4#ifndef lethe_physical_properties_manager_h
5#define lethe_physical_properties_manager_h
26 RequiresConstantDensity,
28 "The following assembler or post-processing utility "
30 <<
" that you are trying to use does not support the use of a non-constant density model."
31 " Modifications to Lethe are required to take this into account.");
35 RequiresConstantViscosity,
37 "The following assembler or post-processing utility "
39 <<
" that you are trying to use does not support the use of a non-constant viscosity model. "
40 "Modifications to Lethe are required to take this into account.");
43 MaterialInteractionIsNotEffectiveMedium,
45 "The material interaction with id "
47 <<
" does not define an effective medium model. Only fluid-dispersed phase interactions do.");
98 std::shared_ptr<SimulationControl> &simulation_control)
129 std::shared_ptr<DensityModel>
131 const unsigned int material_id = 0)
const
136 std::shared_ptr<SpecificHeatModel>
138 const unsigned int material_id = 0)
const
143 std::shared_ptr<ThermalConductivityModel>
145 const unsigned int material_id = 0)
const
150 std::shared_ptr<RheologicalModel>
152 const unsigned int material_id = 0)
const
157 std::shared_ptr<ThermalExpansionModel>
159 const unsigned int material_id = 0)
const
164 std::shared_ptr<TracerDiffusivityModel>
166 const unsigned int material_id = 0)
const
171 std::shared_ptr<TracerReactionPrefactorModel>
173 const unsigned int material_id = 0)
const
179 std::shared_ptr<SurfaceTensionModel>
192 std::shared_ptr<MobilityCahnHilliardModel>
194 const unsigned int material_interaction_id = 0)
const
206 std::shared_ptr<ElectricConductivityModel>
208 const unsigned int material_id = 0)
const
220 std::shared_ptr<ElectricPermittivityModel>
222 const unsigned int material_id = 0)
const
235 std::shared_ptr<ElectricPermittivityModel>
237 const unsigned int material_id = 0)
const
250 std::shared_ptr<MagneticPermeabilityModel>
252 const unsigned int material_id = 0)
const
265 std::shared_ptr<MagneticPermeabilityModel>
267 const unsigned int material_id = 0)
const
274 std::vector<std::shared_ptr<DensityModel>>
280 std::vector<std::shared_ptr<SpecificHeatModel>>
286 std::vector<std::shared_ptr<ThermalConductivityModel>>
292 std::vector<std::shared_ptr<RheologicalModel>>
298 std::vector<std::shared_ptr<ThermalExpansionModel>>
304 std::vector<Parameters::PhaseChange>
310 std::vector<std::shared_ptr<TracerDiffusivityModel>>
316 std::vector<std::shared_ptr<SurfaceTensionModel>>
327 std::vector<std::shared_ptr<MobilityCahnHilliardModel>>
338 std::vector<std::shared_ptr<ElectricConductivityModel>>
349 std::vector<std::shared_ptr<ElectricPermittivityModel>>
360 std::vector<std::shared_ptr<ElectricPermittivityModel>>
371 std::vector<std::shared_ptr<MagneticPermeabilityModel>>
382 std::vector<std::shared_ptr<MagneticPermeabilityModel>>
395 std::shared_ptr<EffectiveMediumModel>
397 const unsigned int material_interaction_id)
const
400 material_interaction_id) !=
nullptr,
401 MaterialInteractionIsNotEffectiveMedium(
402 material_interaction_id));
413 std::shared_ptr<EffectiveMediumModel>
415 const unsigned int material_interaction_id)
const
418 material_interaction_id) !=
nullptr,
419 MaterialInteractionIsNotEffectiveMedium(
420 material_interaction_id));
431 std::shared_ptr<EffectiveMediumModel>
433 const unsigned int material_interaction_id)
const
436 material_interaction_id) !=
nullptr,
437 MaterialInteractionIsNotEffectiveMedium(
438 material_interaction_id));
449 std::shared_ptr<EffectiveMediumModel>
451 const unsigned int material_interaction_id)
const
454 material_interaction_id) !=
nullptr,
455 MaterialInteractionIsNotEffectiveMedium(
456 material_interaction_id));
463 return rheology[0]->get_kinematic_viscosity_scale();
469 return density[0]->get_density_ref();
474 const unsigned int fluid_id = 0)
476 rheology[fluid_id] = std::move(p_rheology);
518 const unsigned int material_0_id,
519 const unsigned int material_1_id)
const
523 std::pair<unsigned int, unsigned int> fluid_fluid_material_interaction(
524 material_0_id, material_1_id);
526 .find(fluid_fluid_material_interaction)
529 else if (material_interaction_type ==
532 std::pair<unsigned int, unsigned int> fluid_solid_material_interaction(
533 material_0_id, material_1_id);
535 .find(fluid_solid_material_interaction)
538 else if (material_interaction_type ==
541 std::pair<unsigned int, unsigned int>
542 fluid_dispersed_phase_material_interaction(material_0_id,
545 .find(fluid_dispersed_phase_material_interaction)
549 throw(std::runtime_error(
550 "Invalid type of material interaction. The choices are <fluid_fluid|fluid_solid|fluid_dispersed_phase>"));
569 const unsigned int material_id)
const
592 const unsigned int material_id)
const
606 std::vector<std::shared_ptr<DensityModel>>
density;
609 std::vector<std::shared_ptr<RheologicalModel>>
rheology;
612 std::vector<std::shared_ptr<TracerReactionPrefactorModel>>
616 std::vector<std::shared_ptr<MobilityCahnHilliardModel>>
620 std::vector<std::shared_ptr<ElectricPermittivityModel>>
622 std::vector<std::shared_ptr<ElectricPermittivityModel>>
624 std::vector<std::shared_ptr<MagneticPermeabilityModel>>
626 std::vector<std::shared_ptr<MagneticPermeabilityModel>>
628 std::vector<std::shared_ptr<EffectiveMediumModel>>
630 std::vector<std::shared_ptr<EffectiveMediumModel>>
632 std::vector<std::shared_ptr<EffectiveMediumModel>>
634 std::vector<std::shared_ptr<EffectiveMediumModel>>
658 std::map<std::pair<unsigned int, unsigned int>,
unsigned int>
660 std::map<std::pair<unsigned int, unsigned int>,
unsigned int>
662 std::map<std::pair<unsigned int, unsigned int>,
unsigned int>
Abstract class that defines the interface for a interface property model. Interface property model pr...
PhysicalProperties - Define the possible physical properties. All continuum equations share the same ...
std::vector< std::shared_ptr< ElectricConductivityModel > > electric_conductivity
std::vector< std::shared_ptr< EffectiveMediumModel > > effective_magnetic_permeability_real
std::vector< bool > material_is_effective_medium
std::shared_ptr< SpecificHeatModel > get_specific_heat(const unsigned int fluid_id=0, const unsigned int material_id=0) const
std::vector< std::shared_ptr< MobilityCahnHilliardModel > > get_mobility_cahn_hilliard_vector() const
Returns the vector of all mobility models defined in the problem.
std::shared_ptr< ElectricPermittivityModel > get_electric_permittivity_real(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the electric permittivity model of the real part for a given fluid_id and material_id.
std::vector< std::shared_ptr< ElectricConductivityModel > > get_electric_conductivity_vector() const
Returns the vector of all electric conductivity models defined in the problem.
std::vector< Parameters::PhaseChange > get_phase_change_parameters_vector() const
std::map< std::pair< unsigned int, unsigned int >, unsigned int > fluid_fluid_interactions_with_material_interaction_ids
std::vector< Parameters::PhaseChange > phase_change_parameters
std::shared_ptr< ElectricConductivityModel > get_electric_conductivity(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the electric conductivity model for a given fluid_id and material_id.
std::vector< std::shared_ptr< SpecificHeatModel > > get_specific_heat_vector() const
bool field_is_required(const field id) const
std::vector< std::shared_ptr< ThermalExpansionModel > > get_thermal_expansion_vector() const
unsigned int calculate_global_id(const unsigned int fluid_id, const unsigned int material_id) const
Calculates the global id of the physical property. By default. Lethe stores all the properties of the...
std::shared_ptr< MagneticPermeabilityModel > get_magnetic_permeability_real(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the magnetic permeability model of the real part for a given fluid_id and material_id.
std::vector< std::shared_ptr< ThermalExpansionModel > > thermal_expansion
std::shared_ptr< ThermalConductivityModel > get_thermal_conductivity(const unsigned int fluid_id=0, const unsigned int material_id=0) const
PhysicalPropertiesManager(Parameters::PhysicalProperties physical_properties)
PhysicalPropertiesManager Constructor that initializes the class.
std::vector< std::shared_ptr< ElectricPermittivityModel > > get_electric_permittivity_real_vector() const
Returns the vector of all real part electric permittivity models defined in the problem.
bool density_is_constant() const
bool is_effective_medium(const unsigned int fluid_id, const unsigned int material_id) const
Returns true if the material with the given fluid_id and material_id is defined by an effective mediu...
std::shared_ptr< EffectiveMediumModel > get_effective_electric_permittivity_imag(const unsigned int material_interaction_id) const
Returns the effective medium model of the imaginary part of the electric permittivity of the mixture ...
bool is_non_newtonian() const
std::map< std::pair< unsigned int, unsigned int >, unsigned int > fluid_solid_interactions_with_material_interaction_ids
bool surface_tension_is_constant() const
std::vector< double > tracer_reaction_order
std::vector< std::shared_ptr< ElectricPermittivityModel > > electric_permittivity_real
std::vector< std::shared_ptr< RheologicalModel > > rheology
std::map< field, bool > required_fields
void set_rheology(std::shared_ptr< RheologicalModel > p_rheology, const unsigned int fluid_id=0)
std::map< std::pair< unsigned int, unsigned int >, unsigned int > fluid_dispersed_phase_interactions_with_material_interaction_ids
std::vector< std::shared_ptr< MagneticPermeabilityModel > > get_magnetic_permeability_imag_vector() const
Returns the vector of all imaginary part magnetic permeability models defined in the problem.
std::vector< std::shared_ptr< ElectricPermittivityModel > > electric_permittivity_imag
unsigned int number_of_material_interactions
PhysicalPropertiesManager()
Default constructor that initialized none of the physical properties.
std::shared_ptr< EffectiveMediumModel > get_effective_magnetic_permeability_imag(const unsigned int material_interaction_id) const
Returns the effective medium model of the imaginary part of the magnetic permeability of the mixture ...
Parameters::PhysicalProperties get_physical_properties_parameters() const
bool has_phase_change() const
std::vector< std::shared_ptr< MagneticPermeabilityModel > > get_magnetic_permeability_real_vector() const
Returns the vector of all real part magnetic permeability models defined in the problem.
std::shared_ptr< MobilityCahnHilliardModel > get_mobility_cahn_hilliard(const unsigned int material_interaction_id=0) const
Returns the mobility model for a given material_interaction_id (integer).
void initialize(Parameters::PhysicalProperties physical_properties)
initialize Initializes the physical properties using the parameters
std::shared_ptr< DensityModel > get_density(const unsigned int fluid_id=0, const unsigned int material_id=0) const
std::vector< std::shared_ptr< MagneticPermeabilityModel > > magnetic_permeability_imag
std::vector< std::shared_ptr< DensityModel > > get_density_vector() const
std::shared_ptr< EffectiveMediumModel > get_effective_magnetic_permeability_real(const unsigned int material_interaction_id) const
Returns the effective medium model of the real part of the magnetic permeability of the mixture defin...
std::vector< std::shared_ptr< DensityModel > > density
double reference_temperature
std::vector< std::shared_ptr< TracerDiffusivityModel > > get_tracer_diffusivity_vector() const
std::vector< std::shared_ptr< EffectiveMediumModel > > effective_magnetic_permeability_imag
std::shared_ptr< EffectiveMediumModel > get_effective_electric_permittivity_real(const unsigned int material_interaction_id) const
Returns the effective medium model of the real part of the electric permittivity of the mixture defin...
std::vector< std::shared_ptr< SurfaceTensionModel > > surface_tension
std::vector< std::shared_ptr< ThermalConductivityModel > > get_thermal_conductivity_vector() const
std::shared_ptr< SurfaceTensionModel > get_surface_tension(const unsigned int material_interaction_id=0) const
double get_reference_temperature() const
std::vector< std::shared_ptr< ElectricPermittivityModel > > get_electric_permittivity_imag_vector() const
Returns the vector of all imaginary part electric permittivity models defined in the problem.
std::vector< std::shared_ptr< MobilityCahnHilliardModel > > mobility_cahn_hilliard
std::vector< std::shared_ptr< SurfaceTensionModel > > get_surface_tension_vector() const
std::shared_ptr< ThermalExpansionModel > get_thermal_expansion(const unsigned int fluid_id=0, const unsigned int material_id=0) const
unsigned int number_of_fluids
std::shared_ptr< RheologicalModel > get_rheology(const unsigned int fluid_id=0, const unsigned int material_id=0) const
void provide_simulation_control(std::shared_ptr< SimulationControl > &simulation_control)
Parameters::PhysicalProperties physical_properties_parameters
double get_kinematic_viscosity_scale() const
std::vector< std::shared_ptr< EffectiveMediumModel > > effective_electric_permittivity_real
std::vector< std::shared_ptr< TracerReactionPrefactorModel > > tracer_reaction_prefactor
std::shared_ptr< ElectricPermittivityModel > get_electric_permittivity_imag(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the electric permittivity model of the imaginary part for a given fluid_id and material_id.
void establish_fields_required_by_model(PhysicalPropertyModel &model)
double get_density_scale() const
std::vector< std::shared_ptr< RheologicalModel > > get_rheology_vector() const
unsigned int get_number_of_material_interactions() const
std::shared_ptr< TracerDiffusivityModel > get_tracer_diffusivity(const unsigned int fluid_id=0, const unsigned int material_id=0) const
unsigned int number_of_solids
std::vector< std::shared_ptr< MagneticPermeabilityModel > > magnetic_permeability_real
std::vector< std::shared_ptr< TracerDiffusivityModel > > tracer_diffusivity
unsigned int get_number_of_fluids() const
std::vector< std::shared_ptr< EffectiveMediumModel > > effective_electric_permittivity_imag
unsigned int get_material_interaction_id(const material_interactions_type material_interaction_type, const unsigned int material_0_id, const unsigned int material_1_id) const
unsigned int get_number_of_solids() const
std::shared_ptr< TracerReactionPrefactorModel > get_tracer_reaction_prefactor(const unsigned int fluid_id=0, const unsigned int material_id=0) const
std::shared_ptr< MagneticPermeabilityModel > get_magnetic_permeability_imag(const unsigned int fluid_id=0, const unsigned int material_id=0) const
Returns the magnetic permeability model of the imaginary part for a given fluid_id and material_id.
std::vector< std::shared_ptr< SpecificHeatModel > > specific_heat
bool constant_surface_tension
std::vector< std::shared_ptr< ThermalConductivityModel > > thermal_conductivity
Abstract class that defines the interface for a physical property model Physical property model provi...
material_interactions_type
DeclException1(RequiresConstantDensity, std::string, "The following assembler or post-processing utility "<< arg1<< " that you are trying to use does not support the use of a non-constant density model." " Modifications to Lethe are required to take this into account.")