OGS
MaterialPropertyLib::RelPermVanGenuchten Class Referencefinal

Detailed Description

Van Genuchten relative permeability function.

This property must be a medium property, it computes the permeability reduction due to saturation as function of capillary pressure.

Definition at line 25 of file RelPermVanGenuchten.h.

#include <RelPermVanGenuchten.h>

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

Public Member Functions

 RelPermVanGenuchten (std::string name, double const residual_liquid_saturation, double const residual_gas_saturation, double const min_relative_permeability_liquid, double const exponent)
 
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 Attributes

double const S_L_res_
 
double const S_L_max_
 
double const k_rel_min_
 
double const m_
 

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

◆ RelPermVanGenuchten()

MaterialPropertyLib::RelPermVanGenuchten::RelPermVanGenuchten ( std::string name,
double const residual_liquid_saturation,
double const residual_gas_saturation,
double const min_relative_permeability_liquid,
double const exponent )

Definition at line 20 of file RelPermVanGenuchten.cpp.

28 k_rel_min_(min_relative_permeability_liquid),
29 m_(exponent)
30{
31 name_ = std::move(name);
32
33 if (!(m_ > 0 && m_ < 1))
34 {
36 "The exponent value m = {:g} of van Genuchten relative "
37 "permeability model, is out of its range of (0, 1)",
38 m_);
39 }
40}
#define OGS_FATAL(...)
Definition Error.h:26

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

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 40 of file RelPermVanGenuchten.h.

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

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

◆ dValue()

PropertyDataType MaterialPropertyLib::RelPermVanGenuchten::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 56 of file RelPermVanGenuchten.cpp.

60{
61 if (variable != Variable::liquid_saturation)
62 {
64 "RelativePermeabilityVanGenuchten::dValue is implemented for "
65 "derivatives with respect to liquid saturation only.");
66 }
67
68 double const S_L =
69 std::clamp(variable_array.liquid_saturation, S_L_res_, S_L_max_);
70
71 double const S_eff = (S_L - S_L_res_) / (S_L_max_ - S_L_res_);
72 if (S_eff <= 0) // prevent division by zero
73 {
74 return 0.;
75 }
76
77 if (S_eff >= 1) // prevent taking root of zero
78 {
79 return 0.;
80 }
81
82 double const S_eff_to_1_over_m = std::pow(S_eff, 1. / m_);
83 double const v = 1. - std::pow(1. - S_eff_to_1_over_m, m_);
84 double const sqrt_S_eff = std::sqrt(S_eff);
85 double const k_rel = sqrt_S_eff * v * v;
86
87 if (k_rel < k_rel_min_)
88 {
89 return 0.;
90 }
91
92 return (0.5 * v * v / sqrt_S_eff +
93 2. * sqrt_S_eff * v * std::pow(1. - S_eff_to_1_over_m, m_ - 1.) *
94 S_eff_to_1_over_m / S_eff) /
96}

References k_rel_min_, MaterialPropertyLib::liquid_saturation, MaterialPropertyLib::VariableArray::liquid_saturation, m_, OGS_FATAL, S_L_max_, and S_L_res_.

◆ value()

PropertyDataType MaterialPropertyLib::RelPermVanGenuchten::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) 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 42 of file RelPermVanGenuchten.cpp.

46{
47 double const S_L =
48 std::clamp(variable_array.liquid_saturation, S_L_res_, S_L_max_);
49
50 double const S_eff = (S_L - S_L_res_) / (S_L_max_ - S_L_res_);
51 double const v = 1. - std::pow(1. - std::pow(S_eff, 1. / m_), m_);
52 double const k_rel = std::sqrt(S_eff) * v * v;
53 return std::max(k_rel_min_, k_rel);
54}

References k_rel_min_, MaterialPropertyLib::VariableArray::liquid_saturation, m_, S_L_max_, and S_L_res_.

Member Data Documentation

◆ k_rel_min_

double const MaterialPropertyLib::RelPermVanGenuchten::k_rel_min_
private

Definition at line 30 of file RelPermVanGenuchten.h.

Referenced by dValue(), and value().

◆ m_

double const MaterialPropertyLib::RelPermVanGenuchten::m_
private

Definition at line 31 of file RelPermVanGenuchten.h.

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

◆ S_L_max_

double const MaterialPropertyLib::RelPermVanGenuchten::S_L_max_
private

Definition at line 29 of file RelPermVanGenuchten.h.

Referenced by dValue(), and value().

◆ S_L_res_

double const MaterialPropertyLib::RelPermVanGenuchten::S_L_res_
private

Definition at line 28 of file RelPermVanGenuchten.h.

Referenced by dValue(), and value().


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