OGS
ProcessLib::LIE::HydroMechanics Namespace Reference

Namespaces

 detail
 

Classes

class  HydroMechanicsProcess
 
struct  HydroMechanicsProcessData
 
class  HydroMechanicsLocalAssemblerFracture
 
class  HydroMechanicsLocalAssemblerInterface
 
class  HydroMechanicsLocalAssemblerMatrix
 
class  HydroMechanicsLocalAssemblerMatrixNearFracture
 
struct  IntegrationPointDataFracture
 
struct  IntegrationPointDataMatrix
 
class  LocalDataInitializer
 

Functions

template<int GlobalDim>
std::unique_ptr< ProcesscreateHydroMechanicsProcess (std::string 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 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 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  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

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.find("displacement_jump") != 0)
68  {
69  OGS_FATAL(
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  {
80  OGS_FATAL(
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  {
91  OGS_FATAL(
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 =
137  MaterialLib::Solids::createConstitutiveRelations<GlobalDim>(
138  parameters, local_coordinate_system, 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
158  auto& fluid_viscosity = ParameterLib::findParameter<double>(
159  config,
161  "fluid_viscosity", parameters, 1, &mesh);
162  DBUG("Use '{:s}' as fluid viscosity parameter.", fluid_viscosity.name);
163 
164  // Fluid density
165  auto& fluid_density = ParameterLib::findParameter<double>(
166  config,
168  "fluid_density", parameters, 1, &mesh);
169  DBUG("Use '{:s}' as fluid density parameter.", fluid_density.name);
170 
171  // Biot coefficient
172  auto& biot_coefficient = ParameterLib::findParameter<double>(
173  config,
175  "biot_coefficient", parameters, 1, &mesh);
176  DBUG("Use '{:s}' as Biot coefficient parameter.", biot_coefficient.name);
177 
178  // Porosity
179  auto& porosity = ParameterLib::findParameter<double>(
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 =
228  MaterialLib::Fracture::createLinearElasticIsotropic<GlobalDim>(
229  parameters, fracture_model_config);
230  }
231  else if (frac_type == "Coulomb")
232  {
233  fracture_model = MaterialLib::Fracture::createCoulomb<GlobalDim>(
234  parameters, fracture_model_config);
235  }
236  else if (frac_type == "CohesiveZoneModeI")
237  {
238  fracture_model = MaterialLib::Fracture::CohesiveZoneModeI::
239  createCohesiveZoneModeI<GlobalDim>(parameters,
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"),
264  ParameterLib::findParameter<double>(
266  fracture_properties_config, "initial_aperture", parameters, 1,
267  &mesh),
268  ParameterLib::findParameter<double>(
270  fracture_properties_config, "specific_storage", parameters, 1,
271  &mesh),
272  ParameterLib::findParameter<double>(
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 
326  HydroMechanicsProcessData<GlobalDim> process_data{
327  materialIDs(mesh),
328  std::move(solid_constitutive_relations),
329  intrinsic_permeability,
330  specific_storage,
334  porosity,
335  solid_density,
336  specific_body_force,
337  std::move(fracture_model),
338  std::move(frac_prop),
339  initial_effective_stress,
340  initial_fracture_effective_stress,
341  deactivate_matrix_in_flow,
343 
344  SecondaryVariableCollection secondary_variables;
345 
346  ProcessLib::createSecondaryVariables(config, secondary_variables);
347 
348  return std::make_unique<HydroMechanicsProcess<GlobalDim>>(
349  std::move(name), mesh, std::move(jacobian_assembler), parameters,
350  integration_order, std::move(process_variables),
351  std::move(process_data), std::move(secondary_variables),
352  use_monolithic_scheme);
353 }
#define OGS_FATAL(...)
Definition: Error.h:26
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:34
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:29
std::unique_ptr< Permeability > createPermeabilityModel(BaseLib::ConfigTree const &config)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
Definition: KelvinVector.h:24
static const double v
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition: Mesh.cpp:264
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 MaterialPropertyLib::biot_coefficient, BaseLib::ConfigTree::checkConfigParameter(), MaterialLib::Fracture::Permeability::createPermeabilityModel(), ProcessLib::createSecondaryVariables(), DBUG(), ParameterLib::findParameter(), ProcessLib::TES::fluid_density(), ProcessLib::TES::fluid_viscosity(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterList(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeOptional(), INFO(), MathLib::KelvinVector::kelvin_vector_dimensions(), MeshLib::materialIDs(), MaterialPropertyLib::name, OGS_FATAL, MaterialPropertyLib::reference_temperature, and MathLib::v.

◆ createHydroMechanicsProcess< 2 >()

template std::unique_ptr<Process> ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess< 2 > ( std::string  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  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 82 of file CreateLocalAssemblers.h.

88 {
90  GlobalDim, LocalAssemblerMatrixImplementation,
91  LocalAssemblerMatrixNearFractureImplementation,
92  LocalAssemblerFractureImplementation>(
93  dof_table, mesh_elements, local_assemblers, integration_order,
94  std::forward<ExtraCtorArgs>(extra_ctor_args)...);
95 }
void createLocalAssemblers(const unsigned dimension, 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)

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

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