Earth
Magma crystallization
Cool a binary melt and follow the liquid and the crystals down the phase loop: in equilibrium the lever rule keeps the bulk composition and the last liquid freezes at the solidus; with the crystals removed as they form the liquid runs on to the low-melting end and the crystals are zoned from their first to their last composition. Cool eight times faster and the grains come out half the size.

What happens
A binary melt of a high-melting component A and a low-melting B on an ideal-solution phase loop: at a temperature the coexisting liquid and solid are X_l = (1 − K_B)/(K_A − K_B) and X_s = K_A·X_l with K = e^(ΔH/R·(1/T − 1/T_melt)). Heat is taken out at a set rate; on the liquidus the step is solved by bisection so that sensible plus latent heat equals the heat removed. Equilibrium crystallization keeps the lever rule for the bulk composition; fractional crystallization removes each increment of crystals and lets the liquid run down the liquidus to pure B. Nuclei scale with the cooling rate, so the grain size falls as its cube root.
Try this
Watch the two state points slide down the liquidus and solidus; switch to fractional crystallization and see the liquid run on to the low-melting end; cool faster and read the smaller grains.
The model and its limits
An ideal binary loop with constant enthalpies, instantaneous kinetics on the liquidus, a nucleation law linear in cooling rate, no settling or convection. A teaching melt, not a natural multicomponent magma.
Equations used in the module
Equations K_A = e^(ΔH_A/R·(1/T − 1/T_A)), K_B = e^(ΔH_B/R·(1/T − 1/T_B)) X_l = (1 − K_B)/(K_A − K_B), X_s = K_A·X_l f_s = (X_0 − X_l)/(X_s − X_l) c·(T − T′) + L·Δf = q·Δt, d = (6·f_s/(π·N))^(1/3)


