OGS
MaterialPropertyLib::WaterDensityIAPWSIF97Region1 Class Referencefinal

Detailed Description

Water density model base on the IAPWS Industrial Formulation 1997 IF97-Rev

Definition at line 25 of file WaterDensityIAPWSIF97Region1.h.

#include <WaterDensityIAPWSIF97Region1.h>

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

Public Member Functions

 WaterDensityIAPWSIF97Region1 (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
 

Private Attributes

const MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1 gibbs_free_energy_
 

Static Private Attributes

static constexpr double ref_T_ = 1386
 reference temperature in K.
 
static constexpr double ref_p_ = 1.653e7
 reference pressure in Pa.
 

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

◆ WaterDensityIAPWSIF97Region1()

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

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 34 of file WaterDensityIAPWSIF97Region1.h.

35 {
36 if (!std::holds_alternative<Phase*>(scale_))
37 {
39 "The property 'WaterDensityIAPWSIF97Region1' is "
40 "implemented on the 'Phase' scale only.");
41 }
42 }
#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::WaterDensityIAPWSIF97Region1::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 density with respect to temperature or phase (water) pressure.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 38 of file WaterDensityIAPWSIF97Region1.cpp.

42{
43 const double T = variable_array.temperature;
44 double const p = std::max(0.0, variable_array.liquid_phase_pressure);
45
46 const double tau = ref_T_ / T;
47 const double pi = p / ref_p_;
48
49 const double dgamma_dpi = gibbs_free_energy_.get_dgamma_dpi(tau, pi);
50
51 switch (variable)
52 {
54 return -(ref_p_ -
55 tau * ref_p_ *
57 dgamma_dpi) /
58 (MaterialLib::PhysicalConstant::SpecificGasConstant::
59 WaterVapour *
60 T * T * dgamma_dpi);
62 return -gibbs_free_energy_.get_dgamma_dpi_dpi(tau, pi) /
63 (MaterialLib::PhysicalConstant::SpecificGasConstant::
64 WaterVapour *
65 T * dgamma_dpi * dgamma_dpi);
66 default:
68 "WaterDensityIAPWSIF97Region1::dValue is implemented for "
69 "derivatives with "
70 "respect to temperature or liquid_phase_pressure only.");
71 }
72}
static constexpr double ref_p_
reference pressure in Pa.
static constexpr double ref_T_
reference temperature in K.
static double get_dgamma_dpi_dpi(const double tau, const double pi)

References MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1::get_dgamma_dpi(), MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1::get_dgamma_dpi_dpi(), MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1::get_dgamma_dtau_dpi(), gibbs_free_energy_, MaterialPropertyLib::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_phase_pressure, OGS_FATAL, ref_p_, ref_T_, MaterialPropertyLib::temperature, and MaterialPropertyLib::VariableArray::temperature.

◆ value()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 23 of file WaterDensityIAPWSIF97Region1.cpp.

27{
28 double const p = std::max(0.0, variable_array.liquid_phase_pressure);
29 double const T = variable_array.temperature;
30 const double tau = ref_T_ / T;
31 const double pi = p / ref_p_;
32
33 return ref_p_ /
36}
constexpr double WaterVapour
Specific gas constant for water vapour.

References MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1::get_dgamma_dpi(), gibbs_free_energy_, MaterialPropertyLib::VariableArray::liquid_phase_pressure, ref_p_, ref_T_, MaterialPropertyLib::VariableArray::temperature, and MaterialLib::PhysicalConstant::SpecificGasConstant::WaterVapour.

Member Data Documentation

◆ gibbs_free_energy_

const MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1 MaterialPropertyLib::WaterDensityIAPWSIF97Region1::gibbs_free_energy_
private

Definition at line 57 of file WaterDensityIAPWSIF97Region1.h.

Referenced by dValue(), and value().

◆ ref_p_

double MaterialPropertyLib::WaterDensityIAPWSIF97Region1::ref_p_ = 1.653e7
staticconstexprprivate

reference pressure in Pa.

Definition at line 60 of file WaterDensityIAPWSIF97Region1.h.

Referenced by dValue(), and value().

◆ ref_T_

double MaterialPropertyLib::WaterDensityIAPWSIF97Region1::ref_T_ = 1386
staticconstexprprivate

reference temperature in K.

Definition at line 59 of file WaterDensityIAPWSIF97Region1.h.

Referenced by dValue(), and value().


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