Skip to content

Commit

Permalink
deploy: 91f5763
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchengtkc committed Nov 22, 2023
1 parent 933f2d3 commit 7e15f42
Show file tree
Hide file tree
Showing 15 changed files with 202 additions and 54 deletions.
142 changes: 142 additions & 0 deletions 3D.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Setup &mdash; warmth documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=9eb32ce0"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@^1.0.1/dist/embed-amd.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="API Reference" href="apireference.html" />
<link rel="prev" title="Build 1D model" href="notebooks/Build_within_Python.html" />
</head>

<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >



<a href="index.html" class="icon icon-home">
warmth
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="theory.html">Background theory</a></li>
<li class="toctree-l1"><a class="reference internal" href="example.html">Example</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Setup</a></li>
<li class="toctree-l1"><a class="reference internal" href="#workflow">Workflow</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#d-heat-equation-simulation-using-dolfinx">3D heat equation simulation using dolfinx</a></li>
<li class="toctree-l2"><a class="reference internal" href="#resqml-output">RESQML output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="apireference.html">API Reference</a></li>
</ul>

</div>
</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">warmth</a>
</nav>

<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Setup</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/3D.md" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<section id="setup">
<h1>Setup<a class="headerlink" href="#setup" title="Link to this heading"></a></h1>
<p>We use <a class="reference external" href="https://github.com/FEniCS/dolfinx">dolfinx</a> for full 3D heat transfer model. Compiling and installing dolfinx can be challenging. We suggests using a Docker images.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>docker<span class="w"> </span>run<span class="w"> </span>-ti<span class="w"> </span>-v<span class="w"> </span>&lt;YOUR_WORK_DIR&gt;:/<span class="w"> </span>dolfinx:dolfinx:v0.7.0
<span class="c1"># Then inside the interactive shell</span>
pip<span class="w"> </span>install<span class="w"> </span>warmth
</pre></div>
</div>
<p>3D part of the library has only been tested with Python 3.10.x and Dolfinx v0.7.x</p>
</section>
<section id="workflow">
<h1>Workflow<a class="headerlink" href="#workflow" title="Link to this heading"></a></h1>
<p><a class="reference external" href="https://github.com/equinor/warmth/tree/main/docs/notebooks/3D_simulation.ipynb">Notebook example</a></p>
<p>Step 1 - Extract 1D models from maps</p>
<p>Step 2 - Find beta factor and curstal thickness through time using 1D simulation</p>
<p>Step 3 - Build 3D mesh and run simulation</p>
<section id="d-heat-equation-simulation-using-dolfinx">
<h2>3D heat equation simulation using dolfinx<a class="headerlink" href="#d-heat-equation-simulation-using-dolfinx" title="Link to this heading"></a></h2>
<p>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.</p>
<p>The dolfinx model building and solving is managed by the class <a class="reference internal" href="#warmth3D/fixed_mesh_model.py"><span class="xref myst">UniformNodeGridFixedSizeMeshModel</span></a>. The use of this class is demonstrated in <a class="reference internal" href="#tests/warmth3D_mapA_example.py"><span class="xref myst">warmth3D_mapA_example.py</span></a>. Note that the NodeGrid class definition in this script should match the definition used in <a class="reference internal" href="#warmth3D/parallel-1Dsed.py"><span class="xref myst">parallel-1Dsed.py</span></a> 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.</p>
</section>
<section id="resqml-output">
<h2>RESQML output<a class="headerlink" href="#resqml-output" title="Link to this heading"></a></h2>
<p>The test script <a class="reference internal" href="#tests/warmth3D_mapA_example.py"><span class="xref myst">warmth3D_mapA_example.py</span></a> 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, <a class="reference internal" href="#warmth3D/resqpy_helpers.py"><span class="xref myst">resqpy_helpers.py</span></a>, and require a modified version of the resqpy library. To visualise RESQML data in ParaView, a 3rd-party plug-in can be installed, see <a class="reference external" href="https://github.com/F2I-Consulting/fespp">fespp</a>.</p>
</section>
</section>


</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="notebooks/Build_within_Python.html" class="btn btn-neutral float-left" title="Build 1D model" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="apireference.html" class="btn btn-neutral float-right" title="API Reference" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

<hr/>

<div role="contentinfo">
<p>&#169; Copyright 2023, Equinor ASA.</p>
</div>

Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>

</body>
</html>
28 changes: 28 additions & 0 deletions _sources/3D.md
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).


1 change: 1 addition & 0 deletions _sources/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Welcome to warmth's documentation!

theory
example
3D
apireference


Expand Down
17 changes: 0 additions & 17 deletions _sources/theory.md
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).

6 changes: 4 additions & 2 deletions apireference.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Build 1D model" href="notebooks/Build_within_Python.html" />
<link rel="prev" title="Setup" href="3D.html" />
</head>

<body class="wy-body-for-nav">
Expand All @@ -47,6 +47,8 @@
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="theory.html">Background theory</a></li>
<li class="toctree-l1"><a class="reference internal" href="example.html">Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="3D.html">Setup</a></li>
<li class="toctree-l1"><a class="reference internal" href="3D.html#workflow">Workflow</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#module-warmth.model">Model</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#warmth.model.Model"><code class="docutils literal notranslate"><span class="pre">Model</span></code></a><ul>
Expand Down Expand Up @@ -1211,7 +1213,7 @@ <h1>API Reference<a class="headerlink" href="#api-reference" title="Link to this
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="notebooks/Build_within_Python.html" class="btn btn-neutral float-left" title="Build 1D model" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="3D.html" class="btn btn-neutral float-left" title="Setup" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>

<hr/>
Expand Down
2 changes: 2 additions & 0 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
<li class="toctree-l2"><a class="reference internal" href="notebooks/Build_within_Python.html">Build 1D model</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="3D.html">Setup</a></li>
<li class="toctree-l1"><a class="reference internal" href="3D.html#workflow">Workflow</a></li>
<li class="toctree-l1"><a class="reference internal" href="apireference.html">API Reference</a></li>
</ul>

Expand Down
2 changes: 2 additions & 0 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="theory.html">Background theory</a></li>
<li class="toctree-l1"><a class="reference internal" href="example.html">Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="3D.html">Setup</a></li>
<li class="toctree-l1"><a class="reference internal" href="3D.html#workflow">Workflow</a></li>
<li class="toctree-l1"><a class="reference internal" href="apireference.html">API Reference</a></li>
</ul>

Expand Down
16 changes: 9 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="theory.html">Background theory</a></li>
<li class="toctree-l1"><a class="reference internal" href="example.html">Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="3D.html">Setup</a></li>
<li class="toctree-l1"><a class="reference internal" href="3D.html#workflow">Workflow</a></li>
<li class="toctree-l1"><a class="reference internal" href="apireference.html">API Reference</a></li>
</ul>

Expand Down Expand Up @@ -79,17 +81,17 @@ <h1>Welcome to warmth’s documentation!<a class="headerlink" href="#welcome-to-
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="theory.html">Background theory</a><ul>
<li class="toctree-l2"><a class="reference internal" href="theory.html#pre-requisite-grid-of-1d-node-simulation">Pre-requisite: grid of 1D node simulation</a></li>
<li class="toctree-l2"><a class="reference internal" href="theory.html#d-heat-equation-simulation-using-dolfinx">3D heat equation simulation using dolfinx</a></li>
<li class="toctree-l2"><a class="reference internal" href="theory.html#resqml-output">RESQML output</a></li>
<li class="toctree-l2"><a class="reference internal" href="theory.html#d-dependencies">3D dependencies</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="theory.html">Background theory</a></li>
<li class="toctree-l1"><a class="reference internal" href="example.html">Example</a><ul>
<li class="toctree-l2"><a class="reference internal" href="notebooks/Build_within_Python.html">Build 1D model</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="3D.html">Setup</a></li>
<li class="toctree-l1"><a class="reference internal" href="3D.html#workflow">Workflow</a><ul>
<li class="toctree-l2"><a class="reference internal" href="3D.html#d-heat-equation-simulation-using-dolfinx">3D heat equation simulation using dolfinx</a></li>
<li class="toctree-l2"><a class="reference internal" href="3D.html#resqml-output">RESQML output</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="apireference.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apireference.html#module-warmth.model">Model</a></li>
<li class="toctree-l2"><a class="reference internal" href="apireference.html#module-warmth.build">Model builder</a></li>
Expand Down
2 changes: 2 additions & 0 deletions notebooks/3D_simulation.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="../theory.html">Background theory</a></li>
<li class="toctree-l1"><a class="reference internal" href="../example.html">Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="../3D.html">Setup</a></li>
<li class="toctree-l1"><a class="reference internal" href="../3D.html#workflow">Workflow</a></li>
<li class="toctree-l1"><a class="reference internal" href="../apireference.html">API Reference</a></li>
</ul>

Expand Down
Loading

0 comments on commit 7e15f42

Please sign in to comment.