OGS
CreateRelPermGeneralizedPower.cpp
Go to the documentation of this file.
1
12#include "BaseLib/ConfigTree.h"
14
15namespace MaterialPropertyLib
16{
17std::unique_ptr<RelPermGeneralizedPower> createRelPermGeneralizedPower(
18 BaseLib::ConfigTree const& config)
19{
21 config.checkConfigParameter("type", "RelativePermeabilityGeneralizedPower");
22
23 // Second access for storage.
25 auto property_name = config.peekConfigParameter<std::string>("name");
26
27 DBUG("Create RelPermGeneralizedPower medium property {:s}.", 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 =
37 config.getConfigParameter<double>("min_relative_permeability");
38 double const a =
40 config.getConfigParameter<double>("multiplier", 1);
41 double const lambda =
43 config.getConfigParameter<double>("exponent", 1);
44
45 if (min_relative_permeability < 0)
46 {
47 OGS_FATAL("Minimal relative permeability must be non-negative.");
48 }
49
50 return std::make_unique<RelPermGeneralizedPower>(
51 std::move(property_name), residual_liquid_saturation,
52 residual_gas_saturation, min_relative_permeability, a, lambda);
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< RelPermGeneralizedPower > createRelPermGeneralizedPower(BaseLib::ConfigTree const &config)