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

Material designed to calculate 2-phase porepressures and saturations at nodes and quadpoints assuming the independent variables are the 2 porepressure, and using the Rogers-Stallybrass-Clements capillary curve. More...

#include <PorousFlow2PhasePP_RSC.h>

Inheritance diagram for PorousFlow2PhasePP_RSC:
[legend]

Public Member Functions

 PorousFlow2PhasePP_RSC (const InputParameters &parameters)
 

Protected Member Functions

Real effectiveSaturation (Real pressure) const override
 Effective saturation as a function of porepressure (a negative quantity). More...
 
Real dEffectiveSaturation_dP (Real pressure) const override
 Derivative of effective saturation wrt to p. More...
 
Real d2EffectiveSaturation_dP2 (Real pressure) const override
 Second derivative of effective saturation wrt to porepressure. More...
 
virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 
Real buildQpPPSS ()
 Assemble std::vectors of porepressure and saturation at the nodes and quadpoints, and return the capillary pressure. More...
 

Protected Attributes

const Real _oil_viscosity
 oil viscosity (which must be twice the water viscocity in this formulation) More...
 
const Real _scale_ratio
 scale ratio: porosity/permeability/beta^2, where beta is chosen by the user More...
 
const Real _shift
 shift. seff_water = 1/Sqrt(1 + Exp((Pc - shift)/scale)), where scale = 0.25 * scale_ratio * oil_viscosity More...
 
const Real _scale
 scale = 0.25 * scale_ratio * oil_viscosity More...
 
