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 primary_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
 
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. More...
 

Additional Inherited Members

- Protected Attributes inherited from MaterialPropertyLib::Property
std::string name_
 
PropertyDataType value_
 The single value of a property. More...
 
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 18 of file Exponential.cpp.

22  : exponent_data_(v), offset_(offset)
23 {
24  name_ = std::move(name);
25  auto const f = std::get<double>(exponent_data_.factor);
26  auto const v0 = std::get<double>(exponent_data_.reference_condition);
27  value_ = std::get<double>(property_reference_value) * std::exp(-f * v0);
28 }
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:282
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 59 of file Exponential.cpp.

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

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

◆ dValue()

PropertyDataType MaterialPropertyLib::Exponential::dValue ( VariableArray const &  variable_array,
Variable const  primary_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 42 of file Exponential.cpp.

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

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 30 of file Exponential.cpp.

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

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: