A computational fluid dynamics (CFD) framework for incompressible viscous flows on Cartesian grids, built on PETSc.
Fluca solves the incompressible Navier-Stokes equations using finite differences on collocated Cartesian grids with pressure stabilization. Time integration uses the Segregated Runge-Kutta (SRK) method, which decouples the velocity-pressure system into Helmholtz and Poisson solves at each stage.
- Collocated grid: Cell-centered velocity and pressure with pressure stabilization
- FlucaFD operators: Composable finite difference operators (derivatives, compositions, scaling, sums, TVD schemes)
- Segregated Runge-Kutta: IMEX time integration with 12 selectable schemes (Bakhvalov, 2025)
- Physics models: Modular
Physabstraction with incompressible Navier-Stokes (PhysINS) subtype - Parallel computing: MPI-based parallelization through PETSc
- CGNS I/O: Standard file format support for solution data
- CMake: >= 3.20
- C Compiler: Compatible with PETSc
- PETSc: >= 3.23
- HDF5: Required by CGNS
- CGNS: Must be built with parallel I/O support enabled
cmake -B build
cmake --build buildctest --test-dir build -R tests_ # Unit tests (fast)
ctest --test-dir build -R tutorials_ # Tutorial tests (slow)PETSC_DIR: Path to PETScHDF5_DIR: Path to HDF5CGNS_DIR: Path to CGNSFLUCA_USE_PETSC_CC: Use the C compiler that was used to build PETSc (default: ON); if OFF, Fluca uses the compiler defined inCMAKE_C_COMPILER
See QUICK_START.md for a step-by-step guide to building simulations with Fluca.
See THEORY_GUIDE.md for the mathematical formulation and numerical methods.
Fluca uses the CGNS format for output files. You can visualize results using standard CFD post-processing tools such as ParaView or Tecplot.
The project uses clang-format for code formatting. The configuration file .clang-format, adopted from PETSc, is provided in the repository.
For other style guidelines, such as naming conventions or formatting not covered by clang-format, refer to the PETSc Style and Usage Guide.
Pre-commit hooks are configured in .pre-commit-config.yaml. Install them with:
pip install pre-commit
pre-commit installThis project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
- PETSc: https://petsc.org/
- CGNS: https://cgns.github.io/
- S. Bakhvalov, Segregated Runge-Kutta methods for the incompressible Navier-Stokes equations, arXiv:2506.09519 (2025)