News:

alphaMELTS 2.3 standalone & for MATLAB/Python is now open source and available on GitHub (https://github.com/magmasource/alphaMELTS).
alphaMELTS 1.9 is available at the legacy download and information site.
For news of all MELTS software see the MELTS Facebook page.

Main Menu

Recent posts

#71
alphaMELTS 2 text-menu interface / Re: Assimilation in Alphamelts
Last post by Paula - January 09, 2024, 07:15:38 PM
Hi Brian,

The larger files were generated with easyMelts, and I suggest you play around with easyMelts to get a feel for how the interface for specifying an assimilant and the resulting .melts files are related.

There will be lines that you need to delete or edit for it to work in alphaMELTS. For example, amphibole is separated into clinoamphibole and orthoamphibole in alphaMELTS. Feldspar is separated into plagioclase and alkali-feldspar in alphaMELTS 2. If you delete the line for a particular solution phase then you need to delete the lines for the end members. If you delete only amphibole then tremolite will give issues; delete feldspar then albite will give issues etc. You should be able to delete most of the lines with a 0.0 - that's what isothermal test 1 did.

test 2 illustrates a small extension to the alphaMELTS code for reading in assimilation settings. In the GUI and easyMelts you specify the total mass of assimilated material and the number of increments to divide it into. In alphaMELTS 2 you can also optionally add the same mass of material at each iteration until the run stops for other reasons e.g. it reaches the final temperature. This more closely matches the behavior of alphaMELTS 1.X. The change in the .melts file is to put "Assimilant: Increments 0" (compare with putting '0' for number of iterations in the menu option 4).

Note that in each case "Assimilant mass:" refers to the mass of solid assimilant, which is made up of the mineral phases that you define phase and end member proportions for. The "Liquid mass:" line is for the liquid or bulk assimilant. The .melts output is a bit confusing, as the liquid mass line is early on in the file but the oxide wt% values that belong to the liquid or bulk assimilant are printed last (i.e. the lines at the bottom of the larger .melts files). If alphaMELTS was crashing it might have been a divide by zero error.

test 3 illustrates another extension in alphaMELTS 2 where phase mass proportions are given, in this case 100 wt% olivine (note that the line is "Assimilant: olivine mass 100.00", whereas in test 1 it is "Assimilant: olivine 100.00"). The oxide wt % values then refer to whatever the most recent "mass" line was. You can have multiple solid phases. This replaces the alphaMELTS 1.X assimilation option with separate .melts enrichment files for each mineral phase (see here).

For isothermal conditions bulk assimilation and liquid assimilation are the same and you can just use a "Liquid mass:" line and then make sure the oxide wt % lines come before any other phase mass lines. For isenthalpic or isentropic calculations, it will be the metastable liquid properties that are used to calculate the reference enthalpy or entropy of the assimilant respectively.

There will be an option to equilibrate the assimilant, which will be replacing the binary file assimilant from alphaMELTS 1.9. Instead of having to write out and read in binary files, though, the user will be able to simply swap the (already equilibrated) system and assimilant properties. It's not fully implemented yet, but it's coming soon. So watch this space!

Paula
#72
alphaMELTS 2 text-menu interface / Re: Assimilation in Alphamelts
Last post by balta1701 - December 29, 2023, 02:55:21 PM
How this browser was logged in under my old email address/account I don't know either, but adding a post here so that it goes to updated email address.
#73
alphaMELTS 2 text-menu interface / Assimilation in Alphamelts
Last post by balta - December 29, 2023, 02:51:23 PM
Hi Paula

I'm trying to work through how to do an assimilation calculation in Alphamelts 2. Eventually I'd like to figure out how to do this isentropically but I'm not quite there yet, and am running into an error that I need to understand how to overcome before I start fiddling with those settings.

I've worked through a couple of your workshop files on Assimilation, specifically from the 2022 Goldschmidt page.
https://magmasource.caltech.edu/gitlist/Workshops.git/tree/main/workshop_files/assimilation/

I was able to download and run the assimilation-test files where it assimilates some olivine, and am able to fiddle with the settings to see different amounts of assimilation, etc, those work and return what seem to be reasonable results.

What I would like to do is a more complicated assimilant, I'd like to be able to specify the mineralogy in more detail or ideally just give it a bulk composition that its assimilating at each step.

There are two larger MELTS files shared on that workshop that seem to imply this is possible, https://magmasource.caltech.edu/gitlist/Workshops.git/blob/main/workshop_files/assimilation/MORB-nofO2-isenthalp-assim_fo90.melts for example. This, however is where I run into problems - if I download these files and try them as raw input MELTS files for Alphamelts2, it triggers errors when I input them. For starters, If I tell it to read this file without any edits, it gives me the error "Error during input file read, offending record: assimilant: amphibole 0.00". From there, it starts giving errors and crashing if I try to tell it to run calculations.

If I fiddle with it by say, deleting the amphibole line, then it targets a different line with an error. I got errors on Tremolite, Feldspar, and Albite before I gave up with this method.

If I try to remove all the other assimilants other than the oxides, Alphamelts gave up and crashed on me rather than accepting the MELTS file (specifically it said there was an error with my phase_main_tbl.txt file on that crash).

I'm on an updated Mac, running Alphamelts2, I believe specifically version 2.2 so I'm ever so slightly out of date, I might try updating it next week but I don't think that's the issue right now.

I'm not sure what the error is here but I'd very much appreciate help trying to trace it - the goal would be to have a liquid composition and be able to add in a more complicated solid than just the olivine in an assimilation calculation, and eventually to do that while controlling the system entropy.

Thanks!
#74
Magma chamber processes / Re: Arc Magma Crystallization
Last post by Paula - November 28, 2023, 05:13:58 PM
See here - https://magmasource.caltech.edu/forum/index.php/topic,833.msg1420.html#msg1420

The amphibole project did not turn out as planned, due to Covid. But we are still chipping away at it. And interesting things are coming out of Mark Ghiorso and co-workers MELTS+DEW model, which includes F and Cl that could be key to stabilizing amphibole. E.g:

https://conf.goldschmidt.info/goldschmidt/2023/meetingapp.cgi/Paper/13890

So I guess the advice to watch this space (or spaces) still applies.

Paula
#75
Magma chamber processes / Arc Magma Crystallization
Last post by Bhuvan - November 24, 2023, 10:41:22 AM
Hello all!

I am trying to model crystallization of arc magmas at pressures (1GPa - 0.1GPa) using MELTS v1.2.0 with two objectives:

1. Effect of P and initial H2O on the amphibole crystallization and composition
2. Crystallization of An rich (An98) plagioclase

However, amphibole is never found as a crystallizing phase no matter the initial H2O content or the pressure. Increasing H2O content would lead to water being present as a separate fluid phase, and hence never triggers amphibole due to a decrease in magma's water contents or An rich plagioclase crystallization.

Any leads on solving this?

The primary magma composition is as follows:

Initial Composition: SiO2 49.0555
Initial Composition: TiO2 0.4904
Initial Composition: Al2O3 16.3157
Initial Composition: Fe2O3 1.3472
Initial Composition: Cr2O3: 0.033
Initial Composition: FeO 8.4557
Initial Composition: MgO 9.7423
Initial Composition: CaO 10.2108
Initial Composition: Na2O 1.3813
Initial Composition: K2O 0.0100
Initial Composition: H2O 2.9910
Initial Temperature: 1383
Increment Temperature: -10.00
Mode: Fractionate Solids

Thanks in advance!
#76
alphaMELTS for MATLAB/Python / Re: Unexpected behavior during...
Last post by Paula - October 12, 2023, 05:54:17 PM
Hi! Sorry for the delay again. 

I wasn't entirely able to reproduce the problem (on Windows I got a crash but right at the end when it was pretty much done, on Mac no crash, and on Linux crash early on more similar to what you describe). The variability across platforms is a good indication that it's a memory problem.

I found a couple of issues that I've fixed but can't be sure they are what you were hitting. I'm going to keep testing, combine some other bug fixes and new features, and aim to post an update to GitList some time next week. I'll let you know when it's there.

Thanks for your patience!
Paula
#77
alphaMELTS for MATLAB/Python / Re: KeyError: 'plagioclase_2' ...
Last post by Cambrian - October 03, 2023, 06:10:11 PM
Thank you for your prompt reply, I will try again after all the updates.
#78
alphaMELTS for MATLAB/Python / Re: KeyError: 'plagioclase_2' ...
Last post by Paula - October 02, 2023, 08:39:22 AM
Make sure you have the latest version of everything. The copy of tutorial.py that's up there at the moment has a comment on line 122, so it sounds like you have a slightly older version.

More generally a key error may mean you've tried to get the properties of a phase that isn't present, so you can try wrapping the relevant code in an if block or a try.. except block. The MELTS:libraryAlreadyInitialized message is more of a caution than a critical error.

Paula
#79
alphaMELTS for MATLAB/Python / KeyError: 'plagioclase_2' in M...
Last post by Cambrian - October 02, 2023, 01:24:31 AM
Hi,  Paula:
When I run the tutorial.py file in package folder of MELTS_Matlab/Python, the terminal prompts an error as shown in the following. How should I modify the Python code to make it work.
Thanks.


Current state of the system recorded in _tbl.txt files.
Successful run.  No errors.
Setting calculation mode to rhyolite-MELTS 1.0.2.
MELTS:libraryAlreadyInitialized. Could not re-initialize MELTS library! Please check stderr (console or terminal). If there are any error messages, please save your work and reload Python; otherwise you should be able to continue, with caution...
Traceback (most recent call last):
  File "/home/wanghai/alphaMELTS/MELTS_Matlab-master/package/tutorial.py", line 122, in <module>
    melts.engine.calcEndMemberProperties(phaseList, plag[:, indices])
  File "/home/wanghai/alphaMELTS/MELTS_Matlab-master/package/meltsengine.py", line 890, in calcEndMemberProperties
    self.activity[phaseName] = None
KeyError: 'plagioclase_2'
#80
alphaMELTS for MATLAB/Python / Re: Unexpected behavior during...
Last post by OEM - September 22, 2023, 12:52:55 AM
Here is the code, Paola.
clear all
close all
%% load in appropriate packages and functions
addpath('D:\YandexDisk\Work\_Projects\Melts_for_Matlab\package')
warning('off','all')
P=[4000 4000 4000 4000 4000 4000 4000 4000 4000 8300 8300 8300 9400 9400 9400 9600 9600 9600 9600 9600 9600 9600 9600 9700 9700 9700 9800 9800 9800 2212 2212 2238 2238 2238 2238 2245 2245 2300 2300 2300 2300 2080 2080 2080 2080 2250 2250 2250 2250 2250 2250 2237 2237 2237 2237 3890 3890 3890 3890 2174 2174 2174 2174];
T=[900 900 900 900 900 950 950 950 950 892 892 892 750 750 750 841 841 841 841 841 943 943 943 892 892 892 995 995 995 785 785 776 776 776 776 776 776 834 834 834 834 866 866 866 866 899 899 899 899 899 899 781 781 781 781 780 780 780 780 747 747 778 778];
H2Ogl=[9 8.30000000000000 7.50000000000000 6.70000000000000 4.30000000000000 8.90000000000000 6.60000000000000 5.50000000000000 4.40000000000000 9.30000000000000 8 6.40000000000000 10.5000000000000 9.70000000000000 9 11.7000000000000 10.3000000000000 9.50000000000000 8 7.20000000000000 8.50000000000000 6.80000000000000 6 10.4000000000000 12.9000000000000 8.20000000000000 7.60000000000000 5.30000000000000 4.80000000000000 7 6.69000000000000 7 7 7 7 7 7 7 6.96000000000000 5.76000000000000 6.19000000000000 7 6.21000000000000 5.04000000000000 6.07000000000000 6.96000000000000 6.24000000000000 6.04000000000000 5.66000000000000 3.78000000000000 3.09000000000000 7 7 6.50000000000000 5.83000000000000 8.50000000000000 8.08000000000000 7.27000000000000 8.15000000000000 6.38000000000000 6.35000000000000 7.01000000000000 6.90000000000000];
bulk = zeros(19, 1);
%                       SiO2, TiO2, Al2O3, Fe2O3, Cr2O3, FeO,        MgO
%                         1     2     3      4        5     6          8
bulk([1:6 8 11:16])  = [64.6  0.53   16.5 0.15*4.37 0.000 0.85*4.37  2.39 ...
    5.23 4.49 1.54 0.00   0   0 ];

%, CaO, Na2O, K2O, P2O5, H2O CO2
%    11    12  13   14  15   16
%% carry out equilibrium crystallisation modelling
ptpath=MELTSdynamic(4);
for i=1:numel(P)
        disp([P(i),T(i),H2Ogl(i)]);
        bulk(15)=H2Ogl(i);
        bulk(16)=0;
        bcom=100*bulk/sum(bulk);
        ptpath.engine.set('BulkComposition',bcom);
        ptpath.engine.setSystemProperties("Log fO2 Path","+2FMQ")
        ptpath.engine.pressure = P(i);
        ptpath.engine.temperature = T(i);
        ptpath.engine.calcEquilibriumState(1,1);
        ptpath=ptpath.addNodeAfter;
end

After several successful calculations the system stops responding and matlab closes without report generation. Windows, Matlab R2023a, update 5.
Best
Oleg