Jul 5, 2012 - Geometry Related Issues For Mesh Generation . ...... Literature Survey . ...... containing elements aligned with the area boundaries with few irregular internal ...... No approach beats regular structured grids in terms of efficiency.
1
CFD Open Series Revision 1.85.7
Mesh Generation in CFD Ideen Sadrehaghighi, Ph.D.
Cyliner Head (Polyhedral cells)
Typical Turbo-Machine Mesh (Hexahedral cells)
ANNAPOLIS, MD
Mixer (SAMM cells)
Wing-Body-Pylon-Nacelle (Tetrahedral cells)
2
Contents 1
Introduction ................................................................................................................................ 15
2
Computer-Aided Design (CAD) ............................................................................................. 16
3
Structured Mesh Generation ................................................................................................. 24
Software and Technology ................................................................................................................................ 16 Commercially Available CAD Systems: .............................................................................. 17 Freeware and Open Source ............................................................................................... 18 Solid (Geometry) Modeling ............................................................................................................................. 18 Principal Characteristics of a Solid Modeling Software ..................................................... 18 Feature-Based Modeling ................................................................................................... 18 Constraint-Based Modeling ............................................................................................... 18 Parametric Modeling ......................................................................................................... 19 History-Based Modeling .................................................................................................... 19 Associative Modeling ......................................................................................................... 19 Constructive Solid Geometry (CSG) Representation of Solids.......................................................... 19 Basic Primitives .................................................................................................................. 19 Regularized Boolean Operators ......................................................................................... 20 The CSG Tree ......................................................................................................................................................... 20 Geometry Related Issues For Mesh Generation ..................................................................................... 20 Understanding the Analysis Requirements ....................................................................... 21 Disfeaturing ....................................................................................................................... 21 “Dirty” Geometry ............................................................................................................... 22
1.8
Classification of Mesh Generation Techniques ....................................................................................... 25 Domain Decomposition and Multi-Block Strategy ................................................................................ 26 Field (Domain) Discretization Process (Mesh Generation)............................................................... 27 Conformal Mapping (The Sponge Analogy) ............................................................................................. 28 Domain Decomposition with Multi-Blocking (Multi-Sponge Analogy) ........................................ 28 Structured Grid Generation ............................................................................................................................ 29 Complex Variables ............................................................................................................. 30 Algebraic Methods -Transfinite Interpolation (TFI) ........................................................... 30 PDE Smoother .................................................................................................................... 31 3.6.3.1 Elliptic Schemes ............................................................................................................ 32 3.6.3.1.1 Case Study – Orthogonal Elliptic Mesh Smoother............................................. 33 3.6.3.1.2 Orthogonality Adjustment Algorithm ................................................................ 33 3.6.3.1.3 Stretching Functions ........................................................................................... 34 3.6.3.1.4 Extension to 3D .................................................................................................. 34 3.6.3.1.5 Mesh Quality Analysis ........................................................................................ 35 3.6.3.2 Hyperbolic Schemes ..................................................................................................... 35 3.6.3.3 Parabolic Schemes ........................................................................................................ 36 Variational Method............................................................................................................ 36 Structured Adaptive Grid.................................................................................................................................. 37 Case Study – 2D Euler Flow Over an NACA Airfoil ............................................................. 39
3
4
Un-Structured Mesh Generation .......................................................................................... 42
Advancing Front Method ................................................................................................................................. 42 Advancing Front Triangular Mesh Generator .................................................................... 43 Advancing Front Quadrilateral Meshing Using Triangle Transformations ................................ 45 Outline of Quad-Morphing Algorithm ............................................................................... 45 4.2.1.1 Initial Triangle Mesh ..................................................................................................... 45 4.2.1.2 Front Definition ............................................................................................................ 45 4.2.1.3 Front Edge Classification .............................................................................................. 45 4.2.1.4 Front Edge Processing .................................................................................................. 45 4.2.1.5 Topological Clean-up and Final Smoothing Process ..................................................... 47 4.2.1.6 Example Problems ........................................................................................................ 47 4.2.1.7 Conclusion .................................................................................................................... 50 Delaney Triangulation Method ...................................................................................................................... 50 Properties of Delaunay Triangulation................................................................................ 50 4.3.1.1 Delaunay Lemma .......................................................................................................... 51 4.3.1.2 Compactness ................................................................................................................ 51 Algorithms ......................................................................................................................... 51 Advantages ........................................................................................................................ 53 Delaunay Adaptive Refinement ......................................................................................... 54 Voronoi Diagrams .............................................................................................................. 55 Restricted Delaunay Triangulation .................................................................................... 55 Anisotropic Mesh Generation ........................................................................................................................ 56 Case Study - Anisotropic Mesh Generation via Discretized Riemannian Delaunay Triangulations ................................................................................................................................... 57 4.4.1.1 Anisotropic Delaunay Triangulations............................................................................ 59 4.4.1.1.1 Locally Uniform Anisotropic Meshes.................................................................. 59 4.4.1.1.2 Metric Tensor ..................................................................................................... 59 4.4.1.1.3 Distortion ............................................................................................................ 60 4.4.1.1.4 Locally Uniform Anisotropic Meshes.................................................................. 61 4.4.1.1.5 The Star Set ........................................................................................................ 62 4.4.1.1.6 Stars and Inconsistencies ................................................................................... 62 4.4.1.2 Refinement Algorithm .................................................................................................. 63 4.4.1.3 Discussion on the Parameters ...................................................................................... 63 4.4.1.3.1 Parameter φ0 ..................................................................................................... 63 4.4.1.3.2 Parameters r0 and ρ0 .......................................................................................... 64 4.4.1.3.3 Parameters β and δ ............................................................................................ 65 4.4.1.3.4 Parameters σ0 ..................................................................................................... 66 4.4.1.4 Results and Limitations................................................................................................. 66 4.4.1.4.1 Uniform Metric Fields......................................................................................... 66 4.4.1.4.2 Shock-Based Metric Fields on Planar Domains .................................................. 66 4.4.1.4.3 Starred ................................................................................................................ 66 4.4.1.4.4 Hyperbolic .......................................................................................................... 67 4.4.1.4.5 Swirl .................................................................................................................... 68 4.4.1.4.6 Curvature-Based Metrics Fields on Surfaces ...................................................... 68 4.4.1.4.7 Optimization ....................................................................................................... 68 4.4.1.5 Discrete Riemannian Voronoi Diagrams....................................................................... 69 4.4.1.5.1 Advantages Over Isotropic Canvasses ................................................................ 70 4.4.1.5.2 Straight Riemannian Delaunay Triangulation..................................................... 70
4
4.4.1.5.3 Curved Riemannian Delaunay Triangulation ...................................................... 71 4.4.1.6 Conclusion .................................................................................................................... 73 Octree Decomposition ....................................................................................................................................... 73 Unstructured Hexahedral Meshes................................................................................................................ 75 Conversion of Triangular to Quadrilateral Meshes (2D) ................................................... 76 Overset Grids ........................................................................................................................................................ 77 Cartesian Grids ..................................................................................................................................................... 79 Background and Cartesian Grid Origins............................................................................. 79 Cartesian Grids Schemes ................................................................................................... 80 4.8.2.1 Adaptive Mesh Refinement .......................................................................................... 81 4.8.2.2 Immersed Boundary Methods...................................................................................... 83 4.8.2.3 Volume of Fluid Methods ............................................................................................. 84 4.8.2.4 Reconstruction Schemes .............................................................................................. 84 4.8.2.5 Cut Cell Based Methods................................................................................................ 84 4.8.2.6 Chimera Grid Schemes ................................................................................................. 86 4.8.2.7 Hybrid Grid Schemes .................................................................................................... 86 4.8.2.7.1 Composite Grid Approach .................................................................................. 87 Discussion .......................................................................................................................... 89 Trimmed (SAMM) Cells .................................................................................................................................... 90 Polyhedral Cells ............................................................................................................................................. 90 Cell Decomposition ............................................................................................................ 90 Mesh Duality ...................................................................................................................... 91 Methodology ..................................................................................................................... 92 Treatment of Boundary Layer ................................................................................................................. 92 Domain Mesh Stretching in Unstructured Environment .............................................................. 93 Spatial (Field) Discretization ................................................................................................................... 96 Considerations for the Navier-Stokes Equation ............................................................................... 97 Unstructured Quadrilateral Mesh Generation .................................................................................. 98 Geometry Representation ................................................................................................. 98 Local Mesh Generation Algorithm ..................................................................................... 99 Connectivity Information and Data Structure................................................................................ 100
5
Hybrid Meshes ........................................................................................................................ 102
Accuracy Consideration................................................................................................................................. 102 Comparing Mesh Type for Viscous Accuracy................................................................... 103 Effect of Prismatic Extrusion Sub-Layer in Viscous Layer ................................................ 103 Meshing Tools in CD-Adapco® .................................................................................................................... 104 A Novel Methodology for Extrusion Layer Meshing ........................................................ 106 Case Study - Hybrid Unstructured Meshes for Common Research Model (CRM & JSM) via ANSA®................................................................................................................................................................................ 106 Geometry and Mesh Generation Background................................................................. 107 Geometry Handling.......................................................................................................... 107 5.3.2.1 The CRM Model ......................................................................................................... 108 5.3.2.2 The JSM Model ........................................................................................................... 108 Surface Meshing .............................................................................................................. 110 Volume Meshing .............................................................................................................. 114 5.3.4.1 Extrusion Layers Generation ...................................................................................... 114 5.3.4.2 Tetra Meshing............................................................................................................. 115
5
Sample CFD Results ......................................................................................................... 115 5.3.5.1 CRM ............................................................................................................................ 116 5.3.5.2 JSM ............................................................................................................................. 116 Listing of Available Meshing Software .................................................................................................... 118
6
Adaptive Mesh (Unstructured) ......................................................................................... 119
7
Dynamic Meshing ................................................................................................................... 135
8
Assessment of Mesh Types ................................................................................................. 146
Adaptive Meshing by Subdivision ............................................................................................................. 119 Type of Mesh Refinement ............................................................................................................................. 120 R-Refinement (RR) ........................................................................................................... 121 H-Refinement (HR) .......................................................................................................... 122 6.2.2.1 Isotropic vs. Anisotropic Meshing .............................................................................. 123 P-Refinement (PR) ........................................................................................................... 123 Adaptive Mesh Refinement (AMR) ........................................................................................................... 124 Background ...................................................................................................................... 124 Generalities...................................................................................................................... 124 Cell Division for a Geometry ............................................................................................ 126 6.3.3.1 Division Criteria .......................................................................................................... 126 Types of AMR ................................................................................................................... 127 Case Study 1 – Unstructured Mesh Adaptation for 2D Airfoil......................................... 128 6.3.5.1 Adaption Control Mechanism .................................................................................... 130 Case Study 2 – Parallel Implementation of Unstructured Mesh Refinement of Duct Flow 130 Case Study 3 – Generic Transonic Store Release............................................................. 131 Mesh Modification Operators...................................................................................................................... 133
Type of Mesh Motion ...................................................................................................................................... 135 Mesh Deformation ........................................................................................................................................... 136 Finite Volume in Dynamic Mesh ................................................................................................................ 136 Dynamic Mesh Techniques .......................................................................................................................... 137 Laplacian Mesh Morphing ............................................................................................... 137 Pseudo-Solid Equation ..................................................................................................... 138 7.4.2.1 Case Study – Motion of a Cylinder ............................................................................. 138 Radial Basis Function ....................................................................................................... 139 Generalized Grid Interface .............................................................................................. 140 Overset Methods ............................................................................................................. 142 Delaunay Method ............................................................................................................ 143 7.4.6.1 Case Study - Airfoil Rotation ....................................................................................... 143 Spring Analogy ................................................................................................................. 144 Six Degrees of Ferndom (6 DOF)...................................................................................... 144 7.4.8.1 Transitional Deformation ........................................................................................... 144 7.4.8.2 Rotational Deformation.............................................................................................. 144
Structured vs. Unstructured ........................................................................................................................ 146 Time and Memory ........................................................................................................... 146 Resolution ........................................................................................................................ 146
6
Alignment ........................................................................................................................ 146 Definable Normal............................................................................................................. 147 Effect of Cell Topology in Truncation Error ..................................................................... 147 Polyhedral vs. Tetrahedral ............................................................................................... 147 8.1.5.1 Boundary Prismatic Cells ............................................................................................ 148 Accuracy Assessment of Gradient Calculation Methods ................................................................. 150 Geometric Properties ...................................................................................................... 150 Literature Survey ............................................................................................................. 150 Gradient Calculation ........................................................................................................ 151 8.2.3.1 Green-Gauss Gradient Method .................................................................................. 151 8.2.3.2 GG-Simple Face Averaging ......................................................................................... 152 8.2.3.3 GG-Inverse Distance Weighted (IDW) Face Interpolation.......................................... 152 Visual Inspection .............................................................................................................. 153 Results Based on L2 Norm ................................................................................................ 153 Concluding Remarks ........................................................................................................ 155
9
Case Studies Involving Comparisons of Structured vs. Unstructured Meshes . 156
Case Study 1 – Flow through Pipe with 90 degree Bend ................................................................. 156 Case Study 2 - Comparison of Hexa-Structured and Hybrid-Unstructured Meshing Approaches for Numerical Prediction of the Flow Around Marine Propellers .................................. 157 Introduction & Contributions .......................................................................................... 158 Propeller Models ............................................................................................................. 159 Numerical Method........................................................................................................... 159 Meshing ........................................................................................................................... 160 Results ............................................................................................................................. 161 9.2.5.1 Propeller A .................................................................................................................. 162 9.2.5.2 Propeller P5168 .......................................................................................................... 163 Conclusions ...................................................................................................................... 164 Case Study 3 – Structure & Unstructured Hybrid Meshing and its effect on Quality of Solution on Turbine Blade ........................................................................................................................................ 165 Applications ..................................................................................................................... 165 Results ............................................................................................................................. 165 Case Study 4 - Evaluation of Structured vs. Unstructured Meshes for Simulating Respiratory Aerosol Dynamics ............................................................................................................................... 166 Bifurcation Model, Boundary Conditions, and Contributions ......................................... 166 Mesh Types ...................................................................................................................... 168 9.4.2.1 Structured ................................................................................................................... 168 9.4.2.2 Unstructured .............................................................................................................. 168 Governing Equations ....................................................................................................... 170 Numeric Method ............................................................................................................. 171 Results ............................................................................................................................. 173 9.4.5.1 Validation Studies ....................................................................................................... 173 9.4.5.2 Grid Convergence ....................................................................................................... 173 9.4.5.3 Velocity Fields ............................................................................................................. 175 9.4.5.4 Particle Deposition ..................................................................................................... 176 Discussion ........................................................................................................................ 178 9.4.6.1 Advantages of Hexahedral Structured Mesh ............................................................. 179 Conclusion ....................................................................................................................... 180
7
Case Study 5 - Comparison Between Structured Hexahedral and Hybrid Tetrahedral Meshes Generated by Commercial Software for CFD Hydraulic Turbine Analysis ........................... 180 Problem Description ........................................................................................................ 180 Geometry ......................................................................................................................... 181 Mesh Description............................................................................................................. 183 9.5.3.1 Structured Hexahedral Meshes .................................................................................. 183 9.5.3.2 Hybrid Tetrahedral Mesh ........................................................................................... 183 CFD Solution Strategy and Boundary Conditions ............................................................ 184 Results ............................................................................................................................. 184 Conclusion ....................................................................................................................... 187
10
Mesh Sensitivity and Mesh Independence Study ........................................................ 189
11
Mesh Quality ............................................................................................................................ 198
Different Types of Mesh Sensitivity.................................................................................................... 189 Symbolic Differentiation .................................................................................................. 189 Automatic Differentiation ............................................................................................... 189 10.1.2.1 Symbolic vs Automatic Differentiation.................................................................. 189 Finite Differencing ........................................................................................................... 189 Mesh Sensitivity via Direct Differentiation (DD) .......................................................................... 190 Surface Modeling Using NURBS....................................................................................... 190 10.2.1.1 Case Study - 2D Study of Airfoil Grid Sensitivity via Direct Differentiation (DD) .. 192 Adjoint Variable Sensitivity Analysis (AV) ...................................................................................... 193 Mesh Independence Study ..................................................................................................................... 195
Background .................................................................................................................................................. 198 Mesh Quality Metric .................................................................................................................................. 198 Mesh Quality from User’s Perspective ............................................................................ 200 Mesh Quality from Researcher’s Perspective ................................................................. 200 Mesh Quality from Solver’s Perspective.......................................................................... 201 11.2.3.1 CFD++..................................................................................................................... 201 11.2.3.2 Fluent and CFX ....................................................................................................... 201 11.2.3.3 Kestrel .................................................................................................................... 202 11.2.3.4 STAR-CCM+ ............................................................................................................ 202 11.2.3.5 Deducing Results ................................................................................................... 203 Some Geometric Properties ............................................................................................ 203 11.2.4.1 Aspect ratio ........................................................................................................... 203 11.2.4.2 Orthogonality ........................................................................................................ 203 11.2.4.3 Skewness ............................................................................................................... 204 11.2.4.4 Warpage ................................................................................................................ 204 11.2.4.5 Jacobian ................................................................................................................. 204 11.2.4.6 Tetrahedral Volume............................................................................................... 205 11.2.4.7 Polygonal Face Area and Centroid ........................................................................ 205 11.2.4.8 Polyhedral Volume and Centroid .......................................................................... 206 Best Practice for Mesh Generation ..................................................................................................... 206 Geometry Modeling and Geometry Cleanup .................................................................. 207 Computational Domain ................................................................................................... 207 Choice of Grid .................................................................................................................. 207
8
Surface Meshing .............................................................................................................. 208 Volume Meshing .............................................................................................................. 208 Boundary Layer Meshing ................................................................................................. 208 Guidelines for Aerodynamics in General ......................................................................... 209 Guidelines for Auto Aerodynamics .................................................................................. 209 Improvement of Grid Quality .......................................................................................... 210
12
Appendix A ............................................................................................................................... 211
A.1
Computer Code for a Transfinite Interpolation ................................................................................... 211
List of Tables Table 4.1 Nomenclature ........................................................................................................................................... 58 Table 4.2 Comparison of the number of vertices and quality of the mesh for different values of δ - (Courtesy of [Labbe]) .................................................................................................................................................. 65 Table 5.1 Abbreviations......................................................................................................................................... 107 Table 5.2 Currently Available Grid Generation Software ........................................................................ 118 Table 9.1 Dimensions of Domains – (Courtesy of Morgut & Nobile) .................................................. 160 Table 9.2 Grids for Propeller A– (Courtesy of Morgut & Nobile) ......................................................... 160 Table 9.3 Grids for Propeller P5168 – (Courtesy of Morgut & Nobile) .............................................. 160 Table 9.4 Results of Propeller A– (Courtesy of Morgut & Nobile) ....................................................... 162 Table 9.5 Experimental setup of Propeller P5168 ..................................................................................... 163 Table 9.6 Relative Percentage Differences of Computed Values Between Finer and Coarser Mesh for propeller P5168 – (Courtesy of Morgut & Nobile) ...................................................................... 163 Table 9.7 Grid Convergence – (Courtesy of Samir Vinchurkar & Worth Longest) ........................ 174 Table 9.8 Mesh Densities for Structured Hexahedral and Hybrid Un-Structural Tetrahedral – (Courtesy of Rousseau et al.) ................................................................................................................................... 182 Table 10.1 Pros & Cons of Different Grid Sensitivity Method (NDV = Number of Design Variable) ........................................................................................................................................................................... 195
List of Figures Figure 1.1 Figure 2.1 Figure 2.2 Figure 2.3 Figure 2.4 Figure 2.5 Figure 3.1 Figure 3.2 Figure 3.3 Figure 3.4 Figure 3.5 Figure 3.6 Figure 3.7 Figure 3.8 Figure 3.9 Figure 3.10
Methodology of General Grid Generation .................................................................................... 15 Anatomy of commercial CAD Systems .......................................................................................... 17 Fighter Airplane F-16 calculation ................................................................................................... 17 Example of a CSG Tree ......................................................................................................................... 20 Different Analysis Require Different Geometric Representations .................................... 21 Small Feature (Left) vs Removed (Right) .................................................................................... 22 Classification of Grid Generation Algorithms (Courtesy of Steven Owen) .................... 24 Schwarz concept of iterating between domains ....................................................................... 26 Domain Decomposition for M6 wing using TIL scripts (Courtesy of GridPro) ............ 26 Example of Unstructured Tetrahedral Grids.............................................................................. 27 Examples of Structured grids for Turbine Blade ...................................................................... 27 Sponge Analogy ...................................................................................................................................... 28 Multi Block representation for C-H mesh around a wing ..................................................... 29 Topology and Grid on a Multi-Block Wings using GridPro® ................................................ 29 Multi-block gridding over Turbine blade - (Courtesy of GridPro) .................................... 30 Dual Block Grid Topology for a Generic Wing-Fuselage Configuration ....................... 31
9
Figure 3.11 Grid for dual-block generic airplane geometry ...................................................................... 32 Figure 3.12 Typical Elliptic Grid for an Airfoil with Orthogonality Enforced on the Boundary . 33 Figure 3.13 Orthogonality Adjustments – (Courtesy of Chaitanya Varier) ......................................... 34 Figure 3.14 Euler Solution on a HSCT Wing-Fuselage ................................................................................. 36 Figure 3.15 Folded Grid by Transfinite Interpolation - Smooth Grid by Winslow Functional.... 37 Figure 3.16 1D Weight Function for High Gradient and Curvature........................................................ 38 Figure 3.17 Mesh and Mach Contours for Transonic Flow ........................................................................ 39 Figure 3.18 Grid Adaption and Mack Contours for Supersonic Airfoil ................................................. 40 Figure 4.1 Closing stage of a Moving Front Method ...................................................................................... 42 Figure 4.2 Mesh parameters ................................................................................................................................... 43 Figure 4.3 Surface Mesh of SGI Logo ................................................................................................................... 44 Figure 4.4 States of a front edge – (Courtesy of Owen et al.) .................................................................... 45 Figure 4.5 Steps demonstrating process of generating a quadrilateral from Front NA-NB (Courtesy of Owen et al.) .............................................................................................................................................. 46 Figure 4.6 Progression of Q-Morph- (Courtesy of Owen et al.) ................................................................ 47 Figure 4.7 Comparison of Q-Morph with Lee’s Algorithm Illustrating Element Boundary.......... 48 Figure 4.8 Results of Q-Morph Compared with Lee’s (1994) Advancing Front Indirect............... 48 Figure 4.9 Large Transition Mesh for CFD Application - (Courtesy of Owen et al.) ........................ 49 Figure 4.10 Success and failure of the in sphere test of abcd with e. .................................................... 51 Figure 4.11 Relationship Between Delaunay Triangles and the Voronoi Diagram ......................... 52 Figure 4.12 Two-Three Tetrahedral swap ........................................................................................................ 52 Figure 4.13 Robust and Fast way to Detect if point D lies in the Circumcircle of A, B, C ............... 53 Figure 4.14 Delaunay Triangulation (white) and Voronoi Diagram (blue) – Courtesy of [Labbe]) ............................................................................................................................................................................... 53 Figure 4.15 2D Delaunay triangulation of a set of vertices (black) restricted to a curve (blue) 56 Figure 4.16 Representation of a 3D Metric with Eigenvalues λ1, λ2 and λ3 as an Ellipsoid – (Courtesy of [Labbe]) ..................................................................................................................................................... 60 Figure 4.17 An anisotropic uniform Delaunay triangulation (orange) and the corresponding stretched ............................................................................................................................................................................. 62 Figure 4.18 Two stars Sp and Sq forming an inconsistent configuration - (Courtesy of [Labbe]) ................................................................................................................................................................................................. 63 Figure 4.19 Influence of the Parameter ψ0 in a 2D (shown on the left) and 3D Domain (shown on the right) - (Courtesy of [Labbe]) ....................................................................................................................... 64 Figure 4.20 A square of side 10 and centered on the origin, endowed with the “Starred” metric field ........................................................................................................................................................................................ 67 Figure 4.21 Anisotropic Triangulation of a Rectangle Endowed with the Hyperbolic Shock Metric Field - (Courtesy of [Labbe]) ........................................................................................................................ 67 Figure 4.22 A square of side 6 and centered on the origin, endowed with the “Swirl” metric field - (Courtesy of Labbé et al.) .............................................................................................................................. 68 Figure 4.23 The optimized SRDT of 4000 seeds in a planar domain endowed with a hyperbolic shock induced metric field (left). On the right, a zoom on a rotational region of the metric field shows the difference between pre- (above) and post- (bottom) optimization – (Courtesy of Labbé et al.) ....................................................................................................................................................................... 69 Figure 4.24 Isotropic and Anisotropic Canvas Sampling - (Courtesy of [Labbe]) ............................ 70 Figure 4.25 Unit Sphere Endowed with the Hyperbolic Metric field - (Courtesy of [Labbe]) ..... 71 Figure 4.26 On the left, the discrete Riemannian Voronoi diagram of 1020 seeds on the “Chair” surface, with a curvature induced metric field; the edges of the curved Riemannian Delaunay triangulation are traced in black - (Courtesy of [Labbe]) ............................................................................... 71
10
Figure 4.27 Discrete Riemannian Voronoi Diagram (top) and Curved Riemannian Delaunay Triangulation (bottom) endowed with the Hyperbolic Shock Metric Field - (Courtesy of [Labbe]) ................................................................................................................................................................................................. 72 Figure 4.28 Converging of an Octree Decomposition Around an Airfoil .............................................. 73 Figure 4.29 A close-up view of nasty cheese a well-known test-case featuring 30◦ dihedral angles – (Courtesy’s of [Mar´echal]) ........................................................................................................................ 74 Figure 4.30 Hierarchy of Meshing Methodologies......................................................................................... 75 Figure 4.31 Quadrilateral Mesh Generation..................................................................................................... 77 Figure 4.32 Overset Mesh Combination............................................................................................................. 78 Figure 4.33 Two Counter-Rotating Objects Embedded in Two Overset Regions with Background Mesh – (Courtesy of Siemens) .......................................................................................................... 78 Figure 4.34 Example of Cartesian Grid Near Curved Surface – (Courtesy of NASA Ames) .......... 79 Figure 4.35 Solid Surface Over-Layer Cartesian Cell and Resulting Cut and Split Cell – (Courtesy of NASA Ames) .................................................................................................................................................................. 79 Figure 4.36 Example of Merge Cell Creation – (Courtesy of NASA Ames) ........................................... 80 Figure 4.37 Example Adaptive Grid for Supersonic Wedge Flow – (Courtesy of NASA Ames) .. 81 Figure 4.38 Schematic image of Adaptive Mesh Refinement – (Courtesy of Hiroshi Abe) ........... 82 Figure 4.39 Pressure Contours in 2D Backward Step .................................................................................. 82 Figure 4.40 Flow Around a F16XL Fighter Jet using Cut Cells and AMR – (Courtesy of M. J. Aftosmis, M. J. Berger, J. E. Melton) .......................................................................................................................... 83 Figure 4.41 Example Chimera Grid Near Curved Surface (Courtesy of NASA Ames) .................... 85 Figure 4.42 Example Hybrid Grid Near Curved Surface – (Courtesy of NASA Ames)..................... 87 Figure 4.43 Basic Superposition Example – (Courtesy of Kalinin, Mazo and Isaev) ....................... 88 Figure 4.44 Example of Cartesian Grid on a Generic Airplane – (Source: Richard Smith 1996) 89 Figure 4.45 Meshing Types in SAMM .................................................................................................................. 90 Figure 4.46 Typical Polyhedral Cell and their Decomposition ................................................................. 91 Figure 4.47 Polyhedral meshing using Delaunay triangulation............................................................... 91 Figure 4.48 Dual surface Triangulation resulting in Polyhedron ............................................................ 93 Figure 4.49 Boundary Layer Prisms Generated on a Cascade of a 2D Triangulation and Dual Polyhedron ......................................................................................................................................................................... 94 Figure 4.50 Concept of cascading for boundary layer in 3D...................................................................... 95 Figure 4.51 Dual Mesh for Mixed Triangular-Quadrilateral Unstructured Mesh ................................... 96 Figure 4.52 Conventional configuration geometry (a), final structural mesh (Courtesy of Hwang & Martins) ........................................................................................................................................................... 98 Figure 4.53 The Six Steps of the Unstructured Quad Meshing Algorithm ........................................... 99 Figure 5.1 Hybrid Grid and Steady State Solution ...................................................................................... 102 Figure 5.2 Comparison of different mesh types for RANS Computations......................................... 103 Figure 5.3 Constructions of Hybrid mesh ...................................................................................................... 104 Figure 5.4 Predominantly polyhedral meshing ........................................................................................... 104 Figure 5.5 Combined Volume and Extrusion Layer Meshes ................................................................... 105 Figure 5.6 Meshing tools in CD-adapco ........................................................................................................... 105 Figure 5.7 Meshes Generated by a) Proposed Algorithm and b) Leading Commercial Vendor .............................................................................................................................................................................................. 106 Figure 5.8 Computational Domain of the HL-CRM Gapped Flaps Model .......................................... 108 Figure 5.9 Computational Domain and Separation of Zones of the JSM Model with Engine Nacelle ............................................................................................................................................................................... 109 Figure 5.10 JSM Model with Engine Nacelle.................................................................................................. 109 Figure 5.11 Three Locations of Problematic Areas of the JSM Geometry for the Generation of Boundary Layers ........................................................................................................................................................... 110 Figure 5.12 Batch Mesh setup for the JSM Model with Size Boxes for Local Mesh Control....... 111
11
Figure 5.13 Resulting Layers for Isotropic Surface Mesh (Top) and Anisotropic (Bottom) ..... 112 Figure 5.14 Close ups of Coarse CRM Gapped Flap Model with Comparison of Tridiagonal Dominant (Top) vs. Quad Dominant (Bottom) Surface Mesh .................................................................... 113 Figure 5.15 Volume Mesh of the JSM................................................................................................................ 115 Figure 5.16 Lift and Drag Coefficients for CRM Geometry at 8 degree AoA using OpenFOAM and STAR-CCM+ ............................................................................................................................................................ 116 Figure 5.17 Lift and Drag Coefficients for the JSM Geometry using OpenFOAM and STAR-CCM+ .............................................................................................................................................................................................. 117 Figure 6.1 Adaptive Mesh Refinement types ................................................................................................ 121 Figure 6.2 An H-refinement mesh about a shuttle-like body (left) and computed CP (right)... 122 Figure 6.3 Isotropic vs. Anisotropic Meshing ............................................................................................... 123 Figure 6.4 Example Adaptive Grid for Supersonic Wedge Flow ........................................................... 124 Figure 6.5 Schematic image of Adaptive Mesh Refinement .................................................................... 125 Figure 6.6 Octree Data Structure of Adaptive Cartesian Grid Method ............................................... 126 Figure 6.7 Schematic 2D view of angular variation of normal .............................................................. 126 Figure 6.8 Pressure Contours in 2D Backward Step .................................................................................. 127 Figure 6.9 Flow Around a F16XL Fighter Jet using Cut Cells and AMR – (Courtesy of M. J. Aftosmis, M. J. Berger, and J. E. Melton)............................................................................................................... 127 Figure 6.10 Selected initial meshes for the transient adaptive procedure (Meshes 3, 20, 27 and 29) ....................................................................................................................................................................................... 128 Figure 6.11 Grid Adaption using Supersonic Flow for an Airfoil (bow shock) ............................... 129 Figure 6.12 NACA 0012 test case: M∞= 0.8, α=1.25 ................................................................................... 129 Figure 6.13 Two-pass approach for parallel coarsening and refinement................................................. 130 Figure 6.14 Store position, orientation, and surface pressures at selected points in trajectory ........ 131 Figure 6.15 Adapted mesh partitioning during store dispense..................................................................... 132 Figure 6.16 Inter-Processor partitioning based on Laplace coefficients .......................................... 133 Figure 7.1 Mesh Deformation Problem ........................................................................................................... 136 Figure 7.2 Cylinder Motion in 2D....................................................................................................................... 139 Figure 7.3 Mesh Deformation via Laplace & RBF Methods ..................................................................... 140 Figure 7.4 GGI interface ......................................................................................................................................... 141 Figure 7.5 Overset Method ................................................................................................................................... 142 Figure 7.6 Delaunay Method of Dynamic mesh ........................................................................................... 143 Figure 7.7 Mesh before and after the translational deformations ....................................................... 144 Figure 7.8 Mesh Before and After the x-axis Rotational Deformation ............................................... 145 Figure 8.1 Backward facing step in a duct using Polyhedral, Hexahedral and Tetrahedral cells .............................................................................................................................................................................................. 146 Figure 8.2 Effect of truncation error on Hex and Tet cells ...................................................................... 147 Figure 8.3 Average Bees Being Smarter than CFD Engineer? (Courtesy of Stephen Ferguson) .............................................................................................................................................................................................. 147 Figure 8.4 Polyhedral cells vs Tetrahedral cells .......................................................................................... 148 Figure 8.5 Boundary prims cells for tetrahedral (left) and polyhedral (right) cells – (Courtesy of CD-Adapco) ................................................................................................................................................................ 149 Figure 8.6 GG simple face averaging ................................................................................................................ 151 Figure 8.7 GG Inverse Distance Weighted (IDW) Face Interpolation ................................................. 152 Figure 8.8 Methodologies for various Gradient Order of Accuracy..................................................... 154 Figure 8.9 Global Error Norms for x-Direction Gradient for Various Gradient Methods ........... 155 Figure 9.1 Comparison of Hex (16 K Cells) and Tet (440 K Cells) for a Pipe with 90 Degree Bend ................................................................................................................................................................................... 156 Figure 9.2 Results of Hex vs Tet Meshes as well as Hybrid Mesh in a Pipe with 90 Degree Bend .............................................................................................................................................................................................. 157
12
Figure 9.3 Design of Propellers, (left) Propeller P5168, .......................................................................... 159 Figure 9.4 Computational Domain– (Courtesy of Morgut & Nobile) .................................................. 159 Figure 9.5 Meshing for Propeller P5168– (Courtesy of Morgut & Nobile)....................................... 161 Figure 9.6 KT , KQ and η Curves of Propeller A – (Courtesy of Morgut & Nobile) ........................... 162 Figure 9.7 KT and KQ curves of Propeller P5168 – (Courtesy of Morgut & Nobile)....................... 163 Figure 9.8 Flow Around Turbine Blade – (Courtsy of Sasaki et al.) .................................................... 165 Figure 9.9 Isometric View of the Physiologically Realistic Bifurcation (PRB) Surface Models for (a) Planar and (b) out-of-Plane Configurations – (Courtesy of Heistracher & Hofmann).............. 167 Figure 9.10 Geometric Blocking Used (a) Structured Hexahedral (178 Blocks) and (b) Unstructured Hexahedral (80 Blocks) – (Courtesy of Samir Vinchurkar & Worth Longest)........ 168 Figure 9.11 Four Meshing Styles of the PRB Model (a) Structured Hexahedral, (b) Unstructured Hexahedral, (c) Prismatic, and (d) Hybrid – (Courtesy of Samir Vinchurkar & Worth Longest) 169 Figure 9.12 Velocity Vectors (a) Structured Hexahedral Mesh with 214 K C.V. (b) Unstructured Hexahedral Mesh with 318 K, C. V. (c) Prismatic Mesh with 510K C. V, (d) Hybrid Mesh with 608 K C. V. – (Courtesy of Samir Vinchurkar & Worth Longest) ........................................................................ 175 Figure 9.13 Deposition Locations for 10 lm Particles in the Planar Geometry for the (a) Structured Hexahedral Mesh, (b) Unstructured Hexahedral Mesh, (c) Prismatic Mesh, and (d) Hybrid Mesh – (Courtesy of Samir Vinchurkar & Worth Longest) .......................................................... 177 Figure 9.14 Boundary Layer Transition Between Prismatic and Volume Elements – (Courtesy of Rousseau et al.)......................................................................................................................................................... 181 Figure 9.15 Example of a hydraulic turbine spiral case (half domain) .............................................. 181 Figure 9.16 Geometry of the Stay Vanes and Wicket Gates, Left: Geometry A, Right: Geometry B – (Courtesy of Rousseau et al.) ................................................................................................................................ 182 Figure 9.17 Structured Hexahedral Mesh of the Geometry A on the Symmetrical Surface and Close Up – (Courtesy of Rousseau et al.) ............................................................................................................. 183 Figure 9.18 Hybrid Tetrahedral Medium Mesh on the Symmetric Surface of the Geometry A (left) & Mesh in the wake of a Hydraulic Profile (wicket gates trailing edge)(right) – (Courtesy of Rousseau et al.).............................................................................................................................................................. 184 Figure 9.19 Relative Total Head Loss on the Meridian Plane for the Geometry A with fine mesh, left: Structured Hexahedral, right: Hybrid Tetrahedral – (Courtesy of Rousseau et al.) ................ 185 Figure 9.20 Meridian Velocity Near a Stay Vane with fine mesh for Geometry A, left: Structured Hexahedral, right: Hybrid Tetrahedral – (Courtesy of Rousseau et al.) ................................................ 186 Figure 9.21 Meridian Velocity on the Meridian Plane for the Geometry B – (Courtesy of Rousseau et al.).............................................................................................................................................................. 187 Figure 10.1 B-Spline Approximation of NACA0012 (left) and RAE2822 (right) Airfoils ........... 191 Figure 10.2 Six Control Point Representation of a Generic Airfoil ...................................................... 191 Figure 10.3 Free Form Deformation (FFD) for Volume Grid with Control Points (Courtesy of Kenway et al.) ................................................................................................................................................................. 192 Figure 10.4 Sample Grid and Grid Sensitivity............................................................................................... 193 Figure 10.5 Effects of Mesh Density on Solution Domain ........................................................................ 196 Figure 10.6 Mesh Independence ........................................................................................................................ 197 Figure 11.1 Predicted Mesh Quality (Volume, Aspect Ratio, and Stretch) ....................................... 199 Figure 11.2 A simple Demonstration of How a Poor Mesh from a Cell Geometry Perspective 201 Figure 11.3 Using Kestrel one can Show a Correlation Between Mesh and Solution Quality .. 202 Figure 11.4 Concept of Orthogonality in Cells .............................................................................................. 204 Figure 11.5 Skewness and Warpage................................................................................................................. 204 Figure 11.6 Tetrahedral Volume ........................................................................................................................ 204 Figure 11.7 Triangulation of a polygon ........................................................................................................... 205 Figure 11.8 Tetrahedralization of a polyhedral (showing a single face) .......................................... 206 Figure 11.9 General estimation of surface mesh element size .............................................................. 208
13
Figure 12.1
Symmetry plane (XY) ..................................................................................................................... 212
Contributors ➢ Roy Koomullil, Bharat Soni, Rajkeshar Singh ,”A comprehensive generalized mesh system for CFD applications”, Mathematics and Computers in Simulation 78 (2008). ➢ Narayan, K. Lalit. Computer Aided Design and Manufacturing. New Delhi, 2008. ➢ Duggal, Vijay. Cadd Primer: A General Guide to Computer Aided Design and Drafting-Cadd, Mailmax Pub. ISBN 978-0962916595, 2000. ➢ Christophe Geuzaine, Emilie Marchandise , and Jean-Francois Remacle, “An introduction to Geometrical Modelling and Mesh Generation”, The Gmsh Companion. ➢ Butlin, G., Stops C., “CAD Data Repair”, Proc. 5th Int. Meshing Roundtable, pp. 7-12, 1996. ➢ Mezentsev, A.A. and Woehler, T., “Methods and algorithms of automated CAD repair for incremental surface meshing”, Proc. 8th Int. Meshing Roundtable, Sandia report SAND 992288, pp. 299-309, 1999. ➢ Ribo, R., Bugeda, G. and Onate, E., “Some algorithms to correct a geometry in order to create a finite element mesh”, Computers and Structures, 80:1399-1408, 2002. ➢ Richardson LF. Weather prediction by numerical process. Cambridge: Cambridge University Press; 1921. ➢ Edelsbrunner H. “Geometry and topology for mesh generation”, Cambridge: Cambridge university, 2001. ➢ Baker, T., “Mesh generation: Art or science?” MAE Department, Princeton University, Princeton, NJ. ➢ Steven J. Owen, “A Survey of Unstructured Mesh Generation Technology”, Carnegie Mellon University, PA. ➢ Steven Owen: Introduction to unstructured mesh generation, 2005. 1 Baker, T.,J., “Mesh generation: Art or science?”, MAE Department, Princeton University, Princeton, NJ. ➢ Bauer F, Garabedian P, Korn D. Supercritical wing sections I, Lecture Notes in Economics and Mathematical Systems, vol. 66. Berlin: Springer; 1972. ➢ Moretti G.”Grid generation using classical techniques”. Proceedings of the NASA Langley workshop on numerical grid generation techniques, Langley, VA, October, 1980. ➢ Caughey DA, “A systematic procedure for generating useful conformal mappings”, Int J Num Meth Eng 1978. ➢ Eriksson LE,”Generation of boundary-conforming grids around wing-body configurations using transfinite interpolation”, AIAA J 1982; 20:1313–20. ➢ An overview of Grid Pro/az3000 for automated grid generation. ➢ Churchill, R., V., “Introduction to Complex Variables”, McGraw-Hill, New York. ➢ Joe F. Thompson, Z. U. A. Warsi, C. Wayne Mastin, “Numerical Grid Generation -Foundations and Applications”, North Holland, 1985. ➢ Peter Eiseman and Robert E. Smith, “Applications of Algebraic Grid Generation”, April 1990. ➢ Sadrehaghighi, I., Smith, R.E., Tiwari, S., N., “Grid Sensitivity and Aerodynamic Optimization Of Generic Airfoils”, Journal of Aircraft, Volume 32, No. 6, Pages 1234-1239. ➢ M. Farrashkhalvat and J.P. Miles, “Basic Structured Grid Generation”, An imprint of Elsevier Science Linacre House, Jordan Hill, Oxford OX2 8DP, 200 Wheeler Rd, Burlington MA 01803, First published 2003.
14
➢ Feng Liu, Shanhong Ji, and Guojun Liao,” An Adaptive Grid Method and Its Application to Steady Euler Flow Calculations”, Siam J. Sci. Comput. C° 1998 Society For Industrial And Applied Mathematics Vol. 20, No. 3, Pp. 811{825. ➢ Mael Rouxel-Labbe, “Anisotropic mesh generation”, Université Côte d’Azur, 2016. ➢ Vangelis Skaperdas, and Neil Ashton, “Development of high-quality hybrid unstructured meshes for the GMGW-1 workshop using ANSA”, AIAA, January 2018. ➢ David A. Venditti and David L. Darmofal, “Grid Adaptation for Functional Outputs: Application to Two Dimensional Inviscid Flows", Journal of Computational Physics 176, 40– 69 (2002). ➢ Cavallo, P.A., Sinha, N., and Feldman, G.M.,” Parallel Unstructured Mesh Adaptation For Transient Moving Body And Aero propulsive Applications”, Combustion Research and Flow Technology, Inc. (CRAFT Tech), PA. ➢ Cavallo, P.A., Sinha, N., and Feldman, G.M.,”Parallel Unstructured Mesh Adaptation For Transient Moving Body And Aeropropulsive Applications”, Combustion Research and Flow Technology, Inc. (CRAFT Tech), PA 18947. ➢ Hrvoje Jasak, ˇZeljko Tukovi´c, “Automatic Mesh Motion for the Unstructured Finite Volume Method”, ISSN 1333–1124, UDK 532.5:519.6. ➢ JIA Huana, SUN Qin b, “A Comparison of Two Dynamic Mesh Methods in Fluid –Structure interaction”, School of Aeronautics, Northwestern Polytechnic University, Xi‘an china. 2nd International Conference on Electronic & Mechanical Engineering and Information Technology (EMEIT-2012). ➢ Fluent, “Meshing and CFD Accuracy”, CFD Summit, June 2005. ➢ Mitja Morgut, Enrico Nobile, “Comparison of Hexa-Structured and Hybrid-Unstructured Meshing Approaches for Numerical Prediction of the Flow Around Marine Propellers”, First International Symposium on Marine Propulsions smp’09, Trondheim, Norway, June 2009. ➢ Daisuke Sasaki, Caleb Dhanasekaran, Bill Dawes, Shahrokh Shahpar, “Efficient Unstructured Hybrid Meshing and its Quality Improvement for Design Optimization of Turbomachinery”, European Conference on Computational Fluid Dynamics, ECCOMAS CFD 2006. ➢ Samir Vinchurkar, P. Worth Longest, “Evaluation of hexahedral, prismatic and hybrid mesh styles for simulating respiratory aerosol dynamics”, Computers & Fluids, 2008. ➢ Sadrehaghighi, I., Smith, R.E., Tiwari, S., N., “Grid Sensitivity and Aerodynamic Optimization Of Generic Airfoils”, Journal of Aircraft, Volume 32, No. 6, Pages 1234-1239. ➢ Philippe Martineau Rousseau, Azzeddine Soulaïmani and Michel Sabourin, “Comparison between structured hexahedral and hybrid tetrahedral meshes generated by commercial software for CFD hydraulic turbine analysis”, Conferece Paper, May 2013.
15
1 Introduction A pre-processing step for the computational field simulation is the discretization of the domain of interest and is called mesh generation. The process of mesh generation can be broadly classified into two categories based on the topology of the elements that fill the domain. These two basic categories are known as structured and unstructured meshes. The different types of meshes have their advantages and disadvantages in terms of both solution accuracy and the complexity of the mesh generation process. A structured mesh is defined as a set of hexahedral elements with an implicit connectivity of the points in the mesh. The structured mesh generation for complex geometries is a time-consuming task due to the possible need of breaking the domain manually into several blocks depending on the nature of the geometry. An unstructured mesh is defined as a set of elements, commonly tetrahedrons, with an explicitly defined connectivity. The unstructured mesh generation process involves two basic steps: point creation and definition of connectivity between these points. Flexibility and automation make the unstructured mesh a favorable choice although solution accuracy may be relatively unfavorable compared to the structured mesh due to the presence of skewed elements in sensitive regions like boundary layers. In an attempt to combine the advantages of both structured and unstructured meshes, another approach in practice is hybrid mesh generation. In a hybrid mesh, the viscous region is filled with prismatic or hexahedral cells while the rest of the domain is filled with tetrahedral cells. It has been observed that a hybrid mesh in viscous regions creates a lesser number of elements than a completely unstructured mesh with a similar resolution. This type of mesh has no restrictions on the number of edges or faces on a cell, which makes it extremely flexible for topological adaptation. It is given that unstructured mesh has an advantage over the structured mesh in handling complex geometries, mesh adaptation using local refinement and de-refinements, moving mesh capability by locally repairing the bad quality elements, and load balancing using appropriate graph partitioning algorithms. In the case of a non-matched block-to-block boundary, interpolation issues have to be handled properly to satisfy the conservation principles. However, the structured mesh has a better accuracy for viscous calculations due to the fact that it can handle cells with very high aspect ratio cells in the boundary layer1. Precipitate of most grid generation procedure can be summarized as Figure 1.1 provided that everything goes according to plan.
CAD Data
Surface Grid
Figure 1.1
Volume Grid
Optimization of Grid
CFD
Methodology of General Grid Generation
Roy Koomullil, Bharat Soni, Rajkeshar Singh ,”A comprehensive generalized mesh system for CFD applications”, Mathematics and Computers in Simulation 78 (2008) 605–617. 1
16
2 Computer-Aided Design (CAD) Computer-Aided Design (CAD) is the use of computer systems (or workstations) to aid in the creation, modification, analysis, or optimization of a design2. CAD software is used to increase the productivity of the designer, improve the quality of design, improve communications through documentation, and to create a database for manufacturing. CAD output is often in the form of electronic files for print, machining, or other manufacturing operations. The term CADD (for Computer Aided Design and Drafting) is also used3. CAD may be used to design curves and figures in two-dimensional (2D) space; or curves, surfaces, and solids in three-dimensional (3D) space. CAD is an important industrial art extensively used in many applications, including automotive, shipbuilding, and aerospace industries, industrial and architectural design, prosthetics, and many more. CAD is also widely used to produce computer animation for special effects in movies, advertising and technical manuals, often called DCC digital content creation. The modern ubiquity and power of computers means that even perfume bottles and shampoo dispensers are designed using techniques unheard of by engineers of the 1960s. Because of its enormous economic importance, CAD has been a major driving force for research in computational geometry, computer graphics (both hardware and software), and discrete differential geometry4. CAD is an important industrial art extensively used in many applications, including automotive, shipbuilding, and aerospace industries, industrial and architectural design, prosthetics, and many more. CAD is also widely used to produce computer animation for special effects in movies, advertising and technical manuals, often called DCC digital content creation. The modern ubiquity and power of computers means that even perfume bottles and shampoo dispensers are designed using techniques unheard of by engineers of the 1960s. Because of its enormous economic importance, CAD has been a major driving force for research in computational geometry, computer graphics (both hardware and software), and discrete differential geometry5.
Software and Technology Originally software for Computer-Aided Design systems was developed with computer languages such as Fortran, ALGOL but with the advancement of object-oriented programming methods this has radically changed. Typical modern parametric feature based modeler and freeform surface systems are built around a number of key C modules with their own APIs. A CAD system can be seen as built up from the interaction of a graphical user interface (GUI) with NURBS geometry or boundary representation (B-rep) data via a geometric modeling kernel. A geometry constraint engine may also be employed to manage the associative relationships between geometry, such as wireframe geometry in a sketch or components in an assembly. Unexpected capabilities of these associative relationships have led to a new form of prototyping called digital prototyping. In contrast to physical prototypes, which entail manufacturing time in the design. That said, CAD models can be generated by a computer after the physical prototype has been scanned using an industrial CT scanning machine. Depending on the nature of the business, digital or physical prototypes can be initially chosen according to specific needs. Today, CAD systems exist for all the major platforms (Windows, Linux, UNIX and Mac OS X); some packages support multiple platforms. CAD software enables engineers and architects to design, inspect and manage engineering projects within an integrated graphical user interface (GUI) on a Narayan, K. Lalit (2008). Computer Aided Design and Manufacturing. New Delhi: Prentice Hall of India. p. 3. Duggal, Vijay (2000). Cadd Primer: A General Guide to Computer Aided Design and Drafting-Cadd, Mailmax Pub. ISBN 978-0962916595. 4 Wikipedia. 5 Same Source. 2 3
17
personal computer system. Most applications support solid modeling with boundary representation (B-Rep) and NURBS geometry, and enable the same to be published in a variety of formats. A geometric modeling kernel is a software component that provides solid modeling and surface modeling features to CAD management applications. Based on market statistics, commercial software from Autodesk, Dassault Systems, Siemens PLM Software and PTC dominate the CAD industry. Presently, most of commercially available CAD systems, such as SolidWorks, Autodesk or Siemens NX, calming to be able to do faster design loops, are also including a CFD analysis tool (some with limited capabilities), and Grid Generation kernel, in their product. (see Figure 2.1). For example, using SolidWorks, to solve the symmetric algebraic problem for pressure-correction, an original double preconditioned iterative procedure is used6. It is based on a specially-developed multigrid method from [Hackbusch (1985)]. This is an external flow around a F-16 fighter (Mach Number equals 0.6 and 0.85). The geometry is a native CAD model of the airplane with external tanks and armaments. Flow into the intake and exhaust from the engine’s nozzle are both taking into account. Calculations were performed with relatively coarse grid of approximately 200,000 cells. (see Figure 2.2) Calculation results are compared with the test data from [Nguyen, Luat T. et al.]. Commercially Available CAD Systems: The following is a list of major CAD applications. ➢ Alibre Design ➢ Autodesk AutoCAD ➢ Autodesk Inventor 6
CAD Management
Grid Generation
CFD
Figure 2.1
Anatomy of commercial CAD Systems
Figure 2.2
Fighter Airplane F-16 calculation
➢ Bentley Systems Micro Station ➢ Bricsys BricsCAD ➢ Dassault Systemes CATIA
Solidworks, “Numerical Basis of CAD-Embedded CFD”, White Paper.
18
➢ ➢ ➢ ➢ ➢ ➢ ➢ ➢ ➢ ➢ ➢
Dassault Systemes SolidWorks Kubotek KeyCreator Siemens NX Siemens Solid Edge PTC PTC Creo (formerly known as Pro/ENGINEER) Trimble SketchUp AgiliCity Modelur TurboCAD IRONCAD MEDUSA ProgeCAD
➢ ➢ ➢ ➢ ➢ ➢ ➢ ➢ ➢ ➢ ➢ ➢
SpaceClaim PunchCAD Rhinoceros 3D VariCAD Vectorworks Cobalt Gravotech Type3 RoutCad SketchUp Onshape ActCAD Remo 3D
Freeware and Open Source ➢ ➢ ➢ ➢ ➢ ➢ ➢
123D LibreCAD FreeCAD BRL-CAD OpenSCAD QCad SolveSpace
Solid (Geometry) Modeling
A solid model is a computer model of a 3D solid. It is a virtual representation of the shape of a solid7. Solid models can be simple parts, or complex assemblies of multiple parts. We aim here at explaining how such solids can be described on a computer. We will principally focus on the ability of such solid models to serve as input to numerical simulations. Principal Characteristics of a Solid Modeling Software A solid modeling software may have some specific characteristics that enables to enhance both its efficiency and the productivity of the solid modeling process: Feature-Based Modeling Features are defined to be parametric shapes associated with attributes such as intrinsic geometric parameters (length, width, depth etc.), position and orientation, geometric tolerances, material properties, and references to other features. Feature-based modelers allow operations such as creating holes, fillets, chamfers, bosses, and pockets to be associated with specific edges and faces. When the edges or faces move because of a regeneration, the feature operation moves along with it, keeping the original relationships. Constraint-Based Modeling There are two types of constraints. Dimensional constraints are used to specify distances between items. Geometric constraints define positional relationships between entities in the model in terms of the geometry. Examples of geometric constraints include tangency, parallelism, symmetry, concentricity. Constraint-based modeling allows the engineer or designer to incorporate intelligence Christophe Geuzaine, Emilie Marchandise , and Jean-Francois Remacle, “An introduction to Geometrical Modelling and Mesh Generation”, The Gmsh Companion. 7
19
into the design. The initial sketch of a two-dimensional profile in constraint-based solid modeling does not need to be created with a great deal of accuracy. It just needs to represent the basic geometry of the cross section. The exact size and shape of the profile is defined through assigning enough parameters to fully constrain it. Parametric Modeling Parametric modeling means that parameters of the model may be modified to change the geometry of the model. A dimension is a simple example of a parameter. When a dimension is changed, the geometry of the part is updated. Thus, the parameter drives the geometry. An additional feature of parametric modeling is that parameters can reference other parameters through relations or equations. The power of this approach is that when one dimension is modified, all linked dimensions are updated according to specified mathematical relations, instead of having to update all related dimensions individually. History-Based Modeling The last aspect of solid modeling is that the order in which parts are created is critical. This is known as history-based modeling. For example, a hole cannot be created before a solid volume of material in which the hole occurs has been modeled. If the solid volume is deleted, then the hole is deleted with it. This is known as a parent-child relation. The child (hole) cannot exist without the parent (solid volume) existing first. Parent-child relations are critical to maintaining design intent in a part. Most solid modeling software recognizes that if you delete a feature with a hole in it, you do not want the hole to remain floating around without being attached to the feature. Consequently, careful thought and planning of the base feature and initial additional features can have a significant effect on the ease of adding subsequent features and making modifications. Associative Modeling The associative character of solid modeling software causes modifications in one object to \ripple though" all associated objects. For instance, suppose that you change the diameter of a hole on the engineering drawing that was created based on your original solid model. The diameter of the hole will be automatically changed in the solid model of the part, too. In addition, the diameter of the hole will be updated on any assembly that includes that part. Similarly, changing the dimension in the part model will automatically result in updated values of that dimension in the drawing or assembly incorporating the part. This aspect of solid model software makes the modification of parts much easier and less prone to error. As a result of being feature based, constraint based, parametric, history based, and associative, modern solid modeling software captures \design intent", not just the design. This comes about because the solid modeling software incorporates engineering knowledge into the solid model with features, constraints, and relationships that preserve the intended geometric relationships in the model.
Constructive Solid Geometry (CSG) Representation of Solids We discuss here briefly the Constructive Solid Geometry (CSG) representation of solids. CSG allow to construct complex solid through primitives, Boolean operators and rigid motions. Basic Primitives The standard CSG basic primitives are the sphere, the torus, the parallelepiped (block), the cylinder and the cone. All those primitives defined bounded closed orientable domains. All basic primitives are defined in the world system of coordinates. Rigid motions (rotations, translations) and scaling can be applied to re-position the primitives.
20
Regularized Boolean Operators Each primitive divides the 3D space into two parts: the one that is inside the primitive and the one that is outside. The closure of a primitive is the surface that separates its interior with its exterior. It is easy to think a primitive as a set where standard Boolean operations like union, intersection and difference can be defined. Basic primitives can be combined using Boolean operations. Three Boolean operators are defined. Consider two primitives A and B. ➢ The Union A ⋃ B operation returns of all the points x ∈ R3 that are either inside Figure 2.3 Example of a CSG Tree A or inside B. ➢ The Intersection A ⋂ B operation returns of all the points x ∈ R3 that are both inside A and inside B. ➢ The Difference A n B operation returns of all the points x ∈ R3 that are inside A and outside B. Regularized Boolean operators differ from the set-theoretic ones in that dangling lower dimensional structures are eliminated, all remaining faces, edges and vertices belonging to the closure of the resulting volume.
The CSG Tree A CSG object can be easily represented in a tree structure where the leaves of the tree are simple primitives, nodes of the tree are solids, edges of the tree are Boolean operations and where the root of the tree is a solid that is the final CSG object. Figure 2.3 shows an example of a simple CSG tree. Most of the current commercial solid modelers enable to use CSG trees. Designing robust algorithms for computing both the geometry and the topology of surface intersections is a complex problem. A few number of software enable to perform CSG computations efficiently and, to our best knowledge, only one is open source. In Gmsh, we have interfaced Open cascade primitives and operators to build the solid of Figure 2.3.
Geometry Related Issues For Mesh Generation One of the major issues of mesh generation is access to CAD geometry in an accurate and efficient manner, as addresses by [Beall et al.]8. Here, we will provide an overview the process of accessing 8
Mark W. Beall1, Joe Walsh2, Mark S. Shephard, “Accessing CAD Geometry For Mesh Generation”.
21
CAD geometry for mesh generation and will review several of the issues associated with accessing CAD geometry for mesh generation. The techniques for CAD geometry access to be reviewed include: Translation & Healing, Discrete Representations, Direct Geometry Access, and Unified Topology Accessing Geometry Directly. The intent of this paper is to provide an overview to the alternative approaches and how they address the specific issues related to accessing CAD geometry for mesh generation. It is not the intent of this paper to provide detailed algorithms related to accessing or repairing CAD data. There are several issues associated with effective and efficient access of CAD geometry for mesh generation. This section will provide a quick overview of several of the major issues and the ramifications that this issues have on mesh generation Understanding the Analysis Requirements The first major issue with CAD geometry access for mesh generation is the need to understand the analysis requirements. The appropriate mesh and geometry to be used for meshing is a function of the analysis to be performed and the desired accuracy. There does not exist an optimal mesh independent of the analysis to be performed. A-prior element shape quality test have often been used as a misleading indicator of a good mesh independent of the analysis to be performed or the accuracy desired. The appropriate mesh is one that produces the desired accuracy for the problem to be solved. In practice this is only achievable through adaptively. Different types of analyses require different instances of the geometry to capture the physics. For example, we can perform a dynamic structural response analysis and a Computational Fluid Dynamics (CFD) analysis on the same part. The dynamic structural response analysis requires the solid geometry of the part while the CFD analysis requires the geometry of the cavities through which the fluid will flow. This simple illustration of different use of geometry representations is illustrated in Figure 2.4. Dynamic structural response analysis requires solid geometry of the part. While CFD analysis requires geometry of the flow cavities. Different types of analysis also require different resolutions of mesh to achieve the desired accuracy on a particular design.
Figure 2.4
Different Analysis Require Different Geometric Representations
Disfeaturing Disfeaturing is one of the most complex issues associated with CAD geometry access for mesh generation. Indeed one of the major issues that the CAD and CAE software industries have encountered is developing a consistent definition of a feature. For the purposes of this paper we will
22
classify features into two main groups. The first group of features will be called “intended features”. Intended features are features that were explicitly defined as features in the model that drive the resulting geometry. In this case a feature-based modeling system was used to create a model which contains intended features. Intended features can only be created by feature-based modeling systems and can be suppressed by the original modeling system. The second group of features will be called “artifact features”. Artifact features are features that are created indirectly by the modeling process. One example of artifact features is the creation of engineering features such as holes by a modeling system that is not feature-based. The second example of artifact features is the creation of recognizable patterns of geometry / topology data that create a valid design model but also create difficulties associated with mesh generation. Artifact features can be created from any modeling system and cannot be suppressed in the original modeling system. Figure 2.5 illustrates small features removed from geometry. Part of the complexity associated with CAD geometry access for mesh generation is due to the fact that historically analyses are performed too late in the design process and the design model contains more details than are appropriate for analysis. Moving the analysis earlier in the design process will help to reduce, but will not remove, the need for defeating. Since multiple analysis types may be required for any design state there remains a need for defeating to various levels to support the range of analysis to be performed.
Figure 2.5
Small Feature (Left) vs Removed (Right)
“Dirty” Geometry Dirty geometry has been one of the most nagging issues related to geometry access. Dirty geometry consists of gaps, overlaps and other incompatibilities in the model preventing the model from being valid. These incompatibilities do not exist in the native CAD system and are introduced from translating the native CAD geometry to another format. Differences in representations, methods and tolerances between modeling engines create dirty geometry. Translators must then heal or repair
23
the geometry to represent it as a valid model in the non-native system9-10-11. Note that without knowledge of the modeling system tolerances and methods, there is no a priori means to ensure a healing process will successfully recover the correct model representation.
Butlin, G., Stops C., “CAD Data Repair”, Proc. 5th Int. Meshing Roundtable, pp. 7-12, 1996. Mezentsev, A.A. and Woehler, T., “Methods and algorithms of automated CAD repair for incremental surface meshing”, Proc. 8th Int. Meshing Roundtable, Sandia report SAND 99-2288, pp. 299-309, 1999. 11 Ribo, R., Bugeda, G. and Onate, E., “Some algorithms to correct a geometry in order to create a finite element mesh”, Computers and Structures, 80:1399-1408, 2002. 9
10
24
3 Structured Mesh Generation Mesh generation or Domain Discretization has evolved to the point where highly complicated domains can be covered by a variety of mesh types including hexahedral, tetrahedral and overset meshes. It is an important and very tedious aspect of computational geometry and accounts for almost 70% of CFD works. The concept of a mesh as a field or domain discretization of space has been associated with computational methods since the first attempts to obtain numerical solutions of partial differential equations12. Establishing a suitable mesh was long considered to be a rather tedious exercise and a minor part of the computational effort involved in solving partial differential equations by either a finite difference or finite element method. But mesh generation has steadily evolved into a discipline in its own right drawing on ideas from other fields, in particular mathematics and computer science, and gradually developing a distinct identity of its own. Two series of international conferences are now devoted entirely to mesh generation and adaptation, and almost all conferences on computational methods have sessions that feature this topic. In addition, it is important to recognize the growing interest of the computer science community in mesh related problems. In addition, it is important to recognize the growing interest of the computer science
Figure 3.1
12
Classification of Grid Generation Algorithms (Courtesy of Steven Owen)
Richardson LF. Weather prediction by numerical process. Cambridge: Cambridge University Press; 1921.
25
community in mesh related problems13. Not only has this synergy brought new ideas and ways of viewing mesh related questions, it has also opened up whole new areas of application including medical imaging and segmentation, computer graphics and animation, and data interpolation and compression.14
Classification of Mesh Generation Techniques
As discussed before, the mesh generation techniques can be divided to two major categories of structured and un-structured mesh. Strictly speaking, a structured mesh can be recognized by all interior nodes of the mesh having an equal number of adjacent elements. For our purposes, the mesh generated by a structured grid generator is typically all quad or hexahedral. Algorithms employed generally involve complex iterative smoothing techniques that attempt to align elements with boundaries or physical domains. Where non-trivial boundaries are required, block structured techniques can be employed which allow the user to break the domain up into topological blocks15. Structured grid generators are most commonly used within the CFD field, where strict alignment of elements can be required by the analysis code or necessary to capture physical phenomenon16. Unstructured mesh generation, on the other hand, relaxes the node valence requirement, allowing any number of elements to meet at a single node. Triangle and Tetrahedral meshes are most commonly thought of when referring to unstructured meshing, although quadrilateral and hexahedral meshes can also be unstructured. While there is certainly some overlap between structured and unstructured mesh generation technologies, the main feature which distinguish the two fields are the unique iterative smoothing algorithms employed by structured grid generation. The semi-complete picture of grid generation algorithm is updated by [S. Owens ] and presented here as reference17 (see Figure 3.1). In general, on the structure side, some mapping techniques such as Transfinite Interpolation (TFI), or Elliptic operator are used extensively and proven to be sufficient for majority of applications. On unstructured side, the same could be said about Advancing Front or Delaunay triangulation. The above table is too broad and extensive for our purpose. Our concentration, as red circles indicate, would be on •
Structured Grid • Complex Variables (Restricted to 2D) • Algebraic Techniques (TFI) • PDE Methods (PDE)
•
Unstructured Grid • Delany Triangulation • Advancing Front • Octree Method • Hybrid Meshes • Overset Meshes • Cartesian Meshes Adaptive Grids • Structured • Unstructured
•
Edelsbrunner H. “Geometry and topology for mesh generation”, Cambridge: Cambridge university, 2001. Baker, T., “Mesh generation: Art or science?” MAE Department, Princeton University, Princeton, NJ. 15 Steven J. Owen, “A Survey of Unstructured Mesh Generation Technology”, Carnegie Mellon University, PA. 16 Introduction: An Initial Guide to CFD and to this Volume; page 1, 2007. 17 Steven Owen: Introduction to unstructured mesh generation, 2005. 13 14
26
Domain Decomposition and Multi-Block Strategy One of the essential topics in grid generation is the topic of Domain Decomposition (DD). It is in essence a “divide and conquer” technique for arriving at the solution of problem defined over a domain from the solution of related problems posed on subdomains. The main reason is that the solution Iterate of the subdomain is qualitatively or quantitatively “easier” than Figure 3.2 Schwarz concept of iterating between domains the original one. Other factors are memory concern as well as that the subdomain can be solved with the aid of parallel programing. The issue of domain decomposition is vast and it involves a lot of math such as Schwarz concept18. He purposed that simply: ➢ Solve the PDE in the circle with boundaries taken from interior of square. ➢ Solve the PDE in the square with Boundaries taken from interior of circle. And then iterate as depicted in Figure 3.2. These days, with aid of strong work stations with visual aids, this is running on the background. The user does not know, or cared, what algorithm in running. Some of the vendors are opted for automatic DD schemes, or at least to begin with. User has options to change the topology later. But there is no free launch! There is usually a script which should be run prior to DD. An example would be GridPro® which is runes a TIL (Topology Input Language) script, written in C. The DD obtained using a TIL for an M6 wing is shown in Figure 3.3. Other venders have their own scripts or input data depending. Another example is Poitwise® which uses Glyph or newer Figure 3.3 Domain Decomposition for M6 wing using TIL Glyph2 as a scripting for the geometry. scripts (Courtesy of GridPro) There are generally two methods for generating the grid; Top to Bottom (TTB) and inversely Bottom to Top (BTT). While most of unstructured mesh engines use the TTB approaches, majority of structured ones are adapted to BTT. Some might think that multi-blocking approach is too tedious which of course is true. But the reward is in complete control of grid and its quality, something which is usually lacking in automated unstructured grid generates.
David E. Keyes, “Domain Decomposition Methods for Partial Differential Equations”, Department of Applied Physics & Applied Mathematics Columbia University. 18
27
Field (Domain) Discretization Process (Mesh Generation) Once a mathematical model is selected, we can start with the major process of a simulation, namely the domain discretization process. Since the computer recognizes only numbers, we have to translate our geometrical and mathematical models into numbers which of course called discretization. The first action is to discretize the space, including the geometries and solid bodies present in the flow field or enclosing the flow domain. This set of points, which replaces the continuity of the real space by a finite number of isolated points in space, is called a grid or a mesh. The process of grid generation is in general extremely complex and requires dedicated software tools to help in defining grids that follow the solid surfaces (this is called ‘body-fitted’ grids) and have a minimum level of regularity. We wish already here to draw your attention to the fact that, when dealing with complex geometries, the grid generation process can be very delicate and time consuming. Grid generation is a major step in setting up a CFD analysis, since, as we will see the Figure 3.4 Example of Unstructured outcome of a CFD simulation and its accuracy can Tetrahedral Grids be extremely dependent on the grid properties and quality. Please notice here that the whole object of the simulation is for the computer to provide the numerical values of all the relevant flow variables, such as velocity, pressure, temperature, etc., at the positions of the mesh points. Hence, this first step of grid generation is essential and cannot be omitted. Without a grid, there is no possibility to start a CFD simulation. Figure 3.5 shows examples of 2D and 3D structured grids, while Figure 3.4 displays an example of mainly tetrahedral unstructured grids.
Figure 3.5
Examples of Structured grids for Turbine Blade
28
Conformal Mapping (The Sponge Analogy) It is perhaps not surprising that conformal mapping was among the first and most effective techniques to carry out this task. The best way to the correspondence of a curvilinear grid in physical domain, with logically rectangle grid in computational domain, is through sponge analogy. Consider a rectangular sponge within which an equally spaced Cartesian grid has been drowned. Now wrapped the sponge around a circular cylinder and connect the two end of sponge together. Clearly the original Cartesian grid now becomes a curvilinear grid fitted the cylinder. But the rectangle logical form of grid lattice is still 19 preserved . Figure 3.6 spectacles a simply connected (as oppose to Figure 3.6 Sponge Analogy multiple connected) region which obviously results in O type grid. Since the difference formulae were applied in mapped space it was necessary to transform the partial differential equations to the coordinate system associated with the mapping. Conformal maps lead to a new set of fairly straightforward equations without messy cross-derivative terms. In addition, the orthogonality and smoothness properties of review of conformal mapping meshes obtained in this manner produce a high quality mesh in physical space. Perhaps the first published application of conformal mapping to Computational Fluid Dynamics (CFD) is circle plane mapping that transforms the space exterior to an airfoil onto the interior of the unit circle. This particular conformal mapping technique extends back a long way but its use for creating suitable meshes was a novel application. The same mapping was later used by [Bauer et al.]20 when they developed the first transonic flow code for solving the full potential equation. Other conformal mappings were developed to handle axisymmetric inlets and airfoil/slat combinations. A comprehensive techniques for mesh generation has been given by Moretti21. Another useful reference is the paper by22.
Domain Decomposition with Multi-Blocking (Multi-Sponge Analogy)
This problem was largely solved by the second significant development, the multi block strategy, or Domain Decomposition. The basic idea, first formulated is to break up the domain into several smaller blocks (essentially an ultra-coarse mesh) and then generate separate meshes in each individual block. Figure 3.7 illustrates this idea by showing a schematic of a three block decomposition for the region around a wing. In this example, one would use an H–H-mesh combination in blocks 1 and 3 and a C–H-mesh combination in block 2. A block corresponds to a sub domain that is geometrically much simpler than the full configuration and which can therefore be easily meshed either by solving a partial differential equation or, alternatively, by an algebraic Baker, T.,J., “Mesh generation: Art or science?”, MAE Department, Princeton University, Princeton, NJ. Bauer F, Garabedian P, Korn D. Supercritical wing sections I, Lecture Notes in Economics and Mathematical Systems, vol. 66. Berlin: Springer; 1972. 21 Moretti G.”Grid generation using classical techniques”. Proceedings of the NASA Langley workshop on numerical grid generation techniques, Langley, VA, October, 1980. 22 CaugheyDA, “A systematic procedure for generating useful conformal mappings”, Int J Num Meth Eng 1978.1. 19 20
29
method23. It is, in fact, common practice nowadays to create the mesh in any particular block by an algebraic method such as transfinite interpolation and then smooth the mesh by some iterations of an elliptic solver. A slightly more complicated topology of a dual Block for generic airplane configuration shown on Figure 3.10. An example showing a multi block conformal mapping for a M6 wing is illustrated in Figure 3.8 (a). Another example of multi-block structure gridding for a Turbine Blade is giving by Figure 3.9. GridPro© has developed a Topology Input Language (TIL) which can be used for similar geometries with minimal effort24. As an example, the topology and grid is putted for M6 wing, can be used for Reference H wing, and results are displayed in Figure 3.8 (b).
(a) M6 Wing
Figure 3.8
Figure 3.7
Multi Block representation for CH mesh around a wing
(b) Reference H
Topology and Grid on a Multi-Block Wings using GridPro®
Structured Grid Generation In general, decomposition of the physical domain produces several blocks. Each block is usually defined by six sides, and each side can be defined by either a surface, plane, line, or a point. If one side of a block collapses to a line or a point, then there would be a singularity in the block. In some instances, a block may have been defined by less than six surfaces. Once the surfaces are defined, the Eriksson LE,”Generation of boundary-conforming grids around wing-body configurations using transfinite interpolation”, AIAA J 1982; 20:1313–20. 24 An overview of Grid Pro/az3000 for automated grid generation. 23
30
interior grid can be computed by any standard grid generation technique. The cell information stored in a 3D array, in random fashion and could be easily access. Complex Variables Complex variables techniques have the advantage that the transformation used are analytic as opposed to those methods that are entirely numerical. Unfortunately, complex variable method are restricted to two dimension. For this reason, the technique has limited applicability and will not be covered here. For details readers should refer to Churchill25, Moretti, and Davis. Algebraic Methods -Transfinite Interpolation (TFI)
Figure 3.9 Multi-block gridding over Turbine blade - (Courtesy of GridPro)
Transfinite Interpolation has been used to generate the interior grid points from the boundary surfaces. In 2D (I, J), we may inscribe a linear Lagrange interpolation function as: N M ξ η r( , ) = n r(ξ n , η) + ψ m r( , m ) − I J n =1 m =1 N M ξ η n ψ m r(ξ n , ηm ) I J n =1 m =1
Eq. 3.1
Where now the "blending" functions, φn and ψm, are any functions which satisfy the cardinality conditions:
ξ n L = δ nL n, L = 1,2,..., N I
η and ψ m L = δ mL m, L = 1,2,...., M J
Eq. 3.2 The interpolation function defined by Eq. 3.2 can be thought of two unidirectional interpolation the corner points which has been duplicated. With N=M=2, using the Lagrange interpolation polynomials as the blending functions, is termed the transfinite bilinear interpolant. With N=M=3, this form is the transfinite bi-cubic-interpolation. Other candidates for the blending functions are the Exponential, Hermit Interpolation Polynomials and Splines. For example, for n, L = 2, Eq. 3.3 shows a typical Exponential blending function as K
1 ( ) =
e
ξ 2 −ξ ξ 2 − ξ1
−1 e −1 K
K
,
2 ( ) =
e
ξ − ξ1 ξ 2 − ξ1
−1 e −1 K
Eq. 3.3 Where K is a negative constant greater than one. The greater the K, the less discontinuity will propagate. Similarly, a blending function could be constructed for η direction. The spline-blended 25
Churchill, R., V., “Introduction to Complex Variables”, McGraw-Hill, New York.
31
form gives the smoothest grid with continuous second derivatives26. A sample coding in FORTRAN is given in Appendix A and the resultant grid and topology for a dual-block generic airplane geometry is display in Figure 3.11. A pioneering work in control point form of Algebraic Grid Generation using a univariate interpolations can be attributed to [Eiseman and Smith]27.
Figure 3.10
Dual Block Grid Topology for a Generic Wing-Fuselage Configuration
PDE Smoother Like algebraic methods, differential equation methods are also used to generate grids. Grid construction can be done using all three classes of partial differential equations. The generation of field values of a function from boundary values can be done in various ways, e.g., by interpolation between the boundaries, etc., as is discussed previously. The solution of such a boundary-value problem, however, is a classic problem of partial differential equations, so that it is logical to take the coordinates to be solutions of a system of partial differential equations. If the coordinate points (and/or slopes) are specified on the entire closed boundary of the physical region, the equations must be elliptic, while if the specification is on only a portion of the boundary the equations would be
26 Joe
F. Thompson, Z. U. A. Warsi, C. Wayne Mastin, “Numerical Grid Generation -Foundations and Applications”, North Holland, 1985. 27 Peter Eiseman and Robert E. Smith, “Applications of Algebraic Grid Generation”, April 1990.
32
parabolic or hyperbolic. This latter case would occur, for instance, when an inner boundary of a physical region is specified, but a surrounding outer boundary is arbitrary. The present chapter, however, treats the general case of a completely specified boundary, which requires an elliptic partial differential system. 3.6.3.1 Elliptic Schemes At this stage grid is smooth enough to satisfy majority of applications, but if needed, further smoothing is obtained with solution of elliptic partial differential equations (PDE). For 2D formulation, forcing function terms are used to construct stretched layers of the cells close to the domain boundaries.
ξ xx + ξ yy = P( , η)
,
Figure 3.11 Grid for dual-block generic airplane geometry
ηxx + ηyy = Q( , η)
Eq. 3.4
Where (ξ, η) are the coordinates in the computational domain. Control functions are computed using the boundary point spacing, r, and then interpolated to the inner points28. The forcing terms (P, Q) are computed as:
P=−
r 2 r ξ ξ 2 r ξ
2
, Q=
r 2 r η η2 Eq. 3.5
2
r η
Once P and Q are obtained at each boundary the values for the inner points are obtained using a linear interpolating along lines of constant ξ and η:
P( , ) = (1 − η) P1 ( ) + ηP2 ( )
0 ξ 1
Q( , ) = (1 − ξ) Q1 ( ) + ξQ 2 ( )
Eq. 3.6
0 η 1
Grid control of orthogonality at boundaries is introduced adding a second term in P and Q as:
P=−
r 2 r ξ ξ 2 r ξ
2
−λ
r 2 r ξ η2 r η
2
,
Q=
r 2 r 2 η η r η
2
−λ
r 2 r η ξ 2 r ξ
2
Eq. 3.7
Thomas P., and Middlecoff J., ”Direct control of the Grid Point Distribution in Meshes Generated by Elliptic Equations”, AIAA Journal Vol. 18, No. 6., 1980. 28
33
Where 0 < λ < 1 is a factor that relaxes the orthogonality at the boundaries. It has been observed that the range λ∈ [0.4-0.7] produces optimal results for our configurations. The elliptic PDEs are solved using a multi-grid method and the smoother is based on a point-wise Newton solver. When the forcing terms are used the convergence of the algorithm deteriorates slightly29. An important property in regard to coordinate system generation is the inherent smoothness that prevails in the solutions of elliptic systems. Furthermore, boundary slope discontinuities are not propagated into the field. Finally, the smoothing Figure 3.12 Typical Elliptic Grid for an Airfoil with tendencies of elliptic operators, and the Orthogonality Enforced on the Boundary extremum principles, allow grids to be generated for any configurations without overlap of grid lines (see Figure 3.12). There are thus a number of advantages to using a system of elliptic partial differential equations as a means of coordinate system generation. A disadvantage, of course, is that a system of partial differential equations must be solved to generate the coordinate system. 3.6.3.1.1 Case Study – Orthogonal Elliptic Mesh Smoother This is a 2D orthogonal elliptic mesh generator which works by solving the Winslow PDE 30-31. It is capable of modifying the meshes with stretching functions and an orthogonality adjustment algorithm. This algorithm works by calculating curve slopes using a tilted parabola tangent line fitter (original discovery). A distinct feature of the elliptic mesh solver is that it corrects overlapping and misplaced grid line very well. Firstly to construct an initial mesh, the Transfinite Interpolation algorithm is applied to the given domain constrained by the specified boundary conditions. This algorithm is implemented by mapping each point within the domain (regardless of the boundaries) to a new domain existing within the boundaries. This algorithm works by iteratively solving the parametric vector equation. At the heart of the solver is the mesh smoothing algorithm, which at a high level, works by solving the pair of Laplace equations. Coordinates of every point in the target domain, mapped to a transformed, computational space using the change of variables method. This renders the calculations simpler and faster to compute. However, we wish to solve the inverse problem, where we transition from the computational space to the curvilinear solution space. Using tensor mathematics, it can be shown that this problem entails solving the equations. 3.6.3.1.2 Orthogonality Adjustment Algorithm In several computational fluid dynamics applications, an orthogonal mesh is necessary in certain regions to ensure a high enough accuracy when performing calculations. However, it is not always possible to achieve a fully orthogonal solution, and thus the problem becomes finding a nearlyorthogonal solution to an arbitrarily defined domain. The implemented solution uses an iterative approach to find the angles of intersection and adjust the position of the nodes until their respective Sorenson R. L. and Steger J. L. Numerical Generation of Two dimensional Grids by the Use of Poisson Equations with Grid Control, in Numerical Grid Generation Techniques, R. E Smith, ed.. NASA CP 2166, NASA Langley Research Center, Hampton, VA, USA, 1980. 30 Chaitanya Varier 2017. 31 M. Farrashkhalvat and J.P. Miles, “Basic Structured Grid Generation”, An imprint of Elsevier Science Linacre House, Jordan Hill, Oxford OX2 8DP, 200 Wheeler Rd, Burlington MA 01803, First published 2003. 29
34
angles of intersection converge to a reasonable threshold value from 90 degrees. The exact method makes use of the linear approximation of the grid lines intersecting at each node within the mesh. (see Figure 3.13).
(a) Before
(b) After
Figure 3.13
Orthogonality Adjustments – (Courtesy of Chaitanya Varier)
3.6.3.1.3 Stretching Functions In order to further improve the quality of the mesh, one can introduce univariate stretching functions to either compress or expand grid lines in order to correct non-uniformity where grid lines are more or less dense. These functions are arbitrarily chosen and only reflect the distribution of grid lines. We can derive a new set of equations by combining our previously established differential model for grid generation and a set of univariate stretching functions of our choice. In order to do so in a straightforward manner, we can transform our Cartesian coordinates to a new set of coordinates which exists in a different space, called the parameter space. Then, we define our stretching functions as onto and one-to-one univariate functions of ξ and η respectively. For additional info, please consult the work by 32-33-34. 3.6.3.1.4 Extension to 3D If we wished to extend the elliptic solver to 3D, we would need to develop equations for transitioning Chaitanya Varier 2017. M. Farrashkhalvat and J.P. Miles, “Basic Structured Grid Generation”, An imprint of Elsevier Science Linacre House, Jordan Hill, Oxford OX2 8DP, 200 Wheeler Rd, Burlington MA 01803, First published 2003. 34 Joe F. Thompson, Z. U. A. Warsi, C. Wayne Mastin, “Numerical Grid Generation – Foundations and Application”, Mississippi State, Mississippi, January 1985. 32 33
35
from a curvilinear coordinate system (ξ, η, ς) to a 3D Cartesian coordinate system (x, y, z). Using the same elliptic model as before, we get the 3D version of the Winslow equations where each of the metric tensor coefficients is determined by taking the cofactors of the contravariant tensor matrix. The contravariant tensor matrix is used to obtain the coefficients for the Winslow equations, which are the inverse of the Laplace equations as stated before. In general, if we wish to extend our elliptic mesh solver to n dimensions, then we will have n sets of equations each with n!/(2(n - 2)!) + n terms. This renders the problem gradually more and more difficult to solve for higher dimensions with the existing elliptic scheme, implying that a different type of PDE might be needed in these cases. Another complication that arises in higher dimensions is adjusting grid lines to enforce orthogonality. Using the aforementioned algorithm for adjusting grid lines to achieve either complete or partial orthogonality on the boundary, we would need to iteratively solve three sets of two linear equations for each node in the mesh, as well as solve three trigonometric equations per iteration to compute the tangents. 3.6.3.1.5 Mesh Quality Analysis In order to determine the quality of the resulting mesh, it was necessary to construct an objective means of quality measurement. Therefore, several statistical procedures were implemented in the program to produce a meaningful mesh quality analysis report. The metrics which are presented are divided into the following categories: ➢ Orthogonality Metrics • Standard deviation of angles • Mean angle • Maximum deviation from 90 degrees • Percentage of angles within x degrees from 90 degrees (x can be set as a constant in the code) ➢ Cell Quality Metrics • Average aspect ratio of all cells • Standard deviation of all aspect ratios 3.6.3.2 Hyperbolic Schemes This grid generation scheme is generally applicable to problems with open domains consistent with the type of PDE describing the physical problem. The advantage associated with Hyperbolic PDEs is that the governing equations need to be solved only once for generating grid. The initial point distribution along with the approximate boundary conditions forms the required input and the solution is the then marched outward. Steger and Sorenson35 proposed a volume orthogonality method that uses Hyperbolic PDEs for mesh generation. For a 2D problem, considering computational space to be given by Δξ = Δη =1, the inverse of the Jacobian is given by,
x ξ y η − x η yξ = I
Eq. 3.8
Where I represents the area in physical space for a given area in computational space. The second equation links the orthogonality of grid lines at the boundary in physical space which can be written as Steger, J.L; Sorenson, R.L (1980). "Use of hyperbolic partial differential equation to generate body fitted coordinates, Numerical Grid Generation Techniques". NASA conference publication 2166: 463–478. 35
36
dξ = 0 = ξ x dx + ξ y dy
Eq. 3.9
For ξ and η surfaces to be perpendicular the equation becomes:
x ξ y η + yξ y η = 0
Eq. 3.10
The problem associated with such system of equations is the specification of I. Poor selection of I may lead to shock and discontinuous propagation of this information throughout the mesh. While mesh being orthogonal is generated very rapidly which comes out as an advantage with this method. Figure 3.14 displays a C-O type hyperbolic grid around an HSCT wing-fuselage configuration, with Pressure contours mapped using an Euler solution and M∞ = 2.4. 3.6.3.3 Parabolic Schemes The solving technique is similar to that of hyperbolic PDEs by advancing the solution away from the initial data surface satisfying the boundary conditions at the end. Nakamura (1982) and Edwards (1985) developed the basic ideas for parabolic grid generation. The idea uses either of Laplace or the Poisson's equation and especially treating the parts which controls elliptic behavior. The initial values are given as the coordinates of the point along the surface η = 0 and the advancing the solutions to the outer surface of the object satisfying the boundary conditions along ξ edges. The control of the grid spacing has not been suggested till now. Nakamura and Edwards, grid control was accomplished using non uniform spacing. The parabolic grid generation shows an advantage over the hyperbolic grid generation that, no shocks or discontinuities occur and the grid is relatively smooth. The specifications of initial values and Figure 3.14 Euler Solution on a HSCT Wing-Fuselage selection of step size to control the grid points is however time consuming, but these techniques can be effective when familiarity and experience is gained. Variational Method These methods have evolved from elliptic grid generation. To solve an elliptic PDE is often equivalent to minimizing a functional. Variational methods has been used for improving quality of a given grid36. In the vibrational methods, a grid functional is defined. Grid functional is an algebraic expression of the position vectors of the internal nodes of a mesh. Optimization of the grid functional may result in a grid with desired properties such as orthogonal grid lines, equal cell areas, linear or parallelogram cells and untangled mesh. There are many algebraic functional for grid generation and optimization. For example, algebraic grid generation methods such as Transfinite Interpolations though, one of simplest method of grid generation, but can produce folded grids for curved domains as seen in the 36
J.F. Thompson, B.K. Soni and N.P. Weatherill. Handbook of Grid Generation. CRC Press, 1998.
37
Figure 3.15. One other disadvantage of algebraic grid generation is that boundary discontinuity can prorogate inside the domain. As indicated in Figure 3.15, Winslow functional smooth the grid, and removes the folded grid lines. There are far too many algebraic functional for grid generation and optimization as reader should check with37.
Figure 3.15
1.8
Folded Grid by Transfinite Interpolation - Smooth Grid by Winslow Functional
Structured Adaptive Grid
In an adaptive grid, the physics of the problem at hand must ultimately direct the grid points to distribute themselves so that a functional relationship on these points can represent the physical solution with sufficient accuracy38. The idea is to have the grid point’s move as the physical solution develops, concentrating in regions of large variation in the solution as they emerge. The mathematics controls the points by sensing the gradients in the evolving physical solution, evaluating the accuracy of the discrete representation of the solution, communicating the needs of the physics to the points, and finally by providing mutual communication among the points as they respond to the physics. The basic techniques involved then are as follows: • • • •
A means of distributing points over the field in an orderly fashion, so that neighbors may be easily identified and data can be stored and handled efficiently. A means of communication between points so that a smooth distribution is maintained as points shift their position. A means of representing continuous functions by discrete values on a collection of points with sufficient accuracy, and a means for evaluation of the error in this representation. A means for communicating the need for a redistribution of points in the light of the error evaluation, and a means of controlling this redistribution.
Several considerations are involved here, some of which are conflicting. The points must concentrate, and yet no region can be allowed to become devoid of points. The distribution also must retain a sufficient degree of smoothness, and the grid must not become too skewed, else the truncation error will be increased as noted. This means that points must not move independently, but rather each point must somehow be coupled at least to its neighbors. Also, the grid points must not move too far Sanjay Kumar Khattri, “Grid Generation and Adaptation by Functionals”, Department of Mathematics, University of Bergen, Norway. 38 Joe F. Thompson, J., F., Warsi, Z., U., A., Mastin, .W. “Numerical Grid Generation; Foundations and Applications”, North-Holland Book, 1995. 37
38
or too fast, else oscillations may occur. Finally the solution error, or other driving measure, must be sensed, and there must be a mechanism for translating this into motion of the grid. The need for a mutual influence among the points calls to mind either some elliptic system, thinking continuously, of some sort of attraction (repulsion) between points, thinking discretely. Both approaches have been taken with some success, and both are discussed below. It should be noted that the use of an adaptive grid may not necessarily increase the computer time, even though more computations are necessary, since convergence properties of the solution may be improved, and certainly fewer points will be required. With the time derivatives at fixed values of the physical coordinates transformed to time derivatives taken at fixed values of the curvilinear coordinates, no interpolation is required when the adaptive grid moves. Thus the first derivative transformation given the chain rule is given by
(
∂A ∂A ∂x =( ) + ∇A. ( ) ) ∂t ξ,η,ζ ∂t x,y,z ∂t ξ,η,ζ 3
∂A ∂A ∂A =( ) +∑ ( ) ∂t ξ,η,ζ ∂t x,y,z ∂xi i=1
or
∂xi ( ) ⏟∂t mesh movement
Eq. 3.11 The computation thus can be done on a fixed grid in the transformed space, without need of interpolation, even though the grid points are in motion in physical space. The influence of the motion of the grid points registered through the grid speeds, (xi) t, appearing in the transformed time derivative. This is the appropriate approach when the grid evolves with the solution at each Time step. Some methods, however, change the grid only at selected time steps, and here interpolation must be used to transfer the values from the old grid to the new since the grid movement is not continuous. A combination of the weight functions given by Eq. 3.11 provides the desired tendency toward concentration both in regions of high gradient and near extrema. The effect of the inclusion of the curvature illustrated below: 1/2
2 2 A w = (1 + β K ) 1 + α x 2
where
K=
2A x 2 A 2 1 + x
Eq. 3.12
Figure 3.16
1D Weight Function for High Gradient and Curvature
3/2
39
Where α and β are parameters to be specified. Clearly, concentration near high gradients is emphasized by large values of α , while concentration near extrema (or other regions of large curvature) is emphasized by large β. Case Study – 2D Euler Flow Over an NACA Airfoil In a grid adaptation method for structured grids without adding or removing grid points, adaptation is achieved through moving the grid points toward the desired locations. Changes in the mesh point locations can be controlled by two methods.39 In the first method, the arc elements forming the ides of a control volume are directly related to specified functions. For a three-dimensional problem, this implies that three arc elements need to be given. In the second method, the cell volume may be altered by specifying that the volume of each element change according to a specific rule. To control the cell size, only one relationship must be specified that relates the volume to the quantity responsible for changes in the mesh. The specification of only one control function is an advantage in simplicity but may be less flexible than independently controlling arc lengths. The cell volume control method is applied successfully to calculating transonic Euler flows with shock waves. The method is applied to computing the flow field over an airfoil. Figure 3.17 shows the initial C-mesh of an NACA 0012 airfoil and the adaptive one on the right, with their respective Mach contours. Two flow cases
Figure 3.17
Mesh and Mach Contours for Transonic Flow
Feng Liu, Shanhong Ji, and Guojun Liao,” An Adaptive Grid Method and Its Application to Steady Euler Flow Calculations”, Siam J. Sci. Comput. C° 1998 Society For Industrial And Applied Mathematics Vol. 20, No. 3, Pp. 811{825 39
40
were calculated over the initial grid. The first is a transonic case with free stream Mach number, M1 = 0.85 and an angle of attack, α = 1 where Left is without mesh adaption and Right is with. There is one strong shock wave on the upper side of the airfoil and a weaker one on the lower side. It can be seen from Figure 3.17 that the computed shock waves are rather thick. Shock waves zero thickness in the inviscid limit. To get better computational results, particularly to capture the shock waves more accurately, one would like to concentrate grid points around the shock waves. The deformation method is applied to get a new grid with prescribed distribution of cell sizes based on gradients of the flow field. The adaptive criterion here is to detect the shock waves. This suggests choosing the monitor function f of the form:
1 = C1 (1 + C2P) f
Eq. 3.13
Where P is the pressure and C1and C2 are constants. It can be seen that grid points are clustered closely in the areas where the two shock waves occur, although grid lines are somewhat skewed in the clustered regions because the deformation method does not guarantee orthogonality. However, since our flow solver is based on a finite volume scheme which does not require the use of an orthogonal grid, we are content with the locally reduced cell sizes. Another test case is the supersonic flow over the same airfoil with a free stream Mach number M∞ = 1.5, and α= 0. As can be seen, a strong bow shock wave appears in front of the airfoil leading edge. In addition, there are two weak shocks emanating from the trailing edge of the airfoil the Mach number distribution computed on the adapted grid. It can be seen that a sharper front of the bow shock is captured compared with that on the initial un-adapted grid. The resolution of the two trailing edge shocks is also slightly increased. The computational time needed for the grid adaptation and the flow solver for the supersonic case is the same as that for the transonic case. (See Figure 3.18).
Figure 3.18
Grid Adaption and Mack Contours for Supersonic Airfoil
41
42
4 Un-Structured Mesh Generation The 1980s witnessed the rapid development of alternative meshing techniques. The most prominent of these are the unstructured methods based on triangles in 2D and tetrahedral in 3D. Some of the earliest ideas for generating triangular meshes over planar regions can be found in a review by Thacker40. It is interesting to note that until the mid-1980s little effort had been applied to the problem of computing aerodynamic flow fields on meshes of triangles or tetrahedral. The first attempts to solve the flow around a complete aircraft by means of a finite element solution on a tetrahedral mesh are described in the papers of [Bristeau et al.] and [ Jameson et al.]. There are three essentially different approaches to generating triangular or tetrahedral meshes, the Moving (Advancing) front technique41, Delaunay base methods42,43,44 and the Octree approach45. Moving front and Delaunay based methods create a triangulation that matches a prescribed boundary (a specified set of points and edges in 2D, a specified set of points and triangular faces in 3D). The Octree method, however, determines the boundary discretization as part of the domain meshing procedure and is thus closely related to the Cartesian approach. Each method is discussed below.
Advancing Front Method This technique has the virtue of starting from a prescribed boundary definition (set of edges in 2D, set of triangular faces in 3D) which remains intact throughout the mesh generation process. The boundary triangulation is regarded as a front on which a new layer of elements is built. The original front triangles become interior faces of the mesh and a new set of front faces is created, a process that continues until the entire domain has been filled. A particular difficulty of this method occurs in the closing stages when the front is collapsing on itself and the last vestiges of empty space are replaced by new elements. This is Figure 4.1 Closing stage of a Moving Front Method illustrated in Figure 4.1 which demonstrations an almost completed triangulation of the region around an airfoil with the edges on the current front marked in bold. In Thacker WC. A brief review of techniques for generating irregular computational grids. Intentional Journal Numerical Meth Eng. 1980; 15:1335–41. 41 Lo SH. A new mesh generation scheme for arbitrary planar domains. Int J Numer Meth Eng 1985;21:1403–2 42 Baker TJ. Three dimensional mesh generation by triangulation of arbitrary point sets, AIAA 8th CFD conference. Honolulu, HI. AIAA paper 87-1124, 1987. 43 Weatherill NP. , “A method for generating irregular computational grids in multiply connected planar domains”, International Journal Number Meth Fluids 1988; 8:181–97. 44 George PL, Hecht F, Saltel E. Constraint of the boundary and automatic mesh generation. Proceedings of the second international conference on num grid gen comp fluid dyn, Miami, FL, 1988. p. 589–97. 45 YerryMA, Shephard MS., “Automatic three-dimensional mesh generation by the modified Octree technique”, International J Numerical Meth Engineering 1984; 20:1965–90. 40
43
practice, there is rarely any difficulty in completing the process for a planar triangulation. In three dimensions, however, the remaining region of space can have an extremely complicated shape which may not yield to an acceptable covering by tetrahedral elements, thus preventing the volume triangulation from filling the entire region to be meshed. The basic methodology is based on action performed for a certain boundary image as described by geometric rules or tests. These rules (2D and 3D) are to optimize the shape of the new element in the advancing front method. Each methodology depends on these rule, its complexity, and how they been applied. Therefore, the algorithm has to check the rules stored in data structures. The code complexity is independent of the number of rules. The algorithm is complicated, but well defined and can be, at least theoretically, implemented failsafe. Especially in 3D, the choice of the concrete rules is based on heuristics, which is put into an easily maintainable rule description data-base46. Advancing Front Triangular Mesh Generator The original advancing front algorithm has been developed over time into a family of programs which are very reliable and flexible for an easy incorporation of mesh adaptation47. The advancing front mesh generator can be described as . ➢ ➢ ➢ ➢ ➢ ➢
Input of geometric data (using control points); Input of mesh control parameters (through a background mesh); Geometric modeling (using cubic splines); Boundary discretization (placing new points on the boundary); Domain discretization (simultaneously generating points and triangles); Mesh quality enhancement (through topological and geometrical strategies).
The computational domain is modeled through the use of cubic splines which are defined by some control points. Close to singularities extra care must be taken in the definition of these points in order to avoid failure (Thompson et al., 1999). As a “pre-processing” stage, before the mesh generation begins, we must first build an initial and very coarse triangular background mesh that covers the whole domain. This coarser mesh is used only to provide a piecewise linear spatial distribution of the nodal parameters over the mesh to be constructed. Typically, elements of the generated mesh will have a projected length of δ2 in the direction parallel to α2 a and a projected length of St δ2 in the direction normal to α2 a (see Figure 4.2), with St being the stretching factor. During the generation process, the local values of these parameters will be obtained by a linear interpolation over the triangles of the background mesh. Figure 4.2 Mesh parameters Joachim Sch¨ober, “NETGEN An advancing front 2D/3D-mesh generator based on abstract rules”, Computing and Visualization in Science, 1:41–52 (1997). 47 Paulo Roberto M. Lyra, Darlan Karlo E. de Carvalho, “A Computational Methodology for Automatic TwoDimensional Anisotropic Mesh Generation and Adaptation”, Methodology for Automatic Two-Dimensional Anisotropic Mesh Generation and Adaptation. 46
44
The boundary of the domain is represented by the union of boundary segments forming closed loops. External boundaries are defined in an anti-clockwise fashion while inner boundaries are set in a clockwise manner. As described previously, the generation of a triangular mesh by the advancing front technique begins by the discretization of the boundary of the domain. New points are created according to the mesh parameters which are interpolated from those of the background mesh. At the beginning of the process, the generation front is made by a set of linear segments connecting the boundary nodes. With the initial front defined, one segment is chosen and, in general, a triangle is created through the insertion of an internal node or by simply connecting existing nodes. New triangles are built following the same procedure. During the process any segment available to build a new triangle is set as “active” and the others which are set as “non-active” are removed from the generation front. Therefore the boundary segments are not modified during the mesh generation. The procedure continues until the whole domain is discretized. When solving problems which develop some essentially one dimensional features at certain regions (e.g. boundary layer, shocks, etc.) it is not very efficient to use uniform isotropic meshes. In these cases, it is important to have the possibility to define a direction and a stretching factor for the elements close to such regions. At least for linear triangular elements, the use of anisotropic meshes can be extremely important in terms of computational effort and accuracy. To generate an anisotropic triangulation of the desired domain, it is used a transformation T which is a function of the mesh parameters, i.e. αi , i = 1, 2. This transformation48, is given by, N
1 T(α i , δi ) = (α i α i ) i =1 δ i
Eq. 4.1
where X denotes the tensor product of two vectors and N is the number of dimensions, here, N = 2. The effect of this transformation is to map the physical domain into a normalized domain, where a mesh is generated in which the elements are approximately equilateral with unit average size. Applying the inverse of this transformation T-1, we end up with a directional stretched mesh dictated by the mesh parameters, which are defined either by the analyst or by the mesh adaptive procedure. This mesh generator provides an accurate geometric modeling and high quality meshes, where the high level of control of the distribution of local mesh parameters eases the incorporation of mesh adaptation strategies. The quality of the meshes is strongly influenced by the mesh optimization stage. A specific mesh improvement strategy for highly anisotropic meshes and the definition of an adequate sequence of mesh enhancement procedures are incorporated into the code. Several other modifications have been introduced in the original code in order to incorporate the flexibility to deal with predefined multi-domains Figure 4.3 Surface Mesh of SGI Logo and automatically defined sub-regions, to build boundary layer meshes, to make possible Peiró, J., Peraire, J. and Morgan, K., 1994, “{FELISA SYSTEM}: Reference Manual Part1 - Basic Theory”, University of Wales Swansea Report CR/821/94. 48
45
generating quadrilateral and mixed meshes and the automatic definition of which domains or subregions should be filled up by triangular or by quadrilateral elements. These features will be fully described in the correspondent sections. Figure 4.3 shows an triangulation of SGI logo by [Rypl and Bittnar].
Advancing Front Quadrilateral Meshing Using Triangle Transformations Quad-morphing is a new technique used for generating quadrilaterals from an existing triangle mesh. Beginning with an initial triangulation, triangles are systematically transformed and combined. An advancing front method is used to determine the order of transformations. An all-quadrilateral mesh containing elements aligned with the area boundaries with few irregular internal nodes can be generated. [see Owen et al.]49. Outline of Quad-Morphing Algorithm Quad-morphing is briefly outlined in the following steps: 4.2.1.1 Initial Triangle Mesh The surface is first triangulated. This may be done using any surface triangulation method. Any sizing (Owen,1997) or adaptively information should be built into the initial triangulation. The local sizing for the final quadrilateral mesh will roughly follow that of the triangle mesh. 4.2.1.2 Front Definition The initial front is defined from the initial triangle mesh. Any edge in the triangulation that is adjacent to only one triangle becomes part of the initial front. 4.2.1.3 Front Edge Classification Each edge in the front is initially sorted according to its state. The state of a front edge defines how the edge will eventually be used in forming a quadrilateral. Angles between adjacent front edges determine the state of an individual front. Front edges will be updated and reshuffled as the algorithm proceeds. Figure 4.4 shows the four possible states of a front, where the front edge is indicated by the bold line.
Figure 4.4
States of a front edge – (Courtesy of Owen et al.)
4.2.1.4 Front Edge Processing Each front edge is individually processed to create a new quadrilateral from the triangles in the initial mesh. Figure 4.5 (a) shows front NA-NB in the triangulation ready to be processed. Front edges are handled differently according to their current state classification. As quadrilaterals are formed, the front is redefined and adjacent front edge states are updated. The current front always defines the Steven J. Owen, Matthew. Staten, Scott A. Canann and Sunil Saigal, “Advancing Front Quadrilateral Meshing Using Triangle Transformations”, Conference Paper · January 1998. 49
46
interface between quadrilateral elements in the final mesh and triangle elements in the initial triangle mesh. This process can be further subdivided into the following sub-steps: ➢ Check for Special Cases. Before proceeding to construct a quadrilateral from the current front, several special case scenarios are checked. These include situations where large transitions or small angles exist local to the front. In these cases a seam, or transition seam operation is performed. ➢ Side Edge Definition. Using the front edge as the initial base edge of the quadrilateral, side edges are defined. Side edges may be defined by using an existing edge in the initial triangle mesh, by swapping the diagonal of adjacent triangles, or by splitting triangles to create a new edge. In Figure 4.5 (b), side edge NB-NC shows the use of an existing edge, while the side edge NA-ND was formed from a local swap operation. ➢ Top Edge Recovery. The final edge on the quadrilateral is created by an edge recovery process. During this process, the local triangulation is modified by using local edge swaps to enforce an edge between the two nodes at the ends of the two side edges. Edge NC-ND in Figure 4.5 (c) was formed from a single swap operation. Any number of swaps may be required to form the top edge. ➢ Quadrilateral Formation. Merging any triangles bounded by the front edge and the newly created side edges and top edge as shown in Figure 4.5 (d) forms the final quadrilateral. ➢ Local Smoothing. The mesh is smoothed locally to improve both quadrilateral and triangle element quality as shown in Figure 4.5 (e). ➢ Local Front Reclassification. The front is advanced by removing edges from the front that have two quadrilateral adjacencies and adding edges to the front that have one triangle and one quadrilateral adjacency. New front edges are classified by state. Existing fronts that may have been adjusted in the smoothing process are reclassified.
Figure 4.5
Steps demonstrating process of generating a quadrilateral from Front NA-NB - (Courtesy of Owen et al.)
47
Front edge processing continues until all edges on the front have been depleted, in which case an all quadrilateral mesh will remain, assuming an even number of initial front edges. When an odd number of boundary intervals is provided, a single triangle must be generated, usually towards the interior of the mesh. 4.2.1.5 Topological Clean-up and Final Smoothing Process Element quality is improved by performing local quadrilateral transformations in an attempt to improve the individual edge valences at the nodes of the mesh. A final smoothing pass is performed further improving the element qualities. The final smoothing step involves a limited number of iterations of a constrained Laplacian smoothing algorithm. Each node is moved to the centroid of its neighbors only if an improvement in element shape metric (Lee,1994) would result. In situations where Laplacian smoothing produces poor results, an optimization based smoothing (Canann,1998) operation may be performed. 4.2.1.6 Example Problems The first example, shown in Figure 4.6, demonstrates the progression of the Q-Morph algorithm on a simple planar domain with two holes. Figure 4.6 (a) shows the initial triangle mesh before QMorph begins. In this case an advancing front triangle meshed (Canann,1997) was used to create the triangles. The method used for triangulation is unimportant, inasmuch as the appropriate nodal density is provided. Figure 4.6 (b)-(g) show the progression of the algorithm as each successive layer of elements is completed. Figure 4.6 (c) shows an additional layer of small elements meshed on the internal circle loop before meshing the larger elements of the outer loop. To improve element
Figure 4.6
Progression of Q-Morph- (Courtesy of Owen et al.)
48
Figure 4.8
Figure 4.7
Results of Q-Morph Compared with Lee’s (1994) Advancing Front Indirect Method on Toroidal Surface- (Courtesy of Owen et al.)
Comparison of Q-Morph with Lee’s Algorithm Illustrating Element Boundary Alignment - (Courtesy of Owen et al.)
transitions, provision is made in Q-Morph to mesh loops with smaller elements before those with
49
larger elements. The mesh is completed in Figure 4.6 (h) after a final pass of cleanup and smoothing. Figure 4.8 and compares Q-Morph against Lee’s (1994) quad meshing algorithm, which uses an indirect method, coupled with an advancing front scheme to combine triangles into quadrilaterals. The toroidal surface of Figure 4.8 is composed of four surface patches represented as rational BSplines. Q Morph utilizes projection and geometric evaluation routines as part of the local and final smoothing procedures to maintain nodal locations on the three-dimensional surface. Both Figure 4.8 (a) and (b) were generated using the same initial triangle mesh as well as the same cleanup and smoothing procedures. Despite using an advancing front scheme, Lee’s algorithm shown in Figure 4.8 (b), has difficulty maintaining well-aligned rows of elements introducing many irregular internal nodes.
Figure 4.9
Large Transition Mesh for CFD Application - (Courtesy of Owen et al.)
Figure 4.7 further illustrates the ability of the Q-Morph algorithm to generate well-aligned rows of elements parallel to a complex domain boundary, while still maintaining the required element size transitions. Figure 4.9 demonstrates the use of Q-Morph with a planar surface requiring a high degree of transition. Figure 4.9 (a) shows the partially completed quad mesh with two layers of quads placed. Figure 4.9 (b) shows the same area after final cleanup and smoothing. In order to maintain a specified nodal density near the top of the area, a sizing function (Owen,1997) was used during the triangle meshing process. The algorithm’s ability to maintain the desired mesh density while still enforcing well-aligned rows of elements transitioning quickly to larger size elements is demonstrated in this example. For further and complete analysis, please consult the work by [Owen
50
et al.]50. 4.2.1.7 Conclusion The Q-Morph algorithm is an indirect quadrilateral meshing algorithm that utilizes an advancing front approach to transform triangles into quadrilaterals. It generates an all-quadrilateral mesh, provided the number of intervals on the boundary is even. The resulting mesh has few irregular internal nodes and produces elements whose contours, in general, follow the boundary of the domain. Overall element quality is excellent. The Q-Morph algorithm borrows many of its techniques from the paving method (Blacker,1991; Cass,1996) but adapts them for use as an indirect method, operating on an existing set of triangles. In so doing, it is able to improve upon the paving technique by resolving some of its inherent difficulties. The intersection problem, common to most direct methods of advancing front meshing, is eliminated by relying on the topology of the initial triangle mesh to close opposing fronts. Improvements also include facility for handling individual element placement through the use of states for classifying front edges. Facility for handling transition in element sizes has also been addressed through the use of sizing information provided by the initial triangle mesh and the definition of specific transformations that enable improved mesh transitions. Additionally, the initial triangle mesh provides information that reduces the cost of direct evaluations on three dimensional surface geometry.
Delaney Triangulation Method Delaunay triangulation for a given set of discrete points in a plane is a triangulation such that no point in is inside the circumcircle of any triangle in. Delaunay triangulations maximize the minimum angle of all the angles of the triangles in the triangulation; they tend to avoid sliver triangles. The triangulation is named after [Boris Delaunay]51 for his work on this topic. For a set of points on the same line there is no Delaunay triangulation (the notion of triangulation is degenerate for this case). For four or more points on the same circle (e.g., the vertices of a rectangle) the Delaunay triangulation is not unique: each of the two possible triangulations that split the quadrangle into two triangles satisfies the "Delaunay condition", i.e., the requirement that the circumcircles of all triangles have empty interiors. By considering circumscribed spheres, the notion of Delaunay triangulation extends to three and higher dimensions. Generalizations are possible to metrics other than Euclidean distance. However, in these cases a Delaunay triangulation is not guaranteed to exist or be unique52. The Delaunay triangulation of a discrete point set points in general position corresponds to the dual graph of the Voronoi diagram for the same points, as revealed in Figure 4.11. Special cases include the existence of three points on a line and four points on circle. Properties of Delaunay Triangulation53 Definition 1. The Delaunay triangulation (DT) of a finite set of points S in R3, denoted as D(S), is a triangulation with a special property that no point of S lies in the interior of the circumsphere of any tetrahedron of D(S). The special property of the Delaunay triangulation is called empty circle property in R2 and empty sphere property in R3. This definition of Delaunay triangulation can be generalized to any higher dimension. Definition 2. A simplex s of the Delaunay triangulation D(S) is said to be Delaunay if there exists an empty circumsphere of s. Steven J. Owen, Matthew. Staten, Scott A. Canann and Sunil Saigal, “Advancing Front Quadrilateral Meshing Using Triangle Transformations”, Conference Paper · January 1998. 51 Delaunay, Boris (1934). "Sur la sphère vide". Bulletin de l'Académie des Sciences de l'URSS, Classe des sciences mathématiques et naturelles. 6: 793–800. 52 From Wikipedia, the free encyclopedia. 53 Ashwin Nanjappa, “Delaunay Triangulation In R3 on The Gpu”, A Thesis Submitted For The Degree of Doctor of Philosophy, Department of Computer Science, National University of Singapore, 2012. 50
51
From the definition of circumsphere of a triangulation, it follows that every k-simplex of D(S) has an empty circumsphere. If k = d, then the circumsphere of s is unique, else s has infinitely many circumspheres. 4.3.1.1 Delaunay Lemma There is an alternate local property to the empty sphere property that is related to the Delaunay triangulation. Definition 3. A facet abc ∈ T(S) is said to be locally Delaunay if • •
It belongs to only one tetrahedron and therefore belongs to the boundary of the convex hull, or It belongs to two tetrahedral abcd and abce, and e lies on the exterior of the circumsphere of abcd.
The second test is called the in sphere test and its result is the same no matter if abcd is tested with e or if abce is tested with d. (See Figure 4.10). Lemma 1. (Delaunay Lemma) If every facet of a triangulation T is locally Delaunay, then T is the Delaunay triangulation of S. A face that is locally Delaunay is no guarantee Figure 4.10 Success and failure of the in sphere test of abcd with e. that it belongs to the Delaunay triangulation. However, if a triangulation T consists of only locally Delaunay faces then T = D. 4.3.1.2 Compactness In R2, the Delaunay triangulation maximizes the minimum angle in the triangulation and minimizes the largest circumcircle. This max-min angle optimality was discovered by Lawson. These properties of the Delaunay triangulation in R2 do not generalize to three and higher dimensions. A useful property of the Delaunay triangulation that holds in all dimensions, including three, is the containment radius. In R3, the containment radius is defined as the radius of the smallest sphere containing the tetrahedron. This is called the min-containment sphere and note that this need not necessarily be the circumsphere of the tetrahedron. [Rajan] showed that the Delaunay triangulation in R3 minimizes the containment radius of its tetrahedral. This makes it the most compact triangulation in R3. Algorithms Many algorithms for computing Delaunay triangulations rely on fast operations for detecting when a point is within a triangle's circumcircle and an efficient data structure for storing triangles and edges. In two dimensions, one way to detect if point D lies in the circumcircle of A, B, C is to evaluate the determinant:
52
Ax Bx Cx Dx The Delaunay triangulation with all the circumcircles and their centers (in red)
Figure 4.11
Ay By Cy Dy
A 2x + A 2y B2x + B2y C 2x + C 2y D 2x + D 2y
1 1 0 1 1
Eq. 4.2
Connecting the centers of the circumcircles produces the Voronoi diagram (in red)
Relationship Between Delaunay Triangles and the Voronoi Diagram
As shown in Figure 4.13 when A, B and C are sorted in a counterclockwise order, this determinant is positive if and only if D lies inside the circumcircle. The majority of Delaunay based methods exploit an incremental algorithm that starts with an initial triangulation of just a few points. The complete triangulation is generated by introducing points and locally reconstructing the triangulation after each point insertion. A particularly attractive feature of this approach is the opportunity to place new points at specified locations with the aim of retaining, or possibly improving, the quality of the mesh54. The main difficulty is the need to ensure surface integrity. Most methods allow the boundary points to be inserted into the volume triangulation unchecked, reestablishing the surface edges and faces by a series of edge/face swaps and the occasional introduction of an extra point. The left hand side of Figure Figure 4.12 Two-Three Tetrahedral swap 4.12 illustrates a simplified complex formed by two tetrahedral which share a common face. If this face is removed and an edge is inserted connecting the vertices A and B one obtains three tetrahedral (shown on the right hand side of Figure 4.12 which occupy the same 54
Bowyer A. Computing Dirichlet tessellations. Computer J 1981; 24(2):162–6.
53
region of space as the two original tetrahedral. This so-called “2 to 3” swap can often be used to establish a boundary edge; the reverse operation can similarly be applied to establish a boundary face. Not all boundary edges and faces can be established by this one operation but other more complicated swapping operations are possible. When the boundary triangulation has been established within the initial volume mesh, additional points are then inserted into the triangulation in order to create a volume mesh of wellshaped tetrahedral. (see Figure 4.13 and Figure 4.10). A detailed description of this process is given in the books by [George and Borouchaki] and by [Frey and George]55. Advantages Figure 4.13 Robust and Fast way to The important advantage of triangulation techniques is the Detect if point D lies in the higher degree of automation that is achieved in the meshing Circumcircle of A, B, C process. It can be shown, for example, that a Delaunay mesh can be generated to conform to any prescribed boundary in 2D56. The situation in 3D is much more complicated and no similar mathematical guarantee exists. The method has, nevertheless, been brought to a high level of automation and current tetrahedral mesh generators will reliably create good quality isotropic meshes if they are provided with a good quality surface triangulation57-58. Delaunay triangulation is a concept that extends back well before the emergence of mesh generation59. Together with its geometric dual, the Voronoı diagram, it has proved to be a fertile
Figure 4.14
Delaunay Triangulation (white) and Voronoi Diagram (blue) – Courtesy of [Labbe])
Baker T.J., “Triangulations, mesh generation and point placement strategies”, Caughey DA, Hafez MM, editors. “Frontiers of computational fluid dynamics”, New York: Wiley, 1994, pp. 101–15. 56 Lee DT, Lin AK. Generalized Delaunay triangulation for planar graphs. Discrete Comput Geom 1986;1: 201– 57 George PL, Borouchaki H. Delaunay triangulation and meshing. Hermes; 1998. 58 Baker TJ, Vassberg JC. Tetrahedral mesh generation and optimization. 6th Iinternational conference on numerical grid generation. ISGG; 1998. p. 337–49. 59 DelaunayB. Sur la sphe`re vide, Izvestia Akademia Nauk SSSR, VII Seria. Otdelenie Matematicheskii Estestvennyka Nauk 1934; 7:793–800. 55
54
construct whose applications extend from cartography to crystallography. In the seventies it attracted the attention of computer scientists and quickly became an important topic within the then emerging discipline that is now known as computational geometry60. In the early nineties computer scientists rediscovered mesh generation as an application of Delaunay triangulation although computer graphics and animation was, and still remains, the main justification for their research into triangulation problems and Delaunay triangulation. Delaunay Adaptive Refinement In early isotropic meshing techniques, Delaunay triangulations were constructed from existing point sets, generated through other means. Incorporating the Delaunay structure of the point set in the generation of the point set was pioneered in 2D by [Chew]61and [Ruppert]62. They proposed to iteratively insert the circumcenters of triangles that do not fit a given set of criteria, such as the size or shape of elements. This technique allowed to generate meshes with lower bounds on the smallest angle of triangles and was then extended to 3D domains. In 3D, although no guarantee can be made on the dihedral angles of simplexes, the radius-edge ratio of tetrahedral can be shown to be bounded. An efficient algorithm to insert a vertex in an isotropic Delaunay triangulation, now known as the Bowyer-Watson algorithm, was proposed simultaneously and independently by [Bowyer]63 and [Watson]64. The simplexes whose Delaunay ball contains the simplex are collected and removed from the triangulation, which forms a cavity. Linking the refinement point to the vertices of the border of the cavity creates the new Delaunay simplexes of the triangulation. In the context of anisotropy, the generation of points was also originally done independently from the construction of the triangulation, using for example anisotropic quad trees. [Mavriplis]65-66 first considered the idea of stretched Delaunay methods and using nodes generated from an anisotropic advancing front technique; the connectivity is set by first constructing a large isotropic mesh and then inserting vertices with the Bowyer-Watson algorithm adapted to the anisotropic setting. The stretching of the space is obtained by computing gradients of the solution. Good results were achieved, but the swapping techniques employed do not extend nicely to higher-dimensional settings. [Borouchaki et al.]67 formalized the approach of stretching spaces of [Mavriplis] through the use of Riemannian metric tensors and introduced the anisotropic Delaunay kernel, their anisotropic version of an anisotropic Bowyer Watson algorithm. Along with this new insertion algorithm, they introduced a Delaunay refinement algorithm based on edge swapping, merging and splitting techniques to generate meshes whose edges lengths are close to 1 in the metric at each of their endpoints. Many developments have sprouted from this approach: 3D mesh generation, periodic anisotropic mesh generation, metric-orthogonal mesh generation . While these algorithms produce good results and have seen much use in the context of computational fluid dynamics, theoretical results are limited for these algorithms and there are no guarantees on either the termination or the robustness of algorithms, nor on the quality of the elements produced by these techniques. A theoretically sound approach to anisotropic Delaunay triangulations was
Preparata FP, Shamos MI. Computational geometry. Berlin: Springer; 1985. Chew, L. P. Constrained Delaunay triangulations. (1989). 62 Ruppert, J. A new and simple algorithm for quality 2-dimensional mesh generation. SODA (1993). 63 Bowyer, A. Computing dirichlet tessellations. The Computer Journal 24, 2 (1981). 64 Watson, D. F. Computing the n-dimensional Delaunay tessellation with application to Voronoi polytopes. The computer journal 24, 2 (1981), 167–172. 65 Mavriplis, D. J. Adaptive mesh generation for viscous flows using triangulation. Journal of computational Physics 90, 2 (1990), 271–291. 66 Mavriplis, D. J. Unstructured mesh generation and adaptivity. Tech. rep., DTIC Document, 1995. 67 Borouchaki, H., George, P. L., Hecht, F., Laug, P., and Saltel, E. Delaunay mesh generation governed by metric specifications. part I algorithms. Finite Elem. Anal. Des. 25, 1-2 (1997), 61–83. 60 61
55
proposed by [Boissonnat et al.]68, who introduced the framework of locally uniform anisotropic meshes. In their algorithm, the star of each vertex v is composed of simplices that are Delaunay for the metric at v. Each star is built independently and the stars are stitched together in the hope of creating an anisotropic mesh. The star structure was first introduced by [Shewchuk]69 to handle moving vertices in finite element meshes and considering stretched stars was first proposed by [Schoen]. Two stretched stars may be combinatorically incompatible, a configuration called an inconsistency. [Boissonnat et al.] proved that inconsistencies can be resolved by inserting Steiner points, yielding an anisotropic triangulation. The algorithm works in any dimension, can handle complex geometries and provides guarantees on the quality of the simplices of the triangulation. Voronoi Diagrams The well-known duality between the Euclidean Voronoi diagram and its associated Delaunay triangulation has inspired authors to compute anisotropic Voronoi diagrams, with the hope of obtaining a dual anisotropic triangulation. The approaches of[ Labelle and Shewchuk]70 and [Du and Wang]71 aim at approximating the geodesic distance between a seed and a point of the domain by considering that the metric is constant and equal to the metric at the seed (in the case of [Labelle and Shewchuk]72) or at the point (in the case of [Du and Wang ]). Contrary to the isotropic setting, the dual of an anisotropic Voronoi diagram is not necessarily a triangulation and inverted elements can be present in the dual triangulation. The algorithms were initially introduced for two-dimensional (Labelle and Shewchuk) and surface (Du and Wang) domains and have since then been studied and extended by various authors. The approach of Labelle and Shewchuk was shown to be theoretically sound in 2D, but the approach of the proof does not extend to higher dimensions. This result was extended to surfaces by [Cheng et al.]73 by locally approximating the surface with a plane and then using a density argument similar to the proof of [Canas and Gortler]. Centroid Voronoi tessellations, which are Voronoi diagrams for which the seeds are the centers of mass of their associated Voronoi cell, are known to create elements of good quality. The famous Lloyd algorithm iteratively moves the seeds to the center of mass of their respective cell and recomputed the Voronoi diagram of this new seed set. This algorithm was modified to be used in the anisotropic Voronoi diagram of Du and Wang, but the process is computationally expensive. Restricted Delaunay Triangulation The Delaunay and Voronoi structures presented so far are built from (almost) arbitrary point sets living in Rn. It is possible to employ these structures to approximate bounded domains. The restriction of a Delaunay complex to a domain is the subcomplex (the restricted Delaunay complex) composed of the simplices of whose dual Voronoi face intersect. Restricted Delaunay triangulations were introduced by [Chew] [53] and allow to accurately capture complex geometric objects. For example, it can be shown that under the condition of good sampling of a surface, the restricted Delaunay triangulation and the domain are homeomorphic [9]. Thanks to these good properties, 68 Boissonnat, J.-D., Wormser,
C., and Yvinec, M. Locally uniform anisotropic meshing. Proceedings of the twentyfourth annual symposium on Computational geometry (2008), ACM, pp. 270–277. 69 Shewchuk, R. Star splaying: an algorithm for repairing Delaunay triangulations and convex hulls. Proceedings of the 21st annual symposium on Computational geometry (New York, NY, USA, 2005. 70 Labelle, F., and Shewchuk, J. R. Anisotropic Voronoi diagrams and guaranteed-quality anisotropic mesh generation. Proceedings of the 19th annual symposium on Computational geometry (New York, NY, USA, 2003, 71 Du, Q., and Wang, D. Anisotropic centroidal Voronoi tessellations and their applications. SIAM Journal on Scientific Computing, 2005. 72 Labelle, F., and Shewchuk, J. R. Anisotropic Voronoi diagrams and guaranteed-quality anisotropic mesh generation. Proceedings of the 19th annual symposium on Computational geometry (New York, NY, USA, 2003). 73 Cheng, S.-W., Dey, T. K., Ramos, E. A., and Wenger, R. Anisotropic surface meshing. Proceedings of the seventeenth annual ACM-SIAM symposium on Discrete algorithm (2006).
56
restricted Delaunay triangulations have often been used to create provably correct refinement algorithms in the case of surfaces. It was however proven by [Boissonnat, Guibas and Oudot]74 that this does not extended to higher-dimensional settings. Nevertheless, restricted Delaunay triangulations will be consistently used in the refinement algorithms considered. Figure 4.15 represents 2D Delaunay triangulation of a set of vertices (black) restricted to a curve (blue). Voronoi edges are represented in teal, and in pink if they intersect the curve. The Voronoi vertices are marked with orange circles. Restricted Delaunay edges are drawn in yellow, and restricted Delaunay triangles are drawn in green.
Figure 4.15
2D Delaunay triangulation of a set of vertices (black) restricted to a curve (blue)
Anisotropic Mesh Generation Anisotropic meshes are desirable for various applications, such as the numerical solving of partial differential equations and graphics. From an equivalent point of view, the use of meshes whose elements are stretched according to the anisotropy of the phenomenon requires a lower number of elements to achieve the same precision of the result of the simulation. When stretched elements are used, the mesh is said to be anisotropic. Additionally to providing increased accuracy in the simulations of scientific modeling, anisotropic meshes also find use in geometric modeling as they can improve the visualization of objects, and lower the number of vertices required to represent a shape or interpolate a smooth function. By requiring fewer elements, anisotropic meshes thus provide another way to accelerate mesh generation, and increase the quality and the speed of computations. Where the main improvements in the accuracy of modeling only came from increased computation power and denser meshes for isotropic meshes, anisotropic mesh generation offers another independent way to obtain faster and more accurate results. While anisotropic meshes offer many benefits, their generation is also much harder than the traditional isotropic meshes. Due to its wide range of applications, several classes of methods have been proposed, yet no solution is satisfying for all classes of domains and anisotropy. Moreover, while isotropic meshes and their generation are now well studied from a theoretical point of a view, almost all the algorithms on
Boissonnat, J.-D., Guibas, L. J., and Oudot, S. Y. Manifold reconstruction in arbitrary dimensions using witness complexes. Discrete & Comp. Geom. 42 (2009), 37–70. 74
57
anisotropic mesh generation are heuristic. With this observation in mind, we seek to develop methods that are both provable, robust, and practical [Labbe]75. Case Study - Anisotropic Mesh Generation via Discretized Riemannian Delaunay Triangulations Due to its wide array of practical applications, anisotropic mesh generation has received considerable attention and several classes of methods have been proposed. In this study, the generation of anisotropic meshes using the concepts of Delaunay triangulations and Voronoi diagrams, has been investigated by [Labbe]76. First, consider the framework of locally uniform anisotropic meshes introduced by [Boissonnat, et al.]77. Despite known theoretical guarantees, the practicality of this approach has only been hardly studied. An exhaustive empirical study is presented and reveals the strengths but also the overall impracticality of the method. The ideal shape of simplex has so far been described as the regular simplex, but this is not always the case. We follow closely the development by [Labbe]78-79. The category for discretization of these are: 1 2 3
Algorithms based on the concepts of the Delaunay triangulation and the Voronoi diagram, Algorithms based on an embedding of the input domain to simplify the problem, Algorithms based on the optimization of particles.
The different approaches that we consider here are all based upon extending the notions of Voronoi diagrams and Delaunay triangulations to the anisotropic setting. We hope to benefit from the known results and theoretical soundness of the isotropic Delaunay triangulation and Voronoi diagram to generate anisotropic meshes with provable and practical meshing techniques. As all our methods are based upon the same structures, we dedicate a chapter to introducing the notions that will be used throughout this thesis. Our main chapters follow a logical progression, with each method taking more metric information into account to determine the connectivity and placement of points than the previous ones. We begin with a thorough practical investigation of the framework of locally uniform anisotropic meshes, a theoretically sound meshing technique proposed by [Boissonnat et al.]80 that is based on the idea of constructing at each point a triangulation that is well adapted to the local metric. The theoretical aspect of their approach has been extensively described, but its practicality is comparatively lesser known. We detail our implementation, which is both more robust and faster than the one previously presented in the short experiment investigation of the algorithm for surfaces, investigate the role of the numerous parameters, and give some results. Limitations of the approach are then exposed, along with our attempts to address those. In the Euclidean setting, the Delaunay triangulation of a point set can be constructed by first generating the Voronoi diagram of the point set and then computing the dual of this diagram. Anisotropic Voronoi diagrams have been considered to build anisotropic triangulations, however the dual of an anisotropic Voronoi diagram is not necessarily a valid triangulation and elements can be inverted. Different distances are possible to create such anisotropic Voronoi diagrams.
Mael Rouxel-Labbe, “Anisotropic mesh generation”, Université Côte d’Azur, 2016. Mael Rouxel-Labbe, “Anisotropic mesh generation”, Université Côte d’Azur, 2016. 77 Boissonnat, J.-D., Chazal, F., and Yvinec, M. Geometry and Topology Inference. in preparation. 78 Mael Rouxel-Labbe, “Anisotropic mesh generation”, Université Côte d’Azur, 2016. 79 M. Rouxel-Labbéa, M. Wintraeckenb, J.D. Boissonnatb, “Discretized Riemannian Delaunay triangulations”, 25th International Meshing Roundtable (IMR25). 80 Boissonnat, J.-D., Dyer, R., and Ghosh, A. Delaunay stability via perturbations. Int. J. Comp. Geom.& App .(2014). 75 76
58
Along with the introduction of their anisotropic distance, [Labelle and Shewchuk]81 presented a refinement algorithm that generates a point set for which their anisotropic Voronoi diagram has a valid dual triangulation. However, their method is limited to the setting of planar domains. We give requirements on point sets such that the dual of the anisotropic Voronoi diagram is a nice triangulation and propose a refinement algorithm to generate such point set. Our proof links anisotropic Voronoi diagrams built using the distance of [Labelle and Shewchuk]82 with the framework of locally uniform anisotropic meshes, relating along the way the concepts of quasicosphericity (used in locally uniform anisotropic meshes) and of protection of a point set. The second part of this chapter introduces a refinement algorithm based on the combination of the alternative point of view of the anisotropic Voronoi diagram as the restriction of a high-dimensional power diagram to a fixed paraboloid manifold and the tangential Delaunay complex, a structure used in manifold reconstruction that is well-adapted to the high-dimensional setting. We detail our implementation, study its theoretical grounds and investigate the practicality of the algorithm. Anisotropic Voronoi diagrams studied by previous authors compute and compare distances using a fixed metric, justifying this approximation by invoking the computational and time complexity of computing geodesics in a domain endowed with a metric field. To better facilitate, Table 4.1 is the list of symbols used. Ω P G F λi , vi φ(G1,G2) g0 g dG ‖.‖G dE dg Vord(P) Del(P) DelG(P) Delg0(P) Sp Svp Svp
Domain Point set Metric Square root of a metric Eigenvalues and eigenvectors of a metric Distortion between two metrics G1 and G2 Uniform metric field Arbitrary metric field Distance with respect to the metric G Norm with respect to the metric G Distance with respect to the Euclidean metric E Geodesic distance with respect to the metric field g Voronoi diagram of P using the distance d Abstract Delaunay complex of the point set P Delaunay complex of the point set P with respect to G Delaunay complex of the point set P with respect to g0 (uniform metric field) Star of p Restricted volume star of p Restricted surface star of p Table 4.1
Nomenclature
Labelle, F., and Shewchuk, J. R. Anisotropic Voronoi diagrams and guaranteed-quality anisotropic mesh generation. Proceedings of the nineteenth annual symposium on Computational geometry (New York, NY, USA, 2003), ACM Press, pp. 191–200. 82 see Previous. 81
59
4.4.1.1 Anisotropic Delaunay Triangulations 4.4.1.1.1 Locally Uniform Anisotropic Meshes The Delaunay triangulation has been extensively studied and is well known to possess useful and well-defined properties [Preparata and Shamos]83. Attempts have been made to extend the notion of Delaunay triangulation to the anisotropic setting either by adapting the famous Bowyer-Watson algorithm [Mavriplis] , [Borouchaki], [Dobrzynski], [Alauzet] or as the dual of an anisotropic Voronoi diagram (see Labelle and Shewchuk84, [Du and Wang]85. However, neither class of method offer in all dimensions the theoretical guarantees nor the practical robustness that we are interested in. A theoretically sound framework for Delaunay-based anisotropic meshes was introduced by [Boissonnat et al.], called locally uniform anisotropic meshes. Locally uniform anisotropic meshes are simplicial complexes in which the star of each vertex is Delaunay for the metric attached to the vertex. The use of anisotropic stars, inspired by the works of [Shewchuk] and [Schoen], is combined with the sliver removal techniques proposed by [Li and Teng ]. These techniques are adapted to the anisotropic setting to construct a star-based refinement algorithm that cleverly selects refinement points. The algorithm works in any dimension and offers guarantees on its termination and on the quality (size and shape) of the final simplexes. While the theoretical aspect of the approach has been thoroughly studied, its practicality is comparatively not as well explored. This chapter intends to fill this gap and presents a comprehensive empirical study of the algorithm. We first recall the required theoretical basis and detail some minor changes brought to the theory after practical experimentation. We then dive in the heuristic analysis of the behavior of the algorithm and its parameters and propose some improvements. A strong focus is put on the phenomenon of inconsistencies, which turns out to be a real issue of the algorithm. We introduce an implementation of the anisotropic Delaunay refinement algorithm introduced by [Boissonnat et al.]. We specifically detail the technical issues, and their solution, that arise when aiming for efficiency. This implementation of the star set is completely new and results in significant improvements in terms of computational speed, robustness and genericity over the former implementation that was used in. The empirical study of our implementation and of the algorithm is comprehensive and produce (minor) theoretical improvements. We investigate the practicality of the algorithm, analyze its limitations and propose various fixes that attempt to remedy these limitations. 4.4.1.1.2 Metric Tensor The adaptation of meshes based on a metric tensor was introduced by [Borouchaki et al.]86-87-88 and has imposed itself as the standard way to describe and prescribe anisotropy. A metric tensor, or simply a metric, in Rn is defined by a symmetric positive definite (SPD) quadratic form, represented by a n x n matrix G. [Labbe]89. The quadratic form defines as an inner product as Eq. 4.3
〈u, v〉G = ut , Gv = 〈u, Gv〉
Preparata, F. P., and Shamos, M. Computational geometry: an introduction. Springer Science & Business 2012. Labelle, F., and Shewchuk, J. R. Anisotropic Voronoi diagrams and guaranteed-quality anisotropic mesh generation. Proceedings of the nineteenth annual symposium on Computational geometry, NY, 2003. 85 Du, Q., and Wang, D. Anisotropic centroid Voronoi tessellations and their applications. SIAM Journal on Scientific Computing 26, 3 (2005), 737–761. 86 Borouchaki, H., George, P. L., Hecht, F., Laug, P., and Saltel, E. Delaunay mesh generation governed by metric specifications. part I algorithms. Finite Elem. Anal. Des. 25, 1-2 (1997), 61–83. 87 Diaz, M. C., Hecht, F., Mohammadi, B., and Pironneau, O. Anisotropic unstructured mesh adaptation for flows simulations. Internat. J. Numerical Methods Fluids 25 (1997), 475–491. 88 Hecht, F., and Mohammadi, B. Mesh adaption by metric control for multi-scale phenomena and turbulence. AIAA 35th Aerospace Sciences Meeting & Exhibit (1997). 89 Mael Rouxel-Labbe, “Anisotropic mesh generation”, Université Côte d’Azur, 2016. 83 84
60
and the norm of a vector u with respect to G is then given by
‖u‖𝐺 = √〈u, u〉 = √𝑢𝑡 𝐺𝑢
Eq. 4.4 Using this norm, the distance between two points p and q in Ω can be measured in the metric G as
dG (x, y) = ‖x − y‖G = √(x − y)t G(x − y)
Eq. 4.5 One recognizes the equation of an ellipsoid with semi-axis lengths 1/√λi. Since O is an orthonormal matrix, it can also be seen as a rotation matrix and the unit sphere in the metric is thus an ellipsoid in Rn whose axes directions are given by the eigenvectors {vi} of G and whose semi-axis lengths are equal to 1/√λi in the direction vi, where λi is the eigenvalue corresponding to vi. Incidentally, this construction proves that there is a natural bijection between ellipsoids and metrics. (see Figure 4.16).
Figure 4.16
Representation of a 3D Metric with Eigenvalues λ1, λ2 and λ3 as an Ellipsoid – (Courtesy of [Labbe])
4.4.1.1.3 Distortion The notions of metrics and metric fields are introduced to convey the stretching of spaces. To create a solid theoretical framework, it is required to be able to express how differently two metrics see distances and geometrical objects. For this purpose, [Labelle and Shewchuk] introduced the concept of distortion between two metrics. We recall here their definition. Properties and limitations as well as a new alternative that remedy those shortcomings are proposed by [Labelle and Shewchuk] introduced the concept of distortion between two points p and q of Ω as
φ(p, q) = φ(Gp , Gq ) = Max{‖Fp 𝐹𝑞−1 ‖, ‖Fq 𝐹𝑝−1 ‖}
Eq. 4.6 where ∥·∥ is the Euclidean matrix norm, Observe that φ(Gp,Gq) ≥ 0 and φ(Gp,Gq) = 1 when Gp = Gq.
61
4.4.1.1.4 Locally Uniform Anisotropic Meshes The Delaunay triangulation has been extensively studied and is well known to possess useful and well-defined properties [Preparata & Shamos]90. While the theoretical aspect of the approach has been thoroughly studied, its practicality is comparatively not as well explored. We first recall the required theoretical basis and detail some minor changes brought to the theory after practical experimentation. We then dive in the heuristic analysis of the behavior of the algorithm and its parameters and propose some improvements. We introduce an implementation of the anisotropic Delaunay refinement algorithm introduced by [Boissonnat et al.]91. This implementation of the star set is completely new and results in significant improvements in terms of computational speed, robustness and genericity over the former implementation that was used. The empirical study of our implementation and of the algorithm is comprehensive and produce (minor) theoretical improvements. We investigate the practicality of the algorithm, analyze its limitations and propose various fixes that attempt to remedy these limitations. Attempts have been made to extend the notion of Delaunay triangulation to the anisotropic setting either by adapting the famous BowyerWatson algorithm [Mavriplis]92, [Borouchaki]93, [Dobrzynski]94, [Alauzet]95or as the dual of an anisotropic Voronoi diagram [Labelle and Shewchuk]96, [Du and Wang]97. However, neither class of method offer in all dimensions the theoretical guarantees nor the practical robustness that we are interested in. A theoretically sound framework for Delaunay-based anisotropic meshes was introduced by [Boissonnat et al.]98, called locally uniform anisotropic meshes. Locally uniform anisotropic meshes are simplicial complexes in which the star of each vertex is Delaunay for the metric attached to the vertex. The use of anisotropic stars, inspired by the works of [Shewchuk]99 and [Schoen]100, is combined with the sliver removal techniques proposed by [Li and Teng]101-102. These techniques are adapted to the anisotropic setting to construct a star-based refinement algorithm that cleverly selects refinement points. The algorithm works in any dimension and offers guarantees on its termination and on the quality (size and shape) of the final simplexes.
90 Preparata, F. P., and Shamos, M. Computational geometry: an introduction.
Springer Science & Business, 2012. Locally uniform anisotropic meshing. Proceedings of the twentyfourth annual symposium on Computational geometry (2008), ACM, pp. 270–277. 92 Mavriplis, D. J. Adaptive mesh generation for viscous flows using triangulation. Journal of computational Physics 90, 2 (1990), 271–291. 93 Borouchaki, H., George, P. L., Hecht, F., Laug, P., and Saltel, E. Delaunay mesh generation governed by metric specifications. part Ialgorithms. Finite Elem. Anal. Des. 25, 1-2 (1997), 61–83. 94 Dobrzynski, C., and Frey, P. Anisotropic Delaunay mesh adaptation for unsteady simulations. Proceedings of the 17th International Meshing Roundtable (2008), 177–194. 95 Alauzet, F., and Loseille, A. A decade of progress on anisotropic mesh adaptation for computational fluid dynamics. Computer-Aided Design 72 (2016), 13–39. 96 Labelle, F., and Shewchuk, J. R. Anisotropic Voronoi diagrams and guaranteed-quality anisotropic mesh generation. Proceedings of the 19th annual symposium on Computational geometry (New York, NY, USA, 2003), ACM Press, pp. 191–200. 97 Du, Q., and Wang, D. Anisotropic centroid Voronoi tessellations and their applications. SIAM Journal on Scientific Computing 26, 3 (2005), 737–761. 98 Boissonnat, J.-D., Wormser, C., and Yvinec, M. Locally uniform anisotropic meshing. Proceedings of the twentyfourth annual symposium on Computational geometry (2008), ACM, pp. 270–277. 99 Shewchuk, R. Star splaying: an algorithm for repairing Delaunay triangulations and convex hulls. Proceedings of the twenty-first annual symposium on Computational geometry (New York, NY, USA, 2005). 100 Schoen, J. Robust, guaranteed-quality anisotropic mesh generation. M.S. thesis, UC at Berkeley, 2008. 101 Li, X.-Y. Sliver-free Three Dimensional Delaunay Mesh Generation. PhD thesis, University of Illinois at Urbana Champaign, PhD thesis, University of Illinois at Urbana-Champaign 2000. 102 Li, X.-Y., and Teng, S.-H. Generating well-shaped Delaunay meshed in 3d. Proceedings of the twelfth annual ACM-SIAM symposium on Discrete algorithms (2001). 91 Boissonnat, J.-D., Wormser, C., and Yvinec, M.
62
4.4.1.1.5 The Star Set Many algorithms have been devised to construct Euclidean Delaunay triangulations, but they cannot be simply extended to arbitrary metric fields. Although the computation of a curved Riemannian Delaunay triangulation is difficult, it is easy to compute the Delaunay triangulation of a set of points P with respect to the metric Gp (Delp(P)). Any metric-dependent geometric construction on a set of points P, like the Voronoi diagram or a simplex circumcircle, can therefore be obtained for the metric Gp by the following set of operations. First, compute the transformed point set. Then, compute the construction with the Euclidean norm on and transform the result back through . The triangulation is thus simply the image through the stretching transformation F−1p of the Euclidean Delaunay triangulation Del(Fp(P)) where Fp(P) = {Fppi, pi ∈ P}. As explained before, a sphere in metric space is an ellipsoid in the Euclidean space. Each simplex of a uniformly anisotropic Delaunay triangulation Delp(P) thus possesses an empty circumscribing ellipsoid, the inverse-transformed Delaunay ball from metric to Euclidean space (see Figure 4.17).
Figure 4.17
An anisotropic uniform Delaunay triangulation (orange) and the corresponding stretched
Delaunay balls and circumcenters (black circles) - (Courtesy of [Labbe]) The central idea of the framework of locally uniform anisotropic meshes is to approximate at each vertex p a given arbitrary metric field g by the uniform metric defined by extending Gp over the domain. Similarly to the way affine functions are locally good approximations of a generic continuous function, the approximation of an arbitrary metric field by a uniform metric will be accurate as long we stay in a small neighborhood. At each vertex, a Delaunay triangulation that conforms to the uniform metric field of that vertex is constructed. These independent triangulations can under some density conditions be combined to obtain a final triangulation of the domain. 4.4.1.1.6 Stars and Inconsistencies The star of a vertex p in a simplicial complex K, denoted by Sp, is defined as the sub-complex of K formed by the set of simplexes that are incident to p. The idea of considering independent stars at the vertices of a point set was first conceived by [Shewchuk] [128] to handle moving vertices in finite element meshes. This structure was also employed by [Schoen] [126], who introduced anisotropic stars whose connectivity is obtained by building an isotropic Delaunay mesh of a transformed point set. The star Sp of p ∈ P is in that case extracted from the complex Delp(P). This construction was described in the previous section and forms the core of the locally uniform anisotropic mesh framework. The collection of all the stars is called the (anisotropic) star set of P and is noted S(P). As the connectivity of each star is set according to the metric Gp at the center of the star, a given n-
63
simplex has n + 1 different Delaunay balls, one with respect to the metric of each vertex of the simplex. Consequently, there are in general inconsistencies among the stars of the sites: a simplex τ appearing in the stars of some of its vertices, may not appear in the stars of all of them (Figure 4.18). If a simplex is involved in such configuration, it Figure 4.18 Two stars Sp and Sq forming an inconsistent is said to be configuration - (Courtesy of [Labbe]) inconsistent. Stars containing such simplexes are inconsistent stars and a star set with at least one inconsistent star is also said to be inconsistent. Oppositely, a star whose simplexes are consistent is said to be consistent and a star set is if all of its stars are consistent. The main idea of the algorithm is to refine the set of sites P while maintaining the set of stars S(P) until each star Sp in S(P) is composed of simplexes that are well shaped and well sized in the metric Gp, and until there are no more inconsistencies among the stars. Once a consistent star set is achieved (which is proven to happen), all the stars can be stitched into a single triangulation: a locally uniform anisotropic mesh that conforms to the specified metric field and offers guarantees on the quality of the simplexes. 4.4.1.2 Refinement Algorithm The simplest idea to refine a simplex τ in a star Sp is to insert a new site at the center cp(τ) of the Delaunay Gp-ball of τ. This technique is very common in Delaunay refinement algorithm as the Delaunay ball of the simplex is by construction not empty after the insertion of its center and thus the simplex cannot appear in the new Delaunay triangulation. This simple strategy may unfortunately lead to cascading occurrences of inconsistencies, for the same reason that the refinement of Delaunay meshes cannot remove slivers. An alternative strategy is devised, inspired by the work of [Li and Teng] to avoid slivers in isotropic meshes. The adaptation of [Li and Teng’s] techniques to the present algorithm and the development of the refinement algorithm are described in detail in the following. 4.4.1.3 Discussion on the Parameters The algorithm relies on various parameters: φ0, r0, ρ0, σ0, β, δ... It can be difficult, at first glance, to estimate their influence on the outcome in term of speed, number of vertices or quality of the produced mesh. We investigate each parameter independently. 4.4.1.3.1 Parameter φ0 The rule with the highest priority in the algorithm is the distortion rule, which bounds the maximal distortion in a simplex to be at most φ0, with the intent of increasing the odds of finding a valid solution when the Pick_valid procedure is called later in the algorithm. The value φ0 has naturally a strong impact over both the computation time and the final mesh: if φ0 is chosen too large, the Pick_valid procedure will be at first largely unsuccessful, causing many unsuccessful and costly insertions till the sampling increases and valid points are be found. Oppositely, if φ0 is chosen too
64
small, simplexes might be refined even if they already satisfy all other criteria including consistency which is pointless and costly and thus undesirable. To determine what is the optimal value forφ0, we look at the number of vertices in a final mesh, the number of calls to the Pick_valid procedure and their success percentage, and the computation time for various values of φ0. All the parameters except for φ0 are kept constant and the sizing constraint r0 is chosen large enough as to only be responsible for a negligible number of vertices added. The domain is a square of side 4 and centered on c = (0 , 0) endowed with the hyperbolic shock. Results are shown in Figure 4.19 (left). For the sake of completeness, we also consider a three-dimensional domain, a cube of side 3 and centered on c = {1.5, 1.5, 1.5}, endowed with a unidimensional shock metric field. Since the goal is to compare the influence of φ0 for the refinement of cells, we disable the refinement of surface stars and construct a pure volume mesh. Results can be found in Figure 4.19 (right). These experiments provide a lot of interesting and unexpected information: • • •
The success percentage of the Pick_valid procedure increases when φ0 decreases, as the theory predicts. However, a low value of φ0 will very quickly be responsible for the insertion of an exceptionally large number of vertices (red curves). The final number of points is greater whenever φ0 is used than when it is not (blue curves). However small φ0 is, there are still inconsistencies that appear (the teal curves show the number of vertices inserted to solve inconsistencies), proving that the Pick_valid procedure is a necessary part of the algorithm. Even more interestingly, they add a relatively constant number of vertices, indicating that the distortion rules did not help.
Figure 4.19
Influence of the Parameter ψ0 in a 2D (shown on the left) and 3D Domain (shown on the right) - (Courtesy of [Labbe])
4.4.1.3.2 Parameters r0 and ρ0 The values of r0 (size criterion) and ρ0 (shape criterion) naturally affect the number of vertices as additional vertices must be inserted to satisfy these criteria. In isotropic mesh generation, the number of vertices follows roughly the square of the sizing field in 2D and the cube in 3D: if the sizing field is divided by 2, there are 4 times more vertices in 2D and 8 times more vertices in 3D. As explained before, the size parameter is usually left at 1 as the size of the elements can be directly encoded in the metric. We exceptionally scale r0 instead of the metric field in this experiment for the purpose of clarity. This relation is somewhat similar in the case of anisotropic mesh generation. Here
65
again, the number of points added by the inconsistency queue (that can be roughly computed as the difference of the green and blue curve) is more or less constant, even when the number of points inserted for the size rule is important. The shape parameter ρ0 and its corresponding rule ensure that all simplexes satisfy shape requirements, which is both useful in itself but also improve the odds of finding valid solutions in the Pick_valid procedure. This parameter has, in practice, very little influence and the corresponding rule is very rarely called upon. This can be seen as a consequence from the fact that Rules 1 and 2 (distortion and size) insert the circumcenter, an already appropriate choice to create meshes of good quality. 4.4.1.3.3 Parameters β and δ Contrary to the parameters φ0 and ρ0, who serve to satisfy quality requirements on simplexes ahead of Pick_valid procedure calls, the parameters β and δ are directly involved in the Pick_valid procedure. Indeed, the parameter β controls the size of acceptable inconsistencies and δ determines the size of the picking region Pp(τ ) as its radius is given by δrp(τ ). We use a cubic domain of side 1, centered on (0.5, 0.5, 0.5) and endowed with a unidimensional shock metric field with maximal anisotropy 3. The number of Pick_valid tries is fixed at 60 but the value of δ varies. We investigate the final number of vertices in the mesh and the quality of the simplices. For planar and surface domains, the quality is estimated with the formula of [Zhong et al.]103:
Q = 4√3
A ph
Eq. 4.7 where A is the area of the triangle, p the perimeter and h the longest edge (all computed in the metric). For cells, we use the quality estimation of [Frey and George]104
V2 Q = 216√3 3 𝐴Σ
Eq, 4.8 where V is the volume of the tetrahedron, and A∑ the sum of the areas of the four facets (all compute in the metric). Both these quality measures live between 0 and 1, with 1 signaling the highest quality. Results are detailed in Table 4.2. As expected, more solutions are available in the pick valid algorithm when the picking region is enlarged, resulting in smaller meshes. However, the metric is followed more loosely and the simplexes of the meshes have lower quality. Note that in extreme cases –δ close
Table 4.2 Comparison of the number of vertices and quality of the mesh for different values of δ - (Courtesy of [Labbe]) Zhong, Z., Guo, X., Wang, W., Lévy, B., Sun, F., Liu, Y., and Mao, W. Particle-based anisotropic surface meshing. ACM Trans. Graph. 32, 4 (2013). 104 Frey, P., and George, P. L. Mesh generation: Application to finite elements. Hermes Science, 2008. 103
66
to 1 – the final number of vertices starts to increase again, as the refinement points are often not creating satisfying elements with respect to other criteria, such as the shape. The parameter β is assigned the value 2.5 by default, but changing this value (within 1 to 5) has barely any influence on the outcome. 4.4.1.3.4 Parameters σ0 The parameter σ0 controls the maximal slivery of the simplexes. A majority of inconsistencies do not stem from slivery quasi-cosphericities, and thus this parameter has little influence on the outcome. By increasing its value, one simply trades the removal of inconsistencies for the removal of silvers, but the result stays the same. Furthermore, the slivery and inconsistent queue both rely on the Pick_valid procedure to insert a point and thus there is no difference in the running time of the algorithm either. 4.4.1.4 Results and Limitations 4.4.1.4.1 Uniform Metric Fields A uniform metric field associates to any point of the domain the same metric. Note that since all the metrics are identical, neighboring stars necessarily have compatible connectivity and there can be no inconsistencies. It should be noted that in the setting of uniform metric fields, an anisotropic mesh can simply be obtained by stretching the domain through the usual metric transformation (the square root of the metric), meshing isotopically in the metric space and finally stretching back the constructed isotropic Delaunay triangulation to obtain an anisotropic Delaunay triangulation which is in fact what is done in each star, but for different metrics in the general case. This setting is handled without any issue by the algorithm and our implementation, whether in the setting of planar, surface or volume domains: the algorithm terminates, all criteria are honored and we obtain edges that have a length close to 1. As the algorithm perform most computations in the metric space where triangulations are isotropic the algorithm is extremely robust and can handle anisotropy ratios up to 1017; numerical issues appear in the transformations for higher ratios, which could easily be fixed by changing number types (but no one realistically deals with such ratios). 4.4.1.4.2 Shock-Based Metric Fields on Planar Domains We depart from uniform metric fields and consider a planar domain a square endowed with various metric fields. These artificial metric fields are chosen to exhibit different phenomena: Straight shock - A region of high-anisotropy along a relatively constant direction in between two regions of lower anisotropy. This corresponds to a change in the eigenvalues of the metric. Waves along a (straight) shore is a good illustration of such phenomenon. Rotational anisotropy - A region where the anisotropy ratio is constant, but the direction of the stretching is changing. This corresponds to a change in the eigenvectors of the metric. We will sometimes say that the metric is rotating to describe such regions. These two phenomena are the primal blocks and can be combined and scaled to form any more complex or real-world metric fields. 4.4.1.4.3 Starred Our first example uses the Starred metric field, detailed in Appendix A of [Labbe]105. The anisotropy of this metric field varies between 1 and 10. The Starred metric field possesses long compared to the prescribed size of the elements – regions of straight anisotropy, and regions where the metric field is rotating (and the anisotropy ratio is lower) in between, thus providing a good first example of an arbitrary metric field. The domain is a square of side 10, centered on the origin. Figure 4.20- A square of side 10 and centered on the origin, endowed with the Starred metric field (left). The final mesh is composed of 47126 vertices and 94366 triangles. On the right, a zoom on one of the rotating regions. The algorithm terminates without any issue and the size and shape criteria are solved 105
Mael Rouxel-Labbe, “Anisotropic mesh generation”, Université Côte d’Azur, 2016.
67
quickly (4499 vertices are needed). However, the resolution of inconsistencies is difficult and requires around 40000 additional vertices. While regions where the metric field is rotating are clearly suffering from inconsistencies, regions where the metric field is straight fare only slightly better and also require many vertex insertions to solve inconsistencies.
Figure 4.20
A square of side 10 and centered on the origin, endowed with the “Starred” metric field
(left) - (Courtesy of [Labbe])
4.4.1.4.4 Hyperbolic The hyperbolic shock metric field has already been used several times in previous sections and its definition is detailed. This metric field is characterized by an anisotropy ratio that varies between 1 and 15 and is interesting as its anisotropy ratio does not vary (too much) along the shock, despite the shock being shaped like a sinusoidal curve. We shall refer to the regions of the shock where the
Figure 4.21
Anisotropic Triangulation of a Rectangle Endowed with the Hyperbolic Shock Metric Field - (Courtesy of [Labbe])
68
eigenvectors change rapidly as the “turns”. In these turns, the process of generating a good anisotropic mesh is difficult as the eigenvectors of the metrics are changing rapidly. As larger meshes have already been produced in other sections and very dense refinement was observed at the turns, we here zoom on one of these regions. The result is shown in Figure 4.21. The size and shape constraints are quickly satisfied and only require around 414 vertices, but the final mesh is composed of 4621 vertices. Indeed, the resolution of inconsistencies is difficult especially within the shock and many vertices are required to obtain a consistent mesh despite a relatively low maximum anisotropy ratio. Consequently, the metric field is honored (and consequently the sizing field is too), but simplexes are often much smaller and then resolution of inconsistencies much longer than what we hoped for. 4.4.1.4.5 Swirl The Swirl metric field aims to represent a whirling phenomenon. Figure 4.22 A square of side 6 and centered on the origin, Contrary to the two previous endowed with the “Swirl” metric field - (Courtesy of Labbé et al.) metric fields, the Swirl metric field has a relatively constant anisotropy ratio and is rotating almost everywhere. Figure 4.22 shows the mesh obtained by our implementation for a square of side 6 endowed with this metric field. The result exhibits the same issues as in the previous experiments: the resolution of inconsistencies is difficult and many vertices are required to solve inconsistencies after all other criteria are satisfied. 4.4.1.4.6 Curvature-Based Metrics Fields on Surfaces We now consider the setting of domains embedded in R3, and the generation of pure surface meshes. The metric field induced by the curvature of the domain is known to prescribe an anisotropy that is asymptotically optimal - a mesh whose elements follow this metric field will require the lowest number of element (out of all the meshes) to achieve a given approximation of the domain. It is thus interesting to observe the results produced by our algorithm for this specific metric field. 4.4.1.4.7 Optimization Optimization is often used to improve the quality of a triangulation. Centroid Voronoi tessellations are Voronoi diagrams whose generators are also the centroids (centers of mass) of their respective cells. The famous Lloyd algorithm106 iteratively moves the seeds to the center of mass of their respective cell and recomputed the Voronoi diagram of this new seed set. We approximate the Riemannian Voronoi center of mass of a cell V with the following formula:
106
S. Lloyd, Least squares quantization in pcm, IEEE Trans. Inf. Theo. 28 (2006) 129–137.
69
cg =
∑i ci |t i |gi ∑i|t i |gi
Eq. 4.9 where |ti|gi is the area of the triangle ti in the metric gi and the ti make a partition of V. The canvas conveniently provides this decomposition of a geodesic Voronoi cell in small triangles, making the approximation of cg accurate. The formula in Eq. 4.9 does not extend to surfaces as the result of the weighted sum might not lie on the domain. In that setting, we use a process similar to [Wang et al.]107. As its Euclidean counterpart, this algorithm comes with no guarantees (not even for termination) but works well in practice. In Figure 4.23, the initial SRDT of 4000 seeds has been optimized with 100 iterations. The metric field is well captured with few elements, especially in the rotational region.
Figure 4.23 The optimized SRDT of 4000 seeds in a planar domain endowed with a hyperbolic shock induced metric field (left). On the right, a zoom on a rotational region of the metric field shows the difference between pre- (above) and post- (bottom) optimization – (Courtesy of Labbé et al.)
4.4.1.5 Discrete Riemannian Voronoi Diagrams Several authors have considered Voronoi diagrams based on anisotropic distances to obtain triangulations adapted to an anisotropic metric field. These authors hoped to build upon the wellestablished concepts of the Euclidean Voronoi diagram and its dual structure, the Delaunay triangulation, for which many theoretical and practical results are known. The computation of geodesic path lengths in any domain is a difficult task as there is generally no closed form available. The wide range of domain can be shrunk, through mesh generation, to consider only piecewise-linear X. Wang, X. Ying, Y.-J. Liu, S.-Q. Xin, W. Wang, X. Gu, W. Mueller-Wittig, Y. He, Intrinsic computation of centroidal Voronoi tessellation (CVT) on meshes, Computer-Aided Design 58 (2015) 51–61. 107
70
domains. Even in this simpler setting, the computation of geodesic distances and paths is still a complex problem to which much work has been dedicated in the last decades. Despite many studies, geodesic distances still cannot be obtained exactly for most domains endowed with an arbitrary metric field. Nevertheless, we introduce a discrete structure that is, under some conditions, combinatorically equivalent to the Riemannian Voronoi diagram and whose duals are triangulations. 4.4.1.5.1 Advantages Over Isotropic Canvasses To ensure that the nerve of the Riemannian Voronoi diagram is captured in the case of an isotropic triangulation used as canvas, the (uniform) sizing field of the canvas must be small enough such that Voronoi bisectors are clearly distinct. As the anisotropy ratio increases, Voronoi cells become thinner and the number of canvas vertices required to capture the nerve rapidly grows (Figure 4.24, left and center108). On the other hand, the placement of vertices in an anisotropic canvas is by construction not uniform and does not suffer from the same issue: as the anisotropy of the metric field grows, Voronoi cells and canvas simplices become thinner in tandem. The number of canvas vertices in a Voronoi cell is thus relatively constant regardless of the anisotropy. As the star set satisfies a sizing field of 0.1r0, the canvas edges are roughly 10 times smaller than the distance between seeds. Consequently, the canvas is composed of approximately 10n more vertices than seeds, with n the intrinsic dimension of the domain. The use of an anisotropic canvas greatly decreases the computational time as the number of vertices in the canvas is drastically reduced, without any change in the extracted nerve.
Figure 4.24
Isotropic and Anisotropic Canvas Sampling - (Courtesy of [Labbe])
4.4.1.5.2 Straight Riemannian Delaunay Triangulation In the case of an isotropic canvas, increasing the anisotropy of a cell increases the number of vertices required to properly capture it (left and middle). This is not the case if the canvas can be anisotropic (left and right). 108
71
Figure 4.25
Unit Sphere Endowed with the Hyperbolic Metric field - (Courtesy of [Labbe])
By definition, the Riemannian Voronoi diagram captures the metric field more accurately than other methods that typically only consider the metric at the vertices. This additional input of information allows us to construct curved Riemannian Delaunay triangulations, but also has a positive influence on the straight realization of the diagram. Figure 4.25 shows the different structures involved in our algorithm during the generation of an anisotropic meshes for the sphere endowed with a hyperbolic shock metric field109. On the left is the canvas (an isotropic triangulation here); the middle sphere shows the discrete Riemannian Voronoi diagram computed upon this canvas; finally, the right picture shows the dual of the discrete diagram, an anisotropic triangulation. Contrary to the previous approaches introduced and investigated no over-refinement is observed, including in the regions where the eigenvectors of the metric field are rotating (where the shock turns). The final mesh has slightly fewer than 4000 vertices, which is the number of vertices that was required by our locally uniform anisotropic meshes to generate a mesh of a only small region of that domain. 4.4.1.5.3 Curved Riemannian Delaunay Triangulation The large amount of additional information that is provided by the canvas allows to construct curved Riemannian Delaunay triangulations, which have not been produced before. Figure 4.26 shows the discrete diagram and the curved Riemannian Delaunay triangulation for the Chair surface endowed with a curvature-
Figure 4.26 On the left, the discrete Riemannian Voronoi diagram of 1020 seeds on the “Chair” surface, with a curvature induced metric field; the edges of the curved Riemannian Delaunay triangulation are traced in black - (Courtesy of [Labbe])
The unit sphere endowed with the hyperbolic metric field (approximately 4000 vertices). Isotropic canvas (left), discrete Riemannian Voronoi diagram (center), and straight Riemannian Delaunay triangulation (right). 109
72
induced anisotropic metric field. In the computation of the curvature metric field, the value ǫ = 0.7 is used (see Section A.2.1 in Appendix A of [Labbe]110). The curvature of the simplexes is noticeable and the metric field is well captured with only few curved Riemannian simplexes. Comparatively, a straight dual would require more elements to obtain the same approximation Figure 4.27 shows the curved Riemannian Delaunay triangulation dual of the Riemannian Voronoi diagram for the hyperbolic shock metric field. We obtain an aesthetically pleasing curved mesh that conforms closely to the metric field.
Figure 4.27 Discrete Riemannian Voronoi Diagram (top) and Curved Riemannian Delaunay Triangulation (bottom) endowed with the Hyperbolic Shock Metric Field - (Courtesy of [Labbe]) 110
Mael Rouxel-Labbe, “Anisotropic mesh generation”, Université Côte d’Azur, 2016.
73
4.4.1.6 Conclusion We have presented an empirical study of the locally uniform anisotropic meshes framework, introduced by [Boissonnat, et al]111. During this study, we have introduced minor changes to the theory and provided a robust and generic implementation of the algorithm. While the algorithm is simple to understand, the computation speed of a naive implementation would be unreasonable. We presented an implementation of the algorithm that is both robust and fast, which is more difficult to achieve. The theoretical requirements are demanding, but in practice both the geodesic and straight edge duals require relatively few points to become embedded triangulations, even with nontrivial, highly distorted metric fields. The RVD and its duals are shown to be particularly well suited to capture the metric field in regions where it is both anisotropic and rotational. No preprocessing or smoothing of the metric field is required, a technique that is often used and results in noticeable loss of anisotropy in this type of region112.
Octree Decomposition In 2D this procedure can be viewed as a division of the domain into a collection of rectangles followed by a division of rectangles into triangles. A rectangle can be further subdivided into four new rectangles. For a rectangle that intersects the boundary, this subdivision can be repeated until a sufficiently fine resolution has been achieved. Rectangles that intersect the boundary and are sufficiently small are then replaced by a polygon consisting of the part of the rectangle lying inside the domain together with the part of the boundary that lies inside the rectangle. Figure 4.28 (a) shows a schematic that illustrates the concept of an Octree decomposition of the space around an airfoil. A further division of rectangles and boundary polygons into triangles creates a valid triangulation of the domain (see Figure 4.28 (b)). The concept generalizes in an obvious way to three dimensions although the cutting procedure at the boundaries becomes much more complicated. The main drawback of Octree based triangulation methods is their inability to match a prescribed surface triangulation since the surface triangulation arises as a byproduct of the volume meshing procedure. The size of the
(a)
(b) Figure 4.28
Converging of an Octree Decomposition Around an Airfoil
Boissonnat, J.-D., Wormser, C., and Yvinec, M. Locally uniform anisotropic meshing. Proceedings of the twenty-fourth annual symposium on Computational geometry (2008), ACM, pp. 270–277. 112 M. Rouxel-Labbé, M. Wintraeckenb, J.D. Boissonnat, “Discretized Riemannian Delaunay triangulations”, 25th International Meshing Roundtable (IMR25). 111
74
individual Octree components and hence the size of the tetrahedral elements in the near field can be tailored to match the variation in surface curvature. But the quality of elements adjacent to the boundary surface and likewise the quality of the surface triangulation can be very poor. This can be a considerable handicap since an accurate implementation of the boundary conditions often requires a good quality mesh near the boundary. For high Reynolds number Navier Stokes computations, which must capture the flow details inside thin boundary layers, the lack of a good quality mesh near a boundary causes considerable difficulties. One way to alleviate these problems is to build a good quality mesh in the near field by extrusion of hexahedra, prisms or tetrahedral off the boundary surface and then merge this extruded mesh with an Octree based mesh at a position that is some way off the boundary 113,114. It is best when creating an octree mesh to do the following: Perform volume meshing •
Improve the quality of the volume mesh using Edit Mesh options
•
Create prism layers for boundary layer near the walls
•
Improve the total mesh quality using Edit Mesh options.
The paper by [Mar´echal]115 presents advances
Figure 4.29
A close-up view of nasty cheese a well-known test-case featuring 30◦ dihedral angles – (Courtesy’s of [Mar´echal])
Karman SL, “SPLITFLOW: a 3-D unstructured Cartesian/prismatic grid CFD code for complex geometries”, AIAA 33rd aerospace sciences meeting, Reno, NV. AIAA paper 95-0853, 1995. 114 Shaw JA, Stokes S, Lucking MA, “The rapid and robust generation of efficient hybrid grids for rans simulations over complete aircraft”, International Journal Numeric Method Fluids 2003; 43:785–820. 115 Lo¨ıc Mar´echal, “Mesh Generation: Handling Sharp Features”, Gamma project, I.N.R.I.A., Rocquencourt, 78153 Le Chesnay, France. 113
75
made in terms of sharp angles meshing, non- manifold geometries, based on all-hexahedral mesh. An example showing sharp feature is revealed on Figure 4.29.
Unstructured Hexahedral Meshes It is possible, in principle, to cut up a triangle into three quadrilaterals by inserting an extra point at the triangle barycenter and an extra point at the mid-point of each edge. A similar division of a tetrahedron into four hexahedra is also possible. At first sight, this would appear to be a straightforward way to create unstructured quadrilateral or hexahedral meshes from 2D or 3D triangulations. In practice, the quality of the resulting meshes is generally very poor. Alternative ways to create unstructured hexahedral meshes have been based on paving techniques116 (essentially a moving front approach), Octree decomposition together with a means of merging, or snapping, the outermost Octree hexahedra to the boundary, or by making use of the medial axis in 2D, medial surface in 3D, to produce a type of multi-block decomposition that is more amenable to meshing by paving117. The possibility of automatically generating unstructured hexahedral meshes is tantalizing and offers the prospect of providing automated mesh generation suitable for solid mechanics computations using finite element methods as well as meshes suitable for the computation of the RANS equations. Much depends on the mesh quality near solid boundaries and it remains to be seen whether any of the current approaches to hexahedral mesh generation can provide the required
Hexahedral
Hybrid
Single Block
Tetrahedral/
(Fully Structurd)
Hexahedral
Multiblock (contiguous)
Multiblock Overset (Chimera
Tetrahedral/ Primatic Cartesian (Hexahedral +assorted Polyhedral
Tetrahedral Octree Decompostion
Advancing Front
Delany
Fully unstructured Hexahedral Figure 4.30
Hierarchy of Meshing Methodologies
Zhu JZ, Zienkiewicz OC, Hinton E, Wu J, “A new approach to the development of automatic quadrilateral Mesh generation”, Inter J Number Meth Eng. 1991; 32:849–66. 117 Sheehy, DJ, Armstrong CG, Robinson DJ,”Computing the medial surface of a solid from a domain Delaunay triangulation”, Proceedings of the ACM symposium on solid modeling and applications, Salt Lake City, UT, New York: ACM Press; 1995. p. 201–12. 116
76
flexibility in terms of geometry handled and the necessary quality in terms of mesh orthogonality near solid boundaries. Figure 4.30. displays different methodologies which currently available in mesh generation engines. Conversion of Triangular to Quadrilateral Meshes (2D) Another simple strategy is developing by [Lyra & de Carvalho]118 where quadrilateral mesh generated from triangular meshes. Unstructured quadrilateral meshes can be automatically generated in several different ways and do not impose serious topological restrictions on the meshes, being appropriated to deal with complex geometries, naturally allowing local non-uniform mesh refinement. Several different approaches have been proposed to generate unstructured quadrilateral meshes. These methodologies can be divided into two basic groups: ➢ those that try to generate quadrilaterals directly, ➢ and those that convert a previously generated mesh of triangles into a mesh of quadrilaterals The conversion of triangular meshes is particularly attractive because these meshes can inherit the properties of the triangular meshes, whose generators are very well developed and once it is always possible to build a triangular mesh over any arbitrary 2D domain, quadrilateral meshes can be constructed as general as the triangular ones. It also allows the use of any triangular mesh generator as a “black box”. As we generate a quadrilateral mesh using the conversion strategy, the quadrilateral mesh inherits the characteristics of the initial triangulation. For both, iso and anisotropic meshes this strategy consists of four main steps, as presented . 1. Generate a triangular mesh (either iso or anisotropic); 2. Remove an edge between two adjacent triangles, to forma quadrilateral; 3. Split all elements in the intermediate mixed mesh(triangles into three quadrilaterals and quadrilaterals into four quadrilaterals); 4. Perform some post processing steps in order to enhance mesh quality. The standard strategy of merging triangles into quadrilaterals consists in eliminating a common edge that belongs to two adjacent triangles. Following the work done by [Xie and Ramaekers (1994)] and [Alquati and Groehs (1995)], our mesh generator is such that it refrains from merging triangles that would form a non-convex quadrilateral. Besides, for anisotropic meshes, the merging process will remove a common edge between two adjacent triangles, only if the two quadrilaterals to be created satisfy a quality criteria which is controlled by two geometric parameters. The adopted procedure generates a quadrilateral mesh with edges that are approximately half of those of the corresponding triangular elements and usually this is not a serious concern, since the user can generate a coarser
Paulo Roberto M. Lyra, Darlan Karlo E. de Carvalho, “A Computational Methodology for Automatic TwoDimensional Anisotropic Mesh Generation and Adaptation”, Methodology for Automatic Two-Dimensional Anisotropic Mesh Generation and Adaptation. 118
77
initial triangulation to obtain the desired mesh density. The four steps involved in the quadrilateral mesh generation can be seen in Figure 4.31 (1-4).
(1) Initial triangulation
(3) Mesh non-optimized
Figure 4.31
(2) Intermediate mesh
(4) Final quadrilateral mesh
Quadrilateral Mesh Generation
Overset Grids There are several variants of multi-block depending on whether or not continuity of mesh lines is maintained across the block boundaries. Overset methods represent one extreme where no attempt is made to match meshes from neighboring blocks. Figure 4.32 shows a combination of two overset meshes, an O-mesh around an airfoil plus an H-mesh for the far field. First suggested by [Atta]119 the
119
Atta E. Component–adaptive grid interfacing. AIAA19th aerospace sciences meeting. AIAA paper 81-0382.
78
overset approach was extensively developed by [Benek et al.]120 with later contributions by [Chesshire and Henshaw]121. The lack of any constraint at the block boundaries means that mesh generation for the individual blocks is much easier. In particular, there is no a priori need to create block interfaces and this advantage has facilitated the early application of the overset approach to complicated geometries. Another advantage of permitting such a loose connection between neighboring meshes is the possibility of treating moving body problems (e.g. store separation). The penalty for these advantages lies in the need to transfer information between neighboring meshes. This requires a means of determining an appropriate Figure 4.32 Overset Mesh Combination overlap region and the development of interpolation formulae to ensure accurate data transfer. Overset meshes are also known as Chimera or overlapping meshes. An overset mesh typically containing a body of interest such as a boat or a gear, superimposed on a background mesh containing the surrounding geometry. The data is interpolated between them122. This approach allows complex motion and moving parts to be easily set up and simulated. Overset meshes typically involve a background mesh adapted to the environment and one or more overset grids attached to bodies, overlapping with the background mesh. Multiple overlapping overset regions are also possible, expanding the potential applications of this technology. Data interpolation occurs between the grids, which can move with respect to one another. They are most useful Figure 4.33 Two Counter-Rotating Objects Embedded in Two in simulating multiple or moving Overset Regions with Background Mesh – (Courtesy of Siemens) bodies, as well as parametric studies Benek JA, Buning PG, Steger JL. “A 3-D Chimera grid embedding technique”. AIAA 7th CFD conference, Cincinnati, OH. AIAA paper 85-1523, 1985. 121 Chesshire G, Henshaw WD,”Composite overlapping meshes for the solution of partial differential equations.” Journal of Computational Phys 1990; 90:1–64. 122 Siemens PLM Software www.siemens.com/plm, 2016. 120
79
and optimization analyses. By allowing the overset body to move and also be replaced as many times as needed with different geometry, this technology truly brings multidisciplinary design exploration to the fingertips of engineers and designers. Composite Grids
Cartesian Grids Background and Cartesian Grid Origins Cartesian grids have been utilized in solving a variety of CFD problems from potential flows to Navier-Stokes equations123. Cartesian grids consist of a collection of non-overlapping, connected control volumes with coordinate aligned edges. Thus, the edge (or face in three dimensions) normal for all complete cells are aligned with one of the coordinate directions. Figure 4.34 shows a typical two-dimensional Cartesian grid around a curved surface. Cartesian gridding techniques have become the focus of recent research due to their ability to easily handle complex geometries in the grid generation phase. The ease with which higher order schemes can be applied and the natural connection between the Figure 4.34 Example of Cartesian Grid Near grid refinement techniques and multigrid Curved Surface – (Courtesy of NASA Ames) acceleration schemes. The difficulties in using Cartesian grids arise from the fact that the control volumes adjacent to the surfaces are not usually aligned with the surfaces and thus special techniques need to be employed to handle the non-Cartesian (cut or split) cells in these regions. Cut cells are created when the intersection of the Cartesian cell and the solid surface results in one computational volume with only a fraction of the original volume and possibly non-Cartesian aligned edges, see Figure 4.35 (a). Split cells are created when the intersection of the Cartesian cell and the solid surface results in two or more computational volumes which might have non-Cartesian aligned edges, see Figure 4.35 (b).
(a) Cut 1 Figure 4.35
(b) Cut 2
Solid Surface Over-Layer Cartesian Cell and Resulting Cut and Split Cell – (Courtesy of NASA Ames)
Stephen M. Ruffin, NASA Ames Research Center in coordination with Georgia Institute of Technology, “GSRP/David Marshall: Fully Automated Cartesian Grid CFD Application for MDO in High Speed Flows”, 2003. 123
80
The original use of Cartesian grids involved solving the 2D full potential equation by [Purvis and Burkhalter]124, followed shortly afterwards by [Wedan and South]125, in which a non-body-oriented structured grid was created on which the full potential equation was solved. Their solution strategy was to use finite volume techniques in order to more easily handle the computational cells that were intersected by the solid surface. Additionally, they used linear approximations in the cut cells for the reconstruction of the wall boundary conditions which provided a simple algorithm for implementation and preserved the structure of their coefficient matrix during the solution iteration so that no extra computational costs were incurred for the cut cells. However, this did not preserve the actual body curvature and also only provided a linear approximation to the actual surface lengths and area for the cut cells, and thus could not exactly model curved surfaces. Also, little mention was made of any attempts at cell refinement to more accurately capture the surface geometry and flow features. Earlier, [Clarke et al.]126 used Cartesian grids to solve the two-dimension Euler equations (again on non-grid aligned surfaces). They attempted to more accurately model the solid surface boundary conditions by utilizing the local surface curvature in reconstructing the wall boundary conditions. They also provided more accurate modeling of the cut cell lengths and areas by using the actual surface geometry in their calculations and not linear approximations. Additionally, they noted that clustering was needed in certain critical regions in order to produce accurate results, and this was achieved by clustering entire grid lines. Cut cells that were too small (less than Figure 4.36 Example of Merge Cell Creation – (Courtesy of NASA Ames) 50% of the original cell size) were merged with neighbor cells in order to avoid time stepping problems associated with very small computational cells. [Gaffney and Hassan]127 extended this research to 3D. Figure 4.36 demonstrates the case of cell merging. Cartesian Grids Schemes While the majority of research into Cartesian grids has focused on solving the Euler equations in 2-3 D, there has been some efforts into the utilization of Cartesian grids to solve the Navier-Stokes equations. These efforts have focused on solving the full N-S equations using either the Adaptive Mesh Refinement (AMR), Immersed Boundary, Volume-of-Fluid, Reconstruction, Cut Cell Based techniques, or Coupling Body-Fitted Grid solutions of the Navier-Stokes equations with a Cartesian background grid. The Grid Coupling technique has its foundations in the idea of the viscous/inviscid coupling. Cartesian grids do not, in general, provide grids that are body aligned, however some work has been performed applying the thin-layer techniques to Cartesian grids. Hybrid Methods do exist which couple a body oriented grid solving the thin-layer Navier-Stokes equations with a background J. W. Purvis and J. E. Burkhalter. Prediction of Critical Mach Number for Store Configurations. AIAA J.,1979. B. Wedan and J. C. South, Jr. A Method for Solving the Transonic Full-Potential Equation for General Configurations. In AIAA 6th Computational Fluid Dynamics Conference, Danvers, MA, July 1983. AIAA-83-1889. 126 D. K. Clarke, M.D. Salas, and H. A. Hassan. Euler Calculations for Multi element Airfoils Using Cartesian Grids. AIAA Journal, 24(3):353-358, March 1986. 127 R. L. Gaffney, H. A. Hassan, and M.D. Salas. Euler Calculations for Wings Using Cartesian Grids. AIAA 25th Aerospace Sciences Meeting, Reno, NV, January 1987. AIAA-87-0356. 124 125
81
Cartesian grid128. 4.8.2.1 Adaptive Mesh Refinement [Berger and LeVeque]129 addressed several deficiencies that existed in the established uniform grid methodologies. First, they applied the concept of Adaptive Mesh Refinement (AMR) in order to improve the accuracy in critical regions without adversely affecting the efficiency of the numerical integration scheme. The use of AMR effectively allowed the clustering of blocks of computational grids as the solution process evolved only in the region that they were needed (and not clustering entire grid lines), by using Richardson-type extrapolation error estimates to identify regions of large errors and adding grid blocks in those regions. An example of AMR is Figure 4.37 which represents a simple adapted grid for a supersonic wedge flow with four levels of adaption. As can be seen in the figure, there are more control volumes where gradients are to be expected, specifically along the surface to capture the geometry and along the oblique shock. In regions with small gradients, there is a lower density of control volumes. Also notice that in this figure there is at most a 2:1 ratio at the refinement interface, which is typical of most A MR schemes, in order to promote stability in the numerical schemes. One problem with [Berger and LeVeque's] original implementation of AMR on Cartesian grids was the problem of state variable conservation during the AMR stages. They carefully constructed conservative schemes for the inter-grid transfer to address the problem. They also used the idea Figure 4.37 Example Adaptive Grid for Supersonic Wedge Flow – of wave propagation and (Courtesy of NASA Ames) directional differencing in order to increase the stability near the small boundary cells. This helped keep the CFL of the boundary cells reasonably close to the CFL of the flow cells and allowed larger time steps to be taken with the solver remaining stable. Several researchers have extended [Berger and LeVeque's] research into areas such as multigrid Cartesian grids, higher accuracy flow solvers using more sophisticated flux approximations, time-accurate unsteady flows, and a front tracking AMR scheme that attempted to track the discontinuities (such as shocks) as the solution evolved in order to provide more accuracy in the refined mesh calculations. According to recent investigation by [Hiroshi Abe ]130, Cartesian grid method fall into two categories with the demand of accurate solutions. One keeps its structured grid nature and introduces embedding structured sub grids within the underlying coarse structured grids. Adaptive Mesh Refinement (AMR) is one of them. Figure 4.38 (a) shows an example of AMR in two dimension. The intersected cells by a circle in the underlying coarse grids are tagged in blue. The R. L. Meakin. On Adaptive Refinement and Overset Structured Grids. 13th AIAA Computational Fluid Dynamics Conference, CO, 1997. 129 M. J. Berger and R. J. LeVeque. An Adaptive Cartesian Mesh Algorithm for the Euler Equations in Arbitrary Geometries. 9th AIAA Computational Fluid Dynamics Conference, Buffalo, NY, June 1989. AIAA-89-1930-CP. 130 Hiroshi Abe, “Blocked Adaptive Cartesian Grid FD-TD Method for Electromagnetic Field with Complex Geometries”, International Conference on Modeling and Simulation Technology, Tokyo, JAPAN, 2011. 128
82
blue-tagged cells are to be refined. In the AMR procedure, several embedded rectangle patches are defined so as to contain the blue tagged cells. Then, the embedded rectangle patch areas are refined.
(a) Intersecting meshes with a circle are tagged (blue) Figure 4.38
(b) 2D case of Adaptive Cartesian grid method
Schematic image of Adaptive Mesh Refinement – (Courtesy of Hiroshi Abe)
The other considers the Cartesian mesh as an unstructured collection of h-refined meshes. The data structure is not the same as structured grids but the same as unstructured grids. Adaptive Cartesian grid method was introduced as an unstructured Cartesian grid method and has shown the great
Figure 4.39
Pressure Contours in 2D Backward Step
83
success in simulating complex geometries. Figure 4.38 (a) shows a case of two dimensional adaptive Cartesian grid method. Beginning with a root cell covering whole domain, the intersected cells by the circle are recursively bisected. This simple procedure finally gives Figure 4.38 (b). Figure 4.40 Flow Around a F16XL Fighter Jet using Cut Cells and AMR – Further examples (Courtesy of M. J. Aftosmis, M. J. Berger, J. E. Melton) provided a 2D backward step (see Figure 4.39), and 3D F16XL fighter jet using cut cells and AMR. (see Figure 4.40). 4.8.2.2 Immersed Boundary Methods The immersed boundary method was originally developed by [Peskin]131-132 for heart valve modeling using the Navier-Stokes equations in two dimensions. The heart valves were modeled as flexible surfaces that can propagate with the flow, subject to certain limitations such as hinge points or rigid regions on the surfaces. Instead of remeshing the computational domain as the surface is propagated, the cells that contain the surface have a body force added to their momentum equations that represents the reactive force that the body is applying to the fluid in response to the fluid surface pressure and shear stress. [Goldstein et al.]133 applied [Peskin's] work to incompressible, solid body flows using a force feedback approach. In this formulation, the surface force takes the form of a feedback loop function that acts on the surface cell to bring the surface velocity to zero by adjusting the applied forces appropriately. This approach requires an extremely small time step (CFL around 1 -3) in order for it to remain stable. In order to more accurately determine the appropriate surface forces to add to the momentum equations, [Fadlun et al.]134 developed a second-order boundary interpolation scheme for three dimensional incompressible flows by using linear interpolation to reconstruct the state information at the surface. This approach resulted in the use of larger time steps (CFL around 1.5) and better accuracy at the surface. Further advances by [Lai and Peskin]135 developed second-order methods for moving membranes. Additionally, [Kim et al.]136 developed a second-order method with both momentum and mass sources in order to improve the overall accuracy of their results. While these schemes handle the Navier-Stokes equations on Cartesian grids, they all suffer from numerical C. S. Peskin. Numerical Analysis of Blood Flow in the Heart. Journal of Computational Physics, 1977. C. S. Peskin. The Fluid Dynamics of Heart Valves: Experimental, Theoretical, and Computational Methods. Annual Review of Fluid Mechanics, 14:235-259, 1982. 133 D. Goldstein, R. Handler, and L. Sirovich. Modeling a No-Slip Flow Boundary with an External Force Field. Journal of Computational Physics, 105(2):354-366, 1993. 134 E. A Fadlun, R. Verzicco, P. Orlandi, and J. Mohd-Yusof. Combined Immersed Boundary Finite-Difference Methods for Three-Dimensional Complex. Journal of Computational Physics, 161(1):35-60, 2000. 135 M.-C. Lai and C. S. Peskin. An Immersed Boundary Method with Formal Second Order Accuracy and Reduced Numerical Viscosity. Journal of Computational Physics, 160(12):705-719, 2000. 136 J. Kim, K. Kim, and H. Choi. An Immersed-Boundary Finite-Volume Method for Simulations of Flow in Complex Geometries. Journal of Computational Physics, 171(1):132-150, 2001. 131 132
84
stability problems that typically require numerical diffusion. Also, the surface is not sharply resolved, and is typically smeared between 2 or 3 cells. This can cause problems when flow details are needed near the surface. 4.8.2.3 Volume of Fluid Methods Another approach to solving the Navier-Stokes equations on Cartesian grids is the volume of fluid method. In this method, a scalar transport equation is solved in addition to the Navier-Stokes equations. The scalar is a value between 0 and 1 that represents the volume fraction that the fluid (or gas) occupies in that cell. The typical use of this scheme is free surface flows, where the scalar represents the amount of the cell that the fluid occupies, and interfacial flows, where the scalar represents the volume fraction that a species occupies in the cell. [Hirt and Nichols]137 originally developed this method as part of an incompressible free-surface Navier-Stokes solver. In order to retain the incompressible invariance in the transport equation, strict mass conservation was required of the numerical solver. They also used a first order accurate surface reconstruction technique which causes problems resolving the interface boundaries. The volume of fluid schemes typically work well when the interface curvature is small with respect to the surface modeling. Otherwise, artificial discontinuities can develop as well as the inability to resolve the small scale features at the interfaces. Additionally, without accurate propagation of the scalar transport equation and sophisticated schemes to resolve the interface boundaries, artificial mixing can occur. 4.8.2.4 Reconstruction Schemes Another class of schemes used to solve the Navier-Stokes equations on Cartesian grids are the reconstruction based schemes. These have been proposed by [Ye et al.]138-139 and [Majumdar et al.]140. These schemes are all based around the idea of interpolating the state information to the nodes in the computational domain around the surface. [Ye et al.] have developed a two-dimensional incompressible Navier-Stokes equation solver. The solver use the cell merging technique to eliminate any surface cells that are smaller than 50% of their full size. Then, the state information for the faces of the new cell are found by utilizing a linear-quadratic two-dimensional interpolation from the surrounding cells. This technique results in a slow convergence of the pressure Poisson equation and requires acceleration techniques. This technique has been extended to moving boundaries. [Majumdar et al.] have developed two-dimensional, turbulent Reynolds Averaged Navier-Stokes solver on uniform Cartesian grids. This solver uses interpolation polynomials in one and two dimensions to reconstruct the state of the cells that are inside the body. Thus, the solution process is performed over uniform cells at the surface. The interpolation process can cause numerical instabilities due to the negative coefficients that can arise with certain interpolation polynomials. 4.8.2.5 Cut Cell Based Methods [Fryrnier et al.]141 developed the first work in the application of the full Navier-Stokes equations on Cartesian grids using the cut cell approach. The solution procedure was a straight-forward finiteC. W. Hirt and B. D. Nichols. Volume of Fluid (VOF) Method for Dynamics of Free Boundaries. Journal of Computational Physics, 39(1):201-221, 1981. 138 T. Ye, R. Mittal, H. S. Udaykumar, and W. Shyy. An Accurate Cartesian Grid Method for Viscous Incompressible Flows with Complex Immersed Boundaries. Journal of Computational Physics, 156(2):209-240, 1999. 139 T. Ye, R. R. Mittal, H. S. Udaykumar, and W. Shyy. A Cartesian Grid Method for Viscous Incompressible Flows with Complex Immersed Boundaries. In AIAA 3rd Weakly Ionized Gases Workshop, Norfolk, VA, November 1999. 140 S. Majumdar, G. Iaccarino, and P. Durbin. RANS Solvers with Adaptive Structured Boundary Non-Conforming Grids. Annual Research Briefs 208782, Center for Turbulence Research, Stanford University, Stanford, CA, 2001. 141 P. D. Fryrnier, Jr., H. A. Hassan, and M.D. Salas. Navier-Stokes Calculations Using Cartesian Grids: I. Laminar Flows. AIAA Journal, 26(10):1181-1188, October 1988. 137
85
volume approach with the Cartesian grids clustered using grid line. Their results demonstrated strong dependencies on the smoothness of the surface grid where non-smooth surface grids produced non-smooth skin-friction and surface pressure values. A large number of standard viscous flux formulations for cut cell based schemes were analyzed to ascertain their accuracy and positivity characteristics. These viscous flux formulations fell into two categories: 1. Green-Gauss reconstructions where the divergence theorem was applied to cells neighboring the face that the flux was being calculated to build the integration path, 2. polynomial based reconstructions that used a Lagrange polynomial and a set of support cells to interpolate the state variables where they were needed with the polynomial being differentiated to obtain the needed gradients. This research focused on the accuracy of the various formulations via a standard Taylor series approximation analysis and on the positivity of the formulations. The positivity is a measure of how well the discretization satisfies the local maximum Figure 4.41 Example Chimera Grid Near Curved Surface principle that holds for all homogeneous, (Courtesy of NASA Ames) second order partial differential equations (PDEs). The local maximum principle simply states that the solution to a homogeneous, second order PDE at one point is bounded by the values of its neighbors. It is a statement of the diffusive nature of second order PDEs, and thus it is a necessary requirement for any discretization of a homogeneous, second order PDE. The results of this effort were that all of the schemes demonstrated (to some degree) a competition between the accuracy of the scheme and the viscous stencil positivity for non-uniform cells, i.e. any attempt to improve the accuracy/positivity adversely effected the resulting positivity/accuracy. The resulting numerical analysis was performed for low to moderate Reynolds number flows. Cases where the surface was predominantly aligned with the coordinate directions showed excellent agreement with theoretical values, but when the body was not aligned with the coordinate directions (thus, the surface had cut cells of varying volume fractions of the uncut cells) large oscillations occurred in the results due to the sensitivity of the viscous stencil to the grid smoothness (for both cut cells and coarse/fine cell interfaces). Another impediment to utilizing this scheme for high Reynolds number flows was the large number of control volumes needed to adequately resolve the viscous regions. Even with AMR this became prohibitively large for even moderately complex geometries. In addition to the viscous flux formulation results, AMR was applied to Coirier's solution strategies with a positive effect, but without fully eliminating the viscous stencil sensitivity on the cut cell smoothness. Another approach that was discussed was the use of embedded, body oriented grids to capture the boundary layers, but no numerical results were given.
86
4.8.2.6 Chimera Grid Schemes The use of a collection of grids to cover the computational domain is known as chimera gridding. Typically, a body-oriented structured grid is used around each component of the solid surfaces. Each of these structured grids are then overlaid onto a background Cartesian mesh. Figure 4.41 shows an example of a two-dimensional chimera grid collection around a simple curved surface. Notice that there is no simple mapping of cells in the body oriented grid and the background Cartesian grid. This feature is one of the drawbacks to chimera gridding schemes, but it is only a performance penalty when the grid needs to be generated during initialization and after any AMR processes. The development of chimera gridding schemes were not solely founded in the viscous/inviscid coupling problems, but chimera gridding schemes were applicable to that use. Throughout the history of chimera gridding there have been a number of motivations for their investigation such as increasing grid point resolution near solid bodies, overcoming structured gridding issues associated with modeling complex geometries. [Atta]142 developed one of the first uses of chimera grids for the full potential equation in two-dimensions using a finite difference formulation. A uniform Cartesian grid was used for the background grid and a body-fitted 0-type structured grid was used around the body. The two grids were coupled via boundary information exchanges during the iteration process. First, the solution around the body fitted grid was converged through an outer iteration using a Dirichlet boundary condition imposed on the outer boundary. Next, the outer grid was converged using a Neumann boundary condition on the inner boundary, utilizing the solution information from the body solution. This information was then used to converge the body fitted grid once again. This cycle continued until the solution approached steady-state. This procedure required each grid (body and background) to have at least one complete cell inside the domain of the other, with the inner grid having an extent of between 1 and 3 chord lengths in all directions. Significant effort was needed to minimize the overlapping region in order to achieve optimal performance. [Atta] later extended this methodology to three-dimensions as well as more complex configurations. [Steger et al.]143 developed a finite-difference chimera grid scheme that could handle a much larger variety of configurations compared to Atta's work. While limited to twodimensions, they presented results for an airfoil-flap, cascading blades, a non-lifting bi-plane and an inlet with center body configuration. All of these configurations were handled automatically by their solver with little changes to the standard finite-difference formulations. State variables were exchanged between grids through interpolations which can cause performance penalties in the initialization stages when the connectivity is being constructed, but they addressed this by using the "stencil-walk" search pattern, where the cells that are used for the interpolation of one cell are assumed to be close to the cells that are needed for the interpolation of that cell's neighbors. 4.8.2.7 Hybrid Grid Schemes Another approach that was related to the chimera grid approach was the use of unstructured grids between the body surface and the background Cartesian mesh, as opposed to the overlaying of these grids. These schemes were usually referred to as hybrid grid techniques. Figure 4.42 demonstrates an example hybrid grid around a curved surface in two dimensions. One application of a hybrid scheme known as SPLITFLOW, by Karman144 and enhanced by [Domel and
E. Atta. Component-Adaptive Grid Interfacing. In 19th Aerospace Sciences Meeting, St. Louis, MO, January 1981. AIAA-81-0382. 143 J. L. Steger, F. C. Dougherty, and J. A. Benek. A Chimera Grid Scheme. InK. N. Ghia and U. Ghia, editors, Advances in Grid Generation, Presented at the Applied Mechanics, Bioengineering, and Fluids Engineering Conference, volume 5, pages 59-69. The Fluid Engineering Division, ASME, Houston, TX, June 1983. 144 S. L. Karman, Jr. SPLITFLOW: A 3D Unstructured Cartesian/Prismatic Grid CFD Code for Complex Geometries. In 33rd Aerospace Sciences Meeting and Exhibit, Reno, NV, January 1995. AIAA. AIAA-95-0343. 142
87
Karmen]145, used Cartesian grids for the majority of the computational domain, and prismatic grids to resolve the boundary layers. Standard Cartesian grid cutting techniques were used at the interface between the prismatic grids and the Cartesian grid. The prismatic cells were grown from the surface triangulation using a marching layers technique. The difficulties was addressed that could arise in the prismatic-Cartesian technique near convex regions, overlapping regions, and other regions where the prismatic marching technique needed to be modified to create viable grids. Other Related Method Similar to the reconstruction method is the class of finite element solution techniques called element-free Galerkin methods. Originally developed by [Belytschko et al.]146 for elasticity and heat conduction problems, it is currently being investigated for its applicability to fluid dynamics because of its automated handling of grid generation. The basic premise of this method is the use of polynomial curve fits to approximately represent the data surrounding the node Figure 4.42 Example Hybrid Grid Near Curved Surface – of interest. Typically, a least-squares (Courtesy of NASA Ames) error minimization is used due to the larger number of data points surrounding the node than the number of unknowns in the curve fit. Most implementations demonstrate oscillations near sharp gradients ( especially with higher-order interpolation functions) with more research needed to developing effective limiters. Another scheme related to the reconstruction method that is the grid-less method. This method uses a cloud of points to reconstruct a polynomial curve fit (similar to the element-free Galerkin method) using a least-squares error minimization. These curve fits are then used to calculate the derivatives required to solve the Navier-Stokes equations in differential form. The number of calculations per node is higher than for other techniques due to the large number of least-squares fits that are required. Unfortunately, this scheme does is not conservative and requires numerical dissipation in order to obtain a solution. Other researchers have extended this work, but without addressing the conservation problem. 4.8.2.7.1 Composite Grid Approach Composite grid generation approach is based on meshing of given arbitrary domain by geometric union of lower level grids built in more primitive domains. Advantages of such approach are the simplicity of meshing domains with complicated geometry and convenient definition of appropriate mesh refinement. Furthermore, resulting grid is partly structured and this feature can be utilized for building robust numerical solution schemes. The methodology includes three basic steps: 1. constructing structured prototype grids, N. D. Domel and S, T-. Karman, Jr. Splitfow: Progress in 3D CFD with Cartesian Omni-tree Grids for Complex Geometries. AIAA 38th Aerospace Sciences Meeting & Exhibit, Reno, NV, January 2000. AIAA-2000-1006. 146 T. Belytschko, Y. Y. Lu, and L. Gu. Element-Free Galerkin Methods. International Journal for Numerical Methods in Engineering, 37(2):229-256, January 1994. 145
88
2. mapping these grids to non-regular geometry (if necessary) and 3. final superposition of low level grids into the final one. The procedure are outlined in Figure 4.43 and discussed in details147.
Figure 4.43
Basic Superposition Example – (Courtesy of Kalinin, Mazo and Isaev)
E I Kalinin1, A B Mazo1 and S A Isaev, “Composite mesh generator for CFD problems”, 11th International Conference on "Mesh methods for boundary-value problems and applications" IOP Publishing, IOP Conf. Series: Materials Science and Engineering 158 (2016) 012047 doi:10.1088/1757-899X/158/1/012047. 147
89
Discussion It is generally accepted that a boundary conforming mesh is desirable to achieve accurate solutions from any numerical solver. If one is willing to sacrifice this requirement then mesh generation becomes a much simpler task. No approach beats regular structured grids in terms of efficiency and accuracy. Thus, there have been a number of efforts to use such grids for complex geometries which are called Cartesian grid approach. An early example of a non-aligned Cartesian mesh can be found in the work of [Carlson]148. Difficulties arise at the boundary where the Cartesian mesh intersects the boundary surface. Although finite difference methods can be derived to interpolate the boundary conditions onto the nearest mesh points, it is difficult to ensure solution accuracy. If extra points are inserted, however, where mesh lines intersect the surface then it is possible to create a boundary conforming mesh. In this respect, boundary conforming Cartesian methods are seen to be closely related to the Octree based triangulation methods. In fact, the elements obtained from the Octree and its intersection with the boundaries is precisely the elements that make up the Cartesian mesh. Conversely, any Cartesian mesh can be converted into an Octree type triangulation by splitting all elements into tetrahedral (or triangles in 2D). Most of the elements in a Cartesian mesh will be hexahedra although the elements adjacent to the surface can be expected to assume a variety of polyhedral shapes depending on the way in which an Octree hexahedron intersects any given region of the boundary surface. A Cartesian mesh is therefore well suited for use by a finite volume or finite element method that can accept arbitrarily shaped elements. This approach has been developed extensively by [Aftosmis et al.]149. Given the close affinity between Cartesian meshes and Octree based triangulations it is to be expected that they share the same advantages and limitations. In particular, the problems of correctly finding the intersection between the Cartesian/Octree mesh and the boundary surface, identifying the element shapes for the intersected Cartesian cells and adequately refining the mesh near small boundary features, are substantial. Cartesian mesh methods also suffer
Figure 4.44
Example of Cartesian Grid on a Generic Airplane – (Source: Richard Smith 1996)
Carlson LA. Transonic Airfoil Analysis and Design Using Cartesian Coordinates. AIAA 2nd computational fluid dynamics conference, Hartford, CT, June 1975.p. 175–83. 149 Aftosmis MJ, Berger MJ, Melton JE. ,”Robust and efficient Cartesian mesh generation for component-based 148
Geometry”, AIAA J 1998; 36:952–60.
90
from the drawback that the surface discretization is not known beforehand and it is therefore often difficult to ensure good surface mesh quality. On the plus side, since the surface discretization is a by-product of the volume discretization, it is possible to generate meshes around highly complex geometries without the need for carefully crafted surface meshes. In fact, the surface definition can be obtained directly from the CAD description provided there is a utility to determine the intersection of given line with the surface. Cartesian and Octree based mesh generation methods thus circumvent the need for the prior creation of a surface mesh, a significant advantage if a fast turnaround time in going from design prototype to flow solution is desired. Figure 4.44 shows a Cartesian grid on a generic airplane configuration.
Trimmed (SAMM) Cells This was a novel idea which was generated by [Wayne Oaks]150 of CD-Adapco® for better capturing geometry surfaces. The idea was to use the trimmed or deformed hexahedral cells (see Figure 4.45) or better known as SAMM (SemiAutomatic Meshing Methodology) to generate a sub-surface, then fill the gap with between sub-surface and real surface, with prismatic layer and the core volume with regular hexahedral cells. If there is any unresolved cells, then use the mesh quality button to fix that. Unfortunately, some meshing designers complained of too many unresolved cells. To that end, CD-Adapco added new features and fixes to decrease the amount Figure 4.45 Meshing Types in SAMM of unresolved cells. Figure 4.45 shows a SAMM approach for meshing a manifold showing step by step procedures. It is most useful in modeling external aerodynamic flows due to its ability to refine cell in a wake region, unsteady, and turbulent fluid caused by boundary layer separation.
Polyhedral Cells As a new comer in the field of Mesh Generation, polyhedral cells merits special attention in CFD community. Polyhedral meshes, as the term implies, means many faces. It consist of cells of 12 and 14 faces (although the number of faces is unrestricted). This means that they fill space in close to the most efficient way possible. A polygonal face is defined by a list of vertex labels. The ordering of vertex labels defines the face normal (orientation) using the right-hand rule. A polyhedral cell is defined by a list of face labels that bound it. In Figure 4.46 (a) cell center is marked by P, face center and face includes by f, face normal Sf and neighboring cell center by N. Face center and cell volume are calculated using a decomposition into triangles or pyramids151. Cell Decomposition It remains to choose an appropriate decomposition of a polyhedron into tetrahedral; two methods used in OpenFOAM® are shown in Figure 4.46 (b-c). A cell is decomposed by introducing a point in W. Oaks, S. Paoletti, “Polyhedral Mesh Generation”, adapco Ltd, 60 Broadhollow Road, Melville 11747 New York, USA. 151 Hrvoje Jasak, ˇZeljko Tukovi´c, “Automatic Mesh Motion for the Unstructured Finite Volume Method”, ISSN 1333–1124, UDK 532.5:519.6. 150
91
its centroid and building tetrahedral above the triangular decomposition of a face. The two methods proposed here are the cell decomposition, Figure 4.46 (b), where additional points are introduced only in cell centers; and the cell-and-face decomposition, Figure 4.46(c), where points are introduced in both face and cell centers. In the first method, the number of algebraic equations in the matrix equals the sum of cell and point count, while the second method introduces an equation for each face, giving a considerable increase in the number of unknowns152. For a given resolution level, a mesh consisting of polyhedral cells has fewer faces than a mesh of any other cell type. As the lowestorder polyhedron, tetrahedral are often deformed during meshing to look more like wedges or slivers. Some of these point upstream, letting fluid flows hit their very oblique surfaces. The disparity between the small inflow area and large outflow areas leads to excessive numerical diffusion. Figure shows manifold and piston cylinder head meshing using polyhedral. (a) typical polyhedral cells
Figure 4.46
(b) Cell Decompostion
(c) Cell and Face Decompostion
Typical Polyhedral Cell and their Decomposition
Mesh Duality A different approach in generating polyhedral meshes, which does not suffer by the aforementioned restrictions, comes with the introduction of indirect mesh generation methods. These are based on the principle of duality transforms, which define a mapping from entities of an input mesh, which is referred to as primal, to a destination mesh, referred to as dual. The main mapping process dictates that the vertices of a dual mesh are generated at the centers of the primal cells153. This relation is unique, leading to a one-to-one correspondence of the two counterpart meshes, while it is also characterized by inverse applicability. This means that the original primal mesh can be obtained back, if the same mapping is applied to the dual mesh. This property can be applied for Voronoi tessellations, as well. The dual counterpart of a Voronoi mesh is a Delaunay triangulation, which is defined as a partitioning scheme, such that no vertex is inside the Figure 4.47 Polyhedral meshing circumcircle of any triangle (Figure 4.47). The using Delaunay triangulation implementation of Delaunay triangulation algorithms is 152
See previous.
153 H. Ledoux, “Computing the 3D voronoi diagram robustly: An easy explanation”, In Voronoi Diagrams in Science
and Engineering, 2007. ISVD '07. 4th International Symposium on, pages 117{129, July 2007.
92
relatively simple and can be of complexity O (n log n), following Ruppert's algorithm154. As the duality property can be applied both ways, it is then possible to obtain a Voronoi mesh, by applying a duality transform on a previously generated Delaunay triangulation, considering the circumcenters of the primal tetrahedral as generator vertices. In 3D space, an equivalent mesh generation method would require a tetrahedral primal mesh that complies with the Delaunay criterion. Delaunay partitioning is known to maximize the minimum angle of all formed simples, which leads to well-conditioned tetrahedral. However, in order to obtain a valid dual mesh, a far stricter criterion needs to be filled: that of well centered tetrahedral, meaning that the circumcenter of a primal cell needs to be located within its volume155. This is something that is not always possible, as tetrahedral at the boundaries may be very at, having their circumcenters outside the model's domain, while the Delaunay criterion still remains fulfilled. Situations like this are especially encountered at sharp concavities of the geometric model, and several suggestions have been made in order to overcome this issue. Other possibilities include non-Delaunay tetrahedral meshes, hexahedral or even mixed meshes, which are further discussion. Finally, the advantage of indirect mesh generation lies in the fact that efficient algorithms can be implemented in order to obtain topologically involved dual meshes, based on primal meshes with simple topology. Furthermore, the primal meshes, themselves, can be created following equally efficient and wellstudied algorithms. This approach leads into an elective two-step mesh generation, rather than an expensive, direct one. Methodology Given a triangular mesh in 2D, such as that of (Figure 4.48), a polygonal mesh is formed, following the principle that a dual cell will be formed around every primal vertex. In the interior of the domain, this one-to-one correspondence between primal and dual entities extends to other types as well, with one dual edge per primal edge and a dual vertex for every primal face. However, generation of polygonal faces on the boundary demands for additional dual edges and vertices, at specific locations of the boundary that denote the classification of primal entities as significant. An slightly modified approach of the generic polygonal mesh generation, as previously described, is used to obtain a variation known as median meshes. This method differentiates itself by considering as significant every existing primal edge, thus creating dual vertices at the midpoints of primal edges lying in the interior as well. These dual vertices become, consequently, vertices of the dual faces formed around primal vertices in the interior, however the resulting polygons are characterized by highly concave shapes (Figure 4.48). Concave polygons are in general non-desirable in computational methods, due to their poor numerical properties. Additionally, they are also known for posing further difficulties in geometric computations, making the mesh generation itself problematic, whenever using plain topological relations is not adequate. It is, subsequently, clear that median meshes are not an optimal choice for numerical simulations. However, the concept behind median mesh generation provides a useful basis for meshing curved boundary surfaces of three-dimensional models, where the exact geometry of the primal mesh needs to be preserved.
Treatment of Boundary Layer The poor numerical properties of tetrahedral meshes have dictated the generation of a thin layer of prismatic, pentahedral elements at the boundary. With this common practice, analysts have been able to partially overcome the inability of tetrahedral to capture the details of a flow at regions close to Paul-Louis George and Houman Borouchaki, “Delaunay Triangulation and Meshing - Application to Finite Elements”, Editions HERMES, 1998. 155 Rao V. Garimella, Jibum Kim, and Markus Berndt, “Polyhedral mesh generation and optimization for nonmanifold domains”, Proceedings of the 22nd International Meshing Roundtable, pages 313-330. Springer International Publishing, 2014. 154
93
the boundary . The appropriate generation of a corresponding boundary layer for polyhedral meshes, or even the need for one, are to be examined in future studies. An interesting, however, by-product of the polyhedral mesh generation method, is the automatic formation of a prismatic boundary layer. This effect comes as a result of connecting the centers of primal cells, in order to form dual entities, which, at the boundary, forms dual cells of approximately half the thickness of their primal counterparts. The phenomenon can be intensified by generating cascading dual meshes, having as a starting point an initial primal mesh. This is made possible, given the observation that the dual counterpart of a general bounded polyhedral mesh tends to resemble the primal, tetrahedral mesh, with the exception at the boundaries. This correspondence emerges in a similar way that the dual counterpart of a Voronoi tessellation is a Delaunay triangulation/tetrahedralization, and vice versa. Therefore, for each generation of meshes, the dual mesh that is obtained serves as the primal mesh for the next iteration. It can, then, be observed that for each generation, the boundary layer gets approximately half the thickness of that of the input mesh. Since two iterations are needed in order to cascade from a polyhedral mesh to a tetrahedral dominant and back to a polyhedral one, the formed boundary layer will conclude to a thickness of a 1/4 factor. It is, however, apparent that with such an approach it is difficult to control the properties and thickness of the formed boundary layer and the application of this method seems of limited use. Figure 4.49 and Figure 4.50 are displaying the involving concepts for 2D and 3D.
Domain Mesh Stretching in Unstructured Environment The drive towards full Navier-Stokes solvers has necessitated the development of stretched grid generation techniques in order to resolve the thin boundary layers, wakes, and other viscous regions characteristic of high-Reynolds number viscous flows . Proper boundary-layer resolution usually requires mesh spacing several orders of magnitude smaller in the direction normal to the boundaries than in the stream-wise direction, resulting in large cell aspect-ratios in these regions. In [Babushka & Aziz] it is shown how the accuracy of a two-dimensional finite-element approximation on triangular elements degrades as the maximum angle of the element increases. Therefore, stretched obtuse triangles that contain one large angle and two small angles are to be avoided, while stretched right-angle triangles, with one small and two nearly right angles, are preferred. Delaunay triangulations, which maximize the minimum angles of any triangulation, tend to produce equiangular triangulations and are thus ill suited for the construction of highly stretched triangular
Figure 4.48
Dual surface Triangulation resulting in Polyhedron
94
elements. One of the earliest approaches for generating highly stretched triangulations for viscous flows makes use
2D
Figure 4.49
Boundary Layer Prisms Generated on a Cascade of a 2D Triangulation and Dual Polyhedron
of a Delaunay triangulation performed in a locally mapped space [Mavriplis]156-157, [Vallet et al]158, [Castro-Diaz et al 1995]. By defining a mapped space based on the desired amount and direction of stretching, an isotropic Delaunay triangulation can be generated in this mapped space that, when mapped back to physical space, provides the desired stretched triangulation. Difficulties with such methods involve defining the stretching transformations and determining suitable point distributions for avoiding obtuse triangular elements. An alternative to the above approaches is to generate a locally structured or semi structured mesh in the regions where high stretching is required. One approach [Nakahashi 1987, Ward & Kallinderis 1993] attempts to preserve the mesh structure in the direction normal to the boundary up to a Mavriplis, DJ. ”Adaptive mesh generation for viscous flows using Delaunay triangulation”, Journal computational. Phys. 1991. 157 Mavriplis, DJ, ”Unstructured and adaptive mesh generation for high-Reynolds number viscous flows”Proceedings of the International Conference on Numerical Grid Generation: Computational Fluid Dynamics and Related Fields, 3rd Barcelona, Spain, ed. AS Arcilla, J Hauser, PR Eisman, JF Thompson, pp. 79–92. New York: North-Holland, 1991. 158 Vallet MG, Hecht F, Mantel B., “Anisotropic control of mesh generation based upon a Voronoi type method”. 156
95
specified distance away from the boundary, after which fully unstructured isotropic meshing techniques are employed. Special care must be taken in this case to avoid mesh cross-overs in regions of concave curvature and to ensure a smooth transition between the structured and unstructured region of the mesh. Another strategy [L¨ohner]159; [Pirzadeh]160; [Connell & Braaten 1995] consists of generating a semi structured mesh, where the “stack” of mesh cells emanating from each individual boundary face may terminate independently from those at other boundary faces, as shown. Termination of these “advancing-layers” [Pirzadeh]161 is triggered when the local cell aspect-ratio approaches unity, or when cross-over with other cells is detected, such as in concave corners. The remaining region is then gridded with a conventional isotropic unstructured mesh generation approach. The resulting structured or semi structured meshes can either be conserved as local structured entities of quadrilaterals in two dimensions and prisms in three dimensions (since the surface grid is generally assumed to be triangular), or the different element types may be divided into triangles or tetrahedral in two or three dimensions, respectively.
3-D
Figure 4.50
Concept of cascading for boundary layer in 3D
L¨ohner R.,” Matching semi-structured and unstructured grids for Navier-Stokes calculations”, AIAA 1993. Pirzadeh S.,”Viscous unstructured three dimensional grids by the advancing-layers method”, AIAA, 1994. 161 Pirzadeh S. 1994, AIAA J. 32(8):1735–37. 159 160
96
Spatial (Field) Discretization The previous section describes techniques for generating suitable meshes about arbitrary geometric configurations. Once such a mesh has been generated, it serves as the basis for the spatial discretization of the governing fluid dynamic equations. Unstructured mesh discretization techniques can generally be classified as finite-volume or finite-element strategies, depending on whether a discrete integral or Variational viewpoint is adopted, although many common discretization may be simultaneously interpreted from both viewpoints. For finite-volume formulations, a distinction between vertex-based and cell centered schemes can be made. In a vertex based scheme, the flow variables are stored at the vertices of the mesh. The discrete equations usually involve stencils that are defined by the nearest or next-to-nearest neighbors of each mesh point. In a cell-centered scheme, the flow variables are stored at the centers of the cells or elements of the mesh. The stencils of the discrete equations usually involve the nearest or nextto-nearest neighboring cells. The equivalence between vertex-based and cell-centered schemes can be demonstrated with the concept of a dual mesh. If a dual mesh point is created at each cell center and dual Figure 4.51 Dual Mesh for Mixed Triangular-Quadrilateral mesh edges are drawn by joining Unstructured Mesh neighboring cell centers, the cellcentered scheme can be seen to be equivalent to a vertex-based scheme operating on the dual mesh. Figure 4.51 illustrates the dual mesh for a mixed quadrilateral and triangular mesh in two dimensions and associated control-volumes with edge-based fluxes for a vertex-based scheme. For a purely quadrilateral or hexahedral mesh, the dual mesh also contains quadrilateral or hexahedral elements, and the number of vertices and edges in the original and dual meshes is identical. For triangular or tetrahedral meshes, the number of dual mesh vertices is larger than the number of original mesh vertices. This is due to the fact that a triangular mesh contains twice as many triangles as vertices (neglecting boundary effects), and a tetrahedral mesh five to six times more elements than vertices. On the dual mesh, the degree of a vertex (number of incoming edges) is fixed and equal to three for triangular elements, or four for tetrahedral elements, whereas on the original mesh, the degree of each vertex is variable. Similar relationships hold for other elements such as prisms and pyramids. Thus, cell-centered and vertex-based schemes operating on the same grid result in vastly different discretization when non-quadrilateral or non-hexahedral elements are present. In particular, a cellcentered scheme can be expected to result in a much larger number of unknowns while generating relatively simple stencils of fixed size. The vertex-based scheme, on the other hand, will result in a smaller number of unknowns with larger variable-size stencils. Because of the larger number of unknowns, cell-centered schemes generally incur larger overheads than vertex-based schemes on equivalent grids. However, there is evidence to suggest that they also provide more accurate solutions on equivalent grids. The question of whether the additional overheads are offset by the increase in accuracy is still an open one, especially since vertex-based schemes operate on more complex stencils (more fluxes per unknown) than cell-centered schemes.
97
Considerations for the Navier-Stokes Equation The above discussion on discretization is principally concerned with the purely convective terms that arise in the context of inviscid flows. With the exception of the finite-element methods described above, where convection and diffusion terms can be treated in a unified manner, additional viscous terms must be discretized for the Navier-Stokes equations. These terms are diffusive in nature and generally take the form of second differences. Stable second-order discretization can therefore be constructed using simple central differences. For cell-centered schemes, one approach consists of first computing the gradients at the mesh vertices and then averaging these to the cell faces in order to compute second derivatives at cell centers (Frink162). For vertex based schemes, a similar two-pass procedure based on finite-volume central difference arguments can be used to construct the viscous term discretization. For simplicial meshes, gradients can first be computed on the mesh elements, which can then be interpolated to the control-volume faces in order to form second differences at the mesh vertices. This type of discretization can be derived more formally using a Galerkin finiteelement procedure and assumes linear variation of the flow variables on the mesh elements. The resulting discretization produces a nearest-neighbor stencil and may be implemented as a single loop over the edges of the mesh, rather than as a two-pass procedure that computes intermediate cellbased gradients; [Barth]163 and [Mavriplis]164. For non-simplicial meshes, Galerkin finite-element formulations using bilinear or trilinear variations on quadrilateral or hexahedral elements can be constructed. The resulting stencils, however, are no longer compact, as they involve vertices within mesh elements that are not connected by a mesh edge, such as diagonally opposed vertices in hexahedral elements [Braaten & Connell165]. An alternative strategy for discretizing viscous terms for vertex-based schemes is to employ the vertex-based gradients already computed in the context of second-order upwind schemes (using a Green-Gauss integration around the vertex-based control volumes, for example), instead of the element-based gradients described above. A vertex-based second difference can then be computed by integrating these gradients themselves around the control-volume boundaries [Luo et al 1993]. This approach enables the viscous term discretization to be assembled on meshes of arbitrary element types using the same data structures as required for the upwind convection terms. The principal drawback of this method is that it results in a large stencil that involves neighbors and next to-neighbors, which on a structured mesh reduces to a stencil of size 2h, where h represents the mesh spacing. This not only reduces overall accuracy but is also ineffective at damping odd-even oscillations in the numerical scheme. For high-Reynolds-number flows of practical interest, the Reynolds-averaged form of the Navier-Stokes equations is generally employed, which requires the use of additional turbulence-modeling equation(s). Although algebraic models can be implemented on unstructured grids [Mavriplis]166, they were conceived for simple wall-bounded flows and are thus ill suited for flows over complex geometries. The current practice is to employ two-equation models of the K-ε or K-ω type, or simpler one-equation eddy viscosity models [Baldwin & Barth 1992], [Spalart & Allmaras]167. These equations contain convective, diffusive, and source terms that Frink NT. 1994. Recent progress toward a three dimensional unstructured Navier-Stokes flow solver. AIAA Pap. 94-0061 163 Barth TJ. 1992. Aspects of unstructured grids and finite-element volume solvers for the Euler and NavierStokes equations. Von Karman Inst. Lect. Ser., AGARD Publ. R-787 164 Mavriplis DJ. 1995b. A three-dimensional multigrid Reynolds-averaged Navier-Stokes solver for unstructured meshes. AIAA J.33(3):445–53 165 Braaten ME, Connell SD. 1996. Three dimensional unstructured adaptive multigrid scheme for the Navier-Stokes equations. AIAA J. 34(2):281–90 166 Mavriplis DJ. 1991a. Algebraic turbulence modeling for unstructured and adaptive meshes. AIAA J. 29(12):2086–93 167 Spalart PR, Allmaras SR. 1992. A one-equation turbulence model for aerodynamic flows. AIAA Pap. 92-0439 162
98
can be discretized in a manner analogous to the discretization of the flow equations. Turbulence modeling equations often result in stiff numerical systems, and care must be taken to devise schemes that preserve positivity of the turbulence quantities at all stages of the solution process. A common practice is to discretize the convective terms using a first order upwind strategy, from which a positive scheme that obeys a maximum principle can be obtained.
Unstructured Quadrilateral Mesh Generation Because commercial aircraft are built with thin-walled structures, their structural performance is well-modeled using shell-element meshes [Hwang and Martins]168. However, creating these meshes for the full aircraft configuration can be challenging and presents a bottleneck in the design process, especially in a configuration-level design space. The aim is to presents an algorithm that automatically creates unstructured quadrilateral meshes for the full airframe based on just the description of the desired structural members. The approach consists in representing each node in the mesh as a linear combination of points on the geometry so that the structural mesh morphs as the geometry changes, as it would, for example, in aero-structural optimization. The algorithm divides the aircraft skin into 4-sided domains based on the underlying B-spline representation of the geometry. It meshes each domain independently using an algorithm based on constrained Delaunay triangulation, triangle merging and splitting to obtain a quadrilateral mesh, and elliptical smoothing. Examples of full configuration structural meshes are provided, and a mesh convergence study is performed to show that element quality can be maintained as the structural mesh is refined. Here, presented an automatic unstructured quadrilateral mesh generation algorithm for aircraft structures that uniquely satisfies the four requirements mentioned above. The algorithms starts with a B-spline surface geometry representation and a list of requested structural members defined in terms of parametric locations on the surfaces. It then splits the geometry into domains, meshes each domain independently using Constrained Delaunay triangulation (CDT) as well as merging and splitting operations, and then applies Laplacian smoothing as a final step. Geometry Representation The only requirements on the geometry representation are that it is continuous and watertight. Representing the geometry using untrimmed B-spline surfaces, though this is not the only choice with which the structural mesh generation algorithm would work. B-splines are piecewise polynomials used frequently in computeraided design because of their favorable mathematical properties: compact support for a desired order and smoothness, and flexibility in terms of the number of control points and polynomial degree. B-spline surfaces are tensor products of B-spline curves that maintain the advantages of smoothness and sparsity. Figure 4.52 illustrates how a conventional wing-bodytail aircraft geometry can be constructed
Figure 4.52 Conventional configuration geometry (a), final structural mesh (Courtesy of Hwang & Martins)
J. T. Hwang and J. R. R. A. Martins, “An unstructured quadrilateral mesh generation algorithm for aircraft structures”. Aerospace Science and Technology, 59:172182, 2016. doi:10.1016/j.ast.2016.10.010. 168
99
with 4-sided B-spline surfaces169. Local Mesh Generation Algorithm In general, 2D quad meshing algorithms fall under three general categories: domain-decomposition, advancing-front, and triangulation-based methods. The first two recursively splitting the domain through heuristic algorithms and marching out from boundaries, respectively are not suitable for the current problem because of the line constraints imposed by the structural members intersecting the skin. Two additional ideas that have been successful are topology clean-up and smoothing. There has been work dealing with line constraints in structural mesh generation for marine engineering. The local mesh generation algorithm consists of six stages, as illustrated in Figure 4.53. The figure shows a domain for illustrative purposes, containing a vertical edge extending from the top to the bottom of the domain, two diagonal edges intentionally chosen to form a triangular region, and a shorter edge that is floating by itself near the center of the domain. The six stages are as follows:
1. Initial domain: We start with a 4-sided domain representing a single B-spline surface, with the internal members intersecting this surface pre-determined.
2. Discretization: We discretize the boundaries and the interior of the domain. The boundaries are simply discretized using a global parameter representing the requested resolution. This guarantees that the bounding edges shared by two neighboring domains always agree on the boundary nodes because all domains use the same resolution parameter. The interior of the domain is populated with a grid of points that are spaced based on the sizes of the element
Figure 4.53 169
Same as previous.
The Six Steps of the Unstructured Quad Meshing Algorithm
100
3. 4. 5. 6.
boundaries, as measured from the preview mesh. Triangulation: We perform CDT on the domain while respecting the edges from the boundaries and from the intersecting structural members. Quad-dominant mesh: From the triangulation, we obtain a quad-dominant mesh by ranking all potential merges of adjacent triangles based on how close the angles would be to 90 degrees. The triangles are merged according to this ranking until no possible merges remain. Fully-quad mesh: We split all quads into four smaller quads and all triangles into three quads using its centroid to obtain a fully quad mesh. Smoothing: We perform an elliptical smoothing operator (Laplacian) as the last step.
Other noticeable sources regarding quad meshing are by [Remacle et al,]170, and [Verma & Tim Tautges]171.
Connectivity Information and Data Structure We must identify what information is required to identify the cell and all the neighbors of the cell in the computational mesh. We can choose to locate the arbitrary points anywhere we want for the unstructured grid. A point insertion scheme is used to insert the points independently and the cell connectivity is determined. This suggests that the point be identified as they are inserted. Logic for establishing new connectivity is determined once the points are inserted. Data that form grid point that identifies grid cell are needed. As each cell is formed it is numbered and the points are sorted. In addition the neighbor cell information is needed. Therefore, a brief discussion on data structures is useful because the success of most discretization methods ultimately depends on how efficiently they may be implemented172. Traditionally, finite-element methods have relied on element-based data structures, where for each element of the mesh a list of the forming vertex addresses is stored (i.e. four vertices for tetrahedral, eight vertices for hexahedra, etc.). For many fluid dynamics problems, the discretization, which are typically thought of as summations of fluxes, can be implemented more effectively using an edge-based data structure. For a vertex-based scheme, this corresponds to storing, for each edge of the mesh, the addresses of the two vertices on either end of the edge. For a cell-centered scheme, the relevant entity is the dual edge that joins two neighboring cell centroids and pierces the face common to these two cells. The discretization may be evaluated by computing a flux on each edge, which is then added to and subtracted from the respective control volumes on each end of the edge. In order to compute this flux, a face area must be stored for each edge, which corresponds to the area of the dual control-volume face associated with the mesh edge in the vertexbased scheme, and to the area of the cell face pierced by the dual edge in the cell-centered scheme. The use of edge-based data structures results in lower memory overheads and increased computational throughputs because redundant computations are eliminated and the gather-scatter required for vectorization in supercomputers is minimized. Furthermore, because sets of edges can be used as building blocks for arbitrarily shaped elements, hybrid meshes with mixed element types may be handled by a single edge-based data structure, at least for inviscid flows. For viscous flows, the Galerkin finite-element discretization of the diffusion terms on simplicial meshes results in a nearest-neighbor stencil and thus may be implemented using an edge-based data structure 173. J.-F. Remacle, J. Lambrechts, B. Seny, E. Marchandise, A. Johnen and C. Geuzaine, “Blossom-Quad: a nonuniform quadrilateral mesh generator using a minimum cost perfect matching algorithm”, Int. J. Numerical Meth. Eng. 2010; 00:1-6 171 Chaman Singh Verma and Tim Tautges, “Jaal: Engineering a high quality all-quadrilateral mesh generator”, Argonne National Laboratory, Argonne IL, 60439. 172 Wikipedia. 173 Mavriplis DJ, “Unstructured mesh generation and adaptively”, VKI Lect. Ser. Computational Fluid Dynamics, 26th, VKI-LS 1995. 170
101
However, this is not the case for non-simplicial meshes, since the resulting stencils involve vertices that are not connected to the center vertex by a mesh edge (such as diagonally opposed vertices in hexahedral elements). In these situations, the element-based data structure must be retained174. An alternative is to resort to the thin-layer approximation of the viscous terms on non-simplicial meshes, which can be implemented exclusively along edges175. The limitations of this approach are obvious, although it is justifiable for highly stretched prismatic or hexahedral meshes, where stream wise resolution has been sacrificed for efficiency. An interesting property of the edge-based data structure is that it can provide an interpretation of the discrete operator as a sparse matrix. For nearest neighbor stencil discretization, all points in the stencil are joined to the center point by a mesh edge. The discretization operator can be written as a sparse matrix, where each nonzero entry in the matrix corresponds to a stencil coefficient or edge of the mesh. For systems of equations, the edges correspond to nonzero block matrix entries in the large sparse matrix. This interpretation has implications for the implementation of implicit and algebraic multigrid solution schemes 176-177. One of the disadvantages of the edge-based data structure is that it requires a preprocessing operation to extract a unique list of edges from the list of mesh elements and to compute the associated edge coefficients. For unsteady flows with dynamic meshes, this preprocessing must be performed every time the mesh is altered, although this may be done locally. Additionally, for dynamic grid cases, the element data structures are generally required for performing mesh motion or adaptation, since edge lists represent a lower-level description of the mesh178.
Braaten ME, Connell SD., “Three dimensional unstructured adaptive multigrid scheme for the Navier-Stokes equations”, AIAA J. 34(2):281–90, 1996. 175 Mavriplis DJ, Venkatakrishnan V.,”A unified multigrid solver for the Navier-Stokes equations on mixed element meshes”, .AIAA Pap. 95-1666, 1995. 176 Venkatakrishnan V, Mavriplis DJ., ”Implicit solvers for unstructured meshes”, J. Computational. Phys. 105(1):83–91, 1993. 177 Mavriplis DJ, Venkatakrishnan V., “A unified multigrid solver for the Navier-Stokes equations on mixed element meshes”, AIAA Pap. 95-1666, 1995. 178 Annual. Rev. Fluid Mech. 1997.29:473-514, journals.annualreviews.org by Pennsylvania State University. 174
102
5 Hybrid Meshes A hybrid grid contains a mixture of structured portions and unstructured portions. It integrates the structured meshes and the unstructured meshes in an efficient manner. Those parts of the geometry that are regular can have structured grids and those that are complex can have unstructured grids. These grids can be nonconformal which means that grid lines don’t need to match at block boundaries179. In recent years due to accuracy consideration while capturing the physics (sunlayer in boundaries), and in the same time added flexibility in domain discretization (automated meshing using tetrahedral, polyhedral, etc.), received lots of attention. Figure 5.1 shows a Hybrid mesh obtained from a STL surface Figure 5.1 Hybrid Grid and Steady State Solution using an OpenFOAM© meshing module and solution for a steadystate incompressible turbulent flow.
Accuracy Consideration It is known that the truncation error of a finite volume discretization depends on the shape of the control volume. In particular, a trapezoidal approximation for a vertex based method, though nominally second order, becomes first order accurate unless the control volume possesses central symmetry180. For a vertex based discretization, the control volume associated with a given point typically corresponds to the boundary of the collection of elements incident at that point. For a cell centered discretization it is the element boundary that functions as the control volume. On a structured mesh of hexahedra, one can generally expect central symmetry at all mesh points unless there are extreme distortions in the mesh. A planar triangulation will have central symmetry if the centered discretization it is the element boundary that functions as the control volume. On a structured mesh of hexahedra, one can generally expect central symmetry at all mesh points unless there are extreme distortions in the mesh. A planar triangulation will have central symmetry if the triangles are all equilateral resulting in hexagonal control volumes for vertex based schemes. In an anisotropic layer of highly stretched triangles central symmetry can only be achieved if the mesh maintains a structured appearance (e.g. advancing layers) and all the diagonal edges are oriented in the same direction. In a tetrahedral mesh, however, it appears impossible to achieve central symmetry under any circumstances. The possible loss of second order accuracy in truncation error for the Euler equations is localized and the first order error terms tend to cancel each other when averaged over several elements. As a result, the global solution error should remain second order181. It is possible, however, that this canceling of first order truncation error does not occur viscous regions where second order derivatives of the flow variables play a significant role. If this is the case then it will be necessary to maintain central symmetry of the control volumes in boundary layer 179
From Wikipedia, the free encyclopedia.
180 Roe PL. Error estimates for cell-vertex solutions of the compressible Euler equations. ICASE Report No, 1987.
Giles MB. Accuracy of node-based solutions on irregular meshes. Eleventh international conference on numerical methods in fluid dynamics. Williamsburg, VA, June 1988. 181
103
regions for Navier Stokes computations. Comparing Mesh Type for Viscous Accuracy After the emergence of so many different mesh types it is reasonable to assume that mesh generation has reached a plateau and that the future is unlikely to expand the choice of element types or meshing methods. Figure 5.2 lays out a subjective view of the suitability of different meshing methods for the computation of high Reynolds number Navier Stokes solutions. The structured Multi-block methods achieve good viscous accuracy but are time consuming to apply. Tetrahedral meshes with anisotropic elements in boundary layer regions are easier to create but their accuracy is suspect. Overset methods lie on the diagonal and thus represent a compromise between ease of use and their purported solution accuracy for viscous flows. The best meshing types should lie near the diagonal and be as far away from the origin as possible. It seems likely that the trade-off between accuracy and ease of use will shift so that perhaps one of the meshing methods will stand out as clearly superior in meeting the dual Figure 5.2 Comparison of different mesh types for RANS requirements of solution accuracy and Computations ease of application. In the best of all possible worlds one might hope that all mesh generation methods would one day meet this goal. At the time of writing it appears that composite multi-block meshes of hexahedra offer the best accuracy for RANS computations but the lack of an algorithm for automated block decomposition renders these meshes time consuming to create. At the other extreme, approach offers essentially fully automated mesh generation but the poor quality of mesh elements near boundary surfaces severely limits the accuracy of these mesh types, particularly for RANS computations. Overset meshes of hexahedra represent a compromise that lies between these two extremes; they are more complicated to set up than tetrahedral meshes and computations on overset meshes are arguably less accurate than comparable computations on composite multi-block hexahedral meshes. Effect of Prismatic Extrusion Sub-Layer in Viscous Layer If prism shaped elements are used in the viscous layer there will be central symmetry provided that there is good triangle quality in the lateral direction parallel to the boundary surface. By combining prismatic elements in viscous regions with a tetrahedral mesh for the inviscid part of the flow field one might expect to achieve solutions of the Navier Stokes equations that match the accuracy of computations on structured hexahedral meshes. Since the prism layer is unstructured in the lateral direction there is much more flexibility in handling complex geometries and a greater opportunity to achieve a high level of automation in the mesh generation process than would be the case with purely hexahedral elements. For these reasons, hybrid meshes of prisms and tetrahedral have considerable appeal as the best compromise to achieve accuracy in RANS computations, while permitting ease of mesh generation for complex configurations. Hybrid meshes consisting of prisms and tetrahedral were first proposed by [Nakahashi] and then developed extensively by
104
[Kallinderis et al]. There is little hard evidence to support the contention that using prisms in the boundary layer region is more accurate than using tetrahedral, or that hybrid meshes achieve the same accuracy as composite multi-block meshes made up of hexahedra. In fact, the limited evidence that is available from an analysis of the results presented at the second drag prediction workshop tends to contradict both these beliefs. The extrusion layer is usually extruded with linear or exponential Figure 5.3 Constructions of Hybrid mesh stretching functions for desired spacing of viscous flow calculation. [Moxey, et al.]182 proposed an isoperimetric approach, whereby a mesh containing a valid coarse discretization comprising of high-order triangular prisms near walls is refined to obtain a finer prismatic or tetrahedral boundary-layer mesh.
Meshing Tools in CD-Adapco® There are different methodologies developed for Hybrid meshes. Each has its own merits and of course who you talking to. One such method developed by [Star-CD©]183 where their automated meshing is involved. The essence of the method is Inside-Out where most of applications are interior domain. By creating a sub-surface along actual surface, the interior mesh, composed of Hex and a transition layer (Tetrahedron), is filled. Once the interior is done, an extrusion layer will extrude from sub-surface to the surface with prismatic cells as depicted in Figure 5.3. The automated meshing where sub-surface mesh (orange) is clearly visible. Same procedure can be applied using the (Advanced Layer) on a T-Section Figure 5.4 Predominantly polyhedral meshing for predominantly polyhedral cells and boundary prisms as shown in Figure 5.4. A detailed description of the tools available, from CAD data to sub-models, is provided in Figure 5.6 in particular reference to advanced layer generation and automatic meshing. Other relevant details of automatic meshing is provided in Figure 5.5.
D. Moxey∗, M.D. Green, S.J. Sherwin, J. Peir´o, “An isoperimetric approach to high-order curvilinear boundarylayer meshing”, Computer Methods Applied Mechanics Engineering, 283 (2015) 636–650. 183User Guide STAR-CCM+ Version 8.06. 2013. 182
Sub-Models
105
Figure 5.6
Meshing tools in CD-adapco
Trimmed cells (surface) with Hexahedral Core
All Tetraheadral Cells
Hybrid Meshing
Cell Layer Extusion for Trimmed Cells
Figure 5.5
Combined Volume and Extrusion Layer Meshes
106
A Novel Methodology for Extrusion Layer Meshing A configuration of prismatic elements in boundary layers created by marching a surface triangulation on viscous walls along certain directions is a typical mesh for viscous-flow simulations [Zheng et al.]184. The quality of the resulting elements and the reliability of the meshing procedure thus highly depend on the computing strategy used to determine the marching directions. Here, we propose to compute a field of marching directions governed by Laplacian equations. This new approach can ensure the smooth transition of marching directions, and thereby lead to more desirable element shapes. To demonstrate the effectiveness of the proposed method for computing the normal vectors, a comparison was made with the traditional geometric method.
Figure 5.7
Meshes Generated by a) Proposed Algorithm and b) Leading Commercial Vendor
To generate the boundary-layer mesh, it first generated an anisotropic tetrahedral mesh around the model and then formed the boundary-layer mesh by combining three tetrahedral elements into a prism. In this software, the vertex normal direction is initially defined as the area weighted average of the face normal of the manifold of adjacent triangles, and is then smoothed and adjusted as necessary to guarantee the mesh quality and avoid collisions. Figure 5.7 a presents a cut-out view of the boundary-layer mesh generated by the proposed method near the intake of the engine. It can be seen that the normal at nodes of a same layer change in a smooth way, whereas the counterparts generated using a commercial code change more sharply (see Figure 5.7-b), and stretched elements can be observed in this region. To evaluate the quality of the generated prismatic elements, the scaled-aspect-ratio quality measure proposed in the literature was adopted in this study. It has been reported that this quality measure in effect combines the measures of triangle shapes and edge orthogonality185.
Case Study - Hybrid Unstructured Meshes for Common Research Model (CRM & JSM) via ANSA® In this work an unstructured meshing approach is taken using the commercial software ANSA®, developed by BETA-CAE Systems [Skaperdas and Ashton]186. This describes the meshing process Yao Zheng, Zhoufang Xiao, Jianjun Chen, and Jifa Zhang, “Novel Methodology for Viscous-Layer Meshing by the Boundary Element Method”, AIAA Journal Vol. 56, No. 1, January 2018. 185 See Previous. 186 Vangelis Skaperdas, and Neil Ashton, “Development of high-quality hybrid unstructured meshes for the GMGW-1 workshop using ANSA”, AIAA, January 2018. 184
107
within ANSA as well as an CRM Common Research Model analysis of the unstructured GMGW Geometry and Mesh Generation Workshop grids, similar to the tools ® HLPW High Lift Prediction Work provided in CD-Adapco . It is produced for the 1st AIAA JAXA Japan Aerospace Exploration Agency Geometry and Meshing JSM JAXA high-lift configuration Standard Model Workshop and 3rd AIAA HighMAC Mean Aerodynamic Chord Lift Workshop. Particular focus STEP Standard for the Exchange of Product is made on the process to generate suitable grids for Table 5.1 Abbreviations various CFD codes including OpenFOAM and Star-CCM+. Some of the Abbreviations is been provided in Table 5.1 for clarity. Geometry and Mesh Generation Background The AIAA Drag Prediction and High Lift Prediction provide an opportunity for engineers in the aerospace sector to present and exchange information on the latest CFD methods and tools and to directly compare these methods on open-source geometries. The 1st Geometry and Mesh Generation Workshop took place under the umbrella of the 3rd High Lift Prediction Workshop. It was the first of its kind to focus specifically on the details of preparing high fidelity mesh models for CFD simulations. The aim of was to assess the current state of the art in geometry pre-processing & mesh generation technology and to bring together meshing specialists to discuss challenges and possible solutions. The models studied were NASA’s Common Research Model and JAXA’s high-lift configuration Standard Model. The JSM model was not studied in the workshop but given its inclusion in HLPW-3, the same mesh procedure was applied to both geometries. Both geometries are available in high lift configuration with slats and flaps extracted while the JSM model is also available with an optional engine nacelle and pylon. The main goal for participating in HLPW-3 was to assess the open-source CFD code OpenFOAM. Many aerospace specific CFD codes are restricted for national security reasons e.g., NASA CFD codes are typically not available to researchers in the UK or Greece. Whilst a number of commercial CFD codes are routinely used for industrial aerospace simulations, the ability to implement custom turbulence models, numerical schemes and algorithms means that these are not ideal for research and collaboration. Open source CFD codes like OpenFOAM, SU2 and Saturne have grown in popularity in recent years as a growing movement of international collaboration that is improved by the ease of sharing . Over the past 15 years OpenFOAM has developed from a University code to one which is used by both major industries and Universities, largely because of its growing user base and the comprehensive set of solvers, turbulence models and meshing capabilities. Whilst it has become common in the automotive sector, its largest perceived weakness is a lack of verification and validation, which is particularly true in the aerospace sector, where it does not have a demonstrated track record of matching the results from standard aerospace codes. Whilst OpenFOAM has its own mesh generation utility; SnappyHexMesh, a Cartesian-prismatic unstructured generation tool, the experience of the authors have shown that it is not suitable for low y+ grids and the region between the prismatic and Cartesian is often subject to severe nonorthongality and large cell size jumps. For this reason an alternative mesh generator is used, which is capable of generating high-quality grids that represent the kind of unstructured grids that are typically used by the aerospace industry; ANSA® 17.1, a pre-processor from BETA-CAE System. Geometry Handling The geometries for the CRM and JSM high-lift models were downloaded from the HLPW-3 website187. 187
“HLPW-3 Geometry.” [Online]. Available: https://hiliftpw.larc.nasa.gov/Workshop2/geometries.html%0D.
108
A multitude of CAD file formats were available and for this project the STEP format was selected for both CRM and JSM models. 5.3.2.1 The CRM Model The STEP file of the HL-CRM model is in inches. It has a MAC of 275.8 inches and it represents a full scale aero plane model. No clean-up was required as the geometry had already been cleaned. Based on the GMGW/HLPW-3 meshing guidelines document, a hemi-spherical domain, suitable for imposition of far field boundary conditions, with a radius of 100 times MAC was created in ANSA and connected to the half symmetric airplane model. The raw CAD model was separated only in two zones, the slat and the whole remaining model. In order to facilitate meshing and pre-processing, we separated the model in 17 zones as revealed in Figure 5.8. Two versions of the CRM model are available188. One where the inboard flap is unconnected referred to as “gapped”) and one where the gaps between the inboard flap and outboard flap and main fuselage were sealed (referred to as “sealed”). In the latter case the worst proximity areas are removed, facilitating layers generation.
Figure 5.8
Computational Domain of the HL-CRM Gapped Flaps Model
5.3.2.2 The JSM Model The JSM model is designed in mm and it represents the actual wind tunnel model with a MAC of 529 mm. Geometry was read into ANSA without any topological problems. A hemi-spherical domain was created with a radius of 100 times MAC. The model was separated in ANSA in 13 zones to facilitate meshing and pre-processing as shown in Figure 5.9. Similarly to the HL-CRM model, the JSM model is available in two variants, without engine nacelle, as well as with engine nacelle, as shown in Figure [Accessed: 11-Dec-2017]. 188 Vangelis Skaperdas, and Neil Ashton, “Development of high-quality hybrid unstructured meshes for the GMGW-1 workshop using ANSA”, AIAA, January 2018.
109
5.10 using the HLPW-3 notation for cases.
Figure 5.9
Computational Domain and Separation of Zones of the JSM Model with Engine Nacelle
The geometry of the JSM model has a particularity, which the HL CRM model does not have, that would eventually lead to problems in the generation of layers189. Those areas can be easily identified in ANSA through a quick test layers generation run for one layer. Such areas are identified, marked and can optionally be excluded from layers generation, although for the case of this study we wanted to avoid any area of the model without layers, as that would result to solution instability and Figure 5.10 JSM Model with Engine Nacelle error. Three such areas were found in the JSM geometry as highlighted in Figure 5.11. It was therefore decided to perform some small local geometry modifications190. The size of these geometrical additions is limited to around one or two local element lengths so as not to cause a significant disturbance to the flow field. It is believed that the benefits of allowing for good quality
Vangelis Skaperdas, and Neil Ashton, “Development of high-quality hybrid unstructured meshes for the GMGW-1 workshop using ANSA”, AIAA, January 2018. 190 Vangelis Skaperdas, and Neil Ashton, “Development of high-quality hybrid unstructured meshes for the GMGW-1 workshop using ANSA”, AIAA, January 2018. 189
110
layer generation in these regions surpass any side-effects from deviating from the original CAD geometry.
Figure 5.11
Three Locations of Problematic Areas of the JSM Geometry for the Generation of Boundary Layers
Surface Meshing ANSA provides the user with full control and automation in meshing though the Batch Mesh tool. Batch Mesh is a template driven meshing tool that consists of meshing scenarios for surface meshing, layers generation and volume meshing. Each scenario consists of several sessions and each session contains different zones of the model and the corresponding meshing characteristics. The contents of each session can be assigned manually, or via standard name convention filters of the zones of the model (like name contains, name starts with, name ends with etc.). Using filters allows more automation, since for every new design variant, the sessions can be populated automatically. One of the advantages of Batch Mesh tool is the fact that a scenario can be defined once, saved and then run several times for every new geometry, ensuring automation and mesh consistency for every variant. The CFD meshing algorithm in ANSA creates a high quality surface mesh, controlled by the following settings for each session of the Batch Mesh: ➢ ➢ ➢ ➢ ➢ ➢ ➢
Mesh type (triangular or quad) Target curvature refinement Growth rate of mesh on flat areas Minimum and maximum length Assigned length on all identified feature lines (different for convex and concave ones) Proximity refinement via prescribed length to gap ratio Target quality criteria threshold values
In addition to these mesh controls, the user can create Size Boxes to limit the maximum length of the surface and the volume mesh in different areas. Figure 5.12 displays the Batch Mesh surface meshing scenario that contains eight sessions, each with different zone contents and mesh specifications for the Medium JSM model. Ten Size Boxes were used, each one with a larger maximum
111
length limit the further away of the aircraft. Size Boxes case be cylindrical or hexahedral and can also be manipulated by the user to take various curved forms aligned to the flow field where necessary.
Figure 5.12
Batch Mesh setup for the JSM Model with Size Boxes for Local Mesh Control
The only feature currently missing from Batch Mesh tool is the creation of anisotropic mesh, usually at the leading and trailing edges. The reason for this is that anisotropic mesh is not used in the automotive industry where ANSA usage was built on, while if it offers a great advantage for aerospace meshing. The main difference between these two industries with respect to meshing, is that in the aerospace industry the dimensions of the wings are much larger, while they require very fine curvature refinement. The flow gradients are considerably larger in the chord wise direction than in the span wise direction and as a result anisotropic mesh provides the most efficient refinement method. For the same level of curvature refinement on a typical wing geometry, an isotropic mesh may require at least three times more elements than an equivalent anisotropic mesh. In addition, in the aerospace industry the total height of the boundary layer elements is considerably larger than that used in the automotive industry. In Figure 5.13 the advantage of anisotropic meshing is obvious as in highly convex areas like leading and trailing edges, starting from a span wise anisotropy allows the layer elements to improve in quality with every new step. In the end, the top cap of the layers is perfectly isotropic and this is the best basis for the remaining pyramid and tetra meshing to follow. In contrast, when starting from an isotropic mesh, the mesh quality of the layers deteriorates with each step. For the case of the isotropic surface mesh, the top cap does not have a good quality and this makes the remaining volume meshing process harder. Therefore, the surface meshing of all the models was performed with the following combination of manual and Batch Mesh automatic operations: ➢ Identification and manual meshing of all trailing edges with map quad mesh of specific rows of elements. ➢ Automatic Batch Meshing of all remaining surfaces of the model. ➢ Manual imprint of anisotropic mesh patterns away from the trailing edges and along all leading edges. Note how the anisotropic mesh dies out near the ends with the span wise imposed nodal distribution, in order to smoothly transit to isotropic mesh. The first surface scenarios for both HLCRM and JSM models were performed for the medium mesh size according to the meshing guidelines
112
for rows of elements across the trailing edges and mesh resolution. From the medium meshes we generated the coarse and fine versions by simply scaling up and down respectively the assigned element length of all sessions of Batch Mesh scenario. Of course when dealing with unstructured mesh and especially with anisotropic features and Size Boxes, it is not easy to determine a priori the scale length factor in order to achieve the desired volume cell count. This can only be done for structured hex meshes, where cell number and edge length scale directly. Therefore, after certain
Figure 5.13
Resulting Layers for Isotropic Surface Mesh (Top) and Anisotropic (Bottom)
113
trial and error runs, we ended up with a length scale multiplying factor of 1.2 to 1.25. This resulted in volume cell count changes of 1.6 to 1.8 between the different levels of refinement. Using the batch mesh and simply changing the mesh type of all sessions, we also generated a quad dominant surface mesh for the coarse CRM case. Figure 5.14 displays the two variations of surface mesh, tridiagonal dominant and quad dominant. The quad dominant mesh has 30% fewer shell elements for the same mesh resolution. The only problem that may arise with a quad dominant mesh is that due to the fact that the near wall layers have extreme aspect ratios, there may be curved areas of the model where these quads may also have considerable warping. The combination of warping and high aspect ratio may lead to problems in the solution. At the time of the HLPW-3 the quad dominant meshes were not prepared, so no simulations were performed for them. Currently ANSA development work for the next version focuses on the integration of anisotropic meshing of leading and trailing edges inside Batch Mesh tool, thereby eliminating any manual work for the user.
Figure 5.14
Close ups of Coarse CRM Gapped Flap Model with Comparison of Tridiagonal Dominant (Top) vs. Quad Dominant (Bottom) Surface Mesh
114
Volume Meshing Volume meshing is also a part of the Batch Mesh. Two scenarios were created, one for layers and one for volume meshing. The scenarios were setup once for the CRM and JSM models and then with simple modifications in their parameters (growth rate, max size etc.) were executed automatically in order to generate the final volume meshes. 5.3.4.1 Extrusion Layers Generation The generation of layers is the most demanding part of the meshing process as the there are many factors that should be considered: very high aspect ratio elements whose quality is difficult to control, large total boundary layer height, resulting in proximity issues, especially around the areas of the flaps and slats, where the gaps are small. ANSA layers generation algorithm is very robust and controllable, with characteristics like: ➢ Generation of hex or penta layers from quad or triangle surface mesh. ➢ Generation of initial layers without growth for better refinement of the near wall region. ➢ Generation of initial layers without vector smoothing ensuring high orthogonality near the wall. ➢ Advanced smoothing algorithm to overcome problems of layers extrusion in concave areas. ➢ Generation of layers with different growth rate, number and first height from different zones of the model. ➢ Local element squeezing and collapsing at proximities to avoid intersections and bad quality. ➢ Local collapsing when a target aspect ratio is reached, ensuring a nice volume ttion with the tetra mesh to be connected. Layers squeezing and collapsing modes work in combination. The user can specify a maximum aspect ratio that the elements can attain when squeezed in order to overcome proximities. If this limit is exceeded then ANSA switches to local layer collapsing. Collapsing works for both penta and hex elements. Depending on the number of nodes that need to be collapsed in a certain area, pyramid and tetra elements are created out of the original penta and hex elements. No collapsing of course must take place at the first layers as that would result to very skewed tetras and pyramids. As the layers grow thicker however, collapsing does not compromise the quality of the resulting elements. In contrast to the recommended meshing guidelines of the workshop, the first layer height was kept constant throughout the mesh refinement study. The reason for this is that the initial simulations that were performed showed that a y+ value of just below 1 was achieved with these values, so there was no reason to change this parameter, as it was set to its optimum value. During the mesh refinement study the growth rate of the layers was reduced from 1.25 for the coarse mesh to 1.1 for the fine mesh. The first two layers were kept with constant height, as prescribed by the meshing guidelines. The number of layers was increased for the finer meshes in order to maintain the same total boundary layer height. In addition, the number of layers differed between the main wing and the fuselage. The reason for this was that the surface mesh length on the wing was smaller than that of the fuselage. As a result we needed more layers from the fuselage in order to reach a layer thickness with aspect ratio just below 1 so as to have a nice volume ratio between the last layer and the first tetra or pyramid to connect on it191. Hex layers growing from quad surface mesh are also checked in every step for warping. In certain cases, due to local squeezing at proximities, if the top cap warping exceeds a user specified threshold, ANSA splits the hex into two pentas, so as to avoid having highly warped quads that would have a negative effect in the pyramid generation for the tetra
Vangelis Skaperdas, and Neil Ashton, “Development of high-quality hybrid unstructured meshes for the GMGW-1 workshop using ANSA”, AIAA, January 2018. 191
115
meshing. For further details regarding the meshing, consult the192. 5.3.4.2 Tetra Meshing After layers generation is completed, the third and final Batch Mesh scenario is executed. It consists of the automatic detection of the boundaries of the external volume, and its meshing with tetra elements using the TetraRapid volume meshing algorithm. This algorithm is a hybrid advancing front Delaunay, optimized for speed, smooth size variation and robust surface capturing even in aerospace applications where map anisotropic high aspect surface mesh is present and size variations exist from the surface of the model to the far field boundary of up to one hundred thousand orders of magnitude. Even in such cases, and despite of the fact that it runs on a single thread, it manages to generate high quality tetra mesh at the speed of one to three million tetras per minute, depending on the complexity of the domain and the presence of additional refinement Size Boxes. The growth rate of the volume mesh was set to 1.15. Figure 5.15 shows the medium JSM mesh.
Figure 5.15
Volume Mesh of the JSM
Sample CFD Results Full details of the results are given in [Ashton et al.]193 however a brief sample of the results are provided here to demonstrate the performance of the meshes generated. Simulations were undertaken in STAR-CCM+ and OpenFOAM in order to assess the accuracy and robustness of OpenFOAM against a popular commercial code. In OpenFOAM a segregated pressure-based solver (rhoPimpleFoam) is used with local time-stepping to accelerate steady-state convergence. Second order upwind schemes were used for the both momentum and turbulence quantities with a greengauss scheme for the gradient operators. In STAR-CCM+ a fully implicit compressible density based See Above. N. Ashton, M. Fuchs, C. Mockett, and B. Buda, “EC135 Helicopter Fuselage, ”Go4Hybrid: Grey Area Mitigation for Hybrid RANS-LES Methods”, C. Mockett, W. Haase, and D. Schwamborn, Springer International Publishing, 2018, pp. 2013–2015. 192 193
116
scheme is used with the Roe scheme for the flux. A green-gauss scheme with a min-mod limiter was used for the gradient calculations and a second order upwind scheme was used for both the momentum and turbulence quantities. 5.3.5.1 CRM The flow conditions for the CRM geometry are a Reynolds number of Re = 3.2 x 106 and a Mach number of M = 0.2, however as the geometry is full-scale the flow parameters are adjusted to achieve the required Reynolds number. The viscosity is computed using Sutherlands Law and the density is based upon the ideal gas law. Simulations are conducted at 8 & 16 degrees angle of attack and for both STARCCM+ and OpenFOAM the SpalartAllmaras turbulence model is used. Figure 5.16 displays the Lift and Drag coefficients for the CRM geometry at 8 degree for STAR-CCM+ and OpenFOAM. There is a clear mesh refinement trend for both codes, suggesting that even finer meshes would be required to reach a mesh converged solution for the lift. Given the finest mesh is 269 M cells, it is likely that a meshes up to a billion cells might be required. The agreement between OpenFOAM and STAR-CCM+ is within 0.5% for the lift coefficient and less than 2% for the drag coefficient. They show the same outboard flap separation with the size and position being almost identical. Figure 5.16 Lift and Drag Coefficients for CRM Geometry This less than 2% difference to a popular at 8 degree AoA using OpenFOAM and STAR-CCM+ commercial CFD code would suggest that OpenFOAM is a competitive tool for engineering analysis, which reflects the recent findings of [Ashton et al.]194. 5.3.5.2 JSM Close agreement between OpenFOAM and STAR-CCM+ was observed for the CRM geometry, however without experimental data it is not possible to assess the accuracy. The JAXA Standard Model (JSM) high-lift model is similar to the CRM but has a detailed experimental data set making it ideal to assess the accuracy of OpenFOAM and STAR-CCM+. The flow conditions are a Reynolds number of Re
N. Ashton, M. Fuchs, C. Mockett, and B. Buda, “EC135 Helicopter Fuselage,” in Go4Hybrid: Grey Area Mitigation for Hybrid RANS-LES Methods, vol. 134, C. Mockett, W. Haase, and D. Schwamborn, Eds. Cham: Springer International Publishing, 2018, pp. 2013–2015. 194
117
=1.9x106 and a Mach number of M = 0.172. The viscosity is computed using Sutherlands Law and the density is based upon the ideal gas law. Simulations are conducted at 4.36, 10.47, 14.54, 18.58, 20.59, 21.57degrees angle of attack and all simulations use the Spalart Allmaras turbulence model. Figure 5.17 shows the lift and drag coefficient throughout the angle of attack range using OpenFOAM and STAR-CCM+ for the geometry (no nacelle). It can be seen that there is again close agreement between STAR-CCM+ and OpenFOAM, with only changes becoming clear in the post-stall region. At 4.36 degree, the flow is completely attached in both CFD and the experiment, which is reflected in the close agreement between CFD and experimental for the lift in the lower angle of attack range. At 18.57 degree, just before stall, the agreement in the total lift is close, however the flow structures start to exhibit slightly too much stall in the outboard wing section. By 21.57 degree where the flow is now stalled, the agreement is close but actually for the wrong reason. Whereas the experimental flow-vis shows both separation at the root and the most outboard region of the wing, the CFD (both STAR-CCM+ and OpenFOAM) show almost no separation at the root and much larger separation at the outboard of the wing. The total amount of separation is roughly similar which explains why the lift and to a lesser extent the drag follow the experimental values. Given that all simulations were undertaken with the Spalart-Allmaras model with no corrections for curvature nor anisotropy of the flow it is not surprising that the results do not perfectly correlate with the experiment. More details results for these cases are shown in [Ashton et al.]195. The results from both the CRM and JSM have shown that both STARCCM+ and OpenFOAM on ANSA generated grids can perform well for complex full aircraft geometries and in the case of the JSM, match experimental values up to the stall region. The next steps are to properly assess the code for transonic flows, which is the typical flow regime for Figure 5.17 Lift and Drag Coefficients for the JSM industrial aerospace simulations. Geometry using OpenFOAM and STAR-CCM+
N. Ashton and V. Skaperdas, “Verification and Validation of OpenFOAM for High-Lift Aircraft Flows,” Submitted to AIAA Journal, 2017. 195
118
Listing of Available Meshing Software Table 5.2 shows the list of currently available grid generation software (please be advised that some vendors and features might have been updated yet).
Grid Software 3DGRAPE ANSA CFD-GEOM CSCMDO EAGLEVIEW GAMBIT GEMS GENIE++ GRID* GRIDGEN GridPro ICEM-CFD IGG INGRID Hyper Mesh MACGS MBGRID MEGACADS NGP PEGSUS Pro-Star RAGGS RAPID SAUNA TGRID TIGER UNISG VGRID Table 5.2
Structured yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes -----yes yes yes yes -----yes yes ------
Un-Structured -----yes yes -----yes yes ---------------yes yes yes yes -----yes ---------------yes Chimera yes yes -----yes yes ----------yes
Hybrid -----yes yes ----------yes ---------------yes yes yes yes -----yes ---------------yes -----yes ----------yes ---------------------
Currently Available Grid Generation Software
119
6 Adaptive Mesh (Unstructured) The case for structured adaptive grid is covered before, therefore, will not be mentioned here, therefore, this section is intended for unstructured adaptive meshing. Aside from the treatment of complex geometries, the second main advantage of unstructured meshes is the ease with which solution-adaptive meshing may be implemented196. Since no inherent structure is assumed in the representation of the mesh, mesh points may be added, deleted, or displaced, and the mesh connectivity may be locally reconfigured in the affected regions. The goal of mesh adaptation is the determination of the optimum mesh-point distribution that results in equipartition of the error for each individual simulation. The character of the problem to be solved dictates the requirements of the mesh adaptation strategy. For example, steady-state problems usually involve a small number of adaptation phases as part of a lengthy solution process. Therefore, relatively sophisticated adaptation strategies can be employed, such as, in the extreme case, complete mesh regeneration. Mesh refinement procedures are most important here, while de-refinement has only a minor effect and can often be omitted for steady-state cases. For transient problems, mesh adaptation must be performed every several time steps, and thus efficiency is much more important than optimality. Mesh refinement and de-refinement are both essential for transient cases, as well as mesh movement for cases with moving boundaries. Furthermore, the accuracy of interpolation from the original mesh to the refined mesh affects the solution accuracy (unlike the steady-state case), and thus accurate transfer schemes are required. Delaunay-based mesh generation techniques can easily be extended to incorporate adaptive refinement capabilities [Mavriplis]197-198; [Weatherill]199. Once a solution has been obtained on an initial mesh, new points can be added in regions where high errors are detected. These new points can be triangulated into the mesh using the Bowyer-Watson point insertion algorithm. Alternatively, if a Non-Delaunay mesh is employed, new points may be inserted through element subdivision, and the connectivity of the resulting mesh may be optimized through several face-edge swapping passes based on any appropriate criterion. Rule-based hierarchical element subdivision is a very effective adaptive technique, particularly for unsteady flows, where efficiency and accuracy of interpolation between successive grids are important considerations [Stoufflet 1987, L¨ohner & Baum 1992, Rausch1992, Braaten & Connell 1996]. The essential approach consists in recursively subdividing mesh elements where large solution errors are detected, but conforming to a set of well-defined subdivision rules, which are necessary to prevent the formation of degenerate element shapes and connectivity. Storing the hierarchy of the recursive process enables de-refinement to be implemented by simply retracing the subdivision history. Hierarchical subdivision is also applicable to non-simplicial hybrid meshes by constructing a library of subdivision rules for each element type.
Adaptive Meshing by Subdivision In the interest of developing a single strategy for adapting simplicial as well as mixed element meshes, a hierarchical element subdivision approach has been adopted200. As described before, one must ensure that a compatible refinement pattern is obtained on all elements of the mesh if a valid refined meshes obtained. This technique can be applied to fully tetrahedral meshes, as well as to any Mavriplis, DJ:” Unstructured Grid Techniques”, Annual. Rev. Fluid. Mech. 1997 by Annual Reviews Inc. DJ., “Accurate multigrid solution of the Euler equations on unstructured and adaptive meshes”, AIAA J. 28(2):213–21 198 Mavriplis DJ., “Adaptive mesh generation for viscous flows using Delaunay triangulation”, J. Comp. Phys. 1990. 199 Weatherill NP, Hassan O, Marcum DL, “Calculation of steady compressible flow fields with the finite-element method”, AIAA Pap.93-0341 200 200 Mavriplis D.J., ”Adaptive Meshing Techniques For Viscous Flow Calculations On Mixed Element Unstructured Meshes”, NASA Contract No. NAS1-19480, May 1997. 196
197 Mavriplis
120
hybrid mesh containing mixtures of tetrahedral, pyramids, prisms and hexahedra. The resulting meshes can be employed by the multigrid solver described in201 without modification. In order to implement this technique on mixed element meshes, the various allowable subdivision types for each element type must be defined. The hierarchical rules required to prevent the degeneration of the grid quality with successive adaptation levels must also be constructed. For tetrahedral elements, the subdivision rules have already been well formulated in the literature. We allow only three basic subdivision types: A tetrahedron may be divided into 2 children, 4 children, or 8 children. The two former cases result in anisotropic refinement, while the last case produces an isotropic refinement. In order to prevent the degeneration of grid quality, any anisotropic children may not be refined further. If any such cells require refinement, they are removed, the parent cell is isotopically refined, and the resulting isotropic children may then be further refined. When limiting the possible refinement types. This is achieved by adding refinement points along the all appropriable edges on all elements which are flagged as having non-valid refinement pattern. Since the addition of a refinement point to an edge affects all elements which contain the edge, the process is applied iteratively, until all resulting elemental refinement are valid and no further points are required. The isotropic regiment of a hexahedra element results in eight similar but smaller hexahedral elements. However, anisotropic refinement of a hexahedral element results in children which may consist of hexahedra, pyramids, prisms and tetrahedral. By applying the same hierarchical rules as described for tetrahedral meshes we can ensure that lese elements will never be refined further. Instead, if further refinement ill these regions is desired, such elements are deleted and that parents refined into eight smaller hexahedra. Thus, for fully hexahedral meshes, additional element may only be the boundaries between refined and non-refined regions, or more generally, between two regions which differ by one refinement level. The task of implementing adaptive mesh subdivision elements other than tetrahedral consists in defining the minimum number of allowable subdivision types. On the one hand, it, is desirable to limit the number of subdivision types for complexity reasons. On the other hand, a minimum number of subdivision types must be implemented to allow for compatible subdivision types to be attained on all elements without, incurring excessive additional refinement202.
Type of Mesh Refinement Mesh movement or R-refinement (to be discussed later) has applications in both steady and unsteady flows. For example, R-refinement may be useful for optimizing the normal resolution of the mesh in a developing boundary layer or for clustering points around shock waves [Palmerio203, Castro-Diaz et al 1995]. For transient problems with moving boundaries, R-Refinement is indispensable. Difficulties center on conserving a minimum degree of grid quality under severe deformations. In areas where grid deformation becomes unacceptable, local reconnection through swapping techniques can easily be performed, but only for simplicial meshes [Kennon et al, Baum et al 1994], [Venkatakrishnan & Mavriplis]204. In practice, combinations of H and R-Refinement are
l). J. Mavriplis and Venkatakrishnan. A unified multigrid solver for the Navier-Stokes equations on mixed element meshes. AIAA Paper 95-1666, June 1995. 202 Mavriplis D.J., ”Adaptive Meshing Techniques For Viscous Flow Calculations On Mixed Element Unstructured Meshes”, NASA Contract No. NAS1-19480, May 1997. 203 Palmerio B.,” An attraction-repulsion mesh adaption model for flow solution on unstructured grids”, Computational Fluids 23(3):487- 506. 204 Venkatakrishnan V, Mavriplis DJ.,”Implicit method for the computation of unsteady flows on unstructured grids”, Proc. AIAA CFD Conf., 12th, San Diego. AIAA Pap. 95-1705-CP 201
121
often employed [Baum et al.]205, [Castro-Diaz et al]206 for such cases. Central to the implementation of any solution-adaptive scheme is the ability to detect and assess solution error (P-Refinement). The construction of a suitable refinement criterion represents the weakest point of most adaptive strategies. The main problem is that an exact characterization of the error requires a knowledge of the solution itself, which is obviously impractical. Most error estimates are based on the assumption that the solution is smooth and asymptotically close to the exact solution. This is often not the case for fluid dynamics problems, which are governed by nonlinear hyperbolic partial-differential equations. Solutions may contain discontinuities, and downstream flow features often depend on adequate resolution of upstream flow features. Most refinement criteria are heuristically based on (undivided) gradients and/or second differences of the various flow variables. Conservative criteria (i.e. over-refining) are often employed to compensate for the inability to accurately characterize the true solution error. Because adaptive meshing results in different mesh topologies for each simulation, even when the geometry of the problem is unchanged, parametric studies (typically used in design processes) are complicated by the requirement to distinguish between grid-induced and physical solution variations. Nevertheless, for problems with disparate length scales, adaptive meshing is often indispensable for resolving small flow features, and their full potential awaits the development of more well-founded adaptive criteria. Mesh adaptation, often referred to as Adaptive Mesh Refinement (AMR), refers to the modification of an existing mesh so as to accurately capture flow features. Generally, the goal of these modifications is to improve resolution of flow features without excessive increase in computational effort. We shall discuss in brief on some of the concepts important in mesh adaptation. Mesh adaptation strategies can usually be classified as one of three general types: R-refinement, Hrefinement, or P-refinement as depicted in Figure 6.1.
(a) AMR R-refinement Figure 6.1
(b) AMR H-refinement
(c) Hanging Node
Adaptive Mesh Refinement types
R-Refinement (RR) This is the modification of mesh resolution without changing the number of nodes or cells present in a mesh or the connectivity of a mesh. The increase in resolution is made by moving the grid points into regions of activity, which results in a greater clustering of points in those regions. The movement of the nodes can be controlled in various ways. On common technique is to treat the mesh as if it is an elastic solid and solve a system equations (subject to some forcing) that deforms the original mesh. Care must be taken, however, that no problems due to excessive grid skewness arise. (See Figure 6.1 (a)).
Baum JD, Luo H, L¨ohner R., ”A new ALE adaptive unstructured methodology for the simulation of moving bodies”, AIAA Pap. 94-0414. 206 Castro-Diaz MJ, Hecht F, Mohammadi B.,”Anisotropic unstructured mesh adaptation for flow simulations”, Int. Mesh Roundtable, 4th, Albuquerque, NM, pp. 73–85. 205
122
H-Refinement (HR) The modification of mesh resolution by changing the mesh connectivity. Depending upon the technique used, this may not result in a change in the overall number of grid cells or grid points. The simplest strategy for this type of refinement subdivides cells, while more complex procedures may insert or remove nodes (or cells) to change the overall mesh topology. In the subdivision case, every "parent cell" is divided into "child cells". The choice of which cells are to be divided is addressed in Figure 6.1 (b). For every parent cell, a new point is added on each face. For 2D quadrilaterals, a new point is added at the cell centroid also. On joining these points, we get 4 new "child cells”, (3 in tetrahedral). Thus, every quad parent gives rise to four new off springs. The advantage of such a procedure is that the overall mesh topology remains the same (with the child cells taking the place of the parent cell in the connectivity arrangement). It is easy to see that the subdivision process increases both the number of points and the number of cells. An additional point to be noted is that this type of mesh adaptation can lead to what are called "hanging nodes." In 2D, this happens when one of the cells sharing a face is divided and the other is not, as shown in Figure 6.1 (c). For two quad cells, one cell is divided into four quads and other remains as it is. The highlighted node is the hanging node. This leads to a node on the face between the two cells which does not belong (properly) to both of the cells. The node "hangs" on the face, and one of the cells becomes an arbitrary polyhedron. In the above case, the topology seemingly remains same, but the right (undivided) cell actually has five faces. Figure 6.2 show a mesh modeling supersonic flow around a space shuttle in which h-method adaptivity has been employed to optimize the mesh structure to produce accurate simulation of flow features important in assessing the performance of the design such as the profiles of pressure distribution shown207.
Figure 6.2
207
An H-refinement mesh about a shuttle-like body (left) and computed CP (right)
The National Academies Press, “Research Directions In Computational Mechanics”, 1991.
123
6.2.2.1 Isotropic vs. Anisotropic Meshing There are two ways of H-Refinement: Isotropic and Anisotropic. Anisotropic is the property of being directionally dependent, as opposed to isotropy, which implies identical properties in all directions. In isotropic refinement, new points are added in both the directions, say x and y. In anisotropic refinement, the division takes place in one predominant direction (see Figure 6.3). Thus, in short, an isotropic refinement for a quad would produce four new off springs, while anisotropic refinement would only generate two. Anisotropic refinement is made use of, when the user knows that the flow feature is predominantly to be resolved in one direction, for e.g. Boundary Layers. However, there are situations where an anisotropic refinement alone may not be satisfactory, such as a shock-boundary layer interaction.
Figure 6.3
Isotropic vs. Anisotropic Meshing
P-Refinement (PR) A very popular tool in Finite Element Modelling (FEM) rather than in Finite Volume Modelling (FVM), it achieves resolution by increasing the order of accuracy of the polynomial in each element (or cell). In AMR, the selection of "parent cells" to be divided is made on the basis of regions where there is appreciable flow activity. It is well known that in compressible flows, the major features would include Shocks, Boundary Layers and Shear Layers, Vortex flows, Mach Stem, Expansion fans and the like. It can also be seen that each feature has some "physical signature" that can be numerically exploited. For e.g., Shocks always involve a density/pressure jump and can be detected by their gradients, whereas boundary layers are always associated with rotationally and hence can be detected using curl of velocity. In compressible flows, the velocity divergence, which is a measure of compressibility is also a good choice for shocks and expansions. These sensing parameters which can indicate regions of flow where there are activity are referred to as Error Indicators and are very popular in AMR for CFD. The spectral order p of the approximation is raised or lowered to control error. In finite element methods or boundary element methods, the order p corresponds to the degree of the polynomial shape function used over an element. Just as refinement is possible by Error Indicators as mentioned above, certain other issues also assume relevance. Error Indicators do detect regions for refinement, they do not actually tell if the resolution is good enough at any given time. In fact the issue is very severe for shocks, the smaller the cell, the higher the gradient and the indicator would keep on picking the region, unless a threshold value is provided. Further, many users make use of conservative values while refining a domain and generally end up in refining more than the essential portion of the grid, though not the complete domain. These refined regions are unnecessary and are in strictest sense, contribute to unnecessary computational effort. It is at this juncture, that
124
reliable and reasonable measure of cell error become necessary to do the process of "coarsening", which would reduce the above-said unnecessary refinement, with a view towards generating an "optimal mesh". The measures are given by sensors referred to as Error Estimators, literature on which is in abundance in FEM, though these are very rare in FVM. Control of the refinement and/or coarsening via the error indicators is often undertaken by using either the 'solution gradient' or 'solution curvature'. Hence the refinement variable coupled with the refinement method and its limits all need to be considered when applying mesh adaptation.
Adaptive Mesh Refinement (AMR) Background [Berger and LeVeque]208 addressed several deficiencies that existed in the established uniform grid methodologies. First, they applied the concept of Adaptive Mesh Refinement (AMR) in order to improve the accuracy in critical regions without adversely affecting the efficiency of the numerical integration scheme. The use of AMR effectively allowed the clustering of blocks of computational grids as the solution process evolved only in the region that they were needed (and not clustering entire grid lines), by using Richardson-type extrapolation error estimates to identify regions of large errors and adding grid blocks in those regions. An example of AMR is Figure 6.4 which represents a simple adapted grid for a supersonic wedge flow with four levels of adaption. As can be seen in the figure, there are more control volumes where gradients are to be expected, specifically along the surface to capture the geometry and along the oblique shock. In regions with small gradients, there is a lower density of control volumes. Also notice that in this figure there is at most a 2:1 ratio at the refinement interface, which is typical of most A MR schemes, in order to promote stability in the numerical schemes. One problem with [Berger and LeVeque's] original enactment Figure 6.4 Example Adaptive Grid for Supersonic Wedge Flow of AMR on Cartesian grids was the problem of state variable conservation during the AMR stages. They carefully constructed conservative schemes for the intergrid transfer to address the problem. They also used the idea of wave propagation and directional differencing in order to increase the stability near the small boundary cells. This helped keep the CFL of the boundary cells reasonably close to the CFL of the flow cells and allowed larger time steps to be taken with the solver remaining stable. Generalities Several researchers have extended [Berger and LeVeque's] research into areas such as multigrid Cartesian grids, higher accuracy flow solvers using more sophisticated flux approximations, timeaccurate unsteady flows, and a front tracking AMR scheme that attempted to track the discontinuities (such as shocks) as the solution evolved in order to provide more accuracy in the refined mesh M. J. Berger and R. J. LeVeque. An Adaptive Cartesian Mesh Algorithm for the Euler Equations in Arbitrary Geometries. 9th AIAA Computational Fluid Dynamics Conference, Buffalo, NY, June 1989. AIAA-89-1930-CP. 208
125
calculations. According to recent investigation by [Abe]209, Cartesian grid method fall into two categories with the demand of accurate solutions. One keeps its structured grid nature and introduces embedding structured sub grids within the underlying coarse structured grids. Adaptive Mesh Refinement (AMR) is one of them. Figure 6.5 (a) shows an example of AMR in two dimension. The intersected cells by a circle in the underlying coarse grids are tagged in blue. The blue-tagged cells are to be refined. In the AMR procedure, several embedded rectangle patches are defined so as to contain the blue tagged cells. Then, the embedded rectangle patch areas are refined. The other considers the Cartesian mesh as an unstructured collection of h-refined meshes. The data structure is not the same as structured grids but the same as unstructured grids. Adaptive Cartesian grid method was introduced as an unstructured Cartesian grid method and has shown the great success in simulating complex geometries. Figure 6.5 (a) shows a case of two dimensional adaptive Cartesian grid method. Beginning with a root cell covering whole domain, the intersected cells by the circle are recursively bisected. This simple procedure finally gives Figure 6.5 (b). The actual data structure (quad-tree) of a two dimensional adaptive Cartesian grid method is shown in Figure 6.6. The case shows a quad-tree structure. In this two dimensional case a tree node (a cell) may have four child nodes. In the case of three dimension, a node may have eight children. Level of a node is defined as the depth of the nest in the tree structure. The root node is specified as ’level 0’ (Figure 6.6)210.
(a) Intersecting meshes with a circle are tagged (blue) Figure 6.5
(b) 2D case of Adaptive Cartesian grid method
Schematic image of Adaptive Mesh Refinement
Hiroshi Abe, “Blocked Adaptive Cartesian Grid FD-TD Method for Electromagnetic Field with Complex Geometries”, International Conference on Modeling and Simulation Technology, Tokyo, JAPAN, 2011. 210 Each black circles indicates leaf nodes in the tree structure and they correspond to the cells as is shown with the numbers. 209
126
Figure 6.6
Octree Data Structure of Adaptive Cartesian Grid Method
Cell Division for a Geometry First, we describe the strategy to decide a cell to be divide into smaller cells which is described in211. The strategy gives a criteria which determines whether a intersected cell by triangular facets is to be divided or not. Next, a method which is a fast algorithm to find intersecting triangular facets with respect to a cell is described. 6.3.3.1 Division Criteria 3D geometry is often provided as a CAD file or STereo Lithography (STL) data . Both data may consist of a set of triangulated facets of the geometry’s surface. We need criteria to decide the cells to be divided in order to resolve the geometry through the triangulated facets. We adopt a curvature detection strategy212. Suppose a cell is intersected by triangular facets Ti . ni is the normal vector of the facets (Figure 6.7). Angle variation Vj can be defined as,
Figure 6.7 Schematic 2D view of angular variation of normal vector of triangles within cut-cell i. (a) is small variation case and (b) is large variation case.
Vj = Max(nkj − Min (nkj )
k ∈ Ti (j = x, y, z)
Eq. 6.1 211 M.J. Aftosmis. Solution adaptive Cartesian grid methods 212
See Previous.
for aerodynamic flows with complex geometries, 1997.
127
Ti. The angle which indicates the curvature of the facets is given by, .
cos (θi j ) =
Vj ⃗| |V
(2)
Eq. 6.2 If θ in a cell exceeds a predefined angle threshold, then the cell is tagged for division. This procedure for division is very simple and robust. One can have adaptive Cartesian cells automatically.
Figure 6.8
Pressure Contours in 2D Backward Step
Further examples provided a 2D backward step (see Figure 6.8), and 3D F16XL fighter jet using cut cells and AMR. (see Figure 6.9). Types of AMR The simplest refinement anyone can think of is to divide all cells in the domain. This is referred to as "Uniform Refinement". Although it does improve Figure 6.9 Flow Around a F16XL Fighter Jet using Cut Cells and AMR – (Courtesy of M. J. Aftosmis, M. J. Berger, and J. E. Melton) the solution vastly, it is easy to realize that we are going for a huge unwanted effort in doing so. For e.g., in the far field region of an airfoil, cell division is not bringing in any improvement because the flow such as a shock-boundary layer interaction. To achieve the goal of mesh adaptation, the refinement is done at "selected" regions alone based on certain criterion. This is referred to popularly as AMR or Adaptive Mesh Refinement. It is to be remarked that AMR does not only encompass division of cells into smaller ones (Refinement), but also the agglomeration of smaller cells into a larger one (De-Refinement or coarsening), when the need arises. Transient
128
Inviscid Flow Considers the solution of an internal transient inviscid supersonic flow (Lyra et al.)213. The geometry consists in a wind tunnel with a step and the inflow boundary condition consists of a uniform Mach 3.0 flow with angle of attack 0°. At the right boundary the flow is let free to leave the domain and along the walls, reflecting boundary conditions are applied. During the transient adaptive procedure several adapted meshes are generated along the time integration according to the error analysis. Figure 6.10 shows some selected meshes: mesh 3, is the third mesh generated during the transient adaptive process, and meshes 20, 27 and 29 are meshes generated before and after the time when the shock starts to be reflected from the top boundary. The mesh refinement is clearly following the physical features of the flow. The adaptive algorithm try to obtain an “optimal” mesh for a pre-defined number of elements. The target number of elements for this analysis was 1000 and a limited aspect ratio of 4 was considered. The number of elements generated in the meshes shown was 620, 977, 994 and 1010, and the corresponding number of nodes was 638, 1007, 1029 and 1047, showing that the procedure obeyed well the imposed constraints.
Figure 6.10 Selected initial meshes for the transient adaptive procedure (Meshes 3, 20, 27 and 29)
Case Study 1 – Unstructured Mesh Adaptation for 2D Airfoil214 In order to be able to examine shock-dominated processes at high spatial resolutions without incurring heavy computational penalties, even in two dimensions, it is desirable to use some form of mesh adaptation. Adaptive codes make use of the local flow solution itself to determine where the high spatial mesh resolution is required and then employ some strategy to increase the grid resolution in those regions. This enables the high spatial mesh resolution to be concentrated around the important flow features (e.g. shocks, vortices and so on) rather than being wasted on parts of the computational domain where the flow activity is relatively unimportant. One increasingly popular approach to mesh adaptation is so-called refinement, where additional mesh nodes and elements are inserted into the computational domain in regions where the greater resolution is required and then removed from the mesh when the higher mesh node density is judged to be redundant. The process of mesh adaptation is invoked automatically in response to some dynamically evolving flow solution Lyra, P.R.M., de Carvalho, D.K.E., Willmersdorf, R.B. and Almeida, R.C.C., 2002, “Transient Adaptive Finite Element Analysis of Compressible Flows”, WCCM'2002-Proceedings of the 5th World Conference on Computational Mechanics, Vienna-Austria. 214 David A. Venditti and David L. Darmofal, “Grid Adaptation for Functional Outputs: Application to Two Dimensional Inviscid Flows", Journal of Computational Physics 176, 40–69 (2002). 213
129
criteria, with the regions of mesh refinement corresponding to regions of significant flow activity where it is desirable to have increased spatial resolution (see Figure 6.12 and Figure 6.11).
Figure 6.11
Grid Adaption using Supersonic Flow for an Airfoil (bow shock)
How these criteria are chosen has important consequences for the overall operation of the adaptive solver. The complete adaptive solver may be thought of as consisting of three parts, • • •
mesh data structure, adaptation algorithm and flow integration algorithm, where these objects are organized as adaptation data structure integration
Thus the adaptation and integration operations can be thought of as two distinct processes that are applied to the central data structure. The connectivity outlined above is sufficient to completely specify a given mesh, but it does not contain the connectivity required to construct the adaption hierarchy. For this some additional information is required, which in the case of elements and edges consists of Figure 6.12 NACA 0012 test case: M∞= 0.8, α=1.25 storing parent and child addresses. The bisection of a parent edge by the addition of a node to the mesh results in the creation of two child edges. To extend the, sequence of events involved in a complete adaption and integration of the mesh is shown at first, mesh elements are flagged for adaption. This results in each mesh edge being targeted either for refinement, derefinement or no action data structure to include numerical parameters such as the flow variables.
130
6.3.5.1 Adaption Control Mechanism The Euler flow solver is combined with the adaptive algorithm by flagging regions of the mesh with (low) high density gradients for (de)refinement, with the calculation of local flow gradients being performed across element faces. Where the face normal density gradient falls below or exceeds a chosen tolerance, the edges on the face are flagged to de-regime. In addition, a `safety layer' of refinement flagging is employed to ensure the full capture of solution discontinuities, which is the principal concern for this application. Likewise, a maximum mesh refinement depth is also specified. Coupling the adaption algorithm to the solution integrator is managed in a similarly straightforward manner. Figure 6.12 depicts a NACA airfoil in a transonic flow, while Figure 6.11 shows the same geometry when placed in supersonic flow with a bow shock. Case Study 2 – Parallel Implementation of Unstructured Mesh Refinement of Duct Flow The simultaneous alteration of the decomposed domains of an unstructured mesh presents a number of challenges215. In parallel, each processor operates on its own partition, concurrent with and independent of the others. Previous work in parallel mesh refinement216-217 demonstrated methods in which adaptation was performed on each processor, and patterns for cell subdivision were (1) Original
(2) First Adaption Pass
(3) Cell Migration into inter processor boundary
(4) Second Addaption pass
Figure 6.13
Two-pass approach for parallel coarsening and refinement.
Cavallo, P.A., Sinha, N., and Feldman, G.M.,” Parallel Unstructured Mesh Adaptation For Transient Moving Body And Aeropropulsive Applications”, Combustion Research and Flow Technology, Inc. (CRAFT Tech), PA. 216 De Keyser, J., and Roose, D., “Run-Time Load Balancing Techniques for a Parallel Unstructured Multi-Grid Euler Solver with Adaptive Grid Refinement”, Parallel Computing, Vol. 21, pp. 179-198, 1995. 217 Flaherty, J.E., Loy, R.M., Shephard, M.S., Szymanski, B.K., Teresco, J.D., and Ziantz, L.H., “Adaptive Local Refinement with Octree Load Balancing for the Parallel Solution of Three-Dimensional Conservation Laws”, Journal of Parallel and Distributed Computing, Vol. 47, pp. 139-152, 1997. 215
131
exchanged across inter-processor boundaries, ensuring a conforming mesh. Coarsening the interprocessor boundary was not a concern, nor was the possible motion of the mesh boundaries. Therefore the first issue that arises in parallel adaptation is how to treat the inter-processor boundaries. Rather than modify these faces, the inter-processor boundaries are shifted using a cell migration technique. The inter-processor faces and adjacent cells then become interior faces and interior cells, which may be readily modified through a second adaptation pass. In the second pass only the former inter-processor boundary region needs to be coarsened, refined, or smoothed, as the remainder of the mesh is already consistent with the prescribed point spacing illustrates the twopass approach for solution-based coarsening and refinement of supersonic flow entering a duct. The original mesh partitions, shown in Figure 6.13-(1), are independently coarsened and refined to produce the adapted mesh of (2). Note that the inter-processor boundaries are not modified, which leaves a region of the mesh that still requires adaptation. Several layers of cells are migrated from the right processor to the left, as seen in (3). The inter-processor boundary is now to the right of its original location. A second coarsening and refinement pass treats the former inter-processor faces and adjacent cells, producing the final adapted grid of (4). A consequence of the cell migration approach is that the shape and extent of the decomposed domains change. The cell migration process may introduce new pairs of adjacent domains that did not initially communicate. Similarly, pairs of processors that once shared common nodes, edges, and faces may become disconnected as a result of cell migration. Updating the inter-processor communication schedule proceeds in two stages. First, the current communication lists are updated for each pair of adjacent domains. If no common nodes are found between two domains, the communication is removed from the cycle. The second stage involves checking for any new communication pairs introduced as a result of migration. In addition, one can no longer refer to the original decomposed grid to obtain data for solution transfer or for establishing point spacing after the coarsening phase. This issue is remedied by recomposing the global grid arrays at the start of the mesh adaptation process, such that the list of global vertex coordinates, solution vectors, and computed point spacing may be readily available to all processors. Case Study 3 – Generic Transonic Store Release218 The next application considered is the separation of a finned store from a wing/pylon configuration at Mach 1.2. Inviscid flow is assumed for this tetrahedral grid. A constant ejection force is applied over the first 0.1 seconds of the simulated separation. After the initial ejection stroke, the motion of the store is provided by general 6-degree-of-freedom (6-DOF) equations of motion using the current integrated surface pressure distribution. Gravitational acceleration is also included. Figure 6.14 provides an overview of the simulation. A total of ten adaptations were performed at regular intervals. The unstructured grid is comprised of approximately 2.7 million cells, and is decomposed on 16 processors. In this image, the store is colored by the current pressure distribution at each of the four Figure 6.14 Store position, orientation, and surface pressures at selected points in trajectory instants shown, and the black lines indicate 218 Cavallo,
P.A., Sinha, N., and Feldman, G.M.,”Parallel Unstructured Mesh Adaptation For Transient Moving Body And Aeropropulsive Applications”, Combustion Research and Flow Technology, Inc. (CRAFT Tech), PA 18947.
132
the changing inter-processor boundaries on the store surface resulting from cell migration and load rebalancing. As it translates, the store yaws nose away from the symmetry plane and pitches nose down. The surface pressure distribution reflects the changing local angle of attack and sideslip angle of the store. As the distance between the store and pylon surfaces increases, the mesh distortion becomes less severe. With each successive adaptation, the deformation measure reduces to a minimum value greater than the previous minimum. This indicates that mesh movement may likely be applied for a longer period of time before adaptation is warranted. Such strategies and tradeoffs are yet to be investigated. The evolution of the unstructured mesh as the store falls away is depicted in Figure 6.15 where inter-processor boundaries are highlighted in red. Through the adaptive coarsening and refinement procedures, overall mesh quality is maintained, and an appropriate cell distribution is provided as the distance between the store and pylon increases. Although Figure 6.15 illustrates a slice through the mesh, one can readily see the migration and rebalancing of the interprocessor boundaries219 as left(before), right(after) redistribution.
Figure 6.15 Adapted mesh partitioning during store dispense
To improve the partitioning through high aspect ratio cells, FLUENT® recently device a partitioning method based on grouping of the Laplace coefficients as shown in Figure 6.16. In addition, it improves convergence rate for cases with highly stretched cell.
P.A., Sinha, N., and Feldman, G.M., ”Parallel Unstructured Mesh Adaptation For Transient Moving Body And Aeropropulsive Applications”, Combustion Research and Flow Technology, Inc. (CRAFT Tech), Pipersville, PA. 219 Cavallo,
133
Figure 6.16
Inter-Processor partitioning based on Laplace coefficients
Mesh Modification Operators The tetrahedral region of the grid is locally refined by means of a constrained Delaunay refinement algorithm combined with a circumcenter point placement strategy220. Any inconsistency between the circumradius of a tetrahedron and a desired point density triggers the point insertion procedure. This iterative cell refinement is repeated until the cell circumradii are consistent with a prescribed point spacing. Coarsening of the tetrahedral region is also permitted through an edge collapse procedure. In regions where the grid is distorted or where solution errors are negligible, edges may be selected for removal. All cells incident to the deleted edge are removed from the mesh, the adjacent cells are redefined, and the two nodes of the edge are collapsed to a single vertex. The prismatic and hexahedral regions of the grid may be refined through cell subdivision procedures. As the boundary of the tetrahedral region is refined the adjacent prism layers are also modified. This is accomplished by splitting edges at the tet/prism interface, and propagating this subdivision down to the wall through all of the layers. In addition, a procedure is in place to refine entire layers of prisms if an improved boundary layer resolution is desired. The refinement of the hexahedral region of the grid is accomplished using the pattern formation procedure of Biswas and Strawn221, which employs a parent-child data structure to split the cells. Each hexahedral cell is then split according to a pattern, to generate 2:1, 4:1, or 8:1 sub-divisions. This cell subdivision creates buffer cells, which are tetrahedral, pyramid, or prismatic elements used to transition between different levels of hexahedral refinement, thus ensuring a conforming mesh with no hanging nodes. An initial point spacing ρ0 is defined for each vertex as the average edge length for all edges incident to the node. A larger grid spacing produces an iterative coarsening of the mesh. Using the mesh deformation measure, we modify the local grid spacing to be
ρ=
ρ0 σ where τ = min τ σ max
Eq. 6.3
And σi represent the dilatation of the tetrahedron in each of three principal directions, and are equivalent to the singular values of the transformation matrix. Note that the more deformed the cell, P.A., Sinha, N., and Feldman, G.M., “Parallel Unstructured Mesh Adaptation For Transient Moving Body And Aeropropulsive Applications”, Combustion Research and Flow Technology, Inc. (CRAFT Tech), Pipersville, PA. 221 Biswas, R., and Strawn, R.C., "Tetrahedral and Hexahedral Mesh Adaptation for CFD Problems", NAS Technical Report NAS-97-007, 1997. 220 Cavallo,
134
the larger the prescribed spacing, and hence an increased amount of coarsening will be performed. This improves the likelihood of the distorted cell being removed. Conversely, the enrichment procedures are invoked by specifying a smaller spacing. After the coarsening phase, an appropriate gradation of cell size is restored by solving a Laplace equation for ρ, using the boundary mesh spacing as Dirichlet boundary conditions. An approximate solution is obtained by summing the difference in the point spacing for all edges N incident to the node using a relaxation technique.
ρ n +1 = ρ n +
(
ε N n n ρk − ρ N k =1
)
Eq. 6.4
Prescribing new point spacing also drives solution-based coarsening and refinement. A variation on the solution error estimate developed in two dimensions by222 has been implemented in three dimensions for arbitrary mesh topologies. The method is based on forming a higher order approximation of the solution at each mesh point using a least squares approach. The difference between the higher order reconstruction from incident nodes and the current solution forms the error measurement. If the current mesh is sufficiently fine to support the spatial variation in the solution, the estimated error will be low, allowing coarsening to take place. Conversely, a high degree of error indicates additional refinement is needed.
C., Zhang, X.D., Trépanier, J.-Y., and Camarero, R., “A Comparison of Three Error Estimation Techniques for Finite-Volume Solutions of Compressible Flows”, Computer Methods in Applied Mechanics and Engineering, Vol. 189, pp. 1277-1294, 2000. 222 Ilinca,
135
7 Dynamic Meshing The moving-mesh provides a capability of tackling flow simulations where the domain shape changes during the simulation. In such cases, the computational mesh needs to adapt to the time-varying shape of the domain and preserve its validity and quality. The mesh motion solver support which calculates the internal point motion based on the prescribed motion of the boundary. The performance of the method is preserved through the choice of decomposition of cells, the bounded discretization and the use of iterative solvers223. We covered the dynamic mesh before a little bit with Adaptive Mesh Refinement (AMR) where it was characterized it as H, P, and R-Methods. To recap: • • •
H-Method - It involves automatic refinement or coarsening of the spatial mesh based on a posteriori error estimates or error indicators. The overall method contains two independent parts, i.e. a solution algorithm and a mesh selection algorithm. P-Method - the adaptive enrichment of the polynomial order. R-Method - The R-Method is also known as Moving Mesh Method (MMM). It relocates grid points in a mesh having a fixed number of nodes in such a way that the nodes remain concentrated in regions of rapid variation of the solution.
Where most of adaptive refinements is using R-Methods, with key ingredients which includes Interpolation of time dependent mesh equation224. In the Dynamic Mesh, the computational mesh is moved to follow the changing shape of the boundary by moving its points in every step of the transient simulation. The main difficulty in this case is maintaining the mesh validity and quality without user interaction where the performance will be quantified by speed, accuracy, robustness, and stability225.
Type of Mesh Motion Several deforming mesh algorithms have been presented in literature, with various approaches to defining mesh motion. The most popular method to date is the spring analogy226. Here, all point-topoint connections within the mesh are replaced by linear springs and point motion is obtained as a response to boundary displacement. However, this approach proved to lack robustness, particularly for arbitrarily unstructured (polyhedral) meshes. A review of merits and limitations of the spring analogy and its variants is given by [Blom]227. Other approaches to creating a robust mesh motion solver include the use of Laplacian smoothing 228 with the constant and variable diffusivity and the Pseudo-Solid Equation (static equilibrium equation for small deformations of a linear elastic solid)229 in Arbitrary Lagrangian-Eulerian (ALE) codes. In an effort to simultaneously control the
Hrvoje Jasak, ˇZeljko Tukovi´c, “Automatic Mesh Motion for the Unstructured Finite Volume Method”, ISSN 1333–1124, UDK 532.5:519.6. 224 Tao Tang, “Moving Mesh Methods for Computational Fluid Dynamics”, Contemporary Mathematics, 1991. 225 Hrvoje Jasak, ˇZeljko Tukovi´c, “Automatic Mesh Motion for the Unstructured Finite Volume Method”, ISSN 1333–1124, UDK 532.5:519.6. 226 Batina, J. T., “Unsteady Euler airfoil solutions using unstructured dynamic meshes”, AIAA Journal 28 (8) (1990). 227 Blom, F. J., “Considertions on the spring analogy, International journal for numerical methods in fluids”, (2000). 228 L¨ohner, R., Yang, C., “Improved ALE mesh velocities for moving bodies”, Communications in numerical methods in engineering 12 (1996), pp. 599–608. 229 Johnson, A. A., Tezduyar, T. E., “Mesh update strategies in parallel finite element computations of flow problems with moving boundaries and interfaces”, Computer methods in applied mechanics and engineering 119 (1994). 223
136
position of moving boundary and mesh spacing next to it, [Helenbrook]230 proposes the use of a biharmonic equation to govern mesh motion. Other methods includes Dynamic-Overset meshing, dynamic re-meshing using Radial-Basis Functions (RBF), Delaunay Method and mesh motion and dynamic re-meshing using a generalized grid interface (GGI)231. The Radial Basis Function (RBF) method and Delaunay Method which have been used widely in fluid-structure interaction. An analysis of dynamic-meshing techniques was one by quantifying the accuracy, robustness, stability, and speed of each one and while dynamic re-meshing via solution of a Laplace equation was robust and GGI was the fastest, Overset meshing was found to be the most stable and the most general technique for complex geometries and motions232. RBF proved to be too computationally expensive and unrealistic for 3D problem.
Mesh Deformation The mesh deformation problem can be stated as follows. Let D represent a domain configuration at a given time t with its bounding surface B and a valid computational mesh, as shown in Figure 7.1. During a time interval Δt, D changes shape into a new configuration D′. A mapping between D and D′ is sought in such a way that the mesh on D forms a valid mesh on D′ with a minimal distortion of control volumes. In this study, the displacement vector u is chosen as the dependent variable in the mesh motion problem. Thus, the point position in the deformed configuration is calculated as r´ = r + u where r ∈ D and r′ ∈ D′ are point position vectors.
Figure 7.1
Mesh Deformation Problem
Finite Volume in Dynamic Mesh With respect to dynamic meshes, we start with scalar transport equation as: ∂
⏟(ρφ) +
∂t Transient
Eq. 7.1
∂
∂
∂φ
(ρuj φ) = ∂x (Γφ ∂x ) + S⏟ φ ∂x j ⏟j ⏟j Source ⏟ Convection Diffusion Transport
Helenbrook, B. T., “Mesh deformation using the bi-harmonic operator”, International journal for numerical methods in engineering 56 (2003), pp. 1007–1021. 231 OpenFOAM ®. 232 Hrvoje Jasak, ˇZeljko Tukovi´c, “Automatic Mesh Motion for the Unstructured Finite Volume Method”. 230
137
Where ϕ is the general scalar quantity, ρ is the fluid density, and u i is the flow velocity vector. Furthermore, Γ is the diffusion coefficient and S is the source term. After integrating over a Control Volume and applying the divergence theorem, we obtain the integral form
( ) ( ) ρ + . ρ u − . Γ − S dV = 0 j V t Q x j V t (ρ ) dV + A (ρ u j ). dA = A Γ . dA + V S dV
Eq. 7.2
d (ρ ) dV + ρ (u i − u g ) . dA = Γ . dA + S dV dt V A A V Here, ug is the grid velocity of the moving mesh, and A is used to represent the boundary of the control volume V. The unsteady term (first term) could be written as
d (ρV) n +1 − (ρV) n ρ dV = dt v Δt
→ V n +1 = V n +
dV Δt dt
Eq. 7.3
Where dV/dt is the volume time derivative of the control volume. In order to satisfy the grid conservation law, the volume time derivative of the control volume is computed from Face Face δV dV j = u g .dA = u gj.A j = dt V Δt j j
Eq. 7.4
With δVj is the volume swept out by the control volume face j over the time step Δt. In the case of the sliding mesh, the motion of moving zones is tracked relative to the stationary frame. Therefore, no moving reference frames are attached to the computational domain, simplifying the flux transfers across the interfaces233. In the sliding mesh formulation, the control volume remains constant, therefore, dV/dt = 0 and Vn+1 = Vn
d (ρ ) n +1 − (ρ ) n V ρ dV = dt v Δt
Eq. 7.5
Dynamic Mesh Techniques Laplacian Mesh Morphing A computationally robust dynamic-mesh technique used in CFD is Laplacian Mesh morphing, which solves a Laplace equation to move the mesh. [Bos]234 used this method along with solid body rotation stress to compare with radial basis function interpolation while studying insect flight. [Bos] found 233 234
FLUENT 6.3 User’s Guide. Frank Martijn BOS, “Numerical simulations of flapping foil and wing aerodynamics”, PhD thesis, 2009.
138
that the Laplace equation method was not able to maintain high mesh quality around the boundary of a rectangle when it rotates, shown in Figure 7.2-(a). The cell skewness in the domain is highest near the body, while the remaining mesh is relatively unaltered. However, the method remained quite robust even with the complex geometry and high amplitude mesh motion. The mathematical representation for mesh motion via solution of a Laplace equation is
.(ku i,mesh ) = 0
,
k=
1 l2
Eq. 7.6
Where ui,mesh is the velocity of points in the mesh and k is a distance function that minimizes the mesh distortion, and l is the distance to the moving boundary. The body is rotated or transformed in some manner described by the user and the points on the body are moved based on a coordinate transformation. The points surrounding the body are moved based on the Laplace equation above. There is a modest amount of error introduced before the cells surrounding the body are moved235. Pseudo-Solid Equation While the Laplace equation only allows direction-decoupled transfinite mapping, the pseudo-solid equation also allows rotation. However, this comes at a relatively high price: the pseudo-solid equation couples the components of the motion vector due to rotation. The choice here is either an increase in storage associated with the block solution of all displacement components or an iterative segregated solution method.
[.μu + μ(u)T + λtr(u)I] = 0
Eq. 7.7
7.4.2.1 Case Study – Motion of a Cylinder236 The case consists of a circle moving in a channel in 2D. An identical setup and a triangular mesh has been used by [Baker]237 with the pseudo-solid equation, and [Helenbrook]238 on the bi-harmonic equation. A polygonal mesh used for the test, where D is the cylinder diameter, the height of the channel is 2D and average mesh size is 0.15D. The first test consists of the determination of the maximum displacement of the cylinder in one step without mesh inversion when the outside boundary remains fixed. Mesh quality is determined in terms of the non-orthogonality angle αf. For reference, on the initial polygonal mesh αf,max = 18.45◦ and αf,mean = 0.34◦. The deformed meshes obtained using the Laplace and Pseudo-Solid mesh motion equations for one step maximum cylinder displacement are shown in Figure 7.2 (a-b). Maximum achievable single-step cylinder displacement is Δmax = 0.636D for the Laplace equation and Δmax = 0.995D for the pseudo-solid equation. In transient simulations, the mesh is moved in a number of time-steps. This situation will be examined by repeating the above test, but with the prescribed cylinder motion of 0.15D per timestep until the mesh becomes invalid. This equates to the effective Courant number of unity, based on the boundary motion velocity. Figure 7.2 (c-d) shows that this approach allows a considerably higher deformation, because it handles the inherent non-linearity of the mesh motion problem. It is Gina M. Casadei, “Dynamic-Mesh Techniques for Unsteady Multiphase Surface-Ship Hydrodynamics”, A Thesis in Mechanical Engineering, Pennsylvania State University, December 2010. 236 Hrvoje Jasak, ˇZeljko Tukovi´c, “Automatic Mesh Motion for the Unstructured Finite Volume Method”, ISSN 1333–1124, UDK 532.5:519.6. 237 Baker, T. J., Mesh modification for solution adaptation and time evolving domains, 7th International Conference on Numerical Grid Generation in Computational Field Simulations, Whistler, British Columbia, Canada, 2000. 238 Helenbrook, B. T., Mesh deformation using the biharmonic operator, International journal for numerical methods in engineering 56 (2003), pp. 1007–1021. 235
139
interesting to notice that the Laplace and pseudo-solid equations allow the same cylinder displacement Δmax = 1.2D, contrary to the previous test. On the other hand, the increased cost of solving the pseudo-solid equation compared to the Laplace equation does not seem to be justified with the higher allowed single-step mesh deformation239. Radial Basis Function240 A common problem in CFD is maintaining high mesh quality during large transformations and rotations, as shown in the Laplace equation method as described before. One mesh technique that can handle large mesh deformations is based on the interpolation of Radial Basis Functions (RBF). This technique can offer superior mesh motion in terms of mesh quality on average but can be computationally expensive. It is critical when using RBF that the mesh quality remains high. If the
Figure 7.2
Cylinder Motion in 2D
worst mesh quality is too low, the simulation will diverge. However, if the mesh quality remains high, the simulation will remain stable, accurate and efficient. Bos 241 studied the wing performance for flapping wings of insects at small scales. The RBF method can handle this motion by interpolating the displaced boundary nodes on the surrounding mesh. Bos also studied the difference between using the Laplace equation with variable diffusivity, solid body rotation stress equation and RBF. The skewness and non-orthogonality values were compared for all cases and the RBF showed higher mesh quality for both skewness and non-orthogonality. Tukovi´c, ˇZ. “Finite volume method on domains of varying shape (in Croatian)”, Ph.D. thesis, Faculty of mechanical engineering and naval architecture, University of Zagreb, 2005. 240 Gina M. Casadei, “Dynamic-Mesh Techniques for Unsteady Multiphase Surface-Ship Hydrodynamics”, A Thesis in Mechanical Engineering, Pennsylvania State University, December 2010. 241 Frank Martijn BOS. Numerical simulations of flapping foil and wing aerodynamics. PhD thesis, 2009. 239
140
Figure 7.3
Mesh Deformation via Laplace & RBF Methods
Figure 7.3-(b) clearly displays that the RBF deforms around the rotating rectangle, unlike the Laplacian mesh motion (Figure 7.3-(a)) which has highly skewed cells around the rectangle. The high mesh quality is more preserved in regards to RBF. However, RBF requires much more computational effort between iterations during the mesh update scheme, which is a huge downfall to this method. The interpolation function s(x) as defined below describes the displacement of all computational mesh points by summing a set of basis functions: Nb
(
)
s(x) = γ j x − x b j + q(x) j=1
where x b j = [ x b j , y b j , z b j ]
Eq. 7.8
are boundary value displacemen t
Furthermore, q is a polynomial, Nb is the number of boundary points, ϕ is a given basis function as a function of the Euclidean distance x. One of the first steps in solving equation is to evaluate the interpolation function s(x) in the known boundary points in equation, s(xbj) = Δxbj where Δxbj contains the known discrete values of the boundary point displacements. Generalized Grid Interface The Generalized Grid Interface (GGI) refers to a grid on either side of two connected surfaces, where the grid connectors do not have to match. GGI connections allow non-matching of nodes which can be beneficial for many reasons. The main advantage to this meshing technique is that it does not have to adapt the topology of the mesh at the interface between two non-conformal meshes. Each of the GGI regions can be different sizes, but cannot have overlap regions. One paper studies the use of a GGI for the application of turbomachinery242. GGI can be described as using weighed interpolation to evaluate and transmit flow values over patches in the mesh. These flow values are controlled from 242 M. Beaudoina and H. Jasak. “Development of a Generalized Grid Interface for Turbomachinery simulations with
OpenFOAM”. Open Source CFD International Conference, 2008.
141
the master patch to the shadow patch through a set of finite volume method discretization reasoning. The downfall to this method is that even with minimal error in the master patch variable, unacceptable discretization error can occur243. The GGI weighting factors relate to the percentage of surface intersection between two overlapping faces. The GGI method uses the Sutherland-Hodgman algorithm in OpenFOAM® to compute the master and shadow face intersection surface area. This algorithm must be used with convex polygons only, which could cause problems with complicated geometries where non-convex polygons are present. Inaccuracies can also occur at the border between a rotating and fixed part of the mesh due to possible gaps between the faces. The objective here is to mimic behavior of sliding interface without changing the mesh. (See Figure 7.4).
Figure 7.4
GGI interface
The GGI design rationale with respect to examples like Turbomachinery is: •
243
Apart from “fully overlapped” cases, turbomachinery meshes contain similar features that should employ identical methodology, but are not quite the same.
Same as previous.
142
• • • • •
Non-matching cylices for a single rotor passage. Partial overlap for different rotor-stator pitch. Mixing plane to perform averaging instead of coupling directly.
Component coupling requires data manipulation (copy, transform, average). In such cases, the behavior is closer to a coupled boundary condition, but the numeric is similar to sliding interface244.
Overset Methods One method of grid generation that has many advantages is an overset-grid approach. This process involves constructing several blocks that are overlapping, made up of structured or unstructured grids. Partial differential equations are solved on each component and boundary information is then exchanged between these grids based on interpolation245. The unused grid points are cut from the solution known as hole points. The points that are overlapped between grids are known as fringe points. The interpolation points are identified as the points that interpolate between the overlapped grids to obtain a solution246. Figure 7.5-(a) shows an example of a boundary layer grid and a background grid. Figure 7.5-(b-c) displays an overset grid arrangement showing hole, interpolated and active points correlates for a ship motions using dynamic overset grids247. This method uses rigid overset grids that move with relative motion at large amplitude motions. The code Suggar is used to obtain interpolation coefficients between the grids at each time step that the grid is moved. The overset grid comparison with experimental data for sink age, trim, and resistance showed good comparison proving that this meshing technique allows accurate computations of ship flows in motion.
(b) Overset Mesh Motion with no rotation
(c) Overset Mesh Motion with 45°Rotation
(a) Initial Overset mesh Figure 7.5
Overset Method
Hrvoje Jasak, “General Grid Interface Theoretical Basis and Implementation”, Wikki Ltd, United Kingdom. S.E. Sherer and J.N. Scott. “High-order compact finite-difference methods on general overset grids”. Journal of Computational Physics, 210(2):459–496, 2005. 246 P.M. Carrica, R.V. Wilson, R.W. Noack, and F. Stern, “Ship motions using single phase level set with dynamic overset grids”, Computers and Fluids, 36(9):1415–1433, 2007. 247 See previous. 244 245
143
Delaunay Method Delaunay method used in mesh motion divide into four steps: First, we generate the Delaunay graph according to the geometry boundary. The Delaunay criterion is that the circum-circle for triangles or the circum-for tetrahedron should not include other points except the points which construct the triangular or tetrahedron. If the geometry boundary is convex, this mesh can always proceed and unique. Usually, wing surface and far boundary points take as geometry to generate the Delaunay triangular. After the Delaunay triangular generation, all spatial nodes should locate in its Delaunay triangular. For a point p, search the triangular which contain this point and calculate the surface or volume coordinates as
ej =
Sj S
j = 1,2,3
ej =
Vj V
j = 1,2,3,4
Eq. 7.9
The key step in Delaunay method is moving the Delaunay triangular base on boundary deformation. All the connectivity and vertex index should be kept. If the deformation is too large, triangular deformation may failure. In this case, split the deformation into two shell steps and go back to step 1 regenerating the Delaunay triangular. At last, relocate the spatial node. According to the surface or volume coordinate at step2, turn them into Cartesian at the moved triangular. As equation : 4
xp = ei xi i =1
Eq. 7.10
7.4.6.1 Case Study - Airfoil Rotation In this case, NACA 0012 airfoil will rotate about its back edge 30 degrees. All the fluid uses a structure
(a) mesh before deformation
(b) initial Delaunay triangular
(c) Delaunay triangular after deformation
(d) dynamic mesh by Delaunay
Figure 7.6
Delaunay Method of Dynamic mesh
144
mesh with lowest quality 0.7. The surface girds are quad with 200 nodes and spatial grids are hexahedron with 40325 nodes. Figure 7.6-(a) demonstrates the mesh before deformation. For Delaunay method, first step is generating Delaunay triangular according to geometry boundary as Figure 7.6-(b) displayed. Then, compute the surface coordinates of spatial nodes in Delaunay triangular. After the geometry deformation, the Delaunay triangular will deform as Figure 7.6-(c). By keeping the surface coordinates unchanged, we relocate the spatial nodes in Cartesian coordinates. Figure 7.6-(d) show the mesh after deformation248. Spring Analogy Other technique is the spring analogy, where the mesh nodes are connected through tension springs, where the stiffness is related to the length of the edge. This approach tends to produce highly deformed meshes with collapsed or negative volume and is incapable of reproducing solid body rotation. The tension spring model has been improved by attaching torsion springs to each vertex where the stiffness is related to the angle. Six Degrees of Ferndom (6 DOF) 7.4.8.1 Transitional Deformation The grid was deformed in the y- and z-directions using a spring analogy technique. The 6DOF solver uses the object's forces and moments in order to compute the translational and angular motion of the center of gravity of an object. The governing equation for the translational motion of the center of gravity is solved for in the inertial coordinate system. As an example, Figure 7.7 shows the mesh after the translational deformation for a wing. The original un-deformed mesh is shown in grey color, and the deformed mesh is shown in red. In this case the tip deformation along the y-axis is 20% of the wing semispan249.
Figure 7.7
Mesh before and after the translational deformations
7.4.8.2 Rotational Deformation The rotational grid can be obtained by multiplying the original grid with the matrix on R as:
JIA Huana, SUN Qin b, “A Comparison of Two Dynamic Mesh Methods in Fluid –Structure interaction”, School of Aeronautics, Northwestern Polytechnic University, Xi‘an china. 2nd International Conference on Electronic & Mechanical Engineering and Information Technology (EMEIT-2012). 249 Joaquin Ivan Gargoloff, “A Numerical Method For Fully Nonlinear Aero-elastic Analysis”, Dissertation, Submitted to the Office of Graduate Studies of Texas A&M University in partial fulfillment of the requirements for the degree of Doctor of Philosophy, 2007. 248
145
Cθ C ψ C θ Sψ - Sθ R = S SθCψ - C Sψ S SθSψ + C Cψ S Cθ C Sθ C ψ + S Sψ C SθSψ − S C ψ C Cθ
Eq. 7.11
where, in generic terms, CX = Cos(X) and SX = Sin (X) . The angles φ , ϴ, and ψ are Euler angles that represent the following sequence of rotations: • rotation about the x-axis (e.g., roll for airplanes) • rotation about the y-axis (e.g., pitch for airplanes) • rotation about the z-axis (e.g., yaw for airplanes) Figure 7.8 illustrates an transitional (y axis) + rotation about x axis.
Undeformed
Figure 7.8
Deformed
Mesh Before and After the x-axis Rotational Deformation
146
8 Assessment of Mesh Types It is an old age question. Which is better? Structured or Unstructured meshes? Hexahedra (Polyhedral) vs Tetrahedral? It is a lengthy and heated debate which cannot be fully covered here. The answer may be depends in the case itself. In general, most people dislike unstructured meshes because of lack of direct control over the mesh and they produce more data points and cells than their structured ones, therefore, requiring more CPU. On the other hand, they mostly automated, easier to produce. An example using a backward step in a duct by means of all three types of meshing. The result clearly indicates that polyhedral meshing in superior. Error! R eference source not found. displays residual comparison for three cell types. Polyhedral Figure 8.1 Backward facing step in a duct using Polyhedral, Hexahedral and Tetrahedral cells cells got the best results, then hexahedral cells closely second, with tetrahedral counting as third. But be aware that this is a modest highly anisotropic flow, and could not be used as a decisive criteria.
Structured vs. Unstructured A major mesh generation vendor (Pointwise®) argues that Structured Meshing is not going away, mainly due to Control and Quality as the reasons are. Here are several factors they view including: Time and Memory You can fill the same volume with fewer hexes than Tets, thereby lowering the cell count and your CFD computation time and memory usage. Structured grids generally have a different topology than unstructured grids, so it is difficult to make a direct cell count comparison. At its simplest, each hexahedron can be decomposed into 5 Tetrahedral that share its edges, giving a 5:1 reduction in cell count for the same flow field resolution. The benefit to reducing cell count becomes very apparent when generating a mesh with a wide variation in resolved length scales; you will use many more Tets than you would Hex cells. Resolution Flow of a fluid will often exhibit strong gradients in one direction with milder gradients in the transverse directions (e.g. boundary layers, shear layers, wakes). In these instances, high quality cells are easily generated on a hex grid with high aspect ratio (on the order of one thousand or more). It is much more difficult to generate accurate CFD solutions on highly stretched tetrahedral. (Plus, not all stretched Tet are equal depending on the maximum included angles.) Alignment CFD solvers converge better and can produce more accurate results when the grid is aligned with the predominant flow direction. Alignment in a structured grid is achieved almost implicitly because grid lines follow the contours of the geometry (as does the flow), whereas there's no such alignment in an unstructured mesh.
147
Definable Normal Application of boundary conditions and turbulence models work well when there is a well-defined computational direction normal to a feature such as a wall or wake. Transverse normal are easily defined in a structured grid. To demonstrate, following example is used. Effect of Cell Topology in Truncation Error In general, structured mesh are more aligned with flow gradient, therefore, producing less truncation errors, as depicted in Figure 8.2250. In contrast, tetra cells, have angle with the flow direction as shown in previously. It is suffice to say that the argument is not as simple as case in 2D here, like so many things in CFD where no clear cut definitions are involved (an art?). While some application like Turbomachinery (with clear flow direction) prefer hex meshes, others depend on tet meshes. Basically it comes down to whom you talking and case in hand. While unstructured meshes offer better flexibility for today’s application, then Figure 8.2 Effect of truncation error on Hex and Tet cells lack strict control of structure and overheads of data base. Also the availability of resources should be factor. With advent of Polyhedral cells and their relatively ease of use some vendors such as CD-Adapco© and others are keen to pursue their use (economical concerns?). In fact CD-Adapco© been one of the pioneers of poly cell, argued against the Tet meshing, and for poly meshing, in a blog in titled “Natures answer to Meshing”. That may be true since most of nature is composed of different (patch work) topology. With hummer, it argues that “So how is it that honeybees (average brain size 1g) manage to out mesh those CFD engineers (average brain size 1250g) who still religiously rely on tetrahedral meshing”? With exception of course. (See the smart bee in Figure 8.3)251. But seriously, the case for/or against structures vs unstructured Figure 8.3 Average Bees Being Smarter than meshes with particular attention to Poly versus Tet CFD Engineer? (Courtesy of Stephen Ferguson) cells are argued in two folds as discussed below. Polyhedral vs. Tetrahedral The argument against the Tet cells versus Poly cells are relatively straight forward. Beside cell the count, a major advantage of polyhedral cells is that they have many neighbors (typically of order 10), so gradients can be much better approximated (using linear shape functions and the information 250 251
Sideroff, C,. “Multi-Block Structured Meshing and Pre-Processing for OpenFOAM Turbomachinery Analysis”. Stephen Ferguson, CD-Adapco Blog, “Nature’s Answer to Meshing”, 2013.
148
from nearest neighbors) than is the case with tetrahedral cells. Two of the most common methods for gradient calculation are the Green-Gauss and the Least Squares approaches252. Polyhedral cells are also less sensitive to stretching than tetrahedral. Smart grid generation and optimization techniques offer limitless possibilities: cells can automatically be joined, split, or modified by introducing additional points, edges and faces. Indeed, substantial improvements in grid quality are expected in the future, benefiting both solver efficiency and accuracy of solutions. Polyhedral cells are especially beneficial for handling recirculating flows. Tests have shown that, for example, in the cubic lid-driven cavity flow, many fewer polyhedral are needed to achieve a specified accuracy than even Cartesian hexahedra (which one would expect to be optimal for rectangular solution domains). In fact for a hexahedral cell, there are three optimal flow directions which lead to the maximum accuracy (normal to each of the three sets of parallel faces); for a polyhedron with 12 faces, there are six optimal directions which, together with the Figure 8.4 Polyhedral cells vs Tetrahedral cells larger number of neighbors, leads to a more accurate solution with a lower cell count. Although tetrahedral are the simplest form of volume elements and tetrahedral meshes are able to approximate any arbitrarily shaped continuum with a remarkable level of detail. Automated tetrahedral mesh generation methods have been well studied and developed, providing currently the only robust solution for meshing complex geometries in 3D, making them a standard choice of major CFD codes. However, despite the fact that tetrahedral present several geometric assets, such as planar faces and well defined face and volume centroids, they suffer from certain disadvantages that make analysts deem them inferior to hexahedra. Tetrahedral elements cannot provide reasonable accuracy, as soon as they become too elongated, which is often the case in boundary layers or sharp corners of the domain. Furthermore, they have only four neighbors making them not an optimal choice for CFD, as computation of gradients at cell centers can become problematic. It is, therefore, not unusual during simulations serious numerical stability issues to appear, additionally to the reduced accuracy, and problematic convergence properties to dominate the analysis. Figure 8.4 indicate the pro and con of Polyhedral cells vs Tetrahedral ones. 8.1.5.1 Boundary Prismatic Cells An issue for general unstructured cells, are boundary cells. Several remedies exist in order to Emre Sozer, Christoph Brehm and Cetin C. Kiris, “Gradient Calculation Methods on Arbitrary Polyhedral Unstructured Meshes for Cell-Centered CFD Solvers”, American Institute of Aeronautics and Astronautics. 252
149
overcome those disadvantages. A boundary layer, formed using prismatic elements along walls, is able to balance, up to a certain degree, the negative effects in accuracy and stability (see Figure 8.5left). Furthermore, advanced discretization methods combined with very fine meshes can result to accurate solutions and good convergence properties. This, however, demands for increased memory usage and computing time, while it makes the analysis code more complicated. Recently, an alternative option to tetrahedral meshes has emerged, suggesting the use of polyhedral elements instead253. Polyhedral over the same level of automatic mesh generation as tetrahedral do, while they are able to overcome the disadvantages adherent to tetrahedral meshes (see Figure 8.5-right). A major advantage of polyhedral occurs from the fact that they are bounded by many neighbors, making approximation of gradients much better that tetrahedral. Furthermore, they are much less sensitive to stretching and, since their typically irregular shape is not a restriction for several CFD codes, they over the possibility of post-processing and optimization without the strict geometric criteria that are necessary for optimizing tetrahedral, or even hexahedral meshes. On the negative side, polyhedral are usually of much more complex geometry than regular volumes, and, depending on the generation method, it cannot always be guaranteed that they are convex, or, even more, that their faces are planar. The topology of polyhedral meshes is, typically, also complex, preventing the implementation of efficient and easy to maintain generation algorithms from being straightforward. As a further consequence, polyhedral meshes require a considerable amount of adjacency relations, in comparison to tetrahedral and hexahedral meshes, making them candidates for resource expensive solutions. All the above set the basis for an interesting field of exploration in volume meshing. Previous studies on the subject have shown promising results, however polyhedral meshing is still far from becoming a standard practice in CFD simulations. Some explanations for this
Figure 8.5
Boundary prims cells for tetrahedral (left) and polyhedral (right) cells – (Courtesy of CDAdapco)
M. Peric, “Simulation of flows in complex geometries: New meshing and solution methods”, NAFEMS seminar: Simulation of Complex Flows (CFD). 253
150
may be its limited adoption from analysis codes and the fact that polyhedral are not an appropriate solution for every type of analysis. It should be mentioned that, currently, polyhedral meshes attract more attention in fields such as Computer Graphics and Medical Imaging, where in 3D volume rendering is of specific interest. However, the few researches dedicated to exploring polyhedral mesh generation for CFD remain active, making constant progress towards more efficient methods and high quality meshes.
Accuracy Assessment of Gradient Calculation Methods 254
An unstructured mesh, commonly depicted as consisting of tetrahedral elements, can be considered a superset encompassing any valid cell geometry including hexahedral, tetrahedral and arbitrary polyhedral. A survey of gradient reconstruction methods for cell-centered data on unstructured meshes is conducted within the scope of accuracy assessment. Formal order of accuracy, as well as error magnitudes for each of the studied methods, are evaluated on a complex mesh of various cell types through consecutive local scaling of an analytical test function. The tests highlighted several gradient operator choices that can consistently achieve 1st order accuracy regardless of cell type and shape. The tests further offered error comparisons for given cell types, leading to the observation that the “ideal” gradient operator choice is not universal. During implementation of an unstructured solver, a choice about where to place the discrete data must be made. Alternative choices include vertices, face-centers, cell-centers or a combination. While advantages and drawbacks of each approach have been heavily debated in the CFD community255-256 the current feel is that no clear “best” choice emerges. Gradient operator choice for an unstructured solver has a strong impact on accuracy, efficiency and robustness. While all of these are crucial factors, we limit our scope to the analysis of accuracy alone. Geometric Properties For detail calculation of geometric properties such as Polygonal Face Area and Centroid as well as Polyhedral Volume and Centroid, the reader should refer to [Sozer et al]257. Literature Survey [Aftosmis, et al.]258 investigated the behavior of linear reconstruction techniques on unstructured meshes. Their chief concern was the behavior of limiters and the effect of element types (triangular vs. Quadrilateral) for CFD solutions, particularly for high aspect ratio or irregular elements. They did however, investigate the least squares (LSQR) and Green-Gauss methods for gradient calculation. The methods behaved similarly for regular meshes whereas the LSQR was found to be more tolerant to mesh distortions. [Mavriplis]259 examined the LSQR procedure for gradient reconstruction, observing that the method produced accurate gradients for isotropic meshes but the accuracy deteriorated for highly stretched meshes in the presence of curvature. In the latter case, they found the Green-Gauss
Emre Sozer, Christoph Brehm and Cetin C. Kiris,”Gradient Calculation Methods on Arbitrary Polyhedral Unstructured Meshes for Cell-Centered CFD Solvers”, American Institute of Aeronautics and Astronautics. 255 Diskin, B., Thomas, J., Nielsen, E., Nishiwaka, H., and White, J., “Comparison of Node-Centered and CellCentered Unstructured Finite-Volume Discretization: Viscous Fluxes,” AIAA Journal, Vol. 48, No. 7, 2010. 256 Diskin, B. and Thomas, J. ,“Comparison of Node-Centered and Cell-Centered Unstructured Finite-Volume Discretization: Inviscid Fluxes,” AIAA Journal, Vol. 49, No. 4, 2011, DOI: 10.2514/1.J050897. 257 Emre Sozer, Christoph Brehm and Cetin C. Kiris, “Gradient Calculation Methods on Arbitrary Polyhedral Unstructured Meshes for Cell-Centered CFD Solvers”, American Institute of Aeronautics and Astronautics. 258 Aftosmis, M., Gaitonde, D., and Tavares, T., “Behavior of Linear Reconstruction Techniques on Unstructured Meshes,” AIAA J., vol. 33, no. 11, pp. 2038-2049, 1995. 259 Mavriplis, D., “Revisiting the Least-Squares Procedure for Gradient Reconstruction on Unstructured Meshes,”, AIAA Paper 2003-3986, 2003. 254
151
reconstruction method to be more accurate. [Shima, et al.]260 devised an LSQR method where they incorporate weights based on face areas, attempting to inherit benefits of the Green-Gauss method for stretched meshes. While they note accuracy improvements, they still resort to a hybrid approach where Green-Gauss method is used for thin and distorted mesh regions261. A comprehensive survey of unstructured mesh gradient methods, in the context of computer graphics, is conducted by [Correa, et al.]262. They focus on cost and performance in volume rendering with respect to mesh resolution, element shapes, neighborhood size and scalar field complexity. They find the inverse weighted regression method to provide the highest accuracy for irregular meshes and the Green-Gauss method to perform poorly for badly shaped elements. Gradient Calculation The difficulty in calculating gradients in an unstructured mesh stems from the lack of a consistent and inherent connectivity. The stencil for gradient calculation, as well as the corresponding coefficients vary cell-by-cell and are costly to compute. Hence, those are typically pre-computed and stored. Two of the most common methods for gradient calculation are the Green-Gauss and the Least Squares approaches. Both have several common variations, some of which are explained in the following sections. 8.2.3.1 Green-Gauss Gradient Method The Green-Gauss method represents an intuitive, sound basis for gradient calculation. According to the Green-Gauss theorem, average gradient of a scalar φ in a closed volume V can be obtained by
dV = nˆ dA V
,
=
A
1 nˆ dA V A
Eq. 8.1
Where ň is the surface unit normal vector and A is the surface area. For a 2nd order scheme with midpoint quadrature, the Green-Gauss method takes on the following discrete form for a polyhedral:
=
1 N faces f nˆ f Af V f =1
Eq. 8.2
Where Nfaces is the number of faces and φ͞f is the average of the scalar over the face f. Up to this point, average gradient of a linear function at the polyhedral cell centroid. The potential errors are introduced through the particular choice of a face averaging method to obtain φ͞f . Several common alternatives in this regard are discussed below.
Figure 8.6
GG simple face averaging
Shima, E., Kitamura, K., and Fujimoto, K., “New Gradient Calculation Method for MUSCL Type CFD Schemes in Arbitrary Polyhedra”, 48th AIAA Aerospace Sciences Meeting, Jan 4-7, Orlando, FL, 2010. 261 Shima, E., Kitamura, K., and Haga, T., “Green-Gauss/Weighted-Least-Squares Hybrid Gradient Reconstruction for Arbitrary Polyhedra Unstructured Grids,” AIAA Journal, Vol. 51, No. 11, 2013, DOI: 10.2514/1.J052095. 262 Correa, C., R., H., and K., M., “A Comparison of Gradient Estimation Methods for Volume Rendering on Unstructured Meshes,” IEEE Transactions on Visualization and Computer Graphics, vol. 18, no. 3, March, 2011. 260
152
8.2.3.2 GG-Simple Face Averaging Simple average of the cell center values at the left and right sides of the face is taken as the face center value (see Figure 8.6).
f =
c-left + c-right 2
Eq. 8.3
As the most basic approach, the simple averaging method is still commonly used due to its attractive properties of straightforward and cheap implementation. In fact, its usage is usually implied when cell-centered Green-Gauss gradient method is referred to without mention of the associated face averaging method. 8.2.3.3 GG-Inverse Distance Weighted (IDW) Face Interpolation Another popular approach to face averaging, IDW method utilizes the entire neighbor stencil around face f (see Figure 8.7). The result show difference in 90 degree bend, as shown in Error! Reference source not found.. It is clearly demonstrates the advantage of Hex cell over Tet in this example.. This also indicates a good agreement with experimental data using the hybrid mesh (Tet + Prism). As you clearly see the argument about which mesh to use is far from over and depending to whom you talking. It appears that case against the Tet cells is relatively straight, but Poly cells and Hybrid meshing is still debatable. With most vendors, have capability of offering both structured as well as unstructured meshes at will and table below displays the type of meshing available. Where the sum is carried out over the entire stencil and di = ri −rf represents the distance between the stencil point and the current face center. IDW has shortcomings when the neighboring cell centers are not evenly distributed around the face but clustered in certain directions; a scenario likely to occur for regions with poor grid quality or at the interfaces of different cell types in mixed cell type meshes. In addition to this non-isotropy, potentially large Figure 8.7 GG Inverse Distance Weighted (IDW) discrepancies in stencil distances may occur for Face Interpolation regions with poor grid quality or at the interfaces of different cell types in mixed cell type meshes. In addition to this non-isotropy, potentially large discrepancies in stencil distances may skew the weights significantly, a phenomena made worse by the usage of squared distances. Nonetheless, the squared weighting seems to be the most common approach taken with IDW and hence we chose to adopt it for our evaluation. Variations of this method involving different weightings (e.g. volume, inverse distance…) are possible but this does not change the fundamental flaws explained above. Other methodologies considered are: • • • •
GG-Weighted Least Squares (LSQR) Face Interpolation GG-Weighted Tri-Linear Face Interpolation (WTLI) Least Squares (LSQR) Gradient Method Curvilinear Gradient Method
153
Detailed information regarding these methods and more are available in263. N
f =
i
d i =1 N
Eq. 8.4
1
d i =1
2 i
2 i
Visual Inspection The gradient order of accuracy (GOA) for various aforementioned methodologies are presented in Figure 8.8 (a-f) for x-coordinates. Note that for a 2nd order scheme, a gradient operator of at least order 1 is needed. Figure (a) shows the distribution of GOA for the LSQR scheme with compact stencil. The operator is able to produce at least 1st order accuracy in the entire field. The cells with a uniformly spaced stencil that are aligned with x or y directions exhibit 2nd order accuracy in the corresponding directions. This is due to perfect cancellation of 1st order errors and it breaks down as soon as mesh uniformity is lost. The cancellation leading to the increased order now needs to be satisfied in a wider stencil. The Green-Gauss method with Simple averaging as well as IDW fails to achieve 1st order accuracy as seen in Figure 8.8 (b-c) respectively. Both of these methods neglect to incorporate directionality of their stencils and neither is linear-exact, i.e. can’t reproduce gradient of a linear function exactly. The WTLI and LSQR face interpolation methods for the Green-Gauss gradient yields very similar results (see Figure 8.8 (d-e)). The curvilinear gradient results, as shown in Figure 8.8 (f), are much like those of the LSQR with compact stencil. This is not surprising as both methods are linear-exact and both utilize compact stencils. Note that the curvilinear gradient operator has the most compact stencil of the alternative methods in scope here, utilizing at most 4 points (for 2D). Results Based on L2 Norm While order of accuracy is a crucial property to inspect, it is pertinent to look at the actual error levels as several of the gradient operator choices were demonstrated to satisfy 1st order accuracy. Figure 8.9 shows L2 error norms with respect to the refinement level. First we would like to clear the peculiar behavior of the Green-Gauss method with simple and IDW face averaging. It seem to approach a 1st order convergence rate before stalling at a fixed error level. This is due to the aforementioned inconsistency as they converge, in a 1st order manner, to a gradient value that is not consistent with the exact value. Note here that without a deep enough convergence study, this issue could have been overlooked, leading to a false conclusion that these methods are 1st order accurate. The rest of the operators are all linear-exact, and consequently they all consistently exhibit 1st order accuracy as it was apparent from the GOA distributions shown earlier on the test mesh. The error norms shown in Figure 8.9 now reveal that the Green-Gauss methods (with WTLI or LSQR face averaging) yield significantly larger errors compared to the curvilinear or the LSQR methods. Within the latter group, the LSQR compact has slightly lower error then the LSQR extended while the curvilinear method places in between.
Emre Sozer, Christoph Brehm and Cetin C. Kiris, “Gradient Calculation Methods on Arbitrary Polyhedral Unstructured Meshes for Cell-Centered CFD Solvers”, American Institute of Aeronautics and Astronautics. 263
154
(a) LSQR
(b) GG Simple
(c) GG IDW
(d) GG WTLI
(e) GG LSQR
(f) Curvlinear
Figure 8.8
Methodologies for various Gradient Order of Accuracy
It is possible to inspect errors for individual cells of various cell types. For regular cell types (square, equilateral triangle and right triangle), all the gradient operators are able to produce at least 1st order accuracy. In fact, the square cell type stencil yields 2nd order accuracy for each method. The curvilinear method produces a notably smaller error for this case. For irregular stencils, which are of greater practical interest, we start observing the familiar result of convergence stalling for the inconsistent schemes, namely the Green-Gauss method with simple or IDW face averaging. Discarding the special case of the square stencil, the LSQR gradient operator consistently produces the lowest errors except for the cases of thin triangles and thin quadrilaterals (commonly encountered in boundary layer regions of CFD meshes). For the thin cells, the trend reverses and the LSQR method yields the largest errors while the consistent Green-Gauss methods perform the best. Note that the thin cells mentioned here were sampled near the curved boundary region of the test mesh. Whereas the Green-Gauss method exhibited mediocre performance elsewhere, its favorable behavior in the crucial boundary layer type meshes demonstrates its appeal.
155
The errors associated with the curvilinear method were erratic, yielding the best result for the square cells and placing among the lower error range elsewhere with two exceptions; the thin quadrilateral and the arbitrary polyhedral where it exhibited the largest errors. This suggests that a smarter logic for stencil reduction (in 2D, down-selection of 4 stencil points) needs to be developed. Otherwise, we consider this method promising, considering that it has the most compact stencil, hence the lowest computational cost.
L2 Norm (vertical) vs Refinement level
Global L2 norm for x-direction vs various gradient method
Concluding Remarks Figure 8.9 Global Error Norms for x-Direction Gradient for A detailed accuracy study of Various Gradient Methods gradient calculation methods for cell-centered unstructured data is presented. Necessity of the linear-exactness property for 1st order gradient accuracy, and consequently a 2nd order scheme, is emphasized. A straightforward, yet novel, approach utilizing local curvilinear transformation is proposed. The curvilinear method offers the most compact gradient stencil among those studied here. No clear “best” method emerged but strengths and shortcomings of the investigated methodologies for different cell types are exposed. Gradient operators with compact stencils, namely LSQR compact and curvilinear, generally exhibited lower errors. LSQR compact scheme caused stability issues for the solution of the inviscid standing vortex problem on the random triangulated mesh. The curvilinear scheme, on the other hand, had an erratic behavior for different cell types, yielding overall low error levels but exhibiting a large error for a sample arbitrary polyhedral cell. This suggests that the method could benefit from development of a smarter stencil reduction logic (to down-select 4 points from the available stencil in 2D). The Green-Gauss method stood out with lower errors for thin triangular or quadrilateral cell types, such as those found in typical boundary layer meshes, which is it is a very attractive quality for CFD solvers.
156
9 Case Studies Involving Comparisons of Structured vs. Unstructured Meshes Case Study 1 – Flow through Pipe with 90 degree Bend These last two items are why boundary layers are best modeled in an unstructured mesh with prism layers as they provide structure in the direction away from the wall. Further, another parametric study done by (Fluent®) as turbulent flow over a pipe with 90 degree bend and Reynolds number of ReD = 43000 and turbulent model of Realizable k-ε264. Axial velocity contour are compared at the 90 degree bend. The result show difference in 90 degree bend, as shown in Figure 9.1. It is clearly demonstrates the advantage of Hex cell over Tet in this example. This also indicates a good agreement with experimental data using the hybrid mesh (Tet + Prism, See Figure 9.2). As you clearly see the argument about which mesh to use is far from over and depending to whom you talking. It appears that case against the Tet cells is relatively straight, but Poly cells and Hybrid meshing is still debatable. With most vendors, have capability of offering both structured as well as unstructured meshes at will and table below displays the type of meshing available.
Figure 9.1
264
Comparison of Hex (16 K Cells) and Tet (440 K Cells) for a Pipe with 90 Degree Bend
Fluent, “Meshing and CFD Accuracy”, CFD Summit, June 2005.
157
Figure 9.2
Results of Hex vs Tet Meshes as well as Hybrid Mesh in a Pipe with 90 Degree Bend
Case Study 2 - Comparison of Hexa-Structured and Hybrid-Unstructured Meshing Approaches for Numerical Prediction of the Flow Around Marine Propellers265 Here, we present a comparison between hex structured and hybrid-unstructured meshing approaches for the numerical prediction of the flow around marine propellers working in homogeneous flow (Open Water Conditions)266. The objective was to verify if the accuracy of the predictions based on structured meshes is significantly better than predictions based on hybrid meshes. The study was performed on two five-bladed propellers in model scale. Simulations were carried out with a commercial RANS solver, using a moving frame of reference approach and employing the SST (Shear Stress Transport) two equation turbulence model. Computational results from both meshing approaches were compared against experimental data. The thrust and torque coefficients were used as global quantities. Circumferentially averaged velocity components and root-mean square values of the turbulent velocity fluctuations, available for one of the propellers, were used to indicate the local flow field. The computational results of global quantities for both meshing approaches were very close to each other and in line with experimental data. Also the local values of the flow were in line with the experimental data, except for turbulent velocity fluctuations which were under predicted, especially in the case of the hybrid approach, where higher diffusivity was observed. The overall results suggest that for the prediction of the propulsive performances of marine propellers, at model scale, there are no significant differences, in term of accuracy, between structured and hybrid meshes but for a detailed study of the flow, the structured mesh seems to offer a better resolution.
Mitja Morgut, Enrico Nobile, “Comparison of Hexa-Structured and Hybrid-Unstructured Meshing Approaches for Numerical Prediction of the Flow Around Marine Propellers”, First International Symposium on Marine Propulsions smp’09, Trondheim, Norway, June 2009 266 See Previous. 265
158
Introduction & Contributions The flow around a marine propeller is one of the most challenging problems in (CFD), where for decades it has been investigated numerically using conventional methods based on the potential theory. More recently, due to the improvements of computer performances, (RANS) solvers are becoming the practical tool as demonstrated by [Abdel-Maksoud et al.]267, [Chen and Stern]268, [Stanier]269, [Watanabe et al.]270, and [Rhee and Joshi]271, to name a few. Even though the capabilities of CFD technologies are improving, a fundamental role in a successful CFD simulation is still played by the mesh quality and type. Generally speaking, simulations carried out using Hybrid-Unstructured (HU for brevity) meshes i.e. tetrahedral with prisms or hexahedral layer on solid surfaces, are less accurate then simulations carried out using Hexahedral Structured (HS) grids. On the other hand the effort to generate HU meshes is generally lower than that needed to generate HS meshes. As a matter of fact the hybrid mesh generation is semi-automatic, whilst the structured mesh generation is nonautomatic, and requires a significant amount of work. It can also be very difficult to generate a good quality HS mesh for complex geometries: this is the case of modern marine propeller due to complex shapes, strong twisting of the blade and stagnation point on hub close to the propeller. Moreover the structured meshing approach can be very difficult to apply to the study of the propeller-hull interaction with the currently available commercial codes. Recently also the section of applied physics of the Department of Naval Architecture, Ocean and Environmental Engineering (DINMA) of the University of Trieste, in collaboration with the office of Naval Architecture of Fincantieri - Cantieri Navali S.P.A has developed a CFD procedure for the prediction of the flow around marine propellers working in open water conditions based on the use of the commercial RANS solver ANSYS-CFX 11 and the commercial meshing tool ANSYS ICEM-CFD The procedure has already been validated, using HS meshes. But the long time needed for the generation of HS meshes suggested to investigate the possibility of using hybrid meshes in place of structured meshes. For this reason a comparison between structured and hybrid meshing approaches is carried out. The study is performed on two five-bladed propellers in model scale. One is called Propeller A, propriety of Fincantieri, and the other is propeller DTMB (David Taylor Model Basin) P5168 [Chesnakas & Jessup]272. The study is made by comparing numerical results from both approaches with the available experimental data. For both propellers thrust coefficient and torque coefficient are compared for a wide range of advance ratios. In the case of propeller P5168 the comparison includes circumferentially averaged velocity components, and turbulent quantities, in a plane downstream of the propeller mid plane respectively. For both propellers and meshing approaches the numerical results are in line with experimental data, but the hybrid meshes seem to introduce more diffusivity in the solution than structured meshes.
Abdel-Maksoud, M., Menter, F., and Wuttke, H.. ‘Viscous flow simulations for conventional and high skew marine propellers’. Ship Technology Research, 45:64 – 71. 1998. 268 Chen, B. and Stern, F. ‘Computational fluid dynamics of four-quadrant marine-propulsor flow’. Journal of Ship Research, 43(4):218 – 228., 1999. 269 Stanier, T. ‘The application of ’rans’ code to investigate propeller scale effects’. Proc. 22nd Symposium on Naval Hydrodynamics, Washigton, D.C., USA, 1999. 270 Watanabe, T., Kawamura, T., Takekoshi, Y., Maeda, M., and Rhee, S. H. ‘Simulation of steady and unsteady cavitation on a marine propeller using a rans cfd code’. 5th International Symposium on Cavitation, CAV2003, Osaka, Japan, 2003. 271 Rhee, S. H. and Joshi, S. ‘Computational validation for flow around marine propeller using unstructured mesh based navier-stokes solver’. JSME International Journal, Series B, 48(3):562 – 570, 2005. 272 Chesnakas, C. and Jessup, S. ‘Experimental characterization of propeller tip flow’. Proc. 22nd Symposium on Naval Hydrodynamics, Washington, D.C., USA, 1998. 267
159
Propeller Models Here, the two five-bladed propeller models visible in Figure 9.3 considered. One is the propeller propriety of Fincantieri. While the other is propeller P5168, designed at David Taylor Model Basin. P5168 is a controllable pitch propeller with diameter D = 0.4027m and experimental measurements were carried Figure 9.3 Design of Propellers, (left) Propeller P5168, out at the David Taylor 36(right) Propeller A – (Courtesy of Morgut & Nobile) inch, Variable Pressure Water Tunnel273. For simulations both propellers were placed on the cylinder, simulating the hub, and the axis of the propellers were coincident with the direction of the free stream. Numerical Method In this study only one blade is considered since, the flow around a marine propeller working in uniform flow can be considered periodic with respect to the blades when the hydrostatic pressure is assumed constant. In the given conditions the computational domain used in this study is 72o segment of cylinder covering only one blade. Moreover as a propriety related to the above mentioned conditions and also to capability of the ANSYS-CFX 11 to run different zones of the domain with either rotor or static frame of reference the cylinder is split as revealed in Figure 9.4 in a rotating part
Figure 9.4 273
See Previous.
Computational Domain– (Courtesy of Morgut & Nobile)
160
called Rotating, and in a stationary part called Fixed. The dimensions of computational domains of both propellers are listed in Table 9.1, where D is diameter of the propeller. The variable Lmid, presented but not visible in Figure 9.4, is the length in direction of uniform flow of rotating. Rotating Fixed To simulate the flow around a rotating A P5168 A P5168 propeller the following boundary conditions Hmid 0.70 D 0.57 D were set. On the Inlet boundary, velocity Lmid 0.14 D 0.75 D components of uniform stream with the given L1 2.0 D 1.5 D inflow speed were imposed, while the L2 6.0 D 5.0 D turbulence intensity was set to 1% of the H2 1.8 D 1.4 D mean flow. On the Outlet boundary the static pressure was set to zero. On the outer surface Table 9.1 Dimensions of Domains – (Courtesy of and on the part of the hub included in Fixed Morgut & Nobile) free-slip boundary conditions were set. On the blade surface and on the part of the hub included in Rotating no-slip boundary conditions were set. On the periodic boundaries (sides of the domain) rotational periodicity was ensured. As turbulence model, the two equation SST (Shear Stress Transport) model with the automatic treatment of wall functions was employed. Meshing All the meshes used in this study were generated using the commercial meshing tool ANSYS-ICEM CFD 11. For both propellers the Fixed part was discretized only with a unique structured mesh, while Rotating was discretized with both meshing approaches. Moreover in the case of propeller P5168 were used for Rotating two meshing regimes (coarse, fine). The number of nodes of meshes of propeller A and propeller P5168 are visible in Table 9.2 and Table 9.3. Since ANSYS-CFX 11 employs the node-centered finite volume method, (More precisely a Control Volume-based Finite Element Method - CVFEM) the number of nodes was chosen Fixed Nodes Rotating Nodes as a parameter of congruence. Type Hexa Hexa Hybrid For that reason, Grid1 and 223820 784914 Grid 1 Grid2, Grid3 and Grid5, Grid4 785344 Grid 2 223820 and Grid6 have a similar number of nodes, Table 9.2 Grids for Propeller A– (Courtesy of Morgut & Nobile) respectively. To generate structured meshes of both propellers, Fixed and especially Rotating were decomposed in a large number of blocks and proper nodes distributions were used to control dimensions and quality of the cells. The single hybrid meshes were instead Fixed Nodes Rotating Nodes generated with two Hexa Hexa Hybrid Type successive steps. First 229437 348810 Grid 3 Coarse surface meshes and 229437 711932 Grid 4 Fine volume tetrahedral 229437 340400 meshes were created Grid 5 Coarse 229437 741378 using the robust Octree Grid 6 Fine method. Then in order Table 9.3 Grids for Propeller P5168 – (Courtesy of Morgut & Nobile) to resolve the turbulent boundary layer on the solid surfaces, with the similar resolution to the one used with structured meshes, layers of prism were placed around the hub and blade. In the case of propeller A, 6 layers were generated and in the case of propeller P5168, 15 layers were placed. The average values of y+ on solid surfaces (hub,
161
blade) of propeller A and propeller P5168 were 20 and 15 respectively. The y+ was defined as y+ = μT y/ν where μT = (τw/ρ)1/2 is friction velocity, y is normal distance from the wall, ν is kinematic viscosity, ρ is density and τw is wall shear stress. In the case of propeller P5168 during the refinement, the height of the first node off the solid surfaces was kept unchanged. For propeller P5168 the structured mesh of Fixed is visible in Figure 9.5 (a). Structured and hybrid meshes on the blade and hub surfaces are depicted in Figure 9.5 (b-c).
(a) Hexa Mesh of part Fixed, Propeller P5168 Figure 9.5
(c) Surface mesh, Hybrid, Propeller P5168
(b) Surface mesh, Hexa Fine, Propeller P5168
Meshing for Propeller P5168– (Courtesy of Morgut & Nobile)
Results To study the influence of the grid on the quality of the prediction of the flow around a marine propellers, numerical data were compared with available experimental data. Propeller A was used as a preliminary study. Comparison was carried out only on global quantities of the flow while for Propeller P5168 comparison was made, analogous as (Rhee and Joshi, 2005), also on the local values of the flow in a downstream location x/R=0.2386 measured from the propeller mid plane, where R is the radius of the propeller and x is the distance. The global values considered were thrust coefficient KT , torque coefficient KQ and efficiency η defined as:
KT =
T ρn2 D4
,
KQ =
Q ρn2 D5
,
η=
J KT 2π K Q
Eq. 9.1 where T[N] is the thrust, Q[Nm] is the torque, η[rps] is the rotational speed of propeller, D[m] is the diameter of the propeller, ρ[kg/m3] is the density of the fluid. J=V/nD is the advance coefficient, where V[m/s] is the velocity of uniform flow. Circumferentially averaged velocity components, and root-mean square values of turbulent velocity fluctuations were selected as local flow values. The root mean square of turbulent velocity fluctuations q was defined as
q = √2k
Eq. 9.2 where k is the turbulent kinetic energy. In the following graphs and contours all local flow values are non-dimensionalized by velocity of the uniform flow V. Relative percentage errors present in the next tables are defined as
162
ϵ(K T )% =
K T,Num − K T,Exp K T,Num − K T,Exp × 100 , ϵ(K T )% = × 100 K T,Exp K T,Exp
Eq. 9.3 where KT,exp , KQ,Exp are experimental data and K Q,Num, K T,Num are numerical values.
9.2.5.1 Propeller A In the case of propeller A the simulations were carried out for a wide range of advance ratios. From Table 9.4 and Figure 9.6 it is seen that numerical results of different meshing a approaches, are very close to each other and also in line with the experimental data, especially within the range J = 0.1 - 1.0. Moreover differences between results obtained using different meshes are less than 4%. The relative percentage errors, within the range J = 1.1 - 1.2 but especially at J = 1.2, are very height for both meshing approaches as expected, because thrust and torque are both almost null.
Figure 9.6
Table 9.4
Results of Propeller A– (Courtesy of Morgut & Nobile)
KT , KQ and η Curves of Propeller A – (Courtesy of Morgut & Nobile)
163
9.2.5.2 Propeller P5168 In the case of propeller P5168 the simulations were carried out at four advance coefficients, following experimental setup (Chesnakas and Jessup, 1998) showed in Table 9.5, where N = 60n is the rotational speed of propeller in rpm. In this case, the simulations were carried out first using coarser grids and then using finer grids. The relative percentage differences of the computed values in KT and KQ on grids of different resolution are showed in Table 9.6. It is noteworthy that differences of KT are higher than differences of KQ especially for the structured meshing approach. The relative percentage differences are defined as:
λ(K T )% = Eq. 9.4
J 0.98 1.10 1.27 1.51 Table 9.6
J 0.98 1.10 1.27 1.51
N(rpm) 1200 1450 1300 1150
V(m/s) 7.89 10.70 11.08 11.73
Table 9.5 Experimental setup of Propeller P5168
K T,Fine − K T,Coarse K T,Fine − K T,Coarse × 100 , λ(K T )% = × 100 K T,Coarse K T,Coarse
λ(KT)% Hexa Hybrid 1.37 1.34 1.64 1,60 1.36 2.25 7.89 7.59
λ(KQ)% Hexa Hybrid 0.55 0.98 0.63 1.23 0.31 1.56 0.91 3.88
ε(KT)% Hexa Hybrid 1.65 3.30 0.65 2.60 6.70 8.61 18.84 23.19
ε(KQ)% Hexa Hybrid 1.35 3.49 2.31 4.88 4.28 6.92 5.73 10.83
Relative Percentage Differences of Computed Values Between Finer and Coarser Mesh for propeller P5168 – (Courtesy of Morgut & Nobile)
The results obtained using finer grids are presented and discussed in the following part. First the comparison of KT and KQ is presented. From Figure 9.7 and Table 9.6 it is visible that computed values of KT and KQ on both meshes are all slightly overestimated but they compare well with experimental data, except for J = 1.51. Results obtained using hexa-structured mesh are better than those obtained using hybrid-unstructured mesh but the differences in computed values, within the range J = 0.98 - 1.27, are lower than 3%. See [Morgut and
Figure 9.7
KT and KQ curves of Propeller P5168 – (Courtesy of Morgut & Nobile)
164
Nobile]274 as they depict respectively for structured and hybrid mesh the circumferentially averaged velocity components in axial (Vx), tangential (Vt) and radial (Vr) direction vs non dimensioned radial coordinate (r/R) for various J, where r is the radial distance from the centerline of the hub. From these figures it is visible that the predicted trends of velocity components of both structured and hybrid meshes are very similar and differences are hard to detect. Moreover the axial and tangential velocity components compare well with the experimental data. The radial components, instead, are not so close to the experimental data, but their value are lower and therefore also the experimental uncertainty are larger. It is however noteworthy that within the range r/R = 0.6 -1.0 even though computed values are under predicted they seem to have the same trends as the experimental data. A comparison of contours of the root-mean square values of turbulence velocity fluctuations q on the plane x/R = 0.2386 downstream of the propeller mid plane, for J = 1.1 is presented in [Morgut and Nobile]275. From a qualitative point of view the contours agree well with experimental data, but from a quantitative point of view it is clear that the magnitude of turbulence kinetic energy is under predicted especially on the hybrid-unstructured mesh where is clearly visible the effect of excessive numerical diffusion. It seems therefore that, at least at model scale, the differences, between hexa-structured and hybrid structured meshes do affect the accuracy in the predictions of the turbulence quantities but the effect, for global quantities is modest. It is hard - or even impossible to extrapolate this conclusions to real scale, given the different qualitative and quantitative character of turbulent phenomena. Conclusions In this study a comparison between hexa-structured and hybrid-unstructured meshing approaches for the prediction of the flow around a marine propellers working in uniform flow was carried out. The study was performed on two five-bladed propellers in model scale. Hexa-structured and hybridunstructured meshes used for comparison were generated with the commercial meshing tool ANSYSICEM CFD 11. The simulations were carried out with the commercial RANS solver ANSYS-CFX 11, using the moving frame of reference approach and employing the SST (Shear Stress Transport) two equation turbulence model. Computational results from both meshing approaches were compared against the experimental data. In the case of propeller A the comparison was made only on global values while for propeller P5168 the comparison was carried out also on local values of the flow field. The numerical values of the thrust and torque coefficients computed using structured and hybrid meshes are both in line with the experimental data. The performance curves computed using structured meshes are slightly better than those predicted using hybrid meshes. The differences in computed values, using different meshing approaches and except for the extreme operational conditions, are less than 4% for propeller A and less than 3% for propeller P5168. Also the velocity profiles of propeller P5168, computed using different meshing approaches are in line with the experimental data, especially for axial and tangential components, (See [Morgut and Nobile]276). The overall results suggest, that for the numerical prediction of propulsive performances the use of hybrid meshes might be an adequate choice at least at model scale. They can offer a similar accuracy to the one of structured meshes and moreover they need a less effort to be generated. On the other hand, at the model scale and for the CFD code employed, the hybrid meshes do not seem to be the Mitja Morgut, Enrico Nobile, “Comparison of Hexa-Structured and Hybrid-Unstructured Meshing Approaches for Numerical Prediction of the Flow Around Marine Propellers”, First International Symposium on Marine Propulsions smp’09, Trondheim, Norway, June 2009. 275 Mitja Morgut, Enrico Nobile, “Comparison of Hexa-Structured and Hybrid-Unstructured Meshing Approaches for Numerical Prediction of the Flow Around Marine Propellers”, First International Symposium on Marine Propulsions smp’09, Trondheim, Norway, June 2009. 276 Mitja Morgut, Enrico Nobile, “Comparison of Hexa-Structured and Hybrid-Unstructured Meshing Approaches for Numerical Prediction of the Flow Around Marine Propellers”, 1st International Symposium on Marine Propulsions, Trondheim, Norway, June 2009. 274
165
preferred choice for a detailed investigation of the flow field since they introduce and excessive diffusion in the solution.
Case Study 3 – Structure & Unstructured Hybrid Meshing and its effect on Quality of Solution on Turbine Blade Applications Automatic robust unstructured hybrid meshing is indispensable for the success in design optimization277. In addition, it is important to maintain the mesh quality for deformation of geometry throughout the optimization process for the reliability of optimal design. Mesh adaptation is useful to capture the flow feature which can highly affect flow properties. Therefore, the present hybridmeshing technique with adaptation is applied for various turbomachinery components to validate its robustness. In addition, a turbine blade is used to compare the effects of mesh for the optimization. Results ➢ Effect of mesh quality for design optimization with large deformation of turbine blade is investigated by using structured mesh, unstructured hybrid mesh without adaptation, and unstructured hybrid mesh with adaptation (Figure 9.8 (a-c)).
(a) Structure
(d) Structured Solution Figure 9.8
(b) Hybrid
(c) Hybrid with Adaptation
(e) Hybrid Without Adaptation Solution Flow Around Turbine Blade – (Courtsy of Sasaki et al.)
Daisuke Sasaki, Caleb Dhanasekaran, Bill Dawes, Shahrokh Shahpar, “Efficient Unstructured Hybrid Meshing and its Quality Improvement for Design Optimization of Turbomachinery”, European Conference on Computational Fluid Dynamics, ECCOMAS CFD 2006. 277
166
➢ Flow around turbine blade is computed by structured and hybrid meshes (Figure 9.8 (de)). Because of different mesh topology and quality, the flow is totally different. In the figures, structured mesh can capture the wake region well compared to hybrid mesh without mesh adaptation.
Case Study 4 - Evaluation of Structured vs. Unstructured Meshes for Simulating Respiratory Aerosol Dynamics278 In simulating biofluid flow domains, structured hexahedral meshes are often associated with high quality solutions. However, extensive time and effort are required to generate these meshes for complex branching geometries. In this study, conducted by [Samir Vinchurkar & Worth Longest]279, to evaluates potential mesh configurations that may maintain the advantages of the structured hexahedral style while providing significant savings in grid construction time and complexity. Specifically, the objective here is to evaluate the performance of unstructured hexahedral, prismatic and hybrid meshes (prismatic + Tetrahedral) based on grid convergence and local particle deposition fractions in a bifurcating model of the respiratory tract. A grid convergence index (GCI) has been implemented to assess the mesh-independence of solutions in cases where true grid halving is not feasible. Structured hexahedral, unstructured hexahedral and prismatic meshes were found to provide GCI values of approximately 5% and nearly identical velocity fields. In contrast, the hexahedral–tetrahedral hybrid model resulted in GCI values that were significantly higher in comparison to the other meshes. The resulting velocity field for the hybrid configuration differed from the hexahedral and prismatic solutions by up to an order of magnitude at some locations. Considering the deposition of 10 μm particles in the planar configuration, all meshes considered provided relatively close agreement (2–20% difference) with an available experimental study. For all particle sizes considered, local and total deposition results for the structured and unstructured hexahedral meshes were similar. In contrast, the prismatic and hybrid geometries resulted in significantly higher deposition rates when compared to the hexahedral meshes for particles less than 10 μm. As a result, only the unstructured hexahedral mesh was found to provide overall performance similar to the structured hexahedral configuration with the advantage of a significant savings in construction time. These results emphasize the importance of aligning control volume gridlines with the predominant flow direction in bio fluid applications that involve long and thin internal flow domains. Bifurcation Model, Boundary Conditions, and Contributions The geometry selected to evaluate the mesh styles of interest is a double bifurcation model representative of respiratory generations G3–G5 (see Figure 9.9). This model is generated from the ‘‘Physiologically Realistic Bifurcation’’ (PRB) geometry specified by [Heistracher & Hofmann]280. For the PRB geometry, [Heistracher and Hofmann]281 provide a complete mathematical description of a single symmetric or asymmetric bifurcation based on a set of 11 geometric parameters and two sigmoid functions. Specific parameters for the double bifurcation model of generations G3–G5 employed in this study are identical to the values used in the work of [Heistracher and Hofmann] and
Samir Vinchurkar, P. Worth Longest, “Evaluation of hexahedral, prismatic and hybrid mesh styles for simulating respiratory aerosol dynamics”, Computers & Fluids, 2008. 279 See Previous. 280 Heistracher T, Hofmann W. Physiologically realistic models of bronchial airway bifurcations. J Aerosol Sci 1995;26:497–509. 281 See Previous. 278
167
the localized particle deposition measurements of [Oldham et al.]282. The inlet diameter of G3 in the model is 0.56 cm. Further geometric details of this configuration have been reported in [Longest and Vinchurkar]283. In this study, grid convergence, velocity fields, and local particle deposition profiles will be evaluated for an in-plane configuration, as implemented in the experimental study of [Oldham et al.] (Figure 9.9 a). For comparison, local deposition patterns will also be considered in an out-ofplane model where the second bifurcation has been rotated by an angle of 90 degrees (Figure 9.9 b). The steady inspiratory flow rate employed in the PRB model results in an inlet Reynolds number of 1788. For respiratory generations G3–G5, this is consistent with an inhalation flow rate in the trachea of 60 l/min and represents a state of heavy exertion. The flow rate in generation G3 is 125 ml/s, as specified in the experimental study of [Oldham et al]. Both inlet velocity and initial particle profiles are expected to have a significant impact on the flow field and particle deposition locations. For comparisons to in vitro deposition data, these profiles may be largely influenced by upstream effects in the experimental particle generation system. [Longest and Vinchurkar] have shown that upstream transition to turbulence results in a relatively blunt initial velocity field and particle profile at the model inlet. However, the flow within the PRB model can be approximated as laminar. As such, fully-developed blunt turbulent profiles of velocity and initial particle distributions have been assumed at the model inlet. Within the model, laminar flow is assumed. Outlet flow is assumed to be evenly divided between the left and right symmetric branches, i.e., homogeneous ventilation. Gravity has been included in the flow field and particle trajectory calculations of the PRB model with the gravity vector oriented in the negative z-direction, i.e., normal to the plane of the bifurcation, to remain consistent with the experiments of [Oldham et al]. Mesh Types For comparisons to the structured hexahedral base case, three unstructured mesh styles have been considered. Unstructured meshes are defined as having at least one face or block surface on which the gridlines do not remain continuous. For the structured hexahedral mesh, four-sided blocks are used (Figure 9.10a), which allows the gridlines to remain continuous within each block. For the unstructured hexahedral mesh, blocks with one triangular face have been implemented (Error! Reference source not found.b). On the triangular cross-sectional faces, the gridlines become discontinuous at the center of each triangle (Figure 9.11b, Slice 1). As a result, this blocking structure produces an unstructured hexahedral mesh. The other unstructured meshes considered include prismatic and hybrid styles (Figure 9.11). All meshes were created using the integrated solid modeling and meshing program Gambit 2.2.
Oldham MJ, Phalen RF, Heistracher T. Computational fluid dynamic predictions and experimental results for particle deposition in an airway model. Aerosol Sci Technol 2000;32:61–71. 283 Longest PW, Vinchurkar S. Effects of mesh style and grid convergence on particle deposition in bifurcating airway models with comparisons to experimental data. Med Eng Phys 2007;29:350–66. 282
168
9.4.2.1 Structured The structured base case mesh consists of six-sided hexahedral elements arranged in a system of interconnected rectangular blocks. The blocks have been arranged in a butterfly blocking design which minimizes control volume distortions while aligning a higher percentage of elements with the local flow direction (Figure 9.10a). Moreover, mesh density is increased near the wall and near the bifurcation points. This multi-block structure is difficult to develop because gridlines may be distorted, but must remain continuous throughout the geometry. Designing a high quality blockstructured meshing configuration for a geometry with multiple branches in which hexahedral elements largely align with streamlines is a user intensive non-trivial task.
Figure 9.9
Geometric Blocking Used (a) Structured Hexahedral (178 Blocks) and (b) Unstructured Hexahedral (80 Blocks) – (Courtesy of Samir Vinchurkar & Worth Longest)
9.4.2.2 Unstructured As with the structured mesh, the unstructured hexahedral configuration requires the creation of sub-blocks within the geometry. However, the unstructured hexahedral design allow for two faces on each block to have a non-continuous grid (Figure 9.11 b). Furthermore, blocks with one pair of triangular faces may be accommodated. As a result, the planes forming these blocks may pass entirely through the geometry (Figure 9.10 b). These planes are much easier to construct than the planes in the structured hexahedral configuration that only partially bisect the geometry. In addition, the blocking structure for the unstructured hexahedral mesh reduces the number of required blocks by over 50% (Figure 9.10). Once the geometry is divided into the required blocks, non-continuous meshes are created on cross-sectional surfaces. These meshed faces are then swept through the geometry in the axial direction to generate the volumetric mesh. As a result, this mesh style retains the advantage of aligning mesh elements in the predominate direction of flow. The prismatic mesh consists of five-sided elements which are composed of two triangles joined together by a longitudinal section of three rectangular faces. Generation of this mesh style requires four-sided faces to be constructed on the surface of the PRB (Figure 9.11c). The prismatic elements are arranged such that their triangular faces fill the axial slices (Figure 9.11c). This allows for the rectangular sections of each prismatic element to be aligned with the direction of predominate flow.
169
In order to improve the accuracy of the tetrahedral mesh style, an unstructured hexahedral– tetrahedral hybrid mesh has been created (Figure 9.11d). As with the prismatic mesh, four-sided faces are required on the surface of the PRB geometry. These faces are used to construct structured quadrilateral surface meshes, which form the basis for a layer of near-wall hexahedral cells. The hexahedral elements are intended to better resolve the flow field near the walls where velocity gradients are typically highest. The inner core of the flow field is then meshed with randomly oriented tetrahedral elements. A layer of prismatic elements is used to join the hexahedral and tetrahedral cells. In this configuration, the thin near-wall layer of hexahedral elements is aligned
Figure 9.10 Four Meshing Styles of the PRB Model (a) Structured Hexahedral, (b) Unstructured Hexahedral, (c) Prismatic, and (d) Hybrid – (Courtesy of Samir Vinchurkar & Worth Longest)
with the predominate direction of flow. However, it is not possible for the randomly oriented tetrahedral elements, which comprise a majority of the flow field, to be aligned with the axial flow direction284. The hybrid style consists of tetrahedral elements throughout the interior surrounded by three layers of hexahedral control volumes on the surface. The internal block divisions have been shown in the cross-sectional slices of the structured and unstructured hexahedral meshes. 284
170
Governing Equations Flow conditions in the meshes considered are assumed to be isothermal, incompressible, laminar and steady. Furthermore, the particle concentrations are assumed to be sufficiently dilute such that momentum coupling effects of the dispersed phase on the fluid can be neglected, i.e., a one way coupled flow. The governing equations for the respiratory airflow of interest include the conservation of mass and momentum as:
∇. 𝐮 = 0
,
∂𝐮 1 + (𝐮. ∇)𝐮 = (−∇p + ∇. 𝛕) ∂t ρ
Eq. 9.5 Where u is the velocity vector, p is the pressure, ρ is the fluid density, τ the shear stress tensor is given by
𝛕 = μ[∇𝐮 + (∇𝐮)T ]
Eq. 9.6 and μ is the absolute viscosity. Hydrodynamic inlet and boundary conditions, in addition to the noslip wall condition, were selected to match the experimental conditions of interest. To approximate a uniform outflow distribution, equally divided mass flow was specified. Furthermore, flow field outlets were extended far downstream such that the velocity was normal to the outlet plane, i.e., fully developed flow profiles with no significant radial velocity component. One-way coupled trajectories of monodisperse 1–10 μm aerosols have been calculated on a Lagrangian basis by integration of an appropriate version of the particle trajectory equation for comparison to the experimental results of [Oldham et al.]. Characteristics of the 1–10 μm aerosols of interest within this model include a particle density ρp = 1.06 g/cm3, a density ratio α = ρ/ρp ≈ 10-3, a Stokes number St =ρpd2p CCU/18μD ranging from 0.003 to 0.26, and a particle Reynolds number Rep = ρ|u -v| dp/μ ≤ 10. The appropriate equations for spherical particle motion under the conditions of interest are expressed as
dvi Dui f (u − vi ) + g i (1 − α) + fi,lubcrication =α + dt Dt τp i
and
dxi = vi (t) dt
Eq. 9.7 In the above equations, vi and ui are the components of the particle and local fluid velocity, respectively. The ratio of fluid to particle density is represented as α = ρ/ρp, and gi denotes gravity. The characteristic time required for particles to respond to changes in the flow field, or the momentum response time, is τp = CCρpd2p/18μ, where CC is the Cunningham correction factor. The pressure gradient or acceleration term is often neglected for aerosols due to small values of the density ratio. However, it has been retrained here to emphasize the significance of fluid element acceleration in biofluid flows. The drag factor f, which represents the ratio of the drag coefficient to Stokes drag, is based on the expression of [Morsi and Alexander]285 :
f=
CD Rep Rep a2 a3 = + 2) (a1 + 24 24 Rep Rep
Eq. 9.8 where the ai coefficients are constant for smooth spherical particles over the range of Reynolds number considered, i.e. 0 ≤ Rep ≤ 10. The effect of the lubrication force, or near-wall drag modifications, are shown in Eq. (3a) but are expected to be reduced for the aerosol system of interest Morsi SA, Alexander AJ. An investigation of particle trajectories in two-phase flow systems. J Fluid Mech 1972;55(2):193–208. 285
171
in comparison to liquid flows due to near-wall non-continuum effects. As such, this term has been neglected for the simulations considered here. Due to the significant size of the particles considered and the dilute concentrations, Brownian motion and particle-to-particle collision effects have been neglected. The Cunningham correction factor has only been applied for 1 lm aerosols based on the expression of [Allen and Raabe]286. Inlet particle profiles have been specified to be consistent with the local mass flow rate associated with the blunt velocity profile considered (Fig. 4). That is, the mass flow rate of particles on a finite ring, m p,ring, at the inlet is given by r2
ṁp,ring ~ṁring = ∫ ρu(r)2πdr r1
Eq. 9.9 where r1 and r2 define the extent of the ring and u(r) is the inlet velocity profile. Initial particle velocities were assumed to match the local fluid velocities. Further details describing the specification of initial particle profiles are discussed in [Longest and Vinchurkar]287. Numeric Method To solve the governing mass and momentum conservation equations in each of the geometries and for each mesh style, the CFD package Fluent 6.2 has been employed. User-supplied FORTRAN and C programs have been employed for the calculation of initial particle profiles, particle deposition locations, grid convergence, and post-processing. All transport equations were discretized to be at least second order accurate in space. For the convective terms, a second order upwind scheme was used to interpolate values from cell centers to nodes. The diffusion terms were discretized using central differences. To improve the computation of gradients for the tetrahedral elements of the hybrid mesh, face values were computed as weighted averages of values at nodes, which provides an improvement to using cell-centered values for these meshes. Nodal values for the computation of gradients were constructed from the weighted average of the surrounding cells, following the approach proposed by [Rauch et al.]288. A segregated implicit solver was employed to evaluate the resulting linear system of equations. This solver uses the Gauss–Seidel method in conjunction with an algebraic multigrid approach to solve the linearized equations. The SIMPLEC algorithm was employed to evaluate pressure–velocity coupling. The outer iteration procedure was stopped when the global mass residual had been reduced from its original value by five orders of magnitude and when the residual-reduction-rates for both mass and momentum were sufficiently small. To ensure that a converged solution had been reached, residual and reduction-rate factors were decreased by an additional order of magnitude and the results were compared. The stricter convergence criteria produced a negligible effect on both velocity and particle deposition fields. To improve accuracy, CGS units were employed, and all calculations were performed in double precision. To further improve resolution in the particle deposition studies, geometries were scaled by a factor of 10 and the appropriate non-dimensional parameters were matched. To determine grid convergence and establish grid independence of the velocity field solutions, successive refinements of each mesh style have been considered. For each refinement, grid convergence is evaluated using a relative error measure of velocity magnitude between the coarse and fine solutions:
Allen MD, Raabe OG. Slip correction measurements of spherical solid aerosol particles in an improved Millikan apparatus. Aerosol Sci Technol 1985;4:269–86. 287 Longest PW, Vinchurkar S. Effects of mesh style and grid convergence on particle deposition in bifurcating airway models with comparisons to experimental data. Med Eng. Phys 2007;29:350–66. 288 Rauch RD, Batira JT, Yang NTY. Spatial adaption procedures on unstructured meshes for accurate unsteady aerodynamic flow computations. Technical Report AIAA-91-1106, 1991. 286
172
εi = |
ui,coarse − ui,fine | ui,fine
Eq. 9.10 A vector of relative error values was determined for 1000 consistent points located in the region of the bifurcation. The root-mean-square of the relative error vector was used to provide an initial scalar measure of grid convergence for the points considered 1/2
εrms
2 ∑1000 i=1 εi =( ) 1000
Eq. 9.11 Rigorously, grid convergence measures should be based on refining the grid by a factor of two, i.e., grid halving. However, dividing hexahedral elements by a factor of two in three dimensions is often not practical due to the significant increase in the number of control volumes. As such, relative error values must be adjusted to account for cases in which grid reduction factors less than r = 2 are employed. To extrapolate εrms values to conditions consistent with true grid halving, the Grid Convergence Index (GCI) has been suggested by [Roache]289. This method is based on Richardson extrapolation and can be applied as
GCI = Fs
εrms rp − 1
Eq. 9.12 In the above equation, r represents the grid refinement factor and p is the order of the discretization method. Based on second-order discretization of all terms in space, p = 2 for the systems of interest. Refinement of the meshes was performed to maintain a constant reduction value in the three coordinate directions. The associated r value has been calculated as the ratio of control volumes in the fine and course meshes
Nfine 1/3 r=( ) Ncoarse
Eq. 9.13 To limit errors arising from the extrapolation procedure, r values of approximately 1.5 or greater have been considered. A factor of safety FS equal to 3 has been selected to provide a GCI value equal to the εrms value when r = 2 and p = 2. Therefore, the GCI value represents a scaled version of εrms to account for mesh refinement factors less than 2. Particle trajectories were calculated within the steady flow fields of interest as a post-processing step. The integration scheme employed to solve Eq. 9.7 was based on the trapezoid rule with a minimum of 10 integration steps in each control volume. Doubling the number of integration steps within each control volume had a negligible (less than 1%) effect on cumulative particle deposition values. Due to relatively small particle response times, double precision calculations have been employed. It was found that approximately 20,000 particle trajectories were required to produce convergent cumulative deposition values based on a 1% relative error criterion. As such, 20,000 particles have been initialized in all deposition cases considered.
289
Roache P. Computational fluid dynamics. Albuquerque: Hermosa; 1992.
173
Results 9.4.5.1 Validation Studies Validations of velocity field values for the structured hexahedral mesh scheme applied to a bifurcation geometry have been reported in a previous study. Briefly, a single bifurcation model was considered with a characteristic Reynolds number of 518 and results were compared to the empirical velocity field data of [Zhao and Lieber]290. For steady inhalation flow, the velocity field results of [Longest and Vinchurkar] indicate good quantitative agreement with the empirical data of [Zhao and Lieber]. 9.4.5.2 Grid Convergence To evaluate grid convergence for each mesh style considered, low, mid and high-resolution comparisons between coarse and fine grids have been considered for the planar geometry. Results of this comparison in the form of grid convergence values and required simulation times are reported in Table 9.7 (a-d) and are discussed below. The reported grid convergence results are for the planar bifurcation model (Error! Reference source not found. a). Similar grid convergence results were observed for the out-of-plane configuration (Error! Reference source not found. b). The number of grid cells required is based on the presence of one symmetry plane, i.e., one-half of the geometry is meshed. As described, grid convergence has been based on comparisons between coarse and fine grid solutions at 1000 points concentrated in the region of the bifurcation. A layer of near-wall comparison points was positioned to be less than 5% of the internal radius away from the wall. Selections of other sets of 1000 points as well as doubling the number of points considered had a negligible (i.e., less than 1%) impact on the grid convergence values reported. For the structured hexahedral mesh, successive grid refinements resulted in an effective reduction of εrms values (Table 9.7a). For the high resolution case, an εrms of 1.99% was obtained. In comparison to other relative error estimates, this value is relatively high. However, the selection of 1000 points with many locations near the wall and in low velocity positions produces a very rigorous condition for testing grid convergence. Moreover, errors on the order of 1% are expected to arise from the linear interpolation algorithm used to calculate values at the positions of interest for comparisons of the coarse and fine grid solutions. Therefore, achieving εrms values below 1% may not be possible with the rigorous grid convergence method employed. In this study, values of εrms on the order of approximately 1% are considered to represent a well converged solution. Accounting for the grid reduction factor used in the high resolution case results in a GCI value of 4.27% for the structured hexahedral mesh with 214 K control volumes. Grid convergence estimates for the unstructured hexahedral mesh are reported in Table 9.7 b. These results are highly similar to the grid convergence values observed for the base case. That is, an εrms value of 1.95% is achieved for the high resolution case. However, the number of grid cells required to achieve this level of grid convergence was increased from 214K for the structured hexahedral mesh to 318 K for the unstructured hexahedral mesh. This increase in cell number resulted in a 10% increase in solution time. Grid convergence index values on the order of 10%, as observed for the medium-level resolution, are shown to result in visible differences between velocity profiles. For the high resolution case, which is characterized by a GCI of 4.32%, differences in the velocity profiles are much less discernable. For the prismatic mesh configuration, εrms and GCI values are similar to those observed for the hexahedral style meshes (Table 9.7 c). However, to achieve this level of grid convergence, grid resolution was increased by approximately 30–40% for each case considered. This increase in grid density produces an associated increase in simulation time of approximately 20%. Furthermore, it is observed that the medium-level resolution case of the unstructured prism mesh results in a GCI value of approximately 6.6%, which is consistent with the high resolution prismatic case and 290
Zhao Y, Lieber BB. Steady inspiratory flow in a model symmetrical bifurcation. J Biomech Eng 1994.
174
significantly lower than with the medium resolution hexahedral meshes. Grid convergence values for the hybrid meshes are significantly higher than values reported for the their configurations (Table 9.7 d). The minimum GCI value for the hybrid style was 17.7% and occurred medium-level grid density. For the high-level resolution condition, the GCI value increased to 21.3%. Further increases in grid density resulted in a higher GCI value. This increase may be a result of round-off errors arising from an over-resolved grid. Furthermore, this level of grid convergence is consistent with GCI values
(a) Structure (Hexa)
(b) Un-Structured (Hexa)
(c) Un-Structured (Prism)
(d) Un-Structured (Hybrid)
Table 9.7
Grid Convergence – (Courtesy of Samir Vinchurkar & Worth Longest)
observed for purely tetrahedral meshes with and without flow adaption. As a result, the hybrid mesh style results in GCI values that are significantly higher than observed for the other meshes considered in this study and appears to provide little advantage to purely tetrahedral style meshes. The higher GCI values of the hybrid configuration may largely be a result of mesh elements not aligning with the direction of predominate flow.
175
9.4.5.3 Velocity Fields Velocity vectors, contours of velocity magnitude and streamlines of secondary motion are resented in Figure 9.12 for the high resolution cases of the four mesh styles considered in the planar bifurcation model. Midplane velocity fields appear highly similar among the hexahedral and prismatic meshes (Figure 9.12 c). However the hybrid mesh results in a significant reduction in midplane velocity gradients, which may arise from artificial or numerical dissipation (Figure 9.12 d). Similarly, secondary motions viewed at cross-sectional slice locations appear similar among the first three mesh styles considered (Figure 9.12 c). A single vortex is observed for the upper half of the geometry at Slice 1. The second carinal ridge produces a pair of counter rotating vortices for the
Figure 9.11 Velocity Vectors (a) Structured Hexahedral Mesh with 214 K C.V. (b) Unstructured Hexahedral Mesh with 318 K, C. V. (c) Prismatic Mesh with 510K C. V, (d) Hybrid Mesh with 608 K C. V. – (Courtesy of Samir Vinchurkar & Worth Longest)
176
inner branch of G5, as observed in Slice 2 (Figure 9.12c). However, due to the highly dissipative conditions of the hybrid mesh, only one fully formed vortex is observed in each of the three crosssectional planes considered (Figure 9.12 d). In summary, midplane velocity vectors appear relatively consistent among the four meshes considered, with some variations observed for the hybrid configuration. Secondary velocity profiles appear similar between the two hexahedral mesh styles. However, secondary velocity profiles are significantly different for the non-hexahedral meshes with the largest variations occurring for the hybrid configuration. In order to better evaluate differences among the solutions of the meshes considered, midplane velocity profiles have been plotted at Slices 1–3 for high resolution conditions in the planar model. At each location, velocity profiles for the hexahedral and prismatic meshes are similar. However, minor differences among the first three solutions are discernable. This observation highlights the fact that a high level of grid convergence does not ensure an exact match among solutions of different mesh types. In contrast to the hexahedral and prismatic solutions, the hybrid configuration results in significantly different velocity profiles. Velocity values for the hybrid solution again appear to be influenced by a high degree of dissipation. Considering Slice 3, differences between the first three solutions and the hybrid configuration vary between approximately 30% to one order of magnitude. 9.4.5.4 Particle Deposition Deposition locations for the four mesh styles considered and the planar geometry with 10 μm particles are shown in Figure 9.13. The 10 μm aerosols deposit primarily by impaction. Qualitatively, the observed deposition locations are very similar between the structured and unstructured hexahedral meshes. Furthermore, the hexahedral mesh styles exhibit very distinct divisions between regions of deposition and areas devoid of particle–wall interactions. In contrast, particle deposition locations for the prismatic and hybrid meshes appear more diffuse. This effect may be the result of fewer mesh elements aligned with the flow, especially for the hybrid configuration. Nevertheless, each of the mesh styles considered emphasizes local accumulations of particles, referred to as hotspots, occurring just upstream of the bifurcation points and continuing downstream for approximately one-half the branch lengths. For 10 μm particles, the structured hexahedral, unstructured hexahedral and prismatic high resolution meshes all match the experimental data of [Oldham et al]. For these three solutions, variations from the cumulative particle deposition experimental data are within 2–3%. Furthermore, these solutions result in a final deposition fraction that is within approximately 1% of the experimentally reported value of 81%. Differences in cumulative deposition values among the solutions for the hexahedral and prismatic meshes vary by less than 1%. In contrast, cumulative deposition results for the high-resolution hybrid mesh and 10 μm particles are significantly lower than the experimental data. The hybrid mesh considered is observed to under-predict cumulative deposition by approximately 20%. (see [Samir Vinchurkar & Worth Longest]291). As particle size decreases, larger differences are observed among the cumulative deposition predictions for the mesh styles considered. For 5 μm aerosols, the structured and unstructured hexahedral meshes are in close agreement with a final deposition fraction between 5% and 6%. In contrast, the prismatic mesh predicts a cumulative deposition of 11%, which is approximately double the hexahedral mesh estimates. Results for the hybrid mesh and 5 μm particles are even higher, with a total deposition fraction of 12%. Considering 3 μm particles, close agreement is observed between the hexahedral mesh predictions with a total deposition fraction of 0.3%. In contrast, the prismatic and hybrid configurations predict a deposition rate of approximately 1.8%. A similar trend is observed for 1 μm aerosols. Again, results for the structured and unstructured hexahedral Samir Vinchurkar, P. Worth Longest, “Evaluation of hexahedral, prismatic and hybrid mesh styles for simulating respiratory aerosol dynamics”, Computers & Fluids, 2008. 291
177
configurations are in close agreement with a total deposition fraction ranging between 0.12% and 0.17%. However, predictions of the prismatic and hybrid meshes are significantly higher by a factor of approximately five.
Figure 9.12 Deposition Locations for 10 lm Particles in the Planar Geometry for the (a) Structured Hexahedral Mesh, (b) Unstructured Hexahedral Mesh, (c) Prismatic Mesh, and (d) Hybrid Mesh – (Courtesy of Samir Vinchurkar & Worth Longest)
In general, cumulative deposition results are consistent between the structured and unstructured hexahedral meshes for the planar geometry. Results for the prismatic and hybrid meshes differ from the hexahedral results by values ranging from 20% (10 μm) to a factor of five (1 μm). Deposition predictions of the prismatic and hybrid meshes are also generally higher than for the hexahedral models. Differences in deposition results between the hexahedral and prism/hybrid meshes appears to increase with decreasing particle size. For all particle sizes considered in respiratory generations G3–G5, impaction is the primary deposition mechanism. However, the smaller particles considered have less inertia and are influenced to a greater extent by the secondary velocity patterns. Significant differences in secondary velocity profiles were observed between the hexahedral and other mesh styles considered in Figure 9.12. Therefore, it is concluded that differences in secondary motion patterns associated with mesh style are partially responsible for increased differences in deposition patterns as particle size is reduced.
178
Furthermore, increase in secondary motion associated with out of plane bifurcations may induce additional discrepancies among the models considered. Cumulative deposition results for the out-ofplane geometry and particle sizes of 3 and 10 μm are shown in292. As with the planar geometry for 10 μm particles, close agreement is observed between the hexahedral and prismatic mesh configurations with a total deposition rate of approximately 90%. The hybrid mesh results in an 85% deposition value, which is in relatively close agreement with the other mesh styles considered. However, significant differences in model predictions are again observed as the particle size is decreased. For 3 μm aerosols, results for the structured and unstructured hexahedral meshes appear to be in close agreement with a total deposition rate of approximately 1.8%. Deposition results for the prismatic and hybrid meshes are approximately six times higher than the other model predictions with a total deposition fraction of 11%. Discussion In this study, the effects of mesh style have been evaluated with respect to grid convergence, velocity fields and particle deposition values in a double bifurcation model of the respiratory tract. Mesh styles considered include structured hexahedral, unstructured hexahedral, prismatic and hybrid configurations. Particles ranging from 1 to 10 μm have been evaluated in planar and out-of-plane geometries. Deposition results for 10 μm particles in the planar geometry were found to be in close agreement with the experimental deposition data of [Oldham et al.] on a highly localized basis. In general, grid convergence, velocity fields, and local particle deposition values were consistent between the structured and unstructured hexahedral meshes. Both hexahedral meshes considered resulted in GCI values of approximately 5% and nearly identical midplane and secondary velocity patterns. Furthermore, local particle deposition profiles were largely similar for the hexahedral meshes across the range of particle sizes evaluated. Considering the prismatic mesh, GCI values were comparable to the hexahedral configuration with only a moderate increase in control volume number. Prismatic velocity fields were consistent with the hexahedral results, with some minor variations in the secondary velocity profiles. However, the prismatic mesh resulted in significant differences in local deposition profiles for particles less than 10 μm. The hybrid mesh resulted in a GCI value that was significantly higher than observed for the other meshes. This increase in GCI occurred despite a significant increase in the number of cells in the hybrid mesh. The velocity field for the hybrid configuration differed from the hexahedral and prismatic solutions by up to an order of magnitude at some locations with significant differences in the secondary vortex patterns. Moreover, deposition results for the hybrid mesh differed from the hexahedral results by values ranging from 20% (10 μm) to a factor of five (1μm). For the out-of-plane bifurcating geometry, local deposition results were generally consistent for 10 μm aerosols, but differed significantly for 3 μm particles among the mesh styles considered. This study highlights the effects of mesh style on grid convergence and related solution variables for an internal biofluid flow field. For any CFD problem, the required quality of the solution is often weighted against the time and resources available for mesh development. Structured hexahedral meshes are often thought to provide the highest quality solution, but the associated mesh construction time may be prohibitively expensive. In this study, structured hexahedral and unstructured hexahedral mesh schemes have been shown to provide highly comparable grid convergence values, velocity fields and particle deposition profiles. Moreover, both of these mesh styles predicted deposition results in very close agreement with experimental data for 10 μm aerosols in a planar geometry. As illustrated in Figure 9.11 construction of the unstructured hexahedral mesh requires a less complex blocking schemes than for Samir Vinchurkar, P. Worth Longest, “Evaluation of hexahedral, prismatic and hybrid mesh styles for simulating respiratory aerosol dynamics”, Computers & Fluids, 2008. 292
179
the structured hexahedral configuration. For example, construction of the structured hexahedral mesh requires the creation of 178 blocks in comparison to 80 blocks for the unstructured hexahedral mesh. Therefore, the unstructured hexahedral mesh offers a significant savings in construction time without an appreciable loss in solution performance. Compared with the purely tetrahedral meshes considered in [Longest and Vinchurkar], the hybrid mesh employed in this study showed no improvement in performance. Construction of the hybrid mesh did require subdivision of the PRB surface geometry into rectangular faces. In contrast, construction of purely tetrahedral meshes does no require subdividing the surface into rectangular faces. As a result, purely tetrahedral and flow adaptive tetrahedral meshes may be advantageous in comparison to the hybrid mesh considered in this study. Furthermore, the use of tetrahedral meshes may be preferred when rapid approximate solutions are the top priority. This scenario may arise for patient-specific modeling in the clinical setting. That is, approximate solutions with rapidly generated tetrahedral meshes may be necessary in order to make true patient-specific modeling a reality in the clinical setting . 9.4.6.1 Advantages of Hexahedral Structured Mesh In this study, hexahedral and prismatic meshes were found to provide adequate grid convergence and similar velocity fields. For particle deposition, hexahedral mesh configurations appear to provide the best solution. The observed better performance of the hexahedral and prismatic meshes in comparison to the hybrid mesh may occur for two reasons: First, both hexahedral and prismatic meshes can be aligned with the predominate direction of flow. This alignment is reported to reduce numerical diffusion errors. Furthermore, discretization errors partially cancel on opposite hexahedral faces. In contrast, mainly tetrahedral meshes cannot be aligned with the direction of predominate flow, thereby increasing the potential for numerical diffusion. Therefore, numerical diffusion errors associated with randomly oriented tetrahedral faces are one likely cause of the higher grid convergence values observed for these meshes. The occurrence of these errors is enhanced in the unidirectional flow system considered. The second possible factor responsible for the improved performance of the hexahedral solutions is the use of higher order elements. The hexahedral elements implemented provide more nodes per face for improved predictions of flux values and particle tracking. Some commercial CFD packages provide an increased number of nodes per face to account for this problem. However, the effect of increasing the number of nodes per face has not been quantified for internal biofluid flows. Furthermore, the effects of nodes per face on solution performance is expected to be a secondary factor in comparison to aligning the grid with the predominate direction of flow in the long and thin conduits of interest. Limitations of the current study include calculation of the GCI parameter at linearly interpolated points, the evaluation of a single software package, and the construction of only one style of hybrid mesh. The grid convergence parameter was evaluated at 1000 representative points throughout the flow field. These points include near-wall locations where minor variations in flow field velocities can result in very large relative errors. Modifying the number and location of these randomly selected points did not appreciably change the GCI value provided at least 1000 points were included. However, interpolation errors are present in determining values at comparison points. These errors are estimated to be on the order of approximately 1%. Nevertheless, the grid convergence algorithm employed provided an effective strategy for evaluating relative performance among the mesh styles considered that includes low velocity and near-wall regions. In this study, only one commercial software package was evaluated. Other software may improve the solution quality of the hybrid configuration. Moreover, many other hybrid mesh styles are possible. Nevertheless, evaluation of a representative state-of-the-art commercial software provides a valuable basis of comparison for various styles of meshes. Furthermore, this study highlights the
180
advantages of aligning mesh elements with the predominate direction of flow, which is independent of the computational package considered. Conclusion In deduction, structured and unstructured hexahedral meshes have been shown to provide acceptable grid convergence values, comparable velocity fields and good agreement with experimental 10 μm particle deposition data in a branching respiratory geometry. Generation of the unstructured hexahedral mesh provided a significant time savings in pre-processing with an associated minimal increase in computational run time. In contrast, a hybrid mesh configuration of tetrahedral cells surrounded by multiple layers of near-wall hexahedral elements resulted in significantly higher grid convergence values and different velocity and particle deposition results. These findings emphasize the importance of aligning control volume gridlines with the predominate direction of flow and using higher order elements in biofluid applications with long and thin conduits. Future work is needed to better assess modified flux interpolation schemes, other hybrid configurations and the use of polyhedral elements. For further discussion, please refer to [Samir Vinchurkar, P. Worth Longest 293.
Case Study 5 - Comparison Between Structured Hexahedral and Hybrid Tetrahedral Meshes Generated by Commercial Software for CFD Hydraulic Turbine Analysis294 Reducing meshing time and improving hybrid tetrahedral meshes are desired goals in hydraulic turbine analysis. This paper compares two different meshing methodologies in an industrial application of Francis hydraulic turbines. The first meshing methodology is a structured hexahedral mesh designed by ANSYS ICEM CFD 13.0©295 and the second is a hybrid tetrahedral mesh developed by Pointwise 17.0 R1©296. This software promises to reduce meshing time in comparison to hexahedral structured mesh as well as greatly improve hybrid tetrahedral meshing. Two different spiral case geometries of the same hydraulic turbine are used for the comparison. The features of these geometries are explained, especially in terms of understanding the challenges posed by their meshing. The meshing methodologies and the advantages and disadvantages in the application of these meshes to these geometries are then explained in detail. The numerical method for the flow calculation and the boundary conditions used to obtain the results are shown. The total head loss and the meridian velocity at the symmetrical plane are used to show similarities between the two meshing methodologies. An investigation of the small differences between the results is made, utilizing the velocity and total pressure contours. These analyses indicate that these two meshing methodologies achieve equivalent results for both spiral case geometries. Problem Description Structured hexahedral meshes are usually used to produce more accurate predictions of head losses for internal flows or of the drag force for external flows. The quality of their elements and their improved control over their distribution in the computational domain are the main factors that make them more appealing than tetrahedral meshes. However, designing a hexahedral mesh with a good Samir Vinchurkar, P. Worth Longest, “Evaluation of hexahedral, prismatic and hybrid mesh styles for simulating respiratory aerosol dynamics”, Computers & Fluids, 2008. 294 Philippe Martineau Rousseau, Azzeddine Soulaïmani and Michel Sabourin, “Comparison between structured hexahedral and hybrid tetrahedral meshes generated by commercial software for CFD hydraulic turbine analysis”, Conference Paper, May 2013. 295 ANSYS ICEM CFD 13.0. Available from: http://www.ansys.com/Products/Other+Products/ANSYS+ICEM. 296 Pointwise 17.0 R1. Available from: http://www.pointwise.com/. 293
181
level of quality for complex geometry requires a considerable time investment, very often from a few days to a few weeks. In addition, it is sometimes impossible to obtain a mesh of acceptable quality for very complex geometries. Unstructured tetrahedral meshes are preferred for their ability to quickly mesh complex geometries. However, the addition of structured elements in boundary layers is necessary to improve energy loss prediction. As a result, hybrid tetrahedral meshes are widely used in aerospace and hydraulic turbomachines. Please be advised that the hybrid tetrahedral mesh, often has problems in the transition between the boundary layer structured elements and the neighboring unstructured ones. The too-rapid increase of volume elements, as illustrated in Figure 9.14 (a), is often the source of inaccuracies and convergence problems. Other problems inherent to tetrahedral elements are the inappropriate spatial discretization of trailing and leading edges, which are also the cause of inaccuracy in the determination of the energy loss. Figure 9.14 (b), displays the correct transition between prismatic and volume elements in a boundary area mesh.
(a) Problematic Transition
Figure 9.13
(b) Correct Transition
Boundary Layer Transition Between Prismatic and Volume Elements – (Courtesy of Rousseau et al.)
Geometry A turbine spiral case is the component before the runner of a Francis hydraulic turbine. More specifically, it begins after the penstock and ends at the runner’s entrance, and it also includes the stay vanes and the wicket gates. Figure 9.15 shows a half domain used for the calculation of a spiral case. The primary function of the spiral casing is to rotate the flow and distribute it equally to the runner [4]. The stay vanes and mostly the wicket gates induce a direction to the flow at the entrance of the runner. Ideally these functions are carried out with minimum head loss and evenly within each stay vane and wicket gate channel. For example, the effect of recirculation zones at the stay vanes could affect the distribution and direction of the flow at the runner. The behavior of the runner as well as of
Figure 9.14 Example of a hydraulic turbine spiral case (half domain)
– (Courtesy of Rousseau et al.)
182
the draft tube could thus be affected. In this paper, we consider two spiral case geometries of the same hydraulic turbine and these are scaled at small model dimensions. Each spiral case has 24 stay vanes and wicket gates. Five different models of stay vanes are utilized in each spiral case. These models are characterized by their different cord lengths, which decrease from the entrance to the end of the spiral case. The wicket gates are identical within the same spiral case. The difference between the two spiral cases lies with the stay vanes and the wicket gates. The stay vane leading edge incidence angle of Figure 9.15 Geometry of the Stay Vanes and the geometry B is better aligned with the flow Wicket Gates, Left: Geometry A, Right: Geometry B – and rounded. The trailing edges of the stay (Courtesy of Rousseau et al.) vanes and wicket gates are tapered. Figure 9.16 shows the differences between the two geometries with the same model of stay vanes and wicket gates. These changes improve the flow in the geometry B by reducing the separation on the upper surface of the stay vanes. This greatly eliminates the recirculation zones. Replacement of the chamfer by a rounded leading edge on the stay vanes and refinement of the trailing edge of the wicket gates also decrease wakes in the flow. The flow is generally more uniform in the geometry B. The total head loss through the spiral case is also greatly reduced. The complexity of the flow and the different models of stay vane in the spiral case prevent any periodic simplification of the computational domain. However, it is simplified symmetrically in the horizontal plane. The absence of the runner after the exit of the spiral case allows this simplification. The computation domain of the geometry A is shown in Figure 9.15. The exit of the spiral case is far from the trailing edge of the wicket gates to reduce the effect of the outflow condition on the flow.
Geometry A Table 9.8
Geometry B
Mesh Densities for Structured Hexahedral and Hybrid Un-Structural Tetrahedral – (Courtesy of Rousseau et al.)
183
Mesh Description Some statistics of the meshes used in CFD are shown in Table 9.8. Three different mesh densities are used for the geometry A; coarse (C), medium (M) and fine (F). The geometry B used two meshes; coarse (C) and medium (M). The increase in the density of elements on the surface profiles and walls of the spiral case is the main difference between each mesh. The thickness of the first element on the wall is the same for all meshes. It is selected to achieve a Y+ of less than 5, and averages close to 2. This value is a compromise with respect to the size of the mesh. In contrast to external flows, the internal flow contains several solid walls. Obtaining a Y+ close to one would be ideal, but it was impossible to achieve with our available computing resources. 9.5.3.1 Structured Hexahedral Meshes Structured hexahedral meshes are designed with ICEM CFD 13.0 © and are of a multiblock type. Figure 9.17 show the symmetry surface of the medium hexahedral mesh at different resolutions. In this case, the structured hexahedral mesh has the advantage of an adequate definition of the leading and trailing edges of the hydraulic profiles. Elements in the wake are also of an appropriate density and positioned correctly. However, the use of structured hexahedral mesh in a spiral case brings several drawbacks. For example, the junction of the blocking of each channel of the spiral case leads to a needlessly high element density at the domain exit, see the [Rousseau et al.]297. This junction in the blocking also leads to poor-quality elements on the upper surface of the stay vanes, particularly near the leading edge. It is the same at the leading and trailing edges of the wicket gates. The time required to construct a structured hexahedral mesh for a spiral case is another drawback. The large number of operations related to the multiple blocks is the main cause298. 9.5.3.2 Hybrid Tetrahedral Mesh Unlike structured hexahedral mesh, the hybrid tetrahedral design does not require complex blocking. The construction of the mesh with Pointwise 17.0 R1© begins with the design of a surface mesh. The volume mesh is then performed by a Pointwise tool called T-Rex, with smooth transition Figure 9.16 Structured Hexahedral Mesh of the between prismatic and volume elements as Geometry A on the Symmetrical Surface and Close Up shown in Figure 9.14 (b). These tools allow – (Courtesy of Rousseau et al.) a good-quality volume mesh to be created in a shorter timeframe than with the hexahedral structured mesh. The mesh density is generally adequate in every place of the spiral case. In addition, unlike the Philippe Martineau Rousseau, Azzeddine Soulaïmani and Michel Sabourin, “Comparison between structured hexahedral and hybrid tetrahedral meshes generated by commercial software for CFD hydraulic turbine analysis”, Conference Paper, May 2013. 298 See Previous. 297
184
structured hexahedral topology, the wall elements are of a higher quality because they are more orthogonal. Figure 9.18 (left) shows an example of the hybrid tetrahedral mesh for the geometry A. A drawback of using hybrid tetrahedral mesh is the difficulty to obtain a density of elements equivalent to that of the structured hexahedral in the wake of hydraulic profiles, as illustrated in Figure 9.18 (right). In fact, the size of the elements increases too quickly. This difference may lead to an overestimation of the dissipation in the wake.
Figure 9.17 Hybrid Tetrahedral Medium Mesh on the Symmetric Surface of the Geometry A (left) & Mesh in the wake of a Hydraulic Profile (wicket gates trailing edge)(right) – (Courtesy of Rousseau et al.)
CFD Solution Strategy and Boundary Conditions The flow is computed for a Reynolds number of , based on the runner diameter (350 mm). It is modeled by the Reynolds Averaged Navier-Stokes equations (RANS) and the standard SST turbulence. The presence of a separation and recirculation zone in the geometry A justifies the use of this turbulence model299-300. The second-order advection scheme of ANSYS CFX (blend factor = 1) is used to limit the numerical diffusion. The convergence is obtained when the RMS residuals of the momentum and mass conservation equations are less than 10-5. It is also verified that the total head loss in the spiral case has been stabilized. However, the presence of large recirculation zones prevents this level of convergence to be achieved for all calculations, but the total head loss is always stabilized. This implies that the flow is locally weakly unsteady. The lack of information about the flow boundary conditions used in the physical setup lead us to assume the following conditions: the flow rate corresponding to a maximum opening of the wicket gates is imposed at the entrance of the spiral case by a velocity profile. This profile corresponds to a fully developed turbulent flow in a circular duct as described by the Power Law301. A zero static pressure is imposed at the spiral case exit. However, these conditions can only be valid in a comparative analysis situation. Results Analysis of the total head loss as a function of the radius provides details about the loss through the spiral casing components, which in turn allows identification of the component that causes the largest total head loss. This information is used to amend the problematic component, for example, Shur, M., et al., Comparative Numerical Testing of One- and Two-Equation Turbulence Models for Flows with Separation and Reattachment, 33rd Aerospace Sciences Meeting and Exhibit, American Institute of Aeronautics and Astronautics: Reno, NV, 1995. 300 Bardina, J.E., P.G. Huang, and T.J. Coakley, Turbulence Modeling Validation, Testing, and Development, NASA. 301 R. Munson, B., et al., Fundamentals of Fluid Mechanics. Sixth Edition ed2009, Hoboken, NJ: Wiley. 724. 299
185
the stay vanes in the geometry A. Ultimately, the analysis helps in calculating the hydraulic efficiency of the turbine. The meridian velocity on the symmetrical plane is also used to compare the two meshes. It provides qualitative information on the flow. For example, it shows the effect of recirculation zones or of an obtuse trailing edge. It also indicates if the hybrid tetrahedral mesh overestimates the dissipation of the wake. The meridian velocity is measured at 10 % upstream of the inlet radius of the stay vanes, between the end of the stay vanes and the beginning the guide vanes, and at the average radius of the runner inlet. The difference of the total cumulative loss between the two types of mesh is approximately 10% and occurs predominantly near the trailing edge of the stay vanes and upstream of the leading edge of the guide vanes. Figure 9.19 confirms that the total head loss difference originates at the end of the stay vanes. In fact, the hybrid tetrahedral mesh models a larger recirculation zone and thus a larger wake. The better quality of the prism elements of the tetrahedral mesh on the wall could be the cause for that larger wake. Furthermore, Figure 9.19 shows an effect of the second order advection scheme (blend factor = 1) used in the geometry A by the non-physical total pressure augmentation (red contour plot). This second order scheme could lead to local instabilities in cases of sudden flow direction change or coarse meshes. The adaptive CFX advection scheme (high resolution) should eliminates these instabilities but will induce more numerical diffusion in the presence of large recirculation zones.
Figure 9.18 Relative Total Head Loss on the Meridian Plane for the Geometry A with fine mesh, left: Structured Hexahedral, right: Hybrid Tetrahedral – (Courtesy of Rousseau et al.)
Figure 9.20 show the meridian velocity profiles for the geometry A with medium and fine meshes. For both grids, the meridian velocity is almost identical at the entrance of the stay vanes. The slight difference is due to the azimuthal change in the distribution of the flow. It should be noted that the
186
sudden jump in the meridian velocity corresponds to the end of the spiral case at an azimuthal position of 40°. The wave pattern in the velocity profile shows the influence of the leading edge of the stay vanes. The velocity profile in the gap between the stay vanes and the wicket gates is very similar for all meshes. However, there remains a slight difference caused by the largest recirculation zone in the hybrid tetrahedral mesh. The velocity profile at the entrance of the runner differs by its faster dissipation of the wake and a gap in the velocity profile. The former tends to carry out a smoothing of the velocity profile, and the latter results from the difference between the recirculation zone in the hybrid tetrahedral mesh. The velocity profile at the entrance of the runner differs by its faster dissipation of the wake and a gap in the velocity profile. The former tends to carry out a smoothing of the velocity profile, and the latter results from the difference between the recirculation zones of the two meshes. As noted on the velocity profile at the entrance of the stay vanes, the recirculation zone differences slightly change the flow distribution in the spiral case. These differences between the two meshes are slightly more pronounced with increased refinement. In fact, the recirculation zone is larger with hybrid mesh. In contrast to the geometry A, it appears that the evolution of the total head loss is very similar for both types of meshes. Only the coarse hybrid tetrahedral mesh differs in the total head loss to the end of the stay vanes and wicket gates. The too-rapid growth of the tetrahedral mesh at the trailing edge explains this difference.
Figure 9.19
Meridian Velocity Near a Stay Vane with fine mesh for Geometry A, left: Structured Hexahedral, right: Hybrid Tetrahedral – (Courtesy of Rousseau et al.)
For the geometry, only medium meshes are chosen due to the strong similarity of their assessment of the total head loss. As expected, the meridian velocity at the entrance of the stay vanes is almost
187
identical for the two meshes. (see the [Roussea et al.]302). Similarly, the velocity is almost identical between the stay vanes and the wicket gates. The meridian velocity at the runner entrance shows that the hybrid tetrahedral mesh dissipates faster the wake. In fact, the extreme values caused by the wicket gate’s wake are dispelled by this mesh. Figure 9.21 shows the overall effect of the dissipation of the wake caused by the too-rapid growth of the tetrahedral mesh. However, a strong similarity of the flow is observed between the two mesh types.
Figure 9.20
Meridian Velocity on the Meridian Plane for the Geometry B – (Courtesy of Rousseau et al.)
Conclusion The comparison between the structured hexahedral and hybrid tetrahedral meshes in the complex geometry of a hydraulic turbine spiral case gives an advantage to the latter. In fact, Pointwise software eliminates many defects inherent to hybrid tetrahedral mesh, such as inadequate definition of hydraulic profiles and poor transition between prismatic and volume elements. This mesh also leads to higher quality elements near the walls. Furthermore, a significant savings in turnaround time is obtained for the mesh construction compared to the hexahedral mesh. Typically, the mesh design time is reduced between five and ten times with the construction of a hybrid tetrahedral mesh. The results show a great similarity of the flow for the two meshes in the two geometries. However, the flow in the geometry A differs in the recirculation zones in the upper surface of the stay vanes. The hybrid tetrahedral mesh models a larger recirculation zone than that of the structured hexahedral. The higher quality of the prismatic elements on the wall could be one cause. This difference modifies Philippe Martineau Rousseau, Azzeddine Soulaïmani and Michel Sabourin, “Comparison between structured hexahedral and hybrid tetrahedral meshes generated by commercial software for CFD hydraulic turbine analysis”, Conference Paper, May 2013. 302
188
the evolution of the total head loss and slightly alters the meridian velocity profile. In addition to these differences, there is also a slightly faster dissipation of the wake downstream of hydraulic profiles in the hybrid tetrahedral mesh. The too-rapid growth of tetrahedral elements is the main cause. However, this disadvantage could be reduced with a finer mesh (and associated computational resources). In the absence of detailed experimental results about the flow in the spiral case, it is not possible to conclude on the accuracy of each mesh. In regard to the geometry B, the flow and the evolution of losses are virtually identical. As in the geometry A, there is only a slightly larger dissipation of the wakes due to the rapid expansion of the size of tetrahedral mesh elements at the trailing edge. Finally, the application of two types of mesh in both geometries shows similar results in terms of hydraulic performance. However, it is interesting to note that the evolution of the total head loss function of the radius in the spiral case shows that the hexahedral mesh requires fewer nodes than the tetrahedral hybrid mesh to achieve mesh independence. This can be an important factor when the available computing power is limited or the number of licenses for commercial software becomes an issue. The application of the hybrid tetrahedral mesh is currently being used for the calculation of the entire flooded parts of a Francis hydraulic turbine. That study should allow demonstrating the validity of this meshing method compared with experimental results.
189
10 Mesh Sensitivity and Mesh Independence Study Although mesh sensitivity, in our opinion, could be grouped as one of mesh quality criteria, it is still debatable a, so we leave it as such. But more importantly what is the difference between mesh sensitivity and mesh independence? Very little. Although some argue that grid sensitivity is a real (measured quantity) while grid independence is merely a mist and cannot be truly achieved. So it dependence who is your audience. Here we homage first mesh sensitivity than mesh independence study.
Different Types of Mesh Sensitivity Several methods concerning the derivation of mesh sensitivity equations are currently available. Among the most frequently mentioned are : • • • • •
Direct (Analytical) Differentiation (DD), Adjoint Variable (AV), Symbolic Differentiation (SD), Automatic Differentiation (AD), ( e.g. Odyssée or ADIFOR) Finite Difference (FD), (Brute Force)
Each technique has its own unique characteristics. For example, the Direct Differentiation, used here, has the advantage of being exact, due to direct differentiation of governing equations with respect to design parameters, but limited in scope. By far, the most used sensitivity analysis, is Adjoint Variables techniques, especially for aerodynamic optimization. Due to apparent popularity, we consider these in more details. Symbolic Differentiation Manipulates mathematical expressions in the code. If you ever used Matlab or Mathematica, then you probably used it. For every math expression they know the derivative and use various rules (product rule, chain rule) to calculate the resulting derivative. Then they simplify the end expression to obtain the resulting expression. Automatic Differentiation Manipulates blocks of computer each element of a program (when you define any operation in code, you need to register a gradient for this operation). It also uses chain rule to break complex expressions into simpler ones. 10.1.2.1 Symbolic vs Automatic Differentiation You might think that Automatic differentiation is the same as Symbolic differentiation (in one place they operate on math expression, in another on computer programs). And yes, they are sometimes very similar. But for control flow statements (`if, while, loops) the results can be very different: symbolic differentiation leads to inefficient code (unless carefully done) and faces the difficulty of converting a computer program into a single expression programs303. Finite Differencing This method is easy implement, but cost insensitive. There are a series of issues with this approach. Accuracy is the main drawback of the method especially for non-linear problems such as those of aerodynamic nature. Cost is also something that should not be underestimated. For instance, considering the case where the grid sensitivity needs to be computed, the number of operations that 303
Stackoverflow blog.
190
need to be performed is 𝑁𝐷𝑉×𝑚, where m is the number of step size tested which is unknown a priori and is specific for each design variable (DV). It is obvious that the cost quickly becomes unmanageable304.
Mesh Sensitivity via Direct Differentiation (DD) The general equations can be written as Where R is the residual vector, X mesh vector, and P is the meshing parameters. This results in a large system of linear equations in delta form at each time step as for a steady-state solution (i.e., t → ∞) reduces to
𝐑( 𝐗 (𝐏), 𝐏) = 0
Eq. 10.1 Where the explicit dependency of R on grid and vector of parameters P is evident. The parameters P control the grid X. Using chain rule of differentiation
∂𝐑 ∂𝐗 ∂𝐑 [ ][ ] + [ ] = 0 ∂𝐗 ∂𝐏 ∂𝐏
Eq. 10.2 Further simplification could include the vector of grid sensitivity which is
X X XB = P XB P Eq. 10.3 Where XB denotes the boundary nodes305. Surface Modeling Using NURBS Among many ideas proposed for generating any arbitrary surface, the approximate techniques of using spline functions are gaining a wide range of popularity. The most commonly used approximate representation is the Non-uniform Rational B-Spline (NURBS) function. They provide a powerful geometric tool for representing both analytic shapes (conics, quadrics, surfaces of revolution, etc.) and free-form surfaces306; or occasionally called Free From Deformations (FFD). The surface is influenced by a set of control points and weights to where unlike interpolating schemes the control points might not be at the surface itself. By changing the control points and corresponding weights, the designer can influence the surface with a great degree of flexibility without compromising the accuracy of the design. The relation for a NURBS curve is n
X (r) = R i,p (r) Di i =0
i = 0,........., n
R i,p (r) =
N i,p (r) ωi n
N i =0
i, p
(r) ωi
Eq. 10.4 where X (r) is the vector surface coordinate in the r-direction, Di are the control points (forming a 304 Gabriele Luigi Mura,
“Mesh Sensitivity Investigation in the Discrete Adjoint Framework”, Thesis submitted to University of Sheffield in partial fulfilment of the requirement for the degree of Doctor of Philosophy, 2017. 305 Sadrehaghighi, I., Smith, R.E., Tiwari, S., N., “Grid Sensitivity and Aerodynamic Optimization Of Generic Airfoils”, Journal of Aircraft, Volume 32, No. 6, Pages 1234-1239. 306 Tiller, W., “Rational B-Splines for Curve and Surface Representation," Computer Graphics and Applications, Volume 3, N0. 10, September 1983.
191
control polygon), ωi are weights, Ni,p (r) are the p-th degree B-Spline basis function, and Ri,p(r) are known as the Rational basis functions set n
∑ R i,p (r) = 1 , R i,p (r) ≥ 0 i=1
Eq. 10.5 Figure 10.2 represents a six control point representation of a generic airfoil. The points at the leading and trailing edges are fixed. Two control points at the 0% chord are used to affect the bluntness of the section. Similar procedure can be applied to other airfoil geometries such as NACA four or five digit series. Another example Figure 10.1 shows two airfoils NACA0012 and RAE2822 parameterized using B-Spline curve of order 4 with control points. The choice for number of control points and their locations are best determined using an inverse B-Spline interpolation of the initial data. The algorithm yields a system of linear equations with a positive and banded coefficient matrix. Therefore, it can be solved safely using techniques such as Figure 10.2 Six Control Point Representation of a Gaussian elimination without pivoting. Generic Airfoil The procedure can be easily extended to cross-sectional configurations, when critical cross-sections are denoted by several circular conic sections, and the intermediate surfaces have been generated using linear interpolation. Increasing the weights would deform the circular segments to other conic segments (elliptic, parabolic, etc.) as desired for different flight regions. In this manner, the number of design parameters can be kept to a minimum, which is an important factor in reducing costs. The practice is effortlessly applicable to 3D for example like the common wing & fuselage as designated in Figure 10.3 [Kenway et al.]307. The choice for number of control points and their locations are best determined using an inverse B-Spline interpolation of the initial data. The algorithm yields a system of linear equations with a positive and banded coefficient matrix.
Figure 10.1
B-Spline Approximation of NACA0012 (left) and RAE2822 (right) Airfoils
Gaetan K.W. Kenway, Joaquim R. R. A. Martins, and Graeme J. Kennedy, “Aero structural optimization of the Common Research Model configuration”, American Institute of Aeronautics and Astronautics. 307
192
Therefore, it can be solved safely using techniques such as Gaussian elimination without pivoting. The procedure can be easily extended to cross-sectional configurations, when critical cross-sections are denoted by several circular conic sections, and the intermediate surfaces have been generated using linear interpolation. Increasing the weights would deform the circular segments to other conic segments (elliptic, parabolic, etc.) as desired for different flight regions. In this manner, the number of design parameters can be kept to a minimum, which is an important factor in reducing costs. An efficient gradient-based algorithm for aerodynamic shape optimization is presented by [Hicken and Zingg]308 where to integrate geometry parameterization and mesh movement. The generalized Bspline volumes are used to parameterize both the surface and volume mesh. Volume mesh of B-spline control points mimics a coarse mesh where a linear elasticity mesh-movement algorithm is applied directly to this coarse mesh and the fine mesh is regenerated algebraically. Using this approach, mesh-movement time is reduced by two to three orders of magnitude relative to a node-based movement.
Figure 10.3
Free Form Deformation (FFD) for Volume Grid with Control Points (Courtesy of Kenway et al.)
10.2.1.1 Case Study - 2D Study of Airfoil Grid Sensitivity via Direct Differentiation (DD)309 The structured grid sensitivity of a generic airfoil with respect to design parameters using the NURBS parameterization is discussed. The geometry, as shown in Figure 10.2, has six pre-specified control points. The control points are numbered counter-clockwise, starting and ending with control points (0 and 5), assigned to the tail of the airfoil. A total of 18 design parameters (i.e., three design parameters per control point) available for optimization purpose. Depending on desired accuracy and degree of freedom for optimization, the number of design parameters could be reduced for each particular problem. For the present case, such reduction is achieved by considering fixed weights and chord-length. Out of the remaining four control points with two degrees of freedom for each, Jason E. Hickenand, David W. Zingg, “Aerodynamic Optimization Algorithm with Integrated Geometry Parameterization and Mesh Movement”, AIAA Journal Vol. 48, No. 2, February 2010. 309 Sadrehaghighi, I., Smith, R.E., Tiwari, S., N., “Grid Sensitivity and Aerodynamic Optimization Of Generic Airfoils”, Journal of Aircraft, Volume 32, No. 6, Pages 1234-1239. 308
193
control points 1 and 5 have been chosen as a case study. The number of design parameters is now reduced to four with XD = {X1, Y1, X5, Y5}T, with initial values specified in Figure 10.2. Non-zero contribution to the surface grid sensitivity coefficients of these control points are the basis functions R1,3(r) and R5,3(r). The sensitivity gradients are restricted only to the region influenced by the elected control point. This locality feature of the NURBS parameterization makes it a desirable tool for complex design and optimization when only a local perturbation of the geometry is warranted. Similar results can be obtained for design control point 5 where the sensitivity gradients are restricted to the lower portion of domain. Figure 10.4 shows C-type dual blocks structured grid and its sensitivity with respect to NURBS input for different design control points.
Adjoint Variable Sensitivity Analysis (AV) Following closely the development in [Luo and Liu]310, in the discipline of aerodynamics, a performance function I is usually dependent on flow solutions w and aerodynamic shape, which is essentially dependent on the geometric parameters x = {x1; · · · ;xN}, and subsequently the grid. The sensitivities of performance function to geometric parameters can be given as
Figure 10.4
Sample Grid and Grid Sensitivity
δ𝐈 ∂𝐈 δ𝐰 ∂𝐈 = + δxi ∂𝐰 δxi ∂xi
Eq. 10.6 In the meantime, δw implicitly depends on aerodynamic shape change through the governing flow equations R(w , x) = 0. A similar form as Eq. 10.6 for R can be given as
310 Jiaqi Luo, Feng Liu, “Performance Impact Of Manufacturing Tolerances for a Turbine
Blade Using Second Order Sensitivities”, Proceedings of ASME Turbo Expo 2018: Turbomachinery Technical Conference and Exposition, GT2018, June 11-15, 2018, Oslo, Norway.
194
δ𝐑 ∂𝐑 δ𝐰 ∂𝐑 = + =0 δxi ∂𝐰 δxi ∂xi
Eq. 10.7 By introducing a series of co-state variables, Ψ and subtracting the product of ΨT and Eq. 10.6 from Eq. 10.7, we can get
δ𝐈 ∂𝐈 ∂𝐑 δ𝐰 ∂𝐈 ∂𝐑 ={ − ψT + { − ψT } } δxi ⏟∂𝐰 ∂𝐰 δxi ∂𝐱 𝐢 ∂xi 0
Eq. 10.8 The crucial issue of the adjoint method is to eliminate the effects of δw on δI to avoid the calculation of δw due to the change of aerodynamic shape. It can be achieved if the adjoint operator Ψ satisfies the adjoint equations, therefore the first term in Eq. 10.8 is set to zero. Then the sensitivities can be determined by
δ𝐈 ∂𝐈 ∂𝐑 = − ψT δxi ∂xi ∂xi
Eq. 10.9 Once the flow solutions and adjoint solutions are obtained by solving the governing flow equations and the adjoint equations, respectively, the complete sensitivities can be calculated by deforming the aerodynamic shape and thus the grid for each geometric parameter. Considering that the evaluation of an aerodynamic objective function involves perturbing the grid, it is to be expected that the sensitivities of the objective function to the design variables will in some way involve sensitivities of the grid perturbation algorithm. When evaluating the gradient using the discrete adjoint method, these mesh sensitivities are implicitly included in the terms ∂I/∂xi and ∂R/∂xi .311 Table show the pro and cons of different mesh sensitivity routine as envisioned by [Gabriele Luigi Mura]312.
Chad Oldfield, “An Adjoint Method Augmented with Grid Sensitivities for Aerodynamic Optimization”, A thesis submitted in conformity with the requirements for the degree of M.A.Sc. Graduate Department of Aerospace Engineering University of Toronto, 2006. 312 Gabriele Luigi Mura, “ Mesh Sensitivity Investigation in the Discrete Adjoint Framework”, Thesis is submitted to University of Sheffield in partial fulfilment of the requirement for the degree of Doctor of Philosophy, 2017. 311
195
Method
Pro
Finite Difference
Easy To Implementation
Analytical
No Convergence Issue Low Memory and CPU Requirements
Adjoint Variables
Independent from the 𝑁𝐷𝑉
Automatic Differentiation
Easy to Implement - Largely Automatic
Table 10.1
Cons Prone to Cancellation and Round-off errorCost scales linearly with the 𝑁𝐷𝑉 - Poor accuracy and Consistency The Pre-Processing cost is Proportional to the 𝑁𝐷𝑉 Needs the Solution of a Large Linear System Increase in Memory When Used in Reverse Mode
Pros & Cons of Different Grid Sensitivity Method (NDV = Number of Design Variable)
Mesh Independence Study To perform a Mesh Independent Study, is fairly straight forward as seen in a compressible flow over a forwarding step size example (see Figure 10.5): 1. Run the initial simulation on your initial mesh and ensure convergence of residual error to 10-4, monitor points are steady, and imbalances below 1%. If not refine the mesh and repeat. 2. Once you have met the convergence criteria above for your first simulation, refine the mesh globally so that you have finer cells throughout the domain. Generally we would aim for around 1.5 times the initial mesh size. Run the simulation and ensure that the residual error drops below 10-4, that the monitor points are steady, and that the imbalances are below 1%. At this point you need to compare the monitor point values from Step 2 against the values from Step 1. If they are the same (within your own allowable tolerance), then the mesh at Step 1 was accurate enough to capture the result. If the value at Step 2 is not within acceptable values of the Step 1 result, then this means that your solution is changing because of your mesh resolution, and hence the solution is not yet independent of the mesh. In this case you will need to move to Step 3.
196
3. Because your solution is changing with the refinement of mesh, you have not yet achieved a mesh independent solution. You need to refine the mesh more, and repeat the process until you have a solution that is independent of the mesh. You should then always use the smallest mesh that gives you this mesh independent solution (to reduce your simulation run time).
Figure 10.5
Effects of Mesh Density on Solution Domain
197
Briefly, according to [Ssheshan Pugazhendh], mesh or grid independent solution is a solution that does not vary significantly even when you refine your mesh further. The answer comes through the question that emphasizes the independence of numerical solution from grid structure, also called mesh. In every computational analysis, mesh independence studies, also expressed as mesh convergence, ought to be conducted to sustain credible results. Otherwise, the results that obtained would be considered as skeptical. (see Figure 10.6) Figure 10.6
Mesh Independence
198
11
Mesh Quality Background
Make no mistake about it, mesh quality can have a large influence upon the accuracy (and efficiency) of a simulations based on the solution of partial differential equations (PDE)'s. Most argue that your CFD solution is as good as mesh it has. Many factors go into the influence of mesh on accuracy including the type of physics being simulated, details of the solution to the particular simulation, the method of discretization, and geometric mesh properties having to do with spacing, curvature, angles, smoothness, etc,313. The general consensus is that a good quadrilateral mesh would be formed by two families of orthogonal, or at least nearly orthogonal, curves with a smooth gradation between a coarse mesh in the far field and a fine mesh near the boundary. The following provisional definition is accepted as Mesh Quality concerns the characteristics of a mesh that permit a particular numerical PDE simulation to be efficiently performed, with fidelity to the underlying physics, and with the accuracy required for the problem. This description hints at several issues. First, mesh quality depends on the particular calculation which is undertaken and thus changes if a different calculation is performed. Second, a mesh should do no harm, i.e., it should not create difficulties for the simulation. As mesh generation methods evolved to handle complex three dimensional configurations, and the choice of element type broadened to include not just hexahedra but also tetrahedral and prisms, visual inspection of a mesh became much more difficult. The task was aided considerably by the advent of computer workstations with a powerful graphics capability and the development of good graphics software to view CFD solutions. Today, of course, it is often possible to undertake a CFD simulation and view the results on a laptop computer. Despite these developments in computer graphics and visualization software it is almost impossible to check a mesh with several million points around a complete aircraft and decide whether the quality and distribution of the mesh elements is acceptable. Even if this were a feasible option, visual inspection of large meshes is extremely time consuming and is clearly unacceptable in a design environment where a rapid turnaround is essential and numerous design variations must be evaluated in a timely manner.
Mesh Quality Metric There is a move towards quantifying the mesh in terms of criteria that can measure the element quality and the gradation in mesh element size in a precise way. At the very least, analyzing the mesh in this way allows one to identify the hot spots and thus decide where a careful visual inspection maybe needed (eye pleasing ?). As this approach develops and gains in sophistication one can envision a time when visual assessment is replaced by a different aesthetic, one based entirely on mathematical criteria. The question of whether a mesh is sufficiently fine to achieve a solution that has a required level of accuracy depends to a large extent on the discretization of the flow equations. If the discretization has a formal order of accuracy O(h) where h is the local mesh width (i.e. the linear extent of a mesh element) one would generally expect that the solution error on a good quality mesh should also scale in the same way. By comparing computed solutions on a sequence of three progressively larger meshes it is possible to check this assumption by exploiting a generalized form of Richardson Extrapolation. Deciding whether mesh convergence has been achieved for a flow field computation over a given configuration and, if not, how fine a mesh one actually needs to achieve specified accuracy is critically important (i.e., discretization error will be dealt in detail). In general,
Patrick M. Knupp, “Remarks on Mesh Quality”, 45 th AIAA Aerospace Sciences Meeting and Exhibit, 7-10 January, 2007, Reno, NV. 313
199
• • • •
Rate of convergence Solution accuracy Grid Independence result CPU time required
Now these days most of grid generation routines have sophisticated software of grid quality which shows the results graphically. Important metrics such as Volume, Orthogonality, Skewness, Stretching, Centroids, etc., are available on most grids generation software. Figure 11.1 shows the mesh quality (Volume, AR, and Stretching) for benchmark test case Turk/Hron.
(a) Volume
(b) Aspect Ratio
(c) Stretching
Figure 11.1
Predicted Mesh Quality (Volume, Aspect Ratio, and Stretch)
200
Mesh Quality from User’s Perspective The importance of a priori indicators of mesh quality is exemplified by NASA’s Stephen Alter314, who defined and demonstrated the utility of his grid quality (GQ) metric that combines both orthogonality and stretching into a single number. Driven by the desire to ensure the accuracy of supersonic flow solutions over blunt bodies computed using a Thin Layer Navier-Stokes (TLNS) solver, he has established criteria for the GQ metric that give him confidence prior to starting a CFD solution. Two aspects of GQ are notable. First, this metric’s reliance on orthogonality is closely coupled to the numerics of the solver where TLNS assumptions break down when the grid lacks orthogonality. Second, use of a global metric aids decision making, or as Thornburg315 wrote, “A local error estimate is of little use.” GQ represents domain expertise where the use of specific criteria within a specific application domain316. Mesh Quality from Researcher’s Perspective Dannenhoffer317 reported on an extensive benchmark study that involved parametric variation of a structured grid’s quality for a 5 degree double-wedge airfoil in Mach 2 inviscid flow at 3 degrees angle of attack. Variations of the mesh included resolution, aspect ratio, clustering, skew, taper, and wiggle (using the Verdict definitions). Dannenhoffer’s main conclusion was very interesting: there was little (if any) correlation between the grid metrics and solution accuracy. This may have been exacerbated by the fact that he found it difficult to change one metric without influencing another (e.g. adding wiggle to the mesh also affected skew) or it may have been due to the specific flow conditions. Dannenhoffer also introduced the concept of grid validity (as opposed to grid quality), which is intended to measure whether the grid conforms to the configuration being modeled (which in practice it sometimes does not). He proposed three types of validity checks: 1. Type 1 checks whether cells have positive volumes and faces that do not intersect each other. 2. Type 2 checks whether interior cell faces match uniquely with one other interior face and whether boundary cell faces lie on the geometry model of the object being meshed. 3. Type 3 checks whether each surface of the geometry model is completely covered by boundary cell faces, whether each hard edge of the geometry is covered by edges of boundary cell faces, and whether the sum of the boundary faces areas matches the actual geometry surface area. Prof. Christopher Roy318 from Virginia Tech showed a counter-intuitive example (at least from the standpoint of a priori metrics) that the solution of 2D Burger’s equation on an adapted mesh (with cells of widely varying skew, aspect ratio, and other metrics) has much less Discretization Error (DE) than the solution on a mesh of perfect squares as seen in Figure 11.2319. From this example alone, it is clear that metrics based solely on cell geometry are not good indicators of mesh quality as it pertains to solution accuracy.
Stephen Alter, “A Structured-Grid Quality Measure”, NASA Langley. Thornburg, Hugh J., “Overview of the PETTT Workshop on Mesh Quality/Resolution, Practice, Current Research, and Future Directions”, AIAA paper no. 2012-0606, Jan. 2012. 316 Another Fine Mesh, Pointwise blog, posted on July 5, 2012 by John Chawner. 317 John Dannehoffer , “On Grid Quality and Validity”, Syracuse University. 318 Christopher Roy, “Discretization Error”, Virginia Tech. 319 A simple demonstration of how a poor mesh from a cell geometry perspective (right) results in lower discretization error than one with “perfect” cells (left). 314 315
201
Figure 11.2
A simple Demonstration of How a Poor Mesh from a Cell Geometry Perspective
Mesh Quality from Solver’s Perspective The common thread among all participating CFD solvers was that convergence and stability are more directly affected by mesh quality than solution accuracy, namely: 11.2.3.1 CFD++ Metacomp Technologies’ Vinit Gupta320 cited cell skewness and cell size variation as two quality issues to be aware of for structured grids. In particular, grid refinement across block boundaries in the far field where gradients are low has a strong, negative impact on convergence. For unstructured and hybrid meshes, anisotropic tets in the boundary layer and the transition from prisms to tets outside the boundary layer also can be problematic. Gupta also pointed out two problems associated with metric computations. Cell volume computations that rely on a decomposition of a cell into tets are not unique and depend on the manner of decomposition. Therefore, volume (or any measure that relies on volume) reported by one program may differ from that reported by another. Similarly, face normal computations for anything but a triangle are not unique and also may differ from program to program. (This is a scenario can be often encountered when there is a disagreement with a solver vendor over a cell’s volume that turns out to be the result of different computation methods.) 11.2.3.2 Fluent and CFX ANSYS’ Konstantine Kourbatski321 showed how cell shapes that differ from perfect (dot product of face normal vector with vector connecting adjacent cell centers) make the system of equations stiffer slowing convergence. He then introduced metrics, Orthogonal Quality and two skewness definitions, with rules of thumb for the Fluent solver. It was interesting to note that the orthogonality measure ranges from 0 (bad) to 1 (good) whereas the skewness metric is directly opposite: 0 is good and 1 is bad. Another example of a metric criterion was that aspect ratios should be kept to less than 5 in the bulk flow. Kourbatski also provided guidelines for the CFX solver. He also pointed out that resolution of critical flow features (e.g. shear layers, shock waves) is vital to an accurate solution and that bad cells in benign flow regions usually do not have a significant effect on the solution. 320 321
Vinit Gupta, “CFD++ Perspective on Mesh Quality”, Metacomp Technologies. Konstantine Kourbataski, “Assessment of Mesh Quality in ANSYS CFD”, ANSYS.
202
11.2.3.3 Kestrel Kestrel, the CFD solver from the CREATE-AV program, was represented by David McDaniel322 from the University of Alabama at Birmingham. At the start, he made two important statements. First, their goal is to “do well with the mesh given to us.” (This is similar to Pointwise’s approach to dealing with CAD geometry – do the absolute best with the geometry provided.) Second, he notes that mixedelement unstructured meshes (their primary type) are terrible according to traditional mesh metrics, despite being known to yield accurate results. This same observation is true for adaptive meshes and meshes distorted by the relative motion of bodies within a mesh (e.g. flaps deflecting, stores dropping). More significantly, McDaniel notes a “scary” interdependence between solver discretization and mesh geometry by recalling Mavriplis’ paper on the drag prediction workshop323 in which two extremely similar meshes yielded vastly different results with multiple solvers. To address mesh quality, Kestrel’s developers have implemented non-dimensional quality metrics that are both local and global and that are consistent in the sense that 0 always means bad and 1 always means good. The metrics important to Kestrel are an area-weighted measure of quad face planarity, an interesting measure of flow alignment with the nearest solid boundary, a least squares gradient that accounts for the orientation and proximity of neighbor cell centroids, smoothness, spacing and isotropy. Differing from Dannenhoffer’s result, McDaniel showed a correlation of mesh quality with solution accuracy with the caution that a well resolved mesh can have poor quality and still produce a good answer. (In other words, more points always is better; see Figure 11.3).
Figure 11.3
Using Kestrel one can Show a Correlation Between Mesh and Solution Quality
11.2.3.4 STAR-CCM+ Alan Mueller’s324 presentation on CD-adapco’s STAR-CCM+ solver began by pointing out that mesh quality begins with CAD geometry quality and manifests as either a low quality surface mesh or an David McDaniel, “Kestrel/CREATE-AV Perspective on Mesh Quality”, University of Alabama at Birmingham. Mavriplis, Dimitri J., “Grid Quality and Resolution Issues from the Drag Prediction Workshop Series”, AIAA paper 2008-930, Jan. 2008. 324 Alan Mueller, “A CD-Adapco Perspective on Mesh Quality”,CD-Adapco. 322 323
203
inaccurate representation of the true shape. This echoes Dannenhoffer’s grid validity idea. After introducing a list of their quality metrics, Mueller makes the following statement, “Results on less than perfect meshes are essentially the same (drag and lift) as on meshes where considerable resources were spent to eliminate the poor cells in the mesh.” Here we note that the objective functions are integrated quantities (drag and lift,) instead of distributed data like pressure profiles. After all, integrated quantities are the type of engineering data we want to get from CFD. This insensitivity of accuracy to mesh quality supports Mueller’s position that poor cell quality is a stability issue. Accordingly, the approach with STAR-CCM+ is to be conservative opt for robustness over accuracy. Specifically, they are looking for metrics that will result in division by zero in the solver. Skewness as it effects diffusion flux and linearization is one such example. 11.2.3.5 Deducing Results 1. CFD solver developers believe mesh quality affects convergence much more than accuracy. Therefore, the solution error due to poor or incomplete convergence cannot be ignored. 2. One researcher was able to show a complete lack of correlation between mesh quality and solution accuracy. It would be valuable to reproduce this result for other solvers and flow conditions. 3. Use as many grid points as possible (Dannenhoffer, McDaniel). In many cases, resolution trumps quality. However, the practical matter of minimizing compute time by using the minimum number of points (what Thornburg called an optimum mesh) means that quality still will be important. 4. A priori metrics are valuable to users as an effective confidence check prior to running the solver. It is important that these metrics account for cell geometry but also the solver’s numerical algorithm. The implication is that metrics are solver-dependent. A further implication is that Dannehoffer’s grid validity checks be implemented. 5. There are numerous quality metrics that can be computed, but they are often computed inconsistently from program to program. Development of a common vocabulary for metrics would aid portability. 6. Interpreting metrics can be difficult because their actual numerical values are non-intuitive and stymie development of domain expertise. A metric vocabulary should account for desired range of result numerical values and the meaning of “bad” and “good.” Some Geometric Properties 11.2.4.1 Aspect ratio Prime example would be the Aspect Ratio for a simplified geometry is shown in Figure 11.1 (b) and defined for tetrahedral cells as the ratio between the maximum edge length l and the minimum cell height h as
ARi =
Max (li ) Min (h i )
Eq. 11.1 Similiarly, for hex and polyhedral cells. 11.2.4.2 Orthogonality The concept of mesh orthogonality relates to how close the angles between adjacent element faces or adjacent element edges are to some optimal angle (for example, 90º for quadrilateral faced elements and 60º for triangular faces elements). The most relevant measure of mesh orthogonality, as defined by the CFX-Solver is illustrated in Figure 11.4. It involves the angle between the vector
204
that joins two mesh (or control volume) nodes (s) and the normal vector for each integration point surface (n) associated with that edge. Significant orthogonality and non-orthogonality are illustrated at ip1 and ip2, respectively. 11.2.4.3 Skewness Skew of triangular elements is calculated by finding the minimum angle between the vector from each node to Figure 11.4 Concept of Orthogonality in Cells the opposing mid-side, and the vector between the two adjacent mid-sides at each node of the element as shown in Figure 11.5 (a). The minimum angle found is subtracted from ninety degrees and reported as the element‘s skew. Skew in quads is calculated by finding the minimum angle between two lines joining opposite mid-sides of the element. Ninety degrees minus the minimum angle found is reported as skew of the element. Maximum of 60-70 skewed elements are accepted in most of the solver beyond this limit solver can complain about the skewness of the (b) Warpage calculation of (a) Skewness in Triangle grid. a quadrilateral element Figure 11.5 Skewness and Warpage 11.2.4.4 Warpage This is the amount by which an element (or in the case of solid elements, an element face) deviates from being planar. Since three points define a plane, this check only applies to quads. The quad is divided into two trias along its diagonal, and the angle between the trias normal is measured as shown in Figure 11.5 (b). The maximum angle found between the planes is the warpage of the element. Warpage in threedimensional elements is performed in the same fashion on all faces of the element. Warpage of up to five degrees is generally acceptable.
11.2.4.5 Jacobian This measures the deviation of an element from its ideal or "perfect" shape, such as a triangle‘s deviation from equilateral. The Jacobian value ranges from -1.0 to 1.0, where 1.0 represents a perfectly shaped element. As the element becomes more distorted, the Jacobian value approaches zero. A Jacobian value of less than zero represents a concave Figure 11.6 Tetrahedral Volume element, which most analysis codes do not allow. So it is a good practice to keep the Jacobian of the grid greater than zero325. 325
HyperMesh9.0 Manual, Altair Inc.
205
11.2.4.6 Tetrahedral Volume Since the tetrahedral is the most elementary of volumes, we start with that. Calculates the volumes of a tetrahedron and a parallelepiped which encompasses it with 6 volumes, given four vertices in right hand side order (see Figure 11.6):
VP = AD.(AB AC) = (x 4 − x1 )[(y 2 − y1 ) − (z 2 − z1 )(y3 − y1 )] + (y 4 − y1 )[(z 2 − z1 ) − (x 2 − x1 )(z 3 − z1 )] + (z 4 − z1 )[(x 2 − x1 ) − (y 2 − y1 )(x 3 − x1 )] Vtet = Eq. 11.2
VP 6
11.2.4.7 Polygonal Face Area and Centroid A polyhedral cell consists of a number of polygonal faces Figure 11.7 Triangulation of a polygon forming a closed volume. The area vector and the centroid location of each face needs to be computed. This can be achieved via triangulation of the polygon around a given point f as shown in Figure 11.7326. A convenient starting location for the point f is the midpoint (simple average of the nodes of the polygon).
1 rf = Nf
Nf
r i =1
i
Eq. 11.3 where Nf denotes number of face nodes and r is the position vector. The area of each of the triangular patches are added to get the area of the polygon face
A tri =
(ri − rf ) (ri +1 − rf ) 2
for i = 1, N f
Nf
A f = A tri i =1
Eq. 11.4 And rN+1 = r1. Centroid of the face is computed in a similar fashion as:
rf =
1 Af
Nf
A tri (rn + rn +1 + rf )
i =1
3
Eq. 11.5 Note that the face centroid rf was initially taken as simply the midpoint of the nodes but it is updated at the end of the process. In the case of a planar polygon, this updated location reflects the true centroid of the polygon. However, while not desirable, polygon nodes may be highly no coplanar in practice. This introduces ambiguity to the centroid location as no unique definition exists based solely on the knowledge of the node coordinates. In this case, simply iterating over Eq. 11.4 & Eq. 11.5 until convergence provides a reasonable answer. The triangulated polygonal face, even if nonEmre Sozer, Christoph Brehm and Cetin C. Kiris,”Gradient Calculation Methods on Arbitrary Polyhedral Unstructured Meshes for Cell-Centered CFD Solvers”, American Institute of Aeronautics and Astronautics. 326
206
coplanar, is still attached to each of the vertices defining it as opposed to an approach where one might fit a planar surface to the vertices. This ensures that, once all the faces of a cell is processed, a water-tight control volume is achieved. We note once again that regardless of the aforementioned ambiguity for non-coplanar polygons, consistency can be retained if the cells sharing a face use the same face centroid and area for their reconstruction and flux integration327. 11.2.4.8 Polyhedral Volume and Centroid The volume and the centroid location of a Figure 11.8 Tetrahedralization of a polyhedral polyhedral cell can be computed via (showing a single face) tetrahedralization, basically by extending the logic presented in the previous section to 3D. Figure 11.8 shows a single face of a polyhedral cell and the corresponding tetrahedralization around a midpoint m.
1 rm = Nc
Nc
1 Vtet = A tri .(rm − rf ) 3
r i =1
i
Eq. 11.6 Where Atri and rf for a given face f is obtained previously. This usage of face triangulation around the previously calculated centroid ensures that a consistent volume is obtained. The integrated volume and the centroid of the polyhedral cell is then calculated via summation of the contributions from Nf
Ni
V = Vtet f =1 i =1
,
rc =
1 Nf Ni (rf,i + rf,i+1 + rf + rm )Vtet 4V f =1 i =1
Eq. 11.7 Where Nf is the number of faces, Ni is the number of face nodes328.
Best Practice for Mesh Generation There is no definite guild lines for meshing per say. It really depends to whom you are talking and application in hand. Therefore, each disciplines have its guide lines. In general, the mesh should exhibit some minimal grid quality as defined by measures of orthogonality (specially at boundaries), relative grid spacing (15% to 20% stretching is considered a maximum value), grid skewness, aspect ratio etc329. Also the maximum spacing should be according to the desired resolution of the physical phenomena. Optimum quality measures for the surface as well as volume grid have been described. To resolve the boundary layer it is required to cluster the grid in the direction normal to the surface with the spacing of the first grid point off the wall to be well within the laminar sub-layer of the boundary layer. Hexahedra or prisms elements are employed to discretize boundary layers to preserve the accuracy in the wall normal direction for highly stretched viscous grid. In case of Emre Sozer, Christoph Brehm and Cetin C. Kiris,”Gradient Calculation Methods on Arbitrary Polyhedral Unstructured Meshes for Cell-Centered CFD Solvers”, American Institute of Aeronautics and Astronautics. 328 Emre Sozer, Christoph Brehm and Cetin C. Kiris,”Gradient Calculation Methods on Arbitrary Polyhedral Unstructured Meshes for Cell-Centered CFD Solvers”, American Institute of Aeronautics and Astronautics. 329 Abhishek Khare, Ashish Singh, and Kishor Nokam, “Best Practices in Grid Generation for CFD Applications Using HyperMesh”, Member of Technical Staff Computational Research Lab. 327
207
turbulent flows, it is recommended that the first point off the wall should exhibit a wall normal dimensionless distance (y+) value of less than 1.0. Geometry Modeling and Geometry Cleanup Object about which flow has to be simulated requires modeling. This generally involves modeling the object geometry with some CAD software package. For doing this approximations and simplifications of the geometry are required to allow an analysis with reasonable effort. Unfortunately, CAD models are developed primarily for manufacturing purposes, and typically include details irrelevant for CFD simulations or omitting key components, such as boundaries to close a domain. While it appears that CAD designers are beginning to take better account of the needs of CAE engineers in their work, it is unlikely that CAD models will be delivered CFD ready for some time yet to come. There can be errors in CAD data in the form of gaps, overlaps, non-physical protrusions. So we need a lot of cleanup of the imported CAD geometry. Geometry cleanup is a time consuming step and it requires some intelligence to decide which feature of geometry has to remove and which feature to retain. Usual practice is to retain the details that matter for simulation and ensure water tight geometry. Computational Domain After importing geometry into grid generator, decisions has to be made about the extent of the finite flow domain which is called computational domain in which the flow has to be simulated. Shape and size of flow computational domain is depends on the geometry and the physics of flow. Since this modeled geometry along with the flow domain are used as an input for the grid generation hence the modeling should takes into account the structure and topology of the grid generation. For external flows, decision of computational domain is based on to replicate the actual physics. Many times this domain is decided by wind tunnel dimensions and the blockage ratio. A ratio of model frontal area to wind tunnel cross sectional area (Blockage ratio) should be less than 5%. In internal flows the flow path recognition is one of the major works for internal flows, specifically for conjugate heat transfer analysis. From the model search the interface between solid and fluid. Choice of Grid The choice of whether to use a structured or an unstructured mesh is problem specific which is discussed in detail before. Some advantages of structured meshes that hold generally over most applications are simplicity, availability of code, and suitability for multigrid and finite difference methods. On the other hand, unstructured meshes conform to the domain more easily and allow element sizes to vary more dramatically. Structured meshes are currently more popular, but unstructured are catching up330. Here some guidelines are listed based on three parameters for choosing between structured and unstructured grid: 1. Complex geometry: Unstructured grid generation is usually much faster than structured one. However, if the geometry is only slightly modified from a previously existing geometry with a structured grid, then structured grid generation can occur very rapidly. For a particular problem structured grid can take say a man weeks to one man month. On the other hand unstructured grid will take a man hour to a few days. 2. Accuracy: For simpler problem such as airfoil (single element) or an isolated wing, structured grids are generally more accurate per unknown than unstructured. However, for more complex flows, the adaptively facilitated by an unstructured grid may allow more accurate solutions. Abhishek Khare, Ashish Singh, and Kishor Nokam, “Best Practices in Grid Generation for CFD Applications Using HyperMesh”, Member of Technical Staff Computational Research Lab. 330
208
3. Convergence: Structured grid calculations usually take less time than an unstructured grid calculation because, to date, the existing algorithms are more efficient. Surface Meshing Once the water tight geometry is ready, it is time to create surface mesh on the model surfaces to ensure good quality surface and volume mesh. Volume mesh largely depends on the quality of surface mesh e.g. min/max angle, skewness etc. High surface deviation areas should be meshed by dense grid with smooth transition to low surface deviation areas. According to surface mesh requirement, surfaces can be subdivided into parts. All sharp edges and turnings should be assured by clustering for good quality volume mesh generation. For external aerodynamics like aero and auto domains, a hybrid mesh is fast and cost effective. Volume Meshing Once the surface grid is ready, to generate the volume grid, it is good practice to check whether it is forming a closed volume or not. If the surface grid forms a closed volume, volume grid generation can be started. For structured grid we need to do mapping of the corresponding surfaces as per the topology of the domain. In case of the unstructured grid we need to decide some parameters like boundary layer thickness, element growth ratio, Y+ values, which are required for volume grid generation. Most important parameter is the first point distance from the wall. Placement of the first point near to Figure 11.9 General estimation of surface mesh element size the wall depends on the grid resolution required. This is discussed in more detail in next section which is boundary layer grid generation. The second crucial parameter is the stretching ratio (SR). The value of the SR should be taken in such a way, so that the size of the elements varies smoothly in the domain. The recommended value of the SR is around 1.1 to 1.3. Figure 11.9 shows the general estimation of surface mesh element size based on free stream velocity and Y+ value331. This estimation works as well for automobile aerodynamics. Boundary Layer Meshing Successful computations of turbulent flows require some boundary layer consideration during the mesh generation. Since turbulence (through the spatially-varying effective viscosity) plays a dominant role in the transport of mean momentum and other scalars for the majority of complex turbulent flows, one must ascertain that turbulence quantities are properly resolved, if high accuracy is required. Due to the strong interaction of the mean flow and turbulence, the numerical results for turbulent flows tend to be more susceptible to grid dependency than those for laminar flows. To resolve the boundary layer it is required to cluster the grid in the direction normal to the surface with the spacing of the first grid point off the wall to be well within the laminar sub-layer of the boundary Macro Lanfrit, “Best Practices Guidelines for Handling Automotive External Aerodynamics with Fluent“, Fluent Deutschland GmbH, Birkenweg 14a, 64295 Darmstadt/Germany, 2005. 331
209
layer. Hexahedral or prism elements are employed to discretize boundary layers to preserve the accuracy in the wall normal direction for highly stretched viscous grid. In case of turbulent flows, it is recommended that the first point off the wall should exhibit a wall normal dimensionless distance (y+) value of less than 1.0. This avoids the use of wall functions which generally over predicts the viscous drag in comparison to solve to wall approach. In complex geometries, particularly at high Reynolds numbers, the condition y+ < 1 can be rather stringent, requiring an excessive total number of grid points. In this case, the user should consider the use of wall functions, which allow much larger values for y+, at the expense of additional modeling assumptions introduced in the wall-fluxes and wall adjacent centroids. In case of LES simulation there are no computational restrictions on the near-wall mesh spacing. However, for best results, it might be necessary to use very fine near-wall mesh spacing (on the order of Y+)332. Guidelines for Aerodynamics in General Accurate Cl and Cd predictions are the major focusing areas, while dealing with aero aerodynamics. Decision of element size based on local chord length should be the strategy for surface gridding here. A size of 0.1% of local chord length at leading and trailing edge is good enough to resolve the wing flow physics. 2% of reference chord length produces good quality surface mesh near fuselage nose and after body. Approximately 5% of local chord length is fair enough to resolve flow phenomenon along span wise direction. Since Prediction of viscous drag is crucial here, boundary layer resolution plays a vital role in the prediction of Cd values. Y+ is the governing factor for boundary layer meshing. It is preferred that the value of Y+ must be less than 1 to avoid any kind of wall functions in simulation. Start from a coarse mesh to fine, Y+ can be 1, 0.67, 0.44, and 0.3. This may generate from 5 million to 100 million cells depending on other volume meshing parameters. One should be very careful while stretching cells from boundary layer to outer far field domain. Within the boundary layer, it is a good practice to keep first two cells with constant normal spacing. In general the limit of cell volume growth should be less than 1.25. Outside the viscous layer this can be 3 times for unstructured and 1.5 times for structured mesh. Guidelines for Auto Aerodynamics Surface meshing for ground vehicle aerodynamics should resolve both, boundary layer (less extent) and flow separation regimes (greater extent). In auto aerodynamics sector, the geometries and are quite complex and even if it is simpler, then also the flow physics is complex like modeling of under hood aerodynamics, rotating wheel aerodynamics, rear end aerodynamics etc. If we talk about Formula 1 race car, then it is complex from geometry as well as aerodynamics point of view. In ground vehicle aerodynamics (Mach < 0.3), pressure drag dominates over viscous drag (roughly pressure drag is more than 90% of total drag), so the mesh generation effort should be focused on capturing highly separated flows. Generally for surface gridding, element size variation less than 3% of vehicle reference length is acceptable with clustered mesh at corners and geometric turning. More to say, if it is less than or equal to 1%, the quality of mesh is of high standard. These numbers are independent of surface grid topology. Near the stagnant point and separation areas, the clustering must insure a ratio less than 1.5 between maximum and minimum element size. The user should first decide the degree of resolution needed for the simulation. The standard practice is to calculate an average surface element size, by means of viscous layer resolution criteria (y+ values) for near wall modeling. It can also be limit by aspect ratio at the wall. Aspect ratio values may vary from order of 2 to order of 4 depending upon the curvature in the geometry. Based on Ref 333[6] and our experience, choosing a coarse surface mesh will lead to an initial mesh of approx. 2-5 million HyperMesh9.0 Manual, Altair Inc. Macro Lanfrit, 2005, “Best Practices Guidelines for Handling Automotive External Aerodynamics with Fluent“, Fluent Deutschland GmbH, Birkenweg 14a, 64295 Darmstadt/Germany. 332 333
210
cells. A medium resolution, which currently is part of the standard approach, will lead to meshes that consist of approx. 5-10 million cells, while a fine resolution will correspond to meshes beyond 10 million cells. The overall mesh largely depends on the complexity of model and volume mesh parameters. Improvement of Grid Quality Since the quality of the grid strongly influence the accuracy of the solution. It is required that the resulting grid should have the elements which are as regular as possible. Also the variation of the elements size should be as smooth as possible. After the grid is generated two procedures can be applied to improve the quality of the unstructured grid, namely Edge Swapping and Grid Smoothing. These procedures do not change the total numbers of the elements inside the grid and most of the commercial grid generators are having these for the grid quality334-335.
Blazek, J, “Computational Fluid Dynamics: Principles and Applications”, Elsevier Science Publication, Oxford, UK, 2005. 335 Sven Perzon, “On blockage effects in wind tunnel - A CFD Study”, SAE - 2001-01-0705, 2001. 334
211
12 Appendix A A.1
Computer Code for a Transfinite Interpolation
This subroutine is based on a transfinite interpolation with a Lagrangian blending function. The following section describes the subroutine arguments. Nomenclature F
:
IL, JL :
Grid position (x, y, or z) Number of grid points in i and j-directions, respectively.
II(i), JJ(j) : This array stores the locations of known grid lines in i- and j-directions, respectively (1 for known grid lines). IS, IE, JS, JE : Starting and ending of region (computational) of interest. IMAX, JMAX : Array dimension Example: Consider surface IV in Figure 12.1. In this case, five grid lines are known: two lines at GH, two lines at GJLN, and one line at NO. The size of the grid is 95 in the I-direction and 50 in the Jdirection. Point G is at (70, 15) and point O is at (95, 25).
212
213
214
215
Figure 12.1
Symmetry plane (XY)