18 params.
addParam<
Real>(
"weight", 1.0,
"Weight of the equilibrium species");
19 params.
addCoupledVar(
"log_k", 0.0,
"Equilibrium constant of dissociation equilibrium reaction");
22 "Stoichiometric coef of the primary species the kernel " 23 "operates on in the equilibrium reaction");
25 "gamma_u", 1.0,
"Activity coefficient of primary species that this kernel operates on");
29 "The stoichiometric coefficients of coupled primary species in equilibrium reaction");
32 params.
addCoupledVar(
"gamma_v", 1.0,
"Activity coefficients of coupled primary species");
33 params.
addCoupledVar(
"gamma_eq", 1.0,
"Activity coefficient of this equilibrium species");
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 _cond(getMaterialProperty<
Real>(
"conductivity")),
48 _density(getDefaultMaterialProperty<
Real>(
"density")),
49 _grad_p(coupledGradient(
"p")),
51 _vars(coupledIndices(
"v")),
52 _vals(coupledValues(
"v")),
53 _grad_vals(coupledGradients(
"v")),
54 _gamma_u(coupledValue(
"gamma_u")),
55 _gamma_v(isCoupled(
"gamma_v")
56 ? coupledValues(
"gamma_v")
58 &coupledValue(
"gamma_v"))),
59 _gamma_eq(coupledValue(
"gamma_eq"))
61 const unsigned int n = coupledComponents(
"v");
65 mooseError(
"The number of stoichiometric coefficients in sto_v is not equal to the number of " 66 "coupled species in ",
69 if (isCoupled(
"gamma_v"))
70 if (coupledComponents(
"gamma_v") != n)
71 mooseError(
"The number of activity coefficients in gamma_v is not equal to the number of " 72 "coupled species in ",
85 for (
unsigned int i = 0; i <
_vals.size(); ++i)
93 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
100 mooseAssert(
_gamma_eq[_qp] > 0.0,
"Activity coefficient must be greater than zero");
119 for (
unsigned int i = 0; i <
_vals.size(); ++i)
127 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
151 for (
unsigned int i = 0; i <
_vals.size(); ++i)
158 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
168 if (
_vals.size() == 0)
174 for (
unsigned int i = 0; i <
_vals.size(); ++i)
176 if (jvar ==
_vars[i])
186 for (
unsigned int i = 0; i <
_vals.size(); ++i)
187 if (jvar ==
_vars[i])
198 for (
unsigned int i = 0; i <
_vals.size(); ++i)
199 if (jvar !=
_vars[i])
207 unsigned int var = 0;
209 for (
unsigned int i = 0; i <
_vals.size(); ++i)
210 if (jvar ==
_vars[i])
217 for (
unsigned int i = 0; i <
_vals.size(); ++i)
224 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
225 if (
j != var &&
j != i)
232 (diff1 + diff2 + diff3_sum) /
_gamma_eq[_qp];
virtual Real computeQpResidual() override
static InputParameters validParams()
const VariableValue & _gamma_eq
Activity coefficient of equilibrium species.
void mooseError(Args &&... args)
virtual Real computeQpJacobian() override
const std::vector< unsigned int > _vars
Coupled primary species variable numbers.
const MaterialProperty< Real > & _density
Fluid density.
const std::vector< Real > _sto_v
Stoichiometric coefficients of the coupled primary species.
Convection of primary species in given equilibrium species.
const VariableGradient & _grad_p
Pressure gradient.
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const unsigned int _pvar
Pressure variable number.
const VariableValue & _log_k
Equilibrium constant for the equilibrium species in association form.
const std::vector< const VariableValue * > _gamma_v
Activity coefficients of coupled primary species in the equilibrium species.
const Real _weight
Weight of the equilibrium species concentration in the total primary species concentration.
const RealVectorValue _gravity
Gravity.
const std::vector< const VariableGradient * > _grad_vals
Coupled gradients of primary species concentrations.
OutputTools< Real >::VariableValue VariableValue
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _sto_u
Stoichiometric coefficient of the primary species.
const MaterialProperty< Real > & _cond
Hydraulic conductivity.
const VariableValue & _gamma_u
Activity coefficient of primary species in the equilibrium species.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
registerMooseObject("ChemicalReactionsApp", CoupledConvectionReactionSub)
MooseUnits pow(const MooseUnits &, int)
const std::vector< const VariableValue * > _vals
Coupled primary species concentrations.
CoupledConvectionReactionSub(const InputParameters ¶meters)