0% found this document useful (0 votes)
7 views53 pages

Meshgeneration Slides

The document discusses mesh generation techniques used in numerical solutions of differential equations, focusing on structured and unstructured mesh generation methods. It covers single-block and multi-block grid generation, various mapping techniques, and algorithms for creating high-quality meshes, including Delaunay refinement and advancing front methods. Additionally, it addresses mesh size functions, smoothing techniques, and the DistMesh generator for optimizing mesh quality.

Uploaded by

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

Meshgeneration Slides

The document discusses mesh generation techniques used in numerical solutions of differential equations, focusing on structured and unstructured mesh generation methods. It covers single-block and multi-block grid generation, various mapping techniques, and algorithms for creating high-quality meshes, including Delaunay refinement and advancing front methods. Additionally, it addresses mesh size functions, smoothing techniques, and the DistMesh generator for optimizing mesh quality.

Uploaded by

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

Mesh Generation

Per-Olof Persson
[email protected]

Department of Mathematics
University of California, Berkeley

Math 228B Numerical Solutions of Differential Equations


Structured Mesh Generation
Why Structured Meshes?

Lead to very efficient numerical methods


High quality for sufficiently simple geometries
Larger grid control when high anisotropy is required
Multi-block approach allows for realistic geometries
Single-Block Grid Generation

Construct a one-to-one mapping between a rectangular


computational domain and a physical domain
Ideally, grid size in physical space should be dictated by
solver/solution requirements
Ensure grid quality e.g. smoothness, orthogonality
Single-Block Grid Common Topologies

O-Grid C-Grid

H-Grids
. . . plus combinations
Examples: Single-Block O-Grids
Examples: Single-Block C,H-Grids
Examples: H-Grids

H-Grid H-Grid/I-Grid
Multi-Block Grid Generation

Subdivide domain into an unstructured assembly of


quadrilaterals/hexahedra
Obtaining block topology automatically is hard
Obtaining block geometry automatically (e.g. point
coordinates) once topology is known is tractable
Examples: Multi-Block Grids
Examples: Multi-Block Grids
Block Topology Generators

(from ICEM CFD)

Automatic H ⇒ O conversion
Block Topology Generators - Medial Axis Transform
(MAT)
Single Block Grid Generation - Creating the Mapping

Conformal Mapping
Transfinite Interpolation
Solving PDE’s
Elliptic
Parabolic/Hyperbolic
Conformal Mapping

df
Any function α = f (z) such that 6= 0 defines a one-to-one
dz
(conformal) mapping between z = x + iy and α = ξ + iη, or
between (x, y) and (ξ, η).
The functions ξ(x, y) and η(x, y) satisfy the Cauchy-
Riemann equations (e.g. ξx = ηy , and ηx = −ξy ) and as a
consequence, they are harmonic

∇2 ξ = 0, ∇2 η = 0 (smoothness)

Preserve angles (grid orthogonality)


Preserve ratios
Lead to high quality grids
Limited to 2D
Conformal Mapping Transformations

Jukoswki (maps circle or radius c to segment [−2c, 2c])


2
c2

α + 2c z+c
α=z+ , or =
z α − 2c z−c

Karman-Trefftz  n
α + 2c z+c
=
α − 2c z−c
Schwarz-Christoffel (maps polygon into half plane)
n 
z βk

dα Y
=K 1−
dz zk
k=1
Conformal Mapping - Schwarz-Christoffel

Ref. “Schwarz-Christofell Mapping”, Driscoll and Trefethen,


Cambridge Univeristy Press, 2002.
Algebraic Mappings

Construct a mapping between the boundaries of the unit


square (cube) and the boundaries of an ”arbitrary” region
which is topologically equivalent
Combine 1D interpolants using Boolean sums to construct
mapping - Transfinite Interpolation (TFI)
Not guaranteed to be one-to-one
Orthogonality not guaranteed
Very Fast
Quite General
Grid quality not always assured
Algebraic Mappings - 1D Interpolants

General 1D interpolant of f (x) for x ∈ (0, 1)


L X
P
X dn f
fˆ(x) ≡ Πx f = αin (x)
dxn x=xi
i=0 n=0

αin (x) are the blending functions


Examples
Quadratic Lagrange interpolation - P = 0, L = 2

Πx f = (2x2 − 3x + 1)f (0) + (4x − 4x2 )f (0.5) + (2x2 − x)f (1)

Hermite interpolation - P = 1, L = 2

Πx f = (1 − 3x2 − 2x3 )f (0) + (x − 2x2 + x3 )f (1) +


x2 (3 − 2x)2 f 0 (0) + x2 (x − 1)f 0 (1)
Algebraic Mappings - Transfinite Interpolation

η η
y
R(0,η)
R(x,0)

