← Iris

Step 0
Grid 400 × 200
running
Velocity difference 0.08
Density ratio 1.50
Perturbation 0.01

Shear flow and instability

The Kelvin-Helmholtz instability occurs whenever two fluid layers move at different speeds past each other. The interface between them is unstable: any small disturbance — however tiny — will grow exponentially. The faster-moving layer drags the slower one, creating a rolling motion that amplifies into the characteristic spiral vortices.

The Richardson number

Whether the instability develops depends on the Richardson number, Ri = g Δρ δ / (ρ Δv²), which compares the stabilizing effect of density stratification (gravity pulling denser fluid down) against the destabilizing effect of velocity shear. When Ri < 0.25, the shear wins and the instability grows. The simulation lets you adjust both the velocity difference and the density ratio to explore this threshold.

From clouds to Jupiter

Kelvin-Helmholtz waves are visible throughout nature. In Earth’s atmosphere, they form the beautiful “billow clouds” — parallel rows of rolling waves at the boundary between air masses moving at different speeds. They appear in the ocean where currents of different temperatures meet, in the solar corona where plasma streams interact, and most spectacularly in Jupiter’s banded atmosphere, where the Great Red Spot and the smaller vortices at band boundaries are all consequences of shear instability at planetary scale.

The simulation method

This simulation uses a simplified Eulerian advection scheme on a 2D grid. The fluid density and velocity fields are advected forward in time using a semi-Lagrangian method with bilinear interpolation, combined with a pressure projection step to enforce approximate incompressibility. While not as physically accurate as a full Navier-Stokes solver, it captures the essential qualitative behavior: the growth of the instability, the formation of vortices, and the eventual mixing of the two fluid layers.

Why vortices form

The key insight is that along the shear interface, the faster-moving fluid creates a region of low pressure (by Bernoulli’s principle), which draws the slower fluid upward. Once a small wave forms, the crest extends into the faster stream and gets dragged along, while the trough extends into the slower stream and lags behind. This differential advection curls the interface into a spiral — the characteristic “cat’s eye” vortex of the Kelvin-Helmholtz instability.

Turbulence and mixing

In three dimensions, Kelvin-Helmholtz vortices are themselves unstable. Secondary instabilities break the two-dimensional rolls into three-dimensional turbulence, which efficiently mixes the two fluid layers. This cascade from ordered vortices to turbulent mixing is one of the fundamental processes in geophysical fluid dynamics — it is how the atmosphere and ocean stir themselves, distributing heat, momentum, and chemical species across the planet.