41
Grid and Mesh Generation Introduction to its Concepts and Methods

Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

  • Upload
    others

  • View
    21

  • Download
    5

Embed Size (px)

Citation preview

Page 1: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Grid and Mesh Generation

Introduction to its Concepts and Methods

Page 2: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Elements in a CFD software system

Page 3: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Introduction

• What is a grid ?– The arrangement of the discrete points

throughout the flow field is simply called a grid.

• What is grid generation ?– The way that a grid is determined is called grid

generation.

Page 4: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Introduction• Why is grid generation necessary ?

– The standard finite difference methods require a uniformly spaced rectangular grid.

– If a rectangular grid is used, few grid points fall on the surface.

– Flow close to the surface being very important in terms of forces, a rectangular grid will give poor results in such regions.

The rectangular grid is not appropriate for solution of the flow field.

Page 5: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Introduction• How to overcame those problems ?

– Use a nonuniform, curvilinear grid to make the grid points naturally fall on the airfoil surface.

• The grid is not rectangular and is not uniformly spaced.

• The conventional difference equations are difficult to use.

• Need to transform the curvilinear grid in physical space (x,y) to a rectangular grid in computational space (ξ, η).

Page 6: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Introduction

• The procedure is as follows:– Establish the transformation relations between the

physical space and the computational space

– Transform the governing equations and the boundary conditions into the computational space.

– Solve the equations in the computational space using the uniformly spaced rectangular grid.

– Perform a reverse transformation to represent the flow properties in the physical space.

Page 7: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Outline• General transformation

• Grid Generation– Stretched (compressed ) grids

– Boundary-fitted coordinate system

– Adaptive grids

– Some modern development in grid generation

• Mesh Generation for Finite-Volume Method– Unstructured Meshes– Cartesian Meshes

Page 8: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Physical Space & Computational Space

• If the airfoil is cut and the surface straightened out, it would form the x-axis.

• Similarly, the outer boundary would become the top boundary of the computational domain.

• The left and right boundaries of the computational domain would represent the cut surface.

• Note the locations of points a, b, and c in the two figures.

Page 9: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

General transformation

• The basic idea behind grid generation is the creation of the transformation laws between the physical space and the computational space.

• There is a one-to-one correspondence between the physical space and the computational space.– Each point in the computational space represents a point in the

physical space.

• These laws are known as the metrics of the transformation.

