The goal of this project is to implement the PIC-FLIP fluid simulation from the
paper Animating Sand as a Fluid by Yongning Zhu and Robert Bridson. This is a final project for the Computation Method for Physical Systems course at Dartmouth.

This is a group project with a group size of 2. I worked on coding marker particles, implementing PIC/FLIP algorithm, figuring out how to enforce boundary conditions and adapting the cell-centered functions to work with MAC grid.

Our group also tried comparing the results of using PIC, FLIP and combined PIC/FLIP. From the images below, we can see that the PIC method has a subdued wave, while the FLIP method shows many fluid particles breaking apart from the main fluid body. This demonstrates that PIC tends to dampen fluid due to the loss in velocity during interpolation. On the other hand, FLIP can preserve the lost energy from the PIC method, but is often noisy and can become unstable.

Comparisons between PIC, FLIP, and PIC/FLIP results at 5 seconds into the start of the simulation with the same start conditions.

Our biggest challenge in the project was to figure out how to enforce boundary conditions on cell-centered grids in the projection step. We found going through Chapter 5 of Fluid Simulation for Computer Graphics book really helpful to us. It helped us understand the how the boundary conditions work mathematically. After a lot of trial and error we found that adapting the cell-centered velocity field to the face-centered velocity field by interpolation worked the best, since most of the equations makes more sense with face-centered grids.

If you want to learn more about how to simulate fluid using PIC/FLIP, check out our course report here.