Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Generatzione di grigrila in ambito industriale Grid generation using Background grid based Size Functions Presented By Erling Eklund <[email protected]> Fluent France SA Prepared By Jin Zhu <[email protected]> Fluent, Inc. 1 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Outline 1. Introduction 2. Geometry based size functions 3. Initialisation and generation 4. Examples 5. Meshed based size function 6. Related development 7. Conclusion 2 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • The traditional key aspects of a High quality Industrial CFD Mesh – Good cell quality • Low skew • Low aspect ratio (non-uniform flow) – Sufficient mesh density to capture physics to the prescribed accuracy – Sufficient mesh resolution to capture geometry curvature and proximity – Mesh smoothness 3 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Size control methods: – Size functions using background mesh. – Premesh boundaries of the domain. • Example: Using faceting – Size control by spatial decomposition. • Often structural meshing – Direct size transfer from source entities. • Example: adaptive meshing 4 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Example: Circle pre-meshed with size 0.05, Face meshed with size 1.0 Total of 5656 elements 5 Meshed with fixed size on circle and controlled mesh growth of 1.2 from the circle Total of 1950 elements Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Size Function requirements – General and versatile in size control for all kinds of geometry, all meshing algorithms and all types of element. – Fast. – Local geometric effects have to be able to radiate, or influence size on a more nonlocal area. 6 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Terminology – Source entities Different size function requires different entities types: • Fixed – vertex, edge, face, volume; • Curvature – edges (2D), faces (3D); • Proximity – faces, volumes (i.e. all faces of the given volumes); – Attached entities • Can be any meshable entities (edges, faces, or volumes); – Growth rate • The pace to progress from initial size on source; – Size limit • Mesh size will stay unchanged once reach size limit. 7 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Fixed SF definitions: – • constant start size on source + common parameters; Curvature SF definitions – – normal angle + common parameters; independent of geometry size, purely based on curvature. 8 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Proximity SF definitions: – Including: • face to face proximity (3D proximity, left) • edge to edge proximity of same face (2D proximity, right). – cells/gap + common parameters, 9 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Size function initialization – Initialization establishes the desired sizes everywhere on the sources. – Initialize fixed SF: • Mesh-size on source = start size. 10 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Initialize 3D curvature SF – – – Create facets for source faces so that the angle between the normal vectors of any two adjacent facets does not exceed given angle. Global Control of the shape of curvature facets might be needed Mesh-size is computed for and stored to each node of triangle facets: mesh-size = 2*sin(def-α /2)/max-curvature which is dependent only upon pre-defined angle and local curvature. 11 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 – A min-size tolerance is provided to prevent too small size from very large curvature due to abnormal geometry features. – Later the size at each node is smoothed amongst all nodes of facets on the same face. n2 ’ n+1 n2 α n1 n2 ” n α’ α f1 n-1 f2 Splitting big facet if local angle α>defined angle local circle 90 90 o α/2 Mesh size at a node=standard distance between (n, n+1) (i.e. using def-α, instead of locally varying angle). Size = 2Rsin(α/2), R=1/curvature 12 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Initialize 2D curvature SF: – Create coarse facets of source edges; – Refine edge facets (i.e. bisect facet and then project mid-point to edge) until the offset distance from chord to arc segment is smaller than a distance tolerance, or the angle change across the arc segment is less than an angle tolerance. mesh-size on source facet = 2*sin(angle/2)/mid-curvature. – Mesh-size is computed for and stored to each edge facet. 13 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Example: Meshed curvature edges with similar size distributions to initialized edge segments 14 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Initialize proximity SF: – Create coarse facets for source faces according to some specified normal angle criteria – Refine coarse facets to localize the influence of proximity SF: • Checking the distance between each facet and all other opposing (i.e. visible) facets, and choose the closest one. – Compute mesh size at each facet: Mesh size = gap-distance/cells-per-gap. 15 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Example: influence area influence area gap-dist f1 f2 (size-1) max-edge Unrefined facet in gap: identical mesh size on a big facet gap-dist Split a facet from its longest edge max-edge (size-2) (size-f) split facet Refined facets: gap influence is localized: size-1>size-f, size-2>size-f Gap influence w.r.t. facets refinement at a gap 16 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Size calculations from fixed SF – Get closest projection from a given point to a source – – – entity; Compute distance from given point to the projected point; Grow mesh size from source entity along distance to given point; Compare mesh sizes obtained from all sources and take smallest one. 17 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Size from curvature SF: – Get closest projection from a point to a closest facet on source entity (an edge or a face); – For 3D: interpolate the size at projected point from the 3 nodes of the closest facet; – Compute distance from given point to projected point on source entity; – Grow mesh size along the computed distance; – Compare mesh sizes obtained from all source entities and take smallest one. 18 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Size from 3D proximity SF – Get closest projection from a given point to facets (sizeby-closeness); – If the given point is within the gap, directly take the mesh size from the chosen facet (i.e. uniform mesh size inside and around gap); – If the given point is outside the gap, compute distance from given point to projection point, minus gapdistance, and grow mesh size by this distance (i.e. radiated mesh size outside gap); 19 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 P uniform size domain growth distance gap-distance proximity facets gap-distance gap-distance • Size from 3D proximity SF-cont. – Grow the min-size of face from the min-size-facet to given point (size-from-min); – Compare two obtained sizes, take the smaller one; – Compare mesh sizes obtained from all sources and take the smallest one. 20 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Size from 3D proximity SF-cont. – Compare results using only size-by-closeness and including size-from-min; size-by-closeness only size-by-closeness & size-from-min 21 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Size from 2D proximity SF. – Re-project the surface projection obtained in 3D case to the closest edge segment of the same face; – Grow mesh size of the closest edge segment from surface projection to given point (size-by-closeness); – Grow mesh size of the min-size-segment to given point (size-from-min); R2 P d1 – Compare two obtained sizes, R1 take the smaller one; d2 – Compare with 3D proximity result, and take the smaller one. min-size-seg 22 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Background grid initialization – – Generate a united bounding box from all entities having same size functions attachment. Establish values at the B-grid corner nodes. • • Assuming r is the distance from a source entity (i.e. projection point) to a given point (here the grid node); Find the distance region between two subsequent grown distances in which the grid node of radius r locates: rn-1 <= r <= rn • • Get associated mesh sizes, sn-1 and sn, at rn-1 and rn; Compute parameter α at the point between rn-1 and rn: α = (r - rn-1)/(rn - rn-1) • Compute the mesh size at given node: s=(1 – α )sn-1 + αsn 23 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Mesh size on source entity s0 0 s = s × g n−1 n−1 1 2 step 1 step 2 s =s ×gn 0 n-1 n p a 1-a rn-1 r rn Growing mesh size from source entity and interpolating size for a given point g = growth rate 24 0 n Mesh size Progressive growth Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • B-grid refinement and control – – – If a B-grid’s central mesh size difference between average value and the value computed from SF is larger than a user specified error percentage, the Bgrid will be refined; If a B-grid contains source entities whose smallest size is less than the minimum size at the 8 corner points of the cell, the cell is refined; The number of B-grid refinement levels could also be user controlled, to avoid over refinement 25 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Use Interpolate mesh size at given location • The mesh size at any given point during meshing process is interpolated through the chain of B-grid to its leaf grids by tri-linear shape functions: ∑ NiSi • • Si – mesh size at 8 corner points of the grid; Ni – interpolation function for each corner point which is defined as the functions of local coordinates of the given point inside the leaf grid. 26 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Example: – Meshing the clown using a single curvature size function (a) Whole head (b) Eyeball 27 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Example: – Meshing the clown using a single curvature size function (c) Hat-tail 28 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Example: – Use of 3D proximity SF in volume meshing Meshing results Geometry 29 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Example: – Use of combined size functions (a) Elliptical holes 30 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Example: – Use of combined size functions (b) Airfoil shape geometry 31 (c) Local mesh Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Why meshed size function? • Problems encountered during the meshing processes in using previously described size function capabilities: – Can not handle clustered source mesh sizes defined by user’s manual manipulation; – Alternatively, use of multiple fixed size functions for the following application is both inconvenient and inaccurate. l k j a i b c h d e f g 6 different fixed SFs are needed to specify size distributions for the airfoil face 32 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Inconsistency of size functions when attached to connected geometries Volume.1 Volume.2 Curvature and proximity SFs are attached to connected volumes, and mesh size conflict occurs at their common face because proximity sf dominates exterior volume.1 whereas curvature sf dominates interior volume.2. The common face follows volume.1 and mismatches volume.2 33 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Two connected faces have mesh conflict on their common edge, especially when heavy interval count adjustment is required by some mesh schemes, like map. a Source edge b Noticeable size jump across the common edge 34 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Another similar case Source vertex a b Mapped face mesh Paved face mesh 35 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Unable to handle mesh creation from lower topologies with imported mesh A Volume with imported face mesh 36 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Solution – Therefore, creating a mesh that is radiated in a controlled manner from some pre-meshed boundaries of the domain can be an efficient and supplemental way of obtaining desired mesh transition and gradation. • Definition – The definition of meshed size function is similar to existing size functions, • Source edges/faces and attachment entities; • growth rate and size limit are required; • does not need the parameter for initialization. 37 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Flow chart, including Meshed size function Geometry Entities •Geometry Entities Source Attachment SF Definition SF•Definition •Fixed Fixed Curvature •Curvature Proximity •Proximity •Initializations Initializations •B-Grid BG GridGeneration Generation Evaluator •MeshingTools Tools Meshing 38 Meshed •Proximity Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Initialization • Initialization establishes the desired sizes everywhere on the sources. • The mesh SF directly uses the meshes on source edge or source face as start size. – For edge source, each element is converted to a segment and the length of the element is stored to the segment and represents the local mesh size on the source edge. – For face source, each triangle element is converted to a facet, and the average length of the 3 sides of the triangle element is stored to the facet and represents the local mesh size on the source face. – If the source face has quad elements, each quad element is split into two triangle elements each of which is converted as above. 39 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Use of meshed size function • When evaluating the mesh size at a point: – For edge source: projecting the point to all edge segments – For face source: projecting the point to the best facet of the face. – If the projection is valid, the mesh size stored in that edge segment or face facet is taken as the start size and then grown to the given point, according to specified growth rate. – Choose the smallest size grown from all source entities of the meshed SF. – Choose the smallest size from all size functions. 40 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Example 1 • Meshing results from connected elliptical cylinder: – A mesh SF is created using the common face as source and is attached to the interior volume; – Prevented the size jump in the interior volume; – The meshes of the interior volume are radiated nicely from the common face, in spite of the varying mesh sizes on common face. Without mesh SF With mesh SF 41 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Example 2 • Updated meshing results from connected faces – Defined a second mesh SF using the common edge ab as source and attach it to the right face; – The mesh SF dominates the whole domain of the right face; – The tri/pave algorithm created smooth mesh transitions from the common edge and across the whole right face, and the adjustment to the mesh distributions on the common edge no longer deteriorates the mesh quality on the right face. a Source edge b Without mesh SF With mesh SF 42 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Example 3 • Similar updated results from introduction 5 ? – No matter what scheme is used, the meshes on the right face are grown in such a way that no sudden changes of mesh size can be noticed; – The whole meshes are smoothly radiated from the same Source vertex upper-left vertex without size jumping. a b With mesh SF Without mesh SF 43 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Example 4 • Generating a volume mesh from imported face mesh – Specify the face having imported mesh as source, and volume to be meshed as attachment; – The volume is meshed with desired radiation. Existing mesh Volume mesh 44 Internal mesh patterns Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 • Related development – Meshed Size Function on Boundary layer cap No SF. 9097 tets. Max-skew 0.76 Meshed SF from bottom face 2943 tets. Max-skew 0.92 45 Meshed SF from BL cap 11868 tets. Max-skew 0.75 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 – An Example illustrating conflict: • At the intersection of the pipe with the box, there is a fillet with a radius of 0.1. After structural meshing of the pipe, assign curvature and meshed size function to the brick and tet mesh it. • This produces a bad mesh – why? Skewed elements without blending. 56622 elements. max skewness: 0.98 46 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 – How can size Function be used to improve Quad paving : • Quad paver technology does not work well in situation where you have internal edge loops with significantly different mesh density compared to external edge loops With Size Function worst skew 0.6 Without size function worst skew 0.8 47 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 – Faster Background grid generation • Direct solution of n : – Analytically summing the terms of the geometrical series instead of an iterative method • Define sources Sn = S0*gn – Distances to source entities at a given point then is • R0 = 0, R1 = S0*g, R2 = S0*g2 …. – Knowing the Euclidean distance R from the source, we can directly solve for the exponent • Rn = S0 (gn-1)/(g-1)-S0 • n = ln( R(g-1)/S0+g ) / ln(g) • Taking the integer part of n – The Source at Sp can the be evaluated using linear interpolation using R, Rn, Rn+1, Sn and Sn+1 48 Tecniche di Generazione di Griglie per il Calcolo Scientifico 2005 Conclusions • Automatic and smooth mesh distribution is essential • • in producing high quality CFD results for all industry sectors Background grid based Size Functions (fixed, curvature, proximity and meshed) and their combinations handle virtually all geometric features, and provide rapid evaluators for all element types in different meshing tools. The algorithms has been successfully tested on a wide variety of models with excellent results. 49