OGS
CreateGasPressureDependentPermeability.cpp
Go to the documentation of this file.
1
13
14#include <string>
15
16#include "BaseLib/ConfigTree.h"
17#include "BaseLib/Error.h"
19#include "Parameter.h"
22#include "ParameterLib/Utils.h"
23
24namespace MaterialPropertyLib
25{
27 int const geometry_dimension,
28 BaseLib::ConfigTree const& config,
29 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
30 ParameterLib::CoordinateSystem const* const local_coordinate_system)
31{
32 if ((geometry_dimension != 2) && (geometry_dimension != 3))
33 {
35 "The GasPressureDependentPermeability is implemented only for 2D "
36 "or 3D problems");
37 }
38
40 config.checkConfigParameter("type", "GasPressureDependentPermeability");
41
42 // Second access for storage.
44 auto property_name = config.peekConfigParameter<std::string>("name");
45
46 DBUG("Create GasPressureDependentPermeability property {:s}.",
47 property_name);
48
49 std::string const& parameter_name =
51 config.getConfigParameter<std::string>("initial_permeability");
52 auto const& parameter_k0 = ParameterLib::findParameter<double>(
53 parameter_name, parameters, 0, nullptr);
54
55 auto const a1 =
57 config.getConfigParameter<double>("a1");
58 auto const a2 =
60 config.getConfigParameter<double>("a2");
61 auto const pressure_threshold =
63 config.getConfigParameter<double>("pressure_threshold");
64 auto const minimum_permeability =
66 config.getConfigParameter<double>("minimum_permeability");
67 auto const maximum_permeability =
69 config.getConfigParameter<double>("maximum_permeability");
70
71 if (minimum_permeability > maximum_permeability)
72 {
74 "The value of minimum_permeability of {:e} is larger that the "
75 "value of maximum_permeability of {:e} in "
76 "GasPressureDependentPermeability",
77 minimum_permeability, maximum_permeability);
78 }
79
80 if (geometry_dimension == 2)
81 {
82 return std::make_unique<GasPressureDependentPermeability<2>>(
83 std::move(property_name), parameter_k0, a1, a2, pressure_threshold,
84 minimum_permeability, maximum_permeability,
85 local_coordinate_system);
86 }
87
88 return std::make_unique<GasPressureDependentPermeability<3>>(
89 std::move(property_name), parameter_k0, a1, a2, pressure_threshold,
90 minimum_permeability, maximum_permeability, local_coordinate_system);
91}
92} // 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< Property > createGasPressureDependentPermeability(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const &parameter_name, std::vector< std::unique_ptr< ParameterBase > > const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
Definition Utils.h:102
A local coordinate system used for tensor transformations.