Soft obstacles: a wave encountering a grid of refracting circles
Channel: Nils Berglund
Date: 09/07/2021

Like the video https://youtu.be/zPeW0dL584k this simulation shows a planar wave hitting a regular lattice of obstacles. However, here the obstacles are not hard discs, but regions where the speed of waves is 30% of the speed in open water. I hope you enjoy the small universes of trapped waves that can be seen inside the obstacles. The top half shows the waves' amplitude, while the bottom half shows the energy density. 
Boundary conditions are always a bit tricky in this kind of simulation. Here I followed an idea by Kram 1032 (thx!) and used periodic boundary conditions vertically, that is, the top and bottom boundaries are glued together. On the left and right sides, I used a combination of absorbing boundary conditions, and a bit of damping and "elasticity" in order to get a bunch of parallel waves. I did not manage to kill reflections on the sides completely, which is why you see some weird interference.  

Music: "Footsteps Underwater", by JAde Wii@JAdeWii_

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 wave equation by discretization. The algorithm is adapted from the paper https://hplgit.github.io/fdm-book/doc/pub/wave/pdf/wave-4print.pdf 
C code: https://github.com/nilsberglund-orleans/YouTube-simulations
https://www.idpoisson.fr/berglund/software.html 
Many thanks to my colleague Marco Mancini for helping me to accelerate my code!