R(1,η)
R(x,0)
ξ ξ
x

Start from 1D boundary mappings of R ≡ (x, y), e.g.


R(ξ, 0), R(ξ, 1), R(0, η), R(1, η)
Construct 1D interpolants in the ξ and η directions (e.g.
linear)

Πx R = (1 − ξ)R(0, η) + ξR(1, η)
Πη R = (1 − η)R(ξ, 0) + ηR(ξ, 1)
Algebraic Mappings - Transfinite Interpolation

Construct two-dimensional interpolant by doing the Boolean


sum

R̂(ξ, η) = (Πξ ⊕ Πη )R = (Πξ + Πη − Πξ Πη )R

Expanding
   
R(0, η) 1−η
R̂(ξ, η) = (1−ξ, ξ) +(R(ξ, 0), R(ξ, 1))
R(1, η) η
  
R(0, 0) R(0, 1) 1−η
−(1 − ξ, ξ)
R(1, 0) R(1, η) η
Extends to general 1D interpolants and any dimension
Algebraic Mappings - Example
Algebraic Mappings - Example

Πξ R Πη R

(Πξ ⊕ Πη )R
Algebraic Mappings - Grid Control

Use non-regular subdivisions in (ξ, η) (e.g. exponential


functions) to obtain desired element sizes in (x, y)
Use derivative boundary conditions to enforce boundary
orthogonality
∂R ∂R
· =0
∂ξ ∂η
PDE Grid Generation

Construct mapping by solving a PDE


Elliptic Equations (smooth grids)

∇2 ξ(x, y) = P (x, y), ∇2 η(x, y) = Q(x, y)

Hyperbolic equations (orthogonal grids)

xξ yη − xη yξ = J (size control)
xξ xη + yξ yη = 0 (orthogonality)

Most widely used approach


Grids usually have high quality
Elliptic Grid Generation

We are interested in solving

−∇2 ξ = P in Ω

ξ = g on ΓD
∂ξ
= h on ΓN = Γ\ΓD
∂n
where P , g, and h are given.

Similarly for η(x, y)


Elliptic Grid Generation

x = x(ξ, η)
y = y(ξ, η)
−→

? ? ∇2 ξ = P
Can we determine an equivalent problem to be solved on Ω̂?
Elliptic Grid Generation

ξ = ξ(x, y) x = x(ξ, η)
η = η(x, y) y = y(ξ, η)

! ! ! ! ! !
dξ ξx ξy dx dx xξ xη dξ
= =
dη ηx ηy dy dy yξ yη dη
! !−1 !
ξx ξy xξ xη 1 yη −xη
⇒ = =
ηx ξy yξ yη J −yξ xξ

J = xξ yη − xη yξ
Elliptic Grid Generation

yη x
ξx = J ξy = − Jη
y xξ
ηx = − Jξ ηy = J
 
∂ ∂ ∂  yη 
and ξxx = (ξx ) = ξx + ηx
∂x ∂ξ
  ∂η J
1 ∂ ∂ yη
= yη − yξ
J ∂ξ ∂η J
= ...

ξyy = . . .
Elliptic Grid Generation - Thompson’s Equations

Finally, ξxx + ξyy = 0 and ηxx + ηyy = 0, become

axξξ − 2bxξη + cxηη = 0


ayξξ − 2byξη + cyηη = 0

a, b, c depend on the mapping.


a = x2η + yη2 b = xξ xη + yξ yη c = x2ξ + yξ2
These equations can be solved using central finite
differences on a regular grid in the (ξ, η) domain to
determine the (x, y) coordinates of each grid point (see notes
from 16.920 for details).
These equations are non-linear and are typically solved using
an SOR (Succesive Over-Relaxation) Method
Elliptic Grid Generation - Grid Control

Use, ξxx + ξyy = P (x, y) and ηxx + ηyy = Q(x, y),

axξξ − 2bxξη + cxηη = −J 2 (xξ P + xη Q)


ayξξ − 2byξη + cyηη = −J 2 (yξ P + yη Q)

The functions P (ξ, η) and Q(ξ, η) can be used to obtain grid


control
Derivative boundary conditons can be used to enforce grid
orthogonality at the boundary

Ref. ”Numerical Generation of Two-Dimensional Grids by Use of


Poisson Equations with Grid Control”, Sorenson and Steger,in
Numerical Grid Generation Techniques, Smith, R.E. (Ed.),
NASA-CP-2166, pp. 449-461, 1980
Unstructured Mesh Generation
Unstructured Mesh Generation

Approximate a domain in Rd by simple geometric shapes


Determine node points and element connectivity
Goal: Resolve the domain accurately with well-shaped
elements, but use as few elements as possible
Applications: Numerical solution of PDEs (FEM, FVM, DGM,
BEM), interpolation, computer graphics, visualization
Geometry Representations

