Skip to content

Commit

Permalink
Merge pull request #203 from WasimNiyazMunshi/my-code-gallery-project
Browse files Browse the repository at this point in the history
Phase-field model for fracture using MPI and AMR
  • Loading branch information
marcfehling authored Jan 9, 2025
2 parents 43596ba + 12964be commit 8180094
Show file tree
Hide file tree
Showing 11 changed files with 1,594 additions and 0 deletions.
61 changes: 61 additions & 0 deletions Phase_field_fracture_model_in_3D/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
##
# CMake script for the phase_field program:
##

# Set the name of the project and target:
SET(TARGET "phase_field")

# Declare all source files the target consists of. Here, this is only
# the one step-X.cc file, but as you expand your project you may wish
# to add other source files as well. If your project becomes much larger,
# you may want to either replace the following statement by something like
# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc")
# FILE(GLOB_RECURSE TARGET_INC "include/*.h")
# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC})
# or switch altogether to the large project CMakeLists.txt file discussed
# in the "CMake in user projects" page accessible from the "User info"
# page of the documentation.
SET(TARGET_SRC
${TARGET}.cc
)

# Usually, you will not need to modify anything beyond this point...

CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0)

FIND_PACKAGE(deal.II 9.5.0
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
)
IF(NOT ${deal.II_FOUND})
MESSAGE(FATAL_ERROR "\n"
"*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n"
"You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n"
"or set an environment variable \"DEAL_II_DIR\" that contains this path."
)
ENDIF()

#
# Are all dependencies fulfilled?
#
if(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST)
message(FATAL_ERROR "
Error! This tutorial requires a deal.II library that was configured with the following options:
DEAL_II_WITH_PETSC = ON
DEAL_II_PETSC_WITH_COMPLEX = OFF
DEAL_II_WITH_P4EST = ON
or
DEAL_II_WITH_TRILINOS = ON
DEAL_II_WITH_P4EST = ON
However, the deal.II library found at ${DEAL_II_PATH} was configured with these options:
DEAL_II_WITH_PETSC = ${DEAL_II_WITH_PETSC}
DEAL_II_PETSC_WITH_COMPLEX = ${DEAL_II_PETSC_WITH_COMPLEX}
DEAL_II_WITH_P4EST = ${DEAL_II_WITH_P4EST}
DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS}
This conflicts with the requirements.
One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step."
)
endif()

DEAL_II_INITIALIZE_CACHED_VARIABLES()
PROJECT(${TARGET})
DEAL_II_INVOKE_AUTOPILOT()
59 changes: 59 additions & 0 deletions Phase_field_fracture_model_in_3D/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Phase-field Fracture in 3D

## Motivation
This program implements the hybrid phase-field model of Ambati et al. [1] in deal.II using adaptive mesh refinement and parallel computing capabilities.
Phase-field models have been proven to be effective in modeling complicated fractures because of their ability to model crack branching, merging, and fragmentation.
Despite this, these models are mostly limited to 2D because of the high computational cost, as these models require very fine meshes to resolve the diffused representation of the crack.
This code explores the use of parallel computing and adaptive mesh refinement to model fracture propagation using the hybrid phase-field model.

## Governing equations

The model this program solves is that of Ambati et al. [1], see there for more information. In short,
the model describes the growth of a crack as an object is successively strained. The deformation
of the solid is described by the usual force balance appropriate for quasi-static deformation:

@f{align*}{
\nabla\cdot\boldsymbol{\sigma}
(\boldsymbol{\varepsilon}(\boldsymbol{u}),d) = \mathbf{0}
@f}
with Dirichlet boundary conditions
@f{align*}{
\boldsymbol{u} = \boldsymbol{u}_D \text{ on } \Gamma_D
@f}

The crack is tracked by a "damage field" $d$ that is a smoothed version of a history field $\mathcal{H}^{+}$
that corresponds to accumulated strain at a quadrature point:
@f{align*}{
-l^2 \nabla^2 d+d=\frac{2 l}{G_c}(1-d) \mathcal{H}^{+}
@f} with the boundary condition
@f{align*}{
\left(G_{c} l\right) \nabla d \cdot \boldsymbol{n}=\mathbf{0}.
@f}
Here, $\boldsymbol{u}, d$ represent the displacement and damage(crack) fields, $l$ is the length scale parameter, $G_c$ is the critical energy release rate and $\mathcal{H}^{+}$ is the history field variable.

## To run the Code
After running `cmake .`, run `make release` or `make debug` to switch between `release` and `debug`mode. Compile using `make`.
Run the executable by using `make run` on the command line.
Run the executable on 'n' processes using 'mpirun -np $n$ ./phase_field'. For example 'mpirun -np 40 ./phase_field' runs the program on 40 processes.
## Numerical example
The program currently models fracture propagation in a 3-layered material subjected to equibiaxial loading along $+x$ and $+y$ directions. The problem setup is shown in the following picture:
![Setup](./doc/polyhedral_setup.png)
Results are compared for two different initial meshes, the finer $80\times80\times40$ mesh and the coarser $20\times20\times10$ mesh. The following picture shows results for the fracture patterns and the load-displacement curves for the 2 meshes:
![Load displacement curves](./doc/load_displacement_curves.png)

An animation of how the crack system in this setup evolves can be found [here](./doc/polyhedral_cracks.mp4) (left: coarse mesh; right: fine mesh).

## References
[1]
```
@article{Ambati2015,
title={A review on phase-field models of brittle fracture and a new fast hybrid formulation},
author={Ambati, Marreddy and Gerasimov, Tymofiy and De Lorenzis, Laura},
journal={Computational Mechanics},
volume={55},
pages={383--405},
year={2015},
publisher={Springer},
doi={10.1007/s00466-014-1109-y}
}
```
4 changes: 4 additions & 0 deletions Phase_field_fracture_model_in_3D/doc/author
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Wasim Niyaz Munshi <[email protected]>
Chandrasekhar Annavarapu <[email protected]>
Wolfgang Bangerth <[email protected]>
Marc Fehling <[email protected]>
1 change: 1 addition & 0 deletions Phase_field_fracture_model_in_3D/doc/builds-on
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
step-8 step-40
1 change: 1 addition & 0 deletions Phase_field_fracture_model_in_3D/doc/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DEAL_II_WITH_TRILINOS DEAL_II_WITH_MPI
1 change: 1 addition & 0 deletions Phase_field_fracture_model_in_3D/doc/entry-name
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Phase-field fracture model in 3D
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Phase_field_fracture_model_in_3D/doc/tooltip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Phase-field fracture model in 3D with adaptive mesh refinement and a parallel solver
Loading

0 comments on commit 8180094

Please sign in to comment.