OGS
MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten Class Referencefinal

Detailed Description

This class handles the computation of the capillary pressure, \( p_c(S_l) \), with the capillary pressure regularization.

For the regularized van Genuchten model, please refer to [14].

For the van Genuchten capillary pressure mode,

See also
MaterialPropertyLib::CapillaryPressureVanGenuchten

Definition at line 31 of file CapillaryPressureRegularizedVanGenuchten.h.

#include <CapillaryPressureRegularizedVanGenuchten.h>

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

Public Member Functions

 CapillaryPressureRegularizedVanGenuchten (double const residual_liquid_saturation, double const maximum_liquid_saturation, double const exponent, double const p_b)
 
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 Member Functions

double getPcBarvGSg (double const Sg) const
 
double getSBar (double const Sg) const
 
double getPcvGSg (double const Sg) const
 
double getdPcdSvGBar (double const Sg) const
 Gets \(\frac{\partial p_c}{\partial {\bar S}_g }\). More...
 
double getdPcdSvG (double const Sg) const
 Gets \(\frac{\partial p_c}{\partial {S}_g }\). More...
 

Private Attributes

double const Sg_r_
 Residual saturation of gas phase. More...
 
double const Sg_max_
 Maximum saturation of gas phase. More...
 
double const m_
 
double const p_b_
 
double const PcBarvGSg_Sg_max_
 
double const dPcdSvGBarSg_max_
 

Static Private Attributes

static constexpr double xi_ = 1e-5
 parameter in regularized van Genuchten model 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

◆ CapillaryPressureRegularizedVanGenuchten()

MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::CapillaryPressureRegularizedVanGenuchten ( double const  residual_liquid_saturation,
double const  maximum_liquid_saturation,
double const  exponent,
double const  p_b 
)

Definition at line 32 of file CapillaryPressureRegularizedVanGenuchten.cpp.

38  : Sg_r_(1.0 - maximum_liquid_saturation),
40  m_(exponent),
41  p_b_(p_b),
44 {
46 }
void checkVanGenuchtenExponentRange(const double m)

References MaterialPropertyLib::checkVanGenuchtenExponentRange(), and m_.

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 40 of file CapillaryPressureRegularizedVanGenuchten.h.

41  {
42  if (!std::holds_alternative<Medium*>(scale_))
43  {
44  OGS_FATAL(
45  "The property 'CapillaryPressureRegularizedVanGenuchten' is "
46  "implemented on the 'media' scale only.");
47  }
48  }
#define OGS_FATAL(...)
Definition: Error.h:26
std::variant< Medium *, Phase *, Component * > scale_
Definition: Property.h:287

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

◆ dValue()

PropertyDataType MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::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_l)}{\partial S_l} \)

Reimplemented from MaterialPropertyLib::Property.

Definition at line 71 of file CapillaryPressureRegularizedVanGenuchten.cpp.

75 {
76  if (primary_variable != Variable::liquid_saturation)
77  {
78  OGS_FATAL(
79  "CapillaryPressureRegularizedVanGenuchten::dValue is implemented "
80  "for derivatives with respect to liquid saturation only.");
81  }
82 
83  const double Sl = std::get<double>(
84  variable_array[static_cast<int>(Variable::liquid_saturation)]);
85 
87 
88  double const Sg = 1 - Sl;
89  if (!(Sg < Sg_r_ || Sg > Sg_max_))
90  {
91  return -getdPcdSvGBar(Sg);
92  }
93  if (Sg < Sg_r_)
94  {
95  return 0.0;
96  }
97 
98  return -dPcdSvGBarSg_max_;
99 }

References MaterialPropertyLib::checkSaturationRange(), dPcdSvGBarSg_max_, getdPcdSvGBar(), MaterialPropertyLib::liquid_saturation, OGS_FATAL, Sg_max_, and Sg_r_.

◆ getdPcdSvG()

double MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::getdPcdSvG ( double const  Sg) const
private

Gets \(\frac{\partial p_c}{\partial {S}_g }\).

Definition at line 127 of file CapillaryPressureRegularizedVanGenuchten.cpp.

129 {
130  double const n = 1 / (1 - m_);
131  double const Se = (Sg_max_ - Sg) / (Sg_max_ - Sg_r_);
132  auto const temp = std::pow(Se, (-1 / m_));
133  return p_b_ * (1 / (m_ * n)) * (1 / (Sg_max_ - Sg_r_)) *
134  std::pow(temp - 1, (1 / n) - 1) * temp / Se;
135 }

References m_, p_b_, Sg_max_, and Sg_r_.

Referenced by getdPcdSvGBar().

◆ getdPcdSvGBar()

double MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::getdPcdSvGBar ( double const  Sg) const
private

Gets \(\frac{\partial p_c}{\partial {\bar S}_g }\).

Definition at line 120 of file CapillaryPressureRegularizedVanGenuchten.cpp.

122 {
123  double S_bar = getSBar(Sg);
124  return getdPcdSvG(S_bar) * (1 - xi_);
125 }
static constexpr double xi_
parameter in regularized van Genuchten model

References getdPcdSvG(), getSBar(), and xi_.

Referenced by dValue().

◆ getPcBarvGSg()

double MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::getPcBarvGSg ( double const  Sg) const
private

Gets regularized capillary pressure via the saturation of the non-wetting phase.

Definition at line 101 of file CapillaryPressureRegularizedVanGenuchten.cpp.

103 {
104  double const S_bar = getSBar(Sg);
105  return getPcvGSg(S_bar) - getPcvGSg(Sg_r_ + (Sg_max_ - Sg_r_) * xi_ / 2);
106 }

References getPcvGSg(), getSBar(), Sg_max_, Sg_r_, and xi_.

Referenced by value().

◆ getPcvGSg()

double MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::getPcvGSg ( double const  Sg) const
private

Gets capillary pressure via the non-wetting phase saturation with the original van Genuchten model.

Definition at line 113 of file CapillaryPressureRegularizedVanGenuchten.cpp.

115 {
116  double const Se = (Sg_max_ - Sg) / (Sg_max_ - Sg_r_);
117  return p_b_ * std::pow(std::pow(Se, (-1.0 / m_)) - 1.0, 1.0 - m_);
118 }

References m_, p_b_, Sg_max_, and Sg_r_.

Referenced by getPcBarvGSg().

◆ getSBar()

double MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::getSBar ( double const  Sg) const
private

Gets regularized saturation via the saturation of the non-wetting phase.

Definition at line 108 of file CapillaryPressureRegularizedVanGenuchten.cpp.

109 {
110  return Sg_r_ + (1 - xi_) * (Sg - Sg_r_) + 0.5 * xi_ * (Sg_max_ - Sg_r_);
111 }

References Sg_max_, Sg_r_, and xi_.

Referenced by getdPcdSvGBar(), and getPcBarvGSg().

◆ value()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 48 of file CapillaryPressureRegularizedVanGenuchten.cpp.

52 {
53  const double Sl = std::get<double>(
54  variable_array[static_cast<int>(Variable::liquid_saturation)]);
55 
57 
58  double const Sg = 1 - Sl;
59  if (!(Sg < Sg_r_ || Sg > Sg_max_))
60  {
61  return getPcBarvGSg(Sg);
62  }
63  if (Sg < Sg_r_)
64  {
65  return 0.0;
66  }
67 
69 }

References MaterialPropertyLib::checkSaturationRange(), dPcdSvGBarSg_max_, getPcBarvGSg(), MaterialPropertyLib::liquid_saturation, PcBarvGSg_Sg_max_, Sg_max_, and Sg_r_.

Member Data Documentation

◆ dPcdSvGBarSg_max_

double const MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::dPcdSvGBarSg_max_
private

Definition at line 74 of file CapillaryPressureRegularizedVanGenuchten.h.

Referenced by dValue(), and value().

◆ m_

double const MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::m_
private

◆ p_b_

double const MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::p_b_
private

Capillary pressure scaling factor. Sometimes, it is called apparent gas entry pressure.

Definition at line 69 of file CapillaryPressureRegularizedVanGenuchten.h.

Referenced by getdPcdSvG(), and getPcvGSg().

◆ PcBarvGSg_Sg_max_

double const MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::PcBarvGSg_Sg_max_
private

Definition at line 73 of file CapillaryPressureRegularizedVanGenuchten.h.

Referenced by value().

◆ Sg_max_

double const MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::Sg_max_
private

Maximum saturation of gas phase.

Definition at line 65 of file CapillaryPressureRegularizedVanGenuchten.h.

Referenced by dValue(), getdPcdSvG(), getPcBarvGSg(), getPcvGSg(), getSBar(), and value().

◆ Sg_r_

double const MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::Sg_r_
private

Residual saturation of gas phase.

Definition at line 64 of file CapillaryPressureRegularizedVanGenuchten.h.

Referenced by dValue(), getdPcdSvG(), getPcBarvGSg(), getPcvGSg(), getSBar(), and value().

◆ xi_

constexpr double MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::xi_ = 1e-5
staticconstexprprivate

parameter in regularized van Genuchten model

Definition at line 71 of file CapillaryPressureRegularizedVanGenuchten.h.

Referenced by getdPcdSvGBar(), getPcBarvGSg(), and getSBar().


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