Skip to content

Commit

Permalink
Extending the functionality: Summary and dynamic variables
Browse files Browse the repository at this point in the history
  • Loading branch information
daavid00 committed Jul 27, 2024
1 parent cc63b86 commit f54bdc1
Show file tree
Hide file tree
Showing 28 changed files with 443 additions and 354 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ examples/poro_*,1,*.png
examples/porv_*,1,*.png
examples/satnum_*,1,*.png
examples/sgas_*,1,*.png
examples/rsw_*,1,*.png
examples/fgip.png
tests/generic_deck

Expand Down
Binary file added docs/_images/sgas_diff.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/sgas_diff_edit.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/tcpu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion docs/_sources/api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
plopm Python API
================

The main script (and the only one by now) for the **plopm** executable is located in the `core <https://github.com/cssr-tools/plopm/blob/main/src/plopm/core>`_ folder.
The main script for the **plopm** executable is located in the `core <https://github.com/cssr-tools/plopm/blob/main/src/plopm/core>`_ folder.
The `utils <https://github.com/cssr-tools/plopm/blob/main/src/plopm/utils>`_ folder contains all different methods to handle the plotting.


.. include:: modules.rst
36 changes: 35 additions & 1 deletion docs/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,38 @@ To plot the location of the wells from the top view, then:
plopm -i SPE10_MODEL2 -w 1
.. image:: ./figs/wells.png
:scale: 20%
:scale: 20%

=====================
Different input files
=====================
Let us assume we have two different runs in different folders for the spe11b case, where the firsts results are save
in a folder called spe11b, and simulation results where the injection rate has been increased are saved in a folder
called spe11b_larger_inj. Then, to plot the summary vector for both runs we can execute:

.. code-block:: bash
plopm -i spe11b/SPE11B,/Users/dmar/spe11b_larger_inj/SPE11B -v tcpu -d 5,5 -c r,b -e 'solid;:' -t 'Comparing the simulation times' -f 10
.. image:: ./figs/tcpu.png

Here, we have lower the size of the figure to 5,5 inches, set to use red and blue colors with solid and dotted lines, as well as settting the title and lower the font size to 10.

.. tip::
For any summary variable, one can give the path to more than two different simulation cases, just by separating the folder paths by commas in the -i.

To look at the difference between these two simulations for the dynamic variable sgas at the restar step 3, this can be achieved by executing:

.. code-block:: bash
plopm -i spe11b/SPE11B,spe11b_larger_inj/SPE11B -v sgas -r 3
.. image:: ./figs/sgas_diff.png

To changue the colormap and setting the clorbar limits manually, this can be achieved by:

