3D Flow
Where Every Drop Goes
The open sea, coloured by depth: the drops below the surface are the water, not decoration.
The ocean, drawn as water instead of as a surface. Tens of thousands of drops each ride their own small circle. The circles shrink with depth. There are three scenes. A deep-water wave that is solved exactly. An open sea where long swell outruns short chop. And a beach where the wave breaks right where the physics says it must.
Ocean waves follow the same equations as every other fluid. Those are the Navier-Stokes equations. Water adds one cruel twist. The top of the water is free to move. So the shape you are solving for is part of the answer. A standard coastal engineering text says it plainly. An exact solution to the problem is impossible. Every wave theory in use gives something up. Ignore the water's stickiness and you get Euler's equations. Assume the water does not spin and you get potential flow. Assume the waves are small and you get the linear theory that engineers use every day.
And yet there is one exact answer. In 1802, an engineer in Prague named Franz Gerstner wrote down a wave that satisfies the full frictionless equations. It includes the free surface, and nothing in it is assumed small. His trick was to describe the water, not the surface. Label each drop by where it sits at rest. His formula then says where that drop is at every moment. Each drop goes around a circle. The circles shrink with depth. Half a wavelength down, they are one twentieth the size. The surface the drops add up to is called a trochoid. It has sharp crests and long flat troughs. The wave was forgotten for sixty years and then rediscovered three times. It is still the only exact solution known for gravity waves on deep water.
That is the first scene. It is also why this scene draws drops instead of a surface. There is an honest catch. Gerstner's water spins. A sea raised by wind from rest does not. Real waves are closer to the theory George Stokes built in 1847. In his theory, each drop creeps forward a little every cycle. The two theories are related in the neatest way. To second order, a Stokes wave is a Gerstner wave plus that drift. Switch the drift on and the closed circles open into forward-looping curls.
The open sea adds more wave trains. Here the equations insist on one thing. A wave's speed depends on its length. A ten-second swell moves at nearly sixteen metres a second. A two-second chop moves at three. That is why swell reaches a beach before the storm that made it. It is also what lets music in honestly. The equations fix how each wavelength moves. They say nothing about how much of each there is. So the heights are yours, and the motion is the water's. A change in height does not show up everywhere at once. It travels as a group, at half the speed of the crests inside it. That is why crests seem to be born at the back of a set and die at the front.
On the beach, the swell slows as the bottom rises. The energy it carries has to go somewhere, so the wave grows. It grows until its height reaches a limit. In deep water that limit is about one seventh of the wave's length. Michell found it in 1893. In shallow water the limit is lower. Miche found that in 1944. Then the wave breaks. How it breaks depends on one number. That number combines the slope of the beach with the steepness of the wave. The wave spills, plunges, or surges. When it plunges, the air tube inside the curl has a shape that comes out of the equations of motion. It is a cubic curve about 2.76 times as long as it is wide. In 2021, researchers scanned thirty breaking waves with lidar on a beach in North Carolina. They measured 2.55.
A note on honesty. One wave train in deep water is exact. Several added together are not. Adding solutions only works for linear problems. But the error is second order and known, and the scene prints it. Some parts are measurements, quoted from the people who made them. Those are the spectrum of a wind sea, the breaking limit, the breaker thresholds, the run-up height, and the amount of whitecap. Some parts are a sketch. How water gets from the unbroken wave onto the curl is a sketch. So is everything the foam does afterwards. Each part is labelled.
The Math
$$X = a - A e^{kb}\sin(ka - \omega t), \qquad Y = b + A e^{kb}\cos(ka - \omega t)$$
Gerstner's wave. Pick the drop that rests at position a and depth b. At time t, this formula says where it is. The drop moves on a circle. The radius is A times e to the power k b, so the circles shrink quickly with depth. This is exact for a frictionless fluid with a free surface. No other deep-water wave formula is.
$$\omega^2 = g k \tanh(kh), \qquad c = \frac{\omega}{k}, \qquad c_g = c\left(\frac{1}{2} + \frac{kh}{\sinh 2kh}\right)$$
The dispersion relation. It ties a wave's frequency to its length and to the depth of the water. From it come two speeds. One is the speed of the crests. The other is the slower speed at which the wave's energy travels. In deep water, energy moves at exactly half the speed of the crests. In shallow water the two speeds become equal. Then every wave travels at the square root of g times the depth.
$$A, B = \frac{H}{2}\,\frac{\{\cosh,\ \sinh\}\,k(z+h)}{\sinh kh}$$
How far a drop moves side to side, and up and down. The drop sits at depth z below the surface, in water of depth h. In deep water the two motions are equal, so the path is a circle. As the bed comes up, the vertical motion shrinks. At the bottom it is zero. The path flattens into an ellipse, and finally into a line.
$$\bar{U}(z) = (ka)^2\, \frac{c}{2}\, \frac{\cosh 2k(z+h)}{\sinh^2 kh}$$
Stokes drift. This is the slow forward creep of every drop under a real wave. It depends on the square of the wave's steepness, so it is small. It is only a few percent of the wave's speed. It fades with depth twice as fast as the orbits do.
$$\frac{H}{H_0} = \sqrt{\frac{c_{g0}}{c_g}}\sqrt{\frac{\cos\theta_0}{\cos\theta}}, \qquad \left(\frac{H}{L}\right)_{\max} = 0.142\tanh(kh)$$
Near a beach, a wave's energy is conserved while its travel speed falls. So its height must rise. Turning toward the shore spreads the wave along a longer crest, which lowers it a little. The wave breaks when it reaches the limiting steepness. In deep water that is 0.142. Michell found it in 1893. As the water gets shallower, the limit drops.
$$\xi_0 = \frac{\tan\alpha}{\sqrt{H_0/L_0}}, \qquad \frac{z'}{W} = \pm\frac{3\sqrt{3}}{4}\sqrt{\frac{x'}{L}}\left(\frac{x'}{L} - 1\right), \qquad \frac{R_u}{H} = \xi$$
The surf similarity number. It is the beach slope divided by the square root of the wave steepness. Below about one half, the wave spills. Above about three, it surges. In between, it plunges. The middle formula is the outline of the air tube inside a plunging wave. The last one is Hunt's rule. It says how high the broken wave runs up the beach.
How Spiralyst Lab draws it
Spiralyst Lab does not run a fluid simulation here. Each drop is a label. The label is the drop's resting position. The wave formulas say where that label is at any moment. So there is nothing to integrate and nothing to drift. The labels never move, so most of the arithmetic is done once and remembered. A frame costs a few multiplications per drop. That is how sixty thousand drops run at once. It is also why changing a wave's height costs nothing at all. The beach is solved once per change, like the waterfall. The swell is marched up the slope to its break point. The breaker's type, the tube's size, and the run-up height are read off. A drop that breaks then carries its own clock and its own speed. So moving a slider changes what the next wave does. It never reaches back to shove water that has already broken. The info bar reports the significant wave height, the wavelength, and the speed. When more than one wave train is on, it also reports how far the sum is from exact.
Requires a Spiralyst Lab license.
Did you know?
In deep water, a group of waves travels at exactly half the speed of the waves inside it. Watch a set roll in from a pier and you can see it. Each crest appears from nothing at the back of the group. It runs forward through the group and fades out at the front. The group itself lumbers along behind.
Get Spiralyst Lab — $24.99/yr 3D Flows overview ← All gallery
Math typesetting on this page is rendered by KaTeX 0.17.0 (MIT).