OGS
LinearTemperatureDependentDensity.h
Go to the documentation of this file.
1
14#pragma once
15
16#include <string>
17
20
21namespace MaterialLib
22{
23namespace Fluid
24{
27{
28public:
34 explicit LinearTemperatureDependentDensity(const double rho0, double T0,
35 const double beta)
36 : _rho0(rho0), _temperature0(T0), _beta(beta)
37 {
38 }
39
41 std::string getName() const override
42 {
43 return "Linear temperature dependent density";
44 }
45
49 double getValue(const ArrayType& var_vals) const override
50 {
51 const double T = var_vals[static_cast<int>(PropertyVariableType::T)];
52 return _rho0 * (1 - _beta * (T - _temperature0));
53 }
54
59 double getdValue(const ArrayType& var_vals,
60 const PropertyVariableType var) const override
61 {
62 (void)var_vals;
63 if (var != PropertyVariableType::T)
64 {
65 return 0.0;
66 }
67 return -_rho0 * _beta;
68 }
69
70private:
71 const double _rho0;
72 const double _temperature0;
73 const double _beta;
74};
75
76} // namespace Fluid
77} // namespace MaterialLib
Base class of fluid properties.
std::array< double, PropertyVariableNumber > ArrayType
LinearTemperatureDependentDensity(const double rho0, double T0, const double beta)
double getdValue(const ArrayType &var_vals, const PropertyVariableType var) const override
double getValue(const ArrayType &var_vals) const override
PropertyVariableType
Variable that determine the property.