Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.2.1 instead.
Reason given by maintainers: Superseded by 0.2.1

SubsurfiX

SubsurfiX

PyPI version pepy downloads DOI License: AGPL-3.0-or-later

v0.1.1

SubsurfiX takes you from a folder of well logs to a checked, correlated log set and a 3D property model you can run flow and heat simulations on. I built it because these steps usually live in separate tools, and every hand-off (cleaning logs, filling gaps, correlating wells, gridding, simulating) is where things get lost or quietly changed. Here it's one project file and one run: every filled value carries a provenance code, so you always know what was measured and what was filled. The engine is written in Rust, and you drive it from Python or the command line.

Installation

pip install subsurfix

Python 3.12 or newer. Prebuilt wheels are for macOS arm64; on other systems pip builds from source, which needs Rust, a C/C++ compiler and libclang. Building from a clone, and installing the MODFLOW 6 (the U.S. Geological Survey modular hydrologic model; Langevin et al., 2017) program for examples 09 and 10, are covered in examples/README.md.

Quick start

import subsurfix as sx

toml = sx.write_demo_project("sx_demo")   # a small made-up project, no data needed
sx.prepare_edges(toml)
sx.Project(toml).run()                    # clean, fill, correlate and export the logs

To start on your own logs, sx.init_project("my_project", las_dirs=["las"]) writes a settings file you can edit. More options, including the command line, are in examples/README.md.

Citation

Lai, L.S.-H. (2026) SubsurfiX. Zenodo, https://doi.org/10.5281/zenodo.23832007

Model

3D porosity model built from 60 Kansas wells A 3D porosity model built from 60 Kansas wells, the end product of the log-to-model workflow.

  • Log clean-up and gap filling. Read LAS files and well surveys, mark bad sections, and fill gaps with rules and machine learning (LightGBM). Every value carries a code that says whether it was measured or filled.
  • Well correlation. Match the same beds from well to well automatically, solving all wells together.
  • Grids and properties. Build regular grids, or corner-point grids with faults (the GRDECL format used by industry reservoir tools), and fill them with porosity and rock type by kriging, simulation or machine learning, with low/mid/high (P10/P50/P90) cases. Rock types: sandstone, shale, limestone, dolomite and cherty carbonate.
  • Data exchange. Leapfrog through OMF files, and OpenGeoSys (OGS, an open-source finite-element code for coupled thermal, hydraulic, mechanical and chemical processes; Kolditz et al., 2012) mesh files (.vtu).
Raw, cleaned and gap-filled logs Well correlation section
One Kansas well: the raw log (grey), what the clean-up kept (black) and the filled samples (red). A west–east section, by depth (left) and after correlation (right), where the beds line up.
Porosity maps of one layer
Porosity in one layer, mapped four ways side by side.

Each step has an executed notebook on open data from the Kansas Geological Survey (KGS) and FORCE 2020; see examples/README.md.

Fundamentals

Flow and heat simulations in SubsurfiX rest on two balances:

  • Mass balance with Darcy's law. In every small piece of rock, fluid that flows in minus fluid that flows out equals the change in fluid stored. Darcy's law says how fast fluid flows: faster through more permeable rock, for a bigger pressure difference, and for a thinner (less viscous) fluid. With several fluids (water, oil, gas, CO₂), each one has its own balance and they share the pore space.
  • Energy balance (heat transport). Heat is carried along by moving fluid and also spreads by conduction through rock and fluid; the heat stored in a cell changes by what flows in and out.

These equations are solved on a grid of cells. SubsurfiX uses the finite-volume method: the model is split into cells, and whatever leaves one cell enters its neighbour, so mass and energy are conserved exactly. Cells are connected by two-point flux approximation (TPFA: the flow between two cells depends on their pressure difference). Finite-element methods, as used by OpenGeoSys, are planned (see Roadmap).

Method overview

MRST (MATLAB Reservoir Simulation Toolbox) is SINTEF's open-source MATLAB toolbox for reservoir simulation (Lie, 2019; Lie and Møyner, 2021). SubsurfiX reimplements some methods from MRST papers in Rust; it does not call MATLAB.

