Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Computational Fluid Dynamics Course: Grid Generation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Computational Fluid Dynamics Course

Grid Generation

Ramesh K. Agarwal
Washington University in St. Louis, MO 63130, USA
Phone: +1-314-935-6091, Email: rka@wustl.edu

SV National Institute of Technology, Surat, India, 5-9 July 2010


GRID GENERATION
Body-Conforming Grids
 Determine the Metric of Transformation from a Cartesian System to a Curvilinear
Orthogonal System
• 2D Conservation Equations in Cartesian Coordinates

∂Q ∂E ∂F
+ + =0
∂t ∂x ∂y
• 2D Conservation Equations in Curvilinear Coordinates

∂Qˆ ∂Eˆ ∂Fˆ


+ + =0
∂t ∂ξ ∂η
Qˆ = JQ , Eˆ = J (ξ t Q + ξ x E + ξ y F ) , Fˆ = J (η t Q + η x E + η y F )
J = ( xξ yη - yξ xη )
yη xη yξ xξ
ξx = J
, ξy = -
J
, ηx = -
J
, ηy =
J
Grid Requirements for a Given Problem

 The generation of appropriate grid for a problem is very critical in obtaining an


accurate solution efficiently. A coarse grid will result in a less accurate solution; on
the other hand a fine grid will be inefficient.

 There are certain general guidelines that are normally employed in generating a
suitable grid for a given application. Near solid or porous walls, the grid must be
very fine for calculating skin-friction and heat transfer. For turbulent flow, the first
grid point away from the wall should be at y+ < 2, if a low Reynolds number form of
the two-equation turbulence model is employed. With standard model, with the use
of wall functions, y+ ~ 20 may be O.K. However, the use of wall functions in general
is not recommended, especially for complex flows.

 In other regions of high flow or temperature gradients such as shear layers, jets
and wakes, the grid should be fine enough to capture the gradients using a second-
order solver. This requires some knowledge of the expected flow features on the part
of the user unless a solution-adaptive grid approach is employed which
automatically arranges the grid density appropriately.
Grid Requirements for a Given Problem (Cont.)
 In practice, the solution should be computed on at least two grids, a coarse
and a fine grid. It provides the user some idea about the dependence of the
solution on grid density. Based on these two solutions, an appropriate grid can
be generated that would result in almost grid independent solution.

 In viscous flow regions such as boundary layers, a structured grid is


recommended. An unstructured grid is not desirable because it will require too
many cells to resolve the turbulent boundary layer accurately or will result in
an inaccurate solution due to long elongated wafer-like triangular cells.
The best approach in these situations is to employ a hybrid grid as mentioned
before. The solver will not know the difference so long as the two types of grids
are properly matched point-by-point at the interface.

 It is very difficult to determine a good grid a-priori except using the above
guidelines. The visualization can be very helpful in generating a good grid as a
first guess.
Grid Generation

• Elliptic grid generation

• Algebraic (multi-surface method and transfinite


interpolation)

• Hyperbolic grid generation

• Parabolic grid generation

• Mesh morphing
Geometric Complexity – Grid Types
• Single block structured
• Multiple block structured (zonal)
• Single block unstructured
• Multiple block unstructured
• Patched and overset grids
• Cartesian grids with nested refinement
• Adaptive meshes
• Moving meshes
Grid Types
Cartesian Single Block
Structured

Multi-Block Chimera/
Structured Overset

Unstructured Hybrid
Properties of Good Grids
Structured Grids: It should be noted that the governing equations of fluid flow
are almost always written in orthogonal coordinate system. A good grid should
reflect this property for obtaining a good solution, when solving the equations in
differential form. Thus, the grid lines should be orthogonal as much as possible.
Additionally, they should not be skewed and should not have any cross-overs and
kinks. Even with the finite-volume method, these properties are important for
accurate calculation of fluxes across the cell faces and cell volumes (Jacobians).

Unstructured Grids: These grids are used with finite-volume or finite-element


methods. While orthogonality is not an issue with these grids, the skewness is a
major concern. The elongated wafer-like cells are not desirable. These grids are
most widely employed today, especially for treating complex configurations.

Hybrid Grids: In some applications, a combination of structured and


unstructured grids is preferable to make use of the good features of each type to
preserve the accuracy in all regions (boundary layers, shear layers etc.) of the
flow. In such cases, it should be ensured that the grid points at the interface of
two types of grids are exactly matched. Mismatch gives rise to inaccuracy and
instability in the solution process.
GRID GENERATION
Body-Conforming Grids
Metric of Transformation from a Cartesian System to a Curvilinear Orthogonal System

• 2D Conservation Equations in Cartesian Coordinates

∂Q ∂E ∂F
+ + =0
∂t ∂x ∂y
• 2D Conservation Equations in Curvilinear Coordinates

∂Qˆ ∂Eˆ ∂Fˆ


+ + =0
∂t ∂ξ ∂η
Qˆ = JQ , Eˆ = J (ξ t Q + ξ x E + ξ y F ) , Fˆ = J (η t Q + η x E + η y F )
J = ( xξ yη - yξ xη )
yη xη yξ xξ
ξx = J
, ξy = -
J
, ηx = -
J
, ηy =
J
GRID GENERATION
2D Body-Conforming Structured Grids

