OGS
CreateRelPermVanGenuchten.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<RelPermVanGenuchten> createRelPermVanGenuchten(
10 BaseLib::ConfigTree const& config)
11{
13 config.checkConfigParameter("type", "RelativePermeabilityVanGenuchten");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create RelativePermeabilityVanGenuchten medium property {:s}.",
20 property_name);
21
24 config.getConfigParameter<double>("residual_liquid_saturation");
25 auto const residual_gas_saturation =
27 config.getConfigParameter<double>("residual_gas_saturation");
28 auto const min_relative_permeability_liquid =
30 config.getConfigParameter<double>(
31 "minimum_relative_permeability_liquid");
32 auto const exponent =
34 config.getConfigParameter<double>("exponent");
35 if (exponent <= 0. || exponent >= 1.)
36 {
37 OGS_FATAL("Exponent must be in the (0, 1) range.");
38 }
39
40 return std::make_unique<RelPermVanGenuchten>(
41 std::move(property_name),
44 min_relative_permeability_liquid,
45 exponent);
46}
47} // 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< RelPermVanGenuchten > createRelPermVanGenuchten(BaseLib::ConfigTree const &config)