OGS
ProcessLib::LIE::HydroMechanics Namespace Reference

Namespaces

namespace  detail
 

Classes

class  HydroMechanicsLocalAssemblerFracture
 
class  HydroMechanicsLocalAssemblerInterface
 
class  HydroMechanicsLocalAssemblerMatrix
 
class  HydroMechanicsLocalAssemblerMatrixNearFracture
 
class  HydroMechanicsProcess
 
struct  HydroMechanicsProcessData
 
struct  IntegrationPointDataFracture
 
struct  IntegrationPointDataMatrix
 
class  LocalDataInitializer
 
struct  SecondaryData
 Used for the extrapolation of the integration point values. More...
 

Functions

template<int GlobalDim>
std::unique_ptr< ProcesscreateHydroMechanicsProcess (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
 
template std::unique_ptr< ProcesscreateHydroMechanicsProcess< 2 > (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
 
template std::unique_ptr< ProcesscreateHydroMechanicsProcess< 3 > (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
 
template<int GlobalDim, template< typename, typename, int > class LocalAssemblerMatrixImplementation, template< typename, typename, int > class LocalAssemblerMatrixNearFractureImplementation, template< typename, typename, int > class LocalAssemblerFractureImplementation, typename LocalAssemblerInterface , typename... ExtraCtorArgs>
void createLocalAssemblers (std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, NumLib::IntegrationOrder const integration_order, ExtraCtorArgs &&... extra_ctor_args)
 
template<int GlobalDim, typename RotationMatrix >
Eigen::Matrix< double, GlobalDim, GlobalDim > createRotatedTensor (RotationMatrix const &R, double const value)
 

Function Documentation

◆ createHydroMechanicsProcess()

template<int GlobalDim>
std::unique_ptr< Process > ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config )
Input File Parameter
prj__processes__process__type
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__coupling_scheme

Process Variables

Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__process_variables

Primary process variables as they appear in the global component vector:

Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__process_variables__process_variable

Process Parameters

Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__intrinsic_permeability
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__specific_storage
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fluid_viscosity
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fluid_density
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__biot_coefficient
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__porosity
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__solid_density
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__specific_body_force
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_model
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_model__type
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__material_id
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__initial_aperture
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__specific_storage
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__biot_coefficient
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__fracture_properties__permeability_model
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__initial_effective_stress
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__initial_fracture_effective_stress
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__deactivate_matrix_in_flow
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__reference_temperature
Input File Parameter
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__use_b_bar

Definition at line 32 of file CreateHydroMechanicsProcess.cpp.

42{
44 config.checkConfigParameter("type", "HYDRO_MECHANICS_WITH_LIE");
45 DBUG("Create HydroMechanicsProcess with LIE.");
46 auto const coupling_scheme =
48 config.getConfigParameterOptional<std::string>("coupling_scheme");
49 const bool use_monolithic_scheme =
50 !(coupling_scheme && (*coupling_scheme == "staggered"));
51
54 auto const pv_conf = config.getConfigSubtree("process_variables");
56 auto range =
58 pv_conf.getConfigParameterList<std::string>("process_variable");
59 std::vector<std::reference_wrapper<ProcessVariable>> p_u_process_variables;
60 std::vector<std::reference_wrapper<ProcessVariable>> p_process_variables;
61 std::vector<std::reference_wrapper<ProcessVariable>> u_process_variables;
62 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
63 process_variables;
64 for (std::string const& pv_name : range)
65 {
66 if (pv_name != "pressure" && pv_name != "displacement" &&
67 !pv_name.starts_with("displacement_jump"))
68 {
70 "Found a process variable name '{}'. It should be "
71 "'displacement' or 'displacement_jumpN' or 'pressure'",
72 pv_name);
73 }
74 auto variable = std::find_if(variables.cbegin(), variables.cend(),
75 [&pv_name](ProcessVariable const& v)
76 { return v.getName() == pv_name; });
77
78 if (variable == variables.end())
79 {
81 "Could not find process variable '{:s}' in the provided "
82 "variables list for config tag <{:s}>.",
83 pv_name, "process_variable");
84 }
85 DBUG("Found process variable '{:s}' for config tag <{:s}>.",
86 variable->getName(), "process_variable");
87
88 if (pv_name.find("displacement") != std::string::npos &&
89 variable->getNumberOfGlobalComponents() != GlobalDim)
90 {
92 "Number of components of the process variable '{:s}' is "
93 "different from the displacement dimension: got {:d}, expected "
94 "{:d}",
95 variable->getName(),
96 variable->getNumberOfGlobalComponents(),
97 GlobalDim);
98 }
99
100 if (!use_monolithic_scheme)
101 {
102 if (pv_name == "pressure")
103 {
104 p_process_variables.emplace_back(
105 const_cast<ProcessVariable&>(*variable));
106 }
107 else
108 {
109 u_process_variables.emplace_back(
110 const_cast<ProcessVariable&>(*variable));
111 }
112 }
113 else
114 {
115 p_u_process_variables.emplace_back(
116 const_cast<ProcessVariable&>(*variable));
117 }
118 }
119
120 if (p_u_process_variables.size() > 3 || u_process_variables.size() > 2)
121 {
122 OGS_FATAL("Currently only one displacement jump is supported");
123 }
124
125 if (!use_monolithic_scheme)
126 {
127 process_variables.push_back(std::move(p_process_variables));
128 process_variables.push_back(std::move(u_process_variables));
129 }
130 else
131 {
132 process_variables.push_back(std::move(p_u_process_variables));
133 }
134
136 auto solid_constitutive_relations =
138 parameters, local_coordinate_system, materialIDs(mesh), config);
139
140 // Intrinsic permeability
141 auto& intrinsic_permeability = ParameterLib::findParameter<double>(
142 config,
144 "intrinsic_permeability", parameters, 1, &mesh);
145
146 DBUG("Use '{:s}' as intrinsic permeability parameter.",
147 intrinsic_permeability.name);
148
149 // Storage coefficient
150 auto& specific_storage = ParameterLib::findParameter<double>(
151 config,
153 "specific_storage", parameters, 1, &mesh);
154
155 DBUG("Use '{:s}' as specific storage parameter.", specific_storage.name);
156
157 // Fluid viscosity
159 config,
161 "fluid_viscosity", parameters, 1, &mesh);
162 DBUG("Use '{:s}' as fluid viscosity parameter.", fluid_viscosity.name);
163
164 // Fluid density
166 config,
168 "fluid_density", parameters, 1, &mesh);
169 DBUG("Use '{:s}' as fluid density parameter.", fluid_density.name);
170
171 // Biot coefficient
173 config,
175 "biot_coefficient", parameters, 1, &mesh);
176 DBUG("Use '{:s}' as Biot coefficient parameter.", biot_coefficient.name);
177
178 // Porosity
180 config,
182 "porosity", parameters, 1, &mesh);
183 DBUG("Use '{:s}' as porosity parameter.", porosity.name);
184
185 // Solid density
186 auto& solid_density = ParameterLib::findParameter<double>(
187 config,
189 "solid_density", parameters, 1, &mesh);
190 DBUG("Use '{:s}' as solid density parameter.", solid_density.name);
191
192 // Specific body force
193 Eigen::Matrix<double, GlobalDim, 1> specific_body_force;
194 {
195 std::vector<double> const b =
197 config.getConfigParameter<std::vector<double>>(
198 "specific_body_force");
199 if (b.size() != GlobalDim)
200 {
201 OGS_FATAL(
202 "The size of the specific body force vector does not match the "
203 "displacement dimension. Vector size is {:d}, displacement "
204 "dimension is {:d}",
205 b.size(), GlobalDim);
206 }
207
208 std::copy_n(b.data(), b.size(), specific_body_force.data());
209 }
210
211 // Fracture constitutive relation.
212 std::unique_ptr<MaterialLib::Fracture::FractureModelBase<GlobalDim>>
213 fracture_model = nullptr;
214 auto const opt_fracture_model_config =
216 config.getConfigSubtreeOptional("fracture_model");
217 if (opt_fracture_model_config)
218 {
219 auto& fracture_model_config = *opt_fracture_model_config;
220
221 auto const frac_type =
223 fracture_model_config.peekConfigParameter<std::string>("type");
224
225 if (frac_type == "LinearElasticIsotropic")
226 {
227 fracture_model =
229 parameters, fracture_model_config);
230 }
231 else if (frac_type == "Coulomb")
232 {
234 parameters, fracture_model_config);
235 }
236 else if (frac_type == "CohesiveZoneModeI")
237 {
240 fracture_model_config);
241 }
242 else
243 {
244 OGS_FATAL(
245 "Cannot construct fracture constitutive relation of given type "
246 "'{:s}'.",
247 frac_type);
248 }
249 }
250
251 // Fracture properties
252 std::unique_ptr<FracturePropertyHM> frac_prop = nullptr;
253 auto opt_fracture_properties_config =
255 config.getConfigSubtreeOptional("fracture_properties");
256 if (opt_fracture_properties_config)
257 {
258 auto& fracture_properties_config = *opt_fracture_properties_config;
259
260 frac_prop = std::make_unique<ProcessLib::LIE::FracturePropertyHM>(
261 0 /*fracture_id*/,
263 fracture_properties_config.getConfigParameter<int>("material_id"),
266 fracture_properties_config, "initial_aperture", parameters, 1,
267 &mesh),
270 fracture_properties_config, "specific_storage", parameters, 1,
271 &mesh),
274 fracture_properties_config, "biot_coefficient", parameters, 1,
275 &mesh));
276 if (frac_prop->aperture0.isTimeDependent())
277 {
278 OGS_FATAL(
279 "The initial aperture parameter '{:s}' must not be "
280 "time-dependent.",
281 frac_prop->aperture0.name);
282 }
283
284 auto permeability_model_config =
286 fracture_properties_config.getConfigSubtree("permeability_model");
287 frac_prop->permeability_model =
289 permeability_model_config);
290 }
291
292 // initial effective stress in matrix
293 auto& initial_effective_stress = ParameterLib::findParameter<double>(
294 config,
296 "initial_effective_stress", parameters,
298 DBUG("Use '{:s}' as initial effective stress parameter.",
299 initial_effective_stress.name);
300
301 // initial effective stress in fracture
302 auto& initial_fracture_effective_stress = ParameterLib::findParameter<
303 double>(
304 config,
306 "initial_fracture_effective_stress", parameters, GlobalDim, &mesh);
307 DBUG("Use '{:s}' as initial fracture effective stress parameter.",
308 initial_fracture_effective_stress.name);
309
310 // deactivation of matrix elements in flow
311 auto opt_deactivate_matrix_in_flow =
313 config.getConfigParameterOptional<bool>("deactivate_matrix_in_flow");
314 bool const deactivate_matrix_in_flow =
315 opt_deactivate_matrix_in_flow && *opt_deactivate_matrix_in_flow;
316 ;
317 if (deactivate_matrix_in_flow)
318 INFO("Deactivate matrix elements in flow calculation.");
319
320 // Reference temperature
321 const auto& reference_temperature =
323 config.getConfigParameter<double>(
324 "reference_temperature", std::numeric_limits<double>::quiet_NaN());
325
327 auto const use_b_bar = config.getConfigParameter<bool>("use_b_bar", false);
328
329 HydroMechanicsProcessData<GlobalDim> process_data{
330 materialIDs(mesh),
331 std::move(solid_constitutive_relations),
332 intrinsic_permeability,
333 specific_storage,
337 porosity,
338 solid_density,
339 specific_body_force,
340 std::move(fracture_model),
341 std::move(frac_prop),
342 initial_effective_stress,
343 initial_fracture_effective_stress,
344 deactivate_matrix_in_flow,
346 use_b_bar};
347
348 SecondaryVariableCollection secondary_variables;
349
350 ProcessLib::createSecondaryVariables(config, secondary_variables);
351
352 return std::make_unique<HydroMechanicsProcess<GlobalDim>>(
353 std::move(name), mesh, std::move(jacobian_assembler), parameters,
354 integration_order, std::move(process_variables),
355 std::move(process_data), std::move(secondary_variables),
356 use_monolithic_scheme);
357}
#define OGS_FATAL(...)
Definition Error.h:26
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::unique_ptr< FractureModelBase< DisplacementDim > > createCohesiveZoneModeI(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
std::unique_ptr< Permeability > createPermeabilityModel(BaseLib::ConfigTree const &config)
std::unique_ptr< FractureModelBase< DisplacementDim > > createLinearElasticIsotropic(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
std::unique_ptr< FractureModelBase< DisplacementDim > > createCoulomb(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > createConstitutiveRelations(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition Mesh.cpp:268
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
double fluid_viscosity(const double p, const double T, const double x)
double fluid_density(const double p, const double T, const double x)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)

References BaseLib::ConfigTree::checkConfigParameter(), MaterialLib::Fracture::CohesiveZoneModeI::createCohesiveZoneModeI(), MaterialLib::Solids::createConstitutiveRelations(), MaterialLib::Fracture::createCoulomb(), MaterialLib::Fracture::createLinearElasticIsotropic(), MaterialLib::Fracture::Permeability::createPermeabilityModel(), ProcessLib::createSecondaryVariables(), DBUG(), ParameterLib::findParameter(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterList(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeOptional(), INFO(), MathLib::KelvinVector::kelvin_vector_dimensions(), and OGS_FATAL.

◆ createHydroMechanicsProcess< 2 >()

template std::unique_ptr< Process > ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess< 2 > ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config )

◆ createHydroMechanicsProcess< 3 >()

template std::unique_ptr< Process > ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess< 3 > ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config )

◆ createLocalAssemblers()

template<int GlobalDim, template< typename, typename, int > class LocalAssemblerMatrixImplementation, template< typename, typename, int > class LocalAssemblerMatrixNearFractureImplementation, template< typename, typename, int > class LocalAssemblerFractureImplementation, typename LocalAssemblerInterface , typename... ExtraCtorArgs>
void ProcessLib::LIE::HydroMechanics::createLocalAssemblers ( std::vector< MeshLib::Element * > const & mesh_elements,
NumLib::LocalToGlobalIndexMap const & dof_table,
std::vector< std::unique_ptr< LocalAssemblerInterface > > & local_assemblers,
NumLib::IntegrationOrder const integration_order,
ExtraCtorArgs &&... extra_ctor_args )

Creates local assemblers for each element of the given mesh.

Template Parameters
LocalAssemblerImplementationthe individual local assembler type
LocalAssemblerInterfacethe general local assembler interface
ExtraCtorArgstypes of additional constructor arguments. Those arguments will be passed to the constructor of LocalAssemblerImplementation.

The first two template parameters cannot be deduced from the arguments. Therefore they always have to be provided manually.

Definition at line 80 of file CreateLocalAssemblers.h.

86{
87 detail::createLocalAssemblers<
88 GlobalDim, LocalAssemblerMatrixImplementation,
89 LocalAssemblerMatrixNearFractureImplementation,
90 LocalAssemblerFractureImplementation>(
91 dof_table, mesh_elements, local_assemblers, integration_order,
92 std::forward<ExtraCtorArgs>(extra_ctor_args)...);
93}

References ProcessLib::LIE::HydroMechanics::detail::createLocalAssemblers().

Referenced by ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::initializeConcreteProcess().

◆ createRotatedTensor()

template<int GlobalDim, typename RotationMatrix >
Eigen::Matrix< double, GlobalDim, GlobalDim > ProcessLib::LIE::HydroMechanics::createRotatedTensor ( RotationMatrix const & R,
double const value )

Definition at line 28 of file HydroMechanicsLocalAssemblerFracture-impl.h.

30{
31 using M = Eigen::Matrix<double, GlobalDim, GlobalDim>;
32 M tensor = M::Zero();
33 tensor.diagonal().head(GlobalDim - 1).setConstant(value);
34 return (R.transpose() * tensor * R).eval();
35}