OGS
MaterialLib::Fluid::FluidPropertiesWithDensityDependentModels Class Referencefinal

Detailed Description

A class contains density, viscosity, heat_capacity and thermal_conductivity models, which are all functions of temperature, density and concentration.

Attention
The density must be computed firstly, i.e. first call getValue(PropertyType::density, variable_values).

Definition at line 30 of file FluidPropertiesWithDensityDependentModels.h.

#include <FluidPropertiesWithDensityDependentModels.h>

Inheritance diagram for MaterialLib::Fluid::FluidPropertiesWithDensityDependentModels:
[legend]
Collaboration diagram for MaterialLib::Fluid::FluidPropertiesWithDensityDependentModels:
[legend]

Public Member Functions

 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)
 
double getValue (const FluidPropertyType property_type, const ArrayType &variable_values) const override
 
double getdValue (const FluidPropertyType property_type, const ArrayType &variable_values, const PropertyVariableType variable_type) const override
 
- Public Member Functions inherited from MaterialLib::Fluid::FluidProperties
 FluidProperties (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)
 
virtual ~FluidProperties ()=default
 

Private Member Functions

double compute_df_drho_drho_dT (const FluidPropertyType property_type, const ArrayType &variable_values) const
 Compute df/dT for f(T, rho) with rho(T, p)
 
double compute_df_drho_drho_dp (const FluidPropertyType property_type, const ArrayType &variable_values) const
 Compute df/dp for f(T, rho) with rho(T, p)
 

Private Attributes

std::array< bool, FluidPropertyTypeNumber_is_density_dependent
 

Additional Inherited Members

- Public Types inherited from MaterialLib::Fluid::FluidProperties
using ArrayType = std::array<double, PropertyVariableNumber>
 
- Protected Attributes inherited from MaterialLib::Fluid::FluidProperties
const std::array< std::unique_ptr< FluidProperty >, FluidPropertyTypeNumber_property_models
 

Constructor & Destructor Documentation

◆ FluidPropertiesWithDensityDependentModels()

MaterialLib::Fluid::FluidPropertiesWithDensityDependentModels::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 )

Definition at line 24 of file FluidPropertiesWithDensityDependentModels.cpp.

34 : FluidProperties(std::move(density), std::move(viscosity),
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}}
40{
41}
FluidProperties(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)

Member Function Documentation

◆ compute_df_drho_drho_dp()

double MaterialLib::Fluid::FluidPropertiesWithDensityDependentModels::compute_df_drho_drho_dp ( const FluidPropertyType property_type,
const ArrayType & variable_values ) const
private

Compute df/dp for f(T, rho) with rho(T, p)

Definition at line 106 of file FluidPropertiesWithDensityDependentModels.cpp.

109{
110 const auto& fluid_density_model =
111 _property_models[static_cast<unsigned>(FluidPropertyType::Density)];
112
113 const double drho_dp = fluid_density_model->getdValue(
114 variable_values, PropertyVariableType::p);
115
116 const double density_value = fluid_density_model->getValue(variable_values);
117 ArrayType var_vals = variable_values;
118 var_vals[static_cast<unsigned>(PropertyVariableType::rho)] = density_value;
119
120 // return d ()/drho * drho/dp
121 return _property_models[static_cast<unsigned>(property_type)]->getdValue(
122 var_vals, PropertyVariableType::rho) *
123 drho_dp;
124}
double getdValue(const FluidPropertyType property_type, const ArrayType &variable_values, const PropertyVariableType variable_type) const override
std::array< double, PropertyVariableNumber > ArrayType
const std::array< std::unique_ptr< FluidProperty >, FluidPropertyTypeNumber > _property_models
@ rho
density. For some models, rho substitutes p

◆ compute_df_drho_drho_dT()

double MaterialLib::Fluid::FluidPropertiesWithDensityDependentModels::compute_df_drho_drho_dT ( const FluidPropertyType property_type,
const ArrayType & variable_values ) const
private

Compute df/dT for f(T, rho) with rho(T, p)

Definition at line 83 of file FluidPropertiesWithDensityDependentModels.cpp.

86{
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);
91
92 const double density_value = fluid_density_model->getValue(variable_values);
93
94 ArrayType var_vals = 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)];
98
99 // return d()/dT + d ()/drho * drho/dT
100 return fluid_property_model->getdValue(var_vals, PropertyVariableType::T) +
101 fluid_property_model->getdValue(var_vals,
103 drho_dT;
104}

◆ getdValue()

double MaterialLib::Fluid::FluidPropertiesWithDensityDependentModels::getdValue ( const FluidPropertyType property_type,
const ArrayType & variable_values,
const PropertyVariableType variable_type ) const
overridevirtual

Get the partial differential of a property.

Parameters
property_typeProperty type.
variable_valuesAn array of the primary variables. The order of its elements is temperature, pressure, concentration, which is defined in enum class PropertyVariableType.
variable_typeVariable type

Implements MaterialLib::Fluid::FluidProperties.

Definition at line 58 of file FluidPropertiesWithDensityDependentModels.cpp.

62{
63 if (_is_density_dependent[static_cast<unsigned>(property_type)])
64 {
65 if (variable_type == PropertyVariableType::T)
66 {
67 return compute_df_drho_drho_dT(property_type, variable_values);
68 }
69 if (variable_type == PropertyVariableType::p)
70 {
71 return compute_df_drho_drho_dp(property_type, variable_values);
72 }
73 }
74 else
75 {
76 return _property_models[static_cast<unsigned>(property_type)]
77 ->getdValue(variable_values, variable_type);
78 }
79
80 return 0.0;
81}
double compute_df_drho_drho_dp(const FluidPropertyType property_type, const ArrayType &variable_values) const
Compute df/dp for f(T, rho) with rho(T, p)
double compute_df_drho_drho_dT(const FluidPropertyType property_type, const ArrayType &variable_values) const
Compute df/dT for f(T, rho) with rho(T, p)

◆ getValue()

double MaterialLib::Fluid::FluidPropertiesWithDensityDependentModels::getValue ( const FluidPropertyType property_type,
const ArrayType & variable_values ) const
overridevirtual

Get the value of a Property.

Parameters
property_typeProperty type.
variable_valuesAn array of the primary variables. The order of its elements is temperature, pressure, concentration, which is defined in enum class PropertyVariableType.
Attention
The density must be computed firstly, i.e. first call getValue(PropertyType::density, variable_values).

Implements MaterialLib::Fluid::FluidProperties.

Definition at line 43 of file FluidPropertiesWithDensityDependentModels.cpp.

46{
47 ArrayType var_vals = variable_values;
48 if (_is_density_dependent[static_cast<unsigned>(property_type)])
49 {
50 var_vals[static_cast<unsigned>(PropertyVariableType::rho)] =
51 _property_models[static_cast<unsigned>(FluidPropertyType::Density)]
52 ->getValue(variable_values);
53 }
54 return _property_models[static_cast<unsigned>(property_type)]->getValue(
55 var_vals);
56}
double getValue(const FluidPropertyType property_type, const ArrayType &variable_values) const override

References getValue(), and MaterialLib::Fluid::FluidProperties::getValue().

Member Data Documentation

◆ _is_density_dependent

std::array<bool, FluidPropertyTypeNumber> MaterialLib::Fluid::FluidPropertiesWithDensityDependentModels::_is_density_dependent
private

Definition at line 77 of file FluidPropertiesWithDensityDependentModels.h.


The documentation for this class was generated from the following files: