Chemical model of seawater
This example closely follows Section 6.1 of Bethke (2007).
A chemical analysis of the major element composition of seawater is shown in Table 1, while Table 2 lists the partial pressures of some gases in the atmosphere.
Table 1: Major element composition of seawater
Species | Concentration (mg.kg) |
---|---|
Cl | 19350 |
Na | 10760 |
SO | 2710 |
Mg | 1290 |
Ca | 411 |
K | 399 |
HCO | 142 |
SiO(aq) | 0.1–10 |
O(aq) | 0.1–6 |
Table 2: Partial pressures of some gases in the atmosphere
Gas | Pressure (atm) |
---|---|
N | 0.78 |
O | 0.21 |
HO | 0.001–0.23 |
CO | 0.0003 |
CH | |
CO | |
SO | |
NO | |
H | |
NO |
In this example, we assume that the CO(g) and O(g) fugacities can be set to approximately their partial pressures. Fixing the CO fugacity fixes pH according to the reaction Fixing the fugacity of O(g) defines the oxidation state according to Finally, assume the extent of the system is 1kg of solvent water along with the solutes dissolved in it.
MOOSE input file: no precipitation
The MOOSE input file contains the usual GeochemicalModelDefinition that specifies the database file to use, and in this case the basis species, equilibrium minerals and equilibrium gases. The flag piecewise_linear_interpolation = true
in order to compare with the Geochemists Workbench result
[UserObjects<<<{"href": "../../../syntax/UserObjects/index.html"}>>>]
[definition]
type = GeochemicalModelDefinition<<<{"description": "User object that parses a geochemical database file, and only retains information relevant to the current geochemical model", "href": "../../../source/userobjects/GeochemicalModelDefinition.html"}>>>
database_file<<<{"description": "The name of the geochemical database file"}>>> = "../../../database/moose_geochemdb.json"
basis_species<<<{"description": "A list of basis components relevant to the aqueous-equilibrium problem. H2O must appear first in this list. These components must be chosen from the 'basis species' in the database, the sorbing sites (if any) and the decoupled redox states that are in disequilibrium (if any)."}>>> = "H2O H+ Cl- Na+ SO4-- Mg++ Ca++ K+ HCO3- SiO2(aq) O2(aq)"
equilibrium_minerals<<<{"description": "A list of minerals that are in equilibrium with the aqueous solution. All members of this list must be in the 'minerals' section of the database file"}>>> = "Antigorite Tremolite Talc Chrysotile Sepiolite Anthophyllite Dolomite Dolomite-ord Huntite Dolomite-dis Magnesite Calcite Aragonite Quartz"
equilibrium_gases<<<{"description": "A list of gases that are in equilibrium with the aqueous solution and can have their fugacities fixed, at least for some time and spatial location. All members of this list must be in the 'gas' section of the database file"}>>> = "O2(g) CO2(g)"
piecewise_linear_interpolation<<<{"description": "If true then use a piecewise-linear interpolation of logK and Debye-Huckel parameters, regardless of the interpolation type specified in the database file. This can be useful for comparing with results using other geochemistry software"}>>> = true # for comparison with GWB
[]
[]
(modules/geochemistry/test/tests/equilibrium_models/seawater_no_precip.i)To instruct MOOSE to find the equilibrium configuration, a TimeIndependentReactionSolver is used:
The swaps are defined.
The fugacity of the gases is fixed as defined above.
The bulk mole number of the aqueous species is also fixed appropriately. The numbers are different than the concentration in mg.kg given in the above table, and may be worked out using the TDS.
The
prevent_precipitation
input prevents any minerals from precipitating when finding the equilibrium configuration, even if their saturation indices are positive.The other flags enable an accurate comparison with the Geochemists Workbench software.
[TimeIndependentReactionSolver<<<{"href": "../../../syntax/TimeIndependentReactionSolver/index.html"}>>>]
model_definition<<<{"description": "The name of the GeochemicalModelDefinition user object (you must create this UserObject yourself)"}>>> = definition
swap_out_of_basis<<<{"description": "Species that should be removed from the model_definition's basis and be replaced with the swap_into_basis species"}>>> = "H+ O2(aq)"
swap_into_basis<<<{"description": "Species that should be removed from the model_definition's equilibrium species list and added to the basis. There must be the same number of species in swap_out_of_basis and swap_into_basis. These swaps are performed before any other computations during the initial problem setup. If this list contains more than one species, the swapping is performed one-by-one, starting with the first pair (swap_out_of_basis[0] and swap_into_basis[0]), then the next pair, etc"}>>> = " CO2(g) O2(g)"
charge_balance_species<<<{"description": "Charge balance will be enforced on this basis species. This means that its bulk mole number may be changed from the initial value you provide in order to ensure charge neutrality. After the initial swaps have been performed, this must be in the basis, and it must be provided with a bulk_composition constraint_meaning."}>>> = "Cl-" # this means the bulk moles of Cl- will not be exactly as set below
constraint_species<<<{"description": "Names of the species that have their values fixed to constraint_value with meaning constraint_meaning. All basis species (after swap_into_basis and swap_out_of_basis) must be provided with exactly one constraint. These constraints are used to compute the configuration during the initial problem setup, and in time-dependent simulations they may be modified as time progresses."}>>> = "H2O CO2(g) O2(g) Cl- Na+ SO4-- Mg++ Ca++ K+ HCO3- SiO2(aq)"
constraint_value<<<{"description": "Numerical value of the containts on constraint_species"}>>> = " 1.0 0.0003162 0.2 0.566 0.485 0.0292 0.055 0.0106 0.0106 0.00241 0.000103"
constraint_meaning<<<{"description": "Meanings of the numerical values given in constraint_value. kg_solvent_water: can only be applied to H2O and units must be kg. bulk_composition: can be applied to all non-gas species, and represents the total amount of the basis species contained as free species as well as the amount found in secondary species but not in kinetic species, and units must be moles or mass (kg, g, etc). bulk_composition_with_kinetic: can be applied to all non-gas species, and represents the total amount of the basis species contained as free species as well as the amount found in secondary species and in kinetic species, and units must be moles or mass (kg, g, etc). free_concentration: can be applied to all basis species that are not gas and not H2O and not mineral, and represents the total amount of the basis species existing freely (not as secondary species) within the solution, and units must be molal or mass_per_kg_solvent. free_mineral: can be applied to all mineral basis species, and represents the total amount of the mineral existing freely (precipitated) within the solution, and units must be moles, mass or cm3. activity and log10activity: can be applied to basis species that are not gas and not mineral and not sorbing sites, and represents the activity of the basis species (recall pH = -log10activity), and units must be dimensionless. fugacity and log10fugacity: can be applied to gases, and units must be dimensionless"}>>> = "kg_solvent_water fugacity fugacity bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition"
constraint_unit<<<{"description": "Units of the numerical values given in constraint_value. Dimensionless: should only be used for activity or fugacity constraints. Moles: mole number. Molal: moles per kg solvent water. kg: kilograms. g: grams. mg: milligrams. ug: micrograms. kg_per_kg_solvent: kilograms per kg solvent water. g_per_kg_solvent: grams per kg solvent water. mg_per_kg_solvent: milligrams per kg solvent water. ug_per_kg_solvent: micrograms per kg solvent water. cm3: cubic centimeters"}>>> = " kg dimensionless dimensionless moles moles moles moles moles moles moles moles"
prevent_precipitation<<<{"description": "Mineral species in this list will be prevented from precipitating, irrespective of their saturation index (unless they are initially in the basis)"}>>> = "Antigorite Tremolite Talc Chrysotile Sepiolite Anthophyllite Dolomite Dolomite-ord Huntite Dolomite-dis Magnesite Calcite Aragonite Quartz"
ramp_max_ionic_strength_initial<<<{"description": "The number of iterations over which to progressively increase the maximum ionic strength (from zero to max_ionic_strength) during the initial equilibration. Increasing this can help in convergence of the Newton process, at the cost of spending more time finding the aqueous configuration."}>>> = 0 # not needed in this simple problem
stoichiometric_ionic_str_using_Cl_only<<<{"description": "If set to true, the stoichiometric ionic strength will be set equal to Cl- molality (or max_ionic_strength if the Cl- molality is too big). This flag overrides ionic_str_using_basis_molality_only"}>>> = true # for comparison with GWB
mol_cutoff<<<{"description": "Information regarding species with molalities less than this amount will not be outputted"}>>> = 1E-5
abs_tol<<<{"description": "If the residual of the algebraic system (measured in mol) is lower than this value, the Newton process (that finds the aqueous configuration) is deemed to have converged"}>>> = 1E-15
precision<<<{"description": "Precision for printing values"}>>> = 7
[]
(modules/geochemistry/test/tests/equilibrium_models/seawater_no_precip.i)MOOSE input file: with precipitation
The MOOSE input file is very similar to the no-precipitation case. There are two differences:
The
prevent_precipitation
input is changed.The swaps are different, as is the initial condition for MgCO. This is discussed in Bethke (2007).
[TimeIndependentReactionSolver<<<{"href": "../../../syntax/TimeIndependentReactionSolver/index.html"}>>>]
model_definition<<<{"description": "The name of the GeochemicalModelDefinition user object (you must create this UserObject yourself)"}>>> = definition
swap_out_of_basis<<<{"description": "Species that should be removed from the model_definition's basis and be replaced with the swap_into_basis species"}>>> = "H+ "
swap_into_basis<<<{"description": "Species that should be removed from the model_definition's equilibrium species list and added to the basis. There must be the same number of species in swap_out_of_basis and swap_into_basis. These swaps are performed before any other computations during the initial problem setup. If this list contains more than one species, the swapping is performed one-by-one, starting with the first pair (swap_out_of_basis[0] and swap_into_basis[0]), then the next pair, etc"}>>> = " MgCO3"
charge_balance_species<<<{"description": "Charge balance will be enforced on this basis species. This means that its bulk mole number may be changed from the initial value you provide in order to ensure charge neutrality. After the initial swaps have been performed, this must be in the basis, and it must be provided with a bulk_composition constraint_meaning."}>>> = "Cl-" # this means the bulk moles of Cl- will not be exactly as set below
constraint_species<<<{"description": "Names of the species that have their values fixed to constraint_value with meaning constraint_meaning. All basis species (after swap_into_basis and swap_out_of_basis) must be provided with exactly one constraint. These constraints are used to compute the configuration during the initial problem setup, and in time-dependent simulations they may be modified as time progresses."}>>> = "H2O MgCO3 O2(aq) Cl- Na+ SO4-- Mg++ Ca++ K+ HCO3- SiO2(aq)"
# to obtain the constraint on MgCO3: (1) run seawater_no_precip.i to obtain the free molality of MgCO3; (2) then running seawater_no_precip.i with MgCO3 in the basis (in place of H+) with that free molality, to obtain the bulk mole number
constraint_value<<<{"description": "Numerical value of the containts on constraint_species"}>>> = " 1.0 0.0001959 0.2151E-3 0.566 0.485 0.0292 0.055 0.0106 0.0106 0.00241 0.000103"
constraint_meaning<<<{"description": "Meanings of the numerical values given in constraint_value. kg_solvent_water: can only be applied to H2O and units must be kg. bulk_composition: can be applied to all non-gas species, and represents the total amount of the basis species contained as free species as well as the amount found in secondary species but not in kinetic species, and units must be moles or mass (kg, g, etc). bulk_composition_with_kinetic: can be applied to all non-gas species, and represents the total amount of the basis species contained as free species as well as the amount found in secondary species and in kinetic species, and units must be moles or mass (kg, g, etc). free_concentration: can be applied to all basis species that are not gas and not H2O and not mineral, and represents the total amount of the basis species existing freely (not as secondary species) within the solution, and units must be molal or mass_per_kg_solvent. free_mineral: can be applied to all mineral basis species, and represents the total amount of the mineral existing freely (precipitated) within the solution, and units must be moles, mass or cm3. activity and log10activity: can be applied to basis species that are not gas and not mineral and not sorbing sites, and represents the activity of the basis species (recall pH = -log10activity), and units must be dimensionless. fugacity and log10fugacity: can be applied to gases, and units must be dimensionless"}>>> = "kg_solvent_water bulk_composition free_concentration bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition"
constraint_unit<<<{"description": "Units of the numerical values given in constraint_value. Dimensionless: should only be used for activity or fugacity constraints. Moles: mole number. Molal: moles per kg solvent water. kg: kilograms. g: grams. mg: milligrams. ug: micrograms. kg_per_kg_solvent: kilograms per kg solvent water. g_per_kg_solvent: grams per kg solvent water. mg_per_kg_solvent: milligrams per kg solvent water. ug_per_kg_solvent: micrograms per kg solvent water. cm3: cubic centimeters"}>>> = " kg moles molal moles moles moles moles moles moles moles moles"
prevent_precipitation<<<{"description": "Mineral species in this list will be prevented from precipitating, irrespective of their saturation index (unless they are initially in the basis)"}>>> = "Dolomite-dis Dolomite-ord"
ramp_max_ionic_strength_initial<<<{"description": "The number of iterations over which to progressively increase the maximum ionic strength (from zero to max_ionic_strength) during the initial equilibration. Increasing this can help in convergence of the Newton process, at the cost of spending more time finding the aqueous configuration."}>>> = 0 # not needed in this simple problem
stoichiometric_ionic_str_using_Cl_only<<<{"description": "If set to true, the stoichiometric ionic strength will be set equal to Cl- molality (or max_ionic_strength if the Cl- molality is too big). This flag overrides ionic_str_using_basis_molality_only"}>>> = true # for comparison with GWB
mol_cutoff<<<{"description": "Information regarding species with molalities less than this amount will not be outputted"}>>> = 1E-5
abs_tol<<<{"description": "If the residual of the algebraic system (measured in mol) is lower than this value, the Newton process (that finds the aqueous configuration) is deemed to have converged"}>>> = 1E-15
[]
[UserObjects<<<{"href": "../../../syntax/UserObjects/index.html"}>>>]
[definition]
type = GeochemicalModelDefinition<<<{"description": "User object that parses a geochemical database file, and only retains information relevant to the current geochemical model", "href": "../../../source/userobjects/GeochemicalModelDefinition.html"}>>>
database_file<<<{"description": "The name of the geochemical database file"}>>> = "../../../database/moose_geochemdb.json"
basis_species<<<{"description": "A list of basis components relevant to the aqueous-equilibrium problem. H2O must appear first in this list. These components must be chosen from the 'basis species' in the database, the sorbing sites (if any) and the decoupled redox states that are in disequilibrium (if any)."}>>> = "H2O H+ Cl- Na+ SO4-- Mg++ Ca++ K+ HCO3- SiO2(aq) O2(aq)"
equilibrium_minerals<<<{"description": "A list of minerals that are in equilibrium with the aqueous solution. All members of this list must be in the 'minerals' section of the database file"}>>> = "Antigorite Tremolite Talc Chrysotile Sepiolite Anthophyllite Dolomite Dolomite-ord Huntite Dolomite-dis Magnesite Calcite Aragonite Quartz"
piecewise_linear_interpolation<<<{"description": "If true then use a piecewise-linear interpolation of logK and Debye-Huckel parameters, regardless of the interpolation type specified in the database file. This can be useful for comparing with results using other geochemistry software"}>>> = true # for comparison with GWB
[]
[]
(modules/geochemistry/test/tests/equilibrium_models/seawater_precip.i)Geochemists Workbench input files
The Geochemists Workbench input file for the precipitation case is:
# React script that is analogous to the seawater_precip.i MOOSE input file
data = thermo.tdat verify
conductivity = conductivity-USGS.dat
temperature = 25 C
H2O = 1 free kg
Cl- = 0.566 mol
balance on Cl-
Na+ = 0.485 mol
SO4-- = 0.0292 mol
Mg++ = 0.055 mol
Ca++ = 0.0106 mol
K+ = 0.0106 mol
HCO3- = 0.00241 mol
SiO2(aq) = 0.000103 mol
O2(aq) = 0.0002151 free molal
swap MgCO3 for H+
MgCO3 = 0.0001959 mol
printout species = long
epsilon = 1e-15
go
(modules/geochemistry/test/tests/equilibrium_models/seawater_precip.rea)The non-precipitation case is similar (see the seawater_no_precip.rea file).
Results
The geochemistry
results mirror those from Geochemists Workbench exactly.
Error and charge-neutrality error
The geochemistry
simulation reports an error of 1.664e-16mol, and that the charge of the solution is 4.467e-17mol.
Solution mass
The solution mass is 1.036kg.
Ionic strength and water activity
The ionic strength is 0.6518mol/kg(solvent water), and the water activity is 0.982.
pH, pe and Eh
After precipitation, the pH is 6.726, the pe is 13.88, and Eh = 0.821V.
Aqueous species distribution
The molalities of the most abundant species results in Table 3.
Table 3: Calculated molalities, activity coefficients and activities of the most abundant species in seawater
Species | Molality (mol.kg) | Activity coeff | loga |
---|---|---|---|
Cl | 0.5503 | 0.6276 | -0.4617 |
Na | 0.4755 | 0.6717 | -0.4957 |
Mg | 0.3160 | -1.9000 | |
SO | 0.1692 | -2.5661 | |
K | 0.6276 | -2.1871 | |
MgCl | 0.6717 | -2.2113 | |
NaSO | 0.6717 | -2.3679 | |
Ca | 0.2465 | -2.8446 | |
MgSO | 1.0 | -2.2385 | |
CaCl | 0.6717 | -2.6063 | |
NaCl | 1.0 | -2.5567 | |
HCO | 0.6906 | -3.0938 | |
CaSO | 1.0 | -3.0908 | |
NaHCO | 1.0 | -3.4463 | |
O(aq) | 1.1734 | -3.5979 | |
KSO | 0.6717 | -3.9007 | |
MgHCO | 0.6717 | -3.9836 | |
SiO(aq) | 1.1735 | -3.9993 | |
KCl | 1.0 | -4.2364 |
Minerals
The saturation indices of the equilibrium solution in Table 3 are greater than 0 for a number of minerals, which suggests some minerals will precipitate. Allowing this to occur, the geochemistry
simulations and the GWB simulations predict that only dolomite and quartz actually precipitate (both codes produce the same precipitated mass) as shown in Table 4.
Table 4: Calculated initial saturation indices, and the final mass of each precipitate in the stable phase assemblage
Mineral | Initial SI | Amount formed (mg) |
---|---|---|
Antigorite | 43 | 0 |
Tremolite | 7.3 | 0 |
Talc | 6.5 | 0 |
Chrysotile | 4.5 | 0 |
Sepiolite | 3.7 | 0 |
Dolomite-ord | 3.3 | 0 |
Dolomite | 3.3 | 50.63 |
Anthophyllite | 3.0 | 0 |
Huntite | 1.8 | 0 |
Dolomite-dis | 1.8 | 0 |
Magnesite | 0.95 | 0 |
Calcite | 0.74 | 0 |
Aragonite | 0.57 | 0 |
Quartz | -0.01 | 1.028 |
References
- Craig M. Bethke.
Geochemical and Biogeochemical Reaction Modeling.
Cambridge University Press, 2 edition, 2007.
doi:10.1017/CBO9780511619670.[BibTeX]