OGS
MaterialPropertyLib::SaturationExponential Class Referencefinal

Detailed Description

A simplistic soil characteristics function.

This property must be a medium property. It computes the saturation of the wetting phase as function of capillary pressure.

The capillary pressure-saturation relationship given by \(S_{eff}=1-\left(\frac{p_{c}}{p_{c}^{max}}\right)^{\lambda}\), where \(\lambda\) is an exponent, \(p_{c}\) is capillary pressure, \(p_{c}^{max}\) is the maximum capillary pressure at which \(S_{eff}=0\).

This property can mainly be used for testing. If the exponent is set to 1, the characteristic curve shows a linear dependence.

Reference capillary pressure at which \(S_{eff}=0\).

Definition at line 39 of file SaturationExponential.h.

#include <SaturationExponential.h>

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

Public Member Functions

 SaturationExponential (std::string name, const double residual_liquid_saturation, const double residual_gas_saturation, const double p_cap_max, const double exponent)
 
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 primary_variable, ParameterLib::SpatialPosition const &, double const, double const) const override
 
PropertyDataType d2Value (VariableArray const &variable_array, Variable const, Variable const, ParameterLib::SpatialPosition const &, double const, double const) const override
 Default implementation: 2nd derivative of any constant property is zero. More...
 
- 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
 
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 residual_liquid_saturation_
 Residual saturation of the gas phase. More...
 
const double residual_gas_saturation_
 Residual saturation of the liquid phase. More...
 
const double p_cap_max_
 
const double exponent_
 Exponent to govern the shape of the curve. 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

◆ SaturationExponential()

MaterialPropertyLib::SaturationExponential::SaturationExponential ( std::string  name,
const double  residual_liquid_saturation,
const double  residual_gas_saturation,
const double  p_cap_max,
const double  exponent 
)

Definition at line 25 of file SaturationExponential.cpp.

33  p_cap_max_(p_cap_max),
34  exponent_(exponent)
35 {
36  name_ = std::move(name);
37  if (p_cap_max_ <= 0.)
38  {
39  OGS_FATAL(
40  "Reference capillary pressure must be positive in "
41  "MPL::SaturationExponential.");
42  }
43 };
#define OGS_FATAL(...)
Definition: Error.h:26
const double residual_gas_saturation_
Residual saturation of the liquid phase.
const double exponent_
Exponent to govern the shape of the curve.
const double residual_liquid_saturation_
Residual saturation of the gas phase.

References MaterialPropertyLib::name, MaterialPropertyLib::Property::name_, OGS_FATAL, and p_cap_max_.

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 56 of file SaturationExponential.h.

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

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

◆ d2Value()

PropertyDataType MaterialPropertyLib::SaturationExponential::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 87 of file SaturationExponential.cpp.

92 {
93  OGS_FATAL("SaturationExponential::d2Value() is not implemented.");
94 }

References OGS_FATAL.

◆ dValue()

PropertyDataType MaterialPropertyLib::SaturationExponential::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 61 of file SaturationExponential.cpp.

65 {
66  if (primary_variable != Variable::capillary_pressure)
67  {
68  OGS_FATAL(
69  "SaturationExponential::dValue is implemented for derivatives with "
70  "respect to capillary pressure only.");
71  }
72 
73  const double p_cap = std::get<double>(
74  variable_array[static_cast<int>(Variable::capillary_pressure)]);
75 
76  const double S_res = residual_liquid_saturation_;
77  const double S_max = 1. - residual_gas_saturation_;
78 
79  if ((p_cap > p_cap_max_) || (p_cap <= 0.))
80  {
81  return 0.;
82  }
83  return (exponent_ / p_cap) * (S_res - S_max) *
84  std::pow(p_cap / p_cap_max_, exponent_);
85 }

References MaterialPropertyLib::capillary_pressure, exponent_, OGS_FATAL, p_cap_max_, residual_gas_saturation_, and residual_liquid_saturation_.

◆ value()

PropertyDataType MaterialPropertyLib::SaturationExponential::value ( VariableArray const &  variable_array,
ParameterLib::SpatialPosition const &  pos,
double const  t,
double const  dt 
) const
overridevirtual

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 45 of file SaturationExponential.cpp.

49 {
50  const double p_cap = std::get<double>(
51  variable_array[static_cast<int>(Variable::capillary_pressure)]);
52 
53  const double S_res = residual_liquid_saturation_;
54  const double S_max = 1. - residual_gas_saturation_;
55 
56  const double pc = std::clamp(p_cap, 0., p_cap_max_);
57  const double S_e = 1. - std::pow(pc / p_cap_max_, exponent_);
58  return S_e * (S_max - S_res) + S_res;
59 }

References MaterialPropertyLib::capillary_pressure, exponent_, p_cap_max_, residual_gas_saturation_, and residual_liquid_saturation_.

Member Data Documentation

◆ exponent_

const double MaterialPropertyLib::SaturationExponential::exponent_
private

Exponent to govern the shape of the curve.

Definition at line 48 of file SaturationExponential.h.

Referenced by dValue(), and value().

◆ p_cap_max_

const double MaterialPropertyLib::SaturationExponential::p_cap_max_
private

Maximum capillary pressure at which effective saturation is zero.

Definition at line 46 of file SaturationExponential.h.

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

◆ residual_gas_saturation_

const double MaterialPropertyLib::SaturationExponential::residual_gas_saturation_
private

Residual saturation of the liquid phase.

Definition at line 45 of file SaturationExponential.h.

Referenced by dValue(), and value().

◆ residual_liquid_saturation_

const double MaterialPropertyLib::SaturationExponential::residual_liquid_saturation_
private

Residual saturation of the gas phase.

Definition at line 43 of file SaturationExponential.h.

Referenced by dValue(), and value().


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