OGS
CreateRelPermNonWettingPhaseVanGenuchtenMualem.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
5
9
10namespace MaterialPropertyLib
11{
13 BaseLib::ConfigTree const& config)
14{
17 "type", "RelativePermeabilityNonWettingPhaseVanGenuchtenMualem");
18 DBUG("Create RelPermNonWettingPhaseVanGenuchtenMualem medium property");
19
20 // Second access for storage.
22 auto property_name = config.peekConfigParameter<std::string>("name");
23
26 config.getConfigParameter<double>("residual_liquid_saturation");
27 auto const residual_gas_saturation =
29 config.getConfigParameter<double>("residual_gas_saturation");
30
31 auto const exponent =
33 config.getConfigParameter<double>("exponent");
34
35 auto const min_relative_permeability =
37 config.getConfigParameter<double>("min_relative_permeability");
38 double const a =
40 config.getConfigParameter<double>("enhancement_factor", 1.0);
41
42 if (min_relative_permeability <= 0.0 || min_relative_permeability > 1.0)
43 {
45 "The value for min_relative_permeability of "
46 "RelativePermeabilityNonWettingPhaseVanGenuchtenMualem is {:g}, "
47 "which falls outside of the range of (0, 1]",
48 min_relative_permeability);
49 }
50 if (a < 0 || !std::isfinite(a))
51 {
53 "The value of the enhancement_factor for the nonwetting relative "
54 "permeability must be non-negative and finite."
55 "The value is {:g}, which is out of bounds.",
56 a);
57 }
58
59 return std::make_unique<RelPermNonWettingPhaseVanGenuchtenMualem>(
61 exponent, min_relative_permeability, a);
62}
63} // 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< Property > createRelPermNonWettingPhaseVanGenuchtenMualem(BaseLib::ConfigTree const &config)