Skip to content

Commit e892c85

Browse files
authored
Merge pull request #16 from daavid00/developing
Updates before the v2024.10 release
2 parents b214315 + ed2879a commit e892c85

File tree

126 files changed

+1375
-654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+1375
-654
lines changed

.github/workflows/CI.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run the expreccs executable
1+
name: Run expreccs
22

33
on:
44
push:

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ opm-common/
142142
opm-grid/
143143
opm-models/
144144
opm-simulators/
145-
build_opm_mpi.sh
146-
build_opm_macos.sh
147145

148146
# Extra folders
149147
tests/configs/back

CONTRIBUTING.md

+27-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
# Contributing
22

3-
Hola hola 🙂.
4-
The following is a set of guidelines for contributing to expreccs.
3+
Contributions are more than welcome using the fork and pull request approach 🙂 (if you are not familiar with this approach, please visit [_GitHub Docs PRs_](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests) for an extended documentation about collaborating with pull request; also, looking at previous merged pull requests helps to get familiar with this).
54

65
## Ground Rules
76

8-
1. We use Black code formatting
9-
1. We use Pylint
10-
1. We document our code
7+
- We use Black code formatting
8+
- We use Pylint
9+
- We document our code
1110

12-
## Pull Request Process
11+
## Contribute to the software
1312