.. code-block:: bash
plopm -i spe11b/SPE11B,spe11b_larger_inj/SPE11B -v sgas -r 3 -c tab20c -b '[-0.8,0]'
.. image:: ./figs/sgas_diff_edit.png
21 changes: 14 additions & 7 deletions docs/_sources/introduction.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ and dynamic (e.g., pressure, fluid saturations) properties given any 2D slide (e
as well as plotting any given summary vector (e.g., field gas in place a.k.a fgip).

The **plopm** tool can be useful for quick inspection of geological models, as well as for generation of nice
figures for papers/presentations.
figures for papers/presentations. In addition, **plopm** can plot summary results from different simulation cases in the same figure,
as well as the difference between given dynamic variables (e.g., pressure) for two different simulations cases.

.. _overview:

Expand All @@ -28,20 +29,26 @@ The current implementation supports the following executable with the argument o
where

- \-i: The base name of the input deck and output files (`SPE11B` by default).
- \-o: The base name of the output folder (`output` by default).
- \-i: The base name of the input files; if more than one is given, separate them by ',' (e.g, 'SPE11B,SPE11B_TUNED') (`SPE11B` by default).
- \-o: The base name of the output folder (`.` by default).
- \-f: The font size (`14` by default).
- \-s: The slide for the 2D maps of the static variables, e.g, `10,,` to plot the xz plane on all cells with i=10 (`,1,` by default, i.e., the xz surface at j=1).
- \-x: Option to set the lower and upper bounds in the 2D map along x ('' by default).
- \-y: Option to set the lower and upper bounds in the 2D map along y ('' by default).
- \-z: The option to scale the axis in the 2d maps (`yes` by default).
- \-z: The option to scale the axis in the 2D maps (`yes` by default).
- \-u: Use resdata or opm Python libraries (`resdata` by default).
- \-v: Specify the name of the static vairable to plot (e.g., `depth`) ('' by default, i.e., plotting: porv, permx, permz, poro, fipnum, and satnum).
- \-c: Specify the colormap (e.g., `jet`) (' by default, i.e., set by plopm).
- \-c: Specify the colormap (e.g., `jet`) ('' by default, i.e., set by plopm).
- \-n: Specify the format for the numbers in the colormap (e.g., "lambda x, _: f'{x:.0f}'") ('' by default, i.e., set by plopm).
- \-l: Specify the units (e.g., \"[m\\$^2\\$]\") (`` by default, i.e., set by plopm).
- \-l: Specify the units (e.g., \"[m\\$^2\\$]\") ('' by default, i.e., set by plopm).
- \-r: Restart number to plot the dynamic variable, where 1 corresponds to the initial one ('-1' by default, i.e., the last restart file).
- \-w: Plot the positions of the wells or sources ('0' by default).
- \-g: Plot information about the number of cells in the x, y, and z directions and number of active grid cells ('0' by default).
- \-e: Specify the linestyles separated by ';' (e.g., 'solid;:') ('' by default, i.e., set by plopm).
- \-b: Specify the upper and lower bounds for the color map (e.g., '[-0.1,11]') ('' by default, i.e., set by matplotlib).
- \-d: Specify the dimensions of the Figure (e.g., '5,5') ('8,16' by default).
- \-t: Specify the figure title (e.g., 'Final saturation map') ('' by default, i.e., set by plopm).
- \-r: Restart number to plot the dynamic variable, where 1 corresponds to the initial one ('-1' by default, i.e., the last restart file).
- \-w: Plot the xz-position of the wells or sources ('0' by default).

Installation
------------
Expand Down
3 changes: 2 additions & 1 deletion docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@

<section id="plopm-python-api">
<h1>plopm Python API<a class="headerlink" href="#plopm-python-api" title="Link to this heading"></a></h1>
<p>The main script (and the only one by now) for the <strong>plopm</strong> executable is located in the <a class="reference external" href="https://github.com/cssr-tools/plopm/blob/main/src/plopm/core">core</a> folder.</p>
<p>The main script for the <strong>plopm</strong> executable is located in the <a class="reference external" href="https://github.com/cssr-tools/plopm/blob/main/src/plopm/core">core</a> folder.
The <a class="reference external" href="https://github.com/cssr-tools/plopm/blob/main/src/plopm/utils">utils</a> folder contains all different methods to handle the plotting.</p>
<section id="plopm">
<h2>plopm<a class="headerlink" href="#plopm" title="Link to this heading"></a></h2>
<div class="toctree-wrapper compound">
Expand Down
26 changes: 26 additions & 0 deletions docs/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<li class="toctree-l2"><a class="reference internal" href="#spe11b">SPE11B</a></li>
<li class="toctree-l2"><a class="reference internal" href="#norne">Norne</a></li>
<li class="toctree-l2"><a class="reference internal" href="#generic-deck">Generic deck</a></li>
<li class="toctree-l2"><a class="reference internal" href="#different-input-files">Different input files</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api.html">plopm Python API</a></li>
Expand Down Expand Up @@ -144,6 +145,31 @@ <h2>Generic deck<a class="headerlink" href="#generic-deck" title="Link to this h
</div>
<a class="reference internal image-reference" href="_images/wells.png"><img alt="_images/wells.png" src="_images/wells.png" style="width: 485.40000000000003px; height: 730.0px;" /></a>
</section>
<section id="different-input-files">
<h2>Different input files<a class="headerlink" href="#different-input-files" title="Link to this heading"></a></h2>
<p>Let us assume we have two different runs in different folders for the spe11b case, where the firsts results are save
in a folder called spe11b, and simulation results where the injection rate has been increased are saved in a folder
called spe11b_larger_inj. Then, to plot the summary vector for both runs we can execute:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>plopm<span class="w"> </span>-i<span class="w"> </span>spe11b/SPE11B,/Users/dmar/spe11b_larger_inj/SPE11B<span class="w"> </span>-v<span class="w"> </span>tcpu<span class="w"> </span>-d<span class="w"> </span><span class="m">5</span>,5<span class="w"> </span>-c<span class="w"> </span>r,b<span class="w"> </span>-e<span class="w"> </span><span class="s1">&#39;solid;:&#39;</span><span class="w"> </span>-t<span class="w"> </span><span class="s1">&#39;Comparing the simulation times&#39;</span><span class="w"> </span>-f<span class="w"> </span><span class="m">10</span>
</pre></div>
</div>
<img alt="_images/tcpu.png" src="_images/tcpu.png" />
<p>Here, we have lower the size of the figure to 5,5 inches, set to use red and blue colors with solid and dotted lines, as well as settting the title and lower the font size to 10.</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>For any summary variable, one can give the path to more than two different simulation cases, just by separating the folder paths by commas in the -i.</p>
</div>
<p>To look at the difference between these two simulations for the dynamic variable sgas at the restar step 3, this can be achieved by executing:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>plopm<span class="w"> </span>-i<span class="w"> </span>spe11b/SPE11B,spe11b_larger_inj/SPE11B<span class="w"> </span>-v<span class="w"> </span>sgas<span class="w"> </span>-r<span class="w"> </span><span class="m">3</span>
</pre></div>
</div>
<img alt="_images/sgas_diff.png" src="_images/sgas_diff.png" />
<p>To changue the colormap and setting the clorbar limits manually, this can be achieved by:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>plopm<span class="w"> </span>-i<span class="w"> </span>spe11b/SPE11B,spe11b_larger_inj/SPE11B<span class="w"> </span>-v<span class="w"> </span>sgas<span class="w"> </span>-r<span class="w"> </span><span class="m">3</span><span class="w"> </span>-c<span class="w"> </span>tab20c<span class="w"> </span>-b<span class="w"> </span><span class="s1">&#39;[-0.8,0]&#39;</span>
</pre></div>
</div>
<img alt="_images/sgas_diff_edit.png" src="_images/sgas_diff_edit.png" />
</section>
</section>


Expand Down
47 changes: 5 additions & 42 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,45 +78,22 @@
<h1 id="index">Index</h1>

<div class="genindex-jumpbox">
<a href="#G"><strong>G</strong></a>
| <a href="#I"><strong>I</strong></a>
<a href="#H"><strong>H</strong></a>
| <a href="#L"><strong>L</strong></a>
| <a href="#M"><strong>M</strong></a>
| <a href="#P"><strong>P</strong></a>

</div>
<h2 id="G">G</h2>
<h2 id="H">H</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.get_kws">get_kws() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.get_mesh">get_mesh() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.get_wells">get_wells() (in module plopm.core.plopm)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.get_xy_wells">get_xy_wells() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.get_xycoords">get_xycoords() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.get_xzcoords">get_xzcoords() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.get_yzcoords">get_yzcoords() (in module plopm.core.plopm)</a>
</li>
</ul></td>
</tr></table>

<h2 id="I">I</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.ini_dic">ini_dic() (in module plopm.core.plopm)</a>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.handle_slide_x">handle_slide_x() (in module plopm.core.plopm)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.ini_properties">ini_properties() (in module plopm.core.plopm)</a>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.handle_slide_y">handle_slide_y() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.ini_readers">ini_readers() (in module plopm.core.plopm)</a>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.handle_slide_z">handle_slide_z() (in module plopm.core.plopm)</a>
</li>
</ul></td>
</tr></table>
Expand All @@ -133,20 +110,6 @@ <h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.main">main() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.make_2dmaps">make_2dmaps() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.make_summary">make_summary() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.make_wells">make_wells() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.map_xycoords">map_xycoords() (in module plopm.core.plopm)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.map_xzcoords">map_xzcoords() (in module plopm.core.plopm)</a>
</li>
<li><a href="plopm.core.plopm.html#plopm.core.plopm.map_yzcoords">map_yzcoords() (in module plopm.core.plopm)</a>
</li>
<li>
module
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ <h1>Welcome to plopm’s documentation!<a class="headerlink" href="#welcome-to-p
<li class="toctree-l2"><a class="reference internal" href="examples.html#spe11b">SPE11B</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#norne">Norne</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#generic-deck">Generic deck</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#different-input-files">Different input files</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api.html">plopm Python API</a><ul>
Expand Down
21 changes: 14 additions & 7 deletions docs/introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ <h2>Concept<a class="headerlink" href="#concept" title="Link to this heading">
and dynamic (e.g., pressure, fluid saturations) properties given any 2D slide (e.g., the middle part of a reservoir in the xy plane),
as well as plotting any given summary vector (e.g., field gas in place a.k.a fgip).</p>
<p>The <strong>plopm</strong> tool can be useful for quick inspection of geological models, as well as for generation of nice
figures for papers/presentations.</p>
figures for papers/presentations. In addition, <strong>plopm</strong> can plot summary results from different simulation cases in the same figure,
as well as the difference between given dynamic variables (e.g., pressure) for two different simulations cases.</p>
</section>
<section id="overview">
<span id="id1"></span><h2>Overview<a class="headerlink" href="#overview" title="Link to this heading"></a></h2>
Expand All @@ -105,20 +106,26 @@ <h2>Concept<a class="headerlink" href="#concept" title="Link to this heading">
</div>
<p>where</p>
<ul class="simple">
<li><p>-i: The base name of the input deck and output files (<cite>SPE11B</cite> by default).</p></li>
<li><p>-o: The base name of the output folder (<cite>output</cite> by default).</p></li>
<li><p>-i: The base name of the input files; if more than one is given, separate them by ‘,’ (e.g, ‘SPE11B,SPE11B_TUNED’) (<cite>SPE11B</cite> by default).</p></li>
<li><p>-o: The base name of the output folder (<cite>.</cite> by default).</p></li>
<li><p>-f: The font size (<cite>14</cite> by default).</p></li>
<li><p>-s: The slide for the 2D maps of the static variables, e.g, <cite>10,,</cite> to plot the xz plane on all cells with i=10 (<cite>,1,</cite> by default, i.e., the xz surface at j=1).</p></li>
<li><p>-x: Option to set the lower and upper bounds in the 2D map along x (’’ by default).</p></li>
<li><p>-y: Option to set the lower and upper bounds in the 2D map along y (’’ by default).</p></li>
<li><p>-z: The option to scale the axis in the 2d maps (<cite>yes</cite> by default).</p></li>
<li><p>-z: The option to scale the axis in the 2D maps (<cite>yes</cite> by default).</p></li>
<li><p>-u: Use resdata or opm Python libraries (<cite>resdata</cite> by default).</p></li>
<li><p>-v: Specify the name of the static vairable to plot (e.g., <cite>depth</cite>) (’’ by default, i.e., plotting: porv, permx, permz, poro, fipnum, and satnum).</p></li>
<li><p>-c: Specify the colormap (e.g., <cite>jet</cite>) (’ by default, i.e., set by plopm).</p></li>
<li><p>-c: Specify the colormap (e.g., <cite>jet</cite>) (’ by default, i.e., set by plopm).</p></li>
<li><p>-n: Specify the format for the numbers in the colormap (e.g., “lambda x, _: f’{x:.0f}’”) (’’ by default, i.e., set by plopm).</p></li>
<li><p>-l: Specify the units (e.g., &quot;[m\$^2\$]&quot;) (`` by default, i.e., set by plopm).</p></li>
<li><p>-l: Specify the units (e.g., &quot;[m\$^2\$]&quot;) (’’ by default, i.e., set by plopm).</p></li>
<li><p>-r: Restart number to plot the dynamic variable, where 1 corresponds to the initial one (‘-1’ by default, i.e., the last restart file).</p></li>
<li><p>-w: Plot the positions of the wells or sources (‘0’ by default).</p></li>
<li><p>-g: Plot information about the number of cells in the x, y, and z directions and number of active grid cells (‘0’ by default).</p></li>
<li><p>-e: Specify the linestyles separated by ‘;’ (e.g., ‘solid;:’) (’’ by default, i.e., set by plopm).</p></li>
<li><p>-b: Specify the upper and lower bounds for the color map (e.g., ‘[-0.1,11]’) (’’ by default, i.e., set by matplotlib).</p></li>
<li><p>-d: Specify the dimensions of the Figure (e.g., ‘5,5’) (‘8,16’ by default).</p></li>
<li><p>-t: Specify the figure title (e.g., ‘Final saturation map’) (’’ by default, i.e., set by plopm).</p></li>
<li><p>-r: Restart number to plot the dynamic variable, where 1 corresponds to the initial one (‘-1’ by default, i.e., the last restart file).</p></li>
<li><p>-w: Plot the xz-position of the wells or sources (‘0’ by default).</p></li>
</ul>
</section>
<section id="installation">
Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
Loading

0 comments on commit f54bdc1

Please sign in to comment.