This visualization shows how the speed of water waves varies with depth and wavelength. The position of your mouse changes the depth $h_0$ and the wavenumber $k$. The dispersion relation includes both gravity and surface tension effects:
\begin{equation} \omega^2 = \left(gk + \frac{\sigma k^3}{\rho}\right) \tanh(kh_0) \end{equation}where $\omega$ is the angular frequency, $g$ is gravity (9.81 m/s²), $\sigma$ is surface tension (0.072 N/m for water), $\rho$ is density (1000 kg/m³), $k = 2\pi/\lambda$ is the wavenumber with wavelength $\lambda$, and $h_0$ is the water depth.
In shallow water ($kh_0 \ll 1$), $\tanh(kh_0) \approx kh_0$, giving $\omega^2 \approx (gk + \sigma k^3/\rho) kh_0$. For pure gravity waves, the phase velocity becomes $c_p \approx \sqrt{gh_0}$, which is independent of wavelength - waves are non-dispersive. This is why tsunamis travel at constant speed across the ocean.
In deep water ($kh_0 \gg 1$), $\tanh(kh_0) \approx 1$, giving $\omega^2 \approx gk + \sigma k^3/\rho$. For gravity waves, $c_p \approx \sqrt{g/k} = \sqrt{g\lambda/(2\pi)}$, so long waves travel faster than short waves. This is why ocean swells can travel thousands of kilometers.
Use the controls above to adjust timestep, surface tension, water depth, wavenumber, and wave amplitude. You can toggle surface tension on/off and force deep water mode. When mouse control is enabled, move your mouse to adjust depth (vertical) and wavenumber (horizontal).