Handling complex geometries in the massively parallel lattice Boltzmann framework walberla

Handling complex geometries in the  massively parallel lattice Boltzmann  framework waLBerla M.C. Mihoubi , Ulrich Rüde  Chair for System Simulation  ...
3 downloads 3 Views 3MB Size
Handling complex geometries in the  massively parallel lattice Boltzmann  framework waLBerla M.C. Mihoubi , Ulrich Rüde  Chair for System Simulation  University of Erlangen, Germany Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Outline

• Motivation • Geometric handling • Parallel implementation • Results • Current work

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Motivation

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Motivation

Aerodynamic

Medical applications  

• Extend the framework by complex, 3D triangle­based geometries • Compute more accurate fluid­dynamic forces and moments (second order  boundary conditions) Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Advantages of using triangle meshes • TM are suitable to describe complex­curved geometries, and widely  used in computer graphics and geometric modelling. • Triangle meshes “TM” can be generated or modified by CAD­ software. • Scale, and resize efficiency . • For medical applications, using TM instead of voxel­based format to  describe the information present in the images, can speed the data  processing time (dynamic simulation.) Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Lattice Boltzmann Method [4]  The Boltzmann equation is an evolution equation for a single particle probability  distribution function.

∂t f x ,t v∂ x f x ,t  F ∂v f  x ,t = ,

The Lattice Boltzmann equation (i.e. discretized in D3Q19 model: i=0, ... 19):

f i x Δt ci ,tΔt − f i x ,t  F i=

Δt  f i x ,t − f eq i  ρ x,t ,u x ,t  τ

Which can be solved in three main steps: Setup the boundary conditions Repeat (many times) Stream step

f ¿i x ,tΔt = f i x Δt ei ,t 

Collide step

f i x ,t Δt=1−ω  f i x ,tΔt ωf i

[

3 2 9 f eq =ω ρ3e ⋅u− u  ei⋅u2 i i i 2 2

¿

]

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

eq

D3Q19 model Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Overview of stream and collide steps in LBM [6] 

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Different types of wall­BC in LBM [6] 

Bounce­back scheme (rigid wall) Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Elastic­Collision scheme (movable wall) Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Second order BC representation [Bouzidi 7]  Example:

j i

Representation 

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Second order BC representation (suit) t

t +1

Formula [Bouzidi and all 7]: e i uw t1 t t f IA = 1−2q . f iF 2. q. f iA−6 2 f t1 IA =

c ei uw

 2q−1  t 1 . f iA  . f tiF −3 2 2q 2q qc

0.q0.5 0. 5≤q≤1.

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Geometry handling

It is based on three major steps: 4. Preprocessing the input data 5. Mapping of the surface 6. Fill the inner part of the volume

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

1. Preprocessing the input data

Format:

   solid Hammer_triang facet normal n1 n2 n3     outer loop       vertex v11 v12 v13       vertex v21 v22 v23       vertex v31 v32 v33              endloop   endfacet … … facet normal n1 n2 n3     outer loop       vertex v11 v12 v13       vertex v21 v22 v23       vertex v31 v32 v33              endloop   endfacet  end solid 

T1

Using 3 steps : •Read the data (using only processor,  and using MPI I/O) TN

•Check/repair, scale ... •Distributed data using bcast

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Requirements: a) Closed geometries (no  holes)

d) No gaps or overlaps (repair by connecting  nearby facets )

b) Facet orientation (normal directions )

c) Vertex­to­vertex rule

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

f) No degenerate triangles

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

2. Mapping of the surface 

Note:

Example of 3D cube

The state of any cells is defined by using different flags Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Triangle bounding box technique (TBB)

Triangulated surface

Triangles­bounding­box surrounding each  triangle

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

triangle bounding box 

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Mapping of the surface (setup the BC) Ray

Example: if the Ray (in x direction) intersect with triangle

x

 a) the current cell (x,y,z)is outside the object: •      PUSH_BACK (CELL(x,y,z)) to Near­Obstacles­list

qw

•      Set the flag (x+1,y,z) to Obstacle­flag 

d Cell (x,y,z) Cell (x+1,y,z)

•      q = d 

  b) the current cell (x,y,z) is inside the object:

qw

•      PUSH_BACK (CELL(x­1,y,z)) to Near­Obstacles­list

D Cell(x­1,y,z) Cell (x,y,z)

•      Set  the flag (x,y,z) to Obstacle­flag  •      q = 1­d

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Advantage of using Möller­algorithm:

• Reducing memory storage costs • Reduce number of intersections tests (18 to  9 tests) • All necessary computations for the  intersections test are delayed until it is  known that they are required, which can  speedup the intersection test

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Inside­outside tests triangle meshes

Scalar (C,n)  ouside

Scalar (C,n) >0 ­> inside

n C

Scalar (C,n)  outside

n C

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

n C

n

Scalar (C,n) >0 ­> inside

C

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Parallel implementation details Process boundary

Allocated and  calculated patches  (fluid region)

Empty patch

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

The algorithm for detecting and set up the BC  Find the triangle bounding box “TBB”. Scan through all voxels V(x,y,z) in TBB       If Intersect               Only if (patch is allocated with the current running processor)          If  V(x,y,z) inside the TBB               Change the flag to inside­flag                  Assign q­value based on distance/direction of the intersection                Else V(x,y,z) Outside the TBB          Change the flag to Border­flag  Assign q­value based on distance/direction of the intersection                 Else     Move to next voxel Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

3. FloodFill Algorithm  object border  a start node

Illustration of recursive flood fill  algorithm with 4 directions

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

2D example with (2*2) processors  Problem

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

•Solutions     a) Manually    b) Processors­boundaries 

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Numerical results:

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

3d flow past a sphere asymmetrically placed in a channel  22 d

Use STL GE d=10

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

3d flow past a sphere asymmetrically placed in a channe (d = 10)

after 100 time step

after 700 time step

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Simulation of blood flow in aneurysm

dx =0.12 mm > 250,000 triangles

Simulation using real patient geometry (data  from author of [5])

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Simulation of fluid flow around car

Domain ()

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Video

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Current work  • Moving objects due to the fluid flow • Deformable objects (elastic­collision scheme)

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

References  [1] waLBarla homepage“ http://www10.informatik.uni­erlangen.de/Research/Projects/walberla/walberla.shtml” [2] T. Möller and B. Trumbore. “Fast, minimum storage ray­triangle intersection”. Journal of  graphics tools, 2(1):21–28, 1997. [3]  Paraview homepage “www.paraview.org/” [4]  S. Succi, “The Lattice Boltzmann equation for fluid dynamics and beyond”. Oxford University  Press, 2001 [5]  J. Götz “Numerical simulation of blood flow in aneurysms using the lattice Boltzmann Method”.  Master thesis, University of Erlangen­Nuremberg, Computer Science 10, Systemsimulation,  2005 [6]  N. Thürey, "Physically based Animation of Free Surface Flows with the Lattice Boltzmann  Method“. Ph.D thesis, University of Erlangen­Nuremberg, Computer Science 10,  Systemsimulation, 2007 [7] M. Bouzidi, and All. “Momentum transfer of a Boltzmann­lattice fluid with boundaries" Phys.  Fluids, 13(11):3452­3459", 2001.

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Thank you for your attention 

Parallel Numerics 09/Smolenice,Slovakia/October 27­29

Handling Complex Geometries in the massively  parallel lattice Boltzmann framework waLBerla

Suggest Documents