Go to the documentation of this file.
18 InputParameters params = validParams<AuxKernel>();
19 params.addCoupledVar(
"log_k", 0.0,
"The equilibrium constant in dissociation form");
20 params.addRequiredParam<std::vector<Real>>(
"sto_v",
21 "The stoichiometric coefficient of reactants");
22 params.addRequiredCoupledVar(
23 "v",
"The list of primary species participating in this equilibrium species");
24 params.addCoupledVar(
"gamma", 1.0,
"Activity coefficient of this secondary equilibrium species");
25 params.addCoupledVar(
"gamma_v", 1.0,
"Activity coefficients of coupled primary species");
26 params.addClassDescription(
"Concentration of secondary equilibrium species");
31 : AuxKernel(parameters),
32 _log_k(coupledValue(
"log_k")),
33 _sto_v(getParam<std::vector<Real>>(
"sto_v")),
34 _gamma_eq(coupledValue(
"gamma"))
36 const unsigned int n = coupledComponents(
"v");
40 mooseError(
"The number of stoichiometric coefficients in sto_v is not equal to the number of "
41 "coupled species in ",
45 if (isCoupled(
"gamma_v"))
46 if (coupledComponents(
"gamma_v") != n)
47 mooseError(
"The number of activity coefficients in gamma_v is not equal to the number of "
48 "coupled species in ",
54 for (
unsigned int i = 0; i < n; ++i)
56 _vals[i] = &coupledValue(
"v", i);
58 _gamma_v[i] = (isCoupled(
"gamma_v") ? &coupledValue(
"gamma_v", i) : &coupledValue(
"gamma_v"));
65 Real conc_product = 1.0;
67 for (
unsigned int i = 0; i <
_vals.size(); ++i)
70 mooseAssert(
_gamma_eq[_qp] > 0.0,
"Activity coefficient must be greater than zero");
registerMooseObject("ChemicalReactionsApp", AqueousEquilibriumRxnAux)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
InputParameters validParams< AqueousEquilibriumRxnAux >()
AqueousEquilibriumRxnAux(const InputParameters ¶meters)
const VariableValue & _gamma_eq
Activity coefficient of equilibrium species.
const VariableValue & _log_k
Equilibrium constant.
virtual Real computeValue() override
Calculates equilibrium species concentration according to the mass action law.
const std::vector< Real > _sto_v
Stoichiometric coefficients of coupled primary species.
std::vector< const VariableValue * > _gamma_v
Activity coefficients of coupled primary species.
std::vector< const VariableValue * > _vals
Coupled primary species.