0% found this document useful (0 votes)
74 views55 pages

CH Lecture 6

This document discusses discretization methods for fluid flow simulations. It begins by explaining that numerical methods are needed to approximate solutions for equations that lack analytical solutions. The key points are: - Discretization transforms continuous computational domains into discrete subdomains, allowing equations to be solved using computers by evaluating variables at discrete points. - It involves dividing space and time into grid cells/elements defined by nodes. Structured grids use orthogonal lines while unstructured grids can handle complex geometries. - Finite difference and finite volume methods require space and time discretization, transforming differential equations into algebraic equations that can be solved simultaneously on the grid.

Uploaded by

Sohail Sakhani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views55 pages

CH Lecture 6

This document discusses discretization methods for fluid flow simulations. It begins by explaining that numerical methods are needed to approximate solutions for equations that lack analytical solutions. The key points are: - Discretization transforms continuous computational domains into discrete subdomains, allowing equations to be solved using computers by evaluating variables at discrete points. - It involves dividing space and time into grid cells/elements defined by nodes. Structured grids use orthogonal lines while unstructured grids can handle complex geometries. - Finite difference and finite volume methods require space and time discretization, transforming differential equations into algebraic equations that can be solved simultaneously on the grid.

Uploaded by

Sohail Sakhani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 55

Discretization of Fluid Flow

Domain
3.1. Discrete solutions of equations
 In the previous lectures the engineering problems were represented
by equations. Many of the equations do not have an analytical
solution.
 There are two approaches to find the values of the unknown
function of the equations; one is to make further assumptions such
that the equations are simplified and brought to a form which has an
analytical solution; and another is to develop approximate solutions
using numerical methods.
 The approach of simplifying the equations was successfully used in
the past when computers were not available. The draw back of such
an approach is that the solutions are valid just for a very limited
number of simple engineering problems.
 The approach of using numerical methods has been used and
developed extensively as computer power grew with time. In order
to apply the method of finding a solution for a differential equation
through numerical approximation, the computational domain (space
and time) has to be transformed from a continuum domain into a set
of subdomains, where the equations are still valid.
 The procedure of transforming the space and time of the
computational domain into smaller parts is called discretization.
 With such an approach the infinite number of degrees of freedom of
continuous equations is transformed into a finite number, which can
be solved using a computer, because the continuous unknown
variables are evaluated on the subdomain as discrete values. Hence
the smaller the discretization, the smaller is the approximation error.
 There are different methods to discretize a computational domain,
and in general the choice of the discretization method depends on
the numerical method used for the solution of the equations. Each
discretization method has its advantages and disadvantages.
 The discretization of the computational domain in smaller parts, is
done by a so-called computational grid, defined by nodes (or
points). Nodes are defining cells.
• The grid:
– Designates the cells or elements on which the flow is solved.
– Is a discrete representation of the geometry of the problem.
– Has cells grouped into boundary zones where b.c.’s are applied
Geometry
• The starting point for all problems is a “geometry.”
• The geometry describes the shape of the problem to be analyzed.
• Can consist of volumes, faces (surfaces), edges (curves) and
vertices (points).

Geometry can be very simple... … or more complex

geometry for
a “cube”

5
Geometry creation
• Geometries can be created top-down or bottom-up.
• Top-down refers to an approach where the computational domain
is created by performing logical operations on primitive shapes
such as cylinders, bricks, and spheres.
• Bottom-up refers to an approach where one first creates vertices
(points), connects those to form edges (lines), connects the edges
to create faces, and combines the faces to create volumes.
• Geometries can be created using the same pre-processor
software that is used to create the grid, or created using other
programs (e.g. CAD, graphics).

6
Typical cell shapes
• Many different cell/element and grid types are available. Choice
depends on the problem and the solver capabilities.
• Cell or element types:
2D prism
triangle
– 2D: (quadrilateral
(“tri”)
or “quad”)

