flow
GPU-accelerated incompressible Navier–Stokes solver for flow in complex geometry, built around a
staggered MAC grid, a signed-distance-field (SDF) description of the solid, a cut-cell Immersed
Boundary Method, and a pressure-projection step with a geometric multigrid Poisson solve. The code is
written in Kokkos C++ (one source runs on the CUDA, HIP/AMD, and OpenMP backends, selected at build
time) and exposed to Python through nanobind (zero-copy, on core's View↔ndarray bridge);
simulations are driven from Python.
The repository is also known as
pnm_from_sdf(its GitLab origin) — it computes pore-network–scale flow directly from segmented SDF geometry. The pore-network extraction itself (the formerpeclet.flow.pnmmodule) now lives in its own suite project, peclet-pnm (peclet.pnm).
Modules
| Module | Role |
|---|---|
flow |
The CFD solver — a distributed (MPI-optional) GPU cut-cell IBM Navier–Stokes solver in physical units, built on the shared core block-decomposition + async halo layer. One code / one API / MPI-optional, with native domain boundary conditions. Exposes peclet.flow.Solver (staggered MAC, default) and peclet.flow.SolverColocated (collocated/cell-centered velocities, ABC approximate projection) — identical API via a GridLayout policy. Validated against analytics and Zick & Homsy sphere-array drag (scripts/validate_zick_homsy_sdflow.py). |
The original CUDA implementation has been retired (Kokkos became canonical, 2026-06); flow was
validated bit-identical to the CUDA solver — to machine precision, and against Zick & Homsy sphere-array
drag — before the CUDA sources were deleted (restore point: git tag pre-cuda-retirement). The shared
cut-cell IBM primitives now live in src/cut_cell_ibm.hpp; the operator headers are src/mac_*.hpp +
src/flow_ibm.hpp.
Capabilities
- Geometry: SDF solids (negative inside); the cut-cell IBM applies a Robust-Scaled no-slip / moving-wall condition and a matching cut-cell pressure operator (face openness from the SDF).
- Native domain boundary conditions (
flow): per-face periodic / no-slip wall / Dirichlet velocity (inflow) / outflow / free-slip (symmetry plane), plus per-position inlet velocity profiles. Validated on the lid-driven cavity (Ghia et al.), the developing plane channel (Poiseuille), the backward-facing step (Armaly/Gartling), and a half channel closed by a symmetry plane (pointwise equal to the full one). - Pressure multigrid: rediscretized geometric V-cycle, grid-independent, with MG-PCG and Chebyshev outer accelerators. Works on periodic, IBM, and non-periodic (BC) domains, including semi-coarsening for thin (quasi-2D) grids.
- Time integration: pressure projection with optional incremental pressure, explicit (Koren) or implicit-deferred-correction advection, and Picard outer iteration.
Build
# Canonical: build + install via scikit-build-core
CMAKE_PREFIX_PATH="$PWD/../extern/install/<backend>" pip install . # -> peclet.flow
# Or a dev cmake build (nanobind found via the active interpreter, no cmakedir needed):
cmake -S . -B build -DCMAKE_PREFIX_PATH="$PWD/../extern/install/<backend>" && cmake --build build -j
# distributed flow build (opt-in MPI):
cmake -S . -B build_mpi -DCFD_BUILD_MPI=ON -DCMAKE_PREFIX_PATH="$PWD/../extern/install/<backend>" \
&& cmake --build build_mpi -j
<backend> is one of nvidia-cuda / host-openmp / lumi-hip under ../extern/install/, produced once
by ../tools/bootstrap_deps.sh (a hard build dependency). Requirements: a Kokkos backend (CUDA/HIP/OpenMP
— CUDA is just one option, not required), a C++20 host compiler, nanobind + scikit-build-core, and —
for distributed flow — MPI. Python dependencies live in a virtual environment (.venv).
Run / verify
Simulations are scripts, not C++ mains. The scripts/verify_*_sdflow.py files are the canonical
verification entry points:
source .venv/bin/activate
python scripts/verify_lid_cavity_sdflow.py # lid-driven cavity vs Ghia, Ghia & Shin (1982)
python scripts/verify_channel_sdflow.py # developing plane channel -> Poiseuille
python scripts/verify_bfs_sdflow.py # backward-facing step (reattachment length)
ctest --test-dir build_mpi --output-on-failure # the multi-rank C++ test suite
Documentation
API documentation (C++ classes/kernels and Python scripts) is generated with Doxygen and published to
GitHub Pages by the Documentation CI workflow. Build it locally with:
doxygen docs/Doxyfile # output in docs/html/index.html
The architecture, conventions, and design rationale are described in CLAUDE.md and the design notes
under doc/ in the repository.
Metadata
Release files for peclet-flow 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| peclet_flow-0.5.1.tar.gz | 6.8 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| peclet_flow-0.5.1-cp313-cp313-manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64 | Details |
| peclet_flow-0.5.1-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details |
| peclet_flow-0.5.1-cp311-cp311-manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64 | Details |
| peclet_flow-0.5.1-cp310-cp310-manylinux_2_28_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.28+ x86-64 | Details |
Total release size: 16.6 MB
Release files / peclet_flow-0.5.1.tar.gz
| Download URL | peclet_flow-0.5.1.tar.gz |
|---|---|
| Size | 6.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57beb1f192dd3afebb77571f9c000a7588a10feaa212b3afd929a5bce7745010
|
|
BLAKE2b-256 checksum How to use checksums |
06ead0e55bccc361d9958283083224aa6eccd0014bcc6d3490d29dac23778326
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 6, 2026.
Transparency logRelease files / peclet_flow-0.5.1-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | peclet_flow-0.5.1-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
bf7db76ae4c58d764faa5d6e251220e1ab91249be3c1780b91ee3c065c148c21
|
|
BLAKE2b-256 checksum How to use checksums |
bdd1d36ccd1b5555f1e6814644b019d9458988028012717d0060eade4a5185db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 6, 2026.
Transparency logRelease files / peclet_flow-0.5.1-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | peclet_flow-0.5.1-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
59b1c51837fdcecc66cc1ba9e617703526295a8291559a98cef4ae7766140a06
|
|
BLAKE2b-256 checksum How to use checksums |
13c96771fbcd43207e5d8f9dfe6eb8e60fd1796d1a457c80b655d0c344869863
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 6, 2026.
Transparency logRelease files / peclet_flow-0.5.1-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | peclet_flow-0.5.1-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
480febe153a48079609d45a84814bb1f84171b954e2e6c2bc6f6acd34b65ac40
|
|
BLAKE2b-256 checksum How to use checksums |
66a6f31b84f2fa711ed4b94835947775bc294282937a69f219f44a8689e1ab9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 6, 2026.
Transparency logRelease files / peclet_flow-0.5.1-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | peclet_flow-0.5.1-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ee2cb530aa93a1afd90672ca354b92d7d6d55d56e6ad9a8b87939f3350775bb4
|
|
BLAKE2b-256 checksum How to use checksums |
04f1a5edffff63d4daab3cf3441c93b4f5a23167ff1da55a0bb809093a127c60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 6, 2026.
Transparency log