Skip to main content

flow

PyPI version Python License: MIT CI DOI

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 former peclet.flow.pnm module) 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, plus per-position inlet velocity profiles. Validated on the lid-driven cavity (Ghia et al.), the developing plane channel (Poiseuille), and the backward-facing step (Armaly/Gartling).
  • 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.

Download files

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

Source Distribution

peclet_flow-0.4.0.tar.gz (5.4 MB view details)

Uploaded Source

Built Distributions

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

peclet_flow-0.4.0-cp313-cp313-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

peclet_flow-0.4.0-cp312-cp312-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

peclet_flow-0.4.0-cp311-cp311-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

peclet_flow-0.4.0-cp310-cp310-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

File details

Details for the file peclet_flow-0.4.0.tar.gz.

File metadata

  • Download URL: peclet_flow-0.4.0.tar.gz
  • Upload date:
  • Size: 5.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for peclet_flow-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4f9a05c0902daf6ceed4a79316af0f357378b1ea5d8941494ab5541084ae81ce
MD5 b84d7b3252f2df7919833e3cd5d6977b
BLAKE2b-256 46dbbc5b6f4ad1e6e398aeab1ed8ac13d7ce06e5dc5423f471d542a90d0b86ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for peclet_flow-0.4.0.tar.gz:

Publisher: release.yml on computational-chemical-engineering/peclet-flow

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

File details

Details for the file peclet_flow-0.4.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for peclet_flow-0.4.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2b8c0ebce05017707f1e53cb94d4a6203dae3fba9dac0675c24fee653316cbcf
MD5 f33ecefcdc53639f753a21e064b58fc0
BLAKE2b-256 58fb6be54e3e7ef3ee17ddcabe9cf9bbe810954d8fed43791cdda75b6255d3e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for peclet_flow-0.4.0-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: release.yml on computational-chemical-engineering/peclet-flow

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

File details

Details for the file peclet_flow-0.4.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for peclet_flow-0.4.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ce5033829ed0fcdd891256b66eeafe8c0815f423c499df723c50681d271fc4d7
MD5 f9217f6240a133574a891fd69b138bd6
BLAKE2b-256 06943c5061b61e9fe8a13ac1fd93039b068507d6e0901cd16568c902695821b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for peclet_flow-0.4.0-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: release.yml on computational-chemical-engineering/peclet-flow

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

File details

Details for the file peclet_flow-0.4.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for peclet_flow-0.4.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 139ec4803c36d1b1e16425b3d157836a52d7a1e2af9b57e1b27bdae3f130f5d1
MD5 c97c14ee20a113e3b437e19fb64f4dd2
BLAKE2b-256 3efb17372ed7d1e554ece21681bf828ef8b1fb0d183ad20276c824e2e0af477d

See more details on using hashes here.

Provenance

The following attestation bundles were made for peclet_flow-0.4.0-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: release.yml on computational-chemical-engineering/peclet-flow

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

File details

Details for the file peclet_flow-0.4.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for peclet_flow-0.4.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 651d0fd617bb430109c160ad4e86abdc19e932617051219b05288d5925c65733
MD5 b38b417dd4c18336ebdcfde0c3913787
BLAKE2b-256 336e18c8b303466fe61a0cd98803225fdde414f59af37c8e4e61e9871aa0c698

See more details on using hashes here.

Provenance

The following attestation bundles were made for peclet_flow-0.4.0-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: release.yml on computational-chemical-engineering/peclet-flow

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

Release history Release notifications | RSS feed

This release

0.4.0 This release

5 files

0.3.0

5 files

0.2.1

5 files

0.2.0

5 files

0.1.0

5 files

Supported by

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