20 params.
addParam<
Real>(
"weight", 1.0,
"Weight of the equilibrium species");
21 params.
addCoupledVar(
"log_k", 0.0,
"Equilibrium constant of dissociation equilibrium reaction");
24 "Stoichiometric coef of the primary species the kernel " 25 "operates on in the equilibrium reaction");
27 "gamma_u", 1.0,
"Activity coefficient of primary species that this kernel operates on");
31 "The stoichiometric coefficients of coupled primary species in equilibrium reaction");
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");
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 _cond(getMaterialProperty<
Real>(
"conductivity")),
50 _density(getDefaultMaterialProperty<
Real>(
"density")),
51 _grad_p(coupledGradient(
"p")),
53 _vars(coupledIndices(
"v")),
54 _vals(coupledValues(
"v")),
55 _grad_vals(coupledGradients(
"v")),
56 _gamma_u(coupledValue(
"gamma_u")),
57 _gamma_v(isCoupled(
"gamma_v")
58 ? coupledValues(
"gamma_v")
60 &coupledValue(
"gamma_v"))),
61 _gamma_eq(coupledValue(
"gamma_eq"))
63 const unsigned int n = coupledComponents(
"v");
67 mooseError(
"The number of stoichiometric coefficients in sto_v is not equal to the number of " 68 "coupled species in ",
71 if (isCoupled(
"gamma_v"))
72 if (coupledComponents(
"gamma_v") != n)
73 mooseError(
"The number of activity coefficients in gamma_v is not equal to the number of " 74 "coupled species in ",
87 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");
121 for (
unsigned int i = 0; i <
_vals.size(); ++i)
129 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
153 for (
unsigned int i = 0; i <
_vals.size(); ++i)
160 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
170 if (
_vals.size() == 0)
176 for (
unsigned int i = 0; i <
_vals.size(); ++i)
178 if (jvar ==
_vars[i])
188 for (
unsigned int i = 0; i <
_vals.size(); ++i)
189 if (jvar ==
_vars[i])
200 for (
unsigned int i = 0; i <
_vals.size(); ++i)
201 if (jvar !=
_vars[i])
209 unsigned int var = 0;
211 for (
unsigned int i = 0; i <
_vals.size(); ++i)
212 if (jvar ==
_vars[i])
219 for (
unsigned int i = 0; i <
_vals.size(); ++i)
226 for (
unsigned int j = 0;
j <
_vals.size(); ++
j)
227 if (
j != var &&
j != i)
234 (diff1 + diff2 + diff3_sum) /
_gamma_eq[_qp];
virtual Real computeQpResidual() override
RealVectorValue RealGradient
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)