A parallel CFD solver for 2D incompressible flow. It discretizes the Navier–Stokes equations on a staggered grid with finite differences, advances velocities in time, and enforces incompressibility via a pressure Poisson solve (SOR/CG), following the classic projection method. The discretization uses central differences with donor-cell stabilization for high Reynolds numbers.
The graphic at the top summarizes how obstacle geometry is prepared before it enters the solver:
- A → B: A grayscale input image is converted to a clean binary mask (foreground vs. background).
- B → C: The binary mask is scaled to the target grid resolution, preserving aspect ratio.
- C → D: Small defects are corrected and boundaries are labeled to generate a simulation-ready obstacle map.
This pipeline ensures the obstacle field is well-defined on the staggered grid and matches the resolution used by the flow solver.
- Incompressible Navier–Stokes via projection method (pressure Poisson equation).
- Finite differences on a staggered grid for velocity and pressure.
- Iterative solvers: SOR and Conjugate Gradient for the Poisson system.
- Stabilized convection using donor-cell blending for high-Re flows.
- Parallel execution with MPI + OpenMP and optional CUDA kernels.
-
Spatial discretization: Finite differences on a staggered grid for
$u$ ,$v$ , and$p$ . -
Time stepping: Explicit update of momentum terms to get preliminary velocities
$F$ ,$G$ . -
Projection: Enforce
$\nabla \cdot \mathbf{u}=0$ via a pressure Poisson solve. - Pressure correction: Update velocities with the pressure gradient.
- CMake 3.8+
- MPI (e.g., OpenMPI)
- CUDA toolkit (optional for GPU kernels)
- GCC/G++ (configured in CMakeLists.txt)
Use the provided script to build the MPI/CUDA-enabled executable:
The default run script uses MPI and a sample settings file:
You can switch the input by editing the settings file path, for example:





