Skip to content

Commit b214315

Browse files
authored
Merge pull request #15 from daavid00/developing
Back-coupling example in the docs
2 parents 2f1af9c + ba49c59 commit b214315

23 files changed

+201
-81
lines changed

buildopm.sh

-29
This file was deleted.
Loading

docs/_images/fpr_plopm.png

52.7 KB
Loading

docs/_images/pressure_plopm.png

48.3 KB
Loading

docs/_sources/configuration_file.rst.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ the location of a point of interest to compare results, and the z position of th
6565
Killough hysteresis model on the gas relative permeability.
6666

6767
.. note::
68-
The functionality for back-coupling in line 22 is under development, see/run `back-coupling.txt <https://github.com/cssr-tools/expreccs/blob/main/tests/configs/back-coupling.txt>`_
69-
if you are curious.
68+
The functionality for back-coupling in line 22 is under development, see the :ref:`back_coupling` if you are curious.
7069

7170
.. figure:: figs/grids.png
7271

docs/_sources/examples.rst.txt

+42-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Examples
55
Example 1
66
---------
77

8-
We consider the configuration file 'example1.txt' in the
8+
We consider the configuration file `example1.txt <https://github.com/cssr-tools/expreccs/blob/main/examples/example1.txt>`_ in the
99
examples folder (the animation in the `Github home page <https://github.com/cssr-tools/expreccs>`_ was based on this configuration file).
1010
If the results are to be saved in a folder called 'hello_world', this is achieved by the following command:
1111

@@ -74,4 +74,44 @@ the pressures are projected.
7474

7575
.. code-block:: bash
7676
77-
expreccs -e name_of_folder_for_the_regional_model,name_of_folder_for_the_site_model
77+
expreccs -e name_of_folder_for_the_regional_model,name_of_folder_for_the_site_model
78+
79+
.. _back_coupling:
80+
81+
Back-coupling (under development)
82+
---------------------------------
83+
84+
We consider the configuration file `example1_back.txt <https://github.com/cssr-tools/expreccs/blob/main/examples/example1_back.txt>`_ in the examples folder.
85+
The plan is to update properties (e.g., transmissibility multipliers) in the regional model from features (e.g., faults) in the site model (i.e., not included in the regional model).
86+
By running:
87+
88+
.. code-block:: bash
89+
90+
expreccs -i example1_back.txt -o back-coupling -m all -p yes
91+
92+
This is one of the generated figures:
93+
94+
.. image:: ./figs/back-coupling_summary_BPR_regional_reference.png
95+
96+
The figures in the postprocessing includes the results for the first two iterations and the last one (in this case 9 since the number of
97+
iteration is set to 10 in line 22 of the `configuration_file <https://github.com/cssr-tools/expreccs/blob/main/examples/example1_back.txt>`_). To visualize/compare results
98+
between any of the iterations, we can use our friend `plopm <https://github.com/cssr-tools/plopm>`_.
99+
100+
.. tip::
101+
You can install plopm by executing in the terminal: pip install git+https://github.com/cssr-tools/plopm.git.
102+
103+
For example, to show the difference in the spatial maps for pressure at iteration 4 and 7 at the third restart, this is achieved by executing:
104+
105+
.. code-block:: bash
106+
107+
plopm -i back-coupling/output/regional_7/regional_7,back-coupling/output/regional_4/regional_4 -v pressure -r 3 -s ,,1 -c rainbow -n "lambda x, _: f'{x:.2f}'" -d 5,5
108+
109+
.. image:: ./figs/pressure_plopm.png
110+
111+
And to show the comparison for the summary vector FPR for iterations 1, 5, 7, and 9:
112+
113+
.. code-block:: bash
114+
115+
plopm -i back-coupling/output/regional_1/regional_1,back-coupling/output/regional_5/regional_5,back-coupling/output/regional_7/regional_7,back-coupling/output/regional_9/regional_9 -v fpr -d 5,5 -f 10
116+
117+
.. image:: ./figs/fpr_plopm.png

