Site percolation is one of the cleanest phase transitions in statistical physics. Scatter open pores across a grid of rock with some probability and ask a single question: does a connected path of pores span the medium? Below a critical porosity near 59% the answer is almost always no, and just above it the answer is almost always yes — connectivity flips from local to global over a few percentage points.
Here setup makes each patch a pore with probability given by the porosity slider, leaves the rest as rock, and wets every pore on the top row. Each staged tick, any pore with a wet four-neighbor becomes wet, so the water front traces the connected pore cluster downward. The run stops once the wet count stalls between ticks; the bottom-reached monitor reports whether the medium percolated.