1413
1. Work on your own fork of the main repo
15-
1. Push your commits and make a pull request
16-
1. The changes are merged when your code has been approved
14+
1. In the main repo execute:
15+
1. **pip install -r dev-requirements.txt** (this installs the [_dev-requirements.txt_](https://github.com/cssr-tools/expreccs/blob/main/dev-requirements.txt); in addition, the opm Python package is required, then for not macOs users run **pip install opm**, or else follow the instructions in [_macOS installation_](https://cssr-tools.github.io/expreccs/installation.html#source-build-in-macos))
16+
1. **black src/ tests/** (this formats the code)
17+
1. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request)
18+
1. **mypy --ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request)
19+
1. **pytest --cov=expreccs --cov-report term-missing tests/** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
20+
1. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the [_docs_](https://github.com/cssr-tools/expreccs/tree/main/docs) folder)
21+
* Tip: See the [_CI.yml_](https://github.com/cssr-tools/expreccs/blob/main/.github/workflows/CI.yml) script and the [_Actions_](https://github.com/cssr-tools/expreccs/actions) for installation of expreccs, OPM Flow (binary packages), and dependencies, as well as the execution of the six previous steps in Ubuntu 24.10.
22+
1. Squash your commits into a single commit (see this [_nice tutorial_](https://gist.github.com/lpranam/4ae996b0a4bc37448dc80356efbca7fa) if you are not familiar with this)
23+
1. Push your commit and make a pull request
24+
1. The maintainers will review the pull request, and if the contribution is accepted, then it will be merge to the main repo
25+
26+
## Reporting issues or problems
27+
28+
1. Issues or problems can be raised by creating a [_new issue_](https://github.com/cssr-tools/expreccs/issues) in the repository GitHub page (if you are not familiar with this approach, please visit [_GitHub Docs Issues_](https://docs.github.com/en/issues/tracking-your-work-with-issues)).
29+
1. We will try to answer as soon as possible, but also any user is more than welcome to answer.
30+
31+
## Seek support
32+
33+
1. The preferred approach to seek support is to raise an Issue as described in the previous lines.
34+
1. We will try to answer as soon as possible, but also any user is more than welcome to answer.
35+
- An alternative approach is to send an email to any of the [_mantainers_](https://github.com/cssr-tools/expreccs/blob/main/pyproject.toml).

README.md

+25-12
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,32 @@
33
[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
44
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
55
[![DOI](https://zenodo.org/badge/760077220.svg)](https://zenodo.org/doi/10.5281/zenodo.12100600)
6-
7-
# A Python framework for the ExpReCCS (Expansion of ResourCes for CO2 Storage on the Horda Platform) project
8-
96
<img src="docs/text/figs/expreccs.gif" width="830" height="500">
107

11-
This repository contains scripts to set up a workflow to run site and regional reservoirs for CO2 storage using the [_OPM-Flow_](https://opm-project.org/?page_id=19) simulator.
8+
# expreccs: A Python framework using OPM Flow to simulate regional and site reservoirs for CO2 storage
9+
10+
## Main feature
11+
Simplified and flexible software for two-stage approach (dynamic pressure boundary conditions) to improve CO2 storage regional and site simulations.
1212

1313
## Installation
1414
You will first need to install
15-
* Flow (https://opm-project.org, Release 2024.04 or current master branches)
15+
* Flow (https://opm-project.org, Release 2024.10 or current master branches)
1616

1717
To install the _expreccs_ executable in an existing Python environment:
1818

1919
```bash
2020
pip install git+https://github.com/cssr-tools/expreccs.git
2121
```
2222

23-
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:
23+
If you are interested in a specific version (e.g., v2024.10) or in modifying the source code, then you can clone the repository and install the Python requirements in a virtual environment with the following commands:
2424

2525
```bash
2626
# Clone the repo
2727
git clone https://github.com/cssr-tools/expreccs.git
2828
# Get inside the folder
2929
cd expreccs
30+
# For a specific version (e.g., v2024.10), or skip this step (i.e., edge version)
31+
git checkout v2024.10
3032
# Create the virtual environment
3133
python3 -m venv vexpreccs
3234
# Activate the virtual environment
@@ -39,20 +41,31 @@ pip install -e .
3941
pip install -r dev-requirements.txt
4042
```
4143

42-
See the [_installation_](https://cssr-tools.github.io/exprecss/installation.html) for further details on building OPM Flow from the master branches in Linux, Windows, and macOS, as well as the opm Python package.
44+
See the [_installation_](https://cssr-tools.github.io/exprecss/installation.html) for further details on installing binaries or building OPM Flow from the master branches in Linux, Windows, and macOS, as well as the opm Python package and LaTeX dependencies.
4345

4446
## Running expreccs
4547
You can run _expreccs_ as a single command line:
4648
```
47-
expreccs -i some_input.txt -o some_output_folder
49+
expreccs -i configuration_file.txt
4850
```
49-
Run `expreccs --help` to see all possible command line argument options. Inside the `some_input.txt` file you provide the path to the
51+
Run `expreccs --help` to see all possible command line argument options. Inside the `configuration_file.txt` file you provide the path to the
5052
flow executable and simulation parameters. See the .txt files in the [_examples_](https://github.com/cssr-tools/expreccs/tree/main/examples) and [_tests_](https://github.com/cssr-tools/expreccs/tree/main/tests/configs) folders.
5153

5254
## Getting started
53-
See the [_examples_](https://cssr-tools.github.io/expreccs/examples.html) in the [_documentation_](https://cssr-tools.github.io/expreccs/introduction.html).
55+
See the [_examples_](https://cssr-tools.github.io/expreccs/examples.html) in the [_documentation_](https://cssr-tools.github.io/expreccs/introduction.html).
56+
57+
## Citing
58+
If you would like to cite this repository:
59+
60+
* Landa-Marbán, D. 2024. expreccs: A Python framework using OPM Flow to simulate regional and site reservoirs for CO2 storage. V2024.04. https://doi.org/10.5281/zenodo.12100600.
61+
62+
## Publications
63+
The following is a list of manuscripts in which _expreccs_ is used:
64+
65+
1. Tveit, S., Gasda, S.E., Landa-Marbán, D., Sandve, T.H., submitted. A hierarchical approach for modeling regional pressure interference in multi-site CO2 operations. http://dx.doi.org/10.2139/ssrn.5005237.
66+
1. Gasda, S.E., et al., submitted. Quantifying the impact of regional-scale pressure interference on commercial CO2 storage targets for multiple licenses.
5467

5568
## About expreccs
56-
The expreccs package is funded by Wintershall Dea, Equinor, Shell, and the Research Council of Norway [project number 336294].
69+
The _expreccs_ package is funded by Wintershall Dea, Equinor, Shell, and the Research Council of Norway [project number 336294].
5770
This is work in progress. [_Here_](https://www.norceresearch.no/en/projects/expansion-of-resources-for-co2-storage-on-the-horda-platform-expreccs) is the link to the project details.
58-
Contributions are more than welcome using the fork and pull request approach.
71+
Contributions are more than welcome using the fork and pull request approach. For new features, please request them raising an issue.
Loading

docs/_images/distance_from_border.png

-38.2 KB
Binary file not shown.

docs/_images/fpr_plopm.png

278 KB
Loading
Loading
29.6 KB
Loading
23.4 KB
Loading
Loading
24.9 KB
Loading
Loading

docs/_images/plopm.png

-384 KB
Loading

docs/_images/pressure_plopm.png

253 KB
Loading

docs/_images/pyopmspe11.gif

-3.33 MB
Loading

docs/_images/reference_watfluxi+.png

-22.4 KB
Binary file not shown.

docs/_images/regional_watfluxi+.png

-17.2 KB
Binary file not shown.
-45.8 KB
Binary file not shown.

docs/_images/site_flux_watfluxi+.png

-17.3 KB
Binary file not shown.
-69.4 KB
Binary file not shown.

docs/_sources/about.rst.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ Wintershall Dea, Equinor, Shell, and the Research Council of Norway [project num
1111
This is work in progress.
1212
`Here <https://www.norceresearch.no/en/projects/expansion-of-resources-for-co2-storage-on-the-horda-platform-expreccs>`_ is the link to the project details.
1313

14-
Contributions are more than welcome using the fork and pull request approach.
14+
Contributions are more than welcome using the fork and pull request approach.
15+
16+
For new features, please request them raising an issue.

docs/_sources/contributing.rst.txt

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
************
2+
Contributing
3+
************
4+
5+
Contributions are more than welcome using the fork and pull request approach 🙂 (if you are not familiar with this approach,
6+
please visit `GitHub Docs PRs <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests>`_ for an extended
7+
documentation about collaborating with pull request; also, looking at previous merged pull requests helps to get familiar with this).
8+
9+
============
10+
Ground Rules
11+
============
12+
13+
- We use Black code formatting
14+
- We use Pylint
15+
- We document our code
16+
17+
==========================
18+
Contribute to the software
19+
==========================
20+
21+
#. Work on your own fork of the main repo
22+
#. In the main repo execute:
23+
24+
#. **pip install -r dev-requirements.txt** (this installs the `dev-requirements.txt <https://github.com/cssr-tools/expreccs/blob/main/dev-requirements.txt>`_; in addition, the opm Python package is required, then for not macOs users run **pip install opm**, or else follow the instructions in `macOS installation <https://cssr-tools.github.io/expreccs/installation.html#source-build-in-macos>`_)
25+
#. **black src/ tests/** (this formats the code)
26+
#. **pylint src/ tests/** (this analyses the code, and might rise issues that need to be fixed before the pull request)
27+
#. **mypy --ignore-missing-imports src/ tests/** (this is a static checker, and might rise issues that need to be fixed before the pull request)
28+
#. **pytest --cov=expreccs --cov-report term-missing tests/** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
29+
#. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the `docs <https://github.com/cssr-tools/expreccs/tree/main/docs>`_ folder)
30+
31+
.. tip::
32+
See the `CI.yml <https://github.com/cssr-tools/expreccs/blob/main/.github/workflows/CI.yml>`_ script and the `Actions <https://github.com/cssr-tools/expreccs/actions>`_ for installation of expreccs, OPM Flow (binary packages), and dependencies, as well as the execution of the six previous steps in Ubuntu 24.10.
33+
34+
#. Squash your commits into a single commit (see this `nice tutorial <https://gist.github.com/lpranam/4ae996b0a4bc37448dc80356efbca7fa>`_ if you are not familiar with this)
35+
#. Push your commit and make a pull request
36+
#. The maintainers will review the pull request, and if the contribution is accepted, then it will be merge to the main repo
37+
38+
============================
39+
Reporting issues or problems
40+
============================
41+
42+
#. Issues or problems can be raised by creating a `new issue <https://github.com/cssr-tools/expreccs/issues>`_ in the repository GitHub page (if you are not familiar with this approach, please visit `GitHub Docs Issues <https://docs.github.com/en/issues/tracking-your-work-with-issues>`_).
43+
#. We will try to answer as soon as possible, but also any user is more than welcome to answer.
44+
45+
============
46+
Seek support
47+
============
48+
49+
#. The preferred approach to seek support is to raise an Issue as described in the previous lines.
50+
#. We will try to answer as soon as possible, but also any user is more than welcome to answer.
51+
52+
- An alternative approach is to send an email to any of the `mantainers <https://github.com/cssr-tools/expreccs/blob/main/pyproject.toml>`_.

docs/_sources/examples.rst.txt

+21-18
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Example 1
66
---------
77

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

1212
.. code-block:: bash
1313
14-
expreccs -i example1.txt -o hello_world
14+
expreccs -i example1.txt -o hello_world
1515
1616
Then we can change in line 14 the BC projections from the regional simulations from
1717
'flux' to 'pres', and run the following command to only simulate the site model:
@@ -36,22 +36,25 @@ in PNGs figures, we run the following command:
3636
3737
Below are some of the figures generated inside the postprocessing folder:
3838

39-
.. figure:: figs/reference_watfluxi+.png
39+
.. figure:: figs/hello_world_reference_watfluxi+.png
4040
:scale: 80%
41-
.. figure:: figs/regional_watfluxi+.png
41+
.. figure:: figs/hello_world_regional_watfluxi+.png
4242
:scale: 80%
43-
.. figure:: figs/site_flux_watfluxi+.png
43+
.. figure:: figs/hello_world_site_flux_watfluxi+.png
4444
:scale: 80%
4545

46-
Final water flux (sm3/day) in the x direction for (top) the reference, (middle) regional, and
47-
(bottom) site (with fluxes as BC).
46+
Final water velocity (m/day) in the x direction for (top) the reference, (middle) regional, and
47+
(bottom) site (with fluxes as BC). The figure names in the postprocessing folder are hello_world_reference_watfluxi+.png,
48+
hello_world_regional_watfluxi+.png, and hello_world_site_flux_watfluxi+.png respectively.
4849

49-
.. figure:: figs/sensor_pressure_over_time.png
50-
.. figure:: figs/wells_pressure_site_reference.png
51-
.. figure:: figs/distance_from_border.png
50+
.. figure:: figs/hello_world_sensor_pressure_over_time.png
51+
.. figure:: figs/hello_world_summary_BHP_site_reference.png
52+
.. figure:: figs/hello_world_distance_from_border.png
5253

5354
Comparison of cell pressures on the sensor location (top), well BHPs (middle), and minimum
54-
distance from the CO2 plume to the site boundaries (bottom).
55+
distance from the CO2 plume to the site boundaries (bottom). The figure names in the postprocessing folder are
56+
hello_world_sensor_pressure_over_time.png, hello_world_summary_BHP_site_reference.png, and
57+
hello_world_distance_from_border.png respectively
5558

5659

5760
Example 2
@@ -67,7 +70,7 @@ to generate the animation (using ResInsight) in the :doc:`introduction section <
6770
Generic (under development)
6871
---------------------------
6972

70-
See/run the last lines (34 to 42) in the `test_main.py <https://github.com/cssr-tools/expreccs/blob/main/tests/test_main.py>`_
73+
See/run the `test_generic_deck.py <https://github.com/cssr-tools/expreccs/blob/main/tests/test_generic_deck.py>`_
7174
for an example where **expreccs** is used in two given models (regional and site, in this case they are created using
7275
the **expreccs** package, but in general can be any given geological models), generating a new input deck where
7376
the pressures are projected.
@@ -89,7 +92,7 @@ By running:
8992
9093
expreccs -i example1_back.txt -o back-coupling -m all -p yes
9194
92-
This is one of the generated figures:
95+
This is one of the generated figures in the back-coupling/postprocessing folder (named as back-coupling_summary_BPR_regional_reference.png):
9396

9497
.. image:: ./figs/back-coupling_summary_BPR_regional_reference.png
9598

@@ -98,20 +101,20 @@ iteration is set to 10 in line 22 of the `configuration_file <https://github.com
98101
between any of the iterations, we can use our friend `plopm <https://github.com/cssr-tools/plopm>`_.
99102

100103
.. tip::
101-
You can install plopm by executing in the terminal: pip install git+https://github.com/cssr-tools/plopm.git.
104+
You can install `plopm <https://github.com/cssr-tools/plopm>`_ by executing in the terminal: **pip install git+https://github.com/cssr-tools/plopm.git**.
102105

103-
For example, to show the difference in the spatial maps for pressure at iteration 4 and 7 at the third restart, this is achieved by executing:
106+
For example, to show the difference in the spatial maps for pressure between iteration 4 and 7 at the third restart, this is achieved by executing:
104107

105108
.. code-block:: bash
106109
107-
plopm -i back-coupling/output/regional_7/regional_7,back-coupling/output/regional_4/regional_4 -v pressure -r 3 -s ,,1 -c rainbow -n "lambda x, _: f'{x:.2f}'" -d 5,5
110+
plopm -i back-coupling/output/regional_7/regional_7 -diff back-coupling/output/regional_4/regional_4 -v pressure -r 3 -s ,,1 -c rainbow -cformat .2f -d 5,5
108111
109112
.. image:: ./figs/pressure_plopm.png
110113

111-
And to show the comparison for the summary vector FPR for iterations 1, 5, 7, and 9:
114+
and to show the comparison for the summary vector FPR for iterations 1, 5, 7, and 9:
112115

113116
.. code-block:: bash
114117
115-
plopm -i back-coupling/output/regional_1/regional_1,back-coupling/output/regional_5/regional_5,back-coupling/output/regional_7/regional_7,back-coupling/output/regional_9/regional_9 -v fpr -d 5,5 -f 10
118+
plopm -i 'back-coupling/output/regional_1/regional_1 back-coupling/output/regional_5/regional_5 back-coupling/output/regional_7/regional_7 back-coupling/output/regional_9/regional_9' -v fpr -d 5,5 -f 10
116119
117120
.. image:: ./figs/fpr_plopm.png

docs/_sources/index.rst.txt

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Welcome to expreccs's documentation!
1111
configuration_file
1212
examples
1313
api
14+
contributing
1415
output_folder
1516
related
1617
about

0 commit comments

Comments
 (0)