Grid Generation Chaiwoot Boonyasiriwat November 5, 2020 Sources of - - PowerPoint PPT Presentation

grid generation
SMART_READER_LITE
LIVE PREVIEW

Grid Generation Chaiwoot Boonyasiriwat November 5, 2020 Sources of - - PowerPoint PPT Presentation

Grid Generation Chaiwoot Boonyasiriwat November 5, 2020 Sources of Error at Grid Points Mathematical models do not represent physical phenomena with absolute accuracy. Numerical approximation of the mathematical model gives rise


slide-1
SLIDE 1

Grid Generation

Chaiwoot Boonyasiriwat

November 5, 2020

slide-2
SLIDE 2

2

▪ “Mathematical models do not represent physical phenomena with absolute accuracy.” ▪ Numerical approximation of the mathematical model gives rise to an error. ▪ “The error is influenced by the size and shape of the grid cells.” ▪ “The error is contributed by the computation of the discrete physical quantities satisfying the equations of the numerical approximation.” ▪ “The error is caused by the inaccuracy of the process of interpolation of the discrete solution.”

Liseikin (2010, p. 1)

Sources of Error at Grid Points

slide-3
SLIDE 3

3

  • 1. Points in the domain and on the boundary are called

grid nodes.

  • 2. n-dimensional volumes covering the entire area of the

domain are called grid cells. ▪ “The cells are bounded by curvilinear volumes whose boundaries are divided into a few segments which are (n-1)-dimensional cells.”

Liseikin (2010, p. 2)

Two Definitions of Grid

slide-4
SLIDE 4

4

▪ “In 1D, the cell is a closed line or segment whose boundary is composed of two cell vertices.” ▪ “A 2D cell is a 2D simply connected domain whose boundary is divided into a finite number of 1D cells called the edges of the cell.” ▪ 2D grid cells are in the form of triangles or quadrilaterals.” ▪ The boundaries of triangular and quadrilateral cells are composed of 3 and 4 segments, respectively.

Liseikin (2010, p. 3)

Grid Cells

triangle quadrilateral line/segment

slide-5
SLIDE 5

5

▪ “A 3D grid cell is a simply connected 3D polyhedron whose boundary is composed of 2D cells called faces.” ▪ “Typical 3D cells are in the form of tetrahedrons, hexahedrons, or a prism.” ▪ A tetrahedron has 4 triangular faces, 6 edges, 4 vertices. ▪ A hexahedron has 6 quadrilateral faces, 12 edges, and 8 vertices. ▪ A prism has 3 triangular and 3 quadrilateral faces, 9 edges, and 6 vertices.

Liseikin (2010, p. 3)

Grid Cells

tetrahedron hexahedron prism

slide-6
SLIDE 6

6

▪ “The edges and faces of the cells are typically linear.” ▪ “Linear triangles and tetrahedrons are 2D simplexes and 3D simplexes, respectively.” ▪ An n-dimensional simplex is the space defined by the barycentric sum where xi are the vertices of the simplex. ▪ Barycentric sum is required for blending of points so that the result is independent of coordinate system (Salomon, 2006).

Simplex

Liseikin (2010, p. 3)

slide-7
SLIDE 7

7

▪ “A point has no dimensions; it represents a location in space.” ▪ “A vector has no well-defined location; its only attributes are direction and magnitude.” ▪ “Both points and vectors are represented by pairs or triplets of real numbers.” ▪ Addition of point and vector is a point. ▪ Addition of points are not well defined as the result depends on the coordinate system. ▪ Addition of points is well defined only when it is a barycentric sum.

Point vs Vector

Salomon (2006, p. 1)

slide-8
SLIDE 8

8

Point and Vector Addition

Salomon (2006, p. 3)

slide-9
SLIDE 9

9

▪ “Grid size is indicated by the number of grid points.” ▪ “Cell size is the maximum length of the cell edges.” ▪ A grid generation technique should be able to increase the number of grid nodes. “At the same time the edge lengths of the resulting cells should approach zero as the number of nodes tends to infinity.” ▪ “Small cells are necessary to obtain more accurate solutions and to investigate phenomena associated with the physical quantities on small scales, such as boundary layers and turbulence.” ▪ “Reducing cell size also enables the study of the convergence rate of a numerical code.”

