Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
DensityIsothermalIdealGas Class Reference

#include <density_model.h>

Inheritance diagram for DensityIsothermalIdealGas:
[legend]

Public Member Functions

 DensityIsothermalIdealGas (const double p_density_ref, const double p_R, const double p_T)
double value (const std::map< field, double > &field_values) override
void vector_value (const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector) override
double jacobian (const std::map< field, double > &field_values, const field id) override
void vector_jacobian (const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector) override
double get_psi () const override
double get_density_ref () const override
Public Member Functions inherited from DensityModel
bool is_constant_density_model () const
Public Member Functions inherited from PhysicalPropertyModel
 PhysicalPropertyModel ()
virtual ~PhysicalPropertyModel ()=default
bool depends_on (const field &id)
void provide_simulation_control (std::shared_ptr< SimulationControl > &p_simulation_control)
double numerical_jacobian (const std::map< field, double > &field_values, const field id)
void vector_numerical_jacobian (const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector)

Private Attributes

const double density_ref
const double psi

Additional Inherited Members

Public Types inherited from PhysicalPropertyModel
enum class  ComplexComponent : std::int8_t { real , imag }
Static Public Member Functions inherited from DensityModel
static std::shared_ptr< DensityModel > model_cast (const Parameters::Material &material_properties)
Protected Member Functions inherited from PhysicalPropertyModel
std::shared_ptr< SimulationControl > & get_simulation_control ()
Protected Attributes inherited from DensityModel
bool constant_density_model = false
Protected Attributes inherited from PhysicalPropertyModel
std::map< field, bool > model_depends_on

Detailed Description

Isothermal ideal gas density.

Isothermal ideal gas density assumes that the fluid's density varies according the following state equation:

\(\rho = \rho_\text{ref} + \psi p = \rho_\text{ref} + \frac{1}{R T} \ p\)

where \(\rho_\text{ref}\) is the density of the fluid at the reference state, \(\psi = \frac{1}{R T}\) is the compressibility factor derived from the ideal gas law with \(R= \frac{R_u}{M}\) the specific gas constant (universal gas constant ( \(R_u\)) divided by the molar mass of the gas ( \(M\))) and \(T\) the temperature of the gas, finally, \(p\) is the differential pressure between the reference state and the current state. The model is used for weakly compressible flows when temperature fluctuations' influence on density can be neglected.

Definition at line 222 of file density_model.h.

Constructor & Destructor Documentation

◆ DensityIsothermalIdealGas()

DensityIsothermalIdealGas::DensityIsothermalIdealGas ( const double p_density_ref,
const double p_R,
const double p_T )
inline

Constructor of the isothermal ideal gas density model.

Parameters
[in]p_density_refValue of the density of the gas at reference state.
[in]p_RValue of the specific gas constant \(\left(R=\frac{R_u}{M} \right)\) with \(R_u\) the universal gas constant and \(M\) the molar mass of the gas.
[in]p_TValue of the temperature of the gas at reference state.

Definition at line 237 of file density_model.h.

References density_ref, PhysicalPropertyModel::model_depends_on, pressure, and psi.

Member Function Documentation

◆ get_density_ref()

double DensityIsothermalIdealGas::get_density_ref ( ) const
inlineoverridevirtual

Get the value of the reference state density used in the density model.

Returns
Value of the density of the isothermal ideal gas at reference state

Implements DensityModel.

Definition at line 354 of file density_model.h.

References density_ref.

◆ get_psi()

double DensityIsothermalIdealGas::get_psi ( ) const
inlineoverridevirtual

Get the value of the compressibility factor used in the density model.

Returns
Value of the isothermal ideal gas compressibility factor.

Implements DensityModel.

Definition at line 342 of file density_model.h.

References psi.

◆ jacobian()

double DensityIsothermalIdealGas::jacobian ( const std::map< field, double > & field_values,
const field id )
inlineoverridevirtual

Compute the jacobian (the partial derivative) of the density with respect to a specified field.

Parameters
[in]field_valuesValues of the various fields on which the density may depend. The map stores a single value per field.
[in]idIndicator of the field with respect to which the jacobian should be computed.
Returns
Value of the derivative of the density with respect to the specified field.

Implements PhysicalPropertyModel.

Definition at line 300 of file density_model.h.

References pressure, and psi.

◆ value()

double DensityIsothermalIdealGas::value ( const std::map< field, double > & field_values)
inlineoverridevirtual

Compute the density of the isothermal ideal gas.

Parameters
[in]field_valuesValues of the various fields on which the property may depend. In this case, the density depends on pressure. The map stores a single value per field.
Returns
Value of the density computed with the field_values.

Implements PhysicalPropertyModel.

Definition at line 256 of file density_model.h.

References density_ref, pressure, and psi.

◆ vector_jacobian()

void DensityIsothermalIdealGas::vector_jacobian ( const std::map< field, std::vector< double > > & field_vectors,
const field id,
std::vector< double > & jacobian_vector )
inlineoverridevirtual

Compute the derivative of the density with respect to a field for an isothermal ideal gas.

Parameters
[in]field_vectorsVector of values of the fields used to evaluate the density. The map stores a vector of values per field.
[in]idIdentifier of the field with respect to which a derivative should be computed.
[out]jacobian_vectorVector of computed derivative values of the density with respect to the field of the specified id.

Implements PhysicalPropertyModel.

Definition at line 324 of file density_model.h.

References pressure, and psi.

◆ vector_value()

void DensityIsothermalIdealGas::vector_value ( const std::map< field, std::vector< double > > & field_vectors,
std::vector< double > & property_vector )
inlineoverridevirtual

Compute a vector of density values for an isothermal ideal gas.

Parameters
[in]field_vectorsVectors of the fields on which the density may depend. In this case, the density depends on pressure. The map stores a vector of values per field.
[out]property_vectorVectors of computed density values.

Implements PhysicalPropertyModel.

Definition at line 275 of file density_model.h.

References density_ref, pressure, and psi.

Member Data Documentation

◆ density_ref

const double DensityIsothermalIdealGas::density_ref
private

Density of the isothermal ideal gas at reference state.

Definition at line 361 of file density_model.h.

◆ psi

const double DensityIsothermalIdealGas::psi
private

Compressibility factor of the isothermal ideal gas at reference state.

Definition at line 363 of file density_model.h.


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