Examples

SPE11B

The simulation files located in the examples folder were generated using pyopmspe11 by running this configuration file. Then, if you succeed in installing plopm, inside the examples folder by typing in the terminal

plopm

the following figure should be generated (this example is used in the tests, then it runs with the default terminal argument options).

_images/spe11b_satnum_%2A%2C1%2C%2A_t5.png

See the Overview or run plopm -h for the definition of the argument options, as well as using -printv flag to output the available summary, init, and restart available variables given an input deck.

For example, for the gas saturation at the report step number 4 using a given colormap (-c):

plopm -i SPE11B -v sgas -r 4 -c cubehelix
_images/spe11b_sgas_%2A%2C1%2C%2A_t4.png

and for the gas in place summary vector given a color, line style, font size, dimension of the figure, line width, and using dates for the times:

plopm -i SPE11B -v fgip -c b -e dotted -f 12 -d 5,5 -lw 4 -tunits dates
_images/fgip.png

Generic deck

See/run the test_generic_deck.py for an example where plopm is used to generate figures from the SPE10_MODEL2 model by downloading the files and using the OPM Flow simulator.

_images/spe10_model2_permz_%2A%2C4%2C%2A_t0.png
plopm -i SPE10_MODEL2 -v permz -s ,4, -log 1 -xunits km -yunits km -xlnum 6 -yformat .2f -t 'K$_z$ at the forth slide in the xz plane' -b '[1e-7,1e3]'

Here, we look at the forth slide in the xz plane and use log scale for the permeability in the z direction, as well as changing the axis units to km, setting the format to the numbers to two floats in the y axis, and setting manually the upper and lower bound for the color map.

To plot information for the grid, and also the location of the wells from the top view, this is achieved by:

plopm -i SPE10_MODEL2 -s ,,1 -d 3,4 -f 8 -v grid -remove 0,0,1,0 && plopm -i SPE10_MODEL2 -s ,,1 -d 3,4 -f 8 -v wells -remove 0,0,0,1
_images/wells.png

Here, we use the remove flag to delete the colorbar axis in the maps for the grid and to delete the generated title in the wells plot (the first entry in remove would delete the left axis, e.g., the y label and y ticks in this example, while the second entry if set to 1 would remove the x axis).

Rotation, translation, and zoom

This example relies on the simulation results in opm-tests. If you download the files in that folder, then by using the plopm tool:

plopm -i NORNE_ATW2013 -s ,,1

these are some of the generated figures:

_images/norne.png

In order to reduce the white space outside the active cells, as well as to rotate the grid and translate it, this can be ahieved by:

plopm -i NORNE_ATW2013 -s ,,1 -rotate 65 -translate '[6456335.5,-3476500]' -x '[0,5600]' -y '[0,7600]' -f 30
_images/norne_transformed.png

Convert to VTK

Inside the examples folder, then we can create VTKs from the OPM Flow simulation results (i.e., .EGRID, .INIT, .UNRST). For example, to create VTKS for the temperature, fipnum, the co2 mass, and the co2 mass fraction in the liquid phase from the restart files from the initial (0) to the number 5 restart, using a OPM Flow build from source in a given path, this can be achieved by:

plopm -i SPE11B -v temp,fipnum,co2m,xco2l -vtkformat Float32,UInt16,Float64,Float32 -r 0,5 -m vtk
_images/vtk_temp.png

Visualization using paraview of the grid and temperature after 25 years of CO2 injection.

Note

It is possible to write directly VTKs from OPM Flow simulations by adding the flag –enable-vtk-output=true. However, there are quantities that are not written (e.g., fipnum, flores), in addition to quantities not supported such as component mass (e.g., co2, h2o). This is when plopm can be helpful.

Different input files

Let us assume we have two different runs in different folders for the spe11b case, where the firsts results are save in a folder called spe11b, and simulation results where the injection rate has been increased are saved in a folder called spe11b_larger_inj. Then, to plot the summary vector for both runs we can execute:

plopm -i 'spe11b/SPE11B spe11b_larger_inj/SPE11B' -v 'fgip,fgipm,RGIP:3 / 2' -a 1,1e-6 -tunits w -d 10,5 -c r,b -e 'solid,dashed' -t 'Field gas in place  Comparing the total mass  Half gas in place in fipnum 3' -f 14 -subfigs 2,2 -delax 1 -loc empty,empty,empty,center -save comparison
_images/comparison.png

Here, using subplots, we plot the gas in place, injected mass and scaled to kilo tons, the regional gas in place in fipnum 3 divided by 2, and the time is shown in weeks.

Tip

For any summary variable, one can give the path to more than two different simulation cases, just by separating the folder paths by spaces in the -i.

To look at the difference between these two simulations for the dynamic variable sgas at the restar step 3, this can be achieved by executing:

plopm -i spe11b_larger_inj/SPE11B -v sgas -r 3 -diff spe11b/SPE11B -remove 0,0,0,1
_images/sgas_diff.png

To changue the colormap and setting the colorbar limits manually, this can be achieved by:

plopm -i spe11b_larger_inj/SPE11B -v sgas -r 3 -diff spe11b/SPE11B -remove 0,0,0,1 -c tab20c_r -b '[0,0.8]' -cformat .3 -cnum 9
_images/sgas_diff_edit.png

GIF and mask

To create a gif and mask the results using the satnum numbers (any variable should be supported) for the different rock properties, this can be achieved by:

plopm -v xco2l -subfigs 1,2 -i 'spe11b/SPE11B spe11b_larger_inj/SPE11B' -d 16,2.5 -mask satnum -r 0,5 -m gif -dpi 1000 -t "spe11b  spe11b larger injection" -f 16 -interval 1000 -loop 1 -cformat .2f -cbsfax 0.30,0.01,0.4,0.02
_images/xco2l.gif