Skip to content

gleesonm1/MeltMushRxn

Repository files navigation

MeltMushRxn

Matlab codes use to simulate the chemical and mineralogical influence of melt-mush reaction in magmatic systems.

The code presented in this repository is used to simulate the chemical, mineralogical and thermal consequences of melt-mush reaction and reactive flow in mafic crystal mush systems. The code is used in Gleeson et al. (in review) 'Porosity evolution of mafic crystal mush during reactive flow' - submitted to Nature Communications - to generate all figures and results.

Several different MATLAB scripts and/or packages are presented in this repository and summarised below:

alphaMELTS for MATLAB

The alphaMELTS for MATLAB package written by Paula Antoshechkina contains the relevant thermodynamic models and gibbs free energy minimisation calculations that are used in the MeltMushRxn code. The version of alphaMELTS for MATLAB used in Gleeson et al. (in review) is archived in the "MELTS" folder. For the latest release of alphaMELTS for MATLAB/Python users should contact Paula Antoshechkina directly, or visit https://magmasource.caltech.edu/gitlist/MELTS_Matlab.git/ although we caution that newer versions of alphaMELTS for Python may not be compatible with the MeltMushRxn code.

New MELTS-based functions

To utilze the alphaMELTS for MATLAB package we create three new MATLAB functions to perform MELTS calculations in MATLAB.

  1. Crystallise.m - perform fractional crystallisation calculations in MELTS (using the rhyolite-MELTS v1.0.2 thermodynamic model).
  2. MeltMushRxn_MeltPath.m - calculate the consequence of melt-mush reaction as a single melt phase passes through a mush (i.e., a single melt phase undergos several melt-mush reaction cycles as it reacts with different areas of the magmatic mush).
  3. MeltMushRxn.m - calculate the consequences of melt-mush reaction. This function focuses on a single location within the mush system and calculates the consequence of melt-mush reaction from repeated influx of new magma into the mush system.

MATLAB scripts used in Gleeson et al. (in review)

Parameters.m Generate the input parameters used in the Monte Carlo models. The methods used to generate these input parameters are explained in the method section of Gleeson et al. (in review). The results of these calculations are saved as .mat files (input_scenario1.mat; input_scenario2.mat; input_scenario3.mat).

MushReact_melt_mc.m Monte Carlo approach to simulating melt-mush reaction in mafic crystal mush systems. This code takes the input_scenarioX.mat files and uses the randomly generated input parameters to investigate the influence of various parameters on the porosity evolution of mafic mush sytems.

MeltMush_model1.m Example script using MeltMushRxn_MeltPath.m to simulate the chemical and mineralogical consequences of melt-mush reaction.

MeltMush_model2.m Example script using MeltMushRxn.m to simulate the consequences of melt-mush reaction on the porosity evolution of mafic mush systems where there is repeated input of new magma into the mush.

MeltMush_model_SuppFig2.m Script used to generate Supplementary Figure 2 in Gleeson et al. (in review).

Results of calculations used in Gleeson et al. (in review)

The results generated by the MushReact_melt_mc.m script are saved in the "Results" folder as .xlsx files. A further MATLAB script (PlottingResults.m) is then used to generate the figures displayed in the main text and supplementary information of Gleeson et al. (in review) using these results. Note that these plots require two additional funtions: hexscatter.m (Gordon (2023). hexscatter.m (https://www.mathworks.com/matlabcentral/fileexchange/45639-hexscatter-m), MATLAB Central File Exchange. Retrieved February 9, 2023.); and subaxis.m (Aslak Grinsted (2023). Subaxis - Subplot (https://www.mathworks.com/matlabcentral/fileexchange/3696-subaxis-subplot), MATLAB Central File Exchange. Retrieved February 9, 2023.)

All code was written for MATLAB R2020b, and has been tested, and shown to be compatible with versions up to R2022b.

About

Matlab codes use to simulate the chemical and mineralogical influence of melt-mush reaction in magmatic systems

Resources

Stars

Watchers

Forks

Packages

No packages published