Skip to content

Submodels around wells #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed docs/_images/pyopmnearwell.gif
Binary file not shown.
Binary file added docs/_images/pyopmnearwell.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/submodelwell.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/vicinity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 30 additions & 20 deletions docs/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Via OPM Flow decks
==================

The current development of **pycopm** focuses on creating tailored models (grid refinement, grid coarsening, submodels, and transformations) by using input decks.
While in the Hello world example these four different options are demonstrated, for the latter examples the focus is on the grid coarsening functionality.
While in the Hello world example these four different options are demonstrated, for the latter examples the focus is on the grid coarsening functionality, and the
SPE10 also shows the submodel functionality.

Hello world
-----------
Expand Down Expand Up @@ -70,22 +71,6 @@ we apply a grid refinement on the cells in the middle x and y location, and fina
The text in the legends highlight that the pore volume is conserved (35.58) and the number of active cells is reduced from 351 to 25 in the
submodel and after increased to 41 due to the grid refinement.


SPE10
-----

By downloading the `SPE10_MODEL2 model <https://github.com/OPM/opm-data/tree/master/spe10model2>`_, then:

.. code-block:: bash

pycopm -i SPE10_MODEL2.DATA -o coarser -c 4,8,2

generates a coarsened model from ca. 1 million cells to ca. 20 thousands cells.

.. figure:: figs/spe10_model2_coarser.png

Porosity values for the (left) original and (right) coarsed SPE10 model.

Smeaheia
--------

Expand All @@ -94,7 +79,7 @@ then:

.. code-block:: bash

pycopm -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o . -c 5,4,3 -a min -m all
pycopm -c 5,4,3 -a min -m all -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o .

will generate a coarser model 5 times in the x direction, 4 in the y direction, and 3 in the z direction, where the coarse cell is
made inactive if at least one cell is inactive (**-a min**).
Expand All @@ -103,7 +88,7 @@ We use our `plopm <https://github.com/cssr-tools/plopm>`_ friend to generate PNG

.. code-block:: bash

plopm -i ' STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PREP_PYCOPM_DRYRUN STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PYCOPM' -s ,,0 -v poro -subfigs 1,2 -save smeaheia -t 'Smeaheia Coarsed smeaheia' -xunits km -xformat .0f -yunits km -yformat .0f -d 5,5.2 -suptitle 0 -c cet_rainbow_bgyrm_35_85_c69 -cbsfax 0.30,0.01,0.4,0.02 -cformat .2f
plopm -i 'STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PREP_PYCOPM_DRYRUN STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PYCOPM' -s ,,0 -v poro -subfigs 1,2 -save smeaheia -t 'Smeaheia Coarsed smeaheia' -xunits km -xformat .0f -yunits km -yformat .0f -d 5,5.2 -suptitle 0 -c cet_rainbow_bgyrm_35_85_c69 -cbsfax 0.30,0.01,0.4,0.02 -cformat .2f

.. figure:: figs/smeia.png

Expand Down Expand Up @@ -200,8 +185,33 @@ example), then here we create a coarsened model by removing certain pilars in or

.. code-block:: bash

pycopm -i NORNE_ATW2013.DATA -x 0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,2,0,2,2,2,2,0 -y 0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,2,2,2,2,2,2,2,2,0 -z 0,0,2,0,0,2,2,2,2,2,0,2,2,2,2,2,0,0,2,0,2,2,0 -a min -p 1 -q 1 -m all
pycopm -i NORNE_ATW2013.DATA -s pvmean -x 0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,2,0,2,2,2,2,0 -y 0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,2,2,2,2,2,2,2,2,0 -z 0,0,2,0,0,2,2,2,2,2,0,2,2,2,2,2,0,0,2,0,2,2,0 -a min -p 1 -q 1 -m all

this would generate the following coarsened model:

.. figure:: figs/norne_vec.png

SPE10
-----

By downloading the `SPE10_MODEL2 model <https://github.com/OPM/opm-data/tree/master/spe10model2>`_, then:

.. code-block:: bash

pycopm -i SPE10_MODEL2.DATA -s pvmean -c 4,8,2

generates a coarsened model from ca. 1 million cells to ca. 20 thousands cells.

.. figure:: figs/spe10_model2_coarser.png

Porosity values for the (left) original and (right) coarsed SPE10 model.

To generate a submodel from the coarsened model around the injector 'INJ', this can be achieved by executing:

.. code-block:: bash

pycopm -i SPE10_MODEL2_PYCOPM.DATA -p 1 -v 'INJ diamondxy 5' -m all -w vicinity -l sub