prism with
tetrahedron quadrilateral base
(“tet”) (hexahedron or “hex”)
– 3D:

prism with
pyramid triangular base
(wedge)

arbitrary polyhedron
7
Terminology
• Cell = control volume into
which domain is broken up.
• Node = grid point. cell
node
• Cell center = center of a cell. center
• Edge = boundary of a face. face
• Face = boundary of a cell.
• Zone = grouping of nodes, cell
faces, and cells: 2D computational grid

– Wall boundary zone.


– Fluid cell zone.
• Domain = group of node, face node
and cell zones.
edge
cell
face
3D computational grid

8
 The discretization of the space domain implies that the
governing equations of the phenomena are written in a
discrete form, that is, a linear system of algebraic equations is
obtained that would give the values of the unknown variables
at grid nodes.
 The linear system of equation is solved simultaneously (with
few exception when this is not needed, as is the case of the
explicit approach).
 In the process of transformation of the differential equations into a
finite set of equations, through discretization, three stages are
covered; the discretization of the definition domain of the
differential equation; the discretization of the unknown function in
values at discrete points (i.e., the approximate representation of the
solution); and the discretization of the equation itself. Discretization
of the computational domain is covered in the current chapter, while
the discretization of the solution and of the equation are explained
in the chapters about finite differences and finite volume methods.
 Regardless of the numerical method used, different types of grids
are used in engineering problem practice. Figure 3.1 shows an
example of a simple grid, representing the discretization of
Yongdam reservoir, in South Korea. The gridlines cross each other
orthogonally, hence the grid is called Cartesian.
 The transformation of the continuous equations into discrete forms
is done through methods such as finite difference, finite volume,
finite element, boundary element, spectral methods, collocation
methods, and so on.
 The first two are the methods used in this book and the presentation
of grid generation is done in relation with these two methods.
 Discretization is done for both time and space, however the space
discretization using in grids is more complex than that of time
discretization, especially because it involves three independent
variables (see Figure 3.2).
 Initially space grids were regular and structured, however as more
complex numerical methods were developed, due to the
computational power of computers, irregular physical geometries
could be accounted for.
 Space grids, also known as mesh are of three types; structured,
unstructured and meshless.
 Meshless discretization is not used by the finite differences and
finite volume methods therefore not addressed here.
 The finite difference method requires a structured grid, while for the
finite volume method both structured and unstructured meshes can
be used (see Figure 3.3)
 For each cell of a computational grid, a space is allocated in the
computer’s memory, because the unknown function is defined at the
nodes of the grid or at the cell points of the grid. In case the grid
extends over domains that are not of interest, the required
computational memory is very high.
 Several authors presents comprehensive reviews on how meshes are
generated and for which type of problems they should be used
(Buell & Bush, 1973; Thacker, 1980; Ho-Le, 1988).
3.2. Space Discretization
 Space discretization is discussed for two and three dimensions of
space, because the one-dimensional space does not pose any
challenge in discretization.
 One-dimensional computational domains are discretized in a
computational grid by selecting nodes unequally or equally spaced
(see Figure 3.4).
3.2.1 Structured grids
 Structured grids are simple, used for the discretization of a
rectangular domain.
 Each of the axes of coordinates is divided by nodes in subdomains,
independently of the number of subdivision on the other axes. For
example, in case of a 2D grid there are a number of nx and ny cells
in the x and y direction, respectively.
 Each node or cell in the computational grid is identified by two
indices (say i and i+1).
 Structured grids are classified as:
 Uniform regular grid, where the division of space in each direction is
a constant (equally spaced) (see Figure 3.5a);
 Non-Uniform regular grid, where the division of space in each
direction is not constant (see Figure 3.5b);
 Orthogonal grids, where the grid lines are orthogonal to each other
(see Figure 3.5a and 3.5b);
 Curvilinear grids, where the grid lines are curves in space (see Figure
3.5c).
 Regular structured grids are especially used with the finite
