26 std::unique_ptr<MaterialLib::Fluid::FluidProperty>&& density,
27 std::unique_ptr<MaterialLib::Fluid::FluidProperty>&& viscosity,
28 std::unique_ptr<MaterialLib::Fluid::FluidProperty>&& heat_capacity,
29 std::unique_ptr<MaterialLib::Fluid::FluidProperty>&&
31 const bool is_viscosity_density_dependent,
32 const bool is_heat_capacity_dependent,
33 const bool is_thermal_conductivity)
35 std::move(heat_capacity),
36 std::move(thermal_conductivity)),
37 _is_density_dependent{{
false, is_viscosity_density_dependent,
38 is_heat_capacity_dependent,
39 is_thermal_conductivity}}
58double FluidPropertiesWithDensityDependentModels::getdValue(
63 if (_is_density_dependent[
static_cast<unsigned>(property_type)])
65 if (variable_type == PropertyVariableType::T)
67 return compute_df_drho_drho_dT(property_type, variable_values);
69 if (variable_type == PropertyVariableType::p)
71 return compute_df_drho_drho_dp(property_type, variable_values);
76 return _property_models[
static_cast<unsigned>(property_type)]
77 ->getdValue(variable_values, variable_type);
83double FluidPropertiesWithDensityDependentModels::compute_df_drho_drho_dT(
87 const auto& fluid_density_model =
88 _property_models[
static_cast<unsigned>(FluidPropertyType::Density)];
89 const double drho_dT = fluid_density_model->getdValue(
90 variable_values, PropertyVariableType::T);
92 const double density_value = fluid_density_model->getValue(variable_values);
95 var_vals[
static_cast<unsigned>(PropertyVariableType::rho)] = density_value;
96 const auto& fluid_property_model =
97 _property_models[
static_cast<unsigned>(property_type)];
100 return fluid_property_model->getdValue(var_vals, PropertyVariableType::T) +
101 fluid_property_model->getdValue(var_vals,
102 PropertyVariableType::rho) *
106double FluidPropertiesWithDensityDependentModels::compute_df_drho_drho_dp(
110 const auto& fluid_density_model =
111 _property_models[
static_cast<unsigned>(FluidPropertyType::Density)];
113 const double drho_dp = fluid_density_model->getdValue(
114 variable_values, PropertyVariableType::p);
116 const double density_value = fluid_density_model->getValue(variable_values);
118 var_vals[
static_cast<unsigned>(PropertyVariableType::rho)] = density_value;
121 return _property_models[
static_cast<unsigned>(property_type)]->getdValue(
122 var_vals, PropertyVariableType::rho) *
FluidPropertiesWithDensityDependentModels(std::unique_ptr< MaterialLib::Fluid::FluidProperty > &&density, std::unique_ptr< MaterialLib::Fluid::FluidProperty > &&viscosity, std::unique_ptr< MaterialLib::Fluid::FluidProperty > &&heat_capacity, std::unique_ptr< MaterialLib::Fluid::FluidProperty > &&thermal_conductivity, const bool is_viscosity_density_dependent, const bool is_heat_capacity_dependent, const bool is_thermal_conductivity)