Matthias Müller wrote
a more sophisticated water simulation that is implemented using a so-called grid-based
or Eulerian approach. He personally elaborates on this simulation
in this video
on his Ten Minute Physics YouTube channel.
Click on the above image to activate the Euler-based water simulation
which was implemented using pure JavaScript by
Matthias Müller.