difference method, because the derivatives of the unknown function
are easily computed with respect to all spatial directions.
 Moreover, these types of grids do not require a transformation of
the coordinates, as is the case with the finite volume method, or
other numerical methods.
 The use of such grids is easily implemented in a computer
programme, because the nodes and cells are determined using their
indices, hence the structure of the solution matrix is known in
advance.
 The main disadvantage of structured grids is that they cannot
represent irregular complex domains.
 The only way for structured grids to partially cover irregular
domains is by using the so-called multiblock grids, which are a
combination of several structured grid blocks (see Figure 3.6).
 The solution computation is done on each block separately, however
the computation advance from one block to another requires special
treatment.
 Apart from the multi-block type grids, which try to overcome
irregular domains, there is another particular type of discretization
grid called a staggered grid.
 These types of grids are specific to the problem that is solved by the
differential equation and the way derivatives of the unknown
function are expressed. They are used in case of a phenomenon that
requires solutions for a system of differential equations and the
different unknown variables have different approximation
representations for the derivatives. For such grids different
unknown variables are determined in different nodes of the grids.
 An example of a staggered grid in one dimension is shown in
Figure 3.7 in which Saint Venant equations are solved for a one-
dimensional flow in open channels.
Grid types: structured grid
• Single-block, structured grid.
– i,j,k indexing to locate neighboring cells.
– Grid lines must pass all through domain.
• Obviously can’t be used for very complicated geometries.

2
5
3.2.2 Unstructured grids
 Unstructured grids are complex and are not generated easily,
however they are highly flexible in representing the computational
domain.
 The number of nodes and cells of an unstructured grid are not
related by an equation, hence it is not easy to identify a cell using
indices only, as in the case of structured grids.
 Each cell of an unstructured grid has to be defined by the nodes that
are forming it, therefore all coordinates of the nodes have to be
defined along with the information regarding the cell to which they
belong.
 Unstructured grids are used for the finite volume method and they
are the grid of preference for the finite element method.
 They have the advantage that they can represent some areas of the
computational domain in a very detailed manner, however they
have the disadvantage of longer computational time.
 An example of an unstructured grid is shown in Figure 3.8, as
general representation.
 Figure 3.9 shows the structured and unstructured grid representation
for a portion of Yellow River, in China.
Mesh naming conventions - topology
• Structured mesh: the mesh follows a structured i,j,k convention.
• Unstructured mesh: no regularity to the mesh.
• Multiblock: the mesh consists of multiple blocks, each of which
can be either structured or unstructured.

30
Mesh naming conventions – cell type
• Tri mesh: mesh consisting entirely of triangular elements.
• Quad mesh: consists entirely of quadrilateral elements.
• Hex mesh: consists entirely of hexahedral elements.
• Tet mesh: mesh with only tetrahedral elements.
• Hybrid mesh: mesh with one of the following:
• Triangles and quadrilaterals in 2D.
• Any combination of tetrahedra, prisms, pyramids in 3D.
• Boundary layer mesh: prizms at walls and tetrahedra everywhere else.
• Hexcore: hexahedra in center and other cell types at walls.
• Polyhedral mesh: consists of arbitrary polyhedra.
• Nonconformal mesh: mesh in which grid nodes do not match up
along an interface.

31
Polyhyderal mesh Non-confrontal mesh
3.2.3 Grid generation
 Grid generation is a difficult task, and can be performed manually
just for simple domains that require a small number of cells. For
complex computational and/or large computational domains tools
are used to create the grid of a given domain. Such tools are called
grid generators.
 Grid generation is a field of study on its own and several methods
are available to develop grids. These methods use algebraic
relations to create the nodes and cells of a grid. Grid generators can
take into account several requirements to a grid such as
maximization of the cell area or orthogonality.
 In general, grid generators are dependent on the type of differential
