Multi GPU, Interactive 3D Simulator for the Lattice Boltzmann - - PowerPoint PPT Presentation

multi gpu interactive 3d simulator for the lattice
SMART_READER_LITE
LIVE PREVIEW

Multi GPU, Interactive 3D Simulator for the Lattice Boltzmann - - PowerPoint PPT Presentation

Multi GPU, Interactive 3D Simulator for the Lattice Boltzmann Immersed Boundary Method Bob Zigon Beckman Coulter Indianapolis, Indiana April 7, 2016 1 / 20 Outline Lattice Boltzmann Method Immersed Boundary Method OpenMP & GPU program


slide-1
SLIDE 1

Multi GPU, Interactive 3D Simulator for the Lattice Boltzmann Immersed Boundary Method

Bob Zigon Beckman Coulter Indianapolis, Indiana April 7, 2016

1 / 20

slide-2
SLIDE 2

Outline

Lattice Boltzmann Method Immersed Boundary Method OpenMP & GPU program structure Visualization with Modern OpenGL Results Future Work

2 / 20

slide-3
SLIDE 3

LB Method

Lattice Boltzmann (LB) algorithm is a way to solve the Navier Stokes equations by considering the behavior of collections of fluid particles instead of individual particles.

3 / 20

slide-4
SLIDE 4

LB Method

Lattice Boltzmann (LB) algorithm is a way to solve the Navier Stokes equations by considering the behavior of collections of fluid particles instead of individual particles. fi(x + ei, t + 1) = fi(x, t)

  • Streaming

(1) fi(x, t) - defines the particle distribution in 1 of N discrete directions. ei - the direction vectors that enable streaming to adjacent cells.

3 / 20

slide-5
SLIDE 5

e1 e2 e5 e6 e3 e7 e4 e8 e0

Figure 1: 9 direction vectors e0 through e8 for 2D domain Figure 2: 19 direction vectors for 3D domain

4 / 20

slide-6
SLIDE 6

Collision term

To complete the LB model, a term is added that describes the inevitable collision that

  • ccurs as particles move from cell to cell.

fi(x + ei, t + 1) = fi(x, t) − [fi(x, t) − f eq

i

(x, t)] τ

  • Collision

(2) f eq

i

(x, t) - describes the distribution at equilibrium. τ - describes the rate at which the collision term goes to zero.

5 / 20

slide-7
SLIDE 7

Collision term

To complete the LB model, a term is added that describes the inevitable collision that

  • ccurs as particles move from cell to cell.

fi(x + ei, t + 1) = fi(x, t) − [fi(x, t) − f eq

i

(x, t)] τ

  • Collision

(2) f eq

i

(x, t) - describes the distribution at equilibrium. τ - describes the rate at which the collision term goes to zero. Simple, elegant and embarrassingly parallel.

5 / 20

slide-8
SLIDE 8

IB Method

Immersed Boundary (IB) method is a way of simulating the interaction of a flexible structure and a fluid. Examples

1 Fish swimming in the ocean 2 Red blood cells moving through arteries. 6 / 20

slide-9
SLIDE 9

IB Method

Immersed Boundary (IB) method is a way of simulating the interaction of a flexible structure and a fluid. Examples

1 Fish swimming in the ocean 2 Red blood cells moving through arteries.

fi(x + ei, t + 1) = fi(x, t) − [fi(x, t) − f eq

i

(x, t)] τ − wi · g(x, t)

  • IB term

(3) g(x, t) - describes the force of the boundary on the fluid wi - direction dependent weights

6 / 20

slide-10
SLIDE 10

IB Method

Immersed Boundary (IB) method is a way of simulating the interaction of a flexible structure and a fluid. Examples

1 Fish swimming in the ocean 2 Red blood cells moving through arteries.

fi(x + ei, t + 1) = fi(x, t) − [fi(x, t) − f eq

i

(x, t)] τ − wi · g(x, t)

  • IB term

(3) g(x, t) - describes the force of the boundary on the fluid wi - direction dependent weights Simple, elegant and embarrassingly parallel.

6 / 20

slide-11
SLIDE 11

The Boundary Fluid Forces

Immersed boundaries are objects represented by collections of fibers. Fibers are composed of points and segments. p1 p2 p3 p4 s1 s2 s3

Figure 3: A fiber, its points p1,p2,p3,p4, and segments s1,s2,s3

.

7 / 20

slide-12
SLIDE 12

Stretch and Bend

Segments can be stretched like a spring. We model the force using S(∆x) = −Ks∆x. (4)

8 / 20

slide-13
SLIDE 13

Stretch and Bend

Segments can be stretched like a spring. We model the force using S(∆x) = −Ks∆x. (4) Segments can be bent. We model the force using 1 / curvature of the parameterized fiber path p(x) B(x) = Kb |p′′(x)| |1 + p′2(x)| (5) and simplify to B(x) = Kb|p′′(x)| (6) because we assume that p′(x) ≈ 0.

8 / 20

slide-14
SLIDE 14

Total Boundary Force

Now, the total boundary force, g(fiber, t), is just g(fiber, t) =

K

  • j=1

S(fiberj) + B(fiberj) (7) with S(fiberj) =

N

  • i=1

S(segmentj,i) (8) and B(fiberj) =

N

  • i=1

B(segmentj,i). (9) Simple, elegant and embarrassingly parallel.

9 / 20

slide-15
SLIDE 15

Demo video

Figure 4: Cartoon example of the demo video

10 / 20

slide-16
SLIDE 16

Demo video

Video demo of the application running.

11 / 20

slide-17
SLIDE 17

OpenMP and GPU Program Structure

While not done { Compute field at time Tn on Tesla K40c1 Visualize field at time Tn on Quadro K50002 n = n + 1 }

1CUDA 7.5, Driver 355.85, W7/64, Visual Studio 2013 2OpenGL 4.2, Vertex and Fragment Shaders 12 / 20

slide-18
SLIDE 18

Program Structure more detail

While not done { Compute field at time Tn

  • 1. Compute IB forces
  • 2. LB Stream and Collide
  • 3. Compute boundary conditions
  • 4. Update fluid density, vel
  • 5. Move the fibers
  • 6. Compute inlet & outlet boundary conditions

Visualize field at time Tn n = n + 1 }

13 / 20

slide-19
SLIDE 19

Program Structure with durations3

While not done { Compute f i e l d at time Tn 1. Compute IB f o r c e s 2%

  • 2. LB Stream and

Co l lide 60% 3. Compute boundary conditions 1% 4. Update f l u i d density & v e l o c i t y 15%

  • 5. Move the

f i b e r s 1% 6. Compute i n l e t & o u t l e t bc ’ s 10% V i s u a l i z e f i e l d at time Tn 5% n = n + 1 6% }

3Domain size 2563 14 / 20

slide-20
SLIDE 20

Visualization with Modern OpenGL

Two api’s – Legacy and Modern Legacy

1 Easy to use 2 Lots of examples 3 Not well suited to current GPU’s 15 / 20

slide-21
SLIDE 21

Visualization with Modern OpenGL

Two api’s – Legacy and Modern Legacy

1 Easy to use 2 Lots of examples 3 Not well suited to current GPU’s

Modern

1 Difficult to use 2 Poor examples 3 Extremely well suited to current GPU’s 4 Our custom shaders 10x faster than Legacy 15 / 20

slide-22
SLIDE 22

Results

128 160 192 256 10−1 100 101 Domain Length Time in seconds 1-CPU4 8-CPU Tesla K40c

Figure 5: Execution times for 104 fibers and 103 points/fiber

4Lenovo D30, 8 E5-2609@2.4GHz, 32GB RAM, W7/64 16 / 20

slide-23
SLIDE 23

Future Work-Static complex internal boundary

MS Paint example... ...with 2D simulation.

17 / 20

slide-24
SLIDE 24

Future Work-Red Blood Cells

Insert lots of Red Blood Cells with lots of fibers... ...into this 3D simulation for interactive manipulation.

18 / 20

slide-25
SLIDE 25

Acknowledgements Professor Luoding Zhu, Indiana University-Purdue University of Indianapolis

19 / 20

slide-26
SLIDE 26

robert.zigon@beckman.com

20 / 20