const VariableValue & _phase0_porepressure
 Nodal or quadpoint value of porepressure of the zero phase (eg, the water 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 _p0var
 PorousFlow variable number of the phase0 porepressure. More...
 
const VariableValue & _phase1_porepressure
 Nodal or quadpoint value of porepressure of the one phase (eg, the gas phase) More...
 
const VariableGradient & _phase1_gradp_qp
 Gradient(phase1_porepressure) at the qps. More...
 
const unsigned int _phase1_porepressure_varnum
 Moose variable number of the phase1 porepressure. More...
 
const unsigned int _p1var
 PorousFlow variable number of the phase1 porepressure. More...
 
const PorousFlowCapillaryPressure_pc_uo
 Capillary pressure UserObject Note: This pointer can be replaced with a reference once the deprecated PP 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

Material designed to calculate 2-phase porepressures and saturations at nodes and quadpoints assuming the independent variables are the 2 porepressure, and using the Rogers-Stallybrass-Clements capillary curve.

Definition at line 25 of file PorousFlow2PhasePP_RSC.h.

Constructor & Destructor Documentation

PorousFlow2PhasePP_RSC::PorousFlow2PhasePP_RSC ( const InputParameters &  parameters)

Definition at line 31 of file PorousFlow2PhasePP_RSC.C.

32  : PorousFlow2PhasePP(parameters),
33  _oil_viscosity(getParam<Real>("oil_viscosity")),
34  _scale_ratio(getParam<Real>("scale_ratio")),
35  _shift(getParam<Real>("shift")),
37 {
38  mooseDeprecated("PorousFlow2PhasePP_RSC is deprecated. Please use PorousFlow2PhasePP and a "
39  "PorousFlowCapillaryPressureRSC UserObject instead");
40 }
PorousFlow2PhasePP(const InputParameters &parameters)
const Real _scale
scale = 0.25 * scale_ratio * oil_viscosity
const Real _scale_ratio
scale ratio: porosity/permeability/beta^2, where beta is chosen by the user
const Real _oil_viscosity
oil viscosity (which must be twice the water viscocity in this formulation)
const Real _shift
shift. seff_water = 1/Sqrt(1 + Exp((Pc - shift)/scale)), where scale = 0.25 * scale_ratio * oil_visco...

Member Function Documentation

Real PorousFlow2PhasePP::buildQpPPSS ( )
protectedinherited

Assemble std::vectors of porepressure and saturation at the nodes and quadpoints, and return the capillary pressure.

Definition at line 134 of file PorousFlow2PhasePP.C.

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

135 {
136  _porepressure[_qp][0] = _phase0_porepressure[_qp];
137  _porepressure[_qp][1] = _phase1_porepressure[_qp];
138  const Real pc = _phase0_porepressure[_qp] - _phase1_porepressure[_qp]; // this is <= 0
139  const Real seff = effectiveSaturation(pc);
140  _saturation[_qp][0] = seff;
141  _saturation[_qp][1] = 1.0 - seff;
142  return pc;
143 }
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
const VariableValue & _phase0_porepressure
Nodal or quadpoint value of porepressure of the zero phase (eg, the water phase)
virtual Real effectiveSaturation(Real pressure) const
Effective saturation as a function of porepressure (a negative quantity).
const VariableValue & _phase1_porepressure
Nodal or quadpoint value of porepressure of the one phase (eg, the gas phase)
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
void PorousFlow2PhasePP::computeQpProperties ( )
overrideprotectedvirtualinherited

Reimplemented from PorousFlowVariableBase.

Definition at line 67 of file PorousFlow2PhasePP.C.

68 {
69  // size stuff correctly and prepare the derivative matrices with zeroes
71 
72  const Real pc = buildQpPPSS();
73  const Real dseff = dEffectiveSaturation_dP(pc); // d(seff)/d(pc)
74 
75  if (!_nodal_material)
76  {
77  (*_gradp_qp)[_qp][0] = _phase0_gradp_qp[_qp];
78  (*_gradp_qp)[_qp][1] = _phase1_gradp_qp[_qp];
79  (*_grads_qp)[_qp][0] = dseff * ((*_gradp_qp)[_qp][0] - (*_gradp_qp)[_qp][1]);
80  (*_grads_qp)[_qp][1] = -(*_grads_qp)[_qp][0];
81  }
82 
83  // the derivatives of porepressure with respect to porepressure
84  // remain fixed (at unity) throughout the simulation
85  if (_dictator.isPorousFlowVariable(_phase0_porepressure_varnum))
86  {
87  _dporepressure_dvar[_qp][0][_p0var] = 1.0;
88  if (!_nodal_material)
89  (*_dgradp_qp_dgradv)[_qp][0][_p0var] = 1.0;
90  }
91  if (_dictator.isPorousFlowVariable(_phase1_porepressure_varnum))
92  {
93  _dporepressure_dvar[_qp][1][_p1var] = 1.0;
94  if (!_nodal_material)
95  (*_dgradp_qp_dgradv)[_qp][1][_p1var] = 1.0;
96  }
97 
98  if (_dictator.isPorousFlowVariable(_phase0_porepressure_varnum))
99  {
100  _dsaturation_dvar[_qp][0][_p0var] = dseff;
101  _dsaturation_dvar[_qp][1][_p0var] = -dseff;
102  }
103  if (_dictator.isPorousFlowVariable(_phase1_porepressure_varnum))
104  {
105  _dsaturation_dvar[_qp][0][_p1var] = -dseff;
106  _dsaturation_dvar[_qp][1][_p1var] = dseff;
107  }
108 
109  if (!_nodal_material)
110  {
111  const Real d2seff_qp = d2EffectiveSaturation_dP2(pc); // d^2(seff_qp)/d(pc_qp)^2
112  if (_dictator.isPorousFlowVariable(_phase0_porepressure_varnum))
113  {
114  (*_dgrads_qp_dgradv)[_qp][0][_p0var] = dseff;
115  (*_dgrads_qp_dv)[_qp][0][_p0var] =
116  d2seff_qp * (_phase0_gradp_qp[_qp] - _phase1_gradp_qp[_qp]);
117  (*_dgrads_qp_dgradv)[_qp][1][_p0var] = -dseff;
118  (*_dgrads_qp_dv)[_qp][1][_p0var] =
119  -d2seff_qp * (_phase0_gradp_qp[_qp] - _phase1_gradp_qp[_qp]);
120  }
121  if (_dictator.isPorousFlowVariable(_phase1_porepressure_varnum))
122  {
123  (*_dgrads_qp_dgradv)[_qp][0][_p1var] = -dseff;
124  (*_dgrads_qp_dv)[_qp][0][_p1var] =
125  -d2seff_qp * (_phase0_gradp_qp[_qp] - _phase1_gradp_qp[_qp]);
126  (*_dgrads_qp_dgradv)[_qp][1][_p1var] = dseff;
127  (*_dgrads_qp_dv)[_qp][1][_p1var] =
128  d2seff_qp * (_phase0_gradp_qp[_qp] - _phase1_gradp_qp[_qp]);
129  }
130  }
131 }
virtual Real d2EffectiveSaturation_dP2(Real pressure) const
Second derivative of effective saturation wrt to porepressure.
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
const unsigned int _p0var
PorousFlow variable number of the phase0 porepressure.
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)
Real buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints, and return the capi...
const VariableGradient & _phase0_gradp_qp
Gradient(phase0_porepressure) at the qps.
virtual void computeQpProperties() override
const unsigned int _phase1_porepressure_varnum
Moose variable number of the phase1 porepressure.
const unsigned int _p1var
PorousFlow variable number of the phase1 porepressure.
virtual Real dEffectiveSaturation_dP(Real pressure) const
Derivative of effective saturation wrt to p.
const VariableGradient & _phase1_gradp_qp
Gradient(phase1_porepressure) at the qps.
Real PorousFlow2PhasePP_RSC::d2EffectiveSaturation_dP2 ( Real  pressure) const
overrideprotectedvirtual

