simulating complex surface flow by smoothed particle hydrodynamics & moving particle...

32
Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu [email protected] Shanghai Jiaotong University

Upload: baldric-hubbard

Post on 17-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Simulating complex surface flow by Smoothed Particle Hydrodynamics

& Moving Particle Semi-implicit methods

Benlong Wang Kai Gong Hua Liu

[email protected]

Shanghai Jiaotong University

Page 2: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Contents

• Introduction • SPH & MPS methods• Parallel strategy and approaches

– SPH:– MPS:

• Numerical results– 2D dam breaking– 2D wedge entry– 3D cavity flow– 3D dam breaking

Page 3: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Modeling free surface flows

• Multiphase flows:

MAC, VOF, LevelSet etc.

• ALE

• Meshless methods

& particle methods

SPH & MPS LBM

Page 4: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Kernel function

• Properties:– Narrow support

– decreases monotonously as increase

– h->0, Dirac delta function

r( ; )W r h

( '; ) 1W r r h dV

( ) ( ') ( '; )

( ') ( ' ; )

f r f r W r r h dV

f r W r r h dV

-3 -2 -1 0 1 2 3

0

h

dx

a b ab bb

f f W V

( )r

W

Page 5: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

expression of derivatives

'( ) '( ') ( '; )

( ') ( '; ) ( ') '( '; )

f r f r W r r h dV

f r W r r h nds f r W r r h dV

' 'a b ab bb

f f W V-3 -2 -1 0 1 2 3

0

hWW’

( ) ( )b bb

f x dV f x V

Integral Summation

Trapeze like quadrature formula

h

dx 1.3 ~ 1.5

3.0 2h 130+ (2D)

0

( ') '( '; ) ( ') '( ' ; )f r W r r h dV f r W r r h dV

Page 6: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Correction and Consistance——advanced topic …

' 'a b ab bb

f f W V

' ( ) 'a b a ab bb

f f f W V

-3 -2 -1 0 1 2 3

0 f const ' 0af

( ) ( )a a a a a a b b ab b a b ab b b b a ab bb b b

f f f f W V f W V f f W V

f ax by c

Page 7: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Lists of kernel function

Cubic spline 2h

Quartic spline 2.5h

Fifth order B-spline 3h

Truncated Gaussian

0 0.5 1 1.5 2 2.5 30

0.1

0.2

0.3

0.4

0.5

h

w

2 3

22

3 31 0 1

2 410 1

( ) (2 ) 1 27 4

0 2

s s s

W s s sh

s

2 2

2 2

2 2 22

2

exp exp1

( ) 3

exp2

sh h

W s hh

hh

Page 8: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Hydrodynamics governing equations

2

( )( )2 1( )a b a b a ab b

b a b a abb ba b ba b

p p r r W mm v v W

tr r

20

02

d

d

2 ( )( )( )

a aa

a

b a b a b a aba b a ab b

b ba b a b a b

v pg v

t

m v v r r Wg p p W m

r r

1 aa

a

vp

t

MPS: projection method: Pressure Poisson Equation

SPH: weakly compressible method: State Equation1

0

1aap

Ma < 0.1d

( )da

a a b a b a abb

v m v v Wt

d

da

a

xv

t

0av

Page 9: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Link-List neighbour search

back ground mesh (L X L)

L=2h, 3h, support distance

L

SPH: the most time consuming part ~90%

MPS: generally less than PPE solver

Page 10: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Boundary Condition

• Sym: ghost particles,

• Free surface, p0

Identify the surface particle: 95% const. density

0 p p

gx y

'v v 'n nv v

ba b ab

b b

mW

Page 11: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Large Scale Computation(a few millions particles)

share memory architecture(NEC SX8: 8 nodes, 128G RAM)(Dell T5400: 2 Quad cores Xeon 16G RAM)

• SPH– Particle lists partition, NOT domain partition

• MPS – parallel ICCG method

Page 12: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Black-box Parallel Sparse Matrix Solver

SPH MethodLagrangian Method

Large deformation

Continue changing domain

Complex domain structure

Why not Domain decomposition ?

So, Black-box solver

give me a matrix, I will solve it in parallel…

Page 13: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

PPE solver : ICCG method

• Precondition ILU(0)• Forward and backward substitutions• Inner products• Matrix-vector products• Vector updates

Parallel

Ax bSparse symmetric positive definite matrix

Direct solver or Iterative solver

Page 14: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Coloring• COLOR: Unit of independent sets.• Any two adjacent nodes have different colors. Elements

grouped in the same “color” are independent from each other, thus parallel/vector operation is possible.

• Many colors provide faster convergence, but shorter vector length.

Page 15: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Main Idea of the Coloring

Algebraic Multi-Color OrderingThe number of the colors has a lower boundary

the max bandwidth of the sparse matrix

Any two adjacent nodes have different colors

2hT. Iwashita & M. Shimasaki

2002 IEEE Trans. Magn.

The connection info could be obtained from the distribution of non-zeros in the sparse matrix

Page 16: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

bcsstk14 n=1806,nnz=63454

Page 17: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

MC=50

MC=180

Page 18: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Parallelized ICCG with AMC

Ax b

1,1 1,2 1,

2,1 2,2 2,

,1 ,2 ,

nc

nc

nc nc nc nc

C C C

C C C

C C C

1

2

nc

x

x

x

A TLDL

1

2,1 2

,1 ,2nc nc nc

D

L D

L L D

Ly r1

1,

1

ic

ic ic ic ic k kk

y D r L r

Forward and backward substitutions: parallelized in each color

Page 19: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

SPH Parallel Strategy: OpenMP

MPS Parallel Strategy: OpenMP

Almost linear speedup

Page 20: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Numerical Results

• 2D dam breaking• 2D wedge water entry• 3D cavity flow• 3D dam breaking

Page 21: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Dambreaking Test

Surge front location

Page 22: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Water entry of a wedge

4.5M particles Speed up around 7Dell T5400 2 Xeon Quadcores

Page 23: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn
Page 24: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

t(s)

Fy(

N)

0 0.005 0.01 0.015 0.02 0.0250

2000

4000

6000

8000

SPH ResultsAnalysisExperimentOger' s results

t(s)

v(m

/s)

0 0.005 0.01 0.015 0.02 0.0254.5

5

5.5

6

6.5

SPH ResultsExperiment

Page 25: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

3D Cavity Flow: Re=400

Yang Jaw-Yen et al. 1998 J. Comput. Phys. 146:464-487

45 X 45 X 45 nodes

h/dx=1.5

Page 26: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn
Page 27: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn
Page 28: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn
Page 29: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

3D Dambreaking Tests

Kleefsman, K.M.T. et al 2005J. Comput. Phys. 206:363-393

Page 30: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn
Page 31: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

0.0 0.5 1.0 1.5 2.00.0

0.1

0.2

0.3

0.4

0.5

0.6 H4 H3 H2 H1

Wa

ter

Le

ve

l (m

)

Time (s)

MARIN Exp. Results

SPH Results

Page 32: Simulating complex surface flow by Smoothed Particle Hydrodynamics & Moving Particle Semi-implicit methods Benlong Wang Kai Gong Hua Liu benlongwang@sjtu.edu.cn

Conclusions

• 2D code is developed for both SPH and MPS methods

• 3D code is developed for complex free surface flows

• Computation costs of SPH is generally cheaper than MPS method

• Good agreements are obtained, a promising method for complex free surface flows.