19 "phase0_porepressure",
20 "Variable that is the porepressure of phase 0, which is the liquid phase");
22 "phase1_saturation",
"Variable that is the saturation of phase 1, which is the gas phase");
23 params.
addClassDescription(
"This Material is used for 2-phase situations. It calculates the 2 " 24 "saturations and 2 porepressures, assuming the capillary pressure is " 25 "hysteretic. Derivatives of these quantities are also computed");
31 _pc(_nodal_material ? declareProperty<
Real>(
"PorousFlow_hysteretic_capillary_pressure_nodal")
32 : declareProperty<
Real>(
"PorousFlow_hysteretic_capillary_pressure_qp")),
33 _phase0_porepressure(_nodal_material ? coupledDofValues(
"phase0_porepressure")
34 : coupledValue(
"phase0_porepressure")),
35 _phase0_gradp_qp(coupledGradient(
"phase0_porepressure")),
36 _phase0_porepressure_varnum(coupled(
"phase0_porepressure")),
37 _pvar(_dictator.isPorousFlowVariable(_phase0_porepressure_varnum)
38 ? _dictator.porousFlowVariableNum(_phase0_porepressure_varnum)
41 _phase1_saturation(_nodal_material ? coupledDofValues(
"phase1_saturation")
42 : coupledValue(
"phase1_saturation")),
43 _phase1_grads_qp(coupledGradient(
"phase1_saturation")),
44 _phase1_saturation_varnum(coupled(
"phase1_saturation")),
45 _svar(_dictator.isPorousFlowVariable(_phase1_saturation_varnum)
46 ? _dictator.porousFlowVariableNum(_phase1_saturation_varnum)
50 mooseError(
"The Dictator announces that the number of phases is ",
51 _dictator.numPhases(),
52 " whereas PorousFlow2PhaseHysPS can only be used for 2-phase simulation. The " 53 "Dictator is always watching.");
84 for (
unsigned phase = 0; phase <
_num_phases; ++phase)
86 (*_dporepressure_dvar)[_qp][phase][
_pvar] = 1.0;
88 (*_dgradp_qp_dgradv)[_qp][phase][
_pvar] = 1.0;
97 (*_dsaturation_dvar)[_qp][0][
_svar] = -1.0;
98 (*_dsaturation_dvar)[_qp][1][
_svar] = 1.0;
99 (*_dporepressure_dvar)[_qp][1][
_svar] = -dpc;
101 if (!_nodal_material)
103 (*_dgrads_qp_dgradv)[_qp][0][
_svar] = -1.0;
104 (*_dgrads_qp_dgradv)[_qp][1][
_svar] = 1.0;
106 (*_dgradp_qp_dv)[_qp][1][
_svar] = d2pc_qp * (*_grads_qp)[_qp][1];
107 (*_dgradp_qp_dgradv)[_qp][1][
_svar] = -dpc;
Real d2capillaryPressureQp(Real sat) const
virtual void initQpStatefulProperties() override
const unsigned int _pvar
PorousFlow variable number of the phase0 porepressure.
const VariableGradient & _phase0_gradp_qp
Gradient(phase0_porepressure) at the qps.
const unsigned int _phase1_saturation_varnum
Moose variable number of the phase1 saturation.
void mooseError(Args &&... args)
Real capillaryPressureQp(Real sat) const
GenericMaterialProperty< std::vector< Real >, is_ad > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
static InputParameters validParams()
const VariableValue & _phase0_porepressure
Nodal or quadpoint value of porepressure of phase zero (the liquid phase)
registerMooseObject("PorousFlowApp", PorousFlow2PhaseHysPS)
const VariableGradient & _phase1_grads_qp
Gradient(phase1_saturation) at the qps.
PorousFlow2PhaseHysPS(const InputParameters ¶meters)
virtual void computeQpProperties() override
const unsigned int _phase0_porepressure_varnum
Moose variable number of the phase0 porepressure.
void buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints. ...
static InputParameters validParams()
Base material designed to calculate and store quantities relevant for hysteretic capillary pressure c...
virtual void initQpStatefulProperties() override
const unsigned int _svar
PorousFlow variable number of the phase1 saturation.
const unsigned int _num_phases
Number of phases.
const VariableValue & _phase1_saturation
Nodal or quadpoint value of saturation of phase one (the gas phase)
virtual void computeQpProperties() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Material designed to calculate the 2 porepressures and 2 saturations, as well as derivatives of them...
GenericMaterialProperty< std::vector< Real >, is_ad > & _saturation
Computed nodal or qp saturation of the phases.
MaterialProperty< Real > & _pc
Computed nodal or quadpoint values of capillary pressure.
Real dcapillaryPressureQp(Real sat) const