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

#include <specific_heat_model.h>

Inheritance diagram for PhaseChangeSpecificHeat:
[legend]

Public Member Functions

 PhaseChangeSpecificHeat (const Parameters::PhaseChange p_phase_change_parameters)
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, 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 enthalpy (const double T)
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 Parameters::PhaseChange param
double liquid_fraction

Additional Inherited Members

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

Detailed Description

Phase change specific heat model.

The phase change specific heat \((c^{*}_\mathrm{p})\) model takes into account the phase change of a material by considering the latent heat into the specific heat over a phase change temperature interval determined by \(\left[T_\mathrm{s},T_\mathrm{l}\right]\) where \(T_\mathrm{s}\) is the solidus temperature and \(T_\mathrm{l}\) is the liquidus temperature.

The specific heat is evaluated as: \( c^{*}_\mathrm{p}(T) = \begin{cases} C_\mathrm{p,s} & \text{if} \; T<T_\mathrm{s}\\ \frac{C_\mathrm{p,s}+C_\mathrm{p,l}}{2}+\frac{h_\mathrm{l}} {T_\mathrm{l}-T_\mathrm{s}} & \text{if} \; T\in[T_\mathrm{s},T_\mathrm{l}]\\ C_\mathrm{p,l} & \text{if} \; T>T_\mathrm{l} \end{cases} \)

where \(C_\mathrm{p,s}\) and \(C_\mathrm{p,l}\) are the solid and liquid specific heat, respectively, and \(h_\mathrm{l}\) is the latent enthalpy (enthalpy related to the phase change).

Definition at line 169 of file specific_heat_model.h.

Constructor & Destructor Documentation

◆ PhaseChangeSpecificHeat()

PhaseChangeSpecificHeat::PhaseChangeSpecificHeat ( const Parameters::PhaseChange p_phase_change_parameters)
inline

Constructor of the phase change specific heat model.

Parameters
[in]p_phase_change_parametersSet of parameters of the phase change model.

Definition at line 178 of file specific_heat_model.h.

References PhysicalPropertyModel::model_depends_on, param, temperature, temperature_p1, and temperature_p2.

Member Function Documentation

◆ enthalpy()

double PhaseChangeSpecificHeat::enthalpy ( const double T)
inline

Compute the enthalpy of a phase change material for a temperature \(T\).

The enthalpy \((H)\) is defined:

  • In pure liquid \((T>T_\mathrm{l})\) as:
    \(H(T) = c_\mathrm{p,s} T_\mathrm{s} + 0.5(c_\mathrm{p,s}+c_\mathrm{p,l}) (T_\mathrm{l}-T_\mathrm{s}) + h_\mathrm{l} + c_\mathrm{p,l} (T-T_\mathrm{l})\)

  • In liquid-solid mixture \((T_\mathrm{s} \leq T \leq T_\mathrm{l})\) as:
    \(H(T) = c_\mathrm{p,s} T_\mathrm{s} + 0.5(c_\mathrm{p,s}+c_\mathrm{p,l}) (T_\mathrm{l}-T_\mathrm{s}) + \alpha_\mathrm{l} h_\mathrm{l}\)
    where \(\alpha_\mathrm{l} = \frac{T-T_\mathrm{s}}{T_\mathrm{l}- T_\mathrm{s}}\) is the liquid fraction.

  • In pure solid \((T<T_\mathrm{s})\) as:
    \(H(T) = c_\mathrm{p,s} T\)
Parameters
[in]Ttemperature at which the enthalpy is computed.
Returns
Value of the enthalpy evaluated at \(T\).

Definition at line 454 of file specific_heat_model.h.

References calculate_liquid_fraction(), liquid_fraction, and param.

◆ jacobian()

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

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

Parameters
[in]field_valuesValues of the various fields on which the specific heat 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 specific heat with respect to the specified field.

Implements PhysicalPropertyModel.

Definition at line 390 of file specific_heat_model.h.

References PhysicalPropertyModel::numerical_jacobian(), and temperature.

◆ value()

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

Compute the specific heat of the isothermal ideal gas.

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

Implements PhysicalPropertyModel.

Definition at line 197 of file specific_heat_model.h.

References Parameters::SimulationControl::bdf1, Parameters::SimulationControl::bdf2, enthalpy(), PhysicalPropertyModel::get_simulation_control(), PhysicalPropertyModel::simulation_control, temperature, temperature_p1, and temperature_p2.

◆ vector_jacobian()

void PhaseChangeSpecificHeat::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 specific heat with respect to a field for an isothermal ideal gas.

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

Implements PhysicalPropertyModel.

Definition at line 417 of file specific_heat_model.h.

References temperature, and PhysicalPropertyModel::vector_numerical_jacobian().

◆ vector_value()

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

Compute a vector of specific heat values for an isothermal ideal gas.

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

Implements PhysicalPropertyModel.

Definition at line 279 of file specific_heat_model.h.

References Parameters::SimulationControl::bdf1, Parameters::SimulationControl::bdf2, enthalpy(), PhysicalPropertyModel::get_simulation_control(), PhysicalPropertyModel::simulation_control, temperature, temperature_p1, and temperature_p2.

Member Data Documentation

◆ liquid_fraction

double PhaseChangeSpecificHeat::liquid_fraction
private

Definition at line 474 of file specific_heat_model.h.

◆ param

const Parameters::PhaseChange PhaseChangeSpecificHeat::param
private

Definition at line 473 of file specific_heat_model.h.


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