OGS
MaterialPropertyLib::WaterViscosityIAPWS Class Referencefinal

Detailed Description

A class for viscosity model that is defined by The International Association for the Properties of Water and Steam IAPWS

With the definition, the viscosity is a function of temperature and water density

Attention
The critical enhancement, \(\bar{\mu}_2\), which is significant only within the boundaries specified by

\[ T (\mbox{in K}) \in (645.91, 650.77) \]

and

\[ \rho (\mbox{in kg m}^{-3}) \in (245.8, 405.3)\]

, is not considered.

Definition at line 35 of file WaterViscosityIAPWS.h.

#include <WaterViscosityIAPWS.h>

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

Public Member Functions

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

Static Private Attributes

static constexpr double ref_T_ = 647.096
 reference temperature in K
 
static constexpr double ref_rho_
 reference density in kg/m^3
 
static constexpr double ref_mu_ = 1.0e-6
 reference viscosity in Pa.s
 

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

◆ WaterViscosityIAPWS()

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

Member Function Documentation

◆ checkScale()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 39 of file WaterViscosityIAPWS.h.

40 {
41 if (!std::holds_alternative<Phase*>(scale_))
42 {
44 "The property 'WaterViscosityIAPWS' is "
45 "implemented on the 'Phase' scale only.");
46 }
47 }
#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::WaterViscosityIAPWS::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 viscosity with respect to temperature or phase (water) pressure.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 59 of file WaterViscosityIAPWS.cpp.

63{
64 const double bar_T = variable_array.temperature / ref_T_;
65 const double bar_rho = variable_array.density / ref_rho_;
66
67 switch (variable)
68 {
70 return ref_mu_ * computedBarMu_dbarT(bar_T, bar_rho) / ref_T_;
72 return ref_mu_ * computedBarMu_dbarRho(bar_T, bar_rho) / ref_rho_;
73 default:
75 "WaterViscosityIAPWS::dValue is implemented for "
76 "derivatives with respect to temperature and liquid density "
77 "only.");
78 }
79}
static constexpr double ref_mu_
reference viscosity in Pa.s
static constexpr double ref_T_
reference temperature in K
static constexpr double ref_rho_
reference density in kg/m^3
static double computedBarMu_dbarT(const double barT, double bar_rho)
static double computedBarMu_dbarRho(const double barT, double bar_rho)

References MaterialPropertyLib::computedBarMu_dbarRho(), MaterialPropertyLib::computedBarMu_dbarT(), MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::density, OGS_FATAL, ref_mu_, ref_rho_, ref_T_, MaterialPropertyLib::temperature, and MaterialPropertyLib::VariableArray::temperature.

◆ value()

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

Reimplemented from MaterialPropertyLib::Property.

Definition at line 41 of file WaterViscosityIAPWS.cpp.

45{
46 const double bar_T = variable_array.temperature / ref_T_;
47 const double bar_rho = variable_array.density / ref_rho_;
48
49 const double mu0 = 100. * std::sqrt(bar_T) / computeBarMu0Factor(bar_T);
50
51 const auto& series_factorT = computeSeriesFactorTForMu1(bar_T);
52 const auto& series_factorRho = computeSeriesFactorRhoForMu1(bar_rho);
53 const double mu1 = std::exp(
54 bar_rho * computeBarMu1Factor(series_factorT, series_factorRho));
55
56 return mu0 * mu1 * ref_mu_;
57}
static double computeBarMu0Factor(const double barT)
static std::array< double, 7 > computeSeriesFactorRhoForMu1(const double bar_rho)
static double computeBarMu1Factor(const std::array< double, 6 > &series_factorT, const std::array< double, 7 > &series_factorRho)
static std::array< double, 6 > computeSeriesFactorTForMu1(const double barT)

References MaterialPropertyLib::computeBarMu0Factor(), MaterialPropertyLib::computeBarMu1Factor(), MaterialPropertyLib::computeSeriesFactorRhoForMu1(), MaterialPropertyLib::computeSeriesFactorTForMu1(), MaterialPropertyLib::VariableArray::density, ref_mu_, ref_rho_, ref_T_, and MaterialPropertyLib::VariableArray::temperature.

Member Data Documentation

◆ ref_mu_

double MaterialPropertyLib::WaterViscosityIAPWS::ref_mu_ = 1.0e-6
staticconstexprprivate

reference viscosity in Pa.s

Definition at line 64 of file WaterViscosityIAPWS.h.

Referenced by dValue(), and value().

◆ ref_rho_

double MaterialPropertyLib::WaterViscosityIAPWS::ref_rho_
staticconstexprprivate
Initial value:
=
322.0

reference density in kg/m^3

Definition at line 62 of file WaterViscosityIAPWS.h.

Referenced by dValue(), and value().

◆ ref_T_

double MaterialPropertyLib::WaterViscosityIAPWS::ref_T_ = 647.096
staticconstexprprivate

reference temperature in K

Definition at line 61 of file WaterViscosityIAPWS.h.

Referenced by dValue(), and value().


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