Skip to content
Lab
numbers, not pictures lattice boltzmann · D2Q9 TRT · momentum exchange

Wind Tunnel

A two-dimensional tunnel solved live in a Web Worker with the lattice Boltzmann method (D2Q9, TRT collision). The force on the body is measured directly, by momentum exchange on every wall link. Put a cylinder in and a Kármán street starts near Re 47; the measured drag coefficient and Strouhal number sit next to the published values, with the error shown. A Re sweep, a grid-convergence study and a NACA angle-of-attack polar run separately in background workers.

Presets
t 0.0 L/U 0 steps/s RUNNING
Test section ωL/U −3 … 3 streaklines drag lift
CD mean—
CL now—
St (lift)—
CD corrected—
Lr/L—
Δm / m—
window—
Force history & lift spectrum CD CL reference settling (excluded)
Measurement vs. reference settling
QuantityMeasuredBlockage-corr.ReferenceΔ
Mean drag CD — — — —
Mean lift CL — — — —
Lift fluctuation CL′ rms — — — —
Strouhal number fL/U — — — —
Recirculation length Lr/L — — — —
Base pressure −Cp,b — — — —
Lift-to-drag L/D — — — —

Surface pressure Cp(θ) measured, time-averaged potential flow 1 − 4 sin²θ
Batch study
queued

Lattice Boltzmann · D2Q9 TRT

fi(x+ci, t+1) = fi − ω+(fi+ − fieq+) − ω−(fi− − fieq−)

fieq = wiρ[1 + 3ci·u + 9⁄2(ci·u)2 − 3⁄2u2]

ν = (τ+ − ½)/3,  Λ = (τ+ − ½)(τ− − ½) = 3/16

f± are the even/odd parts of each opposite pair. The magic Λ fixes the bounce-back wall position independent of ν. LES raises τ+ locally from |Πneq| (Smagorinsky, Cs = 0.1).

Boundaries

q < ½: fī(x) = 2q fi*(x) + (1−2q) fi*(x−ci)

q ≥ ½: fī(x) = fi*(x)/2q + (1 − 1/2q) fī*(x)

inlet: Zou–He u = (U, 0);  outlet: ∂tf + U∂xf = 0

Bouzidi interpolated bounce-back with the wall distance q of each link found on the true outline, so the cylinder is round rather than a staircase. Side walls are free-slip, like an ideal closed test section. Painted shapes use q = ½.

Measurement

F = Σlinks ci [fi*(x) + fī(x, t+1)]

CD,L = Fx,y / (½ρU2L),  St = fL/U

ε = π²⁄12(h/H)2 + (h/H)CD/4,  CD,c = CD/(1+ε)2

Momentum exchange on every wall link; f from up-crossings of CL(t), cross-checked by a Hann-windowed FFT. The first-order blockage correction uses Glauert solid blockage and Maskell-type wake blockage. Solver cost here: —.

Drag the body to move it; tap empty space to inject dye. In Draw mode, drag to paint walls and hold Shift (or right-drag) to erase.

What is modelled

What the solver does

Collisions use the two-relaxation-time (TRT) model with the magic parameter Λ = 3/16, so the wall position does not drift with viscosity. Curved walls use Bouzidi interpolated bounce-back with the wall distance q of each link found on the true outline, so the cylinder is round rather than a staircase. The inlet is a Zou–He velocity boundary, the outlet a convective outflow, and the side walls are free-slip. Forces are summed by momentum exchange on the same links, and the Strouhal number comes from up-crossings of the lift signal, cross-checked by a Hann-windowed FFT. The values below are what node scripts/test-lbm.ts checks on every run (after the first-order blockage correction).

Re 100 · C_D
1.347
ref 1.33 · +1.3%
Re 100 · St
0.172
ref 0.166 · +3.2%
Re 20 · C_D
2.11
ref 2.05 · +2.9%
Re 20 · L_r/D
0.91
ref 0.94
Honest scope

What this tunnel cannot tell you

  • The flow is two-dimensional. Real cylinder wakes turn three-dimensional from Re ≈ 190, so values above that compare only with 2D simulations.
  • The grid is coarse: the default cylinder is 16 cells across. The grid-study tab shows how much the numbers move with resolution.
  • Default blockage is 10%. Raw values should come out above the literature; the corrected column is only a first-order Glauert/Maskell correction.
  • The lattice Mach number is about 0.17, so an O(Ma²) compressibility error remains, and the outlet is closer than in a real tunnel.
  • Airfoils run at Re in the hundreds to thousands, in laminar flow. Their lift curves look nothing like an aircraft wing at Re 10⁶ and above. The LES option is a crude Smagorinsky term for stability, not a validated turbulence model.
  • Drawn shapes are cell masks, so their walls are half-way bounce-back staircases (q = ½).