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

#include <rheological_model.h>

Inheritance diagram for PowerLaw:
[legend]

Public Member Functions

 PowerLaw (const double K, const double n, const double shear_rate_min)
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 get_n () const override
void set_n (const double &p_n) override
double get_kinematic_viscosity () const override
double get_kinematic_viscosity_scale () const override
void set_kinematic_viscosity (const double &p_kinematic_viscosity) override
double get_dynamic_viscosity (const double &p_density_ref, const std::map< field, double > &field_values) const override
void get_dynamic_viscosity_vector (const double &p_density_ref, const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector) override
Public Member Functions inherited from RheologicalModel
 RheologicalModel ()=default
virtual void set_dynamic_viscosity (const double &p_density_ref)
virtual double get_kinematic_viscosity_for_stabilization (const std::map< field, double > &field_values)
virtual void get_kinematic_viscosity_for_stabilization_vector (const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector)
virtual double get_dynamic_viscosity_for_stabilization (const double &p_density_ref, const std::map< field, double > &field_values)
virtual void get_dynamic_viscosity_for_stabilization_vector (const double &p_density_ref, const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &property_vector)
bool is_non_newtonian_rheological_model () const
bool is_phase_change_rheological_model () const
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 Member Functions

double calculate_kinematic_viscosity (const double shear_rate_magnitude) const
double calculate_derivative (const double shear_rate_magnitude) const

Private Attributes

double K
double n
const double shear_rate_min

Additional Inherited Members

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

Detailed Description

Definition at line 348 of file rheological_model.h.

Constructor & Destructor Documentation

◆ PowerLaw()

PowerLaw::PowerLaw ( const double K,
const double n,
const double shear_rate_min )
inline

Parameter constructor.

Parameters
KTodo
nTodo
shear_rate_minTodo

Definition at line 358 of file rheological_model.h.

References K, PhysicalPropertyModel::model_depends_on, n, RheologicalModel::non_newtonian_rheological_model, shear_rate, and shear_rate_min.

Member Function Documentation

◆ calculate_derivative()

double PowerLaw::calculate_derivative ( const double shear_rate_magnitude) const
inlineprivate

Definition at line 508 of file rheological_model.h.

References K, n, and shear_rate_min.

◆ calculate_kinematic_viscosity()

double PowerLaw::calculate_kinematic_viscosity ( const double shear_rate_magnitude) const
inlineprivate

Definition at line 500 of file rheological_model.h.

References K, n, and shear_rate_min.

◆ get_dynamic_viscosity()

double PowerLaw::get_dynamic_viscosity ( const double & p_density_ref,
const std::map< field, double > & field_values ) const
inlineoverridevirtual

Calculates the dynamic viscosity, if a kinematic viscosity and a reference density value is specified.

Parameters
p_density_refThe density of the fluid at the reference state
field_valuesValue of the various fields on which the property may depend. The power law dynamic viscosity depends on the shear rate magnitude.

Implements RheologicalModel.

Definition at line 465 of file rheological_model.h.

References calculate_kinematic_viscosity(), and shear_rate.

◆ get_dynamic_viscosity_vector()

void PowerLaw::get_dynamic_viscosity_vector ( const double & p_density_ref,
const std::map< field, std::vector< double > > & field_vectors,
std::vector< double > & property_vector )
inlineoverridevirtual

Calculates the vector values of the dynamic viscosity.

Parameters
p_density_refThe density of the fluid at the reference state
field_vectorsValues of the field on which the dynamic viscosity may depend on.
property_vector

Implements RheologicalModel.

Definition at line 483 of file rheological_model.h.

References calculate_kinematic_viscosity(), and shear_rate.

◆ get_kinematic_viscosity()

double PowerLaw::get_kinematic_viscosity ( ) const
inlineoverridevirtual

Returns the value of the kinematic viscosity, if the model has one.

Reimplemented from RheologicalModel.

Definition at line 438 of file rheological_model.h.

References K.

◆ get_kinematic_viscosity_scale()

double PowerLaw::get_kinematic_viscosity_scale ( ) const
inlineoverridevirtual

Returns the kinematic viscosity scale. This is used to get the kinematic viscosity scale in the problem when it's not constant. This is useful for weak boundary conditions.

Reimplemented from RheologicalModel.

Definition at line 444 of file rheological_model.h.

References K, n, and shear_rate_min.

◆ get_n()

double PowerLaw::get_n ( ) const
inlineoverridevirtual

Returns the value of the n parameters of the model, if the model has one.

Reimplemented from RheologicalModel.

Definition at line 426 of file rheological_model.h.

References n.

◆ jacobian()

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

jacobian Calculates the jacobian (the partial derivative) of the kinematic viscosity with respect to a field

Parameters
field_valuesValue of the various fields on which the property may depend. The constant kinematic viscosity does not depend on anything.
idIndicator of the field with respect to which the jacobian should be calculated
Returns
value of the partial derivative of the kinematic viscosity with respect to the field.

Implements PhysicalPropertyModel.

Definition at line 66 of file rheological_model.cc.

References calculate_derivative(), and shear_rate.

◆ set_kinematic_viscosity()

void PowerLaw::set_kinematic_viscosity ( const double & p_kinematic_viscosity)
inlineoverridevirtual

Sets a new kinematic viscosity value, if the models has one.

Parameters
p_kinematic_viscosityThe kinematic viscosity value

Reimplemented from RheologicalModel.

Definition at line 451 of file rheological_model.h.

References K.

◆ set_n()

void PowerLaw::set_n ( const double & )
inlineoverridevirtual

Sets a new value to the n parameter, if the models has one.

Reimplemented from RheologicalModel.

Definition at line 432 of file rheological_model.h.

References n.

◆ value()

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

Returns the non-Newtonian kinematic viscosity.

Parameters
field_valuesThe values of the field on which the kinematic viscosity may depend on. For this model, it only depends on the magnitude of the shear rate tensor

Source : Morrison, F. A. (2001). No Memory: Generalized Newtonian Fluids. Understanding Rheology. Raymond F. Boyer Library Collection, Oxford University Press.

Implements PhysicalPropertyModel.

Definition at line 43 of file rheological_model.cc.

References calculate_kinematic_viscosity(), and shear_rate.

◆ vector_jacobian()

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

vector_jacobian Calculate the derivative of the with respect to a field

Parameters
field_vectorsVector for the values of the fields used to evaluate the property
idIdentifier of the field with respect to which a derivative should be calculated
jacobian_vectorVector of the value of the derivative of the kinematic viscosity with respect to the field id

Implements PhysicalPropertyModel.

Definition at line 80 of file rheological_model.cc.

References calculate_derivative(), and shear_rate.

◆ vector_value()

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

vector_value Calculates the vector values of the kinematic viscosity.

Parameters
field_vectorsValues of the field on which the kinematic viscosity may depend on. The power-law kinematic viscosity depends on the shear rate.
property_vectorVector of the properties.

Implements PhysicalPropertyModel.

Definition at line 53 of file rheological_model.cc.

References calculate_kinematic_viscosity(), and shear_rate.

Member Data Documentation

◆ K

double PowerLaw::K
private

Definition at line 515 of file rheological_model.h.

◆ n

double PowerLaw::n
private

Definition at line 516 of file rheological_model.h.

◆ shear_rate_min

const double PowerLaw::shear_rate_min
private

Definition at line 517 of file rheological_model.h.


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