OGS
MaterialPropertyLib::CapillaryPressureVanGenuchten Class Reference

Detailed Description

The van Genuchten capillary pressure model.

The van Genuchten capillary pressure model ([32]) 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 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.

In the original work another exponent \(n\) is used, but usually set to \(n = 1 / (1 - m)\), and also in this implementation.

The the capillary pressure is computed from saturation as above but is cut off at maximum capillary pressure given by user.

Definition at line 42 of file CapillaryPressureVanGenuchten.h.

#include <CapillaryPressureVanGenuchten.h>

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

Public Member Functions

 CapillaryPressureVanGenuchten (std::string name, double const residual_liquid_saturation, double const residual_gas_saturation, double const exponent, double const p_b, double const maximum_capillary_pressure)
 
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
 
- 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. More...
 
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_
 Residual saturation of liquid phase. More...
 
double const S_L_max_
 Maximum saturation of liquid phase. More...
 
double const m_
 Exponent. More...
 
double const p_b_
 Pressure scaling factor. More...
 
double const p_cap_max_
 Maximum capillary pressure. More...
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ CapillaryPressureVanGenuchten()

MaterialPropertyLib::CapillaryPressureVanGenuchten::CapillaryPressureVanGenuchten ( std::string  name,
double const  residual_liquid_saturation,
double const  residual_gas_saturation,
double const  exponent,
double const  p_b,
double const  maximum_capillary_pressure 
)

Definition at line 21 of file CapillaryPressureVanGenuchten.cpp.

