A sandcastle wall is a self-weighted, cohesive granular slope. Below a critical height it stands at whatever batter angle β it was packed to; above that height, self-weight shear stress exceeds the sand's cohesive strength and the excess slumps down to the sand's angle of repose. The critical height comes from Culmann's slope-stability formula (Mohr–Coulomb failure, the same relation used for retaining-wall and trench-safety design):
Hcr = 4·c·sinβ·cosφ / [ γ·(1 − cos(β − φ)) ]
where c is the sand's cohesive strength, γ its unit weight, φ its internal friction angle (= angle of repose for loose sand) and β the wall's batter angle from horizontal. At β = 90° this reduces exactly to the classic vertical-cut formula Hcr = (4c/γ)·tan(45°+φ/2); as β → φ, Hcr → ∞ — a slope resting at its own friction angle needs no cohesion at all to stand any height.
Cohesion itself comes from capillary liquid bridges between grains (pendular-regime "wet granular" physics): too little water and no bridges form (c ≈ 0); a working range of moisture builds a roughly constant bridge network (c plateaus, independent of exactly how wet within that range — the classic "any wet sand works" sandcastle finding); push moisture further and bridges merge into a saturated slurry, pressure balance flips and cohesion collapses toward zero. Finer grains pack more contact points per unit volume, so cohesion scales roughly as 1/d.
- Below Hcr — the wall holds its packed batter angle β all the way to a point (or, if it geometrically tapers to an apex first, a complete stable pyramid).
- Above Hcr — the wall is truncated at Hcr and whatever is poured on top settles into a small cone at the shallower angle of repose φ instead.
- Change φ, β, moisture or grain size live — the profile re-derives Hcr every frame and animates toward the new stable shape, visibly slumping when cohesion can no longer support the current height.