equation to be solved, that is, the grid generators for hyperbolic
equations are different from the elliptic ones, because of the type of
boundary conditions that need to be defined at the nodes of the grid.
 In general, grid generators produce a computational domain covered
by a grid of triangles, by first creating all the nodes of the grid and
then connecting them to form triangles.
 The best way to form these triangles is defined by the Delaunay
triangulation, which ensures that very thin triangles are avoided
(Boubez et al., 1986); or by using the Voronoi diagram (Brostow &
Dussault, 1978).
The Delaunay
triangulation with •Connecting the
all the centers of the
circumcircles and circumcircles
their centers (in produces the Voronoi
red). diagram (in red).
 The output of a grid generation is a set of elements along with a set
of points that define it. The set of elements represents the grid
topology. Depending on the approach taken to create the elements
of a grid, the grid generators are (see Figure 3.10):
 Creating first nodes then elements;
 Creating first grid topology then nodes;
 Creating nodes and elements simultaneously; and
 Adapting grid from pre-defined grid templates.
 From the four methods listed above the templates are generated
separately, independently of the computational domain and they are
later adapted for the given computational domain.
 The approaches known to create templates are: grid-based, mapped
elements, conformal mapping and nodes and elements created
simultaneously.
 There are several quality checks that need to be performed over a
grid after it has been generated using a grid generator. The most
important aspects are: grid smoothing, grid density and grid
conformity. In case these three qualities of a grid are not fulfilled
then the grid has to be refined manually.
 Grid smoothing refers to the shape of the elements. Smoothing
is performed by repositioning the nodes. Repositioning is a
difficult task that requires iterations, as repositioning might be
wrong.
 Density of a grid refers to the ability of a grid to change from
one part of the computational domain to another depending on
the computational needs.
 Conformity is related to the density of a grid, because when a
grid is refined smaller elements are introduced and they might
be distorted. In general, orthogonality is the measure to check
for grid conformity.
Mesh quality
• For the same cell count, hexahedral meshes will give more
accurate solutions, especially if the grid lines are aligned with the
flow.
• The mesh density should be high enough to capture all relevant
flow features.
• The mesh adjacent to the wall should be fine enough to resolve
the boundary layer flow. In boundary layers, quad, hex, and
prism/wedge cells are preferred over tri’s, tets, or pyramids.
• Three measures of quality:
– Skewness.
– Smoothness (change in size).
– Aspect ratio.

40
4
1

Mesh quality: skewness


• Two methods for determining
skewness:
1. Based on the equilateral
volume: optimal (equilateral) cell
optimal cell size  cellsize
• Skewness =
optimal cell size circumcircle

• Applies only to triangles and


tetrahedra.
• Default method for tris and tets.
actual cell

2. Based on the deviation from a


normalized equilateral angle:
  90 90   min 
• Skewness (for a quad) = max  max ,
 90 90 

• Applies to all cell and face max


shapes.
• Always used for prisms and  min
pyramids.
Equiangle skewness
• Common measure of quality is based on equiangle skew.
• Definition of equiangle skew:

   e  e   min 
max  max , 
 180   e e 

where:
– max = largest angle in face or cell.
– min = smallest angle in face or cell.  max
– e = angle for equiangular face or cell.
 min
• e.g., 60 for triangle, 90 for square.
• Range of skewness:
0 1
best worst
Mesh quality: smoothness and aspect ratio
• Change in size should be gradual (smooth).

smooth change large jump in


in cell size cell size

• Aspect ratio is ratio of longest edge length to shortest edge


length. Equal to 1 (ideal) for an equilateral triangle or a square.

aspect ratio = 1 high-aspect-ratio quad

aspect ratio = 1 high-aspect-ratio triangle


