https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlowRelativePermeabilityVGTempl< is_ad > Class Template Reference

Material to calculate van Genuchten-type relative permeability of an arbitrary phase given the saturation and exponent of that phase. More...

#include <PorousFlowRelativePermeabilityVG.h>

Inheritance diagram for PorousFlowRelativePermeabilityVGTempl< is_ad >:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 PorousFlowRelativePermeabilityVGTempl (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

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

Protected Attributes

const Real _m
 van Genuchten exponent m for the specified phase More...
 
const bool _wetting
 Whether to use the wetting or non-wetting van Genuchten expression. More...
 
const Real _cut
 Start of cubic smoothing. More...
 
const Real _cub0
 Parameter of the cubic. More...
 
const Real _cub1
 Parameter of the cubic. More...
 
const Real _cub2
 Parameter of the cubic. More...
 
const Real _cub3
 Parameter of the cubic. More...
 
const Real _scaling
 Relative permeability is multiplied by this quantity. More...
 
const GenericMaterialProperty< std::vector< Real >, is_ad > & _saturation
 Saturation material property. More...
 
GenericMaterialProperty< Real, is_ad > & _relative_permeability
 Relative permeability material property. More...
 
MaterialProperty< Real > *const _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

template<bool is_ad>
class PorousFlowRelativePermeabilityVGTempl< is_ad >

Material to calculate van Genuchten-type relative permeability of an arbitrary phase given the saturation and exponent of that phase.

From van Genuchten, M. Th., A closed for equation for predicting the hydraulic conductivity of unsaturated soils, Soil Sci. Soc., 44, 892-898 (1980)

Optionally this relative permeability may be smoothed with a cubic near seff=1 The relative permeability is a cubic for seff>_cut. The cubic is chosen so that the derivative is zero for seff=1, and that the derivative and value matches the van Genuchten expression for seff=_cut.

Definition at line 28 of file PorousFlowRelativePermeabilityVG.h.

Constructor & Destructor Documentation

◆ PorousFlowRelativePermeabilityVGTempl()

Definition at line 42 of file PorousFlowRelativePermeabilityVG.C.

45  _m(this->template getParam<Real>("m")),
46  _wetting(this->template getParam<bool>("wetting")),
47  _cut(this->template getParam<Real>("seff_turnover")),
52  _cub2(_cut < 1.0
53  ? (this->template getParam<bool>("zero_derivative")
54  ? 3.0 * (1.0 - _cub0 - _cub1 * (1.0 - _cut)) / Utility::pow<2>(1.0 - _cut) +
55  _cub1 / (1.0 - _cut)
58  : 0.0),
59  _cub3(_cut < 1.0
60  ? (this->template getParam<bool>("zero_derivative")
61  ? -2.0 * (1.0 - _cub0 - _cub1 * (1.0 - _cut)) / Utility::pow<3>(1.0 - _cut) -
62  _cub1 / Utility::pow<2>(1.0 - _cut)
63  : (1.0 - _cub0 - _cub1 * (1.0 - _cut) - _cub2 * Utility::pow<2>(1.0 - _cut)) /
64  Utility::pow<3>(1.0 - _cut))
65  : 0.0)
66 {
67 }
Real d2RelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Second derivative of relative permeability with respect to saturation.
Real dRelativePermeabilityNW(Real seff, Real lambda)
Derivative of relative permeability of the non-wetting phase wrt to effective saturation.
virtual Real dRelativePermeability(Real seff) const override
Derivative of relative permeability with respect to effective saturation.
T relativePermeabilityNW(const T &seff, Real lambda)
Relative permeability of the non-wetting phase as a function of effective saturation.
van Genuchten effective saturation, capillary pressure and relative permeability functions.
Base class for PorousFlow relative permeability materials.
Real d2RelativePermeabilityNW(Real seff, Real m)
Second derivative of relative permeability for a non-wetting phase with respect to effective saturati...
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
T relativePermeability(const T &seff, Real m)
Relative permeability as a function of effective saturation.
const Real _m
van Genuchten exponent m for the specified phase
const bool _wetting
Whether to use the wetting or non-wetting van Genuchten expression.

Member Function Documentation

◆ computeQpProperties()

template<bool is_ad>
void PorousFlowRelativePermeabilityBaseTempl< is_ad >::computeQpProperties ( )
overrideprotectedvirtualinherited

Definition at line 65 of file PorousFlowRelativePermeabilityBase.C.

66 {
67  // Effective saturation
69  GenericReal<is_ad> relperm;
70  Real drelperm;
71 
72  if (seff < 0.0)
73  {
74  // Relative permeability is 0 for saturation less than residual
75  relperm = 0.0;
76  drelperm = 0.0;
77  }
78  else if (seff >= 0.0 && seff <= 1)
79  {
80  relperm = relativePermeability(seff);
82  }
83  else // seff > 1
84  {
85  // Relative permeability is 1 when fully saturated
86  relperm = 1.0;
87  drelperm = 0.0;
88  }
89 
90  _relative_permeability[_qp] = relperm * _scaling;
91 
92  if (!is_ad)
93  (*_drelative_permeability_ds)[_qp] = drelperm * _dseff_ds * _scaling;
94 }
virtual Real dRelativePermeability(Real seff) const =0
Derivative of relative permeability with respect to effective saturation.
Moose::GenericType< Real, is_ad > GenericReal
const GenericMaterialProperty< std::vector< Real >, is_ad > & _saturation
Saturation material property.
virtual GenericReal< is_ad > relativePermeability(GenericReal< is_ad > seff) const =0
Relative permeability equation (must be overriden in derived class)
auto raw_value(const Eigen::Map< T > &in)
const Real _scaling
Relative permeability is multiplied by this quantity.
const unsigned int _phase_num
Phase number of fluid.
virtual GenericReal< is_ad > effectiveSaturation(GenericReal< is_ad > saturation) const
Effective saturation of fluid phase.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _dseff_ds
Derivative of effective saturation with respect to saturation.
GenericMaterialProperty< Real, is_ad > & _relative_permeability
Relative permeability material property.

◆ dRelativePermeability()

template<bool is_ad>
Real PorousFlowRelativePermeabilityVGTempl< is_ad >::dRelativePermeability ( Real  seff) const
overrideprotectedvirtual

Derivative of relative permeability with respect to effective saturation.

Parameters
seffeffective saturation
Returns
derivative of relative permeability wrt effective saturation

Implements PorousFlowRelativePermeabilityBaseTempl< is_ad >.

Definition at line 87 of file PorousFlowRelativePermeabilityVG.C.

88 {
89  if (seff < _cut)
90  {
91  if (_wetting)
93  else
95  }
96 
97  return _cub1 + 2.0 * _cub2 * (seff - _cut) + 3.0 * _cub3 * Utility::pow<2>(seff - _cut);
98 }
Real dRelativePermeability(Real seff, Real m)
Derivative of relative permeability with respect to effective saturation.
const Real _m
van Genuchten exponent m for the specified phase
Real dRelativePermeabilityNW(Real seff, Real m)
Derivative of relative permeability for a non-wetting phase with respect to effective saturation...
const bool _wetting
Whether to use the wetting or non-wetting van Genuchten expression.

◆ effectiveSaturation()

template<bool is_ad>
GenericReal< is_ad > PorousFlowRelativePermeabilityBaseTempl< is_ad >::effectiveSaturation ( GenericReal< is_ad >  saturation) const
protectedvirtualinherited

Effective saturation of fluid phase.

Parameters
saturationtrue saturation
Returns
effective saturation

Definition at line 98 of file PorousFlowRelativePermeabilityBase.C.

100 {
101  return (saturation - _s_res) / (1.0 - _sum_s_res);
102 }
const Real _sum_s_res
Sum of residual saturations over all phases.
const Real _s_res
Residual saturation of specified phase.

◆ relativePermeability()

template<bool is_ad>
GenericReal< is_ad > PorousFlowRelativePermeabilityVGTempl< is_ad >::relativePermeability ( GenericReal< is_ad >  seff) const
overrideprotectedvirtual

Relative permeability equation (must be overriden in derived class)

Parameters
seffeffective saturation
Returns
relative permeability

Implements PorousFlowRelativePermeabilityBaseTempl< is_ad >.

Definition at line 71 of file PorousFlowRelativePermeabilityVG.C.

72 {
73  if (MetaPhysicL::raw_value(seff) < _cut)
74  {
75  if (_wetting)
77  else
79  }
80 
81  return _cub0 + _cub1 * (seff - _cut) + _cub2 * Utility::pow<2>(seff - _cut) +
82  _cub3 * Utility::pow<3>(seff - _cut);
83 }
T relativePermeabilityNW(const T &seff, Real m)
Relative permeability for a non-wetting phase as a function of effective saturation.
auto raw_value(const Eigen::Map< T > &in)
T relativePermeability(const T &seff, Real m)
Relative permeability as a function of effective saturation.
const Real _m
van Genuchten exponent m for the specified phase
const bool _wetting
Whether to use the wetting or non-wetting van Genuchten expression.

◆ validParams()

template<bool is_ad>
InputParameters PorousFlowRelativePermeabilityVGTempl< is_ad >::validParams ( )
static

Definition at line 18 of file PorousFlowRelativePermeabilityVG.C.

19 {
22  "m", "m > 0 & m < 1", "The van Genuchten exponent of the phase");
23  params.addRangeCheckedParam<Real>("seff_turnover",
24  1.0,
25  "seff_turnover > 0 & seff_turnover <= 1",
26  "The relative permeability will be a cubic for seff > "
27  "seff_turnover. The cubic is chosen so that its derivative "
28  "and value matche the VG function at seff=seff_turnover");
29  params.addParam<bool>("zero_derivative",
30  false,
31  "Employ a cubic for seff>seff_turnover that has zero derivative at seff=1");
32  params.addParam<bool>("wetting",
33  true,
34  "If true, use the van Genuchten form appropriate for a wetting (liquid) "
35  "phase. If false, use the non-wetting (gas) expression.");
36  params.addClassDescription("This Material calculates relative permeability of a phase "
37  "using the van Genuchten model");
38  return params;
39 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)

Member Data Documentation

◆ _cub0

template<bool is_ad>
const Real PorousFlowRelativePermeabilityVGTempl< is_ad >::_cub0
protected

Parameter of the cubic.

Definition at line 49 of file PorousFlowRelativePermeabilityVG.h.

◆ _cub1

template<bool is_ad>
const Real PorousFlowRelativePermeabilityVGTempl< is_ad >::_cub1
protected

Parameter of the cubic.

Definition at line 51 of file PorousFlowRelativePermeabilityVG.h.

◆ _cub2

template<bool is_ad>
const Real PorousFlowRelativePermeabilityVGTempl< is_ad >::_cub2
protected

Parameter of the cubic.

Definition at line 53 of file PorousFlowRelativePermeabilityVG.h.

◆ _cub3

template<bool is_ad>
const Real PorousFlowRelativePermeabilityVGTempl< is_ad >::_cub3
protected

Parameter of the cubic.

Definition at line 55 of file PorousFlowRelativePermeabilityVG.h.

◆ _cut

template<bool is_ad>
const Real PorousFlowRelativePermeabilityVGTempl< is_ad >::_cut
protected

Start of cubic smoothing.

Definition at line 46 of file PorousFlowRelativePermeabilityVG.h.

◆ _drelative_permeability_ds

template<bool is_ad>
MaterialProperty<Real>* const PorousFlowRelativePermeabilityBaseTempl< is_ad >::_drelative_permeability_ds
protectedinherited

Derivative of relative permeability wrt phase saturation.

Definition at line 61 of file PorousFlowRelativePermeabilityBase.h.

◆ _dseff_ds

template<bool is_ad>
const Real PorousFlowRelativePermeabilityBaseTempl< is_ad >::_dseff_ds
protectedinherited

Derivative of effective saturation with respect to saturation.

Definition at line 70 of file PorousFlowRelativePermeabilityBase.h.

◆ _m

template<bool is_ad>
const Real PorousFlowRelativePermeabilityVGTempl< is_ad >::_m
protected

van Genuchten exponent m for the specified phase

Definition at line 40 of file PorousFlowRelativePermeabilityVG.h.

◆ _phase

const std::string PorousFlowMaterialBase::_phase
protectedinherited

Stringified fluid phase number.

Definition at line 34 of file PorousFlowMaterialBase.h.

◆ _phase_num

const unsigned int PorousFlowMaterialBase::_phase_num
protectedinherited

◆ _relative_permeability

template<bool is_ad>
GenericMaterialProperty<Real, is_ad>& PorousFlowRelativePermeabilityBaseTempl< is_ad >::_relative_permeability
protectedinherited

Relative permeability material property.

Definition at line 58 of file PorousFlowRelativePermeabilityBase.h.

◆ _s_res

template<bool is_ad>
const Real PorousFlowRelativePermeabilityBaseTempl< is_ad >::_s_res
protectedinherited

◆ _saturation

template<bool is_ad>
const GenericMaterialProperty<std::vector<Real>, is_ad>& PorousFlowRelativePermeabilityBaseTempl< is_ad >::_saturation
protectedinherited

Saturation material property.

Definition at line 55 of file PorousFlowRelativePermeabilityBase.h.

◆ _scaling

template<bool is_ad>
const Real PorousFlowRelativePermeabilityBaseTempl< is_ad >::_scaling
protectedinherited

Relative permeability is multiplied by this quantity.

Definition at line 52 of file PorousFlowRelativePermeabilityBase.h.

◆ _sum_s_res

template<bool is_ad>
const Real PorousFlowRelativePermeabilityBaseTempl< is_ad >::_sum_s_res
protectedinherited

Sum of residual saturations over all phases.

Definition at line 67 of file PorousFlowRelativePermeabilityBase.h.

Referenced by PorousFlowRelativePermeabilityBaseTempl< is_ad >::PorousFlowRelativePermeabilityBaseTempl().

◆ _wetting

template<bool is_ad>
const bool PorousFlowRelativePermeabilityVGTempl< is_ad >::_wetting
protected

Whether to use the wetting or non-wetting van Genuchten expression.

Definition at line 43 of file PorousFlowRelativePermeabilityVG.h.


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