OGS
MaterialPropertyLib::SaturationBrooksCorey Class Referencefinal

Detailed Description

A well known soil characteristics function.

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

Definition at line 30 of file SaturationBrooksCorey.h.

#include <SaturationBrooksCorey.h>

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

Public Member Functions

 SaturationBrooksCorey (std::string name, const double residual_liquid_saturation, const double residual_gas_saturation, const double exponent, const double entry_pressure)
 
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 variable1, Variable const variable2, 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_
 
const double residual_gas_saturation_
 
const double exponent_
 
const double entry_pressure_
 

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

◆ SaturationBrooksCorey()

MaterialPropertyLib::SaturationBrooksCorey::SaturationBrooksCorey ( std::string name,
const double residual_liquid_saturation,
const double residual_gas_saturation,
const double exponent,
const double entry_pressure )

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 45 of file SaturationBrooksCorey.h.

46 {
47 if (!std::holds_alternative<Medium*>(scale_))
48 {
50 "The property 'SaturationBrooksCorey' is implemented on the "
51 "'media' scale only.");
52 }
53 }
#define OGS_FATAL(...)
Definition Error.h:26
std::variant< Medium *, Phase *, Component * > scale_
Definition Property.h:297

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

◆ d2Value()

PropertyDataType MaterialPropertyLib::SaturationBrooksCorey::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 86 of file SaturationBrooksCorey.cpp.

90{
91 if ((variable1 != Variable::capillary_pressure) &&
92 (variable2 != Variable::capillary_pressure))
93 {
95 "SaturationBrooksCorey::d2Value is implemented for derivatives "
96 "with respect to capillary pressure only.");
97 }
98
99 const double p_b = entry_pressure_;
100 const double p_cap = std::max(p_b, variable_array.capillary_pressure);
101
102 if (p_cap <= p_b)
103 {
104 return 0.;
105 }
106
107 const double s_L_res = residual_liquid_saturation_;
108 const double s_L_max = 1.0 - residual_gas_saturation_;
109
110 const double lambda = exponent_;
111
112 return lambda * (lambda + 1) * std::pow(p_b / p_cap, lambda) /
113 (p_cap * p_cap) * (s_L_max - s_L_res);
114}

References MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::VariableArray::capillary_pressure, entry_pressure_, exponent_, OGS_FATAL, residual_gas_saturation_, and residual_liquid_saturation_.

◆ dValue()

PropertyDataType MaterialPropertyLib::SaturationBrooksCorey::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 57 of file SaturationBrooksCorey.cpp.

61{
62 if (variable != Variable::capillary_pressure)
63 {
65 "SaturationBrooksCorey::dValue is implemented for derivatives with "
66 "respect to capillary pressure only.");
67 }
68
69 const double p_b = entry_pressure_;
70 const double p_cap = variable_array.capillary_pressure;
71
72 if (p_cap <= p_b)
73 {
74 return 0.;
75 }
76
77 const double s_L_res = residual_liquid_saturation_;
78 const double s_L_max = 1.0 - residual_gas_saturation_;
79 const double lambda = exponent_;
80
81 const double ds_eff_dp_cap =
82 -lambda * std::pow(p_b, lambda) / std::pow(p_cap, lambda + 1);
83 return ds_eff_dp_cap * (s_L_max - s_L_res);
84}

References MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::VariableArray::capillary_pressure, entry_pressure_, exponent_, OGS_FATAL, residual_gas_saturation_, and residual_liquid_saturation_.

◆ value()

PropertyDataType MaterialPropertyLib::SaturationBrooksCorey::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & ,
double const ,
double const  ) const
overridevirtual

Those methods override the base class implementations and actually compute and set the property values_ and dValues_.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 38 of file SaturationBrooksCorey.cpp.

42{
43 const double p_cap = variable_array.capillary_pressure;
44
45 const double s_L_res = residual_liquid_saturation_;
46 const double s_L_max = 1.0 - residual_gas_saturation_;
47 const double lambda = exponent_;
48 const double p_b = entry_pressure_;
49
50 if (p_cap <= p_b)
51 return s_L_max;
52
53 const double s_eff = std::pow(p_b / p_cap, lambda);
54 return s_eff * (s_L_max - s_L_res) + s_L_res;
55}

References MaterialPropertyLib::VariableArray::capillary_pressure, entry_pressure_, exponent_, residual_gas_saturation_, and residual_liquid_saturation_.

Member Data Documentation

◆ entry_pressure_

const double MaterialPropertyLib::SaturationBrooksCorey::entry_pressure_
private

Definition at line 36 of file SaturationBrooksCorey.h.

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

◆ exponent_

const double MaterialPropertyLib::SaturationBrooksCorey::exponent_
private

Definition at line 35 of file SaturationBrooksCorey.h.

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

◆ residual_gas_saturation_

const double MaterialPropertyLib::SaturationBrooksCorey::residual_gas_saturation_
private

Definition at line 34 of file SaturationBrooksCorey.h.

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

◆ residual_liquid_saturation_

const double MaterialPropertyLib::SaturationBrooksCorey::residual_liquid_saturation_
private

Definition at line 33 of file SaturationBrooksCorey.h.

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


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