SPH Fluid Simulation from First Principles (Applet)
Controls: After applet loads, click inside to activate controls. A smooth particle hydrodynamics (SPH) simulation coded in java. The following papers were used for reference:

Particle-based Fluid Simulation for Interactive Applications
by Muller et al.

Particle-based Viscoelastic Fluid Simulation
by Clavet et al.

I chose Clavet et al.'s smoothing kernels and viscoelasticity algorithms for my implementation. I also used hashed particle locations to optimize nearest neighbor searches, as advised by both papers. The visualization uses simple OpenGL point rendering of particles with line lattices for viscoelastic "springs" between particles. Density is represented with a blue-to-cyan color gradient.