How it works

How it works

This is a real wind tunnel: a lattice Boltzmann simulation with 41,600 cells (228×128 on screen at 2560×1440, plus a hidden border), stepped 1,920 times a second, and your cursor is a cylinder standing in its current. Past a Reynolds number of about 47 the flow behind any cylinder becomes unstable. It sheds vortices alternately off the top and bottom, and they drift away in two staggered rows: the von Kármán vortex street. Nothing here is animated by hand. The ink released at the cylinder’s rim just rides the simulated flow. At the default settings (Re ≈ 160) a probe measured one shedding cycle every 1.17 s, a Strouhal number of 0.191, close to the textbook 0.2.

Pipeline (per frame)

pointer ─▶ JS  follower: chase the pointer (0.09 s), |v| ≤ 0.1 cells/step, 35 ms velocity smoothing
               free stream u∞ eased (0.4 s) toward flow·(cos θ, sin θ); θ turns with wake steering
               N = accumulator(substeps × 60 steps/s), capped at 2 × substeps   (≈32 per 60 Hz frame)
 ┌── repeat N times: one fixed lattice step ─────────────────────────────────────────────────
 │ LBM    3 × RGBA32F, NEAREST, 260×160 = 228×128 visible + a hidden 16-cell sponge each side
 │        (g0 g1 g2 g3)(g4 g5 g6 g7)(g8 ρ ux uy), g = f − w, one draw with 3 MRT outputs
 │        pull-stream (9 texelFetch) → ρ, u → BGK collide, τ_eff = Smagorinsky(τ, |Π_neq|)
 │        → cylinder: mix to f_eq(ρ, u_cyl) by its soft solid fraction (2×2 supersampled)
 │        → sponge: mix to f_eq(1, u∞)  (inlet + outlet + far field)  → guard: reset bad cells
 └───────────────────────────────────────────────────────────────────────────────────────────
 VEL      RGBA16F 228×128, LINEAR      (ux, uy, ω = ∂uy/∂x − ∂ux/∂y, ρ − 1)
 DYE A    RG16F 1920×1080              hat = dye(x − d(x − ½d(x)))       d = u·N, u: cubic B-spline
 DYE B    RG16F 1920×1080              dye = limit(hat + ½(dye − hat(x + d(x + ½d(x)))))   MacCormack
                                       · e^(−Δt/life) → release on the swept rim / rake inflow
 GLOW     RGBA16F 640×360 → 320×180 → 160×90    bright pass + separable 9-tap Gaussian per level
 DISPLAY  canvas 2560×1440, opaque
            dark   bg + shoulder(A·colA + B·colB) + bloom
            light  paper · (1 − cast shadow) · exp(−A·ln(1/colA) − B·ln(1/colB)) + wet sheen
            ω / |u − u∞|   B-spline field, quadratic fill + iso-contours (fwidth)
            cylinder from its exact SDF, ±1 LSB dither
 ≈ 43 draws per frame, 32 of them lattice steps

The ideas that matter

Parameters

Presets

Performance & compatibility

References & credits