This is presented at OFW 14 (OpenFOAM Workshop) in 2019.
It demonstrates an idea to combine the ML to CFD.
A geometry is parameterized by employing the cut-cell method of the IBM (Immersed Boundary Method) and it has been used as an input to the ML framework. CFD is conducted to predict the drag coefficient of an object and it is used as the target of the ML process.
4. How to combine the Machine
Learning with the computational fluid
dynamics
Idea Description
Computational Results of combining
the ML and CFD
ML-CFD Results
Today’s
Contents
5. NC IdeaDescription
In this section, I will briefly discuss the concept of techniques that
combine machine learning and computational fluid dynamics.NINANO
COMPANY
Inc.
6. For a hull shape design
and optimization…
• The hull design is a very user-dependent task.
• Experienced designer VS Junior designer?
• What if the experienced designer retires?
• Designing 3D hull shapes based on the 2D lines
plan
• Difficult to parametrize the lines
• Almost impossible to uniquely define hull shapes
using the ship parameters (LWL, B, D, CB etc.)
No human designer any longer Parameter-FREE Optimization
User Dependency Difficult to Parameterize
7. For a hull shape design
and optimization…
User Dependency Difficult to Parameterize
◀︎ They will work for us.
Veteran designer will live
in a machine forever…
Go away,
human.
Employing the concept of the
Immersed Boundary Method (IBM)
- Especially, the cut-cell method
Pixelated Volume
Fraction
Machine Learning
Optimal Hull Form
8. ML-CFD
Framework
consists of,
Geometry Handler
⎼ automatically generate and modify the
geometry
Volume Fraction Evaluator
⎼ Make a volume fraction array of a
given geometry in the Design Space
CFD Simulator
⎼ generate mesh, run simulations, and
tell the results to the ML-CFD
Framework
ML Framework for Prediction
⎼ Volume fraction as an input, CFD
results as a target
9. How to Solve Ax = b ?
Need to change the MIND
The solution vector x is NOT unknown value any longer.
Find an accurate and
efficient way to
establish A
Prepare as many
clean x and b
as possible
Traditional
CFD
With the development of
computer resources and
models, more efficient and
accurate analysis is
possible even for more
complex flows.
Data
Driven
Modeling
By focusing on abundant data
and analyzing their
correlations, we can
accurately predict the
outcome of newly given
inputs.
Linearization
Discretization
Limiter
Simplification
Abundant Data
Data Cleansing
Overfitting
Regularization
10. What is the Role of CFD?
Teaches the machine, Validates the AI
Key of System Consistency
Run simulations with various shapes under the SAME
CONDITIONS and teaches the results to the ML
framework
so that it can build more accurate model.
Cost-effective Maintenance Consistency
11. A machine works 24/7 (for me).
It selects optimal candidates.
All I have to do is to choose the Best.
And I earn the money for it.
I have a
dream
12. Work Flow : ML-CFD
To make a machine work for me
Volume Fraction
Prepare the INPUT data for
machine learning
CFD Simulations
Estimate the performances and
prepare TARGET data for the ML
Machine Learning
Build a ML model and
predict the performances
Geometry Handler
Automatically update and
manipulate the geometry
Reinforced
LearningKeep learning and updating the
ML model for accurate prediction
13. ComputationalMethods
To prove the concept, we selected 2D cylinder cases. Run CFD
simulations to estimate the drag coefficients, which is target data.
The volume fractions of each shape was evaluated and given to the
ML framework as an input. A part of the simulated results has been
evaluated the model.
NCNINANO
COMPANY
Inc.
14. We chose
2D cylinders
for simplicity
Proof-of-Concept
14
Elliptic and diamond cylinders with aspect ratio from 0.5 to 2
have been selected for PoC. The drag coefficients were
estimated at the Reynolds number of about 1E5, which is
close to a critical Re number for a circular cylinder.
Elliptic
AR = 2
AoA = 0.0 deg
Diamond
AR = 0.5
AoA = 0.0 deg
Diamond
AR = 2.0
AoA = 15.0 deg
15. Computational Fluid Dynamics
Estimate input data, the drag coefficients numerically
Input a and b - generate the geometry data
Run blockMesh to generate mesh on ¼
plane
Run mirrorMesh about x and y axis
Run a simulation
Estimate the drag coefficients
RUNAUTOMATICALLY
(Idonotwork)
16. 0.0
0.00.0 0.0
0.0
0.0
Estimation of Volume Fraction
Estimate the volume fraction by means of a cut-cell method, introduced at the Immersed Boundary Method
0.0 0.0 0.0
0.0 0.25 0.75
0.0 0.5 1.0
0.0
import numpy as np
# for i in range(0, case_num):
# The vf_array looks like a
# pixelated picture
vf_array[i] = [
0.0, 0.0, 0.0 , 0.0,
0.0, 0.5, 0.25, 0.0,
0.0, 1.0, 0.75, 0.0,
0.0, 0.0, 0.0 , 0.0]
input = np.array(vf_array)
# The vf_array might be a 2D array,
# i.e., its shape can be (4,4)
#
# input.shape is (case_num, 4, 4)
17. Machine Learning
By using the input (vf array) and target (drag coefficients), we can build a simple ML model
Total
175
cases
Train
140
cases
35
case
s
activation=‘relu’
two Dense layers
Build a Sequential model
optimizer=‘rmsprop’
loss = ‘mse’
metric = [‘mae’]
Fit the model
epochs = 400
Evaluate the model
Monitor the error
18. Machine Learning
By using the input (vf array) and target (drag coefficients), we can build a simple ML model
0.0534
Almost saturated, but still
continues to decline
The MAE rapidly
decreases in the early
stage
Comparison of the drag
coefficients from CFD to
ML prediction
Comparison of
the Relative Error of
the test cases
(35 cases)
+/- 5% error
line
Mean RMS Error: 0.0548
colab notebook : https://colab.research.google.com/drive/1_yt4x0p-Ny_eeduRAO9o8JL2yyof5nPX
19. ConcludingRemarks
In this section, I will evaluate the current analysis results. And I will
suggest how the ideas introduced in this study can be utilized in
industry.
19
NCNINANO
COMPANY
Inc.
20. What we can do (At the moment)
It can predict even an arbitrary shape in an instant
Draw your own cylinder
ML-CFD Framework
Get Volume Fraction
ML model
Predict Drag
Coefficient
Put it into the ML-CFD
Framework
REASONAB
LE?
Just use it!
Run CFD
YES
NO
FEEDBACK
Update the model
21. What we want to do (In the Future)
I am trying to develop the techniques to FIRE designers
Design Anyone
Design Anywhere
Quality Guarantee
Expert designer’s experience
has already melted into the
system
No professional and high-cost
design tool is required
The same output whoever
design an object
22. Limitations (Achtung!)
It can only be applied to a similar family of the object
HHHHUUUUGGGGEEEE DATA is essential
Consistent evaluating system is necessary
Large HPC system that is working 24/7 is required
• Like other data driven engineering, abundant data is essential to build a precise model
• It takes very long time to gather enough data for building a ML model
• It is very difficult to build TRUST between HUMAN and MACHINE
• It is very important to ensure the PURITY of the DATA
• Experimental and computational data can be applied at once, but they do not guarantee the
consistency
• The main KEY to success of the ML-CFD is REINFORCED LEARNING
• To do this, the evaluation system should be running at the back-end
• CLOUD system might be very expensive for running the system 24/7
23. CONCLUDING REMARKS
• A combination of CFD and ML framework has been described briefly.
• The volume fraction by means of the cut-cell method (IBM) was adopted as an input to the ML framework.
• CFD results were used as target a value of the ML framework.
• 2D Cylinders were selected for PoC.
• 175 cases were applied were 140 cases were used for training while the rest 35 cases were used for evaluation.
• The ML model predicted the drag coefficients compared to the CFD results with about 5% of relative error in avera
• Considering that a relatively small number of data have been learned, the present results are quite encouraging.
• We expect that the present method can be utilized as a shape optimizer in the industry.
24. Thank
You
Feel free to contact me:
A-309, 15, Jongga-ro, Jung-gu, Ulsan
+82) 10.3084.1357
facebook.com/kgb3233
geonhong.kim@gmail.com