.. figure:: figs/vicinity.png

Pore volume values for the (left) coarsened and (right) vicinity around the well INJ in the SPE10 model.
2 changes: 1 addition & 1 deletion docs/_sources/introduction.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ where
-o The base name of the :doc:`output folder <./output_folder>` ('.' by default, i.e., the folder where pycopm is executed).
-f OPM Flow full path to executable or just 'flow' ('flow' by default).
-m Execute a dry run of the input deck to generate the static properties ('prep'), generate only the modified files ('deck'), only exectute a dry run on the generated model ('dry'), 'prep_deck', 'deck_dry', or do all ('all') ('prep_deck' by default).
-v The location to extract the sub model which can be assigned by a region assignation, e.g., 'fipnum 2,4' extracts the cells with fipnums equal to 2 or 4, or can be assigned by a polygon given the xy locations in meters, e.g., 'xypolygon [0,0] [30,0] [30,30] [0,0]' ('' by default).
-v The location to extract the sub model which can be assigned by region values, e.g., 'fipnum 2,4' extracts the cells with fipnums equal to 2 or 4, by a polygon given the xy locations in meters, e.g., 'xypolygon [0,0] [30,0] [30,30] [0,0]', or by the name of the well and three different options for the neighbourhood: box, diamond, and diamondxy, where for box the i, j, and k interval around the connections are given, e.g., 'welln box [-1,1] [-2,2] [0,3]' results in a vicinity with 1 pm cell in the x direction, 2 pm cells in the y direction and only 3 cells in the k positive direction, while the diamond considers only the given number of cells around the well connections (e.g., 'welln diamond 2') and diamondxy it is restricted to the xy plane ('' by default).
-c Level of coarsening in the x, y, and z dir ('2,2,2' by default; either use this flag or the -x, -y, and -z ones).
-x Array of x-coarsening, e.g., if the grid has 6 cells in the x direction, then '0,2,0,2,0,2,0' would generate a coarsened model with 3 cells, while '0,2,2,2,2,2,0' would generate a coarser model with 1 cell, i.e., 0 keeps the pilars while 2 removes them. As an alternative, the range of the cells to coarse can be given separate them by commas, e.g., '1:3,5:6' generates a coarsened model with 3 cells where the cells with the first three and two last i indices are coarsened to one ('' by default),
-y Array of y-coarsening, see the description for -x ('' by default).
Expand Down
6 changes: 3 additions & 3 deletions docs/_sources/related.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ pyopmspe11
pyopmnearwell
*************

.. image:: ./figs/pyopmnearwell.gif
:scale: 50%
.. image:: ./figs/pyopmnearwell.png
:scale: 60%

`A framework to simulate near well dynamics using OPM Flow <https://github.com/cssr-tools/pyopmnearwell>`_.
`A Python framework to simulate near well dynamics using OPM Flow <https://github.com/cssr-tools/pyopmnearwell>`_.

*****
plopm
Expand Down
9 changes: 8 additions & 1 deletion docs/_sources/theory.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ Regarding the boundary conditions in the extracted model with respect to the por
Figure 3: The shape to extract the sudmodel corresponds to "-v 'xypolygon [50,90] [60,60] [90,60] [65,40] [75,10] [50,30] [25,10] [35,40] [10,60] [40,60] [50,90]'".
The j indices for the cells have been accordingly shifted in the extracted model, and the right figure shows the projected pore volume on the boundary.

In addition, it is possible to extract submodels around wells, with three different options for the neighbourhood: box, diamond, and diamondxy. The box option allows to define
the intervals to extract the cells, while the diamond and diamondxy results in fewer cells since the cells in the corners are trimmed.

.. figure:: figs/submodelwell.png

Figure 4: The submodel in `norne <https://github.com/OPM/opm-tests/tree/master/norne>`_ by executing "-v 'E-3H diamondxy 0' -p 1", "-v 'E-3H diamond 1' -p 1", and "-v 'E-3H box [-1,2] [-2,3] [-1,1]' -p 1" respectively.

===============
Transformations
===============
Expand All @@ -143,4 +150,4 @@ groups which missmatch in the thickness of layers), and rotations (e.g., to alig

.. figure:: figs/transformation.png

Figure 4: Extracted shape in Figure 3 after a rotation "-d 'rotatexy 45'" (left) and scaling "-d 'scale [1,0.25,1]'" (right).
Figure 5: Extracted shape in Figure 3 after a rotation "-d 'rotatexy 45'" (left) and scaling "-d 'scale [1,0.25,1]'" (right).
Loading