19 "Variable that is the porepressure of phase 0. This is assumed to "
20 "be the liquid phase. It will be <= phase1_porepressure.");
22 "Variable that is the porepressure of phase 1 (the gas phase)");
24 "liquid_phase", 0,
"Phase number of the liquid phase (more precisely, the phase of phase0)");
26 "This Material is used for 2-phase situations. It calculates the 2 saturations given the 2 "
27 "porepressures, assuming the capillary pressure is hysteretic. Derivatives of these "
28 "quantities are also computed");
34 _pc(_nodal_material ? declareProperty<Real>(
"PorousFlow_hysteretic_capillary_pressure_nodal")
35 : declareProperty<Real>(
"PorousFlow_hysteretic_capillary_pressure_qp")),
36 _phase0_porepressure(_nodal_material ? coupledDofValues(
"phase0_porepressure")
37 : coupledValue(
"phase0_porepressure")),
38 _phase0_gradp_qp(coupledGradient(
"phase0_porepressure")),
39 _phase0_porepressure_varnum(coupled(
"phase0_porepressure")),
40 _p0var(_dictator.isPorousFlowVariable(_phase0_porepressure_varnum)
41 ? _dictator.porousFlowVariableNum(_phase0_porepressure_varnum)
44 _phase1_porepressure(_nodal_material ? coupledDofValues(
"phase1_porepressure")
45 : coupledValue(
"phase1_porepressure")),
46 _phase1_gradp_qp(coupledGradient(
"phase1_porepressure")),
47 _phase1_porepressure_varnum(coupled(
"phase1_porepressure")),
48 _p1var(_dictator.isPorousFlowVariable(_phase1_porepressure_varnum)
49 ? _dictator.porousFlowVariableNum(_phase1_porepressure_varnum)
53 mooseError(
"The Dictator announces that the number of phases is ",
54 _dictator.numPhases(),
55 " whereas PorousFlow2PhaseHysPP can only be used for 2-phase simulation. When you "
56 "have efficient government, you have dictatorship.");
73 const Real pc =
_pc[_qp];
80 (*_grads_qp)[_qp][0] = ds * ((*_gradp_qp)[_qp][1] - (*_gradp_qp)[_qp][0]);
81 (*_grads_qp)[_qp][1] = -(*_grads_qp)[_qp][0];
88 (*_dporepressure_dvar)[_qp][0][
_p0var] = 1.0;
90 (*_dgradp_qp_dgradv)[_qp][0][
_p0var] = 1.0;
94 (*_dporepressure_dvar)[_qp][1][
_p1var] = 1.0;
96 (*_dgradp_qp_dgradv)[_qp][1][
_p1var] = 1.0;
101 (*_dsaturation_dvar)[_qp][0][
_p0var] = -ds;
102 (*_dsaturation_dvar)[_qp][1][
_p0var] = ds;
106 (*_dsaturation_dvar)[_qp][0][
_p1var] = ds;
107 (*_dsaturation_dvar)[_qp][1][
_p1var] = -ds;
111 if (!_nodal_material)
116 (*_dgrads_qp_dgradv)[_qp][0][
_p0var] = -ds;
118 (*_dgrads_qp_dgradv)[_qp][1][
_p0var] = ds;
123 (*_dgrads_qp_dgradv)[_qp][0][
_p1var] = ds;
125 (*_dgrads_qp_dgradv)[_qp][1][
_p1var] = -ds;
void mooseError(Args &&... args)
registerMooseObject("PorousFlowApp", PorousFlow2PhaseHysPP)
Material designed to calculate the 2 porepressures and 2 saturations, as well as derivatives of them,...
const VariableValue & _phase1_porepressure
Nodal or quadpoint value of porepressure of the one phase (eg, the gas phase)
const unsigned int _phase0_porepressure_varnum
Moose variable number of the phase0 porepressure.
const unsigned int _p0var
PorousFlow variable number of the phase0 porepressure.
const VariableGradient & _phase1_gradp_qp
Gradient(phase1_porepressure) at the qps.
void buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints.
virtual void computeQpProperties() override
const unsigned int _p1var
PorousFlow variable number of the phase1 porepressure.
MaterialProperty< Real > & _pc
Computed nodal or quadpoint values of capillary pressure.
const VariableGradient & _phase0_gradp_qp
Gradient(phase0_porepressure) at the qps.
static InputParameters validParams()
virtual void initQpStatefulProperties() override
const VariableValue & _phase0_porepressure
Nodal or quadpoint value of porepressure of the zero phase (eg, the water phase)
PorousFlow2PhaseHysPP(const InputParameters ¶meters)
const unsigned int _phase1_porepressure_varnum
Moose variable number of the phase1 porepressure.
Base material designed to calculate and store quantities relevant for hysteretic capillary pressure c...
Real d2liquidSaturationQp(Real pc) const
Real dliquidSaturationQp(Real pc) const
virtual void initQpStatefulProperties() override
virtual void computeQpProperties() override
static InputParameters validParams()
Real liquidSaturationQp(Real pc) 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.