21 "Weight of equilibrium species concentration in the primary species concentration");
23 "log_k", 0.0,
"Equilibrium constant of the equilbrium reaction in dissociation form");
26 "Stoichiometric coef of the primary species this kernel " 27 "operates on in the equilibrium reaction");
29 "gamma_u", 1.0,
"Activity coefficient of primary species that this kernel operates on");
31 "sto_v", {},
"The stoichiometric coefficients of coupled primary species");
32 params.
addCoupledVar(
"v",
"List of coupled primary species in this equilibrium species");
33 params.
addCoupledVar(
"gamma_v", 1.0,
"Activity coefficients of coupled primary species");
34 params.
addCoupledVar(
"gamma_eq", 1.0,
"Activity coefficient of this equilibrium species");
41 _diffusivity(getMaterialProperty<
Real>(
"diffusivity")),
42 _weight(getParam<
Real>(
"weight")),
43 _log_k(coupledValue(
"log_k")),
44 _sto_u(getParam<
Real>(
"sto_u")),
45 _sto_v(getParam<
std::vector<
Real>>(
"sto_v")),
46 _vars(coupledIndices(
"v")),
47 _vals(coupledValues(
"v")),
48 _grad_vals(coupledGradients(
"v")),
49 _gamma_u(coupledValue(
"gamma_u")),
50 _gamma_v(isCoupled(
"gamma_v")
51 ? coupledValues(
"gamma_v")
53 &coupledValue(
"gamma_v"))),
54 _gamma_eq(coupledValue(
"gamma_eq"))
60 mooseError(
"The number of stoichiometric coefficients in sto_v is not equal to the number of " 61 "coupled species in ",
66 mooseError(
"The number of activity coefficients in gamma_v is not equal to the number of " 67 "coupled species in ",
76 for (
unsigned int i = 0; i <
_vals.size(); ++i)
81 for (
unsigned int i = 0; i <
_vals.size(); ++i)
87 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
94 mooseAssert(
_gamma_eq[
_qp] > 0.0,
"Activity coefficient must be greater than zero");
107 for (
unsigned int i = 0; i <
_vals.size(); ++i)
117 for (
unsigned int i = 0; i <
_vals.size(); ++i)
122 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
137 if (
_vals.size() == 0)
146 for (
unsigned int i = 0; i <
_vals.size(); ++i)
148 if (jvar ==
_vars[i])
160 for (
unsigned int i = 0; i <
_vals.size(); ++i)
161 if (jvar ==
_vars[i])
173 for (
unsigned int i = 0; i <
_vals.size(); ++i)
174 if (jvar !=
_vars[i])
180 unsigned int var = 0;
182 for (
unsigned int i = 0; i <
_vals.size(); ++i)
183 if (jvar ==
_vars[i])
190 for (
unsigned int i = 0; i <
_vals.size(); ++i)
197 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
198 if (
j != var &&
j != i)
static InputParameters validParams()
const std::vector< const VariableValue * > _gamma_v
Activity coefficients of coupled primary species in the equilibrium species.
virtual bool isCoupled(const std::string &var_name, unsigned int i=0) const
const VariableGradient & _grad_u
static InputParameters validParams()
const VariableValue & _gamma_eq
Activity coefficient of equilibrium species.
const VariablePhiGradient & _grad_phi
const Real _weight
Weight of the equilibrium species concentration in the total primary species concentration.
CoupledDiffusionReactionSub(const InputParameters ¶meters)
const VariableValue & _log_k
Equilibrium constant for the equilibrium species in association form.
virtual Real computeQpResidual() override
Diffusion of primary species in given equilibrium species.
const std::vector< const VariableGradient * > _grad_vals
Coupled gradients of primary species concentrations.
const VariableValue & _gamma_u
Activity coefficient of primary species in the equilibrium species.
virtual Real computeQpJacobian() override
const std::vector< Real > _sto_v
Stoichiometric coefficients of the coupled primary species.
const std::vector< const VariableValue * > _vals
Coupled primary species concentrations.
const Real _sto_u
Stoichiometric coefficient of the primary species.
const std::vector< unsigned int > _vars
Coupled primary species variable numbers.
OutputTools< Real >::VariableValue VariableValue
unsigned int coupledComponents(const std::string &var_name) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("ChemicalReactionsApp", CoupledDiffusionReactionSub)
const VariableTestGradient & _grad_test
void mooseError(Args &&... args) const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const MaterialProperty< Real > & _diffusivity
Material property of dispersion-diffusion coefficient.
const VariablePhiValue & _phi
MooseUnits pow(const MooseUnits &, int)
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override