Calculating equilibrium fluid compositions

The VESIcal.calculate_equilibrium_fluid_comp() function calculates the composition of a fluid phase in equilibrium with a given silicate melt with known pressure, temperature, and dissolved H2O and CO2 concentrations. The calculation is performed simply by calculating the equilibrium state of the given sample at the given conditions and determining if that melt is fluid saturated. If the melt is saturated, fluid composition and mass are reported back. If the calculation finds that the melt is not saturated at the given pressure and temperature, values of 0.0 will be returned for the H2O and CO2 concentrations in the fluid.

Method structure:

Single sample:

def calculate_equilibrium_fluid_comp(self, sample, temperature, pressure, verbose=False).result

ExcelFile batch process:

def calculate_equilibrium_fluid_comp(self, temperature, pressure, print_status=False, model='MagmaSat')

Required inputs:

sample: Only for single-sample calculations. The composition of a sample. A single sample may be passed as a dictionary of values, with compositions of oxides in wt%.

temperature, pressure: the temperature in degrees C and the pressure in bars. Temperature and pressure of the sample or samples must be passed unless an ExcelFile object with a column for temperature and/or pressure is passed to sample. If, alternatively, the user wishes to use temperature or pressure information in their ExcelFile object, the title of the column containing temperature or pressure data should be passed in quotes (as a string) to temperature or pressure respectively. Note for batch calculations that if temperature or pressure information exists in the ExcelFile but a single numerical value is defined for one or both of these variables, both the original information plus the values used for the calculations will be returned.

Optional inputs:

verbose: Default value is False. If set to True, additional parameters are returned in a dictionary: H2O and CO2 concentrations in the fluid, mass of the fluid in grams, and proportion of the fluid in the system in wt%.

print_status: Only for ExcelFile batch calcualtions. The default value is False. If True is passed, the progress of the calculation will be printed to the terminal.

Calculated outputs: If a single sample is passed to sample, a dictionary with keys ‘H2O’ and ‘CO2’ is returned (plus additional variables ‘FluidMass_grams’ and ‘FluidProportion_wtper’ if verbose is set to True).

If mutliple samples are passed as an ExcelFile object, a pandas DataFrame is returned with sample information plus calculated equilibrium fluid compositions, mass of the fluid in grams, and proportion of the fluid in the system in wt%. Pressure (in bars) and Temperature (in degrees C) columns are always returned.

For an entire dataset

Import a data file

myfile = v.BatchFile('example_data.xlsx')
myfile.get_data()
Output
Label SiO2 TiO2 Al2O3 Fe2O3 Cr2O3 FeO MnO MgO NiO CoO CaO Na2O K2O P2O5 H2O CO2 Press Temp
BT-ex 77.5 0.08 12.5 0.207 0 0.473 0 0.03 0 0 0.43 3.98 4.88 0 5.5 0.05 500 900
TVZMa-ex 78.37 0.13 11.94 0 0 0.99 0.04 0.05 0 0 0.53 3.8 4.14 0 4.06 0.005 600 800
TVZOh-ex 77.9 0.08 12.15 0 0 0.95 0.05 0.06 0 0 0.55 4.05 4.12 0 4.63 0.005 50 900
Oh48-FTIR1-MI1-a 78.27 0.0298 12.02 0 0 0.9828 0.0336 0.0515 0 0 0.4772 4.05 4.09 0 4.214912406 0.004565932 250 950
Oh48-FTIR1-MI1-b 78.27 0.0298 12.02 0 0 0.9828 0.0336 0.0515 0 0 0.4772 4.05 4.09 0 4.005815793 0.004447963 500 1025
Oh48-FTIR1-MI1-IRc 78.27 0.0298 12.02 0 0 0.9828 0.0336 0.0515 0 0 0.4772 4.05 4.09 0 3.885649341 0.004654367 5000 925
Oh50-4.1 77.91 0.0984 12.07 0 0 1.0556 0.0257 0.0999 0 0 0.5216 4.04 4.18 0 4.641842879 0.004565932 1000 862
Oh50-4.2 77.91 0.0984 12.07 0 0 1.0556 0.0257 0.0999 0 0 0.5216 4.04 4.18 0 4.402133476 0.004447963 100 770
Oh49-4.1 77.92 0.0099 12.11 0 0 1.002 0.0672 0.0546 0 0 0.5346 4.01 4.3 0 4.283934433 0.004565932 1000 855
Oh49-4.2 77.92 0.0099 12.11 0 0 1.002 0.0672 0.0546 0 0 0.5346 4.01 4.3 0 4.230532593 0.004447963 500 1000
Ma55-5a.1 77.68 0.0096 12.27 0 0 1.0272 0.0628 0.0342 0 0 0.6064 3.97 4.35 0 4.459767403 0.004654367 5000 1010
Ma57-3b.2 77.9 0.0498 12.07 0 0 1.0844 0.0748 0.0355 0 0 0.4759 4.1 4.21 0 3.712506046 0.004447963 1000 1012
Ma57-3c.1 77.65 0.159 12.28 0 0 0.9769 0.0597 0.0577 0 0 0.5598 4.08 4.18 0.0064 4.443973024 0.004654367 100 885
Ma57-3c.2 77.65 0.159 12.28 0 0 0.9769 0.0597 0.0577 0 0 0.5598 4.08 4.18 0.0064 4.283171078 0.004644523 1000 885