Grid Size and Cell Size

Liseikin (2010, p. 5)

slide-10
SLIDE 10

2 Fundamental Classes: ▪ Structured grid: regular grid-point topology ▪ Unstructured grid: irregular topology 3 Subclasses: ▪ Block-structured grid ▪ Overset grid ▪ Hybrid grid

Grid Class

slide-11
SLIDE 11

▪ Coordinate grids are structured grids in which the nodes and cell faces are defined by the intersection of lines and surfaces of a coordinate system in Xn. ▪ The Cartesian and cylindrical grids are examples of coordinate grids. ▪ Nodes of a coordinate grid do not necessarily coincide with the curvilinear boundary of a complex domain.

Coordinate Grids

Liseikin (2017, p. 14)

slide-12
SLIDE 12

▪ Boundary-fitted or boundary-conforming grids are structured grids that are obtained from one-to-one transformations x() which map the boundary of the computation domain n on to the boundary of the physical domain Xn.

Boundary-Conforming Grids

Liseikin (2017, p. 14)

slide-13
SLIDE 13

13

Consider the flow through the divergent duct. Let We can use the transformation

Boundary-Fitted Coordinates

slide-14
SLIDE 14

14

Boundary-Fitted Coordinates

Consider now an airfoil shape with a curvilinear grid wrapped around the shape.

C-type and O-type grids

slide-15
SLIDE 15

15

Boundary-Fitted Coordinates

▪ “What transformation will cast this curvilinear grid into a uniform grid in the computational plane?” ▪ We know the coordinates (x,y) of the inner boundary 1 and outer boundary 2 ▪ This gives us a hint that we can form a boundary- value problem with boundary values specified everywhere. ▪ This BVP can be an elliptic problem!

slide-16
SLIDE 16

16

Image sources: http://en.wikipedia.org/wiki/Regular_grid http://en.wikipedia.org/wiki/Unstructured_grid

Grid Examples

Cartesian Grid Regular Grid Rectilinear Grid Curvilinear Grid Unstructured Grid Structured Grid

slide-17
SLIDE 17

17

Liseikin (2010, p. 17)

Block-Structured Grid

Grid blocks do not overlap but interfaces can be either continuous or discontinuous.

slide-18
SLIDE 18

18

Liseikin (2010, p. 18)

Block-Structured Grid Topology

slide-19
SLIDE 19

19

Liseikin (2010, p. 20)

Overset Grid

Grid blocks can overlap.

slide-20
SLIDE 20

20

Liseikin (2010, p. 21)

Hybrid Grid

Various grid types are combined.

slide-21
SLIDE 21

▪ Mapping methods for structured grids

  • Algebraic methods: transfinite interpolation
  • Differential methods: PDE based
  • Variational methods: optimization based

▪ Unstructured grid

  • Quadtree/octree methods
  • Delaunay procedures
  • Advancing-front techniques

Grid Generation Methods

Liseikin (2010, p. 22-25)

slide-22
SLIDE 22

▪ Structured grids are typically generated through a mapping approach in which a computational domain n

  • f a simple shape is mapped into a physical domain Xn.

▪ The most efficient structured grids are boundary- conforming grids typically generated for the finite difference method. ▪ 3 main mapping methods for structured grids are

  • Algebraic methods use interpolation.
  • Differential methods are based on elliptic, parabolic,
  • r hyperbolic PDEs.
  • Variational methods are based on optimization of grid

quality properties.

Mapping Methods

Liseikin (2017, p. 29)

slide-23
SLIDE 23

23

▪ “PDEs in the physical domain Xn can be solved on a grid obtained by mapping a reference grid in the logical domain n into Xn with a coordinate transformation” ▪ “The mapping approach provides an alternative way to

  • btain a numerical solution to a PDE, by solving the

transformed equation with respect to the new independent variables , , ,  on the reference grid in the logical domain n.”

Coordinate Transformations

Liseikin (2017, p. 47)

slide-24
SLIDE 24

24

▪ “Consider a 2D unsteady flow with independent variables x, y, and t.” ▪ “We will transform the independent variables in physical space (x,y,t) to a new set of independent variables in transformed space (,,), where

Coordinate Transformation

slide-25
SLIDE 25

25

