OGS
CreateSaturationVanGenuchten.cpp
Go to the documentation of this file.
1
11#include "BaseLib/ConfigTree.h"
13
14namespace MaterialPropertyLib
15{
16std::unique_ptr<SaturationVanGenuchten> createSaturationVanGenuchten(
17 BaseLib::ConfigTree const& config)
18{
20 config.checkConfigParameter("type", "SaturationVanGenuchten");
21
22 // Second access for storage.
24 auto property_name = config.peekConfigParameter<std::string>("name");
25
26 DBUG("Create SaturationVanGenuchten medium property {:s}.", property_name);
27
30 config.getConfigParameter<double>("residual_liquid_saturation");
31 auto const residual_gas_saturation =
33 config.getConfigParameter<double>("residual_gas_saturation");
34
35 double pressure_exponent;
36 double saturation_exponent;
37 if (auto const optional_exponent =
39 config.getConfigParameterOptional<double>("exponent"))
40 {
41 pressure_exponent = *optional_exponent;
42 saturation_exponent = 1.0 / (1.0 - pressure_exponent);
43 }
44 else
45 {
46 pressure_exponent =
48 config.getConfigParameter<double>("pressure_exponent");
49 saturation_exponent =
51 config.getConfigParameter<double>("saturation_exponent");
52 }
53
55 auto const p_b = config.getConfigParameter<double>("p_b");
56
57 return std::make_unique<SaturationVanGenuchten>(
58 std::move(property_name), residual_liquid_saturation,
59 residual_gas_saturation, pressure_exponent, saturation_exponent, p_b);
60}
61} // namespace MaterialPropertyLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
T peekConfigParameter(std::string const &param) const
std::optional< T > getConfigParameterOptional(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< SaturationVanGenuchten > createSaturationVanGenuchten(BaseLib::ConfigTree const &config)