Skip to content

Commit

Permalink
Major improvements in the framework and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
daavid00 committed Sep 29, 2023
1 parent 9289dff commit 7dcc578
Show file tree
Hide file tree
Showing 132 changed files with 4,674 additions and 2,341 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run expreccs executable
name: Run the expreccs executable

on:
push:
Expand Down Expand Up @@ -34,13 +34,38 @@ jobs:
sudo apt-get install -y build-essential gfortran pkg-config cmake
sudo apt-get install -y mpi-default-dev
sudo apt-get install -y libblas-dev libboost-all-dev libsuitesparse-dev libtrilinos-zoltan-dev
chmod u+x build_dune_and_opm-flow.bash
./build_dune_and_opm-flow.bash
sudo apt-get install libdune-common-dev libdune-geometry-dev libdune-istl-dev libdune-grid-dev
CURRENT_DIRECTORY="$PWD"
# OPM modules
for repo in common grid models simulators
do
git clone https://github.com/OPM/opm-$repo.git
done
mkdir build
for repo in common grid models
do
mkdir build/opm-$repo
cd build/opm-$repo
cmake -DUSE_MPI=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
make -j
cd ../..
done
mkdir build/opm-simulators
cd build/opm-simulators
cmake -DUSE_MPI=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
make -j flow_gasoil
cd ../..
- name: Install test dependecies
run: |
pip install --upgrade pip setuptools wheel
pip install -r dev-requirements.txt
pip install opm
- name: Install expreccs
run: |
Expand Down
19 changes: 18 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,26 @@ dmypy.json
# MacOS
.DS_Store

# DUNE
dune-common/
dune-geometry/
dune-grid/
dune-istl/

# The OPM
opm-common/
opm-grid/
opm-models/
opm-simulators/