▪ In the governing equations, there are many derivative terms with respect to physical space variables that must be transformed due to the coordinate transformation. ▪ Use chain rule to derive these operators:

Derivative Terms

slide-26
SLIDE 26

26

▪ Let ▪ Then, ▪ Using the chain rule, the mixed derivative terms can be turned into derivative with respect to only  and .

Derivative Terms

Anderson (1995, p. 174)

slide-27
SLIDE 27

27

▪ The first mixed derivative operator can be rewritten as ▪ The second mixed derivative operator can be rewritten as ▪ We then have

Derivative Terms

Anderson (1995, p. 174)

slide-28
SLIDE 28

28

▪ Similarly, we have

Derivative Terms

Anderson (1995, p. 175)

slide-29
SLIDE 29

29

▪ Metrics are used to call the derivatives ▪ It may be convenient to use the inverse transformation ▪ We then need to replace metrics by inverse metrics

Metrics and Jacobians

Anderson (1995)

slide-30
SLIDE 30

30

▪ Let . Total differential of u is given by ▪ We then have the derivatives

Metrics and Jacobians

Anderson (1995)

slide-31
SLIDE 31

31

Solving for and yields where J is Jacobian determinant defined as

Metrics and Jacobians

Anderson (1995)

slide-32
SLIDE 32

32

From previous results we have where

Differential Operators

Anderson (1995)

slide-33
SLIDE 33

33

Consider a direct transformation We have the total differentials

A Formal Approach

Anderson (1995)

slide-34
SLIDE 34

34

Now consider an inverse transformation We have the total differentials

A Formal Approach

Anderson (1995)

slide-35
SLIDE 35

35

We then have

A Formal Approach

Anderson (1995)

slide-36
SLIDE 36

36

Stretch Transformations

slide-37
SLIDE 37

37

▪ “Algebraic grid generation may be used in combination with univariate stretching transformations to control grid density.” ▪ “Stretching transformations involves positive monotonic univariate functions, here given by x = x() and y = y(), with inverse  = (x) and  = (y).”

Stretching Transformations

Farrashkhalvat and Miles (2003, p. 99)

slide-38
SLIDE 38

38

To cluster grid lines in the neighborhood of y = 0, we can use the transformation

Clustered Grid near y = 0

2  =

slide-39
SLIDE 39

39

▪ Another possible transformation is given by ▪ This maps y = 0 directly to  = 0 and y = h onto  = 1. ▪ The inverse transform is

Clustered Grid near y = 0

Farrashkhalvat and Miles (2003, p. 99)

slide-40
SLIDE 40

40

When  = 1.07, h = 5, using the inverse transform

Clustered Grid near y = 0

slide-41
SLIDE 41

41

Although the transform is simpler than the transform the latter transform directly maps  = 1 to y = h. The former transform maps  = 1 to y = e-1 which is not convenient compared to the latter transform when we want to set the maximum value of y.

Clustered Grid near y = 0

slide-42
SLIDE 42

42

▪ Another stretching transformation with a parameter  is ▪ The inverse transform is where

Clustered Grid near y = 0 and y = h

Farrashkhalvat and Miles (2003, p. 99)

slide-43
SLIDE 43

43

▪ This still maps y = h to  = 1 but the boundary y = 0 is mapped to ▪ When  = 0.5, the boundary y = 0 is mapped to  = 0.

Clustered Grid near y = 0 and y = h

Farrashkhalvat and Miles (2003, p. 99)

slide-44
SLIDE 44

44

When  = 0.5,  = 1.01, using the forward transform

Clustered Grid near y = 0 and y = h

slide-45
SLIDE 45

45

When  = 0.5,  = 1.07, h = 1, using the inverse transform

Clustered Grid near y = 0 and y = h

slide-46
SLIDE 46

46

A stretching transformation which gives a clustering of grid lines around line y = y0 is given by where When r = 0, there is no stretching and  = y/h. A larger value of r will result in more clustering around y = y0.

Clustered Grid near y = y0

Farrashkhalvat and Miles (2003, p. 100)

slide-47
SLIDE 47

47

With r = 8, h = 2, and y0 = 0.7, the inverse transform maps the left grid to the right grid.

Clustered Grid near y = y0

slide-48
SLIDE 48

