pycopm#

Tailor OPM Flow geological models by coarsening, refining, extracting submodels, and transforming grids.

pycopm creates modified, simulation-ready OPM Flow models from existing .DATA decks. Generic deck workflows are the active development path. Legacy TOML workflows remain available for existing Norne and Drogon coarsening and ERT studies.

Get started

Understand the deck-first workflow and choose a model operation.

Introduction
Install

Install pycopm, OPM Flow, and visualization tools.

Installation
Follow the tutorial

Work through the complete Hello World deck workflow.

Tutorial
CLI reference

Look up options, defaults, formats, and compatibility rules.

Command-line reference

Quick installation#

Install the current development version:

pip install git+https://github.com/cssr-tools/pycopm.git

See Installation for supported Python versions, OPM Flow, visualization tools, virtual environments, platform-specific dependencies, and installation from source.

Quick start#

Coarsen the bundled Hello World deck and run the complete workflow:

pycopm -i examples/decks/HELLO_WORLD.DATA -c 5,5,1 -m all -o output

Display the available command-line options:

pycopm --help

See Tutorial for a guided workflow, Examples for larger applications, and Command-line reference for exact syntax, accepted values, defaults, and option compatibility.

What can pycopm do?#

Coarsen geological models

Remove selected pillars and grid lines, aggregate continuous and discrete properties, preserve pore volume, and optionally upscale transmissibilities and non-neighbouring connections.

Refine simulation grids

Add cells globally or in selected x, y, and z intervals while mapping properties, regions, wells, faults, and other indexed deck data to the refined grid.

Extract focused submodels

Select cells by region values, xy polygons, or well-centred box, diamond, and diamondxy neighbourhoods, with configurable boundary pore-volume handling.

Transform grid geometry

Translate, scale, or rotate OPM Flow grids to reposition models, modify dimensions, or align geological descriptions from different sources.

Generate simulation-ready files

Write modified OPM Flow decks and supporting include files, run preparation and dry-run stages, and control names, precision, initialization, and completion rewriting.

Support advanced coarsening workflows

Control active-cell aggregation, region and property upscaling, fluid-in-place correction, fault-related jump handling, and dual net/non-net coarsening.

Integrate with other tools

Use generated decks directly with OPM Flow or adapt them for ERT, PET, visualization tools, history matching, optimization, proxy modelling, and uncertainty studies.

Maintain legacy integrated studies

Continue existing Norne and Drogon coarsening and ERT workflows through the retained TOML configuration interface while new development focuses on generic deck input.