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 projected silhouette area of one blob in this renderer.
The backdrop, base, heater disc and cap are rendered from the same Blender scene as the 3D page (orthographic side view, Cycles on the GPU, exported as small WebP sprites); the wax is drawn live in Canvas from the blob positions. The physics runs on the spheres, not on the drawn picture.
The 2D view. This page runs exactly the same lamp model as the 3D page (same lamp.js, same controls, readouts, graphs and checks); only the drawing is flat. The wax is drawn as the iso-line of the same Wyvill-kernel field the 3D mesher uses (same iso level 0.4), projected along the viewing axis, so blobs that sit behind one another overlap and a blob that is merging in depth can look merged here before it is. The backdrop, base, heater disc and cap are Cycles renders of the Blender scene used by the 3D page. Light and shading on the wax are a simple 2D normal from the field gradient, not a ray-traced image.