Examples
ResInsight and plopm are used for the visualization of the results.
Note
You can install plopm by executing in the terminal:
pip install git+https://github.com/cssr-tools/plopm.git
There are binary packages for Linux and Windows to install Resinsight, see the ResInsight Documentation. For macOS users, you could try to install it using brew by executing:
brew tap cssr-tools/opm
brew trust cssr-tools/opm
brew install cssr-tools/opm/resinsight -y
Then, you should be able to open resinsight by typing in the terminal resinsight. If you have issues installing ResInsight, ParaView can be also used. However, you need to add the flag --enable-vtk-output=true to OPM Flow.
Tip
For the figures in the following examples we show a screen recording from ResInsight and a PNG and GIF from plopm. To generate the results, we add a link to a bash file that can be run from the main pyopmnearwell repository as (the results are generated in the test_outputs folder):
. ./tests/scripts/name_of_script.sh
Hello world
In this example we consider the configuration file h2o.toml available in the examples folder, where the co2store model is used and only water is injected in a radial grid.
If the generated files are to be saved in a folder called ‘hello_world’, then this is achieved by the following command:
pyopmnearwell -i h2o.toml -o hello_world
To visualize the results, this can be achieved by using plopm, for example:
plopm -i hello_world/output/H2O -v pressure -s ,,1 -t 'Top view at the end of the simulation' -c bwr -xformat .0f -cformat .0f
Then, both commands (pyopmnearwell and plopm) can be run by (docs_hello_world.sh):
. ./tests/scripts/docs_hello_world.sh
CO2 cyclic injection
In this example we consider the configuration file described in the configuration file section, which is available in the examples folder as co2.toml.
If the generated files are to be saved in a folder called ‘co2’, then this is achieved by the following command:
pyopmnearwell -i co2.toml -o co2
The execution time was c.a. 20 seconds and the following is an animation using ResInsight to visualize the gas saturation:
Visualization of the gas saturation using ResInsight.
To generate a gif using plopm, this can be achieved by executing:
plopm -i CO2 -v sgas -m gif -dpi 1000 -interval 50 -loop 1 -d 10,5 -yformat .0f -f 20 -cnum 6 -t "Cyclic injection"
Visualization of the gas saturation using plopm.
Then, both commands (pyopmnearwell and plopm) can be run by (docs_co2_cyclic_injection.sh):
. ./tests/scripts/docs_co2_cyclic_injection.sh
CCUS (machine learning)
See this folder for an example of how to use pyopmnearwell to generate data for different input parameters (e.g., injection rates) and read the data (e.g., production volumes). An additional example can be found in the data_generation folder. These examples could be used as a starting point for the ones interested in ML.
Publications
For the simulation results published in this paper about the impact of intermittency on salt precipitation during CO2 injection, see/run these configuration files.
For a study where pyopmnearwell is used to generated a machine-learned near-well model, click here.