-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into subsheat3D/test_from_grids
- Loading branch information
Showing
8 changed files
with
44 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,8 @@ | ||
FROM dolfinx/dolfinx:v0.6.0 | ||
|
||
|
||
RUN DEBIAN_FRONTEND=noninteractive \ | ||
RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Oslo \ | ||
&& apt-get update \ | ||
&& apt-get install -y curl | ||
# build-essential --no-install-recommends make \ | ||
# ca-certificates \ | ||
# git \ | ||
# libssl-dev \ | ||
# zlib1g-dev \ | ||
# libbz2-dev \ | ||
# libreadline-dev \ | ||
# libsqlite3-dev \ | ||
# wget \ | ||
# \ | ||
# llvm \ | ||
# libncurses5-dev \ | ||
# xz-utils \ | ||
# tk-dev \ | ||
# libxml2-dev \ | ||
# libxmlsec1-dev \ | ||
# libffi-dev \ | ||
# liblzma-dev | ||
|
||
# RUN useradd -rm -d /home/vscode -s /bin/bash -g root -G sudo -u 1000 vscode -p "" | ||
# USER vscode | ||
# WORKDIR /home/vscode | ||
# ENV HOME=/home/vscode | ||
ENV PATH="/root/.local/bin:$HOME/.local/bin::$PATH" | ||
RUN curl -sSL https://install.python-poetry.org | python3 - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
name: Snyk scan | ||
on: | ||
push: | ||
branches: [main, dev] | ||
workflow_call: | ||
jobs: | ||
security: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Setup | ||
We use [dolfinx](https://github.com/FEniCS/dolfinx) for full 3D heat transfer model. Compiling and installing dolfinx can be challenging. We suggests using a Docker images. | ||
```bash | ||
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 | ||
|
||
# Workflow | ||
[Notebook example](https://github.com/equinor/warmth/tree/main/docs/notebooks/3D_simulation.ipynb) | ||
|
||
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](warmth3D/fixed_mesh_model.py). The use of this class is demonstrated in [warmth3D_mapA_example.py](tests/warmth3D_mapA_example.py). Note that the NodeGrid class definition in this script should match the definition used in [parallel-1Dsed.py](warmth3D/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](tests/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](warmth3D/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](https://github.com/F2I-Consulting/fespp). | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ Welcome to warmth's documentation! | |
|
||
theory | ||
example | ||
3D | ||
apireference | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,2 @@ | ||
# Background theory | ||
|
||
|
||
3D simulations in warmth are under active development. Currently, yhey are based on a uniform reactangular grid of 1D nodes (defined in a NodeGrid data structure). The sediment inputs, horizons are present day, are provided as .gri files, which are read into a SedimentStack class. | ||
|
||
### Pre-requisite: grid of 1D node simulation | ||
The complete 1D warmth simulation is run for some of the 1D nodes. For other 1D nodes the subsidence, beta factor, and crustal thickness are interpolated. The 1D simulations can be run using the script [parallel-1Dsed.py](warmth3D/parallel-1Dsed.py). Results for each node are pickled to a separate file (this is to be improved!). | ||
|
||
### 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](warmth3D/fixed_mesh_model.py). The use of this class is demonstrated in [warmth3D_mapA_example.py](tests/warmth3D_mapA_example.py). Note that the NodeGrid class definition in this script should match the definition used in [parallel-1Dsed.py](warmth3D/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](tests/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](warmth3D/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](https://github.com/F2I-Consulting/fespp). | ||
|
||
### 3D dependencies | ||
The dolfinx package is Linux-only(?) and has to be compiled from source or installed using apt-get. The resqpy dependency can be installed with pip, but, for now, some writing of properties on unstructured grids requires a change in resqpy that is not yet merged. The other dependencies xtgeo and meshio can be installed using pip (requirements file is to be added). | ||
|