Second derivative of effective saturation wrt to porepressure.

Default = 0 for constant saturation. Over-ride in derived classes to implement other effective saturation forulations

Parameters
pressureporepressure (Pa): a negative quantity
Returns
second derivative of effective saturation wrt porepressure

Reimplemented from PorousFlow2PhasePP.

Definition at line 55 of file PorousFlow2PhasePP_RSC.C.

56 {
58 }
const Real _scale
scale = 0.25 * scale_ratio * oil_viscosity
const std::string pressure
Definition: NS.h:24
Real d2EffectiveSaturation(Real pc, Real shift, Real scale)
Second derivative of effective saturation wrt capillary pressure.
const Real _shift
shift. seff_water = 1/Sqrt(1 + Exp((Pc - shift)/scale)), where scale = 0.25 * scale_ratio * oil_visco...
Real PorousFlow2PhasePP_RSC::dEffectiveSaturation_dP ( Real  pressure) const
overrideprotectedvirtual

Derivative of effective saturation wrt to p.

Default = 0 for constant saturation. Over-ride in derived classes to implement other effective saturation forulations

Parameters
pressureporepressure (Pa): a negative quantity
Returns
derivative of effective saturation wrt porepressure

Reimplemented from PorousFlow2PhasePP.

Definition at line 49 of file PorousFlow2PhasePP_RSC.C.

50 {
52 }
Real dEffectiveSaturation(Real pc, Real shift, Real scale)
Derivative of effective saturation wrt capillary pressure.
const Real _scale
scale = 0.25 * scale_ratio * oil_viscosity
const std::string pressure
Definition: NS.h:24
const Real _shift
shift. seff_water = 1/Sqrt(1 + Exp((Pc - shift)/scale)), where scale = 0.25 * scale_ratio * oil_visco...
Real PorousFlow2PhasePP_RSC::effectiveSaturation ( Real  pressure) const
overrideprotectedvirtual

Effective saturation as a function of porepressure (a negative quantity).

Default is constant saturation = 1. Over-ride in derived classes to implement other effective saturation forulations

Parameters
pressureporepressure (Pa): a negative quantity
Returns
effective saturation

Reimplemented from PorousFlow2PhasePP.

Definition at line 43 of file PorousFlow2PhasePP_RSC.C.

44 {
46 }
const Real _scale
scale = 0.25 * scale_ratio * oil_viscosity
const std::string pressure
Definition: NS.h:24
Real effectiveSaturation(Real pc, Real shift, Real scale)
Effective saturation as a function of capillary pressure.
const Real _shift
shift. seff_water = 1/Sqrt(1 + Exp((Pc - shift)/scale)), where scale = 0.25 * scale_ratio * oil_visco...
void PorousFlow2PhasePP::initQpStatefulProperties ( )
overrideprotectedvirtualinherited

Reimplemented from PorousFlowVariableBase.

Definition at line 60 of file PorousFlow2PhasePP.C.

