14 #include "libmesh/quadrature.h" 27 "PorousFlowDictator",
"The UserObject that holds the list of PorousFlow variable names.");
29 "conc_var",
"The variable that represents the concentration of desorped species");
39 _conc_var_number(this->coupled(
"conc_var")),
40 _conc(this->template coupledGenericValue<is_ad>(
"conc_var")),
41 _conc_old(this->coupledValueOld(
"conc_var")),
42 _porosity(this->template getGenericMaterialProperty<
Real, is_ad>(
"PorousFlow_porosity_qp")),
43 _porosity_old(this->template getMaterialPropertyOld<
Real>(
"PorousFlow_porosity_qp")),
44 _dporosity_dvar(is_ad ? nullptr
45 : &this->template getMaterialProperty<
std::vector<
Real>>(
46 "dPorousFlow_porosity_qp_dvar")),
47 _dporosity_dgradvar(is_ad ? nullptr
49 "dPorousFlow_porosity_qp_dgradvar"))
58 Real c_old = (1.0 - _porosity_old[_qp]) * _conc_old[_qp];
59 return _test[_i][_qp] * (
c - c_old) / this->_dt;
66 return computeQpJac(_var.number());
73 return computeQpJac(jvar);
84 if (jvar == _conc_var_number)
85 deriv = (1.0 - this->_porosity[this->_qp]) * this->_phi[this->_j][this->_qp];
87 if (_dictator.notPorousFlowVariable(jvar))
88 return this->_test[this->_i][this->_qp] *
deriv / this->_dt;
89 const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
91 deriv -= (*_dporosity_dgradvar)[this->_qp][pvar] * this->_grad_phi[this->_j][this->_qp] *
92 this->_conc[this->_qp];
93 deriv -= (*_dporosity_dvar)[this->_qp][pvar] * this->_phi[this->_j][this->_qp] *
94 this->_conc[this->_qp];
96 return this->_test[this->_i][this->_qp] *
deriv / this->_dt;
virtual Real computeQpJacobian() override
Moose::GenericType< Real, is_ad > GenericReal
PorousFlowDesorpedMassTimeDerivativeTempl(const InputParameters ¶meters)
Kernel = (desorped_mass - desorped_mass_old)/dt It is NOT lumped to the nodes.
static InputParameters validParams()
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
void libmesh_ignore(const Args &...)
Real deriv(unsigned n, unsigned alpha, unsigned beta, Real x)
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...
registerMooseObject("PorousFlowApp", PorousFlowDesorpedMassTimeDerivative)
virtual GenericReal< is_ad > computeQpResidual() override
static InputParameters validParams()
Real computeQpJac(unsigned int jvar)
Derivative of residual with respect to variable number jvar (non-AD path only)