C++ Lid-Driven Cavity Solver

A completed serial C++17 implementation and parameter study of the two-dimensional incompressible lid-driven cavity benchmark.

Streamlines from the C++ lid-driven cavity solver
36configured executions
3 × 3meshes and Reynolds numbers
22cases meeting selected Ghia limits
C++17serial baseline solver

Problem

The lid-driven cavity benchmark is used as a controlled CFD case for pressure-velocity coupling, mesh sensitivity, convection schemes, convergence behavior, and comparison with Ghia et al. centerline velocity data.

Why this version matters

This implementation moves the reference study into a lower-level compiled language while keeping the numerical setup aligned with the MATLAB version. It provides a completed serial baseline for the broader work-in-progress comparison project.

My contribution

Numerical methodology

Flow model

Two-dimensional incompressible Navier-Stokes equations with a moving lid and no-slip cavity walls.

Pressure coupling

Pseudo-transient pressure-correction algorithm on a structured collocated Cartesian grid.

Study matrix

N = 32, 64, 128; Re = 100, 400, 1000; upwind/central; RBGS/RBSOR.

Representative results

Results and interpretation

Completed scope and limitations

The repository records the completed solver and parameter study as configured. It is an educational solver, not a production CFD package. It uses a collocated grid without Rhie-Chow interpolation, has no multigrid acceleration, and requires stronger convergence control for the high-Reynolds-number cases. These limitations are documented rather than hidden.