Examples
Via configuration files
The examples folder contains configuration files to perform HM studies in drogon and norne using ERT. For example, by executing inside the example folder for drogon:
pycopm -i coarser.txt -o drogon_coarser
The following are the drogon model from opm-tests and coarser model generated using pycopm:
For norne:
pycopm -i input.txt -o norne_coarser
The norne GIF in the introduction was generated using the generated coarse model.
Via OPM Flow decks
The current development of pycopm focuses on only creating coarser models (i.e., all needed input files to run OPM Flow) by using the input deck.
Hello world
For the HELLO_WORLD.DATA deck, by executing:
pycopm -i HELLO_WORLD.DATA -c 5,1,5 -m all
This would generate the following:
To make active the coarse cell where there is only one active cell, this can be achieve by:
pycopm -i HELLO_WORLD.DATA -c 5,1,5 -m all -a max
SPE10
By downloading the SPE10_MODEL2 model, then:
pycopm -i SPE10_MODEL2.DATA -o coarser -c 4,8,2
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 min -m all
will generate a coarser model 5 times in the x direction, 4 in the y direction, and 3 in the z direction, where the coarse cell is made inactive if at least one cell is inactive (-a min).
We use our plopm friend to generate PNG figures:
plopm -i ' STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PREP_PYCOPM_DRYRUN STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PYCOPM' -s ,,0 -v poro -subfigs 1,2 -save smeaheia -t 'Smeaheia Coarsed smeaheia' -xunits km -xformat .0f -yunits km -yformat .0f -d 5,5.2 -suptitle 0 -c cet_rainbow_bgyrm_35_85_c69 -cbsfax 0.30,0.01,0.4,0.02 -cformat .2f
Tip
You can install plopm by executing in the terminal: pip install git+https://github.com/cssr-tools/plopm.git.
Drogon
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. Here are some relevant keywords per deck section that need to be in the main input deck to coarse and not via include files:
SECTION GRID: MAPAXES, FAULTS, MULTREGT (other keywords like MULTZ, NTG, or definitions/operations for perms and poro can be in included files since permx, permy, permz, poro, porv, multx, multy, multz are read from the .INIT file)
SECTION PROPS: EQUALS, COPY, ADD, and MULTIPLY since this involve i,j,k indices and are apply to properties such as saturation functions parameters that are still given in the same input format in the coarse deck. In addition, SWATINIT if used in the deck, is read from the .INIT file and output for the coarse model in a new file, then one might need to give the right include path to this special case.
SECTION SCHEDULE: All keywords in this section must be in the input deck and no via include viles.
Following the note above, then by downloading the DROGON model, adding the MAPAXES to the deck, replacing the lines in DROGON_HIST.DATA for the FAULTS (L127-128) and SCHEDULE (L242-243) with the actual content of those include files, then by executing:
pycopm -i DROGON_HIST.DATA -c 1,1,3 -p 1 -q 1 -l C1
pycopm -i DROGON_HIST_PYCOPM.DATA -c 1,3,1 -p 1 -q 1 -j 2.5 -l C2
this would generate the following coarse model:
Here, we first coarse in the z direction, which reduces the number of cells from 31 to 11, and after we coarse in the y direction. After trial and error, the jump (-j) is set to 2.5 to avoid generated connections across the faults. For geological models with a lot of inactive cells and faults, this divide and conquer apporach is recommended, i.e., coarsening first in the z direction and after coarsening in the x and y directions. Also, we add labels (-l) C1 and C2 to differentiate between the coarse include files. In addition, we use the flags -p 1 -q 1 to add the remove pore volume to the closest coarser cells and to redistribute the pore volume in the locations with gas and oil, this results in the coarse model having the same total pore volume, field gas in place, and practically same oil and water in place as the input model.
Note
Add to the generated coarse deck the removed include files in the grid section related to the region operations (e.g., ../include/grid/drogon.multregt for this case).
Now, we also show a 2 times coarser model in all directions (referring to the previous comment about divide and conquer, for the Drogon model it seems still ok to do a 2 times coarsening in one go):
pycopm -i DROGON_HIST.DATA -c 2,2,2 -p 1 -q 1 -j 4 -w DROGON_2TIMES_COARSER
Here, we use the -w flag to give a specific name to the generated coarser deck, as well as using a higher value of -j to avoid generated connections across the faults.
Tip
To use a different approach from the default ones (see the theroy) to coarse one of the properties (e.g., permeabilities), this can be achieve by the -s flag, e.g., -s pvmean to coarse the permeabilities using a pv-weighted mean. In addition, one could add a different label -l pvweightedperms to identify the generated .INC files with the permeabilities, and rename these files in order to be used in the coarser model with the rest of the properties using the default aporaches or a combination of them (e.g., -s max -l maxpermz and keep the maximum values of permz).
If we run these three models using OPM Flow, then we can compare the summary vectors. To this end, we use our good old friend plopm:
plopm -i 'DROGON_HIST DROGON_HIST_PYCOPM_PYCOPM DROGON_2TIMES_COARSER' -v 'FOIP,FOPR,TCPU' -tunits y -f 14 -subfigs 2,2 -delax 1 -loc empty,empty,empty,center -d 10,5 -xformat '.1f' -xlnum 6 -ylabel 'sm$^3$ sm$^3$/day seconds' -t 'Field oil in place Field oil production rate Simulation time' -labels 'DROGON DROGON 3XZ COARSER DROGON 2XYZ COARSER' -save drogon_pycopm_comparison -yformat '.2e,.0f,.0f'
We can also make a nice GIF by executing:
plopm -v sgas -subfigs 1,3 -i 'DROGON_HIST DROGON_HIST_PYCOPM_PYCOPM DROGON_2TIMES_COARSER' -d 16,10.5 -r 0,3 -m gif -dpi 300 -t "DROGON DROGON 3XZ COARSER DROGON 2XYZ COARSER" -f 16 -interval 2000 -loop 1 -cformat .2f -cbsfax 0.30,0.01,0.4,0.02 -s ,,1 -rotate -30 -xunits km -yunits km -xformat .0f -yformat .0f -c cet_rainbow_bgyrm_35_85_c69 -delax 1
Norne
By downloading the Norne model (and replacing the needed include files as described in the previous example), then here we create a coarser model by removing certain pilars in order to keep the main features of the geological model:
pycopm -i NORNE_ATW2013.DATA -x 0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,2,0,2,2,2,2,0 -y 0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,2,2,2,2,2,2,2,2,0 -z 0,0,2,0,0,2,2,2,2,2,02,2,2,2,2,0,0,2,0,2,2,0,0,0,0,0,0,0,0,0,0 -a min -p 1 -q 1
this would generate the following coarse model: