OGS
MaterialPropertyLib::WaterVapourDensity Class Referencefinal

Detailed Description

A model for water vapour density in the unsaturated porous media.

The water vapour density is given by

\[ \rho_v = h\, \rho_{vS}, \]

where \(h\) is the relative humidity according to

\[ h=\exp({\frac{p}{\rho_w R T}}), \]

with \(R\) the specific gas constant for water vapour, and \(\rho_{vS}\), is the saturated vapour density given by

\[ \rho_{vS}=10^{-3}\, \exp({19.819-4975.9/T}). \]

The specific gas constant for water vapour \(R=461.6\,\text{J}\,\text{kg}^{-1}\text{K}^{-1}\), the value is calculated by \(R_g/M_w\) with \(R_g= 8.3144621\,\text{J}\,\text{mol}^{-1}\text{K}^{-1}\), the ideal gas constant, and \(M_w=0.018016\,\text{kg}\,\text{mol}^{-1}\), the molar mass of water.

The formula of this density model is presented on page 20 of [21].

In the application, the vapour density related terms in the mass balance equation are multiplied with \(1-S\) with \( S \), the water saturation. Therefore the application of the water vapour density model is naturally restricted in the unsaturated zones.

Note
The temperature must be greater then the freezing temperature. In the paper the offset is 273K, not 273.15 which might cause small inconsistencies.

Definition at line 56 of file WaterVapourDensity.h.

#include <WaterVapourDensity.h>

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

Public Member Functions

 WaterVapourDensity (std::string name)
 
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
 

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

◆ WaterVapourDensity()

MaterialPropertyLib::WaterVapourDensity::WaterVapourDensity ( std::string name)
inlineexplicit

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 60 of file WaterVapourDensity.h.

61 {
62 if (!std::holds_alternative<Phase*>(scale_))
63 {
65 "The property 'WaterVapourDensity' is "
66 "implemented on the 'Phase' scale only.");
67 }
68 }
#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::WaterVapourDensity::dValue ( VariableArray const & variable_array,
Variable const variable,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual
Returns
The derivative of water vapour density with respect to temperature or phase (water) pressure.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 56 of file WaterVapourDensity.cpp.

60{
61 double const p = variable_array.liquid_phase_pressure;
62 double const T = variable_array.temperature;
63 assert(T >= 273.);
64 double const water_density = variable_array.density;
65 assert(water_density > 0.);
66
67 if (variable == Variable::temperature)
68 {
69 double const h = humidity(T, p, water_density);
70 double const rho_v = h * saturatedVaporDensity(T);
71 double const drho_vS_dT = dsaturatedVaporDensitydT(T);
72
73 return h * drho_vS_dT - rho_v * p /
74 (water_density * T * T *
77 }
78
79 if (variable == Variable::liquid_phase_pressure)
80 {
81 double const factor =
82 1.0 /
84 T * water_density);
85 double const dhumiditydp = factor * std::exp(factor * p);
86
87 return dhumiditydp * saturatedVaporDensity(T);
88 }
89
91 "WaterVapourDensity::dValue is implemented for derivatives with "
92 "respect to temperature or liquid_phase_pressure only.");
93}
constexpr double WaterVapour
Specific gas constant for water vapour.
static double humidity(double const T, double const p, double const water_density)
static double saturatedVaporDensity(double const T)
static double dsaturatedVaporDensitydT(double const T)

References MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::dsaturatedVaporDensitydT(), MaterialPropertyLib::humidity(), MaterialPropertyLib::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_phase_pressure, OGS_FATAL, MaterialPropertyLib::saturatedVaporDensity(), MaterialPropertyLib::temperature, MaterialPropertyLib::VariableArray::temperature, and MaterialLib::PhysicalConstant::SpecificGasConstant::WaterVapour.

◆ value()

PropertyDataType MaterialPropertyLib::WaterVapourDensity::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual
Returns
The water vapour density.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 42 of file WaterVapourDensity.cpp.

46{
47 double const p = variable_array.liquid_phase_pressure;
48 double const T = variable_array.temperature;
49 assert(T >= 273.);
50 double const water_density = variable_array.density;
51 assert(water_density > 0.);
52
53 return humidity(T, p, water_density) * saturatedVaporDensity(T);
54}

References MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::humidity(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::saturatedVaporDensity(), and MaterialPropertyLib::VariableArray::temperature.


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