Importing Grid Models¶
Currently, Petres supports importing grids only from Eclipse .GRDECL files, with a limited set of supported keywords.
Importing allows you to load grid geometry, grid properties, and the active cell mask into a CornerPointGrid object.
Note
For a detailed description of the keywords used in .GRDECL files and their structure, see the Corner-Point Grid Representation in Eclipse section.
Importing Grid Geometry¶
A grid can be imported directly from a .GRDECL file using the from_grdecl() method:
from petres.grids import CornerPointGrid
grid = CornerPointGrid.from_grdecl("model.grdecl")
grid.show()
By default, this method automatically reads:
Grid geometry (
COORD,ZCORN,SPECGRID, orDIMENS)Active cell mask (
ACTNUM)
Important
The file must contain at least the grid geometry keywords (COORD, ZCORN, SPECGRID, or DIMENS).
To import the grid without the active cell mask, set the use_actnum parameter to False:
grid = CornerPointGrid.from_grdecl("model.grdecl", use_actnum=False)
This is useful when you want to define ACTNUM manually after import.
Importing Properties¶
Properties stored in the Eclipse file can be imported by specifying their keywords in the properties argument:
grid = CornerPointGrid.from_grdecl(
"model_with_props.grdecl",
properties=["PORO", "PERMX"],
)
porosity = grid.properties["PORO"]
permeability = grid.properties["PERMX"]
Only the specified properties are imported.