OGS
CreateOrthotropicEmbeddedFracturePermeability.cpp
Go to the documentation of this file.
1 
11 #include "BaseLib/ConfigTree.h"
13 #include "ParameterLib/Utils.h"
14 
15 namespace MaterialPropertyLib
16 {
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  {
23  OGS_FATAL(
24  "The OrthotropicEmbeddedFracturePermeability is implemented only "
25  "for 2D or 3D problems");
26  }
27 
29  config.checkConfigParameter("type",
30  "OrthotropicEmbeddedFracturePermeability");
31 
32  // Second access for storage.
34  auto property_name = config.peekConfigParameter<std::string>("name");
35 
36  DBUG("Create OrthotropicEmbeddedFracturePermeability medium property");
37 
38  auto const a_i =
40  config.getConfigParameter<std::vector<double>>("mean_frac_distances");
41  if (a_i.size() != 3)
42  {
43  OGS_FATAL(
44  "The size of the mean fracture distances vector must be 3, but is "
45  "{}.",
46  a_i.size());
47  }
48 
49  auto const e_i0 =
51  config.getConfigParameter<std::vector<double>>("threshold_strains");
52  if (e_i0.size() != 3)
53  {
54  OGS_FATAL(
55  "The size of the mean threshold strains vector must be 3, but is "
56  "{}.",
57  e_i0.size());
58  }
59 
60  auto const n =
62  config.getConfigParameter<std::vector<double>>("fracture_normals");
63  if (n.size() != 6)
64  {
65  OGS_FATAL(
66  "The size of the fracture normals vector must be 6, but is {}.",
67  n.size());
68  }
69  Eigen::Vector3d const n1 = Eigen::Vector3d({n[0], n[1], n[2]}).normalized();
70  Eigen::Vector3d const n2 = Eigen::Vector3d({n[3], n[4], n[5]}).normalized();
71 
72  if (n1.dot(n2) > std::numeric_limits<double>::epsilon())
73  {
74  OGS_FATAL(
75  "The given fracture normals are not orthogonal. Please provide two "
76  "orthogonal fracture normals");
77  }
78 
79  Eigen::Matrix3d const n_i =
80  (Eigen::Matrix3d() << n1, n2, n1.cross(n2)).finished();
81 
82  std::string const intrinsic_permeability_param_name =
84  config.getConfigParameter<std::string>("intrinsic_permeability");
85 
86  auto const& k = ParameterLib::findParameter<double>(
87  intrinsic_permeability_param_name, parameters, 0, nullptr);
88 
89  std::string const fracture_rotation_xy_param_name =
91  config.getConfigParameter<std::string>("fracture_rotation_xy");
92 
93  auto const& phi_xy = ParameterLib::findParameter<double>(
94  fracture_rotation_xy_param_name, parameters, 0, nullptr);
95 
96  std::string const fracture_rotation_yz_param_name =
98  config.getConfigParameter<std::string>("fracture_rotation_yz");
99 
100  auto const& phi_yz = ParameterLib::findParameter<double>(
101  fracture_rotation_yz_param_name, parameters, 0, nullptr);
102 
103  if (geometry_dimension == 2)
104  {
105  return std::make_unique<OrthotropicEmbeddedFracturePermeability<2>>(
106  std::move(property_name), a_i, e_i0, n_i, k, phi_xy, phi_yz);
107  }
108  return std::make_unique<OrthotropicEmbeddedFracturePermeability<3>>(
109  std::move(property_name), a_i, e_i0, n_i, k, phi_xy, phi_yz);
110 }
111 } // 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
T getConfigParameter(std::string const &param) const
std::unique_ptr< Property > createOrthotropicEmbeddedFracturePermeability(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)