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

Mesh Generation in CFD

Abhishek Jain
abhishek@zeusnumerix.com
© Zeus Numerix

Defense | Nuclear Power | Aerospace | Infrastructure | Industry


Solving problems using CFD in 6 steps

3
Build Computational Create suitable Boundary Conditions &
Domain Mesh Initial conditions
© Zeus Numerix

Solution of discrete
Interpret solution Plot flow Field equations
Importance of mesh

• The grid
• Stores discrete values for the field variables
• Helps in the evaluation of partial derivatives (structured meshes)
• Helps in calculation of numerical flux / interpolations using basis
functions (unstructured meshes)
• It affects
• Correctness of physics
• Accuracy of solution
• Overall efficiency of simulation such as CPU time
• In fact, in terms of wall clock time and human
efforts mesh generation is half simulation done!
© Zeus Numerix
What meshes are required?

Sr. No. Method Type of Meshes


1 Geometric Optics (GO) / GTD CAD surfaces defined as NURBS,
surface quadrilaterals or triangles
2 Physical theory of Diffraction PO/PTD Surface quadrilaterals or triangles
3 Method of Moments Surface quadrilaterals or triangles
4 Finite Element Method Quadrilaterals or triangles in 2D
and Hexahedrons or Tetrahedrons
in 3D
5 Finite Difference Method No meshes are required in the
basic method. Octree meshes in
advanced FDTD
6 Finite Volume method Quadrilaterals or triangles in 2D
© Zeus Numerix

and Hexahedrons or Tetrahedrons


in 3D
Classification of Meshes

Cartesian Unstructured for


FDTD methods MOM & FEM
methods
x = y = cons

Hybrid
meshes
© Zeus Numerix

Multi-block structured for


FVDT method
Structured Meshes
© Zeus Numerix
Creating Structured Meshes
y

Topological requirements in 2D Topological requirements

Four vertices, four edges Eight vertices, twelve edges, six


faces
Opposite sides must have similar
Opposite edges must have the
© Zeus Numerix

intervals / mesh points


same no of mesh points
Multi-block Structured Grid

Patched Grids
Domain is covered with sub-domain each with rectangular topology
Grids in each blocks are created independently
Grids are smoothened inside the block and also across the block

Grid lines have C1 continuity Block boundary

Each block has 4 edges


© Zeus Numerix
Patched Blocks with C1 Continuity

Block No1 and Block No. 2 share, Block


boundary completely, But grid lines do
not have even C0 continuity
Block 1 Block 1

Block No1 and Block No. 2 share, Block


boundary completely, Grid lines have
C0 continuity
Block 1 Block 1

Block No1 and Block No. 2 share, Block


boundary completely, Grid lines have
C1 continuity
© Zeus Numerix

Block 1 Block 1

C1 continuity across block boundaries gives best numerical results


Multi-block Structured Meshes – an example
© Zeus Numerix

Identify the vertices, edges, faces and blocks in this figure


Unstructured Meshes : Delaunay and
advancing front triangulations
© Zeus Numerix
Properties of Delaunay Triangulation

Uniqueness : The Delaunay triangulation is unique, assuming


that no four sites are circular.

The circumcircle criteria : A triangulation for N > 2 site is Delaunay if and only if
the circumcircle of every interior triangle is point-free

D D
A A

Incircle test fails on the left.


B C B
C Swapping edges, as on right,
© Zeus Numerix

diagonal can be used to


Interior is produce Delaunay triangle
not empty
Properties of Delaunay Triangulation

Delaunay Triangulation

All triangles obey empty-circle


(sphere) property
© Zeus Numerix

Two triangles are highlighted


Properties of Delaunay Triangulation

Circle shown by dotted lines does


not satisfy empty circle (sphere)
property

Shaded triangle is not Delaunay


© Zeus Numerix
Properties of Delaunay Triangulation

Nearest neighbour Property


In Delaunay triangulation an edge is obtained by joining the
nearest neighbour
But the nearest neighbour edge is one of the many edges
Nearest neighbour
edge

Non-nearest neighbour
edge
Minimal roughness Property
Suppose a property fi is given at all vertices Vi , where i = 1 to N

Any triangulation will produce piecewise linear interpolation surface for this data
© Zeus Numerix

Delaunay triangulation minimises the integral given by


 [(f/x)2 + (f/y)2 ] dx dy for any f
Incremental Insertion Algorithms
- Common Features (popular)
Points to be
inserted
New points are added to existing triangulation one
by one

New points are assumed to lie in the existing


triangulation
Phantom
triangle
All incremental insertion algorithms start with a
phantom triangle large enough to enclose all the
given points

The edges formed by these points, if given as a part


of input data is initially ignored. These edges will
be built later after all the points are inserted.
Edge ignored
Every insertion of new point requires locating (i) a
© Zeus Numerix