C-Grid:

H-Grid:

O-Grid:

Hybrid Topologies: The combination of the above two


ELLIPTIC GRID GENERATION
Body-Conforming Structured Grids
Orthogonal Net

Example: Potential Flow Past a Circular Cylinder

Potential lines and Stream lines form a orthogonal net and represent a body conforming
orthogonal curvilinear grid around the circular cylinder.
∂Φ
∇2Φ = 0 , = 0 at r = a
∂r
∇ 2 Ψ = 0 , Ψ = 0 at r = a
Φ − lines

Ψ=0
ELLIPTIC GRID GENERATION
Body-Conforming Structured Grids

O-Topology:

C-Topology:
ELLIPTIC GRID GENERATION
2-D Body-Conforming Structured Grids

• Governing Equations:

∂ 2ξ ∂ 2ξ ∂ 2η ∂ 2η
+ 2 =0 , + 2 =0
∂ x ∂ y
2
∂ x ∂ y
2

• Grid Point Control in the Interior of the Domain

ξ xx + ξ yy = P (ξ ,η )
η xx + η yy = Q (ξ ,η )
• Governing Equations with (x, y) as Dependent Variables:

α xξξ − 2β xξη + γ xηη = − J 2 ( Pxξ + Qxη )


α yξξ − 2β yξη + γ yηη = − J 2 ( Pyξ + Qyη )
α = xη 2 + yη 2 , β = xξ xη + yξ yη , γ = xξ 2 + yξ 2
J = xξ yη − xη yξ
ELLIPTIC GRID GENERATION
2-D Body-Conforming Structured Grids
• Governing Equations due to Middlecoff & Thomas
P (ξ ,η ) = α ⋅ Φ (ξ ,η ) , Q (ξ ,η ) = γ ⋅ Ψ (ξ ,η )
α ( xξξ + Φxξ ) − 2β xξη + γ ( xηη + Ψxη ) = 0
α ( yξξ + Φyξ ) − 2 β yξη + γ ( yηη + Ψyη ) = 0

• Θ = π/2 for orthogonal grids

• We want to control grid spacing ∆s


ELLIPTIC GRID GENERATION
2-D Body-Conforming Structured Grids

• Orthogonality Condition
⇒ ∇ξ ⋅ ∇η = ∇ξ ⋅ ∇η ⋅ cosθ
1

ξ xη x + ξ yη y = (ξ x + ξ y
2 2
)(η x
2
+ η y )  cosθ
2 2
(1)
1

or xξ xη + yξ yη = − ( xξ 2 + yξ 2 )( xη 2 + yη 2 )  cosθ 2
(2)

⇒ ∇ξ × ∇η = ∇ξ ⋅ ∇η ⋅ sin θ
1 1

ds = ( dx ) + ( dy )  = ( xξ d ξ + xη dη ) + ( yξ d ξ + yη dη ) 
2 2 2 2 2 2
   
Along ξ = constant line , d ξ = 0
1 1
⇒ ds = ( xη + yη ) dη or = sη = ( xη + yη )
2 2 2 ds 2 2 2


⇒ Equations (1) and (2) become
xξ xη + yξ yη = − sη ( xξ 2 + yξ 2 ) cosθ (3)

xξ yη − xη yξ = sη ( xξ 2 + yξ 2 ) sin θ (4)
ELLIPTIC GRID GENERATION
2-D Body-Conforming Structured Grids

• Boundary Condition

For θ=π/2, solve Equations (3) and (4) for xη and yη


1 1
xη = −sη yξ ( xξ 2 + yξ )
2 2
, yη = sη xξ ( xξ 2 + yξ )
2 2

• On the boundary:
 1
  1

( η )b ( η )b  yξ
x = − s ( xξ 2 + yξ )
2 2
 b ( η )b ( η )b xξ
, y = s ( xξ 2 + yξ )
2 2

   b
• Determine Φ and Ψ on the boundary:
2β γ
Φ = − ( yη xξξ − xη yξξ ) + ( xξη yη − yξη xη ) −
( yη xηη − xη yηη )
α α
2β γ
Ψ = ( yξ xηη − xξ yηη ) − ( x y
ξη ξ − yξη ξ )
x + ( yξ xξξ − xξ yξξ )
α α
ELLIPTIC GRID GENERATION
2-D Body-Conforming Structured Grids

• Numerical Solution Procedure:

1. Determine Φ and Ψ in the interior of the domain by interpolating the


boundary data. This gives an initial data surface for Φ and Ψ at iteration n =
0
2. Determine the initial data surface for x and y in the interior of the domain by
interpolating the boundary data for x and y (n = 0)
3. Discretize the elliptic grid generation equations due to Middlecoff and
Thomas by second-order central difference and use a relaxation algorithm
(Point Gauss-Seidel for example) for the solution starting from the initial data
at n = 0
4. Repeat steps (1) – (3) until the convergence is achieved to a user specified
tolerance

You might also like