diff --git a/README.md b/README.md
index ac8488d..51ec1c3 100644
--- a/README.md
+++ b/README.md
@@ -4,16 +4,23 @@
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
-# pycopm: An open-source coarsening framework for OPM Flow
+# pycopm: An open-source coarsening framework for OPM Flow geological models
-This repository contains runscripts to create coarser models from given input decks.
-Here we use the [_OPM-Flow_](https://opm-project.org/?page_id=19) simulator.
+## Main feature
+Creation of coarser models from given input decks.
## Installation
You will first need to install
* Flow (https://opm-project.org, Release 2024.04 or current master branches)
-You can install the Python requirements in a virtual environment with the following commands:
+To install the _pycopm_ executable in an existing Python environment:
+
+```bash
+pip install git+https://github.com/cssr-tools/pycopm.git
+```
+
+If you are interested in modifying the source code, then you can clone the repository and
+install the Python requirements in a virtual environment with the following commands:
```bash
# Clone the repo
@@ -32,7 +39,7 @@ pip install -e .
pip install -r dev-requirements.txt
```
-See the [_CI.yml_](https://github.com/OPM/pycopm/blob/main/.github/workflows/CI.yml) script for installation of OPM Flow (binary packages) and the pycopm package. If you are a Linux user (including the Windows subsystem for Linux), then you could try to build Flow from the master branches with mpi support, by running the script `./build_opm-flow_mpi.bash`, which in turn should build flow in the folder ./build/opm-simulators/bin/flow (you first need to install the [_OPM-Flow-prerequisites_](https://opm-project.org/?page_id=239)).
+See the [_CI.yml_](https://github.com/OPM/pycopm/blob/main/.github/workflows/CI.yml) script for installation of OPM Flow (binary packages) and the pycopm package. If you are a Linux user (including the Windows subsystem for Linux), then you could try to build Flow from the master branches with mpi support, by running the script `./build_opm-flow_mpi.bash`, which in turn should build flow in the folder ./build/opm-simulators/bin/flow (you first need to install the [_OPM-Flow-prerequisites_](https://opm-project.org/?page_id=239)).
For macOS users, use at least a Python version of 3.10 (due to resdata), and run the `./build_opm-flow_macOS.bash` to build OPM Flow (the [_OPM-Flow-prerequisites_](https://opm-project.org/?page_id=239) can be installed via brew or macports).
@@ -44,9 +51,4 @@ pycopm -i some_input -o some_output_folder
Run `pycopm --help` to see all possible command line argument options.
## Getting started
-See the [_documentation_](https://cssr-tools.github.io/pycopm/introduction.html).
-
-## Citing
-If you use _pycopm_ in your research, please cite the following publication:
-
-Sandve, T.H., Lorentzen, R.J., Landa-MarbΓ‘n, D., Fossum, K., 2024. Closed-loop reservoir management using fast data-calibrated coarse models. In: ECMOR 2024, 1. European Association of Geoscientists & Engineers, 1β14.
\ No newline at end of file
+See the [_examples_](https://cssr-tools.github.io/pycopm/examples.html) in the [_documentation_](https://cssr-tools.github.io/pycopm/introduction.html).
\ No newline at end of file
diff --git a/docs/_images/contents.png b/docs/_images/contents.png
index 05d6822..1c62973 100644
Binary files a/docs/_images/contents.png and b/docs/_images/contents.png differ
diff --git a/docs/_images/output_generic.png b/docs/_images/output_generic.png
new file mode 100644
index 0000000..37d880a
Binary files /dev/null and b/docs/_images/output_generic.png differ
diff --git a/docs/_images/plopm.png b/docs/_images/plopm.png
new file mode 100644
index 0000000..b7b084f
Binary files /dev/null and b/docs/_images/plopm.png differ
diff --git a/docs/_images/smeia.png b/docs/_images/smeia.png
new file mode 100644
index 0000000..cd4845d
Binary files /dev/null and b/docs/_images/smeia.png differ
diff --git a/docs/_sources/about.rst.txt b/docs/_sources/about.rst.txt
index 7c48a9f..9ea1f09 100644
--- a/docs/_sources/about.rst.txt
+++ b/docs/_sources/about.rst.txt
@@ -5,6 +5,6 @@ About pycopm
.. image:: ./figs/droganim.gif
:scale: 65%
-The **pycopm** tool for coarsening geological models is being funded by the `Center for Sustainable Subsurface Resources (CSSR) `_ [project no. 331841].
+**pycopm**, a tool for coarsening OPM Flow geological models, is being funded by the `Center for Sustainable Subsurface Resources (CSSR) `_ [project no. 331841].
This is work in progress.
Contributions are more than welcome using the fork and pull request approach.
\ No newline at end of file
diff --git a/docs/_sources/configuration_file.rst.txt b/docs/_sources/configuration_file.rst.txt
index 8d85036..55316a4 100644
--- a/docs/_sources/configuration_file.rst.txt
+++ b/docs/_sources/configuration_file.rst.txt
@@ -1,6 +1,14 @@
==================
Configuration file
==================
+.. Note::
+ The configuration files allow to set the integrated studies (coarsening and history matching)
+ only for the drogon and norne model. To use **pycopm** in any given OPM Flow geological model
+ to generate the coarser files, this can be achieve without a configuration file, but setting
+ the parameters via command lines (see the :ref:`overview` or run `pycopm -h` for the definition
+ of the argument options, and the :doc:`examples <./examples>`.)
+
+
Here we use as an example one of the configuration files used in the tests
(see `ert.txt `_).
The first input parameter is:
diff --git a/docs/_sources/examples.rst.txt b/docs/_sources/examples.rst.txt
index 3969850..9f4fbd8 100644
--- a/docs/_sources/examples.rst.txt
+++ b/docs/_sources/examples.rst.txt
@@ -2,9 +2,12 @@
Examples
********
-==================
-Configuration file
-==================
+=======================
+Via configuration files
+=======================
+
+Drogon
+------
The `examples `_ folder contains configuration files
to perform HM studies in drogon and norne. For example, by executing inside the `example folder for drogon `_:
@@ -18,16 +21,59 @@ The following are the drogon model from `opm-tests `_
for an example where **pycopm** is used to coarse the
-`SPE10_MODEL2 model `_ by downloading the files and running:
+`SPE10_MODEL2 model `_ by downloading the OPM files and running:
.. code-block:: bash
pycopm -i SPE10_MODEL2.DATA -o coarser -c 4,8,2
-.. figure:: figs/spe10_model2_coarser.png
\ No newline at end of file
+.. figure:: figs/spe10_model2_coarser.png
+
+ Porosity values for the (left) original and (right) coarsed SPE10 model.
+
+Smeaheia
+--------
+
+By downloading the `Smeaheia simulation model `_,
+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
+
+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).
+
+We can execute a dry run of OPM Flow to generate the grid and static variables of the coarser model:
+
+.. code-block:: bash
+
+ flow STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PYCOPM.DATA --enable-dry-run=true
+
+We use our `plopm `_ friend to generate PNG figures:
+
+.. code-block:: bash
+
+ plopm -i STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PYCOPM -s ,,0
+
+.. figure:: figs/smeia.png
+
+ Porosity values for the (left) original and (right) coarsed model.
+
+.. tip::
+ You can install plopm by executing in the terminal: pip install git+https://github.com/cssr-tools/plopm.git.
+
+.. 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.
\ No newline at end of file
diff --git a/docs/_sources/introduction.rst.txt b/docs/_sources/introduction.rst.txt
index ed1d48b..c4b2857 100644
--- a/docs/_sources/introduction.rst.txt
+++ b/docs/_sources/introduction.rst.txt
@@ -5,20 +5,22 @@ Introduction
.. image:: ./figs/pycopm.gif
This documentation describes the content of the **pycopm** package.
-The numerical studies are performed using the `Flow `_ simulator.
Concept
-------
-Simplified and flexible framework for coarsening geological models. The initial implementation
-included two available models in `opm-tests `_: `norne `_
+Simplified and flexible framework to create coarser OPM Flow geological models.
+
+Roadmap
+-------
+In the initial development of the framework, the focus was two available models in `opm-tests `_: `norne `_
and `drogon `_, where the coarser models are used to perform history matching studies using
-the Ensemble based reservoir tool `ERT `_, via a :doc:`configuration file <./configuration_file>`. The current
-available options for parameters to HM are the saturation functions using the LET model and permeabilities. The plan is to extend the functionality to
-set up history matching/optimization studies using either `ERT `_, `PET `_,
-or `everest `_.
+the Ensemble based reservoir tool `ERT `_, via a :doc:`configuration file <./configuration_file>`.
+
+The current development of **pycopm** focuses on only creating coarser models (i.e., all needed input files to run OPM Flow) by only giving the OPM Flow input files
+(i.e., avoiding the manual work to create templates as it was done for drogon and norne). This allows for flexibility to adapt the generated coarser decks in your
+favourite history matching/optimization tool (e.g., `ERT `_, `PET `_, `everest `_).
-In addition, current work focuces on creating coarser grids by only giving the input files
-(i.e., avoiding the manual work to create templates as done for drogon and norne); see the :doc:`examples <./examples>`.
+.. _overview:
Overview
--------
@@ -30,10 +32,16 @@ The current implementation supports the following executable with the argument o
where
-- \-i, \-input: The base name of the :doc:`configuration file <./configuration_file>` or the name of the deck (`input.txt` by default).
-- \-o, \-output: The base name of the :doc:`output folder <./output_folder>` (`output` by default).
-- \-f, \-flow: Path to OPM Flow (`flow` by default).
-- \-c, \-coarsening: Level of coarsening in the x, y, and z dir (`2,2,2` by default)
+- \-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).
Installation
------------
@@ -41,3 +49,10 @@ See the `Github page `_.
.. tip::
Check the `CI.yml `_ file.
+
+Getting started
+---------------
+See the :doc:`examples <./examples>`.
+
+.. tip::
+ Check the `tests `_.
diff --git a/docs/_sources/output_folder.rst.txt b/docs/_sources/output_folder.rst.txt
index e6cf2f7..5e04a73 100644
--- a/docs/_sources/output_folder.rst.txt
+++ b/docs/_sources/output_folder.rst.txt
@@ -2,13 +2,31 @@
Output folder
=============
-The following screenshot shows the generated ERT configuration file and folders in the selected output folder after executing **pycopm**.
+Via configuration files
+-----------------------
+As described in the :doc:`introduction <./introduction>`, in the early development of **pycopm**
+the focus was on history matching studies using `ERT `_ for the
+`norne `_ and `drogon `_ geological models
+via a :doc:`configuration file <./configuration_file>`.
+
+The following screenshot shows the generated ERT configuration file and folders in the selected output folder after executing **pycopm**
+on the drogon model.
.. figure:: figs/output.png
(Left) example of generated files after executing **pycopm** and (right) some of the figures in the postprocessing folder.
The generate ert.ert file can be run directly calling ERT for further studies, and some useful plots and files
-are generated in the postprocessing folder. The OPM simulation results can be visualized using `ResInsight `_ .
-Then after running **pycopm**, one could modify the generated OPM coarser related files in the preprocessing folder to adapt to
-further existing frameworks (e.g., `PET `_, `everest `_).
\ No newline at end of file
+are generated in the postprocessing folder. The OPM simulation results can be visualized using `ResInsight `_.
+
+Via an OPM Flow input deck
+--------------------------
+The current development of **pycopm** focuces on only creating coarser models (i.e., all needed input files to run OPM Flow) by only giving the OPM Flow input files.
+
+The following screenshot shows the input deck and generated files in the selected output folder (coarser for this example) after executing **pycopm** on the SPE10 model (see the
+`test_generic_deck.py `_) file.
+
+.. figure:: figs/output_generic.png
+
+Then, after running **pycopm**, one could adapt the generated files with the coarser geological model in your
+favourite history matching/optimization tool (e.g., `ERT `_, `PET `_, `everest `_).
\ No newline at end of file
diff --git a/docs/_sources/related.rst.txt b/docs/_sources/related.rst.txt
index 9f182f1..f3a0fcf 100644
--- a/docs/_sources/related.rst.txt
+++ b/docs/_sources/related.rst.txt
@@ -2,8 +2,7 @@
Related
=======
-Below are some packages following the same configuration-file-to-postprocessing-folder approach;
-check them out π.
+Below are some tools that might be of interest; check them out π.
**********
pyopmspe11
@@ -23,6 +22,14 @@ pyopmnearwell
`A framework to simulate near well dynamics using OPM Flow `_.
+*****
+plopm
+*****
+
+.. image:: ./figs/plopm.png
+
+`Quick generation of PNG figures from a simulation model given any 2D slide `_.
+
********
expreccs
********
diff --git a/docs/about.html b/docs/about.html
index 619af63..4712008 100644
--- a/docs/about.html
+++ b/docs/about.html
@@ -82,7 +82,7 @@
pycopm, a tool for coarsening OPM Flow geological models, is being funded by the Center for Sustainable Subsurface Resources (CSSR) [project no. 331841].
This is work in progress.
Contributions are more than welcome using the fork and pull request approach.
The configuration files allow to set the integrated studies (coarsening and history matching)
+only for the drogon and norne model. To use pycopm in any given OPM Flow geological model
+to generate the coarser files, this can be achieve without a configuration file, but setting
+the parameters via command lines (see the Overview or run pycopm -h for the definition
+of the argument options, and the examples.)
+
Here we use as an example one of the configuration files used in the tests
(see ert.txt).
The first input parameter is:
The examples folder contains configuration files
to perform HM studies in drogon and norne. For example, by executing inside the example folder for drogon:
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).
+
We can execute a dry run of OPM Flow to generate the grid and static variables of the coarser model:
Porosity values for the (left) original and (right) coarsed model.ο
+
+
+
+
Tip
+
You can install plopm by executing in the terminal: pip install git+https://github.com/cssr-tools/plopm.git.
+
+
+
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.
In the initial development of the framework, the focus was two available models in opm-tests: norne
and drogon, where the coarser models are used to perform history matching studies using
-the Ensemble based reservoir tool ERT, via a configuration file. The current
-available options for parameters to HM are the saturation functions using the LET model and permeabilities. The plan is to extend the functionality to
-set up history matching/optimization studies using either ERT, PET,
-or everest.
-
In addition, current work focuces on creating coarser grids by only giving the input files
-(i.e., avoiding the manual work to create templates as done for drogon and norne); see the examples.
The current development of pycopm focuses on only creating coarser models (i.e., all needed input files to run OPM Flow) by only giving the OPM Flow input files
+(i.e., avoiding the manual work to create templates as it was done for drogon and norne). This allows for flexibility to adapt the generated coarser decks in your
+favourite history matching/optimization tool (e.g., ERT, PET, everest).
As described in the introduction, in the early development of pycopm
+the focus was on history matching studies using ERT for the
+norne and drogon geological models
+via a configuration file.
+
The following screenshot shows the generated ERT configuration file and folders in the selected output folder after executing pycopm
+on the drogon model.
+
-
(Left) example of generated files after executing pycopm and (right) some of the figures in the postprocessing folder.ο
+
(Left) example of generated files after executing pycopm and (right) some of the figures in the postprocessing folder.ο
The generate ert.ert file can be run directly calling ERT for further studies, and some useful plots and files
-are generated in the postprocessing folder. The OPM simulation results can be visualized using ResInsight .
-Then after running pycopm, one could modify the generated OPM coarser related files in the preprocessing folder to adapt to
-further existing frameworks (e.g., PET, everest).
+are generated in the postprocessing folder. The OPM simulation results can be visualized using ResInsight.
+
+
+
The current development of pycopm focuces on only creating coarser models (i.e., all needed input files to run OPM Flow) by only giving the OPM Flow input files.
+
The following screenshot shows the input deck and generated files in the selected output folder (coarser for this example) after executing pycopm on the SPE10 model (see the
+test_generic_deck.py) file.
+
+
+
+
Then, after running pycopm, one could adapt the generated files with the coarser geological model in your
+favourite history matching/optimization tool (e.g., ERT, PET, everest).
lol (list): List of lines read from the input file
-dic (dict): Global dictionary with required parameters
-ind (int): Number of line of the last opm flags in the input file
+
+
Args:
lol (list): List of lines read from the input file
+
dic (dict): Global dictionary with required parameters
+
ind (int): Number of line of the last opm flags in the input file
-
Returns:
dic (dict): Global dictionary with new added parameters
lol (list): List of lines read from the input file
-dic (dict): Global dictionary with required parameters
-inc (int): Number of line in the input file before the first injection value
-num_lin (list): List with the number of opm and ert flags
+
+
Args:
lol (list): List of lines read from the input file
+
dic (dict): Global dictionary with required parameters
+
inc (int): Number of line in input file before the first injection value
+
num_lin (list): List with the number of opm and ert flags
-
Returns:
dic (dict): Global dictionary with new added parameters
-ind (int): Number of line of the last opm flags in the input file
+
Returns:
ind (int): Number of line of the last opm flags in the input file
Function to correct the lost pore volume on the cell boundaries
-
-
Args:
dic (dict): Global dictionary with required parameters
-inx (array): Index of the reference cells in the coarser block
-num (int): Global index of the reference cell
+
+
Args:
dic (dict): Global dictionary with required parameters
+
inx (array): Index of the reference cells in the coarser block
+
num (int): Global index of the reference cell
-
Returns:
dic (dict): Global dictionary with new added parameters