pycopm: An open-source tool to tailor OPM Flow geological models

David Landa-Marbán · 2026

Read pycopm: An open-source tool to tailor OPM Flow geological models by David Landa-Marbán (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2602-11777.txt.

Introduction

Reservoir simulations help energy firms decide how oil, gas, water, hydrogen, and carbon dioxide will flow underground. But predictions stay accurate only if geological models can be updated fast as new data arrive. David Landa-Marbán presents pycopm, an open-source tool built to make that updating faster and easier. Users can simplify complex grids, focus on specific reservoir regions, or change a model shape and position.

Those abilities let engineers test scenarios efficiently instead of rebuilding models by hand. First used on two well-known public datasets, pycopm has since proved useful far more widely thanks to easy-to-use features and recent extensions. Today it supports model refinement, comparison of coarse and detailed models, study of interactions between nearby sites, and faster troubleshooting in large simulations.

Catalog record

CREATORDavid Landa-Marbán
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE11 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2602-11777

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

pycopm: An open-source tool to tailor OPM Flow geological models David Landa-Marbán Abstract Reservoir simulations help the energy industry make better decisions by predicting how fluids like oil, gas, water, hydrogen, and carbon dioxide will flow underground. To keep these predictions accurate, engineers often need to update geological models quickly as new information becomes available. pycopm is a tool designed to make this process faster and easier. It allows users to adjust geological models in several ways, such as simplifying complex grids, focusing on specific parts of a reservoir, or changing the shape and position of the model. These capabilities help engineers test different scenarios efficiently. Although pycopm was first used on two well-known public datasets, it has since become useful in many other situations because of its easy-to-use features and recent extensions. Today, it supports studies involving model refinement, comparing coarse and detailed models, analyzing interactions between nearby sites, and speeding up troubleshooting in large simulations. The graphical abstract is shown in Fig. 1 . Figure 1: Graphical representation of pycopm ’s functionality. See the online documentation for reproduction details. 1 Statement of need The first step in reservoir simulations is to choose a simulation model, which serves as the computational representation of a geological model, incorporating properties such as heterogeneity, physics, fluid properties, boundary conditions, and wells. Once the spatial model is designed, it is discretized into cells containing average properties of the continuous reservoir model. All this information is then communicated to the simulator, which internally solves conservation equations (mass, momentum, and energy) and constitutive equations (e.g., saturation functions, well models) to perform the predictions. OPM Flow is an open-source simulator for subsurface applications such as hydrocarbon recovery, CO 2 storage, and H 2 storage [ 6 ] . The input files of OPM Flow follow the standard-industry Eclipse format. The different functionality is defined using keywords in a main input deck with extension .DATA and additional information is usually added in .INC files such as tables (saturation functions, PVT) and the grid discretization. We refer to the OPM Flow manual for an introduction to OPM Flow and all supported keywords. Simulation models can be substantial, typically encompassing millions of cells, and can be quite complex due to the number of wells and faults, defined by cell indices in the x, y, and z direction (i, j, k nomenclature). While manually modifying small input decks is feasible, it becomes impractical for large models. In addition, these models commonly rely on corner-point grids defined through pillars and horizons, and they may include further geometric modifications specified through deck keywords. Such representations are not intuitive to manipulate, particularly for users who are not familiar with the internal structure of simulation decks. These challenges inspired the development of pycopm , a user-friendly Python tool designed to tailor geological models from provided input decks. pycopm is intended for researchers, engineers, and students who need to apply model transformations such as coarsening, refinement, submodel extraction, and structural adjustments. The coarsening and refinement capabilities are especially relevant in current workflows, since multi-fidelity modeling has become an active and widely adopted research direction that requires the flexibility to generate models with different levels of complexity. 2 State of the field Two key properties in a reservoir model are its storage capacity, measured by pore volume, and the ability of fluids to flow between cells, known as transmissibilities. Therefore, these properties must be properly handled when generating a new model. While grid refinements and transformations do not pose a significant issue, submodels and grid coarsening present challenges due to lack of unique methods for addressing these properties. In other words, the approach depends on the specific model, and while there are a few methods in the literature, this remains an active area of research. opm-upscaling is part of the OPM initiative , and provides a set of C++ tools focused on single-phase and steady-state upscaling of capillary pressure and relative permeability. However, it does not include functionality for grid refinement or affine transformations, and its upscaling routines operate mainly on the grid structure. As a result, users must manually adjust the remaining components of the deck to match the new i, j, and k indices. Examples include updating the locations of wells, numerical aquifers, and other model elements. ResInsight is an open-source C++ tool designed for postprocessing reservoir models and simulations. It can export modified simulation grids and supports operations such as grid refinement and submodel extraction. Nevertheless, it does not generate an updated input deck reflecting the modified i, j, and k coordinates. It also lacks built-in capabilities for model coarsening or for applying general affine transformations. Users on macOS may encounter installation challenges, and the software has difficulty handling models with very small cell dimensions (below 1 mm) or with very large cell counts (greater than 100 million). To the author’s knowledge, prior to the development of pycopm there was no integrated Python-based solution that combined coarsening, refinement, submodel extraction, and geometric transformations for modifying geological models compatible with OPM Flow. Python offers a significantly more accessible environment than C++, which lowers the entry barrier for researchers, engineers, and students who need flexible model manipulation tools. pycopm offers flexibility in selecting different approaches, allowing end-users to compare methods and choose the one that best fits their needs. For additional information about the different approaches implemented in pycopm for coarsenings, refinements, submodels, and transformations, see the theory in pycopm ’s documentation. 3 Software design pycopm leverages well-established and excellent Python libraries. The Python package NumPy [ 2 ] forms the basis for performing array operations. The pandas package [ 9 ] is used for handling cell clusters, specifically employing the methods in pandas.Series.groupby . The Shapely package [ 1 ] , particularly the contains_xy , is fundamental for submodel implementation to locate grid cells within a given polygon. To parse the output binary files of OPM Flow, the opm Python libraries are utilized. The primary methods developed in pycopm include handling of corner-point grids, upscaling transmissibilities in complex models with faults (non-neighbouring connections) and inactive cells, projecting pore volumes on submodel boundaries, interpolating to extend definition of i, j, k dependent properties (e.g., wells, faults) in grid refinement, and parsing and writing input decks. Interaction with the tool is performed through a terminal executable named pycopm , which provides a set of command-line flags (27 at the time of writing; see the online documentation for the current list ). These flags control the desired functionality, such as specifying the input deck, defining how the model should be modified, and selecting the output file name. This design enables users to chain multiple operations by further editing the generated decks. For example, a user may refine a model first and subsequently extract a submodel. An illustrative example is provided in test_4_submodel.py in the project repository. Advanced users who are familiar with Python can access the underlying functionality directly through Python scripts. This provides greater flexibility for integrating the tool into more sophisticated workflows and for customizing model transformations to meet specific research or engineering needs. 4 Research impact statement pycopm is already being adopted across several projects at NORCE Research AS and Equinor ASA. The user

Read the complete text