12 #include "MooseVariable.h"
20 InputParameters params = validParams<TimeKernel>();
21 MooseEnum coupling_type(
"Hydro ThermoHydro HydroMechanical ThermoHydroMechanical",
"Hydro");
22 params.addParam<MooseEnum>(
"coupling_type",
24 "The type of simulation. For simulations involving Mechanical "
25 "deformations, you will need to supply the correct Biot coefficient. "
26 "For simulations involving Thermal flows, you will need an associated "
27 "ConstantThermalExpansionCoefficient Material");
28 params.addRangeCheckedParam<Real>(
29 "biot_coefficient", 1.0,
"biot_coefficient>=0 & biot_coefficient<=1",
"Biot coefficient");
30 params.addParam<
bool>(
"multiply_by_density",
32 "If true, then this Kernel is the time derivative of the fluid "
33 "mass. If false, then this Kernel is the derivative of the "
34 "fluid volume (which is common in poro-mechanics)");
35 params.addRequiredParam<UserObjectName>(
36 "PorousFlowDictator",
"The UserObject that holds the list of PorousFlow variable names.");
37 params.addClassDescription(
"Fully-saturated version of the single-component, single-phase fluid "
38 "mass derivative wrt time");
43 const InputParameters & parameters)
44 : TimeKernel(parameters),
46 _var_is_porflow_var(_dictator.isPorousFlowVariable(_var.number())),
47 _multiply_by_density(getParam<bool>(
"multiply_by_density")),
48 _coupling_type(getParam<MooseEnum>(
"coupling_type").getEnum<
CouplingTypeEnum>()),
53 _biot_coefficient(getParam<Real>(
"biot_coefficient")),
54 _biot_modulus(getMaterialProperty<Real>(
"PorousFlow_constant_biot_modulus_qp")),
55 _thermal_coeff(_includes_thermal ? &getMaterialProperty<Real>(
56 "PorousFlow_constant_thermal_expansion_coefficient_qp")
58 _fluid_density(_multiply_by_density ? &getMaterialProperty<std::vector<Real>>(
59 "PorousFlow_fluid_phase_density_qp")
61 _dfluid_density_dvar(_multiply_by_density
62 ? &getMaterialProperty<std::vector<std::vector<Real>>>(
63 "dPorousFlow_fluid_phase_density_qp_dvar")
65 _pp(getMaterialProperty<std::vector<Real>>(
"PorousFlow_porepressure_qp")),
66 _pp_old(getMaterialPropertyOld<std::vector<Real>>(
"PorousFlow_porepressure_qp")),
68 getMaterialProperty<std::vector<std::vector<Real>>>(
"dPorousFlow_porepressure_qp_dvar")),
69 _temperature(_includes_thermal ? &getMaterialProperty<Real>(
"PorousFlow_temperature_qp")
71 _temperature_old(_includes_thermal ? &getMaterialPropertyOld<Real>(
"PorousFlow_temperature_qp")
73 _dtemperature_dvar(_includes_thermal ? &getMaterialProperty<std::vector<Real>>(
74 "dPorousFlow_temperature_qp_dvar")
76 _strain_rate(_includes_mechanical
77 ? &getMaterialProperty<Real>(
"PorousFlow_volumetric_strain_rate_qp")
79 _dstrain_rate_dvar(_includes_mechanical ? &getMaterialProperty<std::vector<
RealGradient>>(
80 "dPorousFlow_volumetric_strain_rate_qp_dvar")
84 mooseError(
"PorousFlowFullySaturatedMassTimeDerivative is only applicable to single-phase, "
85 "single-component fluid-flow problems. The Dictator proclaims that you have more "
86 "than one phase or more than one fluid component. The Dictator does not take such "
93 const unsigned phase = 0;
96 volume -= (*_thermal_coeff)[_qp] * ((*_temperature)[_qp] - (*_temperature_old)[_qp]) / _dt;
100 return _test[_i][_qp] * (*_fluid_density)[_qp][phase] * volume;
101 return _test[_i][_qp] * volume;
125 const unsigned phase = 0;
130 volume -= (*_thermal_coeff)[_qp] * ((*_temperature)[_qp] - (*_temperature_old)[_qp]) / _dt;
131 dvolume -= (*_thermal_coeff)[_qp] * (*_dtemperature_dvar)[_qp][pvar] / _dt * _phi[_j][_qp];
136 dvolume +=
_biot_coefficient * (*_dstrain_rate_dvar)[_qp][pvar] * _grad_phi[_j][_qp];
139 return _test[_i][_qp] * ((*_fluid_density)[_qp][phase] * dvolume +
140 (*_dfluid_density_dvar)[_qp][phase][pvar] * _phi[_j][_qp] * volume);
141 return _test[_i][_qp] * dvolume;