Code Descriptions

The FFS method (see Sect. 10.1007/978-3-030-61909-1_3) was developed to simulate direct shear tests. To provide a tool for the project work and get things easier done a graphical user interface (GUI) was also created. The GUI simply calls all necessary functions by letting the user either fill form fields or choose input files from the working folder. The rock parameters and the conditions of the direct shear test with the normal stress levels and shear displacements have to be selected. If an experiment is simulated the lab results can be selected as a text file so a visual comparison is possible. The geometry has to be loaded as a point cloud or an artificial surface can be generated. With small modifications the code can do multiple executions using artificial surfaces.


LEM-Lattice-Element-Method
The lattice element method (LEM) is a well-known model for the simulation of the fracture in the cemented geomaterial and concrete. In comparison to the discrete element method (DEM), where the contact search and contact mechanics are implemented, the LEM represents the medium with a series of spring or beam elements to simulate the fracking process. The considered LEM in this study is fully developed in Kiel University (CAU Kiel) and is implemented in various engineering applications. In earlier studies, the application of LEM was restricted to fracture simulation in concrete, where the heterogeneity was introduced with defining the aggregates, mortar and interface bond zone [1][2][3]. With the development of LEM its application is extended to failure behavior of cemented geomaterials such as bio-cemented granular material [4]. The LEM is also used to simulate the fracture under dynamic loading for the foam concrete [5], masonry walls [6] and cemented geomaterial [7,8]. Figure 7.2 depicts the coupled THM processes and affected geomaterial parameters, which are implemented in LEM algorithm.
In its recent application, the evaluation of effective properties in shallow crustal rock is investigated [9]. The developed in-house LEM model is applied for the simulation of the heat transfer in modified granular material and assessment of effective thermal conductivity [10][11][12][13] as well as the Nano geocomposites [14]. The thermomechanical LEM model is implemented to simulate the change of the thermal conduc-  [15]. With an integration of the interface element, the LEM is able to simulate the fully coupled TM processes in cemented geomaterial [16]. The application of LEM is extended to model the hydromechanical processes [17,18]. In these models, the dual lattice setup is considered, where lattice elements transfer the mechanical loads between the nodes and conduct elements only carry the fluid flow. Similar to DEM models [19], the LEM is extended to simulate the shrinkage and swelling processes in rock material. In the scope of this study, the LEM is also used for the simulation of pressurized percolation tests in rock material. In this model, the mass conservation law is implemented and artificial cavities for fluid or gas transport are defined. In CAU Kiel, we are devoted to continue the development of the LEM and overcome its application limitations. In this sense, the parallel computing for computing efficiency is under process and development. The ongoing work incorporate the plasticity, visco-plasticity, flow, hardening, fatigue and creep rules to establish a constitutive lattice model, which can be implemented in the practical applications to simulate the geomaterial response under the coupled THM processes.

SPH-Smoothed-Particle-Hydrodynamics
The (explicit) discrete nodal formulation of the Navier-Stokes equations basically results in computations of loops over all considered particles and for each additional nested loops over neighbouring particles. On the one hand, this circumstance renders SPH a computationally demanding method, on the other hand, the parallelization of this structure assembled from subroutines is quite generic on CPUs and even GPUs.
Despite the Lagrangian character and the meshfree formulation, SPH codes can be compared to collocation methods resulting in particle-particle interactions (linear algebra operations) similar to explicit particle codes like Molecular Dynamics (MD) or Discrete Element Methods (DEM). Thus, they exhibit the same challenges as these explicit particle codes: for the calculating of the particle interactions, data from neigbouring particles is needed, and memory access and load balancing is unstructured. The neighbour search algorithm is most expensive and considerable communication as well as data migration between processors is necessary. Therefore the presented SPH formulation is implemented on top of the highly optimized and MPI-parallelized HOOMD-blue library developed by the Glotzer group at the University of Michigan, USA [20,21]. This general purpose particle simulation toolkit, initially developed for MD, comes with MPI-based spatial domain decomposition, demonstrated weak and strong scalability for both, GPU-and CPU-accelerated HPC clusters, heuristic load balancing, algorithms for neigbour search and sorting methods to ensure optimal memory access patterns. The HOOMD-Blue software package is employed in a large selection of research areas, cf. the mentioned homepage. It is open-source, published under a BSD 3-clause license and a and comprehensive documentation is available. Recently, weak and strong scaling tests of fluid flow through porous media has been investigated on CPU-and GPU-HPC platforms, [22]. The implemented SPH model [23] includes both, CUDA and MPI features and uses the above mentioned advantages. Setup of the boundary value problem and initialisation of the geometry and particle data is implemented as user-friendly Python scripts. The main implementation are programmed in C++ and CUDA. This comprises among other things the evaluation of the kernel, the computation of density rate, pressure fields and particle accelerations as well as the time integration. Besides single-phase flow models based on the Navier-Stokes equations [24], multi-phase flow models of two immiscible fluids including surface tension has been investigated [25] as well as suspension-flow of a Newtonian/non-Newtonian carrier fluid and solid non-colloidal particles [26].

