A new phase — a crystal, droplet or bubble — does not appear all at once. It begins as tiny clusters created by random thermal fluctuations. Only clusters that exceed a critical radius r* are stable; smaller ones dissolve back. This Monte Carlo model lets you watch undercooling tip the balance from dissolution toward runaway growth.
r* = 2γ / ΔGv, where the driving force ΔGv grows with undercooling.ΔG(r) = −(4/3)πr³·ΔGv + 4πr²·γ
r* = 2γ / ΔGv · ΔG* = 16πγ³ / (3·ΔGv²)
Pure water can be supercooled below 0 °C and stay liquid because no nucleus has formed — until a single speck of dust or a sharp tap triggers explosive ice crystallisation. The same physics decides whether molten steel forms fine, strong grains or coarse, brittle ones.
Nucleation is the very first step in forming a new phase — such as a crystal in a melt, a droplet in a vapour, or a bubble in a liquid. Tiny clusters of the new phase form by random thermal fluctuations, and only those that exceed a critical size survive and grow.
The critical radius r* is the cluster size at which the free energy is maximal. Below r* a cluster lowers its energy by shrinking and dissolves; above r* it lowers its energy by growing. In classical nucleation theory r* = 2γ/ΔGv, where γ is the surface energy and ΔGv is the volume free-energy driving force per unit volume.
Greater undercooling (cooling below the equilibrium temperature) increases the volume driving force ΔGv. Since r* = 2γ/ΔGv, a larger ΔGv means a smaller critical radius, so more thermal fluctuations exceed r* and the nucleation rate rises sharply.
ΔG* is the free-energy barrier a cluster must overcome to become stable. It equals 16πγ³ / (3 ΔGv²) for a sphere. A higher barrier means nucleation is rare; deeper undercooling reduces the barrier and makes nucleation more frequent.
The free energy has two competing terms: a negative volume term (−4/3 πr³ ΔGv) that favours growth, and a positive surface term (+4πr² γ) that resists it. For small r the surface term dominates so energy rises; past r* the volume term wins and energy falls.
Homogeneous nucleation happens uniformly inside the bulk phase. Heterogeneous nucleation occurs on pre-existing surfaces — container walls, impurities or seed particles — which lower the effective surface energy and the barrier, so it dominates in almost all real materials.
It is a Monte Carlo model. Each frame, random embryos appear with sizes drawn from thermal fluctuations. Clusters smaller than r* shrink and dissolve; clusters larger than r* grow at a rate set by atomic attachment. The undercooling slider sets r* and the appearance rate.
Supersaturation is the analogous driving force for nucleation from solution or vapour, where concentration exceeds equilibrium solubility. Like undercooling, higher supersaturation raises ΔGv, shrinks r*, and accelerates nucleation; the same equations apply with concentration replacing temperature.
As the new phase grows it consumes the driving force: the surrounding region becomes less undercooled or less supersaturated, ΔGv drops, and growth slows. Neighbouring grains also compete for material, and grain boundaries form where they meet.
It governs the grain size of cast metals, the formation of snowflakes and rain, the crystallinity of chocolate and ice cream, the strength of steels and aluminium alloys, and the manufacture of pharmaceuticals where crystal form controls drug behaviour.
This simulation is a Monte Carlo model of classical nucleation theory (the physics of how a new phase, like a crystal or droplet, first appears). Every frame it spawns random "embryo" clusters whose radius is drawn from a thermal-noise distribution centred near the critical radius r* = 2γ/ΔGv, where γ is surface energy and ΔGv is the volume free-energy driving force set by undercooling. Clusters smaller than r* shrink and dissolve each step; clusters at or above r* grow, following ΔG(r) = −(4/3)πr³·ΔGv + 4πr²·γ. The dashed ring on screen marks the live r*.
Hundreds of randomly seeded clusters, some fading away (sub-critical, shown faint) and some expanding into stable crystals (super-critical, shown with a bright radial gradient), driven purely by the balance between surface energy and volume free energy predicted by classical nucleation theory.
Drag the Undercooling ΔT slider to raise the driving force and shrink r*; the Surface energy γ slider enlarges r* and the nucleation barrier. Nucleation rate sets how many embryos appear per frame, and Growth speed sets how fast super-critical nuclei expand. Click or tap the canvas to seed a guaranteed super-critical nucleus at that spot. Pause/Play and Reset control the run, and the live stats panel reports r*, the barrier ΔG*, surviving nuclei, and the dissolved count.
Pure water can be supercooled well below 0°C and stay liquid because no stable nucleus has formed yet — a single speck of dust or a sharp tap can trigger near-instant ice crystallisation, the same critical-radius physics modelled here.
r* is the cluster radius at which the free energy ΔG(r) is at its maximum. The simulation computes it live as r* = 2γ/ΔGv from the Surface energy and Undercooling sliders. Clusters smaller than r* are shown shrinking and fading (unstable); clusters at or above it are shown growing with a bright gradient (stable). The dashed circle drawn near the top-right of the canvas is this exact r* value, updated every frame.
Undercooling ΔT feeds directly into the driving force ΔGv used by the code (dGv = 0.25 + 3.0 × undercool). Since r* = 2γ/ΔGv, turning ΔT up shrinks r*, so far more randomly-sized embryos land above the critical size and survive — you will see nucleation become much more frequent and the "Surviving nuclei" counter climb faster.
γ is the energy cost of creating new surface area between the old and new phase. Raising γ increases both r* (= 2γ/ΔGv) and the nucleation barrier ΔG* (= 16πγ³/(3ΔGv²)) computed by the simulation, meaning clusters need to reach a larger size before they stop shrinking — fewer random embryos will be large enough to survive.
Each spawned embryo gets a random starting radius drawn from a rough thermal distribution around r*. In the step() function, any cluster with radius below the current r* has its radius reduced every frame until it is dissolved (added to the Dissolved counter); any cluster at or above r* has its radius increased at a rate based on Growth speed and Undercooling, with growth slowing as it approaches roughly half the canvas size.
Clicking or tapping calls the seedAt() function, which places a new cluster at that exact point with radius set to 1.4 × the current r* — guaranteed to be super-critical — so it immediately starts growing regardless of the random thermal distribution used for automatic embryos.