Sloshing water in an elliptical container
Channel: Nils Berglund
Date: 2023-06-12

This video shows a simulation of the shallow water equations in an elliptical bucket. The initial state consists in two Gaussian bumps, centered at the focal points of the ellipse, added to a constant water height. As expected, the waves tend to periodically concentrate at the focal points.
The shallow water equations are nonlinear equations, which give a better description of the motion of water than the linear wave equation. In particular, unlike the linear wave equation, they conserve the total volume of water. The linear equation gives an approximation of the solutions, when the wave height remains close to its average over space. 
The equations used here include viscosity and dissipation, as described for instance in 
https://en.wikipedia.org/wiki/Shallow_water_equations#Non-conservative_form , without the Coriolis force. The simulation uses quite small values of viscosity and dissipation, that avoid numerical blow-up. The walls of the bucket are represented by soft boundaries, consisting in a localized repulsive force pointing inward, and a steep but continuous cut-off, acting like a strong viscous drag outside the bucket.
The video has four parts, showing the same simulation with two different color schemes and at two different speeds:
Wave height: 0:00
Velocity (norm and direction): 1:30
Wave height (time lapse): 3:00
Velocity (time lapse): 3:30
In the first and third part, the color hue and z coordinate show the height of the water. In the second and fourth part, the color hue shows the direction of the flow, and the z-coordinates shows its speed (the norm of the velocity). There are periodic boundary conditions.
 

Render time: 1 hour 40 minutes
Color scheme: Parts 1 and 3 -   Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing
https://github.com/BIDS/colormap
 Parts 2 and 4 - Twilight by Bastian Bechtold
https://github.com/bastibe/twilight
 
Music: "Spook Off" by TrackTribe@TrackTribe

See also https://images.math.cnrs.fr/Des-ondes-dans-mon-billard-partie-I.html for more explanations (in French) on  a few previous simulations of wave equations. 

The simulation solves the 2D shallow water equation by discretization (finite differences).

C code: https://github.com/nilsberglund-orleans/YouTube-simulations
https://www.idpoisson.fr/berglund/software.html
Many thanks to Marco Mancini and Julian Kauth for helping me to accelerate my code!

#shallowwater #waves #wave