Physical Simulation
Final Project
The goal of this pair-programming final project for CS 384P: Physical Simulation was to implement 2D and 3D Smoothed Particle Hydrodynamics (SPH)— a method of modelling the behavior of incompressible fluids using the Navier-Stokes equations— in Unity.
Goals
The goals of this project are to accurately simulate incompressible fluid motion and behavior using the SPH method in both 2D and 3D and to allow a user to interact with the fluid with both mouse input as well as deforming the fluid’s container.
Implementation
Our implementation relies on iteratively solving for the forces acting on each particle— density, pressure, and viscosity. We also enforce constraints on the velocity of the particles as well as a boundary constraint to ensure particles remain in the container.
Both the 2D and 3D simulations utilize the same techniques described in the project write up.













