Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
EffectiveMediumModel Class Referenceabstract

#include <effective_medium_model.h>

Inheritance diagram for EffectiveMediumModel:
[legend]

Classes

struct  PhaseModels

Public Member Functions

 EffectiveMediumModel (const Parameters::PhysicalProperties &physical_properties, const unsigned int material_interaction_id, const EffectiveMediumProperty &property, const ComplexComponent &complex_component)
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
virtual std::complex< double > apply_mixing_law (const std::map< field, double > &field_values, const std::complex< double > phase_1_property, const std::complex< double > phase_2_property) const =0
virtual void vector_apply_mixing_law (const std::map< field, std::vector< double > > &field_vectors, const std::vector< std::complex< double > > &phase_1_property, const std::vector< std::complex< double > > &phase_2_property, std::vector< std::complex< double > > &mixture_property) const =0
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)

Static Public Member Functions

static std::shared_ptr< EffectiveMediumModel > model_cast (const Parameters::PhysicalProperties &physical_properties, const unsigned int material_interaction_id, const EffectiveMediumProperty &property, const ComplexComponent &complex_component)

Protected Member Functions

void add_phase_dependencies (const PhaseModels &phase_models)
Protected Member Functions inherited from PhysicalPropertyModel
std::shared_ptr< SimulationControl > & get_simulation_control ()

Protected Attributes

PhaseModels phase_1_models
PhaseModels phase_2_models
Protected Attributes inherited from PhysicalPropertyModel
std::map< field, bool > model_depends_on

Private Member Functions

std::complex< double > phase_value (const PhaseModels &phase_models, const std::map< field, double > &field_values) const
void phase_vector_value (const PhaseModels &phase_models, const std::map< field, std::vector< double > > &field_vectors, std::vector< std::complex< double > > &phase_property) const
double get_complex_component (const std::complex< double > mixture_property) const

Static Private Member Functions

static PhaseModels create_phase_models (const Parameters::Material &material_properties, const EffectiveMediumProperty property)
static Parameters::MaterialInteractions::EffectiveMediumModelType get_model_type (const Parameters::MaterialInteractions &interaction, const EffectiveMediumProperty property)

Private Attributes

const ComplexComponent complex_component

Additional Inherited Members

Public Types inherited from PhysicalPropertyModel
enum class  ComplexComponent : std::int8_t { real , imag }

Detailed Description

Effective medium model for the calculation of a physical property of a mixture of two phases. The mixture and its two phases are defined by a material interaction. The property of each phase is calculated with the physical property models of its material. The mixing is done with complex values to allow for the calculation of complex properties, such as the complex permittivity or permeability. The mixture property depends on the fields on which the models of the phases used by the mixing law depend, and on the fields required by the mixing law itself (e.g., the void fraction).

Definition at line 48 of file effective_medium_model.h.

Constructor & Destructor Documentation

◆ EffectiveMediumModel()

EffectiveMediumModel::EffectiveMediumModel ( const Parameters::PhysicalProperties & physical_properties,
const unsigned int material_interaction_id,
const EffectiveMediumProperty & property,
const ComplexComponent & complex_component )

Constructor. Gets the materials of the two phases from the material interaction, creates the models of their property and sets the fields on which these models depend.

Parameters
[in]physical_propertiesPhysical properties parameters.
[in]material_interaction_idIndex of the material interaction that defines the mixture.
[in]propertyMixture property calculated by the model.
[in]complex_componentPart of the mixture property returned by the model.

Definition at line 12 of file effective_medium_model.cc.

References add_phase_dependencies(), complex_component, create_phase_models(), fluid_dispersed_phase, Parameters::MaterialInteractions::fluid_dispersed_phase_interaction_with_material_interaction_id, Parameters::PhysicalProperties::fluids, Parameters::MaterialInteractions::material_interaction_type, Parameters::PhysicalProperties::material_interactions, Parameters::PhysicalProperties::number_of_fluids, Parameters::PhysicalProperties::number_of_material_interactions, Parameters::PhysicalProperties::number_of_unresolved_dispersed_phases, phase_1_models, phase_2_models, and Parameters::PhysicalProperties::unresolved_dispersed_phases.

Member Function Documentation

