A foam is a tightly packed mass of gas bubbles separated by thin liquid films. Where three films meet, surface tension pulls the liquid into curved channels called Plateau borders — the visible "skeleton" of a foam. Because liquid is denser than gas, gravity continuously drains it out of the films and out of the upper Plateau borders, pulling it down into wider channels near the bottom. As films thin below roughly 10 nanometres they become unstable and rupture, merging neighbouring bubbles together (coarsening) or collapsing the foam entirely.
Foam drainage is why shaving cream and beer head slowly go dry and flat, and why firefighting foams and food foams (like whipped cream) are engineered with surfactants that slow this same gravity-driven process.
A 3D foam of packed bubbles with a network of Plateau borders — the channels where three films meet — thins from the top down as gravity drains liquid into a growing puddle at the base, until films rupture.
Liquid fraction decays exponentially with height as the foam drains; Plateau border channel radius shrinks with the square root of local liquid content, and bubbles rupture once their film thins past a critical threshold.
Set the initial liquid fraction and drainage speed, then watch the top of the foam dry out and pop while the bottom stays wet. Toggle gravity off to hold the foam uniformly wet, or hide the Plateau borders to see the bare bubble packing.
Real Plateau borders have concave triangular cross-sections shaped by three 120° film junctions (Plateau's laws) — the same geometry that makes soap-film networks minimize total surface area.