Skip to content

Commit

Permalink
Merge pull request #43 from daavid00/dataReport
Browse files Browse the repository at this point in the history
Adding SPE11a results on a 1 mm Cartesian grid
  • Loading branch information
daavid00 authored Feb 28, 2024
2 parents 388d729 + 0897e9f commit 7504b8f
Show file tree
Hide file tree
Showing 23 changed files with 124 additions and 45 deletions.
Binary file added docs/_images/spe11a_performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/spe11a_performance_detailed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/spe11a_sparse_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/spe11a_tco2_2Dmaps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/_sources/configuration_file.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ line as many flags as required (see the OPM Flow documentation `here <https://op
If you have installed flow with MPI support, then you can run the simulations in
parallel by adding **mpirun -np N flow ...** where N is the number of cpus.

.. tip::
By executing flow --help you get an overview of the available flags in the
flow simulator to improve/fix convergence and mass issues (i.e., by setting the flag --linear-solver=cprw to change the linear solver,
by tightening the mb tolerances (--tolerance-mb), etc.).

****************************
Reservoir-related parameters
****************************
Expand Down
31 changes: 17 additions & 14 deletions docs/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,40 @@ where you can also see some of the preliminary simulation results using OPM Flow
* spe11b and spe11c have an extra layer [1 m] of grid cells on the left and right boundaries to include the buffer volume
¨ The solver time step is the maximum value allowed by the simulator
The `examples/finner_grids <https://github.com/OPM/pyopmspe11/blob/main/examples>`_ folder contains configuration files
with grid size of the same order as requested for reporting the spatial data in the benchmark, as well as the required injection schedules. For example, by executing:
The `examples/finner_grids <https://github.com/OPM/pyopmspe11/blob/main/examples/finner_grids>`_ folder contains configuration files
with grid size of the same order and finner as requested for reporting the spatial data in the benchmark, as well as the required injection schedules.

===============================
SPE11A in a 1 mm Cartesian grid
===============================

In a 1 mm Cartesian grid for the spe11a `(spe11a1mm.txt) <https://github.com/OPM/pyopmspe11/blob/main/examples/finner_grids/spe11a1mm.txt>`_, by executing:

.. code-block:: bash
pyopmspe11 -i spe11b.txt -o spe11b_current -m all -g all -r 840,1,120 -t 5 -w 0.1
pyopmspe11 -i spe11a1mm.txt -o spe11a1mm -m all -g all -t 1 -r 280,1,120 -w 0.16666666666666666
the following are some of the generated figures:

.. figure:: figs/spe11b_sparse_data_finner.png
.. figure:: figs/spe11a_sparse_data.png

Sparse data.

.. figure:: figs/spe11b_performance_finner.png
.. figure:: figs/spe11a_performance.png

Performance data.

.. figure:: figs/spe11b_performance_detailed_finner.png
.. figure:: figs/spe11a_performance_detailed.png

Detailed performance data.

.. figure:: figs/spe11b_wden_2Dmaps_finner.png
.. figure:: figs/spe11a_tco2_2Dmaps.png

Dense data for the water density.
Dense data for the CO2 mass (in the 1 cm size, tho the simulations are runned at 1 mm size).

.. warning::
The inputs in this configuration file were set to show the current functionality of pyopmspe11 to generate the benchmark data, i.e.,
the tolerances are not tight and no tunning was performed. In consequence, the total mass in the simulation (ca. 7.75e7 kg) is less
than what is specified in the benchmark (ca. 8.27e7 kg). By executing flow --help you get an overview of the available flags in the
flow simulator to improve/fix convergence and mass issues (i.e., by setting the flag --linear-solver=cprw to change the linear solver,
by tightening the mb tolerances (--tolerance-mb), etc.).
==============================
SPE11B in a 1 m Cartesian grid
==============================

The following are simulation results in a 1 m Cartesian grid `(spe11b1m.txt) <https://github.com/OPM/pyopmspe11/blob/main/examples/finner_grids/spe11b1m.txt>`_,
and the animation in the `main page <https://github.com/OPM/pyopmspe11/blob/main>`_ was generated using these results (the inizialization time of 1000 years was
Expand Down
Binary file modified docs/_static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/configuration_file.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ <h1>Configuration file<a class="headerlink" href="#configuration-file" title="Li
<p>If you have installed flow with MPI support, then you can run the simulations in
parallel by adding <strong>mpirun -np N flow …</strong> where N is the number of cpus.</p>
</div>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>By executing flow –help you get an overview of the available flags in the
flow simulator to improve/fix convergence and mass issues (i.e., by setting the flag –linear-solver=cprw to change the linear solver,
by tightening the mb tolerances (–tolerance-mb), etc.).</p>
</div>
<section id="reservoir-related-parameters">
<h2>Reservoir-related parameters<a class="headerlink" href="#reservoir-related-parameters" title="Link to this heading"></a></h2>
<p>The following input lines in the configuration file are:</p>
Expand Down
33 changes: 17 additions & 16 deletions docs/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
<li class="toctree-l1 current"><a class="current reference internal" href="#">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#hello-world">Hello world</a></li>
<li class="toctree-l2"><a class="reference internal" href="#presentation">Presentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#spe11a-in-a-1-mm-cartesian-grid">SPE11A in a 1 mm Cartesian grid</a></li>
<li class="toctree-l2"><a class="reference internal" href="#spe11b-in-a-1-m-cartesian-grid">SPE11B in a 1 m Cartesian grid</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api.html">pyopmspe11 Python API</a></li>
Expand Down Expand Up @@ -133,44 +135,43 @@ <h2>Presentation<a class="headerlink" href="#presentation" title="Link to this h
<span class="l l-Scalar l-Scalar-Plain">¨ The solver time step is the maximum value allowed by the simulator</span>
</pre></div>
</div>
<p>The <a class="reference external" href="https://github.com/OPM/pyopmspe11/blob/main/examples">examples/finner_grids</a> folder contains configuration files
with grid size of the same order as requested for reporting the spatial data in the benchmark, as well as the required injection schedules. For example, by executing:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pyopmspe11<span class="w"> </span>-i<span class="w"> </span>spe11b.txt<span class="w"> </span>-o<span class="w"> </span>spe11b_current<span class="w"> </span>-m<span class="w"> </span>all<span class="w"> </span>-g<span class="w"> </span>all<span class="w"> </span>-r<span class="w"> </span><span class="m">840</span>,1,120<span class="w"> </span>-t<span class="w"> </span><span class="m">5</span><span class="w"> </span>-w<span class="w"> </span><span class="m">0</span>.1
<p>The <a class="reference external" href="https://github.com/OPM/pyopmspe11/blob/main/examples/finner_grids">examples/finner_grids</a> folder contains configuration files
with grid size of the same order and finner as requested for reporting the spatial data in the benchmark, as well as the required injection schedules.</p>
</section>
<section id="spe11a-in-a-1-mm-cartesian-grid">
<h2>SPE11A in a 1 mm Cartesian grid<a class="headerlink" href="#spe11a-in-a-1-mm-cartesian-grid" title="Link to this heading"></a></h2>
<p>In a 1 mm Cartesian grid for the spe11a <a class="reference external" href="https://github.com/OPM/pyopmspe11/blob/main/examples/finner_grids/spe11a1mm.txt">(spe11a1mm.txt)</a>, by executing:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pyopmspe11<span class="w"> </span>-i<span class="w"> </span>spe11a1mm.txt<span class="w"> </span>-o<span class="w"> </span>spe11a1mm<span class="w"> </span>-m<span class="w"> </span>all<span class="w"> </span>-g<span class="w"> </span>all<span class="w"> </span>-t<span class="w"> </span><span class="m">1</span><span class="w"> </span>-r<span class="w"> </span><span class="m">280</span>,1,120<span class="w"> </span>-w<span class="w"> </span><span class="m">0</span>.16666666666666666
</pre></div>
</div>
<p>the following are some of the generated figures:</p>
<figure class="align-default" id="id1">
<img alt="_images/spe11b_sparse_data_finner.png" src="_images/spe11b_sparse_data_finner.png" />
<img alt="_images/spe11a_sparse_data.png" src="_images/spe11a_sparse_data.png" />
<figcaption>
<p><span class="caption-text">Sparse data.</span><a class="headerlink" href="#id1" title="Link to this image"></a></p>
</figcaption>
</figure>
<figure class="align-default" id="id2">
<img alt="_images/spe11b_performance_finner.png" src="_images/spe11b_performance_finner.png" />
<img alt="_images/spe11a_performance.png" src="_images/spe11a_performance.png" />
<figcaption>
<p><span class="caption-text">Performance data.</span><a class="headerlink" href="#id2" title="Link to this image"></a></p>
</figcaption>
</figure>
<figure class="align-default" id="id3">
<img alt="_images/spe11b_performance_detailed_finner.png" src="_images/spe11b_performance_detailed_finner.png" />
<img alt="_images/spe11a_performance_detailed.png" src="_images/spe11a_performance_detailed.png" />
<figcaption>
<p><span class="caption-text">Detailed performance data.</span><a class="headerlink" href="#id3" title="Link to this image"></a></p>
</figcaption>
</figure>
<figure class="align-default" id="id4">
<img alt="_images/spe11b_wden_2Dmaps_finner.png" src="_images/spe11b_wden_2Dmaps_finner.png" />
<img alt="_images/spe11a_tco2_2Dmaps.png" src="_images/spe11a_tco2_2Dmaps.png" />
<figcaption>
<p><span class="caption-text">Dense data for the water density.</span><a class="headerlink" href="#id4" title="Link to this image"></a></p>
<p><span class="caption-text">Dense data for the CO2 mass (in the 1 cm size, tho the simulations are runned at 1 mm size).</span><a class="headerlink" href="#id4" title="Link to this image"></a></p>
</figcaption>
</figure>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The inputs in this configuration file were set to show the current functionality of pyopmspe11 to generate the benchmark data, i.e.,
the tolerances are not tight and no tunning was performed. In consequence, the total mass in the simulation (ca. 7.75e7 kg) is less
than what is specified in the benchmark (ca. 8.27e7 kg). By executing flow –help you get an overview of the available flags in the
flow simulator to improve/fix convergence and mass issues (i.e., by setting the flag –linear-solver=cprw to change the linear solver,
by tightening the mb tolerances (–tolerance-mb), etc.).</p>
</div>
</section>
<section id="spe11b-in-a-1-m-cartesian-grid">
<h2>SPE11B in a 1 m Cartesian grid<a class="headerlink" href="#spe11b-in-a-1-m-cartesian-grid" title="Link to this heading"></a></h2>
<p>The following are simulation results in a 1 m Cartesian grid <a class="reference external" href="https://github.com/OPM/pyopmspe11/blob/main/examples/finner_grids/spe11b1m.txt">(spe11b1m.txt)</a>,
and the animation in the <a class="reference external" href="https://github.com/OPM/pyopmspe11/blob/main">main page</a> was generated using these results (the inizialization time of 1000 years was
skipped and the results were printed ever 25 years instead of 5 years):</p>
Expand Down
2 changes: 2 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ <h1>Welcome to pyopmspe11’s documentation!<a class="headerlink" href="#welcome
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="examples.html#hello-world">Hello world</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#presentation">Presentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#spe11a-in-a-1-mm-cartesian-grid">SPE11A in a 1 mm Cartesian grid</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#spe11b-in-a-1-m-cartesian-grid">SPE11B in a 1 m Cartesian grid</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api.html">pyopmspe11 Python API</a><ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/text/configuration_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ line as many flags as required (see the OPM Flow documentation `here <https://op
If you have installed flow with MPI support, then you can run the simulations in
parallel by adding **mpirun -np N flow ...** where N is the number of cpus.

.. tip::
By executing flow --help you get an overview of the available flags in the
flow simulator to improve/fix convergence and mass issues (i.e., by setting the flag --linear-solver=cprw to change the linear solver,
by tightening the mb tolerances (--tolerance-mb), etc.).

****************************
Reservoir-related parameters
****************************
Expand Down
31 changes: 17 additions & 14 deletions docs/text/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,40 @@ where you can also see some of the preliminary simulation results using OPM Flow
* spe11b and spe11c have an extra layer [1 m] of grid cells on the left and right boundaries to include the buffer volume
¨ The solver time step is the maximum value allowed by the simulator
The `examples/finner_grids <https://github.com/OPM/pyopmspe11/blob/main/examples>`_ folder contains configuration files
with grid size of the same order as requested for reporting the spatial data in the benchmark, as well as the required injection schedules. For example, by executing:
The `examples/finner_grids <https://github.com/OPM/pyopmspe11/blob/main/examples/finner_grids>`_ folder contains configuration files
with grid size of the same order and finner as requested for reporting the spatial data in the benchmark, as well as the required injection schedules.

===============================
SPE11A in a 1 mm Cartesian grid
===============================

In a 1 mm Cartesian grid for the spe11a `(spe11a1mm.txt) <https://github.com/OPM/pyopmspe11/blob/main/examples/finner_grids/spe11a1mm.txt>`_, by executing:

.. code-block:: bash
pyopmspe11 -i spe11b.txt -o spe11b_current -m all -g all -r 840,1,120 -t 5 -w 0.1
pyopmspe11 -i spe11a1mm.txt -o spe11a1mm -m all -g all -t 1 -r 280,1,120 -w 0.16666666666666666
the following are some of the generated figures:

.. figure:: figs/spe11b_sparse_data_finner.png
.. figure:: figs/spe11a_sparse_data.png

Sparse data.

.. figure:: figs/spe11b_performance_finner.png
.. figure:: figs/spe11a_performance.png

Performance data.

.. figure:: figs/spe11b_performance_detailed_finner.png
.. figure:: figs/spe11a_performance_detailed.png

Detailed performance data.

.. figure:: figs/spe11b_wden_2Dmaps_finner.png
.. figure:: figs/spe11a_tco2_2Dmaps.png

Dense data for the water density.
Dense data for the CO2 mass (in the 1 cm size, tho the simulations are runned at 1 mm size).

.. warning::
The inputs in this configuration file were set to show the current functionality of pyopmspe11 to generate the benchmark data, i.e.,
the tolerances are not tight and no tunning was performed. In consequence, the total mass in the simulation (ca. 7.75e7 kg) is less
than what is specified in the benchmark (ca. 8.27e7 kg). By executing flow --help you get an overview of the available flags in the
flow simulator to improve/fix convergence and mass issues (i.e., by setting the flag --linear-solver=cprw to change the linear solver,
by tightening the mb tolerances (--tolerance-mb), etc.).
==============================
SPE11B in a 1 m Cartesian grid
==============================

The following are simulation results in a 1 m Cartesian grid `(spe11b1m.txt) <https://github.com/OPM/pyopmspe11/blob/main/examples/finner_grids/spe11b1m.txt>`_,
and the animation in the `main page <https://github.com/OPM/pyopmspe11/blob/main>`_ was generated using these results (the inizialization time of 1000 years was
Expand Down
Binary file modified docs/text/figs/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/text/figs/spe11a_performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/text/figs/spe11a_performance_detailed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/text/figs/spe11a_sparse_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/text/figs/spe11a_tco2_2Dmaps.png
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.
Binary file removed docs/text/figs/spe11b_performance_finner.png
Binary file not shown.
Binary file removed docs/text/figs/spe11b_sparse_data_finner.png
Binary file not shown.
Binary file removed docs/text/figs/spe11b_wden_2Dmaps_finner.png
Binary file not shown.
54 changes: 54 additions & 0 deletions examples/finner_grids/spe11a1mm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""Set the full path to the flow executable and flags"""
mpirun -np 67 flow --tolerance-mb=1e-7 --linear-solver=cprw --newton-min-iterations=1 --enable-tuning=true --enable-opm-rst-file=true --output-extra-convergence-info=steps,iterations

"""Set the model parameters"""
spe11a master #Name of the spe case (spe11a, spe11b, or spe11c) and OPM Flow version (master or release)
complete gaswater #Name of the co2 model (immiscible or complete) and co2store implementation (gaswater or gasoil [oil properties are set to water internally in OPM flow])
cartesian #Type of grid (cartesian, tensor, or corner-point)
2.8 0.01 1.2 #Length, width, and depth [m]
2800 #If cartesian, number of x cells [-]; otherwise, variable array of x-refinment
1 #If cartesian, number of y cells [-]; otherwise, variable array of y-refinment [-] (for spe11c)
1200 #If cartesian, number of z cells [-]; if tensor, variable array of z-refinment; if corner-point, fix array of z-refinment (18 entries)
20 20 #Temperature bottom and top rig [C]
1.2 110000 1 #Pressure on the top [Pa] and multiplier for the permeability in the z direction [-]
1e-9 1.6e-5 #Diffusion (in liquid and gas) [m^2/s]
0 0 #Rock specific heat and density (for spe11b/c)
0 0 0 #Added pore volume on top boundary (for spe11a [if 0, free flow bc]), pore volume on lateral boundaries, and width of buffer cell [m] (for spe11b/c)
0 0 #Elevation of the parabola and back boundary [m] (for spe11c)

"""Set the saturation functions"""
(max(0, (s_w - swi) / (1 - swi))) ** 2 #Wetting rel perm saturation function [-]
(max(0, (1 - s_w - sni) / (1 - sni))) ** 2 #Non-wetting rel perm saturation function [-]
penmax * math.erf(pen * ((s_w-swi) / (1.-swi)) ** (-(1.0 / 2)) * math.pi**0.5 / (penmax * 2)) #Capillary pressure saturation function [Pa]
(np.exp(np.flip(np.linspace(0, 5.0, npoints))) - 1) / (np.exp(5.0) - 1) #Points to evaluate the saturation functions (s_w) [-]

"""Properties sat functions"""
"""swi [-], sni [-], pen [Pa], penmax [Pa], npoints [-]"""
SWI1 0.32 SNI1 0.1 PEN1 1500 PENMAX1 2500 NPOINTS1 1000
SWI2 0.14 SNI2 0.1 PEN2 300 PENMAX2 2500 NPOINTS2 1000
SWI3 0.12 SNI3 0.1 PEN3 100 PENMAX3 2500 NPOINTS3 1000
SWI4 0.12 SNI4 0.1 PEN4 25 PENMAX4 2500 NPOINTS4 1000
SWI5 0.12 SNI5 0.1 PEN5 10 PENMAX5 2500 NPOINTS5 1000
SWI6 0.10 SNI6 0.1 PEN6 1 PENMAX6 2500 NPOINTS6 1000
SWI7 0 SNI7 0 PEN7 0 PENMAX7 2500 NPOINTS7 2

"""Properties rock"""
"""K [mD], phi [-], disp [m] (dispersion requires a Flow version newer than 17-11-2023)"""
PERM1 44529.9988 PORO1 0.44 DISP1 1e-2
PERM2 506624.985 PORO2 0.43 DISP2 1e-2
PERM3 1013249.97 PORO3 0.44 DISP3 1e-2
PERM4 2026499.95 PORO4 0.45 DISP4 1e-2
PERM5 4052999.88 PORO5 0.43 DISP5 1e-2
PERM6 10132499.7 PORO6 0.46 DISP6 1e-2
PERM7 0 PORO7 0 DISP7 0

"""Wells position"""
"""radius (0 to use the SOURCE keyword instead of well keywords, this requires a Flow version newer than 23-01-2024), x, y, and z position [m] (final positions as well for spe11c)"""
0 0.9 0.005 0.3 #Well 1
0 1.7 0.005 0.7 #Well 2

"""Define the injection values ([hours] for spe11a; [years] for spe11b/c)"""
"""injection time, time step size to write results, maximum solver time step, injected fluid (0 water, 1 co2) (well1), injection rate [kg/s] (well1), temperature [C] (well1), injected fluid (0 water, 1 co2) (well2), ..."""
2.5 0.5 .00024 1 1.7e-7 20 1 0 20
2.5 0.5 .00024 1 1.7e-7 20 1 1.7e-7 20
115 0.5 .00024 1 0 20 1 0 20

0 comments on commit 7504b8f

Please sign in to comment.