OGS
VapourDiffusionPMQ.cpp
Go to the documentation of this file.
1
12
#include "
VapourDiffusionPMQ.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
VapourDiffusionPMQ::value
(
24
const
VariableArray
& variable_array,
25
const
ParameterLib::SpatialPosition
&
/*pos*/
,
const
double
/*t*/
,
26
const
double
/*dt*/
)
const
27
{
28
const
double
S_L = std::clamp(variable_array.
liquid_saturation
, 0.0, 1.0);
29
30
const
double
T = variable_array.
temperature
;
31
32
const
double
S_v = 1 - S_L;
33
const
double
D_vr = S_v;
34
35
return
base_diffusion_coefficient_
*
36
std::pow(T /
MaterialLib::PhysicalConstant::CelsiusZeroInKelvin
,
37
exponent_
) *
38
D_vr;
39
}
40
41
PropertyDataType
VapourDiffusionPMQ::dValue
(
42
VariableArray
const
& variable_array,
Variable
const
variable,
43
ParameterLib::SpatialPosition
const
&
/*pos*/
,
double
const
/*t*/
,
44
double
const
/*dt*/
)
const
45
{
46
const
double
S_L = std::clamp(variable_array.
liquid_saturation
, 0.0, 1.0);
47
48
const
double
T = variable_array.
temperature
;
49
50
if
(variable ==
Variable::temperature
)
51
{
52
const
double
S_v = 1 - S_L;
53
const
double
D_vr = S_v;
54
55
return
exponent_
*
base_diffusion_coefficient_
*
56
std::pow(T /
MaterialLib::PhysicalConstant::CelsiusZeroInKelvin
,
57
exponent_
- 1.0) *
58
D_vr /
MaterialLib::PhysicalConstant::CelsiusZeroInKelvin
;
59
}
60
61
if
(variable ==
Variable::liquid_saturation
)
62
{
63
return
-
base_diffusion_coefficient_
*
64
std::pow(T /
MaterialLib::PhysicalConstant::CelsiusZeroInKelvin
,
65
exponent_
);
66
}
67
68
OGS_FATAL
(
69
"VapourDiffusionPMQ::dValue is implemented for "
70
"derivatives with respect to temperature or saturation only."
);
71
}
72
73
}
// namespace MaterialPropertyLib
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
Medium.h
PhysicalConstant.h
VapourDiffusionPMQ.h
VariableType.h
MaterialPropertyLib::Property::value
virtual PropertyDataType value() const
Definition
Property.cpp:76
MaterialPropertyLib::VapourDiffusionPMQ::base_diffusion_coefficient_
double const base_diffusion_coefficient_
Definition
VapourDiffusionPMQ.h:93
MaterialPropertyLib::VapourDiffusionPMQ::exponent_
double const exponent_
Definition
VapourDiffusionPMQ.h:94
MaterialPropertyLib::VapourDiffusionPMQ::dValue
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
Definition
VapourDiffusionPMQ.cpp:41
MaterialPropertyLib::VariableArray
Definition
VariableType.h:97
MaterialPropertyLib::VariableArray::liquid_saturation
double liquid_saturation
Definition
VariableType.h:179
MaterialPropertyLib::VariableArray::temperature
double temperature
Definition
VariableType.h:188
ParameterLib::SpatialPosition
Definition
SpatialPosition.h:27
MaterialLib::PhysicalConstant::CelsiusZeroInKelvin
constexpr double CelsiusZeroInKelvin
Zero degrees Celsius in Kelvin.
Definition
PhysicalConstant.h:22
MaterialPropertyLib
Definition
ChemicalSolverInterface.h:21
MaterialPropertyLib::Variable
Variable
Definition
VariableType.h:30
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
VapourDiffusionPMQ.cpp
Generated by
1.11.0