Ferrofluid simulation
A magnetic fluid under the influence of a movable field source. Drag the magnet across the surface and watch spikes form through the Rosensweig instability — the same phenomenon that gives real ferrofluid its alien, spiky beauty.
Instability threshold: Bc² = 2μ0 √(ρgγ)
Magnetic liquid
Ferrofluid is a colloidal suspension of nanoscale ferromagnetic particles (typically magnetite, Fe3O4) in a carrier liquid, usually oil or water. Each particle is roughly 10 nanometres in diameter and coated with a surfactant to prevent clumping. The result is a liquid that responds strongly to magnetic fields while remaining fluid — a superparamagnetic material.
Invented in 1963 by NASA engineer Steve Papell as a way to move rocket fuel in zero gravity, ferrofluid has since found applications in loudspeakers (as a coolant and damper around voice coils), hard drive seals, medical imaging contrast agents, and — perhaps most famously — as a mesmerising desk toy.
When flat surfaces grow spikes
When a uniform magnetic field is applied perpendicular to a flat ferrofluid surface, nothing happens until the field exceeds a critical threshold. Beyond that threshold, the surface spontaneously breaks into a regular hexagonal array of peaks — the normal-field or Rosensweig instability, first described by Mark Cowley and Ronald Rosensweig in 1967.
The instability arises from a competition between three forces. The magnetic force pulls the fluid along field lines, favouring tall, narrow peaks. Surface tension penalises the increased surface area of spiky shapes. Gravity penalises tall columns of fluid raised above the equilibrium level. The critical field strength is Bc² = 2μ0√(ρgγ), where ρ is fluid density, g is gravitational acceleration, and γ is surface tension. Below this threshold the flat surface is stable; above it, peaks form with a characteristic wavelength set by the capillary length.
A simplified 2D model
This simulation models a 1D cross-section of the ferrofluid surface as a height field. Each point along the surface has a height value that evolves over time according to simplified equations capturing the essential physics: magnetic attraction toward the field source (decaying with distance), a surface-tension restoring force (proportional to the second spatial derivative of the height, which penalises high curvature), and gravitational restoring force pulling peaks back down.
The magnet is treated as a point source with a field that falls off with the inverse square of distance. When you drag the magnet near the surface, the local field exceeds the instability threshold and spikes form. The simulation uses explicit time-stepping with damping to mimic the viscosity of real ferrofluid, preventing unrealistic oscillations. While this is far from a full magnetohydrodynamic solver, it captures the qualitative behaviour beautifully: spikes that grow toward the magnet, merge and split as it moves, and relax back to a flat surface when the field is removed.
Labyrinthine patterns and solitons
The hexagonal spike array is just the beginning. In thin layers of ferrofluid confined between glass plates (a Hele-Shaw cell), applying a perpendicular field produces labyrinthine stripe patterns reminiscent of magnetic domains in solid films. These stripes undergo their own instabilities: branching, tip-splitting, and coarsening as the field changes.
At the surface, individual spikes can behave as solitons — localised structures that persist and move without dispersing. Researchers have shown that ferrofluid spikes can be created, annihilated, and moved independently, leading to proposals for ferrofluid-based logic gates and displays. The interplay of nonlinear magnetisation, surface tension, and gravity makes ferrofluid one of the richest systems in soft-matter physics.