OGS
HTFEM.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 "HTFEM.h"
5
6#include <cmath>
7
8#include "BaseLib/Error.h"
9
10namespace ProcessLib
11{
12namespace HT
13{
14namespace
15{
26 double const biot_coefficient,
27 double const specific_storage)
28{
29 if (biot_coefficient != 1.0 || specific_storage == 0.0 ||
30 std::isnan(specific_storage))
31 {
32 return;
33 }
34
36 "At {} the Biot coefficient evaluates to 1.0, which requires the "
37 "specific storage of the solid phase to be 0.0, but it evaluates to "
38 "{:g}.",
39 pos, specific_storage);
40}
41} // namespace
42
44 double const t, double const dt, ParameterLib::SpatialPosition const& pos,
46 MaterialPropertyLib::Medium const& medium,
47 MaterialPropertyLib::Phase const& liquid_phase,
48 MaterialPropertyLib::Phase const& solid_phase,
49 bool const has_solid_thermal_expansivity, double const specific_storage)
50{
51 double const dfluid_density_dT =
53 .template dValue<double>(
55
56 double const fluid_density = vars.density;
57 double const porosity = vars.porosity;
58 double const fluid_thermal_expansivity =
59 -porosity * dfluid_density_dT / fluid_density;
60
61 if (!has_solid_thermal_expansivity)
62 {
63 return fluid_thermal_expansivity;
64 }
65
66 double const linear_solid_thermal_expansivity =
67 solid_phase
69 .template value<double>(vars, pos, t, dt);
70 double const biot_coefficient =
72 .template value<double>(vars, pos, t, dt);
73
74 // Both properties may vary in space and time, so the evaluated values are
75 // the only ones that can be compared. The state independent cases are
76 // caught earlier by checkBiotStorageRelation().
77 checkBiotStorageRelationValues(pos, biot_coefficient, specific_storage);
78
79 return fluid_thermal_expansivity + 3.0 * (biot_coefficient - porosity) *
80 linear_solid_thermal_expansivity;
81}
82
83void checkBiotStorageRelation(double const t, double const dt,
86 MaterialPropertyLib::Medium const& medium,
87 MaterialPropertyLib::Phase const& solid_phase)
88{
89 double const biot_coefficient =
91 .template value<double>(vars, pos, t, dt);
92 double const specific_storage =
94 .template value<double>(vars, pos, t, dt);
95
96 checkBiotStorageRelationValues(pos, biot_coefficient, specific_storage);
97}
98} // namespace HT
99} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:10
Property const & property(PropertyType const &p) const
Definition Medium.cpp:49
Property const & property(PropertyType const &p) const
Definition Phase.cpp:81
void checkBiotStorageRelationValues(ParameterLib::SpatialPosition const &pos, double const biot_coefficient, double const specific_storage)
Definition HTFEM.cpp:25
void checkBiotStorageRelation(double const t, double const dt, ParameterLib::SpatialPosition const &pos, MaterialPropertyLib::VariableArray const &vars, MaterialPropertyLib::Medium const &medium, MaterialPropertyLib::Phase const &solid_phase)
Definition HTFEM.cpp:83
double evalEffectiveThermalExpansivity(double const t, double const dt, ParameterLib::SpatialPosition const &pos, MaterialPropertyLib::VariableArray const &vars, MaterialPropertyLib::Medium const &medium, MaterialPropertyLib::Phase const &liquid_phase, MaterialPropertyLib::Phase const &solid_phase, bool const has_solid_thermal_expansivity, double const specific_storage)
Definition HTFEM.cpp:43