docs/configuration_file.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ <h2>Reservoir-related parameters<a class="headerlink" href="#reservoir-related-p
143143
Killough hysteresis model on the gas relative permeability.</p>
144144
<div class="admonition note">
145145
<p class="admonition-title">Note</p>
146-
<p>The functionality for back-coupling in line 22 is under development, see/run <a class="reference external" href="https://github.com/cssr-tools/expreccs/blob/main/tests/configs/back-coupling.txt">back-coupling.txt</a>
147-
if you are curious.</p>
146+
<p>The functionality for back-coupling in line 22 is under development, see the <a class="reference internal" href="examples.html#back-coupling"><span class="std std-ref">Back-coupling (under development)</span></a> if you are curious.</p>
148147
</div>
149148
<figure class="align-default" id="id1">
150149
<img alt="_images/grids.png" src="_images/grids.png" />

docs/examples.html

+30-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<li class="toctree-l2"><a class="reference internal" href="#example-1">Example 1</a></li>
5555
<li class="toctree-l2"><a class="reference internal" href="#example-2">Example 2</a></li>
5656
<li class="toctree-l2"><a class="reference internal" href="#generic-under-development">Generic (under development)</a></li>
57+
<li class="toctree-l2"><a class="reference internal" href="#back-coupling-under-development">Back-coupling (under development)</a></li>
5758
</ul>
5859
</li>
5960
<li class="toctree-l1"><a class="reference internal" href="api.html">expreccs Python API</a></li>
@@ -90,7 +91,7 @@
9091
<h1>Examples<a class="headerlink" href="#examples" title="Link to this heading"></a></h1>
9192
<section id="example-1">
9293
<h2>Example 1<a class="headerlink" href="#example-1" title="Link to this heading"></a></h2>
93-
<p>We consider the configuration file example1.txt in the
94+
<p>We consider the configuration file <a class="reference external" href="https://github.com/cssr-tools/expreccs/blob/main/examples/example1.txt">example1.txt</a> in the
9495
examples folder (the animation in the <a class="reference external" href="https://github.com/cssr-tools/expreccs">Github home page</a> was based on this configuration file).
9596
If the results are to be saved in a folder called ‘hello_world’, this is achieved by the following command:</p>
9697
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>expreccs<span class="w"> </span>-i<span class="w"> </span>example1.txt<span class="w"> </span>-o<span class="w"> </span>hello_world
@@ -157,6 +158,34 @@ <h2>Generic (under development)<a class="headerlink" href="#generic-under-develo
157158
</pre></div>
158159
</div>
159160
</section>
161+
<section id="back-coupling-under-development">
162+
<span id="back-coupling"></span><h2>Back-coupling (under development)<a class="headerlink" href="#back-coupling-under-development" title="Link to this heading"></a></h2>
163+
<p>We consider the configuration file <a class="reference external" href="https://github.com/cssr-tools/expreccs/blob/main/examples/example1_back.txt">example1_back.txt</a> in the examples folder.
164+
The plan is to update properties (e.g., transmissibility multipliers) in the regional model from features (e.g., faults) in the site model (i.e., not included in the regional model).
165+
By running:</p>
166+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>expreccs<span class="w"> </span>-i<span class="w"> </span>example1_back.txt<span class="w"> </span>-o<span class="w"> </span>back-coupling<span class="w"> </span>-m<span class="w"> </span>all<span class="w"> </span>-p<span class="w"> </span>yes
167+
</pre></div>
168+
</div>
169+
<p>This is one of the generated figures:</p>
170+
<img alt="_images/back-coupling_summary_BPR_regional_reference.png" src="_images/back-coupling_summary_BPR_regional_reference.png" />
171+
<p>The figures in the postprocessing includes the results for the first two iterations and the last one (in this case 9 since the number of
172+
iteration is set to 10 in line 22 of the <a class="reference external" href="https://github.com/cssr-tools/expreccs/blob/main/examples/example1_back.txt">configuration_file</a>). To visualize/compare results
173+
between any of the iterations, we can use our friend <a class="reference external" href="https://github.com/cssr-tools/plopm">plopm</a>.</p>
174+
<div class="admonition tip">
175+
<p class="admonition-title">Tip</p>
176+
<p>You can install plopm by executing in the terminal: pip install git+https://github.com/cssr-tools/plopm.git.</p>
177+
</div>
178+
<p>For example, to show the difference in the spatial maps for pressure at iteration 4 and 7 at the third restart, this is achieved by executing:</p>
179+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>plopm<span class="w"> </span>-i<span class="w"> </span>back-coupling/output/regional_7/regional_7,back-coupling/output/regional_4/regional_4<span class="w"> </span>-v<span class="w"> </span>pressure<span class="w"> </span>-r<span class="w"> </span><span class="m">3</span><span class="w"> </span>-s<span class="w"> </span>,,1<span class="w"> </span>-c<span class="w"> </span>rainbow<span class="w"> </span>-n<span class="w"> </span><span class="s2">&quot;lambda x, _: f&#39;{x:.2f}&#39;&quot;</span><span class="w"> </span>-d<span class="w"> </span><span class="m">5</span>,5
180+
</pre></div>
181+
</div>
182+
<img alt="_images/pressure_plopm.png" src="_images/pressure_plopm.png" />
183+
<p>And to show the comparison for the summary vector FPR for iterations 1, 5, 7, and 9:</p>
184+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>plopm<span class="w"> </span>-i<span class="w"> </span>back-coupling/output/regional_1/regional_1,back-coupling/output/regional_5/regional_5,back-coupling/output/regional_7/regional_7,back-coupling/output/regional_9/regional_9<span class="w"> </span>-v<span class="w"> </span>fpr<span class="w"> </span>-d<span class="w"> </span><span class="m">5</span>,5<span class="w"> </span>-f<span class="w"> </span><span class="m">10</span>
185+
</pre></div>
186+
</div>
187+
<img alt="_images/fpr_plopm.png" src="_images/fpr_plopm.png" />
188+
</section>
160189
</section>
161190

