Physically-Based Fluid Modeling using Smoothed Particle Hydrodynamics

Table of Contents
Chapter 5: Conclusions and Future Work





CHAPTER 4

Results

Overall this method is successful in modeling fluid motion for computer graphics. The particle motion is convincing and attributes such as pressure and density evolve as the equations of hydrodynamics would predict. Unfortunately the results when using surface rendering were not as successful as it was originally hoped. The performance bottleneck in evaluating the implicit function results in a relatively slow update rate, preventing realistic animations in most cases.

A series of tests were run on the system in order to track interactivity and fluid attributes. The first set of tests (the "interactivity" tests) focused on smaller data sets that had the potential for modeling fluid convincingly (i.e. fast enough to look like fluid flowing without having to save frames for later playback). The other set of tests (the "drop" tests) were intended as full SPH simulations in order to track the evolution of fluid attributes and to check the contribution of the optional SPH equations. All tests were run on an SGI Onyx system. Most were on an 8 processor system (150 MHz) with 512 Mbytes of memory, the rest on a 12 processor system (150 MHz), also with 512 Mbytes of memory.

4.1 Interactivity Tests

The first set of tests used two relatively small particle sets: 36 particles and 156 particles. There were two environments in which the particles were run. One had obstacles forming a "funnel" and a floor, the other had a "spout" and a floor. The environments were created to model a real life fluid situation such as pouring water onto a floor or into a funnel. Figure 6, Appendix shows the spout environment, Figure 7, Appendix shows the funnel environment. Gravity was turned on, but the artificial viscosity, XSPH variant and thermal energy were all turned off. Without surface rendering both particle sets run fast enough for convincing motion, but the large data set has a much smaller time step due to a smaller smoothing length, and so did not move as far during one time step. With surface rendering turned on the 36 particle data set gives marginally convincing motion (if the fluid were cold honey) but the 156 particle simulation is not convincing. Figure 8, Appendix, shows a comparison of the surface update rate and the SPH update rate for this simulation. Table I shows average timings over 2000 time steps (about the length it took the particles to fall, make their way around the obstacle and settle onto the floor). Figure 9 shows the particles falling off the spout at timestep 2800, Figure 10, Appendix shows the same system rendered using an implicit surface.

4.2 Drop Tests

The full SPH tests which were run used data sets ranging form 62 to 1054 particles. All of the optional equations were included, but gravity was turned off. Particles were initialized in a configuration similar to the "drop" tests which Monaghan used in testing the SPH adaptation for incompressible flow (Monaghan, 1994). The initial particle formation was spherical, with initial velocities which were linear in the coordinates (i.e. the initial x velocity is a constant multiple of the initial x coordinate). No surfaces were calculated and there were no obstacles to contend with. The systems were run for 100, 500 and 1000 time steps, on 1, 4, and 8 processors. Unfortunately the serial XSPH loop dominated the timing for all data sets (see Table II), and so the 256 particle data set was also run on the 12 processor Onyx for 500 time steps without the serial XSPH loop. Figure 11, Appendix, shows a timing comparison between the 1, 4, 8 and 12 processor runs. It runs about 4.5 times faster on 12 processors than with 1 processor. Figure 12, Appendix, shows a comparison between the four different data set sizes running on 8 processors (including the XSPH calculation).

Figures 13 and 14, Appendix, show the density and the pressure for 256 particles over 1000 time steps. Initially they oscillate widely about zero, but gradually tend toward zero. This behavior is indicative of a fluid settling into equilibrium (the "molecules" are finding their natural inter molecular distance). Compare these plots against the average acceleration shown in Figure 15, Appendix. As the system settles down the acceleration tends towards zero.

The viscous contribution was found to be quite high at times, ranging from 1% to 20%. Fortunately the computation is not significant relative to the XSPH and rates of change loops, therefore its inclusion causes no performance bottleneck.

The average XSPH contribution to the velocity was found to be less than 0.1%. This is no surprise since this equation was meant to handle high speed flow situations, however it did not prevent inter-particle penetration with or without viscosity. In these simulations particles often intermingle, which is not typical of fluid elements. Initially the reason for this behavior was unclear. Subsequent testing revealed that it is an effect of the gradient of the kernel, preventable by lowering the smoothing length. The kernel gradient approaches a maximum as two particles move together, and decreases towards 0. If particle are close enough together to be "inside" this maximum they will not repel each other as they should. When the smoothing length is set greater than the initial particle separation many particles start out inside that maximum, resulting in unnatural clustering. Figure 16, Appendix, shows the gradient of the kernel and the associated smoothing length. Also shown are two inter-particle separations, one inside the maximum and one outside. By lowering the smoothing length, or by initializing the particle with a larger initial separation, particles will be far enough apart that their gradients will be above the maximum, resulting in proper particle repulsion. This will, however, reduce the size of the time step.

Figure 17, Appendix, shows the initial drop configuration for 256 particles, Figure 18, Appendix shows the drop test at time step 1000.



TABLE I. AVERAGE UPDATE TIMES FOR INTERACTIVE DATASETS.
Data set


SPH Update 
(No surfaces) 
(secs)


SPH Update 
(Surfaces on) 
(secs)


Surface Update 
(secs)


Average 
Number of 
Polygons
36 Particles 0.0078 0.0091 0.1321 37.8
156 Particles 0.0856 0.1048 0.4049 366.8


TABLE II. AVERAGE PROPORTION OF UPDATE TIME SPENT IN DOMINANT LOOPS
Data set 
Update Time
(secs)
Rate of Change 
Loop
XSPH Loop
62 Particles 0.0466 24.4% 69.4%
153 Particles 0.3493 46.4% 52.4%
256 Particles 0.6431 24.6% 74.7%
512 Particles 2.4067 24.4% 75.3%
1054 Particles 8.0447 29.8% 69.9%




Top
Chapter 5: Conclusion and Future Work