61 {
63  buildQpPPSS();
64 }
virtual void initQpStatefulProperties() override
Real buildQpPPSS()
Assemble std::vectors of porepressure and saturation at the nodes and quadpoints, and return the capi...

Member Data Documentation

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
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 unsigned int PorousFlowVariableBase::_num_components
protectedinherited
const unsigned int PorousFlowVariableBase::_num_pf_vars
protectedinherited
const unsigned int PorousFlowVariableBase::_num_phases
protectedinherited
const Real PorousFlow2PhasePP_RSC::_oil_viscosity
protected

oil viscosity (which must be twice the water viscocity in this formulation)

Definition at line 38 of file PorousFlow2PhasePP_RSC.h.

const unsigned int PorousFlow2PhasePP::_p0var
protectedinherited

PorousFlow variable number of the phase0 porepressure.

Definition at line 78 of file PorousFlow2PhasePP.h.

Referenced by PorousFlow2PhasePP::computeQpProperties().

const unsigned int PorousFlow2PhasePP::_p1var
protectedinherited

PorousFlow variable number of the phase1 porepressure.

Definition at line 86 of file PorousFlow2PhasePP.h.

Referenced by PorousFlow2PhasePP::computeQpProperties().

const PorousFlowCapillaryPressure* PorousFlow2PhasePP::_pc_uo
protectedinherited

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

Definition at line 90 of file PorousFlow2PhasePP.h.

Referenced by PorousFlow2PhasePP::d2EffectiveSaturation_dP2(), PorousFlow2PhasePP::dEffectiveSaturation_dP(), and PorousFlow2PhasePP::effectiveSaturation().

const VariableGradient& PorousFlow2PhasePP::_phase0_gradp_qp
protectedinherited

Gradient(phase0_porepressure) at the qps.

Definition at line 74 of file PorousFlow2PhasePP.h.

Referenced by PorousFlow2PhasePP::computeQpProperties().

const VariableValue& PorousFlow2PhasePP::_phase0_porepressure
protectedinherited

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

Definition at line 72 of file PorousFlow2PhasePP.h.

Referenced by PorousFlow2PhasePP::buildQpPPSS().

const unsigned int PorousFlow2PhasePP::_phase0_porepressure_varnum
protectedinherited

Moose variable number of the phase0 porepressure.

Definition at line 76 of file PorousFlow2PhasePP.h.

Referenced by PorousFlow2PhasePP::computeQpProperties().

const VariableGradient& PorousFlow2PhasePP::_phase1_gradp_qp
protectedinherited

Gradient(phase1_porepressure) at the qps.

Definition at line 82 of file PorousFlow2PhasePP.h.

Referenced by PorousFlow2PhasePP::computeQpProperties().

const VariableValue& PorousFlow2PhasePP::_phase1_porepressure
protectedinherited

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

Definition at line 80 of file PorousFlow2PhasePP.h.

Referenced by PorousFlow2PhasePP::buildQpPPSS().

const unsigned int PorousFlow2PhasePP::_phase1_porepressure_varnum
protectedinherited

Moose variable number of the phase1 porepressure.

Definition at line 84 of file PorousFlow2PhasePP.h.

Referenced by PorousFlow2PhasePP::computeQpProperties().

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_porepressure
protectedinherited
MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_saturation
protectedinherited
const Real PorousFlow2PhasePP_RSC::_scale
protected

scale = 0.25 * scale_ratio * oil_viscosity

Definition at line 47 of file PorousFlow2PhasePP_RSC.h.

Referenced by d2EffectiveSaturation_dP2(), dEffectiveSaturation_dP(), and effectiveSaturation().

const Real PorousFlow2PhasePP_RSC::_scale_ratio
protected

scale ratio: porosity/permeability/beta^2, where beta is chosen by the user

Definition at line 41 of file PorousFlow2PhasePP_RSC.h.

const Real PorousFlow2PhasePP_RSC::_shift
protected

shift. seff_water = 1/Sqrt(1 + Exp((Pc - shift)/scale)), where scale = 0.25 * scale_ratio * oil_viscosity

Definition at line 44 of file PorousFlow2PhasePP_RSC.h.

Referenced by d2EffectiveSaturation_dP2(), dEffectiveSaturation_dP(), and effectiveSaturation().


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