Skip to main content

OpenImpala

Banner

Open In Colab PyPI License: BSD-3-Clause DOI GitHub release Build and Test codecov

OpenImpala is a high-performance framework for computing effective transport properties — tortuosity, effective diffusivity tensors, and effective conductivity — directly from 3D voxel images of porous media (X-ray CT, FIB-SEM, synthetic microstructures). It solves the governing PDEs on the Cartesian voxel grid using finite-volume discretisation, bypassing mesh generation, and scales across MPI ranks and CUDA GPUs via AMReX and HYPRE.

Outputs parameterise continuum-scale models such as PyBaMM.

📖 Documentation: https://base-laboratory.github.io/OpenImpala/ 📓 Tutorials: https://base-laboratory.github.io/OpenImpala/tutorials/index.html

Quick example

import numpy as np
import openimpala as oi

image = np.zeros((64, 64, 64), dtype=np.int32)
image[16:48, 16:48, 16:48] = 1   # central solid obstacle

with oi.Session():
    vf  = oi.volume_fraction(image, phase=0)
    tau = oi.tortuosity(image, phase=0, direction="z", solver="mlmg")
    print(f"Volume fraction: {vf.fraction:.4f}")
    print(f"Tortuosity:      {tau.tortuosity:.4f}")

Tutorials

All tutorials are pre-rendered in the online documentation and runnable on Google Colab:

# Tutorial Launch
01 First Transport Solve & Analytical Verification Open In Colab
02 Microstructural Metrics & Directional Anisotropy Open In Colab
03 Periodic Homogenisation & the 3×3 Effective Diffusivity Tensor Open In Colab
04 Multi-Phase Transport in Composite Media Open In Colab
05 Representative Elementary Volume (REV) & Subvolume Uncertainty Open In Colab
06 Cloud-Native OME-Zarr & Out-of-Core yt Plotfiles Open In Colab

Install

pip install "openimpala[openmpi]"   # Linux x86_64 C++/MPI wheel + OpenMPI runtime
pip install openimpala-cuda openmpi # compiled CUDA 12 GPU wheel + OpenMPI runtime (Linux x86_64)

On HPC clusters, load your system MPI module (module load openmpi) and run pip install openimpala so cluster InfiniBand MPI takes precedence automatically. On macOS, Windows, and ARM64, pip install openimpala installs a universal pure-Python SciPy solver (with optional CuPy acceleration) under the identical API. See Getting Started for full details.

Container (HPC)

Pre-built Apptainer/Singularity images are attached to each GitHub Release:

apptainer exec -B "$(pwd):/data" openimpala-vX.Y.Z.sif \
    /usr/bin/Diffusion /data/inputs

For batch SLURM scripts, see HPC Usage.

Build from source / Conda & Spack

Conda-Forge (packaging/conda-forge/) and Spack (packaging/spack/) recipes are bundled alongside native CMake builds; see CONTRIBUTING.md and Getting Started.

Features

  • Steady-state diffusion / conduction on raw or segmented 3D voxel images (built-in Otsu thresholding)
  • Tortuosity factor, 3D cell-centred diffusive flux fields (return_flux=True), full 3×3 effective diffusivity tensor, and multi-phase transport
  • Microstructural metrics: volume fraction, percolation, particle size, total & electrochemically active specific surface area (active_only=True), and resumable REV studies
  • Synthetic 3D microstructure & ML surrogate dataset generators (openimpala.synthetic)
  • TIFF / HDF5 / OME-Zarr / collective MPI-IO RAW / DAT image input; AMReX yt/ParaView plotfiles and BPX / BattINFO JSON output
  • Solvers: HYPRE (PCG, FlexGMRES, BiCGSTAB; SMG / PFMG preconditioners) and AMReX MLMG (float64, float32, and mixed-precision defect-corrected V-cycles, GPU-native)
  • MPI + OpenMP + CUDA parallelism — scales from a laptop to multi-node HPC

Citation

If you use OpenImpala in published work, please cite:

@article{LeHoux2021OpenImpala,
  title   = {{OpenImpala}: {OPEN} source {IMage} based {PArallisable} {Linear} {Algebra} solver},
  author  = {Le Houx, James and Kramer, Denis},
  year    = {2021},
  journal = {SoftwareX},
  volume  = {15},
  pages   = {100729},
  doi     = {10.1016/j.softx.2021.100729},
}

