by chainarong chaktranond cfd... · 4. introduction to numerical methods - finite different method,...
TRANSCRIPT
ME 747 Introduction to computational
fluid dynamics
By Chainarong Chaktranond
Lecture 4
Introduction to numerical methods
2Chainarong Chaktranond, Thammasat University
Lecture schedule
5. Introduction to solve engineering problems with finite-different method
- Taylor series expansion, Approximation of the second derivative, Initial condition and
Boundary conditions
6 – 7
4. Introduction to numerical methods
- Finite different method, Finite volume method, Finite element method, etc.
5
3. Overviews of governing equations for flow and heat transfer
-Elliptic, Parabolic and Hyperbolic equations
4
2. Introduction to Fortran programming
- Basic commands in Fortran programming
2 - 3
1.Overviews of computational fluid dynamics
- Overviews and importance of heat transfer in real applications1
TopicsSession
3Chainarong Chaktranond, Thammasat University
Contents
Overviews of numerical solving methods
Finite difference method
4Chainarong Chaktranond, Thammasat University
Introduction to numerical methods
การกาหนดฟสกสของปญหา (Define the physical problem)
การกาหนดแบบจาลอง (Create a mathematical model)
- Systems of PDEs, ODEs, algebraic equations
- การกาหนดเงอนเรมตน เงอนไขขอบเขต เพอใหสอดคลองกบปญหา (Well- posed
problem)
การสรางแบบจาลองแบบดสครท (Discrete model)
- การดสครไตซโดเมน → การสรางกรด → การไดแบบจาลองแบบดสครท
- ระบบการแกสมการดสครท
การวเคราะหคาผดพลาดในระบบดสครท (Analyze errors in the discrete system)
- ความสอดคลอง/ตรงกบกายภาพ ความเสถยร และการวเคราะหการลเขาของคาตอบ
5Chainarong Chaktranond, Thammasat University
Numerical solving methods
Finite difference method
Finite element method
Finite volume method
Spectral method
6Chainarong Chaktranond, Thammasat University
Main numerical methods for PDEs
Finite difference method (FDM)
Advantages:
Simple and easy to design the scheme
Flexible to deal with the nonlinear problem
Widely used for elliptic, parabolic and hyperbolic equations
Most popular method for simple geometry, ….
Disadvantages:
Not easy to deal with complex geometry
Not easy for complicated boundary conditions
……..
7Chainarong Chaktranond, Thammasat University
Finite difference method
( )0, XΩ =
หลกการ คอ การหาคาอนพนธในสมการอนพนธยอยเปนคาประมาณโดยใชคาฟงกชนเชงเสนทจด
บนกรด
1 D ( )i iu u x≈ 0,1,2, ,i N= …
Grid points ix i x= Δ Mesh sizeXxN
Δ =
อนพนธอนดบท 1( ) ( ) ( ) ( )
0 0lim limi i i ii
x x
u x x u x u x u x xux x xΔ → Δ →
+ Δ − − − Δ∂= =
∂ Δ Δ
( ) ( )0
lim2
i i
x
u x x u x xxΔ →
+ Δ − − Δ=
Δ
8Chainarong Chaktranond, Thammasat University
การประมาณคาอนพนธอนดบทหนง
1i i
i
u uux x
+ −∂⎛ ⎞ ≈⎜ ⎟∂ Δ⎝ ⎠
1i i
i
u uux x
−−∂⎛ ⎞ ≈⎜ ⎟∂ Δ⎝ ⎠
1 1
2i i
i
u uux x
+ −−∂⎛ ⎞ ≈⎜ ⎟∂ Δ⎝ ⎠
Taylor series expansion
x
( ) ( )2 32 3
1 2 32 6i ii i i
x xu u uu u xx x x+
Δ Δ⎛ ⎞ ⎛ ⎞∂ ∂ ∂⎛ ⎞= + Δ + + +⎜ ⎟ ⎜ ⎟⎜ ⎟∂ ∂ ∂⎝ ⎠ ⎝ ⎠ ⎝ ⎠
( ) ( )2 32 3
1 2 32 6i ii i i
x xu u uu u xx x x−
Δ Δ⎛ ⎞ ⎛ ⎞∂ ∂ ∂⎛ ⎞= − Δ + − +⎜ ⎟ ⎜ ⎟⎜ ⎟∂ ∂ ∂⎝ ⎠ ⎝ ⎠ ⎝ ⎠
T1
T2
9Chainarong Chaktranond, Thammasat University
คาผดพลาดจากการประมาณคาอนพนธอนดบทหนง
T1
- T2
Truncation error ( )O xΔ
T1
T2
คาผดจากการการคานวณโดยการประมาณอนพนธอนดบหนง
10Chainarong Chaktranond, Thammasat University
การประมาณอนพนธอนดบทสอง
( )( )
221 1
2 2
2i i i
i
u u uu O xx x
− +⎛ ⎞ − +∂= + Δ⎜ ⎟∂ Δ⎝ ⎠
Central difference scheme
Alternative derivative
11Chainarong Chaktranond, Thammasat University
การประมาณคาโดยอนพนธผสม
Second difference approximation
12Chainarong Chaktranond, Thammasat University
การประมาณคาโดยอนพนธอนดบสงๆ
Taylor series expansion
backward
forward
central
central
13Chainarong Chaktranond, Thammasat University
Example: 1-D Poisson equation
14Chainarong Chaktranond, Thammasat University
Example: 1-D Poisson equation
15Chainarong Chaktranond, Thammasat University
Example: 2-D Poisson equation
16Chainarong Chaktranond, Thammasat University
Example: 2-D Poisson equation
17Chainarong Chaktranond, Thammasat University
18Chainarong Chaktranond, Thammasat University
19Chainarong Chaktranond, Thammasat University
20Chainarong Chaktranond, Thammasat University
Main numerical methods
Finite element method (FEM)
Advantages:
Flexible to deal with problems with complex geometry and complicated boundary conditions
Keep physical laws in the discretized level
Rigorous mathematical theory for error analysis
Widely used in mechanical structure analysis, computational fluid dynamics (CFD), heat transfer, electromagnetics, …
Disadvantages:
Need more mathematical knowledge to formulate a good and equivalent variational form
21Chainarong Chaktranond, Thammasat University
Finite element methods
Basic idea( ) ( ) ( )
1
ˆM
j jj
u x u x u xφ=
≈ = ∑basic functions
M unknowns: ตอง M สมการ
Discretizing derivative results in linear system
jujφ
22Chainarong Chaktranond, Thammasat University
Main numerical methods
Finite volume method (FVM)
Flexible to deal with problems with complex geometry and complicated boundary conditions
Keep physical laws in the discretized level
Widely used in CFD
2
2e w
e wP
u ux xu
x xx
⎡ ⎤∂ ∂⎛ ⎞ ⎛ ⎞−⎜ ⎟ ⎜ ⎟⎢ ⎥∂ ∂⎡ ⎤∂ ⎝ ⎠ ⎝ ⎠⎣ ⎦=⎢ ⎥ −∂⎣ ⎦
E P
e E P
u uux x x
−∂⎛ ⎞ =⎜ ⎟∂ −⎝ ⎠P W
w P W
u uux x x
−∂⎛ ⎞ =⎜ ⎟∂ −⎝ ⎠
23Chainarong Chaktranond, Thammasat University
Main numerical methods
Spectral method
Advantage
High (spectral) order of accuracy
Usually restricted for problems with regular geometry
Widely used for linear elliptic and parabolic equations on regular geometry
Widely used in quantum physics, quantum chemistry, material sciences,
Disadvantage
Not easy to deal with nonlinear problem
Not easy to deal with hyperbolic problem
…..