22 params.
addClassDescription(
"Forms the equations for the chemical reaction networks in a fluid" 23 " medium using a continuous Galerkin finite element discretization.");
27 params.
renameParam(
"solver_variables",
"primary_species",
"The list of primary species to add");
29 "auxiliary_variables",
"secondary_species",
"The list of secondary species to add");
31 "variable_order",
"order",
"Order of both the primary and secondary species variables");
32 params.
renameParam(
"equation_scaling",
"scaling",
"");
33 params.
setDocString(
"reactions",
"The list of equilibrium reactions occuring in the fluid");
37 params.
addParam<
bool>(
"add_darcy_advection_term",
39 "Whether to add an advection term using the Darcy equation to compute the " 40 "advecting velocity");
41 params.
addParam<std::vector<VariableName>>(
42 "pressure", {},
"Pressure variable (for Darcy advection)");
44 "gravity",
RealVectorValue(0, 0, -9.81),
"Gravity vector (for Darcy advection)");
52 _sto_u(_num_solver_species),
53 _sto_v(_num_solver_species),
54 _weights(_num_solver_species),
55 _primary_participation(_num_solver_species),
56 _coupled_v(_num_solver_species),
57 _pressure_var(getParam<
std::vector<VariableName>>(
"pressure"))
68 const auto & products =
reaction.getProductSpecies();
69 if (products.size() != 1)
71 "\n has more than one product species (on the RHS). This Physics only supports " 72 "one product species per reaction");
82 "Equilibrium constant species in square brackets must be specified as a float, " 87 "'\n is missing an equilibrium constant [K=] or its logarithm [log10_K=] in " 152 params_sub.
set<std::vector<Real>>(
"sto_v") =
_sto_v[i][
j];
153 params_sub.
set<std::vector<VariableName>>(
"v") =
_coupled_v[i][
j];
154 _problem->addKernel(
"CoupledBEEquilibriumSub",
166 params_cd.
set<std::vector<Real>>(
"sto_v") =
_sto_v[i][
j];
168 _problem->addKernel(
"CoupledDiffusionReactionSub",
174 if (getParam<bool>(
"add_darcy_advection_term") &&
isParamValid(
"pressure"))
182 params_conv.
set<std::vector<Real>>(
"sto_v") =
_sto_v[i][
j];
183 params_conv.
set<std::vector<VariableName>>(
"v") =
_coupled_v[i][
j];
186 _problem->addKernel(
"CoupledConvectionReactionSub",
210 "Coefs are for solver + auxiliary");
211 std::vector<Real> stos_primary(
_stos[
j].begin(),
213 params_eq.
set<std::vector<Real>>(
"sto_v") = stos_primary;
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
AqueousReactionsEquilibriumPhysics(const InputParameters ¶meters)
const std::vector< ReactionNetworkUtils::Reaction > _reactions
Reaction network after being parsed in initializePhysics()
std::vector< std::vector< Real > > _stos
Stoichiometric coefficients for each primary species (outer indexing) in each reaction.
void paramError(const std::string ¶m, Args... args) const
std::vector< std::string > _reactions_input
Reaction network as a vector of lines for pretty output.
const unsigned int _num_reactions
Number of reactions involved in the network.
registerReactionNetworkPhysicsBaseTasks("ChemicalReactionsApp", AqueousReactionsEquilibriumPhysics)
InputParameters getValidParams(const std::string &name) const
const std::vector< VariableName > & _solver_species
Name of the species variables to solve for in the reaction network.
std::vector< std::vector< VariableName > > _solver_species_involved
Primary species involved in the ith equilibrium reaction (outer indexing)
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void addFEKernels() override
static InputParameters validParams()
std::vector< SubdomainName > _blocks
static InputParameters validParams()
virtual FEProblemBase & getProblem()
virtual void addAuxiliaryKernels() override
Base class to host all common parameters and attributes of Physics actions to solve equations for mul...
const std::vector< AuxVariableName > & _aux_species
Name of the species variables that can be computed without additional solves, simply auxkernels...
std::vector< std::vector< std::vector< Real > > > _sto_v
Stoichiometric coefficients of coupled primary variables (outer indexing) in each reaction...
Creates all the objects needed to solve a reaction network of chemical reactions at equilibrium in an...
std::vector< std::vector< std::vector< VariableName > > > _coupled_v
Coupled primary species for each reaction (outer indexing is primary species, then reactions then inn...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::vector< bool > > _primary_participation
Vector of vectors, indexed by (i, j), of whether primary solver species 'i' is present in reaction 'j...
registerMooseAction("ChemicalReactionsApp", AqueousReactionsEquilibriumPhysics, "add_kernel")
std::vector< std::vector< Real > > _sto_u
Stoichiometric coefficients of primary/solver variables (outer indexing) in each reaction.
std::vector< Real > _log_eq_const
log10(Equilibrium constants) for each reaction
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< std::vector< Real > > _weights
Weight of each primary species (outer indexing) in each reaction.
bool isParamValid(const std::string &name) const
const std::vector< VariableName > & _pressure_var
Name of the pressure variable.
static const std::string k
auto index_range(const T &sizable)
std::vector< VariableName > _eq_species
Equilibrium species: only one per reaction. This is a restriction of this implementation.