Computational Engineering: Tackling Turbulence With (Super) Computers
Computational Engineering: Tackling Turbulence With (Super) Computers
TA C K L I N G T U R B U L E N C E W I T H ( S U P E R ) C O M P U T E R S
A BRIEF OVERVIEW OF CFD
IN A NUTSHELL
REMINDER: NS EQUATIONS
u
∂⃗ 2 Newton's 2nd law
u⋅∇ ) ⃗
+( ⃗ u =ν ∇ ⃗u −∇ p
∂t
u =0
∇⋅⃗ Mass conservation
u
∂⃗ 2 Newton's 2nd law
u⋅∇ ) ⃗
+( ⃗ u =ν ∇ ⃗u −∇ p
∂t
u =0
∇⋅⃗ Mass conservation
Turbulence modelling
We will study this
during this course
Numerical Methods
MareNostrum4 supercomputer
Picture downloaded from https://www.bsc.es/marenostrum/marenostrum (accessed February 27, 2019).
Figure extracted from A. Gorobets, F.X. Trias, R. Borrell, O. Lehmkuhl, and A. Oliva. “Hybrid MPI+OpenMP parallelization
of an FFT-based 3D Poisson solver with one periodic direction”. Computers & Fluids, 49:101–109, 2011.
Figure extracted from A.Gorobets, F.X. Trias, M.Soria and A.Oliva, “A scalable parallel Poisson solver for three-
dimensional problems with one periodic direction”, Computers and Fluids, 39:525–538, 2010.
BW × AI
“Programming is thinking, not typing.”—Casey Patton
ERROR LANDSCAPE
Validation Verification
Solve the right equations Solve the equations right
∂φ ∂2 φ d φh −1
+Γ =f + D φ h=f h A x=b ⇒ x≈ A b
∂t ∂x
2
dt
Numerical
Physical realm Math model Discrete eqs.
solution
∂φ
∂x | xi
φ i+ 1−φ i−1
∂φ
|
∂x x
=
hi +hi +1
i
1
+O (h )
2 2 2 2
h φ i+ 1+(h i+1−hi ) φ i −h i+1 φ i−1
∂φ
∂x | =
xi
i
hi hi +1 (hi + hi+1 )
2
+O (h )
∂2 φ
∂ x2 | xi
( )( ) ( ) ( ) ( )
1 1 1 0
1
−h i 0 hi +1
ci = 0 ⇒ ci = −(hi + hi+1 )
2 2 hi hi+1 ( hi +hi +1)
h i−1 / 2 0 h i+1 / 2 c i +1 1 c i +1 hi
|
2
∂ φ hi φ i+ 1−( hi+ 1+ hi ) φi + hi+1 φ i−1 2
2
= +O (h )
∂x x i
hi hi+1 ( hi +hi +1)
...using Richardson
∂2 φ
∂ x2 |
xi
extrapolation
φ i+ 1−2 φ i + φi −1 ⏞
|
2 2
∂ φ h 4
2
= 2
+ ∂ φ
xxxx i +O (h ) × 4/3
∂x x h 4!
i
|
2
∂2 φ φ i+ 2−2 φ i + φ i−2 ( 2 h) 4
= + ∂ xxxx φ i +O (h ) ×−1/ 3
2
∂x x i
H
2
4!
4
O ( h ) approximation
Mathematical Fundamentals for CFD 20/30
CODE VERIFICATION...
manufactured solution!
Extracted from F.X. Trias, A. Gorobets and A. Oliva. "A simple approach to discretize the viscous term with spatially varying
(eddy-)viscosity", Journal of Computational Physics, 253 (1): 405-417, 2013.
n n n
Mathematical Fundamentals for CFD 22/30
STABILITY
−2 ℝ
−1
|1+~
λ|≤1 Stability region
transfer function
1
What is Δ x and U in an unstructured mesh? 5 4
ANSWER: This is the typical "1D uniform mesh"
6 2
idea applied to "3D unstruct"
d uh 3
Ω +C ( uh )u h=D u h−Ω G ph M u h=0h
dt
−C (uh )+ D
Instead we can compute the
spectral radius of this operator
sol sol
A x=b x ≈A
−1
b where ‖A x −b‖≤ε
ini
A x ε b x sol
Easy to test!
A
rand rand sol sol rand
x b= A x x x ≈x
ε
sol sol
A x=b x ≈A
−1
b where ‖A x −b‖≤ε
29/30
Take-away messages
– Numerical methods
HPC (High Performance Computing)
– HPC
● Codes must be well-structured, efficient, simple, readable
and modular.
nd
ou
yb
CFD codes are memory bound
or
em
●
M
BW × AI