Go to the documentation of this file.
20 params.addRequiredCoupledVar(
"phase0_porepressure",
21 "Variable that is the porepressure of phase 0 (the liquid phase)");
22 params.addRequiredCoupledVar(
"phase1_saturation",
23 "Variable that is the saturation of phase 1 (the gas phase)");
24 params.addRequiredParam<UserObjectName>(
"capillary_pressure",
25 "Name of the UserObject defining the capillary pressure");
26 params.addClassDescription(
"This Material calculates the 2 porepressures and the 2 saturations "
27 "in a 2-phase situation, and derivatives of these with "
28 "respect to the PorousFlowVariables.");
35 _phase0_porepressure(_nodal_material ? coupledDofValues(
"phase0_porepressure")
36 : coupledValue(
"phase0_porepressure")),
37 _phase0_gradp_qp(coupledGradient(
"phase0_porepressure")),
38 _phase0_porepressure_varnum(coupled(
"phase0_porepressure")),
39 _pvar(_dictator.isPorousFlowVariable(_phase0_porepressure_varnum)
40 ? _dictator.porousFlowVariableNum(_phase0_porepressure_varnum)
43 _phase1_saturation(_nodal_material ? coupledDofValues(
"phase1_saturation")
44 : coupledValue(
"phase1_saturation")),
45 _phase1_grads_qp(coupledGradient(
"phase1_saturation")),
46 _phase1_saturation_varnum(coupled(
"phase1_saturation")),
47 _svar(_dictator.isPorousFlowVariable(_phase1_saturation_varnum)
48 ? _dictator.porousFlowVariableNum(_phase1_saturation_varnum)
53 if (_dictator.numPhases() != 2)
54 mooseError(
"The Dictator proclaims that the number of phases is ",
55 _dictator.numPhases(),
56 " whereas PorousFlow2PhasePS can only be used for 2-phase simulation. Be aware "
57 "that the Dictator has noted your mistake.");
88 for (
unsigned phase = 0; phase <
_num_phases; ++phase)
92 (*_dgradp_qp_dgradv)[_qp][phase][
_pvar] = 1.0;
105 if (!_nodal_material)
107 (*_dgrads_qp_dgradv)[_qp][0][
_svar] = -1.0;
108 (*_dgrads_qp_dgradv)[_qp][1][
_svar] = 1.0;
110 (*_dgradp_qp_dv)[_qp][1][
_svar] = d2pc_qp * (*_grads_qp)[_qp][1];
111 (*_dgradp_qp_dgradv)[_qp][1][
_svar] = -dpc;
const VariableValue & _phase1_saturation
Nodal or quadpoint value of saturation of phase one (eg, the gas phase)
const unsigned int _svar
PorousFlow variable number of the phase1 saturation.
virtual void computeQpProperties() override
const VariableGradient & _phase1_grads_qp
Gradient(phase1_saturation) at the qps.
PorousFlow2PhasePS(const InputParameters ¶meters)
const PorousFlowCapillaryPressure & _pc_uo
Capillary pressure UserObject.
const unsigned int _phase1_saturation_varnum
Moose variable number of the phase1 saturation.
registerMooseObject("PorousFlowApp", PorousFlow2PhasePS)
Base class for capillary pressure for multiphase flow in porous media.
virtual void initQpStatefulProperties() override
const unsigned int _phase0_porepressure_varnum
Moose variable number of the phase0 porepressure.
const unsigned int _num_phases
Number of phases.
virtual void computeQpProperties() override
Material designed to calculate fluid-phase porepressures and saturations at nodes and qps using a spe...
Base class for thermophysical variable materials, which assemble materials for primary variables such...
const unsigned int _pvar
PorousFlow variable number of the phase0 porepressure.
virtual Real capillaryPressure(Real saturation, unsigned qp=0) const
Capillary pressure is calculated as a function of true saturation.
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
const VariableValue & _phase0_porepressure
Nodal or quadpoint value of porepressure of phase zero (eg, the liquid phase)
virtual Real dCapillaryPressure(Real saturation, unsigned qp=0) const
Derivative of capillary pressure wrt true saturation.
const VariableGradient & _phase0_gradp_qp
Gradient(phase0_porepressure) at the qps.
void buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints.
virtual Real d2CapillaryPressure(Real saturation, unsigned qp=0) const
Second derivative of capillary pressure wrt true saturation.
InputParameters validParams< PorousFlow2PhasePS >()
virtual void initQpStatefulProperties() override
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
d(saturation)/d(PorousFlow variable)
InputParameters validParams< PorousFlowVariableBase >()