Page 10: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Transformation Relationship

),,(),,(),,,( zyxandzyxzyx ζζηηξξ ===

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

zyx

zyx

zyx

www

vvv

uuu

zw

yw

xw

zv

yv

xv

zu

yu

xu

ζζζ

ηηη

ξξξ

ζηξ

ζηξ

ζηξ

Jacobin matrix

⎥⎥⎥⎥

⎢⎢⎢⎢

=

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

ζηξ

ζηξ

ζηξ

zzz

yyy

xxx

J 1

⎥⎥⎥⎥

⎢⎢⎢⎢

=

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

∂∂

zyx

zyx

zyx

Jζζζ

ηηη

ξξξ

Page 11: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

• Evaluation of the Transformation ParametersTypically the mapping is only defined at grid and the transformation parameters must be evaluated numerically.

The same means of discretization should be used for the evaluation of the transformation parameters and the derivative in the governing equations

kjkj

kjkj xxx

,1,1

,1,1

−+

−+

−≈

ξξξ1,1,

1,1,

−+

−+

−≈

kjkj

kjkj xxx

ξηη

kjkj

kjkj yyy

,1,1

,1,1

−+

−+

−≈

ξξξ1,1,

1,1,

−+

−+

−≈

kjkj

kjkj yyy

ξηη

2,1,,1 2

ξξξ∆

+−= +− kjkjkj xxx

x

21,,1, 2

ηηη∆

+−= +− kjkjkj xxx

x

Page 12: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

• The governing equations in generalized coordinatesThe continuity equation in Cartesian coordinates

The continuity equation in generalized coordinates

0)()()( =++ ηξρρρ

JV

JU

J

cc

t

vuU yxc ξξ +=where vuV yx

c ηη +=

0=∂∂

+∂∂

+∂∂

yv

xu

tρρρ

Page 13: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Formulation of grid generation problems• In the view of physics

– Find out topological correspondence between the physical and computational domains

• In the view of mathematics– Given x = xb(ξ, η) and y = y b(ξ, η) on the boundary ∂R.– Generate x = x(ξ, η) and y = y (ξ, η) in the region R bounded by ∂R

Page 14: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Grid Generation Methods

• Algebraic methods

• Elliptic Grid Generation

• Adaptive grids

• Some examples of modern development in grid generation– 3-D dimensional boundary-fitted coordinate + adaptive grid

– Zonal grids

– Hybrid scheme

– Overlapping block

Page 15: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Algebraic Methods

• Concepts– Known functions are used to map irregular physical

domain into rectangular computational domains.

• Examples– Stretched (compressed ) grids

– Boundary Fitted Coordinate System

Page 16: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Example: Stretched (compressed ) grids

• Grid stretching may be necessary for some problems such as flow with boundary layers.

• Consider the transformation:

)1ln( +==

yx

ηξ

Inverse transformation

1−=

ξ

eyx

Page 17: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Example: Stretched (compressed ) grids

• The following derivatives are used in the transformation

1, 0

10, 1

x y

x y y

ξ ξ

η η

∂ ∂= =

∂ ∂∂ ∂

= =∂ ∂ +

1, 0

0,

x y

x y eξ ξ

ηη η

= =

= =

)1ln( +==

yx

ηξ

1−=

ξ

eyx

Page 18: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Example: Stretched (compressed ) grids

• The relation between increments ∆y and ∆η

Therefore as η increases, ∆y increases exponentially.

Thus we can choose ∆η constant and still have an exponential stretching of the grid in the y-direction.

ηηη

ηηη ∆=∆⇒=⇒= eydedyeddy

Page 19: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Example: Stretched (compressed ) grids

• Transform the continuity equation

Note there is relation between (x,y) plane and (ξ,η) plane

Page 20: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Example: Stretched (compressed ) grids

Substitute for the derivatives in Eq. (5.54) to get

Eq. (5.57) is the continuity equation in the computational domain.

Thus we have transformed the continuity equation from the physical space to the computational space.

Page 21: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Boundary Fitted Coordinate System

• Here we consider the flow through a divergent duct

– de is the curved upper wall

– fg is the centerline.

• Let ys = f(x) be the function that represents the upper wall.

• The following transformation will give rise to a rectangular grid.

max

(5.65)/ (5.66)

xy y

ξη==

Page 22: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Boundary Fitted Coordinate System

• Example:2

max

2max

3

2 2

.......1 2

,

1, 0

2 2 2

1 1

y x xy yx

y x

x yy

x x x

y x

ξ η

ξ ξ

η η ηξ

ηξ

= ≤ ≤

= = =

∂ ∂= =

∂ ∂∂

= − = − = −∂∂

= =∂

Page 23: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Elliptic Grid Generation• The grid generation problem can be considered as a

boundary-value problem, where the boundary conditions (namely, values of x and y) are known everywhere along the boundary.

Given x = xb(ξ, η) and y = y b(ξ, η) on the boundary ∂R.

Generate x = x(ξ, η) and y = y (ξ, η) in the region R bounded by ∂R.

The transformation can be defined by an elliptic partial differential equation.

Page 24: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Elliptic Grid Generation• Simplest elliptic equations

• Comments• The elliptic equations are chosen to relate ζ and η to x and y

and hence constitute a transformation ( one-to-one correspondence of grid points) from the physical plane to the computational plane.

0

0

2

2

2

2

2

2

2

2

=∂∂

+∂∂

=∂∂

+∂∂

yx

yxηη

ξξ

Page 25: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Elliptic Grid Generation• An Example:

Page 26: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Adaptive Grids• Motivation

– Grid generation is important for the solution of CFD

Page 27: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Adaptive Grids

• Motivation - Why need adaptive grids ?– We should put more grid points in the flow field with

large gradients, and put less grid points in the flow field with small gradients.

– How do we know in advance where the major action is going to occur in the flow without actually solving the problem ?

– An adaptive grid is a solution !

Page 28: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Adaptive Grids• What is an adaptive grid ?

– A grid network that automatically clusters grid points in the regions of high flow-field gradient;

– It uses the solution of the flow-field properties to locate the grid points in physical plane.

– It is intimately linked to the flow-field solution and changes as the flow field changes.

• During the course of the solution, the grid points in the physical plane move in such a fashion to adapt to regions of large flow-field gradients as these gradients evolve with time.

• It became stationary only when the flow solution approach a steady state.

Page 29: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Adaptive Grids

• Example

Page 30: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Some Modern Developments• 3-D dimensional boundary-fitted coordinate + adaptive grid

F-20

Page 31: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Some Modern Developments

• Zonal grids (Multi-block methods)– The grid consists of two or more blocks– Each block is a separate grid different from the others.

Page 32: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Some Modern DevelopmentsA zonal grid wrapped an F-16 airplane.

Surface grid is shown as part of a 20-block grid.

Page 33: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Some Modern Developments in Finite-Volume Mesh Generation

• What is a structured mesh ?– The grid lines in physical space pertain to constant coordinate

values ζ, η and ζ in the transformed space.

– A given family of coordinate lines do not intersect.

• What is an unstructured mesh ?– Nonuniform grids in physical space, not necessarily having the

features of a structured mesh.

• The finite-volume calculations can be made directly in the physical plane on a nonuniform mesh.

Page 34: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Some Modern Developments in Finite-Volume Mesh Generation

• Examples for structured meshes and unstructured meshes

unstructured meshesstructured meshes

Page 35: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Return to Cartesian Meshes

• Ordinary Cartesian Meshes– Easy to generate rectangular cells

– Not accurate in the region adjacent to the body surface

• Modified Cartesian Meshes– The mesh cells away from the body can be rectangular

– Those cells adjacent to the body can be modified in the shape such that one side of each cell is along the body surface.

Page 36: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Return to Cartesian Meshes

• Schematic diagram of modified Cartesian meshes

Page 37: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Return to Cartesian Meshes

• Modified Cartesian meshes + Adaptive concept

A Cartesian mesh for the calculation of the subsonic flow over multielement airfoil

Page 38: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Return to Cartesian Meshes• Modified Cartesian meshes + Adaptive concept

A Cartesian mesh for the calculation of the hypersonic flow over a double ellipsoid, a configuration somewhat like the space shuttle

Page 39: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Overlapping block• This approach consists of building partially overlapping blocks.

• Boundary conditions need to be exchanged at the interface between domains and this is usually done through some form of interpolation.

Page 40: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Hybrid scheme• The hybrid scheme takes advantage of both unstructured and

structured methods by applying structured body fitted coordinates to the body and unstructured networks in the outer boundaries.

Page 41: Grid and Mesh Generation - nuaa.edu.cnaircraftdesign.nuaa.edu.cn/aca/Slide/22-Grid Generation.pdf · Elliptic Grid Generation • The grid generation problem can be considered as

Final Remarks

• A transformation is required for finite-difference methods, because the finite-difference expressions are evaluated on the uniform grid.

• A transformation is inherently not required for finite-volume methods, because it can deal directly with a nonuniform mesh in the physical plane.