48

▪ The Eriksson function that provides a grid clustered near y = 0 is given by ▪ The Eriksson function that provides a grid clustered near y = h is given by

Eriksson Function

Farrashkhalvat and Miles (2003, p. 101)

slide-49
SLIDE 49

49

▪ The Eriksson function that provides a grid clustered near y = y0 (corresponding to  = 0 = y0/h) is given by

Eriksson Function

Farrashkhalvat and Miles (2003, p. 101)

slide-50
SLIDE 50

50

▪ A 2D divergent nozzle is bounded by the curves y = h1(x) and y = h2(x). ▪ The physical domain defined by can be mapped directly onto computational space through with inverse

Divergent Nozzle

Farrashkhalvat and Miles (2003, p. 102)

slide-51
SLIDE 51

51

▪ We can concentrate the grid lines near the boundaries by adapting the previous Eriksson function as follows. ▪ When 0    1, ▪ When 1    1,

Divergent Nozzle

Farrashkhalvat and Miles (2003, p. 102)

slide-52
SLIDE 52

52

Divergent Nozzle

Farrashkhalvat and Miles (2003, p. 102)

slide-53
SLIDE 53

53

Algebraic Grid Generation

slide-54
SLIDE 54

54

▪ “Unidirectional interpolation may be carried out between selected points on opposite boundary curves or surfaces of a physical domain.” ▪ Let r0 and r1 be points on two boundary curves. ▪ A point between r0 and r1 can be computed by

Unidirectional Interpolation

Farrashkhalvat and Miles (2003, p. 82-83)

slide-55
SLIDE 55

55

▪ Linear interpolation between A and C yields ▪ Linear interpolation between A1 and C1 yields ▪ The parametric equation of interpolating line is

Unidirectional Interpolation

Farrashkhalvat and Miles (2003, p. 84)

slide-56
SLIDE 56

56

▪ Discretizing the logical domain n as ▪ The linear interpolation formula becomes ▪ Similarly, a linear interpolation in the -direction yields

Unidirectional Interpolation

Farrashkhalvat and Miles (2003, p. 84)

slide-57
SLIDE 57

57

Projector

P

Farrashkhalvat and Miles (2003, p. 84)

slide-58
SLIDE 58

58

Bilinear Mapping

 

P P

Farrashkhalvat and Miles (2003, p. 84)

slide-59
SLIDE 59

59

▪ Boolean sum:

Transfinite Interpolation

 

 P P

slide-60
SLIDE 60

60

Examples of TFI Grids

Farrashkhalvat and Miles (2003, p. 111-112)

slide-61
SLIDE 61

61

Grid Generation Through Differential Systems

slide-62
SLIDE 62

62

Grids from Differential System

▪ In grid generation using transformations, the cartesian coordinates in the logical space become curvilinear coordinates in the physical space which are boundary- conforming, i.e., a boundary becomes a coordinate curve on which the curvilinear coordinate is constant. ▪ However, using transformations increases the complexity of the PDEs to be solved. ▪ In addition, grids generated by transformations are not always orthogonal nor smooth. ▪ We can overcome these problems by generating grids through differential systems: elliptic, parabolic, and hyperbolic PDEs.

Farrashkhalvat and Miles (2003, p. 116)

slide-63
SLIDE 63

63

TFI Grid vs Elliptic Grid

Grid from transfinite Grid from elliptic PDE interpolation

Leiseikin (2017, p. 202)

slide-64
SLIDE 64

64

Elliptic Grid Generators

▪ “Elliptic equations which obey the extremum principle, i.e., the extrema of solutions cannot be within the domain, are readily formulated and implemented.” ▪ “With this property, there is less tendency for folding of the resulting grid cells.” ▪ “Another important property of any elliptic system is the inherent smoothness of its solution.” ▪ “Elliptic systems also allow one to specify the coordinate points on the whole boundary of domain.” ▪ However, elliptic systems has higher costs than other methods.

Liseikin (2017, p. 202)

slide-65
SLIDE 65

65

Laplace Systems

▪ “Laplace equations are the most simple elliptic systems for grid generation.” ▪ Grid generation using the uncoupled Laplace equations can be performed either in the logical domain

  • r in the physical domain

Liseikin (2017, p. 202)

