Introduction#

Near-well gas-saturation simulation generated with pyopmnearwell

pyopmnearwell is a flexible framework for generating and running near-well models with the OPM Flow simulator. A configuration file selects the physical model, template, grid, properties, and operational schedule.

Core workflow#

  1. Select a physical model and compatible Mako template.

  2. Choose a radial, Cartesian, tensor, coordinate, core, or corner-point grid.

  3. Define x, y, and z refinement and near-well geometry.

  4. Define vertical rock layers, permeability, porosity, and saturation functions.

  5. Configure perforations, boundary behavior, and the injection schedule.

  6. Generate the OPM Flow deck and include files.

  7. Run OPM Flow and inspect the generated vectors with external tools.

Physical models#

The current validator accepts co2store, co2eor, foam, h2store, and saltprec. Model-specific templates are stored under src/pyopmnearwell/templates. Requirements differ by model and template, as described in Configuration reference.

Core workflows#

  • Generate only the deck and include files.

  • Run OPM Flow from previously generated files.

  • Generate and run using separate preprocessing and output directories.

  • Generate and run in one output directory.

  • Write EGRID, INIT, and UNRST cell vectors when requested.

  • Generate saturation and porosity-permeability tables without running Flow.

Basic usage#

pyopmnearwell -i examples/co2.toml -o co2
pyopmnearwell -i examples/co2.toml -o co2 -m deck
pyopmnearwell -i examples/co2.toml -o co2 -m single

Use Command-line reference for exact syntax and Examples for complete workflows.

Visualization#

The built-in plotting functionality was retired in release 2025.04. Use plopm or ResInsight for PNGs, GIFs, variable profiles, and distance-to-boundary visualizations. ParaView can be used when Flow is run with --enable-vtk-output=true.

Development limitations#

Warning

The H2CH4 template under h2store remains under development and is based on BO_DIFFUSE_CASE1.DATA from opm-tests. The co2eor and foam templates are based on SPE5.BASE from opm-publications. Their current PVT data limit the usable pressure and temperature ranges.

About the project#

pyopmnearwell graphical project overview

pyopmnearwell is funded by the HPC Simulation Software for the Gigatonne Storage Challenge project (project 622059) and the Center for Sustainable Subsurface Resources (project 331841).

Where to continue#