Setup
We use dolfinx for full 3D heat transfer model. Compiling and installing dolfinx can be challenging. We suggests using a Docker images.
docker run -ti -v <YOUR_WORK_DIR>:/ dolfinx:dolfinx:v0.7.0
# Then inside the interactive shell
pip install warmth
3D part of the library has only been tested with Python 3.10.x and Dolfinx v0.7.x
Run Example
mpiexec -n 4 python3 tests/warmth3d/test_3d.py
Workflow
Step 1 - Extract 1D models from maps
Step 2 - Find beta factor and curstal thickness through time using 1D simulation
Step 3 - Build 3D mesh and run simulation
3D heat equation simulation using dolfinx
The 3D simulation performs a series of heat equation solves, regularly updating the mesh positions from the 1D nodes. The equations are solved using the PETSc solver from the dolfinx package (part of the FeNiCs project). The compute mesh is built by defining hexahedra for every rectangle of 1D nodes and for every layer (i.e. each sediment, the crust, the lithosphere, and the aesthenosphere), which are then subdivided into tetrahedra.
The dolfinx model building and solving is managed by the class UniformNodeGridFixedSizeMeshModel. The use of this class is demonstrated in warmth3D_mapA_example.py. Note that the NodeGrid class definition in this script should match the definition used in parallel-1Dsed.py to compute the 1D solutions. This script writes the results (mesh positions and function values) at every 1M years in xdmf format for visualization in ParaView.
RESQML output
The test script warmth3D_mapA_example.py further demonstrates writing the unstructured grid (with properties) in RESQML format, as a pair of .epc and .h5 files. The RESQML I/O functions are in a separate file, resqpy_helpers.py, and require a modified version of the resqpy library. To visualise RESQML data in ParaView, a 3rd-party plug-in can be installed, see fespp.