OGS
MaterialPropertyLib::SaturationVanGenuchten Class Referencefinal

Detailed Description

The van Genuchten capillary pressure model.

The van Genuchten capillary pressure model ([40]) is:

\[p_c(S)=p_b (S_\text{eff}^{-1/m}-1)^{1-m}\]

with effective saturation defined as

\[S_\text{eff}=\frac{S-S_r}{S_{\text{max}}-S_r}.\]

Above, \(S_r\) and \(S_{\text{max}}\) are the residual and the maximum saturations. The (pressure) exponent \(m \in (0,1)\) and the pressure scaling parameter \(p_b\) (it is equal to \(\rho g/\alpha\) in original publication) are given by the user. The scaling parameter \(p_b\) is given in same units as pressure.

Another (saturaton) exponent \(n\) is usually set to \(n = 1 / (1 - m)\).

The saturation is computed from the capillary pressure as follows:

\[S(p_c)= \begin{cases} S_{\text{max}} & \text{for $p_c \leq 0$, and}\\ \left( \left(\frac{p_c}{p_b}\right)^{\frac{1}{1-m}} +1\right)^{-m} (S_{\text{max}}-S_r) +S_r& \text{for $p_c > 0$.} \end{cases} \]

The result is then clamped between the residual and maximum liquid saturations.

Definition at line 45 of file SaturationVanGenuchten.h.

#include <SaturationVanGenuchten.h>

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

Public Member Functions

 SaturationVanGenuchten (std::string name, double const residual_liquid_saturation, double const residual_gas_saturation, double const pressure_exponent, double const saturation_exponent, double const p_b)
 
void checkScale () const override
 
PropertyDataType value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &, double const, double const) const override
 
PropertyDataType dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &, double const, double const) const override
 
PropertyDataType d2Value (VariableArray const &variable_array, Variable const variable1, Variable const variable2, ParameterLib::SpatialPosition const &, double const, double const) const override
 Default implementation: 2nd derivative of any constant property is zero.
 
- 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 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

double const S_L_res_
 
double const S_L_max_
 
double const m_
 
double const n_
 
double const p_b_
 

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

◆ SaturationVanGenuchten()

MaterialPropertyLib::SaturationVanGenuchten::SaturationVanGenuchten ( std::string name,
double const residual_liquid_saturation,
double const residual_gas_saturation,
double const pressure_exponent,
double const saturation_exponent,
double const p_b )

Definition at line 20 of file SaturationVanGenuchten.cpp.

29 m_(pressure_exponent),
30 n_(saturation_exponent),
31 p_b_(p_b)
32{
33 name_ = std::move(name);
34
35 if (!(m_ > 0 && m_ < 1))
36 {
38 "The pressure exponent value m = {:g} of van Genuchten saturation "
39 "model, is out of its range of (0, 1)",
40 m_);
41 }
42
43 if (n_ < 1)
44 {
46 "The saturation exponent value n = {:g} of van Genuchten "
47 "saturation model, is out of its range of [1, +inf)",
48 n_);
49 }
50}
#define OGS_FATAL(...)
Definition Error.h:26

References m_, n_, MaterialPropertyLib::name, MaterialPropertyLib::Property::name_, and OGS_FATAL.

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 55 of file SaturationVanGenuchten.h.

56 {
57 if (!std::holds_alternative<Medium*>(scale_))
58 {
60 "The property 'SaturationVanGenuchten' is implemented on the "
61 "'media' scale only.");
62 }
63 }
std::variant< Medium *, Phase *, Component * > scale_
Definition Property.h:297

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

◆ d2Value()

PropertyDataType MaterialPropertyLib::SaturationVanGenuchten::d2Value ( VariableArray const & variable_array,
Variable const variable1,
Variable const variable2,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual

Default implementation: 2nd derivative of any constant property is zero.

This virtual method will compute the second derivative of a property with respect to the given variables pv1 and pv2.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 107 of file SaturationVanGenuchten.cpp.

111{
112 (void)variable1;
113 (void)variable2;
114 assert((variable1 == Variable::capillary_pressure) &&
115 (variable2 == Variable::capillary_pressure) &&
116 "SaturationVanGenuchten::d2Value is implemented for derivatives "
117 "with respect to capillary pressure only.");
118
119 const double p_cap = variable_array.capillary_pressure;
120
121 if (p_cap <= 0)
122 {
123 return 0.;
124 }
125
126 double const p = p_cap / p_b_;
127 double const p_to_n = std::pow(p, n_);
128
129 double const S_eff = std::pow(p_to_n + 1., -m_);
130 double const S = S_eff * S_L_max_ - S_eff * S_L_res_ + S_L_res_;
131
132 if (S < S_L_res_ || S > S_L_max_)
133 {
134 return 0.;
135 }
136
137 double const d2S_eff_dp_cap2 =
138 m_ * n_ * n_ * p_to_n * S_eff * (p_to_n - m_) /
139 ((p_cap * p_to_n + p_cap) * (p_cap * p_to_n + p_cap));
140 return d2S_eff_dp_cap2 * (S_L_max_ - S_L_res_);
141}

References MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::VariableArray::capillary_pressure, m_, n_, p_b_, S_L_max_, and S_L_res_.

◆ dValue()

PropertyDataType MaterialPropertyLib::SaturationVanGenuchten::dValue ( VariableArray const & variable_array,
Variable const variable,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual

This virtual method will compute the property derivative value based on the variables that are passed as arguments with the default implementation using empty variables array for the previous time step.

The default implementation of this method only returns the property value derivative without altering it.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 72 of file SaturationVanGenuchten.cpp.

76{
77 if (variable != Variable::capillary_pressure)
78 {
80 "SaturationVanGenuchten::dValue is implemented for derivatives "
81 "with respect to capillary pressure only.");
82 }
83
84 const double p_cap = variable_array.capillary_pressure;
85
86 if (p_cap <= 0)
87 {
88 return 0.;
89 }
90
91 double const p = p_cap / p_b_;
92 double const p_to_n = std::pow(p, n_);
93
94 double const S_eff = std::pow(p_to_n + 1., -m_);
95 double const S = S_eff * S_L_max_ - S_eff * S_L_res_ + S_L_res_;
96
97 if (S < S_L_res_ || S > S_L_max_)
98 {
99 return 0.;
100 }
101
102 double const dS_eff_dp_cap =
103 -m_ * n_ * p_to_n * S_eff / (p_cap * (p_to_n + 1.));
104 return dS_eff_dp_cap * (S_L_max_ - S_L_res_);
105}

References MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::VariableArray::capillary_pressure, m_, n_, OGS_FATAL, p_b_, S_L_max_, and S_L_res_.

◆ value()

PropertyDataType MaterialPropertyLib::SaturationVanGenuchten::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & ,
double const ,
double const  ) const
overridevirtual

Those methods override the base class implementations and actually compute and set the property values_ and dValues_.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 52 of file SaturationVanGenuchten.cpp.

56{
57 const double p_cap = variable_array.capillary_pressure;
58
59 if (p_cap <= 0)
60 {
61 return S_L_max_;
62 }
63
64 double const p = p_cap / p_b_;
65 double const p_to_n = std::pow(p, n_);
66
67 double const S_eff = std::pow(p_to_n + 1., -m_);
68 double const S = S_eff * S_L_max_ - S_eff * S_L_res_ + S_L_res_;
69 return std::clamp(S, S_L_res_, S_L_max_);
70}

References MaterialPropertyLib::VariableArray::capillary_pressure, m_, n_, p_b_, S_L_max_, and S_L_res_.

Member Data Documentation

◆ m_

double const MaterialPropertyLib::SaturationVanGenuchten::m_
private

Definition at line 85 of file SaturationVanGenuchten.h.

Referenced by SaturationVanGenuchten(), d2Value(), dValue(), and value().

◆ n_

double const MaterialPropertyLib::SaturationVanGenuchten::n_
private

Definition at line 86 of file SaturationVanGenuchten.h.

Referenced by SaturationVanGenuchten(), d2Value(), dValue(), and value().

◆ p_b_

double const MaterialPropertyLib::SaturationVanGenuchten::p_b_
private

Definition at line 87 of file SaturationVanGenuchten.h.

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

◆ S_L_max_

double const MaterialPropertyLib::SaturationVanGenuchten::S_L_max_
private

Definition at line 84 of file SaturationVanGenuchten.h.

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

◆ S_L_res_

double const MaterialPropertyLib::SaturationVanGenuchten::S_L_res_
private

Definition at line 83 of file SaturationVanGenuchten.h.

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


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