www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlowRelativePermeabilityBase Class Referenceabstract

Base class for PorousFlow relative permeability materials. More...

#include <PorousFlowRelativePermeabilityBase.h>

Inheritance diagram for PorousFlowRelativePermeabilityBase:
[legend]

Public Member Functions

 PorousFlowRelativePermeabilityBase (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties () override
 
virtual Real effectiveSaturation (Real saturation) const
 Effective saturation of fluid phase. More...
 
virtual Real relativePermeability (Real seff) const =0
 Relative permeability equation (must be overriden in derived class) More...
 
virtual Real dRelativePermeability (Real seff) const =0
 Derivative of relative permeability with respect to effective saturation. More...
 

Protected Attributes

const Real _scaling
 Relative permeability is multiplied by this quantity. More...
 
VariableName _saturation_variable_name
 Name of (dummy) saturation primary variable. More...
 
const MaterialProperty< std::vector< Real > > & _saturation
 Saturation material property. More...
 
MaterialProperty< Real > & _relative_permeability
 Relative permeability material property. More...
 
MaterialProperty< Real > & _drelative_permeability_ds
 Derivative of relative permeability wrt phase saturation. More...
 
const Real _s_res
 Residual saturation of specified phase. More...
 
const Real _sum_s_res
 Sum of residual saturations over all phases. More...
 
const Real _dseff_ds
 Derivative of effective saturation with respect to saturation. More...
 
const unsigned int _phase_num
 Phase number of fluid. More...
 
const std::string _phase
 Stringified fluid phase number. More...
 

Detailed Description

Base class for PorousFlow relative permeability materials.

All materials that derive from this class must override relativePermeability() and dRelativePermeability()

Definition at line 23 of file PorousFlowRelativePermeabilityBase.h.

Constructor & Destructor Documentation

PorousFlowRelativePermeabilityBase::PorousFlowRelativePermeabilityBase ( const InputParameters &  parameters)

Definition at line 31 of file PorousFlowRelativePermeabilityBase.C.

33  : PorousFlowMaterialBase(parameters),
34  _scaling(getParam<Real>("scaling")),
35  _saturation_variable_name(_dictator.saturationVariableNameDummy()),
36  _saturation(_nodal_material
37  ? getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
38  : getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")),
40  _nodal_material ? declareProperty<Real>("PorousFlow_relative_permeability_nodal" + _phase)
41  : declareProperty<Real>("PorousFlow_relative_permeability_qp" + _phase)),
43  _nodal_material
44  ? declarePropertyDerivative<Real>("PorousFlow_relative_permeability_nodal" + _phase,
46  : declarePropertyDerivative<Real>("PorousFlow_relative_permeability_qp" + _phase,
48  _s_res(getParam<Real>("s_res")),
49  _sum_s_res(getParam<Real>("sum_s_res")),
50  _dseff_ds(1.0 / (1.0 - _sum_s_res))
51 {
52  if (_sum_s_res < _s_res)
53  mooseError("Sum of residual saturations sum_s_res cannot be smaller than s_res in ", name());
54 }
const Real _scaling
Relative permeability is multiplied by this quantity.
MaterialProperty< Real > & _relative_permeability
Relative permeability material property.
const Real _dseff_ds
Derivative of effective saturation with respect to saturation.
const MaterialProperty< std::vector< Real > > & _saturation
Saturation material property.
PorousFlowMaterialBase(const InputParameters &parameters)
VariableName _saturation_variable_name
Name of (dummy) saturation primary variable.
const std::string _phase
Stringified fluid phase number.
MaterialProperty< Real > & _drelative_permeability_ds
Derivative of relative permeability wrt phase saturation.
const Real _sum_s_res
Sum of residual saturations over all phases.
const Real _s_res
Residual saturation of specified phase.

Member Function Documentation

void PorousFlowRelativePermeabilityBase::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 57 of file PorousFlowRelativePermeabilityBase.C.

58 {
59  // Effective saturation
60  Real seff = effectiveSaturation(_saturation[_qp][_phase_num]);
61  Real relperm, drelperm;
62 
63  if (seff < 0.0)
64  {
65  // Relative permeability is 0 for saturation less than residual
66  relperm = 0.0;
67  drelperm = 0.0;
68  }
69  else if (seff >= 0.0 && seff <= 1)
70  {
71  relperm = relativePermeability(seff);
72  drelperm = dRelativePermeability(seff);
73  }
74  else // seff > 1
75  {
76  // Relative permeability is 1 when fully saturated
77  relperm = 1.0;
78  drelperm = 0.0;
79  }
80 
81  _relative_permeability[_qp] = relperm * _scaling;
82  _drelative_permeability_ds[_qp] = drelperm * _dseff_ds * _scaling;
83 }
const Real _scaling
Relative permeability is multiplied by this quantity.
MaterialProperty< Real > & _relative_permeability
Relative permeability material property.
virtual Real dRelativePermeability(Real seff) const =0
Derivative of relative permeability with respect to effective saturation.
const Real _dseff_ds
Derivative of effective saturation with respect to saturation.
const MaterialProperty< std::vector< Real > > & _saturation
Saturation material property.
const unsigned int _phase_num
Phase number of fluid.
virtual Real effectiveSaturation(Real saturation) const
Effective saturation of fluid phase.
MaterialProperty< Real > & _drelative_permeability_ds
Derivative of relative permeability wrt phase saturation.
virtual Real relativePermeability(Real seff) const =0
Relative permeability equation (must be overriden in derived class)
virtual Real PorousFlowRelativePermeabilityBase::dRelativePermeability ( Real  seff) const
protectedpure virtual

Derivative of relative permeability with respect to effective saturation.

Parameters
seffeffective saturation
Returns
derivative of relative permeability wrt effective saturation

Implemented in PorousFlowRelativePermeabilityVG, PorousFlowRelativePermeabilityBC, PorousFlowRelativePermeabilityBW, PorousFlowRelativePermeabilityCorey, PorousFlowRelativePermeabilityFLAC, and PorousFlowRelativePermeabilityConst.

Referenced by computeQpProperties().

Real PorousFlowRelativePermeabilityBase::effectiveSaturation ( Real  saturation) const
protectedvirtual

Effective saturation of fluid phase.

Parameters
saturationtrue saturation
Returns
effective saturation

Definition at line 86 of file PorousFlowRelativePermeabilityBase.C.

Referenced by computeQpProperties().

87 {
88  return (saturation - _s_res) / (1.0 - _sum_s_res);
89 }
const Real _sum_s_res
Sum of residual saturations over all phases.
const Real _s_res
Residual saturation of specified phase.
void FORTRAN_CALL() saturation(double &P, double &T, int &N, int &nerr)
virtual Real PorousFlowRelativePermeabilityBase::relativePermeability ( Real  seff) const
protectedpure virtual

Relative permeability equation (must be overriden in derived class)

Parameters
seffeffective saturation
Returns
relative permeability

Implemented in PorousFlowRelativePermeabilityVG, PorousFlowRelativePermeabilityBC, PorousFlowRelativePermeabilityBW, PorousFlowRelativePermeabilityCorey, PorousFlowRelativePermeabilityFLAC, and PorousFlowRelativePermeabilityConst.

Referenced by computeQpProperties().

Member Data Documentation

MaterialProperty<Real>& PorousFlowRelativePermeabilityBase::_drelative_permeability_ds
protected

Derivative of relative permeability wrt phase saturation.

Definition at line 65 of file PorousFlowRelativePermeabilityBase.h.

Referenced by computeQpProperties().

const Real PorousFlowRelativePermeabilityBase::_dseff_ds
protected

Derivative of effective saturation with respect to saturation.

Definition at line 74 of file PorousFlowRelativePermeabilityBase.h.

Referenced by computeQpProperties().

const std::string PorousFlowMaterialBase::_phase
protectedinherited

Stringified fluid phase number.

Definition at line 36 of file PorousFlowMaterialBase.h.

const unsigned int PorousFlowMaterialBase::_phase_num
protectedinherited
MaterialProperty<Real>& PorousFlowRelativePermeabilityBase::_relative_permeability
protected

Relative permeability material property.

Definition at line 62 of file PorousFlowRelativePermeabilityBase.h.

Referenced by computeQpProperties().

const Real PorousFlowRelativePermeabilityBase::_s_res
protected

Residual saturation of specified phase.

Definition at line 68 of file PorousFlowRelativePermeabilityBase.h.

Referenced by effectiveSaturation(), and PorousFlowRelativePermeabilityBase().

const MaterialProperty<std::vector<Real> >& PorousFlowRelativePermeabilityBase::_saturation
protected

Saturation material property.

Definition at line 59 of file PorousFlowRelativePermeabilityBase.h.

Referenced by computeQpProperties().

VariableName PorousFlowRelativePermeabilityBase::_saturation_variable_name
protected

Name of (dummy) saturation primary variable.

Definition at line 56 of file PorousFlowRelativePermeabilityBase.h.

const Real PorousFlowRelativePermeabilityBase::_scaling
protected

Relative permeability is multiplied by this quantity.

Definition at line 53 of file PorousFlowRelativePermeabilityBase.h.

Referenced by computeQpProperties().

const Real PorousFlowRelativePermeabilityBase::_sum_s_res
protected

Sum of residual saturations over all phases.

Definition at line 71 of file PorousFlowRelativePermeabilityBase.h.

Referenced by effectiveSaturation(), and PorousFlowRelativePermeabilityBase().


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