22 "add_geochemistry_molality_aux");
29 "geochemistry_reactor_name",
30 "geochemistry_reactor",
31 "The name that will be given to the GeochemistryReactor UserObject built by this action");
32 params.
addParam<
bool>(
"include_moose_solve",
34 "Include a usual MOOSE solve involving Variables and Kernels. In pure " 35 "reaction systems (without transport) include_moose_solve = false is " 36 "appropriate, but with transport 'true' must be used");
39 "The name of the GeochemicalModelDefinition user object " 40 "(you must create this UserObject yourself)");
46 params.addRangeCheckedParam<
Real>(
47 "stoichiometry_tolerance",
49 "stoichiometry_tolerance >= 0.0",
50 "Swapping involves inverting matrices via a singular value decomposition. During this " 51 "process: (1) if abs(singular value) < stoi_tol * L1norm(singular values), then the " 52 "matrix is deemed singular (so the basis swap is deemed invalid); (2) if abs(any " 53 "stoichiometric coefficient) < stoi_tol then it is set to zero.");
60 "execute_console_output_on", exec_enum,
"When to execute the geochemistry console output");
61 params.addParam<Point>(
"point",
63 "The geochemistry console output will be regarding the aqueous " 64 "solution at node that is closest to this point");
67 params.addParam<
bool>(
70 "Add AuxVariable, called kg_solvent_H2O, that records the kg of solvent water");
71 params.addParam<
bool>(
72 "add_aux_pH",
true,
"Add AuxVariable, called pH, that records the pH of solvent water");
73 params.addParam<
bool>(
76 "Add AuxVariables measured in molal units (ie mol(species)/kg(solvent_water)). These are " 77 "named molal_name, where 'name' is the species name. AuxVariables are added for all species " 79 params.addParam<
bool>(
"add_aux_mg_per_kg",
81 "Add AuxVariables measured in mg(species)/kg(solvent_water). These are " 82 "named mg_per_kg_name, where 'name' is the species name. AuxVariables are " 83 "added for all species except minerals");
84 params.addParam<
bool>(
"add_aux_free_mg",
86 "Add AuxVariables for all minerals measured in free mg. These are named " 87 "free_mg_name, where 'name' is the species name");
88 params.addParam<
bool>(
"add_aux_free_cm3",
90 "Add AuxVariables for all minerals measured in free cm^3. These are named " 91 "free_cm3_name, where 'name' is the species name");
92 params.addParam<
bool>(
95 "Add AuxVariables that record the activity for all species (for gas species this equals the " 96 "gas fugacity). These are called activity_name where 'name' is the species name.");
97 params.addParam<
bool>(
100 "Add AuxVariables that record the number of bulk-composition moles for all species. Note " 101 "that these will be zero for any species not currently in the basis. These are called " 102 "bulk_moles_name where 'name' is the species name.");
103 params.addParam<
bool>(
"add_aux_surface_charge",
105 "Add AuxVariables, measured in C/m^2, corresponding to specific surface " 106 "charge for each mineral involved in surface sorption. These are " 107 "surface_charge_name, where 'name' is the mineral name");
108 params.addParam<
bool>(
"add_aux_surface_potential",
110 "Add AuxVariables, measured in V, corresponding to surface potential " 111 "for each mineral involved in surface sorption. These are " 112 "surface_potential_name, where 'name' is the mineral name");
113 params.addParam<
bool>(
"add_aux_temperature",
115 "Add AuxVariable, called solution_temperature, that records the " 116 "temperature of the aqueous solution in degC");
117 params.addParam<
bool>(
118 "add_aux_kinetic_moles",
120 "Add AuxVariables that record the number of moles for all kinetic species. These are called " 121 "moles_name where 'name' is the species name.");
122 params.addParam<
bool>(
"add_aux_kinetic_additions",
124 "Add AuxVariables that record the rate-of-change (-reaction_rate * dt) for " 125 "all kinetic species. These are called " 126 "mol_change_name where 'name' is the species name.");
127 params.addClassDescription(
"Base class for an Action that sets up a reaction solver. This class " 128 "adds a GeochemistryConsoleOutput and AuxVariables corresponding to " 129 "molalities, etc. Derived classes will create the solver.");
144 const std::string class_name =
"NearestNodeNumberUO";
146 params.
set<Point>(
"point") = getParam<Point>(
"point");
148 params.set<std::vector<SubdomainName>>(
"block") =
149 getParam<std::vector<SubdomainName>>(
"block");
151 params.set<std::vector<BoundaryName>>(
"boundary") =
152 getParam<std::vector<BoundaryName>>(
"boundary");
154 _problem->addUserObject(class_name,
"geochemistry_nearest_node_number", params);
158 const std::string class_name =
"GeochemistryConsoleOutput";
160 params.
set<UserObjectName>(
"geochemistry_reactor") =
161 getParam<UserObjectName>(
"geochemistry_reactor_name");
162 params.set<
unsigned>(
"precision") = getParam<unsigned>(
"precision");
163 params.set<
Real>(
"mol_cutoff") = getParam<Real>(
"mol_cutoff");
164 params.set<
Real>(
"stoichiometry_tolerance") = getParam<Real>(
"stoichiometry_tolerance");
165 params.set<
bool>(
"solver_info") = getParam<bool>(
"solver_info");
166 params.set<UserObjectName>(
"nearest_node_number_UO") =
"geochemistry_nearest_node_number";
167 params.set<
ExecFlagEnum>(
"execute_on") = getParam<ExecFlagEnum>(
"execute_console_output_on");
168 _problem->addOutput(class_name,
"geochemistry_console_output", params);
174 getParam<UserObjectName>(
"model_definition"))
177 if (getParam<bool>(
"add_aux_temperature"))
180 if (getParam<bool>(
"add_aux_solvent_kg"))
182 if (getParam<bool>(
"add_aux_activity"))
184 if (getParam<bool>(
"add_aux_bulk_moles"))
187 if (getParam<bool>(
"add_aux_pH"))
192 for (
unsigned i = 1; i < num_basis; ++i)
204 if (getParam<bool>(
"add_aux_activity"))
207 if (getParam<bool>(
"add_aux_bulk_moles"))
212 for (
unsigned j = 0;
j < num_eqm; ++
j)
222 if (getParam<bool>(
"add_aux_activity"))
224 if (getParam<bool>(
"add_aux_bulk_moles"))
230 for (
unsigned k = 0;
k < num_kin; ++
k)
236 if (getParam<bool>(
"add_aux_kinetic_moles"))
238 if (getParam<bool>(
"add_aux_kinetic_additions"))
246 if (getParam<bool>(
"add_aux_surface_charge"))
247 addAuxSpecies(
"surface_charge_" + mineral, mineral,
"surface_charge");
248 if (getParam<bool>(
"add_aux_surface_potential"))
249 addAuxSpecies(
"surface_potential_" + mineral, mineral,
"surface_potential");
256 const std::string & species_name,
257 const std::string & quantity)
261 _problem->addAuxVariable(
"MooseVariable", var_name, var_params);
263 const std::string class_name =
"GeochemistryQuantityAux";
265 params.
set<std::string>(
"species") = species_name;
266 params.set<
MooseEnum>(
"quantity") = quantity;
267 params.set<UserObjectName>(
"reactor") = getParam<UserObjectName>(
"geochemistry_reactor_name");
268 params.set<AuxVariableName>(
"variable") = var_name;
270 _problem->addAuxKernel(class_name, var_name, params);
virtual void act() override
registerMooseAction("GeochemistryApp", AddGeochemistrySolverAction, "add_output")
std::vector< bool > kin_species_mineral
kin_species_mineral[j] = true iff the j^th kinetic species is a mineral
std::vector< std::string > surface_sorption_name
surface_sorption_name[k] = name of the mineral involved in surface sorption.
static InputParameters validParams()
const ModelGeochemicalDatabase mgd
InputParameters getValidParams(const std::string &name) const
const ExecFlagType EXEC_TIMESTEP_END
static InputParameters sharedParams()
contains params that are shared with AddGeochemistrySolverAction and its children ...
User object that parses a geochemical database file, and only retains information relevant to the cur...
static InputParameters sharedParams()
contains params that are shared with Actions that use this object
static InputParameters validParams()
ExecFlagEnum getDefaultExecFlagEnum()
bool isParamValid(const std::string &name) const
static InputParameters validParams()
const ModelGeochemicalDatabase & getDatabase() const
provides a reference to the pertinent geochemical database held by this object
AddGeochemistrySolverAction(const InputParameters ¶meters)
const T & getParam(const std::string &name) const
const std::string & _current_task
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< bool > basis_species_mineral
basis_species_mineral[j] = true iff the j^th basis species is a mineral
std::shared_ptr< FEProblemBase > & _problem
std::vector< std::string > kin_species_name
kin_species_name[j] = name of the j^th kinetic species
Data structure to hold all relevant information from the database file.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Action that sets up GeochemistryConsoleOutput and various AuxVariables.
std::vector< bool > eqm_species_mineral
eqm_species_mineral[i] = true iff the i^th equilibrium species is a mineral
const ExecFlagType EXEC_FINAL
std::vector< std::string > eqm_species_name
eqm_species_name[i] = name of the i^th eqm species
static const std::string k
std::vector< std::string > basis_species_name
basis_species_name[j] = name of the j^th basis species
void addAuxSpecies(const std::string &var_name, const std::string &species_name, const std::string &unit)
Adds AuxVariable and AuxKernel that will record species concentrations.
const ExecFlagType EXEC_INITIAL