162191

docs/expreccs.html

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ <h2>Subpackages<a class="headerlink" href="#subpackages" title="Link to this hea
196196
</ul>
197197
</li>
198198
<li class="toctree-l3"><a class="reference internal" href="expreccs.visualization.reading.html">expreccs.visualization.reading module</a><ul>
199+
<li class="toctree-l4"><a class="reference internal" href="expreccs.visualization.reading.html#expreccs.visualization.reading.define_cases"><code class="docutils literal notranslate"><span class="pre">define_cases()</span></code></a></li>
199200
<li class="toctree-l4"><a class="reference internal" href="expreccs.visualization.reading.html#expreccs.visualization.reading.handle_smsp_time"><code class="docutils literal notranslate"><span class="pre">handle_smsp_time()</span></code></a></li>
200201
<li class="toctree-l4"><a class="reference internal" href="expreccs.visualization.reading.html#expreccs.visualization.reading.manage_names"><code class="docutils literal notranslate"><span class="pre">manage_names()</span></code></a></li>
201202
<li class="toctree-l4"><a class="reference internal" href="expreccs.visualization.reading.html#expreccs.visualization.reading.opm_arrays"><code class="docutils literal notranslate"><span class="pre">opm_arrays()</span></code></a></li>

docs/expreccs.visualization.html

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi
114114
</ul>
115115
</li>
116116
<li class="toctree-l1"><a class="reference internal" href="expreccs.visualization.reading.html">expreccs.visualization.reading module</a><ul>
117+
<li class="toctree-l2"><a class="reference internal" href="expreccs.visualization.reading.html#expreccs.visualization.reading.define_cases"><code class="docutils literal notranslate"><span class="pre">define_cases()</span></code></a></li>
117118
<li class="toctree-l2"><a class="reference internal" href="expreccs.visualization.reading.html#expreccs.visualization.reading.handle_smsp_time"><code class="docutils literal notranslate"><span class="pre">handle_smsp_time()</span></code></a></li>
118119
<li class="toctree-l2"><a class="reference internal" href="expreccs.visualization.reading.html#expreccs.visualization.reading.manage_names"><code class="docutils literal notranslate"><span class="pre">manage_names()</span></code></a></li>
119120
<li class="toctree-l2"><a class="reference internal" href="expreccs.visualization.reading.html#expreccs.visualization.reading.opm_arrays"><code class="docutils literal notranslate"><span class="pre">opm_arrays()</span></code></a></li>

