OGS
CreateEmbeddedFracturePermeability.cpp
Go to the documentation of this file.
1 
11 #include "BaseLib/ConfigTree.h"
13 #include "ParameterLib/Parameter.h"
14 
15 namespace MaterialPropertyLib
16 {
17 std::unique_ptr<Property> createEmbeddedFracturePermeability(
18  int const geometry_dimension, BaseLib::ConfigTree const& config)
19 {
20  if ((geometry_dimension != 2) && (geometry_dimension != 3))
21  {
22  OGS_FATAL(
23  "The EmbeddedFracturePermeability is implemented only for 2D or 3D "
24  "problems");
25  }
26 
28  config.checkConfigParameter("type", "EmbeddedFracturePermeability");
29 
30  // Second access for storage.
32  auto property_name = config.peekConfigParameter<std::string>("name");
33 
34  DBUG("Create EmbeddedFracturePermeability medium property");
35 
36  auto const k =
38  config.getConfigParameter<double>("intrinsic_permeability");
39 
40  auto const b0 =
42  config.getConfigParameter<double>("initial_aperture");
43 
44  auto const a =
46  config.getConfigParameter<double>("mean_frac_distance");
47 
48  auto const e0 =
50  config.getConfigParameter<double>("threshold_strain");
51 
52  bool n_const = false;
53  Eigen::Matrix<double, 3, 1> n;
54  if (auto const n_ptr =
56  config.getConfigParameterOptional<std::vector<double>>(
57  "fracture_normal"))
58  {
59  if ((*n_ptr).size() != 3)
60  {
61  OGS_FATAL(
62  "The size of the fracture normal vector must be 3, but is %d.",
63  (*n_ptr).size());
64  }
65  DBUG("Using constant fracture normal vector.");
66  std::copy_n((*n_ptr).data(), 3, n.data());
67  n_const = true;
68  n /= n.norm();
69  }
70  else
71  {
72  DBUG(
73  "No constant fracture normal was given. By default it will be "
74  "determined as the third principal stress vector.");
75  }
76 
77  if (geometry_dimension == 2)
78  {
79  return std::make_unique<EmbeddedFracturePermeability<2>>(
80  std::move(property_name), n, n_const, k, b0, a, e0);
81  }
82  return std::make_unique<EmbeddedFracturePermeability<3>>(
83  std::move(property_name), n, n_const, k, b0, a, e0);
84 }
85 } // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition: Error.h:26
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
T peekConfigParameter(std::string const &param) const
void checkConfigParameter(std::string const &param, T const &value) const
std::optional< T > getConfigParameterOptional(std::string const &param) const
T getConfigParameter(std::string const &param) const
std::unique_ptr< Property > createEmbeddedFracturePermeability(int const geometry_dimension, BaseLib::ConfigTree const &config)