30  m_(exponent),
31  p_b_(p_b),
32  p_cap_max_(maximum_capillary_pressure)
33 {
34  name_ = std::move(name);
35 
36  if (S_L_res_ < 0 || S_L_res_ > 1)
37  {
38  OGS_FATAL(
39  "Van Genuchten capillary pressure model: The residual liquid "
40  "saturation value S_L_res = {:g} is out of admissible range [0, "
41  "1].",
42  S_L_res_);
43  }
44  if (S_L_max_ < 0 || S_L_max_ > 1)
45  {
46  OGS_FATAL(
47  "Van Genuchten capillary pressure model: The maximum liquid "
48  "saturation value S_L_max = {:g} is out of admissible range [0, "
49  "1].",
50  S_L_max_);
51  }
52  if (S_L_res_ >= S_L_max_)
53  {
54  OGS_FATAL(
55  "Van Genuchten capillary pressure model: The maximum liquid "
56  "saturation S_L_max = {:g} must not be less or equal to the "
57  "residual liquid saturion S_L_res = { : g}.",
59  }
60  if (!(m_ > 0 && m_ < 1))
61  {
62  OGS_FATAL(
63  "Van Genuchten capillary pressure model: The exponent value m = "
64  "{:g} is out of of admissible range (0, 1).",
65  m_);
66  }
67  if (p_b_ <= 0)
68  {
69  OGS_FATAL(
70  "Van Genuchten capillary pressure model: The pressure scaling "
71  "value p_b = {:g} must be positive.",
72  p_b_);
73  }
74  if (p_cap_max_ < 0)
75  {
76  OGS_FATAL(
77  "Van Genuchten capillary pressure model: The maximum capillary "
78  "pressure value p_cap_max = {:g} must be non-negative.",
79  p_cap_max_);
80  }
81 }
#define OGS_FATAL(...)
Definition: Error.h:26
double const S_L_res_
Residual saturation of liquid phase.
double const S_L_max_
Maximum saturation of liquid phase.

References m_, MaterialPropertyLib::name, MaterialPropertyLib::Property::name_, OGS_FATAL, p_b_, p_cap_max_, S_L_max_, and S_L_res_.

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 52 of file CapillaryPressureVanGenuchten.h.

53  {
54  if (!std::holds_alternative<Medium*>(scale_))
55  {
56  OGS_FATAL(
57  "The property 'CapillaryPressureVanGenuchten' is implemented "
58  "on the 'media' scale only.");
59  }
60  }
std::variant< Medium *, Phase *, Component * > scale_
Definition: Property.h:287

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

◆ dValue()

PropertyDataType MaterialPropertyLib::CapillaryPressureVanGenuchten::dValue ( VariableArray const &  variable_array,
Variable const  variable,
ParameterLib::SpatialPosition const &  pos,
double const  t,
double const  dt 
) const
overridevirtual
Returns
\( \frac{\partial p_c(S)}{\partial S} \)

Reimplemented from MaterialPropertyLib::Property.

Definition at line 110 of file CapillaryPressureVanGenuchten.cpp.

114 {
115  if (primary_variable != Variable::liquid_saturation)
116  {
117  OGS_FATAL(
118  "CapillaryPressureVanGenuchten::dValue is implemented for "
119  "derivatives with respect to liquid saturation only.");
120  }
121 
122  double const S_L = std::get<double>(
123  variable_array[static_cast<int>(Variable::liquid_saturation)]);
124 
125  if (S_L <= S_L_res_)
126  {
127  return 0.;
128  }
129 
130  if (S_L >= S_L_max_)
131  {
132  return 0.;
133  }
134 
135  double const S_eff = (S_L - S_L_res_) / (S_L_max_ - S_L_res_);
136 
137  assert(0 < S_eff && S_eff < 1.0);
138 
139  double const val1 = std::pow(S_eff, -1.0 / m_);
140  double const p_cap = p_b_ * std::pow(val1 - 1.0, 1.0 - m_);
141  if (p_cap >= p_cap_max_)
142  {
143  return 0.;
144  }
145 
146  double const val2 = std::pow(val1 - 1.0, -m_);
147  return p_b_ * (m_ - 1.0) * val1 * val2 / (m_ * (S_L - S_L_res_));
148 }

References MaterialPropertyLib::liquid_saturation, m_, OGS_FATAL, p_b_, p_cap_max_, S_L_max_, and S_L_res_.

◆ value()

PropertyDataType MaterialPropertyLib::CapillaryPressureVanGenuchten::value ( VariableArray const &  variable_array,
ParameterLib::SpatialPosition const &  pos,
double const  t,
double const  dt 
) const
overridevirtual
Returns
\( p_c(S) \).

Reimplemented from MaterialPropertyLib::Property.

Definition at line 83 of file CapillaryPressureVanGenuchten.cpp.

87 {
88  double const S_L = std::get<double>(
89  variable_array[static_cast<int>(Variable::liquid_saturation)]);
90 
91  if (S_L <= S_L_res_)
92  {
93  return p_cap_max_;
94  }
95 
96  if (S_L >= S_L_max_)
97  {
98  return 0.;
99  }
100 
101  double const S_eff = (S_L - S_L_res_) / (S_L_max_ - S_L_res_);
102  assert(0 <= S_eff && S_eff <= 1);
103 
104  double const p_cap =
105  p_b_ * std::pow(std::pow(S_eff, -1.0 / m_) - 1.0, 1.0 - m_);
106  assert(p_cap > 0);
107  return std::min(p_cap, p_cap_max_);
108 }

References MaterialPropertyLib::liquid_saturation, m_, p_b_, p_cap_max_, S_L_max_, and S_L_res_.

Member Data Documentation

◆ m_

double const MaterialPropertyLib::CapillaryPressureVanGenuchten::m_
private

Exponent.

Definition at line 78 of file CapillaryPressureVanGenuchten.h.

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

◆ p_b_

double const MaterialPropertyLib::CapillaryPressureVanGenuchten::p_b_
private

Pressure scaling factor.

Definition at line 79 of file CapillaryPressureVanGenuchten.h.

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

◆ p_cap_max_

double const MaterialPropertyLib::CapillaryPressureVanGenuchten::p_cap_max_
private

Maximum capillary pressure.

Definition at line 80 of file CapillaryPressureVanGenuchten.h.

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

◆ S_L_max_

double const MaterialPropertyLib::CapillaryPressureVanGenuchten::S_L_max_
private

Maximum saturation of liquid phase.

Definition at line 77 of file CapillaryPressureVanGenuchten.h.

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

◆ S_L_res_

double const MaterialPropertyLib::CapillaryPressureVanGenuchten::S_L_res_
private

Residual saturation of liquid phase.

Definition at line 76 of file CapillaryPressureVanGenuchten.h.

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


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