docs/expreccs.visualization.reading.html

+14
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,20 @@
8888
<span id="expreccs-visualization-reading-module"></span><h1>expreccs.visualization.reading module<a class="headerlink" href="#module-expreccs.visualization.reading" title="Link to this heading"></a></h1>
8989
<p>
9090
Script to read OPM Flow output files</p>
91+
<dl class="py function">
92+
<dt class="sig sig-object py" id="expreccs.visualization.reading.define_cases">
93+
<span class="sig-prename descclassname"><span class="pre">expreccs.visualization.reading.</span></span><span class="sig-name descname"><span class="pre">define_cases</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dic</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fol</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">folders</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#expreccs.visualization.reading.define_cases" title="Link to this definition"></a></dt>
94+
<dd><p>Only plot the first two and last cases for the back-coupling</p>
95+
<dl>
96+
<dt>Args:</dt><dd><p>dic (dict): Global dictionary</p>
97+
<p>fol (str): Name of the output folder</p>
98+
<p>folders (list): Names of the cases</p>
99+
</dd>
100+
<dt>Returns:</dt><dd><p>dic (dict): Modified global dictionary</p>
101+
</dd>
102+
</dl>
103+
</dd></dl>
104+
91105
<dl class="py function">
92106
<dt class="sig sig-object py" id="expreccs.visualization.reading.handle_smsp_time">
93107
<span class="sig-prename descclassname"><span class="pre">expreccs.visualization.reading.</span></span><span class="sig-name descname"><span class="pre">handle_smsp_time</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dic</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fol</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">res</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#expreccs.visualization.reading.handle_smsp_time" title="Link to this definition"></a></dt>

docs/genindex.html

+4
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ <h2 id="C">C</h2>
138138

139139
<h2 id="D">D</h2>
140140
<table style="width: 100%" class="indextable genindextable"><tr>
141+
<td style="width: 33%; vertical-align: top;"><ul>
142+
<li><a href="expreccs.visualization.reading.html#expreccs.visualization.reading.define_cases">define_cases() (in module expreccs.visualization.reading)</a>
143+
</li>
144+
</ul></td>
141145
<td style="width: 33%; vertical-align: top;"><ul>
142146
<li><a href="expreccs.utils.reg_sit_given_decks.html#expreccs.utils.reg_sit_given_decks.dynamic_mapping">dynamic_mapping() (in module expreccs.utils.reg_sit_given_decks)</a>
143147
</li>

docs/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ <h1>Welcome to expreccs’s documentation!<a class="headerlink" href="#welcome-t
109109
<li class="toctree-l2"><a class="reference internal" href="examples.html#example-1">Example 1</a></li>
110110
<li class="toctree-l2"><a class="reference internal" href="examples.html#example-2">Example 2</a></li>
111111
<li class="toctree-l2"><a class="reference internal" href="examples.html#generic-under-development">Generic (under development)</a></li>
112+
<li class="toctree-l2"><a class="reference internal" href="examples.html#back-coupling-under-development">Back-coupling (under development)</a></li>
112113
</ul>
113114
</li>
114115
<li class="toctree-l1"><a class="reference internal" href="api.html">expreccs Python API</a><ul>

docs/objects.inv

48 Bytes
Binary file not shown.

docs/searchindex.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/text/configuration_file.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ the location of a point of interest to compare results, and the z position of th
6565
Killough hysteresis model on the gas relative permeability.
6666

6767
.. note::
68-
The functionality for back-coupling in line 22 is under development, see/run `back-coupling.txt <https://github.com/cssr-tools/expreccs/blob/main/tests/configs/back-coupling.txt>`_
69-
if you are curious.
68+
The functionality for back-coupling in line 22 is under development, see the :ref:`back_coupling` if you are curious.
7069

