ExaFlow
A Python solver for the incompressible Navier-Stokes equations with MPI parallelization and a Mac-native GUI.
1What does ExaFlow do?
Motivation: A computational fluid dynamics (CFD) solver marches a velocity field forward in time, and a grid of any useful size needs more than one process. That split carries two risks. The parallel answer can differ from the serial one at every block edge, and nothing on the screen shows the flow until the run ends.
Project Solution: ExaFlow splits the grid over MPI ranks and gives one class, Subdomain, every index rule that follows from the split. The test suite checks that 1, 2, 4 and 8 ranks write byte-identical output, so the rank count never changes the answer. A Qt desktop window starts the run and draws the newest result while the ranks still compute.
Project Features:
- The incompressible Navier-Stokes equations in 1D, 2D and 3D, from one stencil per term: first-order upwind convection and second-order central diffusion.
- Explicit Runge-Kutta time integration at orders 1, 2 and 3.
tests/test_numerics.pychecks each scheme against an analytic answer and reports its convergence order. - An MPI domain decomposition with a non-blocking ghost exchange, and a factor search that puts every rank on the long axis of a thin grid.
- Five conditions per domain face: no-slip, slip, inflow, outflow and periodic.
- CSV and VTK output, one folder per run under
~/Documents/ExaFlow, each file written through a temporary name and a rename. - A PySide6 and PyVista window that builds the case from a form, starts the ranks, and draws the field, a cross-section and the velocity vectors.
- A signed macOS app bundle that carries its own Python and its own Open MPI, so it runs on a machine with neither.
2Technology Stack & Architecture
Simulation core:
- Python 3.13 and numpy for every field array and every stencil. Each operator holds its scratch blocks, so a Runge-Kutta stage allocates nothing.
- mpi4py over Open MPI for the decomposition, the ghost exchange and the gather. Open MPI arrives as a Python wheel, so the machine needs no system install.
- scipy for the sparse Laplacian and the conjugate gradient solve of the pressure projection.
- pyevtk for the VTK rectilinear grid file, which carries metres where the CSV file carries cell indices.
Desktop application:
- PySide6 (Qt 6) for the window, the child run process and the TCP server.
- PyVista and VTK for the 3D view, the cross-section plane and the vector glyphs.
Developer tools:
- uv for the environment and the lock file. One
uv syncinstalls Python 3.13, every dependency and ExaFlow itself. - pytest for the 321 tests, which run in about five seconds. Markers separate the tests that start
mpiexecfrom the ones that import the visualization stack. - mypy over
src,tests,examplesandpackaging, with no reported issue. - PyInstaller for the macOS app bundle, and
codesignfor the signature it needs to start.
Architecture overview