resdata extension: Dealing with summary, restart and egrid files

Input and output using resdata package

The Python package resdata developed by Equinor can be loaded to add support for reading summary files (sparse data), egrid (processed grid), init (initial conditions) and restart (cell-wise results).

resdata is GPL-3.0 licensed

The resdata package is under a different license than GeoEnergyIO which uses MIT. The licenses are compatible, but a distributed product that contains resdata must comply with the terms of the GPL license.

To add support for this extension, you have to add PythonCall to your environment (one-time operation):

using Pkg
Pkg.add("PythonCall")

Afterwards, you can then load the package to get access to the new functions:

using PythonCall

Reading output

GeoEnergyIO.read_restartFunction
restart = read_restart(fn)
restart, raw_restart = read_restart(fn, extra_out = true)

Read a restart file from fn. This should be the base path (i.e. without the .RSRT extension). The results are given as a Vector of Dicts.

Keyword arguments

  • extra_out: If true, return the raw Python object as well as the parsed data. Default is false.
  • actnum=missing: ACTNUM array that can be used to reduce the outputs to the active cells.
  • egrid=missing: EGRID object needed to read the restarts. Will be read from the same path as fn if not provided.

Notes

This function requires the resdata Python package to be installed, which will be automatically added to your environment if you first install PythonCall and put using PythonCall in your script or REPL.

The main class to lookup on the Python side of things is ResdataRestartFile.

source
GeoEnergyIO.read_initFunction
init = read_init(fn)
init, raw_init = read_init(fn, extra_out = true)

Read a init file from fn. This should be the base path (i.e. without the .RSRT extension). The results are given as a Dict.

Keyword arguments

  • extra_out: If true, return the raw Python object as well as the parsed data. Default is false.
  • actnum=missing: ACTNUM array that can be used to reduce the outputs to the active cells.

Notes

This function requires the resdata Python package to be installed, which will be automatically added to your environment if you first install PythonCall and put using PythonCall in your script or REPL.

The main class to lookup on the Python side of things is ResdataFile.

source
GeoEnergyIO.read_egridFunction
egrid = read_egrid(pth)
egrid, raw_egrid = read_egrid(pth, extra_out = true)

Read the EGRID file from pth. The results are given as a Dict and can be passed further on to mesh_from_grid_section to construct a Jutul mesh.

Notes

This function requires the resdata Python package to be installed, which will be automatically added to your environment if you first install PythonCall and put using PythonCall in your script or REPL.

Uses primarily resdata.grid.Grid.

source
GeoEnergyIO.read_summaryFunction
summary = read_summary(pth)
summary, raw_summary = read_summary(pth, extra_out = true)

Read the SUMMARY file from pth. The results are given as a Dict.

Notes

This function requires the resdata Python package to be installed, which will be automatically added to your environment if you first install PythonCall and put using PythonCall in your script or REPL.

Uses primarily resdata.summary.Summary.

source

Writing output

Experimental features

Writing files is currently highly experimental. Not all fields are properly set in summary files (e.g. units).

GeoEnergyIO.write_egridFunction
write_egrid(case::JutulCase, pth)

Write an EGRID file from a JutulCase from JutulDarcy.jl. This is a convenience function that will extract the reservoir domain and input data from the case. It is assumed that the case has been set up from a data file so that the mesh matches the GRID section.

source
write_egrid(reservoir::DataDomain, data::Dict, pth)

Write EGRID from a reservoir/DataDomain from JutulDarcy.jl that has been constructed from a data file.

source
write_egrid(G::UnstructuredMesh, data::Dict, pth)

Write EGRID from UnstructuredMesh that was constructed from the GRID section of the data file.

source
write_egrid(data::AbstractDict, pth)

Write EGRID from a Dict that has been parsed from a data file. Can be either the GRID section or the full data file.

source