OGS
MaterialPropertyLib::RelPermGeneralizedPower Class Referencefinal

Detailed Description

A generalized power law for the relative permeability

Definition:

\[ k_{\text{rel}} = \text{multiplier} {S_{\text{eff}}}^{\text{exponent}}\]

where \(S_{\text{eff}}\) is the effective saturation of liquid phase.

This class handles the wetting (liquid) phase portion of this relative permeability property.

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

Definition at line 35 of file RelPermGeneralizedPower.h.

#include <RelPermGeneralizedPower.h>

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

Public Member Functions

 RelPermGeneralizedPower (std::string name, const double residual_liquid_saturation, const double residual_gas_saturation, const double min_relative_permeability, const double a, const double lambda)
 
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

const double residual_liquid_saturation_
 
const double residual_gas_saturation_
 
const double min_relative_permeability_
 
const double a_
 
const double lambda_
 

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

◆ RelPermGeneralizedPower()

MaterialPropertyLib::RelPermGeneralizedPower::RelPermGeneralizedPower ( std::string name,
const double residual_liquid_saturation,
const double residual_gas_saturation,
const double min_relative_permeability,
const double a,
const double lambda )

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 52 of file RelPermGeneralizedPower.h.

53 {
54 if (!std::holds_alternative<Medium*>(scale_))
55 {
57 "The property 'RelativePermeabilityGeneralizedPower' is "
58 "implemented on the 'media' scale only.");
59 }
60 }
#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::RelPermGeneralizedPower::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 67 of file RelPermGeneralizedPower.cpp.

71{
72 if (variable != Variable::liquid_saturation)
73 {
75 "RelPermGeneralizedPower::dValue is implemented for "
76 "derivatives with respect to liquid saturation only.");
77 }
78
79 const double S_L = variable_array.liquid_saturation;
80
81 auto const S_L_res = residual_liquid_saturation_;
82 auto const S_L_max = 1. - residual_gas_saturation_;
83 auto const S_e = (S_L - S_L_res) / (S_L_max - S_L_res);
84
85 if ((S_e < 0.) || (S_e > 1.))
86 {
87 return 0.;
88 }
89
90 auto const dS_e_dS_L = 1. / (S_L_max - S_L_res);
91
92 auto const dk_rel_dS_e = lambda_ * a_ * std::pow(S_e, lambda_ - 1);
93 return dk_rel_dS_e * dS_e_dS_L;
94}

References a_, lambda_, MaterialPropertyLib::liquid_saturation, MaterialPropertyLib::VariableArray::liquid_saturation, OGS_FATAL, residual_gas_saturation_, and residual_liquid_saturation_.

◆ value()

PropertyDataType MaterialPropertyLib::RelPermGeneralizedPower::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 35 of file RelPermGeneralizedPower.cpp.

39{
40 const double S_L = variable_array.liquid_saturation;
41
42 if (std::isnan(S_L))
43 {
45 "In RelPermGeneralizedPower::value, the liquid saturation is "
46 "NaN.");
47 }
48
49 auto const S_L_res = residual_liquid_saturation_;
50 auto const S_L_max = 1. - residual_gas_saturation_;
51
52 auto const S_e = (S_L - S_L_res) / (S_L_max - S_L_res);
53
54 if (S_e >= 1.0)
55 {
56 // fully saturated medium
57 return a_;
58 }
59 if (S_e <= 0.0)
60 {
61 // dry medium
63 }
64
65 return a_ * std::pow(S_e, lambda_);
66}

References a_, lambda_, MaterialPropertyLib::VariableArray::liquid_saturation, min_relative_permeability_, OGS_FATAL, residual_gas_saturation_, and residual_liquid_saturation_.

Member Data Documentation

◆ a_

const double MaterialPropertyLib::RelPermGeneralizedPower::a_
private

Definition at line 41 of file RelPermGeneralizedPower.h.

Referenced by dValue(), and value().

◆ lambda_

const double MaterialPropertyLib::RelPermGeneralizedPower::lambda_
private

Definition at line 42 of file RelPermGeneralizedPower.h.

Referenced by dValue(), and value().

◆ min_relative_permeability_

const double MaterialPropertyLib::RelPermGeneralizedPower::min_relative_permeability_
private

Definition at line 40 of file RelPermGeneralizedPower.h.

Referenced by value().

◆ residual_gas_saturation_

const double MaterialPropertyLib::RelPermGeneralizedPower::residual_gas_saturation_
private

Definition at line 39 of file RelPermGeneralizedPower.h.

Referenced by dValue(), and value().

◆ residual_liquid_saturation_

const double MaterialPropertyLib::RelPermGeneralizedPower::residual_liquid_saturation_
private

Definition at line 38 of file RelPermGeneralizedPower.h.

Referenced by dValue(), and value().


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