OGS
CreateRelPermVanGenuchten.cpp
Go to the documentation of this file.
1
11#include "BaseLib/ConfigTree.h"
12#include "RelPermVanGenuchten.h"
13
14namespace MaterialPropertyLib
15{
16std::unique_ptr<RelPermVanGenuchten> createRelPermVanGenuchten(
17 BaseLib::ConfigTree const& config)
18{
20 config.checkConfigParameter("type", "RelativePermeabilityVanGenuchten");
21
22 // Second access for storage.
24 auto property_name = config.peekConfigParameter<std::string>("name");
25
26 DBUG("Create RelativePermeabilityVanGenuchten medium property {:s}.",
27 property_name);
28
31 config.getConfigParameter<double>("residual_liquid_saturation");
32 auto const residual_gas_saturation =
34 config.getConfigParameter<double>("residual_gas_saturation");
35 auto const min_relative_permeability_liquid =
37 config.getConfigParameter<double>(
38 "minimum_relative_permeability_liquid");
39 auto const exponent =
41 config.getConfigParameter<double>("exponent");
42 if (exponent <= 0. || exponent >= 1.)
43 {
44 OGS_FATAL("Exponent must be in the (0, 1) range.");
45 }
46
47 return std::make_unique<RelPermVanGenuchten>(
48 std::move(property_name),
51 min_relative_permeability_liquid,
52 exponent);
53}
54} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:26
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
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)