4#ifndef lethe_effective_medium_model_h
5#define lethe_effective_medium_model_h
10#include <deal.II/base/exceptions.h>
19 InvalidPhysicalPropertyComplex,
21 <<
"Invalid physical property value: " << arg1
22 <<
". The physical property values must be in the first quadrant of the complex plane (positive real part and non-negative imaginary part).");
25 InvalidEffectiveMediumModel,
26 "The effective medium model is not valid. The available models are 'none' and 'bruggeman'.");
65 const unsigned int material_interaction_id,
82 static std::shared_ptr<EffectiveMediumModel>
84 const unsigned int material_interaction_id,
97 value(
const std::map<field, double> &field_values)
override;
110 std::vector<double> &property_vector)
override;
123 jacobian(
const std::map<field, double> &field_values,
124 const field id)
override;
139 std::vector<double> &jacobian_vector)
override;
151 virtual std::complex<double>
153 const std::complex<double> phase_1_property,
154 const std::complex<double> phase_2_property)
const = 0;
167 const std::map<
field, std::vector<double>> &field_vectors,
168 const std::vector<std::complex<double>> &phase_1_property,
169 const std::vector<std::complex<double>> &phase_2_property,
170 std::vector<std::complex<double>> &mixture_property)
const = 0;
225 const std::map<field, double> &field_values)
const;
238 const std::map<
field, std::vector<double>> &field_vectors,
239 std::vector<std::complex<double>> &phase_property)
const;
289 [[maybe_unused]]
const std::map<field, double> &field_values,
290 const std::complex<double> phase_1_property,
291 [[maybe_unused]]
const std::complex<double> phase_2_property)
const override
293 return phase_1_property;
306 [[maybe_unused]]
const std::map<
field, std::vector<double>> &field_vectors,
307 const std::vector<std::complex<double>> &phase_1_property,
308 [[maybe_unused]]
const std::vector<std::complex<double>> &phase_2_property,
309 std::vector<std::complex<double>> &mixture_property)
const override
311 mixture_property = phase_1_property;
341 const unsigned int material_interaction_id,
358 const std::complex<double> phase_1_property,
359 const std::complex<double> phase_2_property)
const override;
373 const std::map<
field, std::vector<double>> &field_vectors,
374 const std::vector<std::complex<double>> &phase_1_property,
375 const std::vector<std::complex<double>> &phase_2_property,
376 std::vector<std::complex<double>> &mixture_property)
const override;
389 static std::complex<double>
391 const std::complex<double> phase_1_property,
392 const std::complex<double> phase_2_property);
static std::complex< double > bruggeman(const double void_fraction, const std::complex< double > phase_1_property, const std::complex< double > phase_2_property)
Bruggeman formula for a given void fraction.
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 override
Calculates the mixture property with the Bruggeman effective medium approximation at multiple points.
BruggemanEffectiveMediumModel(const Parameters::PhysicalProperties &physical_properties, const unsigned int material_interaction_id, const EffectiveMediumProperty property, const ComplexComponent complex_component)
Constructor. Adds the fields on which the models of phase 2 depend and the void fraction to the field...
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 override
Calculates the mixture property with the Bruggeman effective medium approximation.
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
Mixing law of the effective medium model.
const ComplexComponent complex_component
Part of the mixture property returned by the model.
double get_complex_component(const std::complex< double > mixture_property) const
Returns the selected part (real or imaginary) of a mixture property.
void add_phase_dependencies(const PhaseModels &phase_models)
Adds the fields on which the models of a phase depend to the fields on which the mixture property dep...
static Parameters::MaterialInteractions::EffectiveMediumModelType get_model_type(const Parameters::MaterialInteractions &interaction, const EffectiveMediumProperty property)
Returns the effective medium model chosen in a material interaction for a mixture property.
void vector_jacobian(const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector) override
Calculates the derivative of the selected part of the mixture property with respect to a field at mul...
double jacobian(const std::map< field, double > &field_values, const field id) override
Calculates the derivative of the selected part of the mixture property with respect to a field using ...
void vector_value(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector) override
Calculates the selected part of the mixture property at multiple points.
std::complex< double > phase_value(const PhaseModels &phase_models, const std::map< field, double > &field_values) const
Calculates the complex property of a phase from its models.
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)
Creates the model of a mixture property, with the mixing law given by the material interaction.
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
Mixing law of the effective medium model at multiple points.
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
Calculates the complex property of a phase at multiple points from its models.
PhaseModels phase_2_models
Models of the property of phase 2.
PhaseModels phase_1_models
Models of the property of phase 1.
static PhaseModels create_phase_models(const Parameters::Material &material_properties, const EffectiveMediumProperty property)
Creates the models needed to calculate a property of the material of a phase.
double value(const std::map< field, double > &field_values) override
Calculates the selected part of the mixture property.
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 o...
Mixture without effective medium model: the mixture property is the property of phase 1....
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 override
Returns the property of phase 1 at multiple points.
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 override
Returns the property of phase 1.
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 o...
MaterialInteractions - Class that defines physical properties due to interactions between two differe...
Material - Class that defines the physical property of a material. Generally a material will be a flu...
PhysicalProperties - Define the possible physical properties. All continuum equations share the same ...
PhysicalPropertyModel()
Default constructor. Set the model_depends_on to false for all variables.
ComplexComponent
Part of a complex physical property returned by a model. A PhysicalPropertyModel can only return a si...
EffectiveMediumProperty
Physical property of a mixture that can be calculated with an effective medium model.
DeclExceptionMsg(InvalidEffectiveMediumModel, "The effective medium model is not valid. The available models are 'none' and 'bruggeman'.")
DeclException1(InvalidPhysicalPropertyComplex, std::complex< double >,<< "Invalid physical property value: "<< arg1<< ". The physical property values must be in the first quadrant of the complex plane (positive real part and non-negative imaginary part).")
Models of the property of a phase. The effective property of the phase can be complex and builded fro...
std::vector< std::shared_ptr< PhysicalPropertyModel > > real_part_terms
Models whose values are summed to give the real part of the property.
std::vector< std::shared_ptr< PhysicalPropertyModel > > imaginary_part_terms