OGS
MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem Class Referencefinal

Detailed Description

van Genuchten-Mualem relative permeability function for non-wetting phase in terms of effective wetting-phase saturation [26] :

\[k_{rel}^n= (1 - S_e)^{1/2} (1 - S_e^{1/m})^{2m}\]

with

\[S_e=\frac{S^L-S^L_r}{S^L_{\mbox{max}}-S^L_r}\]

where

\begin{eqnarray*} &S^L_r& \mbox{residual saturation of wetting phase,}\\ &S^L_{\mbox{max}}& \mbox{maximum saturation of wetting phase,}\\ &m\, \in (0, 1) & \mbox{ exponent.}\\ \end{eqnarray*}

The derivative of the relative permeability with respect to saturation is computed as

\[\frac{\mathrm{d} k_{rel}^n}{\mathrm{d}S^L}= -(\dfrac{[1-S_e^{1/m}]^{2m}}{2\sqrt{1-S_e}}+2\sqrt{1-S_e} {(1-S_e^{1/m})}^{2*m-1} S_e^{1/m-1})/(S^L_\mbox{max}-S^L_r) \]

As \(S^L \to S^L_\mbox{max}\), or \(S_e \to 1\), \(\dfrac{[1-S_e^{1/m}]^{2m}}{2\sqrt{1-S_e}}\) has a limit of zero.

Definition at line 47 of file RelPermNonWettingPhaseVanGenuchtenMualem.h.

#include <RelPermNonWettingPhaseVanGenuchtenMualem.h>

Inheritance diagram for MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem:
[legend]
Collaboration diagram for MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem:
[legend]

Public Member Functions

 RelPermNonWettingPhaseVanGenuchtenMualem (std::string name, const double S_L_r, const double S_n_r, const double m, const double krel_min)
 
void checkScale () const override
 
PropertyDataType value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
 
PropertyDataType dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
 
double computeSaturationForMinimumRelativePermeability () const
 
- Public Member Functions inherited from MaterialPropertyLib::Property
virtual ~Property ()
 
virtual PropertyDataType initialValue (ParameterLib::SpatialPosition const &pos, double const t) const
 
virtual PropertyDataType value () const
 
