About this simulation

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 17 September 2026

This CPU companion to the GPU ripple tank drives the same shallow-water wave equation ∂²h/∂t² = c²∇²h with a leapfrog finite-difference scheme running entirely in plain JavaScript, but frames it around droplets rather than a continuous oscillator: click or drag to drop stones (or switch on rain for continuous random impacts), and the wave speed is tied to a physical water depth slider through c = √(g·depth), the real shallow-water dispersion relation.

🔬 What it shows

Each droplet launches a circular ripple that expands, reflects off the tank walls, and fades according to the viscosity (damping) setting. A breakwater wall with an adjustable gap width turns a wide wavefront into a narrow diffracted beam behind the opening, and two overlapping ripples visibly interfere where their crests and troughs meet.

🎮 How to use

Click or drag anywhere on the tank to drop stones. Adjust Water depth to change wave speed, Viscosity to control how fast ripples die out, and Droplet strength for bigger splashes. Turn on Rain for continuous random impacts, or enable the Breakwater wall and tune its Gap width to watch diffraction.

💡 Did you know?

The wave speed readout uses c = √(g·depth), the same shallow-water formula tsunami forecasters use: a tsunami in 4,000 m of open ocean travels near 200 m/s, but slows dramatically — and grows in height — as it reaches the shallows near shore.

Frequently asked questions

How is this different from the 3D ripple tank version?

The 3D version runs its leapfrog wave solver as a GPU fragment shader with a continuous driven oscillator and preset interference/diffraction/refraction demos. This 2D version runs the same class of equation entirely on the CPU, driven by discrete droplet impacts (click, drag, or rain) instead of a continuous source, so you watch individual ripples spread, reflect and interfere rather than a steady-state pattern.

What equation governs the ripples?

The shallow-water wave equation ∂²h/∂t² = c²∇²h, where h is surface height and c is the local wave speed. A leapfrog scheme updates each cell from its current and previous height plus the Laplacian (sum of neighbour heights minus 4× the centre), scaled by c² and a stability-limited CFL coefficient.

Why does the Water depth slider change wave speed?

In the shallow-water approximation, wave speed depends only on depth: c = √(g·depth), where g is gravitational acceleration. Deeper water supports faster-travelling waves — the same relation used to explain why tsunamis slow down and steepen as they approach a shoreline.

What does the Viscosity slider actually do?

It sets a per-step damping multiplier applied to the whole height field, removing a small fraction of wave energy every step so ripples decay realistically instead of oscillating forever. The Damping half-life readout estimates, in seconds, how long it takes a ripple's amplitude to fall to half its starting value at the current setting.

How does the breakwater gap create diffraction?

Enabling the Breakwater wall marks a column of grid cells as perfectly reflecting except for an opening sized by the Gap width slider. A wide wavefront hitting the wall is blocked everywhere except the gap, and the wave that squeezes through spreads out in circular arcs on the far side — diffraction, most visible with a narrow gap.