Skip to content
/ SPH Public

This is a header-only implementation of the Smoothed Particle Hydrodynamics method.

License

Notifications You must be signed in to change notification settings

yuan-feng/SPH

Repository files navigation

A lightweight Smoothed Particle Hydrodynamics

This is a header-only implementation of the Smoothed Particle Hydrodynamics. Tested with valgrind, no memory leak.

Dependencies

On Ubuntu 16.04, install GLUT and OpenGL.

sudo apt install -y freeglut3-dev
sudo apt install -y mesa-utils

Tested by clang++ version 3.8.0 with C++14.

Running the demo

make 
./main
  • Keyboard 'a' - Start animation.
  • Keyboard space - Next Frame.
  • Keyboard '1' - Dam break.
  • Keyboard '2' - Water Drop.
  • Keyboard '3' - Faucet.
  • Keyboard 'g' - Switch Grid Visibility.

Sample solutions

  • Result: Faucet

Faucet

  • Result: Dam Break

Dam Break

  • Result: Water Drop

Water Drop

Reference

  • Müller, Matthias, David Charypar, and Markus Gross. "Particle-based fluid simulation for interactive applications." In Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on Computer animation, pp. 154-159. Eurographics Association, 2003.

About

This is a header-only implementation of the Smoothed Particle Hydrodynamics method.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published