Skip to content

Commit

Permalink
Added functionality, updated docs, and new drogon generic example
Browse files Browse the repository at this point in the history
  • Loading branch information
daavid00 committed Sep 10, 2024
1 parent c80019d commit 6f19c2f
Show file tree
Hide file tree
Showing 48 changed files with 441 additions and 272 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,17 @@ cython_debug/

# Tests
tests/configs/ert/
tests/configs/output/
tests/generic_deck
tests/configs/ert
tests/configs/jobs
tests/configs/logs
tests/configs/observations
tests/configs/parameters
tests/configs/output
tests/configs/postprocessing
tests/configs/preprocessing
tests/configs/.ert_runpath_list
tests/configs/ert.ert

# Python environment
vpycopm/
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Hola hola :).
Hola hola 🙂.
The following is a set of guidelines for contributing to pycopm.

## Ground Rules
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ See the [_installation_](https://cssr-tools.github.io/pycopm/installation.html)
## Running pycopm
You can run _pycopm_ as a single command line:
```
pycopm -i some_input -o some_output_folder
pycopm -i name_of_input_file
```
Run `pycopm --help` to see all possible command line argument options.

Expand Down
Binary file added docs/_images/drogon_generic.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 modified docs/_images/plopm.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 modified docs/_images/pyopmspe11.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 27 additions & 4 deletions docs/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ then:

.. code-block:: bash
pycopm -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o . -c 5,4,3 -a mode -j 1000
pycopm -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o . -c 5,4,3 -a mode
will generate a coarser model 5 times in the x direction, 4 in the y direction, and 3 in the z direction, where the mode is
used to decide if a coarser cell should be active or inactive. The jump (-j) is set to a higher value (1000) to avoid removal
of grid connections (this is a tunning value to remove generated connections between neighbours in the coarse model).
used to decide if a coarser cell should be active or inactive.

We can execute a dry run of OPM Flow to generate the grid and static variables of the coarser model:

Expand All @@ -76,4 +75,28 @@ We use our `plopm <https://github.com/cssr-tools/plopm>`_ friend to generate PNG
.. note::
In the current implementation of the **pycopm** tool, the handling of properties that require definitions of i,j,k indices
(e.g., FAULTS, WELLSPECS) are assumed to be define in the main .DATA deck. Then, in order to use **pycopm** for simulation models
where these properties are define via include files, replace those includes in the .DATA deck with the actual content of the include files.
where these properties are define via include files, replace those includes in the .DATA deck with the actual content of the include files.

Generic Drogon
--------------
Following the note above, then by downloading the `DROGON model <https://github.com/OPM/opm-tests/tree/master/drogon>`_, replacing the lines in
`DROGON_HIST.DATA <https://github.com/OPM/opm-tests/blob/master/drogon/model/DROGON_HIST.DATA>`_ for the FAULTS (L127-128) and SCHEDULE (L242-243) with
the actual content of those include files, then by executing:

.. code-block:: bash
pycopm -i DROGON_HIST.DATA -o . -c 1,1,3 -a min -n max -p 1
pycopm -i DROGON_HIST_PYCOPM.DATA -o . -c 1,3,1 -a mode -n mode -p 1 -j 1.9
this would generate the following coarse model:

.. figure:: figs/drogon_generic.png

Note that the total pore volume is conserved for the coarse model.

Here, we first coarse in the z direction, which reduces the number of cells from 31 to 11, and after we coarse in the y direction.
After trial and error, the jump (-j) is set to 1.9 to avoid generated connections across the faults.

.. note::
After genereting the first coarser deck (DROGON_HIST_PYCOPM.DATA), change the path '../include/props/drogon.swatinit' to 'SWATINIT.INC',
which contains the right number of values for the coarse model.
16 changes: 8 additions & 8 deletions docs/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@ in the terminal the following lines (which in turn should build flow in the fold
CURRENT_DIRECTORY="$PWD"
for repo in common grid models simulators
for repo in common grid simulators
do
git clone https://github.com/OPM/opm-$repo.git
done
mkdir build
for repo in common grid models
for repo in common grid
do
mkdir build/opm-$repo
cd build/opm-$repo
cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common" $CURRENT_DIRECTORY/opm-$repo
make -j5 opm$repo
cd ../..
done
mkdir build/opm-simulators
cd build/opm-simulators
cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-simulators
make -j5 flow
cd ../..
Expand All @@ -95,25 +95,25 @@ For macOS, there are no available binary packages, so OPM Flow needs to be built
./dune-common/bin/dunecontrol --only=dune-$module make -j5
done
for repo in common grid models simulators
for repo in common grid simulators
do
git clone https://github.com/OPM/opm-$repo.git
done
mkdir build
for repo in common grid models
for repo in common grid
do
mkdir build/opm-$repo
cd build/opm-$repo
cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
cmake -DPYTHON_EXECUTABLE=$(which python) -DWITH_NDEBUG=1 -DUSE_MPI=0 -DOPM_ENABLE_PYTHON=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common" $CURRENT_DIRECTORY/opm-$repo
make -j5 opm$repo
cd ../..
done
mkdir build/opm-simulators
cd build/opm-simulators
cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-simulators
make -j5 flow
cd ../..
Expand Down
27 changes: 15 additions & 12 deletions docs/_sources/introduction.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Introduction

.. image:: ./figs/pycopm.gif

This documentation describes the content of the **pycopm** package.
This documentation describes the **pycopm** tool hosted in `https://github.com/cssr-tools/pycopm <https://github.com/cssr-tools/pycopm>`_.

Concept
-------
Expand All @@ -28,17 +28,20 @@ The current implementation supports the following executable with the argument o

.. code-block:: bash
pycopm -i some_input -o some_output_folder
pycopm -i name_of_input_file
where

- \-i: The base name of the :doc:`configuration file <./configuration_file>` or the name of the deck (`input.txt` by default).
- \-o: The base name of the :doc:`output folder <./output_folder>` (`output` by default).
- \-f: OPM Flow full path to executable or just `flow` (`flow` by default).
- \-c: Level of coarsening in the x, y, and z dir (`2,2,2` by default).
- \-a: Use min, max, or mode to scale the actnum (`min` by default).
- \-j: Tunning parameter to avoid creation of nnc on the structural faults (`2.` by default).
- \-x: Vector of x-coarsening (`` by default).
- \-y: Vector of y-coarsening (`` by default).
- \-z: Vector of z-coarsening (`` by default).
- \-e: Use `utf8` or `ISO-8859-1` encoding to read the deck (`ISO-8859-1` by default).
-i The base name of the :doc:`configuration file <./configuration_file>` or the name of the deck, e.g., `DROGON.DATA`, (`input.txt` by default).
-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).
-c Level of coarsening in the x, y, and z dir (`2,2,2` by default).
-a Use `min`, `max`, or `mode` to scale the actnum, e.g., min makes the new coarser cell inactive it at least one cell is inactive, while max makes it active it at least one cell is active (`max` by default).
-j Tuning parameter to avoid creation of neighbouring connections in the coarser model where there are discontinuities between cells along the z direction, e.g., around faults ('' by default, i.e., nothing corrected; if need it, try with values of the order of 1).
-x Vector 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 coarser 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 ('' by default),
-y Vector of y-coarsening, see the description for -x ('' by default).
-z Vector of z-coarsening, see the description for -x ('' by default).
-e Use `utf8` or `ISO-8859-1` encoding to read the deck (`ISO-8859-1` by default).
-p Add the removed pore volume to the closest coarser cells (`0` by default, `1` to enable).
-n Use `min`, `max`, or `mode` to scale satnum, fipnum, pvtnum, eqlnum, imbnum, and multnum (`mode` by default).
-s Use `min`, `max`, or `mean` to scale permx, permy, permz, and poro ('' by default, i.e., using the arithmetic average for permx/permy, harmonic average for permz, and the mean for the porosity).
2 changes: 1 addition & 1 deletion docs/_sources/related.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plopm

.. image:: ./figs/plopm.png

`Quick generation of PNG figures from a simulation model given any 2D slide <https://github.com/cssr-tools/plopm>`_.
`Quick generation of PNGs, GIFs, and VTKs from a OPM Flow type model <https://github.com/cssr-tools/plopm>`_.

********
expreccs
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/doctools.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Base JavaScript utilities for all Sphinx HTML documentation.
*
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
4 changes: 2 additions & 2 deletions docs/_static/language_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/

var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];


/* Non-minified version is copied as a separate JS file, if available */
/* Non-minified version is copied as a separate JS file, is available */

/**
* Porter Stemmer
Expand Down
Loading

0 comments on commit 6f19c2f

Please sign in to comment.