triangle or (ii) circumcircles containing this point.

In mesh adaptation the location is known. In initial


triangulation ‘search is required
Point Insertion Algorithm in Delaunay

Given a Delaunay Triangulation of N nodes and having inserted n nodes How do


I insert the next given n+1 th node? Lawson Algorithm (not
the global edge
swapping!)

Locate triangle
containing X
X
Subdivide triangle

Recursively check
adjoining triangles to
ensure empty-circle
© Zeus Numerix

property.

Swap diagonal if needed


Point Insertion Algorithm in Delaunay

The boundary points of domain are rarely adequate for unstructured meshes.
How do insert additional nodes in the domain.
Criteria

• Insert node in the


largest triangle

• Insert node on the


largest edge

• Insert points at
random
X
© Zeus Numerix

• Insert points arranged


as a lattice
Delaunay Triangulation in action

Initial Triangulation
© Zeus Numerix

Begin with Bounding Triangles (or Tetrahedra)


Delaunay Triangulation in action
Initial Triangulation
© Zeus Numerix

Insert boundary nodes using Delaunay method (Lawson or Bowyer-


Watson)
Delaunay Triangulation in action
Initial Triangulation
© Zeus Numerix

Insert boundary nodes using Delaunay method (Lawson or Bowyer-


Watson)
Delaunay Triangulation in action
Initial Triangulation
© Zeus Numerix

Insert boundary nodes using Delaunay method (Lawson or Bowyer-


Watson)
Delaunay Triangulation in action
Initial Triangulation
© Zeus Numerix

Insert boundary nodes using Delaunay method (Lawson or Bowyer-


Watson)
Delaunay Triangulation in action
Initial Triangulation
© Zeus Numerix

Insert boundary nodes using Delaunay method (Lawson or Bowyer-


Watson)
Delaunay Triangulation in action

Recovering Triangulation

Recover boundary
Delete outside triangles
© Zeus Numerix

Insert internal nodes


Delaunay Triangulation in action

Grid Based Node Insertion

Nodes introduced based on a regular lattice


Lattice could be rectangular, triangular, quadtree, etc…
© Zeus Numerix

Outside nodes ignored


Delaunay Triangulation in action
Grid Based Node Insertion

Nodes introduced based on a regular lattice


Lattice could be rectangular, triangular, quadtree, etc…
Outside nodes ignored
© Zeus Numerix
Delaunay Triangulation in action

Centroid Based Node Insertion

Nodes introduced at triangle centroids


Continues until edge length, l  h
© Zeus Numerix
Delaunay Triangulation in action

Centroid Based Node Insertion

Nodes introduced at triangle centroids


Continues until edge length, l  h
© Zeus Numerix
Delaunay Triangulation in action

Circumcenter (“Guaranteed Quality”) Node Insertion

e.g , a strategy: Nodes introduced at triangle circumcenters


Order of insertion based on minimum angle of any triangle
© Zeus Numerix

Continues until minimum angle > predefined minimum (  30 )


Delaunay Triangulation in action

Circumcenter (“Guaranteed Quality”) Node Insertion

Nodes introduced at triangle circumcenters


Order of insertion based on minimum angle of any triangle
© Zeus Numerix

Continues until minimum angle > predefined minimum (  30 )


Delaunay Triangulation in action

Advancing
A
Front Node
B
Insertion

“Front” structure maintained throughout


Nodes introduced at ideal location from current front edge
© Zeus Numerix
Delaunay Triangulation in action

Advancing Front Node Insertion

“Front” structure maintained throughout


Nodes introduced at ideal location from current front edge
© Zeus Numerix
Delaunay Triangulation in action

Voronoi-Segment Node Insertion

Nodes introduced at midpoint of segment connecting the


circumcircle centers of two adjacent triangles
© Zeus Numerix
Delaunay Triangulation in action

Voronoi-Segment Node Insertion

Nodes introduced at midpoint of segment connecting the


circumcircle centers of two adjacent triangles
© Zeus Numerix
Delaunay Triangulation in action

Edges

Nodes introduced at along existing edges at l = h


Check to ensure nodes on nearby edges are not too close
© Zeus Numerix
Delaunay Triangulation in action

Edges

Nodes introduced at along existing edges at l = h


Check to ensure nodes on nearby edges are not too close
© Zeus Numerix
Delaunay Triangulation in action
Boundary Constrained

Boundary Intersection
© Zeus Numerix

Nodes and edges introduced where Delaunay edges


intersect boundary
Delaunay Triangulation in action
Boundary Constrained

Boundary Intersection
Nodes and edges introduced where Delaunay edges
© Zeus Numerix

intersect boundary
Delaunay Triangulation in action
Boundary Constrained

Local Swapping
© Zeus Numerix

Edges swapped between adjacent pairs of triangles until


boundary is maintained
Delaunay Triangulation in action
Boundary Constrained