Method Purpose Source / credit Fluids and heat Grids Pros Cons
FIM-OBL (default): fully implicit (FIM: all unknowns solved together each time step) finite-volume solver with operator-based linearization (OBL: fluid properties read from pre-computed tables) How water, oil, gas or CO₂ move and how heat spreads over time Method of open-DARTS (open Delft Advanced Research Terra Simulator; Voskov et al., 2024; Voskov, 2017) Water, water–oil, oil–gas, CO₂–brine; heat Regular and corner-point (faulted) Most complete: every fluid system plus heat Slowest of the three; experimental
MODFLOW 6 through FloPy (the Python package for building and running MODFLOW models; Bakker et al., 2016) Groundwater flow and heat with a trusted standard code USGS; groundwater flow (GWF) and energy transport (GWE) models Water; heat. Not multiphase (single fluid only) Regular only Widely tested reference Water and heat only; needs the mf6 program
CO₂ vertical-equilibrium (VE) model (from MRST papers, reimplemented in Rust) Quick screening of where stored CO₂ goes over decades and how much is trapped MRST co2lab papers (Nilsen et al.) CO₂–brine only, constant temperature Regular and corner-point (top surface) Runs in seconds; reports structural and residual trapping (example 13 compares it with FIM-OBL on the same case) Treats CO₂ as a thin layer under the caprock; no dissolution; less detail
Corner-point faulted grids (GRDECL reader, fault connections from MRST methods) Using real industry grids with faults MRST grid methods, reimplemented in Rust Grid input, not a solver Corner-point with faults Real faulted grids for FIM-OBL and VE Faults are geometric overlaps only; fault-rock properties only through multipliers

The animation below uses a 5 × 5 km window of the Kansas property model from the examples (60 m thick, split into 10 × 10 × 12 cells of 500 × 500 × 5 m). One injector (INJ) and one producer (PROD) are open in all layers, and a corner is cut away so you can see inside.

Same method, different fluids (FIM-OBL)

This compares how three injected fluids move through the same reservoir with the same solver, wells and times: water pushing oil, gas pushed into a black oil, and CO₂ pushed into brine. Colours show how much of the pore space the injected fluid fills. In these runs (0.008 m³/s for 40 years, about 5 % of the pore volume; example 12), the injector pressure at 40 years was 24.8 MPa for water, 14.5 MPa for gas and 13.6 MPa for CO₂, and CO₂ reached the producer after 18 years; mass-balance errors stayed below 6e-8.

Water, gas and CO2 injection compared with FIM-OBL on a Kansas model window

How do different injected fluids spread through the same real reservoir?

Roadmap: finite-element methods in the style of OpenGeoSys.

References

