OGS
MaterialLib::Fluid::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 42 of file WaterViscosityIAPWS.h.

#include <WaterViscosityIAPWS.h>

Inheritance diagram for MaterialLib::Fluid::WaterViscosityIAPWS:
[legend]
Collaboration diagram for MaterialLib::Fluid::WaterViscosityIAPWS:
[legend]

Public Member Functions

 WaterViscosityIAPWS ()=default
 
std::string getName () const override
 Get model name. More...
 
double getValue (const ArrayType &var_vals) const override
 
double getdValue (const ArrayType &var_vals, const PropertyVariableType var_type) const override
 
- Public Member Functions inherited from MaterialLib::Fluid::FluidProperty
virtual ~FluidProperty ()=default
 
virtual std::string getName () const =0
 Get model name. More...
 
virtual double getValue (const ArrayType &) const =0
 
virtual double getdValue (const ArrayType &, const PropertyVariableType) const =0
 

Private Attributes

const double _ref_T = 647.096
 reference temperature in K More...
 
const double _ref_rho = 322.0
 reference density in kg/m^3 More...
 
const double _ref_mu = 1.0e-6
 reference viscosity in Pa.s More...
 

Additional Inherited Members

- Public Types inherited from MaterialLib::Fluid::FluidProperty
using ArrayType = std::array< double, PropertyVariableNumber >
 

Constructor & Destructor Documentation

◆ WaterViscosityIAPWS()

MaterialLib::Fluid::WaterViscosityIAPWS::WaterViscosityIAPWS ( )
default

Member Function Documentation

◆ getdValue()

double MaterialLib::Fluid::WaterViscosityIAPWS::getdValue ( const ArrayType var_vals,
const PropertyVariableType  var_type 
) const
overridevirtual

Get the partial differential of the density with respect to temperature or liquid pressure.

Parameters
var_valsVariable values of temperature and water density in an array. The order of its elements is given in enum class PropertyVariableType.
Attention
The variable values must follow the SI standard, e.g temperature unit is K.
Parameters
var_typeVariable type.

Implements MaterialLib::Fluid::FluidProperty.

Definition at line 59 of file WaterViscosityIAPWS.cpp.

61{
62 const double bar_T =
63 var_vals[static_cast<unsigned>(PropertyVariableType::T)] / _ref_T;
64 const double bar_rho =
65 var_vals[static_cast<unsigned>(PropertyVariableType::rho)] / _ref_rho;
66
67 switch (var_type)
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:
74 return 0.;
75 }
76}
const double _ref_mu
reference viscosity in Pa.s
const double _ref_rho
reference density in kg/m^3
const double _ref_T
reference temperature in K
@ rho
density. For some models, rho substitutes p
static double computedBarMu_dbarRho(const double barT, double bar_rho)
static double computedBarMu_dbarT(const double barT, double bar_rho)

References _ref_mu, _ref_rho, _ref_T, MaterialLib::Fluid::computedBarMu_dbarRho(), MaterialLib::Fluid::computedBarMu_dbarT(), MaterialLib::Fluid::rho, and MaterialLib::Fluid::T.

◆ getName()

std::string MaterialLib::Fluid::WaterViscosityIAPWS::getName ( ) const
inlineoverridevirtual

Get model name.

Implements MaterialLib::Fluid::FluidProperty.

Definition at line 48 of file WaterViscosityIAPWS.h.

49 {
50 return "IAPWS temperature-density dependent viscosity model";
51 }

◆ getValue()

double MaterialLib::Fluid::WaterViscosityIAPWS::getValue ( const ArrayType var_vals) const
overridevirtual

Get density value.

Parameters
var_valsVariable values of temperature and water density in an array. The order of its elements is given in enum class PropertyVariableType.
Attention
The variable values must follow the SI standard, e.g temperature unit is K.

Implements MaterialLib::Fluid::FluidProperty.

Definition at line 42 of file WaterViscosityIAPWS.cpp.

43{
44 const double bar_T =
45 var_vals[static_cast<unsigned>(PropertyVariableType::T)] / _ref_T;
46 const double bar_rho =
47 var_vals[static_cast<unsigned>(PropertyVariableType::rho)] / _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 _ref_mu, _ref_rho, _ref_T, MaterialLib::Fluid::computeBarMu0Factor(), MaterialLib::Fluid::computeBarMu1Factor(), MaterialLib::Fluid::computeSeriesFactorRhoForMu1(), MaterialLib::Fluid::computeSeriesFactorTForMu1(), MaterialLib::Fluid::rho, and MaterialLib::Fluid::T.

Member Data Documentation

◆ _ref_mu

const double MaterialLib::Fluid::WaterViscosityIAPWS::_ref_mu = 1.0e-6
private

reference viscosity in Pa.s

Definition at line 80 of file WaterViscosityIAPWS.h.

Referenced by getdValue(), and getValue().

◆ _ref_rho

const double MaterialLib::Fluid::WaterViscosityIAPWS::_ref_rho = 322.0
private

reference density in kg/m^3

Definition at line 79 of file WaterViscosityIAPWS.h.

Referenced by getdValue(), and getValue().

◆ _ref_T

const double MaterialLib::Fluid::WaterViscosityIAPWS::_ref_T = 647.096
private

reference temperature in K

Definition at line 78 of file WaterViscosityIAPWS.h.

Referenced by getdValue(), and getValue().


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