OGS
MaterialLib::Fluid::TemperatureDependentViscosity Class Referencefinal

Detailed Description

Class of a temperature dependent viscosity model, which provides a good fit over temperature variations of 150 K.

\[ \mu = \mu_0\, \exp(-\frac{T-T_c}{T_v}) \]

where

\begin{eqnarray*} &\mu_0:& \mbox{reference viscosity at the temperature of} T_c\\ &T:& \mbox{temperature,}\\ &T_c:& \mbox{reference temperature,}\\ &T_v:& \mbox{constant}\\ \end{eqnarray*}

Definition at line 41 of file TemperatureDependentViscosity.h.

#include <TemperatureDependentViscosity.h>

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

Public Member Functions

 TemperatureDependentViscosity (const double mu0, const double T_c, const double T_v)
 
std::string getName () const override
 Get model name.
 
double getValue (const ArrayType &var_vals) const override
 
double getdValue (const ArrayType &var_vals, const PropertyVariableType var) const override
 
- Public Member Functions inherited from MaterialLib::Fluid::FluidProperty
virtual ~FluidProperty ()=default
 

Private Attributes

const double _mu0
 Initial viscosity.
 
const double _temperature_c
 Reference temperature 1.
 
const double _temperature_v
 Reference temperature 2.
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ TemperatureDependentViscosity()

MaterialLib::Fluid::TemperatureDependentViscosity::TemperatureDependentViscosity ( const double mu0,
const double T_c,
const double T_v )
inlineexplicit
Parameters
mu0\( \mu_0 \)
T_c\( T_c \)
T_v\( T_v \)

Definition at line 49 of file TemperatureDependentViscosity.h.

Member Function Documentation

◆ getdValue()

double MaterialLib::Fluid::TemperatureDependentViscosity::getdValue ( const ArrayType & var_vals,
const PropertyVariableType var ) const
inlineoverridevirtual

Get the partial differential of the viscosity with respect to temperature.

Parameters
var_valsVariable values in an array. The order of its elements is given in enum class PropertyVariableType.
varVariable type.

Implements MaterialLib::Fluid::FluidProperty.

Definition at line 79 of file TemperatureDependentViscosity.h.

81 {
82 (void)var;
83 const double T = var_vals[static_cast<int>(PropertyVariableType::T)];
84 return -_mu0 / _temperature_v *
85 std::exp(-(T - _temperature_c) / _temperature_v);
86 }

References _mu0, _temperature_c, _temperature_v, and MaterialLib::Fluid::T.

◆ getName()

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

Get model name.

Implements MaterialLib::Fluid::FluidProperty.

Definition at line 57 of file TemperatureDependentViscosity.h.

58 {
59 return "Temperature dependent viscosity";
60 }

◆ getValue()

double MaterialLib::Fluid::TemperatureDependentViscosity::getValue ( const ArrayType & var_vals) const
inlineoverridevirtual

Get viscosity value.

Parameters
var_valsVariable values in an array. The order of its elements is given in enum class PropertyVariableType.

Implements MaterialLib::Fluid::FluidProperty.

Definition at line 66 of file TemperatureDependentViscosity.h.

67 {
68 const double T = var_vals[static_cast<int>(PropertyVariableType::T)];
69 return _mu0 * std::exp(-(T - _temperature_c) / _temperature_v);
70 }

References _mu0, _temperature_c, _temperature_v, and MaterialLib::Fluid::T.

Member Data Documentation

◆ _mu0

const double MaterialLib::Fluid::TemperatureDependentViscosity::_mu0
private

Initial viscosity.

Definition at line 89 of file TemperatureDependentViscosity.h.

Referenced by getdValue(), and getValue().

◆ _temperature_c

const double MaterialLib::Fluid::TemperatureDependentViscosity::_temperature_c
private

Reference temperature 1.

Definition at line 90 of file TemperatureDependentViscosity.h.

Referenced by getdValue(), and getValue().

◆ _temperature_v

const double MaterialLib::Fluid::TemperatureDependentViscosity::_temperature_v
private

Reference temperature 2.

Definition at line 91 of file TemperatureDependentViscosity.h.

Referenced by getdValue(), and getValue().


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