OGS
LinearConcentrationAndPressureDependentDensity.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <string>
13
16
17namespace MaterialLib
18{
19namespace Fluid
20{
31 : public FluidProperty
32{
33public:
45 const double reference_density, double reference_concentration,
46 const double fluid_density_concentration_difference_ratio,
47 double reference_pressure,
48 const double fluid_density_pressure_difference_ratio)
49 : _reference_density(reference_density),
50 _reference_concentration(reference_concentration),
52 fluid_density_concentration_difference_ratio),
53 _reference_pressure(reference_pressure),
55 fluid_density_pressure_difference_ratio)
56 {
57 }
58
60 std::string getName() const override
61 {
62 return "Linear concentration and pressure dependent density";
63 }
64
68 double getValue(const ArrayType& var_vals) const override
69 {
70 const double C = var_vals[static_cast<int>(PropertyVariableType::C)];
71 const double p = var_vals[static_cast<int>(PropertyVariableType::p)];
72 return _reference_density *
73 (1 +
78 }
79
82 double getdValue(const ArrayType& /*var_vals*/,
83 const PropertyVariableType var) const override
84 {
85 if (var == PropertyVariableType::C)
86 {
87 return _reference_density *
89 }
90 if (var == PropertyVariableType::p)
91 {
92 return _reference_density *
94 }
95 return 0;
96 }
97
98private:
99 const double _reference_density;
104};
105
106} // namespace Fluid
107} // namespace MaterialLib
Base class of fluid properties.
std::array< double, PropertyVariableNumber > ArrayType
LinearConcentrationAndPressureDependentDensity(const double reference_density, double reference_concentration, const double fluid_density_concentration_difference_ratio, double reference_pressure, const double fluid_density_pressure_difference_ratio)
double getdValue(const ArrayType &, const PropertyVariableType var) const override
PropertyVariableType
Variable that determine the property.