Bindel, Fall 2011 Applications of Parallel Computers (CS 5220)
1 The SPH equations
Smoothed particle hydrodynamics (SPH) is a particle-based method for simulat-
ing the behavior of fluids. Each computational particle carries along information
about the fluid in a little region, such as the velocity and density; and during the
course of the simulation, these particles interact with each other in a way that
models the dynamics of a fluid. In this project, we will tune a simple 2D version
of an SPH method described by M¨uller et al for use in interactive graphics [1].
Our simulation basically solves a system of ordinary differential equations
1
for a collection of particles with equal masses m and interaction radii h. Each
particle i has a position r
i
, a velocity v
i
, and a density ρ
i
. Particle i interacts
with the set N
i
of particles within radius h of i. The density is computed at
each step by
ρ
i
=
4m
πh
8
X
j∈N
i
(h
2
− r
2
)
3
.
The acceleration is computed by the rule
a
i
=
1
ρ
i
X
j∈N
i
f
interact
ij
+ g,
where
f
interact
ij
=
m
j
πh
4
ρ
j
(1 − q
ij
)
15k(ρ
i
+ ρ
j
− 2ρ
0
)
(1 − q
ij
)
q
ij
r
ij
− 40µv
ij
,
where r
ij
= r
i
− r
j
, v
ij
= v
i
− v
j
, and q
ij
= kr
ij
k/h. The parameters in these
expressions are
ρ
0
= reference mass density
k = bulk modulus
µ = viscosity
g = gravitational vector
By default, we choose most of these parameters to be appropriate to a liquid
like water. The exception is the bulk modulus, which is chosen so that the
computational speed of sound
c
s
=
s
k
ρ
0
is large relative to the typical velocities we expect to see in the simulation, but
not too large. Choosing k to be very large (e.g. on the scale of the bulk modulus
for water) severely limits the time step size needed for stable simulation.
1
We describe the derivation of the 2D equations in a separate document. It may interest
those of you who care about fluid dynamics, but it is not critical to understand the derivation
in order to do the assignment.