Do the calculation

eqfluid = myfile.calculate_equilibrium_fluid_comp(temperature=900.0, pressure=200.0)
eqfluid
Output
Label SiO2 TiO2 Al2O3 Fe2O3 Cr2O3 FeO MnO MgO NiO CoO CaO Na2O K2O P2O5 H2O CO2 Press Temp XH2O_fl_VESIcal XCO2_fl_VESIcal FluidMass_grams_VESIcal FluidProportion_wt_VESIcal Temperature_C_VESIcal Pressure_bars_VESIcal Model
BT-ex 77.5 0.08 12.5 0.207 0 0.473 0 0.03 0 0 0.43 3.98 4.88 0 5.5 0.05 500 900 0.994834053 0.005165947 3.986275054 3.773809575 900 200 MagmaSat
TVZMa-ex 78.37 0.13 11.94 0 0 0.99 0.04 0.05 0 0 0.53 3.8 4.14 0 4.06 0.005 600 800 0.999177315 0.000822685 2.485280579 2.388429753 900 200 MagmaSat
TVZOh-ex 77.9 0.08 12.15 0 0 0.95 0.05 0.06 0 0 0.55 4.05 4.12 0 4.63 0.005 50 900 0.999330374 0.000669626 3.054137392 2.921361511 900 200 MagmaSat
Oh48-FTIR1-MI1-a 78.27 0.0298 12.02 0 0 0.9828 0.0336 0.0515 0 0 0.4772 4.05 4.09 0 4.214912406 0.004565932 250 950 0.999291182 0.000708818 2.634159297 2.527392668 900 200 MagmaSat
Oh48-FTIR1-MI1-b 78.27 0.0298 12.02 0 0 0.9828 0.0336 0.0515 0 0 0.4772 4.05 4.09 0 4.005815793 0.004447963 500 1025 0.999250021 0.000749979 2.424985394 2.331376798 900 200 MagmaSat
Oh48-FTIR1-MI1-IRc 78.27 0.0298 12.02 0 0 0.9828 0.0336 0.0515 0 0 0.4772 4.05 4.09 0 3.885649341 0.004654367 5000 925 0.999174409 0.000825591 2.305100074 2.218678045 900 200 MagmaSat
Oh50-4.1 77.91 0.0984 12.07 0 0 1.0556 0.0257 0.0999 0 0 0.5216 4.04 4.18 0 4.641842879 0.004565932 1000 862 0.999390924 0.000609076 3.065981339 2.929814999 900 200 MagmaSat
Oh50-4.2 77.91 0.0984 12.07 0 0 1.0556 0.0257 0.0999 0 0 0.5216 4.04 4.18 0 4.402133476 0.004447963 100 770 0.99935516 0.00064484 2.826197637 2.706884102 900 200 MagmaSat
Oh49-4.1 77.92 0.0099 12.11 0 0 1.002 0.0672 0.0546 0 0 0.5346 4.01 4.3 0 4.283934433 0.004565932 1000 855 0.999309688 0.000690312 2.704896361 2.593460539 900 200 MagmaSat
Oh49-4.2 77.92 0.0099 12.11 0 0 1.002 0.0672 0.0546 0 0 0.5346 4.01 4.3 0 4.230532593 0.004447963 500 1000 0.999313979 0.000686021 2.651372313 2.543446733 900 200 MagmaSat
Ma55-5a.1 77.68 0.0096 12.27 0 0 1.0272 0.0628 0.0342 0 0 0.6064 3.97 4.35 0 4.459767403 0.004654367 5000 1010 0.999339999 0.000660001 2.884173755 2.760645319 900 200 MagmaSat
Ma57-3b.2 77.9 0.0498 12.07 0 0 1.0844 0.0748 0.0355 0 0 0.4759 4.1 4.21 0 3.712506046 0.004447963 1000 1012 0.999147512 0.000852488 2.133108653 2.056655488 900 200 MagmaSat
Ma57-3c.1 77.65 0.159 12.28 0 0 0.9769 0.0597 0.0577 0 0 0.5598 4.08 4.18 0.0064 4.443973024 0.004654367 100 885 0.999336974 0.000663026 2.870993807 2.74846379 900 200 MagmaSat
Ma57-3c.2 77.65 0.159 12.28 0 0 0.9769 0.0597 0.0577 0 0 0.5598 4.08 4.18 0.0064 4.283171078 0.004644523 1000 885 0.999299166 0.000700834 2.710219204 2.598551255 900 200 MagmaSat

For a single sample

Extract a single sample from your dataset

SampleName = 'BT-ex'
extracted_bulk_comp = myfile.get_sample_composition(SampleName, asSampleClass=True)

Do the calculation

v.calculate_equilibrium_fluid_comp(sample=extracted_bulk_comp, temperature=900.0, pressure=200.0).result
{'H2O': 0.994834052532463, 'CO2': 0.00516594746753703}