◆ add_phase_dependencies()

void EffectiveMediumModel::add_phase_dependencies ( const PhaseModels & phase_models)
protected

Adds the fields on which the models of a phase depend to the fields on which the mixture property depends.

Parameters
[in]phase_modelsModels of the property of the phase.

Definition at line 145 of file effective_medium_model.cc.

References EffectiveMediumModel::PhaseModels::imaginary_part_terms, PhysicalPropertyModel::model_depends_on, and EffectiveMediumModel::PhaseModels::real_part_terms.

◆ apply_mixing_law()

virtual std::complex< double > EffectiveMediumModel::apply_mixing_law ( const std::map< field, double > & field_values,
const std::complex< double > phase_1_property,
const std::complex< double > phase_2_property ) const
pure virtual

Mixing law of the effective medium model.

Parameters
[in]field_valuesValues of the fields on which the mixing law depends.
[in]phase_1_propertyProperty of phase 1.
[in]phase_2_propertyProperty of phase 2.
Returns
Property of the mixture.

Implemented in BruggemanEffectiveMediumModel, and NoEffectiveMediumModel.

◆ create_phase_models()

EffectiveMediumModel::PhaseModels EffectiveMediumModel::create_phase_models ( const Parameters::Material & material_properties,
const EffectiveMediumProperty property )
staticprivate

Creates the models needed to calculate a property of the material of a phase.

Parameters
[in]material_propertiesParameters of the material.
[in]propertyProperty described by the models.
Returns
Models of the property.

Definition at line 162 of file effective_medium_model.cc.

References electric_permittivity, EffectiveMediumModel::PhaseModels::imaginary_part_terms, magnetic_permeability, ElectricConductivityModel::model_cast(), ElectricPermittivityModel::model_cast_imag(), MagneticPermeabilityModel::model_cast_imag(), ElectricPermittivityModel::model_cast_real(), MagneticPermeabilityModel::model_cast_real(), and EffectiveMediumModel::PhaseModels::real_part_terms.

◆ get_complex_component()

double EffectiveMediumModel::get_complex_component ( const std::complex< double > mixture_property) const
private

Returns the selected part (real or imaginary) of a mixture property.

Parameters
[in]mixture_propertyProperty of the mixture.
Returns
Real or imaginary part of the mixture property.

Definition at line 237 of file effective_medium_model.cc.

References complex_component, and PhysicalPropertyModel::real.

◆ get_model_type()

Parameters::MaterialInteractions::EffectiveMediumModelType EffectiveMediumModel::get_model_type ( const Parameters::MaterialInteractions & interaction,
const EffectiveMediumProperty property )
staticprivate

Returns the effective medium model chosen in a material interaction for a mixture property.

Parameters
[in]interactionParameters of the material interaction.
[in]propertyMixture property calculated by the model.
Returns
Type of the effective medium model of the property.

Definition at line 246 of file effective_medium_model.cc.

References electric_permittivity, Parameters::MaterialInteractions::electric_permittivity_effective_medium_model, magnetic_permeability, Parameters::MaterialInteractions::magnetic_permeability_effective_medium_model, and Parameters::MaterialInteractions::none.

◆ jacobian()

double EffectiveMediumModel::jacobian ( const std::map< field, double > & field_values,
const field id )
overridevirtual

Calculates the derivative of the selected part of the mixture property with respect to a field using a finite difference.

Parameters
[in]field_valuesValues of the fields on which the property depends.
[in]idField with respect to which the derivative is calculated.
Returns
Derivative of the property with respect to the field.

Implements PhysicalPropertyModel.

Definition at line 129 of file effective_medium_model.cc.

References PhysicalPropertyModel::numerical_jacobian().

◆ model_cast()

std::shared_ptr< EffectiveMediumModel > EffectiveMediumModel::model_cast ( const Parameters::PhysicalProperties & physical_properties,
const unsigned int material_interaction_id,
const EffectiveMediumProperty & property,
const ComplexComponent & complex_component )
static

Creates the model of a mixture property, with the mixing law given by the material interaction.

