This is the 2D companion to the 3D "Why Ice Floats" molecular lab. Instead of a hexagonal lattice, it models the macroscopic consequence: a lake column of 22 horizontal water layers, each with its own temperature. Every frame each layer's real density is computed from the same water density-vs-temperature curve used in the 3D lab, and that density — not temperature directly — decides what happens next.
rho(T) = 999.842594 + 0.06794 T - 0.009095 T^2 + ... (peak ~999.97 at 3.98°C)
if rho(layer i) > rho(layer i+1): swap/mix them (denser water sinks)
ice forms at surface when its temperature reaches 0°C
draft fraction = rho_ice / rho_water(0°C) = 917 / 999.8 ≈ 0.918
- Convective turnover: whenever a layer becomes denser than the water beneath it, the simulation mixes them — exactly the mechanism that turns a lake over each fall (warm water cooling toward 4°C sinks) and each spring (ice-melt water warming toward 4°C sinks again).
- Winter stability: once the surface drops below 4°C it becomes less dense than the 4°C water beneath, so it stops sinking, floats on top, and can finally reach 0°C and freeze — while the bottom stays near 4°C, the warmest, densest water in the whole lake.
- Ice draft: the floating ice blocks and the lake's ice sheet are drawn with the exact submerged fraction computed from the real density ratio each frame, never a fixed pixel height.
- Rates are accelerated for visualization — a real lake turns over over days, this does it in seconds — but the direction and stopping point of every process are read off the real density curve, never scripted.
Real-world relevance: this is why lakes freeze from the top down and why fish survive winter in the 4°C water at the bottom, sheltered under an insulating ice lid.