OGS
CreateRelPermBrooksCorey.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<RelPermBrooksCorey> createRelPermBrooksCorey(
10 BaseLib::ConfigTree const& config)
11{
13 config.checkConfigParameter("type", "RelPermBrooksCorey");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create RelPermBrooksCorey medium property {:s}.", property_name);
20
23 config.getConfigParameter<double>("residual_liquid_saturation");
24 auto const residual_gas_saturation =
26 config.getConfigParameter<double>("residual_gas_saturation");
27 auto const min_relative_permeability =
29 config.getConfigParameter<double>("min_relative_permeability");
30 auto const exponent =
32 config.getConfigParameter<double>("lambda");
33 if (exponent <= 0.)
34 {
35 OGS_FATAL("Exponent 'lambda' must be positive.");
36 }
37
38 return std::make_unique<RelPermBrooksCorey>(std::move(property_name),
41 min_relative_permeability,
42 exponent);
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< RelPermBrooksCorey > createRelPermBrooksCorey(BaseLib::ConfigTree const &config)