Porous-media flow (water, oil, gas, CO₂–brine)

  • Langevin, C. D., et al. (2017). Documentation for the MODFLOW 6 groundwater flow model. USGS Techniques and Methods 6-A55. https://doi.org/10.3133/tm6A55
  • Bakker, M., et al. (2016). Scripting MODFLOW model development using Python and FloPy. Groundwater 54(5). https://doi.org/10.1111/gwat.12413
  • Peaceman, D. W. (1983). Interpretation of well-block pressures in numerical reservoir simulation with nonsquare grid blocks and anisotropic permeability. SPE Journal 23(3). https://doi.org/10.2118/10528-PA
  • Voskov, D., Saifullin, I., Novikov, A., Wapperom, M., et al. (2024). open Delft Advanced Research Terra Simulator (open-DARTS). Journal of Open Source Software. https://doi.org/10.21105/joss.06737
  • Voskov, D. V. (2017). Operator-based linearization approach for modeling of multiphase multi-component flow in porous media. Journal of Computational Physics 337, 275–288. https://doi.org/10.1016/j.jcp.2017.02.041
  • Khait, M., Voskov, D. V. (2017). Operator-based linearization for general purpose reservoir simulation. Journal of Petroleum Science and Engineering 157, 990–998. https://doi.org/10.1016/j.petrol.2017.08.009
  • Spycher, N., Pruess, K. (2005). CO₂–H₂O mixtures in the geological sequestration of CO₂. II. Partitioning in chloride brines at 12–100 °C and up to 600 bar. Geochimica et Cosmochimica Acta 69(13), 3309–3320. https://doi.org/10.1016/j.gca.2005.01.015
  • Ziabakhsh-Ganji, Z., Kooi, H. (2012). An equation of state for thermodynamic equilibrium of gas mixtures and brines to allow simulation of the effects of impurities in subsurface CO₂ storage. International Journal of Greenhouse Gas Control 11. https://doi.org/10.1016/j.ijggc.2012.07.025
  • Nordbotten, J. M., Celia, M. A. (2006). Similarity solutions for fluid injection into confined aquifers. Journal of Fluid Mechanics 561, 307–327. https://doi.org/10.1017/S0022112006000802
  • Nilsen, H. M., et al. (2011). Field-case simulation of CO₂-plume migration using vertical-equilibrium models. Energy Procedia 4, 3801–3808. https://doi.org/10.1016/j.egypro.2011.02.315
  • Nilsen, H. M., Lie, K.-A., Andersen, O. (2016). Fully-implicit simulation of vertical-equilibrium models with hysteresis and capillary fringe. Computational Geosciences 20, 49–67. https://doi.org/10.1007/s10596-015-9547-y
  • Lie, K.-A. (2019). An Introduction to Reservoir Simulation Using MATLAB/GNU Octave (MRST). Cambridge University Press. https://doi.org/10.1017/9781108591416
  • Lie, K.-A., Møyner, O. (eds.) (2021). Advanced Modeling with the MATLAB Reservoir Simulation Toolbox. Cambridge University Press. https://doi.org/10.1017/9781009019781

Heat transport

Well logs, correlation and property modelling

Data sources

Acknowledgements

FIM-OBL follows methods published for open-DARTS and OpenGeoSys; it has not been checked as equivalent to either code. The CO₂ VE relative permeabilities are derived from MRST (SINTEF Digital, GPL-3.0-or-later). MODFLOW 6 and FloPy are by the USGS. 3D animations use PyVista. Details and data credits are in NOTICE and the files in docs/.

Metadata

Release files for subsurfix 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for subsurfix 0.1.2
File Size Uploaded Provenance Actions
subsurfix-0.1.2.tar.gz 626.5 kB Without provenance Details for subsurfix-0.1.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for subsurfix 0.1.2
File Interpreter ABI Platform Actions
subsurfix-0.1.2-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for subsurfix-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
subsurfix-0.1.2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for subsurfix-0.1.2-cp312-cp312-macosx_11_0_arm64.whl

Total release size: 19.4 MB

Release files / subsurfix-0.1.2.tar.gz

Download URL subsurfix-0.1.2.tar.gz
Size 626.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1ef8eb2bb38c09e95996f4b927b5305352ca32a4c26db6216bc45fa842733fec
BLAKE2b-256 checksum
How to use checksums
6cd52832a8a24194bdd83f3a50850ef736bea262074e32b3de716039a3878da9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / subsurfix-0.1.2-cp313-cp313-macosx_11_0_arm64.whl

Download URL subsurfix-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Size 9.4 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b41d8c0b4a42bc83431cc6460b75300ec52ddfd607c681fcdb4e05b99d27bc59
BLAKE2b-256 checksum
How to use checksums
ea070137e72cc60579926c4f29f4f204e03302139055234b4a028858a54800aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / subsurfix-0.1.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL subsurfix-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Size 9.4 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d3aa43136c7f38ecd6469785b1ddfe440dc0a90a948caedf614110d51081a308
BLAKE2b-256 checksum
How to use checksums
b5789f613c44f4f4cd3622666f1c3f5c7879a8099d4bb43660a0c328cf828428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for subsurfix 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

3 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page