Based on the book "Fluid Simulation for Computer Graphics" by Robert Bridson (2008).