OGS
CreateRelPermVanGenuchten.cpp
Go to the documentation of this file.
1 
11 #include "BaseLib/ConfigTree.h"
12 #include "RelPermVanGenuchten.h"
13 
14 namespace MaterialPropertyLib
15 {
16 std::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 
29  auto const residual_liquid_saturation =
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(char const *fmt, Args const &... args)
Definition: Logging.h:27
T peekConfigParameter(std::string const &param) const
void checkConfigParameter(std::string const &param, T const &value) const
T getConfigParameter(std::string const &param) const
std::unique_ptr< RelPermVanGenuchten > createRelPermVanGenuchten(BaseLib::ConfigTree const &config)