You are on page 1of 28

Grid generation

Grid over the flat plate

MEE4006 Computational Fluid Dynamics


Dr. Abhishek Chintagunta
Introduction

Most flows in engineering practice
involve complex geometries which
are not readily fit with Cartesian
grids. For example, the flow over
turbine blades, full car body, etc.

Although the principles of
discretization and solution
methods for algebraic systems
described may be used, many
modifications are required. Like
the choice of the placement of
pressure, velocity, etc.
Choice of grid - 1

When the geometry is regular (e.g. rectangular
or circular), choosing the grid is simple: the grid
lines usually follow the coordinate directions
(Cartesian or polar, or spherical) i.e.,
orthogonal – the curvilinear grid lines are
perpendicular to each other.

In complicated geometries, the choice is not at
all trivial. The grid is subject to constraints
imposed by the discretization method. Cartesian grids : Cylindrical grid,
– If the algorithm is designed for curvilinear
rectangular grid (structured / unstructured)
orthogonal grids, non-orthogonal (the grid lines
intersect at oblique lines) grids cannot be used; are
required to be quadrilaterals or hexahedra, grids
consisting of triangles and tetrahedra cannot be
used, etc.

When the geometry is complex and the
constraints of the algorithm are not met, Non-orthogonal : triangular
compromises have to be made. (unstructured)
Choice of grid - 2

Overlapping (chimera) grids:
– One can combine rectangular,
cylindrical, spherical or non-
orthogonal grids near bodies with
Cartesian grids in the rest of the
solution domain.
– But the coupling of such grids
results in complex codes.
– The overlapping grids could be
non-uniform. And the difficulty lies Chimera grid : cylindrical grid overlapped on a
in the interpolation of the solution rectangular grid
between the grids.
Choice of grid - 3

Boundary-Fitted Non-Orthogonal Grids
– These grids could be structured, block-structured, and
unstructured
– The advantage of such grids is that they can be adapted
to any geometry, and that optimum properties are easier
to achieve than with orthogonal curvilinear grids.
– Non-orthogonal grids have also several disadvantages.
Increase in both the difficulty of programming and the cost
of solving the equations (due to unstructured data
structure).
– The grid non-orthogonality may cause unphysical
solutions and the arrangement of variables on the grid
affects the accuracy and efficiency of the algorithm.
– Non-quad (in 2D), Non-hex (in 3D) would result in severe Body-fitted grid : Triangular
reduction in the order-of-accuracy of the scheme. Tri/Tets elements, we could also have
based grids are easy to generate. quads
Block structured mesh
Unstructured polyhedron grid over
a racing car

Unstructured tetrahedron grid


over a racing car
General element types used in CFD
Higher-order elements
Grid generation process

The process of grid-generation for complex
geometries normally involves following steps:
– Decompose the problem domain into a set of sub-domains
(blocks). In each block, generate the requisite grid.
– Typical sequence of operations would be:

Generate edge-grid (i.e. divide the edges of a surface in desired
number of one dimensional elements).

Using the edge grids, generate the grid on the block-surfaces.

Use surface grids as input to generate volume mesh.

Check mesh quality, and modify the mesh as required.
Grid generation methods - 1
Grid or mesh is an arrangement of discrete set of grid points or cells needs to be
generated for the numerical solution of PDEs (fluid conservation equations)

Finite volume methods: Can be applied to uniform and non-uniform grids

Finite difference methods:
– Require a coordinate transformation to map the irregular grid in the physical spatial domain
to a regular one in the computational domain
– Difficult to do this in complex 3D spatial geometries
– So far, only used with structured grid

Three major classes of (structured) grid generation: i) conformal mapping methods
ii) algebraic methods, iii) differential equation methods. Unstructured grid
generation also has its set of methods.

Grid generation and solving PDE can be independent
– A numerical (flow) solver can in principle be developed independently of the grid
– A grid generator then gives the metrics (weights) and the one-to-one correspondence
between the spatial-grid and computational-grid
Grid generation methods - 2
Grid generation methods - 3

Consider a viscous flow solution on a
given body, where the velocity varies
rapidly near the surface of the body
(Boundary Layer)

For efficient computation, a finer grid
near the body and coarser grid away
from the body is effective (aims to
maintain constant accuracy)

Possible coordinate transformation: a
scaling “η = log (y)” ↔ “y = exp(η)”

β varies from [1,infinity], β closer to 1
imples more points near the wall
Grid generation methods - 4

Inverse transformation is
needed to map solutions back
from ξ, η domain