virtual PropertyDataType value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
virtual PropertyDataType dValue (VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
virtual PropertyDataType d2Value (VariableArray const &variable_array, Variable const variable1, Variable const variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 Default implementation: 2nd derivative of any constant property is zero.
 
virtual void setProperties (std::vector< std::unique_ptr< Phase > > const &phases)
 Default implementation:
 
void setScale (std::variant< Medium *, Phase *, Component * > scale)
 
template<typename T >
initialValue (ParameterLib::SpatialPosition const &pos, double const t) const
 
template<typename T >
value () const
 
template<typename T >
value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
dValue (VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
d2Value (VariableArray const &variable_array, Variable const &variable1, Variable const &variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 

Private Attributes

const double S_L_r_
 Residual saturation of wetting phase.
 
const double S_L_max_
 Maximum saturation of wetting phase.
 
const double m_
 Exponent \( m \).
 
const double krel_min_
 Minimum relative permeability.
 
const double S_L_for_krel_min_
 Liquid saturation that gives krel_min_.
 

Additional Inherited Members

- Protected Attributes inherited from MaterialPropertyLib::Property
std::string name_
 
PropertyDataType value_
 The single value of a property.
 
PropertyDataType dvalue_
 
std::variant< Medium *, Phase *, Component * > scale_
 

Constructor & Destructor Documentation

◆ RelPermNonWettingPhaseVanGenuchtenMualem()

MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::RelPermNonWettingPhaseVanGenuchtenMualem ( std::string name,
const double S_L_r,
const double S_n_r,
const double m,
const double krel_min )
Parameters
nameName of the property,
S_L_rResidual saturation of the wetting phase, \( S^L_r \)
S_n_rResidual saturation of the non-wetting phase, \( S^n_{r} \)
mExponent, \( m \in [0,1]\)
krel_minMinimum relative permeability, \( k_{rel}^n_{\mbox{min}}\)

Definition at line 32 of file RelPermNonWettingPhaseVanGenuchtenMualem.cpp.

38 : S_L_r_(S_L_r),
39 S_L_max_(1. - S_n_r),
40 m_(m),
41 krel_min_(krel_min),
43{
44 name_ = std::move(name);
46}
void checkVanGenuchtenExponentRange(const double m)

References MaterialPropertyLib::checkVanGenuchtenExponentRange(), m_, MaterialPropertyLib::name, and MaterialPropertyLib::Property::name_.

Member Function Documentation

◆ checkScale()

void MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::checkScale ( ) const
inlineoverridevirtual

Reimplemented from MaterialPropertyLib::Property.

Definition at line 66 of file RelPermNonWettingPhaseVanGenuchtenMualem.h.

67 {
68 if (!std::holds_alternative<Medium*>(scale_))
69 {
71 "The property 'RelPermNonWettingPhaseVanGenuchtenMualem' is "
72 "implemented on the 'media' scale only.");
73 }
74 }
#define OGS_FATAL(...)
Definition Error.h:26
std::variant< Medium *, Phase *, Component * > scale_
Definition Property.h:297

References OGS_FATAL, and MaterialPropertyLib::Property::scale_.

◆ computeSaturationForMinimumRelativePermeability()

double MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::computeSaturationForMinimumRelativePermeability ( ) const

Computes the saturation that gives the minimum relative permeability by using the Regula–Falsi Method.

Returns
\( S^L\) that gives the minimum relative permeability.

Definition at line 95 of file RelPermNonWettingPhaseVanGenuchtenMualem.cpp.

97{
98 auto f = [this](double S_L) -> double
99 {
100 return computeVanGenuchtenMualemValue(S_L, this->S_L_r_, this->S_L_max_,
101 this->m_) -
102 this->krel_min_;
103 };
104
105 auto root_finder =
107 f, S_L_r_, S_L_max_);
108
109 root_finder.step(1000);
110
111 return root_finder.getResult();
112}
double computeVanGenuchtenMualemValue(const double S_L, const double S_L_r, const double S_L_max, const double m)
RegulaFalsi< SubType, Function > makeRegulaFalsi(Function &&f, double const a, double const b)
Definition Root1D.h:137

References MaterialPropertyLib::computeVanGenuchtenMualemValue(), krel_min_, m_, MathLib::Nonlinear::makeRegulaFalsi(), S_L_max_, and S_L_r_.

◆ dValue()

PropertyDataType MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::dValue ( VariableArray const & variable_array,
Variable const variable,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual
Returns
\( \frac{\mathrm{d} k_{rel}^n}{\mathrm{d}S^L} \).

Reimplemented from MaterialPropertyLib::Property.

Definition at line 61 of file RelPermNonWettingPhaseVanGenuchtenMualem.cpp.

65{
66 if (variable != Variable::liquid_saturation)
67 {
69 "RelPermNonWettingPhaseVanGenuchtenMualem::dValue is implemented "
70 "for the derivative with respect to liquid saturation only.");
71 }
72
73 const double S_L = variable_array.liquid_saturation;
74 if (S_L < S_L_r_ || S_L > S_L_for_krel_min_)
75 {
76 return 0.0;
77 }
78
79 if (std::fabs(S_L - S_L_max_) < std::numeric_limits<double>::epsilon())
80 {
81 return 0.0;
82 }
83
84 const double Se = (S_L - S_L_r_) / (S_L_max_ - S_L_r_);
85
86 const double val1 = std::sqrt(1.0 - Se);
87 const double val2 = 1.0 - std::pow(Se, 1.0 / m_);
88
89 return (-0.5 * std::pow(val2, 2.0 * m_) / val1 -
90 2.0 * std::pow(Se, -1.0 + 1.0 / m_) * val1 *
91 std::pow(val2, 2.0 * m_ - 1.0)) /
92 (S_L_max_ - S_L_r_);
93}

References MaterialPropertyLib::liquid_saturation, MaterialPropertyLib::VariableArray::liquid_saturation, m_, OGS_FATAL, S_L_for_krel_min_, S_L_max_, and S_L_r_.

◆ value()

PropertyDataType MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual
Returns
\(k_{rel}^n \).

Reimplemented from MaterialPropertyLib::Property.

Definition at line 48 of file RelPermNonWettingPhaseVanGenuchtenMualem.cpp.

52{
53 const double S_L =
54 std::clamp(variable_array.liquid_saturation, S_L_r_, S_L_max_);
55
56 const double krel =
58 return std::max(krel_min_, krel);
59}

References MaterialPropertyLib::computeVanGenuchtenMualemValue(), krel_min_, MaterialPropertyLib::VariableArray::liquid_saturation, m_, S_L_max_, and S_L_r_.

Member Data Documentation

◆ krel_min_

const double MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::krel_min_
private

Minimum relative permeability.

Definition at line 98 of file RelPermNonWettingPhaseVanGenuchtenMualem.h.

Referenced by computeSaturationForMinimumRelativePermeability(), and value().

◆ m_

const double MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::m_
private

◆ S_L_for_krel_min_

const double MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::S_L_for_krel_min_
private

Liquid saturation that gives krel_min_.

Definition at line 100 of file RelPermNonWettingPhaseVanGenuchtenMualem.h.

Referenced by dValue().

◆ S_L_max_

const double MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::S_L_max_
private

Maximum saturation of wetting phase.

Definition at line 96 of file RelPermNonWettingPhaseVanGenuchtenMualem.h.

Referenced by computeSaturationForMinimumRelativePermeability(), dValue(), and value().

◆ S_L_r_

const double MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::S_L_r_
private

Residual saturation of wetting phase.

Definition at line 95 of file RelPermNonWettingPhaseVanGenuchtenMualem.h.

Referenced by computeSaturationForMinimumRelativePermeability(), dValue(), and value().


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