OGS
TemperatureDependentViscosity.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <string>
18#include <cmath>
19
21
22namespace MaterialLib
23{
24namespace Fluid
25{
42{
43public:
49 explicit TemperatureDependentViscosity(const double mu0,
50 const double T_c,
51 const double T_v)
52 : _mu0(mu0), _temperature_c(T_c), _temperature_v(T_v)
53 {
54 }
55
57 std::string getName() const override
58 {
59 return "Temperature dependent viscosity";
60 }
61
66 double getValue(const ArrayType& var_vals) const override
67 {
68 const double T = var_vals[static_cast<int>(PropertyVariableType::T)];
69 return _mu0 * std::exp(-(T - _temperature_c) / _temperature_v);
70 }
71
79 double getdValue(const ArrayType& var_vals,
80 const PropertyVariableType var) const override
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 }
87
88private:
89 const double _mu0;
90 const double _temperature_c;
91 const double _temperature_v;
92};
93
94} // namespace Fluid
95} // namespace MaterialLib
Base class of fluid properties.
std::array< double, PropertyVariableNumber > ArrayType
double getValue(const ArrayType &var_vals) const override
std::string getName() const override
Get model name.
double getdValue(const ArrayType &var_vals, const PropertyVariableType var) const override
TemperatureDependentViscosity(const double mu0, const double T_c, const double T_v)
PropertyVariableType
Variable that determine the property.