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

#include <density_model.h>

Inheritance diagram for DensityConstant:
[legend]

Public Member Functions

 DensityConstant (const double p_density)
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

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

Constant density model.

Definition at line 69 of file density_model.h.

Constructor & Destructor Documentation

◆ DensityConstant()

DensityConstant::DensityConstant ( const double p_density)
inline

Constructor of the constant density model.

Parameters
[in]p_densityConstant density value.

Definition at line 77 of file density_model.h.

References DensityModel::constant_density_model, and density.

Member Function Documentation

◆ get_density_ref()

double DensityConstant::get_density_ref ( ) const
inlineoverridevirtual

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

Returns
Value of the reference state density, here the constant density value.

Implements DensityModel.

Definition at line 194 of file density_model.h.

References density.

◆ get_psi()

double DensityConstant::get_psi ( ) const
inlineoverridevirtual

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

Returns
Value of the compressibility factor which in this case is null.

Implements DensityModel.

Definition at line 181 of file density_model.h.

◆ jacobian()

double DensityConstant::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.
Note
Here, the field_values and id parameters are ignored since the density remains constant.
Returns
Value of the derivative of the density with respect to the specified field. Since the density remains constant, this function returns zero.

Implements PhysicalPropertyModel.

Definition at line 138 of file density_model.h.

◆ value()

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

Compute density value.

Parameters
[in]field_valuesValue of the various fields on which the property may depend. The map stores a single value per field.
Note
Here, the field_values parameter is ignored since the density remains constant.
Returns
Density value.

Implements PhysicalPropertyModel.

Definition at line 95 of file density_model.h.

References density.

◆ vector_jacobian()

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

Computes the derivative of the density with respect to specified fields.

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. In this case, it returns a vector of zeros since the density remains constant.
Note
Here, the field_vectors and id parameters are ignored since the density remains constant.

Implements PhysicalPropertyModel.

Definition at line 165 of file density_model.h.

◆ vector_value()

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

Compute a vector of density values.

Parameters
[in]field_vectorsVectors of the fields on which the density may depend. The map stores a vector of values per field.
[out]property_vectorVector of computed density values.
Note
Here, the field_vectors parameter is ignored since the density remains constant.

Implements PhysicalPropertyModel.

Definition at line 113 of file density_model.h.

References density.

Member Data Documentation

◆ density

const double DensityConstant::density
private

Density of the material.

Definition at line 201 of file density_model.h.


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