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;
void mooseError(Args &&... args)
registerMooseObject("PorousFlowApp", PorousFlow2PhaseHysPS)
Material designed to calculate the 2 porepressures and 2 saturations, as well as derivatives of them,...
const unsigned int _svar
PorousFlow variable number of the phase1 saturation.
static InputParameters validParams()
const VariableGradient & _phase0_gradp_qp
Gradient(phase0_porepressure) at the qps.
const VariableValue & _phase1_saturation
Nodal or quadpoint value of saturation of phase one (the gas phase)
const unsigned int _phase0_porepressure_varnum
Moose variable number of the phase0 porepressure.
const unsigned int _pvar
PorousFlow variable number of the phase0 porepressure.
virtual void computeQpProperties() override
virtual void initQpStatefulProperties() override
void buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints.
MaterialProperty< Real > & _pc
Computed nodal or quadpoint values of capillary pressure.
const VariableValue & _phase0_porepressure
Nodal or quadpoint value of porepressure of phase zero (the liquid phase)
PorousFlow2PhaseHysPS(const InputParameters ¶meters)
const VariableGradient & _phase1_grads_qp
Gradient(phase1_saturation) at the qps.
const unsigned int _phase1_saturation_varnum
Moose variable number of the phase1 saturation.
Base material designed to calculate and store quantities relevant for hysteretic capillary pressure c...
Real capillaryPressureQp(Real sat) const
virtual void initQpStatefulProperties() override
virtual void computeQpProperties() override
Real dcapillaryPressureQp(Real sat) const
static InputParameters validParams()
Real d2capillaryPressureQp(Real sat) const
const unsigned int _num_phases
Number of phases.
GenericMaterialProperty< std::vector< Real >, is_ad > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
GenericMaterialProperty< std::vector< Real >, is_ad > & _saturation
Computed nodal or qp saturation of the phases.