- reactorThe name of the Geochemistry*Reactor user object.
C++ Type:UserObjectName
Controllable:No
Description:The name of the Geochemistry*Reactor user object.
- speciesSpecies name
C++ Type:std::string
Controllable:Yes
Description:Species name
- variableThe name of the variable that this object applies to
C++ Type:AuxVariableName
Controllable:No
Description:The name of the variable that this object applies to
GeochemistryQuantityAux
This AuxKernel is used to extract information from the GeochemistryReactor that underlies geochemistry
models.
A large number of AuxVariables and GeochemistryQuantityAux Kernels are often added automatically using the geochemistry
actions, for instance TimeDependentReactionSolver. However, if users wish to add their own manually, an example (that adds an AuxVariable to measure pH) is
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = 'H+'
reactor = geochemistry_reactor
variable = the_aux
quantity = neglog10a
[]
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/neglog10a.i)Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- boundaryThe list of boundaries (ids or names) from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundaries (ids or names) from the mesh where this object applies
- check_boundary_restrictedTrueWhether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
Default:True
C++ Type:bool
Controllable:No
Description:Whether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
- execute_onLINEAR TIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, PRE_DISPLACE.
Default:LINEAR TIMESTEP_END
C++ Type:ExecFlagEnum
Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, PRE_DISPLACE
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, PRE_DISPLACE.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- quantitymolalType of quantity to output. These are available for non-kinetic species: activity (which equals fugacity for gases); bulk moles (this will be zero if the species is not in the basis); neglog10a = -log10(activity); transported_moles_in_original_basis (will throw an error if species is not in original basis). These are available only for non-kinetic non-minerals: molal = mol(species)/kg(solvent_water); mg_per_kg = mg(species)/kg(solvent_water). These are available only for minerals: free_mg = free mg; free_cm3 = free cubic-centimeters; moles_dumped = moles dumped when special dump and flow-through modes are active. These are available for minerals that host sorbing sites: surface_charge (C/m^2); surface_potential (V). These are available for kinetic species: kinetic_moles; kinetic_additions (-dt * rate = mole increment in kinetic species for this timestep). If quantity=temperature, then the 'species' is ignored and the AuxVariable will record the aqueous solution temperature in degC
Default:molal
C++ Type:MooseEnum
Options:molal, mg_per_kg, free_mg, free_cm3, neglog10a, activity, bulk_moles, surface_charge, surface_potential, temperature, kinetic_moles, kinetic_additions, moles_dumped, transported_moles_in_original_basis
Controllable:No
Description:Type of quantity to output. These are available for non-kinetic species: activity (which equals fugacity for gases); bulk moles (this will be zero if the species is not in the basis); neglog10a = -log10(activity); transported_moles_in_original_basis (will throw an error if species is not in original basis). These are available only for non-kinetic non-minerals: molal = mol(species)/kg(solvent_water); mg_per_kg = mg(species)/kg(solvent_water). These are available only for minerals: free_mg = free mg; free_cm3 = free cubic-centimeters; moles_dumped = moles dumped when special dump and flow-through modes are active. These are available for minerals that host sorbing sites: surface_charge (C/m^2); surface_potential (V). These are available for kinetic species: kinetic_moles; kinetic_additions (-dt * rate = mole increment in kinetic species for this timestep). If quantity=temperature, then the 'species' is ignored and the AuxVariable will record the aqueous solution temperature in degC
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/combined/examples/geochem-porous_flow/geotes_2D/exchanger.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/neglog10a.i)
- (modules/combined/examples/geochem-porous_flow/forge/water_60_to_220degC.i)
- (modules/combined/examples/geochem-porous_flow/forge/water_3.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/except4.i)
- (modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/eqm_model_25_to_92degC.i)
- (modules/geochemistry/test/tests/time_dependent_reactions/seawater_evaporation_flow_through.i)
- (modules/combined/examples/geochem-porous_flow/geotes_2D/exchanger_un_quartz.i)
- (modules/combined/examples/geochem-porous_flow/forge/aquifer_geochemistry.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/except5.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/bulk_moles.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/kinetic_rate.i)
- (modules/geochemistry/test/tests/kinetics/bio_sulfate_1.i)
- (modules/geochemistry/test/tests/kinetics/bio_zoning_conc.i)
- (modules/geochemistry/test/tests/kinetics/bio_death.i)
- (modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/scaling.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/except2.i)
- (modules/combined/examples/geochem-porous_flow/geotes_2D/aquifer_geochemistry.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/temperature.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/free_cm3.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/surface_potential.i)
- (modules/geochemistry/test/tests/time_dependent_reactions/simple_no_action.i)
- (modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/aquifer_geochemistry.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/surface_charge.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/mg_per_kg.i)
- (modules/geochemistry/test/tests/kinetics/bio_arsenate1.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/except3.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/kinetic_moles.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/free_mg.i)
- (modules/geochemistry/test/tests/equilibrium_models/HCl_no_action.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/except1.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/activity.i)
- (modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/exchanger.i)
- (modules/combined/examples/geochem-porous_flow/geotes_2D/aquifer_un_quartz_geochemistry.i)
- (modules/geochemistry/test/tests/kinetics/bio_sulfate_2.i)
- (modules/geochemistry/test/tests/geochemistry_quantity_aux/molal.i)
(modules/geochemistry/test/tests/geochemistry_quantity_aux/neglog10a.i)
#Extract -log10(activity)
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 1.0E-2 1.0E-2"
constraint_meaning = "kg_solvent_water activity bulk_composition"
constraint_unit = "kg dimensionless moles"
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl-"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = 'H+'
reactor = geochemistry_reactor
variable = the_aux
quantity = neglog10a
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "pH"
[]
[]
[Outputs]
csv = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/exchanger.i)
# Model of the heat-exchanger
# The input fluid to the heat exchanger is determined by AuxVariables called production_temperature, production_rate_Na, production_rate_Cl, production_rate_SiO2 and production_rate_H2O. These come from Postprocessors in the porous-flow simulation that measure the fluid composition at the production well.
# Given the input fluid, the exchanger cools/heats the fluid, removing any precipitates, and injects fluid back to the porous-flow simulation at temperature output_temperature and composition given by massfrac_Na, etc.
# In the absence of data concerning Quartz precipitation rates in heat exchangers, do not treat Quartz as kinetic
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[TimeDependentReactionSolver]
model_definition = definition
include_moose_solve = false
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
swap_out_of_basis = "SiO2(aq)"
swap_into_basis = "QuartzLike"
constraint_species = "H2O Na+ Cl- QuartzLike"
constraint_value = " 1.0E-2 0.1E-2 0.1E-2 1E-10"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_mineral"
constraint_unit = " kg moles moles moles"
initial_temperature = 50.0
mode = 4
temperature = 200
cold_temperature = 40.0
source_species_names = 'H2O Na+ Cl- SiO2(aq)'
source_species_rates = 'production_rate_H2O production_rate_Na production_rate_Cl production_rate_SiO2'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
add_aux_pH = false # there is no H+ in this system
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
execute_console_output_on = '' # only CSV output used in this example
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "small_database.json"
basis_species = "H2O SiO2(aq) Na+ Cl-"
equilibrium_minerals = "QuartzLike"
[]
[]
[Executioner]
type = Transient
dt = 1E5
end_time = 2E6 #7.76E6 # 90 days
[]
[AuxVariables]
[production_temperature]
initial_condition = 50 # the production_T Transfer lags one timestep behind for some reason, so give this a reasonable initial condition
[]
[transported_H2O]
[]
[transported_Na]
[]
[transported_Cl]
[]
[transported_SiO2]
[]
[transported_mass]
[]
[massfrac_H2O]
[]
[massfrac_Na]
[]
[massfrac_Cl]
[]
[massfrac_SiO2]
[]
[dumped_quartz]
[]
[production_rate_H2O]
initial_condition = 5.518533e+01 # the production_H2O Transfer lags one timestep behind for some reason (when the porous_flow simulation has finished, it correctly computes mole_rate_H2O_produced, but the Transfer gets the mole_rate_H2O_produced from the previous timestep), so give this a reasonable initial condition, otherwise this will be zero at the start of the simulation!
[]
[production_rate_Na]
initial_condition = 9.943302e-02
[]
[production_rate_Cl]
initial_condition = 9.943302e-02
[]
[production_rate_SiO2]
initial_condition = 2.340931e-04
[]
[]
[AuxKernels]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
[]
[transported_Na]
type = GeochemistryQuantityAux
variable = transported_Na
species = Na+
quantity = transported_moles_in_original_basis
[]
[transported_Cl]
type = GeochemistryQuantityAux
variable = transported_Cl
species = Cl-
quantity = transported_moles_in_original_basis
[]
[transported_SiO2]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = 'transported_H2O transported_Na transported_Cl transported_SiO2'
variable = transported_mass
expression = 'transported_H2O * 18.0152 + transported_Na * 22.9898 + transported_Cl * 35.453 + transported_SiO2 * 60.0843'
[]
[massfrac_H2O]
type = ParsedAux
coupled_variables = 'transported_mass transported_H2O'
variable = massfrac_H2O
expression = '18.0152 * transported_H2O / transported_mass'
[]
[massfrac_Na]
type = ParsedAux
coupled_variables = 'transported_mass transported_Na'
variable = massfrac_Na
expression = '22.9898 * transported_Na / transported_mass'
[]
[massfrac_Cl]
type = ParsedAux
coupled_variables = 'transported_mass transported_Cl'
variable = massfrac_Cl
expression = '35.453 * transported_Cl / transported_mass'
[]
[massfrac_SiO2]
type = ParsedAux
coupled_variables = 'transported_mass transported_SiO2'
variable = massfrac_SiO2
expression = '60.0843 * transported_SiO2 / transported_mass'
[]
[dumped_quartz]
type = GeochemistryQuantityAux
variable = dumped_quartz
species = QuartzLike
quantity = moles_dumped
[]
[]
[Postprocessors]
[cumulative_moles_precipitated_quartz]
type = PointValue
variable = dumped_quartz
[]
[production_temperature]
type = PointValue
variable = production_temperature
[]
[mass_heated_this_timestep]
type = PointValue
variable = transported_mass
[]
[]
[Outputs]
csv = true
[]
[MultiApps]
[porous_flow_sim]
type = TransientMultiApp
input_files = porous_flow.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[injection_T]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'solution_temperature'
variable = 'injection_temperature'
[]
[injection_Na]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Na'
variable = 'injection_rate_massfrac_Na'
[]
[injection_Cl]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Cl'
variable = 'injection_rate_massfrac_Cl'
[]
[injection_SiO2]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_SiO2'
variable = 'injection_rate_massfrac_SiO2'
[]
[injection_H2O]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_H2O'
variable = 'injection_rate_massfrac_H2O'
[]
[production_T]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = production_temperature
variable = production_temperature
[]
[production_Na]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Na_produced
variable = production_rate_Na
[]
[production_Cl]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Cl_produced
variable = production_rate_Cl
[]
[production_SiO2]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_SiO2_produced
variable = production_rate_SiO2
[]
[production_H2O]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_H2O_produced
variable = production_rate_H2O
[]
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/neglog10a.i)
#Extract -log10(activity)
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 1.0E-2 1.0E-2"
constraint_meaning = "kg_solvent_water activity bulk_composition"
constraint_unit = "kg dimensionless moles"
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl-"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = 'H+'
reactor = geochemistry_reactor
variable = the_aux
quantity = neglog10a
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "pH"
[]
[]
[Outputs]
csv = true
[]
(modules/combined/examples/geochem-porous_flow/forge/water_60_to_220degC.i)
# Minerals suggested by Stuart Simmons, but I do not include Laumontite and Zoisite as they are more stable than Anorthite so all Anorthite becomes one of these minerals which contradicts the XRD observations. All minerals are considered in the kinetic models.
# Model of "Water 1" from "Subtask 2C.4.7 Geochemical Modeling SSimmons-VPatil.pdf" subjected to the following:
# (1) The system is equilibrated at 60deg, with pH fixed to 7.5, allowing any precipitates to form. Note that the only minerals present in the system are those mentioned in "Subtask 2C.4.7 Geochemical Modeling SSimmons-VPatil.pdf". If other minerals are present, the results change significantly. Only Quartz and K-feldspar precipitate.
# (2) The system is closed (at time=0), ie the pH is no longer fixed. The Quartz and K-feldspar precipitates are retained
# (3) The temperature is raised to 220degC (during 0<time<=1), allowing any precipitates to form or dissolve. Quartz dissolves entirely, K-feldspar precipitate remains, and Calcite and Phlogopite precipitate. The pH becomes 7.078. Note the use of remove_all_extrapolated_secondary_species = true in the GeochemicalModelDefinition. If the extrapolated secondary species are retained instead, the results are significantly different.
# (4) The following minerals are added (during 1<time<=2): Albite (16.8mol = 44% by weight), Anorthite (1.8mol = 5% by weight), K-feldspar (10.4mol = 29% by weight), Quartz (30.0mol = 18% by weight), Phlogopite (0.48mol = 2% by weight) and Illite (0.52mol = 2% by weight). The mol numbers are approximately what has been measured by XRD, but it is not important to specify the exact composition of the rock (that will be done in the kinetic simulations): what is important here is that there is *some* precipitate.
# (5) The free moles precipitated are Albite 16.38, Anorthite 1.785, K-feldspar 10.68, Quartz 30.82, Phlogopite 0.52, Paragonite 0.44, Calcite 0.0004, Anhydrite 0.0004, Chalcedony 0, Illite 0, Kaolinite 0, Clinochl-7A 0. Calcite is constrained by the initial HCO3- concentration and Anhydrite by the initial SO4-- concentration, and both have only been observed in trace quantities in agreement with this simulation
# (6) The free mole numbers of the basis species that are now in equilibrium with the minerals are extracted, which is the key output of this simulation. Note that the original composition of "Water 1" is largely irrelevant. As mentioned, the HCO3- and SO4-- concentrations constrain Calcite and Anhydrite. Also, adding the minerals causes the pH to change to 6.16.
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = '../../../../geochemistry/database/moose_geochemdb.json'
basis_species = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
equilibrium_minerals = 'Albite Anhydrite Anorthite Calcite Chalcedony Clinochl-7A Illite K-feldspar Kaolinite Quartz Paragonite Phlogopite'
remove_all_extrapolated_secondary_species = true
[]
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = 'Cl-'
constraint_species = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
constraint_value = ' 1.0 3.16E-8 0.12 0.016 0.68E-3 0.0008E-3 3.7E-3 0.004E-3 0.15 0.5E-3 1.4E-3'
constraint_meaning = 'kg_solvent_water activity bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition'
constraint_unit = 'kg dimensionless moles moles moles moles moles moles moles moles moles'
initial_temperature = 60
remove_fixed_activity_name = 'H+'
remove_fixed_activity_time = 0
temperature = 220
source_species_names = 'Albite Anorthite K-feldspar Quartz Phlogopite Illite'
source_species_rates = 'Albite_rate Anorthite_rate K-feldspar_rate Quartz_rate Phlogopite_rate Illite_rate'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
mol_cutoff = 1E-100
execute_console_output_on = 'timestep_end' # only CSV output
solver_info = true
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = 'if(t<1, 1, if(t<1.01, 0.01, 1))'
[]
end_time = 2
[]
[AuxVariables]
[Albite_rate]
[]
[Anorthite_rate]
[]
[K-feldspar_rate]
[]
[Quartz_rate]
[]
[Phlogopite_rate]
[]
[Illite_rate]
[]
[transported_H2O]
[]
[transported_H+]
[]
[transported_Na+]
[]
[transported_K+]
[]
[transported_Ca++]
[]
[transported_Mg++]
[]
[transported_SiO2]
[]
[transported_Al+++]
[]
[transported_Cl-]
[]
[transported_SO4--]
[]
[transported_HCO3-]
[]
[]
[AuxKernels]
[Albite_rate]
type = FunctionAux
variable = Albite_rate
function = 'if(t>1, 16.8, 0)'
execute_on = timestep_begin
[]
[Anorthite_rate]
type = FunctionAux
variable = Anorthite_rate
function = 'if(t>1, 1.8, 0)'
execute_on = timestep_begin
[]
[K-feldspar_rate]
type = FunctionAux
variable = K-feldspar_rate
function = 'if(t>1, 10.4, 0)'
execute_on = timestep_begin
[]
[Quartz_rate]
type = FunctionAux
variable = Quartz_rate
function = 'if(t>1, 30.0, 0)'
execute_on = timestep_begin
[]
[Phlogopite_rate]
type = FunctionAux
variable = Phlogopite_rate
function = 'if(t>1, 0.48, 0)'
execute_on = timestep_begin
[]
[Illite_rate]
type = FunctionAux
variable = Illite_rate
function = 'if(t>1, 0.52, 0)'
execute_on = timestep_begin
[]
[transported_H2O]
type = GeochemistryQuantityAux
species = 'H2O'
variable = transported_H2O
quantity = transported_moles_in_original_basis
[]
[transported_H+]
type = GeochemistryQuantityAux
species = 'H+'
variable = transported_H+
quantity = transported_moles_in_original_basis
[]
[transported_Na+]
type = GeochemistryQuantityAux
species = 'Na+'
variable = transported_Na+
quantity = transported_moles_in_original_basis
[]
[transported_K+]
type = GeochemistryQuantityAux
species = 'K+'
variable = transported_K+
quantity = transported_moles_in_original_basis
[]
[transported_Ca++]
type = GeochemistryQuantityAux
species = 'Ca++'
variable = transported_Ca++
quantity = transported_moles_in_original_basis
[]
[transported_Mg++]
type = GeochemistryQuantityAux
species = 'Mg++'
variable = transported_Mg++
quantity = transported_moles_in_original_basis
[]
[transported_SiO2]
type = GeochemistryQuantityAux
species = 'SiO2(aq)'
variable = transported_SiO2
quantity = transported_moles_in_original_basis
[]
[transported_Al+++]
type = GeochemistryQuantityAux
species = 'Al+++'
variable = transported_Al+++
quantity = transported_moles_in_original_basis
[]
[transported_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
variable = transported_Cl-
quantity = transported_moles_in_original_basis
[]
[transported_SO4--]
type = GeochemistryQuantityAux
species = 'SO4--'
variable = transported_SO4--
quantity = transported_moles_in_original_basis
[]
[transported_HCO3-]
type = GeochemistryQuantityAux
species = 'HCO3-'
variable = transported_HCO3-
quantity = transported_moles_in_original_basis
[]
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[Postprocessors]
[kg_solvent_water]
type = PointValue
variable = kg_solvent_H2O
[]
[free_cm3_Albite]
type = PointValue
variable = free_cm3_Albite
[]
[free_cm3_Anhydrite]
type = PointValue
variable = free_cm3_Anhydrite
[]
[free_cm3_Anorthite]
type = PointValue
variable = free_cm3_Anorthite
[]
[free_cm3_Calcite]
type = PointValue
variable = free_cm3_Calcite
[]
[free_cm3_Chalcedony]
type = PointValue
variable = free_cm3_Chalcedony
[]
[free_cm3_Clinochl-7A]
type = PointValue
variable = free_cm3_Clinochl-7A
[]
[free_cm3_Illite]
type = PointValue
variable = free_cm3_Illite
[]
[free_cm3_K-feldspar]
type = PointValue
variable = free_cm3_K-feldspar
[]
[free_cm3_Kaolinite]
type = PointValue
variable = free_cm3_Kaolinite
[]
[free_cm3_Quartz]
type = PointValue
variable = free_cm3_Quartz
[]
[free_cm3_Paragonite]
type = PointValue
variable = free_cm3_Paragonite
[]
[free_cm3_Phlogopite]
type = PointValue
variable = free_cm3_Phlogopite
[]
[molal_H+]
type = PointValue
variable = molal_H+
[]
[molal_Na+]
type = PointValue
variable = molal_Na+
[]
[molal_K+]
type = PointValue
variable = molal_K+
[]
[molal_Ca++]
type = PointValue
variable = molal_Ca++
[]
[molal_Mg++]
type = PointValue
variable = molal_Mg++
[]
[molal_SiO2]
type = PointValue
variable = molal_SiO2(aq)
[]
[molal_Al+++]
type = PointValue
variable = molal_Al+++
[]
[molal_SO4--]
type = PointValue
variable = molal_SO4--
[]
[molal_HCO3-]
type = PointValue
variable = molal_HCO3-
[]
[bulk_moles_Cl-]
type = PointValue
variable = bulk_moles_Cl-
[]
[transported_H2O]
type = PointValue
variable = transported_H2O
[]
[transported_H+]
type = PointValue
variable = transported_H+
[]
[transported_Na+]
type = PointValue
variable = transported_Na+
[]
[transported_K+]
type = PointValue
variable = transported_K+
[]
[transported_Ca++]
type = PointValue
variable = transported_Ca++
[]
[transported_Mg++]
type = PointValue
variable = transported_Mg++
[]
[transported_SiO2]
type = PointValue
variable = transported_SiO2
[]
[transported_Al+++]
type = PointValue
variable = transported_Al+++
[]
[transported_Cl-]
type = PointValue
variable = transported_Cl-
[]
[transported_SO4--]
type = PointValue
variable = transported_SO4--
[]
[transported_HCO3-]
type = PointValue
variable = transported_HCO3-
[]
[pH]
type = PointValue
variable = pH
[]
[]
[Outputs]
csv = true
[]
(modules/combined/examples/geochem-porous_flow/forge/water_3.i)
# Equilibrium model "Water 3" from "Subtask 2C.4.7 Geochemical Modeling SSimmons-VPatil.pdf". The steps followed in this input file are:
# 1. The initial equilibrium is found at 20degC. This is the temperature at which the bulk composition was measured, and at this temperature most species are supersaturated. However, since measurements were performed in the absence of free minerals, their precipitation must be retarded in some way, so all minerals are prevented from precipitating in the model
# 2. The pH constraint is removed and the system is raised to 70degC, which is the injection temperature. This causes the pH to drop from 6.2 to 6.1, and only Kaolinite and Illite are supersaturated
# 3. The free molality of the species is measured for use in other models
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = '../../../../geochemistry/database/moose_geochemdb.json'
basis_species = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
equilibrium_minerals = 'Albite Anhydrite Anorthite Calcite Chalcedony Clinochl-7A Illite K-feldspar Kaolinite Quartz Paragonite Phlogopite Zoisite Laumontite'
remove_all_extrapolated_secondary_species = true
[]
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = 'Cl-'
constraint_species = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
constraint_value = ' 1.0 6.31E-7 1.32E-4 2.81E-5 7.76E-5 2.88E-5 2.73E-4 3.71E-6 1.41E-5 1.04E-5 3.28E-4'
constraint_meaning = 'kg_solvent_water activity bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition'
constraint_unit = ' kg dimensionless moles moles moles moles moles moles moles moles moles'
prevent_precipitation = 'Albite Anhydrite Anorthite Calcite Chalcedony Clinochl-7A Illite K-feldspar Kaolinite Quartz Paragonite Phlogopite Zoisite Laumontite'
initial_temperature = 20
remove_fixed_activity_name = 'H+'
remove_fixed_activity_time = 0
temperature = 70
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
execute_console_output_on = 'final' # only CSV output needed
[]
[Executioner]
type = Transient
dt = 1
end_time = 1
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[AuxVariables]
[transported_H2O]
[]
[transported_H+]
[]
[transported_Na+]
[]
[transported_K+]
[]
[transported_Ca++]
[]
[transported_Mg++]
[]
[transported_SiO2]
[]
[transported_Al+++]
[]
[transported_Cl-]
[]
[transported_SO4--]
[]
[transported_HCO3-]
[]
[]
[AuxKernels]
[transported_H2O]
type = GeochemistryQuantityAux
species = 'H2O'
variable = transported_H2O
quantity = transported_moles_in_original_basis
[]
[transported_H+]
type = GeochemistryQuantityAux
species = 'H+'
variable = transported_H+
quantity = transported_moles_in_original_basis
[]
[transported_Na+]
type = GeochemistryQuantityAux
species = 'Na+'
variable = transported_Na+
quantity = transported_moles_in_original_basis
[]
[transported_K+]
type = GeochemistryQuantityAux
species = 'K+'
variable = transported_K+
quantity = transported_moles_in_original_basis
[]
[transported_Ca++]
type = GeochemistryQuantityAux
species = 'Ca++'
variable = transported_Ca++
quantity = transported_moles_in_original_basis
[]
[transported_Mg++]
type = GeochemistryQuantityAux
species = 'Mg++'
variable = transported_Mg++
quantity = transported_moles_in_original_basis
[]
[transported_SiO2]
type = GeochemistryQuantityAux
species = 'SiO2(aq)'
variable = transported_SiO2
quantity = transported_moles_in_original_basis
[]
[transported_Al+++]
type = GeochemistryQuantityAux
species = 'Al+++'
variable = transported_Al+++
quantity = transported_moles_in_original_basis
[]
[transported_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
variable = transported_Cl-
quantity = transported_moles_in_original_basis
[]
[transported_SO4--]
type = GeochemistryQuantityAux
species = 'SO4--'
variable = transported_SO4--
quantity = transported_moles_in_original_basis
[]
[transported_HCO3-]
type = GeochemistryQuantityAux
species = 'HCO3-'
variable = transported_HCO3-
quantity = transported_moles_in_original_basis
[]
[]
[Postprocessors]
[temperature]
type = PointValue
variable = 'solution_temperature'
[]
[bulk_Cl]
type = PointValue
variable = 'bulk_moles_Cl-'
[]
[kg_solvent_H2O]
type = PointValue
variable = 'kg_solvent_H2O'
[]
[molal_H+]
type = PointValue
variable = 'molal_H+'
[]
[molal_Na+]
type = PointValue
variable = 'molal_Na+'
[]
[molal_K+]
type = PointValue
variable = 'molal_K+'
[]
[molal_Ca++]
type = PointValue
variable = 'molal_Ca++'
[]
[molal_Mg++]
type = PointValue
variable = 'molal_Mg++'
[]
[molal_SiO2aq]
type = PointValue
variable = 'molal_SiO2(aq)'
[]
[molal_Al+++]
type = PointValue
variable = 'molal_Al+++'
[]
[molal_Cl-]
type = PointValue
variable = 'molal_Cl-'
[]
[molal_SO4--]
type = PointValue
variable = 'molal_SO4--'
[]
[molal_HCO3-]
type = PointValue
variable = 'molal_HCO3-'
[]
[transported_H2O]
type = PointValue
variable = transported_H2O
[]
[transported_H+]
type = PointValue
variable = transported_H+
[]
[transported_Na+]
type = PointValue
variable = transported_Na+
[]
[transported_K+]
type = PointValue
variable = transported_K+
[]
[transported_Ca++]
type = PointValue
variable = transported_Ca++
[]
[transported_Mg++]
type = PointValue
variable = transported_Mg++
[]
[transported_SiO2]
type = PointValue
variable = transported_SiO2
[]
[transported_Al+++]
type = PointValue
variable = transported_Al+++
[]
[transported_Cl-]
type = PointValue
variable = transported_Cl-
[]
[transported_SO4--]
type = PointValue
variable = transported_SO4--
[]
[transported_HCO3-]
type = PointValue
variable = transported_HCO3-
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/except4.i)
#Exception test: inappropriate quantity
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl- Fe+++"
constraint_value = " 1.0 1.0 1.0 1.0"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition"
constraint_unit = "kg moles moles moles"
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl- Fe+++"
equilibrium_minerals = "Fe(OH)3(ppd)_nosorb"
[]
[]
[AuxVariables]
[error]
[]
[]
[AuxKernels]
[error]
type = GeochemistryQuantityAux
species = "Fe(OH)3(ppd)_nosorb"
reactor = geochemistry_reactor
variable = error
quantity = surface_charge
[]
[]
(modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/eqm_model_25_to_92degC.i)
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../../geochemistry/database/moose_geochemdb.json"
basis_species = "H2O H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq)"
equilibrium_minerals = "Siderite Pyrrhotite Dolomite Illite Anhydrite Calcite Quartz K-feldspar Kaolinite Barite Celestite Fluorite Albite Chalcedony Goethite"
[]
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
swap_out_of_basis = "NO3- O2(aq)"
swap_into_basis = " NH3 HS-"
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl- SO4-- HCO3- HS- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NH3"
constraint_value = " 1.0 0.019675774 1.619044933 0.062774835 0.065489838 0.003840583 0.001597755 0.000129719 0.013448104 0.001851471 0.000787867 0.048851229 1.587660615 0.000159781 0.00032108 0.006663119 0.001238987 0.000101944 0.013110503 0.001937302"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition"
constraint_unit = "kg moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles"
prevent_precipitation = "Celestite Fluorite Albite Chalcedony Goethite"
ramp_max_ionic_strength_initial = 0 # not needed in this simple problem
initial_temperature = 25
temperature = 95 # so final temp = 92
execute_console_output_on = 'initial timestep_end'
source_species_names = "Siderite Pyrrhotite Dolomite Illite Anhydrite Calcite Quartz K-feldspar Kaolinite Barite"
source_species_rates = "6.287111422 0.510783201 2.796550921 0.647761624 1.175446234 12.1838956 322.504833 6.613392119 5.96865E-05 8.46449E-05"
solver_info = true
stoichiometric_ionic_str_using_Cl_only = true
[]
[Executioner]
type = Transient
dt = 1
end_time = 1
[]
[AuxVariables]
[total_mineral_volume]
[]
[free_cm3_Kfeldspar] # necessary because of the minus sign in K-feldspar which does not parse correctly in the total_mineral_volume AuxKernel
[]
[]
[AuxKernels]
[free_cm3_Kfeldspar]
type = GeochemistryQuantityAux
reactor = reactor
variable = free_cm3_Kfeldspar
species = 'K-feldspar'
quantity = free_cm3
execute_on = 'timestep_begin timestep_end'
[]
[total_mineral_volume_auxk]
type = ParsedAux
coupled_variables = 'free_cm3_Siderite free_cm3_Pyrrhotite free_cm3_Dolomite free_cm3_Illite free_cm3_Anhydrite free_cm3_Calcite free_cm3_Quartz free_cm3_Kfeldspar free_cm3_Kaolinite free_cm3_Barite free_cm3_Celestite free_cm3_Fluorite free_cm3_Albite free_cm3_Chalcedony free_cm3_Goethite'
expression = 'free_cm3_Siderite + free_cm3_Pyrrhotite + free_cm3_Dolomite + free_cm3_Illite + free_cm3_Anhydrite + free_cm3_Calcite + free_cm3_Quartz + free_cm3_Kfeldspar + free_cm3_Kaolinite + free_cm3_Barite + free_cm3_Celestite + free_cm3_Fluorite + free_cm3_Albite + free_cm3_Chalcedony + free_cm3_Goethite'
variable = total_mineral_volume
execute_on = 'timestep_begin timestep_end'
[]
[]
[Postprocessors]
[total_mineral_volume]
type = PointValue
point = '0 0 0'
variable = total_mineral_volume
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/time_dependent_reactions/seawater_evaporation_flow_through.i)
#Progressively remove H2O until virtually none remains, all the while removing any minerals that precipitate
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ Cl- Ca++ Mg++ Na+ K+ SO4-- HCO3-"
equilibrium_minerals = "Dolomite Epsomite Gypsum Halite Magnesite Mirabilite Sylvite"
equilibrium_gases = "CO2(g)"
piecewise_linear_interpolation = true # for precise agreement with GWB
[]
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
swap_out_of_basis = "H+"
swap_into_basis = " CO2(g)"
charge_balance_species = "Cl-" # this means the bulk moles of Cl- will not be exactly as set below
constraint_species = "H2O CO2(g) Cl- Na+ SO4-- Mg++ Ca++ K+ HCO3-"
constraint_value = " 1.0 -3.5 0.5656 0.4850 0.02924 0.05501 0.01063 0.010576055 0.002412"
constraint_meaning = "kg_solvent_water log10fugacity bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition"
constraint_unit = " kg dimensionless moles moles moles moles moles moles moles"
source_species_names = "H2O"
source_species_rates = "-1.0" # 1kg H2O = 55.51 moles, each time step removes 1 mole
mode = mode
ramp_max_ionic_strength_initial = 0 # not needed in this simple example
stoichiometric_ionic_str_using_Cl_only = true # for precise agreement with GWB
execute_console_output_on = '' # only CSV output for this example
[]
[Functions]
[timestepper]
type = PiecewiseLinear
x = '0 50 55'
y = '5 5 1'
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = timestepper
[]
end_time = 55
[]
[AuxVariables]
[mode]
[]
[dolomite_mol]
[]
[halite_mol]
[]
[gypsum_mol]
[]
[mirabilite_mol]
[]
[]
[AuxKernels]
[mode_auxk]
type = FunctionAux
variable = mode
function = 'if(t<=1.0, 1.0, 2.0)' # initial "dump" then "flow_through"
execute_on = 'timestep_begin'
[]
[dolomite_mol_auxk]
type = GeochemistryQuantityAux
reactor = reactor
variable = dolomite_mol
species = Dolomite
quantity = moles_dumped
[]
[gypsum_mol_auxk]
type = GeochemistryQuantityAux
reactor = reactor
variable = gypsum_mol
species = Gypsum
quantity = moles_dumped
[]
[halite_mol]
type = GeochemistryQuantityAux
reactor = reactor
variable = halite_mol
species = Halite
quantity = moles_dumped
[]
[mirabilite_mol]
type = GeochemistryQuantityAux
reactor = reactor
variable = mirabilite_mol
species = Mirabilite
quantity = moles_dumped
[]
[]
[GlobalParams]
point = '0 0 0'
[]
[Postprocessors]
[solvent_kg]
type = PointValue
variable = 'kg_solvent_H2O'
[]
[dolomite_mol]
type = PointValue
variable = dolomite_mol
[]
[gypsum_mol]
type = PointValue
variable = 'gypsum_mol'
[]
[halite_mol]
type = PointValue
variable = 'halite_mol'
[]
[mirabilite_mol]
type = PointValue
variable = 'mirabilite_mol'
[]
[]
[Outputs]
csv = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/exchanger_un_quartz.i)
# Model of the heat-exchanger
# The input fluid to the heat exchanger is determined by AuxVariables called production_temperature, production_rate_Na, production_rate_Cl, production_rate_SiO2 and production_rate_H2O. These come from Postprocessors in the porous-flow simulation that measure the fluid composition at the production well.
# Given the input fluid, the exchanger cools/heats the fluid, removing any precipitates, and injects fluid back to the porous-flow simulation at temperature output_temperature and composition given by massfrac_Na, etc.
# In the absence of data concerning Quartz precipitation rates in heat exchangers, do not treat Quartz as kinetic
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[TimeDependentReactionSolver]
model_definition = definition
include_moose_solve = false
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
swap_out_of_basis = "SiO2(aq)"
swap_into_basis = "QuartzUnlike"
constraint_species = "H2O Na+ Cl- QuartzUnlike"
constraint_value = " 1.0E-2 0.1E-2 0.1E-2 1E-10"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_mineral"
constraint_unit = " kg moles moles moles"
initial_temperature = 50.0
mode = 4
temperature = 200
cold_temperature = 40.0
source_species_names = 'H2O Na+ Cl- SiO2(aq)'
source_species_rates = 'production_rate_H2O production_rate_Na production_rate_Cl production_rate_SiO2'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
add_aux_pH = false # there is no H+ in this system
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
execute_console_output_on = '' # only CSV output used in this example
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "small_database.json"
basis_species = "H2O SiO2(aq) Na+ Cl-"
equilibrium_minerals = "QuartzUnlike"
[]
[]
[Executioner]
type = Transient
dt = 1E5
end_time = 2E6 #7.76E6 # 90 days
[]
[AuxVariables]
[production_temperature]
initial_condition = 50 # the production_T Transfer lags one timestep behind for some reason, so give this a reasonable initial condition
[]
[transported_H2O]
[]
[transported_Na]
[]
[transported_Cl]
[]
[transported_SiO2]
[]
[transported_mass]
[]
[massfrac_H2O]
[]
[massfrac_Na]
[]
[massfrac_Cl]
[]
[massfrac_SiO2]
[]
[dumped_quartz]
[]
[production_rate_H2O]
initial_condition = 5.518533e+01 # the production_H2O Transfer lags one timestep behind for some reason (when the porous_flow simulation has finished, it correctly computes mole_rate_H2O_produced, but the Transfer gets the mole_rate_H2O_produced from the previous timestep), so give this a reasonable initial condition, otherwise this will be zero at the start of the simulation!
[]
[production_rate_Na]
initial_condition = 9.943302e-02
[]
[production_rate_Cl]
initial_condition = 9.943302e-02
[]
[production_rate_SiO2]
initial_condition = 2.340931e-04
[]
[]
[AuxKernels]
[transported_H2O]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
[]
[transported_Na]
type = GeochemistryQuantityAux
variable = transported_Na
species = Na+
quantity = transported_moles_in_original_basis
[]
[transported_Cl]
type = GeochemistryQuantityAux
variable = transported_Cl
species = Cl-
quantity = transported_moles_in_original_basis
[]
[transported_SiO2]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
[]
[transported_mass]
type = ParsedAux
coupled_variables = 'transported_H2O transported_Na transported_Cl transported_SiO2'
variable = transported_mass
expression = 'transported_H2O * 18.0152 + transported_Na * 22.9898 + transported_Cl * 35.453 + transported_SiO2 * 60.0843'
[]
[massfrac_H2O]
type = ParsedAux
coupled_variables = 'transported_mass transported_H2O'
variable = massfrac_H2O
expression = '18.0152 * transported_H2O / transported_mass'
[]
[massfrac_Na]
type = ParsedAux
coupled_variables = 'transported_mass transported_Na'
variable = massfrac_Na
expression = '22.9898 * transported_Na / transported_mass'
[]
[massfrac_Cl]
type = ParsedAux
coupled_variables = 'transported_mass transported_Cl'
variable = massfrac_Cl
expression = '35.453 * transported_Cl / transported_mass'
[]
[massfrac_SiO2]
type = ParsedAux
coupled_variables = 'transported_mass transported_SiO2'
variable = massfrac_SiO2
expression = '60.0843 * transported_SiO2 / transported_mass'
[]
[dumped_quartz]
type = GeochemistryQuantityAux
variable = dumped_quartz
species = QuartzUnlike
quantity = moles_dumped
[]
[]
[Postprocessors]
[cumulative_moles_precipitated_quartz]
type = PointValue
variable = dumped_quartz
[]
[production_temperature]
type = PointValue
variable = production_temperature
[]
[mass_heated_this_timestep]
type = PointValue
variable = transported_mass
[]
[]
[Outputs]
csv = true
[]
[MultiApps]
[porous_flow_sim]
type = TransientMultiApp
input_files = porous_flow.i
cli_args = 'MultiApps/react/input_files=aquifer_un_quartz_geochemistry.i'
execute_on = 'timestep_end'
[]
[]
[Transfers]
[injection_T]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'solution_temperature'
variable = 'injection_temperature'
[]
[injection_Na]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Na'
variable = 'injection_rate_massfrac_Na'
[]
[injection_Cl]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Cl'
variable = 'injection_rate_massfrac_Cl'
[]
[injection_SiO2]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_SiO2'
variable = 'injection_rate_massfrac_SiO2'
[]
[injection_H2O]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_H2O'
variable = 'injection_rate_massfrac_H2O'
[]
[production_T]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = production_temperature
variable = production_temperature
[]
[production_Na]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Na_produced
variable = production_rate_Na
[]
[production_Cl]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Cl_produced
variable = production_rate_Cl
[]
[production_SiO2]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_SiO2_produced
variable = production_rate_SiO2
[]
[production_H2O]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_H2O_produced
variable = production_rate_H2O
[]
[]
(modules/combined/examples/geochem-porous_flow/forge/aquifer_geochemistry.i)
# Simulates geochemistry in the aquifer. This input file may be run in standalone fashion, which will study the natural kinetically-controlled mineral changes in the same way as natural_reservoir.i. To simulate the FORGE injection scenario, run the porous_flow.i simulation which couples to this input file using MultiApps.
# This file receives pf_rate_H pf_rate_Na pf_rate_K pf_rate_Ca pf_rate_Mg pf_rate_SiO2 pf_rate_Al pf_rate_Cl pf_rate_SO4 pf_rate_HCO3 pf_rate_H2O and temperature as AuxVariables from porous_flow.i
# The pf_rate quantities are kg/s changes of fluid-component mass at each node, but the geochemistry module expects rates-of-changes of moles at every node. Secondly, since this input file considers just 1 litre of aqueous solution at every node, the nodal_void_volume is used to convert pf_rate_* into rate_*_per_1l, which is measured in mol/s/1_litre_of_aqueous_solution.
# This file sends massfrac_H massfrac_Na massfrac_K massfrac_Ca massfrac_Mg massfrac_SiO2 massfrac_Al massfrac_Cl massfrac_SO4 massfrac_HCO3 to porous_flow.i. These are computed from the corresponding transported_* quantities.
# The results depend on the kinetic rates used and these are recognised to be poorly constrained by experiment
[UserObjects]
[rate_Albite]
type = GeochemistryKineticRate
kinetic_species_name = Albite
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 69.8E3
one_over_T0 = 0.003354
[]
[rate_Anhydrite]
type = GeochemistryKineticRate
kinetic_species_name = Anhydrite
intrinsic_rate_constant = 1.0E-7
multiply_by_mass = true
area_quantity = 10
activation_energy = 14.3E3
one_over_T0 = 0.003354
[]
[rate_Anorthite]
type = GeochemistryKineticRate
kinetic_species_name = Anorthite
intrinsic_rate_constant = 1.0E-13
multiply_by_mass = true
area_quantity = 10
activation_energy = 17.8E3
one_over_T0 = 0.003354
[]
[rate_Calcite]
type = GeochemistryKineticRate
kinetic_species_name = Calcite
intrinsic_rate_constant = 1.0E-10
multiply_by_mass = true
area_quantity = 10
activation_energy = 23.5E3
one_over_T0 = 0.003354
[]
[rate_Chalcedony]
type = GeochemistryKineticRate
kinetic_species_name = Chalcedony
intrinsic_rate_constant = 1.0E-18
multiply_by_mass = true
area_quantity = 10
activation_energy = 90.1E3
one_over_T0 = 0.003354
[]
[rate_Clinochl-7A]
type = GeochemistryKineticRate
kinetic_species_name = Clinochl-7A
intrinsic_rate_constant = 1.0E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 88.0E3
one_over_T0 = 0.003354
[]
[rate_Illite]
type = GeochemistryKineticRate
kinetic_species_name = Illite
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 29E3
one_over_T0 = 0.003354
[]
[rate_K-feldspar]
type = GeochemistryKineticRate
kinetic_species_name = K-feldspar
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 38E3
one_over_T0 = 0.003354
[]
[rate_Kaolinite]
type = GeochemistryKineticRate
kinetic_species_name = Kaolinite
intrinsic_rate_constant = 1E-18
multiply_by_mass = true
area_quantity = 10
activation_energy = 22.2E3
one_over_T0 = 0.003354
[]
[rate_Quartz]
type = GeochemistryKineticRate
kinetic_species_name = Quartz
intrinsic_rate_constant = 1E-18
multiply_by_mass = true
area_quantity = 10
activation_energy = 90.1E3
one_over_T0 = 0.003354
[]
[rate_Paragonite]
type = GeochemistryKineticRate
kinetic_species_name = Paragonite
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 22E3
one_over_T0 = 0.003354
[]
[rate_Phlogopite]
type = GeochemistryKineticRate
kinetic_species_name = Phlogopite
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 22E3
one_over_T0 = 0.003354
[]
[rate_Laumontite]
type = GeochemistryKineticRate
kinetic_species_name = Laumontite
intrinsic_rate_constant = 1.0E-15
multiply_by_mass = true
area_quantity = 10
activation_energy = 17.8E3
one_over_T0 = 0.003354
[]
[rate_Zoisite]
type = GeochemistryKineticRate
kinetic_species_name = Zoisite
intrinsic_rate_constant = 1E-16
multiply_by_mass = true
area_quantity = 10
activation_energy = 66.1E3
one_over_T0 = 0.003354
[]
[definition]
type = GeochemicalModelDefinition
database_file = '../../../../geochemistry/database/moose_geochemdb.json'
basis_species = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
remove_all_extrapolated_secondary_species = true
kinetic_minerals = 'Albite Anhydrite Anorthite Calcite Chalcedony Clinochl-7A Illite K-feldspar Kaolinite Quartz Paragonite Phlogopite Zoisite Laumontite'
kinetic_rate_descriptions = 'rate_Albite rate_Anhydrite rate_Anorthite rate_Calcite rate_Chalcedony rate_Clinochl-7A rate_Illite rate_K-feldspar rate_Kaolinite rate_Quartz rate_Paragonite rate_Phlogopite rate_Zoisite rate_Laumontite'
[]
[nodal_void_volume_uo]
type = NodalVoidVolume
porosity = porosity
execute_on = 'initial timestep_end' # "initial" means this is evaluated properly for the first timestep
[]
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = 'Cl-'
constraint_species = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
# Following numbers are from water_60_to_220degC_out.csv
constraint_value = ' 1.0006383866109 9.5165072498215e-07 0.100020379171 0.0059389061065 0.011570884507621 4.6626763057447e-06 0.0045110404925255 5.8096968688789e-17 0.13500708594394 6.6523540147676e-05 7.7361407898089e-05'
constraint_meaning = 'kg_solvent_water free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration bulk_composition free_concentration free_concentration'
constraint_unit = ' kg molal molal molal molal molal molal molal moles molal molal'
initial_temperature = 220
temperature = temperature
kinetic_species_name = ' Albite Anorthite K-feldspar Quartz Phlogopite Paragonite Calcite Anhydrite Chalcedony Illite Kaolinite Clinochl-7A Zoisite Laumontite'
kinetic_species_initial_value = '4.324073236492E+02 4.631370307325E+01 2.685015418378E+02 7.720095013956E+02 1.235192062541E+01 7.545461404965E-01 4.234651808835E-04 4.000485907930E-04 4.407616361072E+00 1.342524904876E+01 1.004823151125E+00 4.728132387707E-01 7.326007326007E-01 4.818116116598E-01'
kinetic_species_unit = ' moles moles moles moles moles moles moles moles moles moles moles moles moles moles'
evaluate_kinetic_rates_always = true # otherwise will easily "run out" of dissolving species
source_species_names = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
source_species_rates = 'rate_H2O_per_1l rate_H_per_1l rate_Na_per_1l rate_K_per_1l rate_Ca_per_1l rate_Mg_per_1l rate_SiO2_per_1l rate_Al_per_1l rate_Cl_per_1l rate_SO4_per_1l rate_HCO3_per_1l'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
execute_console_output_on = ''
add_aux_molal = false # save some memory and reduce variables in output exodus
add_aux_mg_per_kg = false # save some memory and reduce variables in output exodus
add_aux_free_mg = false # save some memory and reduce variables in output exodus
add_aux_activity = false # save some memory and reduce variables in output exodus
add_aux_bulk_moles = false # save some memory and reduce variables in output exodus
adaptive_timestepping = true
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 15
ny = 10
xmin = -100
xmax = 200
ymin = -100
ymax = 100
[]
[injection_node]
input = gen
type = ExtraNodesetGenerator
new_boundary = injection_node
coord = '0 0 0'
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = 'max(1E6, 0.3 * t)'
[]
end_time = 4E12
[]
[AuxVariables]
[temperature]
initial_condition = 220.0
[]
[porosity]
initial_condition = 0.01
[]
[nodal_void_volume]
[]
[free_cm3_Kfeldspar] # necessary because of the minus sign in K-feldspar which does not parse correctly in the porosity AuxKernel
[]
[free_cm3_Clinochl7A] # necessary because of the minus sign in Clinochl-7A which does not parse correctly in the porosity AuxKernel
[]
[pf_rate_H] # change in H mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Na]
[]
[pf_rate_K]
[]
[pf_rate_Ca]
[]
[pf_rate_Mg]
[]
[pf_rate_SiO2]
[]
[pf_rate_Al]
[]
[pf_rate_Cl]
[]
[pf_rate_SO4]
[]
[pf_rate_HCO3]
[]
[pf_rate_H2O] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[rate_H_per_1l]
[]
[rate_Na_per_1l]
[]
[rate_K_per_1l]
[]
[rate_Ca_per_1l]
[]
[rate_Mg_per_1l]
[]
[rate_SiO2_per_1l]
[]
[rate_Al_per_1l]
[]
[rate_Cl_per_1l]
[]
[rate_SO4_per_1l]
[]
[rate_HCO3_per_1l]
[]
[rate_H2O_per_1l]
[]
[transported_H]
[]
[transported_Na]
[]
[transported_K]
[]
[transported_Ca]
[]
[transported_Mg]
[]
[transported_SiO2]
[]
[transported_Al]
[]
[transported_Cl]
[]
[transported_SO4]
[]
[transported_HCO3]
[]
[transported_H2O]
[]
[transported_mass]
[]
[massfrac_H]
[]
[massfrac_Na]
[]
[massfrac_K]
[]
[massfrac_Ca]
[]
[massfrac_Mg]
[]
[massfrac_SiO2]
[]
[massfrac_Al]
[]
[massfrac_Cl]
[]
[massfrac_SO4]
[]
[massfrac_HCO3]
[]
[massfrac_H2O]
[]
[]
[AuxKernels]
[free_cm3_Kfeldspar]
type = GeochemistryQuantityAux
variable = free_cm3_Kfeldspar
species = 'K-feldspar'
quantity = free_cm3
execute_on = 'timestep_begin timestep_end'
[]
[free_cm3_Clinochl7A]
type = GeochemistryQuantityAux
variable = free_cm3_Clinochl7A
species = 'Clinochl-7A'
quantity = free_cm3
execute_on = 'timestep_begin timestep_end'
[]
[porosity_auxk]
type = ParsedAux
coupled_variables = 'free_cm3_Albite free_cm3_Anhydrite free_cm3_Anorthite free_cm3_Calcite free_cm3_Chalcedony free_cm3_Clinochl7A free_cm3_Illite free_cm3_Kfeldspar free_cm3_Kaolinite free_cm3_Quartz free_cm3_Paragonite free_cm3_Phlogopite free_cm3_Zoisite free_cm3_Laumontite'
expression = '1000.0 / (1000.0 + free_cm3_Albite + free_cm3_Anhydrite + free_cm3_Anorthite + free_cm3_Calcite + free_cm3_Chalcedony + free_cm3_Clinochl7A + free_cm3_Illite + free_cm3_Kfeldspar + free_cm3_Kaolinite + free_cm3_Quartz + free_cm3_Paragonite + free_cm3_Phlogopite + free_cm3_Zoisite + free_cm3_Laumontite)'
variable = porosity
execute_on = 'timestep_end'
[]
[nodal_void_volume_auxk]
type = NodalVoidVolumeAux
variable = nodal_void_volume
nodal_void_volume_uo = nodal_void_volume_uo
execute_on = 'initial timestep_end' # "initial" to ensure it is properly evaluated for the first timestep
[]
[rate_H_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H nodal_void_volume'
variable = rate_H_per_1l
expression = 'pf_rate_H / 1.0079 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Na_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Na nodal_void_volume'
variable = rate_Na_per_1l
expression = 'pf_rate_Na / 22.9898 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_K_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_K nodal_void_volume'
variable = rate_K_per_1l
expression = 'pf_rate_K / 39.0983 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Ca_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Ca nodal_void_volume'
variable = rate_Ca_per_1l
expression = 'pf_rate_Ca / 40.08 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Mg_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Mg nodal_void_volume'
variable = rate_Mg_per_1l
expression = 'pf_rate_Mg / 24.305 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_SiO2_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_SiO2 nodal_void_volume'
variable = rate_SiO2_per_1l
expression = 'pf_rate_SiO2 / 60.0843 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Al_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Al nodal_void_volume'
variable = rate_Al_per_1l
expression = 'pf_rate_Al / 26.9815 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Cl_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Cl nodal_void_volume'
variable = rate_Cl_per_1l
expression = 'pf_rate_Cl / 35.453 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_SO4_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_SO4 nodal_void_volume'
variable = rate_SO4_per_1l
expression = 'pf_rate_SO4 / 96.0576 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_HCO3_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_HCO3 nodal_void_volume'
variable = rate_HCO3_per_1l
expression = 'pf_rate_HCO3 / 61.0171 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_H2O_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H2O nodal_void_volume'
variable = rate_H2O_per_1l
expression = 'pf_rate_H2O / 18.01801802 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[transported_H_auxk]
type = GeochemistryQuantityAux
variable = transported_H
species = 'H+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Na_auxk]
type = GeochemistryQuantityAux
variable = transported_Na
species = 'Na+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_K_auxk]
type = GeochemistryQuantityAux
variable = transported_K
species = 'K+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Ca_auxk]
type = GeochemistryQuantityAux
variable = transported_Ca
species = 'Ca++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Mg_auxk]
type = GeochemistryQuantityAux
variable = transported_Mg
species = 'Mg++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_SiO2_auxk]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Al_auxk]
type = GeochemistryQuantityAux
variable = transported_Al
species = 'Al+++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Cl_auxk]
type = GeochemistryQuantityAux
variable = transported_Cl
species = 'Cl-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_SO4_auxk]
type = GeochemistryQuantityAux
variable = transported_SO4
species = 'SO4--'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_HCO3_auxk]
type = GeochemistryQuantityAux
variable = transported_HCO3
species = 'HCO3-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
variable = transported_H2O
species = 'H2O'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = ' transported_H transported_Na transported_K transported_Ca transported_Mg transported_SiO2 transported_Al transported_Cl transported_SO4 transported_HCO3 transported_H2O'
variable = transported_mass
expression = 'transported_H * 1.0079 + transported_Cl * 35.453 + transported_SO4 * 96.0576 + transported_HCO3 * 61.0171 + transported_SiO2 * 60.0843 + transported_Al * 26.9815 + transported_Ca * 40.08 + transported_Mg * 24.305 + transported_K * 39.0983 + transported_Na * 22.9898 + transported_H2O * 18.01801802'
execute_on = 'timestep_end'
[]
[massfrac_H_auxk]
type = ParsedAux
coupled_variables = 'transported_H transported_mass'
variable = massfrac_H
expression = 'transported_H * 1.0079 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Na_auxk]
type = ParsedAux
coupled_variables = 'transported_Na transported_mass'
variable = massfrac_Na
expression = 'transported_Na * 22.9898 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_K_auxk]
type = ParsedAux
coupled_variables = 'transported_K transported_mass'
variable = massfrac_K
expression = 'transported_K * 39.0983 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Ca_auxk]
type = ParsedAux
coupled_variables = 'transported_Ca transported_mass'
variable = massfrac_Ca
expression = 'transported_Ca * 40.08 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Mg_auxk]
type = ParsedAux
coupled_variables = 'transported_Mg transported_mass'
variable = massfrac_Mg
expression = 'transported_Mg * 24.305 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SiO2_auxk]
type = ParsedAux
coupled_variables = 'transported_SiO2 transported_mass'
variable = massfrac_SiO2
expression = 'transported_SiO2 * 60.0843 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Al_auxk]
type = ParsedAux
coupled_variables = 'transported_Al transported_mass'
variable = massfrac_Al
expression = 'transported_Al * 26.9815 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Cl_auxk]
type = ParsedAux
coupled_variables = 'transported_Cl transported_mass'
variable = massfrac_Cl
expression = 'transported_Cl * 35.453 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SO4_auxk]
type = ParsedAux
coupled_variables = 'transported_SO4 transported_mass'
variable = massfrac_SO4
expression = 'transported_SO4 * 96.0576 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_HCO3_auxk]
type = ParsedAux
coupled_variables = 'transported_HCO3 transported_mass'
variable = massfrac_HCO3
expression = 'transported_HCO3 * 61.0171 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_H2O_auxk]
type = ParsedAux
coupled_variables = 'transported_H2O transported_mass'
variable = massfrac_H2O
expression = 'transported_H2O * 18.01801802 / transported_mass'
execute_on = 'timestep_end'
[]
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[Postprocessors]
[temperature]
type = PointValue
variable = 'solution_temperature'
[]
[porosity]
type = PointValue
variable = porosity
[]
[solution_temperature]
type = PointValue
variable = solution_temperature
[]
[massfrac_H]
type = PointValue
variable = massfrac_H
[]
[massfrac_Na]
type = PointValue
variable = massfrac_Na
[]
[massfrac_K]
type = PointValue
variable = massfrac_K
[]
[massfrac_Ca]
type = PointValue
variable = massfrac_Ca
[]
[massfrac_Mg]
type = PointValue
variable = massfrac_Mg
[]
[massfrac_SiO2]
type = PointValue
variable = massfrac_SiO2
[]
[massfrac_Al]
type = PointValue
variable = massfrac_Al
[]
[massfrac_Cl]
type = PointValue
variable = massfrac_Cl
[]
[massfrac_SO4]
type = PointValue
variable = massfrac_SO4
[]
[massfrac_HCO3]
type = PointValue
variable = massfrac_HCO3
[]
[massfrac_H2O]
type = PointValue
variable = massfrac_H2O
[]
[cm3_Albite]
type = PointValue
variable = 'free_cm3_Albite'
[]
[cm3_Anhydrite]
type = PointValue
variable = 'free_cm3_Anhydrite'
[]
[cm3_Anorthite]
type = PointValue
variable = 'free_cm3_Anorthite'
[]
[cm3_Calcite]
type = PointValue
variable = 'free_cm3_Calcite'
[]
[cm3_Chalcedony]
type = PointValue
variable = 'free_cm3_Chalcedony'
[]
[cm3_Clinochl-7A]
type = PointValue
variable = 'free_cm3_Clinochl-7A'
[]
[cm3_Illite]
type = PointValue
variable = 'free_cm3_Illite'
[]
[cm3_K-feldspar]
type = PointValue
variable = 'free_cm3_K-feldspar'
[]
[cm3_Kaolinite]
type = PointValue
variable = 'free_cm3_Kaolinite'
[]
[cm3_Quartz]
type = PointValue
variable = 'free_cm3_Quartz'
[]
[cm3_Paragonite]
type = PointValue
variable = 'free_cm3_Paragonite'
[]
[cm3_Phlogopite]
type = PointValue
variable = 'free_cm3_Phlogopite'
[]
[cm3_Zoisite]
type = PointValue
variable = 'free_cm3_Zoisite'
[]
[cm3_Laumontite]
type = PointValue
variable = 'free_cm3_Laumontite'
[]
[cm3_mineral]
type = LinearCombinationPostprocessor
pp_names = 'cm3_Albite cm3_Anhydrite cm3_Anorthite cm3_Calcite cm3_Chalcedony cm3_Clinochl-7A cm3_Illite cm3_K-feldspar cm3_Kaolinite cm3_Quartz cm3_Paragonite cm3_Phlogopite cm3_Zoisite cm3_Laumontite'
pp_coefs = '1 1 1 1 1 1 1 1 1 1 1 1 1 1'
[]
[pH]
type = PointValue
variable = 'pH'
[]
[]
[Outputs]
[exo]
type = Exodus
execute_on = final
[]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/except5.i)
#Exception test: inappropriate quantity
[TimeDependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
constraint_value = " 1.0 1.0 1.0 1.0 1.0 1.0"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition"
constraint_unit = "kg moles moles moles moles moles"
kinetic_species_name = "Fe(OH)3(ppd)"
kinetic_species_initial_value = "1.0"
kinetic_species_unit = "moles"
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
kinetic_minerals = "Fe(OH)3(ppd)"
[]
[]
[Executioner]
type = Steady
[]
[AuxVariables]
[error]
[]
[]
[AuxKernels]
[error]
type = GeochemistryQuantityAux
species = "Fe(OH)3(ppd)"
reactor = geochemistry_reactor
variable = error
quantity = kinetic_moles
[]
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/bulk_moles.i)
#Extract bulk moles
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 1.0E-2 1.0E-2"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition"
constraint_unit = "kg moles moles"
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl-"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = 'Cl-'
reactor = geochemistry_reactor
variable = the_aux
quantity = bulk_moles
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "bulk_moles_Cl-"
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/kinetic_rate.i)
#Extract -(kinetic rate times dt)
[TimeDependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
constraint_value = " 1.0 4.0 1.0 0.1 1.0E-6 1.0E-6"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration free_concentration free_concentration"
constraint_unit = "kg moles moles molal molal molal"
kinetic_species_name = "Fe(OH)3(ppd)"
kinetic_species_initial_value = "1.0"
kinetic_species_unit = "moles"
max_ionic_strength = 0.0
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[constant_rate]
type = GeochemistryKineticRate
kinetic_species_name = "Fe(OH)3(ppd)"
intrinsic_rate_constant = 1E-3
eta = 0.0
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
kinetic_minerals = "Fe(OH)3(ppd)"
kinetic_rate_descriptions = "constant_rate"
[]
[]
[Executioner]
type = Transient
dt = 2
end_time = 2
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = "Fe(OH)3(ppd)"
reactor = geochemistry_reactor
variable = the_aux
quantity = kinetic_additions
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "mol_change_Fe(OH)3(ppd)"
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/kinetics/bio_sulfate_1.i)
# Example of a microbe-catalysed reaction (see Bethke Section 18.5 for further details):
# CH3COO- + SO4-- -> 2HCO3- + HS-
# at pH = 7.2
# at temperature = 25degC
# This file treats CH3COO- as a kinetic species, not at equilibrium with the aqueous solution
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
swap_into_basis = 'HS-'
swap_out_of_basis = 'O2(aq)'
charge_balance_species = "Cl-"
constraint_species = "H2O Na+ Ca++ Fe++ Cl- SO4-- HCO3- HS- H+ Biomass1"
constraint_value = " 1.0 501E-3 20E-3 2E-3 500E-3 20E-3 2E-3 0.3E-6 -7.2 1E-4"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition log10activity bulk_composition"
constraint_unit = " kg moles moles moles moles moles moles moles dimensionless moles"
controlled_activity_name = 'H+'
controlled_activity_value = 6.30957E-8 # this is pH=7.2
kinetic_species_name = "CH3COO-"
# note that the free molality of CH3COO- would be 0.0008643, if it were in equilibrium with the aqueous solution described above, if the bulk composition was 1E-3 moles.
kinetic_species_initial_value = 1E-3
kinetic_species_unit = moles
ramp_max_ionic_strength_initial = 0
stoichiometric_ionic_str_using_Cl_only = true # for comparison with GWB
execute_console_output_on = ''
mol_cutoff = 1E-20
solver_info = true
evaluate_kinetic_rates_always = true
prevent_precipitation = 'Pyrite Troilite'
[]
[UserObjects]
[rate_sulfate_reducer]
type = GeochemistryKineticRate
kinetic_species_name = "CH3COO-"
intrinsic_rate_constant = 0.0864 # 1E-9 mol/mg/s = 0.0864 mol/g/day
multiply_by_mass = false
kinetic_molal_index = 1.0
kinetic_monod_index = 1.0
kinetic_half_saturation = 70E-6
promoting_species_names = 'H2O Biomass1'
promoting_indices = '1 1'
direction = dissolution
non_kinetic_biological_catalyst = Biomass1
non_kinetic_biological_efficiency = 4.3
energy_captured = 45E3
theta = 0.2
eta = 1
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O Na+ Ca++ Fe++ Cl- SO4-- HCO3- O2(aq) H+ Biomass1"
equilibrium_minerals = "Mackinawite" # other minerals make marginal difference
kinetic_redox = "CH3COO-"
kinetic_rate_descriptions = "rate_sulfate_reducer"
piecewise_linear_interpolation = true # comparison with GWB
[]
[]
[Functions]
[timestepper]
type = PiecewiseLinear
x = '0 10 18 21'
y = '1E-2 1E-2 1 1'
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = timestepper
[]
end_time = 21
[]
[AuxVariables]
[moles_acetate]
[]
[biomass_mg]
[]
[]
[AuxKernels]
[moles_acetate]
type = GeochemistryQuantityAux
species = 'CH3COO-'
reactor = reactor
variable = moles_acetate
quantity = kinetic_moles
[]
[biomass_mg]
type = GeochemistryQuantityAux
species = 'Biomass1'
reactor = reactor
variable = biomass_mg
quantity = mg_per_kg
[]
[]
[Postprocessors]
[moles_acetate]
type = PointValue
point = '0 0 0'
variable = moles_acetate
[]
[biomass_mg]
type = PointValue
point = '0 0 0'
variable = biomass_mg
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/kinetics/bio_zoning_conc.i)
rate_Ca_diffuse = 6.66667E-9 # 2E-6 mol.m^-3.yr^-1 = 2E-9 mol.litre^-1.yr^-1 divided by porosity of 0.3
rate_CH3COO_diffuse = 13.3333E-9 # 4E-6 mol.m^-3.yr^-1 = 4E-9 mol.litre^-1.yr^-1 divided by porosity of 0.3
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmin = 0
xmax = 200000
[]
[]
[GlobalParams]
point = '100000 0 0'
reactor = reactor
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
swap_into_basis = 'Siderite'
swap_out_of_basis = 'Fe++'
prevent_precipitation = 'Pyrite Troilite'
charge_balance_species = "HCO3-"
constraint_species = "H2O Ca++ HCO3- SO4-- CH3COO- HS- CH4(aq) Siderite H+"
# ASSUME that 1 litre of solution initially contains:
constraint_value = " 1.0 1E-3 2E-3 0.04E-3 1E-9 1E-9 1E-9 1 -7.5"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition free_mineral log10activity"
constraint_unit = " kg moles moles moles moles moles moles cm3 dimensionless"
controlled_activity_name = 'H+'
controlled_activity_value = 3.16227E-8 # this is pH=7.5
kinetic_species_name = "sulfate_reducer methanogen"
kinetic_species_initial_value = '1E-6 1E-6'
kinetic_species_unit = 'mg mg'
source_species_names = "H2O Ca++ SO4-- CH3COO- HS- CH4(aq) Fe++"
source_species_rates = "rate_H2O_per_1l rate_Ca_per_1l_with_source rate_SO4_per_1l rate_CH3COO_per_1l_with_source rate_HS_per_1l rate_CH4_per_1l rate_Fe_per_1l"
ramp_max_ionic_strength_initial = 1
ramp_max_ionic_strength_subsequent = 1
execute_console_output_on = ''
solver_info = true
evaluate_kinetic_rates_always = true
adaptive_timestepping = true
abs_tol = 1E-14
precision = 16
[]
[UserObjects]
[rate_sulfate_reducer]
type = GeochemistryKineticRate
kinetic_species_name = "sulfate_reducer"
intrinsic_rate_constant = 31.536 # 1E-9 mol(acetate)/mg(biomass)/s = 31.536 mol(acetate)/g(biomass)/year
multiply_by_mass = true
promoting_species_names = 'CH3COO- SO4--'
promoting_indices = '1 1'
promoting_monod_indices = '1 1'
promoting_half_saturation = '70E-6 200E-6'
direction = dissolution
kinetic_biological_efficiency = 4.3E-3 # 4.3 g(biomass)/mol(acetate) = 4.3E-3 mol(biomass)/mol(acetate) (because sulfate_reducer has molar mass of 1E3 g/mol)
energy_captured = 45E3
theta = 0.2
eta = 1
[]
[death_sulfate_reducer]
type = GeochemistryKineticRate
kinetic_species_name = "sulfate_reducer"
intrinsic_rate_constant = 0.031536E-3 # 1E-9 g(biomass)/g(biomass)/s = 0.031536 g(biomass)/g(biomass)/year = 0.031536E-3 mol(biomass)/g(biomass)/year (because sulfate_reducer has molar mass of 1E3 g/mol)
multiply_by_mass = true
direction = death
eta = 0.0
[]
[rate_methanogen]
type = GeochemistryKineticRate
kinetic_species_name = "methanogen"
intrinsic_rate_constant = 63.072 # 2E-9 mol(acetate)/mg(biomass)/s = 63.072 mol(acetate)/g(biomass)/year
multiply_by_mass = true
promoting_species_names = 'CH3COO-'
promoting_indices = '1'
promoting_monod_indices = '1'
promoting_half_saturation = '20E-3'
direction = dissolution
kinetic_biological_efficiency = 2.0E-9 # 2 g(biomass)/mol(acetate) = 2E-9 mol(biomass)/mol(acetate) (because methanogen has molar mass of 1E9 g/mol)
energy_captured = 24E3
theta = 0.5
eta = 1
[]
[death_methanogen]
type = GeochemistryKineticRate
kinetic_species_name = "methanogen"
intrinsic_rate_constant = 0.031536E-9 # 1E-9 g(biomass)/g(biomass)/s = 0.031536 g(biomass)/g(biomass)/year = 0.031536E-9 mol(biomass)/g(biomass)/year (because methanogen has molar mass of 1E9 g/mol)
multiply_by_mass = true
direction = death
eta = 0.0
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ CH3COO- CH4(aq) HS- Ca++ HCO3- SO4-- Fe++"
kinetic_minerals = "sulfate_reducer methanogen"
equilibrium_minerals = "*"
kinetic_rate_descriptions = "rate_sulfate_reducer death_sulfate_reducer rate_methanogen death_methanogen"
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = 'min(0.1 * (t + 1), 100)'
[]
end_time = 20000
[]
[AuxVariables]
[rate_H2O_per_1l] # change in H2O per 1 litre of aqueous solution that we consider at each node
[]
[rate_CH3COO_per_1l] # change in CH3COO- per 1 litre of aqueous solution that we consider at each node
[]
[rate_CH4_per_1l] # change in CH4(aq) per 1 litre of aqueous solution that we consider at each node
[]
[rate_HS_per_1l] # change in HS- per 1 litre of aqueous solution that we consider at each node
[]
[rate_Ca_per_1l] # change in Ca++ per 1 litre of aqueous solution that we consider at each node
[]
[rate_SO4_per_1l] # change in SO4-- per 1 litre of aqueous solution that we consider at each node
[]
[rate_Fe_per_1l] # change in Fe++ per 1 litre of aqueous solution that we consider at each node
[]
[rate_CH3COO_per_1l_with_source] # change in CH3COO- per 1 litre of aqueous solution that we consider at each node, including the diffuse source
[]
[rate_Ca_per_1l_with_source] # change in Ca per 1 litre of aqueous solution that we consider at each node, including the diffuse source
[]
[transported_H2O]
[]
[transported_CH3COO]
[]
[transported_CH4]
[]
[transported_HS]
[]
[transported_Ca]
[]
[transported_SO4]
[]
[transported_Fe]
[]
[]
[AuxKernels]
[rate_CH3COO_per_1l_with_source]
type = ParsedAux
args = 'rate_CH3COO_per_1l'
variable = rate_CH3COO_per_1l_with_source
function = 'rate_CH3COO_per_1l + ${rate_CH3COO_diffuse}'
execute_on = 'timestep_begin timestep_end'
[]
[rate_Ca_per_1l_with_source]
type = ParsedAux
args = 'rate_Ca_per_1l'
variable = rate_Ca_per_1l_with_source
function = 'rate_Ca_per_1l + ${rate_Ca_diffuse}'
execute_on = 'timestep_begin timestep_end'
[]
[transported_H2O]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_CH3COO]
type = GeochemistryQuantityAux
variable = transported_CH3COO
species = "CH3COO-"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_CH4]
type = GeochemistryQuantityAux
variable = transported_CH4
species = "CH4(aq)"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_HS]
type = GeochemistryQuantityAux
variable = transported_HS
species = "HS-"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Ca]
type = GeochemistryQuantityAux
variable = transported_Ca
species = "Ca++"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SO4]
type = GeochemistryQuantityAux
variable = transported_SO4
species = "SO4--"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Fe]
type = GeochemistryQuantityAux
variable = transported_Fe
species = "Fe++"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[time]
type = TimePostprocessor
[]
[]
[VectorPostprocessors]
[data]
type = LineValueSampler
start_point = '0 0 0'
end_point = '200000 0 0'
num_points = 501 # NOTE
sort_by = x
variable = 'transported_CH4 transported_CH3COO transported_SO4 free_mg_sulfate_reducer free_mg_methanogen'
[]
[]
[Outputs]
exodus = true
[csv]
type = CSV
time_step_interval = 10
execute_on = 'INITIAL TIMESTEP_END FINAL'
[]
[]
(modules/geochemistry/test/tests/kinetics/bio_death.i)
# Example of biomass death
# In this example, the methanogen does NOT metabolize CH3COO- + H2O -> CH4(aq) + HCO3- because it is not provided with an appropriate GeochemistryKineticRate. Instead, it simply dies, via:
# d(moles)/dt = -0.5 * moles
# In the database file, the methanogen is provided with a molecular weight 1E9 g/mol, so
# -0.5 * moles = -0.5E-9 * mass
# This is encoded in the rate_biomass_death object below
# Note that the DE is solved using an implicit method, so the solution is
# moles(t + dt) = moles(t) / (1 + 0.5 * dt)
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "HCO3-"
constraint_species = "H2O HCO3- CH3COO- CH4(aq) H+"
constraint_value = " 1.0 2E-3 1E-6 1E-6 -6"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition log10activity"
constraint_unit = " kg moles moles moles dimensionless"
kinetic_species_name = methanogen
kinetic_species_initial_value = 1
kinetic_species_unit = moles
ramp_max_ionic_strength_initial = 0
execute_console_output_on = '' # only CSV output for this example
[]
[UserObjects]
[rate_biomass_death]
type = GeochemistryKineticRate
kinetic_species_name = methanogen
intrinsic_rate_constant = 0.5E-9
multiply_by_mass = true
eta = 0
direction = DEATH
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ CH3COO- CH4(aq) HCO3-"
kinetic_minerals = methanogen
kinetic_rate_descriptions = rate_biomass_death
[]
[]
[Executioner]
type = Transient
dt = 1E-2
end_time = 10
[]
[AuxVariables]
[moles_biomass]
[]
[transported_acetate]
[]
[]
[AuxKernels]
[moles_biomass]
type = GeochemistryQuantityAux
species = methanogen
reactor = reactor
variable = moles_biomass
quantity = kinetic_moles
[]
[transported_acetate]
type = GeochemistryQuantityAux
species = "CH3COO-"
reactor = reactor
variable = transported_acetate
quantity = transported_moles_in_original_basis
[]
[]
[Postprocessors]
[moles_biomass]
type = PointValue
point = '0 0 0'
variable = moles_biomass
[]
[transported_acetate]
type = PointValue
point = '0 0 0'
variable = transported_acetate
[]
[]
[Outputs]
time_step_interval = 100
csv = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/scaling.i)
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../../geochemistry/database/moose_geochemdb.json"
basis_species = "H2O H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq)"
equilibrium_minerals = "Siderite Pyrrhotite Dolomite Illite Anhydrite Calcite Quartz K-feldspar Kaolinite Barite Celestite Fluorite Albite Chalcedony Goethite"
[]
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
swap_out_of_basis = "NO3- H+ Fe++ Ba++ SiO2(aq) Mg++ O2(aq) Al+++ K+ Ca++ HCO3-"
swap_into_basis = " NH3 Pyrrhotite K-feldspar Barite Quartz Dolomite Siderite Calcite Illite Anhydrite Kaolinite"
charge_balance_species = "Cl-"
constraint_species = "H2O Quartz Calcite K-feldspar Siderite Dolomite Anhydrite Pyrrhotite Illite Kaolinite Barite Na+ Cl- SO4-- Li+ B(OH)3 Br- F- Sr++ NH3"
constraint_value = " 0.99778351 322.177447 12.111108 6.8269499 6.2844304 2.8670301 1.1912027 0.51474767 0.3732507 0.20903322 0.0001865889 1.5876606 1.5059455 0.046792579 0.013110503 0.006663119 0.001238987 0.00032108 0.000159781 0.001937302"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition"
constraint_unit = "kg moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles"
prevent_precipitation = "Fluorite Albite Goethite"
ramp_max_ionic_strength_initial = 0 # not needed in this simple problem
initial_temperature = 92
mode = 1 # dump all minerals at the start of each time-step
temperature = temp_controller
execute_console_output_on = '' # only CSV output for this problem
stoichiometric_ionic_str_using_Cl_only = true
[]
[Executioner]
type = Transient
dt = 0.01
end_time = 1.0
[]
[AuxVariables]
[temp_controller]
[]
[Anhydrite_mol]
[]
[Dolomite_mol]
[]
[Pyrrhotite_mol]
[]
[K-feldspar_mol]
[]
[Barite_mol]
[]
[Quartz_mol]
[]
[Calcite_mol]
[]
[Illite_mol]
[]
[Kaolinite_mol]
[]
[]
[AuxKernels]
[temp_controller_auxk]
type = FunctionAux
variable = temp_controller
function = '92 + (160 - 92) * t'
execute_on = timestep_begin
[]
[Anhydrite_mol_auxk]
type = GeochemistryQuantityAux
reactor = reactor
variable = Anhydrite_mol
species = Anhydrite
quantity = moles_dumped
[]
[Dolomite_mol_auxk]
type = GeochemistryQuantityAux
reactor = reactor
variable = Dolomite_mol
species = Dolomite
quantity = moles_dumped
[]
[Pyrrhotite_mol]
type = GeochemistryQuantityAux
reactor = reactor
variable = Pyrrhotite_mol
species = Pyrrhotite
quantity = moles_dumped
[]
[K-feldspar_mol]
type = GeochemistryQuantityAux
reactor = reactor
variable = K-feldspar_mol
species = K-feldspar
quantity = moles_dumped
[]
[Barite_mol]
type = GeochemistryQuantityAux
reactor = reactor
variable = Barite_mol
species = Barite
quantity = moles_dumped
[]
[Quartz_mol]
type = GeochemistryQuantityAux
reactor = reactor
variable = Quartz_mol
species = Quartz
quantity = moles_dumped
[]
[Calcite_mol]
type = GeochemistryQuantityAux
reactor = reactor
variable = Calcite_mol
species = Calcite
quantity = moles_dumped
[]
[Illite_mol]
type = GeochemistryQuantityAux
reactor = reactor
variable = Illite_mol
species = Illite
quantity = moles_dumped
[]
[Kaolinite_mol]
type = GeochemistryQuantityAux
reactor = reactor
variable = Kaolinite_mol
species = Kaolinite
quantity = moles_dumped
[]
[]
[GlobalParams]
point = '0 0 0'
[]
[Postprocessors]
[temperature]
type = PointValue
variable = temp_controller
[]
[Anhydrite_mol]
type = PointValue
variable = Anhydrite_mol
[]
[Dolomite_mol]
type = PointValue
variable = Dolomite_mol
[]
[Pyrrhotite_mol]
type = PointValue
variable = Pyrrhotite_mol
[]
[K-feldspar_mol]
type = PointValue
variable = K-feldspar_mol
[]
[Barite_mol]
type = PointValue
variable = Barite_mol
[]
[Quartz_mol]
type = PointValue
variable = Quartz_mol
[]
[Calcite_mol]
type = PointValue
variable = Calcite_mol
[]
[Illite_mol]
type = PointValue
variable = Illite_mol
[]
[Kaolinite_mol]
type = PointValue
variable = Kaolinite_mol
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/except2.i)
#Exception test: illegal quantity type
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 1.0 1.0"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition"
constraint_unit = "kg moles moles"
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl-"
[]
[]
[AuxVariables]
[error]
[]
[]
[AuxKernels]
[error]
type = GeochemistryQuantityAux
species = 'H+'
quantity = free_mg
reactor = geochemistry_reactor
variable = error
[]
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/aquifer_geochemistry.i)
# Simulates geochemistry in the aquifer. This input file may be run in standalone fashion but it does not do anything of interest. To simulate something interesting, run the porous_flow.i simulation which couples to this input file using MultiApps.
# This file receives pf_rate_H2O, pf_rate_Na, pf_rate_Cl, pf_rate_SiO2 and temperature as AuxVariables from porous_flow.i.
# The pf_rate quantities are kg/s changes of fluid-component mass at each node, but the geochemistry module expects rates-of-changes of moles at every node. Secondly, since this input file considers just 1 litre of aqueous solution at every node, the nodal_void_volume is used to convert pf_rate_* into rate_*_per_1l, which is measured in mol/s/1_litre_of_aqueous_solution.
# This file sends massfrac_Na, massfrac_Cl and massfrac_SiO2 to porous_flow.i. These are computed from the corresponding transported_* quantities.
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 14 # for better resolution, use 56 or 112
ny = 8 # for better resolution, use 32 or 64
xmin = -70
xmax = 70
ymin = -40
ymax = 40
[]
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
constraint_species = "H2O Na+ Cl- SiO2(aq)"
# ASSUME that 1 litre of solution contains:
constraint_value = " 1.0 0.1 0.1 0.000555052386"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration"
constraint_unit = " kg moles moles molal"
initial_temperature = 50.0
kinetic_species_name = QuartzLike
# Per 1 litre (1000cm^3) of aqueous solution (1kg of solvent water), there is 9000cm^3 of QuartzLike, which means the initial porosity is 0.1.
kinetic_species_initial_value = 9000
kinetic_species_unit = cm3
temperature = temperature
source_species_names = 'H2O Na+ Cl- SiO2(aq)'
source_species_rates = 'rate_H2O_per_1l rate_Na_per_1l rate_Cl_per_1l rate_SiO2_per_1l'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
add_aux_pH = false # there is no H+ in this system
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
execute_console_output_on = ''
[]
[UserObjects]
[rate_quartz]
type = GeochemistryKineticRate
kinetic_species_name = QuartzLike
intrinsic_rate_constant = 1.0E-2
multiply_by_mass = true
area_quantity = 1
activation_energy = 72800.0
[]
[definition]
type = GeochemicalModelDefinition
database_file = "small_database.json"
basis_species = "H2O SiO2(aq) Na+ Cl-"
kinetic_minerals = "QuartzLike"
kinetic_rate_descriptions = "rate_quartz"
[]
[nodal_void_volume_uo]
type = NodalVoidVolume
porosity = porosity
execute_on = 'initial timestep_end' # "initial" means this is evaluated properly for the first timestep
[]
[]
[Executioner]
type = Transient
dt = 1E5
end_time = 7.76E6 # 90 days
[]
[AuxVariables]
[temperature]
initial_condition = 50.0
[]
[porosity]
initial_condition = 0.1
[]
[nodal_void_volume]
[]
[pf_rate_H2O] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Na] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Cl] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_SiO2] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[rate_H2O_per_1l] # rate per 1 litre of aqueous solution that we consider at each node
[]
[rate_Na_per_1l]
[]
[rate_Cl_per_1l]
[]
[rate_SiO2_per_1l]
[]
[transported_H2O]
[]
[transported_Na]
[]
[transported_Cl]
[]
[transported_SiO2]
[]
[transported_mass]
[]
[massfrac_Na]
[]
[massfrac_Cl]
[]
[massfrac_SiO2]
[]
[massfrac_H2O]
[]
[]
[AuxKernels]
[porosity]
type = ParsedAux
coupled_variables = free_cm3_QuartzLike
expression = '1000.0 / (1000.0 + free_cm3_QuartzLike)'
variable = porosity
execute_on = 'timestep_end'
[]
[nodal_void_volume_auxk]
type = NodalVoidVolumeAux
variable = nodal_void_volume
nodal_void_volume_uo = nodal_void_volume_uo
execute_on = 'initial timestep_end' # "initial" to ensure it is properly evaluated for the first timestep
[]
[rate_H2O_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H2O nodal_void_volume'
variable = rate_H2O_per_1l
# pf_rate = change in kg at every node
# pf_rate * 1000 / molar_mass_in_g_per_mole = change in moles at every node
# pf_rate * 1000 / molar_mass / (nodal_void_volume_in_m^3 * 1000) = change in moles per litre of aqueous solution
expression = 'pf_rate_H2O / 18.0152 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Na_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_Na nodal_void_volume'
variable = rate_Na_per_1l
expression = 'pf_rate_Na / 22.9898 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Cl_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_Cl nodal_void_volume'
variable = rate_Cl_per_1l
expression = 'pf_rate_Cl / 35.453 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_SiO2_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_SiO2 nodal_void_volume'
variable = rate_SiO2_per_1l
expression = 'pf_rate_SiO2 / 60.0843 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Na]
type = GeochemistryQuantityAux
variable = transported_Na
species = Na+
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Cl]
type = GeochemistryQuantityAux
variable = transported_Cl
species = Cl-
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SiO2]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = 'transported_H2O transported_Na transported_Cl transported_SiO2'
variable = transported_mass
expression = 'transported_H2O * 18.0152 + transported_Na * 22.9898 + transported_Cl * 35.453 + transported_SiO2 * 60.0843'
execute_on = 'timestep_end'
[]
[massfrac_H2O]
type = ParsedAux
coupled_variables = 'transported_H2O transported_mass'
variable = massfrac_H2O
expression = 'transported_H2O * 18.0152 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Na]
type = ParsedAux
coupled_variables = 'transported_Na transported_mass'
variable = massfrac_Na
expression = 'transported_Na * 22.9898 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Cl]
type = ParsedAux
coupled_variables = 'transported_Cl transported_mass'
variable = massfrac_Cl
expression = 'transported_Cl * 35.453 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SiO2]
type = ParsedAux
coupled_variables = 'transported_SiO2 transported_mass'
variable = massfrac_SiO2
expression = 'transported_SiO2 * 60.0843 / transported_mass'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[cm3_quartz]
type = PointValue
variable = free_cm3_QuartzLike
[]
[porosity]
type = PointValue
variable = porosity
[]
[solution_temperature]
type = PointValue
variable = solution_temperature
[]
[massfrac_H2O]
type = PointValue
variable = massfrac_H2O
[]
[massfrac_Na]
type = PointValue
variable = massfrac_Na
[]
[massfrac_Cl]
type = PointValue
variable = massfrac_Cl
[]
[massfrac_SiO2]
type = PointValue
variable = massfrac_SiO2
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/temperature.i)
#Extract temperature
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 1.0E-6 1.0E-6"
constraint_meaning = "kg_solvent_water free_concentration bulk_composition"
constraint_unit = "kg molal moles"
ramp_max_ionic_strength_initial = 0
temperature = 30
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl-"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = 'H+'
reactor = geochemistry_reactor
variable = the_aux
quantity = temperature
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "solution_temperature"
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/free_cm3.i)
#Extract free cm^3
[TimeIndependentReactionSolver]
model_definition = definition
swap_out_of_basis = 'H+'
swap_into_basis = 'Fe(OH)3(ppd)_nosorb'
charge_balance_species = "Cl-"
constraint_species = "H2O Cl- Fe+++ Fe(OH)3(ppd)_nosorb"
constraint_value = " 1.0 1.0E-6 1.0E-6 1.0"
constraint_meaning = "kg_solvent_water bulk_composition free_concentration free_mineral"
constraint_unit = "kg moles molal moles"
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl- Fe+++"
equilibrium_minerals = "Fe(OH)3(ppd)_nosorb"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = "Fe(OH)3(ppd)_nosorb"
reactor = geochemistry_reactor
variable = the_aux
quantity = free_cm3
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "free_cm3_Fe(OH)3(ppd)_nosorb"
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/surface_potential.i)
#Extract surface potential
[TimeIndependentReactionSolver]
model_definition = definition
swap_out_of_basis = 'H+'
swap_into_basis = 'Fe(OH)3(ppd)'
charge_balance_species = "Cl-"
constraint_species = "H2O Cl- Fe+++ >(s)FeOH >(w)FeOH Fe(OH)3(ppd)"
constraint_value = " 1.0 1.0E-6 1.0E-6 1.0E-6 1.0E-6 1.0E-6"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration free_concentration free_mineral"
constraint_unit = "kg moles moles molal molal moles"
ramp_max_ionic_strength_initial = 0
abs_tol = 1E-20
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
equilibrium_minerals = "Fe(OH)3(ppd)"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = "Fe(OH)3(ppd)"
reactor = geochemistry_reactor
variable = the_aux
quantity = surface_potential
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "surface_potential_Fe(OH)3(ppd)"
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/time_dependent_reactions/simple_no_action.i)
# This example is simple.i but without using an Action
# Simple example of time-dependent reaction path.
# This example involves an HCl solution that is initialized at pH=2, then the pH is controlled via controlled_activity, and finally HCl is titrated into the solution
[GlobalParams]
point = '0 0 0'
[]
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[u]
type = Diffusion
variable = u
[]
[]
[AuxVariables]
[act_H+]
[]
[solution_temperature]
[]
[kg_solvent_H2O]
[]
[activity_H2O]
[]
[bulk_moles_H2O]
[]
[pH]
[]
[molal_H+]
[]
[molal_Cl-]
[]
[molal_HCl]
[]
[molal_OH-]
[]
[mg_per_kg_H+]
[]
[mg_per_kg_Cl-]
[]
[mg_per_kg_HCl]
[]
[mg_per_kg_OH-]
[]
[activity_H+]
[]
[activity_Cl-]
[]
[activity_HCl]
[]
[activity_OH-]
[]
[bulk_moles_H+]
[]
[bulk_moles_Cl-]
[]
[bulk_moles_HCl]
[]
[bulk_moles_OH-]
[]
[]
[AuxKernels]
[act_H+]
type = FunctionAux
variable = act_H+
function = '10^(-2 - t)'
execute_on = timestep_begin
[]
[solution_temperature]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = solution_temperature
quantity = temperature
[]
[kg_solvent_H2O]
type = GeochemistryQuantityAux
species = 'H2O'
reactor = reactor
variable = kg_solvent_H2O
quantity = molal
[]
[activity_H2O]
type = GeochemistryQuantityAux
species = 'H2O'
reactor = reactor
variable = activity_H2O
quantity = activity
[]
[bulk_moles_H2O]
type = GeochemistryQuantityAux
species = 'H2O'
reactor = reactor
variable = bulk_moles_H2O
quantity = bulk_moles
[]
[pH]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = pH
quantity = neglog10a
[]
[molal_H+]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = 'molal_H+'
quantity = molal
[]
[molal_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
reactor = reactor
variable = 'molal_Cl-'
quantity = molal
[]
[molal_HCl]
type = GeochemistryQuantityAux
species = 'HCl'
reactor = reactor
variable = 'molal_HCl'
quantity = molal
[]
[molal_OH-]
type = GeochemistryQuantityAux
species = 'OH-'
reactor = reactor
variable = 'molal_OH-'
quantity = molal
[]
[mg_per_kg_H+]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = 'mg_per_kg_H+'
quantity = mg_per_kg
[]
[mg_per_kg_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
reactor = reactor
variable = 'mg_per_kg_Cl-'
quantity = mg_per_kg
[]
[mg_per_kg_HCl]
type = GeochemistryQuantityAux
species = 'HCl'
reactor = reactor
variable = 'mg_per_kg_HCl'
quantity = mg_per_kg
[]
[mg_per_kg_OH-]
type = GeochemistryQuantityAux
species = 'OH-'
reactor = reactor
variable = 'mg_per_kg_OH-'
quantity = mg_per_kg
[]
[activity_H+]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = 'activity_H+'
quantity = activity
[]
[activity_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
reactor = reactor
variable = 'activity_Cl-'
quantity = activity
[]
[activity_HCl]
type = GeochemistryQuantityAux
species = 'HCl'
reactor = reactor
variable = 'activity_HCl'
quantity = activity
[]
[activity_OH-]
type = GeochemistryQuantityAux
species = 'OH-'
reactor = reactor
variable = 'activity_OH-'
quantity = activity
[]
[bulk_moles_H+]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = 'bulk_moles_H+'
quantity = bulk_moles
[]
[bulk_moles_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
reactor = reactor
variable = 'bulk_moles_Cl-'
quantity = bulk_moles
[]
[bulk_moles_HCl]
type = GeochemistryQuantityAux
species = 'HCl'
reactor = reactor
variable = 'bulk_moles_HCl'
quantity = bulk_moles
[]
[bulk_moles_OH-]
type = GeochemistryQuantityAux
species = 'OH-'
reactor = reactor
variable = 'bulk_moles_OH-'
quantity = bulk_moles
[]
[]
[Postprocessors]
[pH]
type = PointValue
variable = 'pH'
[]
[solvent_mass]
type = PointValue
variable = 'kg_solvent_H2O'
[]
[molal_Cl-]
type = PointValue
variable = 'molal_Cl-'
[]
[mg_per_kg_HCl]
type = PointValue
variable = 'mg_per_kg_HCl'
[]
[activity_OH-]
type = PointValue
variable = 'activity_OH-'
[]
[bulk_H+]
type = PointValue
variable = 'bulk_moles_H+'
[]
[temperature]
type = PointValue
variable = 'solution_temperature'
[]
[]
[Executioner]
type = Transient
dt = 1
end_time = 10
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ Cl-"
[]
[reactor]
type = GeochemistryTimeDependentReactor
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 -2 1E-2"
constraint_meaning = "kg_solvent_water log10activity bulk_composition"
constraint_unit = " kg dimensionless moles"
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
# close the system at time = 0
close_system_at_time = 0
# control pH. This sets pH = 2 + t (see the act_H+ AuxKernel)
controlled_activity_name = 'H+'
controlled_activity_value = 'act_H+'
# remove the constraint on H+ activity at time = 5, when, from the previous time-step, pH = 2 + 4 = 6
remove_fixed_activity_name = 'H+'
remove_fixed_activity_time = 5
# add 1E-5 moles of HCl every second of the simulation: this has no impact before time = 5 when the fixed-activity constraint it turned off, but then, molality_H+ ~ 1E-6 + 1E-4 * (t - 4), so
# time, approx_pH
# 5, -log10(1E-4) = 4
# 10, -log10(6E-4) = 3.2
source_species_names = 'HCl'
source_species_rates = '1E-4'
[]
[nnn]
type = NearestNodeNumberUO
[]
[]
[Outputs]
csv = true
file_base = simple_out
[console_output]
type = GeochemistryConsoleOutput
geochemistry_reactor = reactor
nearest_node_number_UO = nnn
solver_info = true
execute_on = 'final'
[]
[]
(modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/aquifer_geochemistry.i)
#########################################
# #
# File written by create_input_files.py #
# #
#########################################
# Simulates geochemistry in the aquifer. This input file may be run in standalone fashion but it does not do anything of interest. To simulate something interesting, run the porous_flow.i simulation which couples to this input file using MultiApps.
# This file receives pf_rate_H pf_rate_Cl pf_rate_SO4 pf_rate_HCO3 pf_rate_SiO2aq pf_rate_Al pf_rate_Ca pf_rate_Mg pf_rate_Fe pf_rate_K pf_rate_Na pf_rate_Sr pf_rate_F pf_rate_BOH pf_rate_Br pf_rate_Ba pf_rate_Li pf_rate_NO3 pf_rate_O2aq pf_rate_H2O and temperature as AuxVariables from porous_flow.i
# The pf_rate quantities are kg/s changes of fluid-component mass at each node, but the geochemistry module expects rates-of-changes of moles at every node. Secondly, since this input file considers just 1 litre of aqueous solution at every node, the nodal_void_volume is used to convert pf_rate_* into rate_*_per_1l, which is measured in mol/s/1_litre_of_aqueous_solution.
# This file sends massfrac_H massfrac_Cl massfrac_SO4 massfrac_HCO3 massfrac_SiO2aq massfrac_Al massfrac_Ca massfrac_Mg massfrac_Fe massfrac_K massfrac_Na massfrac_Sr massfrac_F massfrac_BOH massfrac_Br massfrac_Ba massfrac_Li massfrac_NO3 massfrac_O2aq to porous_flow.i. These are computed from the corresponding transported_* quantities.
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = '../../../../geochemistry/database/moose_geochemdb.json'
basis_species = 'H2O H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq)'
equilibrium_minerals = 'Siderite Pyrrhotite Dolomite Illite Anhydrite Calcite Quartz K-feldspar Kaolinite Barite Celestite Fluorite Albite Chalcedony Goethite'
[]
[nodal_void_volume_uo]
type = NodalVoidVolume
porosity = porosity
execute_on = 'initial timestep_end' # initial means this is evaluated properly for the first timestep
[]
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = 'Cl-'
swap_out_of_basis = 'NO3- H+ Fe++ Ba++ SiO2(aq) Mg++ O2(aq) Al+++ K+ Ca++ HCO3-'
swap_into_basis = ' NH3 Pyrrhotite K-feldspar Barite Quartz Dolomite Siderite Calcite Illite Anhydrite Kaolinite'
# ASSUME that 1 litre of solution contains:
constraint_species = 'H2O Quartz Calcite K-feldspar Siderite Dolomite Anhydrite Pyrrhotite Illite Kaolinite Barite Na+ Cl- SO4-- Li+ B(OH)3 Br- F- Sr++ NH3'
constraint_value = ' 0.99778351 322.177447 12.111108 6.8269499 6.2844304 2.8670301 1.1912027 0.51474767 0.3732507 0.20903322 0.0001865889 1.5876606 1.5059455 0.046792579 0.013110503 0.006663119 0.001238987 0.00032108 0.000159781 0.001937302'
constraint_meaning = 'kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition'
constraint_unit = "kg moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles"
prevent_precipitation = 'Fluorite Albite Goethite'
initial_temperature = 92
temperature = temperature
source_species_names = 'H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq) H2O'
source_species_rates = ' rate_H_per_1l rate_Cl_per_1l rate_SO4_per_1l rate_HCO3_per_1l rate_SiO2aq_per_1l rate_Al_per_1l rate_Ca_per_1l rate_Mg_per_1l rate_Fe_per_1l rate_K_per_1l rate_Na_per_1l rate_Sr_per_1l rate_F_per_1l rate_BOH_per_1l rate_Br_per_1l rate_Ba_per_1l rate_Li_per_1l rate_NO3_per_1l rate_O2aq_per_1l rate_H2O_per_1l'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
execute_console_output_on = '' # only CSV and exodus output for this simulation
add_aux_molal = false # save some memory and reduce variables in output exodus
add_aux_mg_per_kg = false # save some memory and reduce variables in output exodus
add_aux_free_mg = false # save some memory and reduce variables in output exodus
add_aux_activity = false # save some memory and reduce variables in output exodus
add_aux_bulk_moles = false # save some memory and reduce variables in output exodus
adaptive_timestepping = true
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
xmin = -75
xmax = 75
ymin = 0
ymax = 40
zmin = -25
zmax = 25
nx = 15
ny = 4
nz = 5
[]
[aquifer]
type = ParsedSubdomainMeshGenerator
input = gen
block_id = 1
block_name = aquifer
combinatorial_geometry = 'z >= -5 & z <= 5'
[]
[injection_nodes]
input = aquifer
type = ExtraNodesetGenerator
new_boundary = injection_nodes
coord = '-25 0 -5; -25 0 5'
[]
[production_nodes]
input = injection_nodes
type = ExtraNodesetGenerator
new_boundary = production_nodes
coord = '25 0 -5; 25 0 5'
[]
[]
[GlobalParams]
point = '-25 0 0'
reactor = reactor
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 7.76E6 # 90 days
[TimeStepper]
type = FunctionDT
function = 'min(3E4, max(1E4, 0.2 * t))'
[]
[]
[AuxVariables]
[temperature]
initial_condition = 92.0
[]
[porosity]
initial_condition = 0.1
[]
[nodal_void_volume]
[]
[free_cm3_Kfeldspar] # necessary because of the minus sign in K-feldspar which does not parse correctly in the porosity AuxKernel
[]
[pf_rate_H] # change in H mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Cl] # change in Cl mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_SO4] # change in SO4 mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_HCO3] # change in HCO3 mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_SiO2aq] # change in SiO2aq mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Al] # change in Al mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Ca] # change in Ca mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Mg] # change in Mg mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Fe] # change in Fe mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_K] # change in K mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Na] # change in Na mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Sr] # change in Sr mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_F] # change in F mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_BOH] # change in BOH mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Br] # change in Br mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Ba] # change in Ba mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Li] # change in Li mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_NO3] # change in NO3 mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_O2aq] # change in O2aq mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_H2O] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[rate_H_per_1l]
[]
[rate_Cl_per_1l]
[]
[rate_SO4_per_1l]
[]
[rate_HCO3_per_1l]
[]
[rate_SiO2aq_per_1l]
[]
[rate_Al_per_1l]
[]
[rate_Ca_per_1l]
[]
[rate_Mg_per_1l]
[]
[rate_Fe_per_1l]
[]
[rate_K_per_1l]
[]
[rate_Na_per_1l]
[]
[rate_Sr_per_1l]
[]
[rate_F_per_1l]
[]
[rate_BOH_per_1l]
[]
[rate_Br_per_1l]
[]
[rate_Ba_per_1l]
[]
[rate_Li_per_1l]
[]
[rate_NO3_per_1l]
[]
[rate_O2aq_per_1l]
[]
[rate_H2O_per_1l]
[]
[transported_H]
[]
[transported_Cl]
[]
[transported_SO4]
[]
[transported_HCO3]
[]
[transported_SiO2aq]
[]
[transported_Al]
[]
[transported_Ca]
[]
[transported_Mg]
[]
[transported_Fe]
[]
[transported_K]
[]
[transported_Na]
[]
[transported_Sr]
[]
[transported_F]
[]
[transported_BOH]
[]
[transported_Br]
[]
[transported_Ba]
[]
[transported_Li]
[]
[transported_NO3]
[]
[transported_O2aq]
[]
[transported_H2O]
[]
[transported_mass]
[]
[massfrac_H]
[]
[massfrac_Cl]
[]
[massfrac_SO4]
[]
[massfrac_HCO3]
[]
[massfrac_SiO2aq]
[]
[massfrac_Al]
[]
[massfrac_Ca]
[]
[massfrac_Mg]
[]
[massfrac_Fe]
[]
[massfrac_K]
[]
[massfrac_Na]
[]
[massfrac_Sr]
[]
[massfrac_F]
[]
[massfrac_BOH]
[]
[massfrac_Br]
[]
[massfrac_Ba]
[]
[massfrac_Li]
[]
[massfrac_NO3]
[]
[massfrac_O2aq]
[]
[massfrac_H2O]
[]
[]
[AuxKernels]
[free_cm3_Kfeldspar]
type = GeochemistryQuantityAux
variable = free_cm3_Kfeldspar
species = 'K-feldspar'
quantity = free_cm3
execute_on = 'timestep_end'
[]
[porosity_auxk]
type = ParsedAux
coupled_variables = 'free_cm3_Siderite free_cm3_Pyrrhotite free_cm3_Dolomite free_cm3_Illite free_cm3_Anhydrite free_cm3_Calcite free_cm3_Quartz free_cm3_Kfeldspar free_cm3_Kaolinite free_cm3_Barite free_cm3_Celestite free_cm3_Fluorite free_cm3_Albite free_cm3_Chalcedony free_cm3_Goethite'
expression = '1000.0 / (1000.0 + free_cm3_Siderite + free_cm3_Pyrrhotite + free_cm3_Dolomite + free_cm3_Illite + free_cm3_Anhydrite + free_cm3_Calcite + free_cm3_Quartz + free_cm3_Kfeldspar + free_cm3_Kaolinite + free_cm3_Barite + free_cm3_Celestite + free_cm3_Fluorite + free_cm3_Albite + free_cm3_Chalcedony + free_cm3_Goethite)'
variable = porosity
execute_on = 'timestep_end'
[]
[nodal_void_volume_auxk]
type = NodalVoidVolumeAux
variable = nodal_void_volume
nodal_void_volume_uo = nodal_void_volume_uo
execute_on = 'initial timestep_end' # initial to ensure it is properly evaluated for the first timestep
[]
[rate_H_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H nodal_void_volume'
variable = rate_H_per_1l
expression = 'pf_rate_H / 1.0079 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Cl_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Cl nodal_void_volume'
variable = rate_Cl_per_1l
expression = 'pf_rate_Cl / 35.453 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_SO4_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_SO4 nodal_void_volume'
variable = rate_SO4_per_1l
expression = 'pf_rate_SO4 / 96.0576 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_HCO3_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_HCO3 nodal_void_volume'
variable = rate_HCO3_per_1l
expression = 'pf_rate_HCO3 / 61.0171 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_SiO2aq_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_SiO2aq nodal_void_volume'
variable = rate_SiO2aq_per_1l
expression = 'pf_rate_SiO2aq / 60.0843 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Al_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Al nodal_void_volume'
variable = rate_Al_per_1l
expression = 'pf_rate_Al / 26.9815 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Ca_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Ca nodal_void_volume'
variable = rate_Ca_per_1l
expression = 'pf_rate_Ca / 40.08 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Mg_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Mg nodal_void_volume'
variable = rate_Mg_per_1l
expression = 'pf_rate_Mg / 24.305 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Fe_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Fe nodal_void_volume'
variable = rate_Fe_per_1l
expression = 'pf_rate_Fe / 55.847 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_K_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_K nodal_void_volume'
variable = rate_K_per_1l
expression = 'pf_rate_K / 39.0983 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Na_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Na nodal_void_volume'
variable = rate_Na_per_1l
expression = 'pf_rate_Na / 22.9898 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Sr_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Sr nodal_void_volume'
variable = rate_Sr_per_1l
expression = 'pf_rate_Sr / 87.62 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_F_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_F nodal_void_volume'
variable = rate_F_per_1l
expression = 'pf_rate_F / 18.9984 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_BOH_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_BOH nodal_void_volume'
variable = rate_BOH_per_1l
expression = 'pf_rate_BOH / 61.8329 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Br_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Br nodal_void_volume'
variable = rate_Br_per_1l
expression = 'pf_rate_Br / 79.904 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Ba_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Ba nodal_void_volume'
variable = rate_Ba_per_1l
expression = 'pf_rate_Ba / 137.33 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Li_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Li nodal_void_volume'
variable = rate_Li_per_1l
expression = 'pf_rate_Li / 6.941 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_NO3_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_NO3 nodal_void_volume'
variable = rate_NO3_per_1l
expression = 'pf_rate_NO3 / 62.0049 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_O2aq_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_O2aq nodal_void_volume'
variable = rate_O2aq_per_1l
expression = 'pf_rate_O2aq / 31.9988 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_H2O_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H2O nodal_void_volume'
variable = rate_H2O_per_1l
expression = 'pf_rate_H2O / 18.01801802 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[transported_H_auxk]
type = GeochemistryQuantityAux
variable = transported_H
species = 'H+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Cl_auxk]
type = GeochemistryQuantityAux
variable = transported_Cl
species = 'Cl-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SO4_auxk]
type = GeochemistryQuantityAux
variable = transported_SO4
species = 'SO4--'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_HCO3_auxk]
type = GeochemistryQuantityAux
variable = transported_HCO3
species = 'HCO3-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SiO2aq_auxk]
type = GeochemistryQuantityAux
variable = transported_SiO2aq
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Al_auxk]
type = GeochemistryQuantityAux
variable = transported_Al
species = 'Al+++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Ca_auxk]
type = GeochemistryQuantityAux
variable = transported_Ca
species = 'Ca++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Mg_auxk]
type = GeochemistryQuantityAux
variable = transported_Mg
species = 'Mg++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Fe_auxk]
type = GeochemistryQuantityAux
variable = transported_Fe
species = 'Fe++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_K_auxk]
type = GeochemistryQuantityAux
variable = transported_K
species = 'K+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Na_auxk]
type = GeochemistryQuantityAux
variable = transported_Na
species = 'Na+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Sr_auxk]
type = GeochemistryQuantityAux
variable = transported_Sr
species = 'Sr++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_F_auxk]
type = GeochemistryQuantityAux
variable = transported_F
species = 'F-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_BOH_auxk]
type = GeochemistryQuantityAux
variable = transported_BOH
species = 'B(OH)3'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Br_auxk]
type = GeochemistryQuantityAux
variable = transported_Br
species = 'Br-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Ba_auxk]
type = GeochemistryQuantityAux
variable = transported_Ba
species = 'Ba++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Li_auxk]
type = GeochemistryQuantityAux
variable = transported_Li
species = 'Li+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_NO3_auxk]
type = GeochemistryQuantityAux
variable = transported_NO3
species = 'NO3-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_O2aq_auxk]
type = GeochemistryQuantityAux
variable = transported_O2aq
species = 'O2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
variable = transported_H2O
species = 'H2O'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = ' transported_H transported_Cl transported_SO4 transported_HCO3 transported_SiO2aq transported_Al transported_Ca transported_Mg transported_Fe transported_K transported_Na transported_Sr transported_F transported_BOH transported_Br transported_Ba transported_Li transported_NO3 transported_O2aq transported_H2O'
variable = transported_mass
expression = 'transported_H * 1.0079 + transported_Cl * 35.453 + transported_SO4 * 96.0576 + transported_HCO3 * 61.0171 + transported_SiO2aq * 60.0843 + transported_Al * 26.9815 + transported_Ca * 40.08 + transported_Mg * 24.305 + transported_Fe * 55.847 + transported_K * 39.0983 + transported_Na * 22.9898 + transported_Sr * 87.62 + transported_F * 18.9984 + transported_BOH * 61.8329 + transported_Br * 79.904 + transported_Ba * 137.33 + transported_Li * 6.941 + transported_NO3 * 62.0049 + transported_O2aq * 31.9988 + transported_H2O * 18.01801802'
execute_on = 'timestep_end'
[]
[massfrac_H_auxk]
type = ParsedAux
coupled_variables = 'transported_H transported_mass'
variable = massfrac_H
expression = 'transported_H * 1.0079 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Cl_auxk]
type = ParsedAux
coupled_variables = 'transported_Cl transported_mass'
variable = massfrac_Cl
expression = 'transported_Cl * 35.453 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SO4_auxk]
type = ParsedAux
coupled_variables = 'transported_SO4 transported_mass'
variable = massfrac_SO4
expression = 'transported_SO4 * 96.0576 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_HCO3_auxk]
type = ParsedAux
coupled_variables = 'transported_HCO3 transported_mass'
variable = massfrac_HCO3
expression = 'transported_HCO3 * 61.0171 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SiO2aq_auxk]
type = ParsedAux
coupled_variables = 'transported_SiO2aq transported_mass'
variable = massfrac_SiO2aq
expression = 'transported_SiO2aq * 60.0843 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Al_auxk]
type = ParsedAux
coupled_variables = 'transported_Al transported_mass'
variable = massfrac_Al
expression = 'transported_Al * 26.9815 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Ca_auxk]
type = ParsedAux
coupled_variables = 'transported_Ca transported_mass'
variable = massfrac_Ca
expression = 'transported_Ca * 40.08 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Mg_auxk]
type = ParsedAux
coupled_variables = 'transported_Mg transported_mass'
variable = massfrac_Mg
expression = 'transported_Mg * 24.305 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Fe_auxk]
type = ParsedAux
coupled_variables = 'transported_Fe transported_mass'
variable = massfrac_Fe
expression = 'transported_Fe * 55.847 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_K_auxk]
type = ParsedAux
coupled_variables = 'transported_K transported_mass'
variable = massfrac_K
expression = 'transported_K * 39.0983 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Na_auxk]
type = ParsedAux
coupled_variables = 'transported_Na transported_mass'
variable = massfrac_Na
expression = 'transported_Na * 22.9898 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Sr_auxk]
type = ParsedAux
coupled_variables = 'transported_Sr transported_mass'
variable = massfrac_Sr
expression = 'transported_Sr * 87.62 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_F_auxk]
type = ParsedAux
coupled_variables = 'transported_F transported_mass'
variable = massfrac_F
expression = 'transported_F * 18.9984 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_BOH_auxk]
type = ParsedAux
coupled_variables = 'transported_BOH transported_mass'
variable = massfrac_BOH
expression = 'transported_BOH * 61.8329 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Br_auxk]
type = ParsedAux
coupled_variables = 'transported_Br transported_mass'
variable = massfrac_Br
expression = 'transported_Br * 79.904 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Ba_auxk]
type = ParsedAux
coupled_variables = 'transported_Ba transported_mass'
variable = massfrac_Ba
expression = 'transported_Ba * 137.33 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Li_auxk]
type = ParsedAux
coupled_variables = 'transported_Li transported_mass'
variable = massfrac_Li
expression = 'transported_Li * 6.941 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_NO3_auxk]
type = ParsedAux
coupled_variables = 'transported_NO3 transported_mass'
variable = massfrac_NO3
expression = 'transported_NO3 * 62.0049 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_O2aq_auxk]
type = ParsedAux
coupled_variables = 'transported_O2aq transported_mass'
variable = massfrac_O2aq
expression = 'transported_O2aq * 31.9988 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_H2O_auxk]
type = ParsedAux
coupled_variables = 'transported_H2O transported_mass'
variable = massfrac_H2O
expression = 'transported_H2O * 18.01801802 / transported_mass'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[memory]
type = MemoryUsage
outputs = 'console'
[]
[porosity]
type = PointValue
variable = porosity
[]
[solution_temperature]
type = PointValue
variable = solution_temperature
[]
[massfrac_H]
type = PointValue
variable = massfrac_H
[]
[massfrac_Cl]
type = PointValue
variable = massfrac_Cl
[]
[massfrac_SO4]
type = PointValue
variable = massfrac_SO4
[]
[massfrac_HCO3]
type = PointValue
variable = massfrac_HCO3
[]
[massfrac_SiO2aq]
type = PointValue
variable = massfrac_SiO2aq
[]
[massfrac_Al]
type = PointValue
variable = massfrac_Al
[]
[massfrac_Ca]
type = PointValue
variable = massfrac_Ca
[]
[massfrac_Mg]
type = PointValue
variable = massfrac_Mg
[]
[massfrac_Fe]
type = PointValue
variable = massfrac_Fe
[]
[massfrac_K]
type = PointValue
variable = massfrac_K
[]
[massfrac_Na]
type = PointValue
variable = massfrac_Na
[]
[massfrac_Sr]
type = PointValue
variable = massfrac_Sr
[]
[massfrac_F]
type = PointValue
variable = massfrac_F
[]
[massfrac_BOH]
type = PointValue
variable = massfrac_BOH
[]
[massfrac_Br]
type = PointValue
variable = massfrac_Br
[]
[massfrac_Ba]
type = PointValue
variable = massfrac_Ba
[]
[massfrac_Li]
type = PointValue
variable = massfrac_Li
[]
[massfrac_NO3]
type = PointValue
variable = massfrac_NO3
[]
[massfrac_O2aq]
type = PointValue
variable = massfrac_O2aq
[]
[massfrac_H2O]
type = PointValue
variable = massfrac_H2O
[]
[free_cm3_Siderite]
type = PointValue
variable = free_cm3_Siderite
[]
[free_cm3_Pyrrhotite]
type = PointValue
variable = free_cm3_Pyrrhotite
[]
[free_cm3_Dolomite]
type = PointValue
variable = free_cm3_Dolomite
[]
[free_cm3_Illite]
type = PointValue
variable = free_cm3_Illite
[]
[free_cm3_Anhydrite]
type = PointValue
variable = free_cm3_Anhydrite
[]
[free_cm3_Calcite]
type = PointValue
variable = free_cm3_Calcite
[]
[free_cm3_Quartz]
type = PointValue
variable = free_cm3_Quartz
[]
[free_cm3_K-feldspar]
type = PointValue
variable = free_cm3_K-feldspar
[]
[free_cm3_Kaolinite]
type = PointValue
variable = free_cm3_Kaolinite
[]
[free_cm3_Barite]
type = PointValue
variable = free_cm3_Barite
[]
[free_cm3_Celestite]
type = PointValue
variable = free_cm3_Celestite
[]
[free_cm3_Fluorite]
type = PointValue
variable = free_cm3_Fluorite
[]
[free_cm3_Albite]
type = PointValue
variable = free_cm3_Albite
[]
[free_cm3_Chalcedony]
type = PointValue
variable = free_cm3_Chalcedony
[]
[free_cm3_Goethite]
type = PointValue
variable = free_cm3_Goethite
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/surface_charge.i)
#Extract surface charge
[TimeIndependentReactionSolver]
model_definition = definition
swap_out_of_basis = 'H+'
swap_into_basis = 'Fe(OH)3(ppd)'
charge_balance_species = "Cl-"
constraint_species = "H2O Cl- Fe+++ >(s)FeOH >(w)FeOH Fe(OH)3(ppd)"
constraint_value = " 1.0 1.0E-6 1.0E-6 1.0E-6 1.0E-6 1.0E-6"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration free_concentration free_mineral"
constraint_unit = "kg moles moles molal molal moles"
ramp_max_ionic_strength_initial = 0
abs_tol = 1E-20
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
equilibrium_minerals = "Fe(OH)3(ppd)"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = "Fe(OH)3(ppd)"
reactor = geochemistry_reactor
variable = the_aux
quantity = surface_charge
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "surface_charge_Fe(OH)3(ppd)"
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/mg_per_kg.i)
#Extract mg_per_kg
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 1.0E-4 1.0E-4"
constraint_meaning = "kg_solvent_water free_concentration bulk_composition"
constraint_unit = "kg molal moles"
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl-"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = 'H+'
reactor = geochemistry_reactor
variable = the_aux
quantity = mg_per_kg
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "mg_per_kg_H+"
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/kinetics/bio_arsenate1.i)
# Example of a microbe-catalysed reaction:
# Lactate- + 2HAsO4-- + 2H2O -> CH3COO- + CO3-- + 2As(OH)4-
# at pH = 9.8
# at temperature = 20degC
# The equation in the database involving lactate is
# Lactate- + 3O2(aq) -> 2H+ + 3HCO3-
# with log10(K) = 231.4 at 20degC
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
swap_into_basis = 'CO3--'
swap_out_of_basis = 'HCO3-'
charge_balance_species = "Cl-"
constraint_species = "H2O Na+ CO3-- Lactate- Cl- AsO4--- CH3COO- As(OH)4- H+"
constraint_value = " 1.0 1448E-3 24E-3 10E-3 1500E-3 10E-3 1E-6 1E-6 -9.8"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition log10activity"
constraint_unit = " kg moles moles moles moles moles moles moles dimensionless"
controlled_activity_name = 'H+'
controlled_activity_value = 1.58489E-10 # this is pH=9.8
kinetic_species_name = "arsenate_reducer"
kinetic_species_initial_value = 0.5 # molecular weight of arsenate_reducer = 1, so this is the amount of mmoles too
kinetic_species_unit = mg
ramp_max_ionic_strength_initial = 0
stoichiometric_ionic_str_using_Cl_only = true # for comparison with GWB
execute_console_output_on = ''
mol_cutoff = 1E-20
solver_info = true
evaluate_kinetic_rates_always = true
precision = 16
[]
[UserObjects]
[rate_arsenate_reducer]
type = GeochemistryKineticRate
kinetic_species_name = "arsenate_reducer"
intrinsic_rate_constant = 0.6048 # 7E-9 mol/mg/s = 0.6048 mol/g/day
promoting_species_names = 'HAsO4--'
promoting_indices = '1'
promoting_monod_indices = '1'
promoting_half_saturation = 10E-6
multiply_by_mass = true
direction = dissolution
kinetic_biological_efficiency = 5
energy_captured = 125E3
theta = 0.25
eta = 1
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O Na+ Cl- HCO3- H+ As(OH)4- Lactate- CH3COO- AsO4---"
kinetic_redox = "arsenate_reducer"
kinetic_rate_descriptions = "rate_arsenate_reducer"
[]
[]
[Executioner]
type = Transient
dt = 0.01
end_time = 2
[]
[AuxVariables]
[moles_acetate]
[]
[biomass_g]
[]
[]
[AuxKernels]
[moles_acetate]
type = GeochemistryQuantityAux
species = 'CH3COO-'
reactor = reactor
variable = moles_acetate
quantity = transported_moles_in_original_basis
[]
[biomass_g]
type = GeochemistryQuantityAux
species = 'arsenate_reducer'
reactor = reactor
variable = biomass_g
quantity = kinetic_moles # remember molecular weight = 1 g/mol
[]
[]
[Functions]
[rate]
type = ParsedFunction
vars = 'dt reaction_rate_times_dt'
vals = 'dt reaction_rate_times_dt'
value = 'reaction_rate_times_dt / dt'
[]
[]
[Postprocessors]
[moles_acetate]
type = PointValue
point = '0 0 0'
variable = moles_acetate
[]
[reaction_rate_times_dt]
type = PointValue
point = '0 0 0'
variable = mol_change_arsenate_reducer
outputs = 'none'
[]
[dt]
type = TimestepSize
outputs = 'none'
[]
[reaction_rate]
type = FunctionValuePostprocessor
function = rate
[]
[biomass_g]
type = PointValue
point = '0 0 0'
variable = biomass_g
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/except3.i)
#Exception test: inappropriate quantity
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
constraint_value = " 1.0 1.0 1.0 1.0 1.0 1.0"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition"
constraint_unit = "kg moles moles moles moles moles"
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
equilibrium_minerals = "Fe(OH)3(ppd)"
[]
[]
[AuxVariables]
[error]
[]
[]
[AuxKernels]
[error]
type = GeochemistryQuantityAux
species = "Fe(OH)3(ppd)"
reactor = geochemistry_reactor
variable = error
quantity = molal
[]
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/kinetic_moles.i)
#Extract kinetic moles
[TimeDependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
constraint_value = " 1.0 4.0 1.0 0.1 1.0E-6 1.0E-6"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration free_concentration free_concentration"
constraint_unit = "kg moles moles molal molal molal"
kinetic_species_name = "Fe(OH)3(ppd)"
kinetic_species_initial_value = "1.0"
kinetic_species_unit = "moles"
max_ionic_strength = 0.0
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl- Fe+++ >(s)FeOH >(w)FeOH"
kinetic_minerals = "Fe(OH)3(ppd)"
[]
[]
[Executioner]
type = Transient
dt = 1
end_time = 1
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = "Fe(OH)3(ppd)"
reactor = geochemistry_reactor
variable = the_aux
quantity = kinetic_moles
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "moles_Fe(OH)3(ppd)"
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/free_mg.i)
#Extract free mg
[TimeIndependentReactionSolver]
model_definition = definition
swap_out_of_basis = 'H+'
swap_into_basis = 'Fe(OH)3(ppd)_nosorb'
charge_balance_species = "Cl-"
constraint_species = "H2O Cl- Fe+++ Fe(OH)3(ppd)_nosorb"
constraint_value = " 1.0 1.0E-6 1.0E-6 1.0"
constraint_meaning = "kg_solvent_water bulk_composition free_concentration free_mineral"
constraint_unit = "kg moles molal moles"
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl- Fe+++"
equilibrium_minerals = "Fe(OH)3(ppd)_nosorb"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = "Fe(OH)3(ppd)_nosorb"
reactor = geochemistry_reactor
variable = the_aux
quantity = free_mg
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "free_mg_Fe(OH)3(ppd)_nosorb"
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/equilibrium_models/HCl_no_action.i)
# This is an example of an input file that does not utilize an action. Its functionality is the same as HCl.i
# This solves for molalities in a system just containing HCl
[GlobalParams]
point = '0 0 0'
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx= 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[u]
type = Diffusion
variable = u
[]
[]
[AuxVariables]
[solution_temperature]
[]
[kg_solvent_H2O]
[]
[activity_H2O]
[]
[bulk_moles_H2O]
[]
[pH]
[]
[molal_H+]
[]
[molal_Cl-]
[]
[molal_HCl]
[]
[molal_OH-]
[]
[mg_per_kg_H+]
[]
[mg_per_kg_Cl-]
[]
[mg_per_kg_HCl]
[]
[mg_per_kg_OH-]
[]
[activity_H+]
[]
[activity_Cl-]
[]
[activity_HCl]
[]
[activity_OH-]
[]
[bulk_moles_H+]
[]
[bulk_moles_Cl-]
[]
[bulk_moles_HCl]
[]
[bulk_moles_OH-]
[]
[]
[AuxKernels]
[solution_temperature]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = solution_temperature
quantity = temperature
[]
[kg_solvent_H2O]
type = GeochemistryQuantityAux
species = 'H2O'
reactor = reactor
variable = kg_solvent_H2O
quantity = molal
[]
[activity_H2O]
type = GeochemistryQuantityAux
species = 'H2O'
reactor = reactor
variable = activity_H2O
quantity = activity
[]
[bulk_moles_H2O]
type = GeochemistryQuantityAux
species = 'H2O'
reactor = reactor
variable = bulk_moles_H2O
quantity = bulk_moles
[]
[pH]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = pH
quantity = neglog10a
[]
[molal_H+]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = 'molal_H+'
quantity = molal
[]
[molal_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
reactor = reactor
variable = 'molal_Cl-'
quantity = molal
[]
[molal_HCl]
type = GeochemistryQuantityAux
species = 'HCl'
reactor = reactor
variable = 'molal_HCl'
quantity = molal
[]
[molal_OH-]
type = GeochemistryQuantityAux
species = 'OH-'
reactor = reactor
variable = 'molal_OH-'
quantity = molal
[]
[mg_per_kg_H+]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = 'mg_per_kg_H+'
quantity = mg_per_kg
[]
[mg_per_kg_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
reactor = reactor
variable = 'mg_per_kg_Cl-'
quantity = mg_per_kg
[]
[mg_per_kg_HCl]
type = GeochemistryQuantityAux
species = 'HCl'
reactor = reactor
variable = 'mg_per_kg_HCl'
quantity = mg_per_kg
[]
[mg_per_kg_OH-]
type = GeochemistryQuantityAux
species = 'OH-'
reactor = reactor
variable = 'mg_per_kg_OH-'
quantity = mg_per_kg
[]
[activity_H+]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = 'activity_H+'
quantity = activity
[]
[activity_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
reactor = reactor
variable = 'activity_Cl-'
quantity = activity
[]
[activity_HCl]
type = GeochemistryQuantityAux
species = 'HCl'
reactor = reactor
variable = 'activity_HCl'
quantity = activity
[]
[activity_OH-]
type = GeochemistryQuantityAux
species = 'OH-'
reactor = reactor
variable = 'activity_OH-'
quantity = activity
[]
[bulk_moles_H+]
type = GeochemistryQuantityAux
species = 'H+'
reactor = reactor
variable = 'bulk_moles_H+'
quantity = bulk_moles
[]
[bulk_moles_Cl-]
type = GeochemistryQuantityAux
species = 'Cl-'
reactor = reactor
variable = 'bulk_moles_Cl-'
quantity = bulk_moles
[]
[bulk_moles_HCl]
type = GeochemistryQuantityAux
species = 'HCl'
reactor = reactor
variable = 'bulk_moles_HCl'
quantity = bulk_moles
[]
[bulk_moles_OH-]
type = GeochemistryQuantityAux
species = 'OH-'
reactor = reactor
variable = 'bulk_moles_OH-'
quantity = bulk_moles
[]
[]
[Postprocessors]
[pH]
type = PointValue
variable = 'pH'
[]
[solvent_mass]
type = PointValue
variable = 'kg_solvent_H2O'
[]
[molal_Cl-]
type = PointValue
variable = 'molal_Cl-'
[]
[mg_per_kg_HCl]
type = PointValue
variable = 'mg_per_kg_HCl'
[]
[activity_OH-]
type = PointValue
variable = 'activity_OH-'
[]
[bulk_H+]
type = PointValue
variable = 'bulk_moles_H+'
[]
[temperature]
type = PointValue
variable = 'solution_temperature'
[]
[]
[Executioner]
type = Steady
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ Cl-"
piecewise_linear_interpolation = true # to reproduce the GWB result
[]
[reactor]
type = GeochemistryTimeDependentReactor
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 -2 1E-2"
constraint_meaning = "kg_solvent_water log10activity bulk_composition"
constraint_unit = " kg dimensionless moles"
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
abs_tol = 1E-15
[]
[nnn]
type = NearestNodeNumberUO
[]
[]
[Outputs]
csv = true
[console_output]
type = GeochemistryConsoleOutput
geochemistry_reactor = reactor
nearest_node_number_UO = nnn
solver_info = true
execute_on = initial
[]
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/except1.i)
#Exception test: species does not exist
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 1.0 1.0"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition"
constraint_unit = "kg moles moles"
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl-"
[]
[]
[AuxVariables]
[error]
[]
[]
[AuxKernels]
[error]
type = GeochemistryQuantityAux
species = Na
reactor = geochemistry_reactor
variable = error
[]
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/activity.i)
#Extract activity
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 1.0E-2 1.0E-2"
constraint_meaning = "kg_solvent_water activity bulk_composition"
constraint_unit = "kg dimensionless moles"
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl-"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = 'H+'
reactor = geochemistry_reactor
variable = the_aux
quantity = activity
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "activity_H+"
[]
[]
[Outputs]
csv = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/exchanger.i)
#########################################
# #
# File written by create_input_files.py #
# #
#########################################
# Model of the heat-exchanger
# The input fluid to the heat exchanger is determined by AuxVariables called production_temperature, production_rate_H, production_rate_Cl, production_rate_SO4, production_rate_HCO3, production_rate_SiO2aq, production_rate_Al, production_rate_Ca, production_rate_Mg, production_rate_Fe, production_rate_K, production_rate_Na, production_rate_Sr, production_rate_F, production_rate_BOH, production_rate_Br, production_rate_Ba, production_rate_Li, production_rate_NO3, production_rate_O2aq, production_rate_H2O. These come from Postprocessors in the porous_flow.i simulation that measure the fluid composition at the production well.
# Given the input fluid, the exchanger cools/heats the fluid, removing any precipitates, and injects fluid back to porous_flow.i at temperature output_temperature and composition given by massfrac_H, etc.
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = '../../../../geochemistry/database/moose_geochemdb.json'
basis_species = 'H2O H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq)'
equilibrium_minerals = 'Siderite Pyrrhotite Dolomite Illite Anhydrite Calcite Quartz K-feldspar Kaolinite Barite Celestite Fluorite Albite Chalcedony Goethite'
[]
[]
[TimeDependentReactionSolver]
model_definition = definition
include_moose_solve = false
geochemistry_reactor_name = reactor
swap_out_of_basis = 'NO3- O2(aq)'
swap_into_basis = ' NH3 HS-'
charge_balance_species = 'Cl-'
# initial conditions are unimportant because in exchanger mode all existing fluid is flushed from the system before adding the produced water
constraint_species = 'H2O H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NH3 HS-'
constraint_value = '1.0 1E-6 1E-6 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18'
constraint_meaning = 'kg_solvent_water bulk_composition bulk_composition free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration'
constraint_unit = "kg moles moles molal molal molal molal molal molal molal molal molal molal molal molal molal molal molal molal molal"
prevent_precipitation = 'Fluorite Albite Goethite'
initial_temperature = 92
mode = 4
temperature = ramp_temperature # ramp up to 160degC over ~1 day so that aquifer geochemistry simulation can easily converge
cold_temperature = 92
heating_increments = 10
source_species_names = ' H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq) H2O'
source_species_rates = ' production_rate_H production_rate_Cl production_rate_SO4 production_rate_HCO3 production_rate_SiO2aq production_rate_Al production_rate_Ca production_rate_Mg production_rate_Fe production_rate_K production_rate_Na production_rate_Sr production_rate_F production_rate_BOH production_rate_Br production_rate_Ba production_rate_Li production_rate_NO3 production_rate_O2aq production_rate_H2O'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[AuxVariables]
[ramp_temperature]
initial_condition = 92
[]
[production_temperature]
initial_condition = 92 # the production_T Transfer lags one timestep behind for some reason, so give this a reasonable initial condition
[]
[transported_H]
[]
[transported_Cl]
[]
[transported_SO4]
[]
[transported_HCO3]
[]
[transported_SiO2aq]
[]
[transported_Al]
[]
[transported_Ca]
[]
[transported_Mg]
[]
[transported_Fe]
[]
[transported_K]
[]
[transported_Na]
[]
[transported_Sr]
[]
[transported_F]
[]
[transported_BOH]
[]
[transported_Br]
[]
[transported_Ba]
[]
[transported_Li]
[]
[transported_NO3]
[]
[transported_O2aq]
[]
[transported_H2O]
[]
[transported_mass]
[]
[massfrac_H]
[]
[massfrac_Cl]
[]
[massfrac_SO4]
[]
[massfrac_HCO3]
[]
[massfrac_SiO2aq]
[]
[massfrac_Al]
[]
[massfrac_Ca]
[]
[massfrac_Mg]
[]
[massfrac_Fe]
[]
[massfrac_K]
[]
[massfrac_Na]
[]
[massfrac_Sr]
[]
[massfrac_F]
[]
[massfrac_BOH]
[]
[massfrac_Br]
[]
[massfrac_Ba]
[]
[massfrac_Li]
[]
[massfrac_NO3]
[]
[massfrac_O2aq]
[]
[massfrac_H2O]
[]
[dumped_Siderite]
[]
[dumped_Pyrrhotite]
[]
[dumped_Dolomite]
[]
[dumped_Illite]
[]
[dumped_Anhydrite]
[]
[dumped_Calcite]
[]
[dumped_Quartz]
[]
[dumped_K-feldspar]
[]
[dumped_Kaolinite]
[]
[dumped_Barite]
[]
[dumped_Celestite]
[]
[dumped_Fluorite]
[]
[dumped_Albite]
[]
[dumped_Chalcedony]
[]
[dumped_Goethite]
[]
# The production_* Transfers lag one timestep behind for some reason (when the porous_flow simulation has finished, it correctly computes mole_rate_*_produced, but the Transfer gets the mole_rate_*_produced from the previous timestep), so give the production_rate_* reasonable initial conditions, otherwise they will be zero at the start of the simulation.
[production_rate_H]
initial_condition = -0.00058596786807342
[]
[production_rate_Cl]
initial_condition = 0.274767413291287
[]
[production_rate_SO4]
initial_condition = 0.012567456786868922
[]
[production_rate_HCO3]
initial_condition = 0.0001668295857850308
[]
[production_rate_SiO2aq]
initial_condition = 0.00010068057668449495
[]
[production_rate_Al]
initial_condition = 2.4224219572143877e-07
[]
[production_rate_Ca]
initial_condition = 0.0040997718654983036
[]
[production_rate_Mg]
initial_condition = 0.00015261342984691217
[]
[production_rate_Fe]
initial_condition = 0.0001550375425863269
[]
[production_rate_K]
initial_condition = 0.0003500651859998926
[]
[production_rate_Na]
initial_condition = 0.2896767602995328
[]
[production_rate_Sr]
initial_condition = 2.915285700108879e-05
[]
[production_rate_F]
initial_condition = 5.8582680830041476e-05
[]
[production_rate_BOH]
initial_condition = 0.0012157199878760335
[]
[production_rate_Br]
initial_condition = 0.00022605948665165203
[]
[production_rate_Ba]
initial_condition = 2.2773554030672105e-07
[]
[production_rate_Li]
initial_condition = 0.0023920780265869763
[]
[production_rate_NO3]
initial_condition = 0.000353470613973057
[]
[production_rate_O2aq]
initial_condition = -0.00044255942331181803
[]
[production_rate_H2O]
initial_condition = 10.10458252764496
[]
[]
[AuxKernels]
[ramp_temperature]
type = FunctionAux
variable = ramp_temperature
function = 'min(160, max(92, 92 + (160 - 92) * t / 1E5))'
[]
[transported_H_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_H
species = 'H+'
[]
[transported_Cl_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Cl
species = 'Cl-'
[]
[transported_SO4_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_SO4
species = 'SO4--'
[]
[transported_HCO3_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_HCO3
species = 'HCO3-'
[]
[transported_SiO2aq_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_SiO2aq
species = 'SiO2(aq)'
[]
[transported_Al_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Al
species = 'Al+++'
[]
[transported_Ca_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Ca
species = 'Ca++'
[]
[transported_Mg_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Mg
species = 'Mg++'
[]
[transported_Fe_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Fe
species = 'Fe++'
[]
[transported_K_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_K
species = 'K+'
[]
[transported_Na_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Na
species = 'Na+'
[]
[transported_Sr_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Sr
species = 'Sr++'
[]
[transported_F_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_F
species = 'F-'
[]
[transported_BOH_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_BOH
species = 'B(OH)3'
[]
[transported_Br_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Br
species = 'Br-'
[]
[transported_Ba_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Ba
species = 'Ba++'
[]
[transported_Li_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Li
species = 'Li+'
[]
[transported_NO3_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_NO3
species = 'NO3-'
[]
[transported_O2aq_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_O2aq
species = 'O2(aq)'
[]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_H2O
species = 'H2O'
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = ' transported_H transported_Cl transported_SO4 transported_HCO3 transported_SiO2aq transported_Al transported_Ca transported_Mg transported_Fe transported_K transported_Na transported_Sr transported_F transported_BOH transported_Br transported_Ba transported_Li transported_NO3 transported_O2aq transported_H2O'
variable = transported_mass
expression = ' transported_H * 1.0079 + transported_Cl * 35.453 + transported_SO4 * 96.0576 + transported_HCO3 * 61.0171 + transported_SiO2aq * 60.0843 + transported_Al * 26.9815 + transported_Ca * 40.08 + transported_Mg * 24.305 + transported_Fe * 55.847 + transported_K * 39.0983 + transported_Na * 22.9898 + transported_Sr * 87.62 + transported_F * 18.9984 + transported_BOH * 61.8329 + transported_Br * 79.904 + transported_Ba * 137.33 + transported_Li * 6.941 + transported_NO3 * 62.0049 + transported_O2aq * 31.9988 + transported_H2O * 18.01801802'
[]
[massfrac_H_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_H'
variable = massfrac_H
expression = '1.0079 * transported_H / transported_mass'
[]
[massfrac_Cl_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Cl'
variable = massfrac_Cl
expression = '35.453 * transported_Cl / transported_mass'
[]
[massfrac_SO4_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_SO4'
variable = massfrac_SO4
expression = '96.0576 * transported_SO4 / transported_mass'
[]
[massfrac_HCO3_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_HCO3'
variable = massfrac_HCO3
expression = '61.0171 * transported_HCO3 / transported_mass'
[]
[massfrac_SiO2aq_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_SiO2aq'
variable = massfrac_SiO2aq
expression = '60.0843 * transported_SiO2aq / transported_mass'
[]
[massfrac_Al_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Al'
variable = massfrac_Al
expression = '26.9815 * transported_Al / transported_mass'
[]
[massfrac_Ca_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Ca'
variable = massfrac_Ca
expression = '40.08 * transported_Ca / transported_mass'
[]
[massfrac_Mg_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Mg'
variable = massfrac_Mg
expression = '24.305 * transported_Mg / transported_mass'
[]
[massfrac_Fe_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Fe'
variable = massfrac_Fe
expression = '55.847 * transported_Fe / transported_mass'
[]
[massfrac_K_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_K'
variable = massfrac_K
expression = '39.0983 * transported_K / transported_mass'
[]
[massfrac_Na_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Na'
variable = massfrac_Na
expression = '22.9898 * transported_Na / transported_mass'
[]
[massfrac_Sr_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Sr'
variable = massfrac_Sr
expression = '87.62 * transported_Sr / transported_mass'
[]
[massfrac_F_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_F'
variable = massfrac_F
expression = '18.9984 * transported_F / transported_mass'
[]
[massfrac_BOH_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_BOH'
variable = massfrac_BOH
expression = '61.8329 * transported_BOH / transported_mass'
[]
[massfrac_Br_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Br'
variable = massfrac_Br
expression = '79.904 * transported_Br / transported_mass'
[]
[massfrac_Ba_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Ba'
variable = massfrac_Ba
expression = '137.33 * transported_Ba / transported_mass'
[]
[massfrac_Li_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Li'
variable = massfrac_Li
expression = '6.941 * transported_Li / transported_mass'
[]
[massfrac_NO3_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_NO3'
variable = massfrac_NO3
expression = '62.0049 * transported_NO3 / transported_mass'
[]
[massfrac_O2aq_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_O2aq'
variable = massfrac_O2aq
expression = '31.9988 * transported_O2aq / transported_mass'
[]
[massfrac_H2O_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_H2O'
variable = massfrac_H2O
expression = '18.01801802 * transported_H2O / transported_mass'
[]
[dumped_Siderite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Siderite
species = Siderite
quantity = moles_dumped
[]
[dumped_Pyrrhotite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Pyrrhotite
species = Pyrrhotite
quantity = moles_dumped
[]
[dumped_Dolomite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Dolomite
species = Dolomite
quantity = moles_dumped
[]
[dumped_Illite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Illite
species = Illite
quantity = moles_dumped
[]
[dumped_Anhydrite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Anhydrite
species = Anhydrite
quantity = moles_dumped
[]
[dumped_Calcite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Calcite
species = Calcite
quantity = moles_dumped
[]
[dumped_Quartz_auxk]
type = GeochemistryQuantityAux
variable = dumped_Quartz
species = Quartz
quantity = moles_dumped
[]
[dumped_K-feldspar_auxk]
type = GeochemistryQuantityAux
variable = dumped_K-feldspar
species = K-feldspar
quantity = moles_dumped
[]
[dumped_Kaolinite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Kaolinite
species = Kaolinite
quantity = moles_dumped
[]
[dumped_Barite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Barite
species = Barite
quantity = moles_dumped
[]
[dumped_Celestite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Celestite
species = Celestite
quantity = moles_dumped
[]
[dumped_Fluorite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Fluorite
species = Fluorite
quantity = moles_dumped
[]
[dumped_Albite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Albite
species = Albite
quantity = moles_dumped
[]
[dumped_Chalcedony_auxk]
type = GeochemistryQuantityAux
variable = dumped_Chalcedony
species = Chalcedony
quantity = moles_dumped
[]
[dumped_Goethite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Goethite
species = Goethite
quantity = moles_dumped
[]
[]
[Postprocessors]
[cumulative_moles_precipitated_Siderite]
type = PointValue
variable = dumped_Siderite
[]
[cumulative_moles_precipitated_Pyrrhotite]
type = PointValue
variable = dumped_Pyrrhotite
[]
[cumulative_moles_precipitated_Dolomite]
type = PointValue
variable = dumped_Dolomite
[]
[cumulative_moles_precipitated_Illite]
type = PointValue
variable = dumped_Illite
[]
[cumulative_moles_precipitated_Anhydrite]
type = PointValue
variable = dumped_Anhydrite
[]
[cumulative_moles_precipitated_Calcite]
type = PointValue
variable = dumped_Calcite
[]
[cumulative_moles_precipitated_Quartz]
type = PointValue
variable = dumped_Quartz
[]
[cumulative_moles_precipitated_K-feldspar]
type = PointValue
variable = dumped_K-feldspar
[]
[cumulative_moles_precipitated_Kaolinite]
type = PointValue
variable = dumped_Kaolinite
[]
[cumulative_moles_precipitated_Barite]
type = PointValue
variable = dumped_Barite
[]
[cumulative_moles_precipitated_Celestite]
type = PointValue
variable = dumped_Celestite
[]
[cumulative_moles_precipitated_Fluorite]
type = PointValue
variable = dumped_Fluorite
[]
[cumulative_moles_precipitated_Albite]
type = PointValue
variable = dumped_Albite
[]
[cumulative_moles_precipitated_Chalcedony]
type = PointValue
variable = dumped_Chalcedony
[]
[cumulative_moles_precipitated_Goethite]
type = PointValue
variable = dumped_Goethite
[]
[production_temperature]
type = PointValue
variable = production_temperature
[]
[mass_heated_this_timestep]
type = PointValue
variable = transported_mass
[]
[]
[Outputs]
csv = true
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 7.76E6 # 90 days
[TimeStepper]
type = FunctionDT
function = 'min(3E4, max(1E4, 0.2 * t))'
[]
[]
[MultiApps]
[porous_flow_sim]
type = TransientMultiApp
input_files = porous_flow.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[injection_T]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'solution_temperature'
variable = 'injection_temperature'
[]
[injection_H]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_H'
variable = 'injection_rate_massfrac_H'
[]
[injection_Cl]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Cl'
variable = 'injection_rate_massfrac_Cl'
[]
[injection_SO4]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_SO4'
variable = 'injection_rate_massfrac_SO4'
[]
[injection_HCO3]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_HCO3'
variable = 'injection_rate_massfrac_HCO3'
[]
[injection_SiO2aq]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_SiO2aq'
variable = 'injection_rate_massfrac_SiO2aq'
[]
[injection_Al]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Al'
variable = 'injection_rate_massfrac_Al'
[]
[injection_Ca]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Ca'
variable = 'injection_rate_massfrac_Ca'
[]
[injection_Mg]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Mg'
variable = 'injection_rate_massfrac_Mg'
[]
[injection_Fe]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Fe'
variable = 'injection_rate_massfrac_Fe'
[]
[injection_K]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_K'
variable = 'injection_rate_massfrac_K'
[]
[injection_Na]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Na'
variable = 'injection_rate_massfrac_Na'
[]
[injection_Sr]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Sr'
variable = 'injection_rate_massfrac_Sr'
[]
[injection_F]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_F'
variable = 'injection_rate_massfrac_F'
[]
[injection_BOH]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_BOH'
variable = 'injection_rate_massfrac_BOH'
[]
[injection_Br]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Br'
variable = 'injection_rate_massfrac_Br'
[]
[injection_Ba]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Ba'
variable = 'injection_rate_massfrac_Ba'
[]
[injection_Li]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Li'
variable = 'injection_rate_massfrac_Li'
[]
[injection_NO3]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_NO3'
variable = 'injection_rate_massfrac_NO3'
[]
[injection_O2aq]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_O2aq'
variable = 'injection_rate_massfrac_O2aq'
[]
[injection_H2O]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_H2O'
variable = 'injection_rate_massfrac_H2O'
[]
[production_T]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = production_temperature
variable = production_temperature
[]
[production_H]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_H_produced
variable = production_rate_H
[]
[production_Cl]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Cl_produced
variable = production_rate_Cl
[]
[production_SO4]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_SO4_produced
variable = production_rate_SO4
[]
[production_HCO3]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_HCO3_produced
variable = production_rate_HCO3
[]
[production_SiO2aq]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_SiO2aq_produced
variable = production_rate_SiO2aq
[]
[production_Al]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Al_produced
variable = production_rate_Al
[]
[production_Ca]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Ca_produced
variable = production_rate_Ca
[]
[production_Mg]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Mg_produced
variable = production_rate_Mg
[]
[production_Fe]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Fe_produced
variable = production_rate_Fe
[]
[production_K]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_K_produced
variable = production_rate_K
[]
[production_Na]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Na_produced
variable = production_rate_Na
[]
[production_Sr]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Sr_produced
variable = production_rate_Sr
[]
[production_F]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_F_produced
variable = production_rate_F
[]
[production_BOH]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_BOH_produced
variable = production_rate_BOH
[]
[production_Br]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Br_produced
variable = production_rate_Br
[]
[production_Ba]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Ba_produced
variable = production_rate_Ba
[]
[production_Li]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Li_produced
variable = production_rate_Li
[]
[production_NO3]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_NO3_produced
variable = production_rate_NO3
[]
[production_O2aq]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_O2aq_produced
variable = production_rate_O2aq
[]
[production_H2O]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_H2O_produced
variable = production_rate_H2O
[]
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/aquifer_un_quartz_geochemistry.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 56
ny = 32
xmin = -70
xmax = 70
ymin = -40
ymax = 40
[]
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
constraint_species = "H2O Na+ Cl- SiO2(aq)"
# ASSUME that 1 litre of solution contains:
constraint_value = " 1.0 0.1 0.1 0.00172249633"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration"
constraint_unit = " kg moles moles molal"
initial_temperature = 50.0
kinetic_species_name = QuartzUnlike
# Per 1 litre (1000cm^3) of aqueous solution (1kg of solvent water), there is 9000cm^3 of QuartzUnlike, which means the initial porosity is 0.1.
kinetic_species_initial_value = 9000
kinetic_species_unit = cm3
temperature = temperature
source_species_names = 'H2O Na+ Cl- SiO2(aq)'
source_species_rates = 'rate_H2O_per_1l rate_Na_per_1l rate_Cl_per_1l rate_SiO2_per_1l'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
add_aux_pH = false # there is no H+ in this system
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
execute_console_output_on = '' # only CSV and exodus output used in this example
[]
[UserObjects]
[rate_quartz]
type = GeochemistryKineticRate
kinetic_species_name = QuartzUnlike
intrinsic_rate_constant = 1.0E-2
multiply_by_mass = true
area_quantity = 1
activation_energy = 72800.0
[]
[definition]
type = GeochemicalModelDefinition
database_file = "small_database.json"
basis_species = "H2O SiO2(aq) Na+ Cl-"
kinetic_minerals = "QuartzUnlike"
kinetic_rate_descriptions = "rate_quartz"
[]
[]
[Executioner]
type = Transient
dt = 1E5
end_time = 7.76E6 # 90 days
[]
[AuxVariables]
[temperature]
initial_condition = 50.0
[]
[nodal_volume]
[]
[porosity]
[]
[nodal_void_volume]
[]
[pf_rate_H2O] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Na] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Cl] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_SiO2] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[rate_H2O_per_1l] # rate per 1 litre of aqueous solution that we consider at each node
[]
[rate_Na_per_1l]
[]
[rate_Cl_per_1l]
[]
[rate_SiO2_per_1l]
[]
[transported_H2O]
[]
[transported_Na]
[]
[transported_Cl]
[]
[transported_SiO2]
[]
[transported_mass]
[]
[massfrac_Na]
[]
[massfrac_Cl]
[]
[massfrac_SiO2]
[]
[massfrac_H2O]
[]
[]
[AuxKernels]
[nodal_volume] # TODO: change this hard-coded version once PR is merged
type = FunctionAux
variable = nodal_volume
function = 'if(abs(x) = 70 & abs(y) = 40, 2.5, if(abs(x) = 70 | abs(y) = 40, 5, 10))'
execute_on = 'initial'
[]
[porosity]
type = ParsedAux
coupled_variables = free_cm3_QuartzUnlike
expression = '1000.0 / (1000.0 + free_cm3_QuartzUnlike)'
variable = porosity
execute_on = 'timestep_begin timestep_end'
[]
[nodal_void_volume]
type = ParsedAux
coupled_variables = 'porosity nodal_volume'
variable = nodal_void_volume
expression = 'porosity * nodal_volume'
execute_on = 'timestep_begin'
[]
[rate_H2O_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_H2O nodal_void_volume'
variable = rate_H2O_per_1l
# pf_rate = change in kg at every node
# pf_rate * 1000 / molar_mass_in_g_per_mole = change in moles at every node
# pf_rate * 1000 / molar_mass / (nodal_void_volume_in_m^3 * 1000) = change in moles per litre of aqueous solution
expression = 'pf_rate_H2O / 18.0152 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Na_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_Na nodal_void_volume'
variable = rate_Na_per_1l
expression = 'pf_rate_Na / 22.9898 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Cl_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_Cl nodal_void_volume'
variable = rate_Cl_per_1l
expression = 'pf_rate_Cl / 35.453 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_SiO2_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_SiO2 nodal_void_volume'
variable = rate_SiO2_per_1l
expression = 'pf_rate_SiO2 / 60.0843 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[transported_H2O]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Na]
type = GeochemistryQuantityAux
variable = transported_Na
species = Na+
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Cl]
type = GeochemistryQuantityAux
variable = transported_Cl
species = Cl-
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SiO2]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_mass]
type = ParsedAux
coupled_variables = 'transported_H2O transported_Na transported_Cl transported_SiO2'
variable = transported_mass
expression = 'transported_H2O * 18.0152 + transported_Na * 22.9898 + transported_Cl * 35.453 + transported_SiO2 * 60.0843'
execute_on = 'timestep_end'
[]
[massfrac_H2O]
type = ParsedAux
coupled_variables = 'transported_H2O transported_mass'
variable = massfrac_H2O
expression = 'transported_H2O * 18.0152 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Na]
type = ParsedAux
coupled_variables = 'transported_Na transported_mass'
variable = massfrac_Na
expression = 'transported_Na * 22.9898 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Cl]
type = ParsedAux
coupled_variables = 'transported_Cl transported_mass'
variable = massfrac_Cl
expression = 'transported_Cl * 35.453 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SiO2]
type = ParsedAux
coupled_variables = 'transported_SiO2 transported_mass'
variable = massfrac_SiO2
expression = 'transported_SiO2 * 60.0843 / transported_mass'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[cm3_quartz]
type = PointValue
variable = free_cm3_QuartzUnlike
[]
[porosity]
type = PointValue
variable = porosity
[]
[solution_temperature]
type = PointValue
variable = solution_temperature
[]
[massfrac_H2O]
type = PointValue
variable = massfrac_H2O
[]
[massfrac_Na]
type = PointValue
variable = massfrac_Na
[]
[massfrac_Cl]
type = PointValue
variable = massfrac_Cl
[]
[massfrac_SiO2]
type = PointValue
variable = massfrac_SiO2
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/geochemistry/test/tests/kinetics/bio_sulfate_2.i)
# Example of a microbe-catalysed reaction (see Bethke Section 18.5 for further details):
# CH3COO- + SO4-- -> 2HCO3- + HS-
# at pH = 7.2
# at temperature = 25degC
# This file treats the microbe as a kinetic species and all the aqueous components are in equilibrium
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
swap_into_basis = 'HS-'
swap_out_of_basis = 'O2(aq)'
charge_balance_species = "Cl-"
constraint_species = "H2O Na+ Ca++ Fe++ Cl- SO4-- HCO3- HS- H+ CH3COO-"
constraint_value = " 1.0 501E-3 20E-3 2E-3 500E-3 20E-3 2E-3 0.3E-6 -7.2 1E-3"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition log10activity bulk_composition"
constraint_unit = " kg moles moles moles moles moles moles moles dimensionless moles"
controlled_activity_name = 'H+'
controlled_activity_value = 6.30957E-8 # this is pH=7.2
kinetic_species_name = "sulfate_reducer"
kinetic_species_initial_value = 0.1
kinetic_species_unit = mg
ramp_max_ionic_strength_initial = 0
stoichiometric_ionic_str_using_Cl_only = true # for comparison with GWB
execute_console_output_on = ''
mol_cutoff = 1E-20
solver_info = true
evaluate_kinetic_rates_always = true
prevent_precipitation = 'Pyrite Troilite'
[]
[UserObjects]
[rate_sulfate_reducer]
type = GeochemistryKineticRate
kinetic_species_name = "sulfate_reducer"
intrinsic_rate_constant = 0.0864 # 1E-9 mol/mg/s = 0.0864 mol/g/day
multiply_by_mass = true
promoting_species_names = 'CH3COO-'
promoting_indices = 1
promoting_monod_indices = 1
promoting_half_saturation = 70E-6
direction = both
kinetic_biological_efficiency = 4.3E-3
energy_captured = 45E3
theta = 0.2
eta = 1
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O Na+ Ca++ Fe++ Cl- SO4-- HCO3- O2(aq) H+ CH3COO-"
equilibrium_minerals = "Mackinawite" # other minerals make marginal difference
kinetic_minerals = "sulfate_reducer"
kinetic_rate_descriptions = "rate_sulfate_reducer"
piecewise_linear_interpolation = true # comparison with GWB
[]
[]
[Functions]
[timestepper]
type = PiecewiseLinear
x = '0 10 18 21'
y = '1E-2 1E-2 1 1'
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = timestepper
[]
end_time = 21
[]
[AuxVariables]
[moles_acetate]
[]
[biomass_mg]
[]
[]
[AuxKernels]
[moles_acetate]
type = GeochemistryQuantityAux
species = 'CH3COO-'
reactor = reactor
variable = moles_acetate
quantity = transported_moles_in_original_basis
[]
[biomass_mg]
type = GeochemistryQuantityAux
species = 'sulfate_reducer'
reactor = reactor
variable = biomass_mg
quantity = free_mg
[]
[]
[Postprocessors]
[moles_acetate]
type = PointValue
point = '0 0 0'
variable = moles_acetate
[]
[biomass_mg]
type = PointValue
point = '0 0 0'
variable = biomass_mg
[]
[]
[Outputs]
csv = true
[]
(modules/geochemistry/test/tests/geochemistry_quantity_aux/molal.i)
#Extract molal
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl-"
constraint_value = " 1.0 1.0E-4 1.0E-4"
constraint_meaning = "kg_solvent_water free_concentration bulk_composition"
constraint_unit = "kg molal moles"
ramp_max_ionic_strength_initial = 0
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/ferric_hydroxide_sorption.json"
basis_species = "H2O H+ Cl-"
[]
[]
[AuxVariables]
[the_aux]
[]
[]
[AuxKernels]
[the_aux]
type = GeochemistryQuantityAux
species = 'H+'
reactor = geochemistry_reactor
variable = the_aux
[]
[]
[Postprocessors]
[value]
type = PointValue
point = '0 0 0'
variable = the_aux
[]
[value_from_action]
type = PointValue
point = '0 0 0'
variable = "molal_H+"
[]
[]
[Outputs]
csv = true
[]