loading...
Density of oil (blue) and wax (orange) versus temperature; vertical lines mark the bath and the crossover T*
running...
The science
The idea. A lava lamp works because wax and oil expand at different rates. Cold, the wax is a fraction of a percent heavier than the oil; warm, it is lighter. This lab removes everything else: the column sits in a uniform water bath, so the only thing that changes is the temperature, and you can watch the density crossover happen.
Densities.
ρoil(T) = ρ0 [1 − βf (T − 20°C)], ρwax(T) = ρ0 (1 + δ) [1 − βw (T − 20°C)], ρ0 = 950 kg/m³
Here δ is the weight excess of cold wax and βw > βf the thermal expansion coefficients. The densities are equal at the crossover temperature
δ = ΔT [ (1+δ) βw − βf ] ⇒ T* = 20°C + δ / k, k = (1+δ) βw − βf (about 40°C for the defaults)
so the density difference is exactly linear in temperature: ρoil − ρwax = ρ0 k (T − T*). Above T* a blob rises, below it sinks.
Motion. Each blob follows Newton's law with buoyancy, added mass and a Schiller-Naumann drag:
(ρwax + ½ ρoil) V dv/dt = (ρoil − ρwax) V g − 6π μ r (1 + 0.15 Re0.687) (v − uoil), Re = ρ |v − u| 2r / μ
Stokes limit: vt = 2 g (ρoil − ρwax) r² / (9 μ)
In thick oil (Re < 1) the speed is therefore v = 2 g ρ0 k (T − T*) r² / (9 μ): linear in temperature, quadratic in radius. The speed graph rescales every blob to r = 1.2 cm so all six points fall on one line.
Thermal lag. A blob is a lumped sphere (small Biot number):
m c dT/dt = h A (Toil − T), h = Nu k / 2r, Nu = 2 + 0.6 Re1/2 Pr1/3 ⇒ τ = ρ c r² / (3 k) at rest
For r = 1.2 cm, τ ≈ 12 minutes. If the bath is heated at rate a, a blob trails it by a constant lag a τ; that is why the ramp preset lifts the blobs off well after the bath passes T*.
Honest limits. Blobs stay spheres (never stretched), the oil is not solved (prescribed temperature field, fixed convection roll), material properties are constants of order of paraffin wax and mineral oil, and the blob-pool pinch-off time is a fitted constant. Here the bath is perfectly uniform (a real lamp has a steep temperature gradient), the viscosity does not change with temperature, wax melting and its latent heat are ignored, and there are no wall effects on the drag. Real paraffin expands abruptly when it melts; this lab uses the smooth linear law that the lamp physics needs.
Numerical checks (run in this page). (1) Blob speed at T* + 4 K in viscous oil vs Stokes with the closed-form density difference; (2) the zero of the simulated speed vs T* = 20 + δ/k; (3) the steady thermal lag of a blob in a 1 K/min ramp vs aτ; plus the shared checks: Stokes terminal speed, thermal e-folding time, wax volume conservation, merge radius and momentum, Rayleigh number, and the rendered surface volume.
The scene (glass, base, metal and wood props) is modelled in Blender with baked PBR textures and exported as a Draco GLB; the wax surface is an iso-surface of the blob positions generated live in JavaScript every frame. The physics runs on the spheres, not on the drawn surface.