OGS
CreateRelPermUdellNonwettingPhase.cpp
Go to the documentation of this file.
1 
12 #include "BaseLib/ConfigTree.h"
14 
15 namespace MaterialPropertyLib
16 {
17 std::unique_ptr<RelPermUdellNonwettingPhase> createRelPermUdellNonwettingPhase(
18  BaseLib::ConfigTree const& config)
19 {
21  config.checkConfigParameter("type",
22  "RelativePermeabilityUdellNonwettingPhase");
23 
24  // Second access for storage.
26  auto property_name = config.peekConfigParameter<std::string>("name");
27 
28  DBUG("Create RelPermUdellNonwettingPhase medium property {:s}.",
29  property_name);
30 
31  auto const residual_liquid_saturation =
33  config.getConfigParameter<double>("residual_liquid_saturation");
34  auto const residual_gas_saturation =
36  config.getConfigParameter<double>("residual_gas_saturation");
37  auto const min_relative_permeability =
39  config.getConfigParameter<double>("min_relative_permeability");
40 
41  if (min_relative_permeability < 0)
42  {
43  OGS_FATAL("Minimal relative permeability must be non-negative.");
44  }
45 
46  return std::make_unique<RelPermUdellNonwettingPhase>(
47  std::move(property_name), residual_liquid_saturation,
48  residual_gas_saturation, min_relative_permeability);
49 }
50 } // 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< RelPermUdellNonwettingPhase > createRelPermUdellNonwettingPhase(BaseLib::ConfigTree const &config)