OGS
GetLiquidThermalExpansivity.cpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2
// SPDX-License-Identifier: BSD-3-Clause
3
4
#include "
GetLiquidThermalExpansivity.h
"
5
6
#include "
MaterialLib/MPL/Phase.h
"
7
8
namespace
MaterialPropertyLib
9
{
10
class
Phase
;
11
12
double
getLiquidThermalExpansivity
(
Phase
const
& phase,
13
VariableArray
const
& vars,
14
const
double
density
,
15
ParameterLib::SpatialPosition
const
& pos,
16
double
const
t,
double
const
dt)
17
{
18
// The thermal expansivity is explicitly given in the project file.
19
if
(phase.
hasProperty
(
20
MaterialPropertyLib::PropertyType::thermal_expansivity
))
21
{
22
return
phase
23
.
property
(
MaterialPropertyLib::PropertyType::thermal_expansivity
)
24
.template value<double>(vars, pos, t, dt);
25
}
26
27
// The thermal expansivity calculated by the density model directly.
28
return
(
density
== 0.0)
29
? 0.0
30
: -phase.
property
(
MaterialPropertyLib::PropertyType::density
)
31
.template dValue<double>(
32
vars,
MaterialPropertyLib::Variable::temperature
,
33
pos, t, dt) /
34
density
;
35
}
36
}
// namespace MaterialPropertyLib
GetLiquidThermalExpansivity.h
Phase.h
MaterialPropertyLib::Phase
Definition
Phase.h:24
MaterialPropertyLib::Phase::property
Property const & property(PropertyType const &p) const
Definition
Phase.cpp:44
MaterialPropertyLib::Phase::hasProperty
bool hasProperty(PropertyType const &p) const
Definition
Phase.cpp:60
MaterialPropertyLib::VariableArray
Definition
VariableType.h:94
ParameterLib::SpatialPosition
Definition
SpatialPosition.h:21
MaterialPropertyLib
Definition
ChemicalSolverInterface.h:98
MaterialPropertyLib::Variable::temperature
@ temperature
Definition
VariableType.h:43
MaterialPropertyLib::getLiquidThermalExpansivity
double getLiquidThermalExpansivity(Phase const &phase, VariableArray const &vars, const double density, ParameterLib::SpatialPosition const &pos, double const t, double const dt)
Definition
GetLiquidThermalExpansivity.cpp:12
MaterialPropertyLib::density
@ density
Definition
PropertyType.h:39
MaterialPropertyLib::thermal_expansivity
@ thermal_expansivity
Definition
PropertyType.h:93
MaterialLib
MPL
Utils
GetLiquidThermalExpansivity.cpp
Generated by
1.14.0