Skip to main content

Python bindings for OpenImpala — transport-property computation on 3-D voxel images

Project description

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 differences, 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: tutorials/ (runnable on Google Colab)

Quick example

import numpy as np
import openimpala as oi

image = np.zeros((64, 64, 64), dtype=np.int32)
image[:, :, 16:48] = 1   # solid slab through the middle

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.value:.4f}")
    print(f"Tortuosity:      {tau.value:.4f}")

Install

Python (recommended)

pip install openimpala            # CPU + optional CuPy GPU acceleration
pip install openimpala-cuda       # compiled HYPRE/AMReX CUDA wheel (Linux x86_64)

OpenImpala uses MPI for distributed parallelism — install an MPI runtime (libopenmpi-dev, openmpi, brew install open-mpi, or conda install -c conda-forge openmpi) before pip install. 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/local/bin/Diffusion /data/inputs

For batch SLURM scripts, see HPC Usage.

Build from source

See CONTRIBUTING.md for the native and containerised developer build, code style, and test workflow.

Features

  • Steady-state diffusion / conduction on segmented 3D voxel images
  • Tortuosity factor, full 3×3 effective diffusivity tensor, multi-phase transport
  • Microstructural metrics: volume fraction, percolation, particle size, specific surface area
  • TIFF / HDF5 / RAW / DAT image input; JSON output compatible with BPX / BattINFO
  • Solvers: HYPRE (PCG, FlexGMRES, BiCGSTAB; SMG / PFMG preconditioners) and AMReX MLMG (matrix-free, 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

Issues and feature requests: https://github.com/BASE-Laboratory/OpenImpala/issues. Questions: GitHub Discussions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

openimpala_cuda-4.4.8-cp312-cp312-manylinux_2_34_x86_64.whl (296.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

openimpala_cuda-4.4.8-cp311-cp311-manylinux_2_34_x86_64.whl (296.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

openimpala_cuda-4.4.8-cp310-cp310-manylinux_2_34_x86_64.whl (296.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

openimpala_cuda-4.4.8-cp39-cp39-manylinux_2_34_x86_64.whl (296.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

File details

Details for the file openimpala_cuda-4.4.8-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for openimpala_cuda-4.4.8-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4a1899fb66f1439ce0ea8bc2818de538c2136c6f22951f83368b03d0c9a19ab6
MD5 32bc396ff05c8c7df2f70f9a9d1fd0b5
BLAKE2b-256 8100ea3089ea08b4b2e0da7ad097b44c74bb537dae38f565f60debf47f980db5

See more details on using hashes here.

Provenance

The following attestation bundles were made for openimpala_cuda-4.4.8-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: pypi-wheels-gpu.yml on BASE-Laboratory/OpenImpala

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openimpala_cuda-4.4.8-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for openimpala_cuda-4.4.8-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b56c5dac958ac9ac75e7d48004ff154ebe8ede942f2adcb759a1a9743648d4c1
MD5 90a25fb7545951eb731d18e01b9924b6
BLAKE2b-256 3743567a0991737f95dc4e94765c4c327fa35ee9a44b787f717f949512f2da8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for openimpala_cuda-4.4.8-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: pypi-wheels-gpu.yml on BASE-Laboratory/OpenImpala

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openimpala_cuda-4.4.8-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for openimpala_cuda-4.4.8-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ca26324c56130d43590c9d768e5ca2b09a6dda5c4db2446279bda9d99c3cb74b
MD5 e3ded3dae133baee5d542a9c4402394c
BLAKE2b-256 020ea63da22dad33d0a10d1a9259d600130e330d1a4612afe1940a030e01bd83

See more details on using hashes here.

Provenance

The following attestation bundles were made for openimpala_cuda-4.4.8-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: pypi-wheels-gpu.yml on BASE-Laboratory/OpenImpala

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openimpala_cuda-4.4.8-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for openimpala_cuda-4.4.8-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f90de0fd6f8b2490546c840c1ee1efeee160a103a501137e7736d0eca0fee7b1
MD5 6e7ac95e5d69f60f7d50afb38c043df9
BLAKE2b-256 6cb44ac27e27e8489882a15741cc680a1382348d3c1896c2cbaf331348182496

See more details on using hashes here.

Provenance

The following attestation bundles were made for openimpala_cuda-4.4.8-cp39-cp39-manylinux_2_34_x86_64.whl:

Publisher: pypi-wheels-gpu.yml on BASE-Laboratory/OpenImpala

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page