Questing · 2026-09-27 · Aeolian Physics · Zero Dependencies
DUNE
Scatter sand onto a desert floor. The wind takes it. Grain by grain, over millions of hops, the piles transform into the planet’s most recognisable landform: the barchan — a crescent dune that has appeared independently on every desert world with an atmosphere.
Open Dune →Saltation — How Wind Moves Sand
Wind cannot simply blow sand grains along the ground like leaves — sand is too heavy. Instead it moves by saltation (Latin: saltare, to leap). A grain is lifted by aerodynamic drag when wind speed exceeds the threshold velocity (≈ 5 m/s near the surface). It follows a ballistic arc, landing 10–30 cm away, where its impact ejects 5–10 more grains into the air. Those grains land and eject more. Within seconds of wind beginning to blow, a cascading cloud of saltating grains just centimetres above the surface transports enormous amounts of sand.
Key observables of saltation: Hop length L ≈ 10–30× the grain diameter d_grain For medium sand (d = 0.3 mm): L ≈ 3–9 mm per hop Over 1 km of dune field, a grain hops ≈ 100,000–300,000 times In Dune (dimensionless): L = 5 grid cells (each cell represents ~0.5 m) P_ns = 0.38 (probability of depositing outside shadow zone) Grains that miss their hop deposit one L further away
The Werner Model — Three Rules Build Barchans
In 1995, B.T. Werner published a minimal cellular automaton with three rules that produces realistic dune morphologies from random initial conditions. The model operates on a 2D height field h(x, y):
Rule 1 — Saltation:
Pick a random occupied cell. Remove one slab (h -= GRAIN).
The slab hops L cells downwind to cell (x+L, y).
Rule 2 — Shadow zone (deposition bias):
If (x+L, y) is in the geometric shadow of any upwind cell:
deposit (h[x+L, y] += GRAIN) ← probability 1
Else:
deposit with probability P_ns ← probability < 1
(unsettled grain hops a second L and tries again)
Shadow condition for cell (x, y):
∃ k ∈ [1, LOOK]: h[x-k, y] > h[x, y] + k × tan(α_shadow)
where α_shadow ≈ 14° (tan = 0.28), the geometric shadow angle
Rule 3 — Avalanche (angle of repose):
If |h[i,j] − h[i±1,j]| > tan(θ_repose) × Δx:
transfer ½ the excess to the lower cell
Repeat until all slopes ≤ tan(30°) = 0.58These three rules are sufficient. No aerodynamics, no fluid mechanics, no grain-grain interactions — just lift, hop, shadow, avalanche. The barchan shape emerges from the interplay between rules 2 and 3: the dune’s centre casts a deep shadow (forcing deposition), while its thin horn tips cast almost no shadow (sand escapes around them). The avalanche rule maintains the steep slip face. After many thousands of steps, every initial pile converges to the same crescent attractor.
Why the Crescent? — The Barchan Attractor
The barchan shape is not imposed — it is a dynamical fixed point. Any sand pile in a unidirectional wind converges to it. Here is why:
Consider a circular mound. The centre is tallest and casts the longest shadow downwind: sand deposits preferentially in the centre’s lee. The edges of the mound are thin; at the corners, the shadow extends barely past the saltation length L — so most grains blown over the horns do NOT deposit. They escape downwind. The corners erode; the centre builds. The eroding corners trail behind the advancing centre as the two horn tips.
Once barchan-shaped, the dune is self-maintaining: sand moves up the windward face, avalanches over the crest onto the steep slip face, and exits through the horns. The crescent is a conveyor belt. It migrates downwind intact.
Barchan migration speed: v ∝ 1/H (H = dune height) A 2 m-high barchan migrates ~20 m/year (Sahara, strong winds) A 10 m-high barchan migrates ~4 m/year Implication: small dunes outrun large ones. In a field of barchans, small dunes collide with large ones from behind. Collision outcome depends on size ratio: — similar size: merge into a larger barchan (assimilation) — large overtakes small: the large dune absorbs the smaller and may split — small catches large: horn tip feeds into the windward face → merger These interactions are visible in Dune once multiple dunes form.
Mars — The Universe’s Best Barchan Field
When NASA’s Mars Reconnaissance Orbiter captured HiRISE images of the Martian surface, researchers found classic barchan dunes — identical in form to those in the Namib — on a world with 1% of Earth’s atmospheric pressure and half the gravity. The Werner rules don’t care about the details of the atmosphere; all that matters is that wind moves sand grains in hops, and there is a shadow zone on the lee side.
The barchan is a convergent planetary solution — the same geometry emerges wherever there is a granular substrate, a unidirectional wind, and limited sand supply. It has been identified on Earth, Mars, Venus (though wind-driven), Titan (hydrocarbon sand), and in submarine environments under oceanic currents. The Werner rules appear to encode something universal about granular transport.
Comparison of barchan fields: Location Dune height Migration rate Grain size ───────────────────────────────────────────────────────────── Sahara, Algeria 5–25 m 5–15 m/yr 0.3 mm quartz Namib, Namibia 1–5 m 15–50 m/yr 0.2 mm quartz Rub' al Khali 2–30 m 5–30 m/yr 0.25 mm quartz Mars (Hellas) 10–60 m ~1 m/yr 0.1 mm basalt Titan (Shangri-La) 100–200 m — estimated organic tholin Martian barchans migrate more slowly despite thinner atmosphere because Martian gravity is weaker (less inter-grain friction needed) and grains are lighter — these partially cancel out.
Sand Supply and Dune Morphology
Dune shape depends critically on sand supply. The Werner model captures the two extremes within the same rule set:
Low supply (barchan regime) — isolated crescents. Each dune’s horn tips shed sand into the inter-dune corridor; that sand may feed the next dune downfield or be lost to the supply. The field can be stable for centuries. This is what you see in Dune at the start.
High supply (transverse dune regime) — dunes merge laterally into continuous ridges perpendicular to wind. The horns connect; inter-dune corridors close. These are the classic “waves” you see in photos of the Sahara from orbit. Click + Sandrepeatedly in the simulation to transition toward this regime.
A third regime — multi-directional wind (star dunes) — produces the massive pyramidal dunes that are Earth’s tallest (up to 180 m). These require wind reversals not present in this single-wind model.
Real-World Applications
Desert agriculture and land loss — barchan dunes migrate 5–50 m per year, burying roads, villages, and agricultural land across sub-Saharan Africa and Central Asia. Barrier fences and planted vegetation interrupt the shadow-zone dynamics, decelerating or stopping migration.
Oil sands pipelines — pipelines in dune fields must be designed with barchan migration in mind. A pipe buried 3 m deep can be exposed in a decade if a dune passes over it and the wind strips the lee side.
Dust storms and climate — the Sahara annually exports ≈ 180 million tonnes of mineral dust to the Atlantic, fertilising the Amazon basin and affecting hurricane formation. The saltation threshold controls how much dust enters the climate system.
Coastal management — barchan-like coastal sand dunes migrate inland and can bury buildings. The same Werner dynamics are used to model and predict migration rates. In the Netherlands, engineered foredunes are designed with the barchan geometry in mind to maximise stability.
Implementation
Dune runs entirely in the browser on a 240×120 Float32Array height field. Each animation frame executes 18,000 Monte Carlo saltation steps (random cell → lift GRAIN → shadow check → deposit or re-hop) followed by 5 passes of a 4-neighbour avalanche sweep. The shadow check scans up to 20 cells upwind.
Performance budget per frame (Chrome, M1): 18,000 saltation steps × ~12 ops ≈ 216,000 ops 5 passes × 28,800 cells × 4 nbrs ≈ 576,000 ops Render: 28,800 pixels via ImageData ≈ 29,000 writes Total: ~821,000 ops/frame × 60fps ≈ 49M ops/sec Color LUT: 256 RGB entries interpolated through 8 control points (black desert floor → reddish → amber → warm gold → pale cream) Wind streaks: 50 particles moving at wind speed, rendered with screen blending on a second pass over the canvas. Canvas: 480×240 physics grid displayed at CSS 720px max-width via drawImage() with imageSmoothingEnabled = false. No WebGL, no libraries, no backend. Shareable by URL (F5 to restart).