7170
.. figure:: figs/grids.png
7271

docs/text/examples.rst

+42-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Examples
55
Example 1
66
---------
77

8-
We consider the configuration file 'example1.txt' in the
8+
We consider the configuration file `example1.txt <https://github.com/cssr-tools/expreccs/blob/main/examples/example1.txt>`_ in the
99
examples folder (the animation in the `Github home page <https://github.com/cssr-tools/expreccs>`_ was based on this configuration file).
1010
If the results are to be saved in a folder called 'hello_world', this is achieved by the following command:
1111

@@ -74,4 +74,44 @@ the pressures are projected.
7474

7575
.. code-block:: bash
7676
77-
expreccs -e name_of_folder_for_the_regional_model,name_of_folder_for_the_site_model
77+
expreccs -e name_of_folder_for_the_regional_model,name_of_folder_for_the_site_model
78+
79+
.. _back_coupling:
80+
81+
Back-coupling (under development)
82+
---------------------------------
83+
84+
We consider the configuration file `example1_back.txt <https://github.com/cssr-tools/expreccs/blob/main/examples/example1_back.txt>`_ in the examples folder.
85+
The plan is to update properties (e.g., transmissibility multipliers) in the regional model from features (e.g., faults) in the site model (i.e., not included in the regional model).
86+
By running:
87+
88+
.. code-block:: bash
89+
90+
expreccs -i example1_back.txt -o back-coupling -m all -p yes
91+
92+
This is one of the generated figures:
93+
94+
.. image:: ./figs/back-coupling_summary_BPR_regional_reference.png
95+
96+
The figures in the postprocessing includes the results for the first two iterations and the last one (in this case 9 since the number of
97+
iteration is set to 10 in line 22 of the `configuration_file <https://github.com/cssr-tools/expreccs/blob/main/examples/example1_back.txt>`_). To visualize/compare results
98+
between any of the iterations, we can use our friend `plopm <https://github.com/cssr-tools/plopm>`_.
99+
100+
.. tip::
101+
You can install plopm by executing in the terminal: pip install git+https://github.com/cssr-tools/plopm.git.
102+
103+
For example, to show the difference in the spatial maps for pressure at iteration 4 and 7 at the third restart, this is achieved by executing:
104+
105+
.. code-block:: bash
106+
107+
plopm -i back-coupling/output/regional_7/regional_7,back-coupling/output/regional_4/regional_4 -v pressure -r 3 -s ,,1 -c rainbow -n "lambda x, _: f'{x:.2f}'" -d 5,5
108+
109+
.. image:: ./figs/pressure_plopm.png
110+
111+
And to show the comparison for the summary vector FPR for iterations 1, 5, 7, and 9:
112+
113+
.. code-block:: bash
114+
115+
plopm -i back-coupling/output/regional_1/regional_1,back-coupling/output/regional_5/regional_5,back-coupling/output/regional_7/regional_7,back-coupling/output/regional_9/regional_9 -v fpr -d 5,5 -f 10
116+
117+
.. image:: ./figs/fpr_plopm.png
Loading

docs/text/figs/fpr_plopm.png

52.7 KB
Loading

docs/text/figs/pressure_plopm.png

48.3 KB
Loading

examples/example1_back.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pres #Use free/closed/porv/porvproj/flux/pres/pres2p/well
1919
7000 7000 0 #Sensor position x, y, and z to assess the error over time w.r.t the reference solution [m]
2020
0 #The function for the reservoir surface
2121
0 0 #Add hysteresis (1/0) and salinity (value [1E-3 kg-M/kg])
22-
3 #Number of interations for back-coupling
22+
10 #Number of interations for back-coupling
2323

2424
"""Set the saturation functions"""
2525
krw * ((sw - swi) / (1.0 - sni -swi)) ** nkrw #Wetting rel perm saturation function [-]

0 commit comments

Comments
 (0)