4#ifndef lethe_density_model_h
5#define lethe_density_model_h
26 static std::shared_ptr<DensityModel>
95 value(
const std::map<field, double> &field_values)
override
114 std::vector<double> &property_vector)
override
117 std::ranges::fill(property_vector,
density);
138 jacobian(
const std::map<field, double> &field_values,
const field id)
override
167 std::vector<double> &jacobian_vector)
override
171 std::ranges::fill(jacobian_vector, 0.0);
241 ,
psi(1. / (p_R * p_T))
256 value(
const std::map<field, double> &field_values)
override
259 PhysicialPropertyModelFieldUndefined(
"DensityIsothermalIdealGas",
276 std::vector<double> &property_vector)
override
279 PhysicialPropertyModelFieldUndefined(
"DensityIsothermalIdealGas",
282 for (
unsigned int i = 0; i < property_vector.size(); ++i)
300 jacobian(
const std::map<field, double> &field_values,
const field id)
override
326 std::vector<double> &jacobian_vector)
override
330 std::ranges::fill(jacobian_vector,
psi);
332 std::ranges::fill(jacobian_vector, 0);
void vector_jacobian(const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector) override
Computes the derivative of the density with respect to specified fields.
double value(const std::map< field, double > &field_values) override
Compute density value.
const double density
Density of the material.
void vector_value(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector) override
Compute a vector of density values.
double jacobian(const std::map< field, double > &field_values, const field id) override
Compute the jacobian (the partial derivative) of the density with respect to a specified field.
double get_psi() const override
Get the value of the compressibility factor used in the density model.
DensityConstant(const double p_density)
Constructor of the constant density model.
double get_density_ref() const override
Get the value of the reference state density used in the density model.
void vector_value(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector) override
Compute a vector of density values for an isothermal ideal gas.
DensityIsothermalIdealGas(const double p_density_ref, const double p_R, const double p_T)
Constructor of the isothermal ideal gas density model.
double value(const std::map< field, double > &field_values) override
Compute the density of the isothermal ideal gas.
const double psi
Compressibility factor of the isothermal ideal gas at reference state.
double get_psi() const override
Get the value of the compressibility factor used in the density model.
const double density_ref
Density of the isothermal ideal gas at reference state.
double get_density_ref() const override
Get the value of the reference state density used in the density model.
void vector_jacobian(const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector) override
Compute the derivative of the density with respect to a field for an isothermal ideal gas.
double jacobian(const std::map< field, double > &field_values, const field id) override
Compute the jacobian (the partial derivative) of the density with respect to a specified field.
Abstract class for calculating the density of materials.
bool is_constant_density_model() const
Check if the model is a constant density model.
bool constant_density_model
Boolean indicating if the model corresponds to a constant density model.
static std::shared_ptr< DensityModel > model_cast(const Parameters::Material &material_properties)
Instantiate and return a pointer to a DensityModel object by casting it to the proper child class.
virtual double get_density_ref() const =0
Get the value of the reference state density used in the density model.
virtual double get_psi() const =0
Get the value of the compressibility factor used in the density model.
Material - Class that defines the physical property of a material. Generally a material will be a flu...
PhysicalPropertyModel()
Default constructor. Set the model_depends_on to false for all variables.
std::map< field, bool > model_depends_on
@ pressure
Pressure scalar field from fluid dynamics.