I have implemented a SPH model for a ﬂuid. The supported internal and external forces are pressure,
viscosity, surface tension and gravity.
The simulator lays out a regular grid with cell size equal to one h ontop of the simulated domain, and
after each time step, the particles are positioned in a hash table which has one bucket for each cell. This
ensures that a particle can quickly locate the neighbors with which it has a possibel interaction, since all
particles have the same smoothing length. Gravity knows no boundaries and is currently not supported for
particle-particle, but this will be added later by using a tree structure where the particle-particle attractions
are calculated on a coarser scale the farther the groups of particles are apart. The Barnes-Hutt method is
the one generally used for this.
It is written in C# and the SPH code is written from the bottom.
A number of details and images are given in the (short) report.
This is an example of a breaking dam experiment using a with a fluid with a somewhat low viscosity.