52 _var_is_porflow_var(_dictator.isPorousFlowVariable(_var.number())),
53 _multiply_by_density(this->template getParam<bool>(
"multiply_by_density")),
60 _biot_coefficient(this->template getParam<Real>(
"biot_coefficient")),
61 _biot_modulus(this->template getMaterialProperty<Real>(
"PorousFlow_constant_biot_modulus_qp")),
62 _thermal_coeff(_includes_thermal ? &this->template getMaterialProperty<Real>(
63 "PorousFlow_constant_thermal_expansion_coefficient_qp")
65 _fluid_density(_multiply_by_density
66 ? &this->template getGenericMaterialProperty<
std::vector<Real>, is_ad>(
67 "PorousFlow_fluid_phase_density_qp")
69 _dfluid_density_dvar(_multiply_by_density && !is_ad
70 ? &this->template getMaterialProperty<
std::vector<
std::vector<Real>>>(
71 "dPorousFlow_fluid_phase_density_qp_dvar")
73 _pp(this->template getGenericMaterialProperty<
std::vector<Real>, is_ad>(
74 "PorousFlow_porepressure_qp")),
75 _pp_old(this->template getMaterialPropertyOld<
std::vector<Real>>(
"PorousFlow_porepressure_qp")),
76 _dpp_dvar(is_ad ? nullptr
77 : &this->template getMaterialProperty<
std::vector<
std::vector<Real>>>(
78 "dPorousFlow_porepressure_qp_dvar")),
79 _temperature(_includes_thermal ? &this->template getGenericMaterialProperty<Real, is_ad>(
80 "PorousFlow_temperature_qp")
82 _temperature_old(_includes_thermal
83 ? &this->template getMaterialPropertyOld<Real>(
"PorousFlow_temperature_qp")
85 _dtemperature_dvar(_includes_thermal && !is_ad
86 ? &this->template getMaterialProperty<
std::vector<Real>>(
87 "dPorousFlow_temperature_qp_dvar")
89 _strain_rate(_includes_mechanical ? &this->template getMaterialProperty<Real>(
90 "PorousFlow_volumetric_strain_rate_qp")
92 _dstrain_rate_dvar(_includes_mechanical && !is_ad
93 ? &this->template getMaterialProperty<
std::vector<RealGradient>>(
94 "dPorousFlow_volumetric_strain_rate_qp_dvar")
98 mooseError(
"PorousFlowFullySaturatedMassTimeDerivative is only applicable to single-phase, "
99 "single-component fluid-flow problems. The Dictator proclaims that you have more "
100 "than one phase or more than one fluid component. The Dictator does not take such "
151 if constexpr (!is_ad)
153 const unsigned phase = 0;
154 Real volume = (_pp[_qp][phase] - _pp_old[_qp][phase]) / _dt / _biot_modulus[_qp];
155 Real dvolume = (*_dpp_dvar)[_qp][phase][pvar] / _dt / _biot_modulus[_qp] * _phi[_j][_qp];
156 if (_includes_thermal)
158 volume -= (*_thermal_coeff)[_qp] * ((*_temperature)[_qp] - (*_temperature_old)[_qp]) / _dt;
159 dvolume -= (*_thermal_coeff)[_qp] * (*_dtemperature_dvar)[_qp][pvar] / _dt * _phi[_j][_qp];
161 if (_includes_mechanical)
163 volume += _biot_coefficient * (*_strain_rate)[_qp];
164 dvolume += _biot_coefficient * (*_dstrain_rate_dvar)[_qp][pvar] * _grad_phi[_j][_qp];
166 if (_multiply_by_density)
167 return _test[_i][_qp] * ((*_fluid_density)[_qp][phase] * dvolume +
168 (*_dfluid_density_dvar)[_qp][phase][pvar] * _phi[_j][_qp] * volume);
169 return _test[_i][_qp] * dvolume;
172 libmesh_ignore(pvar);