CFD Solver Development
MATLAB Lid-Driven Cavity Study
A reproducible 72-case CFD study for the two-dimensional incompressible lid-driven cavity, developed to compare numerical schemes, pressure solvers, mesh resolution, runtime, and benchmark agreement.
Problem
The lid-driven cavity is a compact but demanding benchmark for incompressible-flow solvers. It tests pressure–velocity coupling, wall boundary conditions, vortex formation, numerical diffusion, mesh sensitivity, convergence behaviour, and validation against established reference data.
My contribution
- Developed loop-based and vectorized MATLAB implementations.
- Automated a full parameter study across mesh resolution, Reynolds number, convection scheme, and pressure solver.
- Implemented residual tracking, structured result export, plotting, and benchmark validation.
- Documented both successful and limited cases rather than presenting only favourable results.
Methodology
Flow model
Two-dimensional, incompressible Navier–Stokes equations with a moving top wall.
Pressure coupling
SIMPLE-style pressure correction on a structured Cartesian collocated grid.
Study matrix
N = 32, 64, 128; Re = 100, 400, 1000; upwind/central; RBGS/RBSOR; loop/vectorized.
Representative results
Results and interpretation
- The full study executed 72 simulations and retained the complete result set for comparison.
- 44 cases passed the selected Ghia validation thresholds.
- RBSOR reduced pressure-solver cost compared with RBGS in the tested cases.
- Central differencing improved benchmark agreement when the mesh was sufficiently resolved.
- Upwind differencing was more robust but introduced more numerical diffusion, especially on coarse meshes.
Limitations
The solver prioritises transparency and comparison over industrial-scale performance. It uses a collocated formulation without Rhie–Chow interpolation, has no turbulence model or multigrid pressure solver, and high-Reynolds-number cases remain sensitive to mesh resolution and convergence settings.