
416 GPGPU Programming for Games and Science
FIGURE 7.12: Screen captures from the 2D fluid simulation. The upper-
left image is the initial random density with initial zero velocity. The captures
were taken at 1-second intervals, left to right and then top to bottom.
7.11.3 Solving Fluid Flow in 3D
The sample application is found at
GeometricTools/GTEngine/Samples/Physics/Fluids3D
In the sample application, the 3D fluid is confined to a cube R = {(x, y, z):
0 ≤ x ≤ 1, 0 ≤ y ≤ 1, 0 ≤ z ≤ 1}. The boundary B consists of points
for which x =0,x =1,y =0,y =1,z =0,orz = 1. The velocity is
(u, v, w). The velocity boundary conditions are u(0,y,z,t)=0,u(1,y,z,t