(Grid Generation 정렬격자 · 2017. 6. 8. · Ex) Hyperbolic marching + Elliptic smoothing 24....
Transcript of (Grid Generation 정렬격자 · 2017. 6. 8. · Ex) Hyperbolic marching + Elliptic smoothing 24....
-
첨단 사이언스∙교육 허브 개발 (EDISON) 사업
격자 생성(Grid Generation_정렬격자)
이 름 : 김 병 수
소 속 : 충남대학교 항공우주공학과
-
Introduction to CFD
• Conservation Laws
Fundamental equations of fluid dynamics are based on the
universal laws of conservations
– Conservation of Mass
– Conservation of Momentums
– Conservation of Energy
2
-
Introduction to CFD
• Governing Equations
– Mass
– Momentum
– Energy
3
𝜕𝜌
𝜕𝑡+
𝜕
𝜕𝑥(𝜌𝑢) +
𝜕
𝜕𝑦(𝜌𝑣) +
𝜕
𝜕𝑧(𝜌𝑤) = 0
𝜕𝜌𝑢
𝜕𝑡+
𝜕
𝜕𝑥(𝜌𝑢2 + 𝑝 − 𝜏𝑥𝑥) +
𝜕
𝜕𝑦(𝜌𝑢𝑣 − 𝜏𝑥𝑦) +
𝜕
𝜕𝑧(𝜌𝑢𝑤 − 𝜏𝑥𝑧) = 𝜌𝑓𝑥
𝜕𝜌𝑣
𝜕𝑡+
𝜕
𝜕𝑥(𝜌𝑢𝑣 − 𝜏𝑥𝑦) +
𝜕
𝜕𝑦(𝜌𝑣2 + 𝑝 − 𝜏𝑦𝑦) +
𝜕
𝜕𝑧(𝜌𝑣𝑤 − 𝜏𝑦𝑧) = 𝜌𝑓𝑦
𝜕𝜌𝑤
𝜕𝑡+
𝜕
𝜕𝑥(𝜌𝑢𝑤 − 𝜏𝑥𝑧) +
𝜕
𝜕𝑦(𝜌𝑣𝑤 − 𝜏𝑦𝑧) +
𝜕
𝜕𝑧(𝜌𝑤2 + 𝑝 − 𝜏𝑧𝑧) = 𝜌𝑓𝑧
𝜕𝜌𝑒
𝜕𝑡+
𝜕
𝜕𝑥𝜌𝑢𝑒 + 𝑝𝑢 +
𝜕
𝜕𝑦𝜌𝑣𝑒 + 𝑝𝑣 +
𝜕
𝜕𝑧𝜌𝑤𝑒 + 𝑝𝑤 =
𝜕
𝜕𝑥𝑢𝜏𝑥𝑥 + 𝑣𝜏𝑥𝑦 + 𝑤𝜏𝑥𝑧 − 𝑞𝑥 +
𝜕
𝜕𝑦𝑢𝜏𝑦𝑥 + 𝑣𝜏𝑦𝑦 + 𝑤𝜏𝑦𝑧 − 𝑞𝑦 +
𝜕
𝜕𝑧𝑢𝜏𝑧𝑥 + 𝑣𝜏𝑧𝑦 + 𝑤𝜏𝑧𝑧 − 𝑞𝑧
-
Introduction to CFD
• Governing Equations
– Viscous stress tensor 𝜏𝑖𝑗 = μ𝜕𝑢𝑖
𝜕𝑥𝑗+
𝜕𝑢𝑗
𝜕𝑥𝑖−
2
3𝛿𝑖𝑗
𝜕𝑢𝑘
𝜕𝑥𝑘
– Total energy per unit mass 𝑒 = 𝑖 + 𝑉2
2+ 𝑔𝑧
– Heat transfer Ԧ𝑞 = −𝑘𝛻𝑇
– Unknowns(6) 𝜌 𝑢 𝑣 𝑤 𝑝 𝑇
– Equation of state 𝑝 = 𝑝(𝜌, 𝑇)
4
-
Introduction to CFD
• Governing Equations(Cont.)
– 2-D Navier-Stokes Equations in a vector form (4 scalar equations)
𝜕𝑄
𝜕𝑡+𝜕𝐸
𝜕𝑥+𝜕𝐹
𝜕𝑦=𝜕𝐸𝑣𝜕𝑥
+𝜕𝐹𝑣𝜕𝑦
– Conservation Variables
𝑄 =
𝜌𝜌𝑢𝜌𝑣𝜌𝑒
=
𝑞1𝑞2𝑞3𝑞4
– Flux vectors
𝐸 =
𝜌𝑢
𝜌𝑢2 + 𝑝𝜌𝑢𝑣
𝜌𝑒 + 𝑝 𝑢
𝐹 =
𝜌𝑣𝜌𝑢𝑣
𝜌𝑣2 + 𝑝
𝜌𝑒 + 𝑝 𝑣
𝐸𝑣=
0𝜏𝑥𝑥𝜏𝑥𝑦
𝑢𝜏𝑥𝑥 + 𝑣𝜏𝑥𝑦 − 𝑞𝑥
𝐹𝑣 =
0𝜏𝑥𝑦𝜏𝑦𝑦
𝑢𝜏𝑥𝑦 + 𝑣𝜏𝑦𝑦 − 𝑞𝑦
5
-
Introduction to CFD
• Solutions of Governing Equations– Non-linear PDEs(partial differential equations)
– Generally impossible to obtain analytic solutions
• Theoretical(Analytical) approach– Simplified equations with simplified physics for simple geometry
– Exact solutions for limited(specific) problems
– Asymptotic solutions for more problems (but, still limited)
– Solution is a continuous function in space (and time, if unsteady)
• Discretization methods of CFD– FDM(Finite Difference Method)
– FVM(Finite Volume Method)
– FEM(Finite Element Method)
– Solution is obtained as numbers at a finite number of discrete points
6
-
Discretization Methods
• FDM(Finite Difference Method)– the oldest method among CFD methods
– at each node Taylor series expansions are used
– finite-difference approximations to the derivatives of PDE
– commonly applied to structured grids
– for uniformly-spaced grid
7
𝜕𝜙
𝜕𝑥𝑖,𝑗
=𝜙𝑖+1,𝑗 − 𝜙𝑖,𝑗
∆𝑥+ 𝑂 ∆𝑥
𝜕𝜙
𝜕𝑥𝑖,𝑗
=𝜙𝑖+1,𝑗 − 𝜙𝑖−1,𝑗
2∆𝑥+ 𝑂 ∆𝑥2
𝜕𝜙
𝜕𝑥𝑖,𝑗
=−𝜙𝑖+2,𝑗 + 8𝜙𝑖+1,𝑗 − 8𝜙𝑖−1,𝑗 + 𝜙𝑖−2,𝑗
12∆𝑥+ 𝑂 ∆𝑥4
(𝐚𝐜𝐜𝐮𝐫𝐚𝐜𝐲 𝐝𝐞𝐭𝐞𝐫𝐢𝐨𝐫𝐚𝐭𝐞𝐬 𝐟𝐨𝐫 𝐧𝐨𝐧 − 𝐮𝐧𝐢𝐟𝐨𝐫𝐦 𝐠𝐫𝐢𝐝𝐬)
-
Discretization Methods
• FDM(Finite Difference Method)
– Euler equations in Cartesian Coordinates
𝜕𝑄
𝜕𝑡+𝜕𝐸
𝜕𝑥+𝜕𝐹
𝜕𝑦= 0
– Transformation by “Chain rule”
8
𝜕
𝜕𝑡=
𝜕
𝜕𝜏+𝜕𝜉
𝜕𝑡
𝜕
𝜕𝜉+𝜕𝜂
𝜕𝑡
𝜕
𝜕𝜂𝜕
𝜕𝑥=𝜕𝜉
𝜕𝑥
𝜕
𝜕𝜉+𝜕𝜂
𝜕𝑥
𝜕
𝜕𝜂
𝜕
𝜕𝑦=𝜕𝜉
𝜕𝑦
𝜕
𝜕𝜉+𝜕𝜂
𝜕𝑦
𝜕
𝜕𝜂
we can define the coordinate transformation
𝜉 = 𝜉 𝑥, 𝑦, 𝑡 ⇔ 𝑥 = 𝑥 𝜉, 𝜂, 𝜏𝜂 = 𝜂 𝑥, 𝑦, 𝑡 ⇔ 𝑦 = 𝑦 𝜉, 𝜂, 𝜏
𝜏 = 𝑡 𝑡 = 𝜏
𝜕𝑡𝜕𝑥𝜕𝑦
=
1 𝜉𝑡 𝜂𝑡0 𝜉𝑥 𝜂𝑥0 𝜉𝑦 𝜂𝑦
𝜕𝜏𝜕𝜉𝜕𝜂
𝒐𝒓, 𝒓𝒆𝒗𝒆𝒓𝒔𝒆𝒍𝒚
𝜕𝜏𝜕𝜉𝜕𝜂
=
1 𝑥𝜏 𝑦𝜏0 𝑥𝜉 𝑦𝜉0 𝑥𝜂 𝑦𝜂
𝜕𝑡𝜕𝑥𝜕𝑦
-
Discretization Methods
• FDM(Finite Difference Method)▪ The transformations are inverse of each other
1 𝜉𝑡 𝜂𝑡0 𝜉𝑥 𝜂𝑥0 𝜉𝑦 𝜂𝑦
=
1 𝑥𝜏 𝑦𝜏0 𝑥𝜉 𝑦𝜉0 𝑥𝜂 𝑦𝜂
−1
= 𝐽
𝑥𝜉𝑦𝜂 − 𝑦𝜉𝑥𝜂 −𝑥𝜏𝑦𝜂 + 𝑦𝜏𝑥𝜂 𝑥𝜏𝑦𝜉 − 𝑦𝜏𝑥𝜉0 𝑦𝜂 −𝑦𝜉0 −𝑥𝜂 𝑥𝜉
▪ Metrics of transformations : 𝜉𝑥 𝜉𝑦 𝜂𝑥 𝜂𝑦
(interpreted as the ratios of arc lengths in both space, 𝜉𝑥 =𝜕𝜉
𝜕𝑥≈
∆𝜉
∆𝑥)
▪ Jacobian of the transformations 𝐽 =𝜕 𝜉,𝜂
𝜕 𝑥,𝑦=
𝜉𝑥 𝜉𝑦𝜂𝑥 𝜂𝑦
= 𝜉𝑥𝜂𝑦-𝜉𝑦𝜂𝑥
▪ Inverse Jacobian 𝐽−1 = 𝑥𝜉𝑦𝜂 − 𝑥𝜂𝑦𝜉 (𝐽−1 ∶ 𝒄𝒆𝒍𝒍 𝒗𝒐𝒍𝒖𝒎𝒆 𝒊𝒏 𝒑𝒉𝒚𝒔𝒊𝒄𝒂𝒍 𝒅𝒐𝒎𝒂𝒊𝒏)
Euler equations in Curvilinear coordinates
9
𝜕 ෨𝑄
𝜕𝜏+
𝜕 ෨𝐸
𝜕𝜉+
𝜕 ෨𝐹
𝜕𝜂=0 with
෨𝑄 = 𝐽−1𝑄෨𝐹 = 𝐽−1(𝜉𝑡𝑄 + 𝜉𝑥𝐹 + 𝜉𝑦𝐺)෨𝐺 = 𝐽−1(𝜂𝑡𝑄 + 𝜂𝑥𝐹 + 𝜂𝑦𝐺)
-
Discretization Methods
• FVM(Finite Volume Method)– discretizes the integral form of the conservation equations
– computational domain is subdivided into a finite number of cells
– flow variables calculated at the centroid of each CV(Control Volume)
– interpolation is used to express variable values at the surfaces of CV
– used in most commercial codes
10
𝜕𝜙
𝜕𝑥=
1
∆𝑉න
𝑉
𝜕𝜙
𝜕𝑥dV =
1
∆𝑉න
𝑉
𝜙𝑑𝐴𝑥 ≈1
∆𝑉
𝑖=1
𝑁
𝜙𝑖𝑑𝐴𝑖𝑥
𝜕𝜙
𝜕𝑦=
1
∆𝑉න
𝑉
𝜕𝜙
𝜕𝑦dV =
1
∆𝑉න
𝑉
𝜙𝑑𝐴𝑦 ≈1
∆𝑉
𝑖=1
𝑁
𝜙𝑖𝑑𝐴𝑖𝑦
Advantages of FVM over FDM▪ it has good conservation properties▪ applicable to complicated physical domains
-
Grid Generation
• Grid– How the grid points are distributed affects not only the
accuracy of the flow solutions but the time it takes to obtain the flow solutions
• Grid Generation– Grid generation part of CFD analysis procedure is still a time-
consuming and labor-intensive process
– It requires experience and many man-hours
– It is usually a trial-and-error process
– Generally, it is agreed that grid generation is the bottle-neck for a routine application of CFD
11
-
Desirable Grid System
• A mapping which guarantees one-to-one correspondence
ensuring grid lines of the same family do not cross each other
• Smoothness of the grid point distribution with no discontinuities
• Orthogonality or near-orthogonality of the grid lines, especially to
the boundaries
• Grid point clustering in regions of interest
• In short, grid with good quality
12
-
Grid Type
• Structured grid
– Multi-block grid
– Patched grid
– Overset(Chimera) grid
• Unstructured grid
– Triangular grid
– Quadrilateral grid
– Polyhedral grid
• Hybrid grid
• Cartesian grid
13
-
Structured Grid Generation Schemes
• Algebraic scheme
• Conformal mapping
• PDE-based method
– Elliptic scheme
– Hyperbolic scheme
– Parabolic scheme
– Mixed scheme
• Variational method
14
-
Structured Grid Generation Schemes
• Algebraic scheme– Features
▪ Simplest grid generation technique
▪ Algebraic equation is used to distribute grid points
▪ Interpolation is used to generate interior points from the boundary points (boundary points should be provided)
▪ can be generated easily and takes small CPU time for calculation
▪ less smooth than grids by PDE schemes (propagation of slope discontinuities)
▪ often used as initial conditions for iterative elliptic scheme
▪ TFI(Transfinite Interpolation) is most popular
– Formulation of TFI scheme
𝑋 𝜉, 𝜂 =
𝑛=1
2
𝑎𝑛 𝜂 𝑋 𝜉, 𝜂𝑛 +
𝑚=1
2
𝑏𝑚 𝜉 𝑋 𝜉𝑚 , 𝜂 +
𝑛=1
2
𝑚=1
2
𝑎𝑛 𝜂 𝑏𝑚 𝜉 𝑋 𝜉𝑚 , 𝜂
• Linear Interpolants
𝑎1 𝜂 = 1 −𝜂−𝜂1
𝜂2−𝜂1𝑎2 𝜂 =
𝜂−𝜂1
𝜂2−𝜂1𝑏1 𝜉 = 1 −
𝜉−𝜉1
𝜉2−𝜉1𝑏2 𝜉 =
𝜉−𝜉1
𝜉2−𝜉1
15
-
Structured Grid Generation Schemes
• Conformal mapping– Features
▪ Conformal map: a function that preserves angles locally
▪ A function 𝑓: 𝑈 → 𝑉 is called conformal (or angle-preserving) at a point 𝑢0 ∈ 𝑈if it preserves oriented angles between curves through 𝑢0 with respect to their orientation
▪ Conformal map preserves both angles and the shapes of infinitesimally small figures
▪ It does not necessarily preserve their size or curvature
16
-
Structured Grid Generation Schemes
• PDE-based - Elliptic Scheme– Features
▪ entire boundary points should be specified (elliptic PDE=B.V.P.)
▪ proper for internal flows
▪ boundary slope discontinuity does not propagate into the interior
▪ slow due to its iterative solution procedure
▪ grid spacing and angle control through the control functions
▪ generates smooth grids, and most popular
– Formulation of Elliptic scheme𝛻2𝜉 = 𝑃 (𝜉𝑥𝑥 + 𝜉𝑦𝑦 = 𝑃)
𝛻2𝜂 = 𝑄 (𝜂𝑥𝑥 + 𝜂𝑦𝑦 = 𝑄)
Reversely 𝑎𝑋𝜉𝜉 + 𝑏𝑋𝜂𝜂-2c𝑋𝜉𝜂 = −𝐽−2(𝑃𝑋𝜉 + 𝑄𝑋𝜂)
Where,
a = 𝑋𝜂 ∙ 𝑋𝜂 b = 𝑋𝜉 ∙ 𝑋𝜉 c = 𝑋𝜉 ∙ 𝑋𝜂 𝐽−1 =
𝜕(𝑥,𝑦)
𝜕(𝜉,𝜂)
17
-
Structured Grid Generation Schemes
• PDE-based - Hyperbolic Scheme– Features
▪ generates by marching in the outward direction (non-iterative)
▪ boundary conditions need not be specified on all boundaries
▪ one boundary(usually along the body surface) is specified
▪ suitable for physically unbounded regions (external flows)
▪ generates orthogonal grids
▪ grid shocks can occur
– How it works▪ from selected grid points on the boundary, grid points are chosen by
marching outward with a given slope (normal to the previous grid line) and arc-length (or cell volume)
▪ solves 2 equations
∙ orthogonality (for marching direction)
∙ arc-length equation or cell-volume equation (for spacing control)
18
-
Structured Grid Generation Schemes
• PDE-based - Hyperbolic Scheme– Formulation of Hyperbolic scheme
▪ Arc-length approach : solves 2 equations given for
• Orthogonality 𝛻𝜉 ∙ 𝛻𝜂 = 0
• Arc-length specified (𝑑𝑠)2= (𝑑𝑥)2+(𝑑𝑦)2
From orthogonality relation 𝛻𝜉 ∙ 𝛻𝜂 = 𝜉𝑥𝜂𝑥 + 𝜉𝑦𝜂𝑦 = −𝐽(𝑦𝜂𝑦𝜉 + 𝑥𝜂𝑥𝜉)
Therefore, 𝑥𝜂𝑥𝜉 + 𝑦𝜂𝑦𝜉 = 0
Arc-length relation gives (𝑑𝑠)2= (𝑥𝜉𝑑𝜉 + 𝑥𝜂𝑑𝜂)2+(𝑦𝜉𝑑𝜉 + 𝑦𝜂𝑑𝜂)
2
And ∆𝑠 ≡𝑑𝑠
𝑑𝜂is specified (∆𝝃 = ∆𝜼 = 𝟏 (𝒅𝝃 = 𝒅𝜼 = 𝟏))
Then the arc-length relation becomes
(∆𝒔)𝟐= 𝑥𝜉𝟐 + 𝟐𝑥𝜂𝑥𝜉 + 𝑥𝜂
2 + 𝑦𝜉2 + 𝟐𝑦𝜂𝑦𝜉+𝑦𝜂
2=𝑥𝜉2+𝑥𝜂
2+𝑦𝜉2+𝑦𝜂
2 (← 𝑥𝜂𝑥𝜉 + 𝑦𝜂𝑦𝜉 = 0)
Introducing 𝑥𝑜, 𝑦𝑜 as values at a known position :
𝑥 = 𝑥𝑜 + ҧ𝑥 𝑦 = 𝑦𝑜 + ത𝑦
19
-
Structured Grid Generation Schemes
• PDE-based - Hyperbolic Scheme– Formulation of Hyperbolic scheme
▪ Arc-length approach
the final equation become
𝑥𝜂𝑜 𝑦𝜂
𝑜
𝑥𝜉𝑜 𝑦𝜉
𝑜
𝑥𝑦
𝜉+
𝑥𝜂𝑜 𝑦𝜂
𝑜
𝑥𝜉𝑜 𝑦𝜉
𝑜
𝑥𝑦
𝜂=
𝑥𝜉𝑜𝑥𝜂
𝑜 + 𝑦𝜉𝑜𝑦𝜂
𝑜
1
2(∆𝑠)2+(𝑥𝜉
𝑜)2+(𝑥𝜂𝑜)2+(𝑦𝜉
𝑜)2+(𝑦𝜂𝑜)2
or simply 𝐴𝑋𝜉 + 𝐵𝑋𝜂 = Ԧ𝑓
▪ We can solve this equation once we specify the distribution of points along
the boundary, and a means for selecting Δ𝑠
▪ This method works fine on convex surfaces.
▪ However, for concave boundaries much poorer results are found
20
(a) (b)
-
Structured Grid Generation Schemes
• PDE-based - Hyperbolic Scheme– Formulation of Hyperbolic scheme
▪ Cell-volume approach : solves 2 equations given for
• Orthogonality 𝑥𝜂𝑥𝜉 + 𝑦𝜂𝑦𝜉 = 0
• Cell-volume specified 𝑥𝜉𝑦𝜂 + 𝑥𝜉𝑦𝜂 = 𝐽−1 = 𝑉
after linearization of the equations
𝑥𝜂𝑜 𝑦𝜂
𝑜
𝑦𝜂𝑜 −𝑥𝜂
𝑜
𝑥𝑦
𝜉+
𝑥𝜉𝑜 𝑦𝜉
𝑜
−𝑦𝜉𝑜 𝑥𝜉
𝑜
𝑥𝑦
𝜂=
0𝑉 + 𝑉0
or, again simply
ሚ𝐴𝑋𝜉 + ෨𝐵𝑋𝜂 = Ԧ𝑔
21
-
Structured Grid Generation Schemes
• PDE-based - Hyperbolic Scheme– Advantages
▪ The grid system is orthogonal in two-dimensions
▪ Since a marching scheme is used for the solution of the system, computationally they are much faster compared to elliptic systems
▪ Grid line spacing may be controlled by the cell volume or arc-length functions
– Disadvantages▪ Extension to three-dimensions where complete orthogonality exists is not
possible
▪ They cannot be used for domains where the outer boundary is specified
▪ Boundary discontinuity may be propagated into the interior domain
▪ Specifying the cell-area or arc-length functions must be handled carefully. A bad selection of these functions easily leads to undesirable grid systems
22
-
Structured Grid Generation Schemes
• PDE-based - Parabolic Scheme– Features
▪ solved by marching in one direction (non-iterative)
▪ using elliptic equations(Laplace eqn, Poisson eqn) locally
▪ no grid shocks occur due to natural diffusions(2nd order derivatives)
▪ outer boundary influence can be included in the marching process
▪ difficulties in orthogonality control
▪ solves elliptic equations in a marching fashion
– Formulation of Parabolic scheme
𝜕𝑥
𝜕𝜂− 𝐴
𝜕2𝑥
𝜕𝜉2= 𝑆𝑥
𝜕𝑦
𝜕𝜂− 𝐴
𝜕2𝑦
𝜕𝜉2= 𝑆𝑦
23
𝑆𝑥 , 𝑆𝑦 : source terms
𝐴 : specific constant
-
Structured Grid Generation Schemes
• PDE-based – Mixed Scheme– Features
▪ combination of different PDE schemes
▪ take advantage of desirable features of each scheme
▪ mixing in the equation level, in the calculation level, or in the result level
▪ Ex) Hyperbolic marching + Elliptic smoothing
24
-
Structured Grid Generation Schemes
• PDE-based – Mixed Scheme– Comparison of resultant Grids
▪ C-type grid for an Airfoil
▪ Hyperbolic scheme vs. Mixed scheme
25
(a) Hyperbolic scheme (b) Mixed scheme
-
Surface Grid Generation
• Surface mesh generation
– Useful for surface panel method
26
-
Edge Point Distribution
• 1-D Point Distribution
– Grid generation as B.V.P.(Boundary Value Problem)
– Node distribution along boundary is needed
• Stretching Functions
– Exponential
– Cubic polynomial
– Hyperbolic tangent
– Hyperbolic sine
27
-
Grid Adaptation
• Grid Adaptation
28
(a) Before
(b) After
-
29
Measures of Grid
• Measures of Grid– Availability of flow solvers
– Accuracy and efficiency of flow solvers
– Turn-around time of final grids
– Ease for generation
– Block generation (structured grid)
– Automation level
– Adaptation
– Grid quality
– Surface grid generation
– Multi-body problems
– Bodies in relative motion
– CAD-CFD data interface