pygcc.solid_solution
Created on Wed Mar 17 16:02:22 2021
@author: adedapo.awolayo and Ben Tutolo, University of Calgary
Copyright (c) 2020 - 2021, Adedapo Awolayo and Ben Tutolo, University of Calgary
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Attributes
Classes
Class to calculate Ideal mixing model for solid-solutions, supporting multisite ideal formalism |
Functions
This function stores the Molecular weight of all elements |
Module Contents
- pygcc.solid_solution.Molecularweight()[source]
This function stores the Molecular weight of all elements
- pygcc.solid_solution.MW
- pygcc.solid_solution.J_to_cal = 4.184
- class pygcc.solid_solution.solidsolution_thermo(**kwargs)[source]
Class to calculate Ideal mixing model for solid-solutions, supporting multisite ideal formalism
- Parameters:
X (float) – End member mineral volume fraction or mole fraction of Mg in clinopyroxene
cpx_Ca (float) – number of moles of Ca in clinopyroxene formula unit (=1 for Di, Hed)
T (float, vector) – Temperature [°C]
P (float, vector) – Pressure [bar]
dbaccessdic (dict) – dictionary of species from direct-access database, optional, default is speq23
solidsolution_type (string) – specify either ‘All’ or ‘plagioclase’ or ‘olivine’ or ‘pyroxene’ or ‘cpx’ or ‘alk-feldspar’ or ‘biotite’ or ‘basalt_glass’ to carry-out all or any solid-solution calculations, default is ‘All’
Dielec_method – specify either ‘FGL97’ or ‘JN91’ or ‘DEW’ as the method to calculate dielectric constant (optional), if not specified default - ‘JN91’
- Returns:
if ‘All’ is specified for solidsolution_type, each case has the follwowing prefix - AnAb_, FoFa_, EnFe_, cpx_, AlkFed_, Biotite_
logK (float, vector) – logarithmic K values
Rxn (dict) – The calculated dictionary of reaction thermodynamic properties has the following properties:
type: solid-solution mineral type, [-]
name: solid-solution name, [K]
formula: solid-solution mineral formula, [-]
MW: Molecular weight, [g/mol]
min: solid-solution mineral properties, [‘formula’, ‘source date’, dG[cal/ml], dH[cal/mol], S[cal/mol-K], V[cm3/mol], a[cal/mol-K], b[10^3 cal/mol/K^2], c[10^-5 cal/mol/K]]
spec: list of species, [-]
coeff: list of corresponding coefficients of species above, [-]
nSpec: Total number of species, [-]
V: Molar volume, [cm3/mol]
source: Source of thermo data, [kJ/kg·K]
elements: list of elements and their total numbers, [-]
Usage
The general usage of water_dielec is as follows:
For water dielectric properties at any Temperature and Pressure:
ss = solidsolution_thermo(T = T, P = P, X = X, solidsolution_type = ‘All’, Dielec_method = ‘JN91’),
where T is temperature in celsius and P is pressure in bar
For water dielectric properties at any Temperature and density :
ss = solidsolution_thermo(T = T, rho = rho, X = X, solidsolution_type = ‘All’, Dielec_method = ‘JN91’),
where T is temperature in celsius and rho is density in kg/m³
For water dielectric properties at any Temperature and Pressure on steam saturation curve:
ss = solidsolution_thermo(T = T, P = ‘T’, X = X, solidsolution_type = ‘All’, Dielec_method = ‘JN91’),
where T is temperature in celsius and P is assigned a quoted character ‘T’ to reflect steam saturation pressure
ss = solidsolution_thermo(P = P, T = ‘P’, X = X, solidsolution_type = ‘All’, Dielec_method = ‘JN91’),
where P is pressure in bar and T is assigned a quoted character ‘P’ to reflect steam saturation temperature
Examples
>>> ss = solidsolution_thermo(cpx_Ca = 0.5, X = 0.85, T = 30, P = 50, solidsolution_type = 'All') >>> ss.AnAb_logK, ss.FoFa_logK, ss.EnFe_logK, ss.cpx_logK, ss.AlkFed_logK, ss.Biotite_logK 21.750590, 26.570902, 10.793372, 20.577152, 3.756792, 32.96363
>>> ss = solidsolution_thermo(cpx_Ca = 1, X = 0.85, T = 50, P = 100, solidsolution_type = 'cpx') >>> ss.logK 18.81769186 >>> ss.Rxn {'type': 'cpx', 'name': 'Di85Hed15', 'formula': 'Ca1.00Mg0.85Fe0.15Si2O6', 'MW': 221.2817, 'min': ['Ca1.00Mg0.85Fe0.15Si2O6', ' R&H95, Stef2001', -711392.7391800061, nan, 37.032850185405415, 66.369, 106.66383843212236, -0.019588551625239002, -16326.4818355, -1052.9517208413004, 5.714746653919693e-06], 'spec': ['H+', 'Ca++', 'Mg++', 'Fe++', 'SiO2(aq)', 'H2O'], 'coeff': [-4, 1.0, 0.85, 0.15, 2, 2], 'nSpec': 6, 'V': 66.369, 'source': ' R&H95, Stef2001', 'elements': ['1.0000', 'Ca', '0.8500', 'Mg', '0.1500', 'Fe', '2.0000', 'Si', '6.0000', 'O']}
>>> ss = solidsolution_thermo(X = 0.5, T = 50, P = 100, solidsolution_type = 'plagioclase') >>> ss.logK 12.62488394 >>> ss.Rxn {'type': 'plag', 'name': 'An50', 'formula': 'Ca0.50Na0.50Al1.50Si2.50O8', 'MW': 270.215145, 'min': ['Ca0.50Na0.50Al1.50Si2.50O8', ' R&H95, Stef2001', -919965.222804649, nan, 47.33081919017781, 100.43, 131.53908221797, -0.022148661567686426, 32265.761759082205, -1316.0836615678777, 7.719885114722753e-06], 'spec': ['H+', 'Al+++', 'Na+', 'Ca++', 'SiO2(aq)', 'H2O'], 'coeff': [-6.0, 1.5, 0.5, 0.5, 2.5, 3.0], 'nSpec': 6, 'V': 100.43, 'source': ' R&H95, Stef2001', 'elements': ['0.5000', 'Ca', '0.5000', 'Na', '1.5000', 'Al', '2.5000', 'Si', '8.0000', 'O']}
- kwargs
- calclogKAnAb(XAn, TC, P, dbaccessdic, rhoEG, Dielec_method=None)[source]
This function calculates thermodynamic properties of solid solution of Plagioclase minerals
- Parameters:
XAn (volume fraction of Anorthite)
TC (temperature [°C])
P (pressure [bar])
dbaccessdic (dictionary of species from direct-access database)
Dielec_method (specify either 'FGL97' or 'JN91' or 'DEW' as the method to calculate) – dielectric constant (optional), if not specified default - ‘JN91’
rhoEG (dictionary of water properties like density (rho),) – dielectric factor (E) and Gibbs Energy (optional)
- Returns:
logKplag (logarithmic K values)
Rxn (dictionary of reaction thermodynamic properties)
Usage
The general usage of calclogKAnAb without the optional argument is as follows:
Not on steam saturation curve:
[logK, Rxn] = calclogKAnAb(XAn, TC, P, dbaccessdic),
where T is temperature in celsius and P is pressure in bar;
On steam saturation curve:
[logK, Rxn] = calclogKAnAb(XAn, TC, ‘T’, dbaccessdic),
where T is temperature in celsius, followed with a quoted char ‘T’
[logK, Rxn] = calclogKAnAb(XAn, P, ‘P’, dbaccessdic),
where P is pressure in bar, followed with a quoted char ‘P’.
Meanwhile, usage with any specific dielectric constant method (‘FGL97’) for condition not on steam saturation curve is as follows. Default method is ‘JN91’
[logK, Rxn] = calclogKAnAb(XAn, TC, P, dbaccessdic, Dielec_method = ‘FGL97’)
- calclogKFoFa(XFo, TC, P, dbaccessdic, rhoEG, Dielec_method=None)[source]
This function calculates thermodynamic properties of solid solution of olivine minerals
- Parameters:
XFo (volume fraction of Forsterite)
TC (temperature [°C])
P (pressure [bar])
dbaccessdic (dictionary of species from direct-access database)
Dielec_method (specify either 'FGL97' or 'JN91' or 'DEW' as the method to calculate) – dielectric constant (optional), if not specified default - ‘JN91’
rhoEG (dictionary of water properties like density (rho),) – dielectric factor (E) and Gibbs Energy (optional)
- Returns:
logK_ol (logarithmic K values)
Rxn (dictionary of reaction thermodynamic properties)
Usage
The general usage of calclogKFoFa without the optional argument is as follows:
Not on steam saturation curve:
[logK, Rxn] = calclogKFoFa(XFo, TC, P, dbaccessdic),
where T is temperature in celsius and P is pressure in bar;
On steam saturation curve:
[logK, Rxn] = calclogKFoFa(XFo, TC, ‘T’, dbaccessdic),
where T is temperature in celsius, followed with a quoted char ‘T’
[logK, Rxn] = calclogKFoFa(XFo, P, ‘P’, dbaccessdic),
where P is pressure in bar, followed with a quoted char ‘P’.
Meanwhile, usage with any specific dielectric constant method (‘FGL97’) for condition not on steam saturation curve is as follows. Default method is ‘JN91’
[logK, Rxn] = calclogKFoFa(XFo, TC, P, dbaccessdic, Dielec_method = ‘FGL97’)
- calclogKEnFe(XEn, TC, P, dbaccessdic, rhoEG, Dielec_method=None)[source]
This function calculates thermodynamic properties of solid solution of pyroxene minerals
- Parameters:
XEn (volume fraction of Enstatite)
TC (temperature [°C])
P (pressure [bar])
dbaccessdic (dictionary of species from direct-access database)
Dielec_method (specify either 'FGL97' or 'JN91' or 'DEW' as the method to calculate) – dielectric constant (optional), if not specified default - ‘JN91’
rhoEG (dictionary of water properties like density (rho),) – dielectric factor (E) and Gibbs Energy (optional)
- Returns:
logK_opx (logarithmic K values)
Rxn (dictionary of reaction thermodynamic properties)
Usage
The general usage of calclogKEnFe without the optional argument is as follows:
Not on steam saturation curve:
[logK, Rxn] = calclogKEnFe(XEn, TC, P, dbaccessdic),
where T is temperature in celsius and P is pressure in bar;
On steam saturation curve:
[logK, Rxn] = calclogKEnFe(XEn, TC, ‘T’, dbaccessdic),
where T is temperature in celsius, followed with a quoted char ‘T’
[logK, Rxn] = calclogKEnFe(XEn, P, ‘P’, dbaccessdic),
where P is pressure in bar, followed with a quoted char ‘P’.
Meanwhile, usage with any specific dielectric constant method (‘FGL97’) for condition not on steam saturation curve is as follows. Default method is ‘JN91’
[logK, Rxn] = calclogKEnFe(XEn, TC, P, dbaccessdic, Dielec_method = ‘FGL97’)
- calclogKDiHedEnFe(nCa, XMg, TC, P, dbaccessdic, rhoEG, Dielec_method=None)[source]
This function calculates thermodynamic properties of solid solution of clinopyroxene minerals (Di, Hed, En and Fe)
- Parameters:
nCa (number of moles of Ca in formula unit (=1 for Di, Hed)) – and must be greater than zero
XMg (mole fraction of Mg) – XMg = (nMg/(nFe + nMg))
TC (temperature [°C])
P (pressure [bar])
dbaccessdic (dictionary of species from direct-access database)
Dielec_method (specify either 'FGL97' or 'JN91' or 'DEW' as the method to calculate) – dielectric constant (optional), if not specified default - ‘JN91’
rhoEG (dictionary of water properties like density (rho),) – dielectric factor (E) and Gibbs Energy (optional)
- Returns:
logK_cpx (logarithmic K values)
Rxn (dictionary of reaction thermodynamic properties)
Usage
The general usage of calclogKDiHedEnFe without the optional argument is as follows:
Not on steam saturation curve:
[logK, Rxn] = calclogKDiHedEnFe(nCa, XMg, TC, P, dbaccessdic),
where T is temperature in celsius and P is pressure in bar;
On steam saturation curve:
[logK, Rxn] = calclogKDiHedEnFe(nCa, XMg, TC, ‘T’, dbaccessdic),
where T is temperature in celsius, followed with a quoted char ‘T’
[logK, Rxn] = calclogKDiHedEnFe(nCa, XMg, P, ‘P’, dbaccessdic),
where P is pressure in bar, followed with a quoted char ‘P’.
Meanwhile, usage with any specific dielectric constant method (‘FGL97’) for condition not on steam saturation curve is as follows. Default method is ‘JN91’
[logK, Rxn] = calclogKDiHedEnFe(nCa, XMg, TC, P, dbaccessdic, Dielec_method = ‘FGL97’)
- calclogKAbOr(XAb, TC, P, dbaccessdic, rhoEG, Dielec_method=None)[source]
This function calculates thermodynamic properties of solid solution of Alkaline-Feldspar minerals
- Parameters:
XAb (volume fraction of Albite)
TC (temperature [°C])
P (pressure [bar])
dbaccessdic (dictionary of species from direct-access database)
Dielec_method (specify either 'FGL97' or 'JN91' or 'DEW' as the method to calculate) – dielectric constant (optional), if not specified default - ‘JN91’
rhoEG (dictionary of water properties like density (rho),) – dielectric factor (E) and Gibbs Energy (optional)
- Returns:
logKalkfeld (logarithmic K values)
Rxn (dictionary of reaction thermodynamic properties)
Usage
The general usage of calclogKAnAb without the optional argument is as follows:
Not on steam saturation curve:
[logK, Rxn] = calclogKAbOr(XAb, TC, P, dbaccessdic),
where T is temperature in celsius and P is pressure in bar;
On steam saturation curve:
[logK, Rxn] = calclogKAbOr(XAb, TC, ‘T’, dbaccessdic),
where T is temperature in celsius, followed with a quoted char ‘T’
[logK, Rxn] = calclogKAbOr(XAb, P, ‘P’, dbaccessdic),
where P is pressure in bar, followed with a quoted char ‘P’.
Meanwhile, usage with any specific dielectric constant method (‘FGL97’) for condition not on steam saturation curve is as follows. Default method is ‘JN91’
[logK, Rxn] = calclogKAbOr(XAb, TC, P, dbaccessdic, Dielec_method = ‘FGL97’)
- calclogKBiotite(XPh, TC, P, dbaccessdic, rhoEG, Dielec_method=None)[source]
This function calculates thermodynamic properties of solid solution of Biotite minerals
- Parameters:
XAb (volume fraction of Albite)
TC (temperature [°C])
P (pressure [bar])
dbaccessdic (dictionary of species from direct-access database)
Dielec_method (specify either 'FGL97' or 'JN91' or 'DEW' as the method to calculate) – dielectric constant (optional), if not specified default - ‘JN91’
rhoEG (dictionary of water properties like density (rho),) – dielectric factor (E) and Gibbs Energy (optional)
- Returns:
logKalkfeld (logarithmic K values)
Rxn (dictionary of reaction thermodynamic properties)
Usage
The general usage of calclogKAnAb without the optional argument is as follows:
Not on steam saturation curve:
[logK, Rxn] = calclogKAbOr(XAb, TC, P, dbaccessdic),
where T is temperature in celsius and P is pressure in bar;
On steam saturation curve:
[logK, Rxn] = calclogKAbOr(XAb, TC, ‘T’, dbaccessdic),
where T is temperature in celsius, followed with a quoted char ‘T’
[logK, Rxn] = calclogKAbOr(XAb, P, ‘P’, dbaccessdic),
where P is pressure in bar, followed with a quoted char ‘P’.
Meanwhile, usage with any specific dielectric constant method (‘FGL97’) for condition not on steam saturation curve is as follows. Default method is ‘JN91’
[logK, Rxn] = calclogKAbOr(XAb, TC, P, dbaccessdic, Dielec_method = ‘FGL97’)
- calclogKBasaltGlass(oxide_wt, TC, P, dbaccessdic, rhoEG, sourcedic=None, specielist=None, Dielec_method=None, FeO_split=0.84, ideal_oxygens=4, glass_name='Basalt_Glass', source='Techer2001')[source]
Calculate logK of basalt glass dissolution by the ideal-mixing model of constituent oxide endmember reactions (Techer et al., 2001 / Oelkers & Gislason, 2001).
- Workflow:
The supplied oxide weight percents are normalized to mass fractions.
If only Fe2O3 is supplied, it is split into FeO + Fe2O3 by
FeO_split(default 0.84, standard MORB convention).Cation moles are recalculated to
ideal_oxygensoxygens per formula unit, then the formula is renormalized so that nSi = 1.The full reaction is
- glass + n_H * H+ ==> n_K K+ + n_Na Na+ + n_Fe Fe++ + n_Ca Ca++
n_Mg Mg++ + n_Al Al+++ + n_Fe3 Fe+++
n_Si SiO2(aq) + n_H2O H2O,
where
n_H = 2*Oxy - 4*n_Siandn_H2O = Oxy - 2*n_Si.logK_glassis assembled as the oxide-mole-fraction-weighted sum of constituent endmember-mineral logK values (Corundum, Lime, Hematite, FeO, K2O, Periclase, Na2O, SiO2(am)) plus the ideal configurational entropy termsum(x_i * log10(x_i)).
- Parameters:
oxide_wt (dict (or anything dict-coercible, e.g. a pandas.Series)) – Oxide composition in weight percent. Recognized oxides: ‘SiO2’, ‘Al2O3’, ‘Fe2O3’, ‘FeO’, ‘MgO’, ‘CaO’, ‘Na2O’, ‘K2O’. Other oxides (TiO2, MnO, P2O5, …) are dropped from the calculation; only the recognized oxides contribute to the mass normalization.
TC (float, vector) – Temperature [°C]
P (float, vector or 'T') – Pressure [bar], or ‘T’ for steam-saturation pressure.
dbaccessdic (dict) – Direct-access database (from db_reader).
rhoEG (dict) – Water property dictionary {‘rho’, ‘E’, ‘dGH2O’}.
sourcedic (dict, optional) – Source-format database (from db_reader). Required to look up the constituent oxide endmember-mineral dissolution reactions. If None, the default GWB thermo_latest + speq23 database is loaded.
specielist (list, optional) – Species list from db_reader (loaded with sourcedic).
Dielec_method (str, optional) – ‘FGL97’ | ‘JN91’ | ‘DEW’. Default ‘JN91’.
FeO_split (float, optional) – Fraction of supplied Fe2O3 to convert to FeO when no FeO is supplied. Default 0.84.
ideal_oxygens (int, optional) – Oxygens per formula unit prior to per-Si normalization. Default 4 (Techer 2001 convention).
glass_name (str, optional) – Written into
Rxn['name']. Default'Basalt_Glass'.source (str, optional) – Written into
Rxn['source']. Default'Techer2001'.
- Returns:
logK (float, vector) – Logarithmic K values at each (TC, P) point.
Rxn (dict) – Reaction thermodynamic properties (formula, MW, V, spec, coeff, nSpec, source, elements, type, name).
Usage
- oxides = {‘SiO2’:47.28, ‘Al2O3’:15.20, ‘Fe2O3’:10.10, ‘MgO’:8.16,
‘CaO’:11.59, ‘Na2O’:2.43, ‘K2O’:0.45}
- ss = solidsolution_thermo(T = [0, 25, 60, 100, 150, 200, 250, 300],
P = ‘T’, solidsolution_type = ‘glass’, glass_oxide_wt = oxides)
ss.logK, ss.Rxn
References
Techer, I., Advocat, T., Lancelot, J., Liotard, J.-M., 2001. Dissolution kinetics of basaltic glasses: control by solution chemistry and protective effect of the alteration film. Chem. Geol. 176, 235-263.
Oelkers, E.H., Gislason, S.R., 2001. The mechanism, rates and consequences of basaltic glass dissolution. Geochim. Cosmochim. Acta 65, 3671-3681.
Wallace, P.J., 2002. Volatiles in submarine basaltic glasses. J. Petrol. partial molar volumes.