OGS
CreateOrthotropicEmbeddedFracturePermeability.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include <Eigen/Geometry>
5
9
10namespace MaterialPropertyLib
11{
13 int const geometry_dimension, BaseLib::ConfigTree const& config,
14 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters)
15{
16 if ((geometry_dimension != 2) && (geometry_dimension != 3))
17 {
19 "The OrthotropicEmbeddedFracturePermeability is implemented only "
20 "for 2D or 3D problems");
21 }
22
24 config.checkConfigParameter("type",
25 "OrthotropicEmbeddedFracturePermeability");
26
27 // Second access for storage.
29 auto property_name = config.peekConfigParameter<std::string>("name");
30
31 DBUG("Create OrthotropicEmbeddedFracturePermeability medium property");
32
33 auto const a_i =
35 config.getConfigParameter<std::vector<double>>("mean_frac_distances");
36 if (a_i.size() != 3)
37 {
39 "The size of the mean fracture distances vector must be 3, but is "
40 "{}.",
41 a_i.size());
42 }
43
44 auto const e_i0 =
46 config.getConfigParameter<std::vector<double>>("threshold_strains");
47 if (e_i0.size() != 3)
48 {
50 "The size of the mean threshold strains vector must be 3, but is "
51 "{}.",
52 e_i0.size());
53 }
54
55 auto const n =
57 config.getConfigParameter<std::vector<double>>("fracture_normals");
58 if (n.size() != 6)
59 {
61 "The size of the fracture normals vector must be 6, but is {}.",
62 n.size());
63 }
64 Eigen::Vector3d const n1 = Eigen::Vector3d({n[0], n[1], n[2]}).normalized();
65 Eigen::Vector3d const n2 = Eigen::Vector3d({n[3], n[4], n[5]}).normalized();
66
67 if (n1.dot(n2) > std::numeric_limits<double>::epsilon())
68 {
70 "The given fracture normals are not orthogonal. Please provide two "
71 "orthogonal fracture normals");
72 }
73
74 Eigen::Matrix3d const n_i =
75 (Eigen::Matrix3d() << n1, n2, n1.cross(n2)).finished();
76
77 std::string const intrinsic_permeability_param_name =
79 config.getConfigParameter<std::string>("intrinsic_permeability");
80
82 intrinsic_permeability_param_name, parameters, 0, nullptr);
83
84 std::string const fracture_rotation_xy_param_name =
86 config.getConfigParameter<std::string>("fracture_rotation_xy");
87
88 auto const& phi_xy = ParameterLib::findParameter<double>(
89 fracture_rotation_xy_param_name, parameters, 0, nullptr);
90
91 std::string const fracture_rotation_yz_param_name =
93 config.getConfigParameter<std::string>("fracture_rotation_yz");
94
95 auto const& phi_yz = ParameterLib::findParameter<double>(
96 fracture_rotation_yz_param_name, parameters, 0, nullptr);
97
98 auto const jf =
100 config.getConfigParameter<double>("jacobian_factor", 0.);
101
102 if (geometry_dimension == 2)
103 {
104 return std::make_unique<OrthotropicEmbeddedFracturePermeability<2>>(
105 std::move(property_name), a_i, e_i0, n_i, k, phi_xy, phi_yz, jf);
106 }
107 return std::make_unique<OrthotropicEmbeddedFracturePermeability<3>>(
108 std::move(property_name), a_i, e_i0, n_i, k, phi_xy, phi_yz, jf);
109}
110} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:19
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
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 > createOrthotropicEmbeddedFracturePermeability(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)