OGS
CreateRelPermBrooksCorey.cpp
Go to the documentation of this file.
1 
11 #include "BaseLib/ConfigTree.h"
12 #include "RelPermBrooksCorey.h"
13 
14 namespace MaterialPropertyLib
15 {
16 std::unique_ptr<RelPermBrooksCorey> createRelPermBrooksCorey(
17  BaseLib::ConfigTree const& config)
18 {
20  config.checkConfigParameter("type", "RelPermBrooksCorey");
21 
22  // Second access for storage.
24  auto property_name = config.peekConfigParameter<std::string>("name");
25 
26  DBUG("Create RelPermBrooksCorey medium property {:s}.", property_name);
27 
28  auto const residual_liquid_saturation =
30  config.getConfigParameter<double>("residual_liquid_saturation");
31  auto const residual_gas_saturation =
33  config.getConfigParameter<double>("residual_gas_saturation");
34  auto const min_relative_permeability =
36  config.getConfigParameter<double>("min_relative_permeability");
37  auto const exponent =
39  config.getConfigParameter<double>("lambda");
40  if (exponent <= 0.)
41  {
42  OGS_FATAL("Exponent 'lambda' must be positive.");
43  }
44 
45  return std::make_unique<RelPermBrooksCorey>(std::move(property_name),
48  min_relative_permeability,
49  exponent);
50 }
51 } // 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< RelPermBrooksCorey > createRelPermBrooksCorey(BaseLib::ConfigTree const &config)