www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlow2PhasePS Class Reference

Material designed to calculate fluid-phase porepressures and saturations at nodes and qps using a specified capillary pressure formulation. More...

#include <PorousFlow2PhasePS.h>

Inheritance diagram for PorousFlow2PhasePS:
[legend]

Public Member Functions

 PorousFlow2PhasePS (const InputParameters &parameters)
 

Protected Member Functions

void buildQpPPSS ()
 Assemble std::vectors of porepressure and saturation at the nodes and quadpoints. More...
 
virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 

Protected Attributes

const VariableValue & _phase0_porepressure
 Nodal or quadpoint value of porepressure of phase zero (eg, the liquid phase) More...
 
const VariableGradient & _phase0_gradp_qp
 Gradient(phase0_porepressure) at the qps. More...
 
const unsigned int _phase0_porepressure_varnum
 Moose variable number of the phase0 porepressure. More...
 
const unsigned int _pvar
 PorousFlow variable number of the phase0 porepressure. More...
 
const VariableValue & _phase1_saturation
 Nodal or quadpoint value of saturation of phase one (eg, the gas phase) More...
 
const VariableGradient & _phase1_grads_qp
 Gradient(phase1_saturation) at the qps. More...
 
const unsigned int _phase1_saturation_varnum
 Moose variable number of the phase1 saturation. More...
 
const unsigned int _svar
 PorousFlow variable number of the phase1 saturation. More...
 
const PorousFlowCapillaryPressure_pc_uo
 Capillary pressure UserObject. More...
 
const unsigned int _num_phases
 Number of phases. More...
 
const unsigned int _num_components
 Number of components. More...
 
const unsigned int _num_pf_vars
 Number of PorousFlow variables. More...
 
MaterialProperty< std::vector< Real > > & _porepressure
 Computed nodal or quadpoint values of porepressure of the phases. More...
 
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
 d(porepressure)/d(PorousFlow variable) More...
 
MaterialProperty< std::vector< RealGradient > > *const _gradp_qp
 Grad(p) at the quadpoints. More...
 
MaterialProperty< std::vector< std::vector< Real > > > *const _dgradp_qp_dgradv
 d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints More...
 
MaterialProperty< std::vector< std::vector< RealGradient > > > *const _dgradp_qp_dv
 d(grad porepressure)/d(PorousFlow variable) at the quadpoints More...
 
MaterialProperty< std::vector< Real > > & _saturation
 Computed nodal or qp saturation of the phases. More...
 
MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
 d(saturation)/d(PorousFlow variable) More...
 
MaterialProperty< std::vector< RealGradient > > *const _grads_qp
 Grad(s) at the quadpoints. More...
 
MaterialProperty< std::vector< std::vector< Real > > > *const _dgrads_qp_dgradv
 d(grad saturation)/d(grad PorousFlow variable) at the quadpoints More...
 
MaterialProperty< std::vector< std::vector< RealGradient > > > *const _dgrads_qp_dv
 d(grad saturation)/d(PorousFlow variable) at the quadpoints More...
 

Detailed Description

Material designed to calculate fluid-phase porepressures and saturations at nodes and qps using a specified capillary pressure formulation.

Definition at line 25 of file PorousFlow2PhasePS.h.

Constructor & Destructor Documentation

◆ PorousFlow2PhasePS()

PorousFlow2PhasePS::PorousFlow2PhasePS ( const InputParameters &  parameters)

Definition at line 32 of file PorousFlow2PhasePS.C.

33  : PorousFlowVariableBase(parameters),
34 
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)
41  : 0),
42 
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)
49  : 0),
50 
51  _pc_uo(getUserObject<PorousFlowCapillaryPressure>("capillary_pressure"))
52 {
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.");
58 }
const unsigned int _pvar
PorousFlow variable number of the phase0 porepressure.
const VariableGradient & _phase0_gradp_qp
Gradient(phase0_porepressure) at the qps.
const VariableValue & _phase0_porepressure
Nodal or quadpoint value of porepressure of phase zero (eg, the liquid phase)
const unsigned int _phase0_porepressure_varnum
Moose variable number of the phase0 porepressure.
Base class for capillary pressure for multiphase flow in porous media.
PorousFlowVariableBase(const InputParameters &parameters)
const PorousFlowCapillaryPressure & _pc_uo
Capillary pressure UserObject.
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.
const unsigned int _phase1_saturation_varnum
Moose variable number of the phase1 saturation.
const VariableGradient & _phase1_grads_qp
Gradient(phase1_saturation) at the qps.

Member Function Documentation

◆ buildQpPPSS()

void PorousFlow2PhasePS::buildQpPPSS ( )
protected

Assemble std::vectors of porepressure and saturation at the nodes and quadpoints.

Definition at line 117 of file PorousFlow2PhasePS.C.

