OGS
LinearConcentrationDependentDensity.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <string>
13
16
17namespace MaterialLib
18{
19namespace Fluid
20{
29{
30public:
39 const double reference_density, double reference_concentration,
40 const double fluid_density_difference_ratio)
41 : _reference_density(reference_density),
42 _reference_concentration(reference_concentration),
43 _fluid_density_difference_ratio(fluid_density_difference_ratio)
44 {
45 }
46
48 std::string getName() const override
49 {
50 return "Linear concentration dependent density";
51 }
52
56 double getValue(const ArrayType& var_vals) const override
57 {
58 const double C = var_vals[static_cast<int>(PropertyVariableType::C)];
59 return _reference_density * (1 +
62 }
63
69 double getdValue(const ArrayType& var_vals,
70 const PropertyVariableType var) const override
71 {
72 (void)var_vals;
73 if (var != PropertyVariableType::C)
74 {
75 return 0.0;
76 }
78 }
79
80private:
81 const double _reference_density;
84};
85
86} // namespace Fluid
87} // namespace MaterialLib
Base class of fluid properties.
std::array< double, PropertyVariableNumber > ArrayType
LinearConcentrationDependentDensity(const double reference_density, double reference_concentration, const double fluid_density_difference_ratio)
double getdValue(const ArrayType &var_vals, const PropertyVariableType var) const override
PropertyVariableType
Variable that determine the property.