24 "Density (kg(precipitate)/m^3(precipitate)) of each secondary species in the " 25 "aqueous precipitation-dissolution reaction system");
27 "PorousFlowDictator",
"The UserObject that holds the list of PorousFlow variable names.");
29 "A vector of stoichiometric coefficients for the " 30 "primary species that is the Variable of this Kernel: " 31 "one for each precipitation-dissolution reaction " 32 "(these are one columns of the 'reactions' matrix)");
40 _mineral_density(this->template getParam<
std::vector<
Real>>(
"mineral_density")),
42 _aq_ph(_dictator.aqueousPhaseNumber()),
43 _porosity_old(this->template getMaterialPropertyOld<
Real>(
"PorousFlow_porosity_nodal")),
44 _saturation(this->template getGenericMaterialProperty<
std::vector<
Real>, is_ad>(
45 "PorousFlow_saturation_nodal")),
46 _dsaturation_dvar(is_ad ? nullptr
47 : &this->template getMaterialProperty<
std::vector<
std::vector<
Real>>>(
48 "dPorousFlow_saturation_nodal_dvar")),
49 _reaction_rate(this->template getGenericMaterialProperty<
std::vector<
Real>, is_ad>(
50 "PorousFlow_mineral_reaction_rate_nodal")),
51 _dreaction_rate_dvar(is_ad
53 : &this->template getMaterialProperty<
std::vector<
std::vector<
Real>>>(
54 "dPorousFlow_mineral_reaction_rate_nodal_dvar")),
55 _stoichiometry(this->template getParam<
std::vector<
Real>>(
"stoichiometry"))
65 "The Dictator proclaims that the number of precipitation-dissolution secondary " 66 "species in this simulation is ",
68 " whereas you have provided ",
70 ". The Dictator does not take such mistakes lightly");
75 "The Dictator proclaims that the number of precipitation-dissolution secondary " 76 "species in this simulation is ",
78 " whereas you have provided ",
80 ". The Dictator does not take such mistakes lightly");
99 for (
unsigned r = 0; r < _dictator.numAqueousKinetic(); ++r)
100 res += _stoichiometry[r] * _mineral_density[r] * _reaction_rate[_i][r];
101 return _test[_i][_qp] * res * _porosity_old[_i] * _saturation[_i][_aq_ph];
104 template <
bool is_ad>
108 if constexpr (!is_ad)
111 if (_dictator.notPorousFlowVariable(_var.number()))
113 return computeQpJac(_dictator.porousFlowVariableNum(_var.number()));
118 template <
bool is_ad>
122 if constexpr (!is_ad)
125 if (_dictator.notPorousFlowVariable(jvar))
127 return computeQpJac(_dictator.porousFlowVariableNum(jvar));
134 template <
bool is_ad>
138 if constexpr (!is_ad)
145 for (
unsigned r = 0; r < _dictator.numAqueousKinetic(); ++r)
147 dres += _stoichiometry[r] * _mineral_density[r] * (*_dreaction_rate_dvar)[_i][r][pvar];
148 res += _stoichiometry[r] * _mineral_density[r] * _reaction_rate[_i][r];
151 return _test[_i][_qp] *
152 (dres * _saturation[_i][_aq_ph] + res * (*_dsaturation_dvar)[_i][_aq_ph][pvar]) *
Moose::GenericType< Real, is_ad > GenericReal
const std::vector< Real > _stoichiometry
Stoichiometric coefficients.
void paramError(const std::string ¶m, Args... args) const
static InputParameters validParams()
const std::vector< Real > _mineral_density
Density of the mineral species.
void libmesh_ignore(const Args &...)
static InputParameters validParams()
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
virtual Real computeQpJacobian() override
unsigned int numAqueousKinetic() const
The number of aqueous kinetic secondary species.
registerMooseObject("PorousFlowApp", PorousFlowPreDis)
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
Kernel = sum (stoichiometry * density * porosity_old * saturation * reaction_rate) where the sum is o...
Base class for PorousFlow kernels that use mass-lumped (nodal) material properties.
Real computeQpJac(unsigned int pvar)
Derivative of residual wrt PorousFlow variable pvar (non-AD path only)
PorousFlowPreDisTempl(const InputParameters ¶meters)
virtual GenericReal< is_ad > computeQpResidual() override