Fluid simulations

Five simulations I ran in OpenFOAM. The flat ones play here from the solver’s own data, so every pixel has a value: hover to read it. The 3D ones turn when you drag them.

  1. Vortex streetStrouhal 0.1825
  2. Kelvin–HelmholtzGrows 83 per second
  3. Rayleigh–BénardRolls 3 × the depth
  4. Wind in a city block185,237 cells
  5. Hot room1 m² at 600 K
01

Vortex street

Air flows past a cylinder 1 mm across, at Reynolds number 150. Swirls peel off one side, then the other, and drift downstream in a chain. It is why flagpoles hum and power lines sing.

Loading 1.6 MB

Vorticity behind the cylinder, blue for one direction of spin and orange for the other, with tracer particles riding the flow. Swirls leave the top and bottom of the cylinder in turn.

Each swirl that lets go gives the cylinder a small sideways push, so the lift force on it swings up and down once per pair. The rhythm is the Strouhal number. This run measures 0.1825 from that force; the published value at Re 150 is 0.183.

The colour scale stops at ±4,055 per second so the wake is readable. The thin layer on the cylinder’s surface spins up to 62,000. Drag the scale to the end and most of the wake goes dark.

Reynolds number
150
Strouhal number
0.1825, published 0.183
Mesh
20,910 cells
Solve
7.3 min
02

Kelvin–Helmholtz

Two layers slide past each other at 0.5 m/s. The boundary between them waves, rolls up into four spirals, and the spirals merge in pairs. Clouds sometimes show the same shape.

Loading 1.1 MB

Spin in a shear layer over 0.32 seconds: a thin bright band waves, rolls into four glowing spirals, and the spirals merge into two.

While the wave is small it grows at a fixed rate, which is a straight line on the chart’s log scale. The run grows at 83 per second. Theory for a fluid with no friction says 95. Real fluid has friction, so it should come in lower.

Reynolds number
400
Growth rate
83 per second, theory 95
Mesh
72,080 cells
Solve
19.6 min
03

Rayleigh–Bénard convection

A shallow box, 30 cm long and 5 cm deep, with a hot floor at 305 K and a cold lid at 295 K. Warm fluid rises, cool fluid sinks, and the flow sorts itself into rolls that turn over and over. Soup in a pan does this, and so does the surface of the Sun.

Drag to turn · ⌘ or Ctrl + scroll to zoomDrag sideways to turn · pinch to zoom

Loading 1.6 MB

warm plumecool plumearrows: how the fluid movesOrange is fluid warmer than 300 K, blue cooler. The arrows are the flow on the side cut, measured by the solver: they turn over in rolls between plumes.
The convection box in 3D, turning on drag. Orange plumes of warm fluid rise from a glowing floor and blue sheets of cool fluid hang from the lid. White arrows on a vertical plane through the middle show the fluid turning over in rolls. Two dashed rectangles mark where the side and top cuts below are taken.

The two dashed cuts, frame by frame

Side view Top view, halfway up

Loading 1.2 MB

Temperature in two cuts through a 30 cm box over six seconds. In the side cut, orange plumes rise from the floor and blue fluid sinks from the lid. In the cut from above the same motion shows as wandering orange and blue bands.

The rolls settle at one size: a pattern 15 cm long, three times the depth of the box, so two pairs of rolls fit across it. That size is the strongest in every frame of the run.

Rayleigh number
2.6 × 10⁵
Box
30 × 10 × 5 cm
Mesh
115,200 cells
Solve
9 min
04

Wind in a city block

Wind at 10 m/s through a cluster of towers. On the walls, red is where the wind pushes and blue where it pulls. The lines follow the air from upstream, through the gaps and into the slow, tangled wake.

Drag to turn · ⌘ or Ctrl + scroll to zoom · hover a wallDrag sideways to turn · pinch to zoom

Loading 1.6 MB

A cluster of tower blocks you can turn. Walls facing the wind are red, side walls and roof edges blue. Coloured lines show the wind: yellow and green where it is fast over the roofs, purple where it slows behind the tallest blocks.

Planners read this for wind comfort on the street, and engineers for the load on glass and cladding. The solve was stopped at 400 iterations, before it fully settled, so read it for where the loads fall rather than for exact numbers.

Model
Steady, k–epsilon
Mesh
185,237 cells
Solve
149 s, mesh 20 s
Lines
32, none through a wall
05

Hot room

One square metre of floor at 600 K in a 10 × 5 × 10 m room, after 400 seconds. Warm air rises in a tight column, hits the ceiling and spreads out under it. Nearly all the heat ends up above head height.

Drag to turn · ⌘ or Ctrl + scroll to zoomDrag sideways to turn · pinch to zoom

Loading 0.1 MB

A wireframe room seen from above at an angle, turning slowly. A warm column rises from an orange patch in the middle of the floor and spreads into a bright layer under the ceiling.

The air in this room spans only 3.5 K, and all but the column sits within 0.3 K. The colour scale covers that 0.3 K, so the layering shows; the column is hotter than the top of the scale, which the arrowhead marks.

Mesh
108,000 cells
Simulated
400 s
Solve
352 s
Volume
125 × 63 × 125 samples

Rendered in Blender

How these were made

Each case ran in OpenFOAM 13, in Docker on an M4 Mac. Python scripts read the fields straight from the solver’s files. From there, one path renders stills and loops in Blender; the other packs the fields into 8-bit images for this page, 5.6 MB for all five, geometry included.

OpenFOAM 13 Solve. 2D and 3D, 21k to 185k cells, 2.5 to 20 minutes per case Export, Python Fields on a grid, streamlines, volumes. Checks: cell order, no line through a wall Blender, Eevee Stills and loops, 0.4 to 1 s a frame. For reports and video This page, WebGL 8-bit field images plus a rule to decode them, so every pixel reads back a value

On every colour bar, a clipped end gets an arrowhead and the field’s real range is printed underneath. Values you hover are read from the 8-bit images, so they are rounded.