OGS
CreateRelPermUdellNonwettingPhase.cpp
Go to the documentation of this file.
1
12#include "BaseLib/ConfigTree.h"
14
15namespace MaterialPropertyLib
16{
17std::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
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(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< RelPermUdellNonwettingPhase > createRelPermUdellNonwettingPhase(BaseLib::ConfigTree const &config)