Go to the documentation of this file.
18 InputParameters params = validParams<Kernel>();
19 params.addParam<Real>(
22 "Weight of equilibrium species concentration in the primary species concentration");
24 "log_k", 0.0,
"Equilibrium constant of the equilbrium reaction in dissociation form");
25 params.addParam<Real>(
"sto_u",
27 "Stoichiometric coef of the primary species this kernel "
28 "operates on in the equilibrium reaction");
30 "gamma_u", 1.0,
"Activity coefficient of primary species that this kernel operates on");
31 params.addParam<std::vector<Real>>(
"sto_v",
32 "The stoichiometric coefficients of coupled primary species");
33 params.addCoupledVar(
"v",
"List of coupled primary species in this equilibrium species");
34 params.addCoupledVar(
"gamma_v", 1.0,
"Activity coefficients of coupled primary species");
35 params.addCoupledVar(
"gamma_eq", 1.0,
"Activity coefficient of this equilibrium species");
36 params.addClassDescription(
"Diffusion of equilibrium species");
42 _diffusivity(getMaterialProperty<Real>(
"diffusivity")),
43 _weight(getParam<Real>(
"weight")),
44 _log_k(coupledValue(
"log_k")),
45 _sto_u(getParam<Real>(
"sto_u")),
46 _sto_v(getParam<std::vector<Real>>(
"sto_v")),
47 _gamma_u(coupledValue(
"gamma_u")),
48 _gamma_eq(coupledValue(
"gamma_eq"))
50 const unsigned int n = coupledComponents(
"v");
54 mooseError(
"The number of stoichiometric coefficients in sto_v is not equal to the number of "
55 "coupled species in ",
58 if (isCoupled(
"gamma_v"))
59 if (coupledComponents(
"gamma_v") != n)
60 mooseError(
"The number of activity coefficients in gamma_v is not equal to the number of "
61 "coupled species in ",
69 for (
unsigned int i = 0; i < n; ++i)
71 _vars[i] = coupled(
"v", i);
72 _vals[i] = &coupledValue(
"v", i);
75 _gamma_v[i] = (isCoupled(
"gamma_v") ? &coupledValue(
"gamma_v", i) : &coupledValue(
"gamma_v"));
84 for (
unsigned int i = 0; i <
_vals.size(); ++i)
89 for (
unsigned int i = 0; i <
_vals.size(); ++i)
95 for (
unsigned int j = 0; j <
_vals.size(); ++j)
102 mooseAssert(
_gamma_eq[_qp] > 0.0,
"Activity coefficient must be greater than zero");
115 for (
unsigned int i = 0; i <
_vals.size(); ++i)
125 for (
unsigned int i = 0; i <
_vals.size(); ++i)
130 for (
unsigned int j = 0; j <
_vals.size(); ++j)
145 if (
_vals.size() == 0)
154 for (
unsigned int i = 0; i <
_vals.size(); ++i)
156 if (jvar ==
_vars[i])
168 for (
unsigned int i = 0; i <
_vals.size(); ++i)
169 if (jvar ==
_vars[i])
181 for (
unsigned int i = 0; i <
_vals.size(); ++i)
182 if (jvar !=
_vars[i])
188 unsigned int var = 0;
190 for (
unsigned int i = 0; i <
_vals.size(); ++i)
191 if (jvar ==
_vars[i])
198 for (
unsigned int i = 0; i <
_vals.size(); ++i)
205 for (
unsigned int j = 0; j <
_vals.size(); ++j)
206 if (j != var && j != i)
213 (diff1 + diff2 + diff3_sum) /
_gamma_eq[_qp];
const std::vector< Real > _sto_v
Stoichiometric coefficients of the coupled primary species.
Diffusion of primary species in given equilibrium species.
std::vector< const VariableGradient * > _grad_vals
Coupled gradients of primary species concentrations.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::vector< const VariableValue * > _vals
Coupled primary species concentrations.
VectorValue< Real > RealGradient
registerMooseObject("ChemicalReactionsApp", CoupledDiffusionReactionSub)
virtual Real computeQpJacobian() override
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const Real _sto_u
Stoichiometric coefficient of the primary species.
const VariableValue & _gamma_eq
Activity coefficient of equilibrium species.
const Real _weight
Weight of the equilibrium species concentration in the total primary species concentration.
virtual Real computeQpResidual() override
std::vector< const VariableValue * > _gamma_v
Activity coefficients of coupled primary species in the equilibrium species.
CoupledDiffusionReactionSub(const InputParameters ¶meters)
const MaterialProperty< Real > & _diffusivity
Material property of dispersion-diffusion coefficient.
std::vector< unsigned int > _vars
Coupled primary species variable numbers.
InputParameters validParams< CoupledDiffusionReactionSub >()
const VariableValue & _gamma_u
Activity coefficient of primary species in the equilibrium species.
const VariableValue & _log_k
Equilibrium constant for the equilibrium species in association form.