This is a cellular-automaton model of aeolian (wind-driven) sand transport: individual grains hop forward via saltation, knock other grains loose when they land, and slide down as avalanches whenever a slope gets steeper than the angle of repose. No dune shape is hard-coded — barchan crescents and transverse ripples emerge purely from these simple local rules repeated over thousands of steps.
Wind lifts grains from upwind cells and moves them forward by a hop distance that scales with wind speed. On gentle windward slopes grains simply climb; on the steep leeward (slip) face, whenever the local slope exceeds the angle of repose (~34° for dry sand) an avalanche event redistributes grains downhill until the slope is stable again.
Adjust Wind speed to control saltation hop distance, Sand supply to change how much new sand enters from the windward edge, Max height to cap dune growth, and Angle of repose to change how steep a slip face can get before it avalanches. Pause/Reset control the run, and Speed fast-forwards the simulation. Live stats track total grains, max height, avalanche count, and elapsed steps.
Barchan dunes (crescent-shaped with horns pointing downwind) and transverse ripples (straight corrugations perpendicular to the wind) are both self-organised patterns — real deserts on Earth and even Mars show the same shapes because they follow from the same universal physics of saltation and avalanching, not from anything specific to a particular location's geology.
Saltation is the hopping motion of sand grains lifted briefly by wind, carried forward, and dropped back to the surface — where they can knock other grains loose in a chain reaction. It's the dominant transport mechanism for sand-sized particles (too heavy to stay suspended like dust, too light to stay put like gravel), and it's what slowly migrates dune shapes downwind.
Loose granular material can only support a slope up to a maximum angle — the angle of repose — before gravity overcomes inter-grain friction and triggers a slide. That's why a dune's windward slope stays gentle (built up grain by grain) while its leeward slip face is consistently near the angle of repose, refreshed by avalanches every time saltation over-steepens it.
Barchans form where sand supply is limited and wind direction is fairly constant. The dune's central mass moves slower than its thinner edges (which have less sand to shift), so the edges get pushed ahead of the center, curling forward into the crescent's characteristic horns pointing downwind.
Barchans form under limited sand supply, leaving bare ground between isolated crescent dunes. Transverse ripples form when sand supply is abundant and the surface is nearly flat, producing continuous, evenly spaced corrugations across the whole area rather than isolated dune shapes.
Higher wind speed increases the saltation hop distance, meaning grains travel farther before landing and triggering the next avalanche or deposit. This speeds up how quickly sand redistributes and can shift the emergent pattern between isolated dunes and continuous ripple fields depending on how it interacts with sand supply.