OGS
VapourDiffusionDeVries.cpp
Go to the documentation of this file.
1
12
#include "
VapourDiffusionDeVries.h
"
13
14
#include <algorithm>
15
#include <cmath>
16
17
#include "
MaterialLib/MPL/Medium.h
"
18
#include "
MaterialLib/MPL/VariableType.h
"
19
#include "
MaterialLib/PhysicalConstant.h
"
20
21
namespace
MaterialPropertyLib
22
{
23
PropertyDataType
VapourDiffusionDeVries::value
(
24
const
VariableArray
& variable_array,
25
const
ParameterLib::SpatialPosition
&
/*pos*/
,
const
double
/*t*/
,
26
const
double
/*dt*/
)
const
27
{
28
const
double
T = variable_array.
temperature
;
29
const
double
p_g = variable_array.
gas_phase_pressure
;
30
31
return
base_diffusion_coefficient_
* std::pow(T,
exponent_
) / p_g;
32
}
33
34
PropertyDataType
VapourDiffusionDeVries::dValue
(
35
VariableArray
const
& variable_array,
Variable
const
variable,
36
ParameterLib::SpatialPosition
const
&
/*pos*/
,
double
const
/*t*/
,
37
double
const
/*dt*/
)
const
38
{
39
const
double
T = variable_array.
temperature
;
40
const
double
p_g = variable_array.
gas_phase_pressure
;
41
42
if
(variable ==
Variable::temperature
)
43
{
44
return
exponent_
*
base_diffusion_coefficient_
*
45
std::pow(T,
exponent_
- 1.0) / p_g;
46
}
47
if
(variable ==
Variable::gas_phase_pressure
)
48
{
49
return
-
base_diffusion_coefficient_
* std::pow(T,
exponent_
) /
50
(p_g * p_g);
51
}
52
if
(variable ==
Variable::liquid_saturation
)
53
{
54
return
0.0;
55
}
56
57
OGS_FATAL
(
58
"VapourDiffusionDeVries::dValue is implemented for derivatives with "
59
"respect to temperature or saturation only."
);
60
}
61
62
}
// namespace MaterialPropertyLib
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
Medium.h
PhysicalConstant.h
VapourDiffusionDeVries.h
VariableType.h
MaterialPropertyLib::Property::value
virtual PropertyDataType value() const
Definition
Property.cpp:76
MaterialPropertyLib::VapourDiffusionDeVries::base_diffusion_coefficient_
double const base_diffusion_coefficient_
Definition
VapourDiffusionDeVries.h:67
MaterialPropertyLib::VapourDiffusionDeVries::dValue
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
Definition
VapourDiffusionDeVries.cpp:34
MaterialPropertyLib::VapourDiffusionDeVries::exponent_
double const exponent_
Definition
VapourDiffusionDeVries.h:68
MaterialPropertyLib::VariableArray
Definition
VariableType.h:99
MaterialPropertyLib::VariableArray::temperature
double temperature
Definition
VariableType.h:191
MaterialPropertyLib::VariableArray::gas_phase_pressure
double gas_phase_pressure
Definition
VariableType.h:187
ParameterLib::SpatialPosition
Definition
SpatialPosition.h:27
MaterialPropertyLib
Definition
ChemicalSolverInterface.h:21
MaterialPropertyLib::Variable
Variable
Definition
VariableType.h:30
MaterialPropertyLib::Variable::gas_phase_pressure
@ gas_phase_pressure
MaterialPropertyLib::Variable::liquid_saturation
@ liquid_saturation
MaterialPropertyLib::Variable::temperature
@ temperature
MaterialPropertyLib::PropertyDataType
std::variant< double, Eigen::Matrix< double, 2, 1 >, Eigen::Matrix< double, 3, 1 >, Eigen::Matrix< double, 2, 2 >, Eigen::Matrix< double, 3, 3 >, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 >, Eigen::MatrixXd > PropertyDataType
Definition
Property.h:31
MaterialLib
MPL
Properties
VapourDiffusion
VapourDiffusionDeVries.cpp
Generated by
1.11.0