«Proceedings of the 16th International Conference on Numerical Methods in Fluid Dynamics, To appear in Lecture Notes in Physics, Springer−Verlag, ...»
Proceedings of the 16th International Conference on Numerical Methods in Fluid
Dynamics, To appear in "Lecture Notes in Physics",
Springer−Verlag, Heidelberg Germany.
Aspects (and Aspect Ratios) of Cartesian
Marsha J. Berger
New York, NY 10012
Michael J. Aftosmis
NASA Ames Research Center
Moffett Field, CA 94035
6−10 July, 1998
Aspects and Aspect Ratios of Cartesian
Marsha Berger+ and Michael Aftosmis
+ Courant Institute, New York, NY 10012 email: firstname.lastname@example.org NASA Ames Research Center, Mo ett Field, CA 94025 email: email@example.com Key Words: grid generation, Cartesian meshes, complex geometry, embedded boundaries 1 Introduction Over the last decade, researchers have taken another look at the use of Cartesian meshes for grid generation around complicated con gurations Melton 96, Karman 95, Charlton and Powell 97, Landsberg and Boris 93, Pember et al. 91. This research has demonstrated the advantages of cutcell Cartesian approaches in robustness, e ciency and automatibility. Although the arbitrarily small cut-cells which appear at intersections with the geometry may introduce accuracy and stability concerns, Cartesian methods present a viable path for mesh generation around complex geometry.
This paper presents a concise description of a revised grid generation algorithm for Cartesian meshes with embedded geometry. While conceptually straightforward, certain decisions make the process extremely e cient both in terms of memory requirements and execution speed. Adaptively re ned meshes with millions of cells may be generated for very complex geometries within minutes on a desktop workstation. The paper also presents an approach for resolving geometry which splits Cartesian cells into distinct regions with unique ow states. It further examines the possibility of reducing the number of Cartesian cells in a domain through the use of anisotropic sub-division of Cartesian cells using a variety of con gurations. A detailed example of the run-time performance of the grid generator is included.
1.1 Background A comprehensive presentation of Cartesian mesh methods must consider a variety of topics. This paper focuses mainly on the generation of Cartesian meshes with embedded boundaries. This includes the computational geometry algorithms and data structures which support rapid intersection of nonconvex objects, as well as mesh re nement criteria. The grid generation process is greatly simpli ed by a preprocessor described in Aftosmis, et al.
2 Marsha Berger and Michael Aftosmis 98 which robustly extracts the wetted surface of a con guration described by surface triangulations of an arbitrary number of individual possibly intersecting objects.
Another important aspect of Cartesian mesh methods concerns the numerical issues that arise in computing steady ow. The lack of grid smoothness at the cut-cells where the solid body intersects the grid locally degrades scheme accuracy. However, much work has been done in the last few years developing methods for these types of irregular grids Coirier and Powell 94, Berger and Melton 94, Johansen and Colella 99. The situation for time dependent ows however is more di cult and less developed. This is mainly due to stability problems encountered by explicit methods on cut-cells whose volumes are potentially orders of magnitude smaller than the regular ow cells.
In both the steady and time dependent cases, mesh re nement is an important component. Section 2.3 examines a generalization of the re nement criteria to include anisotropic subdivision. This approach helps reduce the number of cells produced at each adaptation by a constant factor, and o ers the potential of resolving a given geometry with considerably fewer Cartesian cells. Finally, section 4 mentions extensions currently underway to inviscid ows with moving geometry and to the automatic generation of viscous grids with boundary layer zoning.
2 Cartesian Grid Generation Algorithm The starting point for the grid generator is a closed watertight surface triangulation describing the geometry. In broad outline, our algorithm rst intersects the geometry with the mesh, re ning the ow eld cells where necessary.
This process repeats until the maximum speci ed number of levels has been reached or no more re nement is needed. Only at this point is the detailed geometric information at the cut-cells computed. This is described in section
2.1. As a result of this process, some cut-cells may be split into several separate polyhedra. We describe a robust algorithm for treating such split-cells" in section 2.2. Finally, section 2.3 presents an extension of the grid generator that allows anisotropic re nement of Cartesian cells. While this approach cannot be applied to boundary-layer zoning, it can substantially reduce the total number of cells required for a given simulation. Since the grid generator views the mesh as a completely unstructured collection of hexahedra, the data structures easily accommodate such anisotropically re ned cells.
2.1 Overall Description Grid generation proceeds in two steps. In the rst, a uniform, coarse Cartesian mesh possibly a single root" cell is repeatedly re ned using only simple geometric criteria. The goal is to provide a good starting mesh for the ow Aspects and Aspect Ratios of Cartesian Mesh Methods 3 solver, and to ensure the geometry is well resolved on the mesh. During this step, the only geometric information needed is whether or not a Cartesian cell is in the ow eld, within the solid object, or cut by the geometry. At the end of this step, the ow eld cells in the volume mesh have been completely determined, and can be written to disk. This frees active memory so that more elaborate data structures can be retained for determining the precise geometry of the cut-cells without increasing the maximum memory needed during mesh generation. In the second step, the detailed intersection of the geometry and the cut-cells is computed.
In a little more detail, the grid generation starts with an initial coarse mesh of speci ed dimensions. The cells are classi ed as ow, cut or solid.
Cut-cells can be classi ed by intersecting them with the surface triangulation.
This can be done rapidly using the ADT Bonet and Peraire 91 to store the triangles, so that each query takes OlogNT , where NT is the number of triangles in the surface description. Further speedup comes from using bounding box lters preceding the ADT search. Flow" and solid" cells can be classi ed by ray-casting O'Rourke 94 from the test cell to just outside the bounding box of the closed, watertight, geometry. Again the ADT is useful here for searching through surface triangles. However, to minimize this expensive ray-casting procedure, once a cell's status is determined, it shares this status with all its uncut neighbors in a painting" step. Thus, one ray cast can classify a large number of cells. These search and traversal algorithms are described in more detail in Aftosmis, et al. 98 . Cartesian cells which lie completely internal to the geometry solid" cells are immediately removed from the mesh, and only the ow and cut-cells are retained.
Based on estimates of the surface curvature, cut-cells are marked as needing re nement. A number of neighboring cells are also marked to be re ned.
These bu er" layers typically extend three to ve cells in all directions. The re nement criteria looks at both the variation of the surface normals within a cell, and the variation of the average normal between cells. This criteria alone would always re ne cells that are split by the geometry, even if two distinct surfaces within a cell were planar. To avoid this, the variation of normals for each connected piece of the surface needs to be measured separately. Note that the re nement in the mesh generator is solely based on resolving the geometry. Further solution-adaptive mesh re nement will occur as necessary in the ow solver.
After the cells are marked for division the actual re nement takes place, and new cells and faces are created. To prevent adjacent cell sizes from di ering by more than one level, the cell division routines sweep from coarsest to nest. The faces are kept sorted in x y z order. To maintain this convention, the face lists are repacked after each complete division pass. Finally, some of the newly re ned cells will lie entirely within the geometry. Again, ray-casting determines the cell status of a newly created non-intersected cell. The solid 4 Marsha Berger and Michael Aftosmis cells with their associated faces are then deleted from the mesh and the cell and face lists are compacted.
In the second phase of the grid generation, the detailed intersection of the surface triangles and cut cells is computed. The data structures for these cells are necessarily more complex than those of non-intersected Cartesian cells.
Each cut-cell maintains a list of its intersected surface triangles. The ow" faces of the cut cell are determined by clipping the Cartesian faces against the triangles. Each triangle may also be clipped into a convex polygon by the cell that owns it. The true centroids and areas of these polygons, cut faces and cut cells are also computed and retained. Cells and faces in the volume mesh uncut cells require 9 four-byte words of storage per cell. Since each cutcell is linked to its triangles, the storage for cut cells is problem dependent.
However, in the example of gure 5 the cut cells generated using 9 levels of mesh re nement required an average of 84 words per cell. This includes full information, such as the double precision centroids of each triangle's intersection with each cut cell. On average each cut cell was linked to 4.19 triangles. Since the volume mesh is written to disk and storage is released before the cut cell processing, the maximum memory used to generate the mesh was 53 Mb.
2.2 Split-Cells As with any method, certain annoying details must be taken care of. For Cartesian grids with embedded geometry, this laborious chore comes from cut Cartesian cells which are split" into multiple distinct ow" regions by the geometry. For example, a thin wing may bisect the cells for the trailing 15 of the chord, even though the Cartesian cell size would be su cient to resolve either the top or bottom of the thin surface alone. It can be quite ine cient to use mesh re nement alone to resolve the entire thin piece of geometry. Even geometry that does not appear thin may produce a small number of split-cells. Figure 1 shows examples of split-cells stemming from two common geometric situations.
The main di culty in treating this problem is recognizing that a cell has been split, and connecting the various faces with their corresponding possibly split neighbor cells. This is further complicated by the possibility of re nement boundaries occurring at such faces. A coarse cell face may be split, whereas the corresponding face on the re ned neighbor may not be.
The example in gure 2 shows a large cell a linked to four smaller cells. The high x face of cell a is split, but it links to the low x face of cell b which is not.
In the case presented by the gure, ve faces would be stored, one for ab, two for ac cell c is split, one for ae and one for ad. To include all diabolical cases, the algorithm also permits cells to be split into more than two ow cells.
Our treatment of split-cells rst groups the connected surfaces within a cell into distinct polyhedra. Since phase two of the mesh generator works cellAspects and Aspect Ratios of Cartesian Mesh Methods 5 by-cell, each cell must save enough information to correctly match with its neighboring possibly split-cells as a post-processing step. We match fragments of the Cartesian edges themselves. Each split-cell or face must have an edge fragment from the Cartesian mesh with an original Cartesian edge. Since Cartesian edges are known by their integer coordinates, they can be used to unambiguously match the fragments on either side. Relying on constructed geometry, for example resulting from the polygon clipping may introduce oating-point errors which could lead to non-robustness. Centroid matching algorithms can be fooled. Using an integer-based approach eliminates any dependence on oating point comparisons.
2.3 Anisotropic Re nement One of the major drawbacks of Cartesian methods is its lack of exibility, particularly in the ability to do directional re nement. A solution to this problem would be a breakthrough for extending Cartesian mesh methods to the high Reynolds number viscous case. An interesting rst stab at this problem is in Coirier 94, where cells in a two dimensional quadtree mesh are re ned with only one planar cut rather than the usual two, and the direction is arbitrary. Unfortunately, this produced meshes that were too irregular for the ow solver to compute an accurate solution. Here we explore the usefulness of a limited anisotropic re nement capability along Cartesian coordinate directions. The asymptotic complexity of this approach is not su cient to produce boundary layer" zoning for viscous ows; our aim is to reduce the total number of cells in an inviscid mesh. At this point we are only considering the use of anisotropic re nement to resolve static geometry. We follow the same procedure as in Aftosmis 94, although that paper applied it to a three dimensional ow eld without geometry.
The main di culty lies in establishing useful criteria for directional renement, and trying to insure that there are smooth transitions between anisotropic regions in di erent directions. Our strategy is two-fold: if the variation of surface normals within a cell is large enough to warrant re nement, and is almost completely in one coordinate direction, we re ne only in that direction. Our de nition of almost completely" is illustrated in gure 3, where if the variation in the surface normals is outside an angle of the coordinate direction, re nement in that direction occurs. Secondly, we use the cautious strategy of also re ning in the direction normal to the surface normal, or most parallel to the geometry. The surface normals do not give any information about this direction. The expectation is that the ow eld associated with surface curvature will warrant the additional re nement. Note that with this strategy, no cell will be re ned in only one direction.