If you use the homogenisation-based effective diffusivity workflow, additionally cite Le Houx et al., Transport in Porous Media 150, 71–88 (2023), doi:10.1007/s11242-023-01993-7.

License

BSD 3-Clause. See LICENSE.

Acknowledgements

This work was financially supported by the EPSRC Centre for Doctoral Training in Energy Storage and its Applications [EP/R021295/1]; the Ada Lovelace Centre (STFC) project CANVAS-NXtomo; the EPSRC prosperity partnership with Imperial College, INFUSE [EP/V038044/1]; the Rutherford Appleton Laboratory; the Faraday Institution Emerging Leader Fellowship [FIELF001]; and Research England's Expanding Excellence in England grant at the University of Greenwich via the M34Impact programme. We acknowledge the use of the IRIDIS HPC facility, Diamond Light Source's Wilson cluster, STFC SCARF, and the University of Greenwich M34Impact cluster, and thank the developers of AMReX, HYPRE, libtiff, and HDF5.

Contact

Maintainer: James Le Houx (j.lehoux@greenwich.ac.uk). Issues and feature requests: https://github.com/BASE-Laboratory/OpenImpala/issues. Questions: GitHub Discussions.

Metadata

Release files for openimpala 5.2.0

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

Built distributions (wheels)

Table of built distributions (wheels) for openimpala 5.2.0
File Actions
openimpala-5.2.0-py3-none-any.whl Python 3 none any Details for openimpala-5.2.0-py3-none-any.whl
openimpala-5.2.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for openimpala-5.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
openimpala-5.2.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for openimpala-5.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
openimpala-5.2.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for openimpala-5.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
openimpala-5.2.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for openimpala-5.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
openimpala-5.2.0-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details for openimpala-5.2.0-cp39-cp39-manylinux_2_28_x86_64.whl

Total release size: 24.4 MB

Release files / openimpala-5.2.0-py3-none-any.whl

Download URL openimpala-5.2.0-py3-none-any.whl
Size 76.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb7cfda1845239d89fa79a906856067b75d19dd2f95152c2411bb33b6e3cc09c
BLAKE2b-256 checksum
How to use checksums
7640e8f835c32dcad8ed63db50f1ef89760c52540973b6c167a74e35a5c6a9d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / openimpala-5.2.0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL openimpala-5.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 4.9 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
20be0eb77bae19174143b5bbb59ee4e0434352b60924c2dac6551751b99421ea
BLAKE2b-256 checksum
How to use checksums
4a146e18ae2de27cf0592db3752347c645b6c3674645741477b88494b19cd6ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / openimpala-5.2.0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL openimpala-5.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 4.9 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a52c7df827507ae017ee68cf87f8d8ff8f533d2690f37183ea7745c0596914f3
BLAKE2b-256 checksum
How to use checksums
972dd5431e63cda87cd7543dece31a8f3348a75f9848809b7977d1ac77d87daa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / openimpala-5.2.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL openimpala-5.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 4.9 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a542b731abb8dc3995b98875cc65c77361573f993515d4315c4bb728901759f5
BLAKE2b-256 checksum
How to use checksums
ef810e648bf262ad848b0a7bc0af2ccfbd2dc17b8cf3585492572a9842262479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / openimpala-5.2.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL openimpala-5.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 4.9 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f000fea318be67b839a33366b8a62ca272f5299ade283218c0f4d2bcce44ead6
BLAKE2b-256 checksum
How to use checksums
3c226a86e3ff391d7691718356e98dd6cfda2db1d1e7642ecb03b22a3a25e01f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / openimpala-5.2.0-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL openimpala-5.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
Size 4.9 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
aa95fa23685528113402c023dd31312c7c25f9e10d1e546354a5ddbc8d94f099
BLAKE2b-256 checksum
How to use checksums
f8d10b245ff1667243d11bc3ebbf579dc9a2782f1d43133899fdf8560443968b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for openimpala 5.2.0

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for openimpala-5.2.0-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

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

5.2.0 This release

6 release files Full 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