Presets and playback
Camera and quality
Aquarium: gas bubbles
Bubbles from an air stone: size from Tate's law, speed from the drag law.
Champagne flute
Bubbles grow on the way up as dissolved CO2 diffuses in.
Soap bubbles and wand
Click a bubble in the scene to prick it. Film colour comes from its thickness.
Blowing
Time
Slow motion helps to watch merging and bursting.
Layers
Model checks
The science
Gas bubbles in a liquid
Buoyancy against drag. A bubble of radius R is pushed up by rho_l g V and slowed by drag. With the added mass of the liquid (rho_l V / 2) the equation of motion is dv/dt = 2g - (3 C_D / 4R) v^2, so the terminal speed obeys v^2 C_D(Re) = 8 g R / 3, with Re = rho_l d v / mu. The page solves this by bisection for 180 diameters and interpolates.
- Clean bubble (mobile surface, pure water):
C_D = (16/Re) [1 + 1 / (8/Re + 0.5 (1 + 3.315 / sqrt(Re)))](Mei, Klausner and Lawrence 1994). At small Re it tends to16/Re, which gives the Hadamard-Rybczynski speed, exactly 1.5 times the rigid-sphere value. - Contaminated bubble (surfactant makes the surface rigid): Schiller-Naumann
C_D = 24/Re (1 + 0.15 Re^0.687), with the Stokes lawv = g d^2 / (18 nu)at small Re. - Large bubbles are limited by interface waves,
v = sqrt(2 sigma / (rho d) + g d / 2)(Mendelson 1967). The two regimes are joined with a smooth minimum, so the speed peaks near 2 mm (about 29 cm/s) and then falls to about 23 cm/s near 5 mm: the famous maximum of the curve in the first graph. - Shape. The aspect ratio
1 / (1 + 0.163 Eo^0.757)withEo = rho g d^2 / sigmasquashes large bubbles into oblate ellipsoids. Clean bubbles above about 1.3 mm also zigzag (drawn as a spiral at a Strouhal number of about 0.12; the path is illustrative).
Birth, growth and pressure. A bubble leaving a pore of radius r_o has the Tate radius (3 r_o sigma / 2 rho g)^(1/3). Gas inside follows the isothermal ideal-gas law with the Laplace pressure, (p + 2 sigma / R) R^3 = K, where p = p_above + rho g (depth); K is solved for R with Newton iterations, so a bubble that rises 25 cm in water grows only a few per cent, but in a vacuum chamber it swells visibly. Dissolved gas adds to K by diffusion: dK/dt = 3 R_gas T R D Sh (c_inf - c_s) / (2 M), with the Ranz-Marshall Sherwood number Sh = 2 + 0.6 Re^0.5 Sc^(1/3). That is why champagne bubbles (CO2, supersaturation s) swell as they rise, while air bubbles hardly change.
Coalescence. Touching bubbles merge with a probability that depends on the liquid (high in pure water, very low in soapy or salty water, where drainage of the thin film between them is slowed). A follower in the wake of a leader is sped up by up to 45 % (wake drafting), which is what drives merging in clean water. At the top, bubbles form a raft whose lifetime depends on the liquid.
Soap bubbles in air
Laplace pressure. A soap film has two surfaces, so the excess pressure is Delta p = 4 gamma / R (a gas bubble in a liquid has one surface: 2 sigma / R). It follows from the energy E = 2 gamma 4 pi R^2: Delta p = dE/dV. Smaller bubbles have the higher pressure, which is why a small bubble connected to a big one empties into it.
Why a bubble falls (or floats). Net weight = film mass rho_w 4 pi R^2 h + inside air - displaced air. Warm breath is lighter than room air, so a fresh bubble can hover or rise until its air cools (time constant about 4 s per 2 cm of radius). Drag uses the sphere law above with the added mass of air; the wind is a uniform breeze plus a sum of sines for gusts.
Colour = thin-film interference. Light reflected from the front and back of the film interferes. For index n = 1.33 and thickness h, the reflectance (exact two-beam sum, averaged over polarisations) is R = F sin^2(beta) / (1 + F sin^2(beta)), with beta = 2 pi n h cos(theta_t) / lambda and F = 4 r^2 / (1 - r^2)^2. A film around 100 nm reflects best at lambda = 4 n h = 532 nm (green); below about 20 nm it is a "black film" and soon bursts. The spectrum is turned into colour with CIE colour-matching functions (Wyman et al. fit) and a 6500 K white light, stored in a thickness x angle table used by the shader. The bubble then reflects a procedural room (window and sky), brightened so the faint 7 % reflection is visible. The thickness varies over the surface: gravity drains the top (thin) toward the bottom (thick), and swirls grow with age.
Lifetime. Drainage dh/dt = -h / tau_d - evaporation (1 - RH) is a phenomenological model, not a derivation: real drainage depends on surfactant, viscosity and marginal regeneration. The bubble pops when the top of the film is thinner than a random threshold of 8 to 38 nm. When it pops, the hole opens at the Taylor-Culick speed sqrt(2 gamma / (rho h)) (about 10 m/s); the page shows it 60 times slower.
What is simplified
- No bubble-induced liquid flow, no hydrodynamic bubble-bubble forces beyond wake drafting, no mass loss from the tank liquid.
- The aquarium and flute are rigid containers; the foam raft is a single layer.
- Film thickness evolves by a lumped law; the colours are physically computed for that thickness but the pattern of swirls is procedural noise.
- Reflected radiance comes from a simple analytic room, not a full ray trace.
In-page numerical checks
Five independent tests run at start-up: (1) the scanned film reflection peak against 4 n h and the black-film limit; (2) the numerical bubble speed against Stokes' law and the 3/2 Hadamard-Rybczynski ratio; (3) the Laplace pressure from a finite-difference energy derivative; (4) the time integrator reaching the tabulated terminal speed and the isothermal growth law; (5) the total-internal-reflection angle asin(1/n) found by scanning, and the Tate radius.