OGS
MaterialPropertyLib::TemperatureDependentDiffusion Class Referencefinal

Detailed Description

Temperature dependent model for molecular diffusion in the pore water

This model takes the form of

\[ \mathbf{D} = \mathbf{D}_0 \mathrm{exp} \left( \frac{E_{\mathrm{a}}}{R} \left( \frac{1}{T_0} - \frac{1}{T} \right) \right), \]

where \(\mathbf{D_0}\) is the molecular diffusion at the reference temperature, \(E_{\mathrm{a}}\) is the activition energy for diffusion, \(R\) is the ideal gas constant, \(T\) is the absolute temperature, \(T_0\) is the reference temperature.

Definition at line 32 of file TemperatureDependentDiffusion.h.

#include <TemperatureDependentDiffusion.h>

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

Public Member Functions

 TemperatureDependentDiffusion (ParameterLib::Parameter< double > const &D0, double const Ea, double const T0)
 
void checkScale () const override
 
PropertyDataType value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, 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 PropertyDataType dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
virtual PropertyDataType d2Value (VariableArray const &variable_array, Variable const variable1, Variable const variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 Default implementation: 2nd derivative of any constant property is zero.
 
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

ParameterLib::Parameter< double > const & D0_
 the molecular diffusion at the reference temperature
 
double const Ea_
 the activition energy for diffusion
 
double const T0_
 the reference temperature
 

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

◆ TemperatureDependentDiffusion()

MaterialPropertyLib::TemperatureDependentDiffusion::TemperatureDependentDiffusion ( ParameterLib::Parameter< double > const & D0,
double const Ea,
double const T0 )
inlineexplicit

Definition at line 35 of file TemperatureDependentDiffusion.h.

39 : D0_(D0), Ea_(Ea), T0_(T0)
40 {
41 }
ParameterLib::Parameter< double > const & D0_
the molecular diffusion at the reference temperature
double const Ea_
the activition energy for diffusion

Member Function Documentation

◆ checkScale()

void MaterialPropertyLib::TemperatureDependentDiffusion::checkScale ( ) const
overridevirtual

Reimplemented from MaterialPropertyLib::Property.

Definition at line 20 of file TemperatureDependentDiffusion.cpp.

21{
22 if (!std::holds_alternative<Component*>(scale_))
23 {
25 "The property 'TemperatureDependentDiffusion' is "
26 "implemented on the 'component' scale only.");
27 }
28}
#define OGS_FATAL(...)
Definition Error.h:26
std::variant< Medium *, Phase *, Component * > scale_
Definition Property.h:297

References OGS_FATAL, and MaterialPropertyLib::Property::scale_.

◆ value()

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

This virtual method will compute the property value based on the variables that are passed as arguments with the default implementation using empty variables array for the previous time step.

Reimplemented from MaterialPropertyLib::Property.

Definition at line 30 of file TemperatureDependentDiffusion.cpp.

34{
35 auto const T = variable_array.temperature;
36 double const gas_constant = MaterialLib::PhysicalConstant::IdealGasConstant;
37 double const Arrhenius_exponent =
38 std::exp(Ea_ / gas_constant * (1 / T0_ - 1 / T));
39
40 auto const D0_data = D0_(t, pos);
41 std::vector<double> D;
42 std::transform(D0_data.cbegin(), D0_data.cend(), std::back_inserter(D),
43 [&Arrhenius_exponent](double const D0_component)
44 { return D0_component * Arrhenius_exponent; });
45
46 return fromVector(D);
47}
PropertyDataType fromVector(std::vector< double > const &values)
Definition Property.cpp:23

References D0_, Ea_, MaterialPropertyLib::fromVector(), MaterialLib::PhysicalConstant::IdealGasConstant, T0_, and MaterialPropertyLib::VariableArray::temperature.

Member Data Documentation

◆ D0_

ParameterLib::Parameter<double> const& MaterialPropertyLib::TemperatureDependentDiffusion::D0_
private

the molecular diffusion at the reference temperature

Definition at line 52 of file TemperatureDependentDiffusion.h.

Referenced by value().

◆ Ea_

double const MaterialPropertyLib::TemperatureDependentDiffusion::Ea_
private

the activition energy for diffusion

Definition at line 54 of file TemperatureDependentDiffusion.h.

Referenced by value().

◆ T0_

double const MaterialPropertyLib::TemperatureDependentDiffusion::T0_
private

the reference temperature

Definition at line 56 of file TemperatureDependentDiffusion.h.

Referenced by value().


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