OGS
CreateSaturationVanGenuchten.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<SaturationVanGenuchten> createSaturationVanGenuchten(
10 BaseLib::ConfigTree const& config)
11{
13 config.checkConfigParameter("type", "SaturationVanGenuchten");
14
15 // Second access for storage.
17 auto property_name = config.peekConfigParameter<std::string>("name");
18
19 DBUG("Create SaturationVanGenuchten 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
28 double pressure_exponent;
29 double saturation_exponent;
30 if (auto const optional_exponent =
32 config.getConfigParameterOptional<double>("exponent"))
33 {
34 pressure_exponent = *optional_exponent;
35 saturation_exponent = 1.0 / (1.0 - pressure_exponent);
36 }
37 else
38 {
39 pressure_exponent =
41 config.getConfigParameter<double>("pressure_exponent");
42 saturation_exponent =
44 config.getConfigParameter<double>("saturation_exponent");
45 }
46
48 auto const p_b = config.getConfigParameter<double>("p_b");
49
50 return std::make_unique<SaturationVanGenuchten>(
51 std::move(property_name), residual_liquid_saturation,
52 residual_gas_saturation, pressure_exponent, saturation_exponent, p_b);
53}
54} // namespace MaterialPropertyLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
T peekConfigParameter(std::string const &param) const
std::optional< T > getConfigParameterOptional(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< SaturationVanGenuchten > createSaturationVanGenuchten(BaseLib::ConfigTree const &config)