Scientific Python package for pore network modeling (PNM)
Project description
voids
voids is a scientific Python package for pore network modeling (PNM) aimed at
research workflows where reproducibility, explicit assumptions, and validation matter.
The current project emphasis is a clean canonical network model, interoperability with
PoreSpy/OpenPNM-style data, and a validated single-phase reference workflow before
expanding to more complex physics.
Goals
The intended direction of voids is:
- provide a rigorous internal representation of pore-throat networks
- preserve sample geometry and provenance information needed for reproducible studies
- support import and normalization of extracted networks from external tools
- expose well-scoped physics modules with diagnostics and regression tests
- build confidence on single-phase transport first, then expand toward richer models
This is a research codebase, not a GUI application or a full image-to-network extraction pipeline. Raw segmentation and extraction are intentionally delegated to upstream tools such as PoreSpy.
Current Scope
The current v0.1.x implementation includes:
- canonical
Network,SampleGeometry, andProvenancedata structures - import of PoreSpy/OpenPNM-style dictionaries into the canonical model
- geometry normalization helpers for extracted networks
- static petrophysics:
- absolute porosity
- effective porosity
- connectivity metrics
- single-phase incompressible flow with directional permeability estimation
- HDF5 serialization
- optional Plotly and PyVista network visualization
- interoperability cross-checks against OpenPNM
- optional direct-image permeability benchmarking against XLB
- synthetic and manufactured examples for regression and tutorials
Important boundaries:
- multiphase flow is not implemented yet
- production image acquisition and fully automated "push-button" extraction pipelines are out of scope
- controlled grayscale preprocessing, segmentation helpers, and
snow2-based extraction helpers are available invoids.image - synthetic mesh/manufactured examples are controlled validation cases, not realistic rock reconstructions
For a more formal statement of scope and assumptions, see spec_v0_1.md.
The rendered documentation is intended to live alongside the repository at https://geomech-project.github.io/voids/.
Installation
Recommended: Pixi
This repository is configured for Pixi and exposes four main environments:
default: core library + notebooks + plotting + PyVista + OpenPNMtest: everything indefaultplus test-only dependencieslbm: test environment plus the optional XLB stackdocs: MkDocs, Material for MkDocs, and mkdocstrings
pixi install
pixi run -e default python -c "import voids; print(voids.__version__)"
Pixi activation also provides project path variables used by notebooks:
VOIDS_PROJECT_ROOTVOIDS_NOTEBOOKS_PATHVOIDS_EXAMPLES_PATHVOIDS_DATA_PATH
Editable pip install
If you prefer a plain Python environment:
python -m pip install -e .
Optional extras:
python -m pip install -e ".[dev,viz,test,docs,lbm]"
Assumption to keep in mind: the notebooks are exercised primarily through the Pixi environments, so the most reliable setup is still Pixi.
Quick Start
from voids.examples import make_linear_chain_network
from voids.physics.petrophysics import absolute_porosity
from voids.physics.singlephase import FluidSinglePhase, PressureBC, solve
net = make_linear_chain_network()
result = solve(
net,
fluid=FluidSinglePhase(viscosity=1.0),
bc=PressureBC("inlet_xmin", "outlet_xmax", pin=1.0, pout=0.0),
axis="x",
)
print("phi_abs =", absolute_porosity(net))
print("Q =", result.total_flow_rate)
print("Kx =", result.permeability["x"])
print("mass_balance_error =", result.mass_balance_error)
There is also a small workflow entry point:
pixi run examples-singlephase
Examples And Notebooks
The repository includes paired notebooks and py:percent scripts under notebooks/:
01_mwe_singlephase_porosity_perm- minimal single-phase solve, porosity, and permeability
02_mwe_openpnm_crosscheck_optional- roundtrip and OpenPNM cross-check workflow
03_mwe_pyvista_visualization- optional PyVista-based network rendering
04_mwe_manufactured_porespy_extraction- manufactured 3D void image, PoreSpy extraction, import into
voids, and serialization
- manufactured 3D void image, PoreSpy extraction, import into
05_mwe_cartesian_mesh_network- configurable 2D/3D mesh-like pore networks, flow solve, Plotly visualization, and HDF5 export
06_mwe_real_porespy_extraction- real segmented Ketton image, PoreSpy extraction,
voidsimport, solve, and diagnostics
- real segmented Ketton image, PoreSpy extraction,
07_mwe_synthetic_vug_case- grayscale synthetic vug volume preprocessing, extraction, solve, and pruning comparison
08_mwe_image_based_vug_shape_sensitivity- controlled baseline vs spherical/ellipsoidal vug study with porosity,
Kabs, and network statistics
- controlled baseline vs spherical/ellipsoidal vug study with porosity,
09_mwe_image_based_vug_sensitivity_2d- simplified 2D image-based baseline vs circular/elliptical vug study with porosity,
Kabs, andK/K0distributions
- simplified 2D image-based baseline vs circular/elliptical vug study with porosity,
10_mwe_lattice_based_vug_sensitivity- lattice-based stochastic baselines with spherical/ellipsoidal vug insertion,
Kabs/porosity sensitivity, andK/K0distributions
- lattice-based stochastic baselines with spherical/ellipsoidal vug insertion,
11_mwe_lattice_based_vug_sensitivity_2d- simplified 2D lattice counterpart with circular/elliptical vugs, multi-baseline sensitivity, and
K/K0frequency distributions
- simplified 2D lattice counterpart with circular/elliptical vugs, multi-baseline sensitivity, and
12_mwe_synthetic_volume_openpnm_benchmark- synthetic spanning volumes, synthetic grayscale segmentation,
snow2extraction, andKabscross-checks betweenvoidsand OpenPNM
- synthetic spanning volumes, synthetic grayscale segmentation,
13_mwe_synthetic_volume_xlb_benchmark- synthetic segmented volumes, direct-image XLB solves, extracted-network
voidssolves, andKabscomparison between voxel-scale LBM and PNM
- synthetic segmented volumes, direct-image XLB solves, extracted-network
14_mwe_shape_factor_conductance_comparison- synthetic and extracted-network comparison of conductance closures (
generic_poiseuille,valvatne_blunt_throat, andvalvatne_blunt) and permeability sensitivity to shape factors
- synthetic and extracted-network comparison of conductance closures (
15_mwe_external_pnflow_benchmark- committed external
pnextract/pnflowreference cases compared against the currentvoidsextraction + solve workflow
- committed external
Example data under examples/data/ includes a deterministic manufactured void image and
generated artifacts from the extraction/mesh notebooks.
Scientific Notes
Several assumptions are deliberate and should be stated explicitly:
- extracted-network predictions depend strongly on upstream segmentation and extraction quality
- imported geometry fields may be incomplete or model-dependent across tools
- single-phase OpenPNM cross-checks compare solver/assembly consistency, not universal physical truth
- throat visualization may use arithmetic averaging of pore scalars when no throat scalar field is provided; that is a visualization choice, not a constitutive model
If any of those assumptions are inappropriate for a study, the corresponding workflow should be tightened before using results quantitatively.
Development
Useful commands:
pixi run test
pixi run test-cov
pixi run lint
pixi run typecheck
pixi run precommit
pixi run notebooks-smoke
Version updates are handled with:
pixi run bump-version 0.1.4
Status
voids is still pre-alpha. The codebase is already useful for controlled PNM experiments,
solver validation, and interoperability studies, but it should not be described as a
complete pore-network simulation platform yet.
Institutional Support
voids receives institutional support from the
Laboratório Nacional de Computação Científica (LNCC),
a research unit of the Ministério da Ciência, Tecnologia e Inovação (MCTI), Brazil.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file voids-0.1.4.tar.gz.
File metadata
- Download URL: voids-0.1.4.tar.gz
- Upload date:
- Size: 9.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29b87bf4ee01fe7e13a019c6022c8884497d071cc683bf993e5d77fc5bc03843
|
|
| MD5 |
09353059db0b88742f635a73c72b24a9
|
|
| BLAKE2b-256 |
386345d4f9e07afc6677d3afe19bf41ba8dabdd2f6fda958b0437ca37287aaf4
|
Provenance
The following attestation bundles were made for voids-0.1.4.tar.gz:
Publisher:
publish-pypi.yml on geomech-project/voids
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
voids-0.1.4.tar.gz -
Subject digest:
29b87bf4ee01fe7e13a019c6022c8884497d071cc683bf993e5d77fc5bc03843 - Sigstore transparency entry: 1064377670
- Sigstore integration time:
-
Permalink:
geomech-project/voids@d6b1f674379edb991b1dc9bf641bee9b05dcf4a7 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/geomech-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@d6b1f674379edb991b1dc9bf641bee9b05dcf4a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file voids-0.1.4-py3-none-any.whl.
File metadata
- Download URL: voids-0.1.4-py3-none-any.whl
- Upload date:
- Size: 111.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e7e0823f12aa17025fbf692e901ec526440467912eae13ff49d46c1171e8c37
|
|
| MD5 |
683694763c2d27f69d5291f66133caa9
|
|
| BLAKE2b-256 |
7cee738a01a7a7a36fc56f370539456150e9a12c034d4ec8a468096a0712e066
|
Provenance
The following attestation bundles were made for voids-0.1.4-py3-none-any.whl:
Publisher:
publish-pypi.yml on geomech-project/voids
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
voids-0.1.4-py3-none-any.whl -
Subject digest:
1e7e0823f12aa17025fbf692e901ec526440467912eae13ff49d46c1171e8c37 - Sigstore transparency entry: 1064377715
- Sigstore integration time:
-
Permalink:
geomech-project/voids@d6b1f674379edb991b1dc9bf641bee9b05dcf4a7 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/geomech-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@d6b1f674379edb991b1dc9bf641bee9b05dcf4a7 -
Trigger Event:
push
-
Statement type: