Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Unstructured adaptive mesh generation and sparse matrix storage applied to Stokes flow around cylinders Cameron Bracken1
E521 May 1, 2008
1
Humboldt State University
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Project Goals
1. Solve the 2D Steady Stokes equations via finite elements 2. Investigate the placement of cylindrical obstructions in the flow field 3. Adaptively generate the finite element mesh 4. Utilize sparse matrix storage
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Stokes equations - Simplification
Computation Time Results
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Stokes equations - Simplification Start with the NS equations: ρVt − µ∇2 V + ρ(V · ∇)V + ∇p = 0
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Stokes equations - Simplification Start with the NS equations: ρVt − µ∇2 V + ρ(V · ∇)V + ∇p = 0 Assume steady, µ∇2 V + ρ(V · ∇)V + ∇p = 0
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Stokes equations - Simplification Start with the NS equations: ρVt − µ∇2 V + ρ(V · ∇)V + ∇p = 0 Assume steady, µ∇2 V + ρ(V · ∇)V + ∇p = 0 Assume irrotational flow, ν∇2 V + ∇p = 0 And we arrive at the Stokes equations.
(1)
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Stokes equations - Simplification Start with the NS equations: ρVt − µ∇2 V + ρ(V · ∇)V + ∇p = 0 Assume steady, µ∇2 V + ρ(V · ∇)V + ∇p = 0 Assume irrotational flow, ν∇2 V + ∇p = 0 And we arrive at the Stokes equations. And for the continuity equation, assume incompressible,
(1)
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Stokes equations - Simplification Start with the NS equations: ρVt − µ∇2 V + ρ(V · ∇)V + ∇p = 0 Assume steady, µ∇2 V + ρ(V · ∇)V + ∇p = 0 Assume irrotational flow, ν∇2 V + ∇p = 0
(1)
And we arrive at the Stokes equations. And for the continuity equation, assume incompressible, ∇·V =0
(2)
We have enough information to describe any very viscous and/or slow moving fluid (RE 1,creeping flow).
Introduction
Mesh Generation
Model Results
Formal Problem Statement
Scalar Equations: −ν
∂2u ∂ 2 u ∂p − ν + =0 ∂x 2 ∂y 2 ∂x
−ν
∂2v ∂p ∂2v − ν + =0 2 2 ∂x ∂y ∂y ∂u ∂v + =0 ∂x ∂y
Meshing Results
Computation Time Results
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Formal Problem Statement ∂u ∂n
=
∂v ∂n
=0
∂2u ∂ 2 u ∂p − ν + =0 ∂x 2 ∂y 2 ∂x
−ν
∂2v ∂p ∂2v − ν + =0 2 2 ∂x ∂y ∂y ∂u ∂v + =0 ∂x ∂y
u=v =0
p=0
v = k x (1 − x) u=0
u=v =0
−ν
u=v =0
Scalar Equations:
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Basis Functions (xk , yk )
(xk , yk ) (xik , yik ) (xjk , yjk )
(xi , yi )
(xi , yi ) (xij , yij ) (xj , yj )
Linear Pressure Element.
(xj , yj ) Quadratic Velocity Element.
How, you ask, do we generate a mesh which accommodates holes and adaptively refines itself?
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Constrained Adaptive Mesh Generation Mesh Generation
[Basic Structured Grid Generation, Farrashkhalvat and Miles 2003]
Introduction
Mesh Generation
Model Results
Unstructured grid generation Meshing Results
203
Computation Time Results
Conclusions
Constrained Adaptive Mesh Generation Mesh Generation
nay triangulation. Voronoi-segment algorithm.
Unstructured
nay triangulation for an airfoil. Voronoi-segment algorithm. [Basic Structured Grid Generation, Farrashkhalvat and Miles 2003]
Introduction
Mesh Generation
Model Results
Unstructured grid generation Meshing Results
203
Computation Time Results
Conclusions
Constrained Adaptive Mesh Generation Mesh Generation
nay triangulation. Voronoi-segment algorithm.
Unstructured
Unstructured Adaptive
nay triangulation for an airfoil. Voronoi-segment algorithm. [Basic Structured Grid Generation, Farrashkhalvat and Miles 2003]
Introduction
Mesh Generation
Unstructured grid generation 203 Meshing Results Computation Time Results Fig. 6.3 Area functional.
Model Results
Conclusions
Constrained Adaptive Mesh Generation Mesh Generation
nay triangulation. Voronoi-segment algorithm. Fig. 6.4 Area functional.
Unstructured
Structured
Unstructured Adaptive
Fig. 6.5 Area-orthogonality. nay triangulation for an airfoil. Voronoi-segment algorithm. [Basic Structured Grid Generation, Farrashkhalvat and Miles 2003]
Introduction
Mesh Generation
Unstructured grid generation 203 Meshing Results Computation Time Results Fig. 6.3 Area functional.
Model Results
Conclusions
Constrained Adaptive Mesh Generation Mesh Generation
nay triangulation. Voronoi-segment algorithm. Fig. 6.4 Area functional.
Unstructured
Structured
Unstructured Adaptive
Structured Adaptive
Fig. 6.5 Area-orthogonality. nay triangulation for an airfoil. Voronoi-segment algorithm. [Basic Structured Grid Generation, Farrashkhalvat and Miles 2003]
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Adaptive mesh framework (a.k.a. Error controlled FE) Generate Sparse Set of Initial Nodes
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Adaptive mesh framework (a.k.a. Error controlled FE) Generate Sparse Set of Initial Nodes Mesh Generation
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Adaptive mesh framework (a.k.a. Error controlled FE) Generate Sparse Set of Initial Nodes Mesh Generation Solve Stokes Equations
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Adaptive mesh framework (a.k.a. Error controlled FE) Generate Sparse Set of Initial Nodes Mesh Generation Solve Stokes Equations
Identify Elements to Refine
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Adaptive mesh framework (a.k.a. Error controlled FE) Generate Sparse Set of Initial Nodes Mesh Generation Solve Stokes Equations
Elements to refine <m
Identify Elements to Refine
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Adaptive mesh framework (a.k.a. Error controlled FE) Generate Sparse Set of Initial Nodes Mesh Generation Refine Mesh
Solve Stokes Equations
no
Elements to refine <m
Identify Elements to Refine
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Adaptive mesh framework (a.k.a. Error controlled FE) Generate Sparse Set of Initial Nodes Mesh Generation Refine Mesh
Solve Stokes Equations
no
Elements to refine <m
Identify Elements to Refine
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Adaptive mesh framework (a.k.a. Error controlled FE) Generate Sparse Set of Initial Nodes Mesh Generation Refine Mesh
Solve Stokes Equations
no
Elements to refine <m Stop
How is this efficient?
yes
Identify Elements to Refine
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
The Error Indicator and Relative Error Measurement I
Typically we take some measure of the solution gradient as an indicator of elemental error.
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
The Error Indicator and Relative Error Measurement I
Typically we take some measure of the solution gradient as an indicator of elemental error.
I
These measures are called “a posteriori” (after the fact) estimates because we must solve the problem before we get an estimate of error.
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
The Error Indicator and Relative Error Measurement I
Typically we take some measure of the solution gradient as an indicator of elemental error.
I
These measures are called “a posteriori” (after the fact) estimates because we must solve the problem before we get an estimate of error.
I
For the Stokes equations we have three indicators: u, v , p.
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
The Error Indicator and Relative Error Measurement I
Typically we take some measure of the solution gradient as an indicator of elemental error.
I
These measures are called “a posteriori” (after the fact) estimates because we must solve the problem before we get an estimate of error.
I
For the Stokes equations we have three indicators: u, v , p.
Let θe be the indicator for an element e with vertex nodes i, j, k:
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
The Error Indicator and Relative Error Measurement I
Typically we take some measure of the solution gradient as an indicator of elemental error.
I
These measures are called “a posteriori” (after the fact) estimates because we must solve the problem before we get an estimate of error.
I
For the Stokes equations we have three indicators: u, v , p.
Let θe be the indicator for an element e with vertex nodes i, j, k: Ee =
(Maximum nodal value − Minimum Nodal Value)e Average difference in max and min nodal values over all elements max θie , θje , θke − min θie , θje , θke h i Ee = 1 Pnele n , θ n , θ n − min θ n , θ n , θ n max θ n=1 i j i j k k nele
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Simulation Model Results - Verification
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Simulation Model Results - Verification 0
0.1
0.2
0.3
0.1
0.4
0.2
0.3
0.4
−4
0
2
2
0.2
1.8
1.8
0.4
1.6
1.6
0.6
1.4
1.4
0.8
1.2
1.2
1
1
1
1.2
0.8
0.8
1.4
0.6
0.6
1.6
0.4
0.4
1.8
0.2
0.2
2
0
0.5
1
0
0
0.5
(d) Velocity Field (e) Velocity tours
1
0
0
−2
0
0.5
2
1
Con- (f) Streamlines and Pressure Contours
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
1 Obstruction 0
0.2
0.1
0.4
0.2
0.3
0.4
0
0.5
0
2
2
0.2
1.8
1.8
0.4
1.6
1.6
0.6
1.4
1.4
0.8
1.2
1.2
1
1
1
1.2
0.8
0.8
1.4
0.6
0.6
1.6
0.4
0.4
1.8
0.2
0.2
2
0
0.5
1
0
0
0.5
(a) Velocity Field (b) Velocity tours
1
0
0
5
10
0.5
15
20
1
Con- (c) Streamlines and Pressure Contours
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
5 Obstructions 0
0.2
0.4
0.6
0.8
0.2
0.4
0.6
0
0.8
2
0.2
1.8
0.4
1.6
1.6
0.6
1.4
1.4
0.8
1.2
1.2
1
1
1
0.8
0.8
1.4
0.6
0.6
1.6
0.4
0.4
1.8
0.2
0.2
2
0
1
60
80
1.8
1.2
0.5
40
2
0
0
20
0
0.5
(a) Velocity Field (b) Velocity tours
1
0
0
0.5
1
Con- (c) Streamlines and Pressure Contours
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
13 obstructions 0
0.5
0.2
1
0.4
0.6
0.8
0
0
2
2
0.2
1.8
1.8
0.4
1.6
1.6
0.6
1.4
1.4
0.8
1.2
1.2
1
1
1
1.2
0.8
0.8
1.4
0.6
0.6
1.6
0.4
0.4
1.8
0.2
0.2
2
0
0
0.5
1
0
0.5
(a) Velocity Field (b) Velocity tours
1
0
0
100
0.5
200
1
Con- (c) Streamlines and Pressure Contours
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Additional Verification
';
'i'l'
""':"""" t-
b* ' 1 , :, ' : : '
[TQ Education and Training Ltd.]
-.
Computation Time Results
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Meshing Results Pressure
Initial Mesh
Horizontal velocity
Vertical velocity
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Meshing Results Pressure
Refinement 1
Horizontal velocity
Vertical velocity
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Meshing Results Pressure
Refinement 2
Horizontal velocity
Vertical velocity
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Meshing Results Pressure
Refinement 3
Done
Horizontal velocity
Vertical velocity
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Meshing Results Pressure
Refinement 4
Done
Horizontal velocity
Vertical velocity
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Meshing Results Pressure
Horizontal velocity
Refinement 5
Done
Done
Vertical velocity
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Meshing Results Pressure
Horizontal velocity
Vertical velocity
Refinement 6
Done
Done
Done
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results 5 Hole
Meshing Results
Computation Time Results
Conclusions
Introduction
Mesh Generation ModelAND Results Meshing Results Computation Time BRACKEN: ADAPTIVE MESHING SPARSE MATRIX STORAGE FOR STOKES FLOW 11 Results BRACKEN: ADAPTIVE MESHING AND SPARSE MATRIX STORAGE FOR STOKES FLOW
13
Pressure as error indicator
Figure 16. Sample Refinement process using pressure as the error indicator. Figure 16. Sample Refinement process using pressure as the error indicator.
Meshing Results 5 Hole
Horizontal velocity as error indicator Figure 17. Sample Refinement process with 5 obstructions using pressure as the error indicator.
Figure 17. Sample Refinement process with 5 obstructions using horizonal component of velocity as the error indicator.
Vertical as errorprocess indicator Figure 17. velocity Sample Refinement with 5 obstructions using horizonal component of velocity as the error indicator. Figure 18. Sample Refinement process with 13 obstructions using horizonal component of velocity as the error indicator.
Conclusions
Figure 17. 19. Sample Refinement process with 5Model obstructions using horizonal pressure ascomponent the error indicator. of velocity as Computation the error indicator. Introduction Mesh Generation Results Meshing Results Time Results
Conclusions
Figure 21. Sample Refinement process with 13 obstructions using vertical component of velocity as the error indicator.
Pressure as error indicator
Meshing Results 13 Holes
Figure 18. Sample Refinement process with 5 obstructions using vertical component of velocity as the error indicator.
Horizontal velocity as error indicator Figure 22. Sample Refinement process with 13 obstructions using pressure as the error indicator.
BRACKEN: ADAPTIVE MESHING AND SPARSE MATRIX STORAGE FOR STOKES FLOW
Vertical as errorprocess indicator Figure 20. velocity Sample Refinement with 13 obstructions using horizonal component of velocity as the error indicator.
15
●
● ●
25
● ● ●
●
●
●
50 45
Horizontal velocity Vertical velocity Pressure
40
●
●
35
●
35 30
●
Computation Time Results
●
● ● ● ● ●
30
40
●
Average Percent Realative Elemental Error
Horizontal velocity Vertical velocity Pressure
●
Meshing Results
●
● ●
25
● ●
Model Results
45
50
Mesh Generation
20
Average Percent Realative Elemental Error
Introduction
1
2
3
4
●
5
6
7
2
3
4
5
5 Obstructions
Horizontal velocity Vertical velocity Pressure
40
45
50
1 Obstruction ●
1
Mesh Refinement Step
Mesh Refinement Step
●
35
Error Results
30
● ● ●
●
●
25
●
●
●
●
20
Average Percent Realative Elemental Error
●
●
●
1
2
●
3 Mesh Refinement Step
13 Obstructions
●
4
5
Conclusions
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Computation Time Results - Sparse vs. Dense Solvers
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Direct Dense Solver (LAPACK's DGETRS) Iterative Sparse Solver (SLAP's DGMRES)
20 15 10 5 0
Solution Time (s)
25
30
Computation Time Results - Sparse vs. Dense Solvers
1000
2000
3000
4000
5000
6000
7000
# of Unknowns
Sparseness
Computation Time
Introduction
Mesh Generation
Model Results
Meshing Results
Computation Time Results
Conclusions
Conclusions
I
I
Reproduced well know flow patterns around cylinders at very low Reynolds numbers. Implemented unstructured adaptive meshing algorithm. I I
I
Pressure performed well as an error indicator Different Error indicators produced very different meshes.
Sparse matrix storage and equation solver drastically reduced solution time.