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

Calculates porepressure and saturation at the nodes and qps using a van Genuchten capillary pressure curve. More...

#include <PorousFlow2PhasePS_VG.h>

Inheritance diagram for PorousFlow2PhasePS_VG:
[legend]

Public Member Functions

 PorousFlow2PhasePS_VG (const InputParameters &parameters)
 

Protected Member Functions

virtual Real capillaryPressure (Real seff) const override
 Capillary pressure as a function of saturation. More...
 
virtual Real dCapillaryPressure_dS (Real seff) const override
 Derivative of capillary pressure wrt to saturation. More...
 
virtual Real d2CapillaryPressure_dS2 (Real seff) const override
 Second derivative of capillary pressure wrt to saturation. More...
 
void buildQpPPSS ()
 Assemble std::vectors of porepressure and saturation at the nodes and quadpoints. More...
 
virtual Real effectiveSaturation (Real saturation) const
 Effective saturation of liquid phase. More...
 
virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 

Protected Attributes

const Real _m
 van Genuchten exponent m More...
 
const Real _pc_max
 Maximum capillary pressure (Pa). Note: must be <= 0. More...
 
const Real _p0
 van Genuchten capillary pressure coefficient (inverse of alpha) More...
 
const Real _alpha
 van Genuchten alpha = 1/p0 More...
 
