Particle-based fluid simulation for interactive applications

Download Report

Transcript Particle-based fluid simulation for interactive applications

Particle-based fluid simulation
for interactive applications
Matthias Müller
David Charypar
Markus Gross
9557501 陳岳澤
Outline
• Introduction
• Navier-Stokes Equation
• SPH (Smoothed Particle Hydrodynamics )
• Smooth Kernel
• Marching Cubes
• Result
Introduction
• Navier-Stokes Equation describe the
motion of fluid substances such as liquids
and gases
• Use Smoothed Particle Hydrodynamics
(SPH) to simulate fluids with free surfaces.
• Interactive simulation (about 5 fps).
Navier-Stokes Equation

Conservation of momentum equation

Three components:
-1
– Pressure term
– External force term
– Viscosity term
v: velocity,
g: external force,
 : density,

p: pressure,
: viscosity coefficient
Navier-Stokes Equation
-2
• The acceleration ai of particle i is
vi
fi
 ai 
t
i (fi is body force)
• Using ai , we can get velocity and position
of particle i
SPH
-1
• Originally developed for astrophysical
problems (1977).
• Interpolation method for particles.
• Properties that are defined at discrete
particles can be evaluated anywhere in
space.
• Uses smoothing kernels to distribute
quantities.
SPH
-2
• Smoothing of attribute A
mj: mass
j : density
Aj: quantity to be interpolated
W: smoothing kernel
h
Particle density
• Smoothing of attribute A
• Particle density
j
 s r    m j W r  rj , h   m jW r  rj , h
j
j
j
Pressure Term
• Navier-Stokes Equation
• Pressure Term
Viscosity term
• Navier-Stokes Equation
• Viscosity Term
External force term
• Other external forces are directly
applied to the particles.
• Collisions: In case of collision the
normal component of the velocity is
flipped.
Smoothing Kernel
-1
• Has an impact on the stability and
speed of the simulation.
– ex: Avoid square-roots for distance
computation.
• Sample smoothing kernel:
Smoothing Kernel




all points inside a radius
of ‘h’ are considered for
“smoothing”.
Thick line: the kernel
Thin line: the gradient
of kernel
Dashed line: the
laplacian of kernel
-2
Smoothing Kernel
-3
h
• For n particles n2 potential interactions!
• To reduce to linear complexity O(n2)
define interaction cutoff distance h
Smoothing Kernel
-4
h
h
• Fill particles into grid with spacing h
• Only search potential neighbors in
adjacent cells
Marching Cubes
• To visualize the free surface
-1
Marching Cubes
-2
Result

Interactive Simulation (5fps)
2200 particle
Point Splatting
Marching Cubs