23 "Weight of equilibrium species concentration in the primary species concentration");
25 "log_k", 0.0,
"Equilibrium constant of the equilbrium reaction in dissociation form");
28 "Stoichiometric coef of the primary species this kernel " 29 "operates on in the equilibrium reaction");
31 "gamma_u", 1.0,
"Activity coefficient of primary species that this kernel operates on");
33 "sto_v", {},
"The stoichiometric coefficients of coupled primary species");
34 params.
addCoupledVar(
"v",
"List of coupled primary species in this equilibrium species");
35 params.
addCoupledVar(
"gamma_v", 1.0,
"Activity coefficients of coupled primary species");
36 params.
addCoupledVar(
"gamma_eq", 1.0,
"Activity coefficient of this equilibrium species");
43 _diffusivity(getMaterialProperty<
Real>(
"diffusivity")),
44 _weight(getParam<
Real>(
"weight")),
45 _log_k(coupledValue(
"log_k")),
46 _sto_u(getParam<
Real>(
"sto_u")),
47 _sto_v(getParam<
std::vector<
Real>>(
"sto_v")),
48 _vars(coupledIndices(
"v")),
49 _vals(coupledValues(
"v")),
50 _grad_vals(coupledGradients(
"v")),
51 _gamma_u(coupledValue(
"gamma_u")),
52 _gamma_v(isCoupled(
"gamma_v")
53 ? coupledValues(
"gamma_v")
55 &coupledValue(
"gamma_v"))),
56 _gamma_eq(coupledValue(
"gamma_eq"))
62 mooseError(
"The number of stoichiometric coefficients in sto_v is not equal to the number of " 63 "coupled species in ",
68 mooseError(
"The number of activity coefficients in gamma_v is not equal to the number of " 69 "coupled species in ",
78 for (
unsigned int i = 0; i <
_vals.size(); ++i)
83 for (
unsigned int i = 0; i <
_vals.size(); ++i)
89 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
96 mooseAssert(
_gamma_eq[
_qp] > 0.0,
"Activity coefficient must be greater than zero");
109 for (
unsigned int i = 0; i <
_vals.size(); ++i)
119 for (
unsigned int i = 0; i <
_vals.size(); ++i)
124 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
139 if (
_vals.size() == 0)
148 for (
unsigned int i = 0; i <
_vals.size(); ++i)
150 if (jvar ==
_vars[i])
162 for (
unsigned int i = 0; i <
_vals.size(); ++i)
163 if (jvar ==
_vars[i])
175 for (
unsigned int i = 0; i <
_vals.size(); ++i)
176 if (jvar !=
_vars[i])
182 unsigned int var = 0;
184 for (
unsigned int i = 0; i <
_vals.size(); ++i)
185 if (jvar ==
_vars[i])
192 for (
unsigned int i = 0; i <
_vals.size(); ++i)
199 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
200 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
RealVectorValue RealGradient
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