OGS
MaterialPropertyLib::RelPermBrooksCorey Class Referencefinal

Detailed Description

Relative permeability function of the wetting phase proposed by Brooks&Corey.

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

Definition at line 32 of file RelPermBrooksCorey.h.

#include <RelPermBrooksCorey.h>

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

Public Member Functions

 RelPermBrooksCorey (std::string name, const double, const double, const double, const double)
 
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 exponent_
 

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

◆ RelPermBrooksCorey()

MaterialPropertyLib::RelPermBrooksCorey::RelPermBrooksCorey ( std::string name,
const double residual_liquid_saturation,
const double residual_gas_saturation,
const double min_relative_permeability,
const double exponent )

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 48 of file RelPermBrooksCorey.h.

49 {
50 if (!std::holds_alternative<Medium*>(scale_))
51 {
53 "The property 'RelPermBrooksCorey' is implemented on the "
54 "'media' scale only.");
55 }
56 }
#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::RelPermBrooksCorey::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.

here, an extra computation of saturation is forced, guaranteeing a correct value. In order to speed up the computing time, saturation could be inserted into the primary variable array after it is computed in the FEM assembly.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 75 of file RelPermBrooksCorey.cpp.

79{
80 if (variable != Variable::liquid_saturation)
81 {
83 "RelPermBrooksCorey::dValue is implemented for derivatives with "
84 "respect to liquid saturation only.");
85 }
86
91 auto const s_L = std::visit(
92 [&variable_array, &pos, t, dt](auto&& scale) -> double
93 {
94 return scale->property(PropertyType::saturation)
95 .template value<double>(variable_array, pos, t, dt);
96 },
97 scale_);
98
99 auto const s_L_res = residual_liquid_saturation_;
100 auto const s_L_max = 1. - residual_gas_saturation_;
101 auto const lambda = exponent_;
102
103 auto const s_eff = (s_L - s_L_res) / (s_L_max - s_L_res);
104 if ((s_eff < 0.) || (s_eff > 1.))
105 {
106 return 0.;
107 }
108
109 auto const d_se_d_sL = 1. / (s_L_max - s_L_res);
110 auto const dk_rel_LRdse =
111 (3 * lambda + 2.) / lambda * std::pow(s_eff, 2. / lambda + 2.);
112
113 return dk_rel_LRdse * d_se_d_sL;
114}
void scale(PETScVector &x, PetscScalar const a)
Definition LinAlg.cpp:44

References exponent_, MaterialPropertyLib::liquid_saturation, OGS_FATAL, residual_gas_saturation_, residual_liquid_saturation_, MaterialPropertyLib::saturation, and MaterialPropertyLib::Property::scale_.

◆ value()

PropertyDataType MaterialPropertyLib::RelPermBrooksCorey::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_.

here, an extra computation of saturation is forced, guaranteeing a correct value. In order to speed up the computing time, saturation could be inserted into the primary variable array after it is computed in the FEM assembly.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 36 of file RelPermBrooksCorey.cpp.

40{
45 auto const s_L = std::visit(
46 [&variable_array, &pos, t, dt](auto&& scale) -> double
47 {
48 return scale->property(PropertyType::saturation)
49 .template value<double>(variable_array, pos, t, dt);
50 },
51 scale_);
52
53 auto const s_L_res = residual_liquid_saturation_;
54 auto const s_L_max = 1. - residual_gas_saturation_;
55
56 auto const lambda = exponent_;
57
58 auto const s_eff = (s_L - s_L_res) / (s_L_max - s_L_res);
59
60 if (s_eff >= 1.0)
61 {
62 // fully saturated medium
63 return 1.0;
64 }
65 if (s_eff <= 0.0)
66 {
67 // dry medium
69 }
70
71 auto const k_rel_LR = std::pow(s_eff, (2. + 3. * lambda) / lambda);
72
73 return std::max(k_rel_LR, min_relative_permeability_);
74}

References exponent_, min_relative_permeability_, residual_gas_saturation_, residual_liquid_saturation_, MaterialPropertyLib::saturation, and MaterialPropertyLib::Property::scale_.

Member Data Documentation

◆ exponent_

const double MaterialPropertyLib::RelPermBrooksCorey::exponent_
private

Definition at line 38 of file RelPermBrooksCorey.h.

Referenced by dValue(), and value().

◆ min_relative_permeability_

const double MaterialPropertyLib::RelPermBrooksCorey::min_relative_permeability_
private

Definition at line 37 of file RelPermBrooksCorey.h.

Referenced by value().

◆ residual_gas_saturation_

const double MaterialPropertyLib::RelPermBrooksCorey::residual_gas_saturation_
private

Definition at line 36 of file RelPermBrooksCorey.h.

Referenced by dValue(), and value().

◆ residual_liquid_saturation_

const double MaterialPropertyLib::RelPermBrooksCorey::residual_liquid_saturation_
private

Definition at line 35 of file RelPermBrooksCorey.h.

Referenced by dValue(), and value().


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