![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <physical_property_model.h>
Public Types | |
| enum class | ComplexComponent : std::int8_t { real , imag } |
Public Member Functions | |
| PhysicalPropertyModel () | |
| virtual | ~PhysicalPropertyModel ()=default |
| bool | depends_on (const field &id) |
| virtual double | value (const std::map< field, double > &fields_value)=0 |
| virtual void | vector_value (const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector)=0 |
| virtual double | jacobian (const std::map< field, double > &field_values, const field id)=0 |
| virtual void | vector_jacobian (const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector)=0 |
| 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) |
Protected Member Functions | |
| std::shared_ptr< SimulationControl > & | get_simulation_control () |
Protected Attributes | |
| std::map< field, bool > | model_depends_on |
Private Attributes | |
| std::shared_ptr< SimulationControl > | simulation_control |
Abstract class that defines the interface for a physical property model Physical property model provides an abstract interface to calculate the value of a physical property or a vector of physical property value for given field value. By default, the interface does not require that all (or any) fields be specified. This is why a map is used to pass the dependent variable. To allow for the calculation of the appropriate jacobian matrix (when that is necessary) the interface also provides a jacobian function, which must provide the derivative with respect to the field specified as an argument.
Definition at line 77 of file physical_property_model.h.
|
strong |
Part of a complex physical property returned by a model. A PhysicalPropertyModel can only return a single double value, so this flag is used to select which part of the complex property is returned.
| Enumerator | |
|---|---|
| real | |
| imag | |
Definition at line 85 of file physical_property_model.h.
|
inline |
Default constructor. Set the model_depends_on to false for all variables.
Definition at line 94 of file physical_property_model.h.
References levelset, model_depends_on, phase_order_cahn_hilliard, pressure, shear_rate, temperature, temperature_p1, temperature_p2, tracer_concentration, and void_fraction.
|
virtualdefault |
Default virtual destructor. Does not do anything.
|
inline |
Returns true if the PhysicalPropertyModel depends on a field, false if not.
Definition at line 117 of file physical_property_model.h.
References model_depends_on.
|
inlineprotected |
Definition at line 243 of file physical_property_model.h.
References simulation_control.
|
pure virtual |
jacobian Calcualtes the jacobian (the partial derivative) of the physical property with respect to a field
| field_values | Value of the various fields on which the property may depend. |
| id | Indicator of the field with respect to which the jacobian should be calculated |
Implemented in Carreau, ConstantElectricConductivity, ConstantElectricPermittivity, ConstantMagneticPermeability, ConstantSpecificHeat, ConstantThermalConductivity, ConstantThermalExpansion, ConstantTracerDiffusivity, ConstantTracerReactionPrefactor, DensityConstant, DensityIsothermalIdealGas, EffectiveMediumModel, GaussianLevelsetTracerDiffusivity, GaussianLevelsetTracerReactionPrefactor, Newtonian, NoneTracerReactionPrefactor, PhaseChangeRheology, PhaseChangeSpecificHeat, PolynomialElectricConductivity, PolynomialElectricPermittivity, PolynomialMagneticPermeability, PowerLaw, TanhLevelsetTracerDiffusivity, TanhLevelsetTracerReactionPrefactor, ThermalConductivityLinear, ThermalConductivityPhaseChange, and ThermalExpansionPhaseChange.
|
inline |
numerical_jacobian Calculates the jacobian through a forward finite difference (Euler) approximation. This approach, although not preferable, is meant as a fall-back when calculating the jacobian manually is too difficult.
| fields_values | The values of the various fields |
| id | Field id of the field with respect to which the jacobian should be calculated |
Definition at line 187 of file physical_property_model.h.
References value().
|
inline |
Provides the physical property with the simulation control object ensuring that the PhysicalPropertyModel can calculate physical properties that depend on time or time-history.
| p_simulation_control | shared pointed to a SimulationControl object. A copy of this shared pointer is stored in the physical property. |
Definition at line 172 of file physical_property_model.h.
References simulation_control.
|
pure virtual |
value Calculates the value of a physical property.
| fields_value | Value of the various field on which the property may depend. |
Implemented in Carreau, ConstantElectricConductivity, ConstantElectricPermittivity, ConstantMagneticPermeability, ConstantSpecificHeat, ConstantThermalConductivity, ConstantThermalExpansion, ConstantTracerDiffusivity, ConstantTracerReactionPrefactor, DensityConstant, DensityIsothermalIdealGas, EffectiveMediumModel, GaussianLevelsetTracerDiffusivity, GaussianLevelsetTracerReactionPrefactor, Newtonian, NoneTracerReactionPrefactor, PhaseChangeRheology, PhaseChangeSpecificHeat, PolynomialElectricConductivity, PolynomialElectricPermittivity, PolynomialMagneticPermeability, PowerLaw, TanhLevelsetTracerDiffusivity, TanhLevelsetTracerReactionPrefactor, ThermalConductivityLinear, ThermalConductivityPhaseChange, and ThermalExpansionPhaseChange.
|
pure virtual |
vector_jacobian Calculate the derivative of the property with respect to a field
| field_vectors | Vector for the values of the fields used to evaluate the property |
| id | Identifier of the field with respect to which a derivative should be calculated |
| jacobian | Vector of the value of the derivative of the property with respect to the field id |
Implemented in Carreau, ConstantElectricConductivity, ConstantElectricPermittivity, ConstantMagneticPermeability, ConstantSpecificHeat, ConstantThermalConductivity, ConstantThermalExpansion, ConstantTracerDiffusivity, ConstantTracerReactionPrefactor, DensityConstant, DensityIsothermalIdealGas, EffectiveMediumModel, GaussianLevelsetTracerDiffusivity, GaussianLevelsetTracerReactionPrefactor, Newtonian, NoneTracerReactionPrefactor, PhaseChangeRheology, PhaseChangeSpecificHeat, PolynomialElectricConductivity, PolynomialElectricPermittivity, PolynomialMagneticPermeability, PowerLaw, TanhLevelsetTracerDiffusivity, TanhLevelsetTracerReactionPrefactor, ThermalConductivityLinear, ThermalConductivityPhaseChange, and ThermalExpansionPhaseChange.
|
inline |
vector_numerical_jacobian Calculates the vector of jacobian through forward finite difference (Euler) approximation. This approach, although not preferable, is meant as a fall-back when calculating the jacobian manually is too difficult.
| field_vectors | |
| field_id | |
| jacobian_vector |
Definition at line 208 of file physical_property_model.h.
References vector_value().
|
pure virtual |
vector_value Calculates the values of a physical property for multiple points
| field_vectors |
Implemented in Carreau, ConstantElectricConductivity, ConstantElectricPermittivity, ConstantMagneticPermeability, ConstantSpecificHeat, ConstantThermalConductivity, ConstantThermalExpansion, ConstantTracerDiffusivity, ConstantTracerReactionPrefactor, DensityConstant, DensityIsothermalIdealGas, EffectiveMediumModel, GaussianLevelsetTracerDiffusivity, GaussianLevelsetTracerReactionPrefactor, Newtonian, NoneTracerReactionPrefactor, PhaseChangeRheology, PhaseChangeSpecificHeat, PolynomialElectricConductivity, PolynomialElectricPermittivity, PolynomialMagneticPermeability, PowerLaw, TanhLevelsetTracerDiffusivity, TanhLevelsetTracerReactionPrefactor, ThermalConductivityLinear, ThermalConductivityPhaseChange, and ThermalExpansionPhaseChange.
|
protected |
Definition at line 250 of file physical_property_model.h.
|
private |
Definition at line 257 of file physical_property_model.h.