Parameters
[in]physical_propertiesPhysical properties parameters.
[in]material_interaction_idIndex of the material interaction that defines the mixture.
[in]propertyMixture property calculated by the model.
[in]complex_componentPart of the mixture property returned by the model.
Returns
A shared pointer to the created effective medium model.

Definition at line 62 of file effective_medium_model.cc.

◆ phase_value()

std::complex< double > EffectiveMediumModel::phase_value ( const PhaseModels & phase_models,
const std::map< field, double > & field_values ) const
private

Calculates the complex property of a phase from its models.

Parameters
[in]phase_modelsModels of the property of the phase.
[in]field_valuesValues of the fields.
Returns
Property of the phase.

Definition at line 192 of file effective_medium_model.cc.

References EffectiveMediumModel::PhaseModels::imaginary_part_terms, and EffectiveMediumModel::PhaseModels::real_part_terms.

◆ phase_vector_value()

void EffectiveMediumModel::phase_vector_value ( const PhaseModels & phase_models,
const std::map< field, std::vector< double > > & field_vectors,
std::vector< std::complex< double > > & phase_property ) const
private

Calculates the complex property of a phase at multiple points from its models.

Parameters
[in]phase_modelsModels of the property of the phase.
[in]field_vectorsValues of the fields at each point.
[in,out]phase_propertyProperty of the phase at each point. Its size sets the number of points.

Definition at line 208 of file effective_medium_model.cc.

References EffectiveMediumModel::PhaseModels::imaginary_part_terms, and EffectiveMediumModel::PhaseModels::real_part_terms.

◆ value()

double EffectiveMediumModel::value ( const std::map< field, double > & field_values)
overridevirtual

Calculates the selected part of the mixture property.

Parameters
[in]field_valuesValues of the fields on which the property depends.
Returns
Real or imaginary part of the mixture property.

Implements PhysicalPropertyModel.

Definition at line 92 of file effective_medium_model.cc.

References apply_mixing_law(), get_complex_component(), phase_1_models, phase_2_models, and phase_value().

◆ vector_apply_mixing_law()

virtual void EffectiveMediumModel::vector_apply_mixing_law ( const std::map< field, std::vector< double > > & field_vectors,
const std::vector< std::complex< double > > & phase_1_property,
const std::vector< std::complex< double > > & phase_2_property,
std::vector< std::complex< double > > & mixture_property ) const
pure virtual

Mixing law of the effective medium model at multiple points.

Parameters
[in]field_vectorsValues of the fields on which the mixing law depends at each point.
[in]phase_1_propertyProperty of phase 1 at each point.
[in]phase_2_propertyProperty of phase 2 at each point.
[in,out]mixture_propertyProperty of the mixture at each point.

Implemented in BruggemanEffectiveMediumModel, and NoEffectiveMediumModel.

◆ vector_jacobian()

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

Calculates the derivative of the selected part of the mixture property with respect to a field at multiple points using a finite difference.

Parameters
[in]field_vectorsValues of the fields on which the property depends at each point.
[in]idField with respect to which the derivative is calculated.
[in,out]jacobian_vectorDerivative of the property at each point.

Implements PhysicalPropertyModel.

Definition at line 136 of file effective_medium_model.cc.

References PhysicalPropertyModel::vector_numerical_jacobian().

◆ vector_value()

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

Calculates the selected part of the mixture property at multiple points.

Parameters
[in]field_vectorsValues of the fields on which the property depends at each point.
[in,out]property_vectorReal or imaginary part of the mixture property at each point. Its size sets the number of points.

Implements PhysicalPropertyModel.

Definition at line 104 of file effective_medium_model.cc.

References get_complex_component(), phase_1_models, phase_2_models, phase_vector_value(), and vector_apply_mixing_law().

Member Data Documentation

◆ complex_component

const ComplexComponent EffectiveMediumModel::complex_component
private

Part of the mixture property returned by the model.

Definition at line 265 of file effective_medium_model.h.

◆ phase_1_models

PhaseModels EffectiveMediumModel::phase_1_models
protected

Models of the property of phase 1.

Definition at line 196 of file effective_medium_model.h.

◆ phase_2_models

PhaseModels EffectiveMediumModel::phase_2_models
protected

Models of the property of phase 2.

Definition at line 199 of file effective_medium_model.h.


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