Referenced by computeQpProperties(), and initQpStatefulProperties().

118 {
119  _saturation[_qp][0] = 1.0 - _phase1_saturation[_qp];
120  _saturation[_qp][1] = _phase1_saturation[_qp];
121  const Real pc = _pc_uo.capillaryPressure(1.0 - _phase1_saturation[_qp]);
122  _porepressure[_qp][0] = _phase0_porepressure[_qp];
123  _porepressure[_qp][1] = _phase0_porepressure[_qp] + pc;
124 }
const VariableValue & _phase0_porepressure
Nodal or quadpoint value of porepressure of phase zero (eg, the liquid phase)
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
virtual Real capillaryPressure(Real saturation, unsigned qp=0) const
Capillary pressure is calculated as a function of true saturation.
const PorousFlowCapillaryPressure & _pc_uo
Capillary pressure UserObject.
const VariableValue & _phase1_saturation
Nodal or quadpoint value of saturation of phase one (eg, the gas phase)
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.

◆ computeQpProperties()

void PorousFlow2PhasePS::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowVariableBase.

Definition at line 68 of file PorousFlow2PhasePS.C.

69 {
70  // size stuff correctly and prepare the derivative matrices with zeroes
72 
73  buildQpPPSS();
74  const Real dpc = _pc_uo.dCapillaryPressure(1.0 - _phase1_saturation[_qp]);
75 
76  if (!_nodal_material)
77  {
78  (*_grads_qp)[_qp][0] = -_phase1_grads_qp[_qp];
79  (*_grads_qp)[_qp][1] = _phase1_grads_qp[_qp];
80  (*_gradp_qp)[_qp][0] = _phase0_gradp_qp[_qp];
81  (*_gradp_qp)[_qp][1] = _phase0_gradp_qp[_qp] - dpc * (*_grads_qp)[_qp][1];
82  }
83 
84  // _porepressure depends on _phase0_porepressure, and its derivative is 1
85  if (_dictator.isPorousFlowVariable(_phase0_porepressure_varnum))
86  {
87  // _phase0_porepressure is a PorousFlow variable
88  for (unsigned phase = 0; phase < _num_phases; ++phase)
89  {
90  _dporepressure_dvar[_qp][phase][_pvar] = 1.0;
91  if (!_nodal_material)
92  (*_dgradp_qp_dgradv)[_qp][phase][_pvar] = 1.0;
93  }
94  }
95 
96  // _saturation is only dependent on _phase1_saturation, and its derivative is +/- 1
97  if (_dictator.isPorousFlowVariable(_phase1_saturation_varnum))
98  {
99  // _phase1_saturation is a PorousFlow variable
100  // _phase1_porepressure depends on saturation through the capillary pressure function
101  _dsaturation_dvar[_qp][0][_svar] = -1.0;
102  _dsaturation_dvar[_qp][1][_svar] = 1.0;
103  _dporepressure_dvar[_qp][1][_svar] = -dpc;
104 
105  if (!_nodal_material)
106  {
107  (*_dgrads_qp_dgradv)[_qp][0][_svar] = -1.0;
108  (*_dgrads_qp_dgradv)[_qp][1][_svar] = 1.0;
109  const Real d2pc_qp = _pc_uo.d2CapillaryPressure(1.0 - _phase1_saturation[_qp]);
110  (*_dgradp_qp_dv)[_qp][1][_svar] = d2pc_qp * (*_grads_qp)[_qp][1];
111  (*_dgradp_qp_dgradv)[_qp][1][_svar] = -dpc;
112  }
113  }
114 }
const unsigned int _pvar
PorousFlow variable number of the phase0 porepressure.
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
void buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints. ...
const VariableGradient & _phase0_gradp_qp
Gradient(phase0_porepressure) at the qps.
const unsigned int _phase0_porepressure_varnum
Moose variable number of the phase0 porepressure.
MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
d(saturation)/d(PorousFlow variable)
const PorousFlowCapillaryPressure & _pc_uo
Capillary pressure UserObject.
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 unsigned int _phase1_saturation_varnum
Moose variable number of the phase1 saturation.
const VariableGradient & _phase1_grads_qp
Gradient(phase1_saturation) at the qps.
virtual Real d2CapillaryPressure(Real saturation, unsigned qp=0) const
Second derivative of capillary pressure wrt true saturation.
virtual Real dCapillaryPressure(Real saturation, unsigned qp=0) const
Derivative of capillary pressure wrt true saturation.
const unsigned int _num_phases
Number of phases.

◆ initQpStatefulProperties()

void PorousFlow2PhasePS::initQpStatefulProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowVariableBase.

Definition at line 61 of file PorousFlow2PhasePS.C.

