🚦 LWR Traffic Flow: Treating the Motorway as a Fluid
Interactive 3D motorway where adjusting traffic density and a bottleneck's capacity shows the Lighthill-Whitham-Richards model forming shockwaves that propagate backward through simulated vehicle flow.
A stretch of motorway is solved as a continuous density field, the way the Lighthill-Whitham-Richards model treats traffic like a compressible fluid, so that a lane-closure bottleneck visibly triggers a shockwave — a traffic jam boundary — that crawls backward against the flow.
🔬 What It Demonstrates
A Godunov finite-volume scheme advances vehicle density ρ(x,t) using the Greenshields speed-density relation. Where a bottleneck caps the flow that can pass, density backs up and a sharp shock front forms and propagates upstream, matching the Rankine-Hugoniot jump condition.
🎮 How to Use
Raise the inflow density to add more demand, and dial up bottleneck severity to choke capacity at the cone-marked pinch point. Watch the colour-coded density ribbon and the instanced vehicles bunch into a red jam that creeps backward, then ease off the bottleneck to watch it dissolve.
💡 Did You Know?
The same Godunov numerical-flux technique used here to resolve sharp traffic shocks was originally developed for shock waves in compressible gas dynamics — traffic jams and sonic booms share the same mathematics.
Interactive 3D highway where adjusting traffic density shows the Lighthill-Whitham-Richards model forming shockwaves, or traffic jams, that propagate backward through simulated vehicle flow.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install