The question is to solve the
PDEs in the computational
space (ξ, η) system rather than
the physical space (x,y).

To do this lets see the example
of the continuity equation in
the conservation form.
Grid generation methods - 5

In the computational plane, this equation becomes (using the chain rule)


We know from the stretching function that


The continuity equation becomes
Grid generation methods – 6
Algebraic method

Multi-directional interpolation (Transfinite
Interpolation)
– To generate algebraic grids within more complex
domains or around more complex configurations, multi-
directional interpolations can be used
– They consist of a suite of unidirectional interpolations

Unidirectional Interpolations (1D curve)
– The Cartesian coordinate vector of any point on a curve
r(x,y) is obtained as an interpolation between given
points that lie on the boundary curves
– We can interpolate normally using Lagrange polynomials
or Hermite polynomials. These polynomials fit a single
polynomial from one boundary to the next as shown.

Grid generation methods – 7
Algebraic method

C grid around an ellipse using C grid around an ellipse using


Unidirectional Lagrange Inteprolation Unidirectional Lagrange Inteprolation
With Hyperbolic Tangent Spacing
Grid generation methods – 8
PDE method

We solve for (ξ, η) as functions of (x,y) using Lapace PDE (mostly
used – elliptic grid generators) or hyperbolic PDEs.

First a boundary value problem (BVP) is defined which input the
boundaries in (x,y).

The selected PDEs are solved for inverted and solved for (x,y) such
that we get x, and y as functions of (ξ, η).

Values of x and y given by the solution at the grid nodes in the
computational plane now directly give the cartesian co-ordinates of
the grid nodes in the physical plane.
Assessing mesh quality - 1

The mesh quality can determine :
– the rate of convergence (i.e., how much the numerical
solution reaches the expected solution),
– the resolving of flow features like boundary layer,
turbulence, etc

Some metrics can be employed to access the
mesh quality.
Assessing mesh quality - 2

Smoothness : Rapid changes in the cell volumes of adjacent cells will result
in larger truncation errors.

Cell shape metrics - Skewness
– It is defined as the difference between the shape of the cell and the shape of
an equilateral cell of equivalent volume. Highly skewed cells can decrease
accuracy and destabilize the solution.
– For example, optimal quadrilateral meshes will have vertex angles close to 90
degrees, while triangular meshes should preferably have angles of close to 60
degrees and have all angles less than 90 degrees.
– A general rule is that the maximum skewness for a triangular/tetrahedral mesh
in most flows should be kept below 0.95, with an average value that is less
than 0.33. A maximum value above 0.95 may lead to convergence difficulties.
– For hex cells maximum skewness should not exceed 0.85
Optimum Cell Size - Actual cell size
Skewness 
Optimum cell Size
Assessing mesh quality - 3

Cell shape metric - Aspect ratio
– It is a measure of the stretching
of the cell. It is the ratio of the
longest side to the shortest side.
– Generally, it is best to avoid
aspect ratios in excess of 5:1 in
the bulk flow (away from the
walls).
– The quadrilateral / hexahedral /
wedge cells inside the boundary
layer, on the other hand, can be
stretched to aspect ratio of up to
10:1 in most cases.
The choice of variable arrangement

In FDM and FVM methods we employ both the grid points
as well as the control volumes (i.e. the volume bound by the
grid points).

The next question is where should I place scalars (density,
pressure, temperature) and vector (velocity) variables for
non-orthogonal grids.

We can think of three ways
– Staggered (different location for scalars and vector) - grid-oriented
– Staggered - Cartesian
– Collocated (same location for scalars and vector) - Carteisan

(a) First arrangement is staggered, but the velocity vector is
oriented to the grid faces.

(b) Second arrangement is staggered. Velocity is oriented to
(x,y) axis and scalars are at the center of the CV.

(c) Third, all the flow variables are at the same location.
The choice of variable arrangement - 3

Staggered grid with the velocity oriented to the
faces is suitable (but is achieved via face
normals).

It also improves pressure-velocity coupling.
Choice of velocity components

Cartesian :
– In FDM we use both grid points and the control-volumes i.e., the area/
volume in which we are dividing the grid. Whereas, in FVM we use
only control-volumes.
– In FVM methods, normally, there is no need for coordinate
transformations in the PDEs: a local coordinate transformation can be
used for the gradients normal to the cell faces.

Grid-oriented:
– Non-conservative source terms appear in the equations (they account
for the re-distribution of momentum between the components)
– For example, in polar-cylindrical coordinates, in the momentum
equations: Apparent centrifugal force and apparent Coriolis force

You might also like