26
Striving for quality
• A poor quality grid will cause inaccurate solutions and/or slow
convergence.
• Minimize equiangle skew:
– Hex and quad cells: skewness should not exceed 0.85.
– Tri’s: skewness should not exceed 0.85.
– Tets: skewness should not exceed 0.9.
• Minimize local variations in cell size:
– E.g. adjacent cells should not have ‘size ratio’ greater than 20%.
• If such violations exist: delete mesh, perform necessary
decomposition and/or pre-mesh edges and faces, and remesh.

Value of 0-0.25 0.25-0.50 0.50-0.80 0.80-0.95 0.95-0.99 0.99-1.00


Skewness
Cell Quality excellent good acceptable poor sliver degenerate
Grid design guidelines: resolution
• Pertinent flow features should be adequately resolved.

flow inadequate better

•Cell aspect ratio (width/height) should be near one


where flow is multi-dimensional.
•Quad/hex cells can be stretched where flow is fully-
developed and essentially one-dimensional.

Flow Direction
OK!

45
Grid design guidelines: smoothness
• Change in cell/element size should be gradual (smooth).

smooth change sudden change


in cell size in cell size — AVOID!

• Ideally, the maximum change in grid spacing should be <20%:

• • • x i1
 1.2
xi xi+1 x i

46
3.2.4 Physical aspects of space
discretization
 There are problems for which the domain over which the
solution is sought is bounded by special elements, such as
structures, or may have a special form in the physical plane.
 Such special domains with special boundaries may be
discretized to obtain the computational domain, which may be
represented in a simpler format through a simple
transformation of coordinates.
 After the solution is computed all values of the unknown
function are placed back to the initial computational domain,
which represents the real domain. Such an example is a
distorted L-shape region that can be transformed into a simple
I-shape (see Figure 3.11).
 Transformation should be done with care because it may
introduce accuracy problems in the solution. In case of a
bump a transformation grid may eliminate the bump (see
Figure 3.12).
 Fletcher (1991) emphasizes the importance of carefully
making such transformations because the computational
domain is distorted and so is the corresponding approximate
solution.
3.3 Time Discretization
 Discretization of time is separated from the one in space. Time
discretization is used for problems, where the boundary of the
computational domain varies in time, as is the case with free surface
flows.
 In each time step values of the unknown function are computed at
all nodes of the grid in space. When all values of the unknown
function have been determined at time step n, computation advances
to the next time step (n + 1).
 Numerical methods algorithms are written with respect to time level
n and (n + 1), considering that all values of the unknown function
are known at time step n, for all nodes of the space grid, and a new
computation starts to determine all the values at time level (n + 1)
where values of the unknown function are considered unknown (see
Figure 3.13).
 Depending on the numerical method to determine the approximate
solution of a differential equation, there are two main types of
discretization with respect to time; explicit and implicit methods.
 In explicit discretization the values at the grid nodes of each
unknown variable at the new time step of computation depend only
on known values at the previous time step.
 The advantage of this kind of discretization is that in many cases no
system of equation is formed, hence no solver is required, because
the solution is straightforward computed step by step. Such a
discretization is easy to implement in a computer programme.
 The disadvantage of such an approach is that solution becomes
unstable if the time intervals for computation are selected bigger
than a threshold value. Such a threshold value is usually determined
from stability conditions of the solution combined with physical
characteristics of the variable that needs to be determined.
 The implicit method of time discretization determines the values
of the unknown function at the grid nodes from values of the
function at neighboring points at the same time level.
 An algebraic system of equations is formed, that requires a solver to
be solved. The advantage of such method is that they are stable and
no threshold value on the time interval of computation is required.
From an accuracy point of view one should always try to solve the
problems with small time intervals.
 In order to take advantage of both implicit and explicit methods of
discretization for time, combined methods are also used. They are
called semi-implicit methods, where the variable at the new time
step depends both on the old and new time step.
References
 Andre Baker Lecture
 Ioana Popescu-Computational Hydraulics_
Numerical Methods and Modelling-IWA Publishing
(2014)

You might also like