OGS
CreateTemperatureDependentFraction.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
6
8{
9std::unique_ptr<TemperatureDependentFraction>
11{
13 config.checkConfigParameter("type", "TemperatureDependentFraction");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create temperature dependent fraction property {:s}.", property_name);
20
21 auto const k =
23 config.getConfigParameter<double>("steepness");
24
25 auto const T_c =
27 config.getConfigParameter<double>("characteristic_temperature");
28
29 auto const S_r =
31 config.getConfigParameter<double>("residual_saturation", 0.0);
32
33 if (S_r < 0.0 || S_r > 1.0)
34 {
36 "In the temperature dependent fraction property setting, "
37 "the residual_saturation value {} is out of [0, 1]-range.",
38 S_r);
39 }
40
41 return std::make_unique<MaterialPropertyLib::TemperatureDependentFraction>(
42 std::move(property_name), k, T_c, S_r);
43}
44} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:19
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
T peekConfigParameter(std::string const &param) const
T getConfigParameter(std::string const &param) const
void checkConfigParameter(std::string const &param, std::string_view const value) const
std::unique_ptr< TemperatureDependentFraction > createTemperatureDependentFraction(BaseLib::ConfigTree const &config)
constexpr double T_c
Critical temperature.