22 "Variable that is the porepressure of phase 0 (the liquid phase)");
24 "Variable that is the saturation of phase 1 (the gas phase)");
26 "Name of the UserObject defining the capillary pressure");
27 params.
addClassDescription(
"This Material calculates the 2 porepressures and the 2 saturations " 28 "in a 2-phase situation, and derivatives of these with " 29 "respect to the PorousFlowVariables.");
36 _phase0_porepressure(_nodal_material
37 ? this->template coupledGenericDofValue<is_ad>(
"phase0_porepressure")
38 : this->template coupledGenericValue<is_ad>(
"phase0_porepressure")),
39 _phase0_gradp_qp(this->template coupledGenericGradient<is_ad>(
"phase0_porepressure")),
40 _phase0_porepressure_varnum(coupled(
"phase0_porepressure")),
41 _pvar(_dictator.isPorousFlowVariable(_phase0_porepressure_varnum)
42 ? _dictator.porousFlowVariableNum(_phase0_porepressure_varnum)
45 _phase1_saturation(_nodal_material
46 ? this->template coupledGenericDofValue<is_ad>(
"phase1_saturation")
47 : this->template coupledGenericValue<is_ad>(
"phase1_saturation")),
48 _phase1_grads_qp(this->template coupledGenericGradient<is_ad>(
"phase1_saturation")),
49 _phase1_saturation_varnum(coupled(
"phase1_saturation")),
50 _svar(_dictator.isPorousFlowVariable(_phase1_saturation_varnum)
51 ? _dictator.porousFlowVariableNum(_phase1_saturation_varnum)
56 if (_dictator.numPhases() != 2)
57 mooseError(
"The Dictator proclaims that the number of phases is ",
58 _dictator.numPhases(),
59 " whereas PorousFlow2PhasePS can only be used for 2-phase simulation. Be aware " 60 "that the Dictator has noted your mistake.");
79 const auto dpc = _pc_uo.dCapillaryPressure(1.0 - _phase1_saturation[_qp]);
83 (*_grads_qp)[_qp][0] = -_phase1_grads_qp[_qp];
84 (*_grads_qp)[_qp][1] = _phase1_grads_qp[_qp];
85 (*_gradp_qp)[_qp][0] = _phase0_gradp_qp[_qp];
86 (*_gradp_qp)[_qp][1] = _phase0_gradp_qp[_qp] - dpc * (*_grads_qp)[_qp][1];
92 if (_dictator.isPorousFlowVariable(_phase0_porepressure_varnum))
95 for (
unsigned phase = 0; phase < _num_phases; ++phase)
97 (*_dporepressure_dvar)[_qp][phase][_pvar] = 1.0;
99 (*_dgradp_qp_dgradv)[_qp][phase][_pvar] = 1.0;
104 if (_dictator.isPorousFlowVariable(_phase1_saturation_varnum))
108 (*_dsaturation_dvar)[_qp][0][_svar] = -1.0;
109 (*_dsaturation_dvar)[_qp][1][_svar] = 1.0;
110 (*_dporepressure_dvar)[_qp][1][_svar] = -dpc;
112 if (!_nodal_material)
114 (*_dgrads_qp_dgradv)[_qp][0][_svar] = -1.0;
115 (*_dgrads_qp_dgradv)[_qp][1][_svar] = 1.0;
117 const auto d2pc_qp = _pc_uo.d2CapillaryPressure(1.0 - _phase1_saturation[_qp]);
119 (*_dgradp_qp_dv)[_qp][1][_svar] = d2pc_qp * (*_grads_qp)[_qp][1];
120 (*_dgradp_qp_dgradv)[_qp][1][_svar] = -dpc;
126 template <
bool is_ad>
130 _saturation[_qp][0] = 1.0 - _phase1_saturation[_qp];
131 _saturation[_qp][1] = _phase1_saturation[_qp];
133 const auto pc = _pc_uo.capillaryPressure(1.0 - _phase1_saturation[_qp]);
134 _porepressure[_qp][0] = _phase0_porepressure[_qp];
135 _porepressure[_qp][1] = _phase0_porepressure[_qp] + pc;
virtual void computeQpProperties() override
virtual void computeQpProperties() override
Material designed to calculate fluid-phase porepressures and saturations at nodes and qps using a spe...
virtual void initQpStatefulProperties() override
void buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints. ...
void mooseError(Args &&... args)
static InputParameters validParams()
PorousFlow2PhasePSTempl(const InputParameters ¶meters)
Base class for capillary pressure for multiphase flow in porous media.
Base class for thermophysical variable materials, which assemble materials for primary variables such...
virtual void initQpStatefulProperties() override
registerMooseObject("PorousFlowApp", PorousFlow2PhasePS)
static InputParameters validParams()