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 38 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 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.
 
- 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

const double residual_liquid_saturation_
 Residual saturation of the gas phase.
 
const double residual_gas_saturation_
 Residual saturation of the liquid phase.
 
const double p_cap_max_
 
const double exponent_
 Exponent to govern the shape of the curve.
 

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

◆ 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 24 of file SaturationExponential.cpp.

32 p_cap_max_(p_cap_max),
33 exponent_(exponent)
34{
35 name_ = std::move(name);
36 if (p_cap_max_ <= 0.)
37 {
39 "Reference capillary pressure must be positive in "
40 "MPL::SaturationExponential.");
41 }
42};
#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 55 of file SaturationExponential.h.

56 {
57 if (!std::holds_alternative<Medium*>(scale_))
58 {
60 "The property 'SaturationExponential' 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::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 84 of file SaturationExponential.cpp.

88{
89 OGS_FATAL("SaturationExponential::d2Value() is not implemented.");
90}

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 59 of file SaturationExponential.cpp.

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

References MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::VariableArray::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 44 of file SaturationExponential.cpp.

48{
49 const double p_cap = variable_array.capillary_pressure;
50
51 const double S_res = residual_liquid_saturation_;
52 const double S_max = 1. - residual_gas_saturation_;
53
54 const double pc = std::clamp(p_cap, 0., p_cap_max_);
55 const double S_e = 1. - std::pow(pc / p_cap_max_, exponent_);
56 return S_e * (S_max - S_res) + S_res;
57}

References MaterialPropertyLib::VariableArray::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 47 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 45 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 44 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 42 of file SaturationExponential.h.

Referenced by dValue(), and value().


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