Home▸Fluid Dynamics & Aerodynamics▸2D Computational Fluid Dynamics: Vortex Shedding Around a Cylinder

2D Computational Fluid Dynamics: Vortex Shedding Around a Cylinder

A grid-based Navier-Stokes solver drawn straight onto a Canvas2D color field — adjust inflow speed, viscosity and grid resolution to watch the wake behind a cylinder shed vortices as the Reynolds number climbs.

Fluid Dynamics & Aerodynamics2DModerate60 FPS⇄ 3D version
2d-computational-fluid-dynamics ↗ Open standalone

This 2D companion runs the same advect-diffuse Navier-Stokes lattice as the 3D version — inflow entering from the left, a circular obstacle, viscous diffusion followed by semi-Lagrangian advection, and a small wake-injection term that seeds vortex shedding once the Reynolds number climbs past the laminar regime — but draws every lattice cell straight onto a flat Canvas2D grid instead of an orbitable 3D plane. Dropping the camera makes the wake easier to read at a glance: watching the velocity view, the boundary layer thickens and separates as inflow speed rises; switching to the vorticity view exposes the alternating red/blue rotation bands of the von Kármán vortex street directly, cell by cell, as they peel off the back of the cylinder.

⚙ Under the hood

Canvas2D CFD lattice around a cylinder: viscous diffusion, semi-Lagrangian advection and a wake-shedding term reproduce vortex shedding and Reynolds-number effects, colored per-cell by velocity magnitude or vorticity.

CFDfluid dynamicsnavier-stokesvortex sheddingreynolds numbercanvas2d

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

Why does the wake wobble instead of staying smooth?

Below a Reynolds number of roughly 40 the flow stays laminar and the wake is a symmetric pair of trailing streaks. Raise the inflow speed or lower the viscosity and the Reynolds number climbs, the wake becomes unstable, and the built-in shedding term makes it peel off as alternating vortices — the same von Kármán vortex street seen behind real bridge piers and chimney stacks.

What's the difference between the velocity and vorticity views?

The velocity view colors each cell by how fast the fluid there is moving, which highlights the boundary layer and the free-stream. The vorticity view colors by local rotation (curl) of the flow instead, which is what actually makes the alternating vortex bands in the wake visible — velocity magnitude alone hides them.

What did you find?

Add reproduction steps (optional)