const VariableValue & _phase0_porepressure
 Nodal or quadpoint value of porepressure of the zero phase (eg, the gas 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 the one phase (eg, the water 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 Real _sat_lr
 Liquid residual saturation. More...
 
const Real _dseff_ds
 Derivative of effective saturation with respect to saturation. More...
 
const PorousFlowCapillaryPressure_pc_uo
 Capillary pressure UserObject Note: This pointer can be replaced with a reference once the deprecated PS materials have been removed. 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

Calculates porepressure and saturation at the nodes and qps using a van Genuchten capillary pressure curve.

Definition at line 23 of file PorousFlow2PhasePS_VG.h.

Constructor & Destructor Documentation

PorousFlow2PhasePS_VG::PorousFlow2PhasePS_VG ( const InputParameters &  parameters)

Definition at line 33 of file PorousFlow2PhasePS_VG.C.

34  : PorousFlow2PhasePS(parameters),
35 
36  _m(getParam<Real>("m")),
37  _pc_max(getParam<Real>("pc_max")),
38  _p0(getParam<Real>("p0")),
39  _alpha(1.0 / _p0)
40 {
41  mooseDeprecated("PorousFlow2PhasePS_VG is deprecated. Please use PorousFlow2PhasePS and a "
42  "PorousFlowCapillaryPressureVG UserObject instead");
43 
44  if (_dictator.numPhases() != 2)
45  mooseError("The Dictator proclaims that the number of phases is ",
46  _dictator.numPhases(),
47  " whereas PorousFlow2PhasePS_VG can only be used for 2-phase simulation. Be aware "
48  "that the Dictator has noted your mistake.");
49 }
PorousFlow2PhasePS(const InputParameters &parameters)
const Real _m
van Genuchten exponent m
const Real _pc_max
Maximum capillary pressure (Pa). Note: must be <= 0.
const Real _alpha
van Genuchten alpha = 1/p0
const Real _p0
van Genuchten capillary pressure coefficient (inverse of alpha)

Member Function Documentation

void PorousFlow2PhasePS::buildQpPPSS ( )
protectedinherited

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

Definition at line 122 of file PorousFlow2PhasePS.C.

Referenced by PorousFlow2PhasePS::computeQpProperties(), and PorousFlow2PhasePS::initQpStatefulProperties().

123 {
124  _saturation[_qp][0] = 1.0 - _phase1_saturation[_qp];
125  _saturation[_qp][1] = _phase1_saturation[_qp];
126  const Real pc = capillaryPressure(_phase1_saturation[_qp]);
127  _porepressure[_qp][0] = _phase0_porepressure[_qp];
128  _porepressure[_qp][1] = _phase0_porepressure[_qp] - pc;
129 }
const VariableValue & _phase0_porepressure
Nodal or quadpoint value of porepressure of the zero phase (eg, the gas phase)
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
const VariableValue & _phase1_saturation
Nodal or quadpoint value of saturation of the one phase (eg, the water phase)
virtual Real capillaryPressure(Real saturation) const
Capillary pressure as a function of saturation.
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
Real PorousFlow2PhasePS_VG::capillaryPressure ( Real  saturation) const
overrideprotectedvirtual

Capillary pressure as a function of saturation.

Default is constant capillary pressure = 0.0. Override in derived classes to implement other capillary pressure forulations

Parameters
saturationtrue saturation
Returns
capillary pressure (Pa)

Reimplemented from PorousFlow2PhasePS.

Definition at line 52 of file PorousFlow2PhasePS_VG.C.

53 {
54  Real seff = effectiveSaturation(saturation);
56 }
const Real _m
van Genuchten exponent m
const Real _pc_max
Maximum capillary pressure (Pa). Note: must be <= 0.
virtual Real effectiveSaturation(Real saturation) const
Effective saturation of liquid phase.
const Real _alpha
van Genuchten alpha = 1/p0
void FORTRAN_CALL() saturation(double &P, double &T, int &N, int &nerr)
Real capillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Capillary pressure as a function of effective saturation.
void PorousFlow2PhasePS::computeQpProperties ( )
overrideprotectedvirtualinherited

Reimplemented from PorousFlowVariableBase.

Definition at line 73 of file PorousFlow2PhasePS.C.

74 {
75  // size stuff correctly and prepare the derivative matrices with zeroes
77 
78  buildQpPPSS();
79  const Real dpc = dCapillaryPressure_dS(_phase1_saturation[_qp]);
80 
81  if (!_nodal_material)
82  {
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];
87  }
88 
89  // _porepressure depends on _phase0_porepressure, and its derivative is 1
90  if (_dictator.isPorousFlowVariable(_phase0_porepressure_varnum))
91  {
92  // _phase0_porepressure is a PorousFlow variable
93  for (unsigned phase = 0; phase < _num_phases; ++phase)
94  {
95  _dporepressure_dvar[_qp][phase][_pvar] = 1.0;
96  if (!_nodal_material)
97  (*_dgradp_qp_dgradv)[_qp][phase][_pvar] = 1.0;
98  }
99  }
100 
101  // _saturation is only dependent on _phase1_saturation, and its derivative is +/- 1
102  if (_dictator.isPorousFlowVariable(_phase1_saturation_varnum))
103  {
104  // _phase1_saturation is a porflow variable
105  // _phase1_porepressure depends on saturation through the capillary pressure function
106  _dsaturation_dvar[_qp][0][_svar] = -1.0;
107  _dsaturation_dvar[_qp][1][_svar] = 1.0;
108  _dporepressure_dvar[_qp][1][_svar] = -dpc;
109 
110  if (!_nodal_material)
111  {
112  (*_dgrads_qp_dgradv)[_qp][0][_svar] = -1.0;
113  (*_dgrads_qp_dgradv)[_qp][1][_svar] = 1.0;
114  const Real d2pc_qp = d2CapillaryPressure_dS2(_phase1_saturation[_qp]);
115  (*_dgradp_qp_dv)[_qp][1][_svar] = -d2pc_qp * (*_grads_qp)[_qp][1];
116  (*_dgradp_qp_dgradv)[_qp][1][_svar] = -dpc;
117  }
118  }
119 }
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 VariableValue & _phase1_saturation
Nodal or quadpoint value of saturation of the one phase (eg, the water 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.
const unsigned int _num_phases
Number of phases.
virtual Real d2CapillaryPressure_dS2(Real saturation) const
Second derivative of capillary pressure wrt to saturation.
virtual Real dCapillaryPressure_dS(Real seff) const
Derivative of capillary pressure wrt to saturation.
Real PorousFlow2PhasePS_VG::d2CapillaryPressure_dS2 ( Real  saturation) const
overrideprotectedvirtual

Second derivative of capillary pressure wrt to saturation.

Override in derived classes to implement other capillary pressure forulations

Parameters
saturationtrue saturation
Returns
second derivative of capillary pressure wrt saturation

Reimplemented from PorousFlow2PhasePS.

Definition at line 66 of file PorousFlow2PhasePS_VG.C.

67 {
68  Real seff = effectiveSaturation(saturation);
70  _dseff_ds;
71 }
const Real _m
van Genuchten exponent m
const Real _pc_max
Maximum capillary pressure (Pa). Note: must be <= 0.
virtual Real effectiveSaturation(Real saturation) const
Effective saturation of liquid phase.
Real d2CapillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Second derivative of capillary pressure wrt effective saturation.
const Real _alpha
van Genuchten alpha = 1/p0
void FORTRAN_CALL() saturation(double &P, double &T, int &N, int &nerr)
const Real _dseff_ds
Derivative of effective saturation with respect to saturation.
Real PorousFlow2PhasePS_VG::dCapillaryPressure_dS ( Real  seff) const
overrideprotectedvirtual

Derivative of capillary pressure wrt to saturation.

Override in derived classes to implement other capillary pressure forulations

Parameters
saturationtrue saturation
Returns
derivative of capillary pressure wrt saturation

Reimplemented from PorousFlow2PhasePS.

Definition at line 59 of file PorousFlow2PhasePS_VG.C.

60 {
61  Real seff = effectiveSaturation(saturation);
63 }
const Real _m
van Genuchten exponent m
const Real _pc_max
Maximum capillary pressure (Pa). Note: must be <= 0.
virtual Real effectiveSaturation(Real saturation) const
Effective saturation of liquid phase.
const Real _alpha
van Genuchten alpha = 1/p0
Real dCapillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Derivative of capillary pressure wrt effective saturation.
void FORTRAN_CALL() saturation(double &P, double &T, int &N, int &nerr)
const Real _dseff_ds
Derivative of effective saturation with respect to saturation.
Real PorousFlow2PhasePS::effectiveSaturation ( Real  saturation) const
protectedvirtualinherited

Effective saturation of liquid phase.

Parameters
saturationtrue saturation
Returns
effective saturation

Definition at line 132 of file PorousFlow2PhasePS.C.

Referenced by capillaryPressure(), d2CapillaryPressure_dS2(), and dCapillaryPressure_dS().

133 {
134  return (saturation - _sat_lr) / (1.0 - _sat_lr);
135 }
const Real _sat_lr
Liquid residual saturation.
void FORTRAN_CALL() saturation(double &P, double &T, int &N, int &nerr)
void PorousFlow2PhasePS::initQpStatefulProperties ( )
overrideprotectedvirtualinherited

Reimplemented from PorousFlowVariableBase.

Definition at line 66 of file PorousFlow2PhasePS.C.

67 {
69  buildQpPPSS();
70 }
void buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints. ...
virtual void initQpStatefulProperties() override

Member Data Documentation

const Real PorousFlow2PhasePS_VG::_alpha
protected

van Genuchten alpha = 1/p0

Definition at line 40 of file PorousFlow2PhasePS_VG.h.

Referenced by capillaryPressure(), d2CapillaryPressure_dS2(), and dCapillaryPressure_dS().

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 52 of file PorousFlowVariableBase.h.

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

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

Definition at line 55 of file PorousFlowVariableBase.h.

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 67 of file PorousFlowVariableBase.h.

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

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

Definition at line 70 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dporepressure_dvar
protectedinherited
MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dsaturation_dvar
protectedinherited
const Real PorousFlow2PhasePS::_dseff_ds
protectedinherited

Derivative of effective saturation with respect to saturation.

Definition at line 93 of file PorousFlow2PhasePS.h.

Referenced by d2CapillaryPressure_dS2(), and dCapillaryPressure_dS().

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

Grad(p) at the quadpoints.

Definition at line 49 of file PorousFlowVariableBase.h.

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

Grad(s) at the quadpoints.

Definition at line 64 of file PorousFlowVariableBase.h.

const Real PorousFlow2PhasePS_VG::_m
protected

van Genuchten exponent m

Definition at line 34 of file PorousFlow2PhasePS_VG.h.

Referenced by capillaryPressure(), d2CapillaryPressure_dS2(), and dCapillaryPressure_dS().

const unsigned int PorousFlowVariableBase::_num_components
protectedinherited
const unsigned int PorousFlowVariableBase::_num_pf_vars
protectedinherited
const unsigned int PorousFlowVariableBase::_num_phases
protectedinherited
const Real PorousFlow2PhasePS_VG::_p0
protected

van Genuchten capillary pressure coefficient (inverse of alpha)

Definition at line 38 of file PorousFlow2PhasePS_VG.h.

const Real PorousFlow2PhasePS_VG::_pc_max
protected

Maximum capillary pressure (Pa). Note: must be <= 0.

Definition at line 36 of file PorousFlow2PhasePS_VG.h.

Referenced by capillaryPressure(), d2CapillaryPressure_dS2(), and dCapillaryPressure_dS().

const PorousFlowCapillaryPressure* PorousFlow2PhasePS::_pc_uo
protectedinherited

Capillary pressure UserObject Note: This pointer can be replaced with a reference once the deprecated PS materials have been removed.

Definition at line 97 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::capillaryPressure(), PorousFlow2PhasePS::d2CapillaryPressure_dS2(), and PorousFlow2PhasePS::dCapillaryPressure_dS().

const VariableGradient& PorousFlow2PhasePS::_phase0_gradp_qp
protectedinherited

Gradient(phase0_porepressure) at the qps.

Definition at line 77 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::computeQpProperties().

const VariableValue& PorousFlow2PhasePS::_phase0_porepressure
protectedinherited

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

Definition at line 75 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::buildQpPPSS().

const unsigned int PorousFlow2PhasePS::_phase0_porepressure_varnum
protectedinherited

Moose variable number of the phase0 porepressure.

Definition at line 79 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::computeQpProperties().

const VariableGradient& PorousFlow2PhasePS::_phase1_grads_qp
protectedinherited

Gradient(phase1_saturation) at the qps.

Definition at line 85 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::computeQpProperties().

const VariableValue& PorousFlow2PhasePS::_phase1_saturation
protectedinherited

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

Definition at line 83 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::buildQpPPSS(), and PorousFlow2PhasePS::computeQpProperties().

const unsigned int PorousFlow2PhasePS::_phase1_saturation_varnum
protectedinherited

Moose variable number of the phase1 saturation.

Definition at line 87 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::computeQpProperties().

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_porepressure
protectedinherited
const unsigned int PorousFlow2PhasePS::_pvar
protectedinherited

PorousFlow variable number of the phase0 porepressure.

Definition at line 81 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::computeQpProperties().

const Real PorousFlow2PhasePS::_sat_lr
protectedinherited

Liquid residual saturation.

Definition at line 91 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::effectiveSaturation().

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_saturation
protectedinherited
const unsigned int PorousFlow2PhasePS::_svar
protectedinherited

PorousFlow variable number of the phase1 saturation.

Definition at line 89 of file PorousFlow2PhasePS.h.

Referenced by PorousFlow2PhasePS::computeQpProperties().


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