# Extra folders
tests/configs/output
tests/configs/compare
gift
vexpreccs
examples/output
developing
workshop
workshop
debugging
cssr
results
5 changes: 3 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include README.md
include LICENSE
include src/expreccs/core/*
include src/expreccs/templates/co2/*
include src/expreccs/templates/common/*
include src/expreccs/utils/*
include src/expreccs/templates/decks/*
include src/expreccs/utils/*
include src/expreccs/visualization/*
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

# Expansion of ResourCes for CO2 Storage on the Horda Platform (ExpReCCS)
# A Python framework for the project: Expansion of ResourCes for CO2 Storage on the Horda Platform (ExpReCCS)

<img src="docs/text/figs/expreccs.gif" width="830" height="500">

Expand All @@ -14,12 +14,6 @@ for CO2 storage using the [_OPM-Flow_](https://opm-project.org/?page_id=19) simu
You will first need to install
* Flow (https://opm-project.org)

For now you need to build OPM from source using the master branch (this since there have been updates for
the boundary conditions (BC) keywords, which will be available in the next OPM stable release 2023.10).
You can run the script `./build_dune_and_opm-flow.bash`, which in turn should build flow in the folder
./build/opm-simulators/bin/flow (this builds OPM without mpi support [for macOS users]; changue
the mpi cmake flags accordingly for mpi support).

You can install the Python requirements in a virtual environment with the following commands:

```bash
Expand All @@ -39,6 +33,21 @@ pip install -e .
pip install -r dev-requirements.txt
```

For now you need to build OPM from source using the master branch (this since there have been updates for
the boundary conditions (BC) keywords, which will be available in the next OPM stable release 2023.10).
To build dune and the corresponding OPM master branches from source (e.g., you are a macOS user), you can run the script
`./build_dune_and_opm-flow.bash`, which in turn should build flow in the folder
./build/opm-simulators/bin/flow (for macOS users the dependecies such as boost can be installed using macports).
If you are a Linux user (including the windows subsystem for Linux), then you could try to build Flow with mpi support,
by running the script `./build_dune_and_opm-flow_mpi.bash` instead of `./build_dune_and_opm-flow.bash`.

For macOS users with the latest chips (M1/M2), the ecl package is not available via pip install. Then
before installation, remove ecl from the requierements.txt, then proceed with the Python requirements installation, and
once inside the vexpreccs Python environment, add the flag `-DPYTHON_EXECUTABLE=/Users/dmar/expreccs/vexpreccs/bin/python`
(by typing `which python` in the terminal you get your path) to the cmake (lines 24 in the bash scripts), build flow by
running the bash script, and finally, add to the python path the folder where you have built it, e.g., by running in the terminal
`export PYTHONPATH=$PYTHONPATH:/Users/dmar/expreccs/build/opm-common/build/python`.

## Running expreccs
You can run _expreccs_ as a single command line:
```
Expand All @@ -53,6 +62,6 @@ folders.
See the [_documentation_](https://daavid00.github.io/expreccs/introduction.html).

## About expreccs
The expreccs package was funded by Wintershall Dea, Equinor, Shell, and the Research Council of Norway [project number 104908].
The expreccs package is funded by Wintershall Dea, Equinor, Shell, and the Research Council of Norway [project number 104908].
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.
Contributions are more than welcome using the fork and pull request approach.
4 changes: 2 additions & 2 deletions build_dune_and_opm-flow.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ for repo in common grid models
do
mkdir build/opm-$repo
cd build/opm-$repo
cmake -DUSE_MPI=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
cmake -DUSE_MPI=0 -DOPM_ENABLE_PYTHON=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
make -j5
cd ../..
done

mkdir build/opm-simulators
cd build/opm-simulators
cmake -DUSE_MPI=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
make -j5 flow_gasoil
make -j5 flow
cd ../..
33 changes: 33 additions & 0 deletions build_dune_and_opm-flow_mpi.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
CURRENT_DIRECTORY="$PWD"

# Dune modules
for module in common geometry grid istl
do git clone https://gitlab.dune-project.org/core/dune-$module.git --branch v2.9.0
done
for module in common geometry grid istl
do ./dune-common/bin/dunecontrol --only=dune-$module cmake
./dune-common/bin/dunecontrol --only=dune-$module make -j5
done

# OPM modules
for repo in common grid models simulators
do
git clone https://github.com/OPM/opm-$repo.git
done

mkdir build

for repo in common grid models
do
mkdir build/opm-$repo
cd build/opm-$repo
cmake -DUSE_MPI=1 -DOPM_ENABLE_PYTHON=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
make -j5
cd ../..
done

mkdir build/opm-simulators
cd build/opm-simulators
cmake -DUSE_MPI=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
make -j5 flow
cd ../..
Binary file added docs/_images/ad-micp.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/confile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/contents.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/distance_from_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_images/gridding.png
Binary file not shown.
Binary file added docs/_images/grids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/introduction.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/maximum_pressure_difference_over_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified docs/_images/output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/pymm.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/pyopmcsp11.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/pyopmnearwell.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_images/reference_saturation.png
Binary file not shown.
Binary file added docs/_images/reference_watfluxi+.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/regional_watfluxi+.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_images/sands.png
Binary file not shown.
Binary file added docs/_images/site_flux_watfluxi+.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_images/site_saturation.png
Binary file not shown.
Binary file removed docs/_images/test_distance_from_border.png
Binary file not shown.
Binary file removed docs/_images/test_saturation.png
Binary file not shown.
Binary file removed docs/_images/tranxy.png
Binary file not shown.
Binary file modified docs/_images/wells.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/wells_pressure_site_reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/_sources/about.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ About expreccs
.. image:: ./figs/about.png
:scale: 50%

The **expreccs** package was funded by
The **expreccs** package is funded by
Wintershall Dea, Equinor, Shell, and the Research Council of Norway [project number 104908].

This is work in progress.
Expand Down
3 changes: 1 addition & 2 deletions docs/_sources/api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ expreccs Python API
The main script for the **expreccs** executable is located in the core folder.
The expreccss folder contains mako files to generate the corresponding opm
input decks. The scripts in the utils folder process the input configuration
file, runs the reference, regional, and site (including a site simulation
considering open boundaries) simulations, and generate images (.png) to show
file, runs the reference, regional, and site simulations, and generate images (.png) to show
comparisons between the different runs.

.. figure:: figs/contents.png
Expand Down
Loading

0 comments on commit 7dcc578

Please sign in to comment.