国際会議 particles で発表のある粒⼦法 - 九州大学(kyushu … · 2017-08-17  ·...

9
空間充填曲線を⽤いた動的負荷分散による ⼤規模粒⼦法シミュレーション 東京⼯業⼤学 学術国際情報センター ⻘⽊ 尊之 フォーラム「粒⼦法による流体シミュレーションの並列化技術」九州⼤学 情報基盤研究開発センター 2017年8⽉21⽇ 2,160 NVIDIA P100 GPUs 12.15 PFLOPS (Peak) TSUBAME3.0 Pascal core GPU: Tesla P100 3,584 cores 3 4 国際会議 Particles で発表のある粒⼦法 DEM, SPH, MPS, MPM, LBM DEM, SPH, MPS, MPM, LBM Contact interaction Normal direction Tangential direction Spring Viscosity Viscosity Friction Spring DEM (Discrete Element Method) Particle Distribution The load imbalance problem among subdomains Many particles No particle

Upload: others

Post on 17-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 国際会議 Particles で発表のある粒⼦法 - 九州大学(KYUSHU … · 2017-08-17  · Scalability on TSUBAME2.5 Peano Hilbert Morton Slice-grid Comparison of 3 different

空間充填曲線を⽤いた動的負荷分散による⼤規模粒⼦法シミュレーション

東京⼯業⼤学 学術国際情報センター

⻘⽊ 尊之

フォーラム「粒⼦法による流体シミュレーションの並列化技術」九州⼤学 情報基盤研究開発センター 2017年8⽉21⽇

2,160 NVIDIA P100 GPUs12.15 PFLOPS (Peak)

TSUBAME3.0

Pascal core GPU: Tesla P100 3,584 cores

3 4

国際会議 Particles で発表のある粒⼦法

DEM, SPH, MPS, MPM, LBMDEM, SPH, MPS, MPM, LBM

Contact interaction

Normal direction

Tangential direction

SpringViscosity

Viscosity

Friction 

Spring

DEM (Discrete Element Method) Particle DistributionThe load imbalance problem among subdomains

Many particles

No particle

Page 2: 国際会議 Particles で発表のある粒⼦法 - 九州大学(KYUSHU … · 2017-08-17  · Scalability on TSUBAME2.5 Peano Hilbert Morton Slice-grid Comparison of 3 different

Sub-domains with High Aspect ratioThe passive particles under vortex velocity field using 64 GPUs

Slice Grid Method

バンカーショット計算Golf Bunker shot using 16.7 millions particles with 64 GPUs

Complex Shape Objects

11

Non-spherical model described by rigidly connected sphere particles

∆ ∆ / ∆∆ / ∆ / ∆⁄∆ / ∆ / ) ∆∆ ∆ ∆ /∆ ∆ ∆∆ ∆ ∆ ∆∆ / ∆ / ∆ / ∆ ∆

12

Page 3: 国際会議 Particles で発表のある粒⼦法 - 九州大学(KYUSHU … · 2017-08-17  · Scalability on TSUBAME2.5 Peano Hilbert Morton Slice-grid Comparison of 3 different

13

Multiple GPU ScalabilityConditions

Particles : 2 × 106, 1.6 × 107, 1.29 × 108

Domain Decomposition : Dynamic load Balance using Slice Grid Method Time-Integration : 2-stage

Runge-Kutta

Space Filling Curves• Construction of a tree so that each leafs contain minimum number of particles• Each leafs is numbered by following the rules of space filling curves.

A tree-base cell refinement

Space Filling Curves The domain decomposition

by Peano curve The connections of leafs by

Peano curve

空間充填曲線による動的負荷分散ペアノ、ヒルベルト、モートン空間充填曲線による 2 次元動的負荷分散

Peano Hilbert Morton

空間充填曲線を⽤いた領域分割 粒⼦数 / 領域番号テーブルの利⽤

ツリーの構築の際に各リーフ領域内の粒⼦数を計測するが、粒⼦配列に対するリーフ内の粒⼦の探索は探索時間が全粒⼦数に⽐例するためコストが⾼い.

予め計算領域内に最⼩リーフと同サイズの空間格⼦を⽣成しておき,各格⼦に格⼦内の粒⼦数を登録した粒⼦数テーブルにより探索時間を削減する.

Page 4: 国際会議 Particles で発表のある粒⼦法 - 九州大学(KYUSHU … · 2017-08-17  · Scalability on TSUBAME2.5 Peano Hilbert Morton Slice-grid Comparison of 3 different

Scalability on TSUBAME2.5

Peano Hilbert

Morton Slice-grid

Comparison of 3 different SFCwith slice-grid method

SPH (Smoothed Particle Hydrodynamics)

Short-range Interaction (SPH: Smoothed Particle Hydrodynamics)Each particle has its physical properties and interactions among particles in the range of kernel radius are calculated at every time step.

Kernel function W

Particle

Kernel radius

Normalization

Discretization

: mass : density

Physical property

A Dam Break SimulationArrangement & setting of parameters

12 m

2.2 m

0.8 m

Water

Object 6 m10 m

4.8 m

Description of the Object ShapeObjects formed by particles generated from CAD data

CAD Particles

A Dam Break Simulation

72 M particles with 80 GPUs

Tsunami Debris FlowIncluding a lot of floating objects

• Simulation area : 180 m × 160 m × 20 m • Total particles : 117,561,285• Particles / object : 19 ~ 472• Objects : 10368• Physical time (s) : 10.0• Steps : 20,000• GPUs : 256 • Simulation (h) : 100 • Initial height (m) : 10.0

Initial state of each objects

410 315144309

12447271151

441919245

Computational conditions

CAD Data ParticlesRepresentation of object shapes

Page 5: 国際会議 Particles で発表のある粒⼦法 - 九州大学(KYUSHU … · 2017-08-17  · Scalability on TSUBAME2.5 Peano Hilbert Morton Slice-grid Comparison of 3 different

TSUBAME2.5を⽤いた⼤規模計算

Dynamic Domain DecompositionUsing the improved SPH with 87Million particles with 256 GPUs

27

Fluid-solid Two Phase Flows

-- Fluidized Bed --

流動層の⼤規模シミュレーション従来の固気・固液シミュレーション 直接相互作⽤による固気・固液シミュレーション

固体粒⼦は計算格⼦より⼩さいラグランジュ粒⼦ 球形粒⼦を仮定した相互作⽤モデル

固体粒⼦は計算格⼦よりずっと⼤きい 流体−固体間の直接相互作⽤を計算

⾼精度⾮球形粒⼦乱流

LBM-DEM coupled method

∆ , ∆ , , ,

, , , ,∆2

/

■ Solid fraction in each cell: ■ Bounce back boundary condition

:

MRT型の格⼦ボルツマン法

30

隣接点に速度分布関数をコピー ローカルな物理量で計算

D3Q27速度モデル

Δ , Δ , , ,乱流モデル(コヒーレント構造Smagorinsky)∗ (粘性=分⼦粘性+渦粘性)̅ ̅ /

12渦粘性係数を局所的に決定・物体周りの流れに適⽤可能・⼤規模計算に適⽤可能

12コヒーレント構造関数

:速度分布関数:変換マトリックス:緩和時間マトリックス

:速度モーメント: 速度分布の速度M

緩和時間マトリックス を粘性 ∗を⽤いて修正

Kobayashi, Hiromichi. "The subgrid-scale models based on coherent structures for rotating homogeneous turbulence and turbulent channel flow." Physics of Fluids 17.4 (2005): 045104.

Page 6: 国際会議 Particles で発表のある粒⼦法 - 九州大学(KYUSHU … · 2017-08-17  · Scalability on TSUBAME2.5 Peano Hilbert Morton Slice-grid Comparison of 3 different

AMR (Adaptive Mesh Refinement) Large-scale simulation flow around a sphere

31

Domain size D×D×2DMesh resolution (Δx/d) 0.001 min.

0.512 max.Blockage ratio (d/D) 0.01529Total mesh number 2.7×108

GPU NVIDIA K20X × 64

格⼦解像度が異なる格⼦間の補間

空間補間各軸に線形補間 (1,2,4, または 8 点から)

時間補間線形補間 (1つまたは2つの時刻から)

レベル変換*

速度勾配テンソルが連続となる変換

粗野化: , ,細分化: , 2 ,

32

*Filippova Olga and Hnel Dieter. Grid Refinement for Lattice-BGK Models. Journal of Computational Physics, Vol. 147, No. 1, pp. 219-228, 1998.

2点 4点

空間補間

時間補間

細t

1点

格⼦解像度ごとの時間ステップの設定LBMの速度分布関数の移動速度 は⼀定⇒格⼦解像度に応じて時間刻みΔ を変化させる

リーフの外殻格⼦のアクセスパターン

格⼦は6⾯・12辺・8頂点の26通り各カーネルの隣接点参照が27通り全702通りの参照パターンが存在

全⼿動の実装は⽣産性・保守性に問題あり

34

C++テンプレートによる実装⻘:頂点上の外殻格⼦

橙:⾯上の外殻格⼦

緑:辺上の外殻格⼦

AMRのリーフ: 16×16×16等のパッチ

空間充填曲線による領域分割

35

通信最適化① 通信する格⼦の最適化

36

袖領域リーフの全体 必要最⼩限通信する格⼦2次元:8通り3次元:26通り

Page 7: 国際会議 Particles で発表のある粒⼦法 - 九州大学(KYUSHU … · 2017-08-17  · Scalability on TSUBAME2.5 Peano Hilbert Morton Slice-grid Comparison of 3 different

通信最適化② 時間ステップ値が更新された格⼦のみ通信する2段の解像度の場合,• 偶数の時間ステップ:全格⼦を通信• 奇数の時間ステップ:細かい格⼦のみ通信

37

偶数ステップ 奇数ステップ

通信最適化③ 格⼦ボルツマン法の分布関数

38

D2Q9LBM

黒⾊:送る⽩⾊:送らない

C++テンプレートによる実装

Drag Crisis

39

Re=2×105 Re=5×105

0.1

1

1.E+05 1.E+06

CD

Re

J. Almedij, 2008Morrison, 2013present method

Near Re = 105 〜 106,• Drag coefficient drastically decreases• Vortexes translate past the sphere

Interpolated Bounce-back移動境界

40

流体の格⼦点固体内部の格⼦点

壁が近い場合

,wall 1 2

’ Δ ,

, Δ, Δ 2 , 1 2 Δ , 2 ·

格⼦点の間にある壁を2次精度で扱う境界条件

固体粒⼦に作⽤する流体⼒

41

Galilean invariant momentum exchange method*, , , Δ

*Wen, Binghai, et al. "Galilean invariant fluid–solid interfacial dynamics in lattice Boltzmann simulations.“, Journal of Computational Physics 266 (2014): 161-170.

,∈ ,∈

壁で反射される速度分布関数 の運動量変化から評価

壁を含む格⼦点における の総和から,物体に作⽤する流体⼒ とトルク を計算

,wall 1 2 Δ ,

’ , Δ

検証:移動する球に作⽤する抗⼒

42

20Δ 0.02

CD

Re

MRTMRT+LESExperiment

10-1 100 101 102 103 104 105 10610-1

100

101

102

球を⼀定速度で流体中を移動させ,抗⼒係数を測定

2 /4 ::::抗⼒流体の密度粒⼦の移動速度粒⼦直径

抗⼒係数

Page 8: 国際会議 Particles で発表のある粒⼦法 - 九州大学(KYUSHU … · 2017-08-17  · Scalability on TSUBAME2.5 Peano Hilbert Morton Slice-grid Comparison of 3 different

検証:球形粒⼦の沈降計算

43

120mm 15mm 15Δ

Ten Cate, A., Nieuwstad, C., Derksen, J. and Van den Akker, H.: "Particle imaging velocimetry experiments and lattice-Boltzmann simulations on a single sphere settling under gravity'", Physics of Fluids, Vol. 14, No. 11, pp. 4012-4025 (2002).

粒⼦の沈降速度の時間変化time [s]

velo

city

[m/s

]

Re=1.5Re=4.1Re=11.6Re=31.9

0 1 2 3 4

-0.12

-0.08

-0.04

0

Δ 1.0mm970, 965, 962, 960kg/m100mm 100mm 160mm1120kg/m

1.5, 4.1, 11.6, 31.9

複数GPU計算

44

• 各⼩領域を1台のGPUに割り当て,LBMの計算を実⾏

• 各GPUがすべての粒⼦を計算• MPI_Allreduceを⽤いて各GPUで

計算された流体⼒の総和

ハロー領域の通信全ノード間総和計算全体の計算領域

⼆次元領域分割

DEM68,921 particles

LBM288x288x576 mesh

2500kg/m1000kg/m512 512 1024mesh8GPUs TeslaK80

10,300cubicparticles185,800particles

Δ 0.05mm

Diameter 0.5mm100kg/m

1.2kg/m1.5 10 m /s512 512 16801.5m/s

48GPUs

81,920sphereparticlesΔ 1.67 s

Δ 1.67 s

Fluid

Solid

Spouted Bed

たわら型粒⼦を含む流動層

47

Δ 0.133mm1.2kg/m1.5 10 m /s

225 750 3600mesh

Δ 1.33 s0.5m/s

流体(空気)

85kg/m5512particlesΔ 1.33 s円柱形粒⼦

30mm

480mm

0.5m/s固体粒⼦の

初期配置

54GPU

100mm

80mm

0.03, 0.9

半径1.3mmの球を9個並べた粒⼦モデル

2.6mm 6.0mm

計算結果

48流体の鉛直⽅向の速度

Page 9: 国際会議 Particles で発表のある粒⼦法 - 九州大学(KYUSHU … · 2017-08-17  · Scalability on TSUBAME2.5 Peano Hilbert Morton Slice-grid Comparison of 3 different

Falling Gingko leaves

49(Collision detection)

Modeling of Gingko leaf

Real Polygons Level Set Particles

Summary 空間充填曲線を⽤いた動的負荷分散による⼤規模粒⼦計算の実現 格⼦ボルツマン法による⾮球形固体粒⼦との直接相互作⽤計算 数10GPUの⼤規模計算

• ⾮球形固体粒⼦の沈降計算• 噴流計算• 舞い落ちる多数のイチョウの葉の計算

格⼦ボルツマン法のAMR実装• リーフの外殻格⼦の隣接アクセスの最適化• 空間充填曲線による領域分割• 分割領域間通信の最適化