OGS
MaterialPropertyLib::Exponential Class Referencefinal

Detailed Description

An exponential property.

This property calculates the exponential relationship \( \alpha(\beta) = \alpha_{\mathrm{offset}} + \alpha_{\mathrm{ref}} \cdot \exp (m (\beta - \beta_{\mathrm{ref}})\), where:

  • \(\alpha_{\mathrm{ref}}\) is a reference value, for instance reference viscosity,
  • \(\alpha_{\mathrm{offset}}\) is additive offset in units of the property,
  • \(m\) is a dimensionless exponent,
  • \(\beta_{\mathrm{ref}}\) is a reference condition value of independent variable, for instance reference temperature.

The current implementation accepts only the scalar independent variables.

Definition at line 40 of file Exponential.h.

#include <Exponential.h>

Inheritance diagram for MaterialPropertyLib::Exponential:
[legend]
Collaboration diagram for MaterialPropertyLib::Exponential:
[legend]

Public Member Functions

 Exponential (std::string name, double const offset, PropertyDataType const &property_reference_value, ExponentData const &v)
 
PropertyDataType value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
 
PropertyDataType dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &, double const, double const) const override
 
PropertyDataType d2Value (VariableArray const &variable_array, Variable const pv1, Variable const pv2, ParameterLib::SpatialPosition const &, double const, double const) const override
 
- Public Member Functions inherited from MaterialPropertyLib::Property
virtual ~Property ()
 
virtual PropertyDataType initialValue (ParameterLib::SpatialPosition const &pos, double const t) const
 
virtual PropertyDataType value () const
 
virtual PropertyDataType value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
virtual PropertyDataType dValue (VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
virtual void setProperties (std::vector< std::unique_ptr< Phase > > const &phases)
 Default implementation:
 
void setScale (std::variant< Medium *, Phase *, Component * > scale)
 
template<typename T >
initialValue (ParameterLib::SpatialPosition const &pos, double const t) const
 
template<typename T >
value () const
 
template<typename T >
value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
dValue (VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
d2Value (VariableArray const &variable_array, Variable const &variable1, Variable const &variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 

Private Attributes

ExponentData const exponent_data_
 
double const offset_
 additive offset in units of the property.
 

Additional Inherited Members

- Protected Attributes inherited from MaterialPropertyLib::Property
std::string name_
 
PropertyDataType value_
 The single value of a property.
 
PropertyDataType dvalue_
 
std::variant< Medium *, Phase *, Component * > scale_
 

Constructor & Destructor Documentation

◆ Exponential()

MaterialPropertyLib::Exponential::Exponential ( std::string name,
double const offset,
PropertyDataType const & property_reference_value,
ExponentData const & v )

This constructor accepts single values of double data type defined in the PropertyDataType definition and sets the protected attribute value_ of the base class Property to that value.

Definition at line 17 of file Exponential.cpp.

21 : exponent_data_(v), offset_(offset)
22{
23 name_ = std::move(name);
24 auto const f = std::get<double>(exponent_data_.factor);
25 auto const v0 = std::get<double>(exponent_data_.reference_condition);
26 value_ = std::get<double>(property_reference_value) * std::exp(-f * v0);
27}
double const offset_
additive offset in units of the property.
Definition Exponential.h:72
ExponentData const exponent_data_
Definition Exponential.h:71
PropertyDataType value_
The single value of a property.
Definition Property.h:292
VariableType factor
a dimensionless exponent.
Definition Exponential.h:23

References exponent_data_, MaterialPropertyLib::ExponentData::factor, MaterialPropertyLib::name, MaterialPropertyLib::Property::name_, MaterialPropertyLib::ExponentData::reference_condition, and MaterialPropertyLib::Property::value_.

Member Function Documentation

◆ d2Value()

PropertyDataType MaterialPropertyLib::Exponential::d2Value ( VariableArray const & variable_array,
Variable const pv1,
Variable const pv2,
ParameterLib::SpatialPosition const & ,
double const ,
double const  ) const
overridevirtual

This method will compute the second derivative of a property with respect to the given primary variables pv1 and pv2.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 56 of file Exponential.cpp.

60{
61 if (exponent_data_.type != pv1 && exponent_data_.type != pv2)
62 {
63 return 0.;
64 }
65
66 auto const f = std::get<double>(exponent_data_.factor);
67 auto const v = std::get<double>(variable_array[exponent_data_.type]);
68
69 return std::get<double>(value_) * f * f * std::exp(f * v);
70}

References exponent_data_, MaterialPropertyLib::ExponentData::factor, MaterialPropertyLib::ExponentData::type, and MaterialPropertyLib::Property::value_.

◆ dValue()

PropertyDataType MaterialPropertyLib::Exponential::dValue ( VariableArray const & variable_array,
Variable const variable,
ParameterLib::SpatialPosition const & ,
double const ,
double const  ) const
overridevirtual

This method will compute the derivative of a property with respect to the given primary variable.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 40 of file Exponential.cpp.

44{
45 if (exponent_data_.type != variable)
46 {
47 return 0.;
48 }
49
50 auto const f = std::get<double>(exponent_data_.factor);
51 auto const v = std::get<double>(variable_array[exponent_data_.type]);
52
53 return std::get<double>(value_) * f * std::exp(f * v);
54}

References exponent_data_, MaterialPropertyLib::ExponentData::factor, MaterialPropertyLib::ExponentData::type, and MaterialPropertyLib::Property::value_.

◆ value()

PropertyDataType MaterialPropertyLib::Exponential::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
overridevirtual

This method computes the value of a property \(\alpha\) depending exponentially on the value of the given primary variable \(\beta\).

Reimplemented from MaterialPropertyLib::Property.

Definition at line 29 of file Exponential.cpp.

33{
34 auto const f = std::get<double>(exponent_data_.factor);
35 auto const v = std::get<double>(variable_array[exponent_data_.type]);
36
37 return offset_ + std::get<double>(value_) * std::exp(f * v);
38}

References exponent_data_, MaterialPropertyLib::ExponentData::factor, offset_, MaterialPropertyLib::ExponentData::type, and MaterialPropertyLib::Property::value_.

Member Data Documentation

◆ exponent_data_

ExponentData const MaterialPropertyLib::Exponential::exponent_data_
private

Definition at line 71 of file Exponential.h.

Referenced by Exponential(), d2Value(), dValue(), and value().

◆ offset_

double const MaterialPropertyLib::Exponential::offset_
private

additive offset in units of the property.

Definition at line 72 of file Exponential.h.

Referenced by value().


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