Explicit Geometry Implicit Geometry


Parameterized boundaries Boundaries from contour
f (x,y)=0

f (x,y)<0

(x,y) = (x(s), y(s)) f (x,y)>0


Unstructured Meshing Algorithms

Delaunay refinement
Refine an initial triangulation by inserting centroid points and
updating connectivities
Efficient and robust, provably good in 2-D
Advancing front
Propagate a layer of elements from boundaries into domain,
stitch together at intersection
High quality meshes, good for boundary layers, but somewhat
unreliable in 3-D
Unstructured Meshing Algorithms

Octree mesh
Create an octree, refine until geometry well resolved, form
elements between cell intersections
Guaranteed quality even in 3-D, but poor element qualities
DistMesh
Improve initial triangulation by node movements and
connectivity updates
Easy to understand and use, handles implicit geometries, high
element qualities, but non-robust and low performance
Delaunay Triangulation

Find non-overlapping triangles that fill the convex hull of a set


of points
Properties:
Every edge is shared by at most two triangles
The circumcircle of a triangle contains no other input points
Maximizes the minimum angle of all the triangles

Empty circumcircle

Delaunay triangulation Voronoi tesselation


Constrained Delaunay Triangulation
The Delaunay triangulation might not respect given input
edges

Non-conforming triangles

Use local edge swaps to recover the input edges


Delaunay Refinement Method

Algorithm:
Form initial triangulation using boundary points and outer box
Replace an undesired element (bad or large) by inserting its
circumcenter, retriangulate and repeat until mesh is good
Will converge with high element qualities in 2-D
Very fast – time almost linear in number of nodes
The Advancing Front Method

Discretise the boundary as initial front


Add elements into the domain and update the front
When front is empty the mesh is complete

New element

Original front New front

New element

Original front New front


Grid Based and Octree Meshing

Overlay domain with regular grid, crop and warp edge points
to boundary

Octree instead of regular


grid gives graded mesh with
fewer elements
Mesh Size Functions

Function h(x) specifying desired mesh element size


Many mesh generators need a priori mesh size functions
Physically-based methods such as DistMesh
Advancing front and Paving methods
Discretize mesh size function h(x) on a background grid
Mesh Size Functions

Based on several factors:


Curvature of geometry boundary
Local feature size of geometry
Numerical error estimates (adaptive solvers)
Any user-specified size constraints
Also: |∇h(x)| ≤ g to limit ratio G = g + 1 of neighboring
element sizes
Explicit Mesh Size Functions

A point-source

h(x) = hpnt + g|x − x0 |

Any shape, with distance function φ(x)

h(x) = hshape + gφ(x)

Combine mesh size functions by min operator:

h(x) = min hi (x)


i

For more general h(x), solve the gradient limiting equation


[Persson’05]
∂h
+ |∇h| = min(|∇h|, g),
∂t
h(t = 0, x) = h0 (x).
Mesh Size Functions – 2-D Examples

Mesh Size Function h(x) Mesh Based on h(x)


Laplacian Smoothing

Improve node locations by iteratively moving nodes to average


of neighbors:
ni
1 X
xi ← xj
ni
j=1

Usually a good postprocessing step for Delaunay refinement


However, element quality can get worse and elements might
even invert:
Face and Edge Swapping

In 3-D there are several swappings between neighboring


elements
Face and edge swapping important postprocessing of
Delaunay meshes

Figure 30: Face-edge swapping


Boundary Layer Meshes

Unstructured mesh for offset curve ψ(x) − δ


The structured grid is easily created with the distance function
The DistMesh Mesh Generator
The DistMesh Mesh Generator

1. Start with any topologically correct initial mesh, for example


random node distribution and Delaunay triangulation
2. Move nodes to find force equilibrium in edges
Project boundary nodes using implicit function φ
Update element connectivities
Internal Forces

For each interior node:


X
Fi = 0
i

F5
Repulsive forces depending on
F
3
edge length ` and equilibrium
F6 length `0 :
F2
F
(
F
1
4
k(`0 − `) if ` < `0 ,
|F | =
0 if ` ≥ `0 .

Get expanding mesh by choosing


`0 larger than desired length h
Reactions at Boundaries

For each boundary node:


X
R
Fi + R = 0
F3
i
F1
F4 Reaction force R:
F
2
Orthogonal to boundary
Keeps node along
boundary
Node Movement and Connectivity Updates

Move nodes p to find force


equilibrium:

pn+1 = pn + ∆tF (pn )

Project boundary nodes to


φ(p) = 0
Elements deform, change
connectivity based on element
quality or in-circle condition
(Delaunay)

You might also like