Lid-Driven Cavity from Scratch | Vorticity-Streamfunction CFD in Python

2026-09-12

Lid-Driven Cavity from Scratch | Vorticity-Streamfunction CFD in Python

Channel: Engineering Insight Lab (173 subscribers)

The lid-driven cavity is the "hello world" of computational fluid dynamics — a square box of fluid with one wall sliding tangentially, generating a primary vortex and (at higher Reynolds numbers) secondary corner vortices. It's the canonical benchmark because it has no inflow/outflow boundaries to complicate things, yet exhibits genuinely nonlinear behavior that separates a working solver from a broken one.

What makes this video worth your time is that it builds the solver from nothing — no Fluent, no OpenFOAM, no library that hides the physics. Instead of solving the primitive-variable Navier-Stokes equations directly (which forces you to deal with the pressure-velocity coupling and staggered grids), the video uses the vorticity-streamfunction formulation. This is a clever reformulation for 2D incompressible flow: take the curl of momentum to eliminate pressure entirely, leaving you with a transport equation for vorticity coupled to a Poisson equation for the streamfunction. Two scalar fields, no pressure headaches.

Expect to see finite-difference discretization, boundary condition treatment (the tricky part — wall vorticity has to be derived from the streamfunction), an iterative Poisson solve, and validation against Ghia's reference data. This is exactly the ground-up exercise that turns CFD from a black box into something you actually understand.

Why watch: A from-scratch Python implementation of the canonical CFD benchmark using the elegant vorticity-streamfunction method — the fastest way to build real intuition for incompressible flow solvers.

All newsletters