MATLAB Lid-Driven Cavity Solver

A transparent two-dimensional incompressible-flow solver and automated 72-case study developed to examine pressure–velocity coupling, numerical schemes, mesh resolution, convergence behavior, and benchmark agreement.

Overview of MATLAB lid-driven cavity CFD study results
72configured simulations
3 × 3meshes and Reynolds numbers
44cases within selected Ghia limits
2 × 2 × 2schemes, pressure solvers, implementations

Problem

The lid-driven cavity is a compact benchmark for incompressible-flow solvers. It tests pressure–velocity coupling, wall boundary conditions, vortex formation, numerical diffusion, mesh sensitivity, convergence behavior, and comparison with established reference data.

My contribution

Numerical methodology

Flow model

Two-dimensional incompressible Navier–Stokes equations with a moving top wall.

Pressure coupling

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

Study matrix

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

Representative results

Results and interpretation

Relationship to the comparison project

This completed MATLAB solver is the reference implementation for the work-in-progress Lid-Driven Cavity Solver Comparison, which extends the same benchmark across MATLAB/Octave, Python, C, C++, OpenMP, MPI, and a CUDA prototype.

Limitations

The solver prioritizes transparency and numerical comparison over production performance. It uses a collocated grid without Rhie–Chow interpolation and an iterative pressure solver without multigrid acceleration. All uploaded full-study cases reached the configured outer-iteration limit, so execution status, profile agreement, and numerical convergence are reported separately.