ABSTRACT

This chapter presents a simple and efficient algorithm for the simulation of fluid flow directly on the Graphics Processing Units using a single pixel shader. In order to physically model the motion of fluids, the simplified classical Navier-Stokes equations for incompressible fluids are a good description of such mechanics, and a solver based on this model is capable of simulating a large class of fluid-like phenomena. Boundary conditions are specified at the boundary of the fluid in order for the fluid to satisfy specific behaviors. They are essential for the interactions between the fluid and the different types of matter such as solids in the domain. The simplest boundary condition is the Dirichlet boundary condition, which specifies the value solution needs to take on the boundary; hence, one could set the border cells to null velocities and densities to an initial value and make sure the simulation works well before considering obstacles.