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 @@

About pycopm

_images/droganim.gif -

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.

diff --git a/docs/configuration_file.html b/docs/configuration_file.html index 01c303d..e2e067b 100644 --- a/docs/configuration_file.html +++ b/docs/configuration_file.html @@ -82,6 +82,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 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:

diff --git a/docs/examples.html b/docs/examples.html index 04c47d4..1f7c483 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -50,8 +50,15 @@
  • Introduction
  • Configuration file
  • Examples
  • pycopm Python API
  • @@ -86,8 +93,10 @@

    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:

    pycopm -i coarser.txt -o drogon_coarser
    @@ -98,18 +107,60 @@ 

    Configuration file

    -
    -

    Input deck

    +
    +
    +

    Via OPM Flow decks

    +
    +

    SPE10

    See/run the test_generic_deck.py 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:

    pycopm -i SPE10_MODEL2.DATA -o coarser -c 4,8,2
     
    -
    +
    _images/spe10_model2_coarser.png +
    +

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

    +
    +
    +

    Smeaheia

    +

    By downloading the Smeaheia simulation model, +then:

    +
    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:

    +
    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:

    +
    plopm -i STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PYCOPM -s ,,0
    +
    +
    +
    +_images/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.

    +
    +
    +
    diff --git a/docs/genindex.html b/docs/genindex.html index 7b55555..3b1e8fb 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -83,9 +83,11 @@

    Index

    A | C | E + | F | G | H | I + | L | M | O | P @@ -138,13 +140,23 @@

    E

    +

    F

    + + +
    +

    G

    @@ -161,13 +173,25 @@

    H

  • handle_face_dir_ip() (in module pycopm.utils.grid_builder)
  • - - +
    +

    L

    + + +
    +

    M

    • main() (in module pycopm.core.pycopm)
    • map_ijk() (in module pycopm.utils.generate_coarser_files) +
    • +
    • map_properties() (in module pycopm.utils.generate_coarser_files)
    • module diff --git a/docs/index.html b/docs/index.html index e3f8d4e..d66e041 100644 --- a/docs/index.html +++ b/docs/index.html @@ -85,14 +85,23 @@

      Welcome to pycopm’s documentation!Introduction

    • Configuration file
    • Examples
    • pycopm Python API
        @@ -106,10 +115,15 @@

        Welcome to pycopm’s documentation!Output folder +
      • Output folder +
      • Related
        • pyopmspe11
        • pyopmnearwell
        • +
        • plopm
        • expreccs
        • ad-micp
        • pymm
        • diff --git a/docs/introduction.html b/docs/introduction.html index e67faa2..bdd89b7 100644 --- a/docs/introduction.html +++ b/docs/introduction.html @@ -49,8 +49,10 @@
          • Introduction
          • Configuration file
          • @@ -88,32 +90,38 @@

            Introduction

            _images/pycopm.gif -

            This documentation describes the content of the pycopm package. -The numerical studies are performed using the Flow simulator.

            +

            This documentation describes the content of the pycopm package.

            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 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 Ensemble based reservoir tool ERT, via a 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).

            -

            Overview

            +

            Overview

            The current implementation supports the following executable with the argument options:

            pycopm -i some_input -o some_output_folder
             

            where

              -
            • -i, -input: The base name of the configuration file or the name of the deck (input.txt by default).

            • -
            • -o, -output: The base name of the 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 configuration file or the name of the deck (input.txt by default).

            • +
            • -o: The base name of the 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).

            @@ -124,6 +132,14 @@

            InstallationCI.yml file.

            +
            +

            Getting started

            +

            See the examples.

            +
            +

            Tip

            +

            Check the tests.

            +
            +
            diff --git a/docs/objects.inv b/docs/objects.inv index 1031bae..4f5d324 100644 Binary files a/docs/objects.inv and b/docs/objects.inv differ diff --git a/docs/output_folder.html b/docs/output_folder.html index a45ce21..009c5a0 100644 --- a/docs/output_folder.html +++ b/docs/output_folder.html @@ -51,7 +51,11 @@
          • Configuration file
          • Examples
          • pycopm Python API
          • -
          • Output folder
          • +
          • Output folder +
          • Related
          • About pycopm
          @@ -82,17 +86,34 @@

          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 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.

          +
          _images/output.png
          -

          (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.

          +
          +
          +

          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.

          +
          +_images/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).

          +
          diff --git a/docs/pycopm.core.html b/docs/pycopm.core.html index 0950c45..e79c88a 100644 --- a/docs/pycopm.core.html +++ b/docs/pycopm.core.html @@ -89,6 +89,7 @@

          Submodules
          • pycopm.core.pycopm module diff --git a/docs/pycopm.core.pycopm.html b/docs/pycopm.core.pycopm.html index 7cf2860..001cdc9 100644 --- a/docs/pycopm.core.pycopm.html +++ b/docs/pycopm.core.pycopm.html @@ -85,7 +85,13 @@

            pycopm.core.pycopm module

            -

            Main script

            +

            Main script for pycopm

            +
            +
            +pycopm.core.pycopm.load_parser()
            +

            Argument options

            +
            +
            pycopm.core.pycopm.main()
            @@ -95,7 +101,7 @@
            pycopm.core.pycopm.pycopm()
            -

            Main function

            +

            Main function for the pycopm executable

            diff --git a/docs/pycopm.html b/docs/pycopm.html index 3a268b7..9e79fce 100644 --- a/docs/pycopm.html +++ b/docs/pycopm.html @@ -90,6 +90,7 @@

            Subpackagespycopm.core package
            • Submodules
              • pycopm.core.pycopm module @@ -111,11 +112,20 @@

                Subpackagespycopm.utils.generate_coarser_files module
                • create_deck()
                • +
                • find_neighbors()
                • +
                • get_ijk()
                • handle_clusters()
                • handle_cp_grid()
                • +
                • handle_fault()
                • +
                • handle_grid_props()
                • +
                • handle_mapaxes()
                • +
                • handle_pv()
                • +
                • handle_regions()
                • +
                • handle_segmented_wells()
                • handle_wells()
                • handle_zcorn()
                • map_ijk()
                • +
                • map_properties()
                • process_the_deck()
                • write_grid()
                • write_props()
                • diff --git a/docs/pycopm.utils.files_writer.html b/docs/pycopm.utils.files_writer.html index 440a181..03a0a35 100644 --- a/docs/pycopm.utils.files_writer.html +++ b/docs/pycopm.utils.files_writer.html @@ -90,30 +90,60 @@
                  pycopm.utils.files_writer.coarser_files(dic)

                  Method to write files by running mako templates

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  None

                  +
                  +
                  pycopm.utils.files_writer.ert_files(dic)
                  -

                  Routine to write the ERT deck

                  +

                  Method to write the ERT deck

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.files_writer.grid_features(dic)
                  -

                  Function to write OPM grid related files

                  +

                  Method to write OPM grid related files

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.files_writer.opm_properties(dic)

                  Method to write OPM property files

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.files_writer.write_let_tables(dic)
                  -

                  Function to write the LET saturation function tables

                  +

                  Method to write the LET saturation function tables

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  None

                  +
                  +
                  diff --git a/docs/pycopm.utils.generate_coarser_files.html b/docs/pycopm.utils.generate_coarser_files.html index 608b7a0..a9067dc 100644 --- a/docs/pycopm.utils.generate_coarser_files.html +++ b/docs/pycopm.utils.generate_coarser_files.html @@ -89,55 +89,236 @@
                  pycopm.utils.generate_coarser_files.create_deck(dic)
                  -

                  Dry run to generate the files

                  +

                  Main scrip to call the diffeent methods to generate the coarser files

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  +
                  + +
                  +
                  +pycopm.utils.generate_coarser_files.find_neighbors(dic, ind, i_d, n, s)
                  +

                  Find the neighbouring cells to distribute the removed pore volume

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  ind (list): Indices os cells to distribute the pore volume

                  +

                  i_d (int): Index of the removed cell to distribute its pore volume

                  +

                  n (int): Current increased index for the neighbours search

                  +

                  s (int): Shift to neighbours cells

                  +
                  +
                  Returns:

                  ind (list): Indices os cells to distribute the pore volume

                  +

                  dic (dict): Modified global dictionary

                  +
                  +
                  +
                  + +
                  +
                  +pycopm.utils.generate_coarser_files.get_ijk(dic, i_d)
                  +

                  Return the i,j, and k index from the global index

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  i_d (int): Index of the removed cell to distribute its pore volume

                  +
                  +
                  Returns:

                  i,j,k (int): i,j, and k cell indices

                  +
                  +
                  pycopm.utils.generate_coarser_files.handle_clusters(dic)

                  Create the coarser clusters

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.generate_coarser_files.handle_cp_grid(dic)

                  Handle the pillars and zcord for the coarser grid

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  +
                  + +
                  +
                  +pycopm.utils.generate_coarser_files.handle_fault(dic, nrwo)
                  +

                  Handle the i,j,k coarser fault indices

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  nrwo (list): Splited row from the input deck

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  +
                  + +
                  +
                  +pycopm.utils.generate_coarser_files.handle_grid_props(dic, nrwo)
                  +

                  Handle the grid and props sections

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  nrwo (list): Splited row from the input deck

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  +
                  + +
                  +
                  +pycopm.utils.generate_coarser_files.handle_mapaxes(dic, nrwo)
                  +

                  Keep the mapping so the grids have the same view

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  nrwo (list): Splited row from the input deck

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  +
                  + +
                  +
                  +pycopm.utils.generate_coarser_files.handle_pv(dic, clusmin, clusmax, rmv)
                  +

                  Make sure the pore volume is not created nor destroyed, only distributed

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  clusmin (pandas dataFrame): Mask with all active cells in cluster

                  +

                  clusmax (pandas dataFrame): Mask with at least one active cell in cluster

                  +

                  rmv (pandas dataFrame): Mask to remove cells by the argument flag jump

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  +
                  + +
                  +
                  +pycopm.utils.generate_coarser_files.handle_regions(dic, nrwo)
                  +

                  Handle the regions sections

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  nrwo (list): Splited row from the input deck

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  +
                  + +
                  +
                  +pycopm.utils.generate_coarser_files.handle_segmented_wells(dic, nrwo)
                  +

                  We also support segmented wells

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  nrwo (list): Splited row from the input deck

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.generate_coarser_files.handle_wells(dic, nrwo)

                  Add the necessary keywords and right i,j,k coarser well indices

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  nrwo (list): Splited row from the input deck

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.generate_coarser_files.handle_zcorn(dic, ir)

                  Process the zcorn

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  ir (list): Z coordinates from the corners

                  +
                  +
                  Returns:

                  ir (list): Modified z coordinates

                  +
                  +
                  pycopm.utils.generate_coarser_files.map_ijk(dic)

                  Create the mappings to the new i,j,k indices

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  +
                  + +
                  +
                  +pycopm.utils.generate_coarser_files.map_properties(dic, actnum, d_z, z_z)
                  +

                  Mapping to the coarse properties

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  actnum (array): Integers with the active cells

                  +

                  d_z (array): Floats with the corresponding grid DZ

                  +

                  z_z (array): Floats with the cell z-center position

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.generate_coarser_files.process_the_deck(dic)

                  Identify and modified the required keywords

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.generate_coarser_files.write_grid(dic)

                  Write the corner-point grid

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  None

                  +
                  +
                  pycopm.utils.generate_coarser_files.write_props(dic)

                  Write the coarser properties

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  None

                  +
                  +
                  diff --git a/docs/pycopm.utils.grid_builder.html b/docs/pycopm.utils.grid_builder.html index 4c15086..aa610a6 100644 --- a/docs/pycopm.utils.grid_builder.html +++ b/docs/pycopm.utils.grid_builder.html @@ -85,41 +85,89 @@

                  pycopm.utils.grid_builder module

                  -

                  Utiliy functions for the generation of the grids.

                  +

                  Utiliy functions for the generation of coarse corner-point grids.

                  pycopm.utils.grid_builder.coarser_grid(dic)
                  -

                  Function to coarse the grid

                  +

                  Method to coarse the grid

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.grid_builder.handle_face_dir_im(dic, cell_index, i, j, k)

                  Method for the face I- dir

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  cell_index (int): Global index of the cell position

                  +

                  i (int): i index of the cell position

                  +

                  j (int): j index of the cell position

                  +

                  k (int): k index of the cell position

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.grid_builder.handle_face_dir_ip(dic, cell_index, i, j, k)

                  Method for the face I+ dir

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  cell_index (int): Global index of the cell position

                  +

                  i (int): i index of the cell position

                  +

                  j (int): j index of the cell position

                  +

                  k (int): k index of the cell position

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.grid_builder.handle_face_dir_jm(dic, cell_index, j)

                  Method for the face J- dir

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  cell_index (int): Global index of the cell position

                  +

                  j (int): j index of the cell position

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.grid_builder.handle_face_dir_jp(dic, cell_index, j)

                  Method for the face J+ dir

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +

                  cell_index (int): Global index of the cell position

                  +

                  j (int): j index of the cell position

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  pycopm.utils.grid_builder.handle_faults(dic)
                  -

                  Method for the fault approach

                  +

                  Method for the fault i,j,k mapping from reference to coarse positions

                  +
                  +
                  Args:

                  dic (dict): Global dictionary

                  +
                  +
                  Returns:

                  dic (dict): Modified global dictionary

                  +
                  +
                  diff --git a/docs/pycopm.utils.html b/docs/pycopm.utils.html index 43f685d..d19b422 100644 --- a/docs/pycopm.utils.html +++ b/docs/pycopm.utils.html @@ -98,11 +98,20 @@

                  Submodulespycopm.utils.generate_coarser_files module
                  • create_deck()
                  • +
                  • find_neighbors()
                  • +
                  • get_ijk()
                  • handle_clusters()
                  • handle_cp_grid()
                  • +
                  • handle_fault()
                  • +
                  • handle_grid_props()
                  • +
                  • handle_mapaxes()
                  • +
                  • handle_pv()
                  • +
                  • handle_regions()
                  • +
                  • handle_segmented_wells()
                  • handle_wells()
                  • handle_zcorn()
                  • map_ijk()
                  • +
                  • map_properties()
                  • process_the_deck()
                  • write_grid()
                  • write_props()
                  • diff --git a/docs/pycopm.utils.input_values.html b/docs/pycopm.utils.input_values.html index dcc3150..a321f8f 100644 --- a/docs/pycopm.utils.input_values.html +++ b/docs/pycopm.utils.input_values.html @@ -90,12 +90,12 @@
                    pycopm.utils.input_values.assign_hm_parameters(lol, dic, ind)

                    Function to process the saturation functions

                    -
                    -
                    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

                    +
                    +
                    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

                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    @@ -104,14 +104,13 @@
                    pycopm.utils.input_values.assign_standard_values(lol, dic, inc, num_lin)

                    Function to process the ert and opm 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 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

                    @@ -119,10 +118,10 @@
                    pycopm.utils.input_values.get_number_of_lines(lol, inc)
                    -

                    Function to obtain the number of opm and ert flags

                    -
                    -
                    Args:

                    lol (list): List of lines read from the input file -inc (int): Number of line in the input file before the first injection value

                    +

                    Function to obtain the number of OPM and ERT flags

                    +
                    +
                    Args:

                    lol (list): List of lines read from the input file

                    +

                    inc (int): Number of line in the input file before the first injection value

                    Returns:

                    num_lin (list): List with the number of opm flags, and ert flags

                    @@ -136,7 +135,7 @@
                    Args:

                    dic (dict): Global dictionary with required parameters

                    -
                    Returns:

                    dic (dict): Global dictionary with new added parameters

                    +
                    Returns:

                    dic1 (dict): Local dictionary

                    @@ -145,11 +144,11 @@
                    pycopm.utils.input_values.process_input(dic, in_file)

                    Function to process the input file

                    -
                    -
                    Args:

                    dic (dict): Global dictionary with required parameters -in_file (str): Name of the input text file

                    +
                    +
                    Args:

                    dic (dict): Global dictionary with required parameters

                    +

                    in_file (str): Name of the input text file

                    -
                    Returns:

                    dic (dict): Global dictionary with new added parameters

                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    @@ -161,7 +160,7 @@
                    Args:

                    dic (dict): Global dictionary with required parameters

                    -
                    Returns:

                    dic (dict): Global dictionary with new added parameters

                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    @@ -170,12 +169,11 @@
                    pycopm.utils.input_values.read_the_first_part(lol, dic)

                    Function to process the first 29 lines of the input file

                    -
                    -
                    Args:

                    lol (list): List of lines read from the input file -dic (dict): Global dictionary with required parameters

                    +
                    +
                    Args:

                    lol (list): List of lines read from the input file

                    +

                    dic (dict): Global dictionary with required parameters

                    -
                    Returns:

                    dic (dict): Global dictionary with new added parameters -inc (int): Number of line in the input file before the first injection value

                    +
                    Returns:

                    inc (int): Number of line in the input file before the first injection value

                    diff --git a/docs/pycopm.utils.properties_builder.html b/docs/pycopm.utils.properties_builder.html index b570753..f69f8a9 100644 --- a/docs/pycopm.utils.properties_builder.html +++ b/docs/pycopm.utils.properties_builder.html @@ -89,31 +89,51 @@
                    pycopm.utils.properties_builder.add_lost_pv_to_all_cells(dic)
                    -

                    Function to correct the lost pore volume on all active cells

                    +

                    Method to correct the lost pore volume on all active cells

                    +
                    +
                    Args:

                    dic (dict): Global dictionary

                    +
                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    +
                    +
                    pycopm.utils.properties_builder.add_lost_pv_to_all_eq_cells(dic)
                    -

                    Correct the lost pore volume by distributing it to the same eqlnum

                    +

                    Method to correct the lost pore volume by distributing it to the +same eqlnum

                    +
                    +
                    Args:

                    dic (dict): Global dictionary

                    +
                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    +
                    +
                    pycopm.utils.properties_builder.add_lost_pv_to_all_fip_cells(dic)
                    -

                    Correct the lost pore volume by distributing it to the same fipnum

                    +

                    Method to correct the lost pore volume by distributing it to the +same fipnum

                    +
                    +
                    Args:

                    dic (dict): Global dictionary

                    +
                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    +
                    +
                    pycopm.utils.properties_builder.add_lost_pv_to_boundary_cells(dic, inx, num)

                    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

                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    @@ -121,25 +141,49 @@
                    pycopm.utils.properties_builder.coarser_properties(dic)
                    -

                    Function to coarse the properties defined in the input deck

                    +

                    Method to coarse the properties defined in the input deck

                    +
                    +
                    Args:

                    dic (dict): Global dictionary

                    +
                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    +
                    +
                    pycopm.utils.properties_builder.identify_removed_pilars(dic)

                    Identify the removed pilars to be used to write the coarser grid

                    +
                    +
                    Args:

                    dic (dict): Global dictionary

                    +
                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    +
                    +
                    pycopm.utils.properties_builder.identify_removed_pilars_zdir(dic)
                    -

                    Function to identify the removed pilars in the z direction

                    +

                    Identify the removed pilars in the z direction

                    +
                    +
                    Args:

                    dic (dict): Global dictionary

                    +
                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    +
                    +
                    pycopm.utils.properties_builder.initialize_properties(dic)
                    -

                    Function to initialize the coarser properties

                    +

                    Method to initialize the coarser properties

                    +
                    +
                    Args:

                    dic (dict): Global dictionary

                    +
                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    +
                    +
                    diff --git a/docs/pycopm.utils.runs_executer.html b/docs/pycopm.utils.runs_executer.html index 2f3cbee..f5cb989 100644 --- a/docs/pycopm.utils.runs_executer.html +++ b/docs/pycopm.utils.runs_executer.html @@ -89,13 +89,26 @@
                    pycopm.utils.runs_executer.plotting(dic, time)
                    -

                    Function to generate and run the plotting.py file

                    +

                    Generate and run the plotting.py file

                    +
                    +
                    Args:

                    dic (dict): Global dictionary +time (float): Current execution time

                    +
                    +
                    Returns:

                    dic (dict): Modified global dictionary

                    +
                    +
                    pycopm.utils.runs_executer.simulations(dic)
                    -

                    Function to run OPM Flow or selected ERT functionality

                    +

                    Run OPM Flow or selected ERT functionality

                    +
                    +
                    Args:

                    dic (dict): Global dictionary

                    +
                    +
                    Returns:

                    None

                    +
                    +
                    diff --git a/docs/related.html b/docs/related.html index f36ae58..7932e7d 100644 --- a/docs/related.html +++ b/docs/related.html @@ -55,6 +55,7 @@
                  • Related
                    • pyopmspe11
                    • pyopmnearwell
                    • +
                    • plopm
                    • expreccs
                    • ad-micp
                    • pymm
                    • @@ -89,8 +90,7 @@