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, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
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, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
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, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
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,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )
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__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__initial_aperture
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__use_b_bar

Definition at line 38 of file CreateHydroMechanicsProcess.cpp.

49{
51 config.checkConfigParameter("type", "HYDRO_MECHANICS_WITH_LIE");
52 DBUG("Create HydroMechanicsProcess with LIE.");
53 auto const coupling_scheme =
55 config.getConfigParameterOptional<std::string>("coupling_scheme");
56 const bool use_monolithic_scheme =
57 !(coupling_scheme && (*coupling_scheme == "staggered"));
58
61 auto const pv_conf = config.getConfigSubtree("process_variables");
63 auto range =
65 pv_conf.getConfigParameterList<std::string>("process_variable");
66 std::vector<std::reference_wrapper<ProcessVariable>> p_u_process_variables;
67 std::vector<std::reference_wrapper<ProcessVariable>> p_process_variables;
68 std::vector<std::reference_wrapper<ProcessVariable>> u_process_variables;
69 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
70 process_variables;
71 for (std::string const& pv_name : range)
72 {
73 if (pv_name != "pressure" && pv_name != "displacement" &&
74 !pv_name.starts_with("displacement_jump"))
75 {
77 "Found a process variable name '{}'. It should be "
78 "'displacement' or 'displacement_jumpN' or 'pressure'",
79 pv_name);
80 }
81 auto variable = std::find_if(variables.cbegin(), variables.cend(),
82 [&pv_name](ProcessVariable const& v)
83 { return v.getName() == pv_name; });
84
85 if (variable == variables.end())
86 {
88 "Could not find process variable '{:s}' in the provided "
89 "variables list for config tag <{:s}>.",
90 pv_name, "process_variable");
91 }
92 DBUG("Found process variable '{:s}' for config tag <{:s}>.",
93 variable->getName(), "process_variable");
94
95 if (pv_name.find("displacement") != std::string::npos &&
96 variable->getNumberOfGlobalComponents() != GlobalDim)
97 {
99 "Number of components of the process variable '{:s}' is "
100 "different from the displacement dimension: got {:d}, expected "
101 "{:d}",
102 variable->getName(),
103 variable->getNumberOfGlobalComponents(),
104 GlobalDim);
105 }
106
107 if (!use_monolithic_scheme)
108 {
109 if (pv_name == "pressure")
110 {
111 p_process_variables.emplace_back(
112 const_cast<ProcessVariable&>(*variable));
113 }
114 else
115 {
116 u_process_variables.emplace_back(
117 const_cast<ProcessVariable&>(*variable));
118 }
119 }
120 else
121 {
122 p_u_process_variables.emplace_back(
123 const_cast<ProcessVariable&>(*variable));
124 }
125 }
126
127 if (p_u_process_variables.size() > 3 || u_process_variables.size() > 2)
128 {
129 OGS_FATAL("Currently only one displacement jump is supported");
130 }
131
132 if (!use_monolithic_scheme)
133 {
134 process_variables.push_back(std::move(p_process_variables));
135 process_variables.push_back(std::move(u_process_variables));
136 }
137 else
138 {
139 process_variables.push_back(std::move(p_u_process_variables));
140 }
141
143 auto solid_constitutive_relations =
145 parameters, local_coordinate_system, materialIDs(mesh), config);
146
147 // Specific body force
148 Eigen::Matrix<double, GlobalDim, 1> specific_body_force;
149 {
150 std::vector<double> const b =
152 config.getConfigParameter<std::vector<double>>(
153 "specific_body_force");
154 if (b.size() != GlobalDim)
155 {
156 OGS_FATAL(
157 "The size of the specific body force vector does not match the "
158 "displacement dimension. Vector size is {:d}, displacement "
159 "dimension is {:d}",
160 b.size(), GlobalDim);
161 }
162
163 std::copy_n(b.data(), b.size(), specific_body_force.data());
164 }
165
166 // Fracture constitutive relation.
167 std::unique_ptr<MaterialLib::Fracture::FractureModelBase<GlobalDim>>
168 fracture_model = nullptr;
169 auto const opt_fracture_model_config =
171 config.getConfigSubtreeOptional("fracture_model");
172 if (opt_fracture_model_config)
173 {
174 auto& fracture_model_config = *opt_fracture_model_config;
175
176 auto const frac_type =
178 fracture_model_config.peekConfigParameter<std::string>("type");
179
180 if (frac_type == "LinearElasticIsotropic")
181 {
182 fracture_model =
184 parameters, fracture_model_config);
185 }
186 else if (frac_type == "Coulomb")
187 {
189 parameters, fracture_model_config);
190 }
191 else if (frac_type == "CohesiveZoneModeI")
192 {
195 fracture_model_config);
196 }
197 else
198 {
199 OGS_FATAL(
200 "Cannot construct fracture constitutive relation of given type "
201 "'{:s}'.",
202 frac_type);
203 }
204 }
205
206 // Fracture properties
207 std::unique_ptr<FractureProperty> frac_prop = nullptr;
208 auto opt_fracture_properties_config =
210 config.getConfigSubtreeOptional("fracture_properties");
211 if (opt_fracture_properties_config)
212 {
213 auto& fracture_properties_config = *opt_fracture_properties_config;
214
215 frac_prop = std::make_unique<ProcessLib::LIE::FractureProperty>(
216 0 /*fracture_id*/, 0 /*material_id*/,
219 fracture_properties_config, "initial_aperture", parameters, 1,
220 &mesh));
221 if (frac_prop->aperture0.isTimeDependent())
222 {
223 OGS_FATAL(
224 "The initial aperture parameter '{:s}' must not be "
225 "time-dependent.",
226 frac_prop->aperture0.name);
227 }
228 }
229
230 // initial effective stress in matrix
231 auto& initial_effective_stress = ParameterLib::findParameter<double>(
232 config,
234 "initial_effective_stress", parameters,
236 DBUG("Use '{:s}' as initial effective stress parameter.",
237 initial_effective_stress.name);
238
239 // initial effective stress in fracture
240 auto& initial_fracture_effective_stress = ParameterLib::findParameter<
241 double>(
242 config,
244 "initial_fracture_effective_stress", parameters, GlobalDim, &mesh);
245 DBUG("Use '{:s}' as initial fracture effective stress parameter.",
246 initial_fracture_effective_stress.name);
247
248 // deactivation of matrix elements in flow
249 auto opt_deactivate_matrix_in_flow =
251 config.getConfigParameterOptional<bool>("deactivate_matrix_in_flow");
252 bool const deactivate_matrix_in_flow =
253 opt_deactivate_matrix_in_flow && *opt_deactivate_matrix_in_flow;
254 ;
255 if (deactivate_matrix_in_flow)
256 INFO("Deactivate matrix elements in flow calculation.");
257
259 auto const use_b_bar = config.getConfigParameter<bool>("use_b_bar", false);
260
261 auto media_map =
263
264 std::array const requiredMediumProperties = {
268 std::array const requiredFluidProperties = {MaterialPropertyLib::viscosity,
270 std::array const requiredSolidProperties = {MaterialPropertyLib::density};
271
273
274 for (auto const& medium : media_map.media())
275 {
276 checkRequiredProperties(*medium, requiredMediumProperties);
277 checkRequiredProperties(fluidPhase(*medium), requiredFluidProperties);
278 checkRequiredProperties(medium->phase("Solid"),
279 requiredSolidProperties);
280 }
281
282 // Check whether fracture permeability is given as a scalar value.
283 for (auto const& element_id : mesh.getElements() | MeshLib::views::ids)
284 {
285 media_map.checkElementHasMedium(element_id);
286 auto const& medium = *media_map.getMedium(element_id);
287
288 // For fracture element
289 if (mesh.getElement(element_id)->getDimension() != GlobalDim)
290 {
293 auto const permeability =
295 .value(variables, x_position, 0.0 /*t*/, 0.0 /*dt*/);
296 if (!std::holds_alternative<double>(permeability))
297 {
298 OGS_FATAL(
299 "The permeability model for the fracture must be "
300 "isotropic, and it must return a scalar value.");
301 }
302 }
303 }
304
305 HydroMechanicsProcessData<GlobalDim> process_data{
306 materialIDs(mesh), std::move(solid_constitutive_relations),
307 std::move(media_map), specific_body_force,
308 std::move(fracture_model), std::move(frac_prop),
309 initial_effective_stress, initial_fracture_effective_stress,
310 deactivate_matrix_in_flow, use_b_bar};
311
312 SecondaryVariableCollection secondary_variables;
313
314 ProcessLib::createSecondaryVariables(config, secondary_variables);
315
316 return std::make_unique<HydroMechanicsProcess<GlobalDim>>(
317 std::move(name), mesh, std::move(jacobian_assembler), parameters,
318 integration_order, std::move(process_variables),
319 std::move(process_data), std::move(secondary_variables),
320 use_monolithic_scheme);
321}
#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
virtual constexpr unsigned getDimension() const =0
Get dimension of the mesh element.
const Element * getElement(std::size_t idx) const
Get the element with the given index.
Definition Mesh.h:94
std::unique_ptr< FractureModelBase< DisplacementDim > > createCohesiveZoneModeI(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, 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)
void checkMPLPhasesForSinglePhaseFlow(MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map)
void checkRequiredProperties(Component const &c, std::span< PropertyType const > const required_properties)
Definition Component.cpp:60
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
Phase const & fluidPhase(Medium const &medium)
Returns a gas or aqueous liquid phase of the given medium.
Definition Medium.cpp:100
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
constexpr ranges::views::view_closure ids
For an element of a range view return its id.
Definition Mesh.h:225
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
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)

References MaterialPropertyLib::biot_coefficient, BaseLib::ConfigTree::checkConfigParameter(), MaterialPropertyLib::checkMPLPhasesForSinglePhaseFlow(), MaterialLib::Fracture::CohesiveZoneModeI::createCohesiveZoneModeI(), MaterialLib::Solids::createConstitutiveRelations(), MaterialLib::Fracture::createCoulomb(), MaterialLib::Fracture::createLinearElasticIsotropic(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), ProcessLib::createSecondaryVariables(), DBUG(), MaterialPropertyLib::density, ParameterLib::findParameter(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterList(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeOptional(), MeshLib::Element::getDimension(), MeshLib::Mesh::getElement(), MeshLib::Mesh::getElements(), MeshLib::views::ids, INFO(), MathLib::KelvinVector::kelvin_vector_dimensions(), OGS_FATAL, MaterialPropertyLib::permeability, MaterialPropertyLib::reference_temperature, and MaterialPropertyLib::viscosity.

◆ 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,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )

◆ 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,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )

◆ 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 32 of file HydroMechanicsLocalAssemblerFracture-impl.h.

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