OGS
LinearPressureDependentViscosity.h
Go to the documentation of this file.
1
12#pragma once
13
14#include <string>
15
17
18namespace MaterialLib
19{
20namespace Fluid
21{
36{
37public:
43 explicit LinearPressureDependentViscosity(const double mu0,
44 const double p0,
45 const double gamma)
46 : _mu0(mu0), _p0(p0), _gamma(gamma)
47 {
48 }
49
51 std::string getName() const override
52 {
53 return "Linear pressure dependent viscosity";
54 }
55
60 double getValue(const ArrayType& var_vals) const override
61 {
62 const double p = var_vals[static_cast<int>(PropertyVariableType::p)];
63 return _mu0 * (1 + _gamma * (p - _p0));
64 }
65
71 double getdValue(const ArrayType& var_vals,
72 const PropertyVariableType var) const override
73 {
74 (void)var_vals;
75 (void)var;
76 return _mu0 * _gamma;
77 }
78
79private:
80 const double _mu0;
81 const double _p0;
82 const double _gamma;
83};
84
85} // namespace Fluid
86} // namespace MaterialLib
Base class of fluid properties.
std::array< double, PropertyVariableNumber > ArrayType
double getValue(const ArrayType &var_vals) const override
double getdValue(const ArrayType &var_vals, const PropertyVariableType var) const override
LinearPressureDependentViscosity(const double mu0, const double p0, const double gamma)
PropertyVariableType
Variable that determine the property.