SpatialReactionSolver
This sets up a MOOSE simulation that is spatially and temporally dependent, with no "usual" solution process (with Kernels, etc). This Action adds a GeochemistrySpatialReactor userobject, many AuxVariables corresponding to molality, free-mg, free-cm3, pH, etc using the GeochemistryQuantityAux and a console output object, the GeochemistryConsoleOutput along with its NearestNodeNumberUO UserObject.
The input file must also contain the GeochemicalModelDefinition (as all geochemistry
simulations must), along with a definition of the Mesh and Executioner.
An simple example input file is:
# Example demonstrating that controlled-activity can be spatially-dependent
[UserObjects<<<{"href": "../UserObjects/index.html"}>>>]
[definition]
type = GeochemicalModelDefinition<<<{"description": "User object that parses a geochemical database file, and only retains information relevant to the current geochemical model", "href": "../../source/userobjects/GeochemicalModelDefinition.html"}>>>
database_file<<<{"description": "The name of the geochemical database file"}>>> = "../../../database/moose_geochemdb.json"
basis_species<<<{"description": "A list of basis components relevant to the aqueous-equilibrium problem. H2O must appear first in this list. These components must be chosen from the 'basis species' in the database, the sorbing sites (if any) and the decoupled redox states that are in disequilibrium (if any)."}>>> = "H2O H+ Cl-"
[]
[]
[SpatialReactionSolver<<<{"href": "index.html"}>>>]
model_definition<<<{"description": "The name of the GeochemicalModelDefinition user object (you must create this UserObject yourself)"}>>> = definition
charge_balance_species<<<{"description": "Charge balance will be enforced on this basis species. This means that its bulk mole number may be changed from the initial value you provide in order to ensure charge neutrality. After the initial swaps have been performed, this must be in the basis, and it must be provided with a bulk_composition constraint_meaning."}>>> = "Cl-"
constraint_species<<<{"description": "Names of the species that have their values fixed to constraint_value with meaning constraint_meaning. All basis species (after swap_into_basis and swap_out_of_basis) must be provided with exactly one constraint. These constraints are used to compute the configuration during the initial problem setup, and in time-dependent simulations they may be modified as time progresses."}>>> = "H2O H+ Cl-"
constraint_value<<<{"description": "Numerical value of the containts on constraint_species"}>>> = " 1 -5 1E-5"
constraint_meaning<<<{"description": "Meanings of the numerical values given in constraint_value. kg_solvent_water: can only be applied to H2O and units must be kg. bulk_composition: can be applied to all non-gas species, and represents the total amount of the basis species contained as free species as well as the amount found in secondary species but not in kinetic species, and units must be moles or mass (kg, g, etc). bulk_composition_with_kinetic: can be applied to all non-gas species, and represents the total amount of the basis species contained as free species as well as the amount found in secondary species and in kinetic species, and units must be moles or mass (kg, g, etc). free_concentration: can be applied to all basis species that are not gas and not H2O and not mineral, and represents the total amount of the basis species existing freely (not as secondary species) within the solution, and units must be molal or mass_per_kg_solvent. free_mineral: can be applied to all mineral basis species, and represents the total amount of the mineral existing freely (precipitated) within the solution, and units must be moles, mass or cm3. activity and log10activity: can be applied to basis species that are not gas and not mineral and not sorbing sites, and represents the activity of the basis species (recall pH = -log10activity), and units must be dimensionless. fugacity and log10fugacity: can be applied to gases, and units must be dimensionless"}>>> = "bulk_composition log10activity bulk_composition"
constraint_unit<<<{"description": "Units of the numerical values given in constraint_value. Dimensionless: should only be used for activity or fugacity constraints. Moles: mole number. Molal: moles per kg solvent water. kg: kilograms. g: grams. mg: milligrams. ug: micrograms. kg_per_kg_solvent: kilograms per kg solvent water. g_per_kg_solvent: grams per kg solvent water. mg_per_kg_solvent: milligrams per kg solvent water. ug_per_kg_solvent: micrograms per kg solvent water. cm3: cubic centimeters"}>>> = " kg dimensionless moles"
controlled_activity_name<<<{"description": "The names of the species that have their activity or fugacity constrained. There should be an equal number of these names as values given in controlled_activity_value. NOTE: if these species are not in the basis, or they do not have an activity (or fugacity) constraint then their activity cannot be controlled: in this case MOOSE will ignore the value you prescribe in controlled_activity_value."}>>> = 'H+'
controlled_activity_value<<<{"description": "Values of the activity or fugacity of the species in controlled_activity_name list. These should always be positive"}>>> = 'act_H+'
[]
[Mesh<<<{"href": "../Mesh/index.html"}>>>]
type = GeneratedMesh
dim = 1
nx = 10
xmax = 1
[]
[Executioner<<<{"href": "../Executioner/index.html"}>>>]
type = Transient
num_steps = 1
[]
[AuxVariables<<<{"href": "../AuxVariables/index.html"}>>>]
[act_H+]
[]
[]
[AuxKernels<<<{"href": "../AuxKernels/index.html"}>>>]
[act_H+]
type = FunctionAux<<<{"description": "Auxiliary Kernel that creates and updates a field variable by sampling a function through space and time.", "href": "../../source/auxkernels/FunctionAux.html"}>>>
variable<<<{"description": "The name of the variable that this object applies to"}>>> = 'act_H+'
function<<<{"description": "The function to use as the value"}>>> = '10^(-5 + x)'
execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = timestep_begin # so the Reactor gets the correct value
[]
[]
[VectorPostprocessors<<<{"href": "../VectorPostprocessors/index.html"}>>>]
[pH]
type = LineValueSampler<<<{"description": "Samples variable(s) along a specified line", "href": "../../source/vectorpostprocessors/LineValueSampler.html"}>>>
start_point<<<{"description": "The beginning of the line"}>>> = '0 0 0'
end_point<<<{"description": "The ending of the line"}>>> = '1 0 0'
sort_by<<<{"description": "What to sort the samples by"}>>> = x
num_points<<<{"description": "The number of points to sample along the line"}>>> = 11
variable<<<{"description": "The names of the variables that this VectorPostprocessor operates on"}>>> = pH
[]
[]
[Outputs<<<{"href": "../Outputs/index.html"}>>>]
csv<<<{"description": "Output the scalar variable and postprocessors to a *.csv file using the default CSV output."}>>> = true
execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = final
[]
(modules/geochemistry/test/tests/spatial_reactor/spatial_1.i)