Fast Prediction Methods for Fluid Simulation
Results Using Deep Neural Networks
Takashi Shimokawabe

Information Technology Center, The University of Tokyo

2023/11/29

45th ASE Seminar (Advanced Supercomputing Environment):
International Workshop on "Integration ofSimulation/Data/Learning and Beyond"1Our group aim: Accelerating MD/CFD by DL
nComputational FluidDynamics

nMolecular Dynamics

CNN prediction

GNN prediction

CFD Simulations

16:35 16:50

MD Simulations

Hayato Shiba (Online) (University of Hyogo)
Deep learning of simulated glassy dynamics

Target: Computational Fluid Dynamics
Weather Prediction

Compressible Flow

Whole domain

Decom2D decomposition
Wind Simulations

Computational cost ofcomputational fluid dynamics is
relatively high.

Stencil3
Computational domain computations

Fast prediction of CFD simulation results by DNN
DatasetFlow around acircular cylinder

CFD simulation(Lattice Boltzmannmethods）
fi (x + ci ∆t, t + ∆t) = fi (x, t) + Ωi (x, t)
t3CIIyuxPlsnva6xBvrtM4EHwzr9DZQYpGM=</latexit>
1TU5CjX7XN0eV8Wb5cM3i3f/ZQVcM+z+YT3LKDRn2MaU0aqpPTZIcQuvx+8cHN8sTi/Uu5NyJj+p/1Su5JI3CDu33vm8WvjyDz0uteQmHtL/ZF4jMPpCVqBLPOaqqSCnlqZRsU4vMXl68fsKOHzHKmqsTv5MpMlIzm6wH9f+qbHcbNjSsOcFo3iLd3jPtB8wg1nMocWjy5Wx5TRqJ55qeZEfJauukypfh6qV6cxXq3GinMD11Yq797GIr3RUkuooXMr2Y7URODuh3taekxGa26zUpCFmVJ8adt+ooT+iyjXWsYUIHtoIoBAio+3DQcpvDTYEMbENdIkltLSJK+QooU52m/sU9zjE9zjv0FvroyH9Imtq+B7P8fkn5FZRl+/yVW7km1zID/nFbH/P
VAGP72ijyuoUJ0QajBRsB+fP4h83Vhp1R9SdRYEJXMU1zDDtTczjARbQ5NE72MUH7FnvrE/W50HjWGPDDrqM34Z18BNuAbnf</latexit>l/sk93jENzl36K0P0Zh+mTU3/IDnhPwzcm3UxEfxRhyJXfFWHIofzPb3XH2To1SzxdUfcGXq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7i/VvorCs6YeXTZeFbzHBil24ZX64cPHu0uzi43sPH/Gd+D/KR/xN9hBOPzivViQi0/+4ceFl9zwIfL75jQC4y9EBzLgMWYFBzm8tI0L
seMnTk7WTk0tp9Eg8WTHi/woWXVFKn0Vyo5W2percSJF4Ppyxd24XvArQ5mkKgpv6c1YrgeiH6qe8oQG1K1ddW4Gsi+6qvngAtPT7AqbYU4vEV5m55mjxSBnzd5PdoYhvp3Je3kJTHdrdd7iZrC9gV0FdarGfFT7TA7doYg8GlBAkkLSiH0SlOJZI5s4xcDWKQOWIFKG<latexit sha1_base64="fyMMhAXRS1IwpPqMkMRL1/RQDbc=">AAADMXichVK7btRAFL0xrxAeWUKDRDNitWgjkdV4hQSKBIqgoSMPNokUh9XYzC6j+IU9uxAs/wA/QEEFggJR8gk0KG2g2A7RoUg0QaKh4HhsQBACY9lz7zlzrs/MHTf2Vao5H41ZBw4eOnxk/OjEseMnTk7WTk0tp9Eg8WTHi/woWXVFKn0Vyo5W2percSJF4Ppyxd24XvArQ5mkKgpv6c1YrgeiH6qe8oQG1K1ddW4Gsi+6qvngAtPT7AqbYU4vEV5m55mjxSBnzd5PdoYhvp3Je3kJTHdrdd7iZrC9gV0FdarGfFT7TA7doYg8GlBAkkLSiH0SlOJZI5s4xcDWKQOWIFKGl5TTBDWgHmCdxBoBfAPfPrK1Cg2RF1VTo/fwHx9vAi2jBn/PX/Jd/pa/4p/4N1T7e63M1CjcbGJ2S62Mu5OPzix9/a8qwKzp7i/VvorCs6YeXTZeFbzHBil24ZX64cPHu0uzi43sPH/Gd+D/KR/xN9hBOPzivViQi0/+4ceFl9zwIfL75jQC4y9EBzLgMWYFBzm8tI0LB1li6pT8jw4InCOjOrqT78O0weS4Dvafzd8bLLdbNm/ZCxfrc9eqizFOZ+kcNVH/Es3RDZqnDjw8py3apnfWa2tkfbA+lkutsUpzmn4b1s53ZMW85A==</latexit>

Training
Prediction
Prediction of flow

Convolutional neural networks (CNNs) topredict simulation results
CNNs may become “faster simulator”

Topic1: Steady flow
nSteady flow

Flow

• The fluid flows along the x axis around objects.

nLBM (Lattice Boltzmann method)
simulation results• D2Q9 model (9 variables is used for discretevelocity)• Re = 20,• Region size: 256 x 128 ( clipped from 1024 x1024)• 6 types of object shapes:• polygons (number of angles: 3-7)• cylinders.

nInput data: 256 x 128 (clipped)• Training: 14515• Validation: 1613

256128

Singed distance function (SDF)
nSDF represents• the surface of the object as zero.
• the outside of the object as a positive distance.
• the inside of the object as a negative distance.

nA universal representation for different geometry shapes andworks efficiently with neural networks
Insideofcylinder

cylinderf(x)0100200x6

Network Architecture and Training
Input:
Signed distance function
Boundary conditions

Deconv
Deconv
512 , 88 256 , 44Conv
128 , 168Conv
512 , 44

Output:Velocity
Deconv
32 , 221616128
44512256128

1616128

vector x

FullCon256128

256×128u

Deconv
1 , 22256128256256128×128v

vector y445121024

256128

1616128
44512

Encoding part

256128256256128×128

Decoding partA modified version of the network architecture proposed in Guo et al.
”Convolutional Neural Networks for Steady Flow Approximation”, 2016

Prediction results for single domain
CNN Predictionu

LBM Ground truth

Err = |CNN - LBM|

uCylindervv

Loss: 7.3 x 10-5

Prediction results for a complex shape
CNN Predictionu (velocity in x dir)v (velocity in y dir)

LBM Ground truthuv

Err = |CNN - LBM|
uv

・Computation time… LBM (82,000steps) → 41.1 sec 、 CNN prediction → 0.6 sec⇒ CNN prediction has achieved high accuracy with significant reduction in calculation9 time.

Prediction by CNN with boundary exchangen The network model trained for a single domain is applied to the decomposed
subdomains to predict the simulation results in each subdomain.

n In order to maintain consistency between values in the subdomains, boundary
exchange between neighbor subdomains is performed.
n CNN and boundary exchange are performed iteratively until values converge.
n This method has no limitation for device (GPU) capacity.

Whole domain Decomposed subdomains
Boundary
Decomposition

Input

Signed distance function
Boundary conditions

OutputVelocityCNN
Boundary exchange

Iterative loop

Predicted results using CNN with boundary exchange
CNN prediction

CNN prediction

uu (x⽅向の速度)

uuv (y⽅向の速度)vv

v( Initial )( Final )Domain size：748 x 364 (9 decomposed subdomains)
Mean error ：3.89％
Comp. time ：3.82 s

LBM Ground Truth

Err = | CNN - LBM |11

Topic2: Time dependent flow
n3D CNN prediction of time dependent flows• 2 dimensions in space and 1 dimension in time：x, y, t à 3D CNN

nInput and output• Input: 3 frames (t0, ..., t0+200) at 100 step intervals in the LBM
simulation• Output: Predicts the next 3 frames (t0+300, ..., t0+500)

LBM simulations
64 x 64
t=t0CNN PredictionCNN
t=t0+300

t=t0+100t=t0+200

t=t0+400
t=t0+500

Network structure to predict time dependent flow
Input:
discrete velocity distribution function
Singed distance function (geometry shapes)

Conv3D 2x2x3

1024

1024

Conv3D 2x2x3512

42 x3512512

22 x3

Conv3D 2x2x3

42 x3

82 x3256

Conv3D 3x3x3

Conv3D 2x2x3

12 x3256

Deconv3D 2x2x3

Deconv3D 2x2x3

Deconv3D 2x2x3

Deconv3D 2x2x3
Deconv3D 2x2x3• Encoder-decoder type of convolution and deconvolution layers in 3 dim of x, y, t
• Activation function: tanh
• Skip connections (used in U-net, etc.)• Normalization of input/output data
• Loss function based on collision process in LBM

3

9Conv3D 4x4x3

322 x3

Conv3D 3x3x3

128

162 x3

256

Conv3D 3x3x3

162 x3

12864

32

82 x3

Conv3D 2x2x3

128

Conv3D 3x3x3

64

Conv3D 3x3x364

22 x3

64x64x3

32

Conv3D 4x4x3
322 x3410

Output:discrete velocity distribution function

64x64x3

Lattice Boltzmann Method
A Discrete-velocity Boltzmann equation
collision

streamingforcing term

Streaming step: discrete velocity distribution function: discrete velocity

velocity

time-integration (n → ✽)D3Q19
discrete velocity

・・・・・・

copy

14

Predicts large simulation results• Predictions are needed for regions beyond the training size
• Apply inference patchily over the entire computational domain• Apply inference in an overlapping regions

LBM simulations (v)CNN prediction (v)64 x 64

t0t0+100

t0+200discrete velocity distribution function, sdf

t0+300t0+400t0+500discrete velocity distribution function

Prediction with multiple applies of CNN inference
nPrediction of long time evolution by CNN• Predicts further frames ahead by using the CNN prediction result as
the next input

LBM simulations

CNN

3 framest0 …

CNN prediction

CNN prediction

CNN

3 frames
t0+300 …

3 frames
t0+600 …

Prediction
Example１

LBM Ground truth

CNN Prediction

UVPrediction
Example2

LBM Ground truth

CNN Prediction

UVConclusionnWe have developed deep learning fast prediction methods
for steady/unsteady flow.
nSteady flow

• Predicting simulation results on large domain using CNN with boundaryexchange.
• The proposed method has no limitation for device (GPU) capacity.

nTime dependent flow (unsteady flow)• Predicting simulation flow using 3D CNN.
• By applying the CNN multiple times, long time predictions can be made.
• Applied patchily, predictions can be made for regions beyond the size of thetraining data.

19