OGS
CreateLiquidViscosityVogels.cpp
Go to the documentation of this file.
1
13
14#include "BaseLib/ConfigTree.h"
17
18namespace MaterialPropertyLib
19{
20std::unique_ptr<Property> createLiquidViscosityVogels(
21 BaseLib::ConfigTree const& config)
22{
24 config.checkConfigParameter("type", "LiquidViscosityVogels");
25 INFO("Using Vogels model, which gives viscosity in SI unit, Pa s");
26
27 // Second access for storage.
29 auto property_name = config.peekConfigParameter<std::string>("name");
30
31 auto const fluid_type =
33 config.peekConfigParameter<std::string>("liquid_type");
34
35 if (fluid_type == "Water")
36 {
38 config.checkConfigParameter("liquid_type", "Water");
39
40 const VogelsViscosityConstantsWater constants;
41 return std::make_unique<
43 std::move(property_name), std::move(constants));
44 }
45 if (fluid_type == "CO2")
46 {
48 config.checkConfigParameter("liquid_type", "CO2");
49 const VogelsViscosityConstantsCO2 constants;
50 return std::make_unique<
52 std::move(property_name), std::move(constants));
53 }
54 if (fluid_type == "CH4")
55 {
57 config.checkConfigParameter("liquid_type", "CH4");
58 const VogelsViscosityConstantsCH4 constants;
59 return std::make_unique<
61 std::move(property_name), std::move(constants));
62 }
64 "The fluid type {:s} for Vogels model is unavailable.\n"
65 "The available fluid types are Water, CO2 and CH4\n",
66 fluid_type.data());
67}
68} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:26
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
T peekConfigParameter(std::string const &param) const
void checkConfigParameter(std::string const &param, std::string_view const value) const
std::unique_ptr< Property > createLiquidViscosityVogels(BaseLib::ConfigTree const &config)