Meatballs - Smoothed Particle Hydrodynamic Overview Simulator and - - PowerPoint PPT Presentation

meatballs smoothed particle hydrodynamic
SMART_READER_LITE
LIVE PREVIEW

Meatballs - Smoothed Particle Hydrodynamic Overview Simulator and - - PowerPoint PPT Presentation

Meatballs Jennine Nash and Thomas Klein Meatballs - Smoothed Particle Hydrodynamic Overview Simulator and Renderer Goals SPH Solver Equations Why CUDA? Jennine Nash and Thomas Klein Results References Carnegie Mellon University


slide-1
SLIDE 1

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Meatballs - Smoothed Particle Hydrodynamic Simulator and Renderer

Jennine Nash and Thomas Klein

Carnegie Mellon University jmnash@andrew.cmu.edu, twklein@andrew.cmu.edu

May 9, 2014

slide-2
SLIDE 2

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Overview

1 Overview 2 Goals 3 SPH Solver Equations 4 Why CUDA? 5 Results 6 References

slide-3
SLIDE 3

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

SPH Overview

SPH is used to model liquid flows Too computationally intensive to simulate billions of particles or a truly continuous flow SPH creates discrete particles which function as moving bodies of fluid Kernel function updates a particles’ properties based on the values of other nearby particles

slide-4
SLIDE 4

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Goal of the Project

Realistic-looking liquid particle simulator using a smooth-particle hydrodynamics solver Implemented on both the CPU and GPU (with CUDA) Compare implementation runtimes to each other to determine the benefit of using CUDA

slide-5
SLIDE 5

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Properties of Each Particle j

Position rj Velocity vj Pressure Pj Density ρj Mass mj Each property (with the exception of mass) is updated according to the values of the properties of the other particles

slide-6
SLIDE 6

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Kernel Function Limits Which Particles Affect Each Other

For two particles i and j, x = |ri − rj| h is a smoothing constant adjusted to determine the distance over which particles have effects Let x = r

h

W (r, h) =

1 πh3

     1 − 3

2x2 + 3 4x3

0 ≤ x ≤ 1

1 4(2 − x)3

1 ≤ x ≤ 2 x ≥ 2 [Cossins, 2010]

slide-7
SLIDE 7

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Kernel Function Limits Which Particles Affect Each Other

∇W (r, h) = ∂

∂r W (r, h)

=

1 πh4

    

9 4x2 − 3x

0 ≤ x ≤ 1 −3

4(2 − x)2

1 ≤ x ≤ 2 x ≥ 2 [Cossins, 2010] ∇jWij =

∂ ∂rj W (|ri − rj|, h) = ∇W (r, h)∂|ri−rj| ∂rj

= ∇W (r, h)1

r (ri − rj)

∇iWij = −∇jWij ∇jWji = −∇jWij

slide-8
SLIDE 8

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Property Update Functions are Performed at Each Time Step

We defined a small global time step ∆t All values on the right-hand sides of the equations were calculated during the previous time step Position: rj := rj + ∆tvj Velocity: vj := vj − ∆t

  • i

mi

  • Pj

ρ2

j + Pi

ρ2

i

  • ∇jWji + g
  • where g is the gravity vector [Cossins, 2010]

Density: ρj :=

i

miWji (density effectively changes due to particles being close together) [Schechter, 2012] Pressure: Pj := 2000 ρj

ρ0

7 − 1

  • where ρ0 is density

based on the mass and volume [Schechter, 2012]

slide-9
SLIDE 9

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

CUDA Best Utilizes Parallelism in Algorithm

Works well with CUDA warps because unlikely to diverge Each particle calls same functions, and kernel likely to be skipped over in all 32 threads in the warp Every particle is independent because computations only depend on the time step before

slide-10
SLIDE 10

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Animation of our Code’s Output

VIDEOS

slide-11
SLIDE 11

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Graph: 4096 Particles on CPU vs. GPU

slide-12
SLIDE 12

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

Graph: 256 Particles on CPU vs. GPU

slide-13
SLIDE 13

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

References

Peter J. Cossins (2010) Smoothed Particle Hydrodynamics http://arxiv.org/abs/1007.1245v2 Hagit Schechter and Robert Bridson (2012) Ghost SPH for Animating Water ACM Transactions on Graphics 31(4), article 61 http://dl.acm.org/citation.cfm?doid=2185520.2185557

slide-14
SLIDE 14

Meatballs Jennine Nash and Thomas Klein Overview Goals SPH Solver Equations Why CUDA? Results References

The End