OGS
CreateEmbeddedFracturePermeability.cpp
Go to the documentation of this file.
1
11#include "BaseLib/ConfigTree.h"
13#include "ParameterLib/Utils.h"
14
15namespace MaterialPropertyLib
16{
17std::unique_ptr<Property> createEmbeddedFracturePermeability(
18 int const geometry_dimension, BaseLib::ConfigTree const& config,
19 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters)
20{
21 if ((geometry_dimension != 2) && (geometry_dimension != 3))
22 {
24 "The EmbeddedFracturePermeability is implemented only for 2D or 3D "
25 "problems");
26 }
27
29 config.checkConfigParameter("type", "EmbeddedFracturePermeability");
30
31 // Second access for storage.
33 auto property_name = config.peekConfigParameter<std::string>("name");
34
35 DBUG("Create EmbeddedFracturePermeability medium property");
36
37 auto const k =
39 config.getConfigParameter<double>("intrinsic_permeability");
40
41 auto const b0 =
43 config.getConfigParameter<double>("initial_aperture");
44
45 auto const a =
47 config.getConfigParameter<double>("mean_frac_distance");
48
49 auto const e0 =
51 config.getConfigParameter<double>("threshold_strain");
52
53 bool n_const = false;
54 Eigen::Matrix<double, 3, 1> n;
55 if (auto const n_ptr =
57 config.getConfigParameterOptional<std::vector<double>>(
58 "fracture_normal"))
59 {
60 if ((*n_ptr).size() != 3)
61 {
63 "The size of the fracture normal vector must be 3, but is %d.",
64 (*n_ptr).size());
65 }
66 DBUG("Using constant fracture normal vector.");
67 std::copy_n((*n_ptr).data(), 3, n.data());
68 n_const = true;
69 n /= n.norm();
70 }
71 else
72 {
73 DBUG(
74 "No constant fracture normal was given. By default it will be "
75 "determined as the third principal stress vector.");
76 }
77
78 std::string const fracture_rotation_xy_param_name =
80 config.getConfigParameter<std::string>("fracture_rotation_xy");
81
82 auto const& phi_xy = ParameterLib::findParameter<double>(
83 fracture_rotation_xy_param_name, parameters, 0, nullptr);
84
85 std::string const fracture_rotation_yz_param_name =
87 config.getConfigParameter<std::string>("fracture_rotation_yz");
88
89 auto const& phi_yz = ParameterLib::findParameter<double>(
90 fracture_rotation_yz_param_name, parameters, 0, nullptr);
91
92 auto const jf =
94 config.getConfigParameter<double>("jacobian_factor", 0.);
95
96 if (geometry_dimension == 2)
97 {
98 return std::make_unique<EmbeddedFracturePermeability<2>>(
99 std::move(property_name), n, n_const, k, b0, a, e0, phi_xy, phi_yz,
100 jf);
101 }
102 return std::make_unique<EmbeddedFracturePermeability<3>>(
103 std::move(property_name), n, n_const, k, b0, a, e0, phi_xy, phi_yz, jf);
104}
105} // 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
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< Property > createEmbeddedFracturePermeability(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
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