slide-66
SLIDE 66

66

Curvilinear Coordinate Systems

▪ A general set of curvilinear coordinates in a 3D Euclidean space E3 is denoted as {x1,x2,x3} which could stand for cylindrical polar coordinates {r,,z}, spherical coordinates {r,,}, or etc. ▪ Cartesian coordinates are denoted using subscripts as {x1,x2,x3} or {x,y,z}. ▪ Cartesian coordinates are related with curvilinear coordinates as ▪ These mapping are assumed to be differentiable.

Farrashkhalvat and Miles (2003, p. 1-2)

slide-67
SLIDE 67

67

Curvilinear Coordinate Systems

▪ A position vector r of a point P in space with respect to an origin O may be expressed as (1) where {i1,i2,i3} are unit vectors of the Cartesian system. ▪ Differentiating (1) with respect to xi gives the set of covariant base vectors with background cartesian components

Farrashkhalvat and Miles (2003, p. 2)

slide-68
SLIDE 68

68

Curvilinear Coordinate Systems

▪ At any point P, each of the covariant base vectors is tangential to a coordinate curve passing through P as shown below. ▪ In general, gi are neither unit vectors nor orthogonal to each

  • ther.

▪ For gi to form a set of basis vectors in E3, they must not be co-planar, i.e.,

Farrashkhalvat and Miles (2003, p. 2)

slide-69
SLIDE 69

69

Curvilinear Coordinate Systems

▪ A set of contravariant base vectors at P denoted by {g1,g2,g3} is defined by where is the Kronecker delta function. ▪ From this definition, the contravariant base vectors may be expressed as ▪ As a result, gi is normal to the surface xi = constant. ▪ The background cartesian components of gi are

Farrashkhalvat and Miles (2003, p. 3)

slide-70
SLIDE 70

70

Curvilinear Coordinate Systems

▪ A contravariant base vector may be expressed as ▪ The Einstein summation convention is used for repeated indices. ▪ For a general scalar field  we have

Farrashkhalvat and Miles (2003, p. 3-4)

slide-71
SLIDE 71

71

Metric Tensors

▪ Given a set of curvilinear coordinates {xi} with covariant base vectors gi and contravariant base vectors gi, the covariant metric tensors are defined as and the contravariant metric tensors are defined as

Farrashkhalvat and Miles (2003, p. 4)

slide-72
SLIDE 72

72

Metric Tensors

▪ If we write (x,y,z) for Cartesians and (,,) for curvilinear coordinates, we have

Farrashkhalvat and Miles (2003, p. 4-5)

slide-73
SLIDE 73

73

Generalized Vectors

▪ A vector field u may be expressed as (2) (3) where ui and ui are contravariant and covariant components of u. ▪ Taking a scalar product of (2) with gj yields ▪ Hence, ▪ Similarly, ▪ Then

Farrashkhalvat and Miles (2003, p. 8-9)

slide-74
SLIDE 74

74

Generalized Vectors

▪ The scalar product of vectors u and v is given by ▪ The magnitude of vector u is then given by

Farrashkhalvat and Miles (2003, p. 9)

slide-75
SLIDE 75

75

Christoffel Symbols

▪ Differentiation of covariant base vector with respect to xj satisfies ▪ Expressing the resulting vector as a linear combination

  • f base vectors yields

Christoffel symbols of first kind [ij,k] and second kind are related by

Farrashkhalvat and Miles (2003, p. 14)

slide-76
SLIDE 76

76

Christoffel Symbols

▪ The Christoffel symbols of first and second kinds can be written as ▪ It can be shown that

Farrashkhalvat and Miles (2003, p. 15-17)

slide-77
SLIDE 77

77

Laplace Systems

▪ Given the Laplace equation ▪ The equation then becomes ▪ Substituting we obtain the Winslow equations

Farrashkhalvat and Miles (2003, p. 118)

slide-78
SLIDE 78

78

Laplace Systems

▪ “The maximum principle is valid for both systems of Laplace equations.” ▪ However, the system is not guaranteed that all grid points will be inside of the physical domain.

Liseikin (2017, p. 204)

slide-79
SLIDE 79

79

Elliptic Grids

Grid from Grid from

Leiseikin (2017, p. 205)

slide-80
SLIDE 80

