A phase-field brittle fracture mechanics code written in Nutils is coupled to a Poisson equation in FEniCS or DOLFIN. The FEniCS code is a place-holder for a proper corrosion model. The coupling is realized with preCICE. The purpose of this code is to showcase how preCICE could be used to volume-couple between an electro-chemistry model (here the FEniCS code) and a fracture mechanics model. Currently, meaningless data is exchanged.
The original fracture mechanics code was developed by Clemens Verhoosel. The model is documented in this publication:
Singh, N., Verhoosel, C.V., De Borst, R. and Van Brummelen, E.H., 2016. A fracture-controlled path-following technique for phase-field modeling of brittle fracture. Finite Elements in Analysis and Design, 113, pp.14-29.
The coupling prototype was developed by Benjamin Uekermann. Contact Benjamin for questions about this code. Furthermore, the following support channels might be helpful: Nutils matrix chat room, preCICE forum.
- Python3 (e.g. 3.6, but any new version should work)
- numpy (e.g. 1.18, but any new version should work)
- matplotlib (e.g. 3.0, but any new version should work)
- Nutils v6
- preCICE v2
- pyprecice v2
- FEniCS v2019.1
- FEniCS-preCICE adapter v1 only needed for the FEniCS Poisson equation
Instead of installing all dependencies on your system you can run the simulation in a docker container.
$ docker build -t brittle-fracture:1.0 -f brittle-fracture.dockerfile .
$ docker run -it --name bf brittle-fracture:1.0
Building the docker image will take some time.
Then, just clone this repository again within the container.
git clone https://github.com/uekerman/Coupled-Brittle-Fracture.git
and continue below.
Allclean
: a bash script to clean the case (incl. build artifacts)corrosion.py
: the dummy corrosion model, implemented with FEniCS, using the FEniCS-preCICE adapter for couplingprecice-adapter-config.json
: the FEniCS-preCICE adapter configuration filecorrosion.cpp
: a similar dummy corrosion model, implemented with DOLFIN, directly using preCICE for couplingPoisson.ufl
: the corresponding DOLFIN unified form language fileCMakeLists
: cmake specification to build the DOLFIN codedummy.py
: an alternative dummy code, which can also provide material parametersfracture.py
: the fracture mechanics, implemented with Nutilsprecice-config.xml
: the preCICE configuration file, describing the coupled setupREADME.md
The DOLFIN code is the only one that needs building
ffc -l dolfin Poisson.ufl
cmake .
make
Be sure to use the same ffc
version as used for the linked libdolfin
.
Open two terminals and start one program in each directly from the root directory:
- Either
python3 corrosion.py
(the FEniCS variant) or./demo_corrosion
(the DOLFIN variant) python3 fracture.py
If you only have one terminal (e.g. in an interactive docker container):
./demo_corrosion & python3 fracture.py
Both codes write vtk data, which can be visualized for example with Paraview.
l0 acts as a numerical regularization parameter for the phase field model. It controls the width of the smooth approximation of the crack. In the limit case of l0 going to zero, the phase-field approximation converges to the discrete fracture surface. The parameter could, however, also be regarded as a model parameter: the critical stress for which crack nucleation occurs depends on it. For smaller l0, the critical stress increases. For the limit case, fracture nucleation is impossible in the absence of stress singularities. For too large values of l0, on the other hand, the complete damage field is already above the critical damage value. Whatever happens then could be regarded as unphysical model artifacts. In particular, fractures cannot be localized properly. Given the total load, the Lamé parameters, and the fracture toughness, l0 needs to be tuned such that the initial virgin damage field is below the critical damage value (approximately 0.25, better below 0.1). Additionally, l0 still needs to be larger than the local mesh size.
Please see section 2 (in particular section 2.3.1) of: Borden, M.J., Verhoosel, C.V., Scott, M.A., Hughes, T.J. and Landis, C.M., 2012. A phase-field description of dynamic brittle fracture. Computer Methods in Applied Mechanics and Engineering, 217, pp.77-95. PDF