Local Swapping
© Zeus Numerix

Edges swapped between adjacent pairs of triangles until


boundary is maintained
Delaunay Triangulation in action
Boundary Constrained

Local Swapping
© Zeus Numerix

Edges swapped between adjacent pairs of triangles until


boundary is maintained
Delaunay Triangulation in action
Boundary Constrained

Local Swapping
© Zeus Numerix

Edges swapped between adjacent pairs of triangles until


boundary is maintained
Delaunay Triangulation in action
Boundary Constrained

Local Swapping
© Zeus Numerix

Edges swapped between adjacent pairs of triangles until


boundary is maintained
Advancing front Algorithm

Algorithm (in 2D)


• Boundary is discretised based upon the points per wavelength (ppw)
criteria
• Initialize front as a set of line segments defining the boundary completely
• The front is advanced in to the domain producing triangles as it
advances.
• Front advances in a variety of ways depending on the angle between
two consecutive edges of the front:
• Three possibilities arise : as discussed in the next slide

Advancing
/ppw
front Domain :
© Zeus Numerix

A B
Advancing front Algorithm

• Determine whether element formed with the trial point crosses any
edge.
• If yes, select a new trial point and try again.
• Add the new point, edges and triangles to the respective lists. Delete
base edge from the front and add new edge(s) to the front till front is
empty Case C
Case A Case B

New front
Trial point
  

Case Deleting vertices Deleting edges Adding vertices Adding edges Included angle
© Zeus Numerix

Case A 1 2 Nil 1  < 30


Case B 1 2 1 2 30 <  < 120
Case C Nil 1 1 2  > 120
Advancing Front

initial front

C
Trial point

Step 1:
A B
Create a list of vertices, edges and triangles

Consider boundary as the initial front. Advance the front by creating a triangle
in the domain with an edge (say AB). Locate vertex C (trial point) for the
© Zeus Numerix

purpose.

If point C is acceptable form a triangle in the domain


Advancing Front (contd.)

Vertex added

C’ D
r

Triangle
added

Step 2: Edge deletedA’ B’

Delete one edge, add one vertex, add two edges and add one triangle from / to
the respective lists
© Zeus Numerix

Choose a new advancing front (A’ B’). Determine if trial point C’ is within radius
r (= /ppw) , if not, accept D.
Advancing Front (contd.)

deleted
Edge
Triangle Triangle
1 added 2 added

Edge
deleted
Step 3 :

Delete two edges, add one edge and add one triangle to the respective lists
© Zeus Numerix

Note that “Book-Keeping” of the vertices, edges and triangles is important


Advancing Front (contd.)

Step 4 :

Delete two edges, add one edge and add one triangle to the respective lists
© Zeus Numerix
Advancing Front (contd.)

Step 5 :

Delete one edge, add two edges and add one triangle to the respective lists
© Zeus Numerix

Note that so far only one vertex has been added to the list of vertices
Advancing Front (contd.)

Step 6 :

Delete four edges, delete four vertices and add two triangles

Where multiple choices are available, use best quality (closest shape to
© Zeus Numerix

equilateral) triangle

Reject any triangle that intersects existing front


Advancing Front (contd.)

r
C

B
Step 7:

To recover , reject any inverted triangles AB X AC < 0)


© Zeus Numerix
Advancing Front Algorithm

Advantages:
Method can be used for surfaces and volume though a lot of modification is
required
Anisotropic grids can be produced
Disadvantages
Grid quality is not high
Advancing fronts collide to produce poor grids
© Zeus Numerix

Front Advancing in the process and triangulation completed


© Zeus Numerix

Hybrid Meshes
Hybrid Methods

When two or more meshes / methods are used

Structured mesh + tet meshes


© Zeus Numerix

Image courtesy of Roy P. Koomullil, Engineering Research Center,


Mississippi State University, http://www.erc.msstate.edu/~roy/

Image courtesy of acelab, University of Texas, Austin,


http://acelab.ae.utexas.edu
Hybrid Mesh Through Advancing Front

Discretize Boundary
© Zeus Numerix
Hybrid Mesh Through Advancing Front

Convex
Corner Concave Corner
© Zeus Numerix
Closure

• Mesh generation consists of


• 3D Mesh Generation : Dividing volume where electromagnetic field is
required to be calculated in to tetrahedrons or hexahedrons
• 2D/ Surface Mesh Generation : Diving surfaces which limits the
electromagnetic field or material boundaries into triangles or
quadrilaterals
• Mesh generation affect the accuracy of solution
• Mesh Generation requires domain experience
• Mesh generation affects the duration and cost of
simulation
• Zeus Numerix uses it proprietary software GridZ™ for
© Zeus Numerix

the purpose.
Thank You!
© Zeus Numerix

3 November 2014 60
© Zeus Numerix

Questions?

You might also like