80

Elliptic Grid Generation

In 2D, the Laplace equations can be written as

slide-81
SLIDE 81

81

Elliptic Grid Generation

▪ In the logical space n, assume that . ▪ Then, we approximate , , and  as follows.

slide-82
SLIDE 82

82

Elliptic Grid Generation

The derivative terms in the Laplace equation are discretized as follows.

slide-83
SLIDE 83

83

Elliptic Grid Generation

The resulting nonlinear algebraic equation is rewritten as an iterative relaxation scheme: The scheme is iteratively applied until The Laplace equation for y is also discretized and turned into a relaxation scheme which is iteratively applied until

slide-84
SLIDE 84

84

Comments on Grid Generation

▪ Numerical solutions of PDEs for grid generation is “completely separate” from those of the governing equations. ▪ PDE-based methods for grid generation also include methods based on parabolic and hyperbolic PDEs.

slide-85
SLIDE 85

85

Adaptive Grid

▪ Algebraic (stretched) and PDE-based (elliptic) grid generation methods mentioned previously are applied prior to actually solving the governing equations. ▪ Therefore, it is very difficult to design an appropriate grid for a flow problem. ▪ “An adaptive grid can automatically cluster grid points in regions of high flow-field gradients; it uses the solution of the flow-field properties to locate grid points in physical plane.” (Anderson, 1995, p. 202)

slide-86
SLIDE 86

86

Adaptive Grid Examples

Image sources: https://software.intel.com/sites/default/files/fluid-part-two-1.jpg http://www.tp1.ruhr-uni-bochum.de/~jd/racoon/figs/t7_7400m.png http://s3-blogs.mentor.com/travis-mikjaniec/files/2012/08/BADMINTONFLOEFD_206MPH_LOCAL_meshVeloc.png

slide-87
SLIDE 87

87

Adaptive Mesh Refinement

▪ “In numerical analysis, adaptive mesh refinement (AMR) is a method of changing the accuracy of a solution in certain regions, during the time the solution is being calculated.” ▪ “Adaptive mesh refinement (AMR) changes the spacing of grid points, to change how accurately the solution is known in that region.” ▪ Static or dynamic mesh refinement?

Reference: http://en.wikipedia.org/wiki/Adaptive_mesh_refinement

slide-88
SLIDE 88

88

Orthogonal Grid

Elliptic system with control functions P and Q Orthogonality condition: Haussling and Coleman (1981) proposed

Reference: Thompson et al. (1999, Chapter 6), Liseikin (2010, p. 182)

slide-89
SLIDE 89

89

Orthogonal Grid

Haussling and Coleman (1981) system: Central FD is used to approximate derivatives and SOR is used to solve the algebraic system.

Liseikin (2010, p. 183)

slide-90
SLIDE 90

90

Orthogonal Grid

Another approach given in Liseikin (2010, p. 184) for 2D orthogonal grid is where

slide-91
SLIDE 91

91

Boundary Orthogonality

Orthogonality condition: Neumann orthogonality: ▪ Parametric boundary ▪ No control function is used ▪ Boundary nodes are displaced ▪ At left boundary ▪ At right boundary

Thompson et al. (1999, section 6.2.1)

slide-92
SLIDE 92

92

Neumann Orthogonality

▪ Let the original and the new boundary points be and , respectively. ▪ Substituting the Taylor’s expansion in and we obtain for the left boundary

Thompson et al. (1999, section 6.2.1)

slide-93
SLIDE 93

93

References

▪ Anderson, J. D., 1995, Computational Fluid Dynamics: The Basics with Applications, McGraw-Hill. ▪ Liseikin, V. D., 2010, Grid Generation Methods, Springer. ▪ Farrashkhalvat, M., and J. P. Miles, 2003, Basic Structured Grid Generation with An Introduction to Unstructured Grid Generation, Butterworth-Heinemann. ▪ Salomon, D., 2006, Curves and Surfaces for Computer Graphics, Springer. ▪ Thompson, J. F., Z. U. A. Warsi, and C. W. Mastin, 1985, Numerical Grid Generation: Foundations and Applications, North-Holland. ▪ Thompson, J. F., B. K. Soni, and N. P. Weatherill, 1999, Handbook of Grid Generation, CRC Press.