OGS
VogelsLiquidDynamicViscosity.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <array>
16#include <cmath>
17#include <string>
18#include <utility>
19#include <vector>
20
22
23namespace MaterialLib
24{
25namespace Fluid
26{
31template <typename VogelsConstants>
33{
34public:
40 explicit VogelsLiquidDynamicViscosity(VogelsConstants constants)
41 : _constants(std::move(constants))
42 {
43 }
44
46 std::string getName() const override
47 {
48 return "Liquid viscosity by Vogel's equation";
49 }
50
55 double getValue(const ArrayType& var_vals) const override
56 {
57 const double T = var_vals[static_cast<int>(PropertyVariableType::T)];
58 // Note: the constant of 1.e-3 is for the SI unit conversion.
59 return 1.e-3 *
60 std::exp(_constants.A + _constants.B / (_constants.C + T));
61 }
62
69 double getdValue(const ArrayType& var_vals,
70 const PropertyVariableType var) const override
71 {
72 (void)var;
73 const double T = var_vals[static_cast<int>(PropertyVariableType::T)];
74 const double f_buff = _constants.B / (_constants.C + T);
75 // Note: the constant of 1.e-3 is for the SI unit conversion.
76 return -1.e-3 * f_buff * std::exp(_constants.A + f_buff) /
77 (_constants.C + T);
78 }
79
80private:
81 const VogelsConstants _constants;
82};
83
89{
91 const double A = -3.7188;
92 const double B = 578.919;
93 const double C = -137.546;
94};
95
97{
99 const double A = -24.0592;
100 const double B = 28535.2;
101 const double C = 1037.41;
102};
103
105{
107 const double A = -25.5947;
108 const double B = 25392;
109 const double C = 969.306;
110};
111
112} // namespace Fluid
113} // namespace MaterialLib
Base class of fluid properties.
std::array< double, PropertyVariableNumber > ArrayType
std::string getName() const override
Get model name.
double getValue(const ArrayType &var_vals) const override
VogelsLiquidDynamicViscosity(VogelsConstants constants)
Viscosity defined by .
double getdValue(const ArrayType &var_vals, const PropertyVariableType var) const override
PropertyVariableType
Variable that determine the property.