OpenGeoSys-Finite-Element-Method
OpenGeoSys (OGS) is a scientific open-source initiative for the numerical simulation of thermo-hydro-mechanical/chemical (THMC) processes in porous and fractured media, inspired by FEFLOW [27] and ROCKFLOW concepts and continuously developed since the mid-eighties (Fig. 7.3), see e.g. [28][29][30][31]. Meanwhile, more than 50 PhD projects have been dedicated to the OGS development since the merger in the nineties.
The OGS framework is targeting applications of various disciplines in environmental geoscience, e.g., in the fields of regional  [40,41]. OGS is also used in fundamental studies for nuclear waste management [42].
The most recent version, OpenGeoSys-6 (OGS-6) [43,44], is a complete reimplementation of the multi-physics code OpenGeoSys-4/5 [45,46] using advanced methods in software engineering and architecture with a focus on code quality, modularity, performance and comprehensive documentation. The current release version OpenGeoSys 6.2.0 [47] will be dedicated to analyze and predict the behaviour of geosystems becoming more and more relevant in future like nuclear waste deposition, geothermal use of subsurface resources for power and heat production, and geological storage of various energy carriers. Particular emphasis is put on the implementation of advanced numerical methods for the propagation of discontinuities, such as enriched finite element function spaces [48], non-local formulations [49] and phase-field models for fracture [50] with the ability to utilize HPC platforms [51,52].

VPF-Variational Phase-Field model
The variational phase-field model (V-pf) is increasingly becoming a popular numerical method for fracture computation because of its ability to account for arbitrary numbers of pre-existing or propagating cracks in terms of energy minimization, without any a priori assumption on their geometry or restriction on the growth to specific grid directions. The variational phase-field model applied in this study has been based on the model proposed by [59,60] where each process (e.g. mechanical or hydraulic) is solved in a staggered manner as in Fig. 7.4 and has been implemented in OGS utilizing its linear algebraic and finite element method platform. The mechanical process solves the force equilibrium under the presence of the crack (damage) field in which the damage is accounted differently depending on the state of the load (e.g. compression or tension) in order to distinguish the material's response under different types of loading. Various approaches have been proposed for the energy split strategy and the three of the most established approaches [61][62][63] have been implemented. Though the process for the phase-field is an elliptic problem, the solution space is bounded in [0, 1] and is constrained by the irreversibility (i.e. fracture is not allowed to heal). Therefore, its solution requires a variational inequality solver and it is achieved through PETSc [64,65]. Once the displacement and the phase-field are solved, the crack opening displacement will be reconstructed following an approximation proposed by [66] and the computation result will be passed onto the hydro process where fluid flows both in porous medium and fracture will be solved. These processes will be repeated in a staggered manner until the convergence is met (currently its judgement is based on the phase-field process).

HDF-Hybrid-Dimensional-Formulation
The Hybrid-Dimensional-Formulation results in a numerically strongly coupled system of governing equations. Different numerical strategies, namely the weak/ staggered and strong/monolithic coupling schemes have been implemented in course of this project to solve the interaction between fluid flow and deformation of the surrounding porous matrix. Dependent on the method different technical requirements are demanded from the numerical framework. Hence for each one of the two cou- pling strategies an individual numerical framework has been chosen to guarantee numerical efficiency (Fig. 7.5).
For the strongly coupled scheme high performance has been ensured by choosing the Distributed and Unified Numerics Environment (DUNE) [67] to monolithically build and solve the global system of governing equations. The Dune implementation is based on modern C++ programming techniques to provide a unique combination of highly efficient and flexible code by providing a common interface at a very low overhead for various mesh based methods. Combined with the generalized discretization module PDELab [68] the basis for Finite Element calculations of the implemented solver has been built. Nevertheless, extensive work on the existing framework has been performed in order to allow the integration of zero-thickness elements; a feature which is not provided by default.
The staggered algorithm of the weak coupling scheme allows for calculations on different numerical domains. Efficient numerical implementation combined with a versatile way to handle continuously varying boundary conditions provided by the FEniCS computing platform [69] form the basis of the developed solver. Since the coupling between both domains is numerically strong an implicit coupling iteration is required. The Precise Code Interaction Coupling Environment (preCICE) [70] provides an easily accessible interface for parallel communication between existing solvers allowing for non-conformal discretization of computational domains in combination with a highly developed Quasi-Newton method to guarantee numerical stability.
Discretization for both methods, namely the construction of interface elements and separation of fracture surfaces is a challenging task especially in three dimensions. This challenge has been overcome by an in house meshing tool based on the Gmsh meshing facility [71]. Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.