62 {
64  buildQpPPSS();
65 }
void buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints. ...
virtual void initQpStatefulProperties() override

Member Data Documentation

◆ _dgradp_qp_dgradv

MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowVariableBase::_dgradp_qp_dgradv
protectedinherited

d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints

Definition at line 54 of file PorousFlowVariableBase.h.

◆ _dgradp_qp_dv

MaterialProperty<std::vector<std::vector<RealGradient> > >* const PorousFlowVariableBase::_dgradp_qp_dv
protectedinherited

d(grad porepressure)/d(PorousFlow variable) at the quadpoints

Definition at line 57 of file PorousFlowVariableBase.h.

◆ _dgrads_qp_dgradv

MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowVariableBase::_dgrads_qp_dgradv
protectedinherited

d(grad saturation)/d(grad PorousFlow variable) at the quadpoints

Definition at line 69 of file PorousFlowVariableBase.h.

◆ _dgrads_qp_dv

MaterialProperty<std::vector<std::vector<RealGradient> > >* const PorousFlowVariableBase::_dgrads_qp_dv
protectedinherited

d(grad saturation)/d(PorousFlow variable) at the quadpoints

Definition at line 72 of file PorousFlowVariableBase.h.

◆ _dporepressure_dvar

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dporepressure_dvar
protectedinherited

◆ _dsaturation_dvar

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dsaturation_dvar
protectedinherited

◆ _gradp_qp

MaterialProperty<std::vector<RealGradient> >* const PorousFlowVariableBase::_gradp_qp
protectedinherited

Grad(p) at the quadpoints.

Definition at line 51 of file PorousFlowVariableBase.h.

◆ _grads_qp

MaterialProperty<std::vector<RealGradient> >* const PorousFlowVariableBase::_grads_qp
protectedinherited

Grad(s) at the quadpoints.

Definition at line 66 of file PorousFlowVariableBase.h.

◆ _num_components

const unsigned int PorousFlowVariableBase::_num_components
protectedinherited

◆ _num_pf_vars

const unsigned int PorousFlowVariableBase::_num_pf_vars
protectedinherited

◆ _num_phases

const unsigned int PorousFlowVariableBase::_num_phases
protectedinherited

◆ _pc_uo

const PorousFlowCapillaryPressure& PorousFlow2PhasePS::_pc_uo
protected

Capillary pressure UserObject.

Definition at line 57 of file PorousFlow2PhasePS.h.

Referenced by buildQpPPSS(), and computeQpProperties().

◆ _phase0_gradp_qp

const VariableGradient& PorousFlow2PhasePS::_phase0_gradp_qp
protected

Gradient(phase0_porepressure) at the qps.

Definition at line 43 of file PorousFlow2PhasePS.h.

Referenced by computeQpProperties().

◆ _phase0_porepressure

const VariableValue& PorousFlow2PhasePS::_phase0_porepressure
protected

Nodal or quadpoint value of porepressure of phase zero (eg, the liquid phase)

Definition at line 41 of file PorousFlow2PhasePS.h.

Referenced by buildQpPPSS().

◆ _phase0_porepressure_varnum

const unsigned int PorousFlow2PhasePS::_phase0_porepressure_varnum
protected

Moose variable number of the phase0 porepressure.

Definition at line 45 of file PorousFlow2PhasePS.h.

Referenced by computeQpProperties().

◆ _phase1_grads_qp

const VariableGradient& PorousFlow2PhasePS::_phase1_grads_qp
protected

Gradient(phase1_saturation) at the qps.

Definition at line 51 of file PorousFlow2PhasePS.h.

Referenced by computeQpProperties().

◆ _phase1_saturation

const VariableValue& PorousFlow2PhasePS::_phase1_saturation
protected

Nodal or quadpoint value of saturation of phase one (eg, the gas phase)

Definition at line 49 of file PorousFlow2PhasePS.h.

Referenced by buildQpPPSS(), and computeQpProperties().

◆ _phase1_saturation_varnum

const unsigned int PorousFlow2PhasePS::_phase1_saturation_varnum
protected

Moose variable number of the phase1 saturation.

Definition at line 53 of file PorousFlow2PhasePS.h.

Referenced by computeQpProperties().

◆ _porepressure

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_porepressure
protectedinherited

◆ _pvar

const unsigned int PorousFlow2PhasePS::_pvar
protected

PorousFlow variable number of the phase0 porepressure.

Definition at line 47 of file PorousFlow2PhasePS.h.

Referenced by computeQpProperties().

◆ _saturation

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_saturation
protectedinherited

◆ _svar

const unsigned int PorousFlow2PhasePS::_svar
protected

PorousFlow variable number of the phase1 saturation.

Definition at line 55 of file PorousFlow2PhasePS.h.

Referenced by computeQpProperties().


The documentation for this class was generated from the following files: