slides - iwcse 2013

Download Report

Transcript slides - iwcse 2013

Session: Supercomputer/GPU and Algorithms (GPU-2)

A GPU Accelerated Explicit Finite-volume Euler Equation Solver with Ghost-cell Approach

F.-A. Kuo 1,2 , M.R. Smith 3 , and J.-S. Wu 1*

1 Department of Mechanical Engineering National Chiao Tung University Hsinchu, Taiwan 2 National Center for High-Performance Computing, NARL Hsinchu, Taiwan 3 Department of Mechanical Engineering National Cheng Kung University Tainan, Taiwan *E-mail: [email protected]

2013 IWCSE Taipei, Taiwan October 14-17, 2013 1 1

Outline

Background & Motivation

Objectives

Split HLL (SHLL) Scheme

Cubic-Spline Immersed Boundary Method (IBM)

Results & Discussion

Parallel Performance

Demonstrations

Conclusion and Future work

Background & Motivation

Parallel CFD

Computational fluid dynamics ( CFD ) has played an important role in accelerating the progress of aerospace/space and other technologies.

For several challenging 3D flow problems, parallel computing of CFD time.

bceomes necessary to greatly shorten the very lengthy computational

Parallel computing of CFD has evolved from SIMD type vectorized processing to SPMD type distributed-memory processing for the past 2 decades, mainly because of the much lower cost for H/W of the latter and easier programming.

SIMD vs. SPMD

SIMD (Single instruction, multiple data), which is a class of parallel computers, performs the same operation on multiple data points at the instruction level simultaneously.

SSE/AVX instructions in CPU and GPU computation, e.g., CUDA .

SPMD (Single program, multiple data) is a higher level abstraction where programs are run across multiple processors and operate on different subsets of the data.

Message passing programming on distributed memory computer architectures, e.g., MPI .

5

MPI vs. CUDA

Most well-known parallel CFD codes adopt SPMD parallelism using MPI .

e.g., Fluent (Ansys), CFL3D (NASA), to name a few.

Recently, because of the potentially very high C/P ratio by using graphics processor units (GPUs), parallelization of CFD code using GPUs has become an active research area based on CUDA , developed by Nvidia.

However, redesign of the numerical scheme may be necessary to take full advantage of the GPU architecture.

Split HLL Scheme on GPUs

Split Harten-Lax-van Leer (SHLL) scheme (Kuo

  

et al ., 2011) a highly local numerical scheme, modified from the original HLL scheme Cartesian grid

~

60 times of speedup (Nvidia C1060 GPU vs. Intel X5472 Xeon CPU) with explicit implementation

However, it is difficult to treat objects with complex geometry accurately, especially for high-speed gas flow. One example is given in the next page.

Thus, how to take advantage of easy implementation of Cartesian grid on GPUs , while improving the capability of treating objects with complex geometry extending the applicability of SHLL scheme in CFD simulations.

becomes important in further 7

Staircase-like vs. IBM

Staircase-like Shock direction IBM

Spurious waves staircase-like solid surface for high-speed gas flows. are often generated using

Immersed Boundary Method

Immersed boundary method ( IBM ) (Peskin, 1972; Mittal & Iaccarino, 2005 )

easy treatment of objects with complex geometry on a

 

Cartesian grid grid computation near the objects become automatic or very easy easy treatment of moving objects domain w/o remeshing in computational

Major idea of IBM is simply to enforce the B.C.’s at computational grid points thru interpolation among fluid grid and B.C.’s at solid boundaries.

Stencil of IBM operation is local in general.

Enabling an efficient use of original numerical scheme , e.g., SHLL

Easy parallel implementation

Objectives

Goals

To develop and validate an

explicit cell centered finite-volume

Euler equation, based on SHLL scheme, on a Cartesian grid with solver for solving

cubic-spline IBM on multiple GPUs

To study the

parallel performance

code on single and multiple GPUs of the

To demonstrate the

capability

of the code with several applications

Split HLL Scheme

12

SHLL Scheme - 1

i-1 i i+1 SIMD model for 2D flux computation +Flux - Flux

F

F L

  1  

S S S L U L R

 

L

 

F R

 

S R S L

S R U

 1  

R F

F L

   1 

S L U S S L A R

 

L

F R

   1 

S R U S S R A L

 

R F

 

F L D

L

 1 2 

DU L a L

 1 2  2

L

 

F

  

F R D

R

 1 2 

DU R a R

 1 2  2

R

  Original HLL Introduce local approximations Final form (SHLL) is a highly local scheme 

New S R & S L term are approximated w/o involving the neighbor-cell data.

A highly local flux GPU!

computational scheme: great for

SHLL Scheme - 2

i-1 i i+1 SIMD model for 2D flux computation   

Flux computation is perfect for GPU application.

Almost the same as the vector addition case.

> 60 times speedup possible using a single Tesla C1060 GPU device. Performance compares to single thread of a high-performance CPU (Intel Xeon X5472)

+Flux - Flux

F

 

F L D

L

 1 2 

DU L a L

 1 2 

L

2  

F

  

F R D

R

 1 2 

DU R a R

 1 2 

R

2   Final Form (SHLL)

Cubic-spline IBM

15

Two Critical Issues of IBM

How to approximate solid boundaries?

 

Local Cubic Spline for reconstructing solid boundaries w/ much fewer points Easier calculation of surface normal/tangent

How to apply IBM in a cell-centered FVM framework?

Ghost-cell approach

 

Obtain ghost cell properties by the interpolation of data among neighboring fluid cells Enforce BCs at solid boundaries to ghost cells through data mapping from image points

Cell Identification

1. Define a cubic-spline function for each segment of boundary data to best fit solid boundary geometry 2. Identify all the solid cells, fluid cells and ghost points 3. Locate image points corresponding to ghost cells Fluid cell Solid boundary curve Ghost cell Solid cell 17

Cubic-Spline Reconstruction

(Solid Boundary)

The cubic spline method provides the advantages including : 1. A high order curve fitting boundary 2. Find these ghost cells easily.

3. Calculate the normal vector which is normal to the body surface.

n T

n

n V

0 0 0 surface

n

BCs of Euler Eqns.

Approximated form

image

 

ghost V

 

V n

,ghost

V T image

 

V t

,ghost

T ghost

19 19

IBM Procedures

Interpolation Fluid cell Image point Solid cell Ghost point

Approximate the properties of the image points using

bi-linear interpolation

among neighboring fluid cells 20

SHLL/IBM Scheme on GPU

21

Nearly All-Device Computation

Start Initialize Flux calculation True Set GPU device ID and flowtime T > flowtime State calculation flowtime += dt False IBM CFL calculation

dt new

Device

dt new

Output the result Host

Results & Discussion

(Parallel Performance)

Parallel Performance - 1

Also named as “ Schardin’s problem ” L=1

Test Conditions – Moving shock w/ Mach 1.5

– Resolution: 2000x2000 cells – CFL max =0.2

– Physical time: 0.35 sec. for 9843 time steps using one GPU Moving shock x

0.2 @ t=0 H=1

Parallel Performance - 2

Resolution

2000x2000 cells

GPU cluster

 

GPU: Geforce GTX590 (2x 512 cores, 1.2 Ghz 3GB DDR5) CPU: Intel Xeon X5472

Overhead w/ IBM

3% only

Speedup

  

GPU/CPU: ~ 60x GPU/GPU: 1.9 @2 GPUs GPU/GPU: 3.6 @4 GPUs Sec.

600 500 400 300 200 100 0 Speedup 4 3,5 3 2,5 2 1,5 1 0,5 0 1 GPU 2 GPUs Compute time 4 GPUs Speedup

Results & Discussion

(Demonstrations)

26

Shock over a finite wedge - 1

w/o IBM

In the case of properties.

400x400 cells w/o IBM, the staircase solid boundary generates spurious waves, which destroys the accuracy of the surface

By comparison, the case w/ IBM shows much more improvement for the surface properties.

w/ IBM

Shock over a finite wedge - 2

Density contour comparison with IBM w/o IBM 28

t= 0.35 s 

All important physical phenomena are well captured by the solver with IBM without spurious wave generation.

28

Transonic Flow past a NACA Airfoil Staircase boundary w/o IBM pressure IBM result pressure In the left case, the spurious waves appear near the solid boundary, but in the right case, we modify the boundary by using the IBM.

29

Transonic Flow past a NACA Airfoil Distribution of pressure around the surface of the airfoil Upper surf.

Lower surf.

New approach method Ghost cell method, J. Liu et al., 2009 These 2 results are very closed, and the right result is made by Liu in 2009, and the left result is made by the cubic spline IBM. 30

Transonic Flow past a NACA Airfoil Top-side shock wave comparison New approach method Furmanek*, 2008 * Petr Furmánek, “Numerical Solution of Steady and Unsteady Compressible Flow”, Czech Technical University in Prague, 2008 31

Transonic Flow past a NACA Airfoil Bottom-side shock wave comparison New approach method Furmanek*, 2008 * Petr Furmánek, “Numerical Solution of Steady and Unsteady Compressible Flow”, Czech Technical University in Prague, 2008 32

Conclusion & Future Work

33

Summary

A cell-centered 2-D finite-volume solver for the inviscid Euler equation, which can easily treat objects with complex geometry on a Cartesian grid by using the cubic-spline IBM on multiple GPUs, is completed and validated

The addition of cubic-spline IBM only increase 3% of the computational time, which is negligible.

Speedup for GPU/CPU generally exceeds 60 times on a single GPU (Nvidia, Telsa C1060) as compared to that on a single thread of an Intel X5472 Xeon CPU.

Speedup for GPUs/GPU reaches 3.6 at 4 GPUs (GeForce) for a simulation w/ 2000x2000 cells.

34

Future Work

To modify the Cartesian grid to the adaptive mesh grid.

To simulate the moving boundary problem and real-life problems with this immersed boundary method

To change the SHLL solver to the true direction finite volume solver, likes QDS 35

Thanks for your patient and Questions ?