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 [19].

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.
 
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 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 }\).
 
double getdPcdSvG (double const Sg) const
 Gets \(\frac{\partial p_c}{\partial {S}_g }\).
 

Private Attributes

double const Sg_r_
 Residual saturation of gas phase.
 
double const Sg_max_
 Maximum saturation of gas phase.
 
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
 

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

◆ 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 {
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:297

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 70 of file CapillaryPressureRegularizedVanGenuchten.cpp.

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

References MaterialPropertyLib::checkSaturationRange(), dPcdSvGBarSg_max_, getdPcdSvGBar(), MaterialPropertyLib::liquid_saturation, MaterialPropertyLib::VariableArray::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 125 of file CapillaryPressureRegularizedVanGenuchten.cpp.

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

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 118 of file CapillaryPressureRegularizedVanGenuchten.cpp.

120{
121 double S_bar = getSBar(Sg);
122 return getdPcdSvG(S_bar) * (1 - xi_);
123}
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 99 of file CapillaryPressureRegularizedVanGenuchten.cpp.

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

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 111 of file CapillaryPressureRegularizedVanGenuchten.cpp.

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

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 106 of file CapillaryPressureRegularizedVanGenuchten.cpp.

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

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 = variable_array.liquid_saturation;
54
56
57 double const Sg = 1 - Sl;
58 if (!(Sg < Sg_r_ || Sg > Sg_max_))
59 {
60 return getPcBarvGSg(Sg);
61 }
62 if (Sg < Sg_r_)
63 {
64 return 0.0;
65 }
66
68}

References MaterialPropertyLib::checkSaturationRange(), dPcdSvGBarSg_max_, getPcBarvGSg(), MaterialPropertyLib::VariableArray::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_

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: