©1999 CRC Press LLC

Acquiring Editor: Project Editor: Marketing Manager: Cover design: Manufacturing Manager:

B. Stern Sylvia Wood J. Stark Dawn Boyd Carol Slatter

Library of Congress Cataloging-in-Publication Data Thompson, Joe F. Handbook of Grid Generation / Joe F. Thompson, Bharat Soni, Nigel Weatherill, editors. p. cm. Includes bibliographical references and index. ISBN 0-8493-2687-7 (alk. paper) 1. Numerical grid generation (Numerical analysis) I. Thompson, Joe F. II. Soni, B.K. III. Weatherill, N.P. QA377.H3183 1998 519.4--dc21

98-34260 CIP

This book contains information obtained from authentic and highly regarded sources. Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the author and the publisher cannot assume responsibility for the validity of all materials or for the consequences of their use. Neither this book nor any part may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, microfilming, and recording, or by any information storage or retrieval system, without prior permission in writing from the publisher. All rights reserved. Authorization to photocopy items for internal or personal use, or the personal or internal use of specific clients, may be granted by CRC Press LLC, provided that $.50 per page photocopied is paid directly to Copyright Clearance Center, 27 Congress Street, Salem, MA 01970 USA. The fee code for users of the Transactional Reporting Service is ISBN 0-8493-2687-7/99/$0.00+$.50. The fee is subject to change without notice. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. The consent of CRC Press LLC does not extend to copying for general distribution, for promotion, for creating new works, or for resale. Specific permission must be obtained in writing from CRC Press LLC for such copying. Direct all inquiries to CRC Press LLC, 2000 Corporate Blvd., N.W., Boca Raton, Florida 33431. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation, without intent to infringe. © 1999 by CRC Press LLC No claim to original U.S. Government works International Standard Book Number 0-8493-2687-7 Library of Congress Card Number 98-34260 Printed in the United States of America 1 2 3 4 5 6 7 8 9 0 Printed on acid-free paper

©1999 CRC Press LLC

Foreword

Grid (mesh) generation is, of course, only a means to an end: a necessary tool in the computational simulation of physical field phenomena and processes. (The terms grid and mesh are used interchangeably, with identical meaning, throughout this handbook.) And grid generation is, unfortunately from a technology standpoint, still something of an art, as well as a science. Mathematics provides the essential foundation for moving the grid generation process from a user-intensive craft to an automated system. But there is both art and science in the design of the mathematics for — not of — grid generation systems, since there are no inherent laws (equations) of grid generation to be discovered. The grid generation process is not unique; rather it must be designed. There are, however, criteria of optimization that can serve to guide this design. The grid generation process has matured now to the point where the use of developed codes — freeware and commercial — is generally to be recommended over the construction of grid generation codes by end users doing computational field simulation. Some understanding of the process of grid generation — and its underlying principles, mathematics, and technology — is important, however, for informed and effective use of these developed systems. And there are always extensions and enhancements to be made to meet new occasions, especially in coupling the grid with the solution process thereon. This handbook is designed to provide essential grid generation technology for practice, with sufficient detail and development for general understanding by the informed practitioner. Complete details for the grid generation specialist are left to the sources cited. A basic introduction to the fundamental concepts and approaches is provided by Chapter l, which covers the state of practice in the entire field in a very broad sweep. An even more basic introduction for those with little familiarity with the subject is given by the Preface that precedes this first chapter. Appendixes provide information on a number of available grid generation codes, both commercial and freeware, and give some representative and illustrative grid configurations. The grid generation process in general proceeds from first defining the boundary geometry as discussed in Part III. Points are distributed on the curves that form the edges of boundary sections. A surface grid is then generated on the boundary surface, and finally, a volume grid is generated in the field. Chapter 13, although directed at structured grids, gives a general overview of the entire grid generation process and the fundamental choices and considerations involved from the standpoint of the user. Chapter 2, though also largely directed at structured grids, covers essential mathematical elements from tensor analysis and differential geometry relevant to the entire subject, particularly the aspects of curve and surfaces. The other chapters of this handbook cover the various aspects of grid generation in some detail, but still from the standpoint of practice, with citations of relevant sources for more complete discussion of the underlying technology. The chapters are grouped into four parts: structured grids, unstructured grids, surface definition, and adaptation/quality. An introduction to each part provides a road map through the material of the chapters. A source of fundamentals on structured grid generation is the 1985 textbook of Thompson, Warsi, and Mastin, now out of print but accessible on the Web at www.erc.msstate.edu. A recent comprehensive text of both structured and unstructured grids is that of Carey 1997 from Taylor and Francis publishers.

©1999 CRC Press LLC

The first step in generating a grid is, of course, to acquire and input the boundary data. This boundary data may be in the form of output from a CAD system, or may simply be sets of boundary points acquired from drawings. CAD boundary data are generally in the form of some parametric description of boundary curves and surfaces, typically consisting of multiple segments for which assembly and some adjustments may be required. Point boundary data may be in the form of 1D arrays of points describing boundary curves and 2D arrays for boundary surfaces, or could be an unorganized cloud of points on a surface. In the latter case, conversion to some surface tessellation or parametric description is required. These initial steps of boundary definition are common in general to both structured and unstructured grid generation. And, unfortunately, considerable human intervention may be necessary in this setup phase of the process. The setup of the boundary definition from the CAD approach is discussed in general in Chapter 13, while details of application, together with procedures for boundary curve and surface parametric representations, are covered in Part III. There is then the fundamental choice of whether to use a structured or unstructured grid. Structured grids are covered in Part I, and unstructured grids are covered in Part II. The next step with either type of grid is the generation of the corresponding type of grid on the boundary surfaces — preceded, of course, by a distribution on points on the curves that form the edges of these surfaces. This surface grid generation is covered in Chapters 9 and 19 for structured and unstructured grids, respectively. Finally, the quality of the grid, with relation to the accuracy of the numerical solution being done on the grid, and the adaptation of the grid to improve that accuracy are covered in Part IV. Grid generation is still under active research and development, particularly in regard to automation, adaptation, and hybrid combinations. This handbook is therefore necessarily a snapshot in time, especially in these areas, but much of the material has matured now, and this collection should be of enduring value as a source and reference.

Bharat K. Soni Joe F. Thompson Nigel P. Weatherill Starkville, MS, and Swansea, Wales, UK

©1999 CRC Press LLC

Contributors Michael J. Aftosmis

Gerald Farin

Olivier-Pierre Jacquotte

NASA Ames Research Center Moffett Field, CA

Arizona State University Tempe, AZ

Research Directorate (DRET) Paris, France

Timothy J. Baker

David R. Ferguson

Brian A. Jean

Princeton University Princeton, NJ

The Boeing Company Seattle, WA

U.S. Army Corps of Engineers Waterways Experiment Station Vicksburg, MS

Mark W. Beall

Luca Formaggia

Rensselaer Polytechnic Institute Troy, NY

Ecole Polytechnique Federale de Lausanne Lausanne, Switzerland

Yannis Kallinderis

Timothy Gatzke

O.B. Khairullina

The Boeing Company St. Louis, MO

Urals Branch of the Russian Academy of Sciences Ekaterinburg, Russia

Marsha J. Berger Courant Institute New York University

William M. Chan MCAT, Inc. at NASA Ames Research Center Moffett Field

Paul-Louis George

Zheming Cheng

Bernd Hammann

Program Development Corporation White Plains, NY

University of California at Davis Davis, CA

Hugues L. de Cougny Rensselaer Polytechnic Institute Troy, NY

Luís Eça Technical University of Lisbon Lisbon, Portugal

Peter R. Eiseman Program Development Corporation White Plains, NY

Austin L. Evans NASA Lewis Research Center Cleveland, OH

©1999 CRC Press LLC

INRIA Le Chesnay Cedex, France

O. Hassan University of Wales Swansea Swansea, UK

Jochem Häuser CLE Salzgitter Bad Salzgitter, Germany

Frédéric Hecht INRIA Le Chesnay Cedex, France

Sergey A. Ivanenko Computer Center of the Russian Academy of Sciences Moscow, Russia

University of Texas Austin, TX

Ahmed Khamayseh Los Alamos National Laboratory Los Alamos, NM

Andrew Kuprat Los Alamos National Laboratory Los Alamos, NM

Kelly R. Laflin North Carolina State University Raleigh, NC

Kunwoo Lee Seoul National University Seoul, Korea

David L. Marcum Mississippi State University Starkville, MS

C. Wayne Mastin Nichols Research Corporation Vicksburg, MS

D. Scott McRae

E. J. Probert

Joe F. Thompson

North Carolina State University Raleigh, NC

University of Wales Swansea Swansea, UK

Mississippi State University Starkville, MS

Robert L. Meakin

Anshuman Razdan

O.V. Ushakova

Army Aeroflightdynamics Directorate (AMCOM) Moffett Field, CA

Arizona State University Tempe, AZ

Urals Branch of the Russian Academy of Sciences Ekaterinburg, Russia

John E. Melton

Robert Schneiders MAGMA Giessereitechnologie GmbH Aachen, Germany

Zahir U.A. Warsi

NASA Ames Research Center Moffett Field, CA

David P. Miller

Jonathon A. Shaw

Nigel P. Weatherill

NASA Lewis Research Center Cleveland, OH

Aircraft Research Association Bedford, U.K.

University of Wales Swansea Swansea, UK

K. Morgan

A.F. Sidorov

Yang Xia

University of Wales Swansea Swansea, UK

Urals Branch of the Russian Academy of Sciences Ekaterinburg, Russia

CLE Salzgitter Bad Germany

Robert M. O’Bara Rensselaer Polytechnic Institute Troy, NY

Sangkun Park

Mark S. Shephard Rensselaer Polytechnic Institute Troy, NY

Information Technology R&D Center Seoul, Korea

Robert E. Smith

J. Peraire

Bharat K. Soni

Massachusetts Institute of Technology Cambridge, MA

Mississippi State University Starkville, MS

J. Peiró Imperial College London, UK

©1999 CRC Press LLC

NASA Langley Research Center Hampton, VA

Stefan P. Spekreijse National Aerospace Laboratory (NLR) Emmeloord, The Netherlands

Mississippi State University Starkville, MS

Tzu-Yi Yu Chaoyang University of Technology Wufeng, Taiwan

Paul A. Zegeling University of Utrecht Utrecht, The Netherlands

Acknowledgments

Grid (mesh) generation is truly a worldwide active research area of computation science, and this handbook is the work of individual authors from around the world. It has been a distinct pleasure, and an opportunity for professional enhancement, to work with these dedicated researchers in the course of the preparation of this book over the past two years. The material comes from universities, industry, and government laboratories in 10 countries in North America, Europe, and Asia. And we three are from three different countries of origin, though we have collaborated for years. The attention to quality that has been the norm in the authoring of these many chapters has made our editing responsibility a straightforward process. These chapters should serve well to present the current state of the art in grid generation to practitioners, researchers, and students. The assembly and editing of the material for this handbook from all over the world via the Internet has been a rewarding experience in its own right, and speaks well for the potential for worldwide collaborative efforts in research. Our thanks go to Mississippi State University and the University of Wales Swansea for the encouragement and support of our efforts to produce this handbook. Specifically at Mississippi State, the work of Roger Smith in administering the electronic communication is to be noted, as are the efforts of Alisha Davis, who handled the word processing. Bob Stern of CRC Press has been great to work with and appreciation is due to him for recognizing the need for this handbook and for his editorial guidance and assistance throughout its preparation. His efforts, and those of Sylvia Wood, Suzanne Lassandro and Dawn Mesa, also at CRC, have made this a pleasant process. We naturally are especially grateful for the support of our wives, Purnima, Emilie, Barbara, and our families in this and all our efforts. And finally, Mississippi and Wales — two great places to live and work.

Bharat K. Soni Joe F. Thompson Nigel P. Weatherill Author/Editors

©1999 CRC Press LLC

Preface: An Elementary Introduction

Joe F. Thompson, Bharat K. Soni, and Nigel P. Weatherill

This first section is an elementary introduction provided for those with little familiarity with grid (mesh) generation in order to establish a base from which the technical development of the chapters in this handbook can proceed. (The terms grid and mesh are used interchangeably throughout with identical meaning.) The intent is not to introduce numerical solution procedures, but rather to introduce the idea of using numerically generated grid (mesh) systems as a foundation of such solutions.

P-1

Discretizations

The numerical solution of partial differential equations (PDEs) requires first the discretization of the equations to replace the continuous differential equations with a system of simultaneous algebraic difference equations. There are several bifurcations on the way to the construction of the solution process, the first of which concerns whether to represent the differential equations at discrete points or over discrete cells. The discretization is accomplished by covering the solution field with discrete points that can, of course, be connected in various manners to form a network of discrete cells. The choice lies in whether to represent the differential equations at the discrete points or over the discrete cells.

P-1.1

Point Discretization

In the former case (called finite difference), the derivatives in the PDEs are represented at the points by algebraic difference expressions obtained by performing Taylor series expansions of the solution variables at several neighbors of the point of evaluation. This amounts to taking the solution to be represented by polynomials between the points. This can be unrealistic if the solution varies too strongly between the points. One remedy is, of course, to use more points so that the spacing between points is reduced. This, however, can be expensive, since there will then be more points at which the equations must be evaluated. This is exacerbated if the points are equally spaced and strong variations in the solution occur over scattered regions of the field, since numerous points will be wasted in regions of small variation. An alternative, of course, is to make the points unequally spaced.

P-1.2

Cell Discretization

The other possibility of this first bifurcation is to return the PDEs to their more fundamental integral form and then to represent the integrals over discrete cells. Here there is yet another bifurcation — whether to represent the solution variables over the cell in terms of selected functions and then to integrate

©1999 CRC Press LLC

FIGURE 1

these functions analytically over the volume (finite element), or to balance the fluxes through the cell sides (finite volume). The finite element approach itself comes in two basic forms: the variational, where the PDEs are replaced by a more fundamental integral variational principle (from which they arise through the calculus of variations), or the weighted residual (Galerkin) approach, in which the PDEs are multiplied by certain functions and then integrated over the cell. In the finite volume approach, the solution variables are considered to be constant within a cell, and the fluxes through the cell sides (which separate discontinuous solution values) are best calculated with a procedure that represents the dissolution of such a discontinuity during the time step (Riemann solver).

P-2

Curvilinear (Structured) Grids

The finite difference approach, using the discrete points, is associated historically with rectangular Cartesian grids, since such a regular lattice structure provides easy identification of neighboring points to be used in the representation of derivatives, while the finite element approach has always been, by the nature of its construction on discrete cells of general shape, considered well suited for irregular regions, since a network of such cells can be made to fill any arbitrarily shaped region and each cell is an entity unto itself, the representation being on a cell, not across cells.

P-2.1

Boundary-Fitted Grids

The finite difference method is not, however, limited to rectangular grids and has long been applied on other readily available analytical coordinate systems (cylindrical, spherical, elliptical, etc.) that still form a regular lattice. albeit curvilinear, that allows easy identification of neighboring points. These special curvilinear coordinate systems are all orthogonal, as are the rectangular Cartesian systems, and they also can exactly cover special regions (e.g., cylindrical coordinates covering the annular region between two concentric circles) in the same way that a Cartesian grid fills a rectangular region. The cardinal feature in each case is that some coordinate line is coincident with each portion of the boundary. In fact, these curvilinear systems can be considered to be logically rectangular, and from a programming standpoint are no different, conceptually, from the Cartesian system. Thus, for example, the cylindrical grid in Figure 1, where the radial coordinate r varies from r1 on the inner boundary to r2 on the outer and the azimuthal coordinate θ varies from 0 to 2π, can be diagrammed logically as shown in Figure 2.

©1999 CRC Press LLC

FIGURE 2

The continuity of the azimuthal coordinate can be represented by defining extra “phantom” columns to the left of 0 and to the right of 2π and setting values on each phantom column equal to those on the corresponding “real” columns inside of 2π and 0, respectively. This latter, logically rectangular, view of the cylindrical grid is the one used in programming anyway, and without being told of the cylindrical configuration, a programmer would not realize any difference here from programming in Cartesian coordinates — there would simply be a different set of equations to be programmed on what is still a logically rectangular grid, e.g., the Laplacian on a Cartesian grid (with ξ = x and η = y), 2 ∇ f = f + fηη ξξ becomes (with ξ = θ and η = r) ∇2 f =

f fη ξξ + fηη + η η2

on a cylindrical grid. The key point here is that in the logical (i.e., programming) sense there is really no essential difference between Cartesian grids and the cylindrical systems: both can be programmed as nested loops; the equations simply are different. Another key point is that the cylindrical grid fits the boundary of a cylindrical region just as the Cartesian grid fits the boundary of a rectangular region. This allows boundary conditions to be represented in the same manner in each case also (see Figure 3). By contrast, the use of a Cartesian grid on a cylindrical region requires a stair-stepped boundary and necessitates interpolation in the application of boundary conditions (Figure 4) — the proverbial square peg in a round hole.

P-2.2

Block Structure (The Sponge Analogy)

The best way to visualize the correspondence of a curvilinear grid in the physical field with a logically rectangular grid in the computational field is through the sponge analogy. Consider a rectangular sponge within which an equally spaced Cartesian grid has been drawn. Now wrap the sponge around a circular cylinder and connect the two ends of the sponge together. Clearly the original Cartesian grid in the sponge now has become a curvilinear grid fitted to the cylinder. But the rectangular logical form of the grid lattice is still preserved, and a programmer could still operate in the logically underformed sponge in constructing the loop and the difference expressions, simply having been given different equations to program. The correspondence of “phantom” points just outside one of the connected faces of the sponge

©1999 CRC Press LLC

FIGURE 3

FIGURE 4

with “real” points just inside the face to which it is connected is clear — this is simply the correspondence of 370° with 10° in a cylindrical system. Such a sponge could just as well be around a cylinder of noncircular cross section, regardless of the cross-sectional shape. To carry the analogy further, the sponge could, in principle, be wrapped around a body of any shape, or could be expanded and compressed to fill any region (e.g., expanding to fill a sphere), again producing a curvilinear grid filling the region and having the same correspondence to a logically rectangular grid (Figure 5). The programmer need not know, in fact, what has been done to the sponge. It is also clear from this analogy that the sponge could deform in time; i.e., the curvilinear grid could move in physical space, while the logically rectangular grid could still be considered fixed in computational space (image the sponge filling a beating heart). Again, the programmer need not be told that the boundaries are moving, but simply again be given a different set of equations that will include a transformation of the time derivatives as well. It is not hard to see, however, that for some boundary shapes the sponge may have to be so greatly deformed that the curvilinear grid will be so highly skewed and twisted that it is not usable in a numerical solution. The solution to this problem is to use not one, but rather a group of sponges to fill the physical field. Each sponge has its own logically rectangular grid that deforms to a curvilinear grid when the sponge is put in place in the field. Each sponge now abuts with adjacent sponges, and the correspondence

©1999 CRC Press LLC

FIGURE 5

across an interface is analogous to that across the two connected faces of the single sponge in the cylindrical case above — here it is simply that the “phantom” points just outside one sponge correspond to “real” points just inside a different sponge. Block-structured grid codes are based on this multiple-sponge analogy, with the physical field being filled with a group of grid blocks with correspondence of grid lines, and in fact complete continuity, across the interfaces between blocks. This approach has been carried to a high degree of application in the aerospace industry (cf. Chapter 13), with complete aircraft configurations being treated with a hundred or so blocks. Current grid generation systems seek to make the setup of this block structure both graphical and easy for the user. The ultimate goal is to automate the process (cf. Chapter 10). 2.3 Grid Generation Approaches With these obvious advantages of specialized curvilinear coordinate systems fitted to the boundaries of cylindrical, spherical, elliptical, and other analytic regions, it has been natural to use grids based on these systems for finite difference solutions on such regions. In the late 1960s the visual analogy between potential solutions (electrostatic potential, potential flow, etc.) that are solutions of Laplace’s equation, ∇2φ = 0, and curvilinear grids led to the idea of generating grid lines in arbitrary regions as the solution of Laplace’s equation. Thus, whereas potential flow is described in terms of a stream function ψ and a velocity potential φ that are orthogonal and satisfy ∇2ψ = 0, ∇2φ = 0 (Figure 6), a curvilinear grid could be generated by solving the system ∇2ξ = 0, ∇2η = 0 with η a constant on the upper and lower boundaries in the above region, while ξ is constant on the left and right boundaries (Figure 7). Here again, for purposes of programming, the grid forms a logically rectangular lattice (Figure 8). The problem of generating a curvilinear grid to fit any arbitrary region thus becomes a boundary value problem — the generation of interior values for the curvilinear coordinates from specified values on the boundary of the region (cf. Chapter 4). In order to set this up, note that we have for the boundary value problem the generation of interior values of the curvilinear coordinates ξ and η from specified constant values on opposing boundaries (Figure 9). Clearly ξ and η must vary monotonically and over the same range over the boundaries on which they are not specified, else the grid would overlap on itself. Thus, on the lower and upper boundaries, ξ here must vary monotonically from ξ 1 on the left to ξ 2 on the right. Similarly, on the left and right boundaries,

©1999 CRC Press LLC

FIGURE 6

FIGURE 7

FIGURE 8

η must vary monotonically from η1 at the bottom to η2 at the top. The next question is what this variation should be. This is, in fact, up to the user. Ultimately, the discrete grid will be constructed by plotting lines of constant ξ and lines of constant η at equal intervals of each, with the size of the interval determined by the number of grid lines desired. Thus, if there are to be 10 grid lines running from side to side between the top and bottom of the region, 10 points would be selected on the left and right sides — with their locations being up to the user. Once these points are located, η can be said to assume, at the 10 points on each side, 10 values at equal intervals between its top and bottom values, η1 and η2. With this specification on the sides, the curvilinear coordinate η is thus specified on the entire boundary of

©1999 CRC Press LLC

FIGURE 9

FIGURE 10

FIGURE 11

the region, and its interior values can be determined as a boundary value problem. A similar specification of ξ on the bottom and top boundaries by placing points on these boundaries sets up the determination of ξ in the interior from its boundary values. Now the problem can be considered a boundary value problem in the physical field for the curvilinear coordinates ξ and η (Figure 10) or can be considered a boundary value problem in the logical field for the Cartesian coordinates, x and y (Figure 11). Note that the boundary points are by nature equally spaced on the boundary of the logical field regardless of the distribution on the boundaries of the physical field. Continuing the potential analogy, the curvilinear grid can be generated by solving the system ∇2ξ = 0, ∇2η = 0, in the first case, or by solving the transformation of these equations (transformation relations are covered in Chapter 2), in the

©1999 CRC Press LLC

FIGURE 12

αxξξ − 2 βxξη + γxηη = 0 αyξξ − 2 βyξη + γyηη = 0 α = xη2 + yη2 γ = xξ2 + yξ2 β = xξ xη + yξ yη second case. Although the equation set is longer in the second case, the solution region is rectangular, and the differencing can be done on a uniformly spaced rectangular grid. This is, therefore, the preferred approach. Note that the placing of points in any desired distribution on the boundary of the physical region, where x and y are the independent variables, amounts to setting (x,y) values at equally spaced points on the rectangular boundary of the logical field, where ξ and η are the independent variables. This is the case regardless of the shape of the physical boundary. This boundary value problem for the curvilinear grid can be generalized beyond the analogy with potential solutions, and in fact is in no way tied to the Laplace equation. The simplest approach is to generate the interior values by interpolation from the boundary values — a process called algebraic grid generation (cf. Chapter 3). There are several variants of this process. Thus for the region considered above, a grid could be generated by interpolating linearly between corresponding points on the top and bottom boundaries (Figure 12). Note that the point distributions on the side boundaries have no effect here. Alternatively, the interpolation could be between pairs of points on the side boundaries (Figure 13). The second case is, however, obviously unusable since the grid overlaps the boundary. Here the lack of influence from the points on the bottom boundary is disastrous. Another alternative is transfinite interpolation in which the interpolation is done in one (either) direction as above, but then the resulting error on the two sides not involved is interpolated in the other direction and subtracted from the first result. This procedure includes effects from all of the boundary and consequently matches the point distribution that is set on the entire boundary. This is the preferred approach, and it provides a framework for placing any one-dimensional interpolation into a multipledimensional form. It is possible to include any type of interpolation, such as cubic, which gives orthogonality at the boundaries, in the transfinite interpolation format.

©1999 CRC Press LLC

FIGURE 13

It is still possible in some cases for the grid to overlap the boundaries with transfinite interpolation, and there is no control over the skewness of the grid. This gives incentive to now return to the grids generated from solving the Laplace equation. The Laplace equation is, by its very nature, a smoother, tending to average values at points with those at neighboring points. It can be shown from the calculus of variations, in fact, that grids generated from the Laplace equation are the smoothest possible. There arises, however, the need to concentrate coordinate lines in certain areas of anticipated strong solution variation, such as near solid walls in viscous flow. This can be accomplished by departing from the Laplace equation and designing a partial differential equation system for grid generation: designing because, unlike physics, there are no laws governing grid generation waiting to be discovered. The first approach to this, historically, was the obvious: simply replace the Laplace equation with Poisson equations ∇2ξ = P, ∇2η = Q and leave the control functions on the right-hand sides to be specified by the user (with appeal to Urania, the muse of science, for guidance). This does in fact work but the approach has evolved over the years, guided both by logical intuition and the calculus of variations, to use a similar set of equations but with a somewhat different right-hand side. Also, the user has been relieved of the responsibility for specifying the control functions, which are now generally evaluated automatically by the code from the boundary point distributions that are set by the user (cf. Chapter 4). These functions may also be adjusted by the code to achieve orthogonality at the boundary and/or to reduce the grid skewness or otherwise improve the grid quality (cf. Chapter 6). Algebraic grid generation, based on transfinite interpolation, is typically used to provide an initial solution to start an iterative solution of the partial differential equation for this elliptic grid generation system that provides a smoother grid, but with selective concentration of lines, and is less likely to result in overlapping of the boundary. This elliptic grid generation has an analogy to stretching a membrane attached to the boundaries (cf. Chapter 33) Grid lines inscribed on the underformed membrane move in space as the membrane is selectively stretched, but the region between the boundaries is always covered by the grid. Another form of grid generation from partial differential equations has an analogy with the waves emanating from a stone tossed into a pool This hyperbolic grid generation uses a set of hyperbolic equations, rather than the Poisson equation, to grow an orthogonal grid outward from a boundary (cf. Chapter 5). This approach is, in fact, faster than the elliptic grid generation, since no iterative solution is involved, but it is not possible to fit a specified outer boundary. Hyperbolic grid generation is thus limited in its use to open regions. As with the elliptic system, it is possible to control the spacing of the grid lines, and the orthogonality helps prevent skewness.

©1999 CRC Press LLC

The control of grid line spacing can be extended to dynamically couple the grid generation system with the physical solution to be performed on the grid in order to resolve developing gradients in the solution wherever such variations appear in the field (cf. Chapter 34 and 35). With such adaptive grids, certain solution variables, such as pressure or temperature, are made to feed back to the control functions in the grid generations system to adjust the grid before the next cycle of the physical solution algorithm on the grid.

P-2.4

Variations

Structured grids today are typically generated and applied in the block-structured form described above with the multiple-sponge analogy. A variation is the chimera (from the monster of Greek mythology, composed of disparate parts) approach in which separate grids are generated about various boundary components, e.g., bodies in the field, and these separate grids are simply overlaid on a background grid and perhaps on each other in a hierarchy (cf. Chapter 11). The physical solution process on this composite grid proceeds with values being transferred between grids by interpolation. This approach has a number of advantages: (1) simplicity in grid generation since the various grids are generated separately, (2) bodies can be added to, or taken out of, the field easily, (3) bodies can carry their grids when moving relative to the background (think of simulating the kicking of a field goal with the ball and its grid tumbling end over end), (4) the separate grids can be used selectively to concentrate points in regions of developing gradients that may be in motion. The disadvantages are the complexity of setup (but this is being attacked in new code development) and the necessity for the interpolation between grids. Another approach of interest is the hybrid combination with separate structured grids over the various boundaries, connected by unstructured grids (cf. Chapter 23). There is great incentive to use structured grids over boundaries in viscous flow simulation because the boundary layer requires very small spacing out from the wall, resulting either in very long skewed triangular cells or a prohibitively and unnecessarily large number of small cells when unstructured grids are used. This hybrid approach is less well developed but can be expected to receive more attention.

P-2.5

Transformation

The use of numerically generated nonorthogonal curvilinear grids in the numerical solution of PDEs is not, in principle, any more difficult than using Cartesian grids: the differencing and solution techniques can be the same; there are simply more terms in the equations. For instance, the first derivative fx could be represented in difference form on a Cartesian grid as

( f x )ij =

fi +1, j − fi −1, j 2∇x

or if the spacing is not uniform, though the grid is still rectangular, by

( f x )ij =

©1999 CRC Press LLC

fi +1, j − fi −1, j xi +1, j − xi −1, j

To use a curvilinear grid, this derivative is transformed so that the curvilinear coordinate (ξ,η) rather than the Cartesian coordinate x,y, are the independent coordinates. Thus

fx =

( xξ fη − xη fξ ) J

where J = xξ yη – xη yξ is the Jacobian of the transformation and represents the cell volume. This then could be written in a difference form, taking ∆ξ and ∆η to be unity without loss of generality, using

(f )

ξ ij

( fη )ij

(

)

(

)

1 i +1, j − i −1, j 2 1 = fi +1, j − fi, j −1 2

=

with analogous expressions for xξ , xη , yξ , yη. Movement of the grid, either to follow moving boundaries or to dynamically adapt to developing solution gradients, is not really a complication, since the time derivative can also be transformed as

( ft )r = ( ft )ξ − ( f x x + f y y˙ ) where the time derivative on the left is taken at a fixed position in space, i.e., is the time derivative appearing in the PDEs while the one on the right is that seen by a particular grid point moving with a speed ( x˙ , y˙ ). The spatial derivatives (fx , fy ) are transformed as was discussed above. There is no need to interpolate solution values from the grid at one time step to the displaced grid at the next time step, since that transfer is accomplished by the grid speed terms ( x˙ , y˙ ) in the above transformation relation. The straightforwardness of the use of curvilinear grids is further illustrated by the appearance of the generic convection–diffusion equations; ft + ∇ ⋅ (uf ) + ∇ ⋅ (v∇f ) + S = O where u is the velocity, v is a diffusion coefficient, and S is a source term, after transformation: 3

( i =1

)

3

3

( )

At + Σ U i + v∇ 2ξ i Aξ i + Σ Σ g ij vAξ j i =1 j =1

3

ξi

+ A Σ a i ⋅ uξ i + S = 0 i =1

where now the time derivative is understood to be that seen by a certain (moving) grid point. Here the elements of the contravariant metric tensor g ij are given by g ij = a i ⋅ a j

©1999 CRC Press LLC

where the ai are the contravariant base vectors (which are simply normals to the cell sides):

(

)

a i = a j × ak / g (i, j,k cyclic) with the ai the covariant base vectors (tangents to the coordinate lines): ai = rξ i g is the Jacobian of the transformation (the

where r is the Cartesian coordinate of a grid point, and cell volume):

g = a1 ⋅ ( a2 × a3 ) Also, the contravariant velocity (normal to the cell sides) is U i = a ⋅ (u − r ) where u is the fluid velocity and r is the velocity of the moving grid. For comparison, the Cartesian grid formulation is 3

3

( )

3

At + Σ ui Ax i + Σ Σ δ ij vAx j i =1

i =1 j =1

3

xi

+ A Σ (ui ) x + S = 0 i =1

i

The formulation has thus been complicated by the curvilinear grid only in the sense that the coefficient ui has been replaced by the coefficient U i + v(∇2ξ i ), and the Kronecker delta in the double summation has been replaced by g ij (thus expanding that summation from three terms to nine terms), and through the insertion of variable coefficients in the last summation. When it is considered that the transformed equation is to be solved on a fixed rectangular field with a uniform square grid, while the original equation would have to be solved on a field with moving curved boundaries, the advantages of using the curvilinear systems are clear. These advantages are further evidenced by consideration of boundary conditions. In general, boundary conditions for the example being treated would be of the form

αA + βn ⋅ (u∇A) = γ where n is the unit normal to the boundary and α, β, and γ are specified. These conditions transform to

αA + β

©1999 CRC Press LLC

v g ii

3

Σ gij Aξ j =1

j

=γ

for a boundary on which ξ i is constant. For comparison, the original boundary conditions can be written in the form

3

αA + βv Σ n j Ax j = γ i =1

The transformed boundary conditions thus have the same form as the original conditions, but with the coefficient nj replaced by g ij/ g ii . The important simplification is the fact that the boundary to which the transformed conditions are applied is fixed and flat (coincident with a curvilinear coordinate surface). This permits a discrete representation of the derivative Aξ j along the transformed boundary without the need for interpolation. By contrast, the derivative Ax j in the original conditions cannot be discretized along the physical boundary without interpolation since the boundary is curved and may be in motion. Although the transformed equation clearly contains more terms, the differencing is the same as on a rectangular grid, i.e., it is done on the logically rectangular computational lattice, and the solution field is logically rectangular. Note that it is not necessary to discover and implement a transformation for each new boundary shape — rather the above formulation applies for all, simply with different values of (x, y, z) at the grid points. The transformed PDE can also be expressed in conservative form as

(

3 3 g A + Σ g U i A + v Σ g ij Aξ j + gS = 0 t i = 1 i =1 ξ i

)

for use in the finite volume approach. For more information on transformations, see Chapter 2.

P-3 P-3.1

Unstructured Grids Connectivities and Data Structures

The basic difference between structured and unstructured grids lies in the form of the data structure which most appropriately describes the grid. A structured grid of quadrilaterals consists of a set of coordinates and connectivities that naturally map into elements of a matrix. Neighboring points in a mesh in the physical space are the neighboring elements in the mesh matrix (Figure 14). Thus, for example, a two-dimensional array x(i,j) can be used to store the x-coordinates of points in a 2D grid. The index i can be chosen to describe the position of points in one direction, while j describes the position of points in the other direction. Hence, in this way, the indices i and j represent the two families of curvilinear lines. These ideas naturally extend to three dimensions. For an unstructured mesh the points cannot be represented in such a manner and additional information has to be provided. For any particular point, the connection with other points must be defined explicitly in the connectivity matrix (Figure 15).

©1999 CRC Press LLC

FIGURE 14

FIGURE 15

A typical form of data format for an unstructured grid in two dimensions is Number of Points, Number of Elements x1, y1 x2, y2 x3, y3 … n1, n2, n3 n4, n5, n6 n7, n8, n9 … where (x1, y1) are the coordinates of point i, and ni, 1=1,N are the point numbers with, for example, the triad (n1, n2, n3) forming a triangle. Other forms of connectivity matrices are equally valid, for example, connections can be based upon edges. The real advantage of the unstructured mesh is, however, because the points and connectivities

©1999 CRC Press LLC

do not possess any global structure. It is possible, therefore, to add and delete nodes and elements as the geometry requires or, in a flow adaptivity scheme, as flow gradients or errors evolve. Hence the unstructured approach is ideally suited for the discretization of complicated geometrical domains and complex flowfield features. However, the lack of any global directional features in an unstructured grid makes the application of line sweep solution algorithms more difficult to apply than on structured grids.

P-3.2

Grid Generation Approaches

In contrast to the generation of structured grids, algorithms to construct unstructured grids are frequently based upon geometrical ideas. There are now many techniques available, many of which are described within this Handbook. For this elementary overview it is not appropriate to discuss details but to comment on general procedures. P-3.2.1 Triangle and Tetrahedra Creation by Delaunay Triangulation The Delaunay approach to unstructured grid generation is now popular. The basic concepts go back as far as Dirichlet, who in a paper in 1850 discussed the basic geometrical concept. Dirichlet proposed a method whereby a given domain could be systematically decomposed into a set of packed convex polygons. Given two points in the plane, P and Q, the perpendicular bisector of the line joining the two points subdivides the plane into two regions, V and W. The region V is closer to P than it is to Q. Extending these ideas, it is clear that for a given set of points in the plane, the regions Vi are territories that can be assigned to each point so that Vi represents the space closer to Pi than to any other point in the set. This geometrical construction of tiles is known as the Dirichlet tessellation. This tessellation of a closed domain results in a set of non-overlapping convex polygons, called Voronoï regions, covering the entire domain. From this description, it is apparent that in two dimensions, the territorial boundary that forms a side of a Voronoï polygon must be midway between the two points it separates and is thus a segment of the perpendicular bisector of the line joining these two points. If all point pairs that have some segment of a boundary in common are joined by straight lines, the result is a triangulation of the convex hull of the set of points Pi. This triangulation is known as the Delaunay triangulation. Equivalent constructions can be defined in higher dimensions. In three dimensions, the territorial boundary that forms a face of a Voronoï polyhedron is equidistant between the two points it separates. If all point pairs that have a common face in the Voronoï construction are connected, then a set of tetrahedra is formed that covers the convex hull of the data points. For the number of points which may be required in grid for computational analysis, it might appear that the above procedure would be difficult and computationally expensive to construct. However, there are several algorithms that can form the construction in a very efficient manner. These are discussed at length in Chapters 1, 16 and 20. The approach is very flexible in that it can automatically create grids with the minimum of user interaction for arbitrary geometries. P-3.2.2 Triangle and Tetrahedra Creation by the Advancing Front Method A grid generation technique based on the simultaneous point generation and connection is the advancing front method. Unlike the Delaunay approach, advancing front methods are not based on any geometrical criteria. They encompass the logical procedure of starting with a boundary grid of edges, in two dimensions, triangular faces, in three dimensions, and creating a point and constructing an element. Slowing the initial boundary advances into the domain until the domain is filled with elements. The placing of

©1999 CRC Press LLC

points within the domain is, like the Delaunay approach, controlled by a combination of a background mesh and sources that provides the required data to ensure adequate resolution of the domain. The algorithms that generate grids in this way are based on fast geometrical search routines. Details are to be found in Chapter 17. It is possible to combine techniques from both the Delaunay and the Advancing Front methods to produce effective grid generation procedures – a sort of combination that tries to utilize the advantages of both approaches. Chapter 18 discusses one such approach. The Delaunay triangulation produces elements that are isotropic in nature. Although the Advancing Front method can produce elements with stretching, it cannot produce high quality meshes with stretching factors applicable to some problems, such as high Reynolds number viscous flows. Hence, it is necessary to augment the standard procedures outlined above. In general, this is done by introducing a mapping that ensures that regular isotropic grids can be generated but once mapped back to the physical space are distorted in a well defined manner to give appropriate element stretching. Such a method is described in detail in Chapter 20. P-3.2.3 Unstructured Grids of Quadrilaterals and Hexahedra The preference of some developers for quadrilateral or hexahedral element based unstructured meshes has resulted in effort devoted to the generation of such meshes. In two dimensions, it is possible to modify the Advancing Front algorithm to construct quadrilaterals, although the additional complexity in extending this approach to three dimensions has not yet been overcome for practical geometries. An alternative approach that has seen some success is that of “paving.” This approach relies upon iteratively layering or paving rows of elements in the interior of a region. As rows overlap or coincide they are carefully connected together. It is fair to conclude that almost without exception the methods for the construction of unstructured hexahedral based grids are heuristic in nature, requiring considerable effort to include the many possible geometrical occurrences. Chapter 21 discusses in detail aspects of this kind of grid generation. P-3.2.4 Surface Mesh Generation The generation of unstructured grids on surfaces is, in itself, one of the most difficult and yet important aspects of mesh generation in three dimensions. The surface mesh influences the field mesh close to the boundary. Surface meshes have the same requirement for smoothness and continuity as the field meshes for which they act as boundary conditions, but in addition, they are required to conform to the geometry surfaces, including lines of intersection and must accurately resolve regions of high curvature. The approach usually taken to generate grids on surfaces is to represent the geometry in parametric coordinates. A parametric representation of a surface is straightforward to construct and provides a description of a surface in terms of two parametric coordinates. This is of particular importance, since the generation of a mesh on a surface then involves using grid generation techniques developed for two space dimensions. A full description of these procedures is given in Chapter 19.

P-3.3

Grid Adaptation Techniques

To resolve features of a solution field accurately it is, in general, necessary to introduce grid adaptivity techniques. Adaptivity is based on the equidistribution of errors principle, namely,

wi dsi = constant

©1999 CRC Press LLC

where wi is the error or activity indicator at node i and dsi is the local grid point spacing at node i. Central to adaptivity techniques and the satisfaction of this equidistribution principle is to define an appropriate indicator wi. Adaptivity criteria are based on an assessment of the error in the solution of the governing equations or are constructed to detect features of the field. These estimators are intimately connected to the analysis equations to be solved. For example, some of the main features of a solution of the Euler equations can be shock waves, stagnation points and vortices, and any indicator should accurately identify these flow characteristics. However, for the Navier-Stokes equations, it is important not only to refine the mesh in order to capture these features but, in addition, to adequately resolve viscous dominated phenomena such as the boundary layers. Hence, it seems likely that, certainly in the near future, adaptivity criteria will be a combination of measures, each dependent on some aspects of the flow and, in turn, on the flow equations. There is also an extensive choice of criteria based on error analysis. Such measures include, a comparison of computational stencils of different orders of magnitude, comparison of the same derivatives on different meshes, e.g., Richardson extrapolation, and resort to classical error estimation theory. No generally applicable theory exists for errors associated with hyperbolic equations, hence, to date combinations of rather ad hoc methods have been used. Once an adaptivity criterion has been established, the equidistribution principle is achieved through a variety of methods, including point enrichment, point derefinement, node movement and remeshing, or combinations of these. For more information on grid adaption techniques, see Chapter 35. P-3.3.1 Grid Refinement Grid refinement, or h-refinement, involves the addition of points into regions where adaptation is required. Such a procedure clearly provides additional resolution at the expense of increasing the number of points in the computation. Grid refinement on unstructured grids is readily implemented. The addition of a point or points involves a local reconnection of the elements, and the resulting grid has the same form as the initial grid. Hence, the same solver can be used on the enriched grid as was used on the initial grid. It is important that the adaptivity criteria resolve both the discontinuous features of the solution (i.e. shock waves, contacts) and the smooth features as the number of grid points are increased. A desirable feature of any adaptive method to ensure convergence is that the local cell size goes to zero in the limit of an infinite number of mesh points. Grid refinement on a structured or multiblock grids is not so straightforward. The addition of points will, in general, break the regular array of points. The resulting distributed grid points no longer naturally fit into the elements of an array. Furthermore, some points will not “conform” to the grid in that they have a different number of connections to other points. Hence grid refinement on structured grids requires a modification to the basic data structure and also the existence of so-called non-conforming nodes requires modifications to the solver. Clearly, point enrichment on structured grids is not as natural a process as the method applied on unstructured grids and hence is not so widely employed. Work has been undertaken to implement point enrichment on structured grids and the results demonstrate the benefits to be gained from the additional effort in modifications to the data structure and the solve. P-3.3.2 Grid Movement Grid movement satisfies the equidistribution principle through the migration of points from regions of low activity into regions of high activity. The number of nodes in this case remains fixed. Traditionally, algorithms to move points involve some optimization principle. Typically, expressions for smoothness,

©1999 CRC Press LLC

orthogonality and weighting according to the analysis field or errors are constructed and then an optimization is performed such that movement can be driven by a weight function, but not at the expense of loss of smoothness and orthogonality. Such methods are in general, applicable to both structured and unstructured grids. An alternative approach is to use a weighted Laplacian function. Such a formulation is often used to smooth grids, and of course the formal version of the formulation is used as the elliptic grid generator presented earlier. P-3.3.3 Combinations of Node Movement, Point Enrichment and Derefinement An optimum approach to adaptation is to combine node movement and point enrichment with derefinement. These procedures should be implemented in a dynamic way, i.e., applied at regular intervals within the simulation. Such an approach also provides the possibility of using movement and enrichment to independently capture different features of the analysis. P-3.3.4 Grid Remeshing One method of adaptation which, to date, has been primarily used on unstructured grids, is adaptive remeshing. As already indicated, unstructured meshes can be generated using the concept of a background mesh. For an initial mesh, this is usually some very coarse triangulation that covers the domain and on which the spatial distribution is consistent with the given geometry. For adaptive remeshing, the solution achieved on an initial mesh is used to define the local point spacing on the background mesh which was itself the initial mesh used for the simulation. The mesh is regenerated using the new point spacing on the background mesh. Such an approach can result in a second adapted mesh that contains fewer points than that contained in the initial mesh. However, there is the overhead of regeneration of the mesh which in three dimensions can be considerable. Nevertheless, impressive demonstrations of its use have been published.

©1999 CRC Press LLC

Contents Foreword Contributors Acknowledgments Preface: An Elementary Introduction Joe F. Thompson, Bharat K. Soni, and Nigel P. Weatherill

1

Fundamental Concepts and Approaches

Joe F. Thompson and

Nigel P. Weatherill

PART I

Block-Structured Grids

Introduction to Structured Grids Joe F. Thompson

2

Mathematics of Space and Surface Grid Generation

Zahir U.A. Warsi

3

Transfinite Interpolation (TFI) Generation Systems

Robert E. Smith

4

Elliptic Generation Systems

5

Hyperbolic Methods for Surface and Field Grid Generation

Stefan P. Spekreijse

William M. Chan

6

Boundary Orthogonality in Elliptic Grid Generation Ahmed Khamayseh, Andrew Kuprat, and C. Wayne Mastin

7

Orthogonal Generation Systems

8

Harmonic Mappings

9

Surface Grid Generation Systems

10

Luís Eça

Sergey A. Ivanenko Ahmed Khamayseh and Andrew Kuprat

A New Approach to Automated Multiblock Decomposition for Grid Generation: A Hypercube++ Approach Sangkun Park and Kunwoo Lee

©1999 CRC Press LLC

11 12

Composite Overset Structured Grids

Robert L. Meakin

Parallel Multiblock Structured Grids

Jochem Häuser, Peter R. Eiseman,

Yang Xia, and Zheming Cheng

13

Block-Structured Applications

PART II

Timothy Gatzke

Unstructured Grids

Introduction to Unstructured Grids Nigel P. Weatherill

14

Data Structures for Unstructured Mesh Generation

15

Automatic Grid Generation Using Spatially Based Trees

Luca Formaggia

Mark S. Shephard, Hugues L. de Cougny, Robert M. O’Bara, and Mark W. Beall

16

Delaunay–Voronoï Methods

17

Advancing Front Grid Generation

18

Unstructured Grid Generation Using Automatic Point Insertion and Local Reconnection David L. Marcum

19

Surface Grid Generation

20

Nonisotropic Grids

21

Quadrilateral and Hexahedral Element Meshes

22

Timothy J. Baker J. Peraire, J. Peiró, and K. Morgan

J. Peiró

Paul Louis George and Frédéric Hecht

Adaptive Cartesian Mesh Generation

Robert Schneiders

Michael J. Aftosmis, Marsha J. Berger,

and John E. Melton

23

Hybrid Grids

24

Parallel Unstructured Grid Generation

Jonathon A. Shaw Hugues L. de Cougny and

Mark S. Shephard

25

Hybrid Grids and Their Applications

26

Unstructured Grids: Procedures and Applications

©1999 CRC Press LLC

Yannis Kallinderis Nigel P. Weatherill

PART III

Surface Definition

Introduction to Surface Definition

Bharat K. Soni

27

Spline Geometry: A Numerical Analysis View

28

Computer-Aided Geometric Design

29

Computer-Aided Geometric Design Techniques for Surface Grid Generation Bernd Hamann, Brian Jean, and Anshuman Razdan

30

NURBS in Structured Grid Generation

31

NASA IGES And NASA-IGES NURBS Only Standard

David R. Ferguson

Gerald Farin

Tzu-Yi Yu and Bharat K. Soni Austin L. Evans

and David P. Miller

PART IV

Adaptation and Quality

Introduction to Adaptation and Quality

Bharat K. Soni

32

Truncation Error on Structured Grids

33

Grid Optimization Methods for Quality Improvement and Adaptation Olivier-Pierre Jacquotte

34

Dynamic Grid Adaptation and Grid Quality

C. Wayne Mastin

D. Scott McRae and

Kelly R. Laflin

35

Grid Control and Adaptation

36

Variational Methods of Construction of Optimal Grids

O. Hassan and E. J. Probert

A. F. Sidorov, and O. V. Ushakova

37

Moving Grid Techniques

Paul A. Zegeling

Appendix A: Grid Software and Configurations Appendix B: Grid Configurations

©1999 CRC Press LLC

Bharat K. Soni

Bharat K. Soni

O. B. Khairullina,

I Block-Structured Grids Joe F. Thompson

Introduction to Structured Grids The grid generation process, in general, proceeds from first defining the boundary geometry as discussed in Part III. Then points are distributed on the curves that form the edges of boundary sections. A surface grid is then generated on the boundary surface, and finally a volume grid is generated in the field. Chapter 13 gives a general overview of the entire grid generation process and the fundamental choices and considerations involved from the standpoint of the user. The underlying essential mathematics of structured grid generation, including essential concepts from differential geometry and tensor analysis, is collected in Chapter 2. The mathematical constructs explained in this chapter are utilized throughout the chapters of this handbook. The distribution of points on boundary curves (edges of boundary surfaces) is commonly done through several distribution functions as described in Section 3.6 of Chapter 3. (The mathematics of curves is covered in Section 2.3 of Chapter 2.) These functions have been adopted over time as providing point distributions that comply with certain constraints that must be applied in order to control error that can be introduced into the solution by the grid if the spacing changes too rapidly, as discussed in Chapter 32 of Part IV. Structured grids can be generated algebraically or as the solution of PDEs. Algebraic grid generation is simply some form of interpolation from boundary points — the variants just use different kinds of interpolation. The most fundamental and versatile form — and now commonly incorporated in grid generation codes — is TFI (transfinite interpolation), which is introduced in Section 1.3.5 of Chapter 1 and described in Chapter 3. The basic equations of TFI are given in Section 3.4 of Chapter 3, and the specific equations for application with and without orthogonality at the boundaries are given in Section 3.5. Algebraic grid generation based on TFI is the fastest procedure for structured grids, and is also commonly used to generate an initial grid in generation systems based on PDEs. Grids generated algebraically can, however, have some problems with smoothness and may overlap strongly convex portions of boundaries.

©1999 CRC Press LLC

Generation systems based on PDEs can produce smoother grids with fewer problems with boundary overlap. Such generation systems are therefore often used to smooth algebraic grids. Since grid generation is essentially a boundary-value problem, grids can be generated from point distributions on boundaries by solving elliptic PDEs in the field. The smoothness properties and extremum principles inherent in some such PDE systems can serve to produce smooth grids without boundary overlap. The PDE solution is generally one by iteration, and therefore elliptic grid generation is not as fast as algebraic grid generation. The elliptic PDEs for grid generation are not unique, of course, but must be designed. This design has converged over the years to the elliptic system given in Section 1.3.3 of Chapter 1, which forms the basis for most grid generation codes today. This formulation incorporates control functions that are determined from the boundary point distribution to control the grid line spacing and orientation in the field to be compatible with that on the boundary. Procedures for the determination of these control functions in grid codes have evolved in time to the forms noted in this section of Chapter 1, which can accomplish boundary orthogonality through iterative adjustment during the generation process. A more recent and general formulation, with a sounder basis for evaluation of the control functions, is given here in Chapter 4: for 2D in Section 4.2 and for 3D in Section 4.4. This iterative solution of the elliptic system is often done by SOR, but a Picard iteration is given in Section 4.2.2 of Chapter 4, and a conjugate gradient solution is given in Section 12.10.4 of Chapter 13, in connection with parallel implementation. The generation of a grid on a boundary surface is a necessary prelude to the generation of a volume grid, and this is generally done by representing the boundary surface parametrically by NURBS or another spline formulation, and then generating the grid in parameter space either algebraically or using PDEs. This is perfectly analogous to 2D grid generation except that surface curvature terms appear in the PDEs. With the generation system operating in parameter space, the resulting grid is guaranteed to lie on the boundary surface. The parametric representation of the boundary surface is covered in Chapter 29, utilizing the underlying curve and surface constructs given in Chapter 28. Other aspects of surface generation are covered in the other chapters in Part III, and the mathematical foundations are given in Section 2.4 and in Section 2.5.2 of Chapter 2. Algebraic surface grid generation is simply the application of TFI to generate values of the surface parameters on the surface from the values set on the edges of the boundary surface by the grid point distribution on those edges, as covered in Section 9.2 of Chapter 9. Elliptic surface grid generation operates with the PDEs formulated in terms of the surface parameters, and surface curvature terms appearing in the PDEs (see Section 2.5.2 of Chapter 2). A commonly applied procedure is given in Section 9.3 of Chapter 9, and a more recent and general procedure is given in Section 4.3 of Chapter 4. Hyperbolic surface grid generation is covered in Section 5.3 of Chapter 5. It is generally advantageous, in view of such things as boundary layer phenomena and turbulence models, to have the grid orthogonal to boundaries even though orthogonality is not imposed in the field. This is commonly done through iterative adjustment of the control functions as described in Chapter 6: in Section 6.2 for 2D grids, Section 6.3 for surface grids, and Section 6.4 for volume grids. Another procedure in 2D, also using the control functions, is given in Section 4.2 of Chapter 4. An alternative approach to grid generation via PDEs is to use a hyperbolic generation system rather than an elliptic. Elliptic equations admit boundary conditions, i.e., grid point distributions, on all boundaries of a region. Hyperbolic systems, however, can take boundary conditions only on a portion of the boundary. Therefore, while elliptic grid generation systems can produce a grid in the entire volume from point distributions of the entire boundary, hyperbolic systems generate the grid by marching outward from a portion of the boundary. Hyperbolic grid generation systems therefore cannot be used to generate a grid in the entirety of a volume defined by a complete boundary. Chapter 5 covers hyperbolic grid generation in volumes in Section 6.2 and on surfaces in Section 6.3. Structured grids are not generally made orthogonal, although orthogonality at boundaries is often incorporated, as has been noted above. In fact, 3D orthogonality is not, in general, possible without imposing certain conditions on the grids on the boundary surfaces. And even in 2D, orthogonality imposes severe restrictions on the grid distribution. Transformed PDEs, however, take a much simpler

©1999 CRC Press LLC

form on orthogonal grids, providing some incentive for their use when feasible — with relatively simple boundary configurations and physical problems without strong localized gradients. Chapter 7 covers orthogonal grid generation systems. As has been noted, PDEs for grid generation are designed, not discovered. Considerable research has gone into this topic, leading to generally standard elliptic (Chapter 4) and hyperbolic (Chapter 5) grid generation systems. The underlying theory of harmonic mappings provides a framework for the development of elliptic grid generation systems, and this topic is treated in some depth in Chapter 9. This theoretical base also leads to the formulation of adaptive grid systems, also covered in this chapter. Adaptive grids are most fundamentally formulated from variational principles, and this is covered in Chapter 36 of Part IV. Adaptive grids and grid quality are covered in the chapters of Part IV. A strong and versatile alternative to block-structured grids is the overset grid approach (originally called chimera, after the composite monster of Greek mythology). With this approach, individual structured grids are generated around separate boundary components, e.g., bodies, and these separate grids simply overlap each other in some hierarchy. Data is transferred between overlapping grids by interpolation. The overset grid approach is covered here in Chapter 11. The grid generation involved is typically done by hyperbolic generation systems, described in Chapter 5. The mathematics and technology of structured grid generation have matured now so that the techniques covered in Part I can be expected to be of enduring utility. The block structure is versatile, and serves as the foundation for efficient solutions because of its inherently simple data structure. Construction of the block configuration by hand, even with graphically interactive tools, is very labor intensive, however, as noted in Chapter 13. Automation of the block structure, rather than graphical interaction, is the goal, and this is an area of active research and development (Section 21.2 of Chapter 21 is relevant here). A very promising recent approach is included in Chapter 11. Finally, operation on parallel processors is essential now, and the block structure provides a natural means of domain decomposition, as covered in Sections 12.8–12.10 of Chapter 12. The operation of the block structure is discussed in Sections 12.2–12.6 of Chapter 12. Chapter 12 also covers a script-based meta-language approach to structured grid generation in Section 12.7. Although most available grid generation systems have departed from the script-based approach in favor of graphical interaction, the script-based approach has definite advantages in design cycles.

©1999 CRC Press LLC

1 Fundamental Concepts and Approaches 1.1 1.2 1.3

Introduction Mesh Generation Considerations Structured Grids Composite Grids • Block-Structured Grids • Elliptic Systems • Hyperbolic System • Algebraic System • Adaptive Grid Schemes

1.4

Joe F. Thompson Nigel P. Weatherill

Unstructured Grids The Delaunay Triangulation • Point Creation • Other Unstructured Grid Techniques • Unstructured Grid Generation on Surfaces • Adaptation on Unstructured Grids • Summary

1.1 Introduction This introductory chapter uses fluid mechanics as an example field problem for reference; the applicability of the concepts discussed is, however, not in any way limited to this area. Fluid mechanics is described by nonlinear equations, which cannot generally be solved analytically, but which have been solved using various approximate methods including expansion and perturbation methods, sundry particle and vortex tracing methods, collocation and integral methods, and finite difference, finite volume, and finite element methods. Generally the finite difference, finite volume, and finite element discretization methods have been the most successful, but to use them it is necessary to discretize the field using a grid (mesh). (The terms grid and mesh are used interchangeably throughout with identical meaning.) The mesh can be structured or unstructured, but it must be generated under some of the various constraints described below, which can often be difficult to satisfy completely. In fact, at present it can take orders of magnitude more person-hours to construct the grid than it does to construct and analyze the physical solution on the grid. This is especially true now that solution codes of wide applicability are becoming available. Computational fluid dynamics (CFD) is a prime example, and grid generation has been cited repeatedly as a major pacing item (cf. Thompson [1996]). The same is true for other areas of computational field simulation. The proceedings of the several international conferences on grid generation (Thompson [1982], Hauser and Taylor [1986], Sengupta, et al. [1988], Arcilla, et al. [1991], Eiseman, et al. [1994], Soni et al. [1996]) as well as those of the NASA conferences (Smith [1980], Smith [1992], Choo [1995]) provide numerous illustrations of application to CFD and some other fields. A recent comprehensive text is Carey [1997].

©1999 CRC Press LLC

1.2 Mesh Generation Considerations The generated mesh must be sufficiently dense that the numerical approximation is an accurate one, but it cannot be so dense that the solution is impractical to obtain. Generally, the grid spacing should be smoothly and sufficiently refined to resolve changes in the gradients of the solution. If the grid is also boundary-conforming and curvilinear, the application of boundary conditions is simplified. Boundaryconforming curvilinear grids may also allow the use of various approximate equations such as boundarylayer equations. The grid should also be constructed with computational efficiency in mind. The accuracy of a numerical approximation can also be impaired, if a grid changes discontinuously or is too skewed. Various computers often require well-organized data, and memory requirements can grow to impractical limits unless the data is organized well. Finally, the choice of a grid should not lead to overly complex computer codes. A mesh is a set of points distributed over a calculation field for a numerical solution of a set of partial differential equations (PDEs). This set may be structured, e.g., formed by the intersections of curvilinear coordinate surfaces, or unstructured, i.e., with no relation to coordinate directions. In the first case the points form quadrilateral cells in 2D, or hexahedral cells in 3D (with nonplanar sides). The unstructured mesh generally consists of triangles and tetrahedra in 2D and 3D, respectively, in its most basic form, but may be made of hexahedra or elements of any shape in general. The structured grid can be generated algebraically by interpolation from boundaries, e.g., transfinite interpolation, or by solving a set of partial differential equations in the region. An entire subject, complete with textbook (Thompson, Warsi, and Mastin [1985], now on the Web at www.erc.msstate.edu), has developed around the generation of structured grids having the fundamental characteristic that some curvilinear coordinate surface is coincident with each boundary segment, i.e., boundary conforming. A later text is Knupp and Steinberg [1993]. Castillo [1991] provides a compilation of mathematical aspects as well. Structured grid generation is also covered in the recent text of Carey [1997]. Several earlier surveys of the field are still useful for basic understanding (Thompson, Warsi, and Mastin [1982], Thompson [1984], Thompson [1985], Eiseman [1985]). Structured boundary-conforming meshes have been widely applied in computational fluid dynamics. Basically, the algebraic generation systems (Chapter 3) are faster, but the grids generated from partial differential equations are generally smoother. The hyperbolic generation systems (Chapter 5) are faster than the elliptic systems, but are more limited in the geometries that can be treated. The elliptic systems (Chapter 4) are the most generally applicable with complicated boundary configurations, but transfinite interpolation is also effective in a composite grid framework. The generation of unstructured meshes can be done by tessellation of a point distribution that could be random but is more likely to have been produced by some ordered procedure. This tessellation is not unique, and involves some type of nearest-neighbor search, such as the Delaunay triangulation (Chapter 16). Other approaches are the advancing front procedure (Chapter 17) and the finite octree method (Chapter 15). The recent text of Carey [1997] covers unstructured grid generation as well as structured grid generation. An earlier text on unstructured grids is George [1991]. General configurations can conceivably be treated with either type of mesh, and hybrid combinations (Chapter 23) are also possible, using individual structured meshes near boundaries, with these subregions being connected by an unstructured mesh. Still another approach is overlaid grids (chimera) (Chapter 11), in which separate boundary-conforming structured grids are generated for each component of a complex configuration, and data is communicated between the various component grids by interpolation. Of particular importance is the development of dynamically adaptive meshes (Chapters 33–36) coupled with the physical solution. In this mode the mesh is locally refined by the selective addition of points, and/or is moved to concentrate points, in order to resolve developing gradients in the physical solution on the mesh. Both of these approaches have seen considerable development and show much promise in particular areas. Implementation of solution algorithms on structured, unstructured, and overlaid grids places differing requirements on the algorithms. Various conflicts arise between the grid and solution procedures in

©1999 CRC Press LLC

regard to requirements and ease of operation. In particular, unstructured grids require a much more complex solution data structure, but are more easily generated and adapted. Structured grids provide a more natural representation of normal derivative boundary conditions and allow more straightforward approximations based on prevailing directions, e.g., parallel or normal to a boundary or flow direction. The structure also leads to a much simpler data set construction, and allows the use of directional time splitting and flux representations. On the other hand, unstructured grids can be much more readily imagined for complicated boundary configurations.

1.3 Structured Grids 1.3.1 Composite Grids Structured grid generation had its roots in the U.S. in the work of Winslow and Crowley at Lawrence Livermore National Lab in the late 1960s (Winslow [1967]), and in Russia from Godunov and Prokopov [1967] at about the same time. (There is also that enigmatic Biblical reference to the “four corners of the earth,” once thought to proclaim a flat earth but now seen to be a prophesy of structured grid generation.) Another very fundamental component was the work of Bill Gordon at Drexel on transfinite interpolation for the automotive industry, introduced to the emerging grid generation community at the grid conference in Nashville in 1982 (Gordon and Thiel [1982]). 1.3.1.1 Terminology The use of composite grids has been the key to the treatment of general 3D configurations with structured grids. Here in general, composite refers to the fact that the physical region is divided into subregions, within each of which a structured grid is generated. These subgrids may be patched together at common interfaces, may be overlaid, or may be connected by an unstructured grid. Considerable confusion has arisen in regard to terminology for composite grids, making it difficult to immediately classify papers on the subject. Composite grids in which the subgrids share common interfaces are referred to as block, patched, embedded, or zonal grids in the literature. The use of the first two of these terms is fairly consistent with this type of grid (patched comes from the common interfaces, block from the logically rectangular structure), but the last two are sometimes also applied to overlaid grids. Overlaid (overset) grids are often called chimera grids after the composite monster of Greek mythology. Unfortunately, the common interface grids can also be said to overlap, since they typically use surrounding layers of points to achieve continuity. Embedded grids can be almost anything, and the term is probably best avoided. The use of zonal comes mostly from CFD applications where the suggestion of applying different solution equations sets in different flow regions is made. Perhaps block or patched would be best for the common interface grids, chimera for the overlaid (avoiding overlaid) grids, and hybrid for the structured–unstructured combinations. 1.3.1.2 Forms With this terminology adopted, the block (or patched) grids may be completely continuous at the interfaces, have slope or line continuity, or be discontinuous (sharing a common interface but not common points thereon). (Block seems to cover all of these possibilities, but patched is being stretched a bit in the latter case.) Complete continuity is achieved through a surrounding layer of (image, phantom) points at which values are kept equal to those at corresponding object points inside an adjacent block. This requires a data indexing procedure to link the blocks across the interfaces. With complete continuity, the interface is not fixed (not even in shape), but is determined in the course of the solution. This type of interface necessitates an elliptic generation system. Slope continuity requires that the grid generation procedure incorporate some control over the intersection angle at boundaries (usually, but not necessarily, orthogonality), as can be done through Hermite interpolation in algebraic generation systems or through iterative adjustment of the control functions in elliptic systems. In this case the points on the interface are fixed, and the subgrids are generated independently, except for the use of the common interface

©1999 CRC Press LLC

points and a common (presumably orthogonal) angle of intersection with the interface. The PDE coding construction is greatly simplified with either complete or slope continuity, since then no algorithm modifications are necessary at the interfaces. The chimera (overlaid) grids are composed of completely independent component grids that overlap a background grid, other component grids and/or other component boundary elements, creating holes in the component grids. This requires flagging procedures to locate grid points that lie out of the field of computation, but such holes can be handled even in tridiagonal solvers by placing ones at the corresponding positions on the matrix diagonal and all zeros off the diagonal. These overlaid grids also require interpolation to transfer data between grids, and that subject is the principal focus of effort in regard to the use of this type of composite grid. The hybrid structured–unstructured grids avoid this interpolation by replacing the overlaid region with an unstructured grid connecting logically rectangular structured component grids. This can require modification of solution codes, however.

1.3.2 Block-Structured Grids Block-structured grids opened the door to real-world CFD in the late 1980s, and many real applications are still based on these grids (see Chapters 12 and 13). The idea appears in the proceedings of the grid conference in Nashville in 1982 (Rubbert and Lee [1982]), but it was Weatherill and Forsey [1984], and Miki and Takagi [1984] that attracted attention to the block-structured approach. Today’s structured grid codes are based on this approach. Although the grid is logically rectangular within each block, the blocks fit together in an unstructured manner. Block-structured generation systems that maintain complete continuity across block interfaces allow difference representations to be applied on the block interfaces as in the rest of the field. Complete continuity across block interfaces in the field is accomplished by treating the interface in the manner of a branch cut, with correspondence between “phantom” points outside one block with “real” points inside the adjacent block. The curvilinear grid system can be constructed simply by setting values in a rectangular array of position vectors, rijk (i = 1, 2,..., I j = 1, 2,..., J k = 1, 2,..., K ) and identifying the indices i, j, k with the three curvilinear coordinates. The position vector r is a threevector giving the values of the x, y, and z Cartesian coordinates of a grid point. Since all increments in the curvilinear coordinates cancel out of the transformation relations for derivative operators, there is no loss of generality in defining the discretization to be on integer values of these coordinates. Fundamental to this curvilinear coordinate system is the coincidence of some coordinate surface with each segment of the boundary of the physical region, in the same manner that surfaces of constant radius coincide with the inner and outer boundary segments of the region between two concentric spheres filled with a polar coordinate system. This is accomplished by placing a two-dimensional array of points on a physical boundary segment and entering these values into the array rijk of position vectors, with one index constant, e.g., in , rijk with i from 1 to I and j from 1 to J. The curvilinear coordinate k is thus constant on this physical boundary segment. With values set on the sides of the rectangular array of position vectors in this manner, the generation of the grid is accomplished by determining the values in its interior, e.g., by interpolation or a PDE solution. The set of values rijk then forms the nodes of a curvilinear coordinate system filling the physical region. A physical region bounded by six generally curved sides can thus be considered to have been transformed to a logically rectangular computational region on which the curvilinear coordinates are the independent variables. Although in principle it is possible to establish a correspondence between any physical region and a single empty logically rectangular block for general three-dimensional configurations, the resulting grid is likely to be much too skewed and irregular to be usable when the boundary geometry is complicated. A better approach with complicated physical boundaries is to segment the physical region into contiguous

©1999 CRC Press LLC

subregions, each bounded by six curved sides (four in 2D) — each of which transforms to a logically rectangular block in the computational region. Each subregion has its own curvilinear coordinate system irrespective of that in the adjacent subregions (see Figure 13.5). This then allows both the grid generation and numerical solutions on the grid to be constructed to operate in a logically rectangular computational region, regardless of the shape or complexity of the full physical region. The full region is treated by performing the solution operations in all of the logically rectangular computational blocks. With the block-structured framework, partial differential equation solution procedures written to operate on logically rectangular regions can be incorporated into a code for general configurations in a straightforward manner, since the code only needs to treat a rectangular block. The entire physical field then can be treated in a loop over all the blocks. Transformation relations for partial differential equations are covered in Chapter 2 and in Thompson, Warsi, and Mastin [1985], on the Web. Discretization error related to the grid is covered in Chapter 32. The evaluation and control of grid quality (Chapter 33) is an ongoing area of active research. The generally curved surfaces bounding the subregions in the physical region form internal interfaces across which information must be transferred, i.e., from the sides of one logically rectangular computational block being paired with another on the same, or different, block, since both correspond to the same physical surface. Grid lines at the interfaces may meet with complete continuity, with or without slope continuity, or may not meet at all. Complete continuity of grid lines across the interface requires that the interface be treated as a branch cut on which the generation system is solved just as it is in the interior of blocks. The interface locations are then not fixed, but are determined by the grid generation system. This is most easily handled in coding by providing an extra layer of points surrounding each block. Here the grid points on an interface of one block are coincident in physical space with those on another interface of the same or another block, and also the grid points on the surrounding layer outside the first interface are coincident with those just inside the other interface, and vice versa. This coincidence can be maintained during the course of an iterative solution of an elliptic generation system by setting the values on the surrounding layers equal to those at the corresponding interior points after each iteration. All the blocks are thus iterated to convergence together, so that the entire composite grid is generated at once. The same procedure is followed by PDE solution codes on the block-structured grid. The construction of codes for complicated regions is greatly simplified by the block structure since, with the use of the surrounding layer of points on each block, a PDE code is only required basically to operate on a logically rectangular computational region. The necessary correspondence of points on the surrounding layers (image points) with interior points (object points) is set up by the grid code and made available to the PDE code.

1.3.3 Elliptic Systems Elliptic grid generation is treated in detail in Chapter 4. This section provides an overview of the technology as applied in the EAGLE system (Thompson [1987]), as an example of the technology applied in several current grid generation codes. 1.3.3.1 Generation System An elliptic grid generation system used in many codes is 3

3

3

Σ Σ g mn rξ mξ n + nΣ=1 g nn Pn rξ n = 0 m =1 n =1 where the gmn are the elements of the contravariant metric tensor, g mn = ∇ξ m ⋅ ∇ξ n

©1999 CRC Press LLC

(1.1)

These elements are more conveniently expressed for computation in terms of the elements of the covariant metric tensor, gmn, gmn = rξ m ⋅ rξ n which can be calculated directly. Thus

(

g mn = gik g jl − gil g jk

)/ g

( m, i, j ) cyclic, (n, k, l) cyclic where g, the square of the Jacobian, is given by

(

g = det gmn = rξ 1 ⋅ rξ 2 × rξ 2

)

In these relations, r is the Cartesian position vector of a grid point (r = ix + jy + kz) and the ξ i (i = 1,2,3) are the three curvilinear coordinates. The Pn (n = 1,2,3) are the control functions that serve to control the spacing and orientation of the grid lines in the field. The first and second coordinate derivatives are normally calculated using second-order central differences. One-sided differences dependent on the sign of the control function Pn (backward for Pn < 0 and forward for Pn > 0) are useful to enhance convergence with very strong control functions. The control functions are evaluated either directly from the initial algebraic grid and then smoothed, or by interpolation from the boundary-point distributions. 1.3.3.2 Control Functions The now-standard procedure in block-structured systems is to first generate surface grids on block faces — both boundary and in-field block interfaces — from point distributions placed on the face edges by distribution functions. Then volume grids are generated within the blocks. In both this surface and volume grid generation, the first step is normally TFI, to be followed by elliptic generation with control functions interpolated into the field in accordance with boundary point distribution and surface curvature. The three components of the elliptic grid generation system, Eq. 1.1, provide a set of three equations that can be solved simultaneously at each point for the three control functions, Pn (n = 1,2,3), with the derivatives here represented by central differences. This produces control functions that will reproduce the algebraic grid from the elliptic system in a single iteration, of course. Thus, evaluation of the control functions in this manner would be of trivial interest except that these control functions can be smoothed before being used in the elliptic generation system. This smoothing is done by replacing the control function at each point with the average of the four neighbors in the two curvilinear directions (one in 2D) other than that of the function. Thus Pi is smoothed in the ξ j and ξ k directions, where i, j, k are cyclic. No smoothing is done in the direction of the function because to do so would smooth the spacing distribution. An algebraic grid is generated by transfinite interpolation (Chapter 3) from the boundary point distribution, to serve as the starting solution for the iterative solution of the elliptic system. With the boundary point distribution set from the hyperbolic sine or tangent functions, which have been shown to give reduced truncation error (Chapters 3 and 32), this algebraic grid has a good spacing distribution but may have slope breaks propagated from corners into the field. The use of smoothed control functions evaluated from the algebraic grid produces a smooth grid that retains essentially the spacing of the algebraic grid. The elliptic generation system can be solved by point SOR iteration using a field of locally optimum acceleration parameters. These optimum parameters make the solution robust and capable of convergence with strong control functions.

©1999 CRC Press LLC

Control functions can also be evaluated on the boundaries using the specified boundary point distribution in the generation system, with certain necessary assumptions (orthogonality at the boundary) to eliminate some terms, and then can be interpolated from the boundaries in this manner. More general regions can, however, be treated by interpolating elements of the control functions separately. Thus control functions on a line on which ξ n varies can be expressed as Pn = An = +

Sn ρn

(1.2)

where An is the logarithmic derivative of the arc length, Sn is the arc length spacing, and Ρn the radius of curvature of the surface on which ξ n is constant. The arc length spacing, Sn, and the arc length contribution, An, to the control function can be interpolated into the interior of the block from the four sides on which they are known by twodimensional interpolation. The radius of curvature, ρn, however is interpolated one-dimensionally between the two surfaces on which it is evaluated. The control function is finally formed by adding the arc length spacing divided by the radius of curvature to the arc length contribution according to Eq. 1.2. This procedure allows very general regions with widely varying boundary curvature to be treated. A more general construction of the control functions is given in Chapter 4. 1.3.3.3 Boundary Orthogonality The standard approach used to achieve orthogonality and specified off-boundary spacing on boundaries has been the iterative adjustment of control functions in elliptic generation systems, first introduced by Sorenson in the GRAPE code in the 1980s (Sorenson [1989]). Various modifications of this basic concept have been introduced in several codes, and the general approach is now common (see Chapter 6). A second-order elliptic generation system allows either the point locations on the boundary or the coordinate line slope at the boundary to be specified, but not both. It is possible, however, to iteratively adjust the control functions in the generation system until not only a specified line slope but also the spacing of the first coordinate surface off the boundary is achieved, with the point locations on the boundary specified. These relations can be applied on each successive coordinate surface off the boundary, with the off-surface spacing determined by a hyperbolic sine distribution from the spacing specified at the boundary. The control function increments are attenuated away from the boundary, and contributions are accumulated from all orthogonal boundary sections. Since the iterative adjustment of the control functions is a feedback loop, it is necessary to limit the acceleration parameters for stability. This allows the basic control function structure evaluated from the algebraic grid, or from the boundary-point distributions, to be retained, and thus relieves the iterative process from the need to establish this basic form of the control functions. The extent of the orthogonality into the field can also be controlled. This orthogonality feature is also applicable on specified grid surfaces within the field, allowing grid surfaces in the field to be kept fixed while retaining continuity of slope of the grid lines crossing the surface. This is quite useful in controlling the skewness of grid lines in some troublesome areas. Alternatively, boundary orthogonality can be achieved through Neumann boundary conditions, which allow the boundary points to move over a surface spline. The boundary point locations by Newton iteration on the spline to be at the foot of normals to the adjacent field points. This is done as follows: The Neumann point on the section currently closest to the field point R is first located. This is done by sweeping the section in ever expanding squares centered on the Neumann point. (These squares are actually limited by the section edges, of course, and hence, may become rectangles.) Next the quadrant about this closest point above which the field point lies is determined by comparing the dot products of the distance vector (from the closest point to the field point) with the tangent vectors (rξ , rη ) to the two grid lines on the section. The quadrant is identified by the signs of these two dot products. The Neumann boundary point in question, r, is then moved to the foot of the normal from the adjacent field point to the surface. This position is found as the solution of the nonlinear system

©1999 CRC Press LLC

rξ ⋅ (R − r) = 0, rη ⋅ (R − r) = 0

(1.3)

by Newton iteration. The location of the closest current boundary point and the examination of dot products described above has determined the surface cell, i.e., the quadrant, on which this solution lies so that the iteration can be confined to a single cell. Provision can also be made for extrapolated zero-curvature boundary conditions and for mirrorimage reflective boundary conditions on symmetry planes. 1.3.3.4 Surface Grids In the case of a curved surface, the surface is splined and the surface grid is generated in terms of surface parametric coordinates. The generation of a grid on a general surface (Chapter 9) is a two-dimensional grid problem in its own right, which can also be done either by interpolation or a PDE solution. In general, this is a 2D boundary value problem on a curved surface, i.e., the determination of the locations of points on the surface from specified distributions of points on the four edges of the surface. This is best approached through the use of surface parametric coordinates, whereby the surface is first defined by a 2D array of points, rmn’ e.g., a set of cross sections. The surface is then splined, and the spline coordinates (u,v; surface parametric coordinates) are then made the dependent variables for the interpolation or PDE generation system. The generation of the surface grid can then be accomplished by first specifying the boundary points in the array rij on the four edges of the surface grid; converting these Cartesian coordinate values to spline coordinate values (uij, vij) on the edges; then determining the interior values in the arrays uij and vij from the edge values by interpolation or PDE solution; and finally converting these spline values to Cartesian coordinates rij (see Figure 9.1).

1.3.4 Hyperbolic System Elliptic generation systems operate throughout the entirety of a region, while hyperbolic systems move outward from boundaries. An alternate approach to boundary orthogonality and spacing is to incorporate a hyperbolic generation system near the boundary, transitioning to an elliptic system in the far field. It is also possible to base a grid generation system on hyperbolic partial differential equations, rather than elliptic equations (Chapter 5). In this case the grid is generated by numerically solving a hyperbolic system, marching in the direction of one curvilinear coordinate between two boundary curves in two dimensions, or between two boundary surfaces in three dimensions. The hyperbolic system, however, allows only one boundary to be specified, and is therefore of interest only for use in calculation on physically unbounded regions where the precise location of a computational outer boundary is not important. The hyperbolic grid generation system has the advantage of being generally faster than elliptic generation systems but, as just noted, is applicable only to certain configurations. Hyperbolic generation systems can be used to generate orthogonal grids. In two dimensions the condition of orthogonality is simply g12 = 0. If either the cell area g or the cell diagonal length (squared), g11 + g22, is a specified function of the curvilinear coordinates, i.e., g = F(ξ , η) or g11 + g22 = F(ξ , η) then the system consisting of g12 = 0 and either of the two equations just above is hyperbolic. Since the system is hyperbolic, a noniterative marching solution can be constructed proceeding in one coordinate direction away from a specified boundary. The cell volume distribution in the field can be controlled by the specified control function F. One form of this specification is as follows: Let points be distributed on a circle having a perimeter equal to that of the specified boundary at the same arc length distribution as on that boundary. Then specify a radial distribution of concentric circles about this circle according to some distribution function, e.g., the hyperbolic tangent. Then use the volume distribution from this unequally spaced cylindrical coor-

©1999 CRC Press LLC

dinate system as F. The specification of the cell volume prevents the coordinate system from overlapping even off a concave boundary. In this case the line spacing will expand rapidly away from the boundary in order to keep the cell volume from vanishing. Although this prevents overlap, the rapid expansion that occurs can lead to problems with truncation error in some cases. This approach is extendable to 3D with the coordinate lines emanating from the boundary being orthogonal to the other two coordinates, but the latter two lines not being orthogonal. There apparently is no system, hyperbolic or elliptic, that will give complete orthogonality in 3D in general. This hyperbolic grid generation system is faster than the elliptic generation systems by one or two orders of magnitude, the computational time required being equivalent to about that for one iteration in a solution of the elliptic system. The specification of the cell volume distribution avoids the grid line overlapping that otherwise can occur with concave boundaries in a method involving projection away from a boundary. The grid may, however, be somewhat distorted when concave boundaries are involved. The cell volume specification also allows control of the grid line spacing, but again concave boundaries may cause the intended spacing to occur in the wrong coordinate direction, since it is only the volume, and not the spacing in the two separate coordinate directions, that is controlled. As has been noted, the grid is constructed to be orthogonal. The hyperbolic generation system is not as general as the elliptic systems, however, since the entire boundary of the region cannot be specified. Boundary slope discontinuities are propagated into the field, so that the metric elements will be discontinuous along coordinate lines emanating from boundary slope discontinuities. Finally, since hyperbolic partial differential equations can have shock-like solutions in some circumstances, it is possible for very unsuitable grids to result with some specifications of boundary point and cell volume distributions. This is in contrast with the elliptic generation system, which tends to emphasize smoothness because of the nature of elliptic partial differential equations.

1.3.5 Algebraic System Transfinite interpolation (TFI) has become the standard for algebraic grid generation systems, and is now incorporated in most large codes. TFI can accomplish interpolation from any combination of faces, edges, and corners — with boundary orthogonality and with blending functions interpolated from boundary point distributions. Algebraic grid generation is treated in detail in Chapter 3. This section provides an overview of the technology as applied in the EAGLE system, for example (Thompson [1988]). 1.3.5.1 Transfinite Interpolation An algebraic three-dimensional generation system based on transfinite interpolation (using either Lagrange or Hermite interpolation) generates an initial solution to start the iterative solution of the elliptic generation system. The interpolation, in general complete transfinite interpolation from all boundaries, can be restricted to any combination of directions or lesser degrees of interpolation, and the form (Lagrange, Hermite, or incomplete Hermite) can be different in different directions or in different blocks. The blending functions can be linear or, more appropriately, based on interpolated arc length from the boundary point distributions. (This arc length is interpolated by 2D transfinite interpolation from four sides of the block.) Hermite interpolation, based on cubic blending functions, allows orthogonality at the boundary. Incomplete Hermite uses quadratic functions and hence can give orthogonality atone of two opposing boundaries, while Lagrange, with its linear functions, does not give orthogonality. The transfinite interpolation is done by the appropriate combination of 1D projectors, Fi, for the type of interpolation specified. (Each projector is simply the 1D interpolation in the direction indicated.) For interpolation from all sides of the section, if all three directions are indicated and the section is a volume, this interpolation is from all six sides, and the combination of projectors is the Boolean sum of the three projectors:

©1999 CRC Press LLC

F1 + F2 + F3 − F1 F2 − F2 F3 − F3 F1 + F1 F2 F3 With interpolation in only the two directions j and k, or if the section is a surface on which ξ i is constant, the combination is the Boolean sum of Fj and Fk: Fj + Fk − Fj Fk (i, j, k ) cyclic With interpolation in only a single direction i, or if the section is a line on which ξ i varies, the interpolation is between the two sides on which ξ i is constant using only the single projector Fi. With interpolation from the edges of the section, with all three directions indicated and the section a volume, the interpolation is from all 12 edges using the Boolean combination F1 F2 + F2 F3 + F3 F1 − 2 F1 F2 F3 Interpolation from the eight corners of the section is done using F1 F2 F3. There are also other possible combinations. Blocks can be divided into subblocks for the purpose of generation of the algebraic grid and the control functions. Point distributions on the sides of the subblocks can either be specified or automatically generated by transfinite interpolation from the edge of the side. This allows additional control over the grid in general configurations, and is particularly useful in cases where point distributions need to be specified in the interior of a block or to prevent grid overlap in highly curved regions. This also allows points in the interior of the field to be excluded if desired, e.g., to represent holes in the field.

1.3.6 Adaptive Grid Schemes Adaptive grid systems are treated in detail in Chapters 33 and 34. This section provides an overview of the technology as applied in the EAGLE system as an example, (Tu and Thompson [1991], Kim and Thompson [1990]). Dynamically adaptive grids continually adapt to follow developing gradients in the physical solution. This adaptation can reduce the oscillations associated with inadequate resolution of large gradients, allowing sharper shocks and better representation of boundary layers. Another advantageous feature is the fact that in the viscous regions where real diffusion effects must not be swamped, the numerical dissipation from upwind biasing is reduced by the adaptation. Dynamic adaptation is at the frontier of numerical grid generation and may well prove to be one of its most important aspects, along with the treatment of real three-dimensional configurations through the composite grid structure. There are three basic strategies that may be employed in dynamically adaptive grids coupled with the partial differential equations of the physical problems. (Combinations are also possible, of course.) 1.3.6.1 Redistribution of a Fixed Number of Points In this approach, points are moved from regions of relatively small error or solution gradient to regions of large error or gradient. As long as the redistribution of points does not seriously deplete the number of points in other regions of possible significant gradients, this is a viable approach. The increase in spacing that must occur somewhere is not of practical consequence if it occurs in regions of small error or gradient, even though in a formal mathematical sense the global approximation is not improved. The redistribution approach has the advantage of not increasing the computer time and storage during the solution, and of being straightforward in coding and data structure. The disadvantages are the possible deleterious depletion of points in certain regions and the possibility of the grid’s becoming too skewed. ©1999 CRC Press LLC

1.3.6.2 Local Refinement of a Fixed Set of Points In this approach, points are added (or removed) locally in a fixed point structure in regions of relatively large error or solution gradient. Here there is, of course, no depletion of points in other regions, and therefore no formal increase of error occurs. Since the error is locally reduced in the area of refinement, the global error does formally decrease. The practical advantage of this approach is that the original point structure is preserved. The disadvantages are that the computer time and storage increase with the refinement, and that the coding and data structure are difficult, especially for implicit flow solvers. 1.3.6.3 Local Increases in Algorithm Order In this approach, the solution method is changed locally to a higher-order approximation in regions of relatively large error or solution gradient without changing the point distribution. This again increases the formal global accuracy elsewhere. The advantage is that the point distribution is not changed at all. The disadvantage is the great complexity of implementation in implicit flow solvers. 1.3.6.4 Formulations Adaptive redistribution of points traces its roots to the principle of equidistribution of error, by which a point distribution is set so as to make the product of the spacing and a weight function constant over all the points: w∇x = constant With the point distribution defined by a function x(ξ ), where ξ varies by a unit increment between points, the equidistribution principle can also be expressed as wxξ = constant

(1.4)

This one-dimensional equation can be applied in each direction in an alternating fashion, but a direct extension to multiple dimensions can also be made in either of two ways as follows. From the calculus of variations, the above equation can be shown to be the Euler variational equation for the function x(ξ ), which minimizes the integral I = ∫ w( x )xξ 2 dx Generalizing this, a competitive enhancement of grid smoothness, orthogonality, and concentration can be accomplished by representing each of these features by integral measures over the grid and minimizing a weighted average of the three. The second approach is to note the correspondence between Eq. 1.4 and the one-dimensional form of the following commonly used elliptic grid generation system, Eq. 1.1. Here the control functions, Pn, serve to control the grid line spacing and orientation. The 1D form of Eq. 1.1 is xξξ + Pxξ = 0

(1.5)

wxξξ + wξ xξ = 0

(1.6)

Differentiation of Eq. 1.4 yields

Then, from Eq. 1.5 and 1.6, xξξ xξ

©1999 CRC Press LLC

= −P = −

wξ w

from which the control function can be taken as P=

wξ

(1.7)

w

It is logical then to represent the control functions in 3D as Pn =

wξ η w

, n = 1, 2, 3

(1.8)

This can be generalized to 3D as Pi = Σ j

gij ( wi )ξ i g ii

wi

(1.9)

which, in fact, does arise from a variational form (Warsi and Thompson [1990]). An example of the use of adaptive grids is shown in Figure 34.9.

1.4 Unstructured Grids Unstructured grid generation has its roots in the finite element world of structures modeling. The real introduction to the CFD community came in the 1980s primarily from Baker, Weatherill, and Lohner. Unstructured grids have inherent simplicity of construction in that, by definition, no structure is required. Also it is not inherently necessary to communicate the actual topology of the configuration to the grid generator. Although largely synonymous with tetrahedral grids, unstructured grids may alternatively be composed of hexahedral cells (without directional structure). The term might strictly encompass any combination of cell shapes, but in the grid generation literature combinations of regions with structure (e.g., structured or prismatic grids near body surfaces) with regions without structure are generally called hybrid grids. For that matter, block-structured grids are unstructured in the large. Traditionally, unstructured grids have been used with the finite element method. There is, therefore, an extensive literature that covers techniques to generate unstructured grids (cf. Carey [1997], George [1991], Thacker [1980]). In this introductory chapter, it is not possible to present, in detail, all the different techniques. Instead, emphasis here will be given to one particular approach, based upon the Delaunay triangulation, which provides a powerful unstructured grid generation method. This will be used to illustrate the flexibility and characteristics of unstructured grid methods when applied to complicated geometries in two and three dimensions and in grid adaptation. Brief details of other methods will be given.

1.4.1 The Delaunay Triangulation Structured grid generation methods place an emphasis on creating the position of points. The subsequent connections between points are defined automatically given the (i, j, k) ordering. Such ordering does not exist in unstructured grids and hence connections between points, in addition to the position of points, have to be defined by an unstructured grid method. Grid generation based on the Delaunay triangulation (Chapter 16) uses a particularly simple criterion for connecting points to form conforming, nonintersecting elements. This geometrical construction has been known for many years, but only relatively recently has it been used for grid generation for computational

©1999 CRC Press LLC

FIGURE 1.1

The Delaunay triangulation (solid line), and Voronoï regions (hashed line).

fluid dynamics. The geometrical criterion provides a mechanism for connecting points. The task of point generation must be considered independently. Hence, grid generation by Delaunay triangulation involves the two distinct problems of point connection and point creation. 1.4.1.1 Delaunay–Voronoï Geometrical Construction Dirichlet [1850] first proposed a method whereby a given domain, in arbitrary space, could be systematically decomposed into a set of packed convex regions. For a given set of points (Pi), the space is subdivided into regions (Vi), in such a way that the region (Vi) is the space closer to Pi than to any other point. This geometrical construction of tiles is known as the Dirichlet tessellation. This tessellation of a closed domain results in a set of non-overlapping convex regions called Voronoï regions (Voronoï [1908]) that cover the entire domain. More formally, if a set of points is denoted by (Pi), then the Voronoï regions (Vi) can be defined as

(Vi ) = {P :

p − Pi < p − Pj }, ∀j ≠ i

(1.10)

i.e., the Voronoï regions (Vi) are the set of points P that are closer to Pi than to any other point. The sum of all points p forms a Voronoï region. From this definition, it is clear that, in two dimensions, the territorial boundary that forms a side of a Voronoï polygon must be midway between the two points that it separates and is thus a segment of the perpendicular bisector of the line joining these two points. If all point pairs that have some segment of boundary in common are joined by straight lines, the result is a triangulation within the convex hull of the set of points (Pi). This triangulation is known as the Delaunay triangulation (Delaunay [1934]). An example of this geometrical construction is given in Figure 1.1. The construction is also valid in three dimensions. Territorial boundaries are faces that form Voronoï polyhedra and are equidistant between point pairs. If points with a common face are connected, then a set of tetrahedra is formed that covers the convex hull of points. The Delaunay triangulation possesses some interesting properties. One such property is the in-circle criterion, which states that the circumcircles of the triangles T(Pi) contain no points of the set (Pi). This applies in arbitrary dimensions and is the property used to construct an algorithm for the triangulation. As a consequence of the in-circle criterion, in two dimensions, the triangulation T(Pi) also satisfied the maximum–minimum criterion, which states that if the diagonal of any strictly convex quadrilateral is replaced by the opposite one, the minimum of the six internal angles will not decrease. This is a particularly attractive property, since it ensures that the triangulation maximizes the angle regularity of the triangles, and in this way is analogous to the smoothness property of grids generated by elliptic partial differential equations.

©1999 CRC Press LLC

Voronoï Vertex 1 2 3 4 5 6 7 8

FIGURE 1.2

Delaunay Triangle 123 234 349 479 789 467 587 576

Neighbor Voronoï Vertex 2φφ 13φ 24φ 356 47φ 48φ 58φ 67φ

The data structure for the Voronoï diagram and Delaunay triangulation shown in Figure 1.1.

The structure of the Voronoï diagram and Delaunay triangulation can be described by constructing two lists for each Voronoï vertex: a list of the points that define a triangle for a given vertex of the Voronoï construction (so-called forming points), and a free data structure containing the neighboring Voronoï vertices to a given Voronoï vertex. As an example, Figure 1.2 contains the vertex structure for the construction shown in Figure 1.1. This data structure naturally extends to applications in three dimensions, where each Voronoï vertex has four forming points (tetrahedra of the Delaunay triangulation) and four neighboring Voronoï vertices. 1.4.1.2 Algorithm to Construct the Delaunay Triangulation There are several algorithms used to construct the Delaunay triangulation. One approach, which is flexible in that it readily applies to two and three dimensions, is due to Bowyer [1981]. Each point is introduced into an existing Delaunay satisfying structure, which is locally broken and then reconstructed to form a new Delaunay-satisfying construction. In the presentation here the terms in italics indicate the interpretation for three dimensions. Algorithm I Step 1 Define the convex hull within which all points will lie. It is appropriate to specify four points (eight points) together with the associated Voronoï diagram structure. Step 2 Introduce a new point anywhere within the convex hull. Step 3 Determine all vertices of the Voronoï diagram to be deleted. A point that lies within a circle (sphere) centered at a vertex of the Voronoï diagram and passes through its three (four) forming points results in the deletion of that vertex. This follows from the “in-circle” criterion. Step 4 Find the forming points of all the deleted Voronoï vertices. These are the contiguous points to the new point. Step 5 Determine the neighboring Voronoï vertices to the deleted vertices that have not themselves been deleted. These data provide the necessary information to enable valid combinations of the contiguous points to be constructed. Step 6 Determine the forming points of the new Voronoï vertices. The forming points of the new vertices must include the new point together with the two (three) points that are contiguous to the new point and form an edge (face) of a neighbor triangle (tetrahedron). These are the possible combinations obtained from Step 5. ©1999 CRC Press LLC

FIGURE 1.3

The addition of a new point results in deletion of some triangles and the construction of new ones.

FIGURE 1.4

CPU time v. number of connected points.

Step 7 Determine the neighboring Voronoï vertices to the new Voronoï vertices. Following Step 6, the forming points of all new vertices have been computed. For each new vertex, perform a search through the forming points of the neighboring vertices, as found in Step 5, to identify common pairs (triads) of forming points. When a common combination occurs, then the two (three) associated vertices are neighbors of the Voronoï diagram. Step 8 Reorder the Voronoï diagram structure, overwriting the entries of the deleted vertices. Step 9 Repeat Steps 2–8 for the next point. Figure 1.3 indicates that for a given point, the local region of influence is detected, i.e., the triangles associated with circles which contain the point. These triangles are deleted, and the new point connected to the nodes which form the enclosing polygon. This new construction is Delaunay satisfying. The algorithm described here can be used to connect an arbitrary set of points that lie within a convex hull. The efficiency with which this can be achieved depends upon the use of appropriate data structures. The tree structure of neighbor vertices, indicated in Figure 1.2, is central to the implementation. To illustrate performances, Figure 1.4 shows a plot of CPU time against a number of elements generated in 3D on a workstation. The algorithm described provides an important basis for an unstructured grid method. To illustrate its use and to demonstrate an additional problem, consider the problem of generating a boundary ©1999 CRC Press LLC

FIGURE 1.5 Delaunay triangulation of points on two circles. (a) Delaunay construction including the convex hull points. (b) Delaunay construction after the removal of the convex hull points. (c) Delaunay construction with points from a polar grid.

FIGURE 1.6

The boundary is completed by swapping edges in the Delaunay triangulation.

conforming grid within a multiply connected domain defined between two concentric circles. The circles are defined by a set of discrete points. Following the algorithm outlined, these points can be contained within an appropriate hull and then connected together. The result is shown in Figure 1.5a. It is clear that a set of valid triangles has been derived that covers the region of the hull. Two issues are immediately raised. First, to derive a triangulation in the specified region, triangles outside this region must be deleted. Second, if the triangles are to provide a boundary conforming grid it is necessary that edges in the Delaunay triangulation form the given geometrical boundaries of the domain. Unfortunately, given a set of points which define prespecified boundaries there is no guarantee that the resulting Delaunay triangulation will contain the edges which define the domain boundaries. Such a case is also true in three dimensions, where boundary faces must be included in the tetrahedra of the Delaunay triangulation for the resulting grid to be boundary conforming. It is necessary, therefore, to check the integrity of boundaries, and if found not to be complete, appropriate steps must be taken. Prespecified boundary connectivities can be reconstructed by combinations of edge swapping to recover boundaries in two dimensions is given in Figure 1.6. The given boundary edges are recovered through edge swapping. In 3D, this problem is more severe and requires careful attention. Once the boundary is complete, it is a simple task to delete triangles exterior to the region of interest. Deletion of unwanted triangles in Figure 1.5a leads to the triangulation shown in Figure 1.5b. Figure 1.5b represents a valid triangulation of the points that define the two concentric circles. However, the triangles span the entire region and are clearly inappropriate for any form of analysis. Hence, it is necessary to address the problem of point creation.

1.4.2 Point Creation 1.4.2.1 Points Created by an Independent Generation Technique Points for connection by the Delaunay algorithm could be derived by a method external to the triangulation routine. For example, in the case of the two circles, a polar grid could be generated and the set of points then connected together to form the grid. Such a triangulation with polar grid points is overly

©1999 CRC Press LLC

FIGURE 1.7

FIGURE 1.8

Unstructured grid with points generated from a structured method.

Delaunay triangulation of a regular set of points superimposed over the domain.

complicated. However, for more realistic domains, which may be more geometrically complex, the approach can prove to be effective. Taking an example from aerospace engineering, Figure 1.7 shows a grid in which two structured grids have been independently generated around the two components and the total set of points connected together to form the unstructured mesh. For more general geometries, alternative, more flexible point creation routines are required. 1.4.2.2 Points Created by Grid Superposition and Successive Subdivision It is possible to extend the use of an independent grid generation technique to include grid superposition and successive subdivision. The basic idea is to superimpose a regular grid over the domain. The regular grid can be generated using a quadtree or octree data structure that allows point density in the regular grid to be consistent with point spacing at the boundary. An example of this approach is shown in Figure 1.8. In general, this approach results in good spatial discretization in the interior of the domain, although in the vicinity of boundaries the grid quality can be poor. 1.4.2.3 Point Creation Driven by the Boundary Point Distribution For grid generation purposes, the domain is defined by points on the geometrical boundaries. It will be assumed that this point distribution reflects appropriate geometrical features, such as variation in boundary curvature and gradient. Ideally, any method for automatic point generation should ensure that the boundary point distribution is extended into the domain in a smooth manner. A procedure that has proved successful in creating a smooth point distribution consistent with boundary point spacing and that naturally extends to three dimensions is as follows. ©1999 CRC Press LLC

Algorithm II Step 1 Compute the point distribution function dpi for each boundary point ri = (x, y), where it is assumed that points i+1 and i are contiguous: dpi = 0.5

(ri +1 − ri )2

+

(ri − ri −1 )2

Step 2 Generate the Delaunay triangulation of the boundary points. Step 3 Initialize j = 0. Step 4 For each triangle Tm within the domain, perform the following: a. Define a point at the centroid of the triangle Tm , with nodes n1, n2, n3: Pc =

1 (rn1 + rn2 + rn3 ) 3

b. Derive the point distribution function dpc by interpolating the point distribution function from the nodes n1, n2, n3: dpc =

1 (dpn1 + dpn2 + dpn3 ) 3

c. If Pc − rnk < α dpc k = 1, 2, 3 then reject point Pc; next triangle. If Pc − rnk > α dpc k = 1, 2, 3 then, if P j − Pc > β dpc j = 1,..., N accept point Pc and add to list Pj, j = 1, N. If P j − Pc < β dpc j = 1,..., N then reject point Pc; next triangle Step 5 If j = 0, go to Step 7.

©1999 CRC Press LLC

FIGURE 1.9

Grid point creation and distribution controlled by the boundary point distribution.

Step 6 Perform Delaunay triangulation of the derived points Pj, j = 1, N. Go to Step 3. Step 7 Smooth the grid. It proves beneficial to smooth the position of the grid points using a Laplacian filter. The coefficient α controls the grid point density, while β has an influence on the regularity of the triangulation. Figure 1.9 shows two triangulations produced using this point creation algorithm. In Figure 1.9a, α = 1, β = 10, while in Figure 1.9b α = 1, β = 0.02. The effect of β is clearly evident. A more realistic example is given in Figure 1.10, where a grid is shown for a finite element stress analysis of a tooth. The algorithm outlined is equally applicable in three dimensions. Figure 1.11 shows an unstructured tetrahedral grid around an airplane. Appropriate point clustering has been achieved close to the plane. A flow solution has been computed on this mesh as a further demonstration of the applicability of the approach. The procedure outlined creates points consistent with the point distribution on the boundaries. However, in many problems information is known about features within the domain that require a suitable spatial discretization. It proves possible to modify the above algorithm to take such effects into account. Two techniques can be readily implemented. The first utilizes the idea of point and line sources, while the second uses the concept of a background mesh.

©1999 CRC Press LLC

FIGURE 1.10

Unstructured grid used for finite element stress analysis.

FIGURE 1.11 Automatic point creation in three dimensions driven by boundary point distribution. (a) Surface grid. (b) Cuts through the field. (c) Solution of inviscid flow.

1.4.2.4 Point Creation Controlled by Point and Line Sources In somewhat of an analogous way to point sources used as control functions with elliptic PDEs, it is possible to define line and point sources to provide grid control for unstructured meshes. Local grid point spacing can be defined as dpi = min{A j e

B j R j − ri

}, j = 1,...number of sources

(1.11)

where Aj, Bj, and Rj (j = 1, number of sources) are user-controlled amplification and decay parameters and the position of sources, respectively. Grid point creation is then performed as outlined, but in Step 4b, the appropriate point distribution function at the centroid is determined by Eq. 1.10. In practice, the substitution of Eq. 1.10 for Step 4b is trivial. ©1999 CRC Press LLC

FIGURE 1.12

Point density controlled through point and line sources.

Examples of the use of point sources are given in Figure 1.12a. Figure 1.12a shows the mesh controlled through the boundary point distribution, while in Figure 1.12b a point source has been specified. It is clear that grid spacing is controlled by the source position and associated parameters. Line sources can also be introduced. For simplicity, line sources are treated as a series of point sources. In this way Eq. 1.10 is also applicable. An example of grid control by a line source is given in Figure 1.12c. Combinations of line and point sources can also be used, such as the example shown in Figure 1.12d. It should be noted that the user-specified information to implement the sources is minimal. It is clear that the sources provide a mechanism for clustering points. To ensure an adequate point spacing in regions not influenced by the sources, it is appropriate to use a combination of point spacing derived from the sources and the boundary point distribution. In practice, this can be implemented by defining the local length parameter to be

dpi = min{A j e

B j R j − ri

, dpboundary}, j = 1,...number of sources

where dpboundary is the point spacing parameter defined from the boundary point distribution and derived using Algorithm II. An example of the use of this approach is shown in Figure 1.13, for ocean modeling of the North Atlantic. An unstructured grid generated from the boundary point spacing is shown in Figure 1.13a, while in Figure 1.13b, a single line source has been appropriately positioned to ensure a higher point resolution to capture the Gulf Stream.

©1999 CRC Press LLC

FIGURE 1.13 Unstructured grid for the North Atlantic. (a) Points created from boundary point spacing. (b) Points created from boundary point spacing and line source.

FIGURE 1.14

Grid control using a background mesh.

1.4.2.5 Point Creation Controlled by a Background Mesh An alternative way to control grid point spacing is by defining a background mesh on which the local point spacing is defined. To implement this approach in the proposed algorithm the point spacing in Step 4b is derived from the background mesh. As an example, consider the rectangular domain in Figure 1.14a. A background mesh is defined of 10 elements at whose nodes a point spacing is specified. If small spacing is defined at interior nodes and larger spacing on the boundary, then the use of the automatic point creation algorithm results in the mesh shown in Figure 1.14b. Modification to the topology of the background mesh or the point spacing function at nodes allows complete control of the unstructured grid density. In practice, the background mesh is a previous mesh used for analysis in which a measure of the analysis is converted, by an appropriate transformation, to spacings in the physical domain. An example of this is given in the section on adaptation techniques. The above ideas provide some examples of the way unstructured grids can be generated. There is considerable flexibility to introduce points where required. Algorithms to construct such grids are not over complicated to program and are fast and efficient provided, as already emphasized, appropriate care is taken with respect to data structures.

©1999 CRC Press LLC

FIGURE 1.15

Test case example indicating the steps in the advancing front technique.

1.4.3 Other Unstructured Grid Techniques 1.4.3.1 Advancing Front Methods Another class of unstructured grid generators is based upon the idea of an advancing front (Chapter 17). Such methods construct a mesh of a domain from its boundary information. The method is applicable in both two and three dimensions, where triangles and tetrahedra are generated, respectively. The basic ideas of the method are best illustrated in two dimensions. Consider a region bounded by points (Pi) and edges (PmPn). The edges are called the front. A test case example is shown in Figure 1.15. To construct a grid in the domain, perform the following: Choose an edge on the front, say P1 P2. Construct the perpendicular bisector of P1 P2 and create a point s a distance d into the domain. Create a circle, center s, of radius r. Determine any points which lie within this circle (ai) and order them in distance from the center s. Form triangles (P1P2 ai) and accept the first triangle that satisfies the following conditions: a. Edges (P1ai) and (P2ai) do not intersect any other edges. b. Triangle (P1P2 ai) satisfies an appropriate quality indicator. (Such indicators are based upon regularity of interior angles, etc.) 6. If ai is a new point, add to the list of points. Add any new edges to the front and delete the old edge (P1P2).

1. 2. 3. 4. 5.

This procedure is repeated until the front is empty, i.e., there are not edges left in the front. In the above algorithm, the grid point density can be controlled by the length d1, i.e., the distance away from the mid-point of the current edge on the front. This length parameter can be obtained using a background mesh, or a distribution of line or point sources. The effects are the same as those indicated for the Delaunay algorithm.

©1999 CRC Press LLC

FIGURE 1.16

Hybrid grid for multiple airfoils.

In principle, this basic procedure holds for applications in three dimensions, where the front consists of a set of triangular faces which bound the domain. In practice, the implementation of this basic procedure requires an efficient data structure to ensure realistic computational times. It is worth commenting that the advancing front technique can be used to also generate grids with elements aligned in given directions. This is achieved by introducing a directional parameter, in addition to a length parameter d. In this way, instead of constructing a line perpendicular to the edge on the front, a line inclined in the specified direction can be generated. Again the directional parameters can be specified in the background mesh. 1.4.3.2 Quadtree and Octree Grid generation based upon quadtree (2D) and octree (3D) have recently been introduced (Chapter 15). Such methods begin with a point definition of the boundaries. Superimposed over the domain is a sparse regular grid that is subdivided so that at boundaries the cell size is consistent with the boundary point spacing. The data points and cells are contained in the quadtree or octree data structure. The grid is made to be boundary conforming by appropriate cutting and reconnecting to form triangles and tetrahedra. 1.4.3.3 Hybrid Grids To achieve an optimum compromise between regularity and flexibility, it is possible to combine grid types in the form of hybrid or structured–unstructured grids (Chapter 23). Figure 1.16 shows three airfoils where each is locally discretized using a structured grid that is connected using an unstructured grid. The idea can be also applied in three dimensions. Figure 1.17 shows a surface grid for a fuselage, wing, pylon, and nacelle, where the pylon and nacelle components have been incorporated into a structured grid using locally unstructured grid. Such grid generation techniques require analysis modules that can utilize mixed element types.

1.4.4 Unstructured Grid Generation on Surfaces In most engineering applications it is not possible to define a surface in a closed form mathematical expression. In general, a given surface is defined as a discrete set of points, that map to a regular array. In such cases, it is possible to define the surface in terms of two parametric coordinates (u, v) where each pair maps to a point on the surface. With this description of a surface it is possible to construct grids on surfaces by utilizing 2D techniques applied in the parametric coordinates (Chapter 19). The final grid on the surface is then obtained by mapping to the physical space. The point connections remain fixed through the transformation. Complicated surfaces can be defined by using more than one set of rectangular point sets. Figure 1.18 shows a grid in parametric coordinates, which when mapped to physical space becomes an unstructured grid on the surface of a wing. The grid at the tip of the wing is treated separately from the grid on upper and lower surfaces of the wing.

©1999 CRC Press LLC

FIGURE 1.17

FIGURE 1.18

Hybrid grid for a wing, fuselage, pylon, and nacelle.

Grid in parametric space converted to unstructured surface grid in physical space.

1.4.5 Adaptation on Unstructured Grids The basic principles of adaptation have been given above in Section 1.3.6. Here comments will be restricted to grid adaptation on unstructured grids (Chapter 35). 1.4.5.1 Point Enrichment Local point enrichment can be achieved on any grid type. It is an effective way to ensure greater resolution of the domain in critical regions. It is most naturally employed on unstructured grids where, on the addition of a point and the subsequent connections, the data format of the grid does not change. Hence, solution modules do not require any modifications. This is not true for structured grids where the addition of a point breaks the (i, j, k) data format and hanging or nonconforming nodes are created. Points are added to the domain in regions where some measure of error or solution activity is large. Dependent upon the problem, a suitable indicator f is chosen. From a computation on a grid, the indicator f is known at all points. It is then possible to construct operators that indicate where additional points should be added. For example, point enrichment could be driven by detecting changes in f along edges. If

φa − φb φi − φ j

©1999 CRC Press LLC

max

> tolerance

(1.12)

FIGURE 1.19

Mach 3 flow around a cylinder showing point enrichment. Flowfield contours of density also shown.

then add a point along the edge a to b. Connections to the new node can then be made. Similar expressions can be constructed for triangles, tetrahedra, etc. For some class of problems, more sophisticated error indicators can be used. These can be applied to give a solution which can have a prespecified bound on the errors. In some regions of the domain it may be possible to delete nodes. This process can be driven by criteria similar to the one for enrichment. Examples of point enrichment and derefinement are given in Figure 1.19 and Figure 1.20a. The first example illustrates the use of point enrichment, driven by gradients of density, on an unstructured grid, for a simulation of Mach 3 flow around a cylinder. Contours of density for the flowfield are shown in Figure 1.19c. It is clear that points have been added where gradients in density are high. Figure 1.20a shows an enriched structured multiblock grid. As indicated earlier, once points are added to such a grid, the data format has to be modified. To provide flexibility for grid point enrichment on such grids, the data format has been converted to quadtree. In the example shown the point addition was driven by gradients in density. Contours of density are shown in Figure 1.20d, again confirming that the point enrichment has occurred in the relevant regions. 1.4.5.2 Node Movement Node enrichment successfully enhances the resolution of an analysis. However, it can become computationally expensive and provides a diminishing return on successive enrichments. After ensuring that there is sufficient mesh point resolution, node movement can provide the required mechanism to achieve high resolution at a negligible cost. Many techniques have been explored to move points. One that is particularly simple, is applicable to all grid types, and is effective, is based on a weighted Laplacian formulation. A typical form is the following: cio (rin − r0n ) Σ i =1 M

r0n +1 = r0n + ω

M

Σ cio

(1.13)

i =1

where r = (x, y), ron+1 is the position of node o at relaxation level n + 1, Cio is the adaptive weight function between nodes i and o, and ω is the relaxation parameter. The summation is taken over all edges connecting points o and i, where it is taken that there are M surrounding nodes. The weight Cio can be taken as a measure of activity, and a typical form is Cio = α 1 = α 2

©1999 CRC Press LLC

φi − φ o i = 1,..., M φi + φ o

(1.14)

FIGURE 1.20 Adaption on a multiblock grid; (a) point enrichment, (b) node movement, (c) point enrichment, derefinement and node movement, (d) contours of density.

FIGURE 1.21

Mach 2 flow in a channel showing refined/derefined grid with flow contours of density.

where φ is the adaptive parameter, α1 and α2 are constants. Figure 1.20b shows a multiblock structured grid that has been adapted using node movement driven by density gradients. As was the case for point enrichment, comparison with the contours of density confirms the point movement has been into regions with high gradients. For extensive numerical studies it appears that the use of point enrichment, derefinement, and movement should be closely coupled. Sequences of these adaptive procedures give the optimum results, as judged by solution accuracy and computational efficiency. Examples of computations where these adaptive mechanisms have been cycled are given in Figure 1.20c and Figure 1.21. In Figure 1.21, the contours of density on a refined and derefined grid can be compared with those obtained after the grid points have been moved. A clear improvement in shock capturing is evident.

©1999 CRC Press LLC

FIGURE 1.22

Mach 3 flow over a cylinder showing remeshing.

1.4.5.3 Remeshing The concept of grid point generation driven by the spacing specified on a background mesh can be utilized for adaptation. In this case, the result of an analysis can be used to construct spacings, which are then assigned to the mesh, which in turn are used in the background mesh. There are several ways of performing the transformation between results and local length scales, but typically they take the form of dpinew = dpiold ⋅

φ

average

φi

(1.15)

where dpinew and dpiold are the new and old point distributions, φ i is the adaptive indicator, φaverage is the indicator averaged throughout the domain. An example of remeshing, where the initial mesh is used as a background mesh and pressure was used as the adaptive indicator, is given in Figure 1.22. It is seen that local point clustering has occurred in the vicinity of the bow shock wave, but not in the region rear of the cylinder, which might be expected from the contours shown in Figure 1.19c. This illustrates a key area in grid adaption, in that, although there are steep gradients in density rear of the cylinder, there are no such gradients in pressure. Hence, the adaption process for remeshing, driven in this example by pressure, does not detect the features in density rear of the cylinder. As yet, for flow problems, there is no universal indicator and hence the selection of the parameter has to be made on a case-by-case basis.

1.4.6 Summary Unstructured grids provide considerable flexibility for the discretization of complex geometries and grid adaptation. In these sections a brief outline has been given on such techniques. Particular details have been given on the use of the Delaunay triangulation. It should be emphasized that, although the majority of applications have been drawn from aerospace engineering, the ideas and principles discussed are equally applicable to other fields.

References 1. Arcilla, A. S., Hauser, J., Eiseman, P. R., and Thompson, J. F., (Eds.), Numerical Grid Generation in Computational Fluid Dynamics and Related Fields, Proceedings of the 3rd International Conference, North Holland, 1991. 2. Bowyer, A., Computing Dirichlet Tessellations, The Computer Journal, Vol. 24, pp. 162–166, 1981.

©1999 CRC Press LLC

3. Carey, G. F., Computational Grids: Generation, Adaptation, and Solution Strategies, Taylor & Francis, 1997. 4. Castillo, J. E., (Ed.), Mathematical Aspects of Numerical Grid Generation, SIAM Press, 1991. 5. Choo, Y., (Ed.), Proceedings of the Surface Modeling, Grid Generation and Related Issues in Computational Fluid Dynamics Workshop, NASA Conference Publication 3291, NASA Lewis Research Center, Cleveland, OH, May 1995, p. 359. 6. Delaunay, B., Sur la sphere vide, Bulletin of Academic Science URSS, Class. Science National, 1934, pp. 793–800. 7. Dirichlet, G. L., Uber die Reduction der positiven Quadratischen formen mit drei Underestimmten Ganzen Zahlen, Z. Reine Angew. Mathematics, Vol. 40, No. 3, pp. 209–227, 1850. 8. Eiseman, P. R., Grid generation for fluid mechanics computations, Annual Review of Fluid Mechanics, Vol. 17, 1985. 9. Soni, B. K., Thompson, J.F., Eiseman, P.R., and Hauser, J., (Eds.), Numerical Grid Generation in Computational Field Simulation. Proceedings of the 5th International Conference, MSU Publisher, Mississippi State, MS, U.S., April 1996. 10. Eiseman, P. R., Hauser, J., Thompson, J. F., and Weatherill, N. P., (Eds.), Numerical Grid Generation in Computational Field Simulation and Related Fields, Proceedings of the 4th International Grid Conference, Pineridge Press, Swansea Wales, U.K., 1994. 11. George, P. L., Automatic Mesh Generation, Wiley Publications, 1991. 12. Godunov, S. K. and Propokov, G. P., On the computation of conformal transformations and the construction of difference meshes, Zh. Vychisl. Mat. Mat. Fiz., Vol. 7, p. 209, 1967. 13. Gordon, W. J. and Thiel, L. C., Transfinite mappings and their application to grid generation, Numerical Grid Generation, Thompson, J. F., (Ed.), North Holland, 1982. 14. Hauser, J. and Taylor, C., (Ed.), Numerical Grid Generation in Computational Fluid Dynamics, Proceedings of the 1st International Conference, Pineridge Press, 1986. 15. Kim, J. K. and Thompson, J. F., Three-dimensional solution-adaptive grid generation on a composite block configuration, AIAA Journal, Vol. 28, p. 420, 1990. 16. Knupp, P. and Steinberg, S., Fundamentals of Grid Generation, CRC Press, Boca Raton, FL, 1993. 17. Miki, K. and Takagi, T., A domain decomposition and overlapping method for the generation of three-dimensional boundary-fitted coordinate systems, Journal of Computational Physics, Vol. 53, p. 319, 1984. 18. Rubbert, P. E. and Lee, K. D., Patched coordinate systems, Numerical Grid Generation, Thompson, J.F., (Ed.), North-Holland, 1982. 19. Sengupta, S., Hauser, J., Eiseman, P. R., and Thompson, J. F., (Eds.), Numerical Grid Generation in Computational Fluid Dynamics 1988, Proceedings of the 2nd International Conference, Pineridge Press, 1988. 20. Smith, R. E., (Ed.), Numerical Grid Generation Techniques, NASA Conference Publication 2166, NASA Langley Research Center, 1980. 21. Smith, R. E., (Ed.), Proceedings of the Software Systems for Surface Modeling and Grid Generation Workshop, NASA Conference Publication 3143, NASA Langley Research Center, Hampton, VA, 1992, p. 161. 22. Sorenson, R. L., The 3DGRAPE book: theory, users’ manual, examples, NASA TM-10224, 1989. 23. Thacker, Int. J. Numer. Meth. Eng., 15, p. 1335, 1980. 24. Thompson, J. F., (Ed.), Numerical Grid Generation, North Holland, 1982. (Also published as Vol. 10 and 11 of Applied Mathematics and Computation, 1982.) 25. Thompson, J. F., Grid generation techniques in computational fluid dynamics, AIAA Journal, Vol. 22, p. 1505, 1984. 26. Thompson, J. F., Warsi, Z. U. A., and Mastin, C. W., Numerical Grid Generation: Foundations and Applications. North Holland, 1985. 27. Thompson, J. F., A survey of dynamically adaptive grids in the numerical solution of partial differential equations, Applied Numerical Mathematics, Vol. 1, p. 3, 1985.

©1999 CRC Press LLC

28. Thompson, J. F., A general three-dimensional elliptic grid generation system on a composite block structure, Computer Methods in Applied Mechanics and Engineering, Vol. 64, p 377, 1987. 29. Thompson, J. F., A composite grid generation code for 3D regions —the EAGLE code, AIAA Journal, Vol. 26, p. 915, 1988,. 30. Thompson, J. F., A reflection on grid generation in the ’90s: trends, needs and influences, Numerical Grid Generation in Computational Field Simulation. Soni, B. K., Thompson, J. F., Hauser, J., Eiseman, P. R., (Eds.), Proceedings of the 5th International Conference, MSU Publisher, Mississippi State, MS, U.S., April 1996, p. 1029. 31. Thompson, J. F., Warsi, Z. U. A., Mastin, C. W., Boundary-fitted coordinate systems for numerical solution of partial differential equations — a review, J. of Computational Physics, Vol. 47, p. 1, 1982. 32. Tu, Y. and Thompson, J. F., Three-dimensional solution-adaptive grid generation on composite configurations, AIAA Journal, Vol. 29, p. 2025, 1991. 33. Voronoï, G., Nouvelles applications des parametres continus a la theorie des formes quadratiques. recherches sur les parallelloedres primitifs, Journal Reine Angew. Mathematics, Vol. 134, 1908. 34. Warsi, Z. U. A. and Thompson, J. F., Application of variational methods in the fixed and adaptive grid generation, Computers in Mathematics with Applications, Vol. 19, p. 31–41, 1990. 35. Weatherill, N. P. and Forsey, C. R., Grid generation and flow calculations for complex aircraft geometries using a multi-block scheme, AIAA-84-1665, AIAA 17th Fluid Dynamics, Plasma Dynamics, and Laser Conference, Snowmass, CO, 1984. 36. Winslow, A. M., Equipotential zoning of two-dimensional meshes, J. of Computational Physics, Vol. 1, p. 149, 1966. 37. Winslow, A. M., Numerical solution of the quasilinear Poisson equation in a nonuniform triangle mesh, Journal of Computational Physics, Vol. 135, pp. 128–138, 1997; reprinted from November 1966, Vol. 1, Number 2, pp. 149–172.

©1999 CRC Press LLC

2 Mathematics of Space and Surface Grid Generation 2.1 2.2

Introduction A Résumé of Differential Operations in Curvilinear Coordinates i Representations in Terms of a ~ i and a ~ • Differential Operations • Metric Tensor and the Line Element • Differentiation of the Base Vectors • Covariant and Intrinsic Derivatives • Laplacian of a Scalar

2.3

Theory of Curves

2.4

Geometrical Elements of the Surface Theory

A Collection of Usable Formulae for Curves The Surface Christoffel Symbols • Normal Curvature and the Second Fundamental Form • Principal Normal Curvatures • Mean and Gaussian Curvatures • Derivatives of the Surface Normal; Formulae of Weingarten • Formulae of Gauss • Gauss–Codazzi Equations • Second-Order Differential Operator of Beltrami • Geodesic Curves in a Surface • Geodesic Torsion

2.5

Elliptic Equations for Grid Generation Elliptic Grid Equations in Flat Spaces • Elliptic Grid Equations in Curved Surfaces

Zahir U. A. Warsi

2.6

Concluding Remarks

2.1 Introduction The purpose of this chapter is to provide a comprehensive mathematical background for the development of a set of differential equations that are geometry-oriented and are generally applicable for obtaining curvilinear coordinates or grids in intrinsically curved surfaces. To achieve this aim it is imperative to consider some geometrical results on curvilinear coordinates in the embedding space. The geometrical results are usually a consequence of some differential operations in the embedding space which also lead toward the theory of curves. The embedding space for non-relativistic problems is Euclidean or flat. Sections 2.2, 2.3, and 2.4 contain some basic results that are more fully explained in the books by Struik [1], Kreyszig [2], Willmore [3], Eisenhart [4], Aris [5], and McConnell [6] among others, and in a monograph by Warsi [7]. In the course of development of the subject in this chapter, some elementary tools and results of tensor analysis have helped to provide concise results

©1999 CRC Press LLC

with full generality.* This chapter mainly focuses on one aspect of grid generation, which is the method of elliptic partial differential equations. It has been shown that the developed equations automatically satisfy some important results of the theory of surfaces. From this we conclude that the developed equations should be preferred to any other arbitrarily chosen set of equations to generate coordinates or grids in a surface. Another important outcome of these model equations is that the “fundamental theorem of surface theory” can be re-stated in a computationally realizable form. In other words, the proposed model equations can also be used to generate a surface if appropriate metric data** has been specified. Thus the proposed model equations have dual use, viz., generating the coordinate lines in a given surface, or generating a surface based on the metric data. Further, because of the elliptic nature of the equations, the generated grid lines will be smooth. The idea of coordinate generation by using the elliptic partial differential equations in a plane is essentially due to Winslow [8]. However, if one stretches backward from Winslow to trace the foundations of the theory of coordinate generation by elliptic partial differential equations, then it is not possible to escape from the conclusion that the seed work was done by Allen [9], though in a different context. Later Chu [10] and Thompson, et al. [11] have used Winslow’s model for applications. In [11] extensive work was done to choose the coordinate control functions for application to a variety of problems. The application of the methods developed in [11] to extremely difficult problems involving geometries encountered in aeronautical engineering made the method of grid generation an important tool in CFD. Many years of work by a number of researchers and workers was published in a book [12]. Other books have followed in recent times ([13, 14]). In an attempt to generalize the Winslow model of numerical coordinate generation, and further, to provide a mathematical foundation to the model equations, Warsi [15–18] has used the formulae of Gauss to arrive at the model equations as discussed in the cited references and in this article. These model equations are applicable for coordinate generation on generally curved surfaces with the coordinate generators (the control functions) appearing in them in a natural way. As noted earlier the same equations can also be used to generate a surface. For a plane these model equations reduce to those given in [8–11]. Some authors have also developed the surface coordinate generation model by using variational methods [19–21].

2.2 A Résumé of Differential Operations in Curvilinear Coordinates For a presentation of a connected account of the theory of numerical coordinate mapping, it is imperative to review some basic concepts and formulae pertaining to the differential operations in curvilinear coordinates. As noted in the introduction, the formulae obtained by using simple tensor operations expose themselves effectively and in their full generality. Thus we use the symbol xi, i = 1, 2, …, n to represent a curvilinear coordinate system in either a Euclidean or non-Euclidean n-space. In a Euclidean 3-space, denoted by E3, one can introduce a rectangular Cartesian coordinate system xk, k = 1, 2, 3, or x1 = x, x2 = y, x3 = z, and the corresponding unit vectors ik, k = 1, 2, 3, or i 1 = i, i 2 = j, i 3 = k . The ˜ ˜ ˜ ˜ ˜ ˜ position vector r is ˜ r = i x1 + i x 2 + i x3 = x k i ~

~1

~2

~3

= i x + jy + kz ~

~

~

~k

(2.1a) (2.1b)

*For those readers who have not used tensor calculus in their works, the material presented here is, nevertheless, useful if the tensor quantities are viewed as abbreviations. For example, a Christoffel symbol is nothing but an abbreviated name of an algebraic sum of the first partial derivatives of the metric coefficients. **Metric data means the first and second fundamental coefficients. Refer to Section 2.4

©1999 CRC Press LLC

(In general the repeated indices, when one is a subscript and the other a superscript, will imply summation over the range of index values. Exceptions to this rule will sometimes occur when the background system is rectangular Cartesian, as in Eq. 2.1a where both repeated indices are subscripts.) By introducing a general coordinate system xi , i = 1, 2, 3, in E3 and assuming the functions

(

)

xi = fi x1 , x 2 , x 3 , i = 1, 2, 3

(2.2a)

to be continuously differentiable and which are also invertible, i.e., x i = Φ i ( x1 , x 2 , x3 ), i = 1, 2, 3

(2.2b)

we form the covariant base vectors

∂r

a =

~

∂x j

~j

, j = 1, 2, 3

(2.3a)

where a j is tangent to the coordinate curve xj. A system of reciprocal base vectors a i are formed that ˜ ˜ satisfy the equations a i ⋅ a = δ ij ~

~j

(2.3b)

where

δ ij = 0 if i ≠ j = 1 if i = j is the Kronecker symbol. (In a purely rectangular Cartesian setting it is a common practice to use δ ij as the Kronecker symbol.) Since the coordinates x j are independent among themselves, the simple result

αx i = δ ij αx j leads one to the formula a i = grad x i ~

(2.3c)

where

grad = ∇ = ~

is the gradient operator.

©1999 CRC Press LLC

∂( ) i ∂x m ~ m

(2.4)

2.2.1 Representations in Terms of a~ i and a~i All quantities that follow certain transformation of coordinate rules are called tensors. Tensors of various orders (ranks) can either be formed or appear naturally. In particular, scalars and vectors are tensors of order zero and one, respectively. A vector u can be represented in either of the following forms: ˜ u = ui a

(2.5a)

= ui a

(2.5b)

~

~i

~i

U i + V j+ W k ~

~

~

(2.5c)

In Eqs. 2.5a, 2.5b ui and ui are the contravariant and covariant components of u, respectively. In the ˜ same fashion a tensor T˜ of second order can be represented in any one of the following forms: T = T ij a a

(2.6a)

= Tij a i a j

(2.6b)

= Ti j a aj

(2.6c)

= Ti j a i a

(2.6d)

~i ~ j

~ ~

~i ~

~ ~j

Here T ij are the contravariant components and Tij are the covariant components of T˜ . In Eqs. 2.6c, 2.6d the components are of the mixed type. Further a i a j is the dyadic product of the vectors a i and a j . A ˜ ˜ ˜ ˜ unit tensor I˜ has units on the main diagonal and zeros elsewhere. Thus using either Eq. 2.6c or Eq. 2.6d we have ~

I = δ ij a a j = δ ij a i a ~i ~

~ ~j

In short, ~

I = a ai = ai a ~i ~

(2.7)

~ ~i

The transpose of the tensor T˜ is denoted as T˜ T , and has the representation ~T

T = T ji a a = T ij a a ~i ~ j

(2.8)

~ j ~i

and similarly with the other representations. A tensor is symmetric if ~

~

TT = T

©1999 CRC Press LLC

(2.9a)

and skew-symmetric if ~T

~

T = −T

(2.9b)

Vectors and tensors in the rectangular Cartesian system can be written in a straightforward manner using summation on repeated subscripts, e.g., [22].

2.2.2 Differential Operations Let the position vector r be expressed in terms of the curvilinear coordinates xi. The first differential ˜ dr is then ˜ dr = ~

∂r

~

∂x i

dx i

Using Eq. 2.3a, d r = a dx i ~

(2.10)

~i

On comparison with Eq. 2.5a we note that dxi are the contravariant components of the differential displacement vector dr . It must, however, be noted that xi are not the contravariant components of any ˜ vector. Let φ (x1, x2, x3) be a scalar point function. Then its first differential is

∂φ i dx ∂x i

(2.11a)

dx i = a i ⋅ d r

(2.11b)

dφ = From Eq. 2.10, using Eq. 2.3b we have

~

~

which when used in Eq. 2.11a yields dφ = (∇φ ) ⋅ d r

~

(2.11c)

where ∇φ =

∂φ i a ∂x i ~

is the gradient of φ , and is a vector. Let u be a vector function of position; then its first differential is ˜ du = ~

©1999 CRC Press LLC

∂u ~

∂x i

dx i

(2.11d)

Using Eq. 2.11b, we have ∂u d u = ~i a i ⋅ d r ∂x ~ ~ ~ We shall use the definition of the gradient of a vector as

grad u = ~

∂u ~

∂x i

ai

(2.12)

~

so that d u = grad u ⋅ d r ~ ~ ~

(2.13)

The divergence of a vector field u is obtained by adding the diagonal terms of the tensor grad u , which ˜ ˜ in vector operational form is

div u = ~

∂u ~

∂x i

⋅ ai

(2.14)

~

Taking a lead from Eq. 2.14, the divergence of a tensor is ~

∂T div T = i ⋅ a i ∂x ~ ~

(2.15)

To complete this discussion, the curl of a vector field u is defined as ˜ curl u = a i × ~

~

∂u ~

∂x i

2.2.3 Metric Tensor and the Line Element In E3 we introduce a system of curvilinear coordinates x i. The differential displacement vector is then given by Eq. 2.10 and the length element ds is given by ds 2 = d r⋅ d r = a ⋅ a dx i dx j ~ ~ ~ i ~ j Writing gij = a ⋅ a

(2.16)

ds 2 = gij dx i dx j

(2.17)

~i ~ j

we obtain

©1999 CRC Press LLC

The coefficient gij are the covariant components of the metric tensor. Though Eq. 2.17 has been obtained for a Euclidean space, it is applicable to both the Euclidean and non-Euclidean spaces. In fact, Eq. 2.17 forms the one and the only postulate of Riemannian geometry. Obviously, gij are symmetric components, i.e., gij = g ji and the determinant of the matrix formed by gij is

( )

g = det gij

(2.18)

which is strictly positive for E3. The contravariant components of the metric tensor are g ij = a i ⋅ a j ~

(2.19)

~

which are easily obtained in terms of gij as

(

g ij = grp glt − grt glp

)/ g

(2.20)

where the groups (i, r, l) and (j, p, t) separately assume values in the cyclic permutations of 1, 2, 3, in this order. Introducing the following subdeterminants, G1 = g22 g33 − ( g23 ) G2 = g11g33 − ( g13 )

2

2

G3 = g11g22 − ( g12 )

2

(2.21)

G4 = g13 g23 − g12 g33 G5 = g12 g23 − g13 g22 G6 = g12 g13 − g11g23 we have on using Eq. 2.20: g11 = G1 / g,

g 22 = G2 / g,

g 33 = G3 / g

g12 = G4 / g, g13 = G5 / g,

g 23 = G6 / g

(2.22)

As is shown in the cited references, e.g. [2, 7], g jl g kl = δ kj

(2.23)

a = gik a k

(2.24a)

a j = g jk a

(2.24b)

~i

~

©1999 CRC Press LLC

~

~k

a⋅ a × a = a a × a = a a × a = g ~ 2 ~ 3 ~ 2 ~ 3 ~1 ~ 3 ~1 ~ 2

(2.25a)

~1

Writing x1 = ξ, x2 = η, x3 = ζ, and denoting a partial derivative by a variable subscript, one of the expanded forms of g is

(y z

ξ η

)

(

)

(

)

− yη zξ xζ + xη zξ − xξ zη yζ + xξ yη − xη yξ zζ = g

(2.25b)

Using Eq. 2.21, we also have g = G1g11 + G4 g12 + G5 g13 = G2 g22 + G4 g12 + G6 g23

(2.25c)

= G3 g33 + G5 g13 + G6 g23 Other representations of the base vectors are

ai ~

ai ~

g ijk a × a e 2 g ~ j ~k

(2.26a)

g j a × a k eijk 2 ~ ~

(2.26b)

where eijk and eijk are the permutation symbols. In terms of the metric tensor, the unit tensor defined in Eq. 2.7 is ~

I = gij a i a j

(2.27a)

= g ij a a

(2.27b)

= δ ij a a j

(2.27c)

u i = g ik uk

(2.28a)

ui = gik u k

(2.28b)

~ ~

~i ~ j

~i ~

Using Eq. 2.24 in Eq. 2.5, we have

and

2.2.4 Differentiation of the Base Vectors The main aim is to express the partial derivatives of the base vectors in terms of the base vectors. First, from the definition of the covariant base vectors, Eq. 2.3a, it is readily obvious that

∂a

~i j

∂x ©1999 CRC Press LLC

=

∂a

~j i

∂x

(2.29)

Using this result and the simple derivations given in [7] we have the following results: ∂a i ------˜ = [ ij, k ]a k ∂x j ˜ = Γ ijk a k ˜

(2.30a)

(2.30b)

where the abbreviations 1 ∂gik ∂g jk ∂gij + − ∂x i ∂x k ∂x j

(2.31a)

Γijk = g sk [ij, s]

(2.31b)

[ij, k ] = 2 and

are called the Christoffel symbols of the first and second kind, respectively. Note that [ij, k] = [ji, k] and Γ ijk = Γ jik . Eq. 2.30b can also be stated as

∂2 r

~

∂x i ∂x j

= Γijk a

(2.32)

~k

To obtain the partial derivatives of the contravariant base vectors a i , we differentiate Eq. 2.3b with respect ˜ to any coordinate, say xk, and use the previous results to obtain

∂ ai ~

∂x k

i aj = −Γ jk

(2.33)

~

Taking the dot product of Eq. 2.33 with a~ k and using the definition in Eq. 2.3c, we readily get i ∇ 2 x i = − g jk Γ jk

where

∇2 =

∂2 ∂x m∂x m

is the Laplacian operator and xm are the Cartesian coordinates.

2.2.5 Covariant and Intrinsic Derivatives When one takes the partial derivative of a vector in its entity form, i.e.,

∂u ~

∂x k

©1999 CRC Press LLC

=

∂ i u a ∂x k ~ i

(2.34)

and uses Eq. 2.30b, the result is

∂u

= u;ik a

(2.35a)

∂u i i j + Γ jk u ∂x k

(2.35b)

~

∂x k

~i

where u;ik =

is called the covariant derivative of a contravariant component. A semicolon before an index implies covariant differentiation. Similarly,

∂u

~ k

∂x

=

∂ ui a i ∂x k ~

and then on using Eq. 2.33, one gets

∂u

= ui; k a i

(2.36a)

∂ui − Γikj u j ∂u k

(2.36b)

~

∂x k

~

where ui; k =

is called the covariant derivative of a covariant component. The idea of covariant differentiation can be extended to tensors of any order. Refer to [5] and [22] for some explicit formulae for a second-order tensor. In particular it can be shown that the covariant derivatives of the metric tensor components are zero. That is gij ; k = 0, g;ijk = 0 These two equations yield explicit formulae for the partial derivatives of the covariant and contravariant metric components, which are

∂g ij r = Γikr grj + Γ jk gri ∂x k

(2.37a)

∂g ij i rj = − Γrk g − Γrkj g ri ∂x k

(2.37b)

and

Let Grm be the cofactor of grm in the determinant g. Then g

©1999 CRC Press LLC

δ pr

= g pm G rm

and G rm = gg rm Thus

∂g ∂g = gg rm mj ∂x j ∂x

(2.38)

Using Eq. 2.37a in Eq. 2.38, one readily obtains Γrjr =

=

1 ∂g 2 g ∂x j

(2.39a)

∂ ln g ∂x j

(

)

(2.39b)

Using Eqs. 2.3b, 2.30b, and 2.39a in Eq. 2.14, the formula for the divergence of a vector u becomes ˜ div u = ~

1 ∂ g ∂x i

( gu ) i

(2.40)

Similarly, the formulae for the divergence of a tensor can be developed. Let the curvilinear coordinates xi be functions of a single parameter t, i.e., x i = x i (t ), t0 ≤ t ≤ t1 Then u becomes a function of t, i.e., ˜

( ) ~(

)

u x i = u x i (t ) ~

and the total derivative of u with t is ˜ du

d i u a dt ~ i da du i = = a + ui ~ i ~i dt dt ~

dt

=

Using the chain rule of partial differentiation and the definition of the covariant derivative, one obtains du ∂u i dx j = + u;i j a dt ∂t dt ~ i The intrinsic derivative of ui is defined as

δu i ∂u i dx j = + u;i j δt ∂t dt ©1999 CRC Press LLC

(2.41)

and then du ~

dt

=

δu i a δt ~ i

(2.42)

2.2.6 Laplacian of a Scalar Let φ (x1, x2, x3) be a scalar. The Laplacian of φ is defined as ∇ 2φ = div ( gradφ )

(2.43)

∂f From Eq. 2.11d, the components -------i are the covariant components of the vector grad φ. According to ∂x Eq. 2.28a, the contravariant components are g ij

∂φ ∂x i

Thus using Eq. 2.40, ∇ 2φ =

ij ∂φ 1 ∂ gg j g ∂x ∂x i

(2.44)

which is one of the form for the Laplacian. Another form can be obtained by opening the differentiation on right-hand side and using Eqs. 2.37b and 2.39a, or else using Eq. 2.11d in Eq. 2.14 and using the preceding developed formulae. In either case, we get ∂ 2φ ∂φ ∇ 2φ = g ij i j − Γijk k ∂x ∂x ∂x

(2.45a)

or, by using Eq. 2.34, ∇ 2φ = g ij

(

)

∂ 2φ ∂φ + ∇2 x k ∂x i ∂x j ∂x k

(2.45b)

Note that if φ = xr, a curvilinear coordinate, then from Eq. 2.45a, ∇ 2 x r = − g ij Γijr which is Eq. 2.34.

2.3 Theory of Curves Practically all standard texts on differential geometry describe the theory of curves in formal details [1–6]. This section is intended to supplement the textual material in later sections for reference. In E3 using the rectangular Cartesian coordinates xm, m = 1, 2, 3, the position vector at a point on the curve is stated as a function of an arbitrary parameter t as r(t ) = x m (t ) i , t0 ≤ t ≤ t1 ~

©1999 CRC Press LLC

~m

The main assumption here is that at least one derivative, x˙ m =

dx m , m = 1, 2, 3 dt

is different from zero. A simple example of the parametric equation of a curve is that of a straight line, which is r(t ) = a + bt ~

~

~

where a and b are constant vectors with the components of b being proportional to the direction ~ ˜ ˜ cosines of the line. On a curve the arc length from a point P0 of parameter t0 to a point P of parameter t can be obtained by using Eq. 2.17 in Cartesian coordinates. Thus, ds 2 = d r⋅ d r ~

= r˙⋅ r˙( dt )

~

2

(2.46)

~ ~

so that t

˙ s(t ) ∫ r˙⋅ rdt ~ ~

t0

If instead of t one takes the arc length as a parameter, then from Eq. 2.46 t⋅ t = 1

~ ~

(2.47a)

where dr

t=

~

ds

~

(2.47b)

From Eq. 2.47a it is obvious that t ( s ) is a unit vector tangent to the curve. Further, ˜ r˙ = t ~

~

ds dt

(2.47c)

is also a tangent vector. Differentiating Eq. 2.47a, we get

t⋅

dt

~

~

ds

=0

Writing

kˆ = ~

©1999 CRC Press LLC

dt ~

ds

(2.48)

FIGURE 2.1 Right-handed triad t , p, b, of unit vectors at P on a space curve C. OP = osculating plane; NP = normal ˜ ˜ ˜ plane; RP = rectifying plane.

we note that the vectors t and kˆ are orthogonal. The vector kˆ is the curvature vector because it ˜ ˜ ˜ expresses the rate of change of the unit tangent vector as one follows the curve. Now forming the unit vector p = kˆ/ k

(2.49a)

~

~

where k = kˆ

(2.49b)

~

is the curvature of the curve at a point. The unit vector p is called the principal normal vector. The plane containing t and p is called the osculating plane. ˜ ˜ ˜ formed as Another vector b is now ˜ b = t× p ~

~

(2.50)

~

The triad of vectors t , p, b, in this order, form a right-hand system of unit vectors at a point of the ˜ ˜ ˜ curve. Besides the osculating plane the two other planes, termed the normal plane and the rectifying plane, are shown in Figure 2.1. The vector b is called the binormal vector and is associated with the torsion of the space curve. Based ˜ on simple arguments, e.g. [7], we can obtain the famous formulae of Frenet, or of Serret– Frenet, which are dt ~

ds

(2.51a)

kp ~

dp = −k t + τ b

~

ds

~

db ~

ds ©1999 CRC Press LLC

(2.51b)

~

= −τ p ~

(2.51c)

The scalar τ is called the torsion of a curve at a point and it is zero for plane curves. Eqs. 2.51 are fundamental to the theory of curves. In fact, the fundamental theorem for space curves is stated as follows. “If s > 0 is the arc length along a curve and the functions k(s) and τ (s) are singlevalued and prescribed functions of s, then the solution of Eqs. 2.51 yields a space curve which is unique except for its position in space.” For prescribed k(s) and τ (s) Eqs. 2.51 can be solved in analytical forms for some very small number of cases. Eqs. 2.51 form a set of nine scalar equations, and if the initial conditions at some s = s 0 are prescribed for t and p (initial condition for b can then be obtained from ˜ ˜ ˜ the ordinary differential Eq. 2.50), then according to the theory of existence of equations, the set of nine equations can be solved by any standard numerical method, such as the Runge–Kutta method. If k and τ are prescribed in terms of some other parameter t, then the same program can be slightly altered by prescribing ds/dt and replacing k(s) by k(t), etc., in the program.

2.3.1 A Collection of Usable Formulae for Curves The formulae of curvature and torsion in terms of the arc length s for a curve r ( s ) are as follows: ˜ d2 r d3 r k ( s) = 2~ ⋅ 2~ ds ds

1

2

(2.52a)

d r d2 r d3 r τ ( s) = ρ ~ ⋅ 2~ × 3~ ds ds ds 2

(2.52b)

where

ρ(s) =

1 k (s)

is the radius of curvature. If the curve is expressed in terms of a parameter t as r ( t ) , then denoting ˜ differentiation with t by a dot, we have 2 k (t ) = r˙⋅ r˙ r˙˙⋅ ˙˙ r − r˙⋅ ˙˙ r ~ ~ ~ ~ ~ ~

1

τ (t ) = ρ 2 r˙⋅ r˙˙× ˙˙˙ r / r˙× r˙ ~ ~ ~ ~ ~

( )

32

2

/

r˙ ⋅ r˙˙ ~ ~

(2.53a)

3

(2.53b)

Let a space curve be defined as the intersection of the two surfaces f(x, y, z) = 0 and g(x, y, z) = 0. Then the unit tangent vector of the curve is given by [1]

(

t = i J1 + j J 2 + k J3 / J12 + J 22 + J32 ~ ~ ~ ~

)

1

2

where J1 = f y gz − fz g y , J 2 = fz g x − f x gz , J3 = f x g y − f y g x and a variable subscript denotes a partial derivative. ©1999 CRC Press LLC

(2.54)

2.4 Geometrical Elements of the Surface Theory The theory of surfaces embedded in E3 was developed with all its essential aspects in the 19th century. Almost all of the useful concepts and formulae presently used in engineering and applied sciences were developed by Gauss, Monge, Darboux, Beltrami, and Christoffel, just to name a few. For a detailed discussion of the topics discussed in this section, the reader is referred to Refs. [1–3]. In the theory of surfaces embedded in E3 we can either use the rectangular Cartesian coordinates xm or some general coordinates xi. For the sake of generality, let us first use a general system of coordinates xi. A surface is then defined parametrically by the use of two parameters uα = (u1, u2) as

(

)

x i = x i u1 , u 2 , i = 1, 2, 3

(2.55a)

The functions xi defined in Eq. 2.55a are continuously differentiable with respect to the parameters u1 and u2, and the matrix ∂x i α ∂u is of rank two, i.e., at least one square subdeterminant is not zero. From Eq. 2.55a, dx i =

∂x i α du ∂uα

(2.55b)

where the Greek indices assume values 1 and 2. Also, the displacement vector dr , which belongs both ˜ to the surface and the embedding space E3, can be represented either as

dr = ~

∂r

~

∂x i

dx i = a dx i ~i

(2.55c)

or as

dr = ~

∂r

~

∂uα

duα

(2.55d)

The element of length ds 2 = d r⋅ d r ~

~

from Eq. 2.17, or alternatively from Eq. 2.55c by using Eq. 2.55b, can be stated as ds 2 = aαβ duα du β

(2.56)

∂x i ∂x j ∂uα ∂u β

(2.57)

where aαβ = gij

©1999 CRC Press LLC

Obviously aαβ are symmetric. Since the embedding space is Euclidian, one can also use the rectangular Cartesian coordinates xm in place of the curvilinear coordinates xi. In such a case gij = δ ij, and from Eq. 2.57, aαβ =

∂r ∂r ∂x m ∂x m = ~α ⋅ ~β α β ∂u ∂u ∂u ∂u

From here onward we shall return to the previous symbolism and use gαβ in place of aαβ so that gαβ =

∂r

~ α

∂u

⋅

∂r

~

(2.58)

∂u β

and Eq. 2.56 is written as ds 2 = gαβ duα du β

(2.59)

which gives an elemental arc on a surface of parameters/coordinates u1, u2. The metric, Eq. 2.59, for an element of length in the surface is called the “first fundamental form.” For the purpose of having expanded formulae we write x1 = x, x2 = y, x3 = z; u1 = ξ , u2 = η and then from Eq. 2.58: g11 = xξ2 + yξ2 + zξ2

(2.60a)

g12 = xξ xη + yξ yη + zξ zη

(2.60b)

g22 = xη2 + yη2 + zη2

(2.60c)

G3 = g11g22 − ( g12 )

2

(2.60d)

where a variable subscript implies a partial derivative. Further, similar to Eq. 2.23 we have gαβ gαγ = δ βγ

(2.61a)

g11 = g22 / G3 , g12 = g 21 = − g12 / G3 , g 22 = g11 / G3

(2.61b)

so that

The vectors

a = ~α

∂r

~

∂uα

, α = 1, 2

(2.62)

are the covariant surface base vectors and they form a tangent vector field. The angle θ between the coordinate lines ξ = u1 and η = u2 at a point in the surface is obviously given by cosθ = a ⋅ a

~1 ~ 2

/ a~

a

1 ~2

= g12 / g11g22 ©1999 CRC Press LLC

(2.63a)

and 2

= g11g22 sin 2 θ

a ×a ~1

~2

(

= g11g22 1 − cos 2 θ

)

Thus, using Eq. 2.63a, we have 2

a ×a ~1

~2

= g11g22 − ( g12 )

2

(2.63b)

= G3 Coordinates in the surface at a point are orthogonal if g12 = 0 at that point. The surface base vectors in Eq. 2.62 define the unit normal vector n at each point of the surface ˜ through the equation n = a × a / a × a ~ ~ 1 ~ 2 ~1 ~ 2 Thus n= ~

1 a × a G3 ~ 1 ~ 2

(2.64)

The rectangular Cartesian components of n denoted by X, Y, Z are ˜ X = J1 / G3 , Y = J 2 / G3 , Z = J3 / G3

(2.65)

where J1 = yξ zη − yη zξ , J 2 = xη zξ − xξ zη , J3 = xξ yη − xη yξ

2.4.1 The Surface Christoffel Symbols The surface Christoffel symbols can be formed by the same technique as noted in Section 2.2, independent of any other consideration. For clarity in the analysis to follow, we shall denote the surface Christoffel s symbols of the second kind by ϒ ab . The formula is σ Υαβ = gσδ [αβ , δ ]

(2.66)

where 1 ∂gαβ ∂gαβ ∂gαβ − α + ∂uδ ∂u β ∂u

[αβ ,δ ] = 2

(2.67)

and [αβ, δ ] are the surface Christoffel symbols of the first kind. The technique mentioned above can concisely be stated as follows: ©1999 CRC Press LLC

Obviously (similar to Eq. 2.29),

∂a

~α β

∂u

∂a =

~β

∂u α

(2.68a)

Next ∂gαβ a ⋅ a = ~ α ~ β ∂uγ

(2.68b)

∂gαγ ∂ a ⋅a = β ~ ∂u α ~ γ ∂u β

(2.68c)

∂gβγ a~ ⋅ a~ = β γ ∂uα

(2.68d)

∂ ∂uγ

∂ ∂uα

Adding Eq. 2.68c and Eq. 2.68d and subtracting Eq. 2.68b while using Eq. 2.68a, one obtains

∂a

~α

∂u β

θ ⋅ aθ = Υαβ

(2.69)

~

where a q are the contravariant surface base vectors satisfying ˜ aα ⋅ a = δ βα ~

~β

(2.70a)

and aθ = gθα a

~α

~

etc.

(2.70b)

As a caution, one must not hurriedly conclude an equation similar to Eq. 2.30b from Eq. 2.69. It must also be mentioned here that according to Eq. 2.70a, a 1 is orthogonal to a 2 and a 2 is orthogonal to a 1, ˜ ˜ ˜ ˜ but still a 1 and a 2 lie in the tangent plane to the surface. ˜ ˜

2.4.2 Normal Curvature and the Second Fundamental Form A plane containing the unit tangent vector t and the unit surface normal vector n at a point P of the ˜ ˜ surface cuts the surface in different curves when rotated about n as an axis. We refer to Figure 2.2, where ˜ ˆ the vectors t , n, the curvature vector k , and another unit vector e in the tangent plane are shown. ˜ ˜ ˜ ˜ Each curve obtained by rotating the t – n plane is called a normal section of the surface at P. Since ˜ ˜ these curves belong both to the surface and also the embedding space, a study of the curvature properties of these curves also reveals the curvature and torsion properties of the surface itself. We decompose the vector kˆ at P of C, defined by Eq. 2.48, as ˜ kˆ = k + k ~

©1999 CRC Press LLC

~n

~g

(2.71)

FIGURE 2.2 Right-handed triad t , e, n of unit vectors at P on a surface. The vectors p and b are perpendicular to ˜ ˜˜ ˜ ˜ t and lie in the e – n plane.

˜ ˜ ˜ where the vector k n , is normal to the surface, and the vector k g is tangent to the surface as shown in ˜ ˜ Figure 2.2. The vector k is called the normal curvature vector at the point, and it is directed either toward ˜ or against the direction of the surface normal n. Thus ˜ k = n kn ~

(2.72)

~

where kn is the normal curvature of the normal section of the surface, and is an algebraic number. To find a formula for kn we consider the equation n⋅ t = 0 ~ ~

and differentiate it with respect to s, which yields

kn =

− d n⋅ d r ~

(ds)2

~

(2.73)

Next we differentiate n⋅ a = 0 ~ ~β

with respect to uα and have

∂n

~ α

∂u

⋅ a = − n⋅ ~β

~

∂2 r

~

∂uα ∂u β

Further

dn = ~

©1999 CRC Press LLC

∂n ~

∂uα

duα , d r = a du β ~

~β

Eq. 2.73 yields ∂ 2 r duα du β kn = n⋅ α ~ β ~ ∂u ∂u ( ds)2

(2.74)

A set of new coefficients bαβ are now defined as

bαβ = n⋅ ~

=−

=

∂2 r

~

∂uα ∂u β

∂n ~

∂uα

⋅a

~β

∂2 r 1 a ⋅a × α ~ β G3 ~ 1 ~ 2 ∂u ∂u

(2.75a)

(2.75b)

(2.75c)

Thus Eq. 2.74, beside having the form given in Eq. 2.73, can also be stated as

kn =

=

bαβ duα du β

(ds)2

bαβ duα du β gµν du µ duν

(2.76a)

(2.76b)

It is easy to see from Eq. 2.76a that k d r + d n ⋅ d r = 0 n ~ ~ ~ But dr is arbitrary, so that ˜ kn d r + d n = 0 ~

~

(2.77)

which is due to Rodrigues [1]. The form bαβ duα du β is called the “second fundamental form,” and bαβ the coefficients of the second fundamental form. In expanded form, writing ξ = u1, η = u2, we have

©1999 CRC Press LLC

b11 = Xxξξ + Yyξξ + Zzξξ b12 = Xxξη + Yyξη + Zzξη = b21 b22 = Xxηη + Yyηη + Zzηη b = b11b22 − (b12 )

2

(2.78a) (2.78b) (2.78c) (2.78d)

Returning to the consideration of kn we note that from Eqs. 2.71 and 2.72 n⋅ kˆ = kn ~ ~

which on using Eq. 2.51a gives kk = k cos φ

(2.79)

where p⋅ n = cos φ ~ ~

and k is the curvature of the curve C. Introducing the radius of curvatures

ρ = 1 / k , ρ n = 1 / kn we get from Eq. 2.79

ρ = ρ n cos φ

(2.80)

which is due to Meusnier [1].

2.4.3 Principal Normal Curvatures Let us introduce the directions l=

dξ dη ,m= ds ds

then Eq. 2.76a takes the form kn = b11l 2 + 2b12 lm + b22 m 2 If only the direction

λ=

©1999 CRC Press LLC

dη dξ

(2.81)

is introduced, then

kn =

b11 + 2λb12 + λ2 b22 g11 + 2λg12 + λ2 g22

(2.82)

With the coefficients gαβ and bαβ as constants at a point, the quantity kn is a function of λ . The extremum values of kn are obtained by dkn =0 dλ and the roots of this equation determine those directions for which the normal curvatures kn assumes extreme values. These extreme values are called the principal normal curvatures at P of the surface, which we shall denote by kI and kII. The corresponding directions λ are called the principal directions. Following the details given in [2], we obtain the following important equations for the sum and product of the principal curvatures: k I + k II = bαβ gαβ k I k II =

b G3

(2.83)

(2.84)

where G3 and b have been defined in Eqs. 2.60d and 2.78d, respectively. Here a few definitions are in order.

(i) Lines of curvature: The line of curvature is a curve in a surface whose curvature at any point is either kI or kII. The tangent to the line of curvature falls in the principal direction. The equations for the determination of the lines of curvature are obtained by differentiating Eq. 2.82 with respect to λ and setting the result equal to zero. Thus 2

dη dη +C =0 A + B dξ dξ

(2.85)

where A = b22 g12 − b12 g22 B = b22 g11 − b11g22 C = b12 g11 − b11g12 Note that Eq. 2.85 is equivalent to two first-order ordinary differential equations, and their solutions define two families of curves in a surface which are the lines of curvature. Further, these curves are orthogonal. It is obvious from Eq. 2.85 that if A = 0, then dξ = 0, and if C = 0 then dη = 0. Thus the curves ξ = const. and η = const. are the lines of curvature if A = 0 and C = 0. In an actual computation if the coefficients of the first and second fundamental forms are known throughout the surface as functions of ξ and η, and further the initial point ξ0, η0 is prescribed, then ©1999 CRC Press LLC

the curves of curvature can be obtained by a numerical method, e.g., the Runge–Kutta method. If the curves ξ and η are themselves the curves of curvature, then as discussed above in these coordinates g12 = 0 and b12 = 0, and from Eq. 2.82, 2

dη dξ kn = b11 + b22 ds ds

2

(2.86)

a formula due to Euler. The normal curvatures are then kl =

b11 for η = const. (ξ − curve) g11

kll =

b22 for ξ = const. (η − curve) g22

(ii) Asymptotic directions: Points on a surface where kn = 0 give two directions, which from Eq. 2.82 are dη − b12 ± = dξ

(b12 )

2

− b11b22

b22

(iii) Results for a surface of the form z = f(x, y): When the equation of a surface is given in the form z = f (x, y), then it is convenient to take x = ξ , y = η, z = f (ξ , η) Then r = i ξ + j η + k f (ξ, η) ~

~

~

~

a = i + k fx ~1

~

~

a = j + k fy ~2

~

~

g11 = 1 + f x2 , g12 = f x f y , g22 = 1 + f2y G3 = 1 + f x2 + f y2 n = − i f x − j f y + k G3 ~ ~ ~ ~ dA = G3 dxdy, element of area b11 = f xx / G3 , b12 = f xy / G3 , b 22 = f yy / G3 As an example, for a monkey saddle z = y 3 − 3 yx 2 for which all the geometrical elements can be computed from Eq. 2.87. ©1999 CRC Press LLC

(2.87)

(iv) Results for a body of revolution: Let a curve z = f(x) in the plane y = 0 be rotated about the z-axis. The surface of revolution so generated has the parametric representation x = ξ cos η, y = ξ sin η, z = f (ξ ) df where ξ > 0 and ------ = f ′ is bounded. For this case, dx a = i cos η + j sin η + k f ′ ~i

~

~

a = ξ − i sin η + j cos η ~2 ~ ~

(

g11 = 1 + f ′ 2 , g12 = 0, g22 = ξ 2 , G3 = ξ 2 1 + f 2 n= ~

b11 =

)

, i f ′ cos η + j f ′ sin η − k ~ ~ 1+ f ′ 1

2

f ′f ′′ 1+ f ′

2

, b12 = 0, b22 =

ξf ′ 1 + f ′2

Also referring to Eq. 2.93, 1 Υ11 =

f ′′ 1 ξ 1 2 , Υ22 = , Υ12 = ξ 1+ f 2 1+ f 2

and all other Christoffel symbols are zero. As a particular case, for a cone

ξ = r sin α , f (ξ )r cos α where r is the radial distance from the origin (apex of the cone) to a point on the cone’s surface, and α is the angle made by r with the z-axis. Then x = r sin α cos η, y = r sin ∂ cos η, z = r cos α which yields the equation of a cone: x 2 + y 2 = z 2 tan 2 α

2.4.4 Mean and Gaussian Curvatures The mean curvature Km of a surface at a point is defined as km =

1

2

(k I + k II )

(2.88a)

while the Gaussian or total curvature at a point is defined as K = k I k II ©1999 CRC Press LLC

(2.88b)

Surfaces for which Km = 0 are called “minimal” surfaces, while surfaces for which K = 0 are called developable surfaces. The manner in which kI and kII have been obtained and the Gaussian curvature K has been formed suggests that K is an extrinsic property. In fact, K is an intrinsic property of a surface, that is, it depends only on the first fundamental form and on the derivatives of its coefficients [1, 2, 7].

2.4.5 Derivatives of the Surface Normal; Formulae of Weingarten From the simple identity n⋅ n = 1 ~ ~

one obtains by differentiation the following two equations:

n⋅ ~

∂n

= 0, α = 1, 2

~

∂uα

∂n These two equations suggest that -------˜ , α = 1, 2, lie in the tangent plane to the surface. Thus ∂u a

∂n ~

∂u1 ∂n ~

∂u 2

= Pa + Qa ~1

~2

= Ra + S a ~1

~2

To find the coefficients P, Q, R, S, we differentiate n ⋅ a 1 = 0 with respect to the u2 and n ⋅ a 2 = 0 with ˜ ˜ ˜ ˜ respect to u1. The solution of the four scalar equations yields [7],

∂n ~

∂uα

= − bαβ g βγ a , α = 1, 2 ~γ

(2.89)

Eq. 2.89 were obtained by Weingarten [2, 7], and provide the formulae for the partial derivatives of the surface normal vector with respect to the surface coordinates.

2.4.6 Formulae of Gauss In E3 the vectors a 1 , a 2 , n form a system of independent vectors. It should therefore be possible to ˜ ˜ ˜ express the first partial derivatives of a base vector in terms of the base vectors themselves. Based on the preceding developments, the logical outcome is to have

∂a

~α β

∂u

=

∂2 r

~

∂uα ∂u β

=Υ

γ

αβ

(2.90)

a + n bαβ ~γ

~

As a check we note that the dot products of Eq. 2.90 with aq and n yield Eqs. 2.69 and 2.75a, respectively. ˜ ˜ Eq. 2.90 provides the formulae of Gauss for the second derivatives ∂ 2 r ⁄ ∂u a ∂u b . ˜ The coefficients of the second fundamental form bαβ for a surface have already been defined in Eq. 2.75a. One can obtain a new formula for them by considering the Gauss’ formulae, Eq. 2.90, and the space Christoffel symbols as stated in Eq. 2.32. In E3 consider a surface defined by x3 = const., and let x1 = u1 and x2 = u2. Then from Eq. 2.32, ©1999 CRC Press LLC

∂2 r

~

∂uα ∂u β

= Γ 1αβ a + Γ 2αβ a Γ 3αβ a ; x 3 = const ~1

~2

~3

Since both a 1 and a 2 have been evaluated at x3 = const., taking the dot product with the unit surface ˜ ˜ normal vector n, one gets ˜

∂2 r

n⋅

~

∂uα ∂u β

~

3 = Γαβ n⋅ a ~ ~ 3

Writing n⋅ a = λ

(2.91a)

(

(2.91b)

~ ~3

and comparing with Eq. 2.90, one obtains 3 bαβ = λΓαβ

)

x 3 = const .

which can also be used to find the coefficients bαβ , [16]. Thus the formulae of Gauss can also be stated as

∂2 r

~

∂uα ∂u β

(

3 ν = Υαβ a + n Γαβ λ ~γ

~

)

x 3 = const .

(2.92)

From Eq. 2.66, the expanded form of the surface Christoffel symbols for the surface x3 = const. and with u1 = ξ , u2 = η are as follows: ∂g ∂g ∂g 1 = g22 11 + g12 11 − 2 12 / 2G3 Υ11 ∂ξ ∂ξ ∂η ∂g ∂g ∂g 2 = g11 22 + g12 22 − 2 12 / 2G3 Υ22 ∂η ∂ξ ∂η ∂g ∂g ∂g 1 = g22 2 12 − 22 − g12 22 / 2G3 Υ22 ∂ξ ∂η ∂η ∂g ∂g ∂g 2 Υ11 = g11 2 12 − 11 − g12 11 / 2G3 ∂η ∂ξ ∂ξ ∂g ∂g 1 2 = Υ21 = g22 11 − g12 22 / 2G3 Υ12 ∂η ∂ξ ∂g ∂g 2 2 = Υ21 = g11 22 − g12 11 / 2G3 Υ12 ∂ξ ∂η 1 2 Υ11 + Υ12 =

1 ∂G3 2G3 ∂ξ

1 2 Υ12 + Υ22 =

1 ∂G3 2G3 ∂η

G3 = g11g22 − ( g12 )

©1999 CRC Press LLC

2

(2.93)

2.4.7 Gauss–Codazzi Equations Consider the identity ∂2 r ∂ ∂ ~ = β γ β α ∂u ∂u ∂u ∂u

∂2 r ~ ∂uα ∂u β

for any choice of α, β , and γ. Using Eq. 2.90 and then Eq. 2.89, one obtains

(

)

Rµαγβ − bαβ bλµ − bαγ bβµ = 0

(2.94)

and

∂bαβ ∂uγ

−

∂bαγ ∂u

β

λ λ + Υαβ bδγ − Υαγ bβλ = 0

(2.95)

where Rµαγβ is the two-dimensional Riemann curvature tensor, given as δ δ ∂Υαβ ∂Υαγ σ δ λ δ Rµαγβ = gµδ − + − Υ Υ Υ Υ ασ αγ αβ βλ αuγ αu β

(2.96)

Eq. 2.94 is called the equation of Gauss and is exhibited here in tensor form. In two dimensions, only four components are non-zero. That is R1212 = R2121 = b and R2112 = R1221 = − b where b = b11b22 − (b12 )

2

The Gaussian curvature K is given by K = R1212 / G3

(2.97)

On the other hand, Eq. 2.95 yields two equations: one for α = 1, β = 1, γ = 2 and the other for α = 2, β = 2, γ = 1. The resulting two equations are called the Codazzi or Codazzi–Mainardi equations.

2.4.8 Second-Order Differential Operator of Beltrami First of all, it is of interest to note that Eqs. 2.35b and 2.36b for the covariant derivative and Eqs. 2.37a, 2.37b and 2.39 are all valid in any space including E3, and are equally applicable to a surface that is

©1999 CRC Press LLC

nothing but a two-dimensional non-Euclidean space. Thus the above-noted formulae for a surface are as follows:

∂uα α γ + Υγβ u ∂u β ∂u γ gγ = αβ + Υαβ ∂u

uβα = uα , β

∂gαβ

α δ δα = − Υδγ g δβ − Υβγ g

∂u γ ∂gαβ

(2.98) =

∂u γ

δ Υδβ =

α − Υδγ

g

δβ

−

1 ∂G3 2G3 ∂u β

∂ 1n G3 ∂u β

(

=

Υδγβ gδα

)

The second-order differential operator of Beltrami when applied to a function φ yields [2]

∆ 2φ =

∂ 1 αβ ∂φ G3 g G3 ∂uα ∂u β

(2.99)

Suppose φ = uδ, a surface coordinate, then ∆ 2 uδ =

1 ∂ G3 ∂uα

(

G3 gαδ

)

(2.100)

Using the formulae given in Eq. 2.98, we get δ αβ ∆ 2 uδ = − Υαβ g

(2.101a)

Note the exact similarity between Eqs. 2.44 and 2.100, and between Eqs. 2.34 and 2.101a. Using the formulae given in Eqs. 2.98, Eq. 2.99 becomes ∂ 2φ γ ∂φ ∆ 2φ = gαβ α β − Υαβ ∂uγ ∂u ∂u

(2.101b)

or, by using Eq. 2.101a,

∆ 2φ = g αβ

©1999 CRC Press LLC

(

)

∂ 2φ ∂φ + ∆ 2 uδ β α ∂uδ ∂u ∂u

(2.101c)

2.4.9 Geodesic Curves in a Surface The geodesic curves in a surface are defined in two ways [1]: (i) Geodesics are curves in a surface that have zero geodesic curvature. (ii) Geodesic curves are lines of shortest distance between points on a surface. In the first definition, we must first obtain the formula for the geodesic curvature. Referring to Eq. 2.71 and Figure 2.2, we write the curvature vector of a curve C as kˆ = n kn + e kg ~

~

(2.102)

~

where the unit vector e~ lies in the tangent plane to the surface. Refer to Figure 2.2. Note that e = n× t ~

~

~

and kg = e⋅ kˆ ~ ~

= e⋅ ~

dt ~

ds

dt = n× t ⋅ ~ ~ ~ ds dt = t× ~ ⋅ n ~ ds ~

(2.103a)

Further dt ~

ds

=

∂a

~α β

∂u

duα du β d 2 uα +a 2 ~ α ds ds ds

(2.103b)

Using the formulae of Gauss, Eq. 2.90, in Eq. 2.103b, putting the result in Eq. 2.103a, and writing u1 = ξ , u2 = η, we get after some simplification 3

(

)

2

3 2 dξ 1 dη 2 1 dξ dη kg / G3 Υ11 − Υ22 + 2 Υ12 − Υ11 ds ds ds ds

−

(

1 2 Υ12

−

2 Υ22

)

2 2 2 d η dξ + d ξ d η − d η d ξ ds ds ds ds 2 ds ds 2

(2.104)

Eq. 2.104 is the formula for the geodesic curvature of a curve C in the surface with reference to the surface coordinates ξ, η. Here s is the arc length along the curve C. From Eq. 2.104, the geodesic curvature of the coordinate curve η or ξ = const. is

(kg )ξ = const. = − ©1999 CRC Press LLC

32 1 G3 Υ22 / g22

(2.105a)

and the geodesic curvature of the coordinate curve ξ or η = const. is

(kg )η = const. =

32 2 G3 Υ11 / g11

(2.105b)

1 2 Obviously if the η-curve is a geodesic then ϒ 22 = 0, while if the ξ-curve is a geodesic then ϒ 11 = 0. The differential equation for the geodesic curve is obtained from Eq. 2.104 by putting kg = 0. For brevity, writing

ξ′ =

dξ dη , η′ = ds ds

and using

ξ ′η ′′ − η ′ξ ′′ = ξ ′ 2

d η′ 2 d dη = ξ′ ds ξ ′ ds dξ

we get 3

2

d 2η 1 dη 1 2 dη 2 1 dη 2 − Υ22 + Υ11 =0 − 2 Υ12 − Υ22 + 2 Υ12 − Υ11 2 dξ dξ dξ dξ

(

)

(

)

(2.106)

By solving Eq. 2.106 under the initial conditions dη η(ξ0 ), ( po int ); and , ( direction) dξ ξ = ξ 0

a unique geodesic can be obtained. According to [3], a geodesic can be found to pass through any given point and have any given direction at that point. If the Christoffel symbols are known for all points of a surface in terms of the surface coordinates ξ, η, then a numerical method, e.g., the Runge–Kutta method, can be used to solve Eq. 2.106. In E3 a straight line is the shortest distance between two points. A generalization of this concept to Riemannian or non-Euclidean spaces can be accomplished by using the integral of Eq. 2.46 and applying the Euler–Langrange equations. The end result (refer to [2]) is that the intrinsic derivative (Eq. 2.41) applied to the contravariant components of the unit tangent vector t with the parameter t replaced by ˜ the arc length s is zero. That is,

δ duγ =0 δs ds which yields α

γ β d 2u α du du + Υβλ = 0, α = 1, 2 2 ds ds ds

©1999 CRC Press LLC

(2.107)

The two second-order ordinary differential equations from Eq. 2.107 can be solved simultaneously to yield the geodesic curves u1 = u1(s), u2 = u2(s) by specifying the initial conditions. Alternatively, writing u1 = ξ, u2 = η and dη dη ds η ′ = ⋅ = dξ ds dξ ξ ′ d 2η η ′′ ξ ′′η ′ = − 3 dξ 2 ξ ′ 2 ξ′ and using the two equations from Eq. 2.107, one obtains Eq. 2.106.

2.4.10 Geodesic Torsion The torsion of the geodesic of a surface is called the geodesic torsion and is denoted by τg. Before we proceed further, it is important to note that the basic triads of vectors for space curves is ( t , p, b ) and ˜ ˜ for the surface curves is ( t , e, n ). It can be proved (refer to [2]) that for a surface geodesic˜ the unit ˜ ˜ ˜ normal n to a surface at a point is equal to the principal normal p of the surface geodesic at the same ˜ ˜ point, i.e., p = n . Thus from Eq. 2.50, ˜ ˜ b = t× n ~

~

~

and from Eq. 2.51c, db ~

ds

= −τ g n ~

Thus dt ~

ds

× n+ t × ~

~

dn ~

ds

= −τ g n ~

The first term is zero, since kˆ is parallel to n , and we obtain ˜ ˜ dn τ g = n ~ × t ~ ds ~

(2.108)

To establish a relation between the torsion τ of a curve C lying on a surface and the torsion of the geodesic τg which touches C at the point P, we consider Eq. 2.102 and write it as k p = n kn + e k g ~

~

~

where k is the curvature of the curve C and kg is the geodesic (tangential) curvature of the surface at P. Further, using the relation kg = k sin φ

©1999 CRC Press LLC

from Figure 2.2 and Eq. 2.79, we get p = n cos φ + e sin φ ~

~

(2.109)

~

On differentiating Eq. 2.109 with respect to s, using Eq. 2.51b, and taking the dot product with n, we ˜ obtain de dφ τ b⋅ n = n⋅ ~ sin φ − sin φ ~ ~ ~ ds ds Differentiating e = n× t ~

~

~

using b ⋅ n = sinφ ≠ 0, and Eq. 2.108, we get ˜ ˜

τg = τ +

dφ ds

(2.110)

2.5 Elliptic Equations for Grid Generation In this section we shall develop the elliptic equations for grid generation, or numerical coordinate mapping, in both the Euclidean and non-Euclidean spaces. The mathematical apparatus to achieve this aim has already been developed in Sections 2.2 through 2.4. In this regard the following two important points should be noted. (i) Depending on the number of space dimensions, one has to choose a set of “grid or coordinate generators,” which form a sort of constraints on the variables of computational or logical space. (ii) The resulting grid generation equations should be obtained in a form in which the computational space variables appear as the independent variables rather than the dependent variables.

2.5.1 Elliptic Grid Equations in Flat Spaces First by setting φ = r in Eq. 2.45a and noting that r = i m x m so that its Laplacian is zero, we have ˜ ˜ ˜ ∂2 r ∂r g ij i ~ j − Γijk ~k = 0 ∂x ∂x ∂x Using Eq. 2.34, we get

g ij

∂2 r

~

∂x ∂x i

j

(

+ ∇2 x k

∂r

) ∂x

~ k

=0

(2.111)

If we now take the grid generators as a set of Poisson equations, i.e., ∇2 x k = Pk

©1999 CRC Press LLC

(2.112)

where Pk are arbitrary functions of the coordinates xi, then from the identity shown as Eq. 2.111 a deterministic set of equations is obtained, which is

Dr + gP k ~

∂r

=0

~

∂x k

(2.113)

where D is a second-order differential operator defined as

D = gg ij

∂2 ∂x i ∂x j

Writing r = i m x m , where xm(x1, x2, x3) with m = 1, 2, 3, one can readily write three coupled quasilinear ˜ ˜ partial differential equations for x1, x2, x3 from Eq. 2.113. Writing x1 = ξ , x2 = η, x3 = ζ, denoting a partial derivative by a variable subscript, and using Eq. 2.22, the operator D is written as D = G1∂ ξξ + G2∂ ηη + G3∂ζζ + 2G4∂ ξη + 2G5∂ ξζ + 2G6∂ ηζ

(2.114a)

In two dimensions there is no dependence on z and g33 = 1, so that D = g22∂ ξξ − 2 g12∂ ξη + g11∂ ηη

(2.114b)

and the two equations for x1 = x, x2 = y, from Eq. 2.113 are

(

)

g22 xξξ − 2 g12 xξη + g11 yηη + g P1 xξ + P 2 xη = 0

(

)

g22 yξξ − 2 g12 yξη + g11 yηη + g P1 yξ + P 2 yη = 0

(2.115a)

(2.115b)

A more general choice for Pk is to take it as [15–17] P k = g ij Pijk

(2.116)

where Pkij = Pkji are arbitrary functions. As an example, with this choice the P1 and P2 appearing in Eqs. 2.115 become

(

k P k = g22 P11k − 2 g12 P12k + g11 P22

Note that the g appearing in Eqs. 2.115 and 2.117 is g = g11g12 − ( g12 ) With the choice of Eq. 2.116, Eq. 2.113 becomes

©1999 CRC Press LLC

2

) / g, k = 1, 2

(2.117)

Dr + gg ij Pijk ~

∂r

~

∂x k

=0

(2.118)

Either Eq. 2.113 or Eq. 2.118 forms the basic coordinate generation equations of the elliptic type in Euclidean spaces. For engineering and applied sciences, usually the Euclidean spaces of two (E2) or three (E3) dimensions are needed. In all cases these equations are quasilinear and are solved numerically under the Dirichlet or mixed Dirichlet and Neumann boundary conditions. Note that both Eqs. 2.113 and 2.118 are elliptic partial differential equations in which the independent variables are xi or ξ, η, ζ, and the dependent variables are the rectangular Cartesian coordinates r = ( x m ) = ( x, y, z ) . ˜ 2.5.1.1 Coordinate Transformation Let x i be another coordinate system such that

(

)

x i = f i x 1 , x 2 , x 3 , i = 1, 2, 3 A transformation from one coordinate system to another is said to be admissible if the transformation Jacobian J ≠ 0, where ∂x i J = det j ∂x

(2.119a)

Under the condition J ≠ 0, the inverse transformation

(

x i = φ i x 1, x 2 , x 3

)

exists and ∂x i J = det j ∂x

(2.119b)

where J ≠ 0. The theory of coordinate transformation plays two key roles in grid generation. First, if the coordinates x i are considered, then Eq. 2.118 takes the form

D r + gg ij Pijk ~

∂r

~

∂x k

=0

(2.120)

How are the control system function Pkij and P ijk related? An answer to this question may provide a significant advancement towards the problem of adaptivity. For details on the relationships between Pkij and P ijk refer to [15] and [23]. Second, the consideration of coordinate transformation leads one to the generating equations in which the dependent variables are not the rectangular Cartesian coordinates. For example, in some problems the dependent variables may be cylindrical coordinates. Before proceeding on the second topic it will be helpful to summarize some basic transformation formulae. Refer to [2, 7], etc.,

©1999 CRC Press LLC

Γknp = Γijs

g pn = g ij

∂x p ∂x n ∂x i ∂x j

(2.121a)

g pn = gij

∂x i ∂x j ∂x p ∂x n

(2.121b)

∂x p ∂x i ∂x j ∂ 2 x j ∂x p + k n s n k ∂x ∂x ∂x ∂x ∂x ∂x j

(2.121c)

p r t ∂2x p s ∂x p ∂x ∂x = Γ − Γ rt kn ∂x s ∂x k ∂x n ∂x k ∂x n

(2.121d)

Using Eq. 2.121c in Eq. 2.121d, we get

∂2x p ∂ 2 x j ∂x p ∂x r ∂x t = − ∂x r ∂x t ∂x j ∂x k ∂x n ∂x k ∂x n

(2.121e)

∂ 2xs ∂ 2 x p ∂x s ∂x k ∂x r =− k r m n ∂x ∂x ∂x ∂x ∂x p ∂x m ∂x n

(2.121f)

Inner multiplication yields

Eq. 2.121e, 2.121f provide the formulae for the second derivatives. The first partial derivatives of xi with respect to x j are given by i ∂x i C j = J ∂x j

C ij =

∂x r ∂x k ∂x r ∂x k − ∂x s ∂x n ∂x n ∂x s

(2.121g)

(2.121h)

where (i, s, n) and (j, r, k) are cyclic permutations of (1, 2, 3), and J is defined by Eq. 2.119a. According to Eq. 2.34 the Laplacian of the coordinates x s is ∇ 2 x s = − g ij Γijs

(2.122)

and ∇ 2 x k = − g ij Γijs = g ij Pijk = P k

(2.123)

Thus writing φ = x s in Eq. 2.45b and using Eqs. 2.122 and 2.123, we get g ij =

©1999 CRC Press LLC

∂2xs ∂x s + P k k = g ij Γijs i j ∂x ∂x ∂x

(2.124)

Writing g ij = g mn

∂x i ∂x j ∂x m ∂x n

in Eq. 2.124 and using Eq. 2.121g, we get Cmi Cnj g mn

∂2xs ∂x s + J 2 P k k = − J 2 g ij Γijs i j ∂x ∂x ∂x

(2.125)

For prescribed functions Pk, the set of Eq. 2.125 generates the x s coordinates as functions of xi coordinates. Here x s can be either rectangular Cartesian or any other coordinate system, e.g., cylindrical. Note that if x s are rectangular Cartesian coordinates, then

Cmi Cnj g mn =

3

∑ Cmi Cmj

m =1

and Γijs = 0 so that Eq. 2.125 becomes Eq. 2.113. 2.5.1.2 Non-Steady Coordinates There are many situations in which the curvilinear coordinates are changing with time. This occurs mostly in problems where the coordinates move in an attempt to produce an adaptive solution. For a review of the time-dependent coordinates the reader is referred to [22]. For our present purposes we consider one possible grid generator to obtain time-dependent coordinates. Basically a time-dependent coordinate system xi is stated as x i = x i r, t , i = 1, 2, 3 ~

(2.126a)

τ =t

(2.126b)

and its inverse as

( )

r = r x i ,τ

(2.127a)

t =τ

(2.127b)

~

~

From [22], we have the result

∂r

~

∂τ

©1999 CRC Press LLC

=−

∂ r ∂x k ~ ∂x k ∂t

(2.128)

Suppose for time-dependent coordinates we change the grid generator, Eq. 2.113, to the form ∇2 x k = Pk + φ

∂x k ∂t

(2.129)

where φ = φ(xk). One may choose φ = c/g, or, φ = c, where c is a constant. Substitution of Eq. 2.129 in Eq. 2.111 with φ = c and using Eq. 2.128 yields ∂r g

~

∂σ

= Dr + gP k ~

∂r

~

∂x k

(2.130)

where σ = τ /c and the operator D is same as used in Eq. 2.113. Eq. 2.130 is parabolic in σ and may be used to proceed in stepwise fashion from some initial time. It must, however, be noted that the success of the grid generator, Eq. 2.129, depends upon a proper choice of the control functions Pk or Pkij if the form of Eq. 2.116 is used. The proper choice of the control functions depends on the physical problem. Much work in this area remains to be done. 2.5.1.3 Nonelliptic Grid Generation Besides the elliptic grid generation methodology as discussed in the preceding subsections, which gives the smoothest grid lines, many authors have used the parabolic and hyperbolic equation methodologies. In the hyperbolic grid generation as developed in [24] the grid generators are formed of the following three equations: g13 = 0, g23 = 0,

g = ∆V

(2.131)

where ∆V is a prescribed cell volume. One may take a certain distribution of x1 and x2 at the surface x3 = const. and march along the x3 direction. Efficient numerical schemes can be used if Eq. 2.131 are combined as a set of simultaneous first-order equations. It must, however, be noted that Eqs. 2.131 are not invariant to a coordinate transformation.

2.5.2 Elliptic Grid Equations in Curved Surfaces The basic formulation of the elliptic grid generation equations for a curved surface, forming a twodimensional Riemannian space, is available in [15–18], and [25]. Here we summarize the salient features of the equations with the intent of establishing the fact that the proposed equations are not the result of any sort of simplifying assumptions. (In this regard, readers are referred to [26].) Further, every coordinate system in a surface must satisfy the proposed equations irrespective of the method used to obtain them. We consider a curved surface embedded in E3 and use the formulae of Gauss as given in Equation 2.90. Inner multiplication of Equation 2.90 by gαβ while using Eqs. 2.83 and 2.101a results in having

g

αβ

∂2 r α

~

∂u ∂u

β

(

+ ∆ 2 uδ

∂r

) ∂u

~ δ

= n( k I + k II )

(2.132)

~

From Eq. 2.101c we note that by setting φ = r , the left-hand side of Eq. 2.132 can be written as ∆2 r . Thus ˜ ˜ ∆ 2 r = n( k I + k II ) ~

~

(2.133)

where in both Eqs. 2.132 and 2.133 n is the surface unit normal vector. Also by using Eq. 2.99 we have ˜ ©1999 CRC Press LLC

∇2 r = ~

1 ∂ G3 ∂uα

∂r αβ ~ G3 g β ∂ u

(2.134)

We will return to Eqs. 2.133 and 2.134 subsequently. First, in Eq. 2.132 writing x1 = ξ , x2 = η , and 1 ∆ 2ξ = − gαβ Υαβ =P

(2.135a)

2 ∆ 2η = − gαβ Υαβ =Q

(2.135b)

while using the operator D defined as ∂2

D = G3 gαβ

∂uα ∂u β = g22 ∂ξξ − 2 g12 ∂ξη + g11∂ηη

(2.136)

we get Dr + G3 P r + Qr = n R ~ ~η ~ ~ξ

(2.137)

R = G3 ( k I + k II ) = g22 b11 − 2 g12 b12 + g11b22

(2.138)

where

Eq. 2.137 is a deterministic equation for grid generation if the control functions P and Q, which are the Beltramians of ξ and η, respectively, given in Eq. 2.135, are prescribed. The three scalar equations from Eq. 2.137 are

(

)

(2.139a)

(

)

(2.139b)

(

)

(2.139c)

Dx + G3 Pxξ + Qxη = XR Dy + G3 Pyξ + Qyη = YR Dz + G3 Pzξ + Qzη = ZR

where n = (X, Y, Z). ˜ For prescribed P and Q, which may be chosen as zero, the set of elliptic equations stated in Eq. 2.139 form a model for surface coordinate generation. Looking back we note that the basis of these equations are the formulae of Gauss. To check whether the same equations can be obtained by using the formulae of Weingarten stated in Eq. 2.89 we proceed from Eq. 2.134. First we use the easily verifiable identity gαβ a = ε αδ a × n ~β

©1999 CRC Press LLC

~δ

~

in Eq. 2.134. Here

ε 11 = 0, ε 12 = 1 G3 , ε 21 = −1 G3 , ε 22 = 0 and as before

a = ~β

∂r

~

∂u β

etc.

Thus

∆2 r = ~

∂ 1 G3 ε εδ a × n α ~ δ ~ G3 ∂u

Opening the differentiation and using Eq. 2.89 along with the definition of given in Eq.2. 64, we obtain ∆ 2 r = n bαβ gαβ ~

~

= n( k I + k II ) ~

which is precisely Eq. 2.133 or Eq. 2.132. From this analysis we conclude that the proposed set of equations, i.e., Eq. 2.132, satisfies both the formulae of Gauss and Weingarten. In summary, we may state the following: (i) The solution of the proposed equations automatically satisfies the formulae of Gauss and Weingarten. (ii) When the curved surface degenerates to a plane z = const., then the proposed equations reduce to the elliptic coordinate generation equation given as Eq. 2.115. In this situation the Beltrami operator reduces to the Laplace operator, i.e., ∆ 2ξ = ∇ 2ξ, ∆ 2η = ∇ 2η, The key term in the solution of Eq. 2.139 is the term kI + kII appearing on the right-hand side. For a given surface if this term can be expressed as a function of x, y, z, then there is no difficulty in solving the system of equations. Suppose the equation of the surface is given as F(x, y, z) = 0, then from [17],

(

)(

k I + k II [ Fy2 + Fz2 2 Fx Fz Fxz − Fz2 Fxx − Fx2 Fzz

(

)

+ 2 Fx Fy Fz2 Fxy + Fx Fy Fzz − Fy Fz Fxz − Fx Fz Fyz

(

)(

+ Fx2 + Fz2 2 Fy Fz Fyz − Fz2 Fyy − Fy2 Fzz where P 2 = Fx2 + Fy2 + Fz2

©1999 CRC Press LLC

)

)]/ P3 Fz2 , Fz ≠ 0

(2.140)

FIGURE 2.3

FIGURE 2.4

A demonstrative example of the solution of Eq. 2.137 for a hyperbolic paraboloidal shell.

Transformation from the physical space (a) to the parametric space (b) to the logical space (c).

If Fz = 0, then a cyclic interchange of the subscripts will yield a formula in which Fz does not appear in the denominator. Thus we see that the whole problem of coordinate generation in a surface through Eq. 2.139 depends on the availability of the surface equation F(x, y, z) = 0. Numerical solutions of Eq. 2.139 have been carried out for various body shapes, including the fuselage of an airplane [25]. Here the function F(x, y, z) = 0 was obtained by a least square fit on the available data. As an example, Figure 2.3 shows the distribution of coordinate curves on a hyperbolic paraboloidal shell. To alleviate the problem of fitting the function F(x, y, z) = 0, another set of equations can be obtained from Eq. 2.139. The basic philosophy here is to introduce an intermediate transformation (u,v) between E3 and (ξ,η ), as shown in Figure 2.4. Let u and v be the parametric curves in a surface in which the curvilinear coordinates ξ and η are to be generated. Introducing g11 = r ⋅ r , g12 = r ⋅ r , g22 = r ⋅ r ~u ~u

~u ~v

~v ~v

G3 = g11g22 − ( g12 ) , J3 = uξ vη − uη vξ 2

then from the expressions such as r = r uξ + r vξ , r = r uη + r vη ~ξ

~u

~v

~η

~u

~v

and simple algebraic manipulations, Eq. 2.137 yields the following two equations.

(

)

auξξ − 2buξη + cuηη + J32 Puξ + Quη = J32 ∆ 2 u

©1999 CRC Press LLC

(2.141a)

(

)

avξξ − 2bvξη + cvηη + J32 Pvξ + Qvη = J32 ∆ 2 v

(2.141b)

where a = g22 / G3 , b = g12 / G3 , c = g11 / G3 and

∆ 2u =

1 ∂ g22 ∂ g12 − G3 ∂u G3 ∂v G3

∆2v =

1 ∂ g11 ∂ g12 − G3 ∂v G3 ∂u G3

Eqs. 2.141 were also obtained independently in [27] and recently in [28] by using the Beltrami equations of quasiconformal mapping. Nevertheless, the simple conclusion remains that Eqs. 2.141 are a direct outcome of Eq. 2.137. 2.5.2.1 Transformation of the Surface Coordinates Let u a = fα (u1, u2) be an admissible coordinate transformation in a surface. It is a matter of direct verification that

(

) ~(

)

n u1 , u 2 = n u 1 , u 2 , in var iant ~

and k I + k II = k I + k II , in var iant Using these and other derivative transformations, it can be shown that Eq. 2.132 transforms to

g

αβ

∂2 r

~

∂u α ∂u β

(

+ ∆ 2u δ

∂r

) ∂u

~ δ

(

= n k I + k II ~

)

(2.142)

where δ δ ∆ 2 u δ = g αβ Υαβ = g αβ Pαβ

Similarly ∆2 r = ∆2 r ~

~

The above analysis shows that Eq. 2.132 is form-invariant to coordinate transformation. The same result d d was obtained previously with regard to Eq. 2.118. How are the control functions P ab and P ab related? An answer to this question is similar to the one addressed in [23] and is given in [17, Appendix A]. If

©1999 CRC Press LLC

initially a harmonic coordinate system is chosen [29], then a recursive relation gives the subsequent surface coordinate control functions. 2.5.2.2 The Fundamental Theorem of Surface Theory The fundamental theorem of surface theory proves the existence of a surface if the coefficients of the first and the second fundamental forms satisfy certain conditions. Referring to [1] the statement of the theorem is as follows: “If gαβ and bαβ are given functions of uδ, sufficiently differentiable, which satisfy the Gauss and Codazzi equations as given in Eqs. 2.94 and 2.95, respectively and G3 ≠ 0, then there exists a surface that is uniquely determined except for its position in space.” The demonstration of this theorem consists in showing that the formulae of Gauss and Weingarten as given in Eqs. 2.90 and 2.89 respectively have to be solved under proper conditions. It may be noted that Eqs. 2.89 and 2.90 are 5 vector equations that yield 15 scalar equations, and the proper conditions are n⋅ n = 1, a ⋅ n = 0, α = 1, 2 ~α ~

~ ~

a ⋅ a = gαβ , α , β = 1, 2 ~α ~ β

n⋅ ~

∂2 r

~

∂uα ∂u β

= bαβ , α , β = 1, 2

The above statement poses an elaborate scheme and is quite involved for practical computations if one wants to generate a surface based on a knowledge of gαβ and bαβ . A restatement of the fundamental theorem of surface theory is now possible because Eq. 2.132 already satisfies Eqs. 2.89 and 2.90. Thus, a restatement of the theorem is as follows: “If the coefficient gαβ and bαβ of the first and second fundamental forms have been given that satisfy the Gauss and Codazzi equations (Eqs. 2.94, 2.95), then a surface can be generated by solving only one vector equation (Eq. 2.132) to within an arbitrary position in space.” This theorem has been checked numerically for a number of cases [30]. 2.5.2.3 Time-Dependent Surface Coordinates If in a given surface the coordinates are time-dependent, then we take the “grid generator” similar to Eq. 2.129 with φ = c as δ ∆2 uδ = gαβ Pαβ , +c

∂uδ , δ = 1, 2 ∂t

(2.143)

Realizing that the surface is defined by x3 = const., the resulting surface grid generation equation becomes ∂r G3

~

∂σ

= Dr + P r + Qr − n R ~ ~ξ ~η ~

(2.144)

where σ = τ /c and all other quantities are similar to those given in Eq. 2.137. The choice φ = c/G3 has been used to generate the surface coordinates in a fixed surface by parametric stepping and using a spectral technique [31]. 2.5.2.4 Coordinate Generation Equations in a Hypersurface In the course of an effort to extend the fundamental basis of Eq. 2.132 we have considered an extension of the embedding space E3 to a Riemannian-4 (M4) space. In M4 let the local coordinates be xi, i = 1, … , 4 and let S be an immersed hypersurface of local coordinates ξα , α = 1, … , 3. In the ensuing analysis, a comma preceding an index denotes a partial derivative. From

©1999 CRC Press LLC

dx i = x i , a dξ α we note that x i,α are the tangent vectors. Here, and in what follows, a comma preceding an index will denote a partial derivative while a semicolon will denote a covariant derivative. Further gij and aαβ are the covariant metric tenors and Γ ijk and ϒ αβγ are the Christoffel symbols in M4 and S, respectively. The metric coefficients are related as aαβ = gij x,iα x,jβ

(2.145a)

aαβ = g mnξ,αmξ,βn

(2.145b)

Let aαi be a contravariant vector in M4 and a covariant vector in S, then from [2], the covariant derivative of a ,iα in S is given by γ i k aαi ; β = xαi , β + aαr Γrk x, β − aγi Υαβ

(2.145c)

Replacing aαi by xαi in Eq. 2.145c, we get γ i i r k x,iα ; β = x,iαβ + Γrk x,α x, β − Υαβ x, γ

(2.146)

From [2], the formulae of Gauss in a Riemannian manifold are x,iα ; β = bαβ n i

(2.147)

and the formula of Weingarten is k r p n,kβ = − bαβ aαγ x,kγ − Γrp x, β n

where n i are the components of the normal to S in M4 and bαβ is the covariant tensor of the second fundamental form. Using Eq. 2.147 in Eq. 2.146 and taking the inner multiplication of every term with a αβ , we get

(

)

i aαβ x,iαβ + ∆ 2ξ γ x,iγ = − g rk Γrk + Pn

(2.148)

where ∂2 ∂ γ ∆ 2 = aαβ α β − Υαβ γ ξ ∂ ∂ξ ∂ξ and P = aαβ bαβ Eq. 2.148 is a generalization of Eq. 2.132 for a Riemannian hypersurface [32, 33]. The main difference is the appearance of the space Christoffel symbols, which vanish when M4 becomes E3.

©1999 CRC Press LLC

2.6 Concluding Remarks 1. If Dirichlet data is prescribed on the bounding curves of a given surface, then the three scalar equations from Eq. 2.132 can be used to generate coordinates in the surface. The distribution of these coordinates can be controlled by assigning suitable functions P and Q. 2. If the coefficients of the first and the second fundamental forms have been given as functions of some surface coordinates, then the surface suitable to these coefficients can be generated by solving the three scalar equations from Eq. 2.132. In this case, ∆2uδ is expressed in terms of the given gαβ, and kI + kII is expressed in terms of gαβ bαβ . 3. For a recent account of the use of elliptic equations in grid generation with algebraic parametric transformations, refer to [34].

References 1. Struik, D.J., Lectures on Classical Differential Geometry. Addison-Wesley Press, 1950. 2. Kreyszig, E., Introduction to Differential Geometry and Riemannian Geometry. University of Toronto Press, Mathematical Exposition No. 16, 1968. 3. Willmore, T.J., An Introduction to Differential Geometry. Oxford University Press, 1959. 4. Eisenhart, L.P., Riemannian Geometry. Princeton University Press, 1926. 5. Aris, R., Vectors, Tensors, and the Basic Equations of Fluid Mechanics. Prentice-Hall, Englewood Cliffs, NJ, 1962. 6. McConnell, A.J., Application of the Absolute Differential Calculus. Blackie, London, 1931. 7. Warsi, Z.U.A., Tensors and differential geometry applied to analytic and numerical coordinate generation, MSSU-EIRS-81-1, Engineering and Industrial Research Station, Mississippi State University, 1981. 8. Winslow, A.M., Numerical solution of the quasi-linear poisson equation in a non-uniform triangular mesh, J. Computational Phys. 1967, 1, pp 149–172. 9. Allen, D.N. de. G., Relaxation methods applied to conformal transformations, Quart. J. Mech. Appl. Math. 1962, 15, pp 35–42. 10. Chu, W-H., Development of a general finite difference approximation for a general domain, part i: machine transformation, J. Computational Phys. 1971, 8, pp 392–408. 11. Thompson, J.F., Thames, F.C., and Mastin, C.W., Automatic numerical generation of body-fitted curvilinear coordinate system for field containing any number of arbitrary two-dimensional bodies, J. Computational Phys. 1974, 15, pp 299–319. 12. Thompson, J.F., Warsi, Z.U.A., and Mastin, C.W., Numerical Grid Generation: Foundations and Applications. North-Holland, Elsevier, New York, 1985. 13. Knupp, P. and Steinberg, S., Fundamentals of Grid Generation. CRC Press, Boca Raton, FL, 1993. 14. George, P.L., Automatic Mesh Generation: Application to Finite Element Methods. Wiley, NY, 1991. 15. Warsi, Z.U.A., Basic differential models for coordinate generation, Numerical Grid Generation. Thompson J.F. (Ed.), Elsevier Science, 1982, pp 41–77. 16. Warsi, Z.U.A., A note on the mathematical formulation of the problem of numerical coordinate generation, Quart. Applied Math. 1983, 41, pp 221–236. 17. Warsi, Z.U.A., Numerical grid generation in arbitrary surfaces through a second-order differentialgeometric model, J. Computational Phys. 1986, 64, pp 82–96. 18. Warsi, Z.U.A., Theoretical foundation of the equations for the generation of surface coordinates, AIAA J. 1990, 28, pp 1140–1142. 19. Castillo, J.E., The discrete grid generation method on curves and surfaces, Numerical Grid Generation in Computation Fluid Dynamics and Related Fields. Arcilla, A.S. et al. (Eds.), Elsevier Science, 1991, pp 915–924. 20. Saltzman, J. and Brackbill, J.U., Application and generalization of variational methods for generating adaptive grids, Numerical Grid Generation. Thompson, J.F. (Ed.), North-Holland, 1982, pp 865–878. ©1999 CRC Press LLC

21. Warsi, Z.U.A. and Thompson, J.F., Application of variational methods in the fixed and adaptive grid generation, Computer and Mathematics with Applications. 1990, 19, pp 31–41. 22. Warsi, Z.U.A., Fluid Dynamics: Theoretical and Computational Approaches. CRC Press, Boca Raton, FL, 1993. 23. Warsi, Z.U.A., A Synopsis of elliptic PDE models for grid generation, Appl. Math. and Computation. 1987, 21, pp 295–311. 24. Steger, J.L. and Rizk, Y.M., Generation of Three-Dimensional Body-Fitted Coordinates Using Hyperbolic Partial Differential Equations. NASA TM 86753, 1985. 25. Warsi, Z.U.A. and Tiarn, W.N., Numerical grid generation through second-order differentialgeometric models, IMACS, Numerical Mathematics and Applications. Vichnevetsky, R. and Vigners, J. (Eds.), Elsevier Science, 1986, pp 199–203. 26. Thomas, P.D., Construction of composite three-dimensional grids from subregion grid generated by elliptic systems, AIAA Paper No. 83-1905, 1983. 27. Garon, A. and Camerero, R., Generation of surface-fitted coordinate grids, Advances in Grid Generation. Ghia, K.N. and Ghia, U. (Eds.), ASME, FED-5, 1983, pp 117–122. 28. Khamayesh, A., Ph.D. Dissertation, Mississippi State University, May 1994. 29. Dvinsky, A.S., Adaptive grid generation from harmonic maps on Riemannian manifolds, J. Computational Phys. 1991, 95, pp 450–476. 30. Beddhu, M., private communication, 1994. 31. Koomullil, G.P. and Warsi, Z.U.A., Numerical mapping of arbitrary domains using spectral methods, J. Computational Phys. 1993, 104, pp 251–260. 32. Sritharan, S.S. and Smith, P.W., Theory of harmonic grid generation, Complex Variables. 1988, 10, pp 359–369. 33. Warsi, Z.U.A., Fundamental Theorem Of The Surface Theory And Its Extension To Riemannian manifolds of general relativity, GANITA. 1995, 46, pp 119–129. 34. Spekreijse, S.P., Elliptic grid generation based on Laplace equations and algebraic transformations, J. Computational Phys. 1995, 118, pp 38–61.

©1999 CRC Press LLC

3 Transfinite Interpolation (TFI) Generation Systems 3.1 3.2 3.3 3.4

Introduction Grid Requirements Transformations and Grids Transfinite Interpolation (TFI) Boolean Sum Formulation • Recursion Formulation • Blending Function Conditions

3.5

Practical Application of TFI Linear TFI • Langrangian TFI • Hermite Cubic TFI

3.6

Grid Spacing Control Single-Exponential Function • Double-Exponential Function • Hyperbolic Tangent and Sine Control Functions • Arclength Control Functions • Boundary-Blended Control Functions

Robert E. Smith

3.7 3.8

Conforming an Existing Grid to New Boundaries Summary

3.1 Introduction This chapter describes an algebraic grid generation produced called transfinite interpolation (TFI). It is the most widely used algebraic grid generation procedure and has many possible variations. It is the most often-used procedure to start a structured grid generation project. The advantage of using TFI is that it is an interpolation procedure that can generate grids conforming to specified boundaries. Grid spacing is under direct control. TFI is easily programmed and is very computationally efficient. Before discussing TFI, a background on grid requirements and the concepts of computational and physical domains is presented. The general formulation of TFI is described as a Boolean sum and as a recursion formula. Practical TFI for linear, Lagrangian, and Hermite cubic interpolation is described. Methods for controlling grid point clustering in the application of TFI are discussed. Finally, a practical TFI recipe to conform an existing grid to new specified boundaries is described.

3.2 Grid Requirements Grids provide mathematical support for the numerical solution of governing field equations in a continuum domain. The physics is expressed as a system of differential or integral equations subject to initial and boundary conditions. A numerical solution is obtained by superimposing a grid onto the continuum

©1999 CRC Press LLC

domain, discretizing the governing equations relative to the grid, and applying a numerical solution algorithm to the discrete approximation of the governing equations. The result is an evaluation of the solution at the grid points. Two key ingredients necessary for obtaining an accurate and efficient solution are (1) the numerical solution algorithm, and (2) the grid. A grid generation technique should be as efficient as possible to achieve the desired characteristics. However, the importance of a particular characteristic or combination of characteristics can outweigh alone in determining which grid generation technique is applied to a particular problem. The most efficient grid generation techniques are algebraic and are based on the application of interpolation formulas. Algebraic grid generation techniques relate a computational domain, which is a rectangular parallelepiped (a square in two dimensions and a box in three dimensions), to an arbitrarily shaped physical domain with corresponding sides. The computational domain is a mathematical abstraction. The physical domain is the bounded continuum domain where a numerical solution to a system of governing equations of motion is desired. A side in the computational domain can map into a line or a point in the physical domain, in which case a singularity occurs in the mapping. Singularities can pose problems for the computation of numerical solutions when the governing equations are expressed in differential form. However, grid singularities usually do not cause problems when the governing equations are expressed in integral form. A single block (square or box in the computational domain and deformed block in the physical domain) is not usually sufficient to fit to boundaries of a complex solution domain. Therefore, the complex domains must be divided into subdomains and multiple blocks used to cover the subdomains. Depending on the solution technique used to solve the governing equations, the grid points at the boundaries of adjoining blocks must be contiguous. TFI is a multivariate interpolation procedure. When TFI is applied for algebraic grid generation, a physical grid is constrained to lie on or within specified boundaries. TFI is a Boolean sum of univariate interpolations in each of the computational coordinates. Virtually any univariate interpolation (linear, quadratic, spline, etc.) can be applied in a coordinate direction. Therefore, there are a limitless number of possible variations of TFI that can be created by using different combinations and forms of the univariate interpolations. Often for a particular application, a high order and more sophisticated interpolation is used in one coordinate direction, which we will call the primary coordinate direction, and a low-order interpolation, such as linear interpolation, is used in the remaining coordinate directions.

3.3 Transformations and Grids Algebraic grid generation techniques are transformations from a rectangular computational domain to an arbitrarily shaped physical domain. This is shown schematically in Figure 3.1 and as a general equation x(ξ, η,ζ ) X (ξ , η,ζ ) = y(ξ, η,ζ ) z(ξ, η,ζ ) 0 ≤ ξ ≤ 1 0 ≤ η ≤ 1 and 0 ≤ ζ ≤ 1 A discrete subset of the vector-valued function X, (ξΙ , ηJ , ζK) is a structured grid for 0 ≤ ξI =

I −1 J −1 K −1 ≤ 1 0 ≤ ηJ = ≤ 1 0 ≤ ζI = ≤1 Iˆ − 1 Jˆ − 1 Kˆ − 1

where I = 1, 2, 3,..., Iˆ J = 1, 2, 3,..., Jˆ K = 1, 2, 3,..., Kˆ ©1999 CRC Press LLC

(3.1)

FIGURE 3.1 Transformation between computational and physical domains.

FIGURE 3.2 Grids in computational and physical domains.

The relationships between the indices I, J, and K and the computational coordinates (ξ ,η ,ζ ) uniformly discretize the computational domain and imply a relationship between discrete neighboring points. The transformation to the physical domain produces the actual grid points, and the relationship of neighboring grid points is invariant under the transformation (Figure 3.2). A grid created in this manner is called a structured grid. TFI provides a single framework creating the function X(ξ ,η ,ζ ).

3.4 Transfinite Interpolation (TFI) Transfinite interpolation (TFI) was first described by William Gordon in 1973 [1]. TFI has the advantage of providing complete conformity to boundaries in the physical domain. In the early 1980s, Lars Eriksson described TFI for application to grid generation for computational fluid dynamics (CFD) [2,3,4]. Variants of TFI have since been described many times [5,6,7].

3.4.1 Boolean Sum Formulation The essence of TFI is the specification of univariate interpolations in each of the computational coordinate directions, forming the tensor products of the interpolations, and finally the Boolean sum. The univariate

©1999 CRC Press LLC

interpolation functions are a linear combination of known (user-specified) information in the physical domain (positions and derivatives) for given values of the computational coordinate and coefficients that are blending functions whose independent variable is the computational coordinate. The general expressions of the univariate interpolations for three dimensions are L

P

U(ξ , η,ζ ) = ∑ ∑ α in (ξ )

∂ n X (ξi , η,ζ ) ∂ξ n

i =1 n = 0 Q

M

V(ξ , η,ζ ) = ∑ ∑ β m j (η )

(

∂ m X ξ , η j ,ζ ∂η m

j =1 m = 0 N

W(ξ, η,ζ ) =

R

∑ ∑ α in (ξ )

)

(3.2)

∂ l X (ξ, η,ζ k ) ∂ζ l

k =1l = 0

Conditions on the blending functions are ∂ n ∂ in (ξi ) ∂ξ n

( ) =δ

ηj ∂m β m j

= δ ii δ nn

∂η m

δ jj mm

∂ l γ kl (ζ k ) ∂ζ l

= δ kk δ ll

(3.3)

i = 1, 2,..., L j = 1, 2,..., M k = 1, 2,..., N n = 0,1,..., P m = 0,1,..., Q l = 0,1,..., R The tensor products are L

N

R

P

UW = WU = ∑ ∑ ∑ ∑ α in (ξ )γ kl (ζ )

∂ ln X(ξi , η,ζ k )

i =1 k =1 l = 0 n = 0

L M

Q

R

∑ (ξ ) (η)

UV = VU = ∑ ∑ ∑

α in i =1 j =1 m = 0 n = 0 Q

M N

VW = WV = ∑ ∑ ∑

R

∑ (ξ ) (ζ ) βm j

j =1 k =1 m = 0 l = 0

L M N

R

Q

βm j

UVW = ∑ ∑ ∑ ∑ ∑

P

γ kl

∂ζ∂ξ n

(

∂ nm X ξ, η j ,ζ ∂η ∂ξ m

(

∂ lm X ξ , η j ,ζ k ∂ζ l ∂η m

∑ α in (ξ )β mj (η)γ kl (ζ )

i =1 j =1 k =1 l = 0 m = 0 n = 0

)

n

)

(3.4)

(

∂ lmn X ξi , η j ,ζ k l

∂ζ ∂η ∂ξ m

)

n

The commutability in the above tensor products is assumed in most practical situations, but in general, it is not guaranteed. It is dependent upon the commutability of the mixed partial derivatives. The Boolean sum of the three interpolations is X(ξ , η,ζ ) = U ⊕ V ⊕ W = U + V + W − UV − UW − VW + UVW

(3.5)

3.4.2 Recursion Formulation The application of TFI as a Boolean sum of univariate interpolations in the computational coordinate directions implies that each of the terms in the sum be evaluated and then the sum is evaluated.

©1999 CRC Press LLC

Alternately, TFI can be expressed as a three-step recursion formula. The first step is to express the univariate interpolation in one coordinate direction L

P

X1 (ξ , η,ζ ) = ∑ ∑ α in (ξ )

∂ n X (ξi , η,ζ )

(3.6)

∂ξ n

i =1 n = 0

The second and third steps use the preceding step. That is

(

)

(

M Q ∂ m X ξ , η j ,ζ ∂ m X1 ξ, η j ,ζ X2 (ξ , η,ζ ) = X1 (ξ, η,ζ ) + ∑ ∑ β m − j (η ) ∂η m ∂η m j =1 m = 0

)

N R ∂ l X (ξ, η,ζ k ) ∂ l X2 (ξ, η,ζ k ) X (ξ , η,ζ ) = X2 (ξ, η,ζ ) + ∑ ∑ γ kl (ζ ) − ∂ζ m ∂ζ l k =1 l = 0

(3.7)

(3.8)

3.4.3 Blending Function Conditions In the above equations, a in ( x ), b mj ( h ), and g kl ( z ) are blending functions subject to δ function con∂ lmn X ( x i, h j, z k ) - in the equations are positions and partial derivatives ditions. The defining parameters --------------------------------------------∂ zl ∂ hm ∂ xn in the physical domain and are user-specified. In this definition, the implicit assumption is that coordinate curves are to be interpolated along with their derivatives. This occurs through a network of intersecting surfaces and derivatives that must be specified.

3.5 Practical Application of TFI In the practical process of generating grids, it is necessary to minimize, or at least keep to a manageable level, the amount of input geometry data (position and derivatives along curves or surfaces). At the same time, it is necessary to maintain a high degree of control, particularly near boundary surfaces for which there may be high gradients in the solution of the governing equations.

3.5.1 Linear TFI The simplest application of TFI is to use linear interpolation functions for all coordinate directions and specify the positional data on the six bounding surfaces (Figure 3.3). P = Q = R = 0 and L = M = N = 2 in Eq. 3.2.

The linear blending functions that satisfy the δ function conditions in Eq. 3.3 are α10 (ξ ) = 1 − ξ α 20 (ξ ) = ξ β10 (η) = 1 − η β 20 (η) = η γ 10 (ζ ) = 1 − ζ γ 20 (ζ ) = ζ

©1999 CRC Press LLC

FIGURE 3.3

Boundary surfaces for linear TFI.

The univariate interpolations and tensor products are U(ξ I , η J ,ζ K ) = (1 − ξ I )X(0, η J ,ζ k ) + ξ I X(1, η J ,ζ K ) V(ξ I , η J ,ζ K ) = (1 − η I )X(ξ , 0,ζ k ) + η I X(ξ I ,1,ζ K )

W(ξ I , η J ,ζ K ) = (1 − ζ K )X(ξ I , η J , 0) + ζ I X(ξ I , η J ,1)

UW(ξ I , η J ,ζ K ) = (1 − ξ I )(1 - ζ K )X(0, η J , 0) + (1 − ξ I ,ζ K )X(0, η J ,1) \

+ ξ I (1 − ζ K )X(1, η J , 0) + X(1, 0,ζ K ) + ξ I η J X(1,1,ζ K )

UV(ξ I , η J ,ζ K ) = (1 − ξ I )(1 - η J )X(0, 0,ζ K ) + ξ Iζ K X(1, η J ,1)

+ ξ I (1 − η J )X(1 - η J )X(1, 0,ζ K ) + ξ I η J X(1,1,ζ K )

VW(ξ I , η J ,ζ K ) = (1 − η J )(1 - ζ K )X(ξ I , 0, 0) + (1 − η J )ζ K X(ξ I ,1, 0) + η J (1 − ζ K )X(ξ I , 0,1) + η J ζ K X(ξ I ,1,1)

UVW(ξ I , η J ,ζ K ) = (1 − ξ I )(1 − η J )(1 − ζ K )X(0, 0, 0) + (1 − ξ I )(1 − η J )ζ K X(0, 0,1) + (1 − ξ I )η J (1 − ζ K )X(0,1, 0) + (1 − ξ I )η J ζ K X(1, 0,1) + ξ I η J (1 − ζ K )X(1,1, 0) + ξ I η J ζ K X(1,1,1)

The expression for a TFI grid ( I = 1, …, Iˆ, interpolation functions (Eq. 3.5) is

J = 1, …, Jˆ ,

K = 1, …, Kˆ ) with linear

X(ξ I , η J ,ζ K ) = U(ξ I , η J ,ζ K ) + V(ξ I , η J ,ζ K ) + W(ξ I , η J ,ζ K ) − UW(ξ I , η J ,ζ K ) − UV(ξ I , η J ,ζ K ) − VW(ξ I , η J ,ζ K ) + UVW(ξ I , η J ,ζ K )

(3.9)

3.5.2 Lagrangian TFI When additional surfaces corresponding to the interior of the computational box can be provided (see Figure 3.4 for the case of two interior surfaces that would correspond to cubic Lagrangian interpolation),

©1999 CRC Press LLC

FIGURE 3.4

Transfinite interpolation with Lagrangian blending functions.

a general formula for the blending functions can be used. The formula for a computational coordinate, for instance, the ξ coordinate is

∏ i ≠ i (ξ − ξi ) α i0

i =1

(ξ ) =

(3.10)

L

∏ i ≠ i (ξi − ξi ) i =1

The univariate interpolation function in the ξ computational coordinate direction is L

U(ξ , η,ζ ) = ∑ α i0 (ξ )

∂ 0 X(ξ, η,ζ )

i =1

∂ξ 0

L

= ∑ α i0 (ξ )X(ξ , η,ζ )

(3.11)

i =1

The Lagrange blending function allows a polynomial interpolation of degree L – 1 through L points and satisfies the cardinal condition a i0 ( x i ) = d ii . It is not recommended that high-degree Lagrangian blending functions be used for grid generation because of the large quantity of geometric data that must be supplied and the potential excessive movement in the interpolation. Using L = 2 results in the linear interpolation above being a special case of Lagrangian interpolation.

3.5.3 Hermite Cubic TFI Often in grid generation, the outward derivative at one or more sides of the physical domain corresponding to sites of the computational domain can be specified. It is then feasible to use Hermite blending functions in the coordinate direction in which derivative information can be specified. For example, if ξ is the coordinate direction, the univariate Hermite interpolation (L = 2, P = 1) corresponding to Eq. 3.2 is 2

1

U(ξ , η,ζ ) = ∑ ∑ α in (ξ ) i =1 n = 0

α 10

(ξ )X(ξ1 ,η,ζ )

©1999 CRC Press LLC

+ α 11

∂ n X(ξi , η,ζ ) ∂ξ n

=

∂X(ξ ,η,ζ ) ∂X(ξ , η,ζ ) (ξ ) ∂1ξ + α 20 (ξ )X(ξ2 ,η,ζ ) + α 12 (ξ ) ∂2ξ

(3.12)

FIGURE 3.5

FIGURE 3.6

Transfinite interpolation with Hermite cubic blending functions.

Outward derivatives obtained from cross-product of surface derivatives.

where

α10 (ξ ) = 2ξ 3 − 3ξ 2 + 1 α11 (ξ ) = ξ 3 − 2ξ 2 + ξ α 20 (ξ ) = −2ξ 3 + 3ξ 2 α 12 (ξ ) = ξ 3 − ξ 2 The outward derivatives in the ξ coordinate direction can be specified by the cross-product of the tangential surface derivatives in the η and ζ coordinate directions at ξ = 0 and ξ = 1. This effectively creates the trajectories of grid curves that are orthogonal to the surfaces X(ξ1, η, ζ ) and X(ξ2, η, ζ ). That is, ∂X(ξ1 , η,ζ ) ∂ξ

©1999 CRC Press LLC

∂X(ξ1 , η,ζ ) ∂X(ξ1 , η,ζ ) = × ψ 1 (η,ζ ) ∂η ∂ζ

(3.13)

and ∂X(ξ2 , η,ζ ) ∂ξ

∂X(ξ2 , η,ζ ) ∂X(ξ2 , η,ζ ) = × ψ 2 (η,ζ ) ∂η ∂ζ

(3.14)

The scalar functions ψ1( h , z ) and ψ2( h , z ) are magnitudes of the outward derivatives in the ξ direction at X ( x 1 h, z ) and X ( x 2 h, z ). The derivative magnitude parameters can be constants or surface functions. Increasing the magnitudes of the derivatives extends the orthogonality effect further into the physical domain between the two opposing surfaces. However, the magnitudes can be excessively large, resulting in the interpolations equation being multivalued. This is manifested by grid crossover and is remedied by lowering the magnitudes. Note that when the interpolations in the η and ζ directions are applied, the orthogonality effect achieved with the above application of Hermite interpolation in the ξ direction can be altered.

3.6 Grid Spacing Control TFI transforms a rectangular computational domain to a physical domain with irregular boundaries. A uniform grid in the computational domain is obtained by partitioning each computational coordinate into equal increments. With the transformation, the discrete points in the computational domain map into irregular spaced points in the physical domain creating a physical grid. The spacing between points in the physical domain is controlled by the blending functions a in ( x ), b mj ( h ) and g kl ( ζ ). Blending functions that produce the desired shape of a grid (i.e., relative orientation between points) may not produce the desired spacing between points. In order to create grids with desired grid concentrations, additional information must be provided. One approach is to design or modify the blending functions to exactly produce the desired concentrations. Another approach, which is effective and practical, is to define an intermediate control domain between the computational domain and the physical domain. An intermediate control domain is defined to be a rectangular domain where each intermediate coordinate is related to the computational coordinates by u = f (ξ , η,ζ ) v = g(ξ , η,ζ ) w = h(ξ , η,ζ )

(3.15)

Under the application of these functions, uniformly spaced grid points in the computational domain map to nonuniformly spaced grid points in the control domain enclosed by the unit cube (Figure 3.7). The intermediate coordinates u, v, and w must be single-valued functions of f(ξ,η,ζ ), g(ξ,η,ζ ), and h(ξ,η,ζ ), respectively. The blending functions are redefined with the intermediate coordinates as the independent variables. That is a in ( u ), b mj ( v ) and g kl ( w ) . There are many practical considerations to be exercised at this point. The overall TFI formulation will shape a grid to fit the six boundary surfaces. Control functions that manipulate the grid point spacing are applied. These functions can be simple and be applied universally, or they can be complex and blend from one form to another, transversing from one boundary to an opposite boundary. It may be desirable for a control function to cause concentration of grid points at the extremes of the computational coordinate or somewhere in between. A low slope in a control function leads to grid concentration and high slope leads to grid dispersion. Several control functions are described.

3.6.1 Single-Exponential Function A useful function that maps an independent variable, r, 0 ≤ r ≤ 1, to a monotonically increasing dependent variable, r, 0 ≤ r ≤ 1, is

©1999 CRC Press LLC

FIGURE 3.7

FIGURE 3.8

Intermediate control domain.

Single-exponential control function example.

r=

e Aρ − 1 eA − 1

(3.16)

where ρ is assumed to be a computational coordinate and r is assumed to be an intermediate variable. The sign and magnitude of the parameter A specifies whether the lowest slope is near (0, 0) or (1, 1) and the magnitude of the slope (Figure 3.8). For A = 0 the single exponential function is singular and is not useful for producing an exact straight line between (0, 0) and (1, 1). This would correspond to a uniform clustering of the dependent variable. However, a magnitude of A = .0001 will produce a very near straight line. A uniform discrete spacing of the independent variable evaluation of the control ©1999 CRC Press LLC

function produces concentration or dispersion in the discrete values of the dependent variable. Often the r2 value (r1 = 0) at ∆r or the r Nˆ – 1 value ( r Nˆ = 1 ) at 1 – ∆r is specified, and the value of A that causes the function to pass through the point ( ∆r, r 2 ) or ( 1 – ∆r, r Nˆ – 1 ) is determined with a Newton–Raphson iteration. This creates a control function that specifies the spacing between the first and second grid point or the next to last and last grid point in a coordinate direction. Nˆ is the index for the last grid point.

3.6.2 Double-Exponential Function Another function that maps an independent variable, r, 0 ≤ r ≤ 1, to a monotonically increasing dependent variable r, 0 ≤ r ≤ 1, and provides more flexibility than the single exponential is A2 ρ A3

e −1 e A2 − 1 0 ≤ ρ ≤ A3 0 ≤ r ≤ A1

r = A1

A4

ρ − A3 1− A3

−1 e −1 A1 ≤ r ≤ 1

r = A1 + (1 − A1 ) A3 ≤ ρ ≤ 1 A4 chosen ∋

e

A4

Dr( A3 )

(3.17)

⊂ C1

Dρ

The user-specified parameters in Eq. 3.17 are A1, A2, and A3. The parameter A4 is computed. A3 and A1 are the abscissa and ordinate of a point inside the unit square through which the function will pass. A2 and A4 are exponential parameters for the two segments. The derivative condition at the joining of the two exponential functions is satisfied by applying a Newton–Raphson iteration that adjusts the value of the parameter A4. The double exponential control function provides added spacing control as compared to the single exponential function for concentrations near (0, 0) or (1, 1). Also, the double-exponential function allows a grid concentration in the interior or the domain (Figure 3.9). The concept of the doubleexponential function can be extended to an arbitrary number of segments, but it is recommended to keep the number of segments small.

3.6.3 Hyperbolic Tangent and Sine Control Functions Two other single-segment control functions that are used for grid clustering are the hyperbolic tangent (tanh) control function and the hyperbolic sine (sinh) control function. They are r = 1+

r = 1+

(

)

tanh B( ρ − 1) tanh B

(

)

(3.18)

sinh C(1 − ρ )

sinh C 0 ≤ ρ ≤1 0 ≤ r ≤1

(3.19)

where the parameters B and C govern the control functions and their derivatives. The hyperbolic tangent function in many references is a preferred control function for clustering grid points in a boundary-layer for computational fluid dynamics applications.

©1999 CRC Press LLC

FIGURE 3.9 Double-exponential control function example.

FIGURE 3.10 Arclength control function example.

3.6.4 Arclength Control Functions Very often an existing sequence of grid points along a coordinate curve, for instance, along a boundary curve, is known (Figure 3.10). It is desirable to use the sequence of points to create a control function. This can be done by normalizing the indices of the points to create the independent variable and computing the normalized accumulated chord lengths along the sequence of points to create the dependent variable. This process approximates the normalized arclength along the curve. A sequence of points is {xI,J,K, yI,J,K, zI,J,K, I = 1, 2, …Nˆ } and J and K are fixed, the formulae for the independent variable r, 0 ≤ r ≤ 1, and the dependent variable r, 0 ≤ r ≤ 1, are

©1999 CRC Press LLC

FIGURE 3.11

Boundary-blended control function example.

ρI = sI =

I −1 Nˆ − 1

( x I, J , K − x I −1, J , K )2 + ( yI, J , K − y1, J , K )2 + (z I, J , K − z I −1, J , K )2 + sI −1 rI =

(3.20)

sI s Nˆ

Note that if the number of grid points to be used in the grid generation formula (i.e., TFI) is Nˆ , there is no need to compute the independent variable ρI. If, however, the number of grid points in the coordinate direction is different from Nˆ , then the dependent variable rI must be interpolated from the normalized approximate arclength evaluation, and the independent variable values ρI are necessary.

3.6.5 Boundary-Blended Control Functions One of the practical problems that occurs in grid generation is the need to have different control functions specified along each edge of the intermediate domain and compute blended values of the intermediate variables interior to the domain. Soni [8] has proposed a blending formula for arclength control functions along the boundary edges that is very useful. This formula also is applicable for other control functions defined along the edges (Figure 3.11). A two-dimensional description of this type of blending is shown. Let s1(ξ ), 0 ≤ s 1 ( x ) ≤ 1, and s2(ξ ), 0 ≤ s 2 ( x ) ≤ 1, be control functions along the edges spanning between t1(η = 0), t2(η = 0) and t1(η = 1), t2(η = 1). Let t1(η), 0 ≤ h ≤ 1, 0 ≤ t 1 ( h ) ≤ 1 and t 2 ( h ), 0 ≤ h ≤ 1, 0 ≤ t 2 ( h ) ≤ 1 , be control functions along the edges spanning between s1(ξ = 0), s2(ξ = 0) and s1(ξ = 1), s2(ξ = 1). The blended values of intermediate control variables are u=

(1 − t1 (η))s1 (ξ ) + t1 (η)s2 (ξ ) 1 − ( s2 (ξ ) − s1 (ξ ))(t2 (η) − t1 (η))

(1 − s1 (ξ ))t1 (η) + s1 (ξ )t2 (η) v= 1 − (t2 (η) − t1 (η))( s2 (ξ ) − s1 (ξ ))

©1999 CRC Press LLC

(3.21)

3.7 Conforming an Existing Grid to New Boundaries TFI is normally used to generate a grid given three pairs of defined opposing boundaries. A variation of TFI can also be used to adjust an existing grid to three new pairs of opposing boundaries. This TFI variation can be stated in the following way. Note that x I , h J , and z K are replaced with the indices I, J, and K. ˆ (I, J, K), I = 1, 2…Iˆ, J = 1, 2, …Jˆ , K = 1, 2, …Kˆ and boundary surface grids Given a grid X X(1, J, K), X( Iˆ , J, K), X(I, 1, K), X(I, Jˆ , K), X(I, J, 1), and X(I, J, Kˆ ), an adjusted grid X(I, J, K), can be produced by

[

X1 ( I , J , K ) = Xˆ ( I , J , K )

[(

) (

)]

[(

)

(

)]

[(

)

(

)]

]

+α 10 (ξ ) X (1, J , K ) − Xˆ (1, J , K ) + α 20 (ξ ) X Iˆ, J , K − Xˆ Iˆ, J , K X2 ( I , J , K ) = X1 ( I , J , K )

+ β10 (η)[ X ( I ,1, K ) − X1 ( I ,1, K )] + β 20 (η) X I , Jˆ, K − X1 I , Jˆ, K X ( I , J , K ) = X2 ( I , J , K )

+γ 10 (ζ )[ X ( I , J ,1) − X2 ( I , J ,1)] + γ 20 (ζ ) X I , J , Kˆ − X2 I , J , Kˆ

(ξ ) = 1 − u1 (ξ ) α 20 (ξ ) = u2 (ξ )

α10

β10 (η) = 1 − v1 (η) β 20 (η) = v2 (η) γ 10 (ζ ) = 1 − w1 (ζ ) γ 20 (ζ ) = w2 (ζ ) u1 (ξ ) =

e C1ξ − 1 e C1 − 1

u2 (ξ ) =

e C2 ξ − 1 e C2 − 1

v1 (η) =

e C3η − 1 e C3 − 1

v2 (η) =

e C4η − 1 e C4 − 1

w1 (ζ ) =

e C 5ζ − 1 e C5 − 1

w2 (ζ ) =

e C6ζ − 1 e C6 − 1

where the constants C1, C2, …C6 specify how far into the original grid the effect of the six boundary surfaces is carried.

©1999 CRC Press LLC

3.8 Summary TFI generates grids that conform to specified boundaries. The recipe is a Boolean sum of univariate interpolations, and it is also expressed as a recursion formula. Since any univariate interpolation subject to δ conditions can be applied in a coordinate direction, there are an infinite number of variations of TFI. However, low-order univariate interpolation functions are the most practical. Lagrangian and Hermite cubic formulae have been presented. Grid spacing control can be best achieved by creating intermediate variables to be used in the interpolation functions. The intermediate variables are computed with control functions whose independent variables are computational coordinates and have adjustable parameters affecting spacing. Several examples of practical control functions have been presented. A variation of TFI to conform an existing grid to new specified boundaries has also been represented. This minor variation is highly useful in a practical grid generation environment.

References 1. Gordon, W.N. and Hall, C.A., Construction of curvilinear coordinate systems and application to mesh generation, International J. Num. Methods in Eng., Vol. 7, pp. 461–477, 1973. 2. Eriksson, L.-E., Three-dimensional spline-generated coordinate transformations for grids around wing-body configurations, Numerical Grid Generation Techniques, NASA CP 2166, 1980. 3. Eriksson, L.-E., Generation of boundary conforming grids around wing-body configurations using transfinite interpolation, AIAA J., Vol. 20, pp. 1313–1320, 1982. 4. Eriksson, L.-E., Transfinite Mesh Generation and Computer-Aided Analysis of Mesh Effects, Ph.D. Dissertation, University of Uppsala, Sweden, 1984. 5. Smith, R.E. and Wiese, M.R., Interactive Algebraic Grid Generation, NASA TP 2533, 1986. 6. Eiseman, P.R. and Smith, R.E., Applications of algebraic grid generation, AGARD Specialist Meeting Applications of Mesh Generation to Complex 3-D Configurations, 1989. 7. Samareh-Abolhassani, J., Sadrehaghighi, I., Smith, R.E., and Tiwari, S.N., Applications of Lagrangian blending functions for grid generation around airplane geometries, J. Aircraft, 27(10), pp. 873–877, 1990. 8. Soni, B.K., Two- and three-dimensional grid generation for internal flow applications, AIAA Paper 85-1526, 1985.

©1999 CRC Press LLC

4 Elliptic Generation Systems 4.1 4.2

Introduction Two-Dimensional Grid Generation Harmonic Maps, Grid Control Maps, and Poisson Systems • Discretization and Solution Method • Construction of Grid Control Maps • Best Practices

4.3 4.4 4.5 4.6

Surface Grid Generation Volume Grid Generation Research Issues and Summary Further Information

Stefan P. Spekreijse

4.1 Introduction Since the pioneering work of Thompson on elliptic grid generation, it is known that systems of elliptic second-order partial differential equations produce the best possible grids in the sense of smoothness and grid point distribution. The grid generation systems of elliptic quasi-linear second-order partial differential equations are so-called Poisson systems with control functions to be specified. The secret of each “good” elliptic grid is the method to compute the control functions [3]. Originally Thompson and Warsi introduced the Poisson systems by considering a curvilinear coordinate system that satisfies a system of Laplace equations and is transformed to another coordinate system [30,35]. Then this new coordinate system satisfies a system of Poisson equations with control functions completely specified by the transformation between the two coordinate systems. However, Thompson did not advocate to use this approach for grid generation. Instead he proposed to use the Poisson system with control functions specified directly rather than through a transformation [30]. Since then, the general approach is to compute the control functions at the boundary and to interpolate them from the boundaries into the field [5,29]. The standard approach used to achieve grid orthogonality and specified cell height on boundaries has been the iterative adjustment of the control functions in the Poisson systems (Chapter 6), first introduced by Sorenson of NASA Ames in the GRAPE code in the 1980s [24]. Various modifications of this basic concept have been introduced in several codes, and the general approach is now common [23,5,29]. Although successful, it appears that the method is not easy to apply in practice [14]. Even today, new modifications are proposed to improve the grid quality and to overcome numerical difficulties in solving the Poisson grid generation equations [23,16,12]. In this chapter we describe a useful alternative approach to specify the control functions. It is based on Thompson’s and Warsi’s original idea to define the control functions by a transformation. The transformation, which we call a grid control map, is a differentiable one-to-one mapping from computational space to parameter space. The independent variables of the parameter space are harmonic functions in physical space. The map from physical space to parameter space is called the harmonic map

©1999 CRC Press LLC

(Chapter 8). The composition of the grid control map and the inverse of the harmonic map obeys the familiar Poisson systems with control functions completely defined by the grid control map. The construction of appropriate grid control maps such that the corresponding grid in physical space has desired properties is the main issue of this chapter. One of the main advantages of this approach is that the method is noniterative. If an appropriate grid control map has been constructed, then the corresponding grid control functions of the Poisson system are computed and their values remain unchanged during the solution of the Poisson system. Picard iteration appears to be a simple and robust method to solve the Poisson system with fixed control functions. Another advantage is that the construction of an appropriate grid control map can be considered as a numerical implementation of the constructive proof for the existence of the desired grid in physical space. If the grid control map is one-to-one, then the composition of the grid control map and the inverse of the harmonic maps exist so that the solution of the Poisson system is well-defined. This chapter is organized as follows. Section 4.2 concerns the two-dimensional case. Although published earlier [25], the 2D Poisson system together with the expressions to compute the control functions from the grid control map are given for completeness. The solution of the Poisson system by Picard iteration is shortly described. Section 4.2.3 describes methods to construct appropriate grid control maps. Boundary orthogonality is obtained by applying Dirichlet–Neumann boundary conditions for the harmonic map and by applying cubic Hermite interpolation in parameter space. In that case, the harmonic map is quasi-conformal. This observation leads to the construction of appropriate grid control maps such that the solution of the Poisson system generates an orthogonal grid in physical space with boundary grid points fixed on two adjacent edges but moved along the other two opposite edges (see Chapter 7). This result is similar to that reported by Kang and Leal [13], although they used the Ryskin–Leal grid generation equations [19] instead of the Poisson grid generation equations. Section 4.2.4 shows generated grids in physical space for well-defined geometries so that the reader is able to recompute the grids (by the methods presented in this chapter or by his/her own favorite methods for comparison). The corresponding constructed grid control maps are shown as grids in parameter space. Section 4.3 briefly describes how the same methods to construct appropriate grid control maps for 2D grids can also be used for grid generation on surfaces in 3D physical space (see Chapter 9). It is shown that surface grid generation on minimal surfaces (soap films) is in fact the same as 2D grid generation. Conceptually, the same methods can also be used for parametrically defined surfaces, although the numerical implementation is completely different. The extension to volume grid generation is described in Section 4.4. The construction of appropriate grid control maps for 3D domains is less well developed than for 2D domains. However, a method to construct a grid control map has been proposed which works surprisingly well for many applications. The now-standard procedure in multi-block structured grid generation codes is to first generate surface grids on block faces, both boundary and interior block interfaces, from grid point distributions placed on the face edges by distribution functions. Then volume grids are generated within the blocks. For this reason, the elliptic grid generation methods described in this chapter assume fixed position of the prescribed boundary grid points.

4.2 Two-Dimensional Grid Generation 4.2.1 Harmonic Maps, Grid Control Maps and Poisson Systems Consider a simply connected bounded domain D in two-dimensional space with Cartesian coordinates r x(x, y)T. Suppose that D is bounded by four edges E1, E2, E3, E4. Let (E1, E2) and let (E3, E4) be the two pairs of opposite edges as shown in Figure 4.1. A harmonic map is defined as a differentiable one-to-one map from D onto a unit square such that 1. The boundary of D is mapped onto the boundary of the unit square, 2. The vertices of D are mapped, in the proper sequence, onto the corners of the unit square, 3. The two components of the map are harmonic functions in the interior of D. ©1999 CRC Press LLC

FIGURE 4.1

Composite map from computational (ξ,η) space to a domain D in Cartesian (x,y) space.

r Let s : D a P be a harmonic map where the parameter space P is the unit square in a two-dimensional r space with Cartesian coordinates s = (s, t)T. Assume that •

s ≡ 0 at edge E1 and s ≡ 1 at edge E2,

• t ≡ 0 at edge E3 and t ≡ 1 at edge E4.

The problem of generating an appropriate grid in the physical domain D can be effectively reduced to a simpler problem of generating an appropriate grid in the parameter space P, which can after that be r mapped into D, by using the inverse of the harmonic map x: P a D. Define ther computational space C as the unit square in a two-dimensional space with Cartesian r coordinates ξ = ( x, h ) T . A grid control map s : C a P is defined as a differentiable one-to-one map from C onto P and maps a uniform grid in C to a nonuniform (in general) grid in P. Assume that • s ( 0, h ) ≡ 0 and s ( 1, h ) ≡ 1 , • t ( x, 0 ) ≡ 0 and t ( x, 1 ) ≡ 1 . Then the computational coordinates also fulfill • x ≡ 0 at edge E1 and x ≡ 1 at edge E2, • h ≡ 0 at edge E3 and h ≡ 1 at edge E4.

r r The composition of a grid control map s: C a P and the inverse of the harmonic map x : P a D r define a map x: C a D which transforms a uniform grid in C to a nonuniform (in general) grid in D. The composite map obeys a quasi-linear system of elliptic partial differential equations, known as the Poisson grid generation equations, with control functions completely defined by the grid control map. The secret of each “good” elliptic grid generation method is the method of computing appropriate control functions, which is thus equivalent to constructing appropriate grid control maps. We will now derive the quasi-linear system of elliptic partial differential equations which the composite r r r mapping x = x( s (ξ)) has to fulfill. Suppose that the harmonic map and the grid control map are defined so that the composite map exists. Introduce the two covariant base vectors (see Chapter 2) r r r ∂x r r ∂x r a1 = x a = ξ, 2 = = xη ∂ξ ∂η

(4.1)

and define the covariant metric tensor components as the inner product of the covariant base vectors

(

r r r ai, j = ai , a j

)

r

i = {1, 2}

j = {1, 2}

(4.2)

r

The two contravariant base vectors a1 = ∇ξ = (ξx, ξy)T and a2 = ∇η = (ηx, ηy)T obey

(ar i , ar j )δ ij ©1999 CRC Press LLC

i = {1, 2} j = {1, 2}

(4.3)

with δji the Kronecker symbol. Define the contravariant metric tensor components

(

r r a ij = a i , a j

)

i = {1, 2}

j = {1, 2}

(4.4)

so that 11 a12 1 0 a11 a12 a = a12 a22 a12 a 22 0 1

(4.5)

and r r r a1 = a11a1 + a12 a2 r r r a1 = a11a1 + a12 a 2

r r r a 2 = a12 a1 + a 22 a2 r r r a2 = a12 a1 + a22 a 2

(4.6)

Introduce the determinant J2 of the covariant metric tensor: J 2 = a11a22 – a212 . Now consider an arbitrary function φ = φ (ξ, η). Then φ is also defined in domain D, and the Laplacian of φ is expressed as ∆φ = φ xx + φ yy −

(

1 { Ja11φξ + Ja12φη J

) + ( Ja

12

ξ

φξ + Ja 22φη

)} η

(4.7)

which may be found in Chapter 2 and in every textbook on tensor analysis and differential geometry (for example, see [15]). Take as special cases respectively f ≡ x and f ≡ h . Then Eq. 4.7 yields ∆ξ =

( )ξ + ( Ja12 )η}

1 { Ja11 J

∆η =

(

1 { Ja12 J

)ξ + ( Ja 22 )η}

(4.8)

Thus the Laplacian of φ can also be expressed as ∆φ = a11φξξ + 2 a12φξη + a 22φηη + ∆ξφξ + ∆ηφη

(4.9)

Substitution of respectively f ≡ s and f ≡ t in this equation yields ∆s = a11sξξ + 2 a12 sξη + a 22 sηη + ∆ξsξ + ∆ηsη ∆t = a11tξξ + 2 a12 tξη + a 22 tηη + ∆ξtξ + ∆ηtη

(4.10) (4.11)

Using these equations and the property that s and t are harmonic in domain D, thus ∆s = 0 and ∆t = 0, we find the following expressions for the Laplacian of ξ and η: r r r ∆ξ 11 12 22 = a P11 + 2 a P12 + a P22 ∆η

(4.12)

where sξξ r P11 = − T −1 tξξ

©1999 CRC Press LLC

sξη r P12 = − T −1 tξη

r sηη P22 = − T −1 tηη

(4.13)

and the matrix T is defined as sξ sη T = tξ tη

(4.14)

r r r The six coefficients of the vectors P11 = (P111 , P 211 ) T, P12 = (P112 , P 212 ) T and P 22 = (P122 , P 222 ) T are the socalled control functions. The six control functions are completely defined and easily computed for a given r r r grid control map s = s (ξ ). Different and less useful expressions of these control functions can also be found in [30,35]. r Finally, substitution of φ ≡ x in Eq. 4.9 yields r r r r r r ∆x = a11 xξξ + 2 a12 xξη + a 22 xηη + ∆ξxξ + ∆ηxη

(4.15)

r Substituting Eq. 4.12 into this equation and using the fact that ∆ x ≡ 0, we arrive at the familiar Poisson grid generation system:

(

)

r r r 1 1 1 r a11 xξξ + 2 a12 xξη + a 22 xηη + a11 P11 xξ + 2 a12 P12 + a 22 P22

(

(4.16)

)

2 r + a11 P112 + 2 a12 P122 + a 22 P22 xη = 0

Using Eqs. 4.2, and 4.5 we find the following well-known expressions for the contravariant metric tensor components: r r J 2 a11 = a22 = xη , xη

(

)

(

r r J 2 a12 = − a12 = − xξ , xη

)

(

r r J 2 a 22 = a11 = xξ , xξ

)

(4.17)

Thus the Poisson grid generation system defined by Eq. 4.16 can be simplified by multiplication with J 2. Then we obtain:

( ) 2 r + ( a22 P112 − 2 a12 P122 + a11 P22 )xη = 0

r r r 1 1 1 r a22 xξξ − 2 a12 xξη + a11 xηη + a22 P11 − 2 a12 P12 + a11 P22 xξ

(4.18)

This equation, together with the expressions for the control functions P kij given by Eq. 4.13, is the twodimensional grid generation system. For a given grid control map, so that the six control functions in Eq. 4.18 are given functions of ξ and η, boundary conforming grids in the interior of domain D are computed by solving this quasi-linear system of elliptic partial differential equations with prescribed boundary grid points as Dirichlet boundary conditions. The discretization and solution method of this Poisson system is discussed in the next section. The construction of appropriate grid control maps such that the corresponding grid in physical space has desired properties is discussed in the remaining sections.

4.2.2 Discretization and Solution Method Consider a uniform rectangular grid of (N + 1) × (M + 1) points in computational space C defined as

ξij = ξi = i / N

ηi , j = η j = j / M

i = 0... N

j = 0... M

(4.19)

r r Assume that xi, j is prescribed on the boundary of this grid and consider the computation of xi, j in the interior of the computational grid based on the solution of the Poisson system defined by Eq. 4.18.

©1999 CRC Press LLC

FIGURE 4.2

Boundary conditions for both control of orthogonality and first grid cell height.

r Assume that a grid control map s : C a P has been constructed. Thus the values sij and tij are known at each grid point. At each interior grid point (i, j) ∈ (1… N – 1, 1… M – 1), the six control functions P1ll, P2l1, P112, P212, P122, P222 defined by Eq. 4.13 are now easily computed using central differences for the discretization of sξξ , sξη , sηη , sξ , sη and tξξ , tξη , tηη , tξ , tη. The iterative solution process of the nonlinear elliptic Poisson grid generation system defined by Eq. 4.18 can be simply obtained by Picard iteration. Rewrite the Poisson system as r r r r r Pxξξ − 2Qxξη + Rxηη + Sxξ + Txη = 0

(4.20)

with r r P = xη . xη

(

)

(

r r Q = xξ . xη

)

(

r r R = xξ . xξ

)

1 1 1 S = PP11 − 2QP12 + RP22

T=

PP112

− 2QP122

+

(4.21)

2 RP22

The iterative solution by Picard iteration can be written as rk rk rk r r P k −1 xξξ − 2Q k −1 xξη + R k −1 xηη + S k −1 xξk + T k −1 xηk = 0

(4.22)

where k is the Picard index and

(

r r P k −1 = xηk −1 , xηk −1

)

(

r r Q k −1 = xξk −1 , xηk −1

)

1 1 1 S k −1 = P k −1 P11 − 2Q k −1 P12 + R k −1 P22

T

k −1

=

P k −1 P112

− 2Q k −1 P122

+

(

r r R k −1 ≈ xξk −1 , xξk −1

) (4.23)

2 R k −1 P22

Thus, a current approximate solution r r x k −1 = {xijk −1 , i = 0... N , j = 0... M}

©1999 CRC Press LLC

(4.24)

FIGURE 4.3

Composite map from computational (ξ, η) space to a surface S in Cartesian (x, y, z) space.

is improved by the following steps: • Compute at interior grid points the coefficients Pk-1,Q k–1,R k-1,S k-1,T k-1 by applying central differ-

r r ences for the discretization of xξk −1 and xηk −1. Note that the six control functions remain unchanged during the iterative procedure. rk rk rk rk rk • Discretize at interior grid points xξξ, xξη, xηη, xξ, xη using central differences. rk rk rk rk rk • After the discretization of xξξ, xξη, xηη , xξ , xη we arrive at a linear system of equations for the r unknowns xijk i = 1… N – 1, j = … M – 1. At each interior grid point we have a nine-point stencil. Boundary grid points are prescribed and remain unchanged. This linear system can be solved by a black-box multigrid solver. Such a multigrid solver is called twice to compute the two components r r x kij and y kij of xijk . The solution of the linear system provides a better approximate solution x k. The following algorithm describes the computation of an interior grid in domain D with prescribed boundary grid points and a given grid control map. Algorithm 1. Grid Generation. 1. Compute the six control functions from the grid control map. 2. Compute an initial grid in the interior of domain D by a simple algebraic grid generation method (see Chapter 3). The quality of the initial grid is unimportant, and severe grid folding is allowed. The initial grid is used as starting solution for the Picard iteration process. The final grid will be independent of the initial grid. 3. Solve the quasi-linear Poisson grid generation equations iteratively by Picard iteration. The fixed position of the boundary grid points define Dirichlet boundary conditions. In general, a sufficiently converged grid is obtained in about 10 Picard iterations. The residual is then typically decreased by a factor 1000.

4.2.3 Construction of Grid Control Maps 4.2.3.1 Laplace Grids

r r The simplest grid control map is the identity map s = ξ. The six control functions are identical zero and r r r the Poisson grid generation system defined by Eq. 4.18 simplifies to a22 x ξξ – 2a12 xξη + a11 xηη = 0, which is equivalent with ∆ξ = 0 and ∆η = 0, according to Eq. 4.12. Grids based on this equation are the so-called Laplace (or Harmonic) grids, which were first introduced by Winslow [34]. The inherent smoothness of the Laplace operator makes the grid evenly spaced in the interior. Therefore, the quality of a Laplace grid will be acceptable only as long as the boundary grid points are evenly spaced along the edges. This is illustrated in Figure 4.5 and Figure 4.6 where a region about a NACA0012 airfoil is subdivided into four domains. The domains have common edges, and more or less evenly spaced boundary grid ©1999 CRC Press LLC

FIGURE 4.4

Composite mapping from computational (ξ, η, ζ ) space to a domain D in Cartesian (x, y, z) space.

FIGURE 4.5 Domain boundaries near NACA0012 airfoil. The location of grid points on the domain boundaries is prescribed and fixed.

points are prescribed. Figure 4.6 shows Laplace grids in each domain. The result is not bad for this Otype Euler mesh. (Only smooth grids are required for the solution of the Euler equations for nonviscous flow, where strong gradients near boundaries do not occur.) Laplace grids provide no control about the angle distribution between internal grid lines and the boundary. This causes slope discontinuity of the grid lines across internal domain boundaries, as shown in Figure 4.6. The situation is completely different for Navier–Stokes type of meshes where the grid must contain a boundary layer grid. Highly stretched grids are required for solutions of the Navier–Stokes equations for viscous flow, where large gradients occur near boundaries. Figure 4.9 shows a region about a RAE2822 airfoil also subdivided into four domains. The boundary grid point distribution is highly dense near the leading and trailing edge of the airfoil. Figure 4.10 shows the Laplace grids in the four domains. These grids are unacceptable because the inherent smoothness of the Laplace operator causes evenly spaced grids so that the interior grid contains no boundary layer at all. Therefore, Laplace grids are in general unusable in most practice.

©1999 CRC Press LLC

FIGURE 4.6

4.2.3.2

Laplace grid. Grid control map is the identity map.

Arc Length Based Grids

Consider domain D as shown in Figure 4.1. Assume that the boundary grid points are prescribed at the four edges of D. A boundary-conforming grid in the interior of domain D with an interior grid point distribution which is a good reflection of the prescribed boundary grid point distribution can be obtained by constructing a grid control map based on normalized arc length. In order to construct such a grid control, we define • s ≡ 0 at edge E1 and s ≡ 1 at edge E2, • s is the normalized arc length along edges E3 and E4, • t ≡ 0 at edge E3 and t ≡ 1 at edge E4, • t is the normalized arc length along edges E1 and E2.

For example, this means that along edge E3 we define s(u) =

∫

u

o

r xu du

r

∫r x 1

u

r du where x : u Œ [ 0, 1 ] a

( x, y ) Œ R 2 is a parametrization of edge E3 in the right direction. Thus s : ∂D a∂P is defined by these requirements. The two Laplace equations ∆s = 0 and ∆t = 0, together with the above-specified Dirichlet r boundary conditions, define the harmonic map s: D a P. Note that this map depends only on the shape of domain D and is independent of the prescribed boundary grid point distribution. r The boundary grid points are prescribed at the four edges of D. Thus x: ∂C a ∂D is prescribed. r r r Because x: ∂C a ∂D is prescribed and s : ∂D a∂P is defined as described above, it follows that s : ∂C a∂P is also defined. From the preceding requirements it follows that s(0, η) = 0

s(1, η) = 1

s(ξ , 0) = s Ea3 (ξ )

s(ξ,1) = s Ea 4 (ξ )

(4.25)

t (1, η) = t Ea2 (η)

(4.26)

where the functions s aE3, s aE4 are monotonically increasing, and t (ξ , 0) = 0

©1999 CRC Press LLC

t (ξ ,1) = 1

t (0, η) = t Ea1 (η)

where the functions t aEl, t aE2 are also monotonically increasing. The superscript a is used to indicate that these functions measure the normalized arc length at the boundary grid points. r The grid control map s : C a P is now defined by the following two algebraic equations: s = s Ea3 (ξ )(1 − t ) + s Ea 4 (ξ )t

(4.27)

t = t Ea1 (η)(1 − s) + t Ea2 (η)s

(4.28)

Eq. 4.27 implies that a coordinate line ξ = const. is mapped to the parameter space P as a straight line: s is a linear function of t, and Eq. 4.28 implies that a grid line η = const. is also mapped to P as a straight line: t is a linear function of s. For given values of ξ and η, the corresponding s and t values are found as the intersection point of the two straight lines. It can be easily verified that the grid control map is a differentiable and one-to-one because of the positiveness of the Jacobian: sξ tη – sηtξ > 0. The discrete computation of the grid control map is straightforward. For a grid of (N + 1) × (M + 1) points, the distance between succeeding grid points at the boundary are computed as r r d, 0 j = x 0, j − x 0, j −1

r r d N , j = x N , j − x N , j −1

j = 1... M

(4.29)

r r d, i, 0 = xi, 0 − xi −1, 0

r r di, M = xi, M − xi −1, M

i = 1... N

(4.30)

Define the length of edges E1, E2 E3, E4 by M

LE1 = ∑ d0, j j =1

M

LE 2 = ∑ d N , j j =1

N

LE 3 = ∑ di , 0 i =1

N

LE 4 = ∑ di , M

(4.31)

i =1

and the normalized distances as do, j = do, j / LE1

d N , j = d N , j / LE 2

j = 1... M

(4.32)

di , 0 = di , 0 / LE 3

di , M = di , M / LE 4

i = 1... N

(4.33)

The discrete components si,j and ti,j of the grid control map are computed at the boundary by so, j = 0

sN, j = 1

j = 0... M

(4.34)

ti , 0 = 0

ti , M = 1

i = 0... N

(4.35)

and si, 0 = si −1, 0 + di, 0

si, M = si −1, M + di, M

i = 1... N

(4.36)

t o, j = t 0 , j − 1 + d N , j

ti , M = t N , j −1 + d N , j

j = 1... M

(4.37)

The interior values are defined according to Eq. 4.27 and Eq. 4.28 and are thus found by solving simultaneously the two linear algebraic equations, ©1999 CRC Press LLC

FIGURE 4.7

Arc length-based grid.

(

)

(4.38)

(

)

(4.39)

si, j = si, 0 1 − ti, j + si, M ti, j ti, j = t0, j 1 − si, j + t N , j si, j

for each pair (i, j) ∈ (1…N – 1, 1…M – 1). The next algorithm summarizes the computation of arc length-based grid in the interior of D. Algorithm 2. Arc length-based grids 1. Compute the four edge functions t aE,l t aE2, s aE3 and s aE4 from the boundary grid point distribution. 2. Compute the grid control map according to Eq. 4.27 and Eq. 4.28. 3. Compute the corresponding interior grid in D as described in Algorithm 1. Illustrations of boundary conforming grids obtained with this grid control map are shown in Figure 4.7 and Figure 4.11. As opposed to Laplace grids, the interior grid point distribution is always a good reflection of the prescribed boundary grid point distribution. Grid folding hardly ever occurs, because both the grid control map and the harmonic map are one-to-one. When grid folding occurs, then it must be caused by discretization errors [18]. Hence, grid folding will always disappear when the grid is sufficiently refined. A shortcoming of this grid control map is that there is no control about the angle distribution between interior grid lines and the boundary edges of the domain. It is often desired that the interior grid lines are orthogonal at the boundary edges. For example, viscous flow simulations often require orthogonality of the grid in a boundary layer. This can be achieved with a grid control map as constructed below. 4.2.3.3 Grid Orthogonality at the Boundary Consider domain D with prescribed boundary grid points. Suppose that it is desired to generate a boundary-conforming grid in the interior of D which is orthogonal at all four edges of domain D. This can be achieved by imposing Dirichlet–Neumann boundary conditions for the harmonic map:

©1999 CRC Press LLC

• s ≡ 0 at edge E1 and s ≡ 1 at edge E2, • ∂s ⁄ ∂n along edges E3 and E4, where n is the outward normal direction, • t ≡ 0 at edge E3 and t ≡ 1 at edge E4, • ∂t ⁄ ∂n along edges E1 and E2, where n is the outward normal direction.

The two Laplace equations ∆s = 0 and ∆t = 0, together with the above specified boundary conditions, r define the harmonic map s : D a P. Again this map depends only on the shape of domain D and is independent of the prescribed boundary grid point distribution. The Neumann boundary conditions ∂s/∂n = 0 along edges E3 and E4 imply that a parameter line s = const. in P will be mapped into domain D by the inverse of the harmonic map as a curve which is orthogonal at those edges. Similarly, a parameter line t = const. in P will be mapped as a curve in D which is orthogonal at edge E1 and edge E2. These properties can be used to construct a grid control map such that the interior grid in D will be orthogonal at the boundary. r The boundary grid points are prescribed at the four edges of D. Thus x: ∂C a ∂D is prescribed. r r r Because x: ∂C a ∂D is prescribed and s : ∂D a ∂P is also defined, it follows that s : ∂C a ∂P is also defined. From the preceding requirements it follows that s(0, η) = 0

s(1, η) = 1

s(ξ , 0) = s E0 3 (ξ )

s(ξ,1) = s E0 4 (ξ )

(4.40)

where the functions s0E3, s0E4 are monotonically increasing, and t (ξ , 0) = 0

t (ξ ,1) = 1

t (0, η ) = t E01 (η )

t(1, η ) = t E0 2 (η )

(4.41)

where the functions t 0E1, t 0E2 are also monotonically increasing. The superscript 0 is used to indicate that these functions are constructed in a way to obtain grid orthogonality at the boundary. r The grid control map s : C a P is now defined by s = s E0 3 (ξ ) H0 (t ) + s E0 4 (ξ ) H1 (t )

(4.42)

t = t E01 (η) H0 ( s) + t E0 2 (η) H1 ( s)

(4.43)

where H0 and H1 are cubic Hermite interpolation functions defined as H0 ( s) = (1 + 2 s)(1 − s)2

H1 ( s) = (3 − 2 s)s 2 0 ≤ s ≤ 1

(4.44)

Note that H0 (0) = 1, H0′ (0) = 0, H0 (1) = 0, H0′(1) = 0 and H1(0) = 0, H 1′ (0) = 0, H1(1) = 1, H ′1 (1) = 0. It follows from Eq. 4.42 that a coordinate line ξ = const. in C is mapped to parameter space P as a cubic curve (with t as dependent variable) which is orthogonal at both edge E3 and edge E4 in P. Such a r curve in parameter space P will thus be mapped by the inverse of the harmonic map x: P a D as a curve which is orthogonal at both edge E3 and edge E4 in D. Similar observations can be made for coordinate lines η = const. Thus the grid will be orthogonal at all four edges in domain D. Grid orthogonality at boundaries may introduce grid folding. Fortunately, grid folding will not easily arise. From Eq. 4.42 it follows that two different coordinate lines ξ = ξ1, ξ = ξ2, ξ1 ≠ ξ2 are mapped to parameter space P as two disjunct cubic curves which are orthogonal at both edge E3 and edge E4 in P. This is due to the fact that s0E3(ξ) and s0E4(ξ) are monotonically increasing functions. The same holds for different coordinate lines η = η1, η = η2, η1≠ η2. For given values of ξ and η, the corresponding s and t values are found as intersection point of two cubic curves. However, such two cubic curves may have

©1999 CRC Press LLC

more than one intersection point. In that case, grid folding will occur. However, in practice we hardly ever encounter grid folding due to orthogonalization of the grid at the boundary. We have described a method to obtain an orthogonal grid at all four edges of domain D. In practice, orthogonality of the grid is often only desired at less than four edges. Suppose for example that it is only desired to have an orthogonal grid at edge E3. Then take tE1(η) = t0E1(η), tE2(η) = t0E2(η), sE4(ξ) = s0E4(ξ) r and sE3(ξ) = s0E3(ξ). Furthermore, the grid control map s : C a P is such that a coordinate line η = const. is mapped to P as a straight line and a coordinate line ξ = const. is mapped to P as a parabolic curve (with t as dependent variable) which is only orthogonal at edge E3 in P. For given values of ξ and η, the corresponding s and t values are then found as intersection point of a straight line and a parabolic curve. The discrete computation of the grid control map is more complicated when grid orthogonality is required. We have seen that for a grid control map based on normalized arc length, the functions t0El, t 0E2, s 0E3 and s 0E4 can be directly computed from the prescribed boundary grid points only. However, when grid orthogonality is required, the functions t 0E1, t 0E2, s 0E3 and s 0E4 can only be found by solving the Laplace equations ∆s = 0 and ∆t = 0 supplied with the above mentioned Dirichlet–Neumann boundary conditions. The solution of the Laplace equations ∆s = 0 and ∆t = 0 supplied with the boundary conditions requires an initial folding-free grid in the interior of domain D. Therefore, an orthogonal grid at the boundary is in general obtained in three steps: Algorithm 3. Grid orthogonality at boundary 1. Compute an initial boundary conforming grid in the interior of D without grid folding. Such a grid can be computed using the grid control map based on normalized arc length as described in Algorithm 2. 2. Solve on this mesh ∆s = 0 and ∆t = 0 supplied with the above specified Dirichlet–Neumann boundary conditions. A solution method is described in [19]. The solution at the boundary defines the edge functions t 0E1, t 0E2, s 0E3and s 0E4. 3. Compute the grid control map according to Eq. 4.42 and Eq. 4.43. 4. Compute the corresponding interior grid in D as described in Algorithm 1. Illustrations of boundary conforming grids obtained with this grid control map are shown in Figure 4.8 and Figure 4.19. The common interior boundary edges of the four domains can hardly be recognized any more because of the excellent grid orthogonality at these edges. The grid spacing of the interior grid is also good in both cases. For more information on grid orthogonality at the boundary, see Chapter 6. r In the next section we will prove that the harmonic map s : D a P supplied with Dirichlet–Neumann boundary conditions is quasi-conformal. This observation leads to the construction of appropriate grid control maps such that the corresponding grid is orthogonal, not only at the boundary but also in the interior of D. 4.2.3.4

Orthogonal Grids

There is a famous theorem in conformal mapping theory which states that each simply connected domain D can be mapped conformally to a rectangle R in such a way that the vertices of domain D are mapped, in the proper sequence, onto the corners of the rectangle [8,11]. The ratio of the length of two adjacent sides of the rectangle is called the conformal module M, which is a characteristic and fundamental property of each domain. r Let u : D a R be the conformal map where R is the rectangle [0, 1] × [0, M] in a two-dimensional r space with Cartesian coordinates u = (u, v)T. The components of the conformal map obey the Cauchy–Riemann relations: ux vy u = −v y x

©1999 CRC Press LLC

(4.45)

FIGURE 4.8 Grid with boundary orthogonality. Boundary orthogonality makes the grid smooth across internal domain boundaries.

r Hence ∆u = 0 and ∆v = 0 in the interior of domain D. Furthermore, we may assume that the map u : D a R obeys • u ≡ 0 at edge E1 and u ≡ 1 at edge E2, • v ≡ 0 at edge E3 and v ≡ M at edge E4.

From these boundary conditions and using the Cauchy–Riemann relations we can also conclude that • ∂u/∂n = 0 along edges E3 and E4, where n is the outward normal direction, • ∂v/∂n = 0 along edges E1 and E2, where n is the outward normal direction.

r Thus the conformal map u: D a R is harmonic and obeys the same set of Dirichlet–Neumann boundary r conditions as the harmonic map s : D a P. Therefore the two maps are related to each other according to s=u

t=

v M

(4.46)

This means that the harmonic map is quasi-conformal and obeys sx ty s = M − y tx

(4.47)

Thus the two contravariant vectors are orthogonal but have different lengths. It is not difficult to show, using the relations between covariant and contravariant vectors given by Eq. 4.6, that the covariant vectors fulfill xs 1 yt y = s M − xt ©1999 CRC Press LLC

(4.48)

FIGURE 4.9

Region about RAE2822 airfoil subdivided into four domains.

so that the inverse mapping obeys r r M 2 x ss + xtt = 0

(4.49)

which is the well-known partial differential equation for quasi-conformal maps [14, page 96]. It can also be easily verified that the conformal module can be computed from M=

∫E

2

∂s dσ ∂n

(4.50)

where n is the outward normal direction and σ a line element along edge E2 in D [11]. r Conformal maps are angle preserving. The inverse of the conformal map u : D a R is also conformal and maps an orthogonal grid in the rectangle R to an orthogonal grid in D. Therefore, an algorithm to compute an orthogonal grid in the interior of D with a prescribed boundary grid point distribution at all four edges may consist of the following steps: 1. Compute an initial boundary conforming grid in the interior of D without grid folding. This can be achieved using the grid control map based on normalized arc length. 2. Solve on this mesh ∆s = 0 and ∆t = 0 supplied with Dirichlet–Neumann boundary conditions. Compute the edge functions t 0E1, t 0E2, s 0E3, and s 0E4 and the conformal module M according to Eq. 4.50. 3. Map the edge functions in P to the rectangle R, using Eq. 4.46, and compute an orthogonal boundary conforming grid in R. 4. Map the orthogonal grid in R to P, again using Eq. 4.46. This grid in P defines a grid control map that will create an orthogonal grid in the interior of D. Thus, a difficult problem of generating an orthogonal grid in a domain D can be effectively reduced to a simpler problem of generating an orthogonal grid in the rectangle R. Unfortunately, there is no simple algorithm available to generate an orthogonal grid in the interior of a rectangle

©1999 CRC Press LLC

FIGURE 4.10

Laplace grid near airfoil. Grid control map is the identity map.

with prescribed boundary grid points at all four sides. The question of an existence proof for this problem still remains unanswered [17]. Numerical experiments indicate that even for a rectangle it is probably not possible to generate an orthogonal grid for all kinds of boundary grid point distributions [9]. However, if the boundary grid points have fixed positions on two adjacent edges of domain D but are allowed to move along the boundary of the other two edges, then a simple algorithm does exist to generate an orthogonal grid in D. This result is similar to that reported by Kang and Leal [13], although they used the Ryskin–Leal grid generation equations [19] instead of the Poisson grid generation equations. For example, suppose that the boundary grid points are fixed at edges E1 and E3 and are allowed to move along edges E2 and E4. Then the algorithm becomes the following. Algorithm 4. Grid orthogonality 1. Compute an initial boundary conforming grid in the interior of D without grid folding. Such a grid can be computed using the grid control map based on normalized arc length as described in Algorithm 2. 2. Solve on this mesh ∆s = 0 and ∆t = 0 supplied with Dirichlet–Neumann boundary conditions and compute the edge functions t 0E1, t 0E2, s 0E,3 and s 0E.4 3. The initial position of the boundary grid points at edge E2 corresponds with the edge function t 0E2. Move the boundary grid points along edge E2 in such a way that the new position corresponds with t 0E1. This is simply a matter of interpolation. The points along edge E4 should be moved such that their new position corresponds with s0E3. 4. Define the grid control map as s(ξ,η) = s 0E3 (ξ) and t(ξ,η) = t 0E1(η). 5. Compute the corresponding orthogonal grid in D as described in Algorithm 1. The grid in parameter space P is a simple nonuniform rectangular mesh. Such a mesh also corresponds to a nonuniform rectangular grid in the rectangle R so that the corresponding grid in D will indeed be orthogonal. An illustration of this algorithm is shown in Figure 4.13, which consists of two grids in a channel with a circular arc. The lower part shows a grid obtained with Algorithm 3. The grid points are prescribed and their position is fixed while grid orthogonality is obtained at all four edges. The upper part shows

©1999 CRC Press LLC

FIGURE 4.11

FIGURE 4.12

Arc length-based grid.

Grid with boundary orthogonality.

an orthogonal grid obtained by Algorithm 4. The figure clearly demonstrates how the boundary grid points have to move in order to obtain an orthogonal grid. For more information on orthogonal grids, see Chapter 7. 4.2.3.5 Complete Grid Control at the Boundary In Section 4.2.3.3 we described the construction of a grid control map such that grid orthogonality is obtained at the boundary of D. However, the method provides no precise control of the height of the

©1999 CRC Press LLC

first grid cells along the boundary. In general, the cell height distributions of the first grid cell along the boundary in D is fairly good, as illustrated in Figure 4.8 and Figure 4.12. However, there are applications, especially in grid boundary layers for viscous flows, where not only grid orthogonality but also grid spacing should be precisely controlled. For example, it may be required that the first grid cell height is constant in the complete grid boundary layer, in spite of convex or concave parts of the boundary shape. In order to have precise control about both grid orthogonality and grid cell height, we have to consider more general grid control maps. Both the grid control map based on normalized arc length, defined by Eq. 4.27 and Eq. 4.28, and the one based on Dirichlet–Neumann boundary conditions, defined by Eq. 4.42 and Eq. 4.43, have the form s = s (ξ , t )

t = t ( s, h)

(4.51)

Grid control maps of this type have the advantage that the two families of grid lines are independent: a grid line ξ = const. in C is mapped to parameter space P as a curve defined by s = s (ξ,t), which will be mapped by the inverse of a harmonic map to a curve in domain D. For given values of ξ and η, the corresponding grid point in P is found as the intersection point of the two curves s = s (ξ,t), t = t (s,η). When the boundary grid point distribution is changed in one set of opposite edges and remains unchanged in the other set, then one family of grid lines remains unchanged in both P and D. Suppose that grid orthogonality and first-cell height specification are required at all four edges. Then the boundary conditions for the grid control map defined by Eq. 4.51 are shown in Figure 4.11. The boundary condition ∂ s /∂t = 0 at E3 and E4 in (ξ, t)-space is needed for grid orthogonality at E3 and E4 in D. The values of ∂ s /∂ξ at E1 and E2 in (ξ, t)-space control the cell height of the first grid cells at E1 and E2 in D. Similarly, the boundary condition ∂ t /∂s = 0 at E1 and E2 in (s, η)-space is needed for grid orthogonality at E1 and E2 in D. The values of ∂ t /∂η at E3 and E4 in (s, η)-space control the cell height of the first grid cells at E3 and E4 in D. The algorithm for complete control of both grid orthogonality and cell height along the four edges becomes the following. Algorithm 5. Complete grid control at boundary 1. Use Algorithm 3 to compute an initial boundary conforming grid in the interior of D which is orthogonal at the boundary. The corresponding grid control map is based on Eq. 4.42 and Eq. 4.43. 2. Compute ∂ s /∂ξ at E1 and E2 in (ξ, t)-space from Eq. 4.42. Compute ∂ t /∂η at E3 and E4 in (s, η)space from Eq. 4.43. Adapt ∂ s /∂ξ and ∂ t /∂η so that the grid in domain D gets the desired grid cell height distribution along the corresponding edges. Note that the harmonic map and its inverse depend only on the shape of domain D. Therefore it is possible to compute how a change, in for example ∂ s /∂ξ at E1 in (ξ, t)-space will change the cell height along edge E1 in D. 3. Compute s = s (ξ, t) in (ξ, t)-space so that all boundary conditions are satisfied. Also compute t = t (s, η) in (s, η)-space such that all boundary conditions are satisfied. Compute the corresponding grid control map s : C a P for given values of ξ and η. The corresponding grid point in P is found as the intersection point of the two curves s = s (ξ, t), t = t (s, η). 4. Compute the corresponding interior grid in D as described in Algorithm 1. The question remains how to compute s = s (ξ, t) and t = t (s, η) such that all boundary conditions are fulfilled. The boundary data s (0, t), s (1,t), s (ξ,0), s (ξ,1) and ∂ s /∂ξ (0,t), ∂ s /∂ξ (1,t), ∂ s /∂t (ξ,0), ∂ s /∂t (ξ,1), can be interpolated by using a bicubically blended Coon’s patch [10,36]. However, the use of such an algebraic interpolation method has a severe shortcoming because twist vectors have to be specified at the four corners.In general, the tangent boundary conditions ∂ s /∂ξ, ∂ s /∂t, are conflicting at a corner when the two edges of domain D are not orthogonal at the corresponding vertex. In that case, the twist vector is not well-defined at the corner. Because of the conflicting tangent boundary conditions at the corners, we prefer to apply an elliptic partial differential equation to interpolate the boundary data. A fourth-order elliptic operator is needed to satisfy all boundary conditions. Therefore, the biharmonic equations ©1999 CRC Press LLC

FIGURE 4.13 Orthogonal grid generation by boundary grid point movement along an edge. The grid in the lower part is orthogonal only at the boundary. The grid in the upper part is also orthogonal in the interior.

∆∆s = 0

(4.52)

∆∆t = 0

(4.53)

where ∆ = ∂2/∂ξ2 + ∂2/∂t2, and

where ∆ = ∂2/∂s2 + ∂2/∂η2 is a proper choice. The advantage of the use of the biharmonic equation to interpolate the boundary data is that the solution is always a smooth function even when the tangent boundary conditions are conflicting at the corners. A disadvantage is that the biharmonic operator does not fulfill a maximum principle. When there is a grid boundary layer along for example edge E1 in D then the monotonic boundary functions s0E3 (ξ) and s0E4 (ξ) have very small values in a large part of the interval 0 0 sets a lower bound on ε to avoid very large values appearing in computations. The coefficient α is chosen experimentally and is in the range 0.3 ≤ α ≤ 0.7.

©1999 CRC Press LLC

Computational formulas for the direct extension of the method to the case of adaptive planar grids will be described in detail below.

8.4 Harmonic Maps Between Surfaces. Derivation of Governing Equations 8.4.1 Introductory Remarks Recall that for grid generation in a domain Ω the auxiliary problem of constructing a harmonic mapping of this domain onto the parametric square is involved. A mapping of the domain boundary onto the square boundary is given. Laplace equations for unknown functions ξ and η are “inverted” into the equations for the functions x and y, Eq. 8.10, which are then solved numerically, as described in Section 8.3.1. On the other hand, the problem can be stated as a variational minimization of the functional Eq. 8.12 dependent on the unknown functions x(ξ, η) and y(ξ, η). The variational approach is convenient for the method extension to the case of surfaces. To achieve this, the problem of finding the harmonic mapping of the surface onto the parametric square is formulated. The one-to-one mapping between boundaries should be specified. In the following subsection a more common problem of constructing harmonic maps between manifolds is considered. The emphasis is placed on the formulation of the conditions, providing the one-toone mapping.

8.4.2 Theory of Harmonic Maps First we present some common definitions from the survey by Eells and Lemaire [1988]. Let M and N be two n-dimensional manifolds (surfaces) with metrics g and h, defined in local coordinates ui and ξα, i, α = 1, …, n. The energy density of a map ξ(u): (M, g) → (N, h) is called the function e(ξ ): M → R(≥ 0), defined in local coordinates as follows:

e(ξ )(u) = g ij (u)

∂ξ α (u) ∂ξ β (u) h (ξ (u)) ∂u i ∂u j αβ

(8.16)

where the standard summation convention is assumed, gij and hij are the elements of metric tensors G and H manifolds M and N, and gij is the inverse metric:

1 if i = k gij g jk = δ ki = 0 if i ≠ k This means if gij are the elements of matrix G, then gij are the elements of the inverse matrix G–1. The generalization of Dirichlet functional for the mapping ξ(u) is called the energy of the mapping and is defined as follows:

E(ξ ) = ∫ e(ξ )(u)dM , where dM = det(G) du1...du n

(8.17)

M

A smooth map ξ(u): (M, g) → (N, h) is called harmonic if it is an external of the energy functional E. The Euler equations, whose solution minimizes the energy [Eells and Lemaire, 1988] contain Christoffel symbols. The simplified solution form of these equations will be presented below. The fundamental result on the sufficient conditions of existence and uniqueness of harmonic maps, proved by Hamilton [1975] and Shoen and Yau [1978], can be formulated as the theorem.

©1999 CRC Press LLC

THEOREM 3. Let the smooth one-to-one map φ : M → N exist that is also one-to-one between boundaries ∂M and ∂N. The curvature of the manifold N is nonpositive, and its boundary ∂N is convex. Then there exists a unique harmonic map ϕ : M → N, such that ϕ is homotopy equivalent to φ and ϕ(∂M) = φ(∂M). Here we consider the case when N has a simple shape, for example, it is a unit cube in the Euclidean space. The conditions of the theorem (nonpositive curvature and convex boundary) are obviously satisfied in this case. Consequently, the theory of harmonic maps includes the theoretic foundation of the method, proposed by Winslow [1966]. So, consider when M is a n-dimensional manifold, N is a unit cube in Rn: 0 < ξ i < 1, i = 1, …, n. The Euclidean metric in Rn is hαβ = δαβ . If the local coordinates ui and ξα are the same, then Eq. 8.16 can be simplified to give

e(ξ ) = gij

∂ξ α ∂ξ β δ = gijδ ij = gii = Tr(G −1 ) ∂ξ i ∂ξ j αβ

Hence, the energy functional Eq. 8.17 will be 1

1

E(ξ ) = ∫ g (ξ )dM = ∫ ...∫ Tr(G −1 ) det(G) dξ 1...dξ n ii

M

(8.18)

The Euler equations for the functional Eq. 8.18 can be also simplified, and we can avoid the appearance of Christoffel symbols in these equations. Now we will derive these equations following Liseikin [1991].

8.4.3 Derivation of Governing Equations We denote by Srn a n-dimensional in Rn+k with a local coordinate system

(u ,..., u ) = u ∈ S i

n

n

⊂

Rn

The surface is defined by a nondegenerate transform

r(u) : S n → S rn

r = (r1 ,..., r n + k )

(8.19)

The new parameterization of the surface Srn is defined by a mapping of a unit cube Qn : {0 < ξ i < 1, i = 1, …, n} in Rn onto a surface Srn:

r(u(ξ )) : Qn → S rn ξ = (ξ 1 ,..., ξ n ) ∈ Qn

(8.20)

which is the composition of r(u) and some nondegenerate transform

u(ξ ) : Qn → S n

(8.21)

The problem of finding a new parameterization of the surface is stated as the problem of construction at this transformation u(ξ ). The mapping of r(u(ξ )) defines on a surface Srn a new coordinate system (ξ 1 … ξ n) = ξ, which generates a local metric tensor

{ }

G rξ = gijrξ

©1999 CRC Press LLC

i, j = 1, 2..., n

whose elements are scalar products of the vectors ri = ∂r/∂ξ i and rj = ∂r/∂ξ j:

∂r m ∂r m i j m =1 ∂ξ ∂ξ n+k

gijrξ = rr i j =∑

The elements of the metric tensor defined by the transformation r(u) are given by

{ }

G ru = gijru

i, j = 1, 2..., n

These elements are the scalar products of the vectors ∂r/∂ui and ∂r/∂uj:

∂r m ∂r m i j m =1 ∂u ∂u n+k

gijru = ∑

Consider the contravariant metric tensors whose elements form the symmetric matrices Gξr and Gur, inverse to the matrices Grξ and Gru:

gξijr = ( −1)

i+ j

( )

gurij = ( −1)

dξjir det G rξ

i+ j

durji det(G ru )

where djiξr and djiur are the determinants of cofactors of the elements g rijξ and gruij in the matrices Grξ and Gru correspondingly. Let us prove the following relation: n

gξijr = ∑ gurml m ,l

∂ξ i ∂ξ j ∂u m ∂ul

(8.22)

Indeed, substituting in the following identity the right-hand side of Eq. 8.22 instead of glpξr we obtain

δ ip = gilrξ gξlpr = gthru gurmjδ mh

∂r α ∂r α lp ∂r α ∂r α ∂u t ∂u h lp ∂u t ∂u h ∂ξ l ∂ξ p g = t g = gthru gurmj i = i l ξr h i l ξr ∂ξ ∂ξ ∂u ∂u ∂ξ ∂ξ ∂ξ ∂ξ l ∂u m ∂u j

t p t p ∂u t ∂ξ p ru hj ∂u ∂ξ j ∂u ∂ξ g = = δ ip δ = g t th ur ∂ξ i ∂u j ∂ξ i ∂u j ∂ξ i ∂u j

The summation is performed on repeated indices, here α = 1, 2, …, n + k; i, j, l, p, t, h, m = 1, …, n. Now taking Eq. 8.22 into account, the functional Eq. 8.17 takes the form

I = ∫ gξiir dS rn = S

rn

n

ml ∫ ∑ gur

S

rn i , m ,l

∂ξ i ∂ξ i rn dS ∂u m ∂ul

(8.23)

In the derivation of the Euler equations the integration domain in Eq. 8.23 will be replaced by Srn, and the surface element is transformed as follows:

dS rn = det(G ru )dS n = det(G ru )du1...du n

©1999 CRC Press LLC

Consequently, the functional Eq. 8.23 can be written as

n ∂ξ i ∂ξ i I = ∫ det(G ru ) ∑ gurml m l du1...du n i,m,l ∂u ∂u Sn

(8.24)

The quantities det ( G ru ) and gmlur in the functional Eq. 8.24 are independent on the functions ξ i(u) and their derivatives, and hence remain unchanged when ξ (u) is varied. Therefore the Euler equations for the functions ξ i(u), minimizing Eq. 8.24 are of the form i n ∂ ru ml ∂ξ det( G ) g = 0 i = 1,..., n ∑ ur m ∂ul m =1 ∂u l =1

L(ξ i ) = ∑ n

(8.25)

The equations which each component ui(ξ ) of the function u(ξ ) satisfies can be derived from Eq. 8.25. To achieve this, ith equation of the system Eq. 8.25 is multiplied by ∂uj/∂ξ i and summed over i. As a result, we have n

∑ L(ξ i ) i =1

i n ∂u j ∂u j ∂ n ru mp ∂ξ = det G g = ( ) ∑ ∑ ur ∂ξ i i,m =1∂u m p =1 ∂u p ∂ξ i

i j i t n ∂ n ∂ 2u j ru mp ∂ξ ∂u ru mp ∂ξ ∂ξ G g G g det det − =0 ( ) ( ) ∑ ∑ ur ur m∑ ∂u p ∂ξ i i,m, p,t =1 ∂u p ∂u m ∂ξ i∂ξ t m =1 ∂u i , p =1 n

Here j = 1, …, n. Now, multiplying each equation on 1/ det ( G ru ) and taking into account Eq. 8.22 and the relation

∂ξ i ∂u j = δ pj ∑ p i i =1 ∂u ∂ξ n

we finally obtain

gξitr

n ∂ 2u j 1 ∂ = ∑ m ru ∂ξ i∂ξ t ∂ det(G ) m =1 u

(

det(G ru )gurmj

)

j = 1,..., n

(8.26)

This is a quasilinear system of elliptic equations that is a direct extension of the system Eq. 8.10. It will be the basis of the algorithms for structured two-dimensional adaptive grids, grids on surfaces and threedimensional grids. For derivation of governing equations in all these cases, we need only to express the contravariant components g ijξ r and gijur as functions on the covariant components gξijr and gurij and substitute the associate expressions into Eq. 8.26 for n = 2 and n = 3.

8.5 Two-Dimensional Adaptive-Harmonic Structured Grids 8.5.1

Derivation of Equations

Let Ω be a two-dimensional domain in R2, and let in a Euclidean space R3, the surface Sr2 is given as z = f(x, y). We introduce new notations

©1999 CRC Press LLC

FIGURE 8.3

Harmonic coordinates on the surface of the graph of the graph of a function z = f(x, y).

r = (r1 , r 2 , r 3 ) = ( x, y, z ) = ( x, y, f ( x, y)) ∈ S r 2

ξ = (ξ 1 , ξ 2 ) = (ξ, η) ∈ Q2 ⊂ R2

⊂

u = (u1 , u 2 ) = ( x, y) ∈ Ω ⊂ R2

R3

(

)

(

rξ = xξ , yξ , zξ , rη = xη , yη , zη

)

The problem formulation is the following. Suppose we are given a simply connected domain Ω with a smooth boundary in the x, y plane. Consider the surface z = f(x, y) of the graph of the function f ∈ C2(Ω). It is required to find a mapping of the parametric square Q2 onto the domain Ω under a given mapping between boundaries such that the mapping of the surface onto the parametric square be harmonic (see Figure 8.3). Thus, the problem is to minimize the Dirichlet functional, written for a surface

(

)

I = ∫ gξ11r + gξ22r dS r 2

(8.27)

where g11ξr g12ξr g22ξr are the elements of the contravariant metric tensor Gξr dependent on the elements of the covariant metric tensor Grξ as follows:

( )

rξ gξ11r = g22 det G rξ

( )

gξ22r = g11rξ det G rξ

( )

gξ12r = gξ21r = − g12rξ det G rξ

where

g11rξ = rξ2 = xξ2 + yξ2 + zξ2

( )

( )

rξ det G rξ = g11rξ g22 − g12rξ

©1999 CRC Press LLC

(

)

rξ g12rξ = g21 = rξ ⋅ rη = xξ xη + yξ yη + zξ zη 2

zξ = fx xξ + fy yξ ,

rξ g22 = rη2 = xη2 + yη2 + zη2

zη = fx xη + fy yη

(8.28)

Inverting dependent and independent variables in Eq. 8.27 and taking in account

dS r 2 =

( )

rξ rξ rξ g11 g22 − g12

2

dξ d η

we obtain

I=∫

rξ rξ g11 + g22

( )

rξ rξ rξ g11 g22 − g12

2

dξ dη

(8.29)

Euler equation for the functional Eq. 8.29 follow from Eq. 8.26 for n = 2, k = 1. We need only to compute the elements of the covariant metric tensor Grξ and contravariant metric tensor Gξr of the transform r(u) = r(x, y) : Ω → Sr2:

r = ( x, y, f ( x, y)) ru g11

=

rx2

( )

= 1+

f x2

ru g12

( )

ru ru ru det G ru = g11 g22 − g12

2

rx = (1, 0, f x ) =

ru g21

(

ry = 0,1, f y

= rx ⋅ ry = f x f y

= 1 + f x2 + f y2

ru g22

( )

)

= ry2 = 1 + f y2

( )(

det G rξ = det G ru xξ yη − xη yξ

( ) ( ) (1 + fx2 + fy2 ) ru 12 = − g21 det(G ru ) = − f x f y (1 + f x2 + f y2 ) gur 22 22 = g yru (1 + f x2 + f y2 ) = g rT gur gur

)

2

ru 11 = g22 det G ru = 1 + f y2 gur

Substituting these expressions into Eq. 8.26, we obtain equations, written in a form convenient for practical use:

∂ 1 + fy2 ∂ fx fy L( x ) = α xξξ − 2 βxξη + γ xηη − J 2 D − =0 ∂y D ∂x D

(8.30)

∂ − fx fy ∂ 1 + fx2 + =0 L( y) = αyξξ − 2 βyξη + γ yηη − J 2 D ∂y D ∂x D where

D = 1 + fx2 + fy2 , J = xη yξ , α = xη2 + yη2 + fη2 , β = xξ xη + yξ yη + fξ fη , γ = xξ2 + yξ2 + fξ2 .

8.5.2

Numerical Implementation

Eq. 8.30 are approximated on the square grid with the unit size Eq. 8.4, introduced above with the simplest difference relations

©1999 CRC Press LLC

[ ] = 0.5( x y ≈ [ y ] = 0.5( y f ≈ [ f ] = 0.5( f xξ ≈ xξ ξ

ξ ij

ξ

ξ ij

i +1, j

− xi −1, j

[ ]

xξξ ≈ xξξ

[ ]

xξη ≈ xξη

[ ]

xηη ≈ xηη

ij

[ ] = 0.5( x yη ≈ [ yη ] = 0.5( y fη ≈ [ fη ] = 0.5( f

) i +1, j − yi −1, j ) i +1, j − fi −1, j )

ij

xη ≈ xη

ij

ij

ij

(

[ ]

ij

(

[ ] = y − 2y + y α ≈ [ xη ] + [ yη ] + [ fη ] β ≈ [ xξ ] [ xη ] + [ yξ ] [ yη ] + [ fξ ] [ fη ] 2

2

ij

ij

ij

i, j +1

ij

ij

ij

(8.31)

)

i , j −1

ij

ij

ij

)

= yi +1, j − 2 yij + yi −1, j

= 0.25 yi +1, j +1 − yi +1, j −1 − yi −1, j +1 + yi −1, j −1

yηη ≈ yηη

2

− x i , j −1

= 0.25 xi +1, j +1 − xi +1, j −1 − xi −1, j +1 + xi −1, j −1

i, j

[ ]

i, j +1

= xi +1, j − 2 xij + xi −1, j

ij

= xi, j +1 − 2 xi, j + xi, j −1 yξξ ≈ yξξ

yξη ≈ yξη

) i, j +1 − yi, j −1 ) i, j +1 − fi, j −1 )

ij

ij

ij

[ ] + [y ] + [ f ]

γ ≈ xξ

2

ij

2 ξ ij

2 ξ ij

Substitute these expressions into Eq. 8.30 and denote the difference approximations of L(x) and L(y) as [L(x)]ij and [L(y)]ij correspondingly. Suppose that the coordinates of grid nodes (x, y)ij at the lth step of iterations are determined. Then the (l + 1)-th step is accomplished as follows:

xijl+1 = xijl + τ

[ L( x )]ij 2[α ]ij + 2[γ ]ij

yijl+1 = yijl + τ

[ L( y)]

ij

(8.32)

2[α ]ij + 2[γ ]ij

The expressions in square brackets denote the corresponding approximations of expressions in the grid node (i, j) at the lth iteration step. The value of iteration parameter τ is chosen in limits 0 < τ < 1, usually τ = 0.5. Derivatives [fx]ij and [fy]ij in the ijth grid node are evaluated with the centered differences

(f (x (f [ f ] = − (x

[ fx ]ij = y ij

i +1, j

− fi −1, j

i +1, j

− xi −1, j

)( y )( y )( x )( y

) ( ) ( )−(f ) − (x

)( )( )( x )( y

) )

i , j +1

− yi , j −1 − fi , j +1 − fi , j −1 yi +1, j − yi −1, j

i , j +1

− yi , j −1 − xi , j +1 − xi , j −1 yi +1, j − yi −1, j − xi , j −1

i +1, j

− fi −1, j

i , j +1

i +1, j

− xi −1, j

i , j +1 − yi , j −1

i , j +1

− fi , j −1

i , j +1 − xi , j −1

i +1, j

− xi −1, j

i +1, j

− yi −1, j

) )

These formulas must be modified for the boundary nodes. Indices, “leaving” the computational domain must be replaced by the nearest boundary indices. For example, if j = 1, then (i, j – 1) must be replaced by (i, j). Note that if [fξ]ij = 0 and [fη]ij = 0, then [fx]ij = 0 and [fy]ij = 0 and the method Eq. 8.32 reduces to the Winslow method, described briefly in Section 8.3.1. The adaptive-harmonic grid generation algorithm is formulated as follows: 1. 2. 3. 4.

Compute the values of the control function at each grid node. The result is fij. Evaluate derivatives (fx)ij and (fy)ij and other expressions in Eq. 8.32 using the above formulas. Make one iteration step and compute new values of xij and yij. Repeat, starting with Step 1 to convergency.

©1999 CRC Press LLC

The resulting algorithm can be used in the numerical solution of the partial differential equations. In this case, at the first step of the algorithm the values fij in each grid node are taken from the finitedifference or finite element solution of the host equations. Note that for control of the number of grid nodes in the layers of high gradients, it is convenient to use Cf instead of f(x, y). The larger the coefficient C, the greater the number of nodes in the layer of high gradients of the function f.

8.6 Two-Dimensional Adaptive-Harmonic Irregular Meshes 8.6.1 Problem Formulation In notations of Section 8.5.1 the problem is formulated as follows. Suppose we are given a simply connected domain Ω with a smooth boundary in the x, y plane. Consider the surface z = f(x, y) of the graph of the function f ∈ C1(Ω ). It is required to find a mapping of the parametric square Q2 onto a domain Ω under a given mapping between boundaries such that the mapping of the surface onto the parametric square be harmonic (see Figure 8.3). Thus, the problem is to minimize the harmonic functional Eq. 8.27. Substituting expressions Eq. 8.28 for zξ and zη into Eq. 8.29, we obtain the functional from the paper by Ivanenko [1993] to define adaptive-harmonic grid, clustered in regions of high gradients of the function f(x, y):

I=∫

(x

2 ξ

)

(

)( ) ( − x y ) 1+ f + f

+ xη2 (1 + fx2 ) + yξ2 + yη2 1 + fy2 + 2 fx fy xξ yξ + xη yη

(x y

ξ η

2 x

η ξ

2 y

)dξdη

(8.33)

The problem of irregular mesh smoothing and adaption is formulated as follows. Let the coordinates of irregular mesh be given. The mesh is formed by quadrilateral elements, i.e., the array COR(N, k) is also defined. The problem is to find new coordinates of the mesh nodes, minimizing the sum of the functional Eq. 8.33 values, computed for a mapping of the unit square onto each cell of a mesh (see Figure 8.3).

8.6.2 Approximation of the Functional The functional Eq. 8.33 possesses the same properties as the functional Eq. 8.11, and it can be also approximated in such a way that its minimum is attained on a grid/mesh of convex quadrilaterals: Ne

4

1 [ Fk ]N N =1 k =1 4

I = ∑∑ h

(8.34)

where

Fk =

[

] [ ( ) ] + 2D ( f ) ( f )

D1 1 + ( fx )k + D2 1 + fy 2

[

2 k

( )]

Jk 1 + ( fx )k + fy 2

3

x k

y k

2 12 k

D1 = ( xk −1 − xk ) + ( xk +1 − xk ) D2 = ( yk −1 − yk ) + ( yk +1 − yk ) 2

2

2

D3 = ( xk −1 − xk )( yk −1 − yk ) + ( xk +1 − xk )( yk +1 − yk ) Jk = ( xk −1 − xk )( yk +1 − yk ) − ( xk +1 − xk )( yk −1 − yk )

©1999 CRC Press LLC

2

Here (fx)k and (fy)k are the values of derivatives, computed in the node number k of the cell number N. If the set of convex meshes D is not empty, the system of algebraic equations

Rx =

∂I h =0 ∂xn

Ry =

∂I h =0 ∂yn

has at least one solution which is a convex mesh. To find it, one must first find a certain initial convex mesh, and then use some method of unconstrained minimization of the function Ih. Since this function has an infinite barrier on the boundary of the set D, each step of the method can be chosen so that the mesh always remains convex.

8.6.3

Minimization of the Functional

Suppose the mesh at the lth step of the iterations is determined. We use the quasi-Newtonian procedure when the (l + 1)-th step is accomplished as follows:

∂R ∂R ∂R ∂R ∂R ∂R = x − τ Rx y − Ry x x y − y x ∂yn ∂xn ∂yn ∂xn ∂yn ∂yn

−1

∂R ∂R ∂R ∂R ∂R ∂R ynl+1 = ynl − τ Ry x − Rx y x y − y x ∂xn ∂xn ∂yn ∂xn ∂yn ∂xn

−1

x

l +1 n

l n

(8.35)

where τ is the iteration parameter, which is chosen so that the mesh remains convex. For this purpose after each step conditions Eq. 8.8 are checked and if they are not satisfied, this parameter is multiplied by 0.5. Then conditions Eq. 8.8 are checked for the grid, computed with a new value of τ and if they are not satisfied, this parameter is multiplied by 0.25 and so on. The adaptive-harmonic algorithm for r–refinement is formulated as follows: 1. 2. 3. 4. 5.

Generate an initial mesh by the use of a marching method. Compute the values of the control function fn at each mesh node. Evaluate derivatives (fx)n and (fy)n and other expressions in Eq. 8.35. Make one iteration step and compute new values of xn and yn. Repeat starting with Step 2 to convergency.

Computational formulas for [fx]n and [fy]n will be presented below.

8.6.4 Derivation of Computational Formulas Note that the approximation Eq. 8.34 of the functional Eq. 8.33 can be obtained as it was done for the functional Eq. 8.11 in Section 8.3.2. The square cell on the plane ξ, η is divided into two triangles first by the diagonal 13, and then by 24. The mapping of the square onto a quadrilateral cell in the plane x, y is approximated by two functions which are linear in each triangle. Denote this functions as before xh(ξ, η), y h(ξ, η). All derivatives in the integrand of Eq. 8.33 is easy to compute, as it was done in Section 8.3.2. Then the integral Eq. 8.33 over the square cell in the plane ξ, η is approximated by a half of the sum of values of this integral, computed for piecewise linear approximations on triangles, obtained for the first and the second splittings. The result is the approximation Eq. 8.34. Four triangles, introduced above are considered for the quadrilateral cell number N. Each of these triangles corresponds to a corner with the number k and gives a proper contribution to the functional and also to the values of its derivatives. Since the integrand in Eq. 8.33 does not depend on the rotation of the coordinate system ξ, η, then all the computational formulas will be the same for all triangles. We enumerate nodes of triangle corresponding to the corner with the local number k from 1 to 3 as follows:

©1999 CRC Press LLC

node 1 corresponds to the local node number k – 1 of the cell N, node 2 corresponds to the local node number k of the cell N, node 3 corresponds to the local node number k + 1 of the cell N. Then in the new numeration the expression for Fk will be

F=

[

]

[

]

D1 1 + ( fx )2k + D2 1 + ( fy )2k + 2 D3 ( fx )k ( fy )k

[

J2 1 + ( fx )2k + ( fy )2k

(8.36)

]

12

where

D1 = ( x1 − x2 ) + ( x3 − x2 ) 2

D2 = ( y1 − y2 ) + ( y3 − y2 )

2

2

2

D3 = ( x1 − x2 )( y1 − y2 ) + ( x3 − x2 )( y3 − y2 ) J2 = ( x1 − x2 )( y3 − y2 ) − ( x3 − x2 )( y1 − y2 )

We introduce notations

U=

[

] [ ( ) ] + 2D ( f ) ( f )

D1 1 + ( fx )k + D2 1 + fy 2

2

3

k

[1 + ( f ) + ( f ) ]

x k

y k

2 12

2 x k

y k

V = ( x1 − x2 )( y3 − y2 ) − ( x3 − x2 )( y1 − y2 ) We use formulas for the derivatives of the relation of two functions. Differentiating, we obtain

U V U y − FVy U x − FVx U − 2 Fx Vx − FVxx Fx = Fy = Fxx = xx V V V U xy − Fx Vy − FyVx − FVxy U yy − 2 FyVy − FVyy Fxy = Fyx = Fyy = V V F=

(8.37)

For the triangle vertex with the number 1, we should substitute appropriate expressions instead of U and V, Ux and Vx and so on into Eq. 8.37 and replace x and y by x1 and y1. For the vertex 1 we have

Vx = y3 − y2 , Vy = x2 − x3 Vxx = 0, Vxy = 0, Vyy = 0 Ux

[1 + ( f ) ]( x − x ) + ( f ) ( f ) ( y − y ) =2 2 x k

1

2

y k 2 12

[1 + ( f ) + ( f ) ] 2 x k

1 + ( fx )k

2

U xx = 2

x k

[1 + ( f ) + ( f ) ] 2

x k

©1999 CRC Press LLC

2 12

y k

y k

1

2

[1 + ( f ) ](y − y ) + ( f ) ( f ) ( x − x ) U =2 [1 + ( f ) + ( f ) ] 2

y k

y

2

x k

]

U yy

y k

2 12

2 x k

( fx )k ( fy )k U xy = 2 2 12 2 1 + ( fx )k + ( fy ) k

[

1

y k

( ) =2 [1 + ( f ) + ( f ) ] 1 + fy 2

x k

2 k

2 12

y k

1

2

For the vertex 2 we have

Vx = y1 − y3 Vxx = 0

Ux

[1 + ( f ) ](2 x =2 2 x k

2

Vy = x3 − x1

Vxy = 0 Vyy = 0

( ) (2 y

− x1 − x3 ) + ( fx )k fy

[1 + ( f ) + ( f ) ] 2 x k

2

k

− y1 − y3 )

2 12

y k

[1 + ( f ) ](2 y − y − y ) + ( f ) ( f ) (2 x − x − x ) U =2 [1 + ( f ) + ( f ) ] 2

y k

2

1

3

y

2 x k

1 + ( fx )k

2

U xx = 4

[

( )]

1 + ( fx )k + fy 2

2 12 k

x k

y k

2

1

3

2 12

y k

( fx )k ( fy )k U xy = 4 2 12 2 1 + ( fx )k + ( fy ) k

[

]

U yy

( ) =2 [1 + ( f ) + ( f ) ] 1 + fy

2 k

2 12

2

x k

y k

For the vertex 3 we have

Vx = y2 − y1 Vxx = 0

Ux

Vy = x1 − x2

Vxy = 0

Vyy = 0

[1 + ( f ) ]( x − x ) + ( f ) ( f ) ( y − y ) =2 2 x k

3

x k

2

[1 + ( f ) + ( f ) ] 2 x k

y k

3

2

2 12

y k

[1 + ( f ) ]( y − y ) + ( f ) ( f ) ( x − x ) U =2 [1 + ( f ) + ( f ) ] 2

y k

3

y

2

x k

2

x k

1 + ( fx )k

2

U xx = 2

[1 + ( f ) + ( f ) ] 2

x k

2 12

y k

y k

2

U yy

( ) =2 [1 + ( f ) + ( f ) ]

y k

( fx )k ( fy )k U xy = 2 2 12 2 1 + ( fx )k + ( fy ) k

[

3

2 12

]

1 + fy 2

x k

2 k

2 12

y k

Computations are performed as follows. Let F and its derivatives on x1 and y1 be computed with the use of formulas Eq. 8.37 for the cell number N and triangle number k. Then the computed values are added to the appropriate array elements

Ih + = F

[ Rx ]n + = Fx [ Ry ]n + = Fy

[ Rxx ]n + = Fxx [ Rxy ]n + = Fxy [ Ryy ]n + = Fyy where n = COR(N, k – 1). Similarly for the vertex 2, the correspondence between local and global number is n = COR(N, k). Similarly for the vertex 3, the correspondence between local and global number is n = COR(N, k + 1). Derivatives [fx]n and [fy]n are computed as follows. All triangles of the mesh are scanned and for the triangle number k of the cell number N the following values are computed:

©1999 CRC Press LLC

fx = ( f1 − f2 )( y3 − y2 ) − ( f3 − f2 )( y1 − y2 )

fy = ( x1 − x2 )( f3 − f2 ) − ( x3 − x2 )( f1 − f2 ) J2 = ( x1 − x2 )( y3 − y2 ) − ( x3 − x2 )( y1 − y2 ) where f1, f2, and f3 are values of the function f at vertices of the triangle, numbered 1, 2, and 3, corresponding to local numbers of corners of a quadrilateral cell k – 1, k and k + 1. Computed values are added to corresponding array elements (which were first cleared):

[ fx ]n + = fx [ fy ]n + = fy [ J ]n + = J2

n = COR( N , k )

New values of derivatives are computed as follows:

[f ]

[ fx ]n = [ J ]n

y n

= [ J ]n

Here, according to C-language notations, a+ = b means that the new value of a becomes equal to a + b, and a/ = b means that the new value of a becomes equal to a/b. So, the iteration method for irregular mesh relaxation and adaption is described in detail.

8.7 Adaptive-Harmonic Structured Surface Grid Generation 8.7.1 Derivation of Equations Introduce the following notations:

r = (r1 , r 2 , r 3 , r 4 ) = ( x, y, z, f ) ∈ S r 2

(

u = (u1 , u 2 ) = (u, v) ∈ Q2

rξ = xξ , yξ , zξ , fξ

)

(

⊂

R2

rη = xη , yη , zη , fη

)

⊂

R4

ξ = (ξ 1 , ξ 2 ) = (ξ, η) ∈ Q2

⊂

R2

ru = ( xu , yu , zu , fu ) rv = ( xv , yv , zv , fv )

Thus, consider a two-dimensional surface in a four-dimensional space, defined as x = x(u,v), y = y(u, v), z = z(u,v), f = f(u,v). Let functions ξ = ξ(u,v), η = η(u,v) are used to define a new parameterization of a surface. The problem of construction the adaptive-harmonic grid on a surface is stated as the problem of finding the new parameterization u = u(ξ,η), v = v(ξ,η), minimizing the functional Eq. 8.24, specified for this surface. The result of minimization will be a new parameterization u = u(ξ,η), v(ξ,η), defining the adaptiveharmonic grid on a surface. Difficulties encountered in this problem are concerned with nonunique solutions of its discrete analog, in spite of the result from the harmonic map theory that the continuous problem has a unique solution [Steinberg and Roache, 1990]. Metric tensor elements g ruij are defined ru g11ru = xu2 + yu2 + zu2 + fu2 g12ru = xu xv + yu yv + zu zv + fu fv g22 = xv2 + yv2 + zv2 + fv2

We write out the Euler equations in the case of adaption. These equations follow from Eq. 8.26 if n = 2, k = 2:

©1999 CRC Press LLC

ru ∂ g22 ∂ g12ru L(u) = αuξξ − 2 βuξη + γuηη − J 2 D − =0 ∂u D ∂v D

∂ − g12ru ∂ g11ru L(v) = αvξξ − 2 βvξη + γvηη − J 2 D + =0 ∂u D ∂v D

(8.38)

where ru D = g11ru g22 − ( g12ru ) J = uξ vη − uη vξ 2

rξ α = g22 D2 J 2 = xη2 + yη2 + zη2 + fη2

β = g12rξ D2 J 2 = xξ xη + yξ yη + zξ zη + fξ fη

γ = g11rξ D2 J 2 = xξ2 + yξ2 + zξ2 + fξ2

8.7.2 Numerical Implementation The method Eq. 8.32 is used for the numerical solution of Eq. 8.38, where x and y are replaced by u and v and [L(u)]ij and [L(v)]ij are the approximations of Eq. 8.38 at the grid node ij. All derivatives on u and v are computed with the use of formulas similar to formulas from Section 8.5.2:

( fi +1, j − fi −1, j )(vi, j +1 − vi, j −1 ) − ( fi, j +1 − fi, j −1 )(vi +1, j − vi −1, j ) (ui +1, j − ui −1, j )(vi, j +1 − vi, j −1 ) − (ui, j +1 − ui, j −1 )(vi +1, j − vi −1, j ) ( fi +1, j − fi −1, j )(ui, j +1 − ui, j −1 ) − ( fi, j +1 − fi, j −1 )(ui +1, j − ui −1, j ) [ fv ]ij = − (ui +1, j − ui −1, j )(vi, j +1 − vi, j −1 ) − (ui, j +1 − ui, j −1 )(vi +1, j − vi −1, j ) [ fu ]ij =

The adaptive-harmonic surface grid generation algorithm is formulated as follows: 1. 2. 3. 4. 5.

Generate a quasi-uniform harmonic surface grid using the same algorithm as for adaption, but f = 0. Compute the values of the control function at each grid node. The result is fij. Evaluate derivatives (fu)ij and (fv)ij and other expressions in Eq. 8.38 using the above formulas. Make one iteration step and compute new values of uij and vij. Repeat starting with Step 2 to convergency.

The resulting algorithm is simple in implementation but can demand a special procedure for the choice of the parameter τ to achieve the numerical stability.

8.8 Irregular Surface Meshes 8.8.1 Problem Formulation In notations of the previous section, consider a two-dimensional surface in a four-dimensional space, defined as x = x(u, v), y = y(u, v), z = z(u, v), f = f(u, v). Let functions ξ = ξ(u, v), η = η(u, v) are used to define a new parameterization of a surface. The problem of construction of the adaptive-harmonic grid on a surface is stated as the problem of finding the new parameterization u = u(ξ, η), v = v(ξ, η) minimizing the functional

I=∫

©1999 CRC Press LLC

(

)

(

)

( −u v )

ru g11ru uξ2 + uη2 + 2 g12ru uξ vξ + uη vη + g22 vξ2 + vη2 ru − (g g11ru g22

) (u v

ru 2 12

ξ η

η ξ

)dξdη

(8.39)

where

g11ru = xu2 + yu2 + zu2 + fu2

g12ru = xu xv + yu yv + zu zv + fu fv

ru g22 = xv2 + yv2 + zv2 + fv2

(8.40)

The result of minimization will be a new parameterization u = u(ξ, η), v = v(ξ, η). Now we can formulate the problem of irregular surface mesh smoothing and adaption. Let coordinates of an irregular mesh in the plane u, v be given:

(u, v)n

n = 1,..., Nn

The mesh is formed by quadrilateral elements, i.e., the array COR(N, k) is also defined. Functions x = x(u, v), y = y(u, v), z = z(u, v) and f = f(u, v) are assumed to be specified, for example, can be computed by analytic formulas. The problem is to find new coordinates of the mesh nodes, minimizing the sum of the functional Eq. 8.39 values, computed for a mapping of the unit square in the plane ξ, η onto each cell of a mesh in the plane x, y.

8.8.2

Approximation of the Functional

Note that if in the functional Eq. 8.33 we replace expressions for 1 + ( fx)2 by gru11, fx fy by gru12, and 1 + ( fy)2 by gru22, we obtain the functional Eq. 8.39. Hence, the last one possesses all the properties of the functional Eq. 8.33 and also can be approximated in such a way that the minimum of its discrete analog is attained on a nondegenerate grid of convex quadrilaterals on the plane u, v. The algorithm from the Section 8.5 can be used for its approximation and minimization: Ne

4

1 [ Fk ]N N =1 k =1 4

Ih = ∑∑

(8.41)

where

Fk =

ru D1g11ru + D2 g22 + 2 D3 g12ru ru Jk g11ru g22 − ( g12ru )

D1 = (uk −1 − uk ) + (uk +1 − uk ) 2

2

2

D2 = (vk −1 − vk ) + (vk +1 − vk ) 2

2

D3 = (uk −1 − uk )(vk −1 − vk ) + (uk +1 − uk )(vk +1 − vk ) Jk = (uk −1 − uk )(vk +1 − vk ) − (uk +1 − uk )(vk −1 − vk )

Here the values g ruij are computed at the node number k of the cell number N. If the set D of convex meshes on the plane u, v is not empty, the system of algebraic equations

Ru =

∂I h =0 ∂un

Rv =

∂I h =0 ∂vn

has at least one solution that is a convex mesh. To find it, one must first find a certain initial convex mesh, and then use some method of unconstrained minimization of the function Ih. Since this function has an infinite barrier on the boundary of the set of convex meshes, each step of the method can be chosen so that the mesh always remains convex.

©1999 CRC Press LLC

8.8.3 Minimization of the Functional Suppose the mesh at the lth step of the iterations is determined. We use the quasi-Newtonian procedure when the (l+1)-th step is accomplished by solving two linear equations for each interior node:

τRu +

∂Ru l +1 l ∂Ru l +1 l (un − un ) + ∂v (vn − vn ) = 0 ∂un n

(8.42)

∂R ∂R τRv + v (unl+1 − unl ) + v (vnl+1 − vnl ) = 0 ∂un ∂vn

where τ is the iteration parameter, which is chosen so that the mesh remains convex. For this purpose after each step the conditions of grid convexity on the plane u, v are checked and if they are not satisfied, this parameter is multiplied by 0.5. The adaptive-harmonic algorithm for the mesh smoothing and adaption on a surface is formulated as follows: 1. 2. 3. 4. 5.

Generate an initial mesh with the use of a marching method. Compute new values xn, yn, zn and fn at each mesh node. Evaluate derivatives [xu]n and [xv]n, [yu]n and [yv]n, [zu]n and [zv]n, [fu]n and [fv]n used in Eq. 8.42. Make an iteration step and compute new values of un and vn. Repeat starting with Step 2 to convergency.

Computational formulas for [fu]n and [fv]n can be obtained as described in Section 8.6.4.

8.8.4 Derivation of Computational Formulas Recall that if in the functional Eq. 8.33 we replace expressions for 1 + (fx)2 by g ru11, fx fy by g ru12, and 1 + (fy)2 by g ru22, we obtain the functional Eq. 8.39. From this follows that for derivation of computational formulas for surface meshes we need only to perform these replacements in computational formulas for adaptive planar meshes, described in Section 8.6.4.

8.9 Three-Dimensional Regular Grids 8.9.1 Derivation of Equations We will derive equations at once for the case of adaptation. Introduce notations

r = (r1 , r 2 , r 3 , r 4 ) = ( x, y, z, f ) ∈ S r 3 ⊂ R 4

u = (u1 , u 2 , u 3 ) = ( x, y, z ) ∈ Ω ⊂ R3

(

rξ = xξ , yξ , zξ , fξ

)

rx = (1, 0, 0, fx )

ξ = (ξ 1 , ξ 2 , ξ 3 ) = (ξ, η, µ ) ∈ Q3 ⊂ R3

( ) r = ( x , y , z , f ), = (0,1, 0, f ) r = (0, 0,1, f ).

rη = xη , yη , zη , fη ry

y

µ

z

µ

µ

µ

µ

z

The functional Eq. 8.24 in the three-dimensional case has the form

(

)

I = ∫ gξ11r + gξ22r + gξ33r dS r 3 where dSr3 is the element of the surface Sr3.

©1999 CRC Press LLC

(8.43)

The functional Eq. 8.43 can be used for constructing harmonic coordinates on the surface of the graph of control function dependent on three variables. Projection of these coordinates onto a physical domain gives an adaptive-harmonic grid, clustered in regions of high gradients of adapted function f(x, y, z). The Euler equations of the functional Eq. 8.43 follow from Eq. 8.26 for n = 3, k = 1. We need only to compute the elements of the covariant metric tensor Gru and contravariant tensor Gur of the transform r(u) = r(x, y, z) : Ω → Sr3: ru ru g11ru = rx2 = 1 + fx2 g22 = ry2 = 1 + fy2 g33 = rz2 = 1 + fz2 , ru ru ru ru g12ru = g21 = rx ⋅ ry = fx fy g13ru = g31 = rx ⋅ rz = fx fz g23 = g32 = ry ⋅ rz = fy fz

[

]

ru ru ru det(G ru ) = g11ru g22 g33 − ( g23 ) − g12ru (g12ru g33ru − g13ru g23ru ) + g13ru (g12ru g23ru − g22ru g13ru ) = 2

(1 + f )(1 + f

[

( )

2 x

2 y

)

+ fz2 − fx2 fy2 − fx2 fz2 = 1 + fx2 + fy2 + fz2

( ) ] − g (g

rξ rξ rξ g33 − g23 det G rξ = g11rξ g22

[ (

2

rξ 12

) ( − ( g ) ] det(G )

)

rξ rξ 12 33

(

)

rξ rξ rξ rξ g − g13rξ g23 g13 = + g13rξ g12rξ g23 − g22

(

)

det(G ru ) xξ yη zµ − yµ zη − yξ xη zµ − x µ zη + zξ xξ yη − xη yξ

[

gξ13r gξ23r

rξ rξ 12 23

rξ rξ 11 23

(

rξ 2 23

rξ

rξ rξ 13 22

rξ

rξ rξ 13 12

gur11 = 1 + fy2 + fz2

2 x

+ fy2 + fz2

gur13 = − fx fz 1 + fx2 + fy2 + fz2 gur23 = − fy fz

2 x

+ fy2 + fz2

) )

)

rξ

rξ 2 12

rξ rξ 11 22

33 ξr

det G rξ

rξ 2 12

rξ rξ 11 33

22 ξr

rξ

) (1 + f

( (1 + f

rξ rξ gξ12r = − g12rξ g33 − g13rξ g23

)

2

( ) = [ g g − g g ] det(G ) g = [ g g − ( g ) ] det(G ) = − [ g g − g g ] det(G ) g = [ g g − ( g ) ] det(G )

rξ rξ gξ11r = g22 g33

(

)]

rξ

( + f ) (1 + f + f ) (1 + f

) +f ) +f )

gur12 = − fx fy 1 + fx2 + fy2 + fz2

gur22 = (1 + fx2

(

gur33 = 1 + fx2

2 z

2 y

2 x

2 x

+ fy2 + fy2

2 z

2 z

Substituting these expressions into Eq. 8.26, we obtain equations convenient for practical use:

L( x ) = gξ11r xξξ + 2 gξ12r xξη + 2 gξ13r xξµ + gξ22r xηη + 2 gξ23r xηµ + gξ33r x µµ − 2 2 1 ∂ 1 + f y + fz ∂ − f x f y ∂ − f x fz + + =0 D ∂x D ∂y D ∂z D

L( y) = gξ11r yξξ + 2 gξ12r yξη + 2 gξ13r yξµ + gξ22r yηη + 2 gξ23r yηµ + gξ33r yµµ −

1 ∂ − fx fy ∂ 1 + fx2 + fz2 ∂ − fy fz + + =0 D ∂x D D ∂y ∂z D L( z ) = gξ11r zξξ + 2 gξ12r zξη + 2 gξ13r zξµ + gξ22r zηη + 2 gξ23r zηµ + gξ33r zµµ − 2 2 1 ∂ − f x fz ∂ − f y fz ∂ 1 + f x + f y + + =0 D ∂x D D ∂y D ∂z

where

D = 1 + fx2 + fy2 + fz2

©1999 CRC Press LLC

(8.44)

8.9.2 Numerical Implementation The problem of grid generation in three dimensions will be considered in the following formulation. In a simply connected domain Ω in the space x, y, z a grid

( x, y, z )ijm

i = 1,..., i ∗ j = 1,..., j ∗ m = 1,..., m∗

must be constructed with given coordinates of boundary nodes

( x, y, z )ij1 ( x, y, z )ijm* ( x, y, z )i1m ( x, y, z )ij*m ( x, y, z )1 jm ( x, y, z )i* jm Instead of the parametric cube the following parametric domain can be introduced to simplify the computational formulas:

1 0 m = 1,...,12; N = 1,..., Ne

(8.46)

where (JT left)m is a volume of the tetrahedron corresponding to the edge number m and defining the lefthand coordinate system, (JT right)m is a volume of the tetrahedron corresponding to the edge number m and defining the right-hand coordinate system (each cube has 12 edges), N is the cell number, Ne is the total number of cells. Conditions Eq. 8.46 define the discrete analog of the Jacobian positiveness in the three-dimensional case. Meshes satisfying inequalities Eq. 8.46 we will call nondegenerate hexahedral meshes. As in the two-dimensional case, we should introduce the function COR(N,k) to define a correspondence between local and global node numbers:

n = COR( N , k ) n = 1,..., Nn N = 1,..., Ne K = 1,..., 8 where n is a global node number, Nn is a total number of mesh nodes, N is an element number, Ne is a number of elements, k is a local node number in the element. This function is implemented in the computer program as a function for a regular grid and as an array for an irregular mesh.

8.10.2 Problem Formulation Let adapted function f(x, y, z) define a three-dimensional surface in the four-dimensional space. In notations of the previous section, the functional Eq. 8.24 can be written as follows:

I=∫

rξ 11

[

( ) + g g − (g ) + g g − (g ) − (g ) ] − g (g g − g g ) + g (g g − g

rξ g11rξ g22 − g12rξ rξ rξ 22 33

g g g

rξ 2 23

2

rξ rξ 11 33

rξ 12

rξ 2 13

rξ rξ 12 33

rξ rξ 13 23

rξ 2 23

rξ rξ 22 33

rξ 13

rξ rξ 22 13

rξ rξ 12 23

g

)

dξdηdµ

(8.47)

where

(

rξ rξ rξ g11rξ = rξ2 g22 = rη2 g33 = rµ2 g12rξ = g21 = rξ ⋅ rη

©1999 CRC Press LLC

)

(

rξ g13rξ = g31 = rξ ⋅ rµ

)

(

rξ rξ g23 = g32 = rη ⋅ rµ

)

here

fξ = fx xξ + fy yξ + fz zξ fη = fx xη + fy yη + fz zη

f µ = f x x µ + f y yµ + f z z µ

The functional Eq. 8.47 can be used for constructing harmonic coordinates on the surface of the graph of control function dependent on three variables. Projection of these coordinates onto a physical domain gives an adaptive-harmonic grid, clustered in regions of high gradients of adapted function f(x, y, z). The problem of irregular three-dimensional mesh smoothing and adaption is formulated as follows. Let the coordinates of irregular mesh be given:

( x, y, z)n

n = 1,..., Nn

(8.48)

The mesh is formed by hexahedral elements, i.e., the array COR(N, k) is also defined. The problem is to find new coordinates of the mesh nodes, minimizing the sum of the functional Eq. 8.47 values, computed for a mapping of the unit cube onto each cell of a mesh.

8.10.3 Approximation of the Functional First consider the case, where f(x, y, z) = 0. The functional Eq. 8.47 in this case can be written in a more simple form:

(r × r ) + (r × r ) + (r × r ) dξdηdµ I=∫ (r × r ) ⋅ r 2

2

η

ξ

2

µ

ξ

η

ξ

η

µ

(8.49)

µ

where × is a vector product, and ⋅ is a scalar product,

(

rξ = xξ , yξ , zξ

)

(

rη = xη , yη , zη

)

(

rµ = xµ , yµ , zµ

)

Let the linear transform xh(ξ, η, µ), yh(ξ, η, µ), zh(ξ, η, µ) map the base tetrahedron Tξ1234 in the space ξ, η, µ onto a tetrahedron T1234 in the space x, y, z. The value of the functional with the linear functions xh(ξ, η, µ), y h(ξ, η, µ) and zh(ξ, η, µ) can be computed precisely. Consequently, the approximation of this functional can be written as Ne 12

[

1 ( Fm )left + ( Fm )right N =1 m =1 24

Ih = ∑∑

]

(8.50) N

where

( Fm )left

(r =

h ξ

) ( 2

) ( 2

× rηh + rξh × rµh + rηh × rµh

( Jm )left

) (F ) 2

m right

(r =

h ξ

) ( 2

) ( 2

× rηh + rξh × rµh + rηh × rµh

( Jm )right

)

2

( Jm )left = −(rξh × rηh ) ⋅ rµh ( Jm )right = (rξh × rηh ) ⋅ rµh

Consider one term in Eq. 8.50, for example, (Fm)left, and suppose that the Jacobian (Jm)left tends to zero, remaining positive. For Ih not to tend to infinity in this situation it is necessary that the numerator in (Fm)left must also tend to zero. From the form of the numerator it follows that vectors e1 = r2 – r1, e2 = r3

©1999 CRC Press LLC

– r2 and e3 = r4 – r3 are parallel, hence all points r1, r2, r3, and r4 lie on a straight line. Consequently, the volumes of all tetrahedra that contain corresponding faces must also tend to zero, including the tetrahedron defined by the edge 34 and containing the edge 23. Repeating the argument as many times as necessary, we conclude that all mesh nodes, including those at the boundary of the domain, must lie on a straight line, which is impossible. From this follows that the function Ih has an infinite barrier at the boundary of nondegenerate threedimensional hexahedral meshes, satisfying inequalities Eq. 8.46. Hence, if this set is not empty, the system of algebraic equations

Rx =

∂I h ∂I h ∂I h = 0 Ry = = 0 Rz = =0 ∂xn ∂yn ∂zn

has at least one solution which is a nondegenerate mesh. To find it, one must first find a certain initial nondegenerate mesh, and then use some method of unconstrained minimization of the function Ih. Since this function has an infinite barrier on the boundary of the set of nondegenerate meshes, each step of the method can be chosen so that the mesh always satisfies inequalities (Eq. 8.46). For adaptive mesh generation with the employment of the functional Eq. 8.47, we use the same approach: consider T tetrahedra, described above. Then the mapping of the base tetrahedron onto each of these tetrahedra is approximated by linear functions, with assumption that f is also approximated by a linear function defined by its values in tetrahedron vertices. Then the integrand in Eq. 8.47 will be equal to constant. Note that the integrand in Eq. 8.47 differs from Eq. 8.49: the first is an invariant for the orthogonal transformations of the base tetrahedron. This means that we do not need to use two terms in the approximation of Eq. 8.47 corresponding to right-hand and left-hand coordinate systems. The value of this functional depends only on the numeration of nodes of the base tetrahedron, not on its type.

8.10.4 Minimization of the Functional Suppose the mesh at the lth step of the iterations is determined. We use the quasi-Newtonian procedure when the (l+1)-th step is accomplished by solving two linear equations for each interior node:

τRx +

∂Rx l +1 l ∂Rx l +1 l ∂Rx l +1 l ( xn − xn ) + ∂y ( yn − yn ) + ∂z (zn − zn ) = 0 ∂xn n n

τRy +

∂Ry l +1 l ∂Ry l +1 l ∂Ry l +1 l ( xn − xn ) + ∂y ( yn − yn ) + ∂z (zn − zn ) = 0 ∂xn n n

τRz +

∂Rz l +1 l ∂Rz l +1 l ∂Rz l +1 l ( xn − xn ) + ∂y ( yn − yn ) + ∂z (zn − zn ) = 0 ∂xn n n

(8.51)

where τ is the iteration parameter, which is chosen so that the mesh remains nondegenerate. For this purpose after each step the conditions Eq. 8.46 are checked and if they are not satisfied, this parameter is multiplied by 0.5. The adaptive-harmonic algorithm for the three-dimensional mesh is formulated as follows: 1. 2. 3. 4.

Generate initial mesh with the use of a marching method. Compute new values fn at each mesh node. Make one iteration step Eq. 8.51 and compute new values of xn, yn, and zn. Repeat starting with Step 2 to convergency.

Note, that the algorithm contains computational formulas for [fx]n, [fy]n and [fz]n which will be presented below.

©1999 CRC Press LLC

8.10.5 Derivation of Computational Formulas We will obtain computational formulas in the case of adaption, i.e., we will approximate the functional Eq. 8.47. The used approach is similar to the method of approximation to the functional described in Section 8.3. Consider the linear transform xh(ξ, η, µ), y h(ξ, η, µ), zh(ξ, η, µ) of the base tetrahedron shown in Figure 8.5 onto one of tetrahedra of the cell decomposition. Function f will be approximated by the linear function f h(ξ, η, µ). Derivatives of these functions can be easily computed taking into account the numeration of the vertices of the base tetrahedron:

(

)

rξh = xξh , yξh , zξh , fξh = r2 − r1 = ( x2 − x1 , y2 − y1 , z2 − z1 , f2 − f1 )

( ) = (x , y , z , f ) = r − r = (x

rηh = xηh , yηh , zηh , fηh = r3 − r2 = ( x3 − x2 , y3 − y2 , z3 − z2 , f3 − f2 ) rµh

h µ

h µ

h µ

h µ

4

3

4

− x3 , y4 − y3 , z4 − z3 , f4 − f3 )

From this follows

(

gij = (ri +1 − ri ) ⋅ rj +1 − rj

)

i.e.,

g11 = (r2 − r1 ) g22 = (r3 − r2 ) 2

g33 = (r4 − r3 )

2

2

g12 = g21 = ((r3 − r2 ) ⋅ (r2 − r1 ))

(8.52)

g13 = g31 = ((r4 − r3 ) ⋅ (r2 − r1 ))

g23 = g32 = ((r4 − r3 ) ⋅ (r3 − r2 ))

Substituting these expressions into the integrand of Eq. 8.47 we obtain

F= where

U V

U = g11g22 − ( g12 ) + g11g33 − ( g13 ) + g22 g33 − ( g23 ) 2

[

2

2

]

V = g11 g22 g33 − ( g23 ) − g12 ( g12 g33 − g13g23 ) + g13 ( g12 g23 − g22 g13 ) 2

(8.53) (8.54)

We use formulas for differentiating the relation of two functions. After differentiating we obtain

U − FVy U x − FVx U − FVz Fy = y Fz = z V V V U − 2 FyVy − FVyy U − 2 Fx Vx − FVxx U − 2 Fz Vz − FVzz Fxx = xx Fyy = yy Fzz = zz V V V U xy − Fx Vy − FyVx − FVxy U xz − Fx Vz − Fz Vx − FVxz Fxy = Fyx = Fxz = Fzx = V V U yz − Fz Vy − FyVz − FVyz Fyz = Fzy = V Fx =

©1999 CRC Press LLC

(8.55)

For the vertex 1 of the tetrahedron we should substitute the expressions Eq. 8.52, Eq. 8.53, and Eq. 8.54 into Eq. 8.55, and also replace x, y and z by x1, y1 and z1 in the resulting formulas. For the vertex 2 x, y, and z in Eq. 8.55 are replaced by x2, y2, and z2. For the vertex 3 x, y, and z in Eq. 8.55 are replaced by x3, y3, and z3. For the vertex 4 x, y, and z in Eq. 8.55 are replaced by x4, y4, and z4. In computing the derivatives of fi on xj, yj, and zj, i = 1, …, 4, j = 1, …, 4, we use the formulas for the transformation of derivatives in the three-dimensional space:

xξ fx + yξ fy + zξ fz = fξ xη fx + yη fy + zη fz = fη x µ fx + yµ fy + zµ fz = fµ From this follows

(

fx = fξ yη zµ − yµ zη

(

)

(

J − fη yξ zµ − yµ zξ

)

(

)

(

)

J + fµ yξ zη − yη zξ J

)

(

) −x y ) J

fy = − fξ xη zµ − xµ zη J + fη xξ zµ − x µ zξ J − fµ xξ zη − xη zξ J

(

)

(

)

(

fz = fξ xη yµ − x µ yη J − fη xξ yµ − xµ yξ J + fµ xξ yη

(8.56)

η ξ

where

(

)

(

) (

J = xξ yη zµ − yµ zη − xη yξ zµ − yµ zξ + xµ yξ zη − yη zξ

)

Note that the derivatives on x, y, and z are independent on which system of coordinates, right-hand or left-hand is used in Eq. 8.56. Substituting the expressions for the derivatives of xh, yh and zh on ξ, η, µ into Eq. 8.56, we obtain formulas for the derivatives f hx, f hy, and f hz. We use the following formulas in computations: h h h ∂fi fx if i = j ∂fi fy if i = j ∂fi fz if i = j = = = ∂x j 0 if i ≠ j ∂y j 0 if i ≠ j ∂z j 0 if i ≠ j

Computations are performed as follows. Let F and its derivatives on x1, y1 and z1 in the numeration of the base tetrahedron be computed with the use of formulas Eq. 8.55 for the cell number N and the local node number k. Then the computed values are added to the appropriate array elements (which were first cleared):

[ Rx ]n + = Fx [ Ry ]n + = Fy [ Rz ]n + = Fz [ Rxx ]n + = Fxx [ Ryy ]n + = Fyy [ Rzz ]n + = Fzz [ Rxy ]n + = Fxy [ Rxz ]n + = Fxz [ Ryz ]n + = Fyz

Ih + = F

where n = COR(N, k1). Here, a+ = b means that the new value of a becomes equal to a + b. Similarly for the vertex 2, the correspondence between local and global number is n = COR (N, k2). Similarly for the vertex 3, the correspondence between local and global number is n = COR (N, k3).

©1999 CRC Press LLC

(8.57)

Similarly for the vertex 4, the correspondence between local and global number is n = COR (N, k4). So, the iteration method for irregular three-dimensional mesh relaxation and adaption is described in detail.

8.11 Results of Test Computations 8.11.1 Comparison Between the Winslow Method and the Variational Approach Comparison between the variational algorithm described in Section 8.3 and the Winslow method was presented in the paper by Ivanenko and Charakhch’yan [1988]. We will describe here results of computations shown in Figure 8.6. In Figure 8.6 the regular grids 10 × 10, 19 × 19 and 37 × 37, generated for backward facing step by the Winslow method (Figures 8.6a, 8.6c, 8.6e) and by the variational barrier methods (Figs. 8.6b, 8.6d, 8.6f) are shown. The choice of this example is concerned with the discussion about the applicability of the Winslow method. There is an opinion that this method can generate quite satisfactory grids if the number of grid nodes is sufficiently large, despite the fact that in many cases this method generates grids with self-intersecting cells. Indeed, if the number of grid nodes tends to infinity, the limit will be a continuous mapping which is one-to-one. Such a mapping can be used then for the replacement of independent variables (Jacobian is positive inside a domain). This is not the case of a discrete mapping (a grid). If the Jacobian is negative on the boundary, then the Winslow method might generate grids with degenerate cells near the boundary for any number of grid nodes. As shown in the presented example, the form of degenerate cell near the internal corner is worse with increasing the number of nodes (the Winslow method, Figures 8.6a, 8.6c, 8.6e). At the same time, the variational method generates satisfactory (convex) grids for any number of grid nodes (Figures 8.6b, 8.6d, 8.6f). The geometric sense of the smoothing procedure defined by harmonic functional is that the shape of each cell tends to be a square. From this follows constraints on the application of the variational method for irregular meshes. In fact, satisfactory mesh with square cells might not exist for the given mesh structure. It is clear that if the square cell is used as initial, the variational method will not change it (the Winslow finite-difference method will not change it, too). If the initial mesh has the form shown in Figure 8.7a we obtain the irregular smoothed mesh shown in Figure 8.7b after 700 iterations. The grid quality was estimated with the following parameters: Jmin is the minimum of the areas of all triangles, scaled by the maximum area, Aspect is the maximum ratio of edge lengths in quadrilateral, and Skew is the minimum cells angle in degrees. For meshes in Figure 8.7 the minimum area decreases from 0.13 to 0.0002, the maximum ratio increases from 10 to 10.3 and minimum angle decreases from 13.9 to 11.7. But the mesh in Figure 8.7b looks more smooth than the mesh in Figure 8.7a. This means that all these quality parameters do not estimate the mesh quality properly. Note that the mesh after smoothing looks like several cobwebs and is extremely nonuniform. This example shows that in some cases the variational method can be unsatisfactory for smoothing of irregular meshes, for example, if refinement is used for several blocks with regular grid structure in each as shown in Figure 8.7a.

8.11.2 Comparison Between the Finite-Difference Method for Two-Dimensional Adaptive-Harmonic Meshes and the Variational Approach Methods for adaptive mesh generation are illustrated by the following example of control function [Ivanenko, 1993]. The square domain 0 < x < 1, 0 < y < 1 is considered. The cubic curve

y0 ( x ) = 25( x − 0.5)( x − 0.75)( x − 0.25) + 0.5

©1999 CRC Press LLC

FIGURE 8.6 Regular grid 10 × 10, 19 × 19, and 37 × 37 generated by the Winslow method (a,c,e), and by the variational barrier method (b, d, f).

determines the form of a layer of high gradients. For a given point x, y the function f(x, y) is calculated as follows:

if y ≥ y0 + δ 1 f = 0.5 ( y − y0 + δ ) δ if y0 + δ ≥ y ≥ y0 − δ if y ≤ y0 − δ 0 Here 12

∂y 2 δ = δ 0 1 + 0 ∂x ©1999 CRC Press LLC

FIGURE 8.7

Smoothing of irregular mesh; (a) initial mesh, (b) smoothed mesh.

The value of δ is chosen so that the width of the layer will be about 2δ0 everywhere along the curve. In all test computation this value was chosen to be δ0 = 0.02. An additional control parameter C is introduced to control the number of mesh nodes inside the boundary or internal layers. The function Cf(x, y) is used in computational formulas instead of f(x, y). Increasing the value C, more mesh nodes will be in the layer of high gradients. This value is chosen in the range from 0.1 to 0.5. A number of points in a layer is approximately C/(C + 1), i.e., if C = 0.5 one third part of points will be in a layer of high gradients. The grid, generated by the finite-difference method with C = 0.2 slightly differs from the grid generated by variational method with the same value of parameter C. But with the value of parameter C = 0.5, the satisfactory grid cannot be generated by the finite-difference method (Figure 8.8a). The grid generated for this value of parameter by the variational method is shown in Figure 8.8b. All grid cells are convex.

©1999 CRC Press LLC

FIGURE 8.8 Adaptive-harmonic grids; (a) generated by the finite-difference method, (b) generated by the variational method.

8.11.3 Comparison Between the Finite-Difference Method for AdaptiveHarmonic Grid Generation on Surfaces and the Variational Approach The comparison of the finite-difference method for grid generation on surfaces with the variational method was performed on an example of a surface defined parametrically: “Monkeys saddle”

x = u, y = v z = 8(v − 0.3) − 24(u − 0.5) (v − 0.5) 3

2

0 < u 0 and including in B only those tetrahedra S for which d(P, Q) < Rs – µ, where µ is chosen sufficiently large to ensure strict inclusion. When a new point is inserted, a search is made through the list of tetrahedra to find the first tetrahedron that fails the Delaunay test. The remaining tetrahedra that make up the cavity can be found by a tree search. After these tetrahedra have been removed, the points on the boundary of the cavity are connected to the new point P and the new tetrahedra thus formed are added to the data structure. The time required to triangulate N points will be given by N

T =

∑ (T k

©1999 CRC Press LLC

k

+ T ′k )

Here, Tk is the time taken to search for the first cavity tetrahedron that arises from the introduction of the kth point into the triangulation of k – 1 points. T′k is the time taken to find all remaining tetrahedra in the cavity and construct the new triangulation. The time T′k will be proportional to the number of tetrahedra in the cavity. If the points are inserted in a widely distributed manner corresponding to a coarse sprinkling followed by a finer distribution [Baker, 1987], the cavity size, and hence time T′k , should be roughly independent of k. The majority of points are field points that are introduced selectively (e.g., at the circumcenter of the tetrahedron having maximum volume). Under fairly mild conditions on the current state of the triangulation, the time T′k can therefore be regarded as O(1). Thus, the time complexity of the algorithm is dominated by the search time Tk . In general, the list of tetrahedra will be randomly ordered and, in the worst case, Tk will be O(k), leading to an overall time complexity for the triangulation that is O(N2). It is therefore necessary to introduce a data structure that allows an efficient search for the first tetrahedron that fails the Delaunay test irrespective of the point ordering. To achieve this, one can exploit an octree structure to store the points that have previously been inserted [Baker, 1989]. The octree data structure is used to find the point nearest to a newly introduced point. With each previously introduced point, one associates a tetrahedron that has this point as a vertex. The search for the first tetrahedron in the Delaunay cavity thus starts with the tetrahedron associated with the point nearest to the new point, and proceeds to examine all neighboring tetrahedra that have this nearest point as a vertex. In this way, it is possible to find the first cavity tetrahedron in a time Tk, that is O(log k). It follows that the overall time complexity of the algorithm is O(N log N). Other data structures have been proposed that also achieve a fast search time [Bonet and Peraire, 1991].

16.2.3 Tanemura–Ogawa–Ogita Algorithm An alternative algorithm [Tanemura, et al., 1983] for generating the Delaunay triangulation can be described for the planar case as follows. Given a set of points Vn and a Delaunay edge e, we can construct a circle Ci through the endpoints of e and any one of the remaining points Pi. One of these circles, say C1, will be empty and thus defines the Delaunay triangle T containing point P1 and e as the edge opposite P1. For a constrained Delaunay triangulation with respect to a fixed edge e, we require only the segment of the circle on the same side of e as the candidate point Pi to be empty. The triangle T contains two edges other than e. If either of these edges is not among the list of edges already generated, it is added to the list. Any internal edge (i.e., nonboundary edge) that is associated with only one triangle is considered an active edge on which a new Delaunay triangle should be constructed by the above procedure. The algorithm stops, and the triangulation is complete, when every boundary edge corresponds to the side of one triangle and every internal edge forms the common side of precisely two triangles. This approach is the basis of an algorithm first proposed by Tanemura et al. [1983] and subsequently exploited by Merriam [1991] and Mavriplis [1993]. In the planar case, the Tanemura–Ogawa–Ogita algorithm is well suited to the task of generating the constrained Delaunay triangulation with respect to a prescribed set of boundary edges. After establishing a triangulation consisting of the boundary points and conforming to the boundary edges, it is then possible to use the Bowyer–Watson algorithm to selectively add points until an acceptable grid has been created. Various point placement strategies including circumcenter point insertion [Weatherill and Hassan, 1992] and the Voronoï segment method [Rebay, 1993] have been proposed and analyzed [Chew, 1993; Baker 1994]. In 3D the possible nonexistence of a constrained Delaunay triangulation that will conform to a prescribed surface triangulation severely limits the usefulness of the Tanemura–Ogawa–Ogita algorithm. In this case, the preferred approach appears to be based on the Bowyer–Watson algorithm followed by a series of edge/face swaps to establish any edges and faces of the prescribed boundary surface [George, et al., 1988; Weatherill and Hassan, 1992; Sharov and Nakahashi, 1996].

©1999 CRC Press LLC

FIGURE 16.2

Three tetrahedra with common edge AB, or two tetrahedra with common face P1P2P3.

FIGURE 16.3

Several tetrahedra surrounding edge AB.

16.2.4 Edge/Face Swapping The simplest swappable combination in 3D occurs when three tetrahedra share a common edge. In Figure 16.2, the three tetrahedra ABP1P2, ABP2P3, and ABP3P1 together with the common edge AB can be replaced by the two tetrahedra AP1P2P3 and BP1P2P3 together with the common face P1P2P3. Provided that the ensemble of tetrahedra is convex (i.e., edge AB intersects face P1P2P3), then either combination can exist without affecting the remaining tetrahedra. In the general case, when n tetrahedra share a common edge (see Figure 16.3), a transformation that replaces the n tetrahedra by 2(n – 2) tetrahedra can be found provided the ensemble of tetrahedra is convex. In order to determine the new set of tetrahedra it is necessary to cover the interior of the polygon {P1, …, Pn} by triangular facets. For n ≥ 4 the set of new tetrahedra is not uniquely defined [Briére de L'isle and George, 1993]. The utility of these swapping operations lies in the opportunity to establish any prescribed boundary edges and faces that do not exist in the volume grid. Suppose, for example, that a given edge AB lies on the prescribed boundary but does not exist in the volume mesh. After identifying the face P1P2P3 in the volume mesh that intersects the line segment AB, one can apply the reverse of the edge/face swap illustrated in Figure 16.2. It is possible, however, for the line segment AB to lie in or very close to one of the faces AP1P2, AP2P3, AP3P1. For example, suppose that AB lies in face AP3P1 and thus intersects edge P1P3. In this singular case it is necessary to identify the ring of tetrahedra incident to edge P1P3 and use an edge/face swap that removes edge P1P3 and inserts edge AB assuming, of course, that points A and B are both vertices associated with the tetrahedral ring. If this is not the case, or if the ring of tetrahedra is not convex, then the line segment AB cannot be established as an edge of the volume grid. In practice, an edge that was not established initially can often appear in the volume grid or be established by swapping procedures after further missing boundary edges have been inserted. If some missing boundary edges stubbornly remain, then one can resort to the insertion of extra grid points, either inside the domain [George, et al., 1988] or perhaps on the boundary surface [Weatherill and Hassan, 1992; Sharov and Nakahashi, 1996] at the midpoint of the missing edge.

©1999 CRC Press LLC

After all boundary edges and possible additions of new boundary points and edges have been established, it is necessary to ensure that all boundary faces are contained in the volume grid. In practice, a volume grid that contains all boundary edges will at worst be missing only a handful of boundary faces. Suppose, for example, that a missing face has vertices P1P2P3. Then (see Figure 16.2) it is necessary to identify the edge AB that intersects the missing face and carry out the edge/face swap that removes edge AB and establishes face P1P2P3. It is, however, possible for more than one edge of the volume grid to intersect the missing face. In this case, it is again necessary to add an extra grid point either in the domain or on the boundary surface at say, the barycenter of the missing face. The reader is referred to the literature [George, et al.,1988; Weatherill and Hassan, 1992; Sharov and Nakahashi, 1996] for a more detailed discussion of the various ways in which edge/face swaps and grid point insertion can be applied to establish the prescribed boundary surface.

16.2.5 Grid Optimization The objective of grid optimization is to achieve a volume grid with a smooth grading in size of tetrahedra and good tetrahedral quality as measured by some criterion such as dihedral angle or ratio of circumradius to in-radius. Perhaps the most pressing requirement is the identification and removal of slivers. These tetrahedra are formed by four co-planar or nearly co-planar points and hence will have a volume that is extremely small [Cavendish, et al., 1985]. Although it is possible to monitor the formation of such tetrahedra during the grid generation process, any attempt to prevent their formation at this stage will usually sabotage efforts to establish the boundary surface or lead to a final volume grid whose overall quality is in fact worse. It appears best to apply grid optimization as a post processing operation on the final grid [Briére de L'isle and George, 1993]. Sliver-like tetrahedra can be found by searching for edges which have adjacent incident faces with a dihedral angle close to 180°. It follows that at least one of the incident tetrahedra is a sliver, and an edge/face swap that removes this edge will also remove the sliver. If the ring of tetradedra incident to the edge is nonconvex, then this approach fails. In practice, it is usual to apply the edge/swap procedure to remove as many slivers as possible and then smooth the grid (i.e., adjust the positions of the nonboundary grid points). This two-step process can be iterated until a grid of acceptable quality has been obtained. A popular smoothing technique is Laplacian smoothing, although care must be taken to ensure that no grid points cross any faces, thus leading to an invalid grid. Another technique is based on moving each grid point until all incident edges have nearly equal length. Still other techniques have been based on linear programming. Smoothing changes the positions of the nonboundary grid points but leaves the topology intact. Edge/face swaps leave the grid positions fixed but change the topology. It is therefore reasonable to expect that an iterative process alternating between these two procedures should lead to an improved grid.

16.2.6 Constrained Delaunay Triangulation The key procedure that lies at the heart of the Bowyer–Watson algorithm is the determination of the cavity tetrahedra whose circumspheres contain the new point P. For a Delaunay triangulation, the cavity is simply connected and the point P is visible from all faces of the cavity. When the triangulation is no longer Delaunay but constrained by the presence of fixed faces that arise, for example, when one or more of the interior cavity faces is a boundary surface face, then the visibility issue needs to be reexamined. Since some of the faces of the restricted cavity need not be visible from P, it is necessary to find the tetrahedron that contains P and then examine neighboring tetrahedra by means of a tree search. Clearly P lies within the circumsphere of the tetrahedron that contains P and every face of this tetrahedron is visible from P. Each face of this tetrahedron is examined to determine whether it is a fixed (i.e., protected) face that must not be removed. If it is not a protected face, then the tree search proceeds to the adjacent tetrahedron on the other side of this face. If P lies within the circumsphere of the new tetrahedron and P is visible from its other three faces, then this tetrahedron is added to the list of cavity tetrahedra. After

©1999 CRC Press LLC

each of the neighboring faces and tetraheda have been examined in this way, the process is repeated for each of the tetradehra that has been newly admitted to the cavity list. Starting from the original set B of tetrahedra whose circumspheres contain the point P we arrive at a reduced set B1 ⊂ B whose faces found by the tree search were judged visible from the point P. Since the tree search examines the tetrahedra in a particular sequence, it is possible that there exist one or more tetrahedra in the subset B1 whose faces are not visible from P when the visibility test is reapplied to the reduced set B1. The tree search and visibility test must therefore be repeated for set B1 to create a new subset B2 ⊂ B1. If the sets B2 and B1 are identical, then all faces of B1 are visible from P. The points on the boundary of the restricted cavity C1, formed when B1 is removed from the triangulation T, can then be connected to point P to form a valid retriangulation. A detailed discussion of these issues has been given by Wright and Jack [1994]. Let ri = (xi, yi, zi) be the coordinate vector of the ith vertex of a tetrahedron where i = 1, …, 4 and let rp = (xp, yp, zp) be the coordinate vector of the point P. The face opposite vertex 4 is visible with respect to point P if point P lies on the same side of this face as vertex 4. An alternative statement is that point P and vertex 4 must lie in the same half space formed by the plane containing vertices 1, 2, and 3. The visibility test thus amounts to checking whether the volume of the tetrahedron formed by the points r1, r2, r3, and r4, has the same sign as the volume of the tetrahedron formed by the points r1, r2, r3, and rp. In other words, the sign of the determinant 1 x1 y1 z1

1 x2 y2 z2

1 x3 y3 z3

1 x4 y4 z4

must be compared with the sign of the determinant formed by replacing x4, y4, and z4 with xp, yp, and zp. The validity of the retriangulation therefore rests on the accuracy of the determinant evaluation and hence on the precision of the computer arithmetic that is used. Difficulties arise when one or both determinants are extremely close to zero leading to uncertainty as to whether the correct sign has been computed. Various schemes using variable precision arithmetic [Shewchuk, 1996] and also integer arithmetic have been proposed to handle this situation. An interesting development by Edelsbrunner and Mücke [1990] could lead to a systematic handling of these situations.

16.3 Research Issues At the present stage of knowledge, it is fair to say that planar triangulations are well understood and that they enjoy a number of properties that do not apparently extend to three dimensions. The existence in the planar case of a constrained Delaunay triangulation that conforms to any set of prescribed edges makes it possible to construct a grid of triangles for any two-dimensional region whether simply connected or multiply connected. The refinement of the planar grid by insertion of points inside the region can be shown to generate isotropic grids of high quality. The issue of generating anisotropic grids that are designed to contain high aspect ratio triangles, aligned with particular features in a finite element solution, is less well developed but is currently an area of active research. The most obvious difference between three-dimensional triangulations and the planar counterpart is the existence in 3D of valid boundary surface triangulations for which no space filling, conforming set of tetrahedra exists. This precludes the possibility of generating a constrained Delaunay triangulation (in fact, any triangulation) containing only the boundary points and conforming with the boundary surface for every possible boundary surface configuration. It should always be possible, although the author is not aware of a proof, to achieve a conforming triangulation if extra points (so-called Steiner points) are inserted inside the domain. To ensure that the final grid has good quality tetrahedra, the inserted points should not be too close to the boundary surface. In order to guarantee a grid for any boundary surface configuration one therefore needs to know when and where any extra points should be inserted inside the domain.

©1999 CRC Press LLC

One potential research area of great importance is the classification of those boundary surface triangulations for which no conforming volume triangulation exists. Given a boundary surface triangulation one can either (1) create a space-filling, boundary-conforming grid of tetrahedra, (2) be unable to create any conforming tetrahedra, or (3) build a number of tetrahedra inside the domain until no further tetrahedra can be introduced because of the boundary constraint. Case (3) can be viewed as a situation in which tetrahedra are created as one would with an advancing front method until the front, interpreted as a boundary surface triangulation, falls into category (2). It seems likely that the number of triangles in any boundary surface in category (2) should be relatively small, and that the number of distinct cases that fall into category (2) may therefore be a finite and perhaps not too large number. If this is the case, then it may be possible to classify the different cases in category (2) and provide an algorithm for adding a point, or points, inside the domain to create a conforming grid. A satisfactory answer to this question would solve completely the problem of automatic grid generation for tetrahedral grids. A less ambitious question that may prove easier to tackle is to ask how far one can proceed with swapping techniques to change a non-boundary conforming grid of tetrahedra into a grid that does match a given boundary surface triangulation. Is it possible to quantify the extent to which a given boundary surface triangulation fails to be Delaunay and is it possible to relate this characteristic to whether a Delaunay volume grid can be converted by a given set of swapping techniques into a boundary conforming grid? These are all rather difficult questions and although some important work has been done in this area [Joe, 1991], it may be a long time before they are answered in any reasonably satisfactory way. Another important area of research relates to the quality of the final tetrahedral grid that is obtained after the initial grid has been refined by successive insertion of points inside the domain. As pointed out earlier, slivers will almost invariably appear and these extremely small volume tetrahedra wreak havoc on most finite element methods. Edge/face swaps can be applied as described earlier to remove slivers and generally improve grid quality. This approach works well most of the time but there are situations where slivers persist in the optimized grid (the edge/face swap may fail because the tetrahedral ensemble is non-convex for example). The application of smoothing may move the grid into a configuration in which a further application of edge/face swaps will remove all slivers, but there is no guarantee that this will always be the case. Any insight into this problem would be very useful, and a recipe for optimizing the grid, with a guarantee of removing all slivers, would have a profound impact on grid generation. A related question concerns the different optimization criteria and whether these will lead to a global optimum or whether they might generate optimization schemes that get stuck in local optima. There are numerous ways of defining the quality of a tetrahedron including minimum and maximum dihedral angle, ratio of circum-radius to in-radius and several other criteria that have been reported in the literature. Some interesting work has already been carried out to establish which criteria are associated with optimization problems that have global optima and continuing research in this area will undoubtedly lead to better methods for grid optimization. A similar though somewhat different question is how should a grid be optimized to achieve the most accurate finite element solution for a given problem? This will obviously depend on the partial differential equation being solved as well as the finite element discretization being used. Even partial answers to these questions will go a long way to making existing tetrahedral grid generation more efficient and more reliable. With the much deeper knowledge that will eventually be gained, we can look forward one day to achieving truly automatic three-dimensional grid generation.

References 1. Baker, T.J., Three-dimensional mesh generation by triangulation of arbitrary point sets, AIAA 8th Computational Fluid Dynamics Conference, AIAA Paper 87-1124-CP, Hawaii, June 1987. 2. Baker, T.J. Automatic mesh generation for complex three-dimensional regions using a constrained Delaunay triangulation,” Engineering with Computers. 1989, 5, p 161. 3. Baker, T.J., Single block mesh generation for a fuselage plus two lifting surfaces, Proc. 3rd International Conference on Numerical Grid Generation in Computational Fluid Dynamics. Arcilla, A.S., (Ed.), Elsevier Science Publishers B.V., North-Holland, 1991a, p 261.

©1999 CRC Press LLC

4. Baker, T.J., Shape reconstruction and volume meshing for complex solids, Int. J. Num. Meth. Eng., 1991b, 32, p 665. 5. Baker, T.J., Tetrahedral mesh generation by a constrained Delaunay triangulation, Artificial Intelligence, Expert Systems and Symbolic Computing. Houstis, E.N. and Rice, J.R., (Eds.), Elsevier Science, Publishers B.V., North-Holland, 1992. 6. Baker, T.J., Triangulations, mesh generation and point placement strategies, Frontiers of Computational Fluid Dynamics, Caughey, D.A. and Hafez, M.M., (Eds.), John Wiley and Sons, 1994, p 101. 7. Boissonnat, J.D., Shape reconstruction from planar cross sections, Computer Vision, Graphics and Image Processing, 1988, 4, p 1. 8. Bonet, J. and Peraire, J., An Alternating Digital Tree (ADT) algorithm for geometric searching and intersection problems, Int. J. Num. Meth. Eng., 1991, 31, p 1. 9. Bowyer, A., Computing Dirichlet tessellations, Comput. J., 1981, 24, p 162. 10. Brière de L’isle, E. and George, P.L., Optimisation de maillages tridimensionnels, INRIA Report. (2046), 1993. 11. Cavendish, J.C., Field, D.A., and Frey, W.H., An approach to automatic three-dimensional finite element mesh generation, Meth. Eng., 1985, 21, p 329. 11. Chew, P., Guaranteed quality mesh generation for curved surfaces, Proc. 9th Symp. On Comp. Geom. ACM Press, 1993, p 274. 12. Delaunay, B., Sur la sphère vide, Bull. Acad. Science USSR VII: Class Sci. Mat. Nat., 1934, 6, p 793. 13. Edelsbrunner, H. and Mücke, E.P. Simulation of simplicity: a technique to cope with degenerate cases in geometric algorithms, ACM Trans. Graphics, 1990, 9, p 66. 14. Farin, G., Surfaces over Dirichlet tessellations. Computer Aided Geometric Design, 1990, 7, p 281. 15. George, P.L., Hecht. F., and Saltel, E., Tétraedrisation automatique et respect de la frontière, INRIA Report. 835, 1988. 16. George, P.L., Hecht, F., and Saltel, E., Constraint of the boundary and automatic mesh generation, Proc. 2nd International Conference on Numerical Grid Generation in Computational Fluid Mechanics, Sengupta, S., (Ed.), Pineridge Press, 1988, p 589. 17. Guibas, L. and Stolfi, J., Primitives for the manipulation of general subdivisions and the computation of Voronoï diagrams, ACM Trans. Graphics. 1985, 4, p 74. 18. Joe, B., Construction of three-dimensional Delaunay triangulations using local transformations, Computer Aided Geometric Design, 1991, 8, p 123. 19. Lee, D. and Lin, A., Generalized Delaunay Triangulation for planar graphs, Discrete Comp. Geom. 1986, 1, p 201. 20. Mavriplis, D., An advancing front Delaunay triangulation algorithm designed for robustness, AIAA Paper 93-0671, 1993. 21. Merriam, M., An efficient advancing front algorithm for Delaunay triangulation, AIAA Paper 910792, 1991. 22. Perronnet, A., Un algorithme de tètraèdrisation d’un objet multi-matériaux ou de l'extérieur d’un objet, Numerical Analysis Laboratory Report. (R88005). University Pierre et Marie Curie, 1988. 23. Rebay, S., Efficient unstructured mesh generation by means of delaunay triangulation and Bowyer–Watson algorithm, J. Comp. Physics, 1993, 106, p 125. 24. Ruppert, J., Results on Triangulation and high quality mesh generation, Ph.D. thesis. University of California at Berkeley, 1932. 25. Schroeder, W.J. and Shephard, M.S., Geometry-based fully automatic mesh generation and the Delaunay triangulation, Int. J. Num. Meth. Eng., 1988, 26, p 2503. 26. Sharov, D. and Nakahashi, K., A boundary recovery algorithm for Delaunay tetrahedral meshing, Proc. 5th International Conference on Numerical Grid Generation in Computational Field Simulations, Soni, B.K. and Thompson, J.F., (Eds.), NSF Engineering Research Center for Computational Field Simulation, 1996, p 229. 27. Shenton, D.N. and Cendes, Z.J., Three-dimensional finite element mesh generation using Delaunay tessellation, IEEE Trans. Magnetics, 1985, MAG-21, p 2535.

©1999 CRC Press LLC

28. Shewchuk, J.R., Adaptive precision floating-point arithmetic and fast robust geometric predicates, Computer Science Report. Carnegie Mellon University, 1996, CMU-CS-96-140. 29. Sibson, R., Locally equiangular triangulations, Comput. J., 1978, 21, p 243. 30. Tanemura, M., Ogawa, T., and Ogita, N., A new algorithm for three-dimensional Voronoï tessellation, J. Comp. Physics, 1983, 51, p 191. 31. Voronoï, G., Nouvelles applications des paramètres continues à la théorie des formes quadratiques, dieuxieme memoire: researches sur les parallelloedres primitif, J. Reine Angew. Math., 1908, 134, p 198. 32. Watson, D., Computing the n-dimensional Delaunay tessellation with application to Voronoï polytopes, Comput. J., 1981, 24, p 167. 33. Weatherill, N.P. and Hassan, O., Efficient three-dimensional grid generation using the Delaunay triangulation, Proc. First European Computational Fluid Dynamics Conference, Brussels, 1992. 34. Weatherill, N.P., Hassan, O., and Marcum, D.L., Calculation of steady compressible flowfields with a finite element method, 1993, AIAA Paper, 93-0341. 35. Wright, J.P. and Jack, A.G., Aspects of three-dimensional constrained Delaunay meshing, Int. J. Num. Meth. Eng., 1994, 37, p 1841.

©1999 CRC Press LLC

17 Advancing Front Grid Generation 17.1 17.2 17.3

17.4

The Alternating Digital Tree • Geometric Searching • Geometric Intersection • The Use of the ADT for Mesh Generation

J. Peraire, J. Peiró K. Morgan

Introduction Mesh Generation Requirements Geometry Modelling Description of the Computational Domain • Curve and Surface Representation • The Advancing Front Technique • Front Updating • Characterization of the Mesh: Mesh Parameters • Mesh Control • Background Mesh • Distribution of Sources • Calculation of the Transformation T • Curve Discretization • Triangle Generation in Two-Dimensional Domains • Mesh Quality Enhancement • Surface Discretization • Generation of Tetrahedra • Mesh Quality Assessment Data Structures

17.5

Conclusions

17.1 Introduction The advancing front technique (AFT) for the generation of unstructured triangular meshes was first formulated by George [14], but this original publication did not receive significant immediate attention. It seems that the first reference to this work appeared in an appendix of the book by Thomasset [32]. The first journal publication of the method was that of Lo [19], where the AFT was used to produce a triangulation by linking a set of points, which had been generated beforehand in a Cartesian fashion. The algorithm was modified by Peraire et al. [25], using a new formulation in which elements and points were simultaneously generated. The method also allowed for the generation of high aspect ratio triangles and, more importantly, grid control was introduced through the specification of a spatial variation of the desired element size and shape. This facility was later used for adaptive computations in computational fluid dynamics. The methodology was subsequently extended to three dimensions (3D) in [21,26,20,15,16]. The use of the AFT for 3D adaption in compressible flows is described in [28]. Recent implementations of the AFT that improve the generation times and/or the point placement/selection strategies have been reported [13,17,23,22,12]. In addition, the method has also been modified to produce a procedure for the generation of unstructured meshes of quadrilaterals in [34, 4] and of hexahedrals in [5].

©1999 CRC Press LLC

17.2 Mesh Generation Requirements A computational domain of complex geometrical shape may be discretized in terms of an unstructured mesh of tetrahedra. This is an alternative to the approach based upon the use of the multi-block method of grid generation in which the domain is initially subdivided into an unstructured assembly of hexahedral blocks and a structured hexahedral mesh is employed within each block (see, for example, Chapter 13 and [1,31,33]). The unstructured mesh approach is attractive, as it offers the possibility of automating this procedure so that mesh generation times can be significantly reduced. In an unstructured mesh, the number of points and elements that are neighbors to an interior point will vary through the domain. This lack of regularity in the mesh means that the use of an unstructured mesh solution algorithm generally involves an additional cost, in terms of computer time and memory, when compared with its structured mesh counterparts. On the other hand, the unstructured mesh approach offers, as a counterbalance, a greater versatility and geometrical flexibility to the mesh generating process. To take full advantage of these characteristics, the mesh generation procedure will be required to comply with the following requirements: • The algorithm should be able to handle arbitrary geometries in a fully automatic manner and

with minimum user intervention. • The input data should be reduced to a computerized geometric representation of the domain to

be discretized. • The approach followed should provide control over the spatial variation of element size and shape through the domain. • Adaptive methods should be incorporated into the process, with the objective of producing the most accurate approximation of the solution for a given number of points. The algorithmic procedure for the generation of elements and nodes to be described in the following is a three-dimensional extension of the AFT method originally proposed in [25]. This method has been implemented in the FELISA system [24].

17.3 Geometry Modeling The boundary of the computational domain has to be represented in a convenient mathematical form before the solution procedure can begin. As the objective is that the discretization of a domain of arbitrary geometrical complexity should be accomplished in an automatic manner; the method adopted to achieve this mathematical description ought to possess the greatest possible generality. In addition, the computer implementation of this description must provide the means for automatically computing any geometrical quantity relevant to the generation procedure. The area of solid modeling provides [29] the most general up-to-date set of methods for the computational representation and analysis of general shapes matching the above requirements. In this section we give a brief description of the geometry modeling strategy that is employed. More sophisticated representations that ease the task of performing quick geometry modifications, could also be used [11].

17.3.1 Description of the Computational Domain In the case of a planar two-dimensional analysis, the boundary of the computational domain is represented by closed loops of orientated composite cubic spline curves (cf. Chapter 27) [11]. For simply connected domains these boundary curves are oriented in a counter-clockwise sense while for multiply connected regions the exterior boundary curves are given a counterclockwise orientation and all the interior boundary curves are oriented in a clockwise sense (Figure 17.1).

©1999 CRC Press LLC

FIGURE 17.1

Boundary orientation for a two-dimensional domain.

FIGURE 17.2 Decomposition of the boundary of a three-dimensional domain into its surface and curve components.

In three dimensions, following solid modeling ideas, the domain to be discretized is viewed as a region in R3, which is bounded by a general polyhedron whose vertices are points on curved surfaces which intersect along curves. The edges of the polyhedron are segments on these intersection curves. In our notation, the portions of these curves and surfaces needed to define the boundary of the three-dimensional domain of interest are called curve segments and surface regions, respectively. A surface region is represented as a region — a patch — on a surface delimited by curve segments. Each curve segment is common to two surface regions and is a segment of the intersection curve between their respective support surfaces. Figure 17.2 shows the decomposition of the boundary of a three-dimensional domain into its surface and curve components. The approximate representation of the curves and surfaces where curve segments and surface regions is accomplished by means of composite curves and surfaces (Chapter 29 and [11]). These are called the curve and surface components. In addition, boundary curves and surfaces are oriented (see Figure 17.3). This is important during the generation process as it defines the location of the region that is to be discretized. The orientation of a boundary surface is defined by the direction of the inward normal. The orientation of the boundary curves is defined with respect to the boundary surfaces that contain them. Each boundary curve will be common to two boundary surfaces and will have opposite orientations with respect to each of them.

17.3.2 Curve and Surface Representation The problem of curve and surface representation is not considered here, as it has been described in detail in Part III of this Handbook.

©1999 CRC Press LLC

FIGURE 17.3

Orientation of the boundary components in three dimensions.

17.3.3 The Advancing Front Technique The algorithmic procedure adopted for mesh generation is based upon the method originally proposed in [25] for two dimensions and then extended to three dimensions in [26, 27]. The approach is regarded as a generalization of the advancing front technique [14, 19] with the distinctive feature that elements, i.e., triangles or tetrahedra, and points are generated simultaneously. This enables the generation of elements of variable size and stretching and differs from the approach followed in tetrahedral generators based upon Delaunay concepts [2, 10], which generally connect mesh points that have already been distributed in space (Chapter 16). The generation problem consists of subdividing an arbitrarily complex domain into a consistent assembly of elements. The consistency of the generated mesh is guaranteed if the generated elements cover the entire domain and the intersection between elements occurs only on common points, sides or triangular faces in the three dimensional case. The final mesh is constructed in what may be defined as a bottom-up manner. This means that the process starts by discretizing each boundary curve in turn. Nodes are placed on the boundary curve components and then contiguous nodes are joined with straight line segments. In the later stages of the generation process, these segments will become sides of triangular faces. The length of these segments must therefore, be consistent with the desired local distribution of mesh size. This operation is repeated for each boundary curve in turn. The next stage consists of generating planar faces. For each two-dimensional region or surface to be discretized, all the sides produced when discretizing its boundary curves are assembled into the so-called initial front. The relative orientation of the curve components with respect to the surface must be taken into account in order to give the correct orientation to the sides in the initial front. This front is used to generated a triangular mesh on the surface. The size and shape of the generated triangles must be consistent with the local desired size and shape. These triangles will become faces of the tetrahedra to be generated later. For the generation of tetrahedra the advancing front procedure is taken one step further. The front is now made up of the triangular faces that are available to form a tetrahedron. The initial front is obtained by assembling the triangulation of the boundary surfaces. Nodes and elements will be simultaneously created. When forming a new tetrahedron, the three nodes belonging to a triangular face from the front are connected either to an existing node or to a new node. After generating a tetrahedron, the front is updated. The generation procedure is completed when the number of triangles in the front is zero.

©1999 CRC Press LLC

FIGURE 17.4 The front updating procedure in two dimensions. (a) The initial generation front. (b) Creation of a new element: (1) no new point is created; (2) the new point 19 is created. (c) The updating of the front for the case (b) (2).

17.3.4 Front Updating The triangle generation algorithm utilizes the concept of a generation front. The front is a dynamic data structure that changes continuously during the generation process. At the start of the process the front consists of the sequence of straight line segments that connect consecutive boundary nodes. At any given time, the front contains the set of all the sides which are currently available to form a triangular face. Any straight line segment that is available to form an element side is termed active, whereas any segment no longer active is removed from the front. During the generation process an active side is selected from the front and a triangular element is generated. This may involve creating a new node or simply connecting to an existing one. After the triangle has been generated, the front is updated. This updating process is illustrated in Figure 17.4. Thus while the domain boundary will remain unchanged, the generation front changes continuously and needs to be updated whenever a new element is formed. The generation proceeds until the front is empty. Figure 17.5 illustrates the idea of the advancing front technique for a circular planar domain by showing the initial front and the form of the mesh at various stages during the generation process.

17.3.5 Characterization of the Mesh: Mesh Parameters The geometrical characteristics of a general mesh are locally defined in terms of certain mesh parameters. If N is the number of dimensions (two or three) then the parameters used are a set of N mutually orthogonal directions αi; i = 1, …, N, and N associated element sizes δi; i = 1, …, N (see Figure 17.6). Thus, at a certain point, if all N element sizes are equal, the mesh in the vicinity of that point will consist

©1999 CRC Press LLC

FIGURE 17.5

The advancing front technique showing different stages during the triangulation process.

of approximately equilateral elements. To aid the mesh generation procedure, a transformation T which is a function of αi and δi is defined. This transformation is represented by a symmetric N × N matrix and maps the physical space onto a space in which elements, in the neighborhood of the point being considered, will be approximately equilateral with unit average size. This new space will be referred to as the normalized space. For a general mesh this transformation will be a function of position. The 1 transformation T is the result of superimposing N scaling operations with factors ---- in each αi direction. di Thus N 1 T(α i , δ i ) = ∑ α i ⊗ α i i =1 δ i

(17.1)

where ⊗ denotes the tensor product of two vectors. The effect of this transformation in two dimensions is illustrated in Figure 17.7 for the case of constant mesh parameters throughout the domain.

17.3.6 Mesh Control The inclusion of adequate mesh control is a key ingredient in ensuring the generation of a mesh of the desired form. Control over the characteristics is obtained by the specification of a spatial distribution of mesh parameters. This is accomplished by means of the background mesh supplemented by a distribution of sources.

17.3.7 Background Mesh The background mesh is used for interpolation purposes only and is made up of triangles in two dimensions and tetrahedra in three dimensions. Values of αi and δi are defined at the nodes of the background mesh. The background mesh employed must cover the region to be discretized (see Figure 17.8). In the generation of an initial mesh for the analysis of a particular problem, the background mesh will usually consist of a small number of elements. The generation of the background mesh can ©1999 CRC Press LLC

FIGURE 17.6 Characterization of the mesh: (a) the mesh parameters in two dimensions, (b) the mesh parameters in three dimensions.

FIGURE 17.7

The effect of the transformation T for a constant distribution of the mesh parameters.

in this case be accomplished without resorting to sophisticated procedures, e.g., a background mesh consisting of a single element can be used to impose the requirement of a linearly varying or a constant spacing and stretching through the computational domain. The effect of prescribing a variable mesh spacing and stretching is illustrated in Figure 17.9 for a problem involving a rectangular domain, using a background mesh consisting of two triangular elements.

17.3.8 Distribution of Sources For complex geometries, the manual definition of a background mesh can become a very tiresome task. The use of a distribution of sources eases the problem of ensuring the desired specification of the mesh parameters in specific regions in the computational domain, such as the leading and trailing edges of wings. In this approach, an isotropic* spatial distribution of element sizes is specified as a function of ©1999 CRC Press LLC

FIGURE 17.8

The background mesh for the specification of a spatial distribution of mesh parameters.

FIGURE 17.9 Mesh generated for a rectangular domain using a background mesh consisting of two elements to illustrate the effect of variable mesh spacing and stretching.

the distance x from the point of interest to a “source.” The source may take the form of a point, a line segment or a triangle. The form adopted for the function is

if x ≤ xc δ1 δ ( x ) = x − xc log 2 δ1e D− xc if x ≥ xc

(17.2)

This function is local in character and allows for a rapid increase in element size, thus ensuring that the number of generated elements around the source can be kept within reasonable bounds. The quantities *The spacing at a point is the same in all directions.

©1999 CRC Press LLC

FIGURE 17.10

Mesh generated for a rectangular domain using a point source.

FIGURE 17.11

Point, line, and triangle sources.

δ1, D, and xc denote user-specified values that can be altered to control the form of δ(x). An example of a mesh produced by such a function is shown in Figure 17.10. For line and triangle sources the spacing δ at a point P is defined in a similar manner. We choose the closest point S in the line or triangle to the point P — see Figure 17.11 — as a point source. The distance x is now the distance between the points P and S and the quantities δ1, D, and xc at point S are linearly interpolated from the nodal values at the points defining the line or triangle sources. The spacing at a point is computed for the background mesh and for each of the user-defined point, line and triangle sources. The final spacing is computed as the minimum of all of them.

17.3.9 Calculation of the Transformation T The generation process is always performed in a normalized space. The transformation T, given by Eq. 17.1, is repeatedly used to transform regions in the physical space into regions in the normalized space. In this way the process is greatly simplified, as the desired size for a side, triangle, or tetrahedron in this space is always unity. After the element has been generated, the coordinates of the newly created point, if any, are transformed back to the physical space, using the inverse transformation. ©1999 CRC Press LLC

FIGURE 17.12

The generation of a new triangle.

At any point of the computational domain the transformation T is computed as follows. First, the element of the background mesh that contains the point is found and the transformation Tb is computed by linearly interpolating its components from the element nodal values. The stretching directions α bi and corresponding spacings δ bi ; i = 1, 2, 3 are obtained from the eigenvalues and eigenvectors of the matrix Tb. The spacings δ bi are then modified to account for the distribution of sources. The new spacings δ *i at the point are computed as the smallest of the spacings defined by all the sources and the current spacing δ bi . Finally, the transformation T is obtained by substituting the values of α bi and δ *i in the formula Eq. 17.1.

17.3.10 Curve Discretization The discretization of the boundary curve compounds is achieved by positioning nodes along the curve according to a spacing dictated by the local value of the mesh parameters. Consecutive points are joined by straight lines to form sides. The manner by which this can be accomplished has been described in detail in Chapter 16.

17.3.11 Triangle Generation in Two-Dimensional Domains The triangle generation algorithm utilizes the concept of a generation front. At the start of the process the front of the sequence of straight-line segments that connect consecutive boundary nodes. During the generation process, any straight-line segment that is available to form an element side is termed active, whereas any segment that is no longer active is removed from the front. Thus, while the domain boundary will remain unchanged, the generation front changes continuously and needs to be updated whenever a new element is formed along the steps described in Section 17.3.4. In the process of generating a new triangle the following steps are involved (Figure 17.12):

©1999 CRC Press LLC

1. Select a side AB of the front to be used as a base for the triangle to be generated. Here, the criterion is to choose the shortest side. This is especially advantageous when generating irregular meshes. 2. Interpolate from the background mesh the transformation T at the center of the side M and apply it to the nodes in the front that are relevant to the triangulation. In our implementation we define the relevant points to be all those that lie inside the circle of center M and radius three times the ˆ denote the positions in the normalized length of the side being considered. Let Aˆ , Bˆ and M space of the points A, B, and M, respectively. 3. Determine, in the normalized space, the ideal position Pˆ 1 for the vertex of the triangular element. ˆ The point Pˆ 1 is located on the line perpendicular to the side that passes through the point M and at a distance δ1 from the points Aˆ and Bˆ . The direction in which Pˆ 1 is generated is determined by the orientation of the side. The value δ 1 is chosen according to the criterion

1.00 δ1 = 0.55 × L 2.00 × L

4.

5.

6. 7.

if 0.55 × L < 1.00 < 2.00 × L if 0.55 × L < 1.00

(17.3)

if 1.00 > 2.00 × L

where L is the distance between points Aˆ and Bˆ . Only in situations where the side AB happens to have characteristics very different from those specified by the background mesh will the value of δ 1 be different from unity. However, the above inequalities must be taken into account to ensure geometrical compatibility. Expression (3) is pure empirical, and different inequalities could be devised to serve the same purpose. Select other possible candidates for the vertex and order them in a list. Two types of points are ˆ 2 , … in the current generation front that are, in the ˆ1, Q considered viz. (a) all the nodes Q 1 normalized space, interior to a circle with center Pˆ and radius r = δ 1, and (b) the set of points 1 5 1 ˆ i , construct the circle, with center ˆ . For each point Q Pˆ , …, Pˆ generated along the height Pˆ M i 1 ˆ ˆ i , Aˆ and Bˆ 1 . ˆ ˆ C Q on the line defined by points P and M , and that passes through the points Q i 1 ˆi ˆ , defines an ordering of the Q The position of the centers, Cˆ Q , of these circles, on the line Pˆ M i ˆ points in which the point with the furthest center points. A list is created that contains all the Q 1 1 1 5 ˆ ˆ ˆ from P in the direction P M appears at the head of list. The points Pˆ , …, Pˆ are added at the end of this list. Select the best connecting point. This is the first point in the order list which gives a consistent triangle. Consistency is guaranteed by ensuring that none of the newly created sides intersects with any of the existing sides in the front. Finally, if a new node is created, its coordinates in the physical space are obtained by using the inverse transformation T–1. Store the new triangle and update the front by adding/removing the relevant sides.

This mesh generation procedure is schematically presented in the diagram shown in Figure 17.13.

17.3.12 Mesh Quality Enhancement In order to enhance the quality of the generated mesh, two post-processing procedures are applied. These procedures, which are local in nature, do not alter the total number of points or elements in the mesh. • Diagonal swapping: This changes the connectivities among nodes in the mesh without altering their

position. This process requires a loop over all the element sides, excluding those sides on the boundary. For each side AB (Figure 17.14), common to the triangles ABC and ADB, one considers the possibility of swapping AB by CD, thus replacing the two triangles ABC and ADB by the triangles ADC and BCD. The swapping is performed if a prescribed regularity criterion is better satisfied by the new configuration than by the existing one. In our implementation, the swapping operation is performed if the minimum angle occurring in the new configuration is larger than that in the original configuration.

©1999 CRC Press LLC

FIGURE 17.13 Flow chart for mesh generation using the advancing front technique. Double lined boxes are only required if the effect of variable mesh size and stretching are to be included.

FIGURE 17.14

The diagonal swapping procedure: (a) nonadmissible, (b) admissible.

• Mesh smoothing: This alters the positions of the interior nodes without changing the topology of

the mesh. The element sides are considered as springs and the stiffness of a spring is assumed to be proportional to its length. The nodes are moved until the spring system is in equilibrium. The equilibrium positions are found by iteration. Each iteration amounts to performing a loop over the interior points and moving their coordinates to coincide with those of the centroid of the neighboring points. Usually three to five iterations are performed.

©1999 CRC Press LLC

FIGURE 17.15

The generation of a tetrahedral element.

The combined application of these two post-processing algorithms is found to be very effective in improving the smoothness and regularity of the generated mesh.

17.3.13 Surface Discretization The method followed for the triangulation of the surface components is an extension of the mesh generation procedure for planar domains described above. The discretisation of each surface component is accomplished by generating a two-dimensional mesh of triangles in the parametric plane (u1, u2) and then using the mapping r(u1, u2) defined in Section 17.3. This mapping establishes a one-to-one correspondence between the surface component and a region on the parametric plane (u1, u2). Thus, a consistent triangular mesh in the parametric plane will be transformed, by the mapping r(u1, u2), into a valid triangulation of the surface component. The construction of the triangular mesh in the parameter plane (u1, u2) using the two dimensional mesh generator, requires the determination of an appropriate spatial distribution of the two dimensional mesh parameters. This problem has been addressed in detail in Chapter 19.

17.3.14 Generation of Tetrahedra The starting point for the discretization of the three-dimensional domain into tetrahedra is the formation of the initial generation front. The initial front is the set of oriented triangles that constitutes the discretized boundary of the domain and is formed by assembling the discretized boundary surface components. The order in which the nodes of these triangles are given defines the orientation, which is the same as that of the corresponding boundary surface component. The algorithm for generating tetrahedra is analogous to that described above for the generation of triangles (see Figure 17.13). However, in the three-dimensional case the range of possible options at each stage is much wider and the number of geometrical operations involved increases considerably. Thus, the ability of the method to produce a mesh, and the efficiency of its implementation, relies heavily upon the type of strategy selected. The generation of a generic tetrahedral element involves the following steps (Figure 17.15):

©1999 CRC Press LLC

1. Select a triangular face ABC from the front to be a base for the tetrahedron to be generated. In principle, any face could be chosen, but we have found it to be advantageous in practice to consider the smallest faces first. For this purpose, the size of the face is defined in terms of the size of its shortest height. 2. Interpolate from the background mesh the transformation T at the centroid of the face M and apply it to the nodes in the front that are relevant to the triangulation. In our implementation, we define the relevant points to be those which lie inside the sphere of center M with radius equal to three times the value of the maximum dimension of the face being considered. Let Aˆ , ˆ denote the positions in the normalized space of the points A, B, C, and M, Bˆ , Cˆ and M respectively. 1 3. Determine, in the transformed space, the ideal position Pˆ for the vertex of the tetrahedral 1 ˆ and is perpendicular to element. The point Pˆ lies on the line that passes through the point M 1 the face. The direction in which Pˆ is generated is determined by the orientation of the face. The 1 location of Pˆ is computed so that the average length of the three newly created sides, which join 1 point Pˆ with points Aˆ , Bˆ , and Cˆ , is unity. For faces whose size in the parametric plane is very different from unity, this step may have to be modified, as in Eq. 17.3, to ensure geometrical compatibility. However, such cases rarely occur in practice. Let δ1 be the maximum of the distances 1 between point Pˆ and points Aˆ , Bˆ , and Cˆ . 4. Select other possible candidates for the vertex and order them in a list. Two types of points are ˆ1, Q ˆ 2 , … in the current generation front which are, in the considered viz. (a) all the nodes Q ˆ and radius r = δ1, and (b) a new set of normalized space, interior to a sphere with center M 1 5 1 ˆ . Consider the set of points Aˆ , Bˆ , and Cˆ points Pˆ , …, Pˆ generated along the height Pˆ M ˆi, ˆ the member of this set that is furthest away from M ˆ . For each point Q and denote by D i 1 ˆ and which passes construct the sphere with center Cˆ Q on the line defined by points Pˆ and M ˆ i and D ˆ . The position of the centers Cˆ iQ of these spheres on the line Pˆ 1M ˆ though points Q ˆ 1 points in which the point with the furthest center from Pˆ 1 in defines an ordering of the Q 1 ˆ appears at the head of list. The points Pˆ 1 , …, Pˆ 5 are added at the end of the direction Pˆ M this list. 5. Select the best connecting point. This is the first point in the ordered list that gives a consistent tetrahedron. Consistency is guaranteed by ensuring that none of the newly created sides intersects with any of the existing faces in the front, and that none of the existing sides in the front intersect with any of the newly created faces. 6. If a new node is created, its coordinates in the physical space are obtained by using the inverse transformation T–1. 7. Store the new tetrahedron and update the front by adding/removing the necessary triangles.

17.3.15 Mesh Quality Assessment Any discussion of mesh quality should be intimately related to the form of the solution we are trying to represent on that mesh. Two factors need to be considered here: 1. Determination of the characteristics of the optimal mesh for the problem at hand. This introduces the concept of adaptivity and this aspect is considered elsewhere. 2. Assessment on how well the generated mesh meets the requirements specified by the mesh parameters. This assessment can be made by examining the generated mesh and determining the statistical distribution of certain indicators. For example, in Figure 17.16 we have chosen as indicators the number of elements around a side, the magnitude of the element dihedral angles, and the length of the side. These indicators are compared with optimal values, i.e., those of a regular tetrahedron that has the exact dimensions specified by the mesh parameters.

©1999 CRC Press LLC

FIGURE 17.16

Mesh quality statistics.

17.4 Data Structures From Section 17.2 it is apparent that a successful implementation of the mesh generation algorithm will require the use of data structures that enable certain sorting and searching operations to be performed efficiently. For instance, the generation front will require a data structure that allows for the efficient insertion/deletion of sides/faces and that also allows for the efficient identification of the sides/faces that intersect with a prescribed region in space. The problem of determining the members of a set of n points that lie inside a prescribed subregion of an N-dimensional space is known as geometric searching. Several algorithms have been proposed [3, 30, 9] that solve this problem, or equivalent problems, with a computational expense proportional to log(n). The problem complexity increases considerably when, instead of considering points, one deals with finite size objects such line segments, triangles, or tetrahedra. A common problem encountered here, namely geometric intersection, consists of finding the objects that overlap a certain subregion of the space being considered. The algorithm adopted here for solving these problems in three dimensions is based on the use of the alternating digital tree [7]. The alternating digital tree (ADT) algorithm allows for the efficient solution of the geometric searching and intersection problem. It naturally offers the possibility of inserting and removing points and optimally searching for the points contained inside a given region. The ADT algorithm is an extension of the socalled digital binary tree search technique, which is exhaustively used in [18] for one-dimensional problems. It is applicable to any number of dimensions, and allows any geometrical object in an Ndimensional space to be treated as a point in a 2N-dimensional space. The following sections describe the ADT algorithm, and the associated data structures employed, for the efficient solution of the geometric searching problem.

©1999 CRC Press LLC

FIGURE 17.17

The relation between a binary tree and a bisection process.

17.4.1 The Alternating Digital Tree Binary trees provide the basis for several searching algorithms, including the one to be presented here. A detailed exposition of binary tree structures can be found in Chapter 14 and references therein. Consider a set of n points in a N-dimensional space (RN) and assume for simplicity that the coordinate values of their position vectors x1, x2, …, xn, after adequate scaling, vary within the interval [0, 1). The aim of geometric searching algorithms is to select from this set those points that lie inside a given subregion of the space. To facilitate their representation, only rectangular — or “hyper-rectangular” — regions will be considered, thereby allowing their definition in terms of the scaled coordinates of the lower and upper vertices as (a, b). Comparing the coordinates of each point k with the vertex coordinates of a given subregion, to check whether the condition ai ≤ xik ≤ bi is satisfied for i = 1, 2, …, N, would render the cost of the searching operation proportional to the number of points n. This computational expense, however, can be substantially reduced by storing the points in a binary tree, in such a way that the structure of the tree reflects the positions of the points in space. There exist several well-known algorithms that will accomplish this effect for one dimensional problems; the most popular are the binary search tree and digital tree methods [18]. Binary search trees have been extended to N-dimensional problems in [6], but the resulting tree structure, known as N-d trees, do not allow for the efficient deletion of nodes. The algorithm presented here is a natural extension of the one- dimensional digital tree algorithm and overcomes the difficulties encountered in N-d trees. Broadly speaking, an alternating digital tree can be defined as a binary tree in which a set of n points are stored according to certain geometrical criteria. These criteria are based on the similarities arising between the hierarchical and parental structure of a binary tree and a recursive bisection process: each node in the tree has two sons, likewise a bisection process divides a given region into two smaller subregions. Consequently, it is possible to establish an association between tree nodes and subregions of the unit hypercube as follows: the root represents the unit hypercube itself; this region is now bisected across the x1 axis and the region for which 0 ≤ x1 < 0.5 is assigned to the left son and the region for which 0.5 ≤ x1 < 1 is assigned to the right son; at each of these nodes the process is repeated across the x2 direction as shown in Figure 17.17. In a two-dimensional space this process can be repeated indefinitely by choosing x1 and x2 directions in alternating order; similarly, in a general N-dimensional space, the process can be continued by choosing directions x1, x2, …, xN in cyclic order. Generally, if a node k at the hierarchy level m — the root being level 0 — represents a region (ck, dk), the subregions associated to its left and right sons, (clk, dlk) and (crk, drk) result from the bisection of (ck, dk) by a plane normal to the jth coordinate axis, where j is shown cyclically from the N space directions as:

j = 1 + mod( m, N )

(17.4)

and mod(m, N) denotes the remainder of the quotient of m over N. Hence (clk, dlk) and (crk, drk) are obtained as

ckli = cki , dkli = dki for i =/ j and cklj = ckj , dklj =

©1999 CRC Press LLC

1 j (ck + dkj ) 2

(17.5)

ckri = cki , dkri = dki for i =/ j and cklj =

1 j (ck + dkj ), dklj = dkj 2

(17.6)

This correlation between nodes and subdivisions of the unit hypercube allows an ADT to be further defined by imposing that each point in the tree should lie inside the region corresponding to the node where it is stored. Consequently, if node k of an ADT structure contains a point with coordinates xk, the following condition must be satisfied:

cki ≤ xki < dki for i = 1, 2, ..., N

(17.7)

17.4.2 Geometric Searching Consider now a set of points stored in an ADT structure. The fact that Eq. 17.7 is satisfied by every point provides the key to the efficient solution of a geometric searching problem. To illustrate this, note first that the recursive structure of the bisection process described above implies that the region related to a given node k contains all the subregions related to notes descending from k; consequently, all points stored in these nodes must also lie inside the region represented by node k. For instance, all points in the ADT structure are stored in nodes descended from the root and, clearly, all of them lie inside the unit hypercube — the region associated with the root. Analogously, the complete set of points stored in any subtree is inside the region represented by the root of the subtree. This feature can be effectively used to reduce the cost of a geometric searching process by checking, at any node k, the intersection between the searching range (a, b) and the region represented by node k, namely (ck, dk). If these two regions fail to overlap, then the complete set of points stored in the subtree rooted at k can be disregarded from the search, thus avoiding the need to examine the coordinates of every single point. Consequently, a systematic procedure to select the points that lie inside a given searching range (a, b) can be derived from the traversal algorithm previously presented. Now the generic operation “visit the root” can be reinterpreted as checking whether the point stored in the root falls inside the searching range. Additionally, the left and right subtrees need to be traversed only if the regions associated with their respective root nodes intersect with the range.

17.4.3 Geometric Intersection Geometrical intersection problems can be found in many applications; for instance, a common problem that may emerge in contact algorithms [8], hidden-line removal applications, or in the advancing front mesh generation algorithm presented in Section 17.2, is to determine from a set of three-noded triangular elements those which intersect with a given line segment. Similar problems, involving other geometrical objects, are encountered in a wide range of geometrical applications. In general, a geometric intersection problem consists of finding from a set of geometrical objects those which intersect with a given object. If every one-to-one intersection is investigated, the solution of these problems can become very expensive, especially when complex objects such as curves or surfaces are involved. Fortunately, many of these one-to-one intersections can be quickly discarded by means of a simple comparison between the coordinate limits of every given pair of objects. For instance, a triangle with x-coordinate varying from 0.5 and 0.7 cannot intersect with a segment with x-coordinate ranging from 0.1 to 0.3. Generally, the intersection between two objects in the N-dimensional Euclidean space, requires each of the N pairs of coordinate ranges to overlap. Consider for instance the intersection problem between triangular facets and a target straight line segment in R3; then, if (xk,min, xk,max) are the coordinate limits of element k and (x0,min, x0,max) are the lower and upper limits of the target segment (see Figure 17.18), an important step toward the solution of a geometric intersection problem is to select those that satisfy the inequality

©1999 CRC Press LLC

FIGURE 17.18

The definition of coordinate limits for triangular elements and straight line segments.

xki , min ≤ x0i , max for i = 1, 2,..., N x

i k , max

≤x

(17.8)

i 0 , min

The cost of checking Eq. 17.8 for every element grows proportionally to n, and for very numerous sets may become prohibitive. This cost, however, can be substantially reduced by using a simple device whereby the process of selecting those elements that satisfy Eq. 17.8 can be interpreted as a geometric searching problem. Additionally, since the number of elements that satisfy Eq. 17.8 will normally be much smaller than n, the cost of determining which of these intersects with the target segment becomes affordable. In order to interpret Eq. 17.8 as a geometric searching problem, it is first convenient to assume that all the elements to be considered lie inside a unit hypercube — a requirement that can be easily satisfied through adequate scaling of the coordinate values. Consequently, Eq. 17.8 can be rewritten as

0 ≤ xk1, min ≤ x01, max M 0 ≤ xkN, min ≤ x0N, max

(17.9)

x01, min ≤ xk1, max ≤ 1 M x

N 0 , min

≤ xkN, max ≤ 1

Consider now a given object k in RN with coordinate limits xk,min, and xk,max; combining this two sets of coordinate values, it is possible to view an object k in RN as a point in R2N with coordinates xik for i = 1, 2, …, 2N defined as (see Figure 17.19):

[

x k = xk1,min ..., xkN,min , xk1,max ,..., xkN,max

]

T

Using this representation of a given object k, Eq. 17.9 becomes simply:

©1999 CRC Press LLC

(17.10)

FIGURE 17.19

FIGURE 17.20

The representation of a region in R1 as a point in R2.

The intersection problem in R1 as a searching problem in R2.

a i ≤ xki ≤ b1

for i = 1, 2,..., 2 N

(17.11)

where a and b can be interpreted as the lower and upper vertices of a “hyper-rectangular” region in R2N and, recalling Eq. 17.9, their components can be obtained in terms of the coordinate limits of the target object (see Figure 17.20) as

[ b = [x

a = 0,..., 0, x01,max ,..., xoN,max 1 0 , min

]

,..., x0N,min ,1,...,1

]

T

T

(17.12)

Consequently, the problem of finding which objects in RN satisfy Eq. 17.8 becomes equivalent to a geometric searching problem in R2N, i.e., obtaining the points xk that lie inside the region limited by a and b. Once this subgroup of elements has been selected, the intersection of each one of them with the target object must be checked to complete the solution of the geometric intersection problem.

17.4.4 The Use of the ADT for Mesh Generation The advancing front algorithm described in Section 17.2 requires frequent use of operations such as searching, for the points inside a certain region of the space, and determining intersections between geometrical objects — in this case sides and faces. The complexity of the problem is increased by the fact that the set of faces forming the generation front changes continuously as new faces need to be inserted and deleted during the process. Clearly, for meshes consisting of a large number of elements the cost of performing this operations can be very important. A successful implementation of the above algorithms has been accomplished by making extensive use of the ADT data structure. For instance, the algorithm for tetrahedra generation employs two tree structures; one for the faces in the front and the other for the sides defined by the intersection between each pair of faces in the front. This combination allows a high degree of flexibility so that the operations

©1999 CRC Press LLC

FIGURE 17.21

Mesh generation CPU times.

of insertion, deletion, geometric searching, and geometric intersection can be performed optimally. The overall computational performance of the algorithm is demonstrated by generating tetrahedral meshes, using the above method, for a unit cube (see Figure 17.21). Different numbers of elements have been obtained by varying the mesh size. In Figure 17.21 the computer time required on a VAX 8700 machine has been plotted against the number NE of elements generated. It can be observed that a typical NE × log (NE) behavior is attained. Using this approach, meshes containing up to one million elements have been generated and no degradation in the performance has been detected.

17.5 Conclusions A detailed description of the basics of a mesh generation procedure, based upon advancing front concepts, has been presented. Although no meshes for three-dimensional computational domains have been included, there are numerous examples in the literature of the power of the approach when it is applied to the problem of discretizing three dimensional domains of general complex shape [26, 17]. Recent implementations [22] have been shown to be extremely robust and achieve a high level of computational efficiency.

References 1. Allwright, S., Multiblock topology specification and grid generation for complete aircraft configurations, Applications of Mesh Generation to Complex 3D Configurations, AGARD Conference Proceedings, No. 464, pp. 11.1–11.11, 1990. 2. Baker, T. J., Unstructured mesh generation by a generalized Delaunay algorithm, Applications of Mesh Generation to Complex 3D Configurations, AGARD Conference Proceedings 1990, No. 464, pp. 20.1–20.10. 3. Bentley J. L. and Friedman, J.H., Data structures for range searching, Computing Surveys, 11, No 4, 1979. 4. Blacker T. D. and Sthepenson, M.B., Paving: a new approach to automated quadrilateral mesh generation, Int. J. Num. Meth. Eng., 32, pp. 811–847, 1991. 5. Blacker T. D. and Meyers, R.J., Seams and wedges in plastering: a 3d hexahedral mesh generation algorithm, Eng. Computers, 9, pp. 83–93, 1993. 6. Bentley, J. L., Multidimensional binary search trees used for associative searching, Comm. ACM. 18, No 1, 1975.

©1999 CRC Press LLC

7. Bonet J. and Peraire, J., An alternating digital tree (adt) algorithm for geometric searching and intersection problems, Int. J. Num. Meth. Eng., 31, pp. 1–17, 1990. 8. Bonet, J., Finite element analysis of thin sheet superplastic forming process, Ph.D. Thesis, University of Wales, C/PhD/128/89, 1989. 9. Boris, J., A vectorised algorithm for determining the nearest neighbours, J. Comp. Phys., 66, pp. 1–20, 1986. 10. Cavendish, J. C., Field, D. A., and Frey, W. H., An approach to automatic three dimensional finite element mesh generation, Int. J. Num. Meth. Eng., 21, pp 329–348, 1985. 11. Faux, I. D. and Pratt, M. J., Computational Geometry for Design and Manufacture, Ellis Horwood, Chichester, 1981. 12. Formaggia, L., An unstructured mesh generation algorithm for three-dimensional aircraft configurations, Numerical Grid Generation in CFD and Related Fields. (Ed.) Sanchez-Arcilla, A., et al., 13. Frykestig, J., Advancing front mesh generation techniques with application to the finite element method, Dept. of Structural Mechanics Publication 94, 10, Chalmers University of Technology, Göteborg, Sweden, 1994. 14. George, A. J., Computer implementation of the finite element method, Ph.D. Thesis, Stanford University, STAN–CS–71–208, 1971. 15. Golgolab, A., Mailleur 3D automatique pour des géométries complexes, INRIA Research Report No 1004, March 1989. 16. Huet, F., Generation de maillage automatique dans des configurations tridimensionnelles complexes. Utilisation d’une Methode de Front, Applications of Mesh Generation to Complex 3D Configurations, AGARD Conference Proceedings, No. 464, pp 17.1–17.12, 1990. 17. Jin H. and Tanner, R.I., Generation of unstructured tetrahedral meshes by advancing front technique,” Int. J. Num. Meth. Eng., 36, pp 1805–1823, 1993. 18. Knuth, D., The Art Of Computer Programming — Sorting And Searching, Vol. 3, Addison-Wesley, 1973. 19. Lo, S. H., A new mesh generation scheme for arbitrary planar domains, Int. J. Num. Meth. Eng., 21, pp. 1403–1426, 1985,. 20. Lo, S. H., Volume discretization into tetrahedra — II. 3D triangulation by advancing front approach, Comp. Struct., 39, No 5, pp. 501–511, 1991. 21. Löhner R. and Parikh, P., Generation of three-dimensional unstructured grids by the advancingfront method, AIAA Paper AIAA-88-0515, 1988. 22. Löhner, R., Extensions and improvements of the advancing front grid generation technique, Comm. Num. Meth. Eng., 12, pp 683–702, 1996. 23. Möller P. and Hansbo, P., On advancing front mesh generation in three dimensions, Int. J. Num. Meth. Eng., 38, pp. 3551–3569, 1995. 24. Peiró, J., Peraire J., and Morgan, K., FELISA system reference manual. Part I: basic theory, Civil Eng. Dept. Report, CR/821/94, University of Wales, Swansea, U.K., 1994. (More information about the FELISA system is available at http://ab00.larc.nasa.gov/~kbibb/felisa.html.) 25. Peraire, J., Vahdati, M., Morgan, K., and Zienkiewicz, O.C., Adaptive remeshing for compressible flow computations, J. Comp. Phys., 72, pp. 449–466, 1987. 26. Peraire, J. Peiró, J., Formaggia, L., Morgan, K., and Zienkiewicz, O.C., Finite element Euler computations in three dimensions, Int. J. Num. Meth. Eng., 26, pp. 2135–2159, 1988. 27. Peraire, J., Morgan, K., and Peiró, J., Unstructured finite element mesh generation and adaptive procedures for CFD, Applications of Mesh Generation to Complex 3D Configurations, AGARD Conference Proceedings, No. 464, pp 18.1–18.12, 1990. 28. Peraire, J., Peiró, J., and Morgan, K., Adaptive remeshing for three-dimensional compressible flow computations, J. Comp. Phys., 103, pp. 269–285, 1992. 29. Requicha, A. A. G. and Voelcher, H. B., Solid modeling: a historical summary and contemporary assessment, IEEE Computer Graphics and Applications, 3, 2, pp. 9–24, 1982.

©1999 CRC Press LLC

30. Shamos M. I. and Hoey, D., Geometric intersection problems, 17th Annual Symposium on Foundations of Computer Science, IEEE, 1976. 31. Thompson, J. F., Warsi, Z. U. A., and Mastin, C. W., Numerical Grid Generation — Foundations and Application, North-Holland, 1985. 32. Thomasset, F., Implementation of Finite Element Methods for Navier–Stokes Equations, Springer Series in Comp. Physics, 1981. 33. Weatherill, N. P., Mesh generation in computational fluid dynamics, von Karman Institute for Fluid Dynamics Lecture Series 1989-04, Brussels, 1989. 34. Zhu, J. Z., Zienkiewicz, O. C., Hinton, E., and Wu, J., A new approach to the development of automatic quadrilateral mesh generation, Int. J. Num. Meth. Eng., 32, pp. 894–866, 1991.

©1999 CRC Press LLC

18 Unstructured Grid Generation Using Automatic Point Insertion and Local Reconnection 18.1 18.2 18.3

Introduction Unstructured Grid Generation Procedure Two-Dimensional Application Examples

18.4

Three-Dimensional Surface Grid Generation

Multi-element Airfoil • Mediterranean Sea Edge Grid Generation Procedure • Surface Grid Generation Procedure

18.5

Three-Dimensional Surface Grid Generation Application Examples Generic Shell • Hawaiian Islands

18.6 18.7

Surface and Volume Grid Generation Best Practice . Three-Dimensional Application Examples Pump Cover • SUV Interior • NASA Space Shuttle Orbiter • Launch Vehicle • Destroyer Hull

David L. Marcum

18.8

Summary

18.1 Introduction Unstructured grid generation procedures for triangular and tetrahedral elements have typically been based on either an octree [Shepard and Georges, 1991], advancing-front [Lohner and Parikh, 1988; Peraire et al., 1988], or Delaunay [Baker, 1987; George et al., 1990; Holmes and Snyder, 1988; Weatherill, 1985] approach. Efficiency is the primary advantage of the octree approach (see Chapter 15). The advancing-front approach (see Chapter 17) offers advantages of high-quality elements and integrity of the boundary. And, the Delaunay approach (see Chapter 16) offers advantages of efficiency and a sound mathematical basis. None of these procedures offers combined advantages of efficiency, quality, robustness, and sound mathematics. Recent research has focused on improving these methods and combining them in order to provide improved overall characteristics. Methods using a combined approach with advancing-front-type point placement and a Delaunay connectivity have been developed for triangular elements [Mavriplis, 1993; Muller et al., 1993; Rebay, 1993]. These methods can produce grids with quality similar to that of traditional advancing-front methods along with the robustness and sound mathematics of a Delaunay approach. However, efficiency has not been substantially improved.

©1999 CRC Press LLC

Alternative approaches have been developed using automatic point insertion and connectivity optimization. In this type of approach, point placement and connectivity schemes can be devised that are independent processes. For connectivity optimization, variations of the edge-swapping or local-reconnection algorithm of Lawson [1986] can be used. In this scheme, the grid is repetitively reconnected to locally satisfy a desired criterion. A Delaunay triangulation can be obtained using an in-circle criterion. Barth [1995] has implemented this approach with a Delaunay criterion and circumcenter point placement. However, alternative local reconnection criteria are desired for optimal grid quality. This is especially true in three dimensions, where a Delaunay satisfied grid typically contains many “sliver" elements (which have four, nearly coplanar points). Lawson's method can be used with alternative criteria which should not produce slivers. Unfortunately, in three dimensions, most criteria quickly converge to optimum local states which are far from the desired global optimum. Marcum and Weatherill [1995] developed a very efficient local reconnection procedure using advancing-front point placement and a combined Delaunay/min–max (minimize the maximum angle) type local-reconnection criterion for generation of triangular or tetrahedral element grids. It is often referred to as the advancing-front/local–reconnection or AFLR method. This procedure differs substantially from the previously cited methods in that the combined Delaunay/min–max reconnection criterion is the only criteria developed to date that allows effective optimization of a three-dimensional tetrahedral element connectivity; it makes effective use of the existing grid as a search data structure, and point insertion is performed using direct subdivision. This methodology has also been extended for generation of high-aspect-ratio elements, right-angle elements, and solution-adapted grids [Marcum, 1995a; 1995b; 1996a; Marcum and Gaither, 1997]. High-quality grids have been generated about geometrically complex configurations in two and three dimensions for a variety of applications using this method. The combined Delaunay criterion can be used effectively with optimization criteria other than min–max. Various point placement strategies and connectivity optimization criteria have been implemented and compared within this procedure. Results verify that, for isotropic grid generation, advancing-front point placement with a combined Delaunay/min–max connectivity criterion consistently produces the highest element quality in an efficient manner [Marcum, 1995c]. Fully compatible edge and surface grid generation components using this procedure have also been developed [Marcum, 1996b]. In this chapter, an overview of the AFLR method for planar, surface, and volume grid generation is presented. Several application examples are presented demonstrating the capabilities, consistency, efficiency, and quality of this approach. In addition, a discussion on best practices using this methodology is presented.

18.2 Unstructured Grid Generation Procedure The AFLR triangular/tetrahedral grid generation procedure used in the present work is a combination of automatic point creation, advancing type ideal point placement, and connectivity optimization schemes. A valid grid is maintained throughout the grid generation process. This provides a framework for implementing efficient local search operations using a simple data structure. It also provides a means for smoothly distributing the desired point spacing in the field using a point distribution function. This function is propagated through the field by interpolation from the boundary point spacing or by specified growth normal to the boundaries. Points are generated using either advancing-front-type point placement for isotropic elements, advancing-point-type point placement for isotropic right angle elements, or advancing-normal type point placement for high-aspect-ratio elements. The connectivity for new points is initially obtained by direct subdivision of the elements that contain them. Connectivity is then optimized by local reconnection with a min–max type (minimize the maximum angle) type criterion. The overall procedure is applied repetitively until a complete field grid is obtained. The basic steps in the procedure are briefly outlined below. More complete details and results are presented in Marcum and Weatherhill [1995] and Marcum [1995c].

©1999 CRC Press LLC

FIGURE 18.1 Unstructured grid generation process. (a) Initial triangulation, (b) triangulation after direct point insertion on third grid generation iteration, (c) triangulation after local reconnection on third grid generation iteration.

1. Specify point spacing on the boundary surface. 2. Generate a boundary surface grid. 3. Generate a valid initial triangulation of the boundary surface points only and recover all boundary surfaces. An example initial triangulation is shown in Figure 18.1a. 4. Assign a point distribution function to each boundary point based on the local point spacing. Also, optionally assign geometric growth rates normal to the boundary surface.

©1999 CRC Press LLC

FIGURE 18.2 Different point placement strategies. (a) Advancing-front point placement for isotropic equiangular elements, (b) advancing-point point placement for isotropic right-angle elements, (c) advancing-normal point placement for high-aspect-ratio right-angle elements.

4. Assign a point distribution function to each boundary point based on the local point spacing. Also, optionally assign geometric growth rates normal to the boundary surface. 5. For isotropic elements, generate points using advancing-front-type point placement. Points are generated by advancing from the edge/face that satisfies the point distribution function of elements that only satisfy the point distribution function on one edge/face. An example triangulation generated using advancing-front point placement is shown in Figure 18.2a. 6. For right angle elements, generate points using advancing-point-type point placement. Points are generated by advancing as in step 5, except two points are created by advancing along edge/face normals from the two/three points of the satisfied edge/face. An example triangulation generated using advancing-point point placement is shown in Figure 18.2b. 7. For high-aspect-ratio elements, generate points using advancing-normal-type point placement. Points are generated one layer at a time from the boundaries by advancing along normals dependent upon the boundary surface geometry. An example triangulation generated using advancingnormal point placement is shown in Figure 18.2c. A key aspect of the present implementation is the use of multiple normals. At points where the boundary surface is discontinuous, multiple normals are assigned to produce optimal grid quality. An example high-aspect-ratio element grid with multiple normals is shown in Figure 18.3. ©1999 CRC Press LLC

FIGURE 18.3

Tetrahedral field cut for high-aspect-ratio elemnt grid with multiple surface normals.

9

FIGURE 18.4 Possible triangulations for reconnectable element pairs. (a) Four reconnectable points in two dimensions, (b) five reconnectable points in three dimensions.

8. Interpolate the point distribution function for new points from the containing elements. If geometric growth is specified, then the distribution function is determined from an approximate distance to the nearest boundary and the specified geometric growth from that boundary. 9. Reject new points that are too close to other new points. 10. Insert the accepted new points by directly subdividing the elements which contain them. A triangulation after direct insertion is shown in Figure 18.1b. 11. Optimize the connectivity using local reconnection. For each element pair, compare the reconnection criterion for all possible connectivities and reconnect using the most optimal one. Possible triangulations in two and three dimensions are shown in Figures 18.4a and 18.4b, respectively. Repeat this local reconnection process until no elements are reconnected. In three dimensions a combined Delaunay/min–max type criterion is used [Marcum and Weatherill, 1995; Marcum, 1995a]. In this process, a Delaunay criterion is used initially and then the min–max criterion is applied. This improves the overall grid quality substantially and overcomes most of the problems associated with optimum local states that prohibit a global optimum from being obtained. Triangulations before and after local reconnection are shown in Figures 18.1b and 18.1c.

©1999 CRC Press LLC

12. Repeat the point generation and local reconnection process, steps 5 through 11, until no new points are generated. 13. Optionally combine elements to form quadrilaterals in two dimensions or hexahedral, prism, or pyramid elements in three dimensions. Elements are combined by advancing from boundary surfaces and selecting combinations based on alignment and quality. 14. Smooth the coordinates of the field grid. 15. Optimize the connectivity using the local reconnection process (step 11). The procedure described in the above steps allows complete control over the type and quality of grid to be generated with minimal user interaction. In generating the boundary surface grid, user input is required to specify point spacings at selected control points. Further control over the spacing of the field points can be obtained using specified geometric growth, fixed field points, embedded boundary surfaces or adaptation sources [Marcum, 1995b; 1996a]. Once a boundary surface grid is generated no further user input or adjustment of parameters is required other than selecting desired options such as type of point placement or geometric growth. With advancing-normal-type point placement for high-aspect-ratio elements, the procedure described above does produce sliver elements in three dimensions. These elements are generated only in regions of high-aspect-ratio elements with a very structured alignment. Elimination of these elements with local reconnection is not feasible. There may be no nearby optimization path which produces a better connectivity. The problem is inherently due to the very structured nature of the grid in these regions. Only a limited set of possible triangulations, that do not contain sliver elements, exists for a set of tetrahedra aligned in prismatic groups. A modified process is used for three- dimensional cases. In the present approach, the element connectivity is generated along with new points in high-aspect-ratio regions. Local reconnection is not used to determine the connectivity in these regions. Instead, the connectivity is directly determined as each new point is generated. This produces a very structured connectivity and allows the tetrahedral elements to be easily combined into structured type elements. Typically, the majority of the tetrahedral elements within the high-aspect-ratio region can be combined into six-node pentahedrons (prisms). The outer layer of this region may have some five-node pentahedrons (pyramids) to match the outer tetrahedral elements. In all cases, the pentahedral elements have strict node, edge, and face matching to each other and to neighboring tetrahedral elements.

18.3 Two-Dimensional Application Examples Selected application examples are presented here to demonstrate the capabilities of the present procedure for generation of two-dimensional unstructured grids. A summary of grid quality and required CPU time for the primary examples is presented in Table 18.1. Grid quality distributions and statistics are presented for each example. Element angle is used as the grid quality measure. The complete set of grid quality data consists of the three corner angles for all triangles. Maximum and standard deviation values are presented along with distribution plots in 5° increments. The results for the examples presented are representative of those obtained for a variety of configurations. Typically, for an isotropic grid, the maximum element angle is 120° or less, the standard deviation is 7° or less, and 99.5% or more of the elements have angles between 30° and 90°. The minimum angle is usually dictated by the geometry. Standard deviation is not applicable for grids with high-aspectratio elements, as there should be peak distributions at a small angle, 60°, and 90°. Also, the minimum angle typically depends upon the maximum aspect ratio with high-aspect-ratio elements. CPU time required on a laptop PC, desktop PC, and workstation is presented for each example. Computer routines for the two-dimensional grid generator are written in Fortran. All floating-point calculations are performed using 64 bit precision with 8 byte data. The CPU times reported include all I/O and generation of grid quality data. A discretized boundary edge grid file is the input. The output includes a grid coordinate and connectivity file and a quality data file. The efficiency of the overall procedure is such that generation of a typical grid requires only seconds on any current PC or workstation. All of the cases presented can be generated on a PC with at least 16 MB of RAM. ©1999 CRC Press LLC

TABLE 18.1

Summary of Grid Quality and CPU Requirements for Two-Dimensional Example Cases CPU Time (sec)

2D Case Wake-adapted Multi-element airfoil; 140,609 triangles Mediterranean; 213,323 triangles

FIGURE 18.5

Pentium Pro 200 Gateway 2000 G6-200 128 MG Solaris, g77

Ultra SPARC II 300 Sun Ultra 2 512 MB Solaris, f77 single processor

Max. Angle (deg)

Std. Dev. Angle (deg)

Pentium 120 Toshiba Tecra 500 128 MB Solaris, g77

127

n/a

40

16

9.5

118

7.2

61

27

13

Boundary edges for multi-element airfoil with multiple wakes.

User input required to generate a complete grid is minimal and includes specifying the point spacing at selected control points on boundary curves and selection of options such as growth from boundary curves or generation of high-aspect-ratio elements. There are no user adjustable parameters that need to be changed from case to case. Specification of point spacings is minimized by automatic reduction of the boundary point spacing in regions where the spacing is greater than the distance between nearby boundaries. The present code is very robust and thoroughly tested. It does not fail to produce a valid grid, given a set of boundary curves that are valid and have a reasonable discretization.

18.3.1 Multi-Element Airfoil A grid was generated for CFD analysis of the multielement airfoil configuration shown in Figure 18.5. In multielement airfoil configurations, viscous effects and the interaction of multiple wakes can impact overall performance. For optimum solution accuracy, a viscous grid with solution-adapted wakes was used. An initial grid without adaptation was generated and a viscous solution was obtained. Selected streamlines were tracked in the wake regions. These streamlines were then discretized and treated as embedded boundary edges for generation of aligned high-aspect-ratio elements in wake regions. Aligned high-aspect-ratio elements produce optimal resolution and grid quality. The boundary edges and embedded wakes are shown in Figure 18.5. The final solution-adapted grid contains 71,032 points and 140,609 elements and is shown Figure 18.6. Grid quality distribution for this grid is shown in Figure 18.7. Element angle distribution and maximum angle verify that the grid is of very high quality. The maximum element angle is generated within the high-aspect-ratio element region adjacent to one of the corners of the blunt trailing edges. Required CPU time is listed in Table 18.1. Details of solution-adaptation for viscous flow fields are presented in Marcum, [1996a].

18.3.2 Mediterranean Sea A grid was generated for the geometrically complex coastline of the Mediterranean Sea. The boundary edges for the computational domain are shown in Figure 18.8. The initial boundary curve discretization

©1999 CRC Press LLC

FIGURE 18.6

Final solution-adapted grid for multi-element airfoil with multiple wakes.

FIGURE 18.7

Grid quality distribution for multi-element airfoil grid.

FIGURE 18.8

Boundary edges of Mediterranean Sea grid.

was nearly uniform. Automatic point spacing reduction was used to reduce the point spacing near points of high curvature and in regions where boundaries are close to one another. Views of the grid near the Aegean Sea and Sea of Crete are shown in Figures 18.9a and 18.9b, respectively. The grid generated contains 111,612 points and 213,323 elements. Point distribution function growth was used to increase the element size away from the coastline. Element size varies smoothly within the grid. Grid quality distribution for the grid is shown in Figure 18.10. Element angle distribution, maximum value, and standard deviation verify that the grid is of very high quality. Required CPU time is listed in Table 18.1.

©1999 CRC Press LLC

FIGURE 18.9 Mediterranean Sea grid generated using point distribution function growth. (a) Grid near Aegean Sea, (b) grid near Sea of Crete.

FIGURE 18.10

Grid quality distributions for Mediterranean Sea grid.

18.4 Three-Dimensional Surface Grid Generation For grid generation with the present methodology, the grid point distribution is automatically propagated from specified control points to edge grids, from edge to surface grids, and finally from surface grids to

©1999 CRC Press LLC

FIGURE 18.11

Surface patches, edges, and corner points for fighter geometry definition.

the volume grid. Surface patches, edges, and corner points for a fighter geometry definition are shown in Figure 18.11. The first step in the grid generation process is to initially set the desired point spacing to a global value at all edge end points. Point spacings are then set to different values at desired control points on edges in specific regions requiring further resolution. For example, endpoints along leading edges and trailing edges would typically be set to a very fine point spacing. Point spacings can be set anywhere along an edge. A point in the middle of a wing section would typically be set to a larger point spacing than at the leading or trailing edges. As control point spacings are set, a discretized edge grid is created for each edge. Specification of desired control point spacings is typically the only user input required in the overall grid generation process. A CAD geometry system is used to define and evaluate the surface geometry. Edge and surface grid generation requires use of geometry evaluation routines and access to the geometry database. Surface topology is extracted from the CAD database and a separate data structure is used for grid generation [Gaither, 1994; 1997]. The grid generation procedures used have been designed to isolate geometry evaluation access. All access to geometry evaluation routines and data base is outside the grid generation routines. This approach produces a very clean interface between the grid generation and geometry system. It also makes it very easy to use different CAD geometry systems with very little modification. The edge grid generation and subsequent surface grid generation procedures are described in the following sections. Additional information can be found in [Marcum, 1996b]. The only CAD-related routine required for the present edge and surface grid generation is one that determines physical space coordinates, x,y,z, given mapped space coordinates, u,v. This routine is labeled routine xyz_from_uv in the following sections.

18.4.1 Edge Grid Generation Procedure Edge grids are created using a one-dimensional version of the standard grid generation procedure. This ensures that point distribution and growth rates are fully compatible for optimal final grid quality. For each edge or segment the point spacing is specified at both ends, as shown in Figure 18.12a. Edge grid generation is then used to produce the point distribution shown in Figure 18.12b. The basic steps in the edge grid procedure are outlined as follows.

©1999 CRC Press LLC

FIGURE 18.12

Specified point spacings and final point distribution for a surface edge.

1. Create an interpolation table for the mapped space coordinates versus arc length using the geometry evaluation routine xyz_from_uv. 2. Advance from each end of the edge segment in arc-length space and create two new points. The point spacings for these points are interpolated from the exposed interior endpoints of the edge. 3. Reject a new point if it is too close to the other new point. 4. Repeat the edge grid point generation process steps 2 and 3 until no new points are created. 5. Smooth the arc-length coordinates of the edge grid. 6. Interpolate for mapped space coordinates, u,v, at the generated arc-length coordinates. 7. Obtain the physical space coordinates, x,y,z, at the interpolated mapped space coordinates, u,v, using the geometry evaluation routine, xyz_from_uv. The edge grid generation routine consists of steps 2 through 6 above. All generation parameters for details such as interpolation, limiting, rejection, and smoothing are identical to those used in the standard planar and volume grid generation procedures.

18.4.2 Surface Grid Generation Procedure Given a geometry definition that uses a surface mapping, one can generate a surface grid in either mapped or physical space. With a mapped space approximation (MSA), a standard two-dimensional grid generator can be used as is. The advantage of this approach is efficiency. However, for realistic configurations, the mappings are often distorted in physical space and an MSA approach produces a poor-quality surface grid. The two-dimensional grid generation procedure can be modified to generate near optimal grids on a surface using a physical space approximation (PSA). In this approach, an approximate surface definition is used within the surface grid generation procedure to determine point placement, such that ideal surface triangles are created in physical space. The approximate surface definition provides an efficient means of iterating on the surface and allows the CAD geometry system to be decoupled from the grid generation procedure. A valid grid in both mapped and physical space is maintained throughout the procedure and all searching is done in mapped space. Local reconnection is performed in both mapped and physical space. The physical space reconnection cannot be used for elements that are considerably larger than the desired element size. These elements exist early in the process and can be composed of highly curved edges. The physical space reconnection does not account for edge curvature. However, in mapped space these edges are not curved and mapped space reconnection can be used. The PSA procedure produces an output grid in mapped space which corresponds to an approximately optimal surface grid when mapped back to the actual surface definition. The basic steps in the overall procedure are listed below.

©1999 CRC Press LLC

1. Generate a surface grid entirely in mapped space using the standard two-dimensional procedure. This grid will be used to define the physical space approximation. Any triangulation of the surface that adequately resolves the geometry can be used for the physical space approximation. 2. For the grid from step 1 above, obtain the physical space coordinates, x,y,z, at the mapped space coordinates, u,v, using the geometry evaluation routine xyz_from_uv. 3. Generate a valid initial triangulation of the edge points only and recover all discrete edges. 4. Assign a point distribution function to each edge point based on the local physical point spacing. 5. Generate points using advancing-front point placement by advancing from satisfied edges. These points are generated to obtain approximately optimal elements in physical space. Iteration and interpolation of physical space coordinates from mapped space coordinates are required. The grid from steps 1 and 2 is used as a locally linear approximation to the surface definition. 6. Interpolate the point distribution function for new points from the containing elements. 7. Reject new points that are too close to other new points in physical space. 8. For each accepted new point, search in mapped space for the containing element and directly inset the point. 9. Optimize the connectivity using local reconnection in mapped space. 10. Optimize the connectivity using local reconnection in physical space. Only elements that are close to satisfying the distribution function are allowed to be reconnected. 11. Repeat the point generation and local-reconnection process, steps 5 through 10, until no new points are generated. 12. Smooth the mapped space coordinates of the surface grid using physical space edge length weighting. This is equivalent to smoothing directly in physical space. 13. Interpolate for the smoothed physical space coordinates using the grid from steps 1 and 2. 14. Optimize the connectivity using physical space local reconnection. 15. Obtain the “true" physical space coordinates, x,y,z, on the surface at the generated mapped space coordinates, u,v, using the geometry evaluation routine, xyz_from_uv. The PSA surface grid generation routine consists of steps 3 through 14 above. All generation parameters for details such as interpolation, limiting, rejection, and smoothing are identical to those used in the standard planar and volume grid generation procedures. For both the edge and surface grid generation procedures, the final physical space grid is located on the actual surface defined by the geometry data base. The approximate physical space surface grid is used only within the grid generation procedures.

18.5 Three-Dimensional Surface Grid Generation Application Examples Two selected application examples are presented here to demonstrate the capabilities of the present procedure for generation of unstructured surface grids. Grid quality distributions and statistics are presented for each example. Element angle is used as the grid quality measure. The complete set of grid quality data consists of the three corner angles for all surface triangles. Maximum and standard deviation values are presented along with distribution plots in 5° increments. The results for the examples presented are representative of those obtained for a variety of surfaces. Typically, the resulting grid quality is the same as that expected for the two-dimensional grid generator. Required CPU times are about three times that required of the the two-dimensional grid generator.

18.5.1 Generic Shell The first case is a generic shell that was derived from a circular surface patch with a circular hole that is distorted in physical space. Surface grids were generated for this case with two different procedures. One was generated with the mapped space approximation (MSA) approach. With MSA the standard twodimensional grid generator is used in mapped space. The other grid was generated using the physical

©1999 CRC Press LLC

FIGURE 18.13

Surface grids in mapped space for generic shell. (a) MSA grid, (b) PSA grid.

space approximation (PSA) approach. Both grids are shown in Figures 18.13a and 18.13b in mapped space. The MSA grid is optimal in mapped space while the PSA grid is not. The grids in physical are shown in Figures 18.14a and 18.14b. The MSA grid contains distorted elements in physical space while the PSA grid is of very high quality. Grid quality distributions in physical space for these grids are shown in Figure 18.15. Element angle distribution, maximum value, and standard deviation verify that the PSA surface grid is of very high quality and the MSA surface grid is not.

18.5.2 Hawaiian Islands A surface grid was generated on the geometrically complex ocean bottom around the Hawaiian Islands. For this case, a usable grid can only be obtained using some form of physical space grid generation. The surface grid generated using the PSA approach is shown in Figure 18.16. A nearly uniform point spacing was specified and, as shown in Figure 18.16, a nearly uniform grid is generated. Grid quality distribution

©1999 CRC Press LLC

FIGURE 18.14

Surface grids in physical space for generic shell. (a) MSA grid, (b) PSA grid.

in physical space for this case are shown in Figure 18.17. Element angle distribution, maximum value, and standard deviation verify that the PSA surface grid is of very high quality.

18.6 Surface and Volume Grid Generation Best Practice The AFLR procedures previously described are very automated and require minimal user interaction. User input can affect the usefulness and quality of the grid. Optimum quality can usually be approached by reducing the element size. Unfortunately, a grid of optimal quality may often require an excessive number of elements. Obtaining a solution with such a grid may require a prohibitive level of CPU effort. The task for the user is to obtain a grid that offers the best compromise. An ideal grid is often not the most optimal one from just a quality perspective. Instead, an ideal grid is one within the size limits dictated by CPU resources or time for the solution process, resolves the primary geometric features or

©1999 CRC Press LLC

FIGURE 18.15

FIGURE 18.16

Grid quality distributions for generic shell surface grids.

PSA surface grid for ocean bottom near Hawaiian Islands.

those of interest for the given analysis, and has quality at a level that will not impact the solver performance or accuracy. Problem size limits are usually well defined for a given problem. For grid resolution requirements, there is typically at least a consensus on acceptable levels of resolution for a given method of analysis and class of configurations. Requirements for grid quality are not often as well established. Significant differences in how quality affects solver performance and accuracy can exist between solution algorithms of a similar class. Very low quality elements, however, are always detrimental to the solution process. The impact of low-quality elements on solver accuracy can be very localized and is not usually the critical issue. Solver performance, e.g., convergence rate, can be significantly reduced due to presence of even just a few low-quality elements. Other aspects of the solution process can also be impacted by a lowquality grid. For example, a low-quality element can create difficulties in cases where there may be grid deformation during the solution process.

©1999 CRC Press LLC

FIGURE 18.17

Grid quality distributions for Hawaiian Island surface grid.

The quality of a tetrahedral element may be defined in many ways. At the extremes, grid quality is well defined. A very flat or sliver element with four nearly coplanar points is always considered a very low-quality element. An ideal element, in isotropic cases, is one that approaches a tetrahedron with equal length sides and equal dihedral angles. However, this definition is not appropriate for high-aspect-ratio elements. In this case, an ideal high-aspect-ratio element contains one perfectly structured and aligned corner with right angles. Element quality can be quantified by a variety of measures. Among those, dihedral angle offers distinct advantages. Element dihedral angle is advocated in this chapter as it is directly related to the solution algorithm performance and accuracy and it is fairly universal. Barth [1991] demonstrates how the dihedral angle contributes to the diagonal term in the solution matrix of a Laplacian or Hessian. This applies to the solution of many equations, especially in CFD analysis. Large dihedral element angles produce a significant negative contribution to the diagonal terms. Angles approaching 180° will degrade the performance of the solver. Another aspect of using the dihedral element angle is that it applies to both isotropic and high-aspect-ratio elements. A large angle in either case is a lowquality element. Quality for a given surface or volume grid can be evaluated by inspecting worst-case and overall measures. Worst-case quality can be quantified by the maximum angle for all of the grid elements. Overall quality, for isotropic cases, can be quantified by the standard deviation in the angle. In the case of high-aspect-ratio elements, there are multiple peak values and a single deviation is not appropriate. Inspection of the distribution near expected peak values of 0°, 70°, and 90° can verify the overall quality. The minimum angle peak in this case is dictated by the maximum aspect ratio. Several other measures of grid quality have been proposed (see Chapter 33). Many of these can be obtained as ratios of element properties. The following element quality measures are of this type.

Ql = 24 Ri Lmax Qr = 3 Ri Rc

Qv = (9 8) 3 V Rc3

(18.1) (18.2) (18.3)

Ql is a length ratio based measure, Qr is a radius ratio based measure, Qv is a volume ratio based measure, Lmax is the maximum edge length, Re is the circumsphere radius, Ri is the inscribed sphere radius, and V is the volume. The constants in these equations are chosen such that a quality measure value of one is an ideal isotropic element and a value of zero is a perfectly flat element with four coplanar points. These measures are only appropriate for isotropic type elements. Perfectly aligned and

©1999 CRC Press LLC

FIGURE 18.18

NASA space shuttle orbiter volume grid quality ratios.

structured like high-aspect-ratio elements are identified as being of low quality (quality measure value near zero). Even a grid generated to be isotropic may contain some high-aspect-ratio elements, if the surface grid contains any high-aspect-ratio triangles. In most cases, these elements pose no problem for the solver if they are not skewed. The measures defined above do not distinguish between skewed and high-aspect-ratio elements. Skewed elements with large dihedral angles are identified as low-quality elements. However, a high-aspect-ratio element with a maximum dihedral angle of 90° is also identified as being of low quality. Another characteristic of quality ratio measures is that they all are very sensitive to deviations from ideal. For example, a perfect isotropic right-angle element has values of Ql = Qr = 0.732 and Qv = 0.5 which are relatively far from the equiangular ideal of Ql = Qr = Qv = 1. True “ideal” elements cannot be generated for most geometries of interest. Ideal elements are arranged in groups of five surrounding an edge and cannot match up to a flat surface or even a typical curved surface. Also, ideal elements cannot exist if the element size varies. Typical distributions in 0.05 increments of the quality ratios given by Eq. 18.1, Eq. 18.2, and Eq. 18.3 are shown in Figure 18.18. These distributions are for an isotropic type grid about a geometrically complex NASA Space Shuttle Orbiter geometry (presented in the next section on three-dimensional application examples). The high quality of the volume grid is reflected in the clustering of the distributions at high values of the quality ratios. The peaks at an ideal value less than one represent real limitations on quality, which are independent of methodology. For each quality ratio, the maximum ideal value is always one and the minimum value is usually dictated by the geometry. Typical average values are Q l > 0.75, Q r > 0.85, and Q v > 0.75. Typical limits on quality ratio distributions are 99.99% of elements have Ql > 0.3, Qr > 0.4, and Qv > 0.1. Also, 99.5% of elements have Ql > 0.5, Qr > 0.6, and Qv > 0.35. For comparison, 99.99% of element dihedral angles are less than 135° and 99.5% are less than 120°. As previously mentioned, the user of a grid generation procedure can impact the final grid quality. With the procedure described in this article, volume element size and distribution is determined from the boundary. A low-quality surface grid will produce low-quality volume elements near the surface. In most cases, a highquality surface grid will produce a high-quality volume grid. Low-quality surface elements are usually the result of inappropriate edge spacing. With fast surface grid regeneration and simple point spacing specification, optimizing the surface quality is a quick process. An example of a surface mesh with a low quality triangle, which can be corrected by point spacing specification, is shown in Figure 18.19a. In this case, the surface patch has close edges that cannot be eliminated. In Figure 18.19a, the initial choice of a uniform spacing at the edge end-points produces a single low-quality triangle. Specifying a single point spacing at the middle of the edge near the close edges eliminates the low-quality element, as shown in Figure 18.19b. Alternatively, the spacing near the close edges can be reduced to produce a more “perfect” grid, at the expense of an increased number of elements, as shown in Figure 18.19c. ©1999 CRC Press LLC

FIGURE 18.19 Surface grid problem due to close edges. (a) Surface grid patch with distorted surface element, (b) surface grid patch improved by applying a point spacing near problem edge, (c) surface grid patch improved by applying a reduced point spacing near problem edge.

Surface definition can also impact surface grid quality. This type of problem is usually due to a surface patch with a width that is smaller than the desired element size. An example is shown in Figure 18.20a. The original surface definition contains four patches, each with a minimum width less than the element spacing, as shown in Figure 18.20a. The resulting surface grid contains elements with edges that are shorter than the desired element size, as shown in Figure 18.20b. Combining the four patches into one surface patch improves the quality, as shown in Figure 18.20c. Spacings between the nearby edges could be reduced for further improvement. Other conditions can affect volume quality even if the surface grid is of high-quality. An example is shown in Figure 18.21. In this case, there are two nearby surfaces with large differences in element size.

©1999 CRC Press LLC

FIGURE 18.20 Surface grid problem due to multiple surface definitions. (a) Four original surface definition patches, (b) surface grid with four surface definition patches, (c) surface grid with one combined surface definition patch.

FIGURE 18.21 Distorted tetrahedral elements between surface grids that are close and have large differences in surface element size.

This results in distorted volume elements between the surfaces, as shown in Figure 18.21. These elements can be eliminated by increasing the spacing on the surface that has the smaller elements and/or decreasing the spacing on the surfaces which have the larger elements. From a solution algorithm, perspective, the spacings should probably be reduced. The region between the two objects cannot be resolved by the solver without additional grid points. Usability of the volume grid must also be considered along with quality. A high-quality surface grid with desired geometric resolution may produce too many volume elements for efficient analysis. Often, high resolution is only required near the surfaces. Geometric growth can be used in this case to produce a volume grid with substantially fewer elements. With growth, element size is constant very close to the surface and grows geometrically away from the surface. An example with growth is presented in the next section.

©1999 CRC Press LLC

TABLE 18.2

Summary of Grid Quality and CPU Requirements for Three-dimensional Example Cases CPU Time (sec)

3D Case Pump; 123,439 tetrahedra SUV interior; 527,563 tetrahedra Space shuttle orbiter; 3,026,562 tetrahedra Launch vehicle; 2,107,774 tetrahedra Destroyer hull; 4,268,192 tetrahedra

Pentium 120 Toshiba Tecra 500 128 MB Solaris, gcc

Pentium Pro 200 Gateway 2000 G6-200 128 MG Solaris, gcc

Ultra SPARC II 300 Sun Ultra 2 512 MB Solaris, cc single processor

Max. Angle (deg)

Std. Dev. Angle (deg)

154

19

4.3

2.1

0.9

156

17

21

9.5

4.4

155

17

n/a

n/a

44

160

n/a

34

16

5.2

163

n/a

69

34

15

18.7 Three-Dimensional Application Examples Selected application examples are presented here to demonstrate the capabilities of the present procedure for generation of three-dimensional unstructured grids. All surface grids were generated using the previously described PSA surface grid generation procedure. A summary of grid quality and required CPU time for the primary examples is presented in Table 18.2. Grid quality distributions and statistics are presented for each example. Element angle is used as the grid quality measure. The complete set of grid quality data consists of the six dihedral angles for all tetrahedra. Maximum and standard deviation values along with distribution plots in 5° increments are presented for both the surface and volume grids. The results for the examples presented are representative of those obtained for a variety of configurations. Typically, for an isotropic grid, the maximum element angle is 160° or less, the standard deviation is 17° or less, and 99.5% or more of the elements have angles between 30° and 120°. The minimum angle is usually dictated by the geometry. Standard deviation typically increases when geometric growth is used to increase the field point spacing. CPU time required on a laptop PC, desktop PC, and workstation is presented for each primary example. Computer routines for the three-dimensional grid generator are written in C with dynamic memory that is automatically reallocated based upon actual requirements. All floating-point calculations are performed using 64 bit precision with 8 byte data. The CPU times reported include all I/O and generation of grid quality data. A boundary surface grid file is the input. The output includes a grid coordinate and connectivity file and a quality data file. The efficiency of the overall procedure is such that generation of a typical grid requires only minutes on many current PCs or workstations. Generation of a typical surface grid requires only seconds. Memory required is about 100 bytes per isotropic element generated. For grids with high-aspect-ratio elements, the memory requirements are considerably less. User input required to generate a complete grid is minimal and includes specifying the point spacing at selected control points on the boundary curves for surface grid generation. Selection of options such as growth from boundaries is the only required user input for volume grid generation. There are no user adjustable parameters that need to be changed from case to case. The present code is very robust and thoroughly tested. It does not fail to produce a valid volume grid, given a set of boundary surface triangulations that are valid and have a reasonable discretization. Currently, the PSA surface and AFLR volume generation routines are used in the SolidMesh grid generation system [Gaither, 1997] for research and education at the MSU ERC. All of the example cases presented in this section were generated using

©1999 CRC Press LLC

FIGURE 18.22

FIGURE 18.23

Pump cover surface grid.

Tetrahedral field cut for pump cover grid.

SolidMesh. Also, the AFLR volume generation routines are used in the HyperMesh finite element preand post-processing commercial code from Altair Computing, Inc.

18.7.1 Pump Cover A grid suitable for structural analysis was generated for a pump cover. The surface grid contains 40,534 boundary faces and is shown in Figure 18.22. Distribution of grid points within the volume grid can be visualized using a tetrahedral field cut, which displays the exposed surfaces of tetrahedron that intersect a given plane, as shown in Figure 18.23. Element size is uniform within the volume grid. The complete volume grid contains 30,897 points and 123,439 elements. High-order tetrahedrons can be obtained by adding midpoints on the element edges. Midpoints on the surface must be evaluated using the geometry definition. Grid quality distributions for the surface and volume grids are shown in Figures 18.24 and 18.25, respectively. Element angle distributions, maximum values, and standard deviations verify that the surface and volume grids are of very high quality. The standard deviation is higher than typical, as there are several areas where there are only one or two rows of elements between surfaces. This limits the overall quality that can be obtained. Required CPU time is listed in Table 18.2.

18.7.2 SUV Interior A grid was generated for interior airflow and thermal management analysis of a sport utility vehicle (SUV). Exterior and interior surfaces are shown in Figures 18.26a and 18.26b, respectively. The surface grid contains 69,744 boundary faces. A tetrahedral field cut near the drivers seat is shown in Figure 18.27.

©1999 CRC Press LLC

FIGURE 18.24

Pump cover surface grid quality.

FIGURE 18.25

Pump cover volume grid quality

Point distribution function growth was used to automatically increase element size within the interior. Element size grows smoothly away from the surfaces, as shown in Figure 18.27. The complete volume grid contains 106,095 points and 527,563 elements. Without growth, the volume grid contains approximately twice as many points and elements. For this case, a growth rate of 1.2 was used. The growth rate can be increased to further decrease the number of elements. However, the quality begins to degrade with high growth rates. Quality degradation is typically not a significant factor for growth rates of 1.5 or less. Grid quality distributions for the surface and volume grids are shown in Figures 18.28 and 18.29, respectively. Element angle distributions, maximum values, and standard deviations verify that the surface and volume grids are of very high quality. Required CPU time is listed in Ta b l e 18.2.

18.7.3 NASA Space Shuttle Orbiter A grid suitable for inviscid CFD analysis was generated for the NASA Space Shuttle Orbiter. This case demonstrates the level of geometric complexity that can be handled routinely using the present methodology. Geometry clean-up and preparation required approximately 3 days to complete. However, geometry work is highly dependent on the state of the starting geometry definition. Total time for geometry preparation can range from none to a couple of weeks. Surface and volume grid generation ©1999 CRC Press LLC

FIGURE 18.26

SUV surface grid. (a) Exterior surfaces, (b) windows removed to show interior surfaces.

related work required approximately 4 hours. This time included modifications for grid quality optimization and resolution changes based upon preliminary CFD solutions. The surface grid on the orbiter surface is shown in Figure 18.30. The total surface grid contains 150,206 boundary faces. A tetrahedral field cut is shown in Figure 18.31. Element size varies smoothly in the field. The complete volume grid contains 547,741 points and 3,026,562 elements. Grid quality distributions for the surface and volume grids are shown in Figures 18.32 and 18.33, respectively. Element angle distributions, maximum values, and standard deviations verify that the surface and volume grids are of very high quality. Required CPU time is listed in Table 18.2. CPU times are not available for the PCs tested as they each are configured with 128 MB of RAM and this case requires about 300 MB of RAM.

18.7.4 Launch Vehicle A grid suitable for high Reynolds number viscous CFD analysis was generated for a generic launch vehicle. The surface grid on the launch vehicle surface is shown in Figure 18.34. The total surface grid contains 47,392 boundary faces. A tetrahedral field cut is shown in Figure 18.35. Element size varies smoothly in the field, and there is a smooth transition between high-aspect-ratio and isotropic element regions. Also, in areas where there are small distances between surfaces, the merging high-aspect-ratio regions transition

©1999 CRC Press LLC

FIGURE 18.27

Tetrahedral field cut for SUV grid.

FIGURE 18.28

SUV surface grid quality.

(locally) to isotropic generation. If these regions advance too close, without transition, the element quality can be substantially degraded. The complete volume grid contains 363,664 points and 2,107,774 elements. Most of the tetrahedral elements in the high-aspect-ratio regions can be combined into pentahedral elements for improved solver efficiency. With element combination, the complete volume grid contains 461,241 tetrahedrons, 4,757 five-node pentahedrons (pyramids), and 545,673 six-node pentahedrons (prisms). Grid quality distributions for the surface and volume grids are shown in Figures 18.36 and 18.37, respectively. Element angle distributions and maximum values verify that the surface and volume grids are of very high quality. The distribution peaks are at the expected values of near 0°, 70°, and 90°. Required CPU time is listed in Table 18.2. The CPU times listed for this case reflect the fact that generation of high-aspect-ratio elements requires considerably less time than generation of isotropic elements. For the PCs tested, the very last process, which merges the isotropic and high-aspect-ratio regions, was unable to finish. This process requires about 160 MB of RAM and the PCs are configured with 128 MB of RAM. However, the CPU times shown in Table 18.2 are valid for the PCs, as this process and writing of the output grid file requires a small fraction (approximately 6%) of the total time and the times shown have been adjusted up to account for the work not done. ©1999 CRC Press LLC

FIGURE 18.29

FIGURE 18.30

SUV volume grid quality.

NASA space shuttle orbiter surface grid.

18.7.5 Destroyer Hull A grid suitable for high Reynolds Number viscous CFD analysis was generated for the Navy model 5415 destroyer hull. Multiple views of the surface grid on the water-line, hull, and propeller surfaces are shown in Figures 18.38a, 18.38b and 18.38c. The total surface grid contains 86,026 boundary faces. A tetrahedral field cut is shown in Figure 18.39. Element size varies smoothly in the field and there is a smooth transition between high-aspect-ratio and isotropic element regions. The complete volume grid contains 734,330 points and 4,268,192 elements. Most of the tetrahedral elements in the high-aspect-ratio regions can be combined into pentahedral elements for improved solver efficiency. With element combination, the complete volume grid contains 822,604 tetrahedrons, 9,398 five-node pentahedrons (pyramids), and 1,142,264 six-node pentahedrons (prisms). Grid quality distributions for the surface and volume grids are shown in Figures 18.40 and 18.41, respectively. Element angle distributions and maximum values verify that the surface and volume grids are of very high quality. The distribution peaks are at the expected values of near 0°, 70°, and 90°. Required CPU time is listed in Table 18.2. The CPU times listed for this case r eflect the fact that generation of high-aspect-ratio elements requires considerably less time than generation of isotropic elements. For the PCs tested, the very last process, which merges the isotropic ©1999 CRC Press LLC

FIGURE 18.31

Symmetry plane surface grid and tetrahedral field cut for NASA space shuttle orbiter grid.

FIGURE 18.32

NASA space shuttle orbiter surface grid quality.

and high-aspect-ratio regions, was unable to finish. This process requires about 320 MB of RAM and the PCs are configured with 128 MB of RAM. However, the CPU times shown in Table 18.2 are valid for the PCs as this process and writing of the output grid file requires a small fraction (approximately 3%) of the total time and the times shown have been adjusted up to account for the work not done.

18.8 Summary Methods for generation of unstructured planar, surface, and volume grids using the AFLR procedure have been presented. This procedure is based on an automatic point insertion scheme with localreconnection connectivity optimization. Results for a variety of configurations have been presented. The results demonstrate that the procedure consistently produces grids of very high quality. Efficiency is such that standard PCs or workstations can be used to generate three-dimensional unstructured grids for complex configurations. The combined quality and efficiency of the AFLR procedure represents the current state of the art in unstructured tetrahedral grid generation.

©1999 CRC Press LLC

FIGURE 18.33

NASA space shuttle orbiter volume grid quality.

FIGURE 18.34

Surface grid for launch vehicle.

Acknowledgments The author would like to acknowledge the efforts of Adam Gaither at the MSU ERC for preparing the CAD geometry definitions, generating the surface grids, and integrating, within SolidMesh, the software used to produce the results presented in this article. The author would also like to acknowledge support for this work from the Air Force Office of Scientific Research, Dr. Leonidas Sakell, Program Manager, Ford Motor Company, University Research Program, Dr. Thomas P. Gielda, Technical Monitor, Boeing Space Systems Division, Dan L. Pavish, Technical Monitor, National Science Foundation, ERC Program, Dr. George K. Lea, Program Director. In addition, the author would like to acknowledge Dr. Thomas Gielda of Ford Motor Company for providing the SUV interior geometry, Reynaldo Gomez of NASA Johnson Space Center for providing the Space Shuttle Orbiter geometry, Dr. Jim Johnson of General Motors Corporation for providing the pump cover geometry, and Dr. Edwin Rood of the Office of Naval Research for providing the destroyer model 5415 hull geometry.

©1999 CRC Press LLC

FIGURE 18.35

©1999 CRC Press LLC

Tetrahedral field cuts for launch vehicle grid.

FIGURE 18.36

Launch vehicle surface grid quality.

FIGURE 18.37

Launch vehicle volume grid quality.

FIGURE 18.38 propellers.

Destroyer hull surface grid. (a) Complete hull and water-line surfaces, (b) hull and propellers, (c)

©1999 CRC Press LLC

FIGURE 18.39

©1999 CRC Press LLC

Tetrahedral field cut for destroyer hull grid.

FIGURE 18.40

Destroyer hull surface grid quality.

FIGURE 18.41

Destroyer hull volume grid quality.

References 1. Baker, T. J., Three-dimensional mesh generation by triangulation of arbitrary point sets, AIAA Paper 87-1124, 1987. 2. Barth, T. J., Steiner triangulation for isotropic and stretched elements, AIAA Paper 95-0213, 1995. 3. Barth, T. J., Numerical aspects of computing viscous high Reynolds number flows on unstructured meshes, AIAA Paper 91-0721, 1991. 4. Gaither, J. A., A solid modelling topology data structure for general grid generation, MS Thesis, Mississippi State University, 1997. 5. Gaither, J. A., A topology model for numerical grid generation, Proceedings of the Fourth International Conference on Numerical Grid Generation in Computational Fluid Dynamics, Weatherill, N. P., Eiseman, P. R., Hauser, J., Thompson, J. F., (Ed.), Pineridge Press Ltd, 1994. 6. George, P. L., Hecht, F., and Saltel, E., Fully automatic mesh generator for 3D domains of any shape, Impact of Computing in Science and Engineering, 2, p. 187, 1990. 7. Holmes, D. G. and Snyder, D.D., The generation of unstructured meshes using Delaunay triangulation, Proceedings of the Second International Conference on Numerical Grid Generation in Computational Fluid Dynamics, Sengupta, S., Hauser, J., Eiseman, P. R., Thompson, J. F., (Ed.), Pineridge Press Ltd., 1988. 8. Lawson, C. L., Properties of n-dimensional triangulations, Computer Aided Geometric Design, 3, p. 231, 1986. 9. Lohner, R. and Parikh, P., Three-dimensional grid generation by the advancing-front method, International Journal of Numerical Methods in Fluids, 8, p. 1135, 1988. 10. Marcum, D. L., Generation of unstructured grids for viscous flow applications, AIAA Paper 950212, 1995. 11. Marcum, D. L., Generation of high-quality unstructured grids for computational field simulation, 6th International Symposium on Computational Fluid Dynamics, Lake Tahoe, NV, 1995. 12. Marcum, D. L., Adaptive Unstructured Grid Generation for Viscous Flow Applications, AIAA Journal, 1996, 34, p. 2440. 13. Marcum, D. L., Control of Point Placement and Connectivity in Unstructured Grid Generation Procedures, IX International Conference on Finite Elements in Fluids, Venice, Italy, 1995. 14. Marcum, D. L., Unstructured Grid Generation Components for Complete Systems, 5th International Conference on Grid Generation in Computational Fluid Simulations, Starkville, MS, 1996. 15. Marcum, D. L. and Gaither, K.P., Solution adaptive unstructured grid generation using pseudopattern recognition techniques, AIAA Paper 97-1869, 1997. 16. Marcum, D. L. and Weatherill, N.P., Unstructured grid generation using iterative point insertion and local reconnection, AIAA Journal, 33, p. 1619, 1995. 17. Mavriplis, D. J., An advancing front delaunay triangulation algorithm designed for robustness, AIAA Paper 93-0671, 1993. 18. Muller, J. D., Roe, P. L., and Deconinck, H., A frontal approach for internal node generation in delaunay triangulations, International Journal of Numerical Methods in Fluids, 17, p. 256, 1993. 19. Peraire, J., Peiro, J., Formaggia, L., Morgan, K., and Zienkiewicz, O. C., Finite element Euler computations in three-dimensions, International Journal of Numerical Methods in Engineering, 26, p. 2135, 1988. 20. Rebay, S., Efficient unstructured mesh generation by means of Delaunay triangulation and Bowyer–Watson algorithm, Journal of Computational Physics, 106, p. 125, 1993. 21. Shepard, M. S. and Georges, M. K., Automatic three-dimensional mesh generation by the finite octree technique, International Journal of Numerical Methods in Engineering, 32, p. 709, 1991. 22. Weatherill, N. P., A method for generation of unstructured grids using dirichlet tessellations, MAE Report No. 1715, Princeton University, 1985.

©1999 CRC Press LLC

19 Surface Grid Generation 19.1 19.2

Introduction Surface Modeling Geometrical Definition • Topological Description

19.3

Surface Discretization Grid Control Function • Grid Quality

19.4

Triangulation of Surfaces Grid Generation Procedure • Computation of the Local Coordinates of the Edge End Points • Curve Discretization • Computation of Coordinates in the Parameter Plane • Orientation of Initial Front • Grid Generation in the Parameter Plane • Finding the Location of the Ideal Point • Surface Grid Enhancement Techniques

J. Peiró

19.5

Orientation of the Assembled Surface

19.1 Introduction The triangular surface grid generation procedure to be described in this chapter has been developed with the primary intention of employing it as the first step of 3D tetrahedral grid generation methods such as the Delaunay or the advancing front (AFT) techniques described in Chapter 16–18. However, the approach here discussed will be of more general interest, and applications to others areas such as, for instance, finite element analysis of shells, graphical display of surfaces, and the calculation of surface intersections in CAD systems, to name but a few, can also be envisaged. The construction of a surface grid consists of approximating the surface by a set of planar triangular facets. In the rest of this chapter we will consider boundary-fitted grids only, i.e., the vertices of the triangulation lie on the surface. The discretization of a surface (or a part of it) into a general body conforming grid consists of positioning points on the surface, which will constitute the nodes of the grid, and defining the links to be established between a node and its neighbors. Therefore, any surface generation method requires an analytical definition of the surface that permits locating grid nodes on it, and a criterion for positioning the grid nodes on the surface and defining their connectivities according to a spatial distribution of the size and shape of the grid elements. In current engineering practice, most of the geometrical data required in design is generated, stored and manipulated using CAD systems [5]. Applications such as weather forecast modeling or medical imaging, on the other hand, require the generation and handling of discrete data This type of data can either be suitably transformed into a format compatible with that of a CAD system or be dealt directly with in discrete form. The later approach is outside the scope of this chapter and the interested reader is referred to [8] for a discussion of appropriate grid generation techniques. In what follows we will assume that the required geometrical data is available in the form of CAD parametric curves and surfaces represented by spline composite curves and tensor-product surfaces, such as Ferguson, Bezier, or NURBS [10] (see Part III of this Handbook).

©1999 CRC Press LLC

Although a surface is topologically a two-dimensional region, the location of the grid nodes will be three-dimensional. This allows for two possible strategies to be employed in the generation of triangular surface grids. One can either generate grid nodes and connectivities directly in 3D or take advantage of the 2D character of the surface and reduce the surface grid generation to a 2D problem. Both strategies have their advantages and disadvantages. The generation of triangulations directly on the surface presents several difficulties. The advancing front technique can be easily extended to deal with surfaces. However, determining the validity of a new triangle in 3D by verifying whether it intersects with the sides in the generation front is not a trivial task. A triangle and a side might not intersect in space, but they can cross and still produce an invalid triangle. The main problem associated with Delaunay-based methods is the absence, for surfaces of variable curvature, of circumcircle, and circumsphere criteria equivalent to those available for 2D and 3D grid generation, respectively. On the other hand, if a definition of the surface as a mapping from a 2D region and IR3 exists, this can be used to generate a grid in the 2D region which, at a later stage, will be transformed onto the surface. Nevertheless, existing 2D mesh generation methods will require considerable enhancements to deal with the added difficulty of controlling the size and shape of the elements to be generated in the 2D region since these grid characteristics will depend on the surface mapping employed. In the approach adopted here, the use of geometrical definitions of surfaces in the form tensor-product spline surfaces leads to a parametrization that defines the region of the surface to be discretized as a mapping between a 2D region in a parameter plane and IR3. The grid on the surface is obtained as the image of a triangulation of the region in the 2D region. The spatial distribution of grid size and shape in the parameter plane is defined in such a way that, after applying the mapping, the image grid on the surface presents the geometrical characteristics required by the user. These are specified by means of a 3D grid control function. The triangular grid is generated using a modified 2D AFT that accounts for the rapid variation of the grid characteristics in the parameter plane that the surface parametrization might induce.

19.2

Surface modeling

In the following, the domain to be discretized, termed here computational domain, will be viewed as a three-dimensional object that will be described by means of the surfaces that enclose it. This is known as a boundary representation (B-Rep) of the domain [5, 10]. This is the internal solid representation used by the majority of commercial and research solid modelers. In a boundary representation, the computational domain is the region interior to a boundary surface. This surface can be considered as a generalized polyhedron that is the union of a set of faces, bound by edges, which in turn are bound by vertices. The faces lie on surfaces, the edges lie on curves, and the vertices are endpoints of the edges. An illustration of the notation utilized here is depicted in Figure 19.1. Therefore, a B-Rep model requires the storage of two types of data: geometrical and topological. The geometrical data consist of the basic parameters defining the shape of the surfaces and curves, and the point coordinates of the vertices. The topological data are concerned with the adjacency relations between the different components of the boundary surface: vertices, edges, and faces. Finally, a convention of orientations designates on which side of a face to find the computational domain. It will be seen later that, by restricting the domain and the faces forming its boundary to be connected† regions, an orientation compatible with the geometric definition can be obtained automatically.

†A region is said to be connected if any two points in the interior of the region can be joined by a continuous curve whose points are all interior to the region.

©1999 CRC Press LLC

FIGURE 19.1 B-Rep of the boundary of the computational domain showing the orientation of the faces and the notation employed.

19.2.1

Geometrical Definition

The B-Rep of the domain provides a description of the computational domain in terms of a set of oriented faces. The generation of a boundary-fitted grid for this domain will require an analytical definition of the surfaces on which the faces are defined and their intersection curves. This mathematical representation should permit us to perform operations such as, for example, locating a point in space and calculating lengths and tangent vectors of curves as well as normal vectors and areas of surfaces. 19.2.1.1 Curves Although curves are represented in the B-Rep model of the computational domain as the intersection of two surfaces, the use of such approach for grid generation is not recommended, since it results in an implicit representation of the intersection curve. This curve is given as the solution of a system of two nonlinear equations representing each of the intersecting surfaces (usually high-order polynomials). This means that some of the most common operations required in grid generation such as positioning a point on the curve, calculating the length of the curve, etc., will involve an iterative procedure for the solution of such system. A more straightforward approach that eases the process of discretization is to adopt a parametric representation of the curve that accurately approximates the true intersection. This curve is computed once during a preprocessing stage. A method commonly employed is to locate a set of ordered points along the surface intersection through which a spline curve is later interpolated. The distribution of points should be such that the distance between the interpolated curve and the true surface intersection, using an appropriate norm, is within the accepted bounds of accuracy. This is a procedure which is readily available in most of the state-of-the-art systems for CAD. Adopting the CAD representation of spline curves, e.g., Ferguson, Bezier, or NURBS, as described in Part III, curves are given by a parametric representation such as

x1 (u) r(u) = x2 (u) 0 ≤ u ≤ U x (u ) 3 ©1999 CRC Press LLC

(19.1)

Here, and in the following, r will be denote the position vector of a point with respect to a Cartesian frame of reference (x1, x2, x3). The tangent vector t to the curve, at a point with parametric coordinate u, is given by

t (u ) =

dr du

(19.2)

19.2.1.2 Surfaces Tensor products of splines are the most common form of CAD surface representation. Such surfaces can be described by a parametric representation such as

x1 (u1 , u2 ) r(u1 , u2 ) = x2 (u1 , u2 ) 0 ≤ u1 ≤ U1 ; 0 ≤ u2 ≤ U2 x (u , u ) 3 1 2

(19.3)

The normal vector n to the surface, at a point of parametric coordinates (u1, u2), is given by

n(u1 , u2 ) =

∂r ∂r × ∂u1 ∂u2

(19.4)

where × denotes vector product. Eq. 19.3 defines the surface as a mapping between a 2D rectangular region on a parameter plane (u1, u2) and IR3. Such a parametric representation is provided by the majority of surface representation systems used in CAD. For grid generation purposes, we will require that the mapping defining the surface is bijective almost everywhere and that a normal to the surface can be defined, and is continuous, for all the interior points. Singular points, i.e., those where the normal is not defined such as, for instance, the apex of a cone or the pole of a sphere, are allowed to appear only on the boundary.

19.2.2

Topological Description

The B-Rep model provides a hierarchical definition of the computational domain as the 3D region interior to a boundary partitioned into a set of faces. A face is a region on a surface delimited by an oriented set of edges.† Finally, an edge is the segment on a curve bound by two vertices. The topological data required by the model is the definition of the boundary of a region at a certain level of the hierarchical model: domain, face, and edge, in terms of a list of regions in the next lower level: faces, edges, and vertices, respectively. Vertices are points common to three or more faces and are represented by their 3D Cartesian coordinates. An edge is defined by the parametric curve on which it lies and the two end vertices. This representation admits the definition of several nonoverlapping edges on the same curve. If the computation domain is assumed to be connected, then an edge will be common to two faces only. A face is defined by the surface on which it lies and a set of edges forming its boundary. Again, several nonoverlapping faces can be defined on the same surface.

†

A face is sometimes referred to as a “trimmed” surface.

©1999 CRC Press LLC

FIGURE 19.2

FIGURE 19.3

19.3

Definition of a face on a surface as a mapping.

Mapping of a triangular grid T* in the parameter plane onto the surface.

Surface Discretization

The representation of a surface S given by Eq. 19.3 allows us to define a face as a region Ω on the surface with boundary Γ, which is the image, by the mapping (Eq. 19.3), of a region Ω* in the parameter plane (u1, u2). This region is delimited by a boundary Γ* which is the preimage in the parameter plane of the boundary of the face Γ. The notation used here is illustrated in Figure 19.2. If the mapping representing the surface is bijective, i.e., the normal to the surface does not vanish and is continuous, for all the points interior to the face, then such a mapping will transform a valid triangulation T* in the parameter plane into a valid surface triangulation T (Figure 19.3).† This suggests the idea of generating a grid in the parameter plane that will later be mapped onto the surface to produce an appropriate surface discretization. This is accomplished by ensuring that the size and shape of the triangles generated in the parameter plane are such that when mapped onto the surface the size and shape of the resulting triangles comply with those specified by a suitably defined grid control function.

19.3.1

Grid Control Function

The inclusion of adequate grid control is a key ingredient in ensuring the generation of a grid of suitable characteristics for the performance of a numerical simulation. In this approach, the shape and size of the elements in the grid are assumed to be a function of the position, and they are locally defined in terms of a set of mesh parameters. Here the mesh parameters used are a set of three mutually orthogonal directions α i; i = 1, 2, 3, and three associated element sizes, or spacings, δ ι ; i = 1, 2, 3 (see Figure 19.4). Thus, at a certain point, if all three element sizes are equal, the grid in the vicinity of that point will consist of approximately equilateral elements. †

Strictly speaking, it suffices that the mapping be bijective at the nodes of the triangulation only.

©1999 CRC Press LLC

FIGURE 19.4

FIGURE 19.5

Mesh parameters.

The effect of the local mapping T (2D).

The grid control is accomplished by defining a function which represents the characteristics of an element in the neighborhood of a point. This function is represented by means of a linear transformation that locally maps the 3D space onto a space where elements, in the neighborhood of the point being considered, will be approximately equilateral with unit average size. This new space will be referred to as the normalized space. For a general grid, this transformation will be a function of position. The mapping, denoted by T, is represented by a symmetric 3 × 3 matrix; it is a function of the mesh parameters α i and δ i at that position, and can be expressed as r = (x1, x2, x3).

3

1 α j (r ) ⊗ α j (r ) j =1 δ j (r )

T(r) = ∑

(19.5)

where ⊗ denotes the tensor product of two vectors. The effect of this transformation in two dimensions is illustrated in Figure 19.5. The spatial variation of the mesh parameters (or equivalently T) is obtained through the definition of their values at a set of discrete positions and a procedure for interpolation at intermediate points. The most commonly used methods for the definition of the grid control function are the background grid and the distribution of sources [12]. In the first method, the mesh parameters are obtained via linear interpolation from a grid of tetrahedra in which each node is assigned a set of grid parameters. In the second method, the mesh parameters at a point are given as a user-defined function of the distance from the point to the reference sources.

©1999 CRC Press LLC

19.3.2 Grid Quality It is possible to impose restrictions on the grid spacing to ensure that some measure of grid quality is satisfied. The method proposed here tries to avoid rapid spatial changes in grid spacing, since they usually cause problems to the grid generation procedure and might lead to the creation of badly distorted grids. A simple argument in one dimension provides us with a criterion for ensuring a smooth spatial variation of elements sizes. Consider two adjacent element of sizes (or spacings) δ1 and δ2, for which we would like to impose that the size should not change more than a certain fraction, K, of their average size. This condition can be written as

δ 2 − δ1 ≤ K

δ 2 + δ1 2

(19.6)

A continuous analogue of Eq. 19.6 is given by

dδ ( x ) ≤K dx

(19.7)

This can be easily extended to the multi-dimensional case by simply imposing that

∇δ ⋅ S ≤ K

(19.8)

where S denotes a 3D unit vector.

19.4 Triangulation of Surfaces The surface grid generation method proposed here is based on the idea that, using a tensor-product representation of a surface, a face can be obtained as a mapping between a region on a 2D parameter plane and 3D. If the mapping is not singular, i.e., the normal to the surface is non-zero and finite, at interior points on the face, then a valid triangulation in the parameter plane will subsequently transform onto a valid triangulation on the surface. The characteristics of the triangular grid in the parameter plane should be calculated so as to guarantee that the distribution of element size and shape in the transformed surface grid approximately complies with the user-specified 3D grid control function. The following sections describe how this is achieved in practice.

19.4.1 Grid Generation Procedure The grid generation proceeds in a bottom-up fashion. Edges on the curves are discretized first into straight sides. Triangular grids are independently generated in each of the faces on the surfaces forming the boundary of the computational domain. A set of previously generated sides forms the initial generation front on the surface. The procedural steps are the following: 1. Read the geometrical definition and a suitable distribution of mesh parameters. 2. Discretize the edges. a. Calculate the local coordinate u of the points defining the end of the edges. b. Position points along the edge according to the grid control function. 3. Discretize the faces. a. Calculate the local coordinates (u1, u2) in the parameter plane of the points generated in the previous step that belong to the edges in the boundary of the face. b. Form the initial front in the parameter plane and orientate the surface in a form compatible with its normal, as defined by its parametrization (Eq. 19.3) and according to Eq. 19.4.

©1999 CRC Press LLC

c. Generate an appropriate triangulation in the parameter plane using a suitably modified 2D advancing front technique. d. Perform grid enhancement techniques in the parameter plane to achieve a better representation of the surface curvature and to improve the quality of the surface grid. e. Map the resulting grid onto the surface definition. 4. Orientate the discretized boundary.

19.4.2

Computation of the Local Coordinates of the Edge Endpoints

An edge is a region on a curve delimited by two endpoints. These endpoints are vertices of the boundary of the computational domain. However, since the curve is only an approximation to the true intersection, the vertices will not, in general, lie exactly on the curve. For this reason, the delimiting points of the edge are taken to be the points on the curve which are the closest to the vertices. The distance between the vertex and the closest point on the curve has to be smaller than a certain threshold distance Dt. Its value is utilized to determine whether two points are coincident and it should be either known from the geometrical tolerance used in the creation of the CAD data or, if this is not available, calculated from the machine roundoff error. The problem of finding the parametric coordinate of a vertex can be formulated as a point projection problem, i.e., given a vertex r*, find the parametric coordinate u of the point r(u) on the curve such that D = r(u) − r∗ = min

(19.9)

The solution to the above equation is obtained by means of a standard iterative procedure for function minimization [4]. An initial bracketing of the minimum in Eq. 19.9 is given by a triplet of parametric coordinates u(1) ≤ u(2) ≤ u(3). The interval end values are taken to be those corresponding to the endpoints of the curve, u(1) = 0 and u(3) = U, and the third value, u(2), is obtained as follows. The curve is first divided into a few straight segments, then the segment closest to the point is found and, finally, u(2) is taken to be the average value of the parametric coordinates of the endpoints of the closest segment. Once the initial bracketing is done, the bracket is contracted, using a combination of sectioning by golden section search and parabolic interpolation, until the position corresponding to a minimum of the distance, D = Dmin, is found. If the geometrical data is correctly defined, the value of this distance should not be larger than the threshold distance (Dmin ≤ Dt).

19.4.3

Curve Discretization

This procedure consists of dividing the edge into straight sides. The sides should be such that their length is approximately compliant with the spacing specified by the grid control function. Here we will consider two approaches which are equivalent in the hypothetical case that we could define a continuous grid control function and that the length integrations involved could be carried out exactly. The first method is based in the placement of points along the curve according to a distribution function which is reminiscent of those employed in PDE based grid generation methods f In the second approach, the linear mapping T is used to transform the curve to a new space where the grid spacing is uniform. 19.4.3.1 Discretization Using a Distribution Function The discretization of the edges in the surface definition is achieved by positioning nodes along the curve according to a certain function δ (s), the grid spacing, which represents the size of the sides to be generated along the curve. The parameter s denotes the arc length of the curve which, for a curve represented in parametric form as r(u), 0 ≤ u ≤ U, is given by

s( u ) = ∫

s(u)

©1999 CRC Press LLC

ds = ∫

u

dr(t ) dt dt

(19.10)

where a denotes the Euclidean norm of the vector a. In what follows, the edge is taken to be the region on the curve given by the parametric interval 0 ≤ U1 ≤ u ≤ U2 ≤ U, where U1 and U2 are the parametric coordinates of the points on the curve which are the closest to the vertices representing the endpoints as computed by the procedure described in Section 19.4.2. The distribution of spacing along the edge, δ (s), is calculated using the information about the spatial distribution of mesh parameters provided by the grid control function described in Section 19.3.1. Consecutive points generated in the discretization procedure will then by joined by means of straight lines to form sides. The procedure employed here to determine the position and number of nodes to be created on the edges is based on the definition of an appropriate node distribution function. Consider an interval of length ds at a point r(u) corresponding to an associated arc length s and assume that the interval is small enough so that the spacing δ (s) can be taken to be approximately constant. Under these assumptions, the number of subdivisions dAe of the interval will be

dAe =

ds δ (s)

(19.11)

The distribution function will be obtained through the integration of Eq. 19.11. To achieve this, the definition of the spacing function δ (s) along the curve is required first. Here, this is accomplished by generating a set of uniformly spaced sampling points r(ui); i = 1, …, m along the curve. A safe choice for the distance between sampling points is the minimum user specified element size but, often, considerably larger values can be used. The position of the sampling points, i.e., the value of ui, is computed by numerically solving the equation

si = s(ui ) = L1 +

ui dr i −1 ( L2 − L1 ) = ∫0 du; m −1 du

i = 1,..., m

(19.12)

where L1 = s(U1) and L2 = s(U2) denote the arc length values corresponding to the endpoints of the edge. For all the sampling points r(uj); j = 1, …, m, the mesh parameters are obtained by interpolation from the grid control function and the spacing δ j associated to a sampling point is computed as

δ cj = Tj t j

−1

(19.13)

where Tj is the value of the auxiliary transformation at the sampling point given by formula 19.5 and dr tj represents the tangent to the curve at that point, ------ (uj). Then, a piecewise linear distribution of du spacings δ (s) along the edge is obtained from the values δ cj computed in Eq. 19.13 and may be written as m

δ (s) = ∑ δ ic Ni (s)

(19.14)

i =1

where Ni(s) represents the linear finite element shape function

0 if i ≠ j Ni s j = 1 if i = j

( )

(19.15)

The positions sk, k = 1, …, Ne – 1 of the internal nodes to be created are the solutions of the equation

φ ( sk ) =

©1999 CRC Press LLC

Ne Ae

∫

sk

L1

1 ds = k ; k = 1,..., Ne − 1 δ (s)

(19.16)

FIGURE 19.6

Curve discretization by means of a distribution function.

φ(s) is commonly referred to as the distribution function and Ne denotes the number of sides generated on the curve. Its value is chosen to be the nearest integer value to Ae, which is computed by integrating expression 19.10 as

Ae = ∫

L2

L1

1 ds δ (s)

(19.17)

The positioning of the points along the curve using the discretization procedure described above is illustrated in Figure 19.6. The integrals in Eqs. 19.16 and 19.17 can be computed explicitly since the δ (s) is taken to be the piecewise linear function Eq. 19.14. The solution of Eq. 19.16 is obtained via the Newton’s iteration

sk( i +1) = sk( i ) −

( ) φ (s( ) ) − k { } A

δ sk( i )

i

k

(19.18)

e

where s (i) k denotes the value of the arch length sk at iteration i and the initial value for the iteration is taken to be s (0) k = sk–1. 19.4.3.2 Discretization Using the Mapping T Here the placement of points along the edge is based on a transformation of the curve to a normalized space where the spacing along the curve is uniform. In order to determine the position and number of nodes to be created on each edge, the following steps are followed: 1. Subdivide recursively each edge into smaller curves until their length is smaller than a certain prescribed value, i.e., define a set of sampling points rj = r(uj); j = 1, …, n as described previously. When subdividing an edge, the position and tangent vectors corresponding to these new points, tj can be readily found directly from the original definition of the curve. 2. For each data point rj; j = 1, …, n obtain from the grid control function the coefficients of the transformation Tj and transform the position and tangent vectors according to rˆ j = Tj rj and ˆt j = Tj tj. The new position and tangent vectors, rˆ j and ˆt j ; j = 1, …, n, define a spline curve that can ©1999 CRC Press LLC

be interpreted as the image of the original edge in the normalized space. It must be noted that, because of the approximate nature of this procedure, the new curve will in general have discontinuities of curvature, even if the curvature of the original curve varies continuously. 3. Compute the length of the edge in the normalized space, subdivide it into segments of approximately unit length, and calculate the parametric coordinate of each newly created point. This information is then used to determine the coordinates of the new nodes in the physical space, using the parametric representation of the curve.

19.4.4 Computation of Coordinates in the Parameter Plane A face is defined as a region on a surface delimited by a set of edges. These have been discretized in the previous step of the generation process, and the assembly of the discretized edges forms the boundary of the triangular grid to be generated. However, in the approach adopted here, the AFT generation of the triangular grid will take place on the parameter plane. Consequently, to form the initial generation front in the parameter plane, the (u1, u2) parametric coordinates of the nodes generated on the edges need to be computed. Since the mapping r(u1, u2) cannot, in general, be inverted analytically, the coordinates (u1, u2) of such points are found numerically by means of an iterative procedure. The curve where the edge is defined is only an approximation to the intersection curve of the surfaces to which the two adjacent faces belong to. As a result of this, the nodes generated on the edges are not exactly on the surface. The distance between these nodes and the surface depends on the accuracy used to approximate the true intersection between the surfaces by a spline curve. In this formulation, the parametric coordinates (u1, u2) of a node, denoted by r*, are taken to be those of the point r(u1, u2) = (x1, x2, x3) in the surface closest to r*. This can be formulated as the minimization problem of finding the parametric coordinates (u1, u2) for which

r∗ − r(u1 , u2 ) = min

(19.19)

It should be pointed out that the discretization of the edges if performed directly in the 3D space and not in the parameter plane in order to ensure compatibility of nodal coordinates between contiguous faces. The non-linear Eq. 19.19 is solved by means of an iterative procedure that involves the following steps: 1. The distance r – r * is calculated for all the singular points on the surface boundary. If for one of them, this value is smaller than the threshold distance Dt used to determine whether two points coincide, then its parametric coordinates are the sought solution. 2. If the answer is not found among the singular points, the search for the minimum continues on the boundary. The minimization is performed using the 1D procedure described in the Section 19.4.2. The iteration stops if a point r is found that verifies r – r * < D t . 3. Finally, we look for the minimum in the interior of the region. The closest point found on the boundary is used as the initial guess for a conjugate gradient method with line minimization [4]. This method is very efficient but might fail in certain circumstances, e.g., for interior points in the vicinity of a singular point. In such cases, a more robust, but also more expensive, “brute force” approach is used. This method starts with an initial uniform subdivision of the parameter plane into rectangular regions along coordinate lines. Amongst these rectangles, the closest to the target point is selected for further subdivision into four. The distance between the centroid of the rectangle and the target point is used for this purpose. This procedure is repeated until a point r is found which verifies the convergence criteria, i.e., r – r * < D t .

19.4.5 Orientation of Initial Front A simple procedure for automatically orientating the initial front can be devised if we assume that the region in the parameter plane representing a face on the surface is a connected region. For this type of ©1999 CRC Press LLC

FIGURE 19.7

Automatic boundary orientation in the parameter plane.

regions, the boundary of the face is formed by one or more closed non-self-intersecting loops of edges. The edges in a loop join other edges at their end vertices and a vertex is always shared by two edges in the face. Under these assumptions, the loops of edges can be identified and their points ordered so as to assign a unique orientation to the closed curve. There are two possible orientations for a curve that can be determined as follows. The area of a region in the parameter plane (u1, u2) delimited by a closed curve C can be expressed, using Green’s theorem, as the absolute value of the line integral

A=

1 −u2 du1 + u1du2 2 ∫c

(19.20)

The sign of A is used to characterize the orientation of the curve. The initial front representing the discretized boundary of the region in the parameter plane is formed by one or more loops of discretized edges. This provides a piecewise linear representation of the loop as a set of straight segments that permits a simple numerical evaluation of the integral Eq. 19.20. For a connected region, the loop representing the outer boundary will have the largest area in absolute value. The final orientation of the loops defining the boundary of the region is selected so the area of the exterior loop is positive and the area of the interior loops, if any, is negative according to Eq. 19.20. This is depicted in Figure 19.7.

19.4.6 Grid Generation in the Parameter Plane The definition of the surface where a face lies as a mapping permits the surface grid generation to be performed in the parameter plane by a suitably modified 2D grid generation method. The grid generation method employed here is a modification on the 2D AFT, which is briefly summarized in Section 19.4.6.1. This procedure requires the definition of a suitable distribution of mesh parameters in the parameter plane such that, when the triangular grid generated there is transformed onto the surface, the resulting surface triangulation approximately complies with the grid characteristics specified by 3D grid control function. The utilization of a bijective mapping permits to establish a correspondence between the 3D mesh parameters on the surface and the 2D mesh parameters in the parameter plane. This is described in Section 19.4.6.2. 19.4.6.1 The Modified 2D AFT The modified AFT follows these algorithmic steps: 1. Select a side from the current generation front. The sides of the front are ordered, using a heap structure, according to their length in 3D. The side selected is the shortest side, which is located at the root of the binary tree representing the heap. 2. Determine the position of the “ideal” point to form a triangle. The position of the ideal point should be such that the size and shape of the resulting surface triangle complies with those specified

©1999 CRC Press LLC

by the 3D grid control function. A detailed description of the nonlinear iterative procedure employed to achieve this is given in Section 19.4.7. 3. Generate a list of alternative locations and select a list of possible candidates among the nodes in the generation front. 4. Go through the list of candidate nodes (which are organized in a heap structure according to a measure of quality in 3D) and select the best among those producing a compatible triangle, i.e., one that does not intersect with the current generation front. This compatibility condition is verified in the 2D parameter plane, thus avoiding the problem of crossing if checked directly on the surface. 5. Update the generation front and repeat the process if there are sides left in the front. 19.4.6.2 Grid Characteristics in the Parameter Plane The discretization of each face is accomplished by generating a two-dimensional grid of triangles in the parametric plane (u1, u2) and then transforming it onto the surface using the mapping r(u1, u2) defined in Eq. 19.3. This mapping establishes a one-to-one correspondence between the face and a region on the parametric plane (u1, u2) (Figure 19.2). Thus, a consistent triangular grid in the parametric plane will be transformed, by the mapping r(u1, u2), into a valid triangulation of the surface component. The construction of the triangular grid in the parameter plane (u1, u2) using the two-dimensional grid generator, requires the determination of an appropriate spatial distribution of the two-dimensional mesh parameters. These consist of a set of two mutually orthogonal directions α *i ; i = 1, 2, and two associated element sizes δ *i ; = 1, 2. The two-dimensional mesh parameters in the (u1, u2) plane can be evaluated from the spatial distribution of the three-dimensional mesh parameters and the metric tensor that locally represents the deformation characteristics of the mapping. To illustrate this process, consider a point P*, in the parametric plane of coordinates (u*1, u*2), where the values of the mesh parameters α *i, δ *i ; i = 1, 2 are to be computed. Its image on the surface will be the point P given by the position vector r(u*1, u*2). The transformation between the physical space and the normalized space at this point T can be obtained from the grid control function. A new mapping can now be defined at the point P between the parametric plane (u1, u2) and the normalized space as

R(u1 , u2 ) = Tr(u1 , u2 )

(19.21)

A curve in the parametric plane passing through point P* and with unit tangent vector β = (β1, β2) at this point, is transformed by the above mapping into a curve in the normalized space passing through the point of coordinates R(u1, u2). The arc length parameters ds* and ds, along the original and transformed curves, respectively, are related by the expression 19.14.

2 ∂R ∂R 2 ds 2 = ∑ . βi β j ds * i, j =1 ∂ui ∂u j

(19.22)

Assuming that this relation between the arc length parameters also holds for the spacings, we can compute the spacing δβ at the point P* and along the direction β in the parameter plane as

1 = δβ

2

∂R ∂R

∑ ∂u ⋅ ∂u

i , j =1

i

βi β j

(19.23)

j

The two-dimensional mesh parameters α *i , δ *i ; i = 1, 2 are determined from the direction in which δβ attains an extremum. This reduces to finding the eigenvalues and eigenvectors of a symmetric 2 × 2 matrix.

©1999 CRC Press LLC

19.4.6.3 Influence of the Surface Parametrization It is clearly apparent from the discussion in the previous section that there is a direct relation between the mesh parameters in the parameter plane required to produce a surface grid compliant with the 3D grid control function and the parametrization of the surface. The main problem associated with this is that the parametrization of a surface is not unique. A region in the parameter plane can be transformed into a surface using an unlimited number of parametrizations. However, the choice of parametrization will influence the performance and accuracy of the grid generation method, since different parametrizations will induce different degrees of distortion between the parameter plane and the surface. An example of this is illustrated in Figure 19.8 in which a uniform triangular grid for a square region, defined on a planar surface, is obtained by using three different parametrizations. Figures 19.8(a), 19.8(c) and 19.8(e) show the triangulation and a set of 5 × 5 coordinate lines u1 = 0, 1, 2, 3, 4 and u2 = 0, 1, 2, 3, 4 in the parameter plane. Figures 19.8(b), 19.8(d) and 19.8(f) show their respective images on the 3D surface. The first parametrization, shown in Figures 19.8(a) and 19.8(b), preserves the length and area ratios; the mapping does not introduce any distortion and the grids on the surface and the parameter plane are alike. The second parametrization of the surface mapping, Figures 19.8(c) and 19.8(d), maintains the length ratio along u1 but introduces distortion in the u2-direction. The pre-image of the 3D square region is no longer a square since its sides are not straight lines due to the deformation induced by the mapping. To account for this deformation, stretched triangles must be generated in the parameter plane in order to produce a uniform triangulation in 3D. This certainly makes the task of generating a suitable grid in the parameter plane more difficult. The third mapping, Figures 19.8(c) and 19.8(d), introduces distortion in both directions. Stretched elements are required for this case too, but now the variation of the mesh parameters through the parameter plane is more rapid than before, which further increases the difficulties associated with generating the grid in the parameter plane. A slight deterioration of the grid quality is readily noticeable in Figure 19.8(d). As a consequence of the additional deformation introduced by the surface parametrization, large variations of the mesh parameters in a relatively small neighborhood of a point in the parameter plane might occur.† The best parametrization, from the point of view of grid generation, is the one that uses parametric coordinates based on arc length. This results in a surface mapping that produces a small distortion between the parameter plane and the surface. However, such a parametrization is not easy to obtain in practice. Therefore, provisions should always be made to account for mapping-induced distortion in the grid generation procedure. The method originally proposed in [11] assumed that the values of the mesh parameters at the midpoint of the side selected for the generation of a triangle were approximately constant in the neighborhood of the side. In the presence of rapid local changes in the mesh parameters, the quality of the surface grids deteriorates; therefore, it had to be modified to account for the rapid variation of mesh parameters. An improved nonlinear iteration procedure is used here to determine the position of the grid nodes on the surface. This is described in detail in the following section.

19.4.7 Finding the Location of the Ideal Point Following the notation displayed in Figure 19.9, let us consider a side AB in the generation front to be used to generate a new triangle in the surface grid. A candidate location, the so-called “ideal point” P, is sought as the vertex of a triangle with base AB that complies with the size and shape characteristics prescribed by the 3D grid control function. The location of the ideal point is obtained as follows. The matrix T is calculated at the midpoint M of the side AB using the values of the 3D mesh parameters given by the user-specified grid control function. It is assumed that the local mapping, represented by T, can be taken to be constant in the (3D) neighborhood of the side. This assumption is reasonably correct if criteria of grid quality such those described in Section 19.3.2 are enforced on the grid control †

See [15] for a more detailed exposition of this problem.

©1999 CRC Press LLC

FIGURE 19.8 Influence of the surface parametrization. The network of lines on the surface represents the set of coordinate curves u1 = 0, 1, 2, 3, 4 and u2 = 0, 1, 2, 3, 4.

function. It must be stressed that this is not necessarily true for the triangle in the parameter plane since, as discussed in Section 19.4.6.3, the surface mapping might introduce rapid variations of the 2D mesh parameters.

©1999 CRC Press LLC

FIGURE 19.9

Location of the ideal point.

The location of the ideal point P is calculated by first transforming, using T, the coordinates of the relevant points in the triangle to a 3D normalized space. Then its parametric coordinates (u1, u2) are determined by requesting that its position r(u1, u2) in the normalized space satisfies

{r(u , u ) − r } ⋅ {r 1

2

M

B

− rA } = 0

r(u1 , u2 ) − rA

2

(19.24)

=1

(19.25)

where rA, rB and rM denote the positions in the normalized space of the points A, B, and M, respectively. The system of Eqs. 19.24 and 19.25 is nonlinear. Its solution is achieved by iteration using Newton’s method. The iterative procedure can be written in abbreviated matrix form as

[ ][ ]

∆u( k ) = u( k +1) − u( k ) = − J −1 u( k ) f u( k )

(19.26)

with

∆u

(k )

{

}

r( k ) − rM ⋅ {rB − rA } u1( k +1) u1( k ) (k ) = k +1 − k ; f u = 2 ( ) ( ) k) ( u u 2 2 r − rA − 1

[ ]

(19.27)

and

[ ]

J u( k )

∂r( k ) .{rB − rA } ∂u1 = ∂r( k ) 2 ⋅ r( k ) − rA ∂u1

{

∂r( k ) ⋅ {rB − rA } ∂u2

}

∂r( k ) 2 ⋅ r( k ) − rA ∂u2

{

}

(19.28)

where the index (k) denotes the value of the corresponding variable at the kth iteration of the Newton procedure. The convergence of this iterative method depends on the choice of initial guess u(0). If the surface mapping does not introduce severe distortions, an initial guess of the location of the ideal point calculated using the values of the 2D mesh parameters from expression 19.23 usually leads to convergence of the Newton method. However, in general, it is not always possible to avoid or reduce the deformation induced by the mapping and, therefore, an alternative method for handling such situations is required. ©1999 CRC Press LLC

FIGURE 19.10

The diagonal swapping procedure; (a) admissible, (b) inadmissible.

The approach adopted here is to improve upon this initial guess, if the nonlinear iteration fails to converge, by means of a “brute force” approach based on selective recursive subdivision. In the event of convergence failure of the Newton method, a conservative estimate of the maximum ratio between the length of a side in the parameter plane and their image on the surface is calculated first. This ratio is used to determine the size of a rectangular region in the parameter plane that is to be attached to the front side and will contain the location of the ideal point. The selection of the new initial guess for the Newton iteration is based on a quadtree recursive subdivision. The rectangular region is first divided into four rectangles that and the new guess for the position of the ideal point is the center of the rectangle that best approximates the requirements Eqs. 19.24 and 19.25. If the Newton iteration fails to converge, the previously chosen rectangle is further subdivided into four to produce a new initial guess for another iteration. The procedure is repeated until convergence of the Newton iteration is achieved.

19.4.8

Surface Grid Enhancement Techniques

The triangular grid generated on the face in the previous step may contain some badly distorted triangles, especially if the mapping-induced distortions are large. In order to enhance the quality of the generated grid, two post-processing are applied: diagonal swapping and grid smoothing. These procedures are local in nature and do not alter the total number of nodes and elements in the grid. A description of the implementation of these two methods follows. 19.4.8.1 Diagonal Swapping This procedure modifies the grid connectivity without altering the positions of the nodes. This process requires a loop over all the element sides, excluding those sides on the boundary. Following the notation of Figure 19.10, for each internal side AB common to two triangles ACB and ABD, one considers the possibility of swapping AB by CD, thus replacing the triangles ACB and ABD by the triangles ACD and BDC, as shown in Figure 19.10(a). This operation is admissible only if the region bound by the rectangle ACBD is convex. If it is not, the swapping procedure will result in an incompatible grid connectivity as depicted in Figure 19.10(b). When the alternative configuration is admissible, the swapping operation is performed if a user-defined quality criterion is better satisfied by the new configurations than by the existing one. In the present implementation, three grid quality criteria for swapping are used: optimal node connectivity, maximizing the minimum angle, and accurate representation of surface curvature. The optimal node connectivity is represented by the ideal number of sides joining at an internal node. This number is taken to be six for an internal node, which is the number of sides at a node for a grid of equilateral triangles. For a boundary node, the ideal number of connectivities depends on the boundary geometry. The difference between the actual and the ideal number of connectivities, the defect value, is computed for each of the four nodes in the current configuration. The swapping is performed if the new configuration reduces the sum of nodal defect values. The criteria of maximizing the minimum angle requires to perform an admissible swapping if the minimum of the angles between adjacent sides of the surface triangles in the new configuration is larger than that in the original configuration.’

©1999 CRC Press LLC

FIGURE 19.11

Accounting for surface curvature in the diagonal swapping procedure.

The final criterion is based on improving the representation of the curvature of the surface. Following the notation of Figure 19.11, A, B, C, and D are nodes of the triangular grid and are located on the surfaces S. O is the midpoint of side AB and P is the image of the midpoint of the side in the parameter plane. The length OP provides a measure of the accuracy of the approximation of the surface by triangles. In this case the surface will be better represented by using the triangles ACD and BDC. The swapping procedure aims at reducing the distance OP; here the swapping is performed only if the distance in the current configuration is three to four times larger than that of the new configuration. In practice, the strategy employed consists of performing two of three loops of side swapping according to the first two criteria and then it concludes with an optimal loop over the internal sides to improve on the representation of the surface curvature. 19.4.8.2 Grid Smoothing This method modifies the positions of the interior nodes without changing the connectivity of the grid. The element sides are considered as springs. The stiffness of a spring is assumed to be proportional to its length in 3D. The nodes are removed until the spring system is in equilibrium. The equilibrium positions are found by relaxation. Each step of this iterative procedure amounts to performing a loop over the interior nodes in which each node is move independently. In order to move a node I, only the sides that connect with the node are considered to be active springs, and the rest of the nodes J = 1, …, NI connected with I by active sides are taken to be fixed. Denoting the coordinates in the parameter plane by the vector u = (u1, u2), the node I is then moved to an equilibrium position uI which is the solution of N1

f (u I ) = ∑ ω IJ J =1

uJ − uI =0 uJ − uI

(19.29)

ω IJ represents the spring stiffness, which is taken to be proportional to the difference between the 3D length of the side and the length δ IJ along the side IJ as specified by the 3D grid control function, i.e.,

ω IJ (u I ) = rJ − r(u I ) − δ IJ

(19.30)

The new position of the node I is approximately calculated by using one step of a Newton method for the solution of Eq. 19.29 starting from an initial guess u0. Here u0 is taken to be the centroid of the surrounding nodes

u0 =

1 NI

NI

∑u

J

(19.31)

J =1

and the new position uJ is given by −1

∂f u J = u0 − ( u 0 ) f ( u 0 ) u ∂ I ©1999 CRC Press LLC

(19.32)

FIGURE 19.12

Mesh smoothing: The node I is moved to the equilibrium position I′ within the shaded area.

The procedure is repeated for all the interior nodes. Usually two to four loops over the nodes are performed to enhance the grid. This procedure works well if the region formed by the triangles surrounding the node is convex. If it is not, following the method suggested in [6], the motion of the point is restricted to the interior of a convex region, represented by the shaded area in Figure 19.12. This area is defined by a new set of vertices PIJ, on the sides IJ surrounding point I, which are obtained as follows. The coordinates of a point along the side IJ can be expressed as

u = u I + λ (u J − u I ) with

0 ≤ λ ≤1

(19.33)

The intersection between the straight lines along the sides IJ and KL will correspond to a value λ = λ K in Eq. 19.33 with

λK = −

uI ⋅ uK

(u J − u I ) ⋅ n K

0 ≤ λK ≤ 1

with

(19.34)

where nK denotes the normal to side KL. Finally, the position of the vertex PIJ is represented by λ P given by

(

λ P = min λ1 ,..., λ N I

)

(1935)

When the region defined by the triangular elements surrounding node I is nonconvex, the vertices PIJ determined in this fashion are used instead of the original nodes J = 1, …, NI in the smoothing procedure previously described. The combined application of these two post-processing techniques is found to be very effective in improving the smoothness and regularity of the triangular grid generated on the surface.

19.5 Orientation of the Assembled Surface Following arguments similar to those presented in Section 19.4.5, by assuming that the 3D computational domain is connected, the faces forming its boundary can be automatically oriented. Here the discretized faces generated in the previous step of the generation procedure can be joined together to form closed surfaces by using the available information on the common edges. Since these surfaces are assumed to be connected, an edge is always common to two faces. This also permits to assign a consistent orientation to the set of faces forming the closed surface. This orientation is given by the direction of its normal. Using the Gauss’ Theorem, the volume of the region interior to a closed surface S can be expressed as the absolute value of the surface integral

V=

©1999 CRC Press LLC

1 r ⋅ ndS 3 ∫s

(19.36)

where r is the position of a point on the surface and n denotes the unit normal to the surface. The sign of V characterizes the orientation of the surface, i.e., a positive value of V indicates that the adopted normal n is the outer normal. The integral 19.36 can be computed numerically given a triangulation of the face. The closed surface that gives the maximum volume in absolute value is taken to be the outer boundary and is assigned an orientation compatible with a positive value of V according to Eq. 19.36. The other surfaces, if any, are assigned an orientation such that the value of V is negative. The imposition of the (not very severe) restriction that the computational domain and the boundary faces forming its boundary should be connected provides a simple method for their automatic orientation. This greatly reduces the amount of information about the topology of the computational domain that the user has to provide to the grid generation code.

Further Information A presentation of the discretization of surfaces using the advancing front directly on the surface and a discussion of the problems associated with verifying the validity of a new element directly in 3D space by means of an auxiliary projection for triangular and quadrilateral grids are given in [8] and [3], respectively. An alternative method for the discretization of curves in which the grid control function defines a variable metric tensor M along the curve is presented in [7]. Using the notation employed in this chapter, the metric tensor can be written as M = Tt T, where T is given by Eq.19.5. A discussion of the generation of grids on surfaces that are piecewise continuous approximations of discrete data and hence are not defined via a single mapping from a parameter plane is given in [8]. Surface grid generation in the parameter plane using the Delaunay approach requires the introduction of a modified circumcircle criterion or the use of an auxiliary transformation to account for grid stretching. Examples of such approaches have been proposed in [9, 1].

References 1. Borouchaki, H. and George, P.L., Maillage de surfaces paramétriques. partie I: Aspects Théoriques, INRIA Research Report No. 2928, July 1996. 2. Casey, G.F. and Dinh, H.T. Grading functions and mesh redistribution, SIAM J. Num. Anal., 1985, 22, No. 3, pp. 1028–1040. 3. Cass, R.J., Benzley, S.E., Meyers, R.J., and Blacker, T.D., Generalized 3-D paving: an automated quadrilateral surface mesh generation algorithm, Int. J. Num. Meth. Eng., 1996, 39, pp 1475–1489. 4. Fletcher, R., Practical Methods of Optimization, John Wiley, New York, 1987. 5. Hoffmann, C.M., Geometric and Solid Modeling, Morgan Kaufmann, San Mateo, CA, 1989. 6. Formaggia, L. and Rapetti, F., MeSh2D (Unstructured mesh generator in 2D) Algorithm overview and description, CRS4 Technical Report COMPMECH-96/1, February, 1996. 7. Laug, P., Borouchaki, H., and George, P.L., Maillage de courbes gouverné par une carte de métriques, INRIA Research Report No. 2818, March, 1996. 8. Löhner, R., Regridding surface triangulations, J. Comp. Phys. 1996, 126, pp 1–10. 9. Mavriplis, D.J., Unstructured mesh generation and adaptivity, ICASE report No. 95-26, April, 1995. 10. Mortenson, M.E., Geometric Modeling, John Wiley, New York, 1985. 11. Peiró, J., Peraire, J., and Morgan, K., The generation of triangular meshes on surfaces, Creasy, C. and Craggs, C., (Eds.), Applied Surface Modelling, Ellis Horwood, 1989, Chapter 3, pp 25–33. 12. Peiró, J., Peraire, J., and Morgan, K., FELISA system reference manual, part I: basic theory, Civil Eng. Dept. report, CR/821/94, University of Wales, Swansea, U.K., 1994. 13. Peiró, J., Peraire, J., and Morgan, K., Adaptive remeshing for three-dimensional compressible flow computations, J. Comp. Phys. 1992, 103, pp 269–285. 14. Stoker, J.J., Differential Geometry, Wiley Interscience, New York, 1969. 15. Samareh-Abolhassani, J. and Stewart, J.E., Surface grid generation in parameter space, J. Comp. Phys., 1994, 113, pp 112–121.

©1999 CRC Press LLC

20 Nonisotropic Grids 20.1 20.2

Introduction The Classical Delaunay Mesh Generation Method Scheme of a Classical Mesh Generator • Boundary Mesh Creation • Creating the Mesh of a Domain Ω

20.3

Scheme of an Anisotropic Mesh Generator

20.4

Fundamental Definitions

The Mesh of the Domain Metric at a Point • Length of a Segment

20.5

The Anisotropic Delaunay Kernel The Delaunay Measure • Approach Using Only One Metric • Approach Using Two Metrics • Approach Using Four Metrics

20.6

The Field Points Definition The Control Space • Computation of the Edge Length • Field Point Creation • Filtration of the Field Points • Insertion of the Field Points

20.7

Optimization Element Quality • Diagonal Swapping • Point Relocation

20.8

Metric Construction Computation of the Hessian • Remark on Metric Computation • Metric Associated with Classical Norms • Metric with Relative Error • Metric Intersection

20.9 Loop of Adaptation 20.10 Application Examples

Paul Louis George Frédéric Hecht

Navier–Stokes Solver • Flow Over a Backward Step • Transonic Turbulent Flow Over a RAE2822

20.11 Application to Surface Meshing 20.12 Concluding Remarks

20.1 Introduction Nonisotropic or anisotropic grids or meshes have a wide range of applications in engineering. An important domain in which such grids can be beneficial is the numerical simulation of certain PDE systems by the finite element method. Local mesh adaptation, and specifically anisotropic adaptation, is a useful technique to improve the accuracy of the numerical solution, see for example [Peraire et al., 1987], [Lohner, 1989], [Lo, 1991], [Mavriplis, 1994], and [Weatherill et al., 1994]. It is a way of capture rapid variations of the solution with a reasonable number of degrees of freedom. Isotropic adaptation allows a mesh to be obtained that has a variable density in some regions, while anisotropic adaptation leads to an ability to capture directional features requested by the physical problem.

©1999 CRC Press LLC

Coupling regularization methods and local mesh refinement together is a possible solution to create adapted meshes. At first, an initial mesh of the domain is constructed using any mesh generation method, then the solution is computed. Owing to a pertinent choice of a criterion (gradient, a posteriori error estimate, etc.), the regions of the domain requiring some level of adaptation are emphasized. Then, a new mesh is created, that is better suited, and the process is repeated until the convergence is achieved. Irrespective of the space dimension (practically, in dimension three), the refinement procedures are well known (see for example, [Berger and Jameson, 1985], [Bristeau and Periaux, 1986] and [Lee and Lo, 1992]); however, the derefinement procedures are rather difficult to implement. Thus, a global method is proposed in place of a method based on local modifications. This global method relies on the adequate use of a fully automatic mesh generation algorithm governed by a criterion (or a set of criteria) in an iterative process. A mesh is reconstructed at each iteration step according to a function of the solution resulting of the previous iteration. In general, the adaptation criterion indicates the element sizes that are required. It can also specify the desired sizes in a general metric rather than in the classical metric, see for instance [Peraire et al., 1987] or [Vallet, 1992], thus making the treatment of anisotropic cases possible. This chapter aims at discussing such an approach. We are primarily interested in a Delaunay-type method; hence only unstructured meshes will be considered. This chapter will show how to extend this well-known method to the case where anisotropic meshes are expected. To clarify the discussion, the different steps involved in a classical Delaunay mesh generation algorithm are first recalled (Section 20.2). In Section 20.3, the classical scheme is extended to the adapted or anisotropic mesh generation context. The main features of such a scheme are given and further details are given in the following sections. The notions of a metric and length are both introduced in Section 20.4, in a Riemannian space. The Delaunay method is extended to this context (Section 20.5) revealing, in particular, that the proposed extension results from the flexibility of the classical method. Field point construction is discussed in Section 20.6, while optimization procedures are developed in Section 20.7. In Section 20.8, a solution is proposed for the construction of the metric used to govern the mesh generation algorithm and in Section 20.9 the use of previous materials to define a loop of adaptation is discussed. Application examples are provided in Section 20.10, including computational fluid dynamics computations and an application of anisotropic mesh generation for parametric surface meshing. To conclude this chapter, several extensions to three dimensions will be briefly mentioned.

20.2 The Classical Delaunay Mesh Generation Method This section recalls a series of well-known issues regarding the classical Delaunay mesh generation method (see also Chapter 16). For sake of simplicity, the bidimensional case is assumed. Usually, the Delaunay mesh generation procedure enables the mesh construction of a domain from the sole data of a boundary discretization of this domain. Thus, the mesh of a (closed) domain in R2 is governed by geometrical considerations only (the boundary discretization), irrespective of the physics of the given problem. Resulting mesh sizes, as well as element densities or anisotropic features, are solely related to the given discretization, this data being the only available information. Our objective is to recall this classical scheme, as the method has already been described in numerous references, using the set of edges forming the boundary discretization as data.

20.2.1 Scheme of a Classical Mesh Generator Let Ω be a domain and let F(Ω) be the set of edges discretizing its boundary. These edges, the so-called constrained edges, have a set of points, denoted as S(Ω) as endpoints. In order to obtain a mesh of Ω , an empty mesh is first constructed, which is (according to [George, 1991]) an “empty” mesh in the sense that its vertices are (at least in two dimensions) the sole members of S(Ω). Then, a new mesh is constructed by adding the field points inside the empty mesh, this new mesh being then optimized so as to complete the final mesh of Ω . The field points are defined so that

©1999 CRC Press LLC

all internal mesh edges have an acceptable length. This classical mesh generation algorithm includes two main steps. 1. Creation of the empty mesh of Ω . • Creation of a rectangle enclosing Ω and construction of a mesh of this box, • Insertion of the points of S(Ω) into the previous mesh, • Regeneration of F(Ω), the constrained edges, in the current mesh in order to define a mesh of Ω. 2. Creation of the mesh of Ω. • Initialization by means of the previous mesh. • Field points creation (loop) – Generation of points along the internal edges of the current mesh using a length criterion, – Insertion of these points, – Iteration if the current mesh has been modified. • Optimization of the resulting mesh. Some of these steps will be valid without significant changes in classical situations (say, isotropic case) as well as in anisotropic situations, thus they will be only briefly mentioned. However, a few steps involved in the mesh generation algorithm will be widely affected in the case of anisotropic requirements. These changes mainly concern the way the field points are computed and the way a mesh point is inserted (the so-called Watson algorithm). These two aspects will be detailed in the classical approach to clarify the proposed extension in the anisotropic context.

20.2.2 Boundary Mesh Creation At first the construction of the “empty” mesh by means of the Watson algorithm is explained. To this end, this basic tool, later referred to as the Delaunay kernel, is recalled. This kernel is an incremental process allowing the insertion of a point in a given (Delaunay) triangulation. The generation of the constrained edges of F(Ω) in order to obtain the empty mesh is then recalled. Afterwards, the field points creation and insertion procedures are described. 20.2.2.1 The Delaunay Kernel The Delaunay kernel is a procedure resulting in the insertion of an internal point in a (Delaunay) triangulation. This procedure is primarily based on a proximity criterion. The latter, based on length evaluation, appears to be well suited in respect of the envisaged extension. The Delaunay kernel in any dimension, using the classical Euclidean metric, has been proposed by several authors, including Bowyer [1981], Watson [1981] and Hermeline [1982]. In two dimensions this algorithm leads, cf. Figure 20.1, to replace the set of triangles whose open circumdiscs include the point under consideration (i.e., the cavity) by the ball composed of the triangles formed by joining this point to the edges that constitute the boundary of the current cavity. The fundamental idea is, on the one hand, that the cavity is a star-shaped polygon with respect to the point considered, and on the other hand, that the mesh of the complement of this polygon is not affected. Formally speaking, the Delaunay kernel can be written as

T n +1 = T n − C( P) + B( P)

(20.1)

where C(P) is the cavity associated with point P, B(P) is the corresponding ball and Tn denotes the mesh resulting of the insertion of the first n points. The cavity is constructed using the proximity criterion, which can be written as

{K , K ∈ T , ©1999 CRC Press LLC

such that P ∈ Disc( K )}

(20.2)

FIGURE 20.1

Insertion of point P, cavity and ball.

where Disc(K) is the open circumdisc with respect to element K. Numerous implementations of this algorithm have been developed by several authors including, for recent papers only [Borouchaki et al., 1995] and [Borouchaki, George and Lo, 1996]. 20.2.2.2 Meshing the Enclosing Rectangle The introduction of a rectangle enclosing the domain allows us to be in a convex situation and guarantees that all the boundary points are enclosed within this box. Thus, the above Delaunay kernel can be easily applied. The box, defined using four extra points, is covered with a two-triangle mesh. The points of S(Ω) are inserted in this mesh using the Delaunay kernel. Notice that the resulting mesh is a mesh of the box rather than a mesh of the domain Ω . To obtain a mesh of Ω , the edges of F(Ω) are recreated in the current mesh using local modifications (basically, diagonal swappings). At the time the edges of F(Ω) have been regenerated in the mesh, it is possible to classify the elements in this mesh with respect to Ω . The internal elements are specifically tagged, while the elements outside Ω are marked distinctively. Nevertheless, these exterior elements are not removed at this time, in order to preserve a convex environment and simplify the further procedures.

20.2.3 Creating the Mesh of a Domain At this point, a mesh of Ω is given. In principle, this mesh does not contain any point interior to Ω. Hence, to obtain the desired mesh, field points are created according to an iterative procedure. To start, the current mesh is initialized by the “empty” mesh. At each iteration, the current internal mesh edges are analyzed and internal points are • Constructed along the edges so that, on the one hand, the so-created subdivisions are of ideal

length and on the other hand, a point is not too close to an already existing point, and • Inserted in the current mesh via the Delaunay kernel (specifically a constrained variation of it). This process is repeated as long as the current mesh is modified.

©1999 CRC Press LLC

To complete this algorithm we will have to define the concept of a constrained Delaunay kernel and we have to discuss the notion of an ideal distance between two points in case the desired element sizes are specified. The constrained Delaunay kernel is a variation of the classical kernel that maintains the boundary integrity during the point insertion process. Let (P, Q) be a pair of points, let hP (resp. hQ) be the desired size at point P (resp. Q) and let h(t) be a monotonous continuous function that indicates the size variations along the segment [P, Q], such that h(0) = hP and h(1) = hQ. The length l(P, Q) of the segment [P, Q] is ideal with respect to h(t) if and only if (cf. [Laug et al., 1996]). −1

1 1 l( P, Q) = ∫ dt . 0 h(t )

(20.3)

The function h(t) is a size interpolant inside the domain. The desired size at a boundary point is considered as the average of the lengths of the edges sharing this point. The internal point size is defined via the function h(t) associated with the supporting edge of this point. A variation of this procedure regarding the creation of the internal points consists in processing the edges according to their lengths. In this way, the most significant edges are first processed. To close the description of the classical mesh generation process, we still have to mention that the mesh resulting from the internal points insertion is optimized. The optimization is based on diagonal swapping and point relocation procedures. These tools are driven by the element qualities and will be described in a general context, in Section 20.7.

20.3 Scheme of an Anisotropic Mesh Generator We assume now that the desired mesh must have anisotropic features and we consider that the anisotropy is defined by means of a specified metric. More precisely, a metric is specified for which the desired size is 1 (cf. [Vallet, 1992]). In this context, the mesh generator shall provide an acceptable mesh with respect to this metric. To summarize, this leads to • Generalizing the notion of a desired size, which can vary in two different directions, and • Normalizing the classical ideal length to unity, with respect to the considered metric.

From a practical point of view, the metric is known as a discrete function and by interpolating the metric everywhere it is not specified, a Riemannian structure is obtained on the domain. Associated with the so-defined metric, the domain is called a control space. A mesh is satisfactory if all its elements are equilateral with respect to this control space. Therefore, the problem is to extend the classical method (as introduced in the previous section) to permit the construction of an (almost) satisfactory mesh, with respect to the control space. Consequently, meshing the domain includes two main stages: 1. The mesh of the boundary of Ω and 2. The mesh of Ω using the boundary mesh as a support. These two steps are governed by the control space. Before discussing the extension of the previously described classical tools to the anisotropic case, it may be noticed that, at this time, the mesh of the boundary of the domain is supposed to conform to the control space. Thus, the anisotropic mesh of the domain can be obtained using an extension of the classical Delaunay kernel and a generalization of the previous internal point creation procedure. To summarize, both aspects lead us to define properly the lengths with respect to the control space.

©1999 CRC Press LLC

20.3.1 The Mesh of the Domain As mentioned before, the mesh of the domain according to the control space, can be obtained by • Generalizing the Delaunay kernel to a Riemannian space (Section 20.5), • Replacing the ideal length by the unity measure in the control space during the field point creation

(Section 20.6), • Extending the triangle quality notion to a Riemannian space (Section 20.7).

Consequently, the scheme of an anisotropic mesh generation method governed by a control space, the mesh of the boundary being supplied, can be summarized as • Creation of the empty mesh resulting from the insertion of the boundary points and then regen-

eration of the boundary edges. • Generation and insertion (loop) of the field points. – Computation of the edge lengths of the current mesh, – Subdivision of the edges whose lengths exceed the “unity” in the control space, – Insertion of these points in the current mesh, – Iteration if any modification arises. • Optimization.

20.4 Fundamental Definitions Several fundamental definitions are provided in this section, before returning to our purpose.

20.4.1 Metric at a Point The metric or metric tensor at a point X of the domain Ω is the specification at X of a definite positive matrix

aX bX M( X ) = bX cX

(20.4)

such that aX > 0, cX > 0 and aXcX – b2X > 0. The metric field (M(X))X∈Ω induces a Riemannian structure on Ω . The latter, along with this structure, is denoted by (Ω, (M(X)) X∈Ω). If, for all points X in the domain, the metrics are identical, then the Riemannian structure is nothing other than a Euclidean structure; Ω applied with this structure is then denoted by (Ω, M(X)) or simply by (Ω, M), X being an arbitrary point of Ω.

20.4.2 Length of a Segment In the Riemannian space defined by (Ω, (M(X)) X∈Ω), the length L of a curve Γ of IRn, parametrized by γ (t)t=0..1, is

L=∫

1

t

∇γ (t ) M (γ (t ))∇γ (t )dt

(20.5)

consequently, the length of a segment [P, Q] = (P + t PQ )o ≤ t ≤ 1 in Ω is given by 1

l( P, Q) = ∫ 0

©1999 CRC Press LLC

t

→ → → PQ M P + t PQ PQdt

(20.6)

u where PQ is a vector of origin P and extremity Q. With PQ = ( u 12 ) and M(P + t PQ ) =

a ( t )b ( t ) b ( t )c ( t )

, then

1

l( P, Q) = ∫ a(t )u12 + 2b(t )u1u2 + c(t )u22 dt

(20.7)

Notice that in the case of an Euclidean space defined by (Ω, M), with M(X) = ( ba cb ), one has

l( P, Q) = au12 + 2bu1u2 + cu22 .

(20.8)

20.5 The Anisotropic Delaunay Kernel The key idea of the Delaunay kernel is the adequate definition of the cavity associated with the point considered (cf. relations 20.1 and 20.2). The sole component requisite, the evaluation of the cavity, is based on length computations, thus, this sole operation shall be extended to the Riemannian space context. In the classical situation, the cavity can be evaluated from a base, i.e., the set of triangles enclosing the point to be inserted, enriched by adjacency with the triangles whose open circumdiscs enclose this point. According to this algorithm, the cavity is necessarily connected. The circumdiscs are evaluated in the usual Euclidean metric. This proximity criterion shall now be extended to the Riemannian context. Let K = [P1, P2, P3] be a triangle in the current mesh and P be the point to be inserted. The problem we face is to decide if a triangle K belongs to the cavity associated with P. It could be observed that in this case, the edges ([P, Pi])1≤ i ≤ 3 will be part of the ball associated with P, and therefore will be automatically formed. The problem is then to find a suitable proximity criterion that enables us to construct the cavity. Finding a general solution of this problem is very difficult, as will be seen, because the metric can vary widely from one point to another. The easiest solution consists in replacing the Riemannian space by an Euclidean space whose metric is that at point P. This is a quite natural choice (cf. Section 20.5.2). A second solution results from the above remarks and leads to take into account two Euclidean spaces, one of them associated with the point P and the other one associated with the vertex of element K not yet in the cavity (cf. Section 20.5.3). A third solution consists in using the four points of the configuration, the points P, P1, P2, and P3, (cf. Section 20.5.4). Before debating the different options, we define locally, Section 20.5.1, the proximity criterion by means of a measure related to a metric, the so-called Delaunay measure.

20.5.1 The Delaunay Measure Let Z be a point of Ω. Considering the Euclidean space (Ω, M(Z)), we denote by lZ the distance between two points of Ω in this space. The circumdisc associated with a triangle K, whose center is denoted OZ, is defined in this space by

→

→

(l (O , X )) = OX M( Z ) OX = k Z

Z

2

t

2

(20.9)

where X ∈ R2 and k is a real value such that the disc is circumscribed to triangle K. Hence, the center OZ is the solution of the linear system Z Z Z Z l (O , P1 ) = l (O , P2 ) Z Z Z Z l (O , P1 ) = l (O , P3 )

©1999 CRC Press LLC

(20.10)

and k is precisely lZ(OZ, P1). The circumdisc of triangle K encloses the point P, if and only if

l Z (O Z , P) < l Z (O Z , P1 ),

(20.11)

and, in this case, the Delaunay criterion associated with the pair (P, K) is said to be violated according to the metric at point Z. By normalizing to one the above inequality, a dimensionless measure is obtained, defined by

α Z ( P, K ) =

l Z (O Z , P )

l Z (O Z , P1 )

.

(20.12)

The violation of the Delaunay criterion associated with the pair (P, K) in the metric at Z means that α Z(P, K) < 1. The coefficient α Z(P, K) is named the Delaunay measure of the triple (P, K, Z) [George and Borouchaki, 1997].

20.5.2 Approach Using Only One Metric According to this notion of measure, we consider the case where the Delaunay criterion depends only upon the metric at one point P, the point to be inserted. This approach is the easiest one. The triangle K belongs to the cavity if

α P ( P, K ) < 1.

(20.13)

It is obvious to check that the so-defined cavity remains star-shaped with respect to P. This is a consequence of the fact that the given circumdiscs are convex and that the cavity is constructed by adjacency using an edge that separates the discs into two disconnected parts. Consequently, a valid solution results from this choice, although this solution is a coarse approximation, as pointed out by numerical experiences. Actually, a Riemannian space is locally approached by only one Euclidean space.

20.5.3 Approach Using Two Metrics A more precise analysis of the process used to construct the cavity shows that at least one triangle exists in the cavity, that is adjacent to K. Let f be the common edge and let Pj be the vertex of K such that K = [f, Pj]. Then, following the way the edges of the ball associated with P are constructed, it could be seen that, if K belongs to the cavity, then the edge [P, Pj] will be formed. So, it is quite natural to consider the metric at the point P along with that at the point Pj, during the evaluations of the proximity criterion. Hence, the triangle K belongs to the cavity if

α P ( P, K ) + α Pj ( P, K ) < 2.

(20.14)

Similarly, it is easy to check that the cavity constructed in this way is star-shaped with respect to P. Thus, a valid solution is obtained, which is a better approximation, as the violation of the Delaunay criterion is evaluated using two metrics, that at the point P and that at the vertex of K previously defined.

20.5.4 Approach Using Four Metrics This approach leads to the best approximation. Four metrics are considered, that at the point P and those at the three vertices of the triangle K considered. In this case, the triangle K is valid for the Delaunay criterion if

α P ( P, K ) + α P1 ( P, K ) + α P2 ( P, K ) + α P3 ( P, K ) < 4. ©1999 CRC Press LLC

(20.15)

Similarly to the case of two metrics, this solution is valid. Nevertheless, numerical experiments indicate that there is no significant difference with the previous approximation, except a bigger cost in terms of CPU. Remark: From the pure mathematical point of view, this problem is not well posed, as in Riemannian geometry the side of a triangle is a geodesic curve and the triangles are generally not straight-sided.

20.6 The Field Points Definition The field point creation is a crucial step in the mesh generation process. The aim is to create the appropriate number of points and to locate them properly. The field points must be defined so that the resulting mesh edges are of a unit length in the control space. As for the classical method, an iterative procedure is proposed. At each iteration, field points are constructed along the current mesh edges, the current mesh being initialized by the empty mesh. Hence, at the iteration i, the mesh edges of the iteration i – 1 are considered as supporting edges along which the internal points will be created. The points are created so as to divide the edges into unit segments. Each point constructed is stored and will be inserted if it is not too close to an already existing point. The generation, filtration as well as the insertion of the internal points are governed by the control space. The latter is a Riemannian space allowing the computation of edge lengths and distances between two points. The control space is discussed in Section 20.6.1 and the different procedures involved in the field points definition are described in Sections 20.6.2 and 20.6.3.

20.6.1 The Control Space The control space is constructed from a background mesh and a metric map defined at each mesh vertex. To obtain the first governed mesh, the background mesh is set to the classical mesh. Within an adaptation loop (Section 20.9), the background mesh at stage j is the mesh at stage j – 1. The Riemannian structure of the control space is explicitly defined at each mesh vertex and implicitly known at any other location in the domain. Indeed, if X is an interior point • Either X is a vertex of the background mesh and the matrix at X exists in the metric map, • Or X is enclosed in a triangle and the metric at X is defined using an interpolation based on the

triangle vertices. The metric map is a finite set of positive definite 2 × 2 matrices. These matrices define locally the size as well as the desired element shapes. To define the above interpolation, let us recall first the geometrical meaning of the metrics. 20.6.1.1 Geometrical Interpretation of the Metrics In the isotropic case, the metric is defined by λ I2, where I2 is the 2 × 2 identity matrix and λ is a strictly positive number. Let h be the desired element size in any direction, then the metric can be interpreted in terms of h. In the Euclidean space supplied with this metric, the unit circle centered at the origin is a circle of radius h in the space supplied with the usual metric; this circle is defined by

φ ( X ) = x12 h 2 + x22 h 2 = 1

(20.16)

where X corresponds to the point (x1, x2). Consequently, h and λ are such that

λ= ©1999 CRC Press LLC

1 . h2

(20.17)

FIGURE 20.2

Unit circle, anisotropic case.

In the anisotropic case, the metric is defined by a symmetric positive definite 2 × 2 matrix

a b M= , b c

(20.18)

and the unit circle, centered at the origin, is the ellipse of equation

φ ( X ) = ax12 + 2bx1 x2 + cx22 ,

(20.19)

in the usual Euclidean space. Obviously, in the base associated with the principal axis of this ellipse, φ can be replaced by

φ ′(Y ) = y12 h12 + y22 h22 = 1;

(20.20)

where h1 and h2 are the desired sizes along the principal axis of the ellipse. Figure 20.2 illustrates the unit circle associated with a metric where h1 = 2.5, h2 = 1, and θ = π /6, θ being the angle of anisotropy. 20.6.1.2 Interpolation on a Segment The question that arises is how to interpolate a metric on a segment from the metrics of its endpoints or how to perform the interpolation (in terms of size), by means of a monotonous and continuous function, from one ellipse, say M1, to another ellipse, say M2. In the isotropic case, the solution is obvious. Actually, if the first metric is defined by λ I2 and the second by µ I2, the desired size specification with respect to the first metric is h1 = 1 ⁄ λ and h2 = 1 ⁄ µ for the second. Hence, the interpolation function for an arithmetic progression (in terms of size), is defined by

M (t ) =

1

(h + t (h 1

2 − h1 ))

2

I2 0 ≤ t ≤ 1,

(20.21)

with M(0) = M1 and M(1) = M2. In the anisotropic situation, several solutions are possible. They will be discussed hereafter. 20.6.1.2.1 Interpolation According to a Matrix Exponentiation According to the isotropic case, where a metric is written as M = h–2 I2, one can observe that the variations of h are “equivalent” to the variations of M –1/2. Thus,

M (t ) = ((1 − t ) M1−1 2 + tM2−1 2 )

©1999 CRC Press LLC

−2

0 ≤ t ≤ 1.

(20.22)

The computation of M–1/2 requires the evaluation of the eigenvalues of M. To avoid this evaluation, it is possible to consider an interpolation such that

M (t ) = ((1 − t ) M1−1 + tM2−1 ) − 1 0 ≤ t ≤ 1,

(20.23)

and observe that this formulation promotes the smallest sizes. Both interpolation schemes are well defined because, if M is a metric then tMα is a metric, where t > 0 and α are two reals, and if M1 and M2 are two metrics then M1 + M2 is a metric. These schemes are not fully satisfactory as variations in terms of hs are not explicitly controlled. The following solution allows us to control h according to two directions. 20.6.1.2.2 Simultaneous Matrix Reduction We now consider a “better” interpolation scheme, the simultaneous reduction of two metrics, the latter being two quadratic forms. The simultaneous reduction of two forms results in a base where the two forms are defined by two diagonal matrices. Let M1 and M2 by the two metrics. Let us introduce the matrix N = M –11 M2. This matrix is M1-symmetric, so it can be diagonalized in R2. Let (v1, v2) be the eigenvectors of N, they define a base in R2, and t

v1 M1v2 = t v1 M2 v2 = 0.

(20.24)

Let X = x1v1 + x2v2 be a real vector in the base (v1v2); if (λ i = tviM1vi)1 ≤ i ≤ 2 and (µi = tviM2vi)1 ≤ i ≤ 2 then, by definition, for all i, 1 ≤ i ≤ 2, λ i > 0, µi > 0, and t

XM1 X = λ1 x12 + λ2 x22 and tXM2 X = µ1 x12 + µ2 x22 .

(20.25)

Let us define (h1,i = 1 ⁄ λ i )1 ≤ i ≤ 2 and (h2,i = 1 ⁄ µ i )1 ≤ i ≤ 2. The value h1,i (resp. h2,i) is precisely the unit length in the metric M1 (resp. M2), with respect to the axis vi. The metric interpolation between M1 and M2 is defined by

1 h12 (t ) M (t )= tP −1 0

−1 P 0 ≤ t ≤ 1, 1 h22 (t ) 0

(20.26)

where P is the matrix whose columns are (v1, v2) and (h1(t), h2(t)) are monotonous continuous functions such that hi(0) = h1,i and hi(1) = h2,i for 1 ≤ i ≤ 2. In practice, one can consider two kinds of interpolation functions: • hi(t) = h1,i + t(h2,i – h1,i) (arithmetic progression), • hi(t) = h1,i(h2,i/h1,i)t (geometric progression).

It could be observed that this interpolation is controlled for the axes (v1, v2) solely. To illustrate this process, Figure 20.3 depicts the examples of two initial metrics and the related interpolated metrics in the case of an arithmetic progression. 20.6.1.3 Interpolation over a Triangle To interpolate over a triangle, we simply have to extend the interpolation scheme suitable for a segment. Let X be a point in the triangle K = [P1, P2, P3] and (α i)1 ≤ i ≤ 3 be the barycentric coordinates of X in K. Then, for the M–1/2 interpolation scheme, we have 1 3 − M ( X ) = ∑ α i M ( Pi ) 2 i =1

©1999 CRC Press LLC

−2

(20.27)

FIGURE 20.3

Arithmetic interpolation.

FIGURE 20.4

Edge length.

The interpolation scheme using the simultaneous reduction of matrices is not associative. To overcome this drawback, we consider a global ordering of the point numbers. The vertices of K are ordered and the scheme is applied accordingly. Assuming that the vertices of K are such that P1 < P2 < P3, where < stands for the above ordering, then two reals α and β and a point P 3* exist, such that

P3∗ = (1 − α ) P1 + αP2 and X = (1 − β ) P3∗ + βP3 ;

(20.28)

the scheme is applied at first on the segment [P1, P2] to interpolate the metric at P 3* and afterwards on the segment [ P 3* , P3] to interpolate the metric at X.

20.6.2 Computation of the Edge Length Each edge of the current mesh is embedded in the background mesh (in practice, this mesh is the current mesh and its complement in the given bounding box). The visited edge is then subdivided into several segments defined by the intersections of this edge with the edges of the background mesh elements (Figure 20.4). This process is valid, as the rectangle enclosing the background mesh is also a bounding box of the current mesh, such that every segment is included in a triangle of this background mesh. The set of intersection points, the Ai’s on the figure, forms the discrete specification of the metrics needed to analyze the current edge. Using this specification, the edge length can be evaluated. Let [P, Q] be an edge of the current mesh, let (Aj)1 ≤ j ≤ p be the intersections of this edge with the background triangles and let (tj)1 ≤ j ≤ p be such that Aj = P + tj PQ , with A0 = P and Ap+1 = Q. Then the edge length of [P, Q] is p

(

)

l( P, Q) = ∑ l Aj , Aj +1 , j =0

©1999 CRC Press LLC

(20.29)

and the length of each segment [Aj, Aj+1] is evaluated by considering a metric interpolation on [Aj, Aj+1] (cf. Section 20.6.1.2). The metrics at the points P and Q are known. Actually, the set points includes the boundary points (for which the metric is well defined) and some previously created points whose metric was fixed at the time they were created. It is now possible to propose a numerical method for computing the length of each segment in the above subdivision. In the isotropic case, the length of a segment can be computed exactly from the metrics at its endpoints, using the interpolation scheme on the segment [Laug et al., 1996]. In the anisotropic case, the length of the segment [Aj, Aj+1] is given by Eq. 20.6. To compute this integral form, an approximate scheme is used. Let la be the approximation solution. Then t

t

A j A j + 1M ( A j) A j A j + 1 + A j A j + 1M ( A j + 1) A j A j + 1 • Let L = ------------------------------------------------------------------------------------------------------------------------------- ; 2 • If L < L0 (L0 < 1) then la(Aj, Aj+1) = L; or, if M is the midpoint of segment [Aj, Aj+1], then la(Aj, Aj+1) = la(Aj, M) + la(M, Aj+1). This process is recursive. The resulting value is satisfactory if the approximate values, i.e., the la’s, are smaller than a given value L0 (in practice, L0 = 0.5 seems adequate). This process subdivides the segment into subsegments whose length is smaller than L0. As a consequence, the proposed method provides a series of points (Sij )1≤i≤rj on the segment [Aj, Aj+1], such that

( )

l Aj , S1j < L0 j j l(Si , Si +1 ) < L0 1 < i < rj . l(S , A ) < L rj j +1 0

(20.30)

20.6.3 Field Point Creation The edge lengths are computed and points are created along these edges so as to subdivide them into subsegments of unit length. The latter represents the goal to achieve in order to create a (almost) satisfactory mesh in the control space. The subsegments whose length is smaller than L0 resulting from the edge length analysis are now used to define a subdivision into unit length segments. According to Figure 20.4, we have p

[

]

[ P, Q] = U Aj , Aj +1 ; j =0

(20.31)

and for each segment [Aj, Aj+1], the subdivision (S ij )0 ≤ i ≤ r +1 is known such that S 0j = Aj, S rj +1 = Aj+1 and j j j l(S ij , S i+1 ) < L0 for 0 ≤ i ≤ rj . Then p

rj

l( P, Q) = ∑ ∑ l( Sij , Sij+1 ).

(20.32)

j =0 i=0

The method relies upon the definition of m such that m ≤ l(P, Q) < m + 1. The edge [P, Q] will be splitted in m or m + 1 segments if

m l( P, Q) m l( P, Q) > < or l( P, Q) m + 1 l( P, Q) m + 1 ©1999 CRC Press LLC

(20.33)

holds. To clarify this choice, let us assume that m is selected. The edge must be divided into m segments whose length is δ = l(P, Q)/m. Let (Ck = P + kδ )1 ≤ k < m be the subdivision points. For a given k, jα and iβ exists, such that

(

)

(

)

l P, Siβjα ≤ kδ < l P, Siβjα+1 ;

(20.34)

thus, on Ck ∈ [Sjiαβ , Sjiαβ +1], and

Ck = Siβ + jα

(

kδ − l P, Siβjα

(

jα

jα iβ +1

l Siβ , S

)

) (S

jα iβ +1

)

− Siβjα .

(20.35)

As the point Ck belongs to the segment [Ajα , Ajα +1], the metric at Ck is well-defined using an interpolation on this segment. It can be observed that the value δ is bounded by the values δmin = 1 ⁄ 2 and δmax = 2 , which are two tolerance thresholds relative to the desired unit value.

20.6.4 Filtration of the Field Points At the times the field points have been created along all edges, a filtration process is employed to discard those points that are too close to the others. The threshold value used is the above value δmin. This step is strictly required because the point generation process is local to every edge. To this end, a control grid is introduced consisting of regular cells. The points already retained are stored within a cell, and a point P will be retained or discarded if the enclosing cell (or the neighboring cells, at an appropriate distance) already contains a point Q, such that lP (P, Q) < δmin and lQ (P, Q) < δmin is satisfied or not.

20.6.5 Insertion of the Field Points The set of points retained after filtration is inserted in the current mesh using the extended Delaunay kernel in its constrained version.

20.7 Optimization To improve the resulting mesh, two procedures can be used, the diagonal swapping and the internal points relocation operators. The target is to achieve equilateral (or close to equilateral) triangles with respect to the control space. The optimization procedure consists in successively applying the diagonal swapping operator, then moving the points, these two steps being then repeated.

20.7.1 Element Quality Let K = [P1, P2, P3] be a triangle. In the usual Euclidean space, a possible definition of its quality is, according to [Lo, 1991], Q( K ) = α

→ → Det P1 P2 , P1 P3

∑

→

2

,

(20.36)

Pj Pk

1≤ j < k ≤ 3

where Det ( P 1 P 2, P 1 P 3 ) is the determinant of the matrix whose columns are P 1 P 2 and P 1 P 3 . Det represents twice the surface of the triangle K, while P j P k is the length of edge [Pj, Pk] of K and α = 2 3 is a normalization factor such that the quality of an equilateral triangle is 1. Accordingly, 0 ≤ Q(K)

©1999 CRC Press LLC

≤ 1 and a nice-shaped triangle quality is close to 1, while an ill-shaped triangle quality is close to 0. In a Riemannian space, the quality of a triangle K can be defined as

Γ( K ) = min Qi ( K ),

(20.37)

1≤ i < k ≤ 3

where Qi(K) is the triangle quality in the Euclidean space associated with vertex Pi of K, and a simple calculus gives

Qi ( K ) = α

→ → Det ( Mi ) Det P1 P2 , P1 P3

∑

t

→

→

.

(20.38)

Pj Pk Mi Pj Pk

1≤ j < k ≤ 3

with Mi = M(Pi).

20.7.2 Diagonal Swapping Diagonal swapping is a way to improve the mesh quality using a topological modification. This tool allows edges to be removed, if possible. Let f be a mesh edge. We term the shell of f, the set of triangles sharing f. The quality of a shell is that of its worst element. The diagonal swapping operator is then applied if the resulting mesh quality improves, as compared to that of the initial shell. Each edge f is associated with a ratio g f representing the quality improvement factor after the diagonal swapping is applied to f. In view of optimizing the mesh quality, diagonal swapping is applied iteratively depending on the variation of g f. Initially, the ratio of improvement is set to a value ω > 1 (in practice, a value ω = 2 is advised), then the coefficient ω is decreased to 1. According to this procedure, the most significant diagonal swapping are done first.

20.7.3 Point Relocation Let P be an internal mesh point and (Ki) be the ball of P (the set of elements having P as vertex). The point relocation process consists in moving P to improve the quality of the ball (i.e., that of its worst element). Two procedures have been developed, the first one leading to unit edge lengths, the other one leading to optimal elements (in terms of shape). 20.7.3.1 Relocation with Unit Length Let (Pi) be the vertices of (Ki) other than P. Each point Pi is associated with an optimal point P*i such that

→

→

∗ PP l( Pi , P) , i i = PP i

(20.39)

for which l(Pi, P*i ) = 1 holds. The process consists in moving the point P step by step toward the centroid Q of the points P*i , if the quality of the set (Ki) is improved. This process [Briere de l’Isle and George, 1995] leads to establishing unit length for the edges sharing P. 20.7.3.2 Relocation with Optimal Shape Let (fi) be the edges opposite to vertex P in the triangles (Ki)’s (Ki = [P, fi]). The optimal point P*i is associated with each edge fi, such that the triangle K*i = [ P*i , fi] enjoys the best possible quality Γ( K*i ). Let Q be the centroid of the points P*i , then the point P is moved step by step towards the point Q, as the quality variation is controlled.

©1999 CRC Press LLC

FIGURE 20.5

Piecewise linear interpolation in 1D.

This process leads to optimally shaped triangles. To obtain the point P*i , one can possibly consider the centroid of the optimal points associated with fi, each of them being evaluated in the metric specified at the vertices of the triangle Ki. To clarify this approach, let us consider the edge fi = [Pi, Pi+1], (Ki = [P, fi]) and let us compute the optimal point P*i related to fi, with respect to an Euclidean structure associated with a given metric M = (ab bc). The point P*i lies in the same half-plane as P, with respect to fi and is defined so that K*i = [ P*i , fi] is an equilateral triangle in the Euclidean structure related to M. If P is the matrix mapping the canonical base into the base of the eigenvectors of M, and Λ is the diagonal matrix formed by the eigenvectors of M, the optimal point P*i is defined by −

1

→

1

Pi ∗ = Pi + PΛ 2 R(π 3)Λ2 P −1 PP i i +1 ;

(20.40)

as M = PΛP–1, and as R(θ ) is a rotation matrix of angle θ , one has Pi * = Pi + M

−

1 2

1

→

R(π 3) M 2 PP i i +1 ,

(20.41)

or

Pi * = Pi + where d =

→

1 d − b −c PP , d + b i i +1 2d a

(20.42)

( ac – b ) ⁄ 3. 2

20.8 Metric Construction We now discuss the construction of the metric tensor M in order to satisfy an adaptation criterion. Suppose that we have only one unknown, denoted by η . We are trying to determine the metric tensor in order to equilibrate the interpolation error for the piecewise linear continuous finite element. The error equilibration idea is natural if we want to minimize the number of unknowns for solving the given problem with a given error (don’t put too many grid points to get a too- small error in some place). We assume that an initial solution has been computed for a given mesh and we denote by Πhη the piecewise linear interpolation of η supposed to be regular enough. In one dimension, the interpolation error can be defined by ∞ = η – Πhη∞.* On a segment [a, b] of the 1D mesh (see Figure 20.5), we have (Πhη)(a) = η (a) and (Πhη )(b) = η (b), so by using Taylor expansion, for all x ∈]a, b[, we have

(η − Π hη)( x ) = ( x − a)η′(a) + ( *|.|∞is the L∞ norm.

©1999 CRC Press LLC

x − a) ′ 3 η ′′( a) − ( x − a)(Π hη) ( a) + O ( x − a) , 2 2

(

)

(20.43)

By construction of Πh,

(Π hη)(b) − (Π hη)(a) = η(b) − η(a) ,

(Π hη)′ (a) =

b−a

(20.44)

b−a

and with again the Taylor expansion to evaluate η (b), we get

(Π hη)′ (a) = η′(a) + (

b − a) 2 η ′′( a) + O(b − a) . 2

(20.45)

From Eq. 20.43 and Eq. 20.45 we obtain

η( x ) − (Π hη)( x ) =

( x − a )2

η ′′( a) −

2

( x − a)(b − a) 2

η ′′( a) + O(b − a) , 3

(20.46)

therefore,

η( x ) − (Π hη)( x ) =

( x − a)( x − b) 2

η ′′( a) + O(b − a) . 3

(20.47)

But, we have also

max ( x − a)( x − b) = (a − b) 4 ; 2

x ∈[ a , b ]

(20.48)

so the interpolation error ∞ on a segment [ab] is

ε∞ =

( b − a )2 8

η ′′( a) + 0(b − a) . 3

(20.49)

In a two-dimensional space, the interpolation error is related to the Hessian matrix of η (see [d’Azevedo and Simpson, 1989] and [d’Azevedo and Simpson, 1991] for the proof)

ε = η − Π hη ≤ c0 h 2 H (η) ,

(20.50)

where |.| is the H1(Ω) norm, or the L∞(Ω) norm and where the Hessian matrix is defined by

∂ 2η ∂x 2 H (η) = 2 1 ∂ η ∂x1∂x2

∂ 2η ∂x1∂x2 . ∂ 2η ∂x22

(20.51)

Let us define the absolute value of a symmetric matrix by

H

©1999 CRC Press LLC

de f -

λ1 R 0

0 −1 R λ 2

(20.52)

where R is the unit matrix (i.e., tR = R –1), which diagonalizes the symmetric matrix H, and let λ 1, λ2 be the eigenvalues of H such that

λ1 0 −1 H = R R . 0 λ2

(20.53)

The error on a mesh edge ai can be computed as

ε i ≈ c0 t ai Hai ,

(20.54)

where c0 is the constant of the relation 20.50 or c0 = 1/8 if we consider Eq. 20.49. In order to minimize the number of vertices, we have to equilibrate this error. So the error i must be close to a given constant ε 0, a given threshold. In the previous section, we have introduced several tools to construct a unit mesh with respect to a t metric M. Consequently, the length of the segment ai in the metric |H| is ai H a i ≈ e 0 ⁄ c 0 . To achieve a unit mesh size, we simply use the metric tensor M as defined

M

de f −

c0 H ε0

(20.55)

Remark: M is a dimensionless matrix. For other interpolation, such as a quadratic triangle, we can compute an interpolation error (x, d) in all the direction d, and the problem is now find, for all X, the biggest M(x) such that t

dM ( x )d ≤ ε ( x, d ) ∀d ∈ IR 2 .

(20.56)

20.8.1 Computation of the Hessian The second derivatives are the fundamental key point in the metric definition, in case of a piecewise linear finite element (i.e., the second derivatives are equal to zero in each triangle). Therefore, a weak formulation (by means of the Green’s formula) has to be used to compute the Hessians as

∫H

i, j

Ω

∂ηh ∂vh ∂η + ∫ h ⋅ vh x x ∂ ∂ ∂xi i j Ω ∂Ω

.vh = − ∫

(20.57)

where vh is the classical P1 test function and H = (Hij)i=1,2,j=1,2 and η h is the numerical approximate of η (remark ηh ≠ Πhη , but we assume ηh and Πhη are close enough). To solve the liner problem Eq. 20.57, we use a mass lumping technique so as to obtain a diagonal problem, and the discrete Hessian Hkij at a vertex k is thus computed by

Hijk =

∂ηh ∂vhk ∂ηh k − + ∫ ∂x ∂x ∫ ∂x ⋅ vh Ω i j ∂Ω i k ∫ vh

Ω

where vkh is the piecewise linear finite element hat function associated with the vertex k.

©1999 CRC Press LLC

(20.58)

20.8.2 Remark on Metric Computation In the metric definition, we have to introduce the maximum and minimum mesh edge lengths in order to avoid unrealistic metrics. This is not really a restriction as we have usually a pretty good idea of what these quantities should be. More precisely, the eigenvalues of the metric defined in Eq. 20.53 are founded as follows:

1 1 λ˜1,2 = min max λ1,2 , 2 , 2 , hmax hmin hmin and hmax being the minimal and maximal allowable edge lengths in the mesh.

20.8.3 Metric Associated with Classical Norms All the results given in this section are obtainable by a compilation of the results in [Castro and Diaz, 1996] and [d’Azevedo and Simpson, 1991] It is then possible to change the norm in Eq. 20.50 so as to compute the error = |η – Πhη|. To this end, we introduce a new class of metrics defined by

M=

1 c0p 1 p A2 H A2 p ε0

(20.59)

where the exponent p of a matrix is defined by, according to the notation of Eq. 20.52,

H

p d e− f

λ p R 1 0

0 −1 p R . λ2

(20.60)

The given number p and the given symmetric definite positive matrix A can be defined for the different classical norms as follows: • For the L∞ norm, p = 1, A = Id2, and the error is

∈= f − Π h ( f ) ∞,

(20.61)

• For the H1 norm, p = 1, A = Id2, and the error is

∈= ∇( f − Π h ( f ))

L2

,

(20.62)

• For the energy norm, p = 2 and the error is

∈=

∇( f − Π h ( f )) A∇( f − Π h ( f ))

∞

,

(20.63)

• For the L2 norm, p = 1/2, A = Id2, and the error is

ε = f − Π h ( f ) L2 .

©1999 CRC Press LLC

(20.64)

20.8.4 Metric with Relative Error In the previous computation we have used a global error. But the cutoff definition of the error becomes a problem when the magnitude of the variation solution is greater than 103. The global error is not sufficient, and we have to use a local relative error. The relative error r is defined by

∈r =

η − Π h (η) X

(20.65)

max( η ,cutoff )

where cutoff is a positive number that allows to avoid a division by zero. The metric tensor M related to the relative error r is 1

Mr =

c0p A 2 H

(

p

1

A2

ε 0p max cutoff , η

p

(20.66)

)

Remark: This is a dimensionless error.

20.8.5 Metric Intersection In the case where several metric maps are specified (for instance for multicriteria problems), we propose a method that enables us to merge these maps so as to retrieve the one metric case and therefore to define the control space. The problem is to define a metric at a point that is consistent with two or more initially specified metrics. Let us consider the unit circles (ellipses) associated with two initial metrics. The sought solution is the metric associated with the intersection of these two circles. In general, this intersection is not an ellipse, so we retain the largest ellipse included in it as the solution. The latter defines a metric, namely the intersection metric. To obtain this intersection metric, we use the simultaneous reduction applied to the initial metrics. If M1 and M2 denote these two metrics, the two corresponding circles can be written in the base associated with the simultaneous reduction of the matrices M1 and M2 as t

XM1 X = λ1 x12 + λ2 x22 = 1 and tXM2 X = µ1 x12 + µ2 x22 = 1.

(20.67)

The intersection metric M1∩M2 is then defined by

max(λ1, µ1 ) −1 0 M1 ∩ M2 = tP −1 P , 0 max(λ2 , µ2 )

(20.68)

where P is the matrix that allows to transform the canonical base to the base associated with the reduction. On Figure 20.6 the intersection metric of two given metrics can be seen. If more than two metrics are involved, the above scheme is applied recursively,

(

)

M1 ∩ ... ∩ Mq = ...(( M1 ∩ M2 ) ∩ M3 ) ∩ ... ∩ Mq .

©1999 CRC Press LLC

(20.69)

FIGURE 20.6

Ellipse of the intersection of two metrics.

20.9 Loop of Adaptation The aforementioned framework can be easily extended to construct a loop of adaptation. To this end, the control space at iteration j is defined by the mesh at iteration j – 1 and a metric map is specified at every mesh vertex. In this general situation, it is also necessary to create the mesh of the boundary at each step with respect to the control space. To this end, the geometry of the boundary is strictly required. We assume that this geometry is known by Tgeom a mesh constructed so as to permit the creation of a suitable mathematical support, denoted as Suppgeom, which can be easily handled. In so doing, we avoid being too closely coupled with a CAD system. With this background, the scheme of a loop of adaptation is given as • Input of Tgeom, the mesh serving as definition for the geometry and construction of the support

Suppgeom. • Construction of the initial boundary discretization F0 according to a size map H0 given on Suppgeom. • Initial mesh T0 using F0 and H0 as data. • Adaptation loop (starting at j = 1).

– Input of a metric map Hj on Tj–1. – Discretization Fj of the support Suppgeom governed by the control space (Tj–1, Hj). – Mesh adaptation Tj using Fj and the control space (Tj–1, Hj). – Iteration j = j + 1, if required. The diagram associated with an adaptation loop is summarized in Figure 20.7. The above procedure is repeated until an almost satisfactory mesh Tj is obtained, with respect to (Tj, Hj+1). In other words, the edges in Tj tend to have a length close to one, in the control space associated with the current metric.

20.10 Application Examples The CFD examples depicted in this section are the result of the NSC2KE solver. We describe two configurations of compressible inviscid and viscous flows. In all cases, the initial meshes have been generated using the EMC2 software [Hecht and Saltel, 1990], and the adaption loop can be done using the Bamg software [Hecht, 1997]. We compare the normalized residual evolution of the adapted computation with a direct computation for which we started on the last adapted mesh from an uniform solution using the same time integration procedure. The residual is based on the norm of the right-hand side of the equations and not on the time derivative terms. In this way, the time step size does not influence the convergence history. This gives an idea of the cost of similar computations on a large uniform grid. In fact, for the same resolution we would need many more grid points in an uniform mesh, but this just enforces our conclusions. For both cases, the convergence is accelerated by the adaptation technique. In terms of CPU, as in the

©1999 CRC Press LLC

FIGURE 20.7

Adaptation diagram.

adaptation loop, most of the work is done at the coarser levels, the computation cost is reduced by at least a factor of 20. The stop criterion for the adaptation loop has been the independence of the results, with respect of the mesh (especially regarding the wall coefficients). These techniques have been validated on several other configurations, such as multielement airfoils. These computations can be found in [Castro, Diaz, et al., 1995].

20.10.1

Navier–Stokes Solver

We use the NSC2KE fluid solver for the computations; details can be found in [Mohammadi, 1994]. A finite-volume-Galerkin formulation of Navier–Stokes equations in conservation form has been considered. A four stage Runge–Kutta scheme is used for time integration. The Roe Riemann solver [Roe, 1981] has been used for the Euler part together with a MUSCL type reconstruction and Van Albada limiters for second-order accuracy. P1 finite element has been used for the viscous part of the operation. A Steger–Warming [Steger and Warming, 1982] flux splitting has been used at the inflow and outflow boundaries, while nonpenetration or slip boundary conditions have been applied to solid walls depending on the flow nature. Turbulent modeling is done using the classical k – ε [Launder and Spalding, 1972] ©1999 CRC Press LLC

model with special wall-laws, enabling the computations for separated and unsteady flows [Mohammadi and Pironneau, 1994]; [Hecht and Mohammadi, 1997].

20.10.2

Flow Over a Backward Step

This is the classical backward-step (ratio 2 between the step and the channel heights) at Re∞/H = 44,000 and inflow Mach number of 0.1. The parameter δ is set to 0.005H which corresponds to y+ ~ 20. For mesh adaptation the parameters hmin, hmax, and hn are respectively 0.002H, H, and 0.002H. We can see that these parameters are quite easy to choose for a given configuration. We compare the mesh obtained using the global and relative estimations presented above for the same interpolation error (c = 10–2).

20.10.3

Transonic Turbulent Flow Over a RAE2822

This is a transonic flow at inflow Mach number of 0.734 and 2.79 degrees of incidence. The chord-based Reynolds number is ReC = 6.5 × 106. Experimental data are available for the pressure and friction coefficients distribution. One difficulty here is to correctly predict the shock position. The aim here is to show the impact of the ingredients described above regarding mesh generation algorithms for boundary layers. The parameters hmin, hmax, and hn are respectively 0.01C, 3.C, and 0.0002C. The interpolation error is = 5 × 10–3.

20.11 Application to Surface Meshing We like to give a different application of the anisotropic mesh generation method. To this end, we consider the problem of parametric surface meshing. Let Ω be a domain of R2 and σ be a smooth function, then the surface Σ defined by the following parametrization σ

σ : Ω → R3 , (u, v) a σ (u, v) can be meshed in Ω by means of an anisotropic two-dimensional mesh generation method, the resulting mesh being then mapped in R3 by means of σ. As the purpose is to obtain an accurate approximation of Σ, the mesh generation process must be governed so as to provide this issue. The question is then to construct an adequate metric map in Ω, the domain where the construction is made, to obtain, after mapping the resulting mesh onto Σ, an accurate surface mesh. The key-idea is to use the intrinsic properties of the surface Σ to define a metric map in R3, referred to as M3, enabling us to construct the needed metric map, M2 in R2. In this way, the scheme of the mesh generation process is what follows

governed mesh c governed mesh

( Σ, M ( P ) ) 3

p ∈Σ

,

(Ω, M ( X ) ) 2

X ∈Ω

where X ∈ Ω and P ∈ Σ are related by P = σ (X). Assuming that M3 is given, M2(X) is the metric induced by M3(P) on the tangent plane of the surface Σ at P. If Π(P) denotes the matrix transforming the canonical base of R3 in the local base at P, the metric M2(X) is then defined by the two first rows and the two first lines of the matrix t

©1999 CRC Press LLC

Π( P) M3 ( P)Π( P).

(20.70)

FIGURE 20.8 Partial view of the mesh obtained with the relative criterion. The main and secondary recirculations are correctly identified.

FIGURE 20.9 Partial view of the mesh obtained with the global criterion. The main recirculation is weakly detected and the secondary one has not been captured.

FIGURE 20.10 Partial view of the mesh obtained, main and secondary recirculation are correctly identified with the relative criteria and the secondary one has not been captured with the global error.

FIGURE 20.11

Backward facing step: particle tracking for the computation using the relative error estimation.

©1999 CRC Press LLC

FIGURE 20.12

RAE 2822: Adapted mesh with about 7000 nodes and Iso-Mach contours.

FIGURE 20.13

FIGURE 20.14

RAE 2822: Adapted mesh and Iso-Mach contours (partial view).

RAE 2822: Zoom over the region of shock-boundary layer interaction.

FIGURE 20.15

©1999 CRC Press LLC

RAE 2822: Zoom around the trailing edge.

FIGURE 20.16

RAE 2822: Pressure and friction coefficients distribution.

Then, different types of approximate meshes can be obtained as a function of the metric M3(P). In this respect, we can specify isotropic meshes with constant or variable size as well as pure anisotropic meshes. For instance, a metric of the type

1 0 0 h2 1 M3 ( P, h) = 0 2 0 h 1 0 0 2 h

(20.71)

leads to specify an isotropic mesh where h is the expected size at P (if h is independent of P, a uniform mesh will be obtained), while

1 0 0 2 h ( P) 1 1 t B( P) B( P) 0 0 h22 ( P) 1 0 0 h32 ( P)

(20.72)

leads to specify an anisotropic mesh of sizes h1, h2 and h3 in the base vector directions of B(P) at P. Two specific metric can be constructed in this way, referred to as M3(P, ρ) and M3(P, ρ1, ρ2) where ρ1 and ρ2 are the principal radii of curvature of the surface at point P while ρ is the minimal radius of curvature of Σ at point P. More precisely, if ρ, in fact ρ(P), is the smaller of the principal radii of curvature ρ1 and ρ2 then the metric map

1 0 0 2 ρ 1 M3 ( P, ρ ) = 0 0 ρ2 1 0 0 ρ2

©1999 CRC Press LLC

(20.73)

FIGURE 20.17

An isotropic geometric mesh of a cylinder using as domain Ω a ring.

is called the isotropic map related to the minimal radius of curvature and, according to [Borouchaki and George, 1996], this map enables us to obtain an isotropic mesh with a second-order approximation of the surface Σ. Similarly, assuming ρ1 < ρ2 (where ρ1 and ρ2 are functions of P), the metric map

1 ρ12 M3 ( P, ρ1 , ρ2 )= tBρ ( P) 0 0

0 1 ρ2′ 2 0

0 0 Bp ( P) λ

(20.74)

where λ is an arbitrary scalar value is called the anisotropic map related to the principal radii of curvature, and this map allows to obtain an anisotropic mesh with a second order approximate of the surface. To illustrate the surface meshing application, we given Figure 20.17 where the surface Σ is the head section depicted on top while the parametric domain Ω is a ring. The anisotropic mesh generation process is governed by a metric map of the form M3(P, ρ1, ρ2) so as to obtain a second order approximate of the surface. The resulting mesh includes 20,374 triangles and 10,190 vertices.

20.12 Concluding Remarks In this paper, the main lines of a classical Delaunay-type mesh generation algorithm have been recalled. Special attention has been paid to the incremental insertion point procedure, the so-called Delaunay kernel, and to the field point construction using the supporting edges. We have proposed a scheme for a Delaunay generator in the anisotropic case, or more generally an adaptation problem, based on the classical scheme as the usual metric has been replaced by a Riemannian

©1999 CRC Press LLC

structure. The Delaunay kernel as well as the field point creation procedure have been rewritten. To this end, the notion of a control space has been introduced, leading to a new definition of the lengths involved in the different steps of the method. Application examples for two-dimensional CFD computations and parametric surfaces have been presented to illustrate the features of the governed mesh generation algorithm. The extension of the proposed method to three dimensions shall not induce any major difficulty. The process used to define the field points along the edges is still valid. The Delaunay kernel can be formally extended, while verifying that the star-shaped property of the cavity still holds. The delicate aspects expected concern the proper definition of the set Suppgeom, geometric support of the domain and also the ability to remesh the surface of the domain according to a specified map.

Acknowledgment We are greatly indebted to Houman Borouchaki (currently at Université Technologique de Troyes) as well as to Bijan Mohammadi (from INRIA) for helping us in this work.

References 1. Berger, M.J. and Jameson, A., 1985. Automatic adaptive grid refinement for Euler equations, AIAA J. 1985, 23,4, pp 561–568. 2. Borouchaki, H. and George, P.L., Maillage de Surfaces parametriques. partie i; aspects théoriques, Rapport de Recherche. 1996, INRIA, 2928. 3. Borouchaki, H., George, P.L., and Lo, S.H., Optimal Delaunay point insertion, Int. Jour. Num. Meth. Eng. 1996, 39, 20, pp 3407–3438. 4. Borouchaki, H., George, P. L., and Mohammadi, B., Delaunay mesh generation governed by metric specifications. part 2: application examples, Finite Elements in Analysis and Design, 1996, 25(1–2), pp 85–109. 5. Borouchaki, H., George, P. L., Hecht, F., Laug, P., and Saltel, E., Delaunay mesh generation governed by metric specifications. part 1: algorithms, Finite Elements in Analysis and Design 1996, 25(1–2), pp 61–83. 6. Borouchaki, H., George, P. L., Hecht, F., and Saltel, E. Reasonably efficient Delaunay based mesh generator in 3 dimensions, 4th International Meshing Roundtable, Albuquerque, NM, 1995, pp 3–14. 7. Bowyer, A., Computing dirichlet tessellations, Comput. J. 1981, 24, pp 162–166. 8. Briere de l’Isle, E. and George, P.L., 1995. Optimization of tetrahedral meshes, IMA Volumes in Mathematics and its Applications. Babuska, I., Henshaw, W.D., Oliger, J.E., Flaherty, J.E., Hopcroft, J.E., and Tezduyar, T., (Eds.), Springer-Verlag, 1995, Vol. 75, p. 97–128. 9. Bristeau, M.O. and Periaux, J., Finite element methods for the calculation of compressible viscous flows using self-adaptive refinement, in VKI Lecture Notes on CFD, 1986. 10. Castro Díaz, M.J., Mesh refinement over surfaces, INRIA, Rocquencourt, 1994, RR-2462. 11. Castro Díaz, M.J., Generación y adaptatión anisotrópa de mallados de elementos finitos para la resolutión numérica de e.d.p. aplicaciones, (Tesis doctoral), Universidad de Málaga,1996. 12. Castro Díaz, M.J. and Hecht, F. Anisotropic surface mesh generation, INRIA Research Report, Rocquencourt. 1995, RR-2672. 13. Castro Díaz, M. J., Hecht, F., and Mohammadi, B., New progress in anisotropic mesh adaption for inviscid and viscous flow simulations, INRIA Research Report, Rocquencourt. 1995, RR-2671. 14. Cherfils, C. and Hermeline, F., Diagonal Swap procedures and characterizations of 2D-Delaunay triangulations, M2 AN. 1990, 24,5, pp 613–625. 15. d’Azevedo, E.F. and Simpson, R.B., On optimal interpolation triangle incidences, SIAM’s Journal of Scientific and Statistical Computing, 1989, 6, pp1063–1075. 16. d’Azevedo, E.F. and Simpson, R.B.,On Optimal triangular-meshs for minimizing the gradient error, Numerische Mathematik, 1991, 59, 4, pp 321–348.

©1999 CRC Press LLC

17. George, P.L., Automatic Mesh Generation. Applications to Finite Element Methods. Wiley, 1991. 18. George, P.L. and Borouchaki, H., Triangulation de Delaunay et Maillage. Applications aux Éléments Finis, Hermès, Paris, 1997. 19. George, P.L., Hecht, F., and Saltel, E., Automatic mesh generator with specified boundary, Comp. Meth. in Appl. Mech. and Eng. 1991, 92, pp 269–288. 20. Hecht, F., Bidimensional anisotropic mesh generator, Technical report, INRIA, Rocquencourt. 1997 Source code: ftp://ftp.inria.fr/INRIA/Projects/Gamma/bamg.tar.gz 21. Hecht, F. and Mohammadi, B., Mesh adaption by metric control for multi-scale phenomena and turbulence, AIAA Paper 97-0859, 1997. 22. Hecht, F. and Saltel, E., EMC2 un logiciel d’édition de maillages et de contours bidimensionnels, Technical report INRIA, Rocquencourt, 1990, RT-0118. Source code: ftp://ftp.inria.fr/INRIA/Projects/Gamma./emc2.tar.gz 23. Hermeline, F., Triangulation automatique d’un polyèdre en dimension N. R.A.I.R.O. Analyse Num. 1982, 16, 3, pp 211–242. 24. Laug, P. and Borouchaki, H., The BL2D mesh generator: beginner’s guide, user’s and programmer’s manual, R.T. INRIA. 0194, 1996. Source code: ftp://ftp.inria.ft/INRIA/Projects/Gamma/bl2d.tar.Z 25. Laug, P., Borouchaki, H., and George, P. L., Maillage de courbes gouverné par une carte de métriques, R. R. INRIA. 2818, 1996. 26. Launder, B.E. and Spalding, D.B., Mathematical models of turbulence, Academic Press. 1972, 40, pp 263–293. 27. Lawson, C.L., Properties of n-dimensional triangulations, Comput. Aided Geom. Design. 1986, 3, pp 231–246. 28. Lee, C.K. and Lo, S.H., An automatic adaptive refinement finite element procedure for 2D Elastostatic analysis, Int. Jour. Num. Meth. Eng. 1992, 35, pp 1967–1989. 29. Lo, S.H., Automatic mesh generation and adaptation by using contours, Int. Jour. Num. Meth. Eng. 1991, 31, pp 689–707. 30. Lohner, R., Adaptive remeshing for transient problems, Comp. Meth. in Appl. Mech. and Eng. 1989, 75, pp 195–214. 31. Mavriplis, D.J., Adaptive mesh generation for viscous flows using Delaunay triangulation, Jour. of Comput. Phys.1990, 90, 2, pp 271–291. 32. Mohammadi, B., CFD with NSC2KE: A user guide, Technical report, INRIA, Rocquencourt. RT-0164, 1994. Source code: ftp://frp.inria.fr/INRIA/Projects/Gamma/NSC2KE.tar.gz 33. Mohammadi, B. and Pironneau, O., Analysis of the K-Epsilon Turbulence Model. J. Wiley and Masson Pub, 1994. 34. Peraire, J., Vahdati, M., Morgan, K., and Zienkiewicz, O.C., Adaptive remeshing for compressible flow computations, J. Comput. Phys. 1987, 72, pp 449–466. 35. Preparata, F.P. and Shamos, M.I., Computational geometry, an introduction. Springer-Verlag, 1985. 36. Roe, P. L. 1981. Approximate Riemann solvers, parameters vectors and difference schemes, JCP. 43. 37. Steger, J. and Warming, R.F., Flux vector splitting for the inviscid gas dynamic with applications to finite-difference methods, Journal Comp. Phys. 1982, 40, pp 263–293. 38. Vallet, M.G., Génération de maillages éléments finis anisotropes et adaptatifs, Thèse d’Université. Paris 6, 1992. 39. Watson, D.F., Computing the n-dimensional Delaunay tessellation with application to Voronoï polytopes, Comput. J. 1981, 24, pp 167–172. 40. Weatherill, N.P., Marchant, M.J., Hassan, O., and Marcum, D.L., Grid adaptation using a distribution of sources applied to inviscid compressible flow simulations, Int. J. Num. Meth. Eng. 1994, 19, pp 739–764.

©1999 CRC Press LLC

21 Quadrilateral and Hexahedral Element Meshes

Robert Schneiders

21.1 21.2 21.3 21.4 21.5 21.6

Introduction Block-Decomposition Methods Superposition Methods The Spatial Twist Continuum Other Approaches Software and Online Information

21.1 Introduction This chapter explains techniques for the generation of quadrilateral and hexahedral element meshes. Since structured meshes are discussed in detail in other parts of this volume, we focus on the generation of unstructured meshes, with special attention paid to the 3D case. Quadrilateral or hexahedral element meshes are the meshes of choice for many applications, a fact that can be explained empirically more easily than mathematically. An example of a numerical experiment is presented by Benzley [1995], who uses tetrahedral and hexahedral element meshes for bending and torsional analysis of a simple bar, fixed at one end. If elastic material is assumed, second-order tetrahedral elements and first-order hexahedral elements both give good results (first-order tetrahedral elements perform worse). In the case of elastic–plastic material, a hexahedral element mesh is significantly better. A mathematical argument in favor of the hexahedral element is that the volume defined by one element must be represented by at least five tetrahedra. The construction of the system matrix is thus computationally more expensive, in particular if higher order elements are used. Unstructured hex meshes are often used in computational fluid dynamics, where one tries to fill most of the computational domain with a structured grid, allowing irregular nodes but in regions of complicated shape, and for the simulation of processes with plastic deformation, e.g., metal forming processes. In contrast to the favorable numerical quality of quadrilateral and hexahedral element meshes, mesh generation is a very difficult task. A hexahedral element mesh is a very “stiff ” structure from a geometrical point of view, a fact that is illustrated by the following observation: Consider a structured grid and a new node that must be inserted by using local modifications only (Figure 21.1). While this can be done in 2D, in the three-dimensional case it is no longer possible! Thus, it is not possible to generate a hexahedral element mesh by point insertion methods, a technique that has proven very powerful for the generation of tetrahedral element meshes (Delaunay–type algorithms, Chapter 16). Many algorithms for the generation of tetrahedral element meshes are advancing front methods (Chapter 17), where a volume is meshed starting from a discretization of its surface and building the volume mesh layer by layer. It is very difficult to use this idea for hex meshing, even for very simple

©1999 CRC Press LLC

FIGURE 21.1

Inserting a point into a structured quadrilateral element mesh.

FIGURE 21.2

Surface mesh for a pyramid.

structures! Figure 21.2 shows a pyramid whose basic square has been split into four and whose triangles have been split into three quadrilateral faces each. It has been shown that a hexahedral element mesh whose surface matches the given surface mesh exactly exists [Mitchell 1996], but all known solutions have degenerated or zero-volume elements. The failure of point-insertion and advancing-front type algorithms severely limits the number of approaches to deal with the hex meshing problem. Most proposed algorithms can be classified either as block-decomposition or superposition methods. The situation is better for the generation of quadrilateral element meshes. In the remainder of the chapter, we will explain the basic techniques for quadrilateral and hexahedral element mesh generation, with special attention paid to the three-dimensional case. Much of the research work has been presented in the Numerical Grid Generation in Computational Fluid Dynamics and in the Mesh Generation Roundtable and Conference conference series, and detailed information can be found in the proceedings. The proceedings of the latter are available online at the Meshing Research Corner [Owen 1996], a large database with literature on mesh generation maintained at Carnegie Mellon University by S. Owen.

21.2 Block-Decomposition Methods In the early years of the finite element method, hexahedral element meshes were the meshes of choice. The geometries considered at that time were not very complex (beams, plates), and a hexahedral element mesh could be generated with less effort than a tetrahedral mesh (graphics workstations were not available at that time). Meshes were generated by using mapped meshing methods: A mesh defined on the unit cube is transformed onto the desired geometry Ω with the help of a mapping F : [0, 1]3 → Ω . This method can generate structured grids for cube-like geometries (Figure 21.3). The mapping F can be specified explicitly (isoparametric or conformal mapping) or implicitly (solution of an elliptic or hyperbolic partial differential equation). The problem of finding a suitable mapping F has been the object of major research efforts in recent years, and an overview is given elsewhere in this handbook. A summary of the results can be found in the books of Thompson [1985] and Knupp [1995].

©1999 CRC Press LLC

FIGURE 21.3

FIGURE 21.4

Mapped meshing.

Multiblock-structured mesh.

If the geometry to be meshed is too complicated or has reentrant edges, meshes generated by mapped meshing methods usually have poorly shaped elements and cannot be used for numerical simulations. In this case, a preprocessing step is required: The geometry is interactively partitioned into blocks that are meshed separately (the meshes at joint interfaces must match, a problem considered in [Tam and Armstrong 1993] and [Hannemann 1995]). These multiblock-type methods are state of the art in university and industrial codes (see Chapter 13). Figure 21.4 shows an example mesh that was generated with Fluent Inc.’s GEOMESH* preprocessor. In principle, most geometries can be meshed in this way. However, there is a limitation in practice: The construction of the multiblock decomposition, which must be done interactively by the engineer. For complex geometries, e.g., a flow field around an airplane or a complicated casting geometry, this task can take weeks or even months to complete. This severely prolongs the simulation turnaround time and limits the acceptance of numerical simulations (a recent study suggests that in order to obtain a 24hour simulation turnaround time, the time spent for mesh generation has to be cut to at most one hour). One way to deal with that problem is to develop solvers based on unstructured tetrahedral element meshes. In the 1980s, powerful automatic tetrahedral element meshers were developed for that purpose (they are described elsewhere in this volume). The first attempt to develop a truly automated hex mesher was undertaken by the finite element modeling group at Queens University in Belfast (C. Armstrong). Their strategy is to automate the block *GEOMESH is a trademark of Fluent Inc.

©1999 CRC Press LLC

FIGURE 21.5

FIGURE 21.6

Medical axis and domain decomposition.

Multiblock-decomposition and resulting mesh.

decomposition process. The starting point is the derivation of a simplified geometrical representation of the geometry, the medial axis in 2D and the medial surface in 3D. In the following we will explain the idea (see [Price, Armstrong, Sabin 1995] and [Price and Armstrong 1997] for the details). We start with a discussion of the 2D algorithm. Consider a domain A for which we want to find a partition into subdomains Ai. We define the medial axis or skeleton of A as follows: for each point P ∈ A , the touching circle Ur(P) is the largest circle around P that is fully contained in A. The medial axis M(A) is the set of all points P whose touching circles touch the boundary δ A of A more than once. The medial axis consists of nodes and edges and can be viewed as a graph. An example is shown in Figure 21.5: two circles touch the boundary of A exactly twice; the respective midpoints fall on edges of the medial axis. A third circle has three points common with δ A, the midpoint is a branch point (node) of the medial axis. The medial axis is a unique description of A: A is the union of all touching circles Ur(P), P ∈ M ( A ) . The medial axis is a representation of the topology of the domain and can thus serve as a starting point for a block decomposition (Figures 21.5 and 21.6). For each node of M(A) a subdomain is defined, its boundary consisting of the bisectors of the adjacent edges and parts of δ A (a modified procedure is used if nonconvex parts of δ A come into play [Price, Armstrong, Sabin 1995]). The resulting decomposition of A consists of n–polygons, n ≥ 3, whose interior angle are smaller than 180°. A polygon is then split up by using the midpoint subdivision technique [Tam and Armstrong 1993], [Blacker and Stephenson 1991]: Its centroid is connected to the midpoints of its edges; the resulting tesselation consists of convex quadrilaterals. Figure 21.6 shows the multiblock decomposition and the resulting mesh, which can be generated by applying mapped meshing to the faces. It remains to explain how to construct the medial axis. This is done by using a Delaunay technique (Figure 21.7a): The boundary δ A of the domain A is approximated by a polygon p, and the constrained Delaunay triangulation (CDT) of p is computed. One gets an approximation to the medial axis by connection of the circumcircles of the Delaunay triangulation (the approximation is a subset of the Voronoï diagram of p). By refining the discretization p of δ A and applying this procedure, one gets a series of approximations that converges to the medial axis (Figure 21.7b). Consider a triangle of the CDT to p: part of its circumcircle overlaps the complement of A. The overlap for the circumcircle of the respective triangle

©1999 CRC Press LLC

FIGURE 21.7

Approximating the medial axis.

of the refined polygon’s CDT is significantly smaller. If the edge lengths of p tend to zero, the circumcircles converge to circles contained in A that touch δ A at least twice. Their midpoints belong to the medial axis. In three dimensions, the automization of the multiblock decompositions is found by using the medial surface. The medial surface is a straightforward generalization of the medial axis and is defined as follows: Consider a point P in the object A and let Ur(P) the maximum sphere centered in P that is contained in A. The medial surface is defined as the set of all points P for which Ur(P) touches the object boundary δ A more than once. P lies on

δ A twice. • An edge of the medial surface, if Ur(P) touches δ A three times. • A node of the medial surface, if Ur(P) touches δ A four times or more. • A face of the medial surface, if Ur(P) touches

The medial surface is a simplified description of the object (again, A is the union of the touching spheres Ur(P) for all points P on the medial surface). The medial surface preserves the topology information and can therefore be used for finding the multiblock decomposition. Armstrong’s algorithm for hexahedral element mesh generation follows the line of the 2D algorithm (Figure 21.8). The first step is the construction of the medial surface with the help of a constrained Delaunay triangulation (Shewchuk [1998] shows how to construct a surface triangulation for which a constrained Delaunay triangulation exists). The medial surface is then used to decompose the object into simple subvolumes. This is the crucial step of the algorithm, and it is much more complex than in the two-dimensional case. A number of different cases must be considered, especially if nonconvex edges are involved; they will not be discussed here, the interested reader is referred to [Price and Armstrong 1997] for the details. Armstrong identifies 13 polyhedra an object is decomposed to (Figure 21.9 shows a selection). These meshable primitives have convex edges, and each node is adjacent to exactly three edges. The midpoint subdivision technique [Tan and Armstrong 1993] can therefore be used to decompose the object into hexahedra: the midpoints of the edges are connected to the midpoints of the faces (Figure 21.10). Then both the edge and face midpoints are connected to the center of the object, and the resulting decomposition consists of valid hexahedral elements. Figure 21.11 shows a mesh generated for a geometry with a nonconvex edge. The example highlights the strength of the method: the mesh is well aligned to the geometry, it is a “nice” mesh — an engineer would try to create a mesh like this with an interactive tool. The medial surface technique tries to emulate the multiblock decomposition done by the engineer “by hand.” This leads to the generation of quality meshes, but there are some inherent problems: namely, it does not answer the question whether a good block decomposition exists, which may not be the case if the geometry to be meshed has small features. Another problem is that the medial surface is an unstable entity. Small changes in the object can cause big changes in the medial surface and the generated mesh. Nevertheless, the medial surface is extremely useful for engineering analysis: It can be used for geometry idealization and small feature removal, which simplifies the medial surface, enhances the stability of the algorithm and leads to better block decompositions. The method delivers relatively coarse meshes that are well aligned to the geometry, a highly desirable property especially in computational mechanics. It

©1999 CRC Press LLC

FIGURE 21.8 Medial-surface algorithm for the generation of hexahedral element meshes. (a) medial surface, (b) edge primitives, (c) vertex primitives, (d) face primitives, and (e) final mesh.

FIGURE 21.9

FIGURE 21.10

©1999 CRC Press LLC

Meshable primitives (selection).

Volume decomposition by midpoint subdivision.

FIGURE 21.11

Medial surface and mesh for a mechanical part.

FIGURE 21.12

2D grid-based algorithm.

is natural that an approach to high-quality mesh generation leads to a very complex algorithm, but the problems are likely to be solved. Two other hex meshing algorithms based on the medial surface are known in the literature. Holmes [1995] uses the medial surface concept to develop meshing templates for simple subvolumes. Chen [Turkkiyah 1995] generates a quadrilateral element mesh on the medial surface which is then extended to the volume.

21.3 Superposition Methods The acronym superposition methods refers to a class of meshing algorithms that use the same basic strategy. All these algorithms start with a mesh that can be more or less easily generated and covers a sufficiently large domain around the object, which is then adapted to the object boundary. The approach is very pragmatic, but the resulting algorithms are very robust, and there are several promising variants. Since we have actively participated in this research, we will concentrate on a description of our own work, the grid-based algorithm [Schneiders 1996a]. Figure 21.12 shows the 2D variant: A sufficiently large region around the object is covered by a structured grid. The cell size h of the grid can be chosen arbitrarily, but should be smaller than the smallest feature of the object. It remains to adapt the grid to the object boundary — the most difficult part of the algorithm. ©1999 CRC Press LLC

FIGURE 21.13

Grid-based algorithm — boundary adaption by projection technique.

According to [Schneiders 1996a], all elements outside the object or too close to the object boundary are removed from the mesh, with the remaining cells defining the initial mesh (Figure 21.12a, note that the distance between the initial mesh and the boundary is approximately h). The region between the object boundary and the initial mesh is then meshed with the isomorphism technique. The boundary of the initial mesh is a polygon, and for each polygon node, a node on the object boundary is defined (Figure 21.12b). Care must be taken that characteristic points of the object boundary are matched in this step, a problem that is not too difficult to solve in 2D. By connecting polygon nodes to their respective nodes on the objective boundary, one gets a quadrilateral element mesh in the boundary region (Figure 21.12c). The “principal axis” of the mesh depends on the structure of the initial mesh, and in the grid- based algorithm the element layers are parallel to one of the coordinate axis. Consequently, the resulting mesh (Figure 21.12) has a regular structure in the object interior and near boundaries that are parallel to the coordinate axis; irregular nodes can be found in regions close to other parts of the boundary. This is typical for a grid-based algorithm, but can be avoided by choosing a different type of initial mesh. The only input parameter for the grid-based algorithm is the cell size h. In case of failure, it is therefore possible to restart the algorithm with a different choice of h, a fact that greatly enhances the robustness of the algorithm. Another way to adapt the initial mesh to the boundary, the projection method, was proposed in [Taghavi 1994] and [Ives 1995]. The starting point is the construction of a structured grid that covers the object (Figure 21.13a), but in contrast to the grid-based algorithm, all cells remain in place. Mesh nodes are moved onto the characteristic points of the object and then onto the object edges, so that the object boundary is fully covered by mesh edges (Figure 21.13b). Degenerate elements may be constructed in this step, but disappear after buffer layers have been inserted at the object boundary (Figure 21.13c, the mesh is then optimized by Laplacian smoothing). The projection method allows the meshing objects with internal faces; the resulting meshes are similar to those generated with the isomorphism techniques, although there tend to be high aspect ratio elements at smaller features of the object. In contrast to the isomorphism technique, the mesh is adapted to the object boundary before inserting the buffer layer. Superposition methods can be used for the 3D case. The idea of the grid-based algorithm is shown for a simple geometry, a pyramid (1 quadrilateral, 4 triangular faces, Figure 21.14). The whole domain is covered with a structured uniform grid with cell size h. In order to adapt the grid to the boundary, all cells outside the object that intersect the object boundary or are closer than 0.5 • h to the boundary are removed from the grid. The remaining set of cells is called the initial mesh (Figure 21.14a). The isomorphism technique [Schneiders 1996a] is used to adapt the initial mesh to the boundary, a step that poses many more problems in 3D than in 2D. The technique is based on the observation that the boundary of the initial mesh is an unstructured mesh M of quadrilateral elements in 3D. An

©1999 CRC Press LLC

FIGURE 21.14

FIGURE 21.15

Initial mesh (a) and isomorphic mesh (b) on the boundary.

Construction of hexahedral elements in the boundary region.

isomorphic mesh M' is generated on the boundary. For each node of v ∈ M a node v′ ∈ M′ is defined on the object boundary, and for each edge ( v, w ) ∈ M an edge ( v′, w′ ) ∈ M′ is defined. It follows that for each quadrilateral f ∈ M of the initial mesh’s surface there is exactly one face f¢ ∈ M′ on the object boundary. Figure 21.14b shows the isomorphic mesh for the initial mesh of Figure 21.14b. Figure 21.15 shows the situation in detail: The quadrilateral face ( A, B, C, D ) ∈ M corresponds to the face ( a, b, c, d ) ∈ M′ . The nodes A, B, C, D, a, b, c, d define a hexahedral element in the boundary region! This step can be carried out for all pairs of faces, and the boundary region can be meshed with hexahedral elements in this way. The crucial step in the algorithm is the generation of a good quality mesh M' on the object boundary. All object edges must be matched by a sequence of mesh edges, and the shapes of the faces f¢ ∈ M′ must be nondegenerate. If the surface mesh does not meet these requirements, the resulting volume mesh does not represent the volume well or has degenerate elements. Fulfilling this requirement is a nontrivial task; also, the implementation becomes a problem (codes based on superposition techniques usually have more than 100,000 lines of code). We will not describe the process in detail, but some important steps will be discussed for the example shown in Figures 21.16–21.21. Figure 21.16a shows the initial mesh for another geometry that does not look very complicated but nevertheless is difficult to mesh. The first step of the algorithm is to define the coordinates of the nodes of the isomorphic mesh. Therefore, normals are defined for the nodes on the surface of the initial mesh by averaging the normals Nf of the n adjacent faces f (cf. Figure 21.16b):

Nv =

©1999 CRC Press LLC

1 n

∑N

f adj. v

f

FIGURE 21.16

Initial mesh (a) and normals (b).

FIGURE 21.17

Isomorphic surface mesh.

For each point v ∈ M , the position of the corresponding point v′ ∈ M′ is calculated as the intersection of the normal Nv with the object boundary. The point v' is then projected onto • A characteristic vertex P of the object, if dist(v', P) ≤ 0.1 • h. • A characteristic edge E of the object, if dist(v', E) ≤ 0.1 • h.

In case of projection, a flag is set for the respective node to indicate the entity it has been fixed to. Figure 21.17a shows that the quality of the generated surface mesh is unsatisfactory but that at least some of the characteristic vertices and edges of the object are covered by mesh nodes and edges. For the generation of hexahedral elements in the boundary region, the topology of the surface mash M' must not be changed, but we are free to modify the location of the nodes in spaces. This allows the optimization of the surface mesh by moving the nodes v' to appropriate positions (Figure 21.17b shows that the quality of the surface mesh can be improved significantly). A Laplacian smoothing is applied to the nodes of the surface mesh. The new position x new of a node v' is calculated as the average of the i midpoints Sk of the N adjacent faces.

xinew =

1 N ∑ Sk N k =1

The following rules are applied in the optimization phase: • After a correction step, the nodes are reprojected onto the object boundary. • Nodes that are fixed to a characteristic vertex of the object are not considered. • Nodes that are fixed to a characteristic edge are reprojected onto that edge. • Nodes that are fixed to a characteristic edge but whose neighbors are not fixed are released from

that edge.

©1999 CRC Press LLC

FIGURE 21.18

FIGURE 21.19

Edge repair.

Inserting additional elements at sharp convex edges.

FIGURE 21.20

Splitting degenerated elements.

In the next step, the object vertices and edges are covered by mesh nodes and edges: • Each object vertex is assigned the closest mesh node. • Edge capturing: Starting from a vertex, mesh nodes are projected onto an object edge

(Figure 21.18). • The smoothing procedure is reapplied. Figure 21.17b shows that the surface mesh accurately represents the object geometry and that the overall mesh quality has been improved. Nevertheless, degenerate faces can result from the edge capturing process if three nodes of a face are fixed to the same characteristic edge. This cannot be avoided if the object edges are not aligned to the “principal axes” of the mesh (cf. Figure 21.18). There are two ways to deal with the problem. First, the boundary region is filled with a hexahedral element mesh. Due to the meshing procedure, there are two rows of elements adjacent to a convex edge (Figure 21.19a). If the solid angle alongside the edge is sufficiently smaller than 180°, the mesh quality can be improved by inserting an additional row of elements, followed by a local resmoothing. At object vertices where three convex edges meet, one additional element is inserted. Figure 21.21a shows the resulting mesh after the application of the optimization step (note that many degeneracies have been removed). The remaining degenerate elements are removed by a splitting procedure. Figure 21.20 shows the situation: Three points of a face have been fixed to a characteristic edge; the node P is “free.” This face is split up into three quadrilaterals in a way that the flat angle is removed (Figure 21.20b). The adjacent element can be split in a similar way into four hexahedral elements. In order to maintain the conformity of the mesh, the neighbor elements must be split up also; it is, however, important that only neighbor elements adjacent to P must be refined — the initial mesh remains unchanged.

©1999 CRC Press LLC

FIGURE 21.21

FIGURE 21.22

Removing degenerated elements.

Mesh for a mechanical part.

Figure 21.21b shows the resulting mesh. Note that the surface mesh is no longer isomorphic to the initial mesh (Figure 21.16a) since removing the degenerated elements has had an effect on the topology (the mesh in Figure 21.17b is isomorphic to the initial mesh). The mesh has a regular structure at faces and edges that are parallel to one of the coordinate axes. The mesh is unstructured at edges whose adjacent edges include a “flat” angle and where degenerate elements had to be removed by the splitting operation. Figure 21.22 shows another mesh for a mechanical part. The grid-based algorithm is only one out of many possible mesh generators that use the superposition principle. Figure 21.23 shows an examples where a nonuniform initial mesh has been generated. One can then apply the isomorphism (or projection) technique to adapt the mesh to the object boundary. A weak point of the grid-based method is the fact that the elements are nearly equal sized. This can cause problems, since the element size h must be chosen according to the smallest feature of the object — a mesh with an unacceptable number of elements may result. The natural way to overcome this drawback is to choose an octree-based structure as an initial mesh, which would allow the adaption of the element size to the geometry. In the following we will explain the basic ideas and the problems that must be solved in this approach (see [Schneiders 1996b] for the details). For reasons that will become clear later, we choose a special kind of octree structure (cf. Chapter 14). The root octant (a box that contains the object to be meshed) is subdivided into 27 octants (children).

©1999 CRC Press LLC

FIGURE 21.23

Octree-based initial mesh and isomorphic surface mesh.

FIGURE 21.24

FIGURE 21.25

Octree decomposition.

Mesh density information and initial quadtree.

These octants can be split up recursively until the mesh has the desired level of resolution. Figure 21.24 shows an example where one suboctant has been split. The example also shows that each octant can be assigned a level in a natural way: • The root octant is assigned level 0. • If an octant of level l is split, its children get level l + 1.

The octree structure has hanging nodes that have to be removed — one has to find the “conforming hull.” This is the difficult problem to be solved in octree-based meshing, and it is equivalent to the refinement problem for hexahedral element meshes. For ease of understanding, we will treat the 2D case first. Figure 21.25 shows the object to be meshed. The mesh density is represented by tupels (p, h), which means that the element size at the point p should not exceed h (although there are better ways to represent mesh density, this method has been chosen for ease of explanation). These points can be set according to the object geometry or deliberately, for example to get a dense mesh in an area where a point load is applied. ©1999 CRC Press LLC

FIGURE 21.26

Quadrant and node levels.

FIGURE 21.27

2D templates.

Starting from a box that contains the object to be meshed, the following procedure generates the quadtree: procedure refine_quadrant (quadrant) begin if the quadrant contains a point p whose associated edge length is smaller than the quadrant size then split up the quadrant into 9 (3D: 27) quadrants; for all new quadrants q_i refine_quadrant (q_i); end; refine_quadrant (root_quadrant); Figure 21.26a shows a part of the quadtree and the quadrant levels. There are quadrants with hanging nodes at one or more edges if the level of a neighboring quadrant is different. These quadrants must be split up in order to get a conforming mesh. First, the level information is transferred to the nodes of the quadtree: A node v is assigned the maximum level of its adjacent quadrants (Figure 21.26b):

l(v) = max{l(q)| v is a node of q} The hanging nodes are removed by inserting appropriate templates from the list shown in Figure 21.27. The insertion is done successively for the quadrants with level 0, 1, 2, … . The nodal subdivision levels help in finding the correct template. Consider an arbitrary quadrant with level l(q): the nodes v of q with l(v) > l(q) are marked (Figure 21.28a, l = 2). The configuration of the marked nodes uniquely determines the template that must be inserted into q. Figure 21.28a shows the result after all quadrants with level 2 have been processed (the templates 1 and 2a were used). The newly generated nodes and faces are assigned the level l(q) + 1. The procedure is then repeated until no hanging nodes are left (Figure 21.28b):

©1999 CRC Press LLC

FIGURE 21.28

FIGURE 21.29

Construction of the conforming closure.

Generation of the conforming closure.

procedure conforming_closure for 1 = 0 to maximum_level for all quadrants q with level l mark nodes v with level (v) > 1; insert appropriate template; set new levels; The choice of templates guarantees that the process results in a conforming mesh. An edge is • Split into three, if both nodes are marked. • Split into two, if one of its nodes is marked. • Not split, if no node is marked.

Only those elements with a perfect shape may be split up recursively, and it can be shown that the minimum angle in the mesh does not depend on the refinement level [Schneiders 1996c]. Figure 21.29 shows the situation after applying the conforming closure to level 3 and level 4 quadrants. Boundary fitting of the mesh can be done by using either the projection or the isomorphism technique; a short review of the latter one will be given here (see [Schneiders 1996b] for the details). A subset of the conforming quadrilateral element mesh is selected as the initial mesh (Figure 21.30a). This is not as straightforward as for the grid-based algorithm: care must be taken that the distance of each boundary edge e to the object boundary roughly equals the edge length (if this condition is not respected, elements with unacceptable aspect ratios may be generated). One can then construct normals for the boundary nodes of the initial mesh, generate mesh nodes on the object boundary and construct elements in the boundary region (Figure 21.30b). The mesh is then optimized, in a manner similar to grid-based mesh generation. The 3D algorithm follows the same line. For ease of explanation, we choose as an example a block where we want a very fine mesh at one location on the boundary (Figure 21.31). First, a three-level octree is constructed. Octant and node levels are then computed as in the 2D algorithm. ©1999 CRC Press LLC

FIGURE 21.30

FIGURE 21.31

Adapting the mesh to the boundary.

Three-dimensional refinement requirement.

FIGURE 21.32

Selected 3D-templates.

As in 2D, the problem to be solved is the construction of the conforming hull. This is done by inserting appropriate templates into the octree structure. In 3D, a total of 22 templates are needed; Figure 21.32 shows a selection. The templates are constructed by applying the 2D templates (Figure 21.27) to the octant faces — this guarantees that the process results in a conforming mesh. In this way, the problem of how to find the conforming hull is reduced to finding volume meshes for these templates. In the example in Figure 21.31, the templates 1, 2, 3, and 4 from the list are needed (this set forms an important subset, templates for “convex” refinement specifications). The solution for template 2 is similar to the splitting operation in Figure 21.20; template 3 is more complex. Template 4 may look confusing at first glance, but is easier to understand if its construction is done in two steps. A sweep with face template 2a is used in one direction, the three newly generated hexahedra at the face to be refined are split in the same way but in the opposite direction. Note that the new elements at the marked nodes have perfect shape, so that they can be refined further without reducing the smallest angle in the mesh. Both the isomorphism and projection techniques can be used to fit the mesh to the object boundary [Schneiders 1996b]. Unfortunately, the proposed method does not work in every case. Template 6 in Figure 21.32 is the weak point: it has a total of 55 quadrilateral faces on the surface. According to [Mitchell 1996], a hexahedral element mesh has an even number of boundary faces, so a mesh that “fits into” template 6 cannot exist.

©1999 CRC Press LLC

FIGURE 21.33

FIGURE 21.34

3D templates — details.

Hexagedral element mesh for the simulation of flow around a car.

The algorithm in the form presented here can only be applied to a limited set of problems, “convex” refinement specifications. In practice, even the limited set of templates is useful, if the region where a fine mesh is needed is relatively small. Further, there exist two workarounds for the problem, level propagation and buffer layer insertion [Schneiders 1996b]. If one accepts hanging nodes in the mesh, finding the confinement hull is not necessary. This removes one obstacle, but makes boundary adaptation more difficult. Algorithms of this type were developed by Smith [1996], who uses the isomorphism technique for body fitting, and by Tchon [1997] who uses the projection method. The algorithms are implemented in Fluent Inc.’s Gambit and NUMECA’s IGG/Hexa preprocessor. Octree-based meshing without hanging nodes, based on the standard octree structure, is complicated by the fact that the transitioning cannot be localized as in the case of the 1-27-octree. This problem is treated in [Schneiders 1998]. The paper also presents a new approach to deal with the conforming hull problem. Figure 21.34 shows part of a mesh that has been generated for the simulation of flow around a car.

©1999 CRC Press LLC

FIGURE 21.35

Quadrilateral mesh and spatial twist continuum.

The grid- and octree-based algorithms presented here prove that the superposition principle is an algorithmic tool to successfully deal with the hex meshing problem. They are, however, not the only methods of choice; combinations with the other methods outlined in this chapter seem promising. Further research may reveal the full potential of superposition methods.

21.4 The Spatial Twist Continuum The techniques presented so far can also be used for the generation of tetrahedral element meshes. In contrast to that, the spatial twist continuum is a unique concept for quadrilateral and hexahedral element mesh generation. The results presented here were mainly achieved by the CUBIT team, a joint research group at Sandia National Laboratories and Brigham Young University that has been working on quadrilateral and hexahedral element meshing since the beginning of the 1990s. The group is working on algorithms that generate a mesh starting from discretization of the object surface into quadrilaterals. As part of their research, the paving [Blacker and Stephenson 1991] and plastering [Blacker 1993] advancing-front type mesh generators have been developed. These algorithms are described in section 21.5; here we will describe other results. Given an unstructured quadrilateral element mesh M = (V, E, F), the spatial twist continuum (STC) [Murdock et al. 1997] M' = (V', E', F') is defined as follows: • For each face f ∈ F , the midpoint v' is a node of V'. • For each edge e ∈ E ,we define an edge e′ = ( v′ 1, v′ 2 ) ∈ E′ where v'1 and v'2 are the midpoints

of the two quadrilaterals that share e. For each node v ∈ V , a face f′ ∈ F′ is defined by the midpoints of the adjacent quadrilaterals. The STC is the combinatorial dual [Preparata and Shamos 1985] of the quadrilateral mesh. Figure 21.35 shows a quadrilateral mesh and the corresponding STC (gray lines). The edges of the STC are displayed not as straight lines but as curves. This allows the recognition of chords, a very important structure: one can start at a node, follow an edge e1 to the next node, then choose the edge e2 “straight ahead” that is not adjacent to e1, continue to the next edge e3 and so on. The sequence e1, e2, …. forms a chord (displayed as a smooth curve in Figure 21.35). Chords can be closed or open curves and can have self-intersections, and a chord corresponds to a row of quadrilaterals in the mesh. By definition, an STC corresponds to a quadrilateral element mesh. Thus, in order to generate a quadrilateral mesh, one can just construct an STC by arranging a set of chords, and then generate the mesh by constructing the dual. The problem with this strategy is that elements with unacceptable shape can be constructed. Figure 21.36 gives an example: two chords intersect twice, and the quadrilaterals corresponding to the intersection points have two edges in common. One can overcome this problem by adding a chord to the STC. This corresponds to the insertion of an additional row of elements into the mesh, and the degeneracy is resolved. A quadrilateral mesh that respects a given boundary discretization can be constructed by first inserting chords that connect the boundary segments, then adding chords to resolve the degeneracies.

©1999 CRC Press LLC

FIGURE 21.36

FIGURE 21.37

Removing a degeneracy from a quadrilateral mesh.

STC for a mesh of four hexahedra and corresponding surface STC.

The STC is a very good construct to analyze and improve mesh generation algorithms, and the idea can also be used in 3D. This was noticed by the CUBIT team and led to important theoretical results [Mitchell 1996] and to the whisker weaving algorithm [Tautges 1996], which will be described in the following. As in 2D, the STC is the combinatorial dual of a hexahedral element mesh. Figure 21.37 shows an example: The midpoints of the hexahedra are the nodes of the STC, each pair of adjacent hexahedra gives an edge, and the set of hexahedra that have an edge in common defines a face of the STC. As in 2D, one can identify chords that correspond to rows of elements; in the example of Figure 21.37 all chords start and end at the mesh boundary, but there may also be cyclic chords in an STC. The faces of the STC can be combined to a sheet that corresponds to a layer of elements. A chord is defined by the intersection of two sheets or by a self-intersecting sheet. Vertices of the STC that correspond to hexahedra are defined by the intersection of three chords or three sheets (or less in case of self-intersections). Basically, the STC is a set of intersecting sheets, and “dualizing” the STC gives a hexahedral mesh. From this, it is clear that it is difficult to apply a local change to a hexahedral mesh, since that is equivalent to a modification of the STC. The only operations allowed for an STC are the insertion or deletion of a sheet, and both will likely have a global effect. These ideas can be applied to the construction of a hexahedral mesh from a surface discretization. Given a hexahedral element mesh, the STC of its surface mesh matches the intersection of the hexahedral mesh’s STC with the surface: An intersection of a sheet with the surface is a chord of the surface STC. These intersections are called loops. Figure 21.38 shows an example surface mesh and the corresponding four loops. The generation of a hexahedral mesh is thus an inverse problem and can be solved as follows: • Generate the surface STC. • For each loop, construct a sheet whose intersection with the surface matches that loop. • Add sheets in the interior to remove degeneracies. • Dualize to get the hexahedral mesh.

©1999 CRC Press LLC

FIGURE 21.38

FIGURE 21.39

STC of a surface mesh.

Initial set of whisker sheets.

In [Mitchell 1996], it is proved that, given a surface discretization with an even number of elements, a hexahedral element exists. Mitchell shows that an STC that respects all constraints can be generated by inserting sheets into the original STC. His proof is, however, nonconstructive, since he does not give an algorithm for the construction of the first STC. This is done by the whiskerweaving algorithm [Tautges 1996], which is described in the following. The first step of the algorithm is the initialization of whisker sheet diagrams. A whisker sheet corresponds to a sheet of the STC to be constructed, so there is one whisker sheet for each loop. Figure 21.39 shows the whisker sheets for the loops of Figure 21.38. The vertices of a sheet correspond the faces that the loop intersects, and are labeled outside by the face numbers. Since the faces also correspond to the intersection of two loops, the vertices are labeled inside with the number of the intersecting loop (whisker sheet). The next step in whisker weaving is the formation of a hex by crossing three chords on three sheets. Two sheets correspond to two chords on the third sheet, and it is required that the chords start at adjacent faces. The chords are pairwise crossed and define three vertices which correspond to the same STC vertex (hexahedron). In the example of Figure 21.39 the sheets 1, 2, and 3 have been selected, Figure 21.40a shows the result. By duality, this step is equivalent to the construction of a hexahedron at the faces 1, 4, and 8 (Figure 21.41a). Next the sheets 2, 3, and 4 that correspond to the chords starting at the faces 2, 9, and 11 are selected. The result is shown in Figure 21.40b and is equivalent to the construction of another hexahedron (Figure 21.41b). Obviously, glueing the hexahedra is the next step (Figure 21.40c), which is equivalent to joining the chords 2 and 3 in the sheets 2 and 3 (Figure 21.40c). In the following the chords corresponding to the faces 3, 5, 7 and 6, 10, 12 are joined. The gluing operation completes the construction of the whisker sheet (Figure 21.42). Having dualized the STC, one gets the mesh shown in Figure 21.38d. The dualizing process does not always result in a valid hex mesh. Hexahedra with more than two faces in common may be present in the mesh or invalid elements may be constructed if their base faces are nearly coplanar. Mitchell [1996] identifies 7 constraints an STC must fulfil in order to guarantee that dualizing results in a valid hex mesh. This is done by inserting additional sheets into the STC, see [Mitchell 1996] for the details. It proved to be very difficult to derive a stable version of the whisker weaving algorithm. If the surface STC has self-intersections, it may be nearly impossible (the STC corresponding to the surface in

©1999 CRC Press LLC

FIGURE 21.40

FIGURE 21.41

Whisker weaving: example.

Dualized view of whisker weaving.

FIGURE 21.42

Resulting whisker sheets.

Figure 21.2 consists of two loops, one of them with 8 self-interactions — whisker weaving done “by hand” is very difficult). This is probably due to the fact that the algorithm is quite indeterministic and relies more on topological than on geometrical information. Compared to whisker weaving, block-decomposition and superposition methods are easier to realize, since they are not constrained by a given surface discretization. Algorithmic complexity is the price one

©1999 CRC Press LLC

FIGURE 21.43

Paving algorithm.

has to pay for the potential benefit of the whisker weaving algorithm, and it is still a subject of research. Nevertheless, the concepts presented in this chapter give much insight into the nature of hexahedral mesh generation, and the techniques are useful in enhancing block-decomposition of superposition type algorithms (the templates in Figure 21.32 were constructed by using the STC concept).

21.5 Other Approaches Advancing-front type methods are very popular for the generation of tetrahedral element meshes. First, a mesh of triangles is generated for the surface, then a volume mesh is generated layer by layer. This allows the control of mesh quality near the boundary; internal faces can be represented in the mesh, and the method can be parallelized. An advancing-front type algorithm for the generation of quadrilateral element meshes was proposed in [Blacker and Stephenson 1991]. Figure 21.43 gives an idea of how it works: starting from a boundary discretization, the interior is “paved” with quadrilaterals layer by layer. If the layers overlap, a “seaming” procedure is invoked, and the procedure is repeated until the remaining cavities have been filled. The paving algorithm is probably the best mesh generator for quadrilateral element meshes. It generates meshes of high-quality elements with an acceptable number of elements. Irregular nodes (interior nodes with other than four elements adjacent) are more likely to be found in the interior than close the boundary. The algorithm is very complex and not easy to implement. An attempt to develop a three-dimensional version, the plastering algorithm, has been made in the CUBIT project. Starting from a quadrilateral discretization of the object boundary, layers of hexahedral elements are generated in the volume (Figure 21.44). The number of different cases to be considered is far greater than in the 2D case. Degenerated elements (wedges) are removed by propagating them through the mesh [Blacker 1993]. Unfortunately, it turned out to be impossible to develop a robust algorithm. The problems arise when two fronts intersect. In the 2D case, one can glue (“seam”) the fronts if the change in element size is not too large. This is not sufficient in 3D, since these surface meshes must be isomorphic in order to seam them. This condition is unlikely to hold for practical problems. Another problem is that the cavities cannot be meshed in every case. Figure 21.2 shows an example (the cavity can be reduced to an octahedron, a nonmeshable object in the sense that a valid hex mesh that matches the octahedron surface has not yet been found).

©1999 CRC Press LLC

FIGURE 21.44

FIGURE 21.45

Plastering algorithm.

Mesh for a geological structure with internal boundaries.

It turns out that generating a hex mesh from a surface discretization is hard to realize if the decisions are made purely on local information. So the original idea was rejected, and global information was incorporated using the concept of the dual described in section 20.4. An algorithm for the generation of hexahedral element meshes for very complicated domains (geological structures with internal boundaries) was proposed by Taniguchi [1996]. His approach is similar to Armstrong’s algorithm in that he decomposes the domain into simple subvolumes (tetrahedra, pentrahedra, etc.) that are then meshed separately. The method is based on Delaunay triangulation, and therefore can be applied for arbitrary convex domains that consist of a set of convex subdomains that are surrounded by fracture planes. Figure 21.45 shows a mesh generated for the simulation of groundwater flow; for simulations like this it is very important that the boundaries between different layers of material are present in the mesh. A similar method for hexahedral element meshing of mechanical parts was proposed by Sakurai [Shih and Sakurai 1996] (volume decomposition method). Also notable is the work of Shang-Sheng Liu [Liu 1996]; he tries to integrate the mesh generation into a solid modeling environment, an approach that is attractive particularly for mechanical engineering CAD systems. So far we have concentrated on meshing strategies that can be applied both in two and three dimensions. There are, however, strategies for quadrilateral element mesh generation that cannot be extended to the 3D case. Two of these shall be discussed briefly. The block decomposition approach used by Armstrong poses far fewer problems in 2D. Whereas in 3D one must take care to generate subvolumes that can be split up into hexahedra, this is not really a problem in 2D, since every polygon with an even number of edges can be meshed with quadrilateral elements. So, there is much more room for finding a good partitioning strategy. An algorithm of this type is describe by Nowottny [1997] (Figure 21.46). First the holes of the polygon to be meshed are removed by connecting them to the outer boundary. Then appropriate cuts are inserted until sufficiently small subregions have been generated. These are then meshed directly.

©1999 CRC Press LLC

FIGURE 21.46

Quadrilateral mesh generation by geometrically optimized domain decomposition.

This strategy works in 2D since a sufficiently large polygon can always be split into two meshable subpolygons. This does not hold in 3D (Figure 21.2), and thus an extension of this strategy seems unlikely to be realized. Another approach for the generation of quadrilateral element meshes was proposed in [Shimada 1994]: first one generates a triangular mesh with an even number of elements; pairs of triangles are then combined to quadrilaterals until no triangles remain. This approach is very elegant, especially since it allows the use of the work done on triangulation algorithms. Obtaining graded meshes or meshes for geometries with internal boundaries is especially straightforward using this approach. Unfortunately, it cannot be used for 3D, since combining tetrahedra into hexahedra is not possible except for tet meshes with a very regular structure.

21.6 Software and Online Information In the followings a selection of quadrilateral or hexahedral element mesh generators is given. We restrict ourselves to unstructured mesh generation. Information on multiblock-based systems can be found elsewhere in this handbook or on the web page “Mesh Generation and Grid Generation on the Web” [Schneiders 1996d], which has links to all programs described here. HEXAR (Cray Research, http://www.cray.com/products/applications/directory/codes /HEXAR.html) A grid-based mesh generator, available for Cray’s parallel machines. FAM4 (FEGS Ltd, http://www.fegs.co.uk/FAM_products.html) Medial-surface based mesh generator, an implementation of C. Armstrongs ideas. KUBRIX (Simulation Works, Inc. http://www.siw.com, http://kubrix.com) This mesh generator uses a fuzzy logic-based block decomposition method. Houdini (Algor Inc., http://www.algor.com/houdini/homepage.htm) This mesh generator uses an advancing front technique for the generation of tetrahedral and hexahedral element meshes. FAME (AVL-LIST GmbH, http://www.avl.co.at/html/11.htm) Preprocessor for the FIRE cfd code, comes with a grid-based mesh generator. PEP (http://www.rwth-aachen.de/ibf/) A preprocessor for the simulation of metal forming processes, with 2D and 3D grid-based mesh generators [Schneiders 1996a] and an implementation of the paving algorithm [Blacker and Stephenson 1991]. CUBIT (http://sass577.endo.sandia.gov/SEACAS/CUBIT_sw/Cubit.html) A tool for the generator of hexahedral element meshes: whisker weaving and mapped meshing.

©1999 CRC Press LLC

ICEM CFD Hexa (http://www.icemcfd.com/hexa.html) A automatic hex mesher, part of a powerful preprocessor for cfd applications. IGG/Hexa (http://stro5.vub.ac.be/pub/numeca/numeca.html) Numeca’s octree-based hex mesher: Body-fitted meshes with hanging nodes. Cooper Tool/Gambit (http://www.fluent.com) Fluent’s semiautomatic hex mesher and the octree-based automatic unstructured hex mesher (hanging nodes are allowed). Many groups who are active in the field have online information (cf. [Schneiders 1996d]): http://web.cs.ualberta.ca/~barry/ Barry Joe, University of Alberta: Author of the GEOMPACK tet mesher, is now working on algorithms for the generation of hex meshes. http://caor.ensmp.fr/Francais/Personnel/Mounoury/Francais/Introduction.html Valéry Mounoury, CAOR (Paris), uses semantical analysis of volumes as a starting point for mesh generation. http://www-users.informatik.rwth-aachen.de/~roberts/index.html Grid-based and octree-based hex meshing at the Techical University of Aachen. http://www.rwth-aachen.de/ibf/ Automatic remeshing for the simulation of metal forming processes. http://www.unibw-hamburg.de/MWEB/ikf/fft/home_e.html The Institute for Production Technology at the University of Hamburg develops a grid-based mesh generator for the preprocessing of the simulation of metal-forming processes. http://daimler.me.metu.edu.tr/users/tekkaya/ A. Tekkaya, Middle East Technical University (Ankara), uses a grid-based mesh generator for the simulation of metal-forming processes. http://www.inria.fr/Equipes/GAMMA-eng.html The GAMMA project at INRIA (France, director: Paul-Louis George) has an outstanding record in algorithms for tet meshing and is also considering the hex meshing problem. http://sog1.me.qub.ac.uk/femgroup.html Web server for the finite element group at Queens University in Belfast (C. Armstrong, medial-surface tools). http://www.et.byu.edu/~cubit/ CUBIT is a joint project of SANDIA National Laboratories and Brigham Young University, sponsored by the Department of Energy and an industrial consortium, working on advancing-front and whiskerweaving methods. http://smartcad.me.wisc.edu/~shang-sh/homepage.html Shang-Sheng Liu, University of Wisconsin, works on hex meshing in a solid modeling environment. http://swhite.me.washington.edu/~cdam/PEOPLE/HAO/hao.html Information on Hao Chen’s thesis work at the University of Washington, medial-surface-based algorithm. http://www.lance.colostate.edu/~hiroshi/mesh.html A description of the advancing-layer mesh generator developed at Colorado State University.

©1999 CRC Press LLC

Acknowledgment This work benefitted from the support of the following people: C. Armstrong, T. Taniguchi, and D. Nowottny contributed some of the figures. M. Schneider helped in translating the text. The author wishes to thank them for their help.

References 1. Benzley, S. E., Perry, E., Merkley, K., Clark, B., and Sjaardema, G. A comparison of all hexagonal and all tetrahedral finite element meshes for elastic and elastic-plastic analysis, Proc. 4th International Meshing Roundtable, Sandia National Laboratories, Albuquerque, NM, pp 179–192, 1995. 2. Blacker, T.D. and Stephenson, M.B., Paving: a new approach to automated quadrilateral mesh generation, Int. J. Num. Meth. Eng. 32, pp 811–847, 1991. 3. Blacker, T.D. and Meyers, R.J., Seams and wedges in plastering: a 3D hexahedral mesh generation algorithm, Engineering with Computers, 9, pp 83–93, 1993. 4. Brodersen, O., Hepperle, M., Ronzheimer, A., Rossow, C.-C., and Schöning, B., The parametric grid generation system megacads, Proc. 5th Int. Conf. on Numerical Grid Generation Computational Field Simulations. Soni, B.K., Thompson, J.F., Häuser, J., Eiseman, P., (Eds.), NSF, Mississippi, pp 353–362, 1996. 5. George, P.L., Automatic Mesh Generation: Applications to Finite Element Methods, John Wiley & Sons, 1991. 6. Holmes, D., Generalized method of decomposing solid geometry into hexahedron finite elements, Proc. 4th International Meshing Roundtable, Sandia National Laboratories, pp 141–152, 1995. 7. Ives, D., geometric grid generation. surface modeling, grid generation, and related issues in computational fluid dynamic (CFD)Solutions, Proc. NASA-Conference, Cleveland, OH, NASA CP-3291, 1995. 8. Knupp, P. and Steinberg, S., Fundamentals of Grid Generation. CRC Press, Boca Raton, FL. 9. Liu, S.-S. and Gadh, R., Basic logical bulk shapes (blobs) for finite element hexahedral mesh generation, Proceedings 5th International Meshing Roundtable, 1996. 10. Mitchell, S.A., A characterization of the quadrilateral meshes of a surface which admit a compatible hexahedral mesh of the enclosed volume, Proceedings STACS ’96. Grenoble, 1996. 11. Möhring, R., Müller-Hannemann, M., and Weihe, K. Using network flows for surface modeling, Proceedings of the Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 350–359, 1995. 12. Murdock, P., Benzley, S.E., Blacker, T.D., and Mitchel, S.A., The spatial twist continuum: a connectivity based bethod for representing and constructing all-hexahedral finite element meshes, Finite Elements in Analysis and Design, 28, pp 137–149, 1997. 13. Nowottny, D., Quadrilateral mesh generation via geometrically optimized domain decomposition, Proc. 6th International Meshing Roundtable, Park City, UT, pp 309–320, 1997. 14. Owen, S., Meshing research corner, Literaturdatenbank, URL, 1996. http://www.ce.cmu.edu/~sowen/mesh.html 15. Preparata and Shamos, Computational Geometry: An Introduction. Springer Verlag, NY, pp 24–26, 1985. 16. Price, M.A., Armstrong, C.G., and Sabin, M.A., Hexahedral mesh generation by medial axis subdivision: I. Solids with convex edges, Int. J. Num. Meth. Eng., 38, pp 3335–3359, 1995. 17. Price, M.A. and Armstrong, C.G., Hexahedral mesh generation by medial axis subdivision: ii. solids with flat and concave edges, Int. J. Num. Meth. Eng, 40, pp 111–136, 1997. 18. Sabin, M., Criteria for comparison of automatic mesh generation methods, Adv. Eng. Softw, 13, pp 220–225., 1991. 19. Schneiders, R., A Grid-based algorithm for the generation of hexahedral element meshes, Engineering with Computers,12, pp 168–177, 1996a.

©1999 CRC Press LLC

20. Schneiders, R., Schindler, R., and Weiler, F., Octree-based generation of hexahedral element meshes, Proc. 5th International Meshing Roundtable, Sandia National Laboratories, pp 205–216, 1996b. 21. Schneiders, R., Refining quadrilateral and hexahedral element meshes, Proc. 5th International Conference on Numerical Grid Generation in Computational Field Simulations, pp 699–708, 1996c. 22. Schneiders, R., Mesh generation and grid generation on the Web, http://www-users.informatik.rwth-aachen.de/~roberts/meshgeneration.html., 1996d. 23. Schneiders, R., Octree-based hexahedral mesh generation, to appear in Journal of Computational Geometry and Applications, special issue on mesh generation, 1998. 24. Shewchuk, J.R., A condition guaranteeing the existence of higher-dimensional constrained Delaunay triangulations, submitted to the Fourteenth Annual Symposium on Computational Geometry, 1998. 25. Shih, B.-Y. and Sakurai, H., Automated hexahedral mesh generation by swept volume decomposition and recomposition, Proc. 5th Int. Meshing Roundtable. 1996. 26. Shimada, K. and Itoh, T., Automated conversion of 2D triangular meshes into quadrilateral meshes, Proc. Int. Conf. on Computational Engineering Science, 1994. 27. Smith, R.J. and Leschziner, M.A., A novel approach to engineering computations for complex aerodynamic flows, Proc. 5th Int.Conf. on Numerical Grid Generation in Computational Field Simulations, pp 709–716, 1996. 28. Taghavi, R., Automatic, parallel and fault tolerant mesh generation from CAD on Cray Research Supercomputers, Proc. CUG Conf. Tours, France, 1994. 29. Tam, T.K.H. and Armstrong, C.G., Finite element mesh control by integer preprogramming, Int. J. Num. Meth. Eng., 36, pp 2581–2605, 1993. 30. Taniguchi, T., New concept of hexahedral mesh generation for arbitrary 3D domain — block degeneration method, Proc. 5th Int. Conf. on Numerical Grid Generation in Computational Field Simulations, pp. 671–678, 1996. 31. Tautges, T.J. and Mitchell, S., Progress report on the whisker weaving all-hexahedral meshing algorithm, Proc. 5th Int. Conf. on Numerical Grid Generation in Computational Field Simulations, pp 659–670, 1996. 32. Tchon, K.-F., Hirsch, C., and Schneiders, R., Octree-based hexahedral mesh generation for viscous flow simulations, Proc. 13th AIAA Computational Fluid Dynamics Conference, Snowmass, CO, 1997. 33. Thompson, J.F., Warsi, Z.U.A., and Mastin, C.W., Numerical Grid Generation: Foundations and Applications. North-Holland, 1985. 34. Turkkiyah, G.M., Ganter, M.A., Storti, D.W., and Chen, H., Skeleton-based hexahedral finite element mesh generation of general 3D solids, Proc. 4th Int. Meshing Roundtable, Sandia National Laboratories, late addition, 1995.

©1999 CRC Press LLC

22 Adaptive Cartesian Mesh Generation 22.1 22.2

Introduction Overview of Cartesian Grids Geometric Requirements of Cartesian Finite Volume Flow Solvers • Data Structures • Surface Geometry

22.3

Cartesian Volume Mesh Generation Overview • Volume Mesh Generation • Cell Subdivision and Mesh Adaptation • Body Intersecting Cells

22.4

Examples Steady State Simulations

Michael J. Aftosmis Marsha J. Berger John E. Melton

22.5

Research Issues Moving Geometry • NURBS Surface Definitions • Viscous Applications

22.6 Summary Appendix 1: Integer Numbering of Adaptive Cartesian Meshes

22.1 Introduction The last decade has witnessed a resurgence of interest in Cartesian mesh methods for CFD. In contrast to body-fitted structured or unstructured methods, Cartesian grids are inherently non-body-fitted; i.e., the volume mesh structure is independent of the surface discretization and topology. This characteristic promotes extensive automation, dramatically eases the burden of surface preparation, and greatly simplifies the reanalysis processes when the topology of a configuration changes. By taking advantage of these important characteristics, well-designed Cartesian approaches virtually eliminate the difficulty of grid generation for complex configurations. Typically, meshes with millions of cells can be generated in minutes on moderately powerful workstations [1, 2]. As the name suggests, Cartesian non-body-fitted grids use a regular, underlying, Cartesian grid. Solid objects are carved out from the interior of the mesh, leaving a set of irregularly shaped cells along the surface boundary. Since most of the volume mesh is completely regular, highly efficient and accurate finite volume flow solvers can be used. All the overhead for the geometric complexity is at the boundary, where the Cartesian cells are cut by the body. This boundary overhead is only two-dimensional, with typically 10–15% of the cells intersecting the body. Fundamentally, Cartesian approaches exchange the case-specific problem of generating a body-fitted mesh for the more general problem of intersecting hexahedral cells with a solid geometry. Fortunately, the geometry and mathematics of this problem have been thoroughly studied, and robust algorithms are available in the literature of computational geometry and computer graphics [25,53,38,41]. Although Cartesian grid methods date back to the 1970s, it was only with the advent of adaptive mesh refinement (AMR) that their use became practical [11]. Without some provision for grid refinement,

©1999 CRC Press LLC

FIGURE 22.1

Cartesian grid for an F16Xl.

Cartesian grids would lack the ability to efficiently resolve fluid and geometry features of various sizes and scales. This resolution is readily incorporated into structured meshes via grid point clustering. Many algorithms for automatic Cartesian grid refinement have, however, been developed in the last decade, largely alleviating this shortcoming. Figure 22.1 illustrates a typical grid with refinement for discretizing the flow around the General Dynamics F16XL. Early work with Cartesian grids used a staircased representation of the boundary. In contrast, modern Cartesian grids allow planar surface approximations at walls, and some even retain subcell descriptions of the boundary within the body-intersected cells. Obviously, this additional complexity places a greater burden on the flow solver, and recent research has focussed on developing numerical methods to accurately integrate along the surface boundaries of a Cartesian grid [3, 8, 9, 19, 26, 27]. The most serious current drawback of Cartesian grids is that their use is restricted to inviscid or low Reynolds number flows [28, 20]. An area of active research is their coupling to prismatic grids (see [11, 30, 36, 54, 50]) or other methods for incorporating boundary layer zoning into the Cartesian grid framework [20, 13]. A fairly extensive literature on the flow solvers developed for Cartesian grids with embedded adaptation is now available. This chapter therefore focuses on efficient approaches for Cartesian mesh generation. Section 22.2 contains an overview of Cartesian grids, including the geometric information needed by our finite volume flow solver, and a brief discussion of data structures. Most important are the surface geometry requirements for the volume mesh generator. Section 22.3 presents the details of the volume mesh generation,

©1999 CRC Press LLC

including the geometric adaptation criteria and the treatment of the cut cells. Section 22.4 contains a variety of examples of both Cartesian meshes and flow solutions. Section 22.5 includes a discussion of remaining research issues including approaches for viscous flow. For more thorough discussions of Cartesian mesh topics, see references [1, 33] or the alternative approaches documented in [15, 22, 43].

22.2 Overview of Cartesian Grids 22.2.1 Geometric Requirements of Cartesian Finite Volume Flow Solvers Cartesian grids pose some unique challenges to the design of efficient finite volume schemes, accurate surface boundary conditions, and associated data structures. While most of the cells in the volume mesh may be regular, cells at the boundary between refinement levels and cells that intersect the surface may have irregular neighbor connections and computational stencils. Nevertheless, a cell-centered finitevolume scheme is easily implemented as a summation of flux contributions from each of a cell’s faces:

∂ ˆ =0 qdV + ∑ f ⋅ ndS ∂t ∫ faces

(22.1)

where the flux, f , is computed using the normal vector nˆ and surface area dS associated with each face. For a simple first-order scheme, the contributions from the flow faces require the face area vector. More accurate approaches require the positions of the face and volume centroids. This level of geometric information is sufficient to support a linear reconstruction of the solution to the face centroid and a second-order midpoint rule for the flux quadrature. Since the cells of a Cartesian grid can intersect the surface geometry in a completely arbitrary way, general strategies for imposing the surface boundary conditions and computing the flux contributions from the surface faces must be devised. For inviscid flow simulations about solid objects, the surface pressure, normal direction, and area must be available to form the flux contribution from the solid face. Decisions about the surface representation within each mesh cell must therefore be made. Frequently, schemes utilize the average surface normal and surface area within each cut cell. Applying the divergence theorem to cell C and its closed boundary ∂C yields:

∫ (∇ • F)dV = ∫ (F ⋅ nˆ)dS ∂C

C

Substituting the vector function F = (1, 0, 0) yields an expression for nx, the x-component of the surface vector within cell C:

∫ n (dS) = A

x bodySurface

−x

− A+ x = nˆ x ⋅ ASurface

(22.2)

A–x and A+x are the exposed areas of the cell’s x-normal faces. This approach for determining the components of the average surface normal is consistent with the use of a zeroth-order (constant) extrapolation of the pressure to the surface. Improved accuracy requires at least a linear extrapolation of the pressure to the surface. Thus, volume centroids of the cut-cells and area centroids and normals of the individual surface facets within each cut-cell are required. Borrowing the terminology from Harten, we refer to this additional geometric data as subcell information [29]. Although the accuracy improvement that this provides is still being quantified, [9] the mesh generation algorithm described in this chapter is designed to extract this maximal level of geometric detail. The surface flux contributions are incorporated into the summation of Eq. 22.1 in a straightforward manner.

©1999 CRC Press LLC

The final piece of geometric information required for an accurate flow solution is provided by an algorithm for recognition and treatment of “split-cells,” i.e., those Cartesian cells that are divided into two or more disjoint regions by thin pieces of surface geometry. Without an accurate treatment of split cells, the effective chord of a thin wing may be reduced up to 15% due to an inadequate resolution of thin leading and trailing edges [33, 30]. Successive grid refinements could be used to resolve thin pieces of geometry. This approach, however, quickly becomes prohibitively expensive in three dimensions [34]. Although it complicates the mesh generation, it is far more economical to recognize split-cells during the grid generation process and subdivide a cell into its distinct and separate flow regions.

22.2.2 Data Structures Successful algorithms for Cartesian grid generation can be implemented using a variety of data structures. There are three predominant types usually encountered in the literature. The obvious first choice, suggested by the nested hierarchical nature of the grid itself, is to use an octree in 3D or quadtree in 2D [22, 19, 44, 40, 14] (See also Chapter 14). The connectivity of the tree also provides the information needed in a multigrid method. Although local refinement is easy to implement with this data structure, drawbacks to tree approaches include the difficulties of vectorizing (on vector architectures) and minimizing bandwidth to preserve locality (on cache-based machines). To avoid the tree traversal overhead, a mapping of leaf nodes to some other data structure is often used [45]. A second alternative is the use of block structured Cartesian meshes, typically associated with the adaptive mesh refinement (AMR) approach [10, 7, 11, 39, 43]. In this approach, cells at a given level of refinement are organized into rectangular grid patches, usually containing on the order of hundreds to thousands of cells per patch. This blocking process necessarily flags for inclusion some cells that do not need refinement. However, this overhead is typically less than 30% of the flagged cells in time dependent simulations. When the refinement stems from geometry alone, this number approaches 50% [6]. Nevertheless, the use of a structured array with prescribed connectivity permits an entire grid patch to be stored very compactly in approximately 20 words of memory. Offsetting this advantage is the fact that efficient schemes for patch-to-patch communication are relatively complex to program. The third alternative, and the one adopted throughout this chapter, is to use an unstructured data structure where the connectivity is explicitly stored with the mesh. The simplifications of using Cartesian grids lead to an extremely compact data structure. We use a face-based data structure, where the mesh is described by a list of cell faces that point to the Cartesian cells on either side. Adjacent cells at different levels of refinement (which can differ by at most one level) are incorporated into this structure by having the refined faces point to their respective finer cells on one side, and the same coarse cell on the other side. Despite the unstructured framework for this approach, the Cartesian nature of the hexahedra permit cell and face structures in the volume mesh to be stored with approximately 9 words per cell. This number increases to an average of 15 words per cell when including storage for the geometry and cut-cell information [2].

22.2.3 Surface Geometry Three-dimensional geometries can be specified in a variety of formats. Examples include proprietary CAD formats, trimmed NURBS, stereolithography formats, networks of grid patches, and others (see Part III). The mesh generation process begins by assembling the surface descriptions of each component into a configuration. Separate watertight triangulations of wings, fuselages, ailerons, and other components are then created and positioned relative to each other. The individual component triangulations need not be constrained to the intersection curves between components, and neighboring components are not required to have commensurate length scales. Once created, the components can be easily translated and/or rotated as necessary to quickly create new configurations. Adopting this componentbased approach greatly alleviates the CAD burden for studies of multiple component configurations. Overlapped components can create internal (unexposed) geometry, which greatly complicates surface operations in the volume mesh generator. In comparison to field cells, cells that intersect the surface

©1999 CRC Press LLC

geometry are much more expensive to generate, and when the geometry is in fact internal to another component, this expense is wasted. This inefficiency can be eliminated by preprocessing the component geometry to extract the wetted (exposed) surface of the entire configuration as follows. Taking as input the union of component descriptions, the triangulations are intersected against each other to produce a triangulation containing only the wetted surface of the configuration. The original component triangulations are therefore free to overlap in an arbitrary way, while the mesh generator ultimately receives only a triangulation of the wetted surface. While conceptually straightforward, the efficient implementation of such an intersection algorithm is delicate. The algorithm must be designed to perform a series of computational geometry operations: 1. Intersect the triangles from different components. 2. Retriangulate the intersected triangles, keeping the intersection line segments as constraints in the new triangulation. 3. Discard those triangles that are inside of other components. These steps will be discussed in detail in the following sections. A major criterion for the design of the preprocessor is the robust treatment of geometric degeneracies. In three dimensions, the vast majority of coding effort can be consumed by the special case handling required for perhaps less than 1% of the intersections [24,16]. The following presentation initially assumes that no degeneracies arise. This restriction is lifted in later sections, where a consistent algorithmic approach for treating degeneracies is discussed. The approach is automatic, and does not require special case coding. 22.2.3.1 Triangle Intersections The intersection of possibly hundreds of thousands of surface triangles requires an efficient algorithm for finding lists of candidate intersecting triangles. While a variety of spatial data structures return this list in log N time, where N is the number of surface triangles, a particularly attractive structure is the alternating digital tree (ADT)[12] (see also section 14.4.3 of Chapter 14). Although the ADT requires O(N log N) time to initially insert the triangles into the tree, the approach compares very favorably to brute force algorithms which can take O(N) time to find all the intersecting triangles for each cell. The size of the tree can be minimized by using simple bounding box checks on each component in the region of possible intersection to screen the triangles as they are inserted. If there is no possibility of a triangle in one component intersecting any other component, it is not inserted into the tree. For robustness, the intersection of two triangles is computed in two steps. First, the topological connectivity is determined using geometric primitives and robust arithmetic. This step treats the input triangles as “exact.” Once the logical connectivity has been established, the actual location of the intersection points of the two triangles is computed using (unreliable) floating-point arithmetic. For example, due to the limited precision of floating-point math, a constructed intersection point may actually lie slightly outside a triangle’s interior. To avoid robustness problems arising from such circumstances, these situations are resolved using the robustly computed logical connectivity. Triangle–triangle intersection is easily reduced to computing the intersection of line segments and triangles. One characterization is as follows: 1. Two edges of one triangle must cross the plane of the other. 2. There must be a total of two edges (of the available six) that pierce within the boundaries of the triangles. Both of these tests can be recast as the evaluation of the signed volume of a tetrahedron, where the points p, q, r, s are vertices of triangles in R3. The volume of a tetrahedron is

(

6V Tp,q ,r ,s

©1999 CRC Press LLC

)

p0 q 0 = r0 s 0

p1 q1

p2 q2

r1 s1

r2 s2

1 1 1 1

(22.3)

FIGURE 22.2 Constrained retriangulation of an intersected triangle divides it into regions that are completely interior and exterior to the flow.

For example, let triangle T1 have vertices {0,1,2} and let (a,b) be an edge of triangle T2. The edge intersects the plane of T1 if V(T0,1,2,a ) has a different sign than V(T0,1,2,b ). The edge intersects in the interior of T1 if V(Ta,1,2,b), V(Ta,0,1,b) and V(Ta,2,0,b) all have the same sign. Thus at most five determinant evaluations are done for each of the six triangle edges. Note that the only information needed from the evaluation of the determinant is its sign. Using the adaptive floating point precision package of [47], for example, this determinant can be computed reliably and quickly, even for degenerate cases where the determinant evaluates to exactly zero (indicating a degeneracy, see Section 22.2.3.4). Most of the time, the computation of the sign of the determinant can be done using ordinary floating-point arithmetic. This sign is valid, provided that it is larger than an error bound which is computed using knowledge of the properties guaranteed by the IEEE floating-point arithmetic standard [48,1]. Only if the error bound exceeds the computed value of the determinant does a more accurate evaluation need to done using an adaptive-precision floating-point library (see [41 or 47]). After the existence of an intersection is robustly established, the algorithm uses the usual floating-point arithmetic to construct the actual location of the intersection point. 22.2.3.2 Constrained Retriangulation The result of the preceding intersection step is a list of line segments linked to each intersected triangle. These segments divide the intersecting triangles into polygonal regions that are either completely inside or outside the body. In order to remove the portions of the triangles that are interior, we first triangulate the polygonal regions, treating the original intersection segments as constraints, and then discard those triangles lying inside the body. In an effort to maintain well-behaved triangles, we use a constrained Delaunay triangulation algorithm to maximize the minimum angles produced [55] (see Chapter 16). References [17, 21, 49] give two different approaches for generating a constrained triangulation. Figure 22.2 shows two polygonal regions decomposed into sets of triangles. The constraints from the original component intersections are highlighted. 22.2.3.3 Inside/Outside The final step in the intersection process is the classification of the resulting set of triangles into those that are either internal to the geometry or exposed and on the wetted surface of the configuration. The algorithm for inside/outside classification is also used during volume mesh generation and is presented in Section 22.3.2.3.

©1999 CRC Press LLC

22.2.3.4 Automatic Treatment of Degeneracies The preceding discussion assumed that the input geometry was free from degenerate data. In other words, the determinants in Section 22.2.3.1 always evaluate to a non-zero number. However, degeneracies are common in input geometry, and most of the complication in the grid generation arises from such cases [16]. For example, if four input points are exactly co-planar, the determinant in Eq. 22.3 will return exactly zero. For an algorithm to be robust, such degeneracies must be resolved in a consistent manner[58, 57]. One approach toward uniform treatment of degenerate geometry is offered by simulation of simplicity which is a method of virtual displacements [24]. The idea is that all data points pk can be thought of as being perturbed by εk, where ε is large enough to break all degeneracies but small enough to not perturb the general data. As long as all determinant evaluations use this same perturbation, this tie-breaking algorithm consistently resolves degeneracies by reporting the sign of the perturbed determinant as positive or negative. By basing it on the global index of a node, the perturbation is consistent across all points in the geometry. The tie-breaking is implemented as follows. When evaluating determinants, if det (T) = 0, the more complicated determinant det(T + E) is evaluated, where E is a perturbation matrix given by

( E )i , j = ε i , j = ε 2 , 1 < j < d , δ ≥ d iδ − j

(22.4)

and i denotes the index of the point, i ∈ { 0, … ,( V – 1 ) }, and d is the spatial dimension (d = 3 for triangles in R3). Eq. 22.3 is an asymptotic expansion of the determinant in powers of an infinitesimal parameter ε. Note that the perturbations εi, j are virtual; the geometric data itself is never altered. The first non-zero term in the asymptotic expansion of the determinant gives the sign of the determinant. As a simple two dimensional example, let T and E be the 2 x 2 matrices

a0 T= b0

a1 ε 1 2 , E = 2 b1 ε

ε1 4 ε1

(22.5)

Then

det (T + E ) = det(T ) + ( − b0 )ε 1 4 + (b1 )ε 1 2 + (a0 )ε + ε 3 2 + ( − a1 )ε 2 + ( −1)ε 9 4

(22.6)

The fifth term in the expansion has a coefficient of 1. Thus, if each of the first four terms evaluate to 0, the sign of the result would be taken to be positive. In three dimensions there are 15 possible terms in the expansion that generalizes Eq. 22.6 before a constant term is reached (the sign of which conclusively establishes the sign of the original determinant). In practice, rarely are more than two or three terms evaluated before a non-zero coefficient is found. The virtual perturbation computations can be easily incorporated into the low-level subroutine which evaluates the determinant in Eq. 22.3.

22.3 Cartesian Volume Mesh Generation 22.3.1 Overview Cartesian mesh generation is ostensibly a simple task, where the only complications stem from the presence of body-cut cells and refinement boundaries. Since these occur as lower-dimensional features, the vast majority of the cells in the final mesh are regular, non-body-intersecting, Cartesian hexahedra. Since generation of uniform Cartesian cells is extremely fast, the performance of the overall algorithm

©1999 CRC Press LLC

FIGURE 22.3

Cartesian mesh with Mj total divisions in each direction discretizing the region from x0 or x1.

depends directly on the treatment of cut-cells and the scheme used for adaptive refinement. The following discussions place special emphasis on the performance of the algorithms for generating large numbers (106–108) of cells. Wherever possible, the methods seek to maintain linear or logarithmic time complexity so that the expense of generating the volume mesh is not dominated by poor algorithmic performance on lower-dimensional collections of cells. This section begins by highlighting the important algorithms for volume mesh generation, including the detection of cells which lie within solid portions of the geometry and the geometric criteria for cell division. Note that in addition to geometric refinement, flow-field refinement is possible, and in fact, essential. Finally, a variety of algorithms are presented which permit very rapid computation of the geometric information necessary to describe the body-cut cells themselves.

22.3.2 Volume Mesh Generation The mesh generation process begins with an initial coarse mesh (or even a single cell) covering the domain of interest. This mesh is then repeatedly subdivided to resolve the boundary of the geometry. After each refinement, cells which lie completely inside the body are removed from the mesh. Only when the generation of the volume mesh is complete does the algorithm compute the details of the cut-cell intersections with the surface geometry. Adopting this strategy decouples operations within the bodycut cells from the volume mesh generation process. 22.3.2.1 Initial Mesh Specification and Integer Coordinates Figure 22.3 shows an example of a coordinate aligned Cartesian mesh defined by its minimum and maximum coordinates x o and x 1 . This region is subdivided with Mj possible coordinates in each dimension, j = { 0, 1, 2 } . Thus, each node in the mesh may be specified exactly by the integer vector, i , and the Cartesian coordinates, x i , of any allowable location in this mesh are reconstructed when needed from

xi j = x 0 j +

©1999 CRC Press LLC

(

ij x1 − x0 j Mj j

)

(22.7)

FIGURE 22.4 List of triangles associated with children of a cut-cell may be obtained using ADT, or by exhaustively searching over the parent cell’s triangle list.

The use of integer coordinates makes it possible to unambiguously compare vertex locations and leads to compact storage schemes. These properties make integer numbering schemes particularly attractive for the construction of Cartesian meshes. Appendix 1 of this chapter provides details of one such integer numbering scheme which is amenable to adaptively refined Cartesian meshes. This scheme is extremely compact and provides all geometric information and cell-to-vertex pointers with only 96 bits per cell. 22.3.2.2 Efficient Spatial Searches Assume that the intersection algorithm of Section 22.3 returns a set of triangles {T} that describe the wetted surface of the configuration. If the NT surface triangles in {T} are inserted into a efficient spatial data structure such as an ADT, then locating the subset {Ti} of triangles actually intersected by the i th Cartesian cell will have complexity proportional to log (NT). When a cell is subdivided, a child cell inherits the triangle list of its parent. As the mesh subdivision continues, the triangle lists connected to a surface intersecting (“cut”) Cartesian cell will get shorter by approximately a factor of 4 with each successive subdivision. Figure 22.4 illustrates the passing of a parent cell’s triangle list to its children. This observation implies that there is a machine dependent crossover beyond which it becomes faster to simply perform an exhaustive search over a parent cell’s triangle list rather than perform an ADT lookup to get a list of intersection candidates for cell i. This is easy to envision, since all of the triangles that are linked to a child cut-cell must have originally been members of the parent cell’s triangle list. If a parent cell intersects only a very small number of triangles, then there is no reason to perform a full intersection check using the ADT. The crossover point is primarily determined by the number of elements in NT and the processor’s data cache size. 22.3.2.3 Inside/Outside Determination A body-intersecting parent cell may find that some of its children cells lie completely inside the body. These cells must be identified and removed from the mesh. Determination of a cell’s status as “flow” or “solid” is a specific application of the point-in-polyhedron problem that is frequently encountered in computational geometry. Figure 22.5 illustrates two common containment tests for a cell q and a simply connected polygon P. On the left side of the sketch, the winding number [25] is computed by completely traversing the closed boundary P from the perspective of an observer located on cell q, and keeping a running total of the signed angles between successive polygonal edges. As shown in the left of the sketch, if q ∉ P then the positive angles are erased by the negative contributions, and the total angular turn is identically zero. If, however, q ∈ P , then the winding number is 2π. The alternative to computing the winding number is to use a ray-casting approach based on the Jordan Curve Theorem. As indicated in the right sketch of Figure 22.5, one casts a ray, r, from q and simply counts the number of intersections of r with ∂ P. If the point lies outside, q ∉ P , this number is even; if the point is contained, q ∈ P , the intersection count is odd.

©1999 CRC Press LLC

FIGURE 22.5 Illustration of point-in-polygon testing using the (left) winding number and (right) “ray-casting” approaches for determining if q is inside or outside of P.

While both approaches are conceptually straightforward, they are considerably different computationally. Computation of the winding number involves floating-point computation of many small angles, each of which is prone to round-off error. The running sum will make these errors cumulative, increasing the likelihood of robustness pitfalls. In addition, the method answers the topological question “inside or outside?” with a floating-point comparison. By contrast, the ray-casting algorithm poses the inside/outside question in topological terms (i.e., “Does it cross?”). The ray-casting approach fits well within the search and intersection framework developed earlier. Let point q lie on any nonintersected cell in the domain. Then assume r is cast along a coordinate axis (+x for example) and truncated just outside the +x face of the bounding-box for the entire configuration. This ray may then be represented by a line segment from the test point (q0, q1, q2) to ( ∂Ω x + e, q 1, q 2 ) and the problem reduces to that of finding a list of intersection candidates for the segment–triangle intersection algorithm as in Section 22.2.3.1. The tree returns the list of intersection candidates while the signed volume in Eq. 22.3 checks for intersections. Counting the number of such intersections determines a cell’s status as inside or outside. Using a spatial data structure like an ADT to return the list of intersection candidates for r makes it possible to identify this list in a time proportional to log (NT). In addition, computing intersections between the Cartesian cells and surface triangulation via signed volume computations opens the possibility of utilizing exact arithmetic and generalized tiebreaking algorithms from Section 22.2.3.4 to address issues of robustness. 22.3.2.4 Neighborhood Traversal The ray casting operation in the preceding section takes log (NT) time. However, it is common to have to perform the in/out test on potentially large lists of Cartesian cells. A painting algorithm makes it possible to avoid casting as many rays as there are cells. Such an algorithm traverses a topologically connected set of cells while passing the status (“flow/solid”) of one cell to other cells in its neighborhood. Some details of such an algorithm are presented in [1], where it is demonstrated that mesh traversal may be accomplished with a linear time bound. These techniques make it possible to cast only as many rays as there are topologically disjoint regions of cells.

22.3.3 Cell Subdivision and Mesh Adaptation Cell subdivision may be triggered by either geometric or flow field requirements. While a variety of sources document various strategies for solution adaptive refinement (see for example [3]), no discrete solution is available during the initial mesh generation. This section therefore focuses on geometry-based adaptation strategies. All surface intersecting Cartesian cells in the domain are initially automatically refined a specified number of times (Rmin)j. Typically this level is set to be four divisions less than the maximum allowable number of divisions (Rmax)j in each direction. Anytime a cut-cell is tagged for division, the refinement must be propagated several (usually 3–5) layers into the mesh using a “buffering” algorithm that operates by sweeps over the faces of the cells. Buffering is required to maintain mesh smoothness and avoid corruption of the difference stencil in the immediate vicinity of the body.

©1999 CRC Press LLC

FIGURE 22.6 (a) Measurement of the maximum angular variation within cut-cell i, (b) measurement of the angular variation between adjacent cut-cells.

Further refinement is based upon a curvature detection strategy similar to that originally presented in f This is a two-pass strategy which first detects angular variation of the surface normal, , within nˆ each cut cell and then examines the average surface normal behavior between adjacent cut cells. Taking k as a running index to sweep over the set of triangles {Ti}, let V j represent the jth component of the vector subtraction between the maximum and minimum components of the normal vectors in each Cartesian direction:

( )

( )

Vj = max k n j − min k n j

∀k ∈ {Ti }.

(22.8)

The direction cosines of V then provide a measure of the angular variation of the surface normal within cell i.

( )

cos θ ji =

Vj V

(22.9)

Similarly, (φ j)r,s measures the j th component of the angular variation of the surface normals between any two adjacent cut cells r and s. With nˆ i denoting the average unit normal vector within any cut cell i, the components of f r, s are

( )

cos φ j

r ,s

=

n jr − n js nˆr − nˆs

.

(22.10)

If θ j or φ j in any cell exceeds a preset angle threshold, the offending cell is tagged for subdivision in direction j. Figures 22.6a and 22.6b illustrate the construction of φ and θ in two dimensions. Obviously, by varying these thresholds, one may control the number of cut-cells that are tagged for geometric refinement. When both thresholds are identically 0˚, all the cut cells will be tagged for refinement, and when they are 180˚ only those at sharp cusps will be tagged. Reference [1] presents an exploration of the sensitivity to variation of these parameters for angles ranging from 0˚ to 179˚ on several example configurations. In practice, both of these thresholds are generally set at 20˚.

22.3.4 Body Intersecting Cells In three dimensions, the surface triangulation will cut arbitrarily through the body intersecting Cartesian cells. The resulting intersections can therefore be quite complex. We can begin to understand the details of such an intersection by considering the generic cut-cell illustrated in Figure 22.7. The abstraction shown in the sketch presents a single cut-cell, c, which is linked to a set {Tc } of four triangles (T0 – T3) that compose the small swatch of the configuration’s surface triangulation intersected by the cell. Since both the Cartesian cell and the triangles are convex, the intersection of each triangle with the cell produces

©1999 CRC Press LLC

FIGURE 22.7

Anatomy of an abstract cut-cell.

a convex polygon referred to as a triangle-polygon, tp. Edges of the triangle-polygons are formed by the clipped edges of the triangles themselves, and the face-segments, fs, that result from the intersection of the triangles with the faces of the Cartesian cell. On the Cartesian cells themselves, these segments lead to face-polygons, fp, which consist of edges from the Cartesian cell and the face segments from the triangleface intersection. Note that triangle-polygons are always convex, while face-polygons may not be (e.g., face-polygons fp0,1, fp5,0, and fp5,1 in Figure 22.7). Clearly, these intersections may become very complex. It is easy to envision the pathological case where an entire configuration intersects only one or two Cartesian cells, creating tens of thousands of triangle polygons. Thus, an efficient implementation is of paramount importance. Many of the algorithms for efficiently constructing this geometry rely on techniques from the literature on computer graphics and are highly specialized for use with coordinate aligned regions [18, 51]. In principle, similar methods could be adopted for non-Cartesian hexahedra, or even other cell types; however, speed and simplicity would be compromised. Since rapid cut-cell intersection is an important part of Cartesian mesh generation, we present a few central operations in detail. 22.3.4.1 Rapid Intersection with Coordinate Aligned Regions Figure 22.8 shows a two-dimensional Cartesian cell c that covers the region [ c, d ] . The points (p, q,...,v) are assumed to be vertices of c’s candidate triangle list Tc. Each vertex is assigned an “outcode” associated with its location with respect to cell c. This code is really an array of flags which has a “low” and a “high” bit for each coordinate direction, [ lo 0, hi 0, …, lo d – 1, hi d – 1 ] . Since the region is coordinate aligned, a single inequality must be evaluated to set each bit in the outcode of the vertices. Points inside the region, [c, d], have no bits set in their outcode. Using the operators & and | to denote bitwise applications of the “and” and “or” Boolean primitives, candidate edges (like rs) can be trivially rejected as not intersecting cell c if: outcoder & outcodes ≠ 0

(22.11)

This reflects the fact that the outcodes of both r and s will have their low x bit set, thus neither point can be inside the region. Similarly, since (outcodet | outcodev) = 0, the segment tv must be completely contained by the region [c, d] in Figure 22.8. If all the edges of a triangle, like ∆tuv , cannot be trivially rejected, then there is a possibility that it intersects the 0000 region. Such a polygon can be tested against the face-planes of the region by ©1999 CRC Press LLC

FIGURE 22.8

outcode and facecode setup of coordinate aligned region [c, d] in two dimensions.

constructing a logical bounding box (using a bitwise “or”) and testing against each facecode of the region. In Figure 22.8, testing

(

facecode j & outcodet outcodeu outcodev

)

∀j ∈ {0,1, 2,..., 2 d − 1}

(22.12)

produces a non-zero result only for the 0100 face. In Eq. 22.12, the logical bounding box of ∆tuv is constructed by taking the bitwise “or” of the outcodes of its vertices. Once a constructed intersection point, such as p´ or t´, is computed, it can be classified and tested for containment on the boundary of [c, d] by an examination of its outcode. However, since these points lie degenerately on the 01XX boundary, the contents of this bit may not be trustworthy. For this reason, we mask out the questionable bit before examining the contents of these outcodes. Applying “not” in a bitwise manner yields

(outcode

p′

(outcodet ′

)

& ( ¬facecode1 ) = 0 while

)

& ( ¬facecode1 ) ≠ 0

(22.13)

which indicates that t´ is on the face, while p´ is not. There are clearly many alternative approaches for implementing the types of simple queries that this section describes. However, an efficient implementation of these operations is central to the success of a Cartesian mesh code. The bitwise operations and comparisons detailed in the proceeding paragraphs generally execute in a single machine instruction making this a particularly attractive approach. Further discussion of the use of outcodes may be found in [18]. 22.3.4.2 Polygon Clipping With the fast spatial comparison operators in the previous section outlined, we are ready to construct the triangle-polygons and face-segments that describe the surface within the Cartesian cell. The trianglepolygons (tp0 – tp4) in Figure 22.7 are the regions of the triangles that lie within the cut-cells. Thus, extraction of the triangle-polygons is properly thought of as a clipping operation performed on each triangle. The term “clipping” refers to a process where one object acts as a “window” and we compute the parts of a second object visible through this window [25]. Numerous algorithms have been proposed for the clipping of an object against a rectangular or cubical window [32,37]. In this section we apply an algorithm

©1999 CRC Press LLC

FIGURE 22.9 Illustration of divide-and-conquer strategy of Sutherland–Hodgman polygon clipping.The problem is recast as a series of simpler problems in which a polygon is clipped against a succession of infinite edges.

due to Sutherland and Hodgman for clipping against any convex window [51]. While slightly more general than is absolutely necessary, this algorithm has the attractive property that the output polygon is kept as an ordered list of vertices. The asymptotic complexity of this clipping algorithm is O(pq), where p is the degree of the clip window and q is the degree of the clipped object. While this time bound is formally quadratic, p for a 3D Cartesian cell is only 6, and the fast intersection checks of the previous section permit very effective filtering of trivial cases. The Sutherland–Hodgman algorithm adopts a divide-and-conquer strategy that views the entire clipping operation as a sequence of identical, simpler problems. In this case the process of clipping one polygon against another is transformed into a sequence of clips against an infinite edge. Figure 22.9 illustrates the process for an arbitrary polygon clipped against a rectangular window. The input polygon is clipped against infinite edges constructed by extending the boundaries of the clip window. The algorithm is conveniently implemented as two nested loops. The outer loop sweeps over the clipborder (cell faces in 3D), while the inner is over the edges of the polygon. In our application to the intersected triangles, the initial input polygon is the triangle T, and the clip-window is the cut Cartesian cell. Implementation of the algorithm requires testing of the input triangle’s edges against the clip region, so it is useful to combine this algorithm with the outcode flags discussed in the previous section. Figure 22.10 illustrates the clipping problem (in 2D) for generating the triangle-polygons shown in the view of an abstract cut-cell in Figure 22.7. In Figure 22.10, the triangle T is formed by the set of directed edges, v 1 v 0 , v 2 v 1 , and v 0 v 2 , and the clipped polygon, tp, is a quadrilateral. As the edges of the input polygon are processed by each clip-boundary the output polygon is formed according to a set of four rules. For each directed edge in the input polygon we denote the vertex at the origin of the edge as “orig” and the vertex of the destination as “dest.” “IN” implies that the test vertex is on the same side of the clip-boundary as the clip-window. We may test for this by examining the outcode of each vertex, and comparing to the facecode of the current-clip boundary. A test vertex is “IN” if its outcode does not have the bit associated with the facecode of the clip-boundary set, while “OUT” implies that this bit is set. Using the bitwise operators from the previous section, if (facecode(clip - boundary) & outcode( vertex) = 0) then IN

if (facecode(clip - boundary) & outcode( vertex) ≠ 0) then OUT

©1999 CRC Press LLC

(22.14)

FIGURE 22.10 Setup for clipping a candidate triangle T, against a coordinate aligned region and extracting the clipped triangle, tp.

TABLE 22.1

Rules for Sutherland–Hodgmen Polygon Clipping

Case

Origin

Destination

SH.1 SH.2 SH.3 SH.4

IN IN OUT OUT

IN OUT OUT IN

Action Add dest to the output polygon. Add intersection of edge and clip-boundary to the output polygon. Do nothing. Add both intersection and dest to output polygon.

With these definitions, the output polygon is constructed by traversing around the perimeter of the input polygon and applying the following rules to each edge. Table 22.1 summarizes the actions of the Sutherland–Hodgman algorithm. Notice that both SH.2 and SH.4 describe cases where the edge of the input polygon crosses the clipboundary. In both of these cases, we must add the point of intersection of the edge with the clip-boundary to the output polygon. This point may be almost trivially constructed since the clip-boundary is coordinate aligned. For the example in Figure 22.10, the constructor for point p, which is the intersection of edge v 2 v 1 with the right side of the clip-boundary, reduces to

r r r r p = v1 + α (v2 − v1 )

(22.15)

where α is simply the distance fraction in the horizontal coordinate of the clip boundary between vertices v1 and v2. Returning to the cut-cell shown in Figure 22.7, we note that the face-segments are the edges of the triangle-polygons (just created) that result from a clip. The face-polygons are formed by simply connecting loops of cut-cell edges with these face-segments. Thus, all the necessary elements of the cut-cell have been constructed. Since the Sutherland–Hodgman algorithm was originally developed for window clipping in computer graphics, both hardware and software versions of it are available on many platforms. Thus, on platforms with advanced graphics hardware, it is frequently possible to make direct calls to the hardware clipping routines to perform the polygon clipping discussed in the preceding paragraphs. Such hardware implementations typically execute tens to hundreds of times faster than software implementations. Similarly, many of the fast bitwise comparisons in the previous section are often available as hardware routines. Figure 22.11 shows an example of the intersection between the body-cut Cartesian cells and the surface triangulation of a high wing transport configuration. In this case approximately 500,000 cells in the Cartesian mesh intersected the surface triangulation. The figure shows a view of the port side of the

©1999 CRC Press LLC

FIGURE 22.11 Triangle-polygons on surface of high wing transport configuration resulting from intersection of body-cut Cartesian cells with surface triangulation.

aircraft and two zoom-boxes with successive enlargements of the triangle-polygons resulting from the intersection. In this example, the triangle-polygons themselves have been triangulated before plotting. This example contained about 2.9M cells in the full Cartesian mesh.

22.4 Examples 22.4.1 Steady State Simulations Cartesian grids generated automatically about complex geometries are, of course, only useful if those same grids are suitable for engineering analysis. In this section, numerous examples of complex grids and their associated steady and unsteady flow field solutions are discussed in order to demonstrate that non-body-fitted Cartesian methods are indeed suitable for a variety of demanding applications. 22.4.1.1 ONERA M6 The flow field about the ONERA M6 wing was computed at the standard test conditions of Mach 0.84 and α = 3.06˚[4, 46]. The cells in the original mesh were subdivided up to nine times, resulting in a total of 1.2 million cells. The left frame in Figure 22.12 shows an isometric view of this final mesh, including the symmetry plane and portions of the mesh at three outboard stations, while the frame at the right contains the corresponding surface and flow field isobars. Figure 22.13 compares computed pressure distributions for this wing at five locations along the span with experimental data [46]. As is typical of other high-resolution Euler computations for this case, these solutions overpredict the strength of the main shock, but in general, the pressure distributions compare well with those presented by other researchers. Additional information about these computations is presented in [33]. The lift and drag coefficients for this case were 0.275 and 0.0128, respectively.

©1999 CRC Press LLC

FIGURE 22.12 α = 3.06°.

Adapted mesh and computed isobars for inviscid flow over an ONERA M6 wing at Mach 0.84 and

FIGURE 22.13

Cp vs. x/c at 2y/b = 0.2, 0.4, 0.65, 0.8, and 0.95.

22.4.1.2 Examples with Complex Geometry The next four examples of Cartesian grids and steady-state simulations illustrate the geometric complexity that is now routinely simulated with Cartesian methods. Designers, project engineers, and other nonCFD-experts must often repeatedly analyze realistic configurations such as these in order to improve aerodynamic performance. The level of automation attainable with Cartesian approaches makes them particularly attractive for time-critical applications. Figure 22.14 shows a Cartesian mesh with 5.81 M cells discretizing the space around a McDonnell Douglas Apache attack helicopter. The configuration is composed of 320,000 triangles describing 85 separate components, including armaments, wing stores, night-vision equipment, and avionics packages. The surrounding flow field mesh was generated in 320 seconds on a moderately powerful engineering workstation (MIPS 195 Mhz R10000 CPU). The only user inputs to the mesh program were the dimensions of the bounding box of the outer domain, a clustering parameter that controls the refinement on

©1999 CRC Press LLC

FIGURE 22.14 Left: Cartesian mesh for attack helicopter configuration with 5.81 M cells. Right: Close-up of mesh through left wing and stores.

FIGURE 22.15 Isobars resulting from inviscid flow analysis of attack helicopter configuration computed on mesh with 1.2 M cells.

the surface, and a target number of cells in the final mesh. Figure 22.15 displays the computed isobars on this same configuration on a coarser mesh of approximately 1.2 M cells. Figure 22.16 shows two views of a mesh generated after positioning three F-15 aircraft in formation with the Apache helicopter. The helicopter is offset from the axis of the lead fighter to emphasize the asymmetry of the mesh. Each fighter has flow-through inlets and is described by 13 individual component triangulations and 201,000 triangles. After surface preprocessing, the entire four-aircraft configuration contained 121 components described with 683,000 triangles. The lower frame in Figure 22.16 shows portions of three cutting planes through the mesh and geometry, while the upper frame shows one cutting plane at the tail of the rear two aircraft, and another just under the helicopter geometry. The final mesh includes 5.61 M cells, and required a maximum of 365 Mb to compute. Mesh generation time was approximately 6 minutes and 30 seconds on a workstation with a MIPS 195 Mhz R10000 CPU. 22.4.1.3 Transport Aircraft with High-Lift System Deployed Figure 22.17 shows the mesh and flow field about a high-wing transport (HWT) aircraft with its highlift devices deployed in a landing configuration. The aircraft was composed of 18 components and a total of 700,000 triangles. This solution contained approximately 1.7 million cells and had ten levels of cell refinement. Flowfield adaptation was triggered by a simple criterion formed from the undivided first difference of density. At a low subsonic Mach number and a moderate angle of attack, this indicator

©1999 CRC Press LLC

FIGURE 22.16 Cutting planes through mesh of multiple aircraft configuration with 5.61 M cells and 683,000 triangles in the triangulation of the wetted surface.

targets refinement of the suction peaks on the leading edge slat and main element, as well as the inviscid jet through the flap system. Despite the fact that this simulation is inviscid, the sharp outboard corner of the flap has correctly spawned a flap vortex, which is evidenced by the twisting stream ribbon in the figure. Additional information about the solution can be found in [3].

22.5 Research Issues 22.5.1 Moving Geometry Developments in several directions would greatly extend the applicability of Cartesian grid methods. The most obvious extension is to applications involving moving and/or deforming geometry. A very successful first step in this direction was demonstrated in two space dimensions in [5]. The sequence in Figure 22.18 shows a jet-powered projectile in a quiescent stream that penetrates a deformable shell structure. A simple fracture model was used in calculating the deformation of the shell.

22.5.2 NURBS Surface Definitions The mesh generation method presented in this chapter requires component surface triangulations as input geometry. Basing the method on simplicial geometry such as this has many advantages, since the

©1999 CRC Press LLC

FIGURE 22.17 HWT example with high-lift system deployed. The mesh contains 1.65 M cells at 10 levels of refinement. The mesh is presented by cutting planes at 3 spanwise locations, and the cutting plane on the starboard wing is flooded by isobars of the discrete solution.

input geometry is known explicitly to a specified level of precision. Extending the methodology to accept alternative descriptions of the input geometry would further simplify and improve the analysis process. For example, it would be convenient and expedient to work with a geometry format native to current CAD/CAM systems, such as the NURBS description of the geometry [23] (see Part III). This approach was investigated in [35]; however, the need to compute non-linear intersections of splines and Cartesian hexahedra at each step made the procedure extremely expensive. The NURBS representation of a geometry can be extremely flexible, and an ability to work directly from it would eliminate any errors due to the surface faceting inherent in triangulations.

22.5.3 Viscous Applications Finally, the ability to capture boundary layers with a nonisotropic refinement strategy will be necessary for this method to be applicable to high Reynolds number viscous flows. A very interesting but not entirely successful first attempt at combining Cartesian data structures with variable boundary layer zoning is presented in [20]; however, the mesh was too irregular to accurately compute the viscous terms using simple stencils. Other approaches currently under investigation use either integral boundary layer models or hybrid grids (see Chapter 23) that combine a near-body fitted grid and a background Cartesian grid [56, 54]. Although this latter approach only needs a small region around the body to have a viscous grid, this severely compromises the automation of the Cartesian approach since it effectively couples the surface discretization with part of the volume mesh. Developments in these directions will have a great impact in extending the usefulness of Cartesian grids.

©1999 CRC Press LLC

FIGURE 22.18 Density contours and adapted quadtree grids showing a time history of a projectile penetration problem. (Powell, K., von Karman Institute for Fluid Dynamics, Lecture Series 1994-05, Rhode-Saint-Genèse, Belgium, March 1996. With permission.)

22.6 Summary The adaptive Cartesian mesh approach demonstrates great potential for dramatically accelerating the routine inviscid analyses of complex configurations. Many of the advantages of Cartesian grids arise from the independence of the surface description from the flow field discretization and the resultant ease and speed with which grids can be generated. Incorporating a component-based Cartesian approach also streamlines the surface definition process. New configurations can be quickly assembled from libraries of existing components, and individual components can be easily repositioned using simple transformations. Additionally, conventional inviscid finite volume flow solver schemes can be straightforwardly modified and implemented on Cartesian grids. Although many of the geometric algorithms described in this chapter have their roots in the fields of computer graphics and computational geometry, they are well-suited for robust Cartesian grid generation. With appropriate attention to algorithmic complexity and careful programming, the resulting codes can be designed to run extremely efficiently on current workstations. By taking full advantage of the natural simplicity of Cartesian grids, a fast, automated, robust, and low-memory grid generation scheme can be developed.

Appendix 1: Integer Numbering of Adaptive Cartesian Meshes Figure 22.A.1 shows a model of the jth direction of a Cartesian mesh covering the region [ x 0, x 1 ] . As shown in the sketch, specifying the domain with x0 and x1 and the initial partitioning by Nj uniquely identifies a set of possible Cartesian cell locations in this region. Each additional refinement increases the maximum integer coordinate by a factor of 2(Nj – 1). This relationship suggests a natural mapping to a system of integer coordinates. If one defines a maximum number of permissible cell divisions in this

©1999 CRC Press LLC

FIGURE 22.A.1 Specification of integer coordinate locations for a coordinate direction with Nj prescribed boundaries.

direction, Rmaxj, then any point in such a mesh can be uniquely located by its integer coordinates (i0, i1, i2). Allocating m bits of memory to store each integer ij, the upper bound on the permissible total number of vertices in each coordinate direction becomes 2m. Figure 22.A.1 demonstrates that on a mesh with Nj prescribed nodes, performing Rj cell refinements in each direction will produce a mesh with a maximum integer coordinate of 2 Rj ( N j – 1 ) + 1 which must be resolvable in m bits.

2

Rj

( N − 1) + 1 ≤ 2

m

j

(22.A.1)

Thus, the maximum number of cell subdivisions that can be addressed by a set of m-bit integer coordinates is

( Rmax ) j = log2 (2 m − 1) − log2 ( N j − 1)

(22.A.2)

where the floor “ ” indicates rounding down to the next lower integer. Substituting back into Eq. 22.A.1 gives the total number of vertices we can address in each coordinate direction using m-bit integers and with Nj prescribed nodes in the direction.

Mj = 2

Rmax j

( N − 1) + 1 j

(22.A.3)

Thus, the floor in Eq. 22.A.2 ensures that Mj can never exceed 2m. The mesh in Figure 22.A.3 is an illustration of this numbering scheme in three dimensions. The examples in this chapter use up to m = 21 bits per direction, which provides over 2.1 × 106 addressible locations in each coordinate direction. This choice has the advantage that all three indices may then be packed into a single 64-bit integer for storage*. *This is a choice of convenience. All three integer coordinates may, of course, be sorted separately, permitting 264 – 1 = 1.84 × 1019 addressible locations using 64-bit integers.

©1999 CRC Press LLC

FIGURE 22.A.2

Vertex numbering within a cell. Square brackets [-] indicate crystal directions.

Cell-to-Node Pointers Figure 22.A.2 gives an example of the vertex numbering within an individual Cartesian cell. This system has been adopted by analogy to the study of crystalline structures specialized for cubic lattices [52]. Within this framework, the cell vertices are numbered with a boolean index of 0 (low) or 1 (high) in each direction. Following this ordering, Figure 22.A.2 shows the crystal direction of each vertex in square brackets (with no commas). Reinterpreting this 3-bit pattern as an integer yields a unique numbering scheme (from 0 to 7) for each vertex on the cell. For any cell i, V 0 is the integer position vector ( V 00 , V 01 , V 02 ) of its vertex nearest to the x0 corner of the domain. Knowing the number of times that cell i has been divided in each direction, Rj, one may express its other 7 vertices directly.

V1 V2 V3 V4 V5 V6 V7

= = = = = = =

V0 V0 V0 V0 V0 V0 V0

+ + + + + + +

( 0, ( 0, ( 0, Rmax 0 − R0 (2 , (2 Rmax 0 − R0 , (2 Rmax 0 − R0 , (2 Rmax 0 − R0 ,

0, Rmax1 − R1 2 , Rmax1 − R1 2 , 0, 0, Rmax1 − R1 2 , Rmax1 − R1 2 ,

2 Rmax 2 − R2 ) 0) Rmax 2 − R2 2 ) 0) 2 Rmax 2 − R2 ) 0) Rmax 2 − R2 2 )

(22.A.4)

Since the powers of two in this expression are simply a left shift of the bitwise representation of the integer subtraction R max j – R j , vertices V 1 through V 7 can be computed from V 0 and Rj at very low cost. In addition, the total number of refinements in each direction will be a (relatively) small integer, thus it is possible to pack all three components of R into a single 32-bit word.

Acknowledgment This work was supported in part by NASA Ames Research center, by DOE Grants DE-FG02-88ER25053 and DE-FG02-92ER25139, and by AFOSR grant F49620-97-0322. Thanks also to RIACS, whose support of Dr. M. Berger is gratefully acknowledged.

©1999 CRC Press LLC

References 1. Aftosmis, M.J., Solution adaptive cartesian grid methods for aerodynamic flows with complex geometries, von Karman Institute for Fluid Dynamics, Lecture Series 1997-02, Rhode-SaintGenèse, Belgium, Mar. 3-7, 1997. 2. Aftosmis, M.J., Berger, M.J., and Melton, J.E., Robust and efficient Cartesian mesh generation for component-based geometry, AIAA Paper 97-0196, Jan. 1997. 3. Aftosmis, M.J., Melton, J.E., and Berger, M.J., Adaptation and surface modeling for Cartesian mesh methods, AIAA Paper 95-1725-CP, June 1995. 4. AGARD Fluid dynamics panel, test cases for inviscid flow field methods, AGARD Advisory Report AR-211. May 1985. 5. Bayyuk, S., Euler Flows with Arbitrary Geometries and Moving Boundaries. Ph.D thesis, Dept. of Aero. and Mech. Eng., University of Michigan, 1996. 6. Berger M.J., Aftosmis, M.J., and Melton, J.E., Accuracy, adaptive methods and complex geometry, Proc. 1st AFOSR Conf. on Dynam. Mot. in CFD. Rutgers, NJ, 1996. 7. Berger M.J. and Colella, P., Local adaptive mesh refinement for shock hydrodynamics. J. Comp. Physics. 1989, 82, pp 64–84. 8. Berger, M. and LeVeque, R., Stable boundary conditions for Cartesian grid calculations, ICASE Report No. 90-37, 1990. 9. Berger, M. and Melton, J.E., An accuracy test of a cartesian grid method for steady flow in complex geometries, Proc. 8th Int. Conf. Hyp. Problems, (also RIACS Report 95-02) Uppsala, Stonybrook, NY, June 1995. 10. Berger, M.J. and LeVeque, R., Cartesian meshes and adaptive mesh refinement for hyperbolic partial differential equations, Proc. 3rd Int. Conf. Hyp. Problems, Uppsala, Sweden, 1990. 11. Berger, M.J. and Oliger, J., Adaptive mesh refinement for hyperbolic partial differential equations, J. Comp. Physics, 1984, 53, pp 482–512. 12. Bonet, J. and Peraire, J., An alternating digital tree (ADT) algorithm for geometric searching and intersection problems, Int. J. Num. Meth. Eng., 1991, 31, pp 1–17. 13. Chan, W.M. and Meakin, R.L., Advances towards automatic surface domain decomposition and grid generation for overset grids, Proc. of the AIAA 13th Comp. Fluid Dyn. Conf., AIAA Paper 971979, Snowmass, Colorado, June 1997. 14. Charlton. E.F. and Powell, K.G., An octree solution to conservation-laws over arbitrary regions (OSCAR), AIAA Paper 97-0198, Jan. 1997. 15. Charlton. E.F., An octree solution to conservation-laws over arbitrary regions (OSCAR) with applications to aircraft aerodynamics, Ph.D. thesis, Dept. of Aero. and Astro. Eng., Univ. of Michigan, 1997. 16. Chazelle, B., et al., Application Challenges to Computational Geometry: CG Impact Task Force Report. TR-521-96. Princeton Univ., April 1996. 17. Chew, L.P., Constrained Delaunay triangulations, Algorithmica, 1989, 4, pp 97–108. 18. Cohen, E., Some mathematical tools for a modeler’s workbench, IEEE Comp. Graph. and App. Oct. 1983, 3, p 7. 19. Coirier, W.J. and Powell, K.G., An accuracy assessment of Cartesian-mesh approaches for the euler equations, AIAA Paper 93-3335-CP, July 1993. 20. Coirier, W.J., An adaptively refined, Cartesian, cell-based scheme for the Euler equations, NASA TM-106754, Oct., 1994. also Ph.D. thesis, Dept. of Aero. and Astro. Eng., Univ. of Mich., 1994. 21. De Floriani, L. and Puppo, E., An on-line algorithm for constrained Delaunay triangulation, CVGIP: Graphical Models and Image Proc. 1992, 54, 3, pp 290–300. 22. De Zeeuw, D. and Powell, K., An adaptively refined Cartesian mesh solver for the Euler equations, AIAA Paper 91-1542, 1991.

©1999 CRC Press LLC

23. DT_NURBS Spline Geometry Subprogram Library Theory Document, version 3.3. USN Surface Warfare Center/Carderock Div. David Taylor Model Basin, Bethesda MD. CARDEROCKDIV94/000, Dec. 1996. 24. Edelsbrunner, H. and Mücke, E.P., Simulation of simplicity: a technique to cope with degenerate cases in geometric algorithms. ACM Transactions on Graphics, Jan. 1990, 9, 1, pp 66-104. 25. Foley, J., van Dam, A., Feiner, S., and Hughes, J., Computer Graphics: Principles and Practice, ISBN 0-201-84840-6, Addison-Wesley, Reading, MA, 1995. 26. Forrer, H., Boundary Treatment for a Cartesian Grid Method, Seminar für Angewandte Mathmatic, ETH Zürich, ETH Research Report No. 96-04, 1996. 27. Forrer, H., Second Order Accurate Boundary Treatment for Cartesian Grid Methods, Seminar für Angewandte Mathmatic, ETH Zürich, ETH Research Report No. 96-13, 1996. 28. Gooch, C.F., Solution of the Navier–Stokes equations on locally refined Cartesian meshes, Ph.D. dissertation, Dept. of Aero. Astro. Stanford Univ., Dec. 1993. 29. Harten, A., ENO schemes with subcell resolution, ICASE Report 87-56, Aug. 1987. 30. Karman, S.L., Jr., SPLITFLOW: A 3D Unstructured Cartesian/prismatic grid CFD code for complex geometries, AIAA 95-0343, Jan. 1995. 31. Keener, E.R., Pressure-distribution measurements on a transonic low-aspect ratio wing, NASA TM-86683, 1985. 32. Liang, Y. and Barsky, B.A., An analysis and algorithm for polygon clipping, Comm. ACM, 1983, 26, 3, pp 868–877. 33. Melton, J.E., Automated Three-Dimensional Cartesian Grid Generation and Euler Flow Solutions for Arbitrary Geometries, Ph.D. thesis, Univ. California Davis, 1996. 34. Melton, J.E., Berger, M.J., Aftosmis, M.J., and Wong, M.D., 3D applications of a Cartesian grid Euler method, AIAA Paper 95-0853, Jan. 1995. 35. Melton, J.E., Enomoto, F.Y., and Berger, M.J., 3D Automatic Cartesian grid generation for Euler flows, AIAA Paper -93-3386-CP, July 1993. 36. Melton, J.E., Pandya, S., and Steger, J., 3-D Euler solutions using unstructured Cartesian and prismatic grids, AIAA Paper 93-0331, July 1993. 37. Newman, W.M. and Sproull, R.F., Principles of Interactive Computer Graphics, 2nd Ed. McGrawHill, NY, 1979. 38. O’Rourke, J., Computational Geometry in C., Cambridge Univ. Press, NY, 1993. 39. Pember, R.B., Bell, J.B., Colella, P., Crutchfield, W.Y., and Welcome, M.L., An adaptive Cartesian grid method for unsteady compresible flow in irregular regions, J. Comp. Phy. 1995, 120, pp 278–304. 40. Powell, K., Solution of the Euler and Magnetohydrodynamic Equations on Solution-Adaptive Cartesian Grids, von Karman Institute for Fluid Dynamics, Lecture Series 1994-05, Rhode-SaintGenèse, Belgium, Mar. 1996. 41. Preparata, F.P. and Shamos, M.I., Computational Geometry: An Introduction, Springer–Verlag, 1985. 42. Priest, D.M., Algorithms for arbitrary precision floating point arithmetic, 10th Symp. on Computer Arithmetic, IEEE Comp. Soc. Press, 1991, pp 132-143. 43. Quirk, J., An Alternative to unstructured grids for computing gas dynamic flows around arbitrarily complex two dimensional bodies, ICASE Report 92-7, 1992. 44. Finkel, R.A. and Bentley, J.L., Quad trees: a data structure for retrieval on composite keys. Acta Informatica, 1974, 4,1, pp 1–9. 45. Samet, H., The Design and Analysis of Spatial Data Structures. Addison-Wesley Series on Computer Science and Information Processing. Addison–Wesley, 1990. 46. Schmitt, V. and Charpin, F., Pressure distributions on the ONERA-M6-Wing at transonic mach numbers, Experimental Data Base for Computer Program Assessment, AGARD Advisory Report AR-138, 1979.

©1999 CRC Press LLC

47. Shewchuk, J.R., Robust Adaptive Floating-point Geometric Predicates, Proceedings of the Twelfth Annual Symposium on Computational Geometry, ACM, May 1996, pp 141–150. 48. Shewchuk, J.R., Adaptive precision floating-point arithmetic and fast robust geometric predicates. CMU-CS-96-140, School of Computer Science, Carnegie Mellon Univ., 1996. 49. Sloan S.W., A fast algorithm for generating constrained Delaunay triangulations, Computers and Structures, Pergammon Press Ltd., 1993, 47, 3, pp 441–450. 50. Stern, L.G., An Explicitly Conservative Method for Time-Accurate Solution of Hyperbolic Partial Differential Equations on Embedded Chimera Grids, Ph.D. thesis, Univ. of Wash, 1996. 51. Sutherland, I.E. and Hodgman, G.W., Reentrant polygon clipping, Comm ACM, 1974, 17,1, pp 32–42. 52. Van Vlack, L.H., Elements of Material Science and Engineering, Addison-Wesley, 1980. 53. Voorhies, D., Graphics Gems II: Triangle-Cube Intersections. Academic Press, 1992. 54. Wang, Z.J., Przekwas, A., and Hufford, G., Adaptive Cartesian/adaptive prism grid generation for complex geometry, AIAA Paper 97-0860, Jan. 1997. 55. Watson, D.F., Computing the n-dimensional Delaunay Tessellation with application to Voronoï polytopes, Computer J. 1981, 24, 2, pp 167–171. 56. Welterlen, T.J. and Karman, S.L., Jr., Rapid assessment of F-16 store trajectories using unstructured CFD, AIAA 95-0354, Jan. 1995. 57. Yap, C. and Dubé, T., The exact computation paradigm, Computing in Euclidean Geometry, 2nd Ed. Du, D.-Z. and Hwang, F.K., (Eds.), World Scientific Press, 1995, pp. 452-492. 58. Yap, C-.K., Geometric consistency theorem for a symbolic perturbation scheme, J. Comp. Sys. Sci., 1990, 40, 1, pp 2–18.

©1999 CRC Press LLC

23 Hybrid Grids 23.1 23.2

Introduction Underlying Principles Historical Review • The Trend from Unstructured to Hybrid Grids • The Trend from Structured to Hybrid Grids • Potential Computational Benefits of Using Hybrid Meshes

23.3

Best Practices Mesh Generation Techniques Employed in the SAUNA System • Interfacing Different Grid Types • Data Structures for Describing Hybrid Grids • Examples of Hybrid Meshes

Jonathon A. Shaw

23.4

Research Issues and Summary

23.1 Introduction Recent years have witnessed much conjecture over the relative merits of the various methodologies that have emerged as candidates for providing a robust, effective, high-quality mesh generation capability for gridding complex three-dimensional domains. These methods are generally classified into one of two categories, namely structured or unstructured approaches, with strong advocates of each still existing amongst both the method development and user communities. Promoters of structured schemes highlight the efficiency and accuracy that is attained through the employment of regularly arranged hexahedral volumes. Supporters of unstructured schemes emphasize the geometric flexibility and suitability for adaptation inherent to the use of irregularly connected tetrahedral volumes. This Handbook will serve to further the debate on the absolute superiority of one of these approaches over the other without, one suspects, enabling a definitive conclusion to be reached. However, a review of this handbook in conjunction with the proceedings of the now firmly established series of conferences devoted to numerical grid generation indicates that there is an underlying trend within the field of grid generation. This trend is toward an increasing cross-fertilization of ideas and techniques between the two camps. Practitioners of the unstructured approach are having to use directional information to achieve elements of suitable quality near boundaries, while structured grid generators are devising increasingly irregular schemes to attain appropriate geometric flexibility. The limit of this trend is to replace the sole use of one mesh type by the use of combined meshes composed of both structured and unstructured grids — hybrid grids. This combination of grid types not only allows the benefits of structured and unstructured grids to be attained simultaneously, but also allows high grid quality to be achieved throughout the domain due to the appropriate use of each element type. In this chapter, the prime interest is the generation of grids containing more than one element type. This will be termed hybrid grid generation. However, reference will also be made to the generation of single element type meshes where it is felt that the work particularly demonstrates the movement of ideas between the two main fields of mesh generation. This will be termed hybrid grid technology.

©1999 CRC Press LLC

This chapter has three main sections and a summary. Section 23.2 is devoted to “Underlying Principles” and contains a general description of both work in the field of hybrid grid generation and the use of hybrid grid technology. It begins by tracing the roots of hybrid grid generation back to two quite distinct sources. The move to hybrid grid generation/technology from the purely unstructured approach is then reviewed, followed by observations on the progression of the structured community to hybrid grids. The section ends with a discussion on the potential savings in execution times and memory requirements that can be made through using hybrid grids instead of solely unstructured grids. In Section 23.3, entitled “Best Practices,” the discussion becomes more focused around the author’s own experience in generating hybrid grids. This is because, in spite of the very real potential benefits that are to be gained through the use of hybrid grids, there is at present a dearth of evidence that other capabilities exist that are able to form general three-dimensional hybrid meshes. The section begins with a brief overview of the evolution of a mesh generation system that can be used to form either solely structured (hexahedral cells), semistructured (prismatic cells), unstructured (tetrahedral cells) or a hybrid combination of any of these grid types. Attention is then focused briefly on the key elements of the capabilities that are used to form the different types of elements, with the details left either to references or study of other chapters in the book. The very important area of interfacing the different grid types is then covered, and this is followed by a discussion on data structures for describing a hybrid grid. Finally, three examples of hybrid grids for aero- and hydrodynamic applications are presented along with a description of the main considerations that have been borne in mind while forming these grids. Section 23.4 covers some of the open research issues that will need to be addressed within the field of hybrid grid generation for the approach to realize its potential. The discussion also focuses on some of the practical implications that lie behind the adoption of a hybrid grid strategy, which possibly indicate why there are currently so few general, three-dimensional hybrid capabilities.

23.2 Underlying Principles 23.2.1

Historical Review

As with many other ideas, the origins of the concept of hybrid grid generation can be traced back to two unrelated workers, namely Nakahashi from Japan and Weatherill from the U.K. Nakahashi advocated the use of hybrid grids in conjunction with a zonal finite difference (FD) and finite element (FE) flow solution methodology [Nakahashi and Obayashi, 1987a, b]. An implicit finite difference method was applied on structured grids to viscous flow modeling near geometric surfaces. The remaining regions were modeled by an explicit, node-based finite element solution of the Euler equations formulated on unstructured grids. Communication between the FD and FE zones was achieved by allowing the grids to overlap by one cell, with the grids sharing common nodes in these regions. Hence, information required at the zonal boundary of one region could be taken from the interior of the adjacent grid. The observation that the approach combined both the computational efficiency of the FD method and the geometric flexibility of the FE method was central to Nakahashi’s promotion of the use of hybrid grids. In his early work, Nakahashi does not present sufficient detail about the techniques used to generate the grids for it to be possible to judge the generality of the mesh generation tools he used. Nevertheless, the fact that he was able to demonstrate that three-dimensional zonal flow solutions could be achieved on hybrid grids composed of tetrahedra and hexahedra is indeed worthy of note. Weatherill proposed the use of hybrid grids by considering the apparent advantages and disadvantages of both the structured and unstructured approaches [Weatherill, 1988a] (at this time, he was well placed to give a pragmatic view on both approaches, having been involved in pioneering work in both blockstructured [Weatherill and Forsey, 1985] and unstructured [Jameson, Baker, and Weatherill, 1986] mesh generation for complete aircraft.) He observed that the structured grid approach provides high-quality meshes at a relatively low cost and, because of inherent directional qualities, also provides an ideal environment for accurate and efficient flow algorithm techniques. However, structured meshes can be somewhat restrictive when applied to complex geometries and do not readily admit mesh point enrichment. In contrast, ©1999 CRC Press LLC

the unstructured mesh generation techniques have almost total flexibility for complex shapes and readily accept mesh enrichment. These advantages are counterbalanced, however, by their relatively high computational costs and lack of directional properties. The observation that lies at the heart of Weatherill’s proposition of hybrid grids is that the real advantages of one approach are the disadvantages of the other. The combination of the approaches is an attempt to capitalize on the merits of both approaches. This was demonstrated in two dimensionals by embedding unstructured regions of triangular grid in a background structured quadrilateral grid to 1. Form grids for multielement aerofoils. 2. Perform mesh adaptation to the flow over an aerofoil. 3. Improve mesh quality locally. In this work, the structured regions were formed using the block-structured approach and the unstructured regions were created using the Delaunay connectivity algorithm [Weatherill, 1988b]. In contrast to Nakahashi, Weatherill [1988a] developed a single finite-volume flow algorithm for use with hybrid grids, as an extension of the scheme of Jameson, Baker and Weatherill [1986]. In this cellvertex scheme, the control volume for a node was viewed as being the sum of elements containing the node, thereby creating overlapping control volumes. Hence, the flux balancing for nodes at the interface of the two mesh types was achieved by operating over both triangular and quadrilateral elements.

23.2.2

The Trend from Unstructured to Hybrid Grids

The unstructured grid approach, based primarily around the Delaunay [Weatherill, 1988b] (see Chapter 16) and moving-front (advancing front) [Morgan, Peraire and Peiro, 1992] (see Chapter 17) algorithms, has been shown to provide a highly effective basis for simulating inviscid flows over complex configurations, particularly when coupled with solution adaptive point enrichment and removal algorithms. However, considerable obstacles have been encountered in attempting to extend these algorithms to the generation of the highly compressed tetrahedra that are necessary for the efficient computation of viscous flows. These difficulties arise principally because both techniques use the properties of a sphere to determine the suitability of point connectivities, which works very well for the generation of isotropic grids, but not for the highly anisotropic grids required to allow shear layers to be resolved. These problems have motivated workers [Pirzadeh, 1992; Kallinderis, 1996; Marchant and Weatherill, 1994] to investigate employing structured grid generation techniques locally to march triangulations of the geometric surfaces a distance sufficient to cover the expected extent of the shear layer (see Chapter 25). The conventional unstructured mesh generation techniques are then employed to yield a triangulation of the remainder of the domain. This approach allows most of the flexibility of the unstructured approach to be maintained through the use of triangles to cover the surface of the geometry, while also enabling the required point density close to solid surfaces to be achieved. In some cases, the semistructured layers of prismatic elements that are formed by this surface inflation approach are retained for the flow simulation for reasons of efficiency [Kallinderis, 1996]. In others, each prism is subdivided into three tetrahedra [Marchant and Weatherill, 1994] to avoid the need to have a flow algorithm that operates over more than one element type. Whichever the case, it is possible to make use of the structured nature of the grid normal to the surface to enhance the sophistication of the subsequent modeling, as demonstrated by Weatherill, et al., [1987] in their use of locally structured triangular grids for multielement aerofoil flows. This approach has met with a considerable degree of success. However, it is prone either to lack geometric flexibility, require excessive user intervention, or produce grids whose quality is not sufficient to support an accurate flow simulation. These limitations are observed in junction regions at discontinuities in surface slope and where a geometry has a high degree of surface curvature in one direction only. Combinations of these features exacerbate matters. Furthermore, the polar-like topology of the semistructured region of grid is such that the point distribution normal to the wake center-line is not of sufficient density for the wake to be adequately resolved.

©1999 CRC Press LLC

An alternative approach to the generation of unstructured grids for viscous flows, which uses hybrid grid technology, centers on the use of directional refinement, as proposed in two dimensions by Barth [1994] and extended to three dimensions by Peraire and Morgan [1996]. Initially, an isotropic grid is formed, which is subsequently enriched until each point in the grid satisfies user specified stretching distributions that have been defined for curves and surfaces within the domain. The scheme appears to offer significant potential savings in that, in addition to the stretching of the grid normal to geometric and wake surfaces, it allows anisotropic surface triangulations to be established in regions where the surface curvature is only high in one direction. However, it is not clear how well point density and element quality can be controlled in junction regions and at the edge of the refined regions. Furthermore, there remains the question of how well viscous flows can be simulated on highly stretched tetrahedral elements. The analysis of Baker [1996] adds significantly to this particular debate.

23.2.3

The Trend from Structured to Hybrid Grids

Within the class of mesh generation schemes that have been proposed to extend the application of structured grids to geometrically complex domains, the block-structured [Weatherill and Forsey, 1985] (see Chapter 13) and overlying [Benek, Steger, and Dougherty, 1983] (see Chapter 11) approaches have met with most success. However, neither approach has yet matured sufficiently for novel configurations to be treated accurately in a routine manner. The block-structured approach has the potential to be the ultimate demonstration of hybrid grid technology. Within each block the grid is formed of regularly arranged hexahedra that can be generated by either of the established structured methods, namely the solution of elliptic partial differential equations or transfinite interpolation. The blocks have an irregular connectivity, however, which for all but the simplest of domains is not amenable to efficient manual specification, as discussed in Shaw and Weatherill [1992]. This motivates a requirement to be able to decompose a domain automatically into a suitable block structure, which can be cast as the need to generate a coarse unstructured grid of hexahedra. Schonfeld and Weinerfelt [1991] proposed a scheme for this in two dimensions based on the use of the moving front technique to form quadrilateral cells. However, while the scheme was demonstrated for multielement aerofoil configurations, the block structures created did not form the most natural topology for each component, which is a key feature in the successful application of block-structured grids. The objective of forming effective block structures, which can be readily controlled, remains an open problem which if ever realized may be so irregular as to negate most of the advantages of structured grids. The semiautomatic approaches of Shaw and Weatherill [1992], Eiseman, Cheng and Hauser [1994], and Dannenhoffer [1996] represent the most advanced solutions to the problem to date (see Chapter 10). The proposition that there is a limited range of problems that can be efficiently resolved using the block-structured approach has led Shaw, et al., [1991] to discuss situations where the use of hybrid grids would be favored. This is discussed further in Section 23.3. Overlying grids do not have some of the restrictions of block-structured grids. However, the time taken to establish the meshes can be significant because of the need to ensure that sudden changes in mesh size are not encountered in overlapping regions. The FAME (feature associated mesh embedding) scheme of Albone [1988; 1992], which adopts a unified treatment to both geometric and flow features, appears to overcome this particular problem. For each feature (whose topology is either a corner, line, or surface), the approach forms individual meshes that are ordered hierarchically for the flow modeling based on the degrees of constraint possessed by the feature. An octree grid, formed by the repetitive subdivision of Cartesian hexahedral cells into eight, is then used to cover the remainder of the domain, with the refinement driven by the mesh spacing of the feature associated grids. This use of very many overlapping regular grids, coupled to the employment in the background of multiple levels of unstructured, embedded hexahedra, appears very flexible. However, it suffers along with other overlying methods with conservation and nonuniqueness problems when transferring solutions between meshes.

©1999 CRC Press LLC

Increasingly, overlying mesh generators are migrating toward the use of hybrid grids. Liou and Kao [1994] demonstrate an approach in two dimensions whereby an initial set of regular, overlying grids is formed. The quadrilateral cells in the regions of overlap are then identified and removed from the grids, leaving a void which is subsequently filled with triangles. The approach adopted allows much of the technology developed for overlapping grids to be retained while overcoming the problems of conservation. Noack, Steinbrenner, and Bishop [1996] have pursued a similar approach in three dimensions. In their work, the background mesh is an octree grid. Structured body-conforming meshes are formed adjacent to solid surfaces, and tetrahedra are used to fill the void between the background and local sets of hexahedra. In contrast to the methodology described in Section 23.3, the triangular faces of the tetrahedra are allowed to abut the quadrilateral faces of the hexahedra directly. The flow algorithm that operates on these meshes is described in Bishop and Noack [1995].

23.2.4 Potential Computational Benefits of Using Hybrid Meshes In this section, observations are made on the computational benefits that structured grids offer in comparison with unstructured grids. If the majority of a hybrid mesh is composed of structured grid, then it is apparent that these benefits will also extend to the hybrid environment. Shaw, et al., [1993] undertook a study to model inviscid flow over a wing-foreplane-fuselage configuration with both a solely block-structured grid and with a hybrid grid, with the unstructured region containing the foreplane. While this study cannot be viewed as totally rigorous, their findings were that to achieve a similar accuracy in the flow simulation, the surface mesh density of the unstructured grid had to be nearly an order of magnitude more dense than the structured grid. This was due primarily to the isotropic nature of the surface mesh, which meant that to resolve the streamwise curvature of the surface, the spanwise density of the mesh needed to be very high. Also, it is apparent that independent of the strategy that is pursued to create a mesh for modeling shear layer flow, the required point density normal to the surface will be the same. These factors lead to the conclusion that in the viscous region of the flow domain the point density in an unstructured grid will be approximately ten times greater than in a structured grid. Furthermore, the rate at which time marching can be performed on the unstructured grid will be about one half (for a cell-vertex scheme) of that on a structured grid of the same point density. In addition to this, the amount of work done per time step will be greater due to the larger number of faces and edges in the unstructured grid, and there will also be increased processing time due to the amount of indirect addressing that needs to be done. This short discussion suggests conservatively that to achieve the same level of convergence and accuracy, computations of viscous flow on an unstructured grid will be more than 20 times as expensive as on a structured grid. Turning to memory requirements, the findings reported in Shaw, Peace and Weatherill [1994] indicate that the storage requirements per point for a flow solution on an unstructured grid are about four times those of a structured grid. Even if the unstructured grid is coarser in the farfield, the storage of the unstructured grid, with its greater total number of points, would typically be 40 times greater than for a structured grid. There are thus very clear incentives to use structured grids whenever possible. For hybrid grids the implication is that the extent of unstructured grid employed should be as minimal as possible.

23.3

Best Practices

There is general agreement on what is needed in a mesh. It must conform to boundaries, contain points that are distributed effectively, be defined in a manner amenable to efficient computations, and have connections between points that form elements whose geometric properties satisfy certain criteria. The relative importance attached to these requirements will depend upon the problem being addressed.

©1999 CRC Press LLC

In this chapter, the application is the modeling of the high Reynolds number turbulent flows associated with the complex bodies studied by aero- and hydrodynamicists, for which reviews of the demands on a mesh are given by Albone [1988], Albone and Swift [1996] and Patis and Bull [1996]. The task of simulating the flows over these geometries presents the severest of challenges to the traditional use of a single element type in a mesh and represents the principal industrial need that has motivated the current interest in hybrid grid generation/technology. An example of this, which will be the focus of the remainder of this chapter, is the work of the Research Group at ARA in hybrid grid generation that has led to the development of the SAUNA (Structured and Unstructured Numerical Analysis) CFD system.

23.3.1

Mesh Generation Techniques Employed in the SAUNA System

In this section the basic mesh generation techniques that have been developed for the SAUNA system, which has been used to generate the grids described later, are reviewed. The system is capable of forming either solely block-structured, semistructured, or unstructured grids. In addition, it is capable of forming a hybrid combination of any of these mesh types. Hence, the same system can be used to form meshes efficiently for problems as diverse as the steady, viscous flow over a civil aircraft or the unsteady inviscid flow over a store released from a carriage bay. 23.3.1.1

Overview of Development

The initial approach to grid generation pursued within SAUNA was coined “Multi-block” [Weatherill and Forsey, 1985]. It centered around the formation of a global grid through the patching together of many structured, nonoverlapping grid systems, each of which covered a region that was topologically equivalent to a cuboidal block. This block-structured approach was applied to increasingly complex problems through the 1980s with a considerable degree of success [Shaw, Georgala and Weatherill, 1988]. However, as more and more complex configurations were attempted, so an appreciation of the limits to the range of problems the approach can handle developed. Following a study of the hybrid approach in two dimensions [Weatherill, 1988a], work began on the initial development of a three-dimensional hybrid capability [Shaw, Peace and Weatherill, 1994]. The objectives were to explore ideas and gain an appreciation of the major issues that would need to be addressed to create a CFD system based on the hybrid philosophy. The full development of a hybrid capability then began in earnest. The grid generation strategy for inviscid flow modeling centered around the use of hexahedral volumes combined into blocks, wherever they are readily attained, with pockets of tetrahedral grid embedded as appropriate to model local regions of high geometric complexity [Shaw, Georgala, Peace and Childs, 1991]. In the extension of this hybrid approach to the creation of grids for viscous flow modeling, the use of prismatic grid regions has been addressed, this additional grid type fitting in naturally to the hybrid grid framework [Chappell, Shaw, and Leatham, 1996; Peace, Chappell, and Shaw, 1996]. For geometric regions that are sufficiently complex to require an unstructured surface grid, the structured extension of the grid away from the surface allows layers of semistructured prismatic elements to be created. The regular nature of the grid normal to the surface is seen as being preferable to a fully unstructured approach in terms of both accuracy and efficiency. However, to achieve high mesh quality in junction regions, the approach requires to be augmented by a capability to create local block-structured regions between two intersecting surfaces from which prisms are grown. This avoids the need to generate prismatic elements in the regions highlighted as being difficult in Section 23.2.2. A natural hierarchy of mesh elements for viscous flows can be drawn from the discussion to date and indeed this is the order in which the elements are created: 1. Block-structured hexahedral grid. 2. Semistructured prismatic grid. 3. Unstructured tetrahedral grid. The generation of these grids is now considered in turn. ©1999 CRC Press LLC

23.3.1.2

Structured Grid Generation

The multi-block approach [Weatherill and Forsey, 1985] is employed for the generation of structured grids. The domain is decomposed into an assemblage of topologically cuboidal blocks, each of which possesses its own curvilinear coordinate system. Grid lines are constrained to pass between block interfaces with continuity of position, slope and curvature. The technique allows the embedding of appropriate mesh structures local to components. The connectivity arrangement of blocks, known as the block topology, is determined via a semiautomatic approach, based on an input schematic representation of the configuration [Shaw and Weatherill, 1992]. 23.3.1.2.1 Surface Grid Generation. The generation of the surface grids is accomplished via the solution of elliptic PDEs [Thompson, Thames, and Mastin, 1974], with the initial boundary point distribution established automatically using an algorithm that is sensitive to local grid topology and geometry [Shaw and Weatherill, 1992] (see Chapter 9). If the default grids are found to be of insufficient quality, a graphics-based module is employed to modify boundary point distributions and add constraints to the mesh. The meshes are subsequently regenerated until satisfactory quality is achieved. 23.3.1.2.2 Field Grid Generation The field mesh for inviscid flows is also generated by solution of elliptic PDEs with the source terms calculated using the method proposed by Thomas and Middlecoff [1980] (see Chapter 4). Algebraic techniques are employed to enrich the mesh for viscous flow modeling to allow exact control of the first cell height away from the surface (see Chapter 3). A capability to regenerate the mesh automatically in response to a perturbation of the geometry allows the system to be embedded within a design optimization strategy [Lovell and Doherty, 1994]. Mesh adaptation to either viscous or inviscid flow phenomena is performed using the LPE method of Catherall [1996]. This involves the numerical solution of equations for node positions that are formed as a linear combination of an inverted Laplace equation, an inverted Poisson equation, and an equidistribution equation. The Laplace term promotes smoothness and orthogonality, the Poisson term enables the retention of favorable features of the initial mesh, and the equidistribution term controls the redistribution of nodes according to a measure of solution activity. Mesh adaptation is covered in Part IV of this Handbook. Prior to performing a flow simulation, the grid is decomposed into microblocks containing four cells in each coordinate direction. This micro-block structure is then recombined into macro-blocks based on either the requirement to distribute the grid effectively over a number of processors or to allow long loops to be achieved on vector machines. This recombination capability is also used in the generation of hybrid grids to redefine the grid into blocks when part of the initial block-structured grid has been removed to be replaced by tetrahedra and/or prisms. 23.3.1.3

Semistructured Grid Generation

The technique employed [Chappell, 1996] for generating prismatic elements is a marching method, and as such starts from a defined surface and propagates outwards to an outerboundary, the exact shape or location of which cannot be predetermined. The prismatic grid is built up one layer at a time. At each stage, the positions of points in the next layer are determined as a function of the current outer grid surface, which will initially be the input unstructured surface grid. The generation of a prismatic layer can be separated into two distinct processes: the evaluation of normal vectors and the determination of marching distances along these vectors. 23.3.1.3.1 Evaluation of Normal Vectors The first stage of the prismatic grid generation process is the determination of marching direction vectors at all points on the unstructured surface. This is achieved by evaluating the normals to all surface triangles and sending contributions to the forming nodes weighted according to the angle subtended at the node. All nodal vectors are then normalized to unit magnitude.

©1999 CRC Press LLC

This yields an approximately normal marching vector for every point on the current grid surface. If these vectors are used in this form, however, the normal grid lines will converge from concave surface regions, leading to grid crossover. This undesirable feature can be overcome by an iterative smoothing of the vectors using a Laplacian filter, with the amount required being surface-topology- dependent. The trade-off is a reduction in grid orthogonality. 23.3.1.3.2 Marching Distances along Normal Vectors In the development of prismatic grid generation methods, workers have given much attention to the determination of appropriate marching distances along each grid line. If the initial surface features any concave regions, then the maximum distance away from the body to which the grid can extend will be limited, unless some form of marching distance variation is employed. The goal of marching distance variation within a layer is to compensate for regions of high concave and convex curvature, increasing marching distances in the former case and reducing them in the latter. The overall effect is that the grid tends toward a spherical effect as it moves away from the geometric surface. Several approaches to this problem have been investigated with a spring analogy approach found to be the most successful [Chappell, 1996]. By treating the normal vectors connecting a point to its neighbors as springs and summing their effects, an overall “spring force” vector for the point can be calculated. The scalar product of this vector with the nodal normal vector gives a measure of the local surface curvature. In convex regions, where the net effect of the adjoining points will act in opposition to the marching direction, a negative measure will be returned, and vice-versa in concave regions. This measure can form the basis of a marching distance modification function which, with appropriate use of unit vectors, is independent of the distance between a node and its neighbors. The modification function is subject to two constraints. The first checks that the value lies within an appropriate range, the second ensures stability as the grid propagates radially. An average distance for the layer is calculated based on user-defined parameters, which is then multiplied by the modification function to give the nodal marching distance. 23.3.1.4

Unstructured Grid Generation

The optimal properties of the Delaunay connection algorithm, and efficient algorithms that exist for its implementation, led to its adoption within the SAUNA system for forming the regions of tetrahedral grid [Childs, et al., 1992; Childs and Shaw, 1993]. The mesh generation is performed in two stages: surface grids, followed by volume grids. For the former, the generation of grids that are independent of the geometry definition has been a particular focus of effort. For the latter, the problem of boundary integrity requires careful attention. See Chapters 19 and 16 for a discussion of unstructured surface and volume grid generation. 23.3.1.4.1 Unstructured Surface Grid Generation Separate meshes are formed for each surface of the configuration and for the boundary of the domain. For each, boundary point distributions are defined in a graphics-based working environment, with boundary lines delimited into segments to facilitate precise control over distributions. These point distributions can be augmented by fixed internal lines either to exercise precise control of the local grid or ensure that a feature (i.e., a slope discontinuity) is resolved accurately. To be consistent with the creation of a high quality Delaunay field mesh, it is required that the surface meshes consist of triangles that are approximately equilateral in physical space. To this end a pseudo-Delaunay surface triangulation procedure has been developed [Childs and Shaw, 1993], which is coupled to a grid point location algorithm. Control of grid density in regions of high surface curvature is assured through the solution of an optimization problem based on determining a desired edge length distribution. Each surface grid is generated independently, and they are then unified to form the bounding grid for the field grid. 23.3.1.4.2 Boundary Integrity The Delaunay approach is beset by its inability to ensure that the resulting triangulation conforms to the boundaries of the flow domain–boundary integrity. Therefore, if the scheme is to be applied routinely, the basic methodology must be supplemented by a procedure that overcomes this limitation.

©1999 CRC Press LLC

To this end, an automatic boundary integrity algorithm has been developed that consists of local modifications to the datum bounding surface grids so that they more closely match the Delaunay triangulation of the boundary points. Such modifications are limited only by topological considerations and the need to keep a faithful geometric description of curved surfaces. The procedure is an iterative one that is deemed to have converged when all edges and faces of the boundary triangulation are contained in the tetrahedrization. The full implications of this approach to boundary integrity are discussed later, in the section covering the interfacing of different grid types. 23.3.1.4.3 Unstructured Field Grid Generation The three-dimensional grid is determined automatically from the bounding surface grids with grid points positioned according to boundary grid density, curvature and desired rate of change of grid density. The procedure commences with the creation of an initial octree model of the flow domain (see Chapters 14 and 15). Each octant is subdivided as necessary until the density of the terminal octants cutting boundary surfaces is comparable with that of the boundary grid. Further levels of refinement of the octree are then performed based on surface curvature. Finally, the octree is graded so that adjacent octants do not differ by more than one level. Grid points are then located within the empty octants that lie interior to the unstructured domain and connected together to form a coarse tetrahedrization of the domain. This grid is used as the basis for solving a coupled set of PDEs which yield a desired edge length in the field. A denser set of points is then formed by selective addition of suitable points to the Delaunay grid, via an automatic edge refinement procedure, until the optimal edge lengths for the tetrahedra are attained. Throughout, it is found essential to employ the generalized Delaunay algorithm wherein the grid is allowed to become non-Delaunay, due to boundary influences, but only if grid quality is enhanced. Mesh smoothing techniques, coupled with point addition and removal algorithms are used to regenerate the grid in response to a change to the shape of the boundary of the domain. This technology can be used to achieve meshes rapidly either as a result of a design modification or in response to the motion of a body, as in a store release [Leatham, 1996].

23.3.2 Interfacing Different Grid Types The interfacing of the different elements of a hybrid grid represents a major component in the development of a hybrid grid generation system, which must be performed in an automatic manner. In this section, the interfacing of block-structured, unstructured, and semistructured grids is discussed. 23.3.2.1

Interfacing Structured and Semistructured Grids

At the interface of block-structured and prismatic grid regions, the quadrilateral faces of the elements must abut. This means that all points on the interface will be fixed points to which the prismatic grid generator must conform as the layers are formed. To make the transition from block-structured to prismatic grid as smooth as possible, the vectors resulting from the fixed boundary points are used in the smoothing process for the normals in the prismatic region [Chappell, 1996]. This has the effect of preventing any sharp changes of direction near the interface. To obtain a representative marching distance for the prismatic grid, a Laplacian equation is solved for each layer, with the multi-block mesh spacing providing the necessary boundary data. 23.3.2.2

Interfacing Structured and Unstructured Grids

Clearly, some form of special treatment is required at the interface between regions of structured hexahedral grid and unstructured tetrahedral grid. One strategy could be to allow a number of tetrahedral faces to abut the face of a hexahedra. However, while this would simplify the grid generation process, a significant burden would be placed on the flow solver, which would not only have to perform well on different types of elements but would also have to be insensitive to hanging nodes, edges, and faces. Alternatively, an additional element, the pyramid can be used. For if the quadrilateral base of this element adjoins a hexahedron, the remaining triangular faces can abut to this tetrahedra, thereby maintaining a one-to-one connectivity of all faces within the mesh. This is the approach that has been followed.

©1999 CRC Press LLC

However, due to the point addition and edge swapping techniques adopted to ensure that the Delaunay algorithm conforms to the boundary of the domain, the interface of the pyramid elements is augmented locally by a buffer “layer” of tetrahedra, prior to the generation of the unstructured grid. These tetrahedra are formed in two stages, the first of which protects the faces, and the second the edges of the pyramids from the unstructured grid generator. The pyramids and initial layer of tetrahedra are both formed in an automatic manner [Shaw, et al., 1991]. Following the generation of the unstructured region of grid, the initial layer of tetrahedra at the interface needs to be adjusted as a result of the steps taken to ensure boundary integrity. An automatic module has been developed to accomplish this task in response to knowledge of the edges that have been swapped on, and nodes that have been added to, the boundary of the unstructured domain. 23.3.2.3 Interfacing Semistructured and Unstructured Grids There are three principal factors governing the ideal extent of the prismatic region, the first two of which place a lower limit and the third an upper limit on the extent of the prismatic region: 1. The grid should extend to a distance where viscous effects become negligible. 2. The cell aspect ratio (height/average side length) should be as close to unity as possible to promote a smooth transition to the tetrahedral region. 3. The quality of the triangulation on the outer layer should be as good as possible in order to achieve a good quality tetrahedral mesh. The concept of a buffer layer is also used to interface prisms and tetrahedra [Chappell, Shaw, and Leatham, 1996]. In this case the buffer is not needed to ensure compatibility of element faces but rather to eliminate the need to modify the prismatic grid after the generation of the unstructured grid. The prismatic region can be insulated from the effects of the procedure followed to achieve boundary integrity by breaking down the outer layer of prismatic cells, with each prism becoming three tetrahedra. This operation must be performed in such a way that the diagonal introduced by splitting a quadrilateral face matches for both prisms abutting that face. An iterative algorithm for achieving this type of decomposition of the outer-most layer of semistructured grid was originally proposed by Lohner [1993]. The set of face splits derived from this are used to determine the initial make-up of the tetrahedral buffer layer. Following the generation of the unstructured grid, the same procedures that are used to modify the definition of the tetrahedra in the structured/unstructured interface region are used to modify the tetrahedra in the semistructured/unstructured interface. On completion of the generation of the unstructured grid, all grid types are passed to a separate module that forms the complete data structure describing the grid.

23.3.3 Data Structures for Describing Hybrid Grids The data structure that describes the hybrid grid to the flow solver is central to the success of the approach. The description that has been adopted for a cell-vertex scheme is detailed in Peace and Shaw [1992]. The nodes are all uniquely numbered, with all nodes at which a given boundary condition is applied stored contiguously. Nodes that either lie inside each block or solely within the unstructured or semistructured field grids are also stored contiguously. Connectivity matrices are used to describe the joining of faces of tetrahedra to the triangular faces of either other tetrahedra, or prisms, or pyramids. Similarly, for the prisms, the unstructured surface grids are stored in edge-based connectivity matrices, with surface node-based pointers used to define the nodes lying along the lines of structure in the grid. The block-structured region is stored in a block-based structured manner for points that do not lie on block faces. A pointer system, based on the faces of each block, is used to access nodes that lie on block faces; these nodes might be either part of more than one block or be part of other elements. All edges in the unstructured grid and on the boundaries of both blocks and regions of semistructured grid are stored also.

©1999 CRC Press LLC

In Section 23.3.1, the main emphasis of the discussion is on the techniques that have been developed to position nodes for each of the grid types. It is worth nothing that a significant part of the total work undertaken to develop the individual mesh generation modules has focused on creating and communicating data that allows the data structure described above for the complete hybrid grid to be defined automatically.

23.3.4 Examples of Hybrid Meshes The creation of grids for three different aerodynamic and hydrodynamic configurations is discussed in order to highlight what are considered to be “best practices” in the generation of hybrid grids. The configurations are chosen because they demonstrate the three possible types of mesh that can be formed with the SAUNA grid generation system. The examples begin with the combination of block-structured and unstructured grids, followed by the use of semistructured and unstructured grids and end with an example which utilizes all mesh types. Due to the commercial sensitivity of some of the configurations shown, there are no results presented in this section from flow calculations performed on these meshes. However, details of the flow algorithm that operates on these meshes can be found in Peace and Shaw [1992], with results from both inviscid and viscous flow calculations given in Shaw, et al., [1993], Shaw, et al., [1994b], Peace, et al., [1994], and Peace, et al., [1996]. Further discussions on the generation of hybrid meshes can be found in these references and in Shaw, et al., [1994b]. 23.3.4.1

Creation of a Block-Structured/Unstructured Grid for a Civil Aircraft*

To illustrate the creation of a block-structured/unstructured grid, a civil wing-fuselage-pylon-nacelle configuration has been chosen. While block-structured grids have been formed for this type of layout, significant time was taken to establish these meshes, which are of a questionable quality around the pylon. Furthermore, apparently minor changes to the pylon geometry can lead to a major requirement to modify the local block topology. However, if the configuration is considered without the pylon, then the remaining components, both individually and collectively, are well-suited to the generation of a block-structured grid. The highly three-dimensional pylon, with its complex shaping and intersection with both the wing and nacelle surface, is readily modeled by an unstructured grid. The complete configuration can therefore be addressed efficiently by the hybrid approach without having to incur the overhead associated with the completely unstructured approach. The creation of the hybrid grid commenced with the decomposition of the domain around the wingfuselage and nacelle into blocks. A polar topology was embedded around the fuselage, with a spherical polar topology chosen to model the nose region. A “C” topology conformed to the wing leading-edge geometry. Finally, a polar topology internal and external to the nacelle, with a “C” topology around the intake lip, yielded a total of 642 blocks. The next stage in the creation of the mesh was to identify the extent of the structured grid that should be removed and replaced by unstructured grid. In this case, the pylon geometry was introduced into the structured grid and all micro-blocks that either contained the pylon or lay within a user specified distance of the pylon were removed. The remainder of the structured grid was combined into 34 macro-blocks and the initial structured/unstructured interface formed as depicted in Figure 23.1. An unstructured grid was formed on the pylon and part of the wing and nacelle surfaces. In conjunction with the inner triangulation of the structured/unstructured interface this formed the boundary data for the generation of the unstructured field mesh. The meshes were then fused together as shown in Figure 23.2.

*Grid generated by A. Shires, DERA, Bedford, UK and C.M. Newbold, DERA, Farnborough, UK.

©1999 CRC Press LLC

FIGURE 23.1

FIGURE 23.2

©1999 CRC Press LLC

Boundary for unstructured part of hybrid grid.

Hybrid structured/unstructured grid configuration 1.

FIGURE 23.3

Surface triangulation for fully appended submarine.

23.3.4.2 Creation of a Semistructured/Unstructured Grid for a Submarine* To demonstrate the use of semistructured/unstructured grids, a fully appended submarine is chosen. The configuration features several regions of high geometric difficulty for the generation of prismatic grids, i.e., where the trailing-edges of the control surfaces intersect the hull, and a large range of length scales. Unstructured grids were generated on all surfaces, as shown in Figure 23.3, and the surface inflation technique employed to generate the semistructured grid away from the submarine. In practice, several attempts had to be made to achieve a valid extent of prismatic grid, with user input parameters that control the amount of smoothing and stretching of the grid adjusted to achieve the desired result. Unstructured surface grids were then formed for the farfield boundary and the remaining extent of the symmetry plane that had not yet been covered. These were used in conjunction with the outer triangulation of the semistructured/unstructured buffer to provide boundary data for the generation of the unstructured field grid. Part of the unified hybrid mesh is shown in Figure 23.4. Note in particular how the marching distance of the grid adjusts to the size of the local surface triangulation to achieve a smooth transition of cell sizes at the prismatic/tetrahedral interface. While the example is an impressive demonstration of prismatic mesh generation, it does illustrate some of the weaknesses of a strategy based on the sole use of prisms and tetrahedra that were alluded to in Section 23.2.2. 23.3.4.3 Creation of a General Hybrid Grid for a Store Below a Research Aircraft** The final configuration examined is a wing/fuselage/foreplane research model below the wing of which is a finned store. To model the full trajectory of the store as it is released from the aircraft, possibly pitching, yawing, and rolling, is beyond the efficient application of block-structured grids. * Grid generated by J.A. Chappell, ARA, Bedford, UK. **Grid generated by J.A. Shaw and J.A. Chappell, ARA, Bedford, UK.

©1999 CRC Press LLC

FIGURE 23.4

FIGURE 23.5

Hybrid semistructured/unstructured grid for configuration 2.

Hybrid block-structured/semistructured/unstructured grid for configuration 3.

However, the parent aircraft is amenable to the generation of a block-structured grid, which was readily attained. A region of this grid below the wing was then removed and the block-structured/unstructured interface constructed. Layers of prismatic grid were grown from a surface triangulation of the store and fins. The field mesh was completed by forming tetrahedral grid in the region between the block-structured/unstructured and semistructured/unstructured buffers. Figures 23.5 and 23.6 illustrate the full hybrid surface grid and a section through the field grid, respectively. The case amply demonstrates the building block route to forming efficient, high-quality grids for configurations of great complexity that is possible with hybrid grids.

23.4 Research Issues and Summary It is generally accepted that the techniques for generating meshes are well established and that the main challenge lies in developing highly usable systems around these techniques. This is particularly the case for hybrid grids. For hybrid grids to become acceptable in the user environment, clear indication of where a given mesh type should be used for the problem of interest needs to be available. A user’s own knowledge base, coupled with good training, on-line support, and documentation will go some way toward meeting this objective. However, what is and is not a difficult region of geometry to mesh with a structured grid is ©1999 CRC Press LLC

FIGURE 23.6

Slice through hybrid field grid for configuration 3.

not always readily appreciated, even for experienced practitioners. Some form of artificial intelligence that interrogates the local geometric properties of the boundaries of a domain would appear to be required, but the level of sophistication that would be needed should not be underestimated. It is apparent that the simulation of aerodynamics and hydrodynamic flows will be performed increasingly on parallel processors. For effective computations to be achieved on these platforms, the algorithms used to decompose the domain need to be capable of providing a good load balance across all processors. This becomes an increasingly significant issue in a hybrid grid where the topology of the structured regions imposes significant constraints on the decomposition and the different elements require different processing times per time step. It was expected initially that significant problems may be encountered in the flow simulations at the interface between the different element types. To date this has not been observed, which may be testament to the care taken to join the grids together. However, it would be naive to suggest that this region of mesh, which inevitably contains significant changes in element size, could not lead to difficulties. Further validation of the flow solution in these regions is needed. Furthermore, each of the tools within the hybrid system must be of a similarly high quality and easy to use since the number of modules that need to be executed to produce the complete grid is inevitably significant compared to single element systems. The inevitable impact of this is the expense and long term commitment to the philosophy that is required to develop a usable capability. When many groups have already invested heavily in either structured or unstructured grid technology, the decision to move to hybrid grids is not taken easily. While numerous papers are now appearing on the approach in two dimensions, the evidence of work in three dimensions is sparse. The formation of strategic alignments between major industrial companies and/or government bodies, which allow specialists in the two main fields of grid generation to collaborate, could arguably have the greatest impact on changing this situation. Hybrid grid generation offers the potential of combining the advantages of structured and unstructured grids, enabling high quality, efficient meshes to be formed for a wide range of problems. The meshes will inevitably take longer to form and require greater expertise then totally unstructured grids. However, the potential efficiency and modeling gains that hybrid grids offer are such that the total elapsed time and cost to achieve the end result the engineer needs justifies this required investment.

©1999 CRC Press LLC

Acknowledgments This work has been undertaken with the support of the Procurement Executive, United Kingdom Ministry of Defence. I am grateful to my past and present colleagues at ARA who have contributed their ideas and effort to the work described here and am indebted to those who have so willingly provided the figures for the examples discussed. Finally, I would like to dedicate this article to Dr. David Catherall, who has acted as technical monitor for the work described here throughout its development and who is shortly to retire from full-time work at DERA Farnborough, U.K. Dave’s consistent support over many years for the work described has been, and still is, greatly appreciated.

References 1. Albone, C.M., An approach to geometric and flow complexity using Feature-Associated Mesh Embedding (FAME): Strategy and First Results, Numerical Methods for Fluid Dynamics III. Morton K.W. and Baines, M.J., (Eds.), Clarendon Press, Oxford, U.K., 1988, p 215–235. 2. Albone, C.M., Embedded meshes of controllable quality synthesized from elementary geometric features, AIAA Paper 92-0663. 30th AIAA Aerospace Sciences Meeting, Reno, NV, 1992. 3. Albone, C.M. and Swift, V.J., Resolution of high Reynolds number flow features using dynamicallyoverlying meshes, Numerical Grid Generation in Computational Field Simulations. 1996, Soni, B.K., Thompson, J.F., Hauser, J., Eiseman, P.R., (Eds.) Mississippi State University, MS, pp 855–864. 4. Baker, T.J., Discretization of the Navier–Stokes equations and mesh induced errors, Numerical Grid Generation in Computational Field Simulations. Soni, B.K., Thompson, J.F., Hauser, J. and Eiseman, P.R., (Eds.), Mississippi State University, MS, 1996, pp 209–218. 5. Barth, T., Aspects of unstructured grids and finite volume solvers for the Euler and Navier–Stokes equations, VKI Lecture Series on Computational Fluid Dynamics, 1994, 05. 6. Bishop, D.G. and Noack, R.W., An implicit flow solver with upwind differencing for three-dimensional hybrid grids, AIAA Paper 95-1707, 12th AIAA Computational Fluid Dynamics Conference, 1995. 7. Benek, J.A., Steger, J.L., Dougherty, F.C., A flexible grid embedding technique with applications to the Euler equations, AIAA Paper 83-1944, Danvers, MA, 1983. 8. Catherall, D., 1996. Adaptivity via mesh movement with three-dimensional block-structured grids, Numerical Grid Generation in Computational Field Simulations. Soni, B.K., Thompson, J.F., Hauser, J. and Eiseman, P.R., (Eds.), Mississippi State University, MS, 1996, pp 57–66. 9. Chappell, J.A., Private communication, 1996. 10. Chappell, J.A., Shaw, J.A., Leatham, M., 1996. The generation of hybrid grids incorporating prismatic regions for viscous flow calculations, Numerical Grid Generation in Computational Field Simulations. Soni, B.K., Thompson, J.F., Hauser, J. and Eiseman, P.R., (Eds.), Mississippi State University, MS, 1996, pp 537–546. 11. Childs, P.N. and Shaw, J.A., Generation and analysis of hybrid structured /unstructured grids, Numerical Methods for Fluid Dynamics IV, Baines, M.J. and Morton, K.W., (Eds.), Clarendon Press, Oxford, U.K., 1992, pp 499–507. 12. Childs, P.N., Shaw, J.A., Peace, A.J., Georgala, J.M., SAUNA: A system for grid generation and flow simulation using hybrid structured/unstructured grids, Computational Fluid Dynamics ’92. Hirsch, Ch., Periaux, J., Kordulla, W., (Eds.), Elsevier, Amsterdam, Holland, 1992, pp 875–882. 13. Dannenhoffer III, J.F., Automatic generation of block structures — progress and challenges, Numerical Grid Generation in Computational Field Simulations. Soni, B.K., Thompson, J.F., Hauser, J. and Eiseman, P.R., (Eds.), Mississippi State University, MS, 1996, pp 403–412. 14. Eiseman, P.R., Cheng, Z., Hauser, J., 1994. Applications of multi-block grid generators with automatic zoning, Numerical Grid Generation in Computational Fluid Dynamics and Related Fields. Weatherill, N.P., Eiseman, P.R., Hauser, J., Thompson, J.F., (Eds.), Pineridge Press, Swansea, U.K., 1994, pp 123–134. ©1999 CRC Press LLC

15. Jameson, A., Baker, T.J., and Weatherill, N.P., Calculation of Inviscid transonic flow over a complete aircraft, AIAA Paper 86-0103. 24th AIAA Aerospace Sciences Meeting, Reno, NV, 1986. 16. Kallinderis, Y., Discretisation of complex 3D flow domains with adaptive hybrid grids, Numerical Grid Generation in Computational Field Simulations. Soni, B.K., Thompson, J.F., Hauser, J. and Eiseman, P.R., (Eds.), Mississippi State University, MS, 1996, pp 505–515. 17. Leatham, M., Private communication, 1996. 18. Liou, M.S. and Kao, K.-H., Progress in grid generation: from chimera to DRAGON grids, Frontiers of CFD. Caughey, D.A. and Hafez, M.M., (Eds.), John Wiley, Chichester, England, 1994, pp 385-412. 19. Lohner, R., Matching Semi-Structured and Unstructured Grids for Navier–Stokes Calculations, AIAA Paper 93-3348. 1993. 20. Lovell, D.A. and Doherty, J.J., Aerodynamic design of aerofoils and wings using a constrained optimisation method, Proc. of 19th ICAS Congress, Paper-94-2.1.2, 1994. 21. Marchant, M.J. and Weatherill, N.P., Unstructured grid generation for viscous flow simulations, Numerical Grid Generation in Computational Fluid Dynamics and Related Fields. Weatherill, N.P., Eiseman, P.R., Hauser, J., Thompson, J.F., (Eds.), Pineridge Press, Swansea, U.K., 1994, pp 151–162. 22. Morgan, K., Peraire, J., Peiro, J., Unstructured mesh methods for compressible flows, AGARD Report 787. Special Course on Unstructured Grid Methods for Advection Dominated Flows, 1992., 5.1–5.39. 23. Nakahashi, K. and Obayashi, S., FDM - FEM Zonal method for viscous flow computations over multiple bodies, AIAA Paper 87-0604. 25th AIAA Aerospace Sciences Meeting, Reno, NV, 1987a. 24. Nakahashi, K. and Obayashi, S., Viscous flow computations using a composite grid, AIAA Paper 87-1128, 1987b. 25. Noack, R.W., Steinbrenner, J.P., Bishop, D.G., A three dimensional hybrid grid generation technique with application to bodies in relative motion, Numerical Grid Generation in Computational Field Simulations. Soni, B.K., Thompson, J.F., Hauser, J. and Eiseman, P.R., (Eds.), Mississippi State University, MS, 1996, pp 547–556. 26. Patis, C.C. and Bull, P.W., 1996. Generation of grids for viscous flows around hydrodynamic vehicles, Numerical Grid Generation in Computational Field Simulations. Soni, B.K., Thompson, J.F., Hauser, J. and Eiseman, P.R., (Eds.), Mississippi State University, MS, 1996, pp 825–834. 27. Peace, A.J. and Shaw, J.A., The modeling of aerodynamic flows by solution of the Euler equations on mixed polyhedral grids, Int. J. Num. Meth. Eng. 1992, 35, pp 2003–2029. 28. Peace, A.J., May, N.E., Pocock, M.F., Shaw, J.A., Inviscid and viscous flow modeling of complex aircraft configurations using the CFD simulation system SAUNA, Proc. of 19th ICAS Congress, Paper-94-2.6.3, 1994. 29. Peace, A.J., Chappell, J.A., Shaw, J.A., Turbulent flow calculations for complex aircraft geopmetries using prismatic grid regions in the SAUNA CFD code. Proc. of 20th ICAS Congress, Paper 96-1.4.2, 1996. 30. Peraire, J. and Morgan, K., Viscous Unstructured mesh generation using directional refinement, Numerical Grid Generation in Computational Field Simulations. Soni, B.K., Thompson, J.F., Hauser, J. and Eiseman, P.R., (Eds.), Mississippi State University, MS, 1996, pp 1151–1164. 31. Pirzadeh, S., Viscous unstructured three-dimensional grids by the advancing layers method, AIAA Paper 94-0417. 32nd AIAA Aerospace Sciences Meeting, Reno, NV, 1994. 32. Schonfeld, T. and Weinerfelt, P., The automatic generation of quadrilateral multi-block grids by the advancing front technique, Numerical Grid Generation in Computational Fluid Dynamics and Related Fields. Arcilla, A.S., Hauser, J., Eiseman, P.R., Thompson, J.F., (Eds.), Elsevier Science Publishers B.V. (North-Holland), Amsterdam, Holland, 1991, pp 743–754. 33. Shaw, J.A. and Weatherill, N.P., Automatic topology generation for multi-block grids, App. Maths Computation, 1992, 52, pp 355–388. 34. Shaw, J.A., Georgala, J.M., Weatherill, N.P., The construction of component adaptive grids for aerodynamic geometries, Numerical Grid Generation in CFD ’88. Sengupta, S., Hauser, J., Eiseman, P.R., J.F.Thompson, J.F., (Eds.), Pineridge Press, Swansea, U.K., 1988, pp 383–394.

©1999 CRC Press LLC

35. Shaw, J.A., Peace, A.J., Weatherill, N.P., A three-dimensional hybrid structured–unstructured method : motivation, basic approach and initial results, Computational Aeronautical Fluid Dynamics. Fezoui, L., Hunt, J.C.R., Periaux, J., (Eds.), Clarendon Press, Oxford, U.K., 1994, pp 157–201. 36. Shaw, J.A., Georgala, J.M., May, N.E., Pocock, M.F., Application of three dimensional hybrid structured/unstructured grids to land, sea and air vehicles, Numerical Grid Generation in Computational Fluid Dynamics and Related Fields. Weatherill, N.P., Eiseman, P.R., Hauser, J., Thompson, J.F., (Eds.), Pineridge Press, Swansea, U.K., 1994a, p151–162. 37. Shaw, J.A., Georgala, J.M., Peace, A.J., Childs, P.N., The construction, application and interpretation of three-dimensional hybrid meshes, Numerical Grid Generation in Computational Fluid Dynamics and Related Fields. Arcilla, A.S., Hauser, J., Eiseman, P.R., Thompson, J.F., (Eds.), Elsevier Science Publishers B.V. (North-Holland), Amsterdam, Holland, 1991, pp 887–898. 37. Shaw, J.A., Peace, A.J., Georgala, J.M., Childs, P.N., Validation and evaluation of the advanced aeronautical CFD system SAUNA – A method developer’s view, Recent Developments and Applications in Aeronautical CFD. Paper 3. Royal Aeronautical Society, London, U.K., 1993. 38. Shaw, J.A., Peace, A.J., May, N.E., Pocock, M.F., Verification of the CFD Simulation system SAUNA for complex aircraft configurations, AIAA Paper 94-0393. 32nd AIAA Aerospace Sciences Meeting, Reno, NV, 1994. 39. Thomas, P.D. and Middlecoff, J.F., Direct control of grid point distributions in meshes generated by elliptic equations, AIAA J. 18:652-656, 1980. 40. Thompson, J.F., Thames, F.C., Mastin, W., Automatic Numerical generation of body fitted curvilinear co-ordinate systems for field containing arbitrary two-dimensional bodies, J. Comp. Phys. 1994, 15, pp 299–319. 41. Weatherill, N.P., On the Combination of structured–unstructured meshes, Numerical Grid Generation in CFD ’88. Sengupta, S., Hauser, J., Eiseman, P.R., J.F.Thompson, J.F., (Eds.), Pineridge Press, Swansea, U.K., 1988a, pp 729–739. 42. Weatherill, N.P., A method for generating irregular computational grids in multiply connected planar domains, Int. J. Num. Methods Fluids, 1988b, 8, pp 181–197. 43. Weatherill, N.P. and Forsey, C.R., Grid generation and flow calculations for aircraft geometries, J. of Aircraft. 1985, 22,10, pp 855–860. 44. Weatherill, N.P., Johnston, L.J., Peace, A.J., Shaw, J.A., A method for the solution of the Reynoldsaveraged Navier–Stokes equations on triangular grids, In Proc. of the 7th GAMM Conf. on Numerical Methods in Fluid Dynamics. Louvain-La-Neuve, Belgium, 1987.

©1999 CRC Press LLC

24 Parallel Unstructured Grid Generation 24.1 24.2 24.3 24.4 24.5

Hugues L. de Cougny Mark S. Shepherd

Introduction Requirements for Parallel Mesh Generation Classification of Parallel Mesh Generators Meshing Interfaces Along with Subdomains Premeshing Interfaces Initial Coarse Mesh Partitioning • Tree Partitioning • Prepartitioning

24.6 24.7

Postmeshing Interfaces Conclusion

24.1 Introduction Scalable parallel computers have enabled researchers to apply finite element and finite volume analysis techniques to larger and larger problems. As problem sizes have grown into millions of grid points, the task of meshing models on a serial machine has become a bottleneck for two reasons: (1) it will take too much time to generate meshes, and (2) meshes will not fit in the memory of a single machine. Parallel mesh generation is difficult, because it requires the ability to decompose the domain to be meshed into subdomains that can be handed out to processors. This is referred to as partitioning. Partitioning in the context of parallel mesh generation is hard because it has to be done with an input that is either a geometric model or a surface mesh. This means one is trying to partition a 3D domain having only the knowledge of its boundary, at least initially. In contrast, it is much easier to partition a 3D mesh, which is what finite element or finite volume parallel solvers typically do. Proper evaluation of the work load is also a challenge in parallel mesh generation. It is problematic to accurately predict the number of elements to be generated in a given subdomain, or how much computation per element will be required. This leads to difficulties in maintaining good load balance at all times. There are two types of commercially viable parallel architectures: (1) distributed memory, and (2) shared memory [11]. Distributed memory machines are such that each node has its own local memory. They are often associated with message passing libraries, such as MPI [1]. With a message passing library, the programmer is explicitly responsible for communicating data across processors if needed. With a shared memory machine, there is a global address space that each node can read and/or write to. To gain full efficiency, and reduce communication (at the machine level) to a minimum, on today’s shared memory computers, the programmer may have to arrange the data in a specific form depending on how the problem is partitioned. Also, high-level programming languages, such as FORTRAN 90 [12], may not be well-suited for parallel mesh generation because of the lack of a static structure to the problem. In the following, focus is given to the distributed memory parallel architecture. It is assumed parallelism is driven by a message passing library, and in particular, MPI [1].

©1999 CRC Press LLC

The next two sections discuss the requirements that any parallel mesh generator should fulfill and how parallel mesh generators can be classified into three separate classes. The following three sections describe parallel mesh generation techniques presented in the literature using this classification. The last section will conclude this chapter with remark and comments.

24.2 Requirements for Parallel Mesh Generation The ideal parallel mesh generator should be 1. Scalable with respect to time and memory 2. Efficient in a parallel sense 3. Stable A process is considered “time” scalable if the running time increases slowly with the number of processors, assuming the ratio of problem size to number of processors stays constant. As an example, a process with a complexity of O((n/np)log(np)), where n related to the problem size and np is the number of processors, is scalable since the log(np) term increases slowly with np. The same concept applies to “memory” scalability. The memory requirements on a single processor should increase slowly as the problem size increases with the number of processors at the same rate. Scalability is an absolute requirement. If the parallel procedure is not scalable, there will be a limit, sooner or later, on how big a problem can be. Parallel efficiency refers to how well the parallel procedure makes use of the computing resources that are available [11]. Idling processors should be avoided as much as possible. Parallel efficiency is usually related to how well the work load is balanced across the available processors (load balancing). Parallel efficiency should not be confused with “sequential” efficiency, which relates to “sequential” algorithms and has nothing to do with parallelism. In the following, efficiency will refer to parallel deficiency unless noted otherwise. Parallel efficiency is not an absolute requirement but is very desirable. Note that a parallel procedure can be scalable but inefficient, and vice-versa. Stability is with respect to the quality of the produced triangulations. If the quality degrades as the number of processors increases, the parallel mesh generator is not stable.

24.3 Classification of Parallel Mesh Generators Parallel unstructured mesh generators presented to date all employ the concept of domain partitioning. Figure 24.1 shows a partitioned domain in 2D as well as the associated partition graph obtained by connecting neighboring subdomains with a graph edge. Typically, a processor will be given the task to mesh a subdomain. What differentiates the various approaches is how they treat the interfaces between subdomains. In this paper, three classes of parallel unstructured mesh generators are considered: 1. Those that mesh interfaces as they mesh the subdomains 2. Those that premesh the interfaces 3. Those that postmesh the interfaces The first class of parallel mesh generators refers to those that neither premesh nor postmesh interfaces. Interfaces are meshed at the same time as subdomains. In the second class, objects are partitioned in such a way that subdomain meshing requires no communication. This is possible by meshing interfaces before the subdomains. In the third class subdomains are meshed, and interfaces are left out for later processing.

24.4 Meshing Interfaces Along with subdomains The parallel implementations of the Bowyer–Watson algorithm [2, 21] (see Chapter 16) by Chrisochoides and Sukup [4] and Okusanya and Peraire [13] are examples of meshing interfaces at the same time as

©1999 CRC Press LLC

FIGURE 24.1

FIGURE 24.2

Example of partition in 2D.

Delaunay insertion in 2D.

subdomains. The input is a distributed initial mesh that is boundary conforming. It should be noted that this initial mesh could potentially be obtained using the same algorithm, assuming a parallel boundary recovery procedure is available [9]. Assuming element sizes have been prescribed across the domain, any mesh edge in the triangulation that is too long is refined by inserting one or more vertices along the edge using the Bowyer–Watson algorithm [10]. In practice, imposed sizes are stored in a secondary structure such as a background grid or a tree (see Chapter 14 and 15). It should be noted that if the number of grid cells or octants is proportional to the size of the input, the grid or tree has to be distributed to ensure “memory” scalability. Given a point to insert, the Bowyer–Watson algorithm proceeds as follows (in two dimensions): 1. Find one mesh face that contains the new point. 2. From that mesh face, find all mesh faces whose circumcircles contain the new point using mesh adjacency. 3. Delete the mesh faces (this creates a cavity). 4. Connect the boundary edges of the cavity to the new point. A graphical description is given in Figure 24.2. If the mesh is distributed, the insertion of a new point on a given processor may not be possible if the cavity extends to neighboring processors due to the mesh being distributed. The parallel Bowyer–Watson algorithm as described by Chrisochoides and Sukup [4] operates by looping over the following inner loop:

©1999 CRC Press LLC

for each point to insert do get triangle that contains it perform task: expand cavity if cavity cannot be obtained then add uncompleted task to blocking-queue send a request to neighboring processor(s) for needed triangles else then delete cavity connect cavity’s boundary to point endif poll for pending requests put received requests (if any) in ready-queue move any task from the blocking-queue which has been serviced (by a neighboring processor) to the ready-queue while ready-queue not empty do perform task if task can be serviced on processor then notify requesting processor that task has been serviced endif endwhile endfor The blocking-queue contains tasks that are suspended due to missing information residing on other processors. The ready-queue contains tasks that can be performed on a processor. Tasks can switch from the ready-queue to the blocking-queue, and vice-versa. The complete procedure is actually an outer loop that adds to the inner loop the processing of the ready-queue and a check for termination. The outer loop is needed since some processors may still have points to insert while others are done. This procedure has been implemented using Active Messages [3] on the IBM-SP2. From Chang et al. [3], “Active Messages is a low-latency communication mechanism that minimizes overheads and allows communication and computation to be overlapped in multiprocessors.” With Active Messages, a processor must poll for pending messages. If the poll is a hit, the message is received. Polling induces negligible overhead (at least on the IBM-SP2). This procedure is scalable since a processor usually needs to communicate with its neighbors when inserting a point close to the partition boundary. This is usually true if the partitions are initially, and remain, “bulky.” A “bulky” partition is such that the ratio of surface to volume is high. For this procedure to work well, and therefore have a chance to be efficient, communication must overlap computation well. Beside this communication/computation overlapping issue, the efficiency of the above procedure depends upon how well the computation load is distributed. It is difficult to evaluate how much work is needed to “refine” a subdomain, or more exactly, how many vertices a processor will have to insert. It is assumed that the work required to insert a point is, on average, constant. Note that the number of vertices to be inserted on a subdomain is proportional to the number of elements that will be generated. A rough estimate of the number of elements that need to be generated on a given subdomain can be obtained after building a secondary structure such as a quadtree (in 2D) from imposed sizes that, for example, satisfies the maximum 2:1 level of difference rule. This tree construction is similar to the one described in [5]. The number of interior and boundary terminal quadrants (in 2D) provides a rough estimate of the number of elements that will be generated on the subdomain. Here load balancing is more difficult, since work on a given processor may be induced by a neighboring processor. This

©1999 CRC Press LLC

typically happens when points are inserted near partition interfaces. It is assumed that, for a given processor, the work induced by neighboring processors should average out the work the processor itself has relayed to neighboring processors. This means that points to be inserted near interfaces should be evenly distributed among processors. Although very different from interface postmeshing, discussed later, this raises the same basic issue of how to partition the interface for proper load balance. Another issue related to efficiency is how much time is spent updating the various mesh data structures as neighboring processors answer to sent requests. The updating procedures must be very fast, typically as fast as the deletion and creation procedures used in the course of the Bowyer–Watson algorithm. This parallel Bowyer–Watson algorithm is stable with respect to triangulation quality as the number of processors increases since (1) the Delaunay triangulation is unique for a random input, and (2) no interior artificial boundaries are introduced (see Section 24.5 for when this happens).

24.5 Premeshing Interfaces This class has been further subdivided into three subclasses depending on how the partitioning into subdomains is performed: 1. Partitioning of an initial coarse mesh 2. Partitioning of a background tree 3. Direct partitioning (prepartitioning) of the input surface mesh

24.4.1 Initial Coarse Mesh Partitioning A commonly used approach [7, 22] consists of the following: 1. 2. 3. 4. 5. 6. 7.

Generate a coarse initial mesh. Partition that coarse mesh into np subdomains. Refine interface edges of coarse mesh to proper sizes. Distribute the subdomains to the np processors. Mesh subdomains. Optimize locally the submeshes. Optimize globally the assembled mesh.

Figure 24.3 gives a graphical description of the procedure. Initial mesh generation, partitioning, and global optimization are performed on one processor (host), and are therefore not scalable. Subdomain mesh generation and local mesh optimization phases are performed in parallel. These steps are scalable. The partitioning of the coarse mesh should be such that the subsequent parallel subdomain mesh generation phase is load-balanced. This is a difficult task. The best one can do is to define heuristics to estimate the number of elements the mesher will generate on a given subdomain. If partitioning is done well, then it is expected that the speed-up will be nearly perfect for the subdomain meshing generation. It is important to keep in mind that the quality of the meshes generated should not degrade as the number of processors increases. This is a concern since this form of partitioning produces “artificial” boundaries. A constrained Delaunay mesher is usually likely to be minimally influenced by these artificial boundaries as long as they are not too close to “natural” boundaries. On the other hand, an advancing front method is likely to create triangulations that degrade is artificial boundaries multiply. This is due to the nature of the advancing front method which has, in general, a tendency to create poor elements as fronts collide [7]. To alleviate this problem, it is necessary in this case to optimize the mesh.

24.4.2 Tree Partitioning Saxena and Perucchio [14] suggest a tree decomposition of the geometric model to drive the parallel meshing process. Here the input is a geometric model, not a boundary mesh. In 3D, the terminal octants

©1999 CRC Press LLC

FIGURE 24.3

Meshing of subdomains coming from the partitioning of an initial coarse mesh.

FIGURE 24.4

Example of model face and octant face loops.

are such that their sizes correspond to the sizes imposed by the meshing attributes. Interior terminal octants are meshed using meshing templates. Terminal octants that interact with the domain’s boundary (boundary octants) are intersected with the model and then meshed using either a meshing template or an element extraction technique. The interaction between a boundary terminal octant and the model results in the creation of model face loops and interior (to the model) octant face loops [16]. Figure 24.4 shows model face loops and octant face loops for an octant that interacts with three model faces joining at a model vertex. The set of interior and boundary octants is partitioned among the available processors. The process of intersecting boundary terminal octants with the model and meshing the terminal octants is performed in parallel and without communication. Since an octant face can be shared by several processors (two if the tree is uniform) and meshes on interfaces have to match, care must be taken when meshing octant face loops. The Delaunay triangulation is very attractive here since it is unique, assuming vertices are not in a degenerate situation (four vertices forming a rectangle). Because octant faces are rectangles, it is likely a loop on an octant face has degeneracies. By inserting loop vertices in a given order, the uniqueness of the Delaunay triangulation can again be guaranteed [15]. Note that the meshing of model face loops does not require any such consideration since model face loops cannot be on interfaces. Once octant ©1999 CRC Press LLC

FIGURE 24.5

A separator and its associated triangulation in 2D.

face loops and model face loops have been meshed, interiors of octants are meshed with meshing templates or element extraction techniques. Octree generation and partitioning are performed sequentially, and are therefore not scalable. It should be noted that a parallel scalable procedure to perform both at the same time is described later in the present chapter. The subdomain meshing procedure is performed in parallel and is scalable. The performance of the parallel steps of the meshing procedure depends upon how well the partitioner can anticipate how much work will be spent meshing an octant. It is easy to figure this out for an interior octant. It is, however, difficult to estimate how much work will be spent on meshing a boundary octant since one does not know a priori how complex the interaction with the model will be. Stability of the meshing procedure (with respect to triangulation quality) is not an issue here, since identical meshes are created irrespective of the number of processors.

24.4.3 Prepartitioning Galtier and George [8] prepartition a surface mesh by triangulating appropriately placed separators. A separator cuts a domain into two parts. Given a surface mesh and a separator (say, a plane), the triangulation of the separator is such that 1. It separates, without modification, the initial surface mesh into two subsurface meshes. 2. Sizes of mesh entities on the separator are consistent with imposed sizes. The separator is not triangulated in the usual sense. The geometry of the separator is used to guide the meshing of the domain, defined by the input surface mesh, in the vicinity of the separator. The triangulation associated with the separator is made of triangles. In other words, a separator and its associated triangulation have the same dimension. Figure 24.5 shows a line separator and its associated triangulation (dashed line segments ) when the input is a 2D polygonal mesh (solid line segments). How separators are actually meshed is explained next after a short discussion of the properties of the “projective” Delaunay concept. (Delaunay mesh generation is covered in Chapter 16.) The technique used to mesh the separator is based on a rather new concept, referred to as “projective” Delaunay. In classic Delaunay, given a set of vertices in 3D, the Voronoï domain at a vertex is defined as the locus of points that are closer to that vertex than to any other vertex in the set. Any two vertices whose Voronoï domains share a side are connected by an edge in the associated Delaunay triangulation. With projective Delaunay onto a surface, given a set of vertices in 3D space, the Voronoï domain at a vertex is defined as the locus of points on the surface that are closer to that vertex than to any other vertex in the set. This defines a Voronoï diagram on the surface. This Voronoï diagram on the surface defines a projective Delaunay triangulation in 3D space. The Voronoï diagram is constructed on the surface and the resulting projective Delaunay triangulation is built in 3D space by connecting vertices whose Voronoï domains on the surface are adjacent. The term “projective” is misleading in this context, since there is actually no projection involved here. Figure 24.6 shows a simple example of “projective” ©1999 CRC Press LLC

FIGURE 24.6

Example of projective Delaunay triangulation with respect to a plane.

Delaunay triangulation when the surface is a plane. Given a set of vertices in 3D space and a separator, only a subset of these vertices are involved in the projective Delaunay triangulation of the separator. This means the meshing of the separator is local to the separator. Given an input surface mesh and a separator, the projective Delaunay triangulation of the separator is obtained as follows: 1. Define the poly-line boundary of what will be the triangulation associated with the separator by intersecting edges of the input surface mesh with the separator. 2. Build the “projective” Delaunay triangulation of the separator using only vertices from the input surface mesh. 3. Recognize the poly-line boundary. 4. Delete any mesh face that is outside the poly-line boundary. 5. Insert additional vertices on edges that are too long according to meshing attributes. Figure 24.7 shows the meshing of a planar separator on a cube. The bottom left picture corresponds to step 2. The bottom right picture corresponds to step 5. Note that only one additional vertex has been inserted. This process is similar to the building of constrained Delaunay triangulations using insertion [9]. If the poly-boundary is not part of the projective Delaunay triangulation, there is no attempt in trying to recover the boundary. If boundary edges are missing, the meshing of the separator is aborted, and an alternate separator is considered. Mesh entities resulting from the meshing of two different separators cannot intersect each other because (1) the two projective Delaunay triangulations are part of the Delaunay triangulation of the set of vertices appearing on these two triangulations, and (2) the Delaunay triangulation is unique. It is assumed there are not Delaunay degenerate situations, that is, more than four vertices on a sphere. However, a mesh entity on a separator can possibly intersect another mesh entity on the surface mesh. If this happens, the meshing of the separate is again aborted. In the context of prepartitioning, if a separator cannot be meshed, a nearby separator can be considered in its place. This means that, even if a specific separator cannot be meshed, the prepartitioner may still succeed. Nevertheless, due to the possible failure of meshing a given separator, there is no real guarantee the prepartitioner will always succeed at placing the separators where they were meant to be. The cost of meshing a separator depends upon the number of generated mesh faces. Two different techniques for prepartitioning are considered [8]: 1. Cuts along a single direction. 2. Recursive cuts. In both methods, the separator surfaces are planes. It should be noted that separators do not have to be planes. A separator plane is always perpendicular to the cutting direction. It can be chosen so that it separates any domain into two subdomains with nearly equal number of surface mesh faces. Given the

©1999 CRC Press LLC

FIGURE 24.7

Meshing of a separator plane on a cube.

surface mesh of a model, the principal axis of minimum inertia that generates the lowest rotation momentum is a good choice for a cutting direction. In the first method, all cuts are made along that axis. In the second method, the first cut is along that axis. This defines two subdomains that can themselves be cut independently along their respective principal axes of inertia, thus, forming four subdomains. Recursive cutting continues until the desired number of subdomains has been obtained. A priori, the desired number of subdomains is equal to the number of processors. Efficient parallelization of the first method requires separators to be sufficiently distant from each other so that there is no interference when meshing them. Each processor, except one, is responsible for the meshing of a separator. Note that this requirement may conflict with proper load balance during the volume mesh generation phase. The cost of meshing the separators in parallel depends on the maximum number (among all processors) of generated mesh faces. This does not scale since, as the number of surface mesh faces increases, the number of mesh faces to generate on a separator increases (at the same rate in the case of uniform sizing) irrespective of how many processors are used. The second method can be easily parallelized with the divide and conquer paradigm [11]. At each recursive cut, one half of the problem goes to one half of the processors. The cost of meshing the first separator (corresponding to the first cut) depends upon the number of mesh faces generated. This again does not scale if only one processor is involved in meshing the separator. Scalability can be achieved only if the meshing of an individual separator can be performed in parallel. This was not discussed [8]. Once prepartitioning is complete, subdomain meshing is performed in parallel and without any communication using constrained Delaunay triangulation in 3D [9]. Note that prepartitioning implicitly distributes the input meshed needed by the volume mesher on each processor. Subdomain meshing is clearly scalable. The quality of generated triangulations may degrade as the number of processors increases. This is due to the fact that artificial boundaries are created that can potentially be close to original boundaries. Because a Delaunay method is used here, the creation of artificial boundaries far enough away from original boundaries will not cause degradation. It is possible to check for closeness of mesh entities as the separators are being meshed and take appropriate decisions. Checking for closeness is, however, expensive and will lower the performance of prepartitioning in terms of speed. ©1999 CRC Press LLC

24.6 Postmeshing Interfaces This technique has been used first by Shostko and Löhner [18]. Given an input surface mesh, a background grid is built serially on processor 0 (host). The role of the background grid is twofold: 1. To keep track of desired element size information in space. 2. To control the parallel execution. The task parallel paradigm drives the parallel mesh generator. Tasks are handed out by a dedicated host processor. Other processors are referred to as nodes. The host processor is responsible for: 1. Building a background grid. 2. Partitioning the background grid in at least np subdomains. 3. Handing out a background grid subdomain along with the front faces it contains to the next available node. The individual np nodes do the following: 1. Mesh background grid subdomains given by the host. 2. Send back to the host the front faces that could not be processed. On a given node, the advancing front method is used to mesh the subdomain defined by the background grid elements. To prevent overlapping of submeshes coming from different nodes, a mesh region will not be created if it crosses the subdomain’s boundary. More precisely, it will not even be created if it is too close. Assuming the distance between interfaces is always large enough, stability of the parallel mesh generation procedure with respect to triangulation quality degradation will be maintained. Subdomains should be such that the rate of success of the advancing front method is as high as possible. This rate of success can be defined as the ratio of front faces for which mesh regions could be created to the total number of mesh faces processed. If this ratio gets too low, nodes spend most of their effort determining that they cannot create mesh regions. Partitioning should define “bulky” partitions, that is, partitions with a low surface-to-volume ratio. Note that, when computing this ratio, only the surface shared by two processors should be considered. A “greedy” algorithm [6] that looks at element adjacency to build subdomains is used here. It should be stressed that this partitioning is performed on one processor. This is fine with respect to scalability as long as the size of the background grid is constant, that is, is not a function of the size of the input mesh. If the size of the background grid depends upon the input surface mesh, partitioning must be performed in parallel for that step to be scalable. Concerning “memory” scalability, if the size of the background grid (number of elements) is of the order of the size of the input surface mesh, the background grid should be distributed. The host-nodes paradigm also poses a problem for scalability. This can be easily seen when the host is handing out subdomains to available nodes for meshing. Assume that the host initially holds n input mesh faces and that it is handing out n/np mesh faces to each processor in turn. The cost of this operation is O(n), which is not scalable. The host-nodes paradigm poses a problem any time the host has to communicate with a nonconstant number of processors at the same time. After the nodes have created the mesh regions within their respective subdomains, the space in between the meshed subdomains remains to be meshed. The “skeleton” of this empty space is made up of the interfaces between the subdomains. In 3D problems, there are three types of interfaces: 1. Faces. 2. Edges. 3. Vertices. Figure 24.8 shows the interfaces after subdomain meshing on a simple 2D example with four processors. In this particular example, there are four edge interfaces and one vertex interface.

©1999 CRC Press LLC

FIGURE 24.8

FIGURE 24.9

Interfaces in 2D.

Interface meshing in 2D using “base” methodology.

The “base” methodology for interface meshing is as follows: for each corner interface do if no adjacent subdomain is marked as being used then mark adjacent subdomains as being used hand out data to next available node (for meshing) endif endfor Implementation-wise, the node is given (by the host node) the background grid elements and the active faces of the subdomains adjacent to the corner interface being considered. This means the node will mesh all interfaces coming to that corner. The “base” methodology is repeated until there are no more interface vertices remaining. Figure 24.9 explains the “base” methodology on a 2D example. What is shown are 16 subdomains belonging to 16 processors. The thicker lines represent interfaces handed out, for meshing, to nodes. To be more precise, each + sign is given to a node for meshing. The cost of one iteration of the “base” methodology is equal (in 3D) to the maximum number of face interfaces coming to a vertex interface times the maximum size of a face interface. The maximum number of iterations is equal to the maximum number of face interfaces coming to a vertex interface. As the

©1999 CRC Press LLC

FIGURE 24.10

Subdomain refinement to improve interface meshing in “improved” methodology.

problem size increases proportionally with the number of processors, one can assume these quantities remain nearly constant. This means that the procedure used for meshing the interfaces is scalable. It is, however, not efficient with respect to parallelism. Considering Figure 24.9, only four processors out of the 16 available can work at meshing the interfaces at the same time. Better efficiency can be obtained by further subdividing the subdomains once subdomain meshing is complete. Figure 24.10 shows the effect of subdomain refinement on interface meshing. Note that the initial subdomains were the same as in Figure 24.9, meaning the vertex interfaces are at the same locations. Comparing with Figure 24.9 where only four processors could be work at the same time, here, all processors can work at the same time. This “improved” methodology leads to better load balance and, therefore, better parallel efficiency. The parallel mesh generator presented by de Cougny, et al. [5] also uses an advancing front method to mesh the volume in between a surface mesh and template-meshed interior octants. Given a distributed surface mesh, the latest version of this procedure builds a distributed octree in parallel [20]. The octree is such that 1. The root octant fully encloses the input mesh. 2. The size of any terminal octant is comparable to the size of the input mesh entities it contains or will contain. 3. There is no more than one level of difference between octant edge neighbors. The purpose of the tree is to 1. Enable data localization during volume meshing 2. Have a quickly defined spatial structure that can be partitioned 3. Use fast octant meshing techniques on interior terminal octants that are more than one element deep from the surface mesh The input for tree building is a distributed array of points in 3D space associated with a tree level. It is referred to as the (point, level) array. This array is built by considering, for each mesh vertex on the input surface mesh, the average length of the connected mesh edges transformed into a tree level. Any length d can be transformed into a tree level by applying the formula, level = log2(D/d) where D is the dimension of the root octant. Tree building is decomposed into two steps: 1. Local root building 2. Subtree subdivision The process for local root building is as follows: 1. Initialize processor set to all processors 2. Create global root octant on each processor in processor set

©1999 CRC Press LLC

3. Initialize control of global root octant to processor set while all processor sets not of cardinality 1 do only consider terminal octants under processor set’s control 4. subdivide (once) any terminal octant that needs to be subdivided 5. assign terminal octants to processors according to “load ratio rule” 6. split processor set into subsets endwhile 7. Delete trees on all processors but 0 8. Migrate terminal octants according to their owning processors The concept of processor sets is an attractive feature of MPI [1]. It enables subdivision of a set of processors into subsets that can run in parallel independently of each other. A processor set can be subdivided into subsets, and each subset can be further subdivided as many times as desired. In step 1, the processor set is initialized to the complete set of processors. Its cardinality is np. The goal of the procedure is to recursively split the processor sets until all processor sets contain a single processor. When a processor set has control of a terminal octant, it means that (1) the terminal octant exists on all processors in the set, and (2) only that set can make decisions regarding whether or not to refine it. In steps 2 and 3, the initial processor set is given control of the root octant. Critical to the effectiveness of the tree-building procedure is what happens within the while loop (steps 4, 5, and 6). Consider a processor set controlling a set of terminal octants. As a reminder, the set of terminal octants exist on all processors in the set at this time. The (point, level) array known to the processor set contains only entries relevant to the set of terminal octants the processor set is responsible for. If necessary, this array can be evenly distributed among the processors in the set for load balance using a simple data migration scheme. In step 4, the decision to refine, or not refine, at terminal octant is made after (1) having each processor in the set examined its (point, level) array keeping track of the maximum level, and (2) having communicated its maximum level with all processors in the set. If the global maximum level is more than the octant’s level, the terminal octant is refined once at this point. The reason why a terminal octant is refined only once is because the tree must be as shallow as possible for subtree building, described next. The shallower the tree at that point, the more efficient the complete tree building procedure will be, since subtree building requires no communication. Once the terminal octants under the processor set’s control have been processed for refinement (new ones are ignored), they are assigned to processors within the processor set according to a “load ratio rule” (step 5) and the current processor set is split into subsets (step 6). The “load ratio rule” attempts to make sure that processor subsets will carry a load, measured by the number of points within the volumes of the terminal octants they will be in charge of, that is close to the load average times the number of processors in the subset. Considering Figure 24.11, if the number of processors in the set is three, then, octants 0 and 1 are assigned to processor 0, octants 2 and 3 are assigned to processor 1 and 2. The processor set is split into two subsets: one containing processor 0 and the other one containing processors 1 and 2. The (point, level) array is redistributed so that (1) each entry ends up on a processor in the subset that is in charge of the terminal octant that contains the point, and (2) processors in subsets hold the same number of entries. This guarantees locality of data and an even distribution of the (point, level) array. Each subset resulting from the split is now considered a processor set in the next iteration of the while loop. This process continues until all current processor sets contain a single processor. The rest of the procedure can then be run without using the concept of processor sets, since they have all been reduced to single processors. In Steps 7 and 8, the current tree is actually distributed by deleting it everywhere except on processor 0 and migrating terminal octants based upon which processors have control of them. This procedure builds a distributed “partial” tree where each terminal octant can be seen as a local root of a constructed subtree. Figure 24.12 shows a distributed “partial” tree in 2D. Each terminal octant exists only on a single processor. Details about the data structure

©1999 CRC Press LLC

FIGURE 24.11

Example for the “load ratio rule.”

FIGURE 24.12

“Partial” distributed tree.

FIGURE 24.13

Complete distributed tree.

used for this distributed tree can be found in [20]. Subtree building, described below, is implicitly load balanced with respect to the (point, level) array, that is, each processor will have approximately the same number of points to insert into its subtree(s). This is due to the “load ratio rule” used in the above procedure for local root building. The process of subtree subdivision is as follows: Each processor is responsible for 1 or more local roots for each (point, level) do get octant(s) the point is in if octant_level < level then refine octant recursively to level endif enddo Each processor builds subtrees rooted at the local roots. These subtrees only exist on the processors they have been built in. Here terminal octants can be recursively subdivided until the desired level is reached. This procedure requires no communication. Figure 24.13 shows the complete tree structure after subtree building in 2D. The cost for local root building is O((n/np)log(np)). The n/np term represents how many (point, level) each processor is holding. The log(np) factor reflects the number of iterations in the while loop. The cost for subtree subdivision is O((n/np)log(n/np)). The n/np term indicates how many (point, level) each processor has to insert into its subtree(s). The log(n/np) term is for tree traversals of the subtree(s). The

©1999 CRC Press LLC

FIGURE 24.14

Template meshing and face removals.

total cost for tree building is dominated by the subtree subdivision cost. Tree building is therefore a scalable process. Terminal octants are classified according to their interactions with the input surface mesh. If a terminal octant has mesh entities from the input mesh within its volume, it is classified boundary. Once all boundary terminal octants have been recognized, any unclassified terminal octant is classified either interior to a model region or outside. Interior terminal octants at least one element length away from the input surface mesh are meshed using meshing templates. Interior terminal octants are partitioned using a parallel recursive inertial bisection procedure, described below, to ensure load balance while meshing templates. The way templates have been designed is such that triangulations on octant faces shared by two processors are guaranteed to implicitly conform. Once interior terminal octants have been meshed, the domain between the input surface mesh and the meshed octants is meshed in parallel by applying face removals. A face removal is the basic operation in the advancing front method which, given a front face, creates a mesh origin. Figure 24.14 graphically shows the two meshing steps of the procedure on a 2D example. It is important to explain how face removals are performed in parallel in order to understand the full parallel face removal procedure. A front face is not removed if the tree neighborhood from which target vertices are drawn is not fully present on processor. This implicitly guarantees this parallel mesh generator is stable with respect to triangulation quality degradation. Face removals can be applied until there is no front face that can be removed. At that point, the tree is repartitioned. The process of applying face removals and repartitioning the tree continues until the front is empty. The parallel face removal procedure is as follows: where there are boundary terminal octants then repartition the boundary terminal octants apply face removals reclassify boundary terminal octants which have no more front faces in their volumes as complete endwhile Tree repartitioning is performed by a parallel recursive inertial bisection procedure [17] based upon the divide and conquer paradigm [11]. The input to the parallel recursive inertial bisection procedure is a set of distributed boundary terminal octants. All processors participate in the first bisection along the axis of minimum momentum. Half the processors are given the task to further bisect the terminal octants before the median. The other half is responsible for the terminal octants after the median. The median is such that it separates the set of boundary terminal octants into two nearly equal parts. Bisection continues until the number of partitions is equal to the number of processors. Terminal octants are migrated according to their destinations. When a terminal octant is migrated, the front faces in its volume

©1999 CRC Press LLC

are migrated to the same destination. If a front face is connected on one side to a mesh region, the mesh region is migrated. The cost of repartitioning n entities is O((n/np)log(n/np)log(np)). This is a scalable process. The (n/np)log(n/np) term comes from sorting the entities along the axis of minimum momentum. The log(np) factor represents how many times recursive bisection needs to be applied. Details about the implementation of this parallel repartitioning scheme can be found in [17]. This repartitioning method has been chosen because (1) it is relatively easy to parallelize, (2) it generates relatively good partitions [19], and (3) it is multipurpose in the sense that it can be used for other applications than parallel mesh generation. Note that other parallel repartitioners could be used. After a face removal step, boundary terminal octants that have been “filled up” with mesh regions are reclassified as complete and do not participate in the next tree repartitioning. The number of available processors for meshing is reduced when the rate of success of the face removal step drops considerably. This rate of success is defined as the ratio of successfully removed faces to tried faces. To study the scalability of the face removal meshing loop, assume that, at each step, the number of processors is reduced by half. Without loss of generality, the initial number of processors is assumed to be a power of two. The proposed face removal meshing loop can only be scalable if the number of octants to repartition is reduced by half at each iteration. Reducing the problem by half at each iteration cannot be guaranteed in theory. Although test case results have shown promising speed-ups for up to 32 processors with removal rates greater than one half for most steps, scalability of the described face removal meshing loop is questionable in a theoretical sense. Scalability can, however, be ensured by explicitly meshing the interface resulting from subdomain meshing. subdomain meshing is the combination of the first partitioning and face removal step. The following procedure to mesh interfaces is similar to the one described by Shostko and Löhner [18]. The main difference resides in the fact that here the host-nodes paradigm is not used. Decision making concerning the repartitioning of interfaces and the actual migration of data is performed in parallel. Interface meshing is hierarchical, that is, face, edge, and vertex interfaces are considered in turn. Also, here, “very” fine-grain parallelism coming from the tree is used to improve parallel efficiency. Since this procedure can be used by other parallel mesh generators, it is discussed without considering the use of template meshing for interior terminal octants. Template meshing on interior terminal octants reduces the sizes of face and edge interfaces, which makes the procedure, described next, more efficient. A face interface can be meshed by migrating to one processor boundary terminal octants that are closer to that face interface than any other face interface. After the face removal step, each processor assigns its remaining boundary terminal octants, that is, those that have not been “filled up,” to its bounding interfaces based on distance consideration. Within a subdomain, any remaining boundary terminal octant is assigned to the closest bounding interface. Figure 24.15 shows the assignment (to interfaces) of boundary terminal octants resulting from subdomain meshing. In this case, the subdomain of interest is bounded by three edge interfaces denoted as 0, 1, and 2. Assignment of boundary terminal octants to face interfaces is performed in parallel by all processors. Figure 24.15 only shows what happens on one processor. The idea is to have each face interface meshed by a single processor by migrating to that processor (unless already there) all boundary terminal octants associated with the face interface. In practice, to avoid unnecessary migration, a processor adjacent to the face interface will be chosen to mesh it. Since the initial partitioning is “bulky” and terminal octants are similar in sizes to the front mesh faces they contain, a priori all face interfaces can be meshed within the same step without interference except at edge and vertex interfaces, which is expected. The work needed to mesh a face interface can be accurately estimated by counting the boundary terminal octants that have been associated with it. This means that good load balance during face interface meshing is possible. The cost for face interface meshing is equal to the maximum number of face interfaces a subdomain has, times the maximum number of elements to be generated on a face interface. As remarked previously, this leads to a scalable procedure. Edge interface meshing uses the exact same methodology and is not described here. Vertex interfaces can efficiently be meshed independently of each other since they have become small and bounded subdomains. Note that the tree is not needed anymore when meshing the vertex interfaces.

©1999 CRC Press LLC

FIGURE 24.15

Assignment of boundary terminal octants to interfaces.

24.7 Conclusion This chapter has reviewed parallel unstructured mesh generation procedures with respect to: (1) scalability, (2) parallel efficiency, and (3) stability relative to triangulation quality. Scalability appears to be a requirement since it guarantees that, as more processors are used, bigger problems can be solved in reasonable clock time. Parallel mesh generation is difficult because there is no real structure than can “perfectly” drive a parallel algorithm. The final structure appears only upon completion with the generated 3D mesh. Parallel mesh generation is also tedious because it usually involves several processes and data structures that all need to be “time” and “memory” scalable, respectively. The parallel mesh generation field is still very young, which means that the algorithms presented in this chapter are probably evolving very fast and completely new algorithms are being written. Because the development of efficient scalable parallel techniques takes much more time than their sequential counterparts, it may take a while before parallel mesh generation comes to a state of maturity.

References 1. Message passing interface forum MPI: a message-passing interface standard, International Journal of Supercomputer Applications and High-Performance Computing. 8(3/4), 1994. Special issue on MPI. 2. Bowyer, A., Computing Dirichlet tessellations, The Computer Journal. 1981, 24, 2, pp 162–166. 3. Chang, C.-C., Czajkowski, G., von Eicken, T., design and performance of active messages on the IBM SP-2, Technical report, Cornell University, 1996. 4. Chrisochoides, N. and Sukup, F., Task parallel implementation of the Bowyer–Watson algorithm, 5h Int. Conf. on Numerical Grid Generation in Computational Field Simulations. Mississippi State University, 1996, pp 773–782. 5. de Cougny, H.L., Shephard, M.S., Özturan, C., Parallel three-dimensional mesh generation on distributed memory MIMD computers, Engineering with Computers. 1996, 12, pp 94–106. 6. Farhat, C. and Lesoinne, M., Automatic partitioning of unstructured meshes for the parallel solution of problems in computational mechanics. Int. J. for Numerical Methods in Engineering. 1993, 36, pp 745–764. 7. Gaither, A., Marcum, D., Reese, D., A paradigm for parallel unstructured grid generation, 5th Int. Conf. on Numerical Grid Generation in Computational Field Simulations. Mississippi State University, 1996, pp 731–740. 8. Galtier, J. and George, P.-L., Prepartitioning as a way to mesh subdomains in parallel, 5th Int. Meshing Roundtable. 1996, Pittsburgh, PA, pp 107–121.

©1999 CRC Press LLC

9. George, P. L., Hecht, F., Saltel, E., Automatic mesh generator with specified boundary, Computer Methods in Applied Mechanics and Engineering. 92, pp 269–288. 10. George, P. L. and Hermeline, F., Delaunay’s mesh of a convex polyhedron in dimension d. Application to arbitrary polyhedra, Inte. J. for Numerical Methods in Engineering. 1992, 33, pp 975–995. 11. Jájá, J., An Introduction to Parallel Algorithms. Addison-Wesley, 1992. 12. Metcalf, M. and Reid, J., Fortran 90/95 Explained. Oxford University Press, 1995. 13. Okusanya, T. and Peraire, J., Parallel unstructured mesh generation, 5th Int. Conf. on Numerical Grid Generation in Computational Field Simulations. Mississippi State University, 1996, pp 719–729. 14. Saxena, M. and Perucchio, R., Parallel FEM algorithms based on recursive spatial decomposition. I. automatic mesh generation, Computers & Structures. 1992, 45(5–6), pp 817–831. 15. Schroeder, W.J. and Shephard, M.S., A combined octree/Delaunay method for fully automatic 3-D Mesh Generation, Int. J. for Numerical Methods in Engineering. 1990, 29, pp 37–55. 16. Shephard, M.S. and Georges, M.K., Automatic three-dimensional mesh generation by the finite octree technique, Int. J. for Numerical Methods in Engineering. 1991, 32(4), pp 709–749. 17. Shephard, M.S., Flaherty, J.E., de Cougny, H.L., Özturan, C., Bottasso, C.L., Beall, M.W., Parallel automated adaptive procedures for unstructured meshes, Special Course on Parallel Computing in CFD. AGARD, 1995, number R-807, pp 6.1–76.49. 18 Shostko, A. and Löhner, R., Three-dimensional parallel unstructured grid generation, Int. J. for Numerical Methods in Engineering. 1995, 38, pp 905–925. 19. Simon, H.D. and Teng, S.-H., How good is recursive bisection, technical report, NASA Ames Research Center, 1993. 20. Simone, M., de Cougny, H.L., Shephard, M., Tools and Techniques for parallel grid generation, 5th Int. Conf. on Numerical Grid Generation in Computational Field Simulations. Mississippi State University, 1996, Vol. II, pp 1165–1174. 21. Watson, D., Computing the n-dimensional Delaunay tessellation with applications to Voronoï polytopes, The Computer Journal. 1981, 24(2), pp 167–172. 22. Wu, P. and Houstis, E.N., Parallel adaptive mesh generation and decomposition, Engineering with Computers. 1996, 12, pp 155–167.

©1999 CRC Press LLC

25 Hybrid Grids and Their Applications 25.1 25.2

Introduction Underlying Principles The Structured Marching Method for Prisms • The Octree-Advancing Front Methods for Tetrahedra

25.3

Best Practices High Speed Civil Transport (HSCT) Aircraft • Adapted Hybrid Mesh • Resolution of Multiple Wakes • Deforming Hybrid Mesh in 2D • Turbomachinery Blade with Tip Clearance • ABB Burner Case

Yannis Kallinderis

25.4

Research Issues and Summary

25.1 Introduction There is an ever-increasing demand to perform flow simulations that incorporate the complete details of geometry as well as sophisticated field physics. The success of numerical flow simulators depends to a great extent on the computational grid that is employed. As a consequence, grid generation has become a task of primary importance. Books and surveys on grid generation include [1–6]. Structured meshes consisting of blocks of hexahedra and unstructured grids consisting of tetrahedra have been the traditional means of discretizing 3D flow domains [2, 3]. Hybrid grids usually consist of prisms and tetrahedra in 3D, and correspondingly quadrilaterals and triangles in 2D. Layers of prisms are employed to resolve boundary layers and wakes, while tetrahedra cover the rest of the domain. Hybrid meshes are intended to provide flexibility by combining essential features of the two broad types of meshes, namely the structured and the unstructured grids [7–15]. Hybrid meshes consisting of triangles and quadrilaterals have been employed in two dimensions in [16–26]. Other hybrid mesh techniques involve generating a mesh made up of tetrahedral and prismatic elements and then destructuring the prisms to form tetrahedra [27, 28]. Adaptation and load balancing for parallel computation of hybrid grids have been presented in [29, 30]. There are a number of issues to be addressed when dealing with turbulent flow simulations involving complex geometries. These considerations include: (1) the different orientation of the viscous flow features, (2) the disparate length scales that need to be resolved within the same domain, (3) the requirements of the Navier–Stokes solvers, (4) the grid generation time, (5) the required user expertise, as well as (6) the university of application of the grid generator. The main features that are encountered in flow fields include boundary layers, wakes, shock waves, and vortices. These features have different orientations that make generation of a single grid that conforms to them very difficult. In addition, the mesh has to follow the boundaries of the computational domain. A hybrid grid that combines elements of different orientation appears to be much more flexible in

©1999 CRC Press LLC

conforming to the flow features. The prisms are assigned the task of capturing the features that are following the body surface, while the tetrahedra are used for the features that are away (e.g., shocks and vortices). The different spatial scales encountered in viscous flows vary by orders of magnitude from each other. These scales are imposed by the flow features and the geometry. The laminar sublayer requires placement of grid points at distances away from the wall of the order of 10–6 times the scale of the geometry, while the points at the farfield may be at a distance of order 1 from one another. Shock waves and vortices have very different scales as well. Furthermore, the details of the geometry frequently impose scales on the grid generator. The gaps between the main wing and the flap and the tip clearances in turbomachinery geometries are typical examples of small scales. The issue becomes even more complex when taking into account the directionality of the different scales. The small scale required in the boundary layers is in the direction normal to the surface, while much larger sizes of the mesh are sufficient in the lateral directions. Similar directionality also exists in wakes and shock waves. This directionality leads to the issue of generating high aspect ratio grid cells. Generation of thin prismatic grids for the boundary layers and wakes has the advantages of being feasible and fast, and also results in a smaller number of elements compared to tetrahedra. On the other hand, the isotropic nature of tetrahedra appears to be appropriate for the vortices and other regions of the domain where the flow is changing equally in all directions. Navier–Stokes solvers place strict requirements on the mesh. Accuracy and stability of the numerical methods depend crucially on the local resolution and the uniformity of the grid. Smooth transition of element sizes at the prism/tetrahedra interface is important for accuracy and robustness of Navier–Stokes numerical methods [8, 9]. Furthermore, computing resources in terms of CPU time and memory storage are dictated by the number of grid elements. These facts place several requirements on mesh generation. Employment of the thin semistructured prismatic elements in the regions of shear layers results in sufficient accuracy with significantly reduced computing resources compared to all-tetrahedral meshes. The flow field on the body surface usually contains regions of strong flow directionality such as the leading and trailing edges of a wing. Generation of anisotropic surface grid elements results in significant savings in the number of elements without sacrificing accuracy. Minimum user expertise and universal application are also primary considerations placed on grid generators. A generation method must use a relatively small number of control parameters whose effects are obvious even to an inexperienced user. It is highly desired that a grid generation method be applicable to a great variety of geometries without modification. Furthermore, the setup time to apply the generator should be kept to a minimum.

25.2 Underlying Principles The hybrid grid generator consists of two major parts: (1) the prisms generator, which is an algebraic, marching-type technique, and (2) the tetrahedra generator which is an advancing front type of method (see Chapter 19). Details of the two techniques can be found in [6, 8, 9].

25.2.1 The Structured Marching Method for Prisms An unstructured triangular grid is employed as the starting surface to generate a prismatic mesh. This grid, covering the body surface, is marched away from the body in distinct steps, resulting in generation of semistructured prismatic layers in the marching direction (Figure 25.1). The process can be visualized as a gradual inflation of the body’s volume. A major issue with marching methods is the avoidance of crossing of the grid lines. There are three main aspects of the algebraic grid generation process: (1) determination of the directions along which the nodes will march (marching vectors), (2) determination of the distance by which the nodes will march along the marching vectors, and (3) smoothing operations on positioning of the nodes on the new layer.

©1999 CRC Press LLC

FIGURE 25.1

FIGURE 25.2

Generation of a prismatic grid from a triangular boundary surface.

Example of the manifold of point Pi and its corresponding visibility region.

25.2.1.1 Determination of the Marching Vectors Each node on the marching surface is advanced along a marching vector. The marching direction is based on the node-manifold, which consists of the group of faces sharing the node to be marched. The primary criterion to be satisfied when marching is that the new node should be visible from all the faces on the manifold (visibility condition) [7]. An example of a manifold and its corresponding visibility region is shown in Figure 25.2. The dark-shaded region is the manifold of node Pi, and the polyhedral cone above the node is the visibility region. The vector, Vi, is one possible node-normal satisfying the visibility constraint. The node-normal vector lies on the bisection plane of the two faces on the manifold that form the wedge with the smallest angle. This process has yielded consistently valid normal vectors at the nodes by constructing the vector most normal to the most acute face planes. Essentially, it does this by

©1999 CRC Press LLC

maximizing the minimum angle between the node-normal and all the surrounding face normals. This vector is then used as the marching direction for the nodes on the surface to form the new layer. A more detailed description of the marching procedure can be found in [7]. 25.2.1.2 Marching Step Size Determination of marching distances is based on the characteristic angle βave of the manifold of each node to be marched. This angle is computed using the average dot product between the pairs of faces forming the manifold. The marching distance is a linear function of βave. It yields relatively large marching steps in the concave regions, and small steps in the convex areas of the marching surface. Specifically, the distance ∆n is:

∆n = (1 + α )∆nave ,

(25.1)

where ∆nave is the averaging marching step for the layer, and α is a linear function of the manifold angle βave. The sign of α is positive for concave regions and negative for convex regions. The average marching step for each layer (j), ∆nave is computed based on a user-specified initial marching step ∆no on the body surface and a stretching factor st, as follows: j ∆nave = ∆no × st ( j −1) .

(25.2)

25.2.1.3 Smoothing Steps The initial marching vectors are the normal vectors. However, this may not provide a valid grid, since overlapping may occur, especially in concave regions of the grid surface with closely spaced nodes. To prevent overlapping, the directions of the marching vectors must be altered. Altering of the directions should not end abruptly in the local neighborhood of the nodes involved, since this may cause overlapping in nearby regions. A gradual reduction of the magnitude of the change in the vector direction is accomplished via a number of weighted Laplacian type smoothing operations over the marching vectors of all nodes. Typically, ten smoothing passes are performed. These smoothing steps rotate each original marching vector based on the normal vectors of its surrounding manifold nodes as follows:

r r Vi = ωVi ′+ (1 − ω )

1 ∑ j 1 dij

r

∑ (1 d )V , ij

j

(25.3)

j

r r r where Vi ′ and Vi are the initial and final marching vectors of node i, while Vj are the marching vectors of the surrounding nodes j that belong to the manifold of node i. The weighting factor ω is a function of the manifold characteristic angle βave. It has small values in concave regions, and relatively large ones in convex areas. The averaging of the marching vectors of the neighboring nodes is distance-weighted with dij denoting the distance between nodes i and j. A similar procedure is employed for the smoothing of the marching steps ∆n to eliminate abrupt changes in cell sizes.

25.2.1.4 Constraints Imposed to Enhance Quality Typical Navier–Stokes integration methods impose restrictions on the spacing of the points along the marching lines and on the smoothness of these lines. In other words, the prismatic grid should not be excessively stretched or skewed. Constraints are imposed on the lateral and normal distribution of marching step sizes and the deviation of the direction of the marching vectors from one layer to the next. The lateral distribution of cell sizes are constrained so that any node on the current marching surface cannot have a step size (∆ni) that is very different from the size (∆nj) corresponding to any of its surrounding nodes. Specifically,

0.5 × ∆n j < ∆ni < 2.0 × ∆n j , ©1999 CRC Press LLC

(25.4)

The constraints on the step size variation along each marching line are applied in a similar manner. A node on the prismatic layer j cannot have a step size that is smaller than that on the previous layer (j – 1). Also, it cannot exceed the size of the previous step by more than a factor of stmax (usually set to 1.3). Specifically,

∆n j −1 < ∆n j < stmax × ∆n j −1 .

(25.5)

r r Another constraint limits the deviation between two consecutive marching vectors Vj−1 and Vj to be less than a specified angle (typically 30°). The above-mentioned constraints reduce “kinks” in the marching vector directions as well as abrupt changes in step sizes, thus providing a smooth mesh suitable for viscous flow computations. Since the visibility criterion is the ultimate test for the validity of the mesh, this criterion is the final constraint imposed on the grid.

25.2.1.5 Automatic Adjustment of the Prism Layer Thickness Treatment of narrow gaps and cavities in regions such as wing–engine configurations and in between different bodies in multiply connected domains has been a major concern for structured and semistructured mesh generators. The structured nature of prisms prohibits filling such complex geometries without overlapping layers if special measures are not taken. A method has been developed that adjusts the marching step of the prism layers for the treatment of such gaps [8]. The technique allows entirely automatic generation of single-block, nonoverlapping prismatic meshes. Two key features of the method are no user interaction and universality of its application to different geometries. The nodes in the vicinity of a cavity are detected by a special algorithm. The marching distances of these flagged nodes are reduced so that the mesh does not overlap. This may result in prismatic meshes of significantly varying local thickness. Smooth variation of the thickness is attained via lateral smoothing of the size of the marching steps. The local thickness of the prism layer in the cavity or gap region is reduced to avoid overlapping prism layers. This is done by recomputing the initial marching distance ∆no for all the flagged nodes according to the following equation:

∆no =

C1 × dG , ∑ jst ( j −1)

(25.6)

where dG denotes the gap distance computed by a special gap-detection algorithm, C1 is a user- specified constant controlling the extent of reduction (usually chosen to be 0.25), st is the stretching factor, and j is the prism layer index. Thus, the total thickness of the prism layers in the vicinity of the gap is approximately C1 × dG, with slight variations depending on the local curvature of the marching surface. The exact step size for every node on each layer is then determined by Eqs. 25.1 and 25.2. In order to avoid abrupt changes in the thickness of the prism layers due to the local receding, the unflagged nodes in the neighborhood of the cavity are also receded to a certain extent. This extent gradually reduces to zero as the nodes get farther away from the cavity or gap.

25.2.2 The Octree-Advancing Front Methods for Tetrahedra A combined octree-advancing front method is used to generate the unstructured grid [9]. Advancing front type methods require specification by the user of the distribution of three parameters over the entire domain to be gridded. These field functions are (1) are node spacing, (2) the grid stretching, and (3) the direction of the stretching. Using the octree-advancing front method, these parameters do not need to be specified. Instead, they are determined via an automatically generated octree. The octree is constructed via a divide-and-conquer process, which starts with a master hexahedron that contains the body. This hexahedron is recursively subdivided into eight smaller hexahedra called octants. ©1999 CRC Press LLC

Any octant that intersects the body is a boundary octant and is subdivided further (inward refinement). The subdivision of a boundary octant ceases when its size matches the local length scale of the geometry. The choice of the local length scale depends on the particular application of the octree. The length scale can be chosen to be local prism thickness, edge length, or curvature. This flexibility allows the same octree creation technique to be used for many different unstructured applications. Then, the hexahedral grid is further refined in a balancing process (outward refinement) to prevent neighboring octants whose depth differs by more than one. Outward refinement is performed to ensure that the final octree varies smoothly in size away from the original surface. The sole criterion for outward refinement is a depth difference greater than one between the octant itself and any of its neighbors. The outward refinement continues until no octants meet the refinement criterion. Typically, five sweeps are performed to produce a balanced octree. The octree data structure is similar to earlier data structures used for search operations during the grid generation process [31] (see Section 14.4.2.1 of Chapter 14). Two important features of the octree-advancing front method are its capability to match disparate length scales and its geometry independence. The octree is able to insure a smooth size transition over the large range of length scales which are present in a “viscous” mesh. The octree is also able to be used for many different types of geometries with minimal user interaction. 25.2.2.1 Length Scales Octree refinement is terminated when the size of a boundary octant is the same size as the local length scale of the geometry. This local length scale depends on the application. Three different applications are considered, namely, surface mesh generation, tetrahedral mesh generation for hybrid grids, and all tetrahedral mesh generation. For surface mesh generation, the local length scale is determined by the local curvature of the geometry. This length scale is small in areas where the curvature is large, i.e., the trailing edge of a wing, and large where the geometry is flat. The distance between surfaces is another length scale used for surface mesh generation. The local length scale is proportional to this distance. This allows for automatic clustering in regions where surfaces are in close proximity. For hybrid prismatic/tetrahedral mesh generation, the local length scale is simply the local thickness of the last prismatic layer. This will ensure that the size of the tetrahedra in the direction normal to the outer prismatic surface is the same as the height of the neighboring prisms. This smooth transition in size from the prisms to the tetrahedra is important for accuracy of the numerical method. Finally, for an all tetrahedral mesh, the local length scale is the local edge length of the original triangulated surface. The octree-advancing front method can also be used to create meshes for inviscid simulations. Given an initial surface triangulation, the octree is refined until the boundary octants match the size of the local surface triangulation. Figure 25.3 shows plane cuts of the octree for two different geometries. The first case corresponds to the High Speed Civil Transport (HSCT) aircraft, while the second to a two-element wing. A plane cut of the prismatic part of the hybrid mesh is also shown. The size of the octants intersecting the outermost prismatic surface matches the thickness of the last prismatic layer, even in the region of the engine where the thickness of the prisms is several orders of magnitude smaller than their thickness away from the engine. The same observations apply to the second case of the two-element wing. 25.2.2.2 Octree Guides Advancing Front Mesh Generation The advancing front volume grid generation starts from the surface of the body or the outermost prismatic surface for the case of a hybrid grid. The triangular faces of this surface form the initial front list. A face from this list is chosen to start the tetrahedra generation. Then, a list of points is created that consists of a new node, as well as of “nearby” existing points of the front. One of these points is chosen to connect to the vertices of the face. Following the choice of the point, a new tetrahedron is formed. The list of the faces, edges, and points of the front is updated by adding and/or removing elements [32]. The method requires a data structure that allows for efficient addition/removal of faces, edges, and points, as well as for fast identification of faces and edges that intersect a certain region. The alternating digital tree (ADT) algorithm is employed for these tasks [33] (see Section 14.25.4.3 of Chapter 14).

©1999 CRC Press LLC

FIGURE 25.3 Plane cuts of octree meshes. The top figure shows a plane cut of an octree mesh for the HSCT aircraft. The bottom figure shows a plane cut of an octree mesh for the partial-flap high-lift wing at mid span of the flapped region. Both figures show how the octant sizes match the local thickness of the final prismatic layer. Every third layer of the prismatic mesh is shown for clarity of the figure.

The tetrahedra that are generated using this octree method grow in size as the front advances away from the original surface. Their size, the rate of increase of their size, as well as the direction of the increase, are all given from the octree. The octants are progressively larger with distance away from the body. Their sizes determine the characteristic size of the tetrahedra that are generated in their vicinity. This method is flexible and can be used to generate tetrahedra around different types of geometry. The surface mesh generation proceeds in the same manner as the tetrahedral mesh generation, except that surface triangles are generated from an initial front made up of edges [32]. The surface geometry is treated as a patchwork of CAD panels (see Chapter 19 and Part III). An interface is required between the CAD representation and the surface grid generator. The interior of each panel is filled with triangles using the same octree for each panel to insure smooth size transitions across panel boundaries. New triangles are generated using either already existing points, or new points generated on the surface using information from the octree. The octree allows for a smooth transition in size on the surface from areas where the triangles are small (i.e., trailing edge) to areas where the triangles are larger. The advancing front method creates a new element by connecting each face or edge of the current front to either a new or an existing node. This new point is found by using a characteristic distance δ calculated from the size of the local octant to which the face of the front belongs. Specifically,

©1999 CRC Press LLC

δ = αst ( t ) , l −l

(25.7)

where α is a scaling factor, st is the stretching parameter, lt is the total number of octant levels, and l is the level of the local octant. The value of st controls the rate of growth of the mesh. The lower the value of st, the less the mesh increases in size away from the body. A typical value of the stretching parameter st is 1.8. The level l of the local octant is the number of subdivisions of the master octant required to get to the size of the local octant. For hybrid mesh generation, smooth transition in size from the prisms to the tetrahedra is important for accuracy of the numerical methods. The value of the scaling factor α is calculated so that the initial marching size (δ ) of the tetrahedra equals the local thickness of the outermost prismatic layer. For surface mesh generation, α can be varied to generate different meshes using the same octree. Higher values of α result in coarser meshes, while lower values of α yield finer meshes. Both the coarse and fine meshes will have similar local variation of the sizes of the surface triangles. 25.2.2.3 Anisotropic Surface Meshes The octree-advancing front method can also create anisotropic surface meshes. Anisotropic meshes are useful in reducing the number of triangular faces needed to capture all the flow features in a simulation. Allowing high aspect ratio triangles aligned with geometry and flow features in regions that exhibit strong directionality enables a substantial savings in number of both surface and volume grid elements. A user only needs to specify the following: (1) a line segment that defines the direction of the stretching of the mesh, (2) the aspect ratio (AR) of the triangles desired along that line segment, and (3) the area of influence (dmax) of the line segment. Examples of such line segments include the leading edges, trailing edges and engine inlets. The method for generating anisotropic meshes starts with the size, δoct , given by the octree and augments it with the perpendicular distance, d from the user-specified line segment. The local mesh size is now characterized by three sizes, δ 1, δ 2 and δ 3 given by

δ1 = c × δ oct δ 2 = δ oct δ 3 = δ oct ,

(25.8)

with

c=

AR − 1 d + AR, dmax

(25.9)

and δ 1 is the size of the mesh in the direction of the line segment, while δ 2 and δ 3 are the sizes of the mesh in directions perpendicular to the line segment and perpendicular to each other. The method is flexible and robust using multiple line segments at different locations and directions to define directionality on different parts of the surface. Furthermore, it provides a smooth transition between regions of different directionality. Figure 25.4 shows both an isotropic surface mesh for the M6 wing and an anisotropic mesh created with line segments extending over the entire leading and trailing edges with the same aspect ratios as the previous mesh. The isotropic mesh has 39,290 faces while the anisotropic mesh has 6333 faces while maintaining the same chord-wise point density obtained from the same octree. These meshes show the 6.2:1 reduction in the number of generated faces when an anisotropic method is used. This reduction in faces leads to a substantial reduction in the number of elements of the corresponding volume mesh. 25.2.2.4 Automatic Partial Remeshing Grids generated using an advancing front type scheme can contain regions of low quality within the mesh domain. These low-quality regions must be altered before the mesh can be used with a flow solver. A method for improving low quality regions has been developed [9]. This method removes low quality regions from the mesh and fills the resulting cavities using the same advancing front generator on the new front defined by the surface of these holes. ©1999 CRC Press LLC

FIGURE 25.4 Significant savings in number of triangles are realized due to the use of leading- and trailing-edge line segments for the ONERA M6 wing. The top mesh is an isotropic mesh with 39,290 faces. The bottom mesh is an anisotropic mesh with only 6,333 faces. Note that even though the isotropic mesh has six times the number of faces, the anisotropic mesh has the same chordwise point distribution.

In order to properly define the low quality regions of the mesh, the quality of a given region must be quantified. There are several measures of mesh quality. One such indicator that has been used is the volume ratio of the two tetrahedra sharing each face, R = Volmax/Volmin. Large values of R indicate a very stretched mesh. If R = 1, the mesh is locally uniform. Once the low quality regions of the mesh have been located using the quality measure R, these regions must be removed from the mesh. For each face with a value of R greater than a user-specified value, Rsp, a cavity is opened around the low quality region by removing tetrahedra. The radius of the opened cavity is dependent on the local length scale of the mesh. After cavities have been formed around each of the low quality regions of the mesh, the exposed triangular faces inside the cavities are put together to form a new initial front. Then, the advancing front generator refills the cavities with better quality tetrahedra. This process of cavity definition and cavity remeshing is repeated until a specific level of quality is reached. The entire process of cavity definition and remeshing is performed automatically with no user intervention. The remeshing process is efficient and typically takes a quarter of the time that the initial tetrahedral generation requires.

25.3 Best Practices This section presents applications of hybrid grids that include both external and internal geometries. The cases are chosen in order to demonstrates the suitability of the hybrid grids for complex geometries, as

©1999 CRC Press LLC

FIGURE 25.5 Anisotropic surface mesh for the HSCT with engines. The figure shows the anisotropic regions near the leading and trailing edge of the wing. The mesh has 30,189 faces, while a similarly spaced isotropic mesh would have 60,583 faces.

well as the robustness and generality of the generator to yield meshes for very different topologies. The specific cases are: (1) an aircraft configuration, (2) an adapted hybrid mesh, (3) resolution of multiple wakes past a wing, (4) a deformable hybrid grid in two dimensions, (5) a turbomachinery blade with tip clearance, and (6) a burner.

25.3.1 High Speed Civil Transport (HSCT) Aircraft The High Speed Civil Transport (HSCT) aircraft is a next-generation aircraft being designed to travel at supersonic speeds. It has a double-delta wing configuration emerging from the nose. The cavity between the engine and the wing presents a challenge in grid generation. An example of a locally directional surface mesh for the aircraft is illustrated in Figure 25.5. It is observed that the method generates a reduced number of points on the wing in the spanwise direction while maintaining a large number of nodes in the chordwise direction. A strongly directional mesh has been generated primarily in the leading and trailing edge regions of the wing. A view of the hybrid mesh is shown in Figure 25.6. The third is shown on two surfaces that are perpendicular to each other. The first is the symmetry plane with the quadrilateral faces corresponding to the prisms and the triangular faces corresponding to the tetrahedra. The second surface is a field cut intersecting the fuselage and engine. A field cut is a cut through the discretized grid showing all the cells that intersect the plane cut, thus emphasizing the 3D nature of the grid. The prisms are assigned the task of capturing the features that are following the aircraft surface, while the tetrahedra are used for the features that are away (e.g., shocks and vortices). Figure 25.7 illustrates the widely varying length scales of the hybrid grid. The field cut shows portion of the fuselage, the wing, as well as the engine. Note the varying thickness of the prismatic layer which is dictated not only by the thickness of the boundary layer, but also by the size of the cavity between the engine and the wing. The tetrahedral part of the mesh is very dense in the cavity area in order to match the sizes of the local prisms and becomes isotropic away from the cavity.

25.3.2 Adapted Hybrid Mesh The case of an adaptively embedded hybrid mesh is presented next for the same HSCT aircraft geometry. Turbulent flow is simulated with Mach number (M∞) equal to 3, angle of attack (α ) equal to 5° and Reynolds number (Re) equal to 6.3 × 106. The grid is locally embedded according to the magnitude of flow gradients [29]. Figure 25.8 shows a plane cut of the adapted hybrid grid employed for simulation of turbulent supersonic flow around the aircraft. A view of the solution via entropy contours on the initial coarse grid and the corresponding locally refined hybrid mesh is shown. The right hand side of

©1999 CRC Press LLC

FIGURE 25.6 View of the hybrid mesh around the HSCT aircraft with engines on two different planes that are perpendicular to each other. The first plane is that of the symmetry while the second is a field cut intersecting the fuselage and engine.

FIGURE 25.7 Close up of the hybrid grid for the HSCT aircraft around the engine cavity. The tetrahedral mesh is very dense here compared with other regions so as to match the thin local prism cell sizes.

©1999 CRC Press LLC

FIGURE 25.8 View of the solution (entropy contours) on the coarse grid and the corresponding adapted grid for the HSCT configuration. The right-hand side of the figure shows the initial mesh superimposed with entropy contours. The adapted hybrid grid (left side) has been refined in the vicinity of the vortex, and near the wing/fuselage junction. Case of turbulent flow with M∞ = 3, α = 5° and Re = 6.3 × 106.

the figure illustrates the initial grid superimposed with entropy contours of the solution. Two are the main flow features here. The boundary layer conforms to the surfaces of the fuselage and wing, while the vortex has a totally independent orientation. The prismatic mesh used follows the shape of the boundary layer, while the tetrahedral grid appears to be more appropriate for the vortex. Furthermore, local refinement has been applied by the adaptation algorithm in the region of the vortex.

25.3.3 Resolution of Multiple Wakes The ability of the prismatic elements to capture multiple wakes is illustrated by generating a hybrid grid about a generic two-element wing. The approach used here extends fictitious surfaces past the trailing edges of both the blades in the direction of the wakes. Then, prisms are generated marching away from both the wing-surface as well as the fictitious surfaces to capture the viscous effects at the wall and the wake region. The grid consists of 9000 boundary nodes of which 5300 are on the surface of the main wing and flap (the rest are on the fictitious surfaces extended into the wakes). A view of the hybrid mesh is shown in the field cut in Figure 25.9. The grid consists of seven prism layers and 53,000 tetrahedra. A completely unstructured mesh in the wake region would require a very large number of tetrahedra. The prisms in between the main wing and the flap have been receded by the procedure described in Section 25.2.1.5 to prevent grid overlapping. Note the grid clustering in the wake and the smooth transition in cell sizes across the domain.

25.3.4 Deforming Hybrid Mesh in 2D Deformation of a hybrid mesh is now demonstrated via an example of a two-dimensional grid about two circular discs aligned in the tandem direction. This grid has been employed for simulation of vortexinduced vibrations to the two bodies. Figure 25.10a shows the mesh when both cylinders are in their initial position. The thick horizontal and vertical lines are included as a point of reference indicating the

©1999 CRC Press LLC

FIGURE 25.9 Field cut of the hybrid grid for the two-element wing. The grid comprises 9K boundary nodes (including those on the fictitious surface), seven prism layers and 53K tetrahedra. The prisms provide adequate grid clustering in the wake region with fewer cells compared with an all-tetrahedral mesh.

equilibrium position of each cylinder. Figure 25.10b shows the resulting deformed mesh when the two cylinders move away from each other in the transverse direction. Note that the significant displacement of the two cylinders is nicely accommodated by the triangular elements, and connectivity of the mesh is preserved.

25.3.5 Turbomachinery Blade with Tip Clearance The next case considered is an internal geometry. It is a turbine blade with narrow tip clearance. Figure 25.11 shows two perpendicular field cuts of the hybrid mesh around the blade. The surface was composed of 13,663 triangular faces. The hybrid grid consists of 14 layers of prisms (191,282 prismatic cells), and 415,086 tetrahedral cells. The tetrahedra were able to easily match the prismatic thickness everywhere, including the small gap between the tip of the blade and the shroud. Also, the surface mesh is much finer in the tip region adapting to the features of the geometry. It is important to note that the grid generation scheme was able to mesh an internal geometry as easily as the external geometries presented in the previous sections.

25.3.6 ABB Burner Case The final case corresponds to flow through a burner, which consists of an annulus diffuser, a swirl producer, and a combustion chamber. This case has been provided by ABB. The geometry has various complexities such as the fuel injection holes, severe cavities, twisted blades that produce the swirl, and vastly different length scales. The geometry has periodic boundaries, and only one burner is being modeled. Figure 25.12 shows a close-up of the surface triangulation for the swirl producing section. The surface consists of approximately 75,000 triangles. A hybrid mesh of the burner is seen in Figure 25.13, which is a two-dimensional cut along the axis. The view shows that the hybrid grid generator was capable of capturing all the fine features of the geometry, and also clustered points downstream of the swirl producing section. The mesh consists of 415,000 nodes, 521,000 prisms, and 748,000 tetrahedra. A cut

©1999 CRC Press LLC

(a)

(b) FIGURE 25.10 Deforming hybrid grids about a tandem cylinder geometry for (a) initial cylinder configuration, (b) cylinders displaced in the transverse direction.

across the swirl producing blades is shown in Figure 25.14. The view shows the hybrid nature of the mesh, and demonstrates the smooth transition in cell sizes even across different element types.

25.4 Research Issues and Summary Employment of hybrid grids for complex geometries was demonstrated. The prism covered regions of strong flow directionality, such as boundary layers and wakes, while tetrahedra were created elsewhere. The hybrid grid generator consists of two major parts: (1) a special marching method for generation of the prismatic elements, and (2) a combined octree-advancing front technique for generation of the tetrahedra. Narrow gaps and cavities, very disparate length scales, body and flow-field conformity of the mesh, as well as automation were the primary issues that guided the development of the generator. The use of hybrid grids was demonstrated through complex geometries. The hybrid mesh generator was successful in handling severe cavities and capturing widely varying length scales. Applications included the two main categories of topologies: (1) external and (2) internal. The marching-vectors procedure to generate the prisms proved to be robust (in avoiding overlapping of prism layers) and efficient. The smoothing operations and the imposition of constraints eliminated

©1999 CRC Press LLC

FIGURE 25.11 Surface and volume hybrid mesh for a turbine blade with narrow tip clearance. The volume grid is shown via two field cuts that are on surfaces perpendicular to each other intersecting the blade.

FIGURE 25.12 A close-up view of the swirl-producing section of the ABB Burner geometry. The surface is made up of 75,000 triangles.

surface “ripples” and avoided excessively stretched and skewed meshes. The automatic adjustment of the thickness of the prismatic layer allowed the generation of a single-block, nonoverlapping prismatic mesh even when the surface geometry contained narrow gaps and cavities. The mesh generator allowed for marching along arbitrary parametric surfaces, and was also capable of generating periodic meshes. ©1999 CRC Press LLC

FIGURE 25.13 A close-up view of the hybrid cut along the axis of the burner geometry. The grid generator was capable of automatically handling the small length scales and the severe cavities.

FIGURE 25.14 A cut across the swirl-producing blades of the burner geometry. The hybrid nature of the mesh and the smooth transition in cell sizes are visible.

The octree-advancing front approach provided an automatic method for generating unstructured meshes. The method was effective in generating surface triangulations for different complex geometries including a burner surface. The octree allowed surface triangulations to be generated that captured all of the geometry features. The octree also provided for a smooth variation of grid size over the entire surface mesh. ©1999 CRC Press LLC

Anisotropic surface meshes were generated using the octree and minimal user input. These anisotropic meshes resulted in a significant reduction in the number of faces generated. Smooth transition between the different regions of directionality was also accomplished. Generation of tetrahedra via the advancing front method was also made simpler and more automatic by eliminating the traditional user-defined background mesh for determination of mesh spacing. An automatically generated octree guided the growth of the tetrahedra and enabled a smooth transition of the mesh from the prisms to the tetrahedra in a hybrid mesh. The universality of the octree-advancing front method was demonstrated through its application to different complex geometries. The HSCT aircraft configuration demonstrated that the method is flexible enough to adapt to 200:1 size variations in the local length scale. Local remeshing of the tetrahedral mesh proved very effective in removing areas of abrupt changes in size of the tetrahedra.

Further Information Additional sources of information on hybrid grids and grid generation, in general, can be found in the proceedings and papers of the following conferences: • International Conference on Numerical Grid Generation, held every two years • AIAA Computational Fluid Dynamics Conference, held every two years • AIAA Aerospace Sciences Meeting, held in Reno, NV every year • AIAA Applied Aerodynamics Conference, held every year • International Conference on Finite Elements in Fluids, held every two years • International Meshing Roundtable, sponsored by Sandia National Labs • NASA Conference Proceedings on “Unstructured Grid Generation Techniques” (NASA LaRC, CP

10119, Sept. 1993) and “Surface Modeling, Grid Generation, and Related Issues in Computational Fluid Dynamics Solutions” (NASA LeRC, CP 3291, May 1995)

References 1. Thompson, J.F., Warsi, Z.U.A., Mastin, C.W., Numerical Grid Generation, North-Holland, New York, 1985. 2. Thompson, J.F. and Weatherill, N.P., Aspects of numerical grid generation: Current Science and Art, AIAA Paper 93-3539, 1993. 3. Baker, T.J., Developments and trends in three dimensional mesh generation, Applied Numerical Mathematics. 1989, Vol. 5, pp 275–304. 4. Baker, T.J., Mesh generation for the computation of flowfields over complex aerodynamic shapes, Computers Math. Applic. 1992, Vol. 24, No. 5/6, pp 103–127. 5. Eiseman, P. R. and Erlebacher, G., Grid Generation for the solution of partial differential equations, NASA CR 178365 and ICASE Report No. 87–57, August 1987. 6. Von Karman Institute (VKI) Lecture series in computational fluid dynamics, LS 1996-06, March 25–29, 1996. 7. Kallinderis, Y. and Ward, S., Prismatic grid generation for 3D complex geometries, Journal of the American Institute of Aeronautics and Astronautics. October 1993, Vol. 31, No. 10, pp. 1850–1856. 8. Kallinderis, Y., Khawaja, A., McMorris, H., Hybrid prismatic/tetrahedral grid generation for viscous flows around complex geometries, AIAA Journal. February 1996, Vol. 34, No. 2, pp 291–298. 9. McMorris, H. and Kallinderis, Y., Octree-advancing front method for generation of unstructured surface and volume meshes, AIAA Journal. June 1997, Vol. 35, No. 6, pp 976–984. 10. Nakahashi, K. and Obayashi, S., FDM-FEM approach for viscous flow computations over multiple bodies, AIAA-87-0605, 1987. 11. Karman, S. L., SPLITFLOW: A 3D unstructured Cartesian/prismatic grid CFD code for complex geometries, AIAA-95-0343. Reno, NV, January 1995.

©1999 CRC Press LLC

12. Sharov, D. and Nakahashi, K., Hybrid prismatic/tetrahedral grid generation for viscous flow applications, AIAA-96-2000, Proc. of the 27th AIAA Fluid Dynamics Conf. New Orleans, LA, June 1996. 13. Van der Burg, J., Maseland, J., Oskam, B., Development of a fully automated CFD system for threedimensional flow simulations based on hybrid prismatic-tetrahedral grids, Proc. of the 5th Int. Conf. on Numerical Grid Generation in Computational Field Simulations. Mississippi State University, April 1–5, 1996, pp 557–566. 14. Chappell, J., Shaw, J., Leatham, M., The generation of hybrid grids incorporating prismatic regions for viscous flow calculations, Proc. of the 5th Int. Conf. on Numerical Grid Generation in Computational Field Simulations, pp 537–546, Mississippi State University, April 1–5, 1996. 15. Noack, R., Steinbrenner, J., Bishop, D., A three-dimensional hybrid grid generation technique with application to bodies in relative motion, Proc. of the 5th Int. Conf. on Numerical Grid Generation in Computational Field Simulations. Mississippi State University, April 1–5, 1996, pp 547–556. 16. Kallinderis, Y. and Nakajima, K., Finite element method for incompressible viscous flows with adaptive hybrid grids, AIAA Journal. August 1994, Vol. 32, No. 8, pp 1617–1625. 17. Hufford, G.S. and Mitchell, C.R., The generation of hybrid and unstructured grids using curve and area sources, AIAA-95-0215. Reno, NV, January 1995. 18. Spragle, G.S., Smith, W.A., Weiss, J. M., Hanging node solution adaption on unstructured grids, AIAA-95-0216, Reno, NV, January 1995. 19. Kao, K.H. and Liou, M.S., Direct replacement of arbitrary grid-overlapping by nonstructured grid, AIAA-95-0346. Reno, NV, January 1995. 20. Nakahashi, K., FDM-FEM Zonal approach for computations of compressible viscous flows, Lecture Notes in Physics. 1986, Springer, Vol. 264, pp 494–498. 21. Weatherill, N.P., Mixed structured–unstructured meshes for aerodynamics flow simulation, The Aeronautical Journal. Vol. 94, 134, pp 111–123. 22. Soetrisno, M., Imlay, S.T., Roberts, D.W., A zonal implicit procedure for hybrid structured-unstructured grids, AIAA-94-0645, Reno, NV, January 1994. 23. Koomullil, R.P., Soni, B.K., Huang, C.-T., Navier–Stokes Simulation on hybrid grids, AIAA Paper 96-0768, Reno, NV, January 1996. 24. Hwang, C.J. and Wu, S.J., Adaptive finite volume approach on mixed quadrilateral-triangular meshes, AIAA Journal. January 1993, Vol. 31, No. 1, pp 61–67. 25. Banks, D., Mueller, J.-D., VankeirsBilck, P., An Object oriented approach to hybrid structured/unstructured grid generation, AIAA Paper 96-0032. Reno, NV, January 1996. 26. Coirier, W. and Jorgenson, P., A Mixed volume grid approach for the Euler and Navier–Stokes equations, AIAA Paper 96-0762. Reno, NV, January 1996. 27. Connell, S.D. and Braaten, M.E., Semistructured mesh generation for 3D Navier–Stokes calculations, AIAA-95-1679-CP. San Diego, CA, June 1995. 28. Pirzadeh, S., Viscous unstructured three-dimensional grids by the advancing-layers method, AIAA Paper 94-0417. Reno, NV, January 1994. 29. Parthasarathy, V. and Kallinderis, Y., Adaptive prismatic-tetrahedral grid refinement and redistribution for viscous flows, AIAA Journal. April 1996, Vol. 34, No. 4, pp 707–716. 30. Minyard, T. and Kallinderis, Y., Octree partitioning of hybrid grids for parallel adaptive viscous flow simulations, Int. J. for Num. Meth. in Fluids. January, 1998, Vol. 26, pp 1–22. 31. Lohner, R., Some useful data structures for the generation of unstructured grids, Communications in Applied Numerical Methods. 1988, Vol. 4, pp 123–135. 32. Peraire, J., Morgan, K., Peiro, J., Unstructured Finite element mesh generation and adaptive procedures for CFD, in Application of Mesh Generation to Complex 3D Configurations, AGARD Conference Proceedings No. 464, 1990, pp 18.1–18.12. 33. Bonet, J. and Peraire, J., An Alternating Digital Tree (ADT) algorithm for 3D geometric searching and intersection problems, Int. J. for Numerical Methods in Engineering. 1991, Vol. 31, pp 1–17.

©1999 CRC Press LLC

26 Unstructured Grids: Procedures and Applications 26.1 26.2 26.3 26.4 26.5 26.6

Introduction Grids Constructed by Delaunay Triangulation — The General Procedure Unstructured Grid Control Using a Background Grid and Sources Unstructured Grids of Triangles Hybrid Grids of Quadrilaterals and Triangles Unstructured Tetrahedral Grids Dassault Falcon • THRUST Supersonic Car

26.7

Nigel P. Weatherill

26.8 26.9

Non-Isotropic Grid Generation for Viscous Flow Simulation Parallel Unstructured Grid Generation Summary Appendix: Graphics User Interfaces

26.1 Introduction The aims of this chapter are to provide some examples of unstructured grids and, moreover, to illustrate the major steps involved in the generation and use of unstructured grids of triangles and tetrahedra. No theory will be presented, since all the basic theory has been introduced in previous chapters.

26.2 Grids Constructed by Delaunay Triangulation — The General Procedure The Delaunay approach for the construction of unstructured grids is a popular method. It is appropriate, therefore, before discussing real examples, to illustrate the general procedure. Chapters 1 and 16 have discussed the technical aspects of the approach and outlined relevant algorithmic details, so they will not be reproduced here. However, the illustrations presented are based upon the construction of the Delaunay triangulation using the Bowyer [1–6] algorithm. Consider a circle as shown in Figure 26.1a. It is described as a set of discrete points. • The first step is to define a convex hull enclosing all the boundary points that describe the geometry.

This can be automatically performed given the coordinates of the circle. In this case, four points are used to define the convex hull. A Delaunay triangulation of these four points is performed, and the resulting grid with the geometry is shown in Figure 26.1a The convex hull encloses all the geometry points and is triangulated. ©1999 CRC Press LLC

FIGURE 26.1A

The convex hull encloses all the geometry points and is triangulated.

FIGURE 26.1B

A Delaunay triangulation of the boundary points is performed.

• Given an initial construction of four points, together with their Delaunay construction, each one

of the geometry boundary points is inserted sequentially and connected into the triangulation structure. Figure 26.1b shows the resulting grid after all the boundary points have been inserted. • To create the grid inside the circle, it is then necessary to systematically refine the triangles inside the circle. There are several methods for performing this task, as described in Chapter 16. However, for this illustration, the insertion strategy involves the addition of points at the centroid of elements until the required point density is achieved (Chapter 1). The grid point density is controlled by the background mesh and any sources that have been specified (see Section 26.3). Points are created by looping over elements within the domain and inserting a point when element refinement

©1999 CRC Press LLC

FIGURE 26.1C Points within the domain are inserted in an iterative process until the required point density is obtained. Shown is the grid during the point insertion phase.

FIGURE 26.1D

The final grid after point insertion and the deletion of elements outside the domain of interest.

is required. Points are connected into the triangulation using the Delaunay based algorithm. Figure 26.1c shows the grid after the insertion of some points, although the grid point density criterion throughout the grid has not yet been satisfied. point density criterion throughout the grid has not yet been satisfied. • Once the grid point density has been achieved, a post-processing step deletes all triangles that are not within the domain, and if appropriate, the grid can then be smoothed using a Laplacian filter. The final grid for this case is shown in Figure 26.1d. As a further illustration, each stage of the process is illustrated, for a simple geometry, in Figure 26.1e. The process illustrated here for very simple geometries and small grids highlights the sequence of steps that are applied for the generation of Delaunay grids in both two and three dimensions. These simple geometries do not illustrate a very important requirement in the generation of grids by Delaunay triangulation. It is important that in the final grid the edges of the initial boundary are preserved. This is the so-called boundary integrity requirement. Hence, to augment the steps given above, it is necessary to add a final step, • Ensure that the initial boundary edges are included within the final grid [7].

©1999 CRC Press LLC

FIGURE 26.1E

Each stage of the grid generation phase is shown for a simple geometry.

26.3 Unstructured Grid Control Using a Background Grid and Sources Figure 26.1a of Section 26.2 shows the points that define the geometry of the circle. However, any mesh generation procedure must provide a suitable mechanism for a user to change the number of points on the boundary of any given geometry — perhaps a coarse discretization is required, or a fine discretization. One of the popular approaches to this problem in the generation of unstructured grids is to use a background grid and sources [Chapters 1 and 17]. Figure 26.2a shows a schematic of a particularly simple background grid. The idea is straightforward. • Define a mesh that covers the domain Ω to be gridded. The mesh should consist of nodes and have a topologically valid connectivity that defines the elements. In Figure 26.2a the background grid consists of four nodes and two triangles. • At each node of the grid, a parameter is defined which specifies the point spacing at that position.

©1999 CRC Press LLC

FIGURE 26.2A

The background mesh used to control grid point spacing.

• During the grid generation procedure, and included in this is the point discretization of the

geometry, the required spacing at any place in the domain is interpolated from the background grid. Delaunay and advancing front methods require such information. Hence, given a position P in the domain, 1. Determine the element, E, of the background grid that contains P. 2. Find the nodes {n1,n2,n3} of E. 3. Find the point spacing {d1,d2,d3} specified at each of the nodes {n1,n2,n3}. 4. Using {d1,d2,d3}, interpolate the spacing at P. This procedure can also be used to generate grids with stretching (Chapter 19 and 20). This is a very effective way of controlling the element and point density within an unstructured grid. However, it involves the user in generating a suitable grid and specifying the grid point density parameters at each node of the grid. In two dimensions, using graphics user interfaces, this is not too time-consuming and is readily achieved for most geometries. However, in three dimensions it is a nontrivial task. Hence control of a grid by a background grid is usually augmented with the use of sources. Figure 26.2b shows three basic types of sources. Although there are many variants of the definition of a source now in the literature, the fundamental features of a point source are defined by • • • •

A position, Q, within the domain. At Q, the required grid point spacing is defined, d. A circle is specified of radius r1, within which the user specified grid point density, d, is defined. A second circle is specified of radius r2, where, r2 > r1. Within the region defined between the circle radius r1 and the circle radius r2, the point spacing will decay from d to that specified by the background grid.

Hence, for a point source with the structure just defined, the user must specify four parameters. However, this does not involve the intricacies of a mesh connectivity as required with a background grid. In fact, the background grid which accompanies sources is effectively redundant, since uniform spacing everywhere can be the default condition. Hence, no interpolation is required. The extension to a line source, a triangle source, or even a volume source is straightforward. Figure 26.2b shows, in schematic form, a line and triangle source. These two allow the user to easily specify the required grid point density over regions of the domain. The concept of a source naturally extends to three dimensions.

26.4 Unstructured Grids of Triangles The example chosen to illustrate the use of unstructured grids of triangles is the outline of San Francisco Bay. The geometry is defined as a set of discrete points. The boundary can be modeled as a set of NURBS

©1999 CRC Press LLC

FIGURE 26.2B

Point, line, and triangular sources.

FIGURE 26.3A

The geometry of San Francisco Bay.

or splines. This then enables an arbitrary point distribution to be generated on the boundary for any given grid density. • Figure 26.3a shows the geometry as defined by a discrete set of points. • A background grid is superimposed over the geometry and spacing is defined at the nodes. In

Figure 26.3b, the background grid consists of two elements and the specified spacing is shown by the circles around the nodes. • From the geometrical data, and the background grid, the points which will define the boundary within the grid can be generated. Figure 26.3c shows the point distribution on the boundary. • Figure 26.3d shows the resulting grid within the domain. • To illustrate the use of sources, Figure 26.3e shows two line sources that have been designed to construct a grid that will resolve an imaginary deep water channel. The sources that form the line source have different regions of influence, as shown by the circles.

©1999 CRC Press LLC

FIGURE 26.3B The geometry of San Francisco Bay, together with the background grid. Note that the circles attached to the nodes of the background grid indicate to the user the spacing specified.

FIGURE 26.3C

The boundary grid generated from the point spacing specified on the background grid.

• Figure 26.3f shows the resulting boundary point distribution. The effect of the line sources is

apparent. (Compare with the boundary point distribution from the background grid only as shown in Figure 26.3c). • The resulting grid, controlled by both the background grid and the line sources, is shown in Figure 26.3g. • Following the generation of a mesh, it is good practice to make an assessment of grid quality [8]. In many cases, such an assessment can be included within a grid generator and only if there is a problem would the user be informed. However, it can also be beneficial to have a stand-alone grid analysis package. The assessment of grid quality in relation to an analysis algorithm is still a topic for much research. However, it is possible to identify geometrical measures of the “goodness” of a grid. Some appropriate measures are shown in Table 26.1. After computation of quality measures they can be presented in the form of histograms, as shown in Figure 26.3h.

©1999 CRC Press LLC

FIGURE 26.3D

A grid for the Bay generated with grid control from the background grid.

FIGURE 26.3E The geometry of San Francisco Bay with the background grid augmented by two line sources to resolve a deep-water channel. • It is important to know the location of elements with particular grid quality measures. Figure 26.3i

shows the generated grid and the elements that have been highlighted. In practice, such a presentation will involve the user of color.

26.5 Hybrid Grids of Quadrilaterals and Triangles As a second example of the use of unstructured grids, an approach is presented whereby a hybrid grid is constructed from quadrilaterals and triangles. Shaw (Chapter 23) discusses at length the philosophy behind the use of hybrid grids and presents results for three-dimensional aerospace configurations. The

©1999 CRC Press LLC

FIGURE 26.3F line sources.

The boundary grid generated from the point spacing specified on the background grid and the two

FIGURE 26.3G

The grid generated with control from the background grid and the line sources.

example shown here is based upon early work [9,10] and is presented to further elaborate and possibly clarify some of the comments made in Chapter 23. Hybrid grids are also covered in Chapter 25. Figure 26.4a shows an outline of a four component airfoil system composed of a main airfoil, one leading edge slat and two trailing edge flaps. In the process of generating a hybrid grid, • The first step is to generate a structured grid around the main component airfoil. Any structured

grid technique can be used, but here a conformal mapping grid based upon a Von-Karman–Trefftz transformation is used. Figure 26.4b shows such a grid. The outer boundary, which is not shown, extends about 15 chord lengths away from the airfoil. ©1999 CRC Press LLC

TABLE 26.1

Grid Element Quality Parameters

Radius of circumscribing sphere b = ----------------------------------------------------------------------------Radius of inscribed sphere

βequilateral = 3.0

Maximum edge length s = --------------------------------------------------------------Radius of inscribed sphere

σequilateral = 4.8989

Radius of circumscribed sphere w = --------------------------------------------------------------------------Maximum edge length

ωequilateral = 0.6125

Maximum edge length z = -----------------------------------------------------Minimum edge length

ζequilateral = 1.0 3

(average element edge length) a = -------------------------------------------------------------------------Volume 3

(R.M.S edge length) g = --------------------------------------------------Volume

γequilateral = 8.479 3

(Volume) K = ----------------------------------------------------------------------------------------------------------------------2 (Summation of all surface area of triangle faces)

FIGURE 26.3H

αequilateral = 8.479

Κequilateral = 4.5 × 10–4

Typical histogram display of grid quality statistics.

• The next step is to choose one of the flaps or slat components and construct a grid that does not

extend too far away from the geometry. In the case illustrated, the second flap is chosen and a structured grid, again generated by a conformal mapping, is produced. Figure 26.4c shows the grid in relation to the main component airfoil.

©1999 CRC Press LLC

FIGURE 26.3I

Elements with particular grid quality measures can be visualized.

FIGURE 26.4A

Geometry of the three component airfoil.

• The grid around the flap is then superimposed over the main component grid, as shown in

Figure 26.4d. • The next step is governed by user input, which specifies how much of the grid around the flap

should be preserved. A region of the main component grid is then deleted so that the two overlaid grids do not intersect, as shown in Figure 26.4e. • In order to connect the two grids it is then necessary to fill the void region by constructing an unstructured grid. This is readily achieved since the boundary points, together with the boundary edge connectivities, can be easily extracted and sent to the Delaunay grid generator [1–6]. An unstructured grid is then generated, as shown in Figure 26.4f. • A hybrid grid can then be created by connecting together the three generated grids. This is shown in Figure 26.4g. • To introduce the remaining flap and slat, the process already described is repeated. First, introduce a component grid for the leading edge slat and overlay this over the existing grids, Figure 26.4h.

©1999 CRC Press LLC

FIGURE 26.4B A structured grid generated from a conformal mapping is constructed around the main component airfoil.

FIGURE 26.4C

A structured grid is generated around the flap.

• Preserve a portion of the component grid, determine the empty void region, fill with an unstruc-

tured grid and connect all the grids. Figure 26.4i shows the final grid. • To complete the grid, repeat the process again for the second flap component. The final hybrid grid for the complete four component airfoil is shown in Figure 26.4j. The quadrilaterals in the final grid could be directly triangulated if a grid of triangles is required. However, this would defeat the objective of generating a hybrid grid. For high Reynolds number viscous flow simulation, it is very easy to modify the structured grid generation so that appropriate point

©1999 CRC Press LLC

FIGURE 26.4D

The structured grid for the flap is superimposed on the grid for the main component.

FIGURE 26.4E

Overlapping regions of the two grids are deleted leaving two disconnect grids.

clustering in the vicinity of solid boundaries is suitable for capturing boundary layer phenomena. In this way, hybrid grids of the form shown have an important role to play. The major disadvantage of the approach, as illustrated, is that the method is not automatic for general geometries (as defined in the spirit of automatic unstructured grid generators), since a structured grid is required and, since this involves a mapping procedure, the method is geometry-specific. However, the approach is potentially powerful in the sense presented by Shaw (Chapter 23). Hybrid grids are suitable for use with finite volume solvers — in particular, an edge-based scheme — since then the fact that different element types are present is not relevant to the solver [9].

©1999 CRC Press LLC

FIGURE 26.4F An unstructured grid is generated within the void domain, thus connecting the two component grids.

FIGURE 26.4G

The two grids are connected by a ribbon of unstructured grid.

26.6 Unstructured Tetrahedral Grids This section attempts to describe the typical process by which three-dimensional grids of tetrahedra are generated using a Delaunay based approach. Two examples are presented. The first is an aerospace geometry, the Dassault Falcon, consisting of a wing, fuselage, rear-mounted engine, tail and fin, and the second is the geometry of the THRUST Supersonic Car, which broke the world land speed record in October 1997.

©1999 CRC Press LLC

FIGURE 26.4H

FIGURE 26.4I

The third component with a local structured grid is laid over the main component grid.

The component grid is connected to the main grid by a ribbon of unstructured grid.

26.6.1 Dassault Falcon • Figure 26.5a shows the geometry of the Falcon aircraft. For clarity, only half the aircraft will be

considered. The aircraft consists of 12 individual support surfaces. • It will be assumed that a grid is required around the exterior of the geometry, typical for a flow

computation. Hence, the domain must be closed by the addition of bounding surfaces, in this case, an outer hemispherical boundary and a plane of symmetry, as shown in Figure 26.5b.

©1999 CRC Press LLC

FIGURE 26.4J

FIGURE 26.5A

The second component flap grid is introduced and connected to the main component grid.

Shown is the geometry patches. Twelve support surfaces define the shape of the aircraft.

• Given the closed domain, the generation process involves the construction of a grid on the surfaces

which define the domain, followed by a tetrahedral grid generated to fill the domain. Before either of these tasks can be performed it is necessary to define the required spacing of elements within the domain. As in the case of the generation of grids in two dimensions, this is performed using a background grid with added sources. For three dimensions it is not particularly beneficial to present a figure which outlines the background grid. Hence, in Figure 26.5c the geometry of the aircraft is shown together with the representation of a line source. This line source, as can be seen, is shown as a thick line along the leading edge of the wing. The two spheres at the end of the line provide the user with an indication of the region of influence of the line source. The definition of a line source by a user is easily performed within a graphics user environment, since points of

©1999 CRC Press LLC

FIGURE 26.5B

The region around the aircraft is enclosed by a hemispherical boundary and a plane of symmetry.

FIGURE 26.5C Sources are used to provide the required grid control. Shown are two line sources along the leading edge of the wind. The outline of the spheres at the ends of the line sources provide the user with an indication of the regions of influence of the sources.

the geometry can be selected and then point sources/line sources created by the push of a button. The line source shown in Figure 26.5c illustrates the concept. However, for a realistic mesh for the Falcon aircraft it is necessary to define many line and point sources, and in such a case it is not effective to show all these in a figure.

©1999 CRC Press LLC

FIGURE 26.5D A coarse surface grid on the aircraft. (Note: The sources used to generate this grid are not the ones shown in Figure 26.5c.)

FIGURE 26.5E

A close-up view of the surface mesh.

• The surface grid on the aircraft, generated using six point sources and ten line sources, is shown

in Figures 26.5d and 26.5e. Surface grid generation is described in detail in Chapters 17 and 19 and in reference [11]. The mesh shown is, for clarity, a coarse mesh, but it does exhibit the required spacing in that the grid has been clustered in regions around leading edges and trailing edges. • Once the surface grid has been generated on all the boundary surfaces, a volume mesh can be created. It is difficult to view tetrahedra, but Figure 26.5f shows the elements that fall inside a cutting arc. This leads to effective pictures, but arguably these are of little value in assessing grid quality. • It is necessary to resort to analysis of the grid quality measures to assess the quality of the grid and histograms are a suitable way to project this data, Figure 26.5g. • If required, elements or nodes within the grid whose associated quality measures are of concern can be viewed, Figure 26.5h.

©1999 CRC Press LLC

FIGURE 26.5F

Sectional cut through the grid of tetrahedra.

FIGURE 26.5G

Histogram of grid quality measures.

• To complete the sequence of figures, the grid generated is suitable for an inviscid flow simulation.

Figure 26.5i shows the geometry of the aircraft, streamlines, contours, and sections through the unstructured grid.

26.6.2 THRUST Supersonic Car • Figure 26.6a shows the geometry of the Thrust car. The car is enclosed within a bounding box, as

shown in Figure 26.6b.

©1999 CRC Press LLC

FIGURE 26.5H

Elements with specific grid quality measures can be viewed in the mesh.

FIGURE 26.5I

Flow simulation for the Dassault Falcon.

• Figure 26.6c shows the geometry of the car together with sources to control the grid point density. • Figure 26.6d shows a grid on the car, plane of symmetry and the ground. • Figure 26.6e shows a cut through the grid of tetrahedra. • A typical flow simulation is shown in Figure 26.6f.

©1999 CRC Press LLC

FIGURE 26.6A

FIGURE 26.6B

FIGURE 26.6C

©1999 CRC Press LLC

Geometrical definition of the car.

The car inside a bounding box.

The geometry of the car showing sources to control grid density.

FIGURE 26.6D

Surface grid on the car, plane of symmetry and the ground.

FIGURE 26.6E

Cut through the domain of tetrahedra.

26.7 Non-Isotropic Grid Generation for Viscous Flow Simulation For some applications, the use of regular isotropic elements can lead to very large meshes. A good example of such a case is the simulation of high Reynolds number viscous flows where, to capture boundary layer effects, very small elements are required. It is appropriate, therefore, knowing the physics of boundary layers, to consider a form of a priori adaptation to reflect the difference in gradients in flowfield variables across a boundary layer as compared with along a boundary layer in the direction of the flow. If such an approach is followed, then elements with high aspect ratios will be required.

©1999 CRC Press LLC

FIGURE 26.6F

Flow solution over the car.

The generation of grids that incorporate elements with arbitrary stretching has been the focus of interest for some time. Chapter 20 discusses this issue in some length and presents in detail one approach. An alternative approach is highlighted in Figure 26.7. • Figure 26.7a shows a grid of quadrilaterals which has been generated using an algebraic approach

[14,15]. The approach amounts to growing layers of elements by advancing along lines that are approximately normal to the boundary. These layers of elements are grown until either they selfintersect or reach an aspect ratio of unity. • After this the domain is filled with regular isotropic elements using the standard Delaunay approach, Figure 26.7c. • Figures 26.7e show some of the details of this approach within a concave corner. • The quadrilaterals can be triangulated to provide a grid consisting of triangles, Figures 26.7b, 26.7d, and 26.7f. This approach is equally applicable in three dimensions where grids of tetrahedra or tetrahedra/prisms can be created. This method of advancing layers (or advancing normals) is a pragmatic approach and is clearly applicable for solid boundaries. However, it does not take into account other features of viscous flow phenomena, such as wakes. However, it is relatively easy to modify the approach to include a suitable treatment for wakes. The approach adopted is as follows: • Use an initial mesh to obtain a flow solution. • From the flow solution, determine the wake lines. Figure 26.8a shows a four-component high lift

airfoil system with the computed wake lines. • Attach the wake lines to the existing geometry and then use the advancing layer approach to

construct stretched elements along the geometry boundaries and along the computed wake lines, Figures 26.8b and 26.8c. • Determine the outer points and edges of the grid generated from the advancing layer stage. These define a boundary which is input data for the Delaunay triangulation phase, Figures 26.8d and 26.8e.

©1999 CRC Press LLC

FIGURE 26.7

The advancing layer approach to the generation of stretched elements close to solid boundaries.

• The advancing layers grid and the Delaunay grid are then combined to form the final grid,

Figure 26.8f. • The final grid is suitable for a high Reynolds number viscous flow simulation, Figure 26.8g.

©1999 CRC Press LLC

FIGURE 26.8A

FIGURE 26.8B

Geometry of the high-lift airfoils, together with wake lines.

Highly stretched elements close to the geometrical boundary and the wake lines.

FIGURE 26.8C

©1999 CRC Press LLC

Close-up view of the stretched elements.

FIGURE 26.8D

FIGURE 26.8E

The isotropic grid generated by Delaunay triangulation.

Close-up view of the unstructured isotropic elements.

26.8 Parallel Unstructured Grid Generation The introduction of scalable parallel computers is enabling larger problems to be solved in many areas of computational engineering. In computational electromagnetics (CEM), typical simulations employ meshes of five million triangles in two dimensions and many tens of millions of elements in three dimensions. In computational fluid dynamics (CFD), a mesh of at least ten million elements can be required for a high Reynolds number viscous flow simulation over a complete aircraft. As mesh sizes become as large as this, the process of mesh generation on a serial computer can become problematic both in terms of time for generation and memory requirements of computers. Parallel computers afford the potential to relieve this problem. Chapter 24 discussed in detail many aspects of parallel mesh generation; therefore, here only examples will be given. The approach that will be demonstrated, is based upon geometrical partitioning of the domain [16]. To generate a grid in parallel, the complete domain is divided into a set of smaller

©1999 CRC Press LLC

FIGURE 26.8F

FIGURE 26.8G

FIGURE 26.9A

The final grid.

Flow solution for a high-lift airfoil system.

The inner geometry and the outer boundary is point discretized.

subdomains, and a grid generated in every subdomain independently. A combination of the subdomain grids forms the final grid of the total domain. A manager/worker model is employed, in which the initial work is performed by the manager who then distributes the grid generation tasks to the workers. The manager can recombine all the subdomain grids or, if the grid is particularly large, leave the partitioned grid on disc. Figure 26.9 shows the general procedure.

©1999 CRC Press LLC

FIGURE 26.9B

The initial triangulation formed by triangulating the boundary points.

FIGURE 26.9C

Domain decomposition.

• The geometry is point discretized, Figure 26.9a. • The boundary points are connected using a Delaunay algorithm to produce an initial triangulation,

as shown in Figure 26.9b. • A greedy algorithm, with an area criterion, is employed to give a number of equally sized subdo-

mains, Figure 26.9c. • The interdomain boundaries are discretized leading to a set of independent grid generation tasks, Figure 26.9d. • The data for each subdomain grid is distributed to the processors and the grids generated. The distribution of data is performed using the message passing library MPI. If the number of domains is N, and the number of processors is M, then static load balances results if N = M, and dynamic load balancing if N > M. The parallel procedure is more efficient if dynamic load balancing is employed. ©1999 CRC Press LLC

FIGURE 26.9D

In this example, six independent grid generation problems are created.

FIGURE 26.10A

The initial geometry.

The approach outlined also applies to the generation of grids in three dimensions. The generation of grids on the interdomain boundaries is significantly more difficult [16]. As an illustration of the procedure, Figure 26.10 shows some of the stages in the generation of a grid for a realistic geometry. • Figure 26.10a shows the initial geometry. • Figure 26.10b shows the surface grid of triangles. • Figure 26.10c shows each of the four partitions, first in the form following the initial decompo-

sition, and then after the surface grid has been suitably modified to provide input data for the volume generation. • Figure 26.10d shows sections cut through the four volume grids. The procedure outlined is capable of generating very large meshes. As an example, Figure 26.11 shows the profile data of a mesh with almost 50 million tetrahedra. The manipulation of such large meshes becomes very difficult, and the user interaction with a graphics user interface described in the different sections of this chapter is not practical. Therefore, it is necessary to use graphics frameworks based upon parallel computer platforms [17]. Figure 26.12 shows an illustration of the parallel visualization of a large mesh generated by the parallel mesh generator. ©1999 CRC Press LLC

FIGURE 26.10B

The surface mesh.

26.9 Summary In this chapter, an attempt has been made to provide examples of unstructured grids and to indicate the procedures followed in the process of grid generation. In this way, it should augment much of the material presented in the other chapters of this part of the handbook. All the grids have been generated using software developed at Swansea and are snapshots taken of results presented with graphics user interfaces [18,19] (see also the Appendix to this chapter). The literature now provides many impressive examples of grids generated for real-world problems, and the interested reader is directed to proceedings of recent grid generation conferences [20–24] and survey papers [25].

Appendix: Graphics User Interfaces With the wide-scale availability of high-resolution computer graphics, the process of user-grid interaction has been revolutionized. It is now common practice for grid generation algorithms to be embedded within easy-to-use graphics user interfaces where users can be shown relevant data in a visually meaningful way [18,19]. This technology has reduced both the time taken to generate grids and the training time required for new users to become proficient at generating grids. Images from some typical windows of two graphics user environments for grid generation [18,19] are presented in Figure 26.A1.

Acknowledgment The author would like to acknowledge Dr. O Hassan, Dr. M. J. Marchant, Mr. R. Said, Mr. E. TurnerSmith, Mr. J. Jones for helping to produce the figures used in the chapter.

©1999 CRC Press LLC

FIGURE 26.10C An example of a domain decomposed into four partitions. Shown is the surface grid, the interdomain surface triangles (faces of the initial tetrahedra that fill the domain), followed by the final surface grids prior to volume meshing.

©1999 CRC Press LLC

FIGURE 26.10D

©1999 CRC Press LLC

Sections through the volume grids of the individual partitions.

FIGURE 26.11

©1999 CRC Press LLC

Details of a mesh of almost 50 million elements generated in parallel.

FIGURE 26.12

©1999 CRC Press LLC

Sections through a grid computed using parallel visualization.

FIGURE 26.A1

©1999 CRC Press LLC

Typical Windows environments for more effective interactive grid generation.

References 1. Weatherill, N.P., The generation of unstructured grids using Dirichlet tessellations, Department of Mechanical and Aerospace Engineering, Report No. 1715, Princeton University, 1985. 2. Jameson, A., Baker, T.J., and Weatherill, N.P., Calculation of inviscid transonic flow over a complete aircraft, 24th Aerospace Sciences Meeting, AIAA Paper 86-0103. Reno, NV, 1986. 3. Weatherill, N.P., A method for generating irregular computational grids in multiply connected planar domains, Int. J. for Numerical Methods in Fluids. 1988, Vol. 8, pp. 181–197. 4. Weatherill, N.P., Delaunay triangulation in computational fluid dynamics, Computers and Mathematics with Applications. 1992, Vol. 24, No. 5/6, pp. 129–150. 5. Weatherill, N.P. and Hassan, O., Efficient three-dimensional grid generation using the Delaunay triangulation, Proc. of the 1st European Computational Fluid Dynamics Conf. Brussels, Belgium, Hirsch, C., Periaux, J., Kodulla, W., (Eds.), Elsevier, Amsterdam, 1992. 6. Weatherill, N.P. and Hassan, O., Efficient three-dimensional delaunay triangulation with automatic point creation and imposed boundary constraints, Int. J. for Numerical Methods in Engineering. 1994, Vol. 37, pp. 2005–2039. 7. Weatherill, N.P., The reconstruction of boundary contours and surfaces in arbitrary unstructured triangular and tetrahedral grids, Engineering Computations. 1996, Vol. 3, No. 8, pp. 66–81. 8. Parmley, K.L., Dannenhoffer J.F. III, and Weatherill, N.P., Techniques for the visual evaluation of computational grids, AIAA Paper 93-3353. AIAA CFD Meeting Orlando, FL, July 6-9, 1993. 9. Weatherill, N.P., Mixed structured and unstructured meshes for aerodynamic flow simulation, Aeronautical Journal. 1990, 94, pp. 111–123. 10. Weatherill, N.P. and Natakusumah, D., The simulation of potential flow around multiple bodies using overlapping connected meshes, Appl. Math. Comput., 1991, 46, pp. 1–21. 11. Peraire, J., Peiro, J., Formaggia, L., Morgan,K., and Zienkiewicz, O.C., Finite element Euler computations in three dimensions, 1988, Vol. 26, pp. 2135–2159. 12. Weatherill, N.P., Mixed structured and unstructured meshes for aerodynamic flow simulation, Aeronautical Journal. 1990, 94, pp. 111–123. 13. Weatherill, N.P. and Natakusumah, D., The simulation of potential flow around multiple bodies using overlapping connected meshes, Appl. Math. Comput., 1991, 46, pp. 1–21. 14. Marchant, M.J., Weatherill, N.P., and Hassan, O., FEA. 15. Hassan, O., AIAA. 16. Said, R., Weatherill, N.P., Morgan, K., and Verhoeven, N.A., Distributed Delaunay mesh generation for very large meshes, submitted for publication, January 1998. 17. Jones, J. and Weatherill, N.P., Parallel visualisation, submitted for publication. 18. Marchant, M.J. and Weatherill, N.P., The design of a software tutorial for computational aerodynamics, Proc. of the Eng. Education Conf., Professional Standards and Quality. Sheffield, UK, Bramhall, M.D. and Robinson, I.M., (Eds.), SHU Press, 1997. 19. Marchant, M.J., Weatherill, N.P., Turner–Smith, E., Zheng, Y., and Sotirakos, M., A parallel simulation user environment for computational engineering, Proceedings of the 5th International Conference on Numerical Grid Generation in Computational Field Simulation. April 1996, Soni, B., Hauser, J., Eiseman, P., Thompson, J.F., (Eds.), MSU Press, 1996. 20. Proc. of the 1st Int.Conf. on Grid Generation. Landshut, West Germany, Pineridge Press, UK, 1986. 21. Proc. of the 2nd Int. Conf. on Grid Generation. Miami, FL, Pineridge Press, UK, 1988. 22. Proc. of the 5th Int. Conf. on Grid Generation in Computational Fluid Dynamics and Related Fields. Starkville, MS, North-Holland, 1991. 23. Proc. of the 4th Int. Conf. on Grid Generation in Computational Fluid Dynamics and Related Fields. Swansea, UK., North-Holland, 1994. 24. Proc. of the 3rd Int. Conf. on Grid Generation in Computational Fluid Dynamics and Related Fields Barcelona, Spain. North-Holland, 1991.

©1999 CRC Press LLC

25. Thompson J.R. and Weatherill, N.P., Aspects of numerical grid generation, AIAA Applied Aerodynamics Meeting, Monterey, CA, August 1993.

©1999 CRC Press LLC

III Surface Definition Bharat K. Soni

Introduction to Surface Definition The geometry preparation is the most time-critical and labor-intensive part of the overall grid generation process. Most of the geometrical configurations of interest to practical scientific and engineering problems are designed in the CAD/CAM system as a composition of explicit or implicit analytical entities, semianalytic parametric-based entities and/or sculptured sets of discrete points. The standard common interface for geometry exchange is IGES (International Graphics Exchange Specification), which is based on the points, curves, and surface definition of geometric entities. There are numerous geometry output formats that require a grid developer to spend a great deal of time manipulating geometrical entities to achieve a useful sculptured geometrical description with appropriate distribution of points. Hence, surface definition associated with all solid geometrical components pertinent to the field region under consideration for grid generation plays a very crucial role in the efficiency and accuracy of the overall grid generation. This part of the handbook is devoted to providing an in-depth description of the mathematics, numerics, technology, and state of the practice of surface definition. In particular, the concentration is placed on the computer-aided geometric design (CAGD) techniques based on the interpolations and approximations involving parametric splines, B-splines and nonuniform rational Bsplines (NURBS). The chapters included in Part III present the mathematical foundations of spline-based geometry definition with pertinent numerics, basic computational and geometry manipulation tools of CAGD and their respective applications in grid generation, and industrial standards for geometry treatments involving practical complex configurations. Basic theory of splines and tools for using splines in engineering work are laid out by Ferguson in Chapter 27. This chapter provides the basic mathematical foundation using a functional approach and discusses the properties and numerical evaluations of general splines. Application of these methodologies in the development of engineering tools is described. The CAGD techniques for curves and surfaces involving widely used deBoor and de Cateljau algorithms are described by Farin in Chapter 28. The discussions also include Bezier and NURBS-based surfaces and their practical

©1999 CRC Press LLC

applications: surface refinement and reparametrization, approximation of discontinuous surface geometries containing gaps, holes and overlaps, surface–surface intersections are the widely utilized CAGD tools for complex grid generation. The detailed description and development of these tools is provided by Hammann, Razdan, and Jean in Chapter 29. In Chapter 30, the development of grid generation tools based on the NURBS-based surface and volume definition is described. In particular, a step-by-step process to develop NURBS description of widely utilized surface and volume geometrical entities in grid generation is developed. The development of IGES and NASA–IGES NINO (NURBS-Only) standards with pertinent applications is described by Evans and Miller in Chapter 31. This description also includes the presentation of associated software and documentation for efficiently utilizing these standards. Recently, the NURBS representation of geometric entities has become the de facto standard for geometry description in most of the grid generation systems. Various grid systems presented in Chapter 2 utilize NURBS data structure for geometry and grid generation. The geometry exchange standard, IGES, based on curves and surfaces definition is not suitable for the treatment of trimmed curves that widely appear in industrial CAD geometry design. Therefore, a research concentration has shifted toward using solid modeling-based geometric entities and their utilization in grid generation. Also, a new international standard STEP (Standard for Exchange of Product Data) has been gaining popularity. The standard provides users with the ability to exchange and express useful product information in digital form throughout a product’s life cycle. This includes the information needed from conceptual design stage to analysis, manufacturing, and product support and maintenance. However, the utilization of STEP in routine industrial application is still at the research level.

©1999 CRC Press LLC

27 Spline Geometry: A Numerical Analysis View 27.1 27.2 27.3 27.4

Background and Introduction A Functional Approach to Splines Basics of Spline Theory B-Splines Description and Examples of B-Splines • Evaluation • Robustness of the B-Spline Representation • A Representation Format for Univariate Splines

27.5 27.6

Approximation with Splines Constructing Spline Functions

27.7

Parametric Curves and Rational Splines

Least Squares Approximation • Interpolation Methods Parametric Curves • Rational Splines • Representation of Rational Splines and an Example

27.8

Surfaces Tensor Product Splines • Interpolation and Approximation on a Rectangular Grid • Interpolation and Approximation of Scattered Data • Construction of Parametric Spline Surfaces from Rectangular Data • Other Methods of Construction of Surfaces

David R. Ferguson

27.9

Functional Composition

27.1 Background and Introduction In this Chapter the basic theory of splines and tools for using splines in engineering work are laid out. Mathematical splines, introduced by Schoenberg [18], have become one of the workhorse tools of mathematical modeling and geometry systems. Managing and controlling the wide variety of computeraided design, manufacturing and engineering (CAD/CAM/CAE) packages and geometry systems in use in a modern engineering company is not only a challenge, but it is also a key to making the enterprise successful. Here we address one aspect of that challenge: the construction, analysis, and management of “geometric” data. By geometric data we include not only basic geometry but also analysis (e.g., pressure, thermal), grids, meshes, kinematic and other data associated with geometry. To work well, geometry systems, analysis of geometry, conversion from one representation to another, and graphical display of geometry must be based on sound mathematical theories and numerical methods. If the underlying mathematics and numerics are sound, the geometry system will, by and large, perform well, be maintainable, and be adaptable to new needs as they arise. For geometric design, methods

©1999 CRC Press LLC

based on polynomial splines using the B-spline representation provide some of the best tools for meeting these goals. Therefore, in this chapter, we concentrate on the basic theory of multivariate, tensor product, polynomial splines and their B-spline representation. The goal is to provide working engineers with the insight and tools needed to use splines effectively in geometric design and related work. To use splines effectively requires specific knowledge of what constitutes a spline, and familiarity with common methods for working with splines. While most of this Chapter deals with the details of spline theory and application, the remainder of this section discusses the attributes that make a mathematical tool a valuable engineering tool and shows that splines have those attributes. A mathematical tool or technique is understood and valued if it is simple and familiar, is usable in a number of situations, leads to well-posed problems (i.e., problems in which the solutions are well understood and uniquely defined), produces robust algorithms for computation, and provides techniques for error analysis that practitioners can use to understand how well a problem is being solved and to help manage error. That is, it must be simple, familiar, versatile, and useful. Splines satisfy these criteria. As a natural extension of polynomials, and as a common engineering tool that has been in use for years, they are simple and familiar. Their versatility is shown in their many uses: describing curves and surfaces, data fitting and smoothing, modeling analysis results, and paneling geometry in preparation for analysis are some of the many uses of splines. There is a rich, comprehensive, unifying mathematical theory complete with error analysis to guide practitioners in selecting alternatives and to aid in knowing how well a problem is being solved. The Chapter is organized into eight sections. Section 27.2 describes the functional or object-oriented approach to splines, the separation of construction from evaluation, and includes extensions to higher dimensions and a discussion of differences with the traditional CAD and CAGD approach. Sections 27.3, 27.4, and 27.5 are the spline theory parts of the chapter. Section 27.3 begins the development of splines as linear vector spaces of mathematical functions. In this section the basic concepts — break-points, knots, degree, order, and continuity — are described. Section 27.4 continues with a discussion of Bsplines. Section 27.5 lays out some of the theoretical results on approximation and shows how this theory can be used by the practitioner to manage error and control results. The remaining sections are devoted to the practical construction and use of splines for representing data and constructing curves, rational curves, and surfaces. In the final section, functional composition is used to address classes of engineering problems where an analysis or geometry depends on another more fundamental geometry as, for example, a mesh depends on the geometry being meshed. Since this is a handbook and not a comprehensive treatment of spline theory, the emphasis in these sections is on matters of interest to the practitioner. Those interested in more exhaustive treatments are advised to consult the books A Practical Guide to Splines [3] or Spline Functions: Basic Theory [16].

27.2 A Functional Approach to Splines The premise of this Chapter is that splines are mathematical objects that have a knowable structure, and that structure is useful to understanding and applying splines. Specifically, splines form a finite-dimensional vector space of mathematical functions f mapping an m-dimensional hypercube D into an ndimensional space. Two crucial ideas follow from this perspective. First, since the spline spaces being considered are finite dimensional, it is possible to determine a priori the dimensionality and, hence, the number of conditions needed to specify a spline. Further, it is possible to determine a set of basic splines that can be used to represent other splines. These two aspects provide the framework for the formulation of well-posed problems and robust algorithms for construction and evaluation. Second, it means that any particular spline can be understood as separate from both its method of construction and its method of evaluation. This has powerful implications. One example might be in highway engineering, where a quadratic spline with one interior knot (see next section) with fixed starting and ending positions and tangents is used to connect two straight sections of highway while avoiding the use of sharp corners. The resulting spline could be used immediately to help design forms by evaluating the spline at a series of way points and also to determine the amount of concrete needed by ©1999 CRC Press LLC

calculating the arc length of the spline. Moreover, since the spline exists independently of its construction, it may be stored and retrieved later to help determine how well the finished highway met the design goals. Even more potential benefits come from developing a single evaluator for all tensor product splines. To illustrate the power of a single, standard evaluator, suppose a simulation is built using piecewise linear splines but that later, perhaps years later, the simulation needs to be upgraded by replacing the piecewise linear spline with a smooth, higher-order spline. Such an upgrade might be prohibitively costly if the downstream uses of the original spline — evaluation, calculation of mass properties, etc. — had been based on the assumption that the underlying model was piecewise linear. However, if the evaluating functions are general and only assume a tensor product spline structure, then the cost of the upgrade would be greatly reduced or nonexistent. The functional approach to splines differs sharply from traditional CAD and CAGD. Traditionally in CAD, the dependence of geometry on the underlying function f is suppressed; the image of f is the sole object of interest, geometry is always planar or spatial, and the preferred development is as generalization of polynomial arcs or patches with an emphasis on parameters (e.g., Bezier points, control points) that can be manipulated interactively to yield various curves and surfaces. By contrast, in the approach undertaken here the underlying function f plays a critical role; properties of f itself become important, geometry is no longer restricted to be planar or spatial, and the emphasis is on defining data requirements that lead to well-posed engineering problems. Having said this, however, it should be pointed out that the end products are often the same. Any Bezier curve or rectangular patched surface can be represented exactly as a spline. Conversely, any spline, as long as it is planar or spatial, can be represented in any of the common CAGD forms. Where the two approaches are incompatible are with higher dimensional objects that have no equivalent representation in CAD and, from the CAGD side, the use of other forms (e.g., triangular patches, radial bases), which are not tensor product based.

27.3 Basics of Spline Theory In this section the basics of spline theory — degree, order, break-points, knots, continuity, and dimension — are covered. The objective is to describe splines and to determine the conditions required to specify a spline, e.g., the dimension of the spline space. The basic spline is the tensor product spline

F : D ⊂ Em → En where D = [a1, b1] × [a2, b2] × … ×[am, bm] is a rectangular parallelapiped. Tensor products are straightforward generalizations of univariate splines, so we begin with simple, univariate splines

f : [ a, b] → E1 . What is a spline? A simple and intuitively pleasing definition is that a spline is a finite sequence of polynomial arcs satisfying certain smoothness conditions at their break-points. The following are four examples. Example 27.3.1:

−t if − 1 ≤ t ≤ 0; s1 (t ) = t = . t if 0 ≤ t ≤ 1

©1999 CRC Press LLC

Example 27.3.2:

−t 2 if − 1 ≤ t < 0; s2 = 2 t if 0 ≤ t ≤ 1

Example 27.3.3:

t if − 1 ≤ t < 0; s3 (t ) = 2 t if 0 ≤ t ≤ 1

Example 27.3.4:

t 3 + t 2 if − 1 ≤ t < 0; s4 (t ) = 2 if 0 ≤ t ≤ 1 t

©1999 CRC Press LLC

Each example satisfies the working definition, as each is composed of polynomial arcs. In the examples, the degrees are 1, 2, 2, 3 with corresponding orders 2, 3, 3, and 4. Example 27.3 has degree 2 (order 3) and Example 27.4 has degree 3 (order 4) even though, in both cases, there are segments of lower degree. The following is a formal definition. Definition 27.3.1: Let break-points a = ξ 0 < ξ 1 < … < ξ q = b and polynomials p1, …, pq, each of order (degree + 1)* less than or equal to k be given. The function s defined as

0 p1 (t ) . s(t ) = . . pq (t ) 0

if t < ξ0 ; if ξ0 ≤ t < ξ1 ; . . . if ξq-1 ≤ t ≤ ξq ; if t > ξq

is a spline function of order k having the indicated break-points. The spline s is defined for all values of t by using the zero function to extend the definition. This convention provides certain mathematical conveniences in setting up computations. In the examples, –1, 0, and 1 are all break-points. The next concept is order of continuity. Observe how the examples behave at zero. Direct computation shows that the first is continuous, but there is a continuity break at zero in its derivative. The same holds for the third example. In the second, both the spline and its derivative are continuous, while a break in continuity occurs in the second derivative. In the fourth there is a continuity break in the third derivative. It is important to control the order of continuity or smoothness in order to correctly model phenomena and to assure that the resulting computational models are appropriate for other mathematical operations (e.g., optimization). Knots and multiplicities are used to manage smoothness. Definition 27.3.2: Let k be the order of the spline s. The break-point ξ is called a knot of order λ if the first break in continuity occurs in the k – λ derivative. That is, it is a knot of order λ if

s( j ) (ξ − ) = s( j ) (ξ + ) for

j = 0,..., k − 1 − λ

while

s(

k −λ )

(ξ ) ≠ s( ) (ξ ). −

k −λ

+

By this definition, the break-point 0 is a knot of multiplicity 1 in the first, second, and fourth examples and of multiplicity 2 in the third. Because of the convention of extending splines by the zero function, the first and last break-points are knots of multiplicity equal to the order k of the spline.** Thus, the break-points –1 and 1 are knots of multiplicity 2 for the first example, 3 for the next two examples, and 4 for the last example. Note that the number of spans or polynomial pieces of a spline is one less than *Degree, the greatest exponent, is a classic polynomial exponent. However, order, which is always the degree plus 1, is a more natural parameter when dealing with dimensions of spline spaces and with multiplicities of knots. It would be nice to pick one term and stick with it, but spline theorists use both and the practitioner might as well get used to it. Therefore, in this Chapter we make no effort to exclude one or the other. **Actually, the multiplicity would be less if the spline or some of its derivatives were zero at the end points but, since that is not the usual case, we assume the knot to be of multiplicity k.

©1999 CRC Press LLC

the number of break-points and is not derivable solely from the total number of knots. This fact is sometimes a source of confusion. There are two commonly accepted ways of representing knots and their multiplicities: either list the knot and its multiplicity explicitly or replicate the knot a number of times corresponding to its multiplicity. Thus, the knots for Example 27.3.3 could be listed as –1, 0, 1 with multiplicities 3, 2, 3 respectively or as –1, –1, –1, 0, 0, 1, 1, 1. Except occasionally, the second representation is preferred.* In either form, the total number of knots of Example 27.3.3 is 8. That is, knots are to be countered with their multiplicities. Up to this point we have concentrated on individual splines and described the key concepts of order, knots, multiplicities, and smoothness. Now we turn attention to the totality of splines having a specific order and knot set. Understanding properties of a collection of splines is important because these properties are used to represent and construct specific splines that solve particular problems. In particular, it is important to be able to calculate the dimension of the space and to produce a set of basis elements to be used to represent arbitrary splines. Calculating the dimension is the topic of the remainder of the section. Basis elements are covered in the next section. Let k be the order and m the total number of knots. The dimension of the spline space is m-k. Since the techniques of this Chapter rely on understanding and accepting this formula, it is worthwhile spending time establishing its validity. This can be done by a simple counting argument accounting for the required smoothness of the spline. Let the break-points be ξ 0 < ξ 1 < … < ξ q with multiplicities λ 0, …, λ q. (This is one place where it is q

convenient to use the distinct knots with multiplicities representation.) Thus, m =

∑l

j

and the

j=0

number of polynomial pieces is q. Since each polynomial piece can have order at most k, each can be defined by k polynomial coefficients. Thus, there is a total of kq coefficients to be determined, nominally requiring kq equations. However, satisfying the smoothness conditions implied by the multiplicities will reduce the number of required equations as follows. At the knot ξ i there are k– λ i continuity equations of the form s(j) (ξ i– ) = s(j) (ξ i+ ) for j = 0, …, k – 1 – λ i. Summing over all the knots gives a total of q

∑ (k – l ) = k(q + 1) – m i

i=0

continuity conditions. Subtracting this from the total number of equations required gives kq – ( k ( q + 1 ) – m ) = m – k as the dimension of the spline space. The following table shows order and knots for the Examples 27.3.1 – 27.3.4, and the dimensions of their associated spline spaces. The following are three additional properties of splines considered as elements of a function space. First, the derivative of a spline of order k is a spline of order k – 1 with the same break-points. Any knot of multiplicity k becomes a knot of multiplicity k – 1, but all others retain their original multiplicity. Second, an antiderivative of a spline of order k is a spline of order k + 1 with the same break-points. Interior knots have the same multiplicities as before and the endpoints become knots of order k + 1. *Preference is a matter of choice. The STEP [17]data exchange standards prefer the first form at this time. The DT _NURBS Library [5] uses the second form. In general, when developing software, simplicity is to be preferred. Because the second form lends itself directly to computation (see Section 27.4) it is our preference.

©1999 CRC Press LLC

Example

Order

Knots

Dimension

27.3.1 27.3.2 27.3.3 27.3.4

2 3 3 4

–1, –1, 0, 1, 1 –1, –1, –1, 0, 1, 1, 1 –1, –1, –1, 0, 0, 1, 1, 1 –1, –1, –1, –1, 0, 1, 1, 1, 1

3 4 5 5

Third, any spline of order k can be expressed as a spline of order k + 1 with the multiplicity of each knot increased by one. We close with an observation: not all splines in any particular space necessarily have discontinuities at any particular knot nor do they necessarily have the specified degree. The definition of a spline space as having a particular order (degree) and knot set merely limits the location and multiplicities of knots and the order of the splines in the space; it does not require that the actual order of each spline be equal to the order of the spline space and does not require each of the knots to be active. For example, polynomials of degree k – 1 belong to every spline space of order greater than or equal to k even though the polynomials have no discontinuities themselves. It would be possible to restrict attention only to active knots and full degree, but there are two good reasons for not doing so. First, by allowing inactive knots and less than full degree the spline spaces become closed with respect to taking limits of splines. Second, collections of seemingly disparate splines (e.g., splines of varying degrees, knots, and multiplicities, their derivatives and integrals) can be put together under a common spline framework if inactive knots and less than full degree are accepted. For example, each of the splines of Section 27.3 can be put in the framework of splines of order 4 with the knots –1, –1, –1, –1, 0, 0, 0, 1, 1, 1, 1. That spline space has dimension 7. The triple knot at zero is necessary if s1 to be included. But for s4, two of the potential discontinuities are inactive.

27.4 B-Splines In the last section, examples of splines were given, basic parameters were described, and a formula for the dimension of spline spaces was provided. In this section we look at how splines are represented. We know that there is a certain number of data that are required to define a spline but the actual definition can take many forms. For example, we could simply represent splines, as in the four examples, by sequences of polynomial arcs using the standard power series representation. In this fashion a spline with q segments would be represented by kq coefficients and a corresponding number of constraints as required by the knots and their multiplicities. But this is inherently inefficient and unstable. Inefficient because in most cases it requires the storage of more coefficients than is strictly necessary. Unstable because the power series is inherently unstable [7, 15]. An alternate, more efficient, and more robust scheme uses Bsplines as the basic elements of the representation. In this section, B-splines will be examined, again at the practitioner’s level. We will use a shortcut definition for B-splines, give examples, provide a formula for evaluation, and list a number of useful properties. We will finish the section by describing a standard representation format for univariate splines. Readers wanting a deeper, more detailed discussion of Bsplines are again referred to [3] or [16].

27.4.1 Description and Examples of B-Splines Start with a set of knots T = (τ1 ≤ … ≤ τ m) and assume no knot is repeated more than k times. The dimension of the space of splines of order k with these knots is m – k. Now consider the subsets Tj=(τ j, …, τ j+k ). There are m – k of these subsets, and each one may be used to specify a subspace of splines of order k, the dimension of which is exactly k + 1 – k = 1. Thus, for each Tj there is, up to a scaling factor, only one spline in the associated spline subspace. We assert, without proof, that we can choose one spline Bj,k from

©1999 CRC Press LLC

m–k

each of the subspaces in such a way that

∑B

j, k

≡ 1.. We will call these functions the B-splines for the

j=1

knot set T.* The following are four examples of collections of B-splines.** Example 27.4.1: T = {–1, –1, 0, 1, 1} and order = 2. The three B-splines are

− t B1,2 (t ) = 0

if -1 ≤ t ≤ 0; if 0 < t ≤ 1. if -1 ≤ t < 0; if 0 ≤ t ≤ 1.

t +1 B2,2 (t ) = 1- t 0 B3,2 (t ) = t

if -1 ≤ t < 0; if 0 ≤ t ≤ 1.

Example 27.4.2: T = {–1, –1, –1, 0, 1, 1, 1} and order = 3. Then the four B-splines are

t 2 B1,3 (t ) = 0

if -1 ≤ t ≤ 0; if 0 < t.

2 −3t - 2t + 1 B2,3 (t ) = .5 (1- t )2

if -1 < t < 0; if 0 ≤ t ≤ 1.

2 if -1 ≤ t < 0; (t + 1) B3,3 (t ) = .5 2 −3t + 2t + 1 if 0 ≤ t ≤ 1. if -1 ≤ t < 0; 0 B4,3 (t ) = 2 if 0 ≤ t ≤ 1. t

*The notation Bj,k will be simplified to Bj when there is no danger of confusion about the order. In other cases, if the knots are to be emphasized, we will use B(t ;τ j,…, τ j+k). **These B-splines are presented in piecewise polynomial form in order to provide specific examples. It is a useful exercise to verify some properties of B-splines (e.g., positivity, partition of unity, see below). It is also useful to derive the same collections using the normalized divided difference definition [3]. However, neither of these are the standard formulas for B-spline evaluation. The preferred formulas are those of Section 27.4.2.

©1999 CRC Press LLC

Example 27.4.3: T = {–1, –1, –1, 0, 0, 1, 1, 1} and order = 3. Then the five B-splines are

t 2 M1,3 (t ) = 0

if -1 ≤ t ≤ 0; if 0 < t.

-2t 2 − 2t M2,3 (t ) = 0

if -1 ≤ t < 0; if 0 ≤ t.

1 + 2t + t 2 M3,3 (t ) = 2 1 - 2t + t

if -1 ≤ t < 0;

0 M 4 , 3 (t ) = 2 −2t + 2t 0 M5,3 (t ) = 2 t

©1999 CRC Press LLC

if 0 ≤ t ≤ 1. if -1 ≤ t < 0; if 0 ≤ t ≤ 1. if -1 ≤ t < 0; if 0 ≤ t ≤ 1.

Example 27.4.4: T = {–1, –1, –1,–1, 0, 1, 1, 1, 1} and order = 4. Then the five B-splines are

− t 3 B1,4 (t ) = 0

if -1 ≤ t ≤ 0; if 0 < t.

7t 3 + 3t 2 - 3t +1

B2,4 (t ) =

( )(1- t )

B3,4 (t ) =

( )2t

B4,4 (t ) =

( )−7t

1 4

1 2

if -1 < t < 0; if 0 ≤ t ≤ 1.

2

−2t 3 - 3t 2 +1

3

if -1 ≤ t < 0; if 0 ≤ t ≤ 1.

2

- 3t + 1

(1+ t )3

1 4

0 B5,4 (t ) = 3 t

3

if -1 < t − 0; if 0 ≤ t ≤ 1.

2

+ 3t + 3t +1

if -1 ≤ t < 0; if 0 ≤ t ≤ 1.

Example 27.4.5: The Bernstein polynomials φ i,k of order k defined by

φi,k (t ) = (k! i!(k − i)!)(1 − t ) t k −i i

are the B-splines for the knot set consisting of 0 and 1 each with multiplicity k. They are the basis for Bezier curves. The importance of B-splines lies in the fact that they may be used to represent arbitrary splines. For a spline s there are unique constants a1, …, am–k so that m−k

s(t ) = ∑ a j Bj ,k (t ). j =1

For instance, the splines of Examples 27.3.1 – 27.3.4 may be represented by the B-splines of Examples 27.4.1–27.4.4 as s1 = B1,2 + B3,2 s2 = − B1,3 + B4,3

( )M − ( )B

s3 = − M1,3 − s4 =

©1999 CRC Press LLC

( )B 1 3

2,4

1 2

1 3

2 ,3

+ M5,3

3, 4

+

( )B 1 3

4, 4

+ B5, 4

Let SC(s) be the number of sign changes of the spline s and SV(c) be the number of sign in the sequence c of B-spline coefficients. The following are some useful properties of B-splines. m–k

∑B

Partition of Unity:

j, k

≡ 1 for t k ≤ t ≤ t m – k + 1

j=1

B j, k ( t ) ≡ 0 if t < t j or t > t j + k

Local Support:

B j, k ( t ) > 0 if t j < t < t j + k

Positivity:

SC ( s ) ≤ SV ( c )

Variation Diminishing:

m–k

i

t =

Marsden’s Identity:

∑a

i, j

B j, k ( t )

j=1

where

aij = (Cik −1 )

−1

∑

p1 < p2 2. For example, the cubic spline interpolation problem with k = 4 gives dimension n + 2 which is 2 more than the number of interpolation conditions. Thus, additional conditions are required. We discuss three (among many) methods for cubic interpolation and one for quadratic interpolation. Each of these methods is easily generalized to higher order splines. Method 1: Natural Spline Interpolation In this scheme, equations s″(x1) = 0, s″(xn) = 0 are added giving the linear system Aa = w to solve for the coefficients a = (a1,…,an+2) where w = (0,y1,…,yn, 0) and the matrix is

©1999 CRC Press LLC

B1′′( x1 ) B1 ( x1 ) B x 1( 2 ) • • • B1 ( xn ) B1′′( xn )

B2′′( x1 ) ... Bn+2 ′′ ( x1 ) B2 ( x1 ) ... Bn + 2 ( x1 ) B2 ( x2 ) ... Bn + 2 ( x2 ) • ... • • ... • • ... • B2 ( xn ) ... Bn + 2 ( xn ) B2′′( xn ) ... Bn+2 ′′ ( xn )

The term “natural spline” was coined by I. J. Schoenberg. He called these splines natural because they are equations of (infinitely) thin beams constrained to pass through the points (xi, yi ). Even though these splines are called “natural” they may not be so natural. That is, there is no a priori reason to believe that the data would suggest that the best fitting function should have zero second derivatives at the end points. In fact, the user will see a problem very quickly if natural cubic spline interpolation is used to approximate a function whose second derivatives are not zero at the ends. The rate of convergence will be O(h2) rather than O(h4) that might be expected otherwise.* The next method uses a different approach. Method 2: Complete Spline Interpolation When derivative information y′1, y′n , is available at the end-points, the complete spline interpolation problem where the conditions s′(x1) = y′1, s′ (xn) = y′1 are added may be solved. The right-hand side is w = (y′1, y1,…, yn , y′n )and the matrix is B1′( x1 ) B1 ( x1 ) B x 1( 2 ) • • • B1 ( xn ) B1′( xn )

B2′ ( x1 ) ... Bn′+2 ( x1 ) B2 ( x1 ) ... Bn + 2 ( x1 ) B2 ( x2 ) ... Bn + 2 ( x2 ) • ... • • ... • • ... • B2 ( xn ) ... Bn + 2 ( xn ) B2′ ( xn ) ... Bn′+2 ( xn )

For this interpolation scheme, the convergence problem observed with the natural spline goes away. Convergence is O(h4). Both methods discussed so far convert the interpolation at knots into a solvable problem by adding data. The next method removes knots. Method 3: Not-a-knot Interpolation In this method, rather than adding equations, variables are removed by deleting x2 and xn–1 from the knot sequence while keeping them as interpolation abscissae. Now, the number of coefficients is exactly n, the right-hand side is w = (y1,…,yn), and the matrix is *The natural cubic spline does solve an interesting and perhaps important variational problem. Among all the possible twice continuously differentiable solutions to the interpolation problem, the natural spline interpolant b

minimizes the quality

∫ (s′′) . Thus, it would appear that natural splines are an attractive starting point for practical 2

a

interpolation. But in practice, the difficulty mentioned above plus the fact that in applications we are usually concerned with problems about which a lot more is known than simply that the desired model is twice differentiable, make the natural spline less attractive as an all inclusive interpolation tool.

©1999 CRC Press LLC

B1 ( x1 ) B2 ( x1 ) ... Bn ( x1 ) B1 ( x2 ) B2 ( x2 ) ... Bn ( x2 ) • • ... • • ... • • • • ... • B x B x ... B x ( ) 1( n ) 2 ( n ) n n The method is not restricted to removing the second and second-to-last knots. Any two knots may be removed as long as the interlacing conditions hold. Method 4: Even Degree Interpolation The methods described above can be easily and naturally modified to handle any odd degree (even order) spline interpolation with knots at the data points. Constructing even degree (odd order) splines presents a slightly different problem. Consider interpolation by quadratic splines. Following the idea that the knots and abscissae must coincide would give knots

x1 , x1 , x1 , x2 ,..., xn −1 , xn , xn , xn for a total of n + 4 knots and n + 1 coefficients but only n equations. We need to select one additional equation. This can be done in a variety of ways, for example, by selecting a condition on the derivative at one of the end points. There is an elegant alternative. Rather than choosing the points x2,…,xn–1 to be the interior knots, select the mid-points (xi + xi+1)/2, i = 1,…, n – 1 to be the interior knots. Then, add the equations s″ (x1) = 0, s″ (xn) = 0 as in the natural cubic spline. As in the case of natural splines, the resulting linear system Aa = w can be solved for the vector of coefficients. This is an example where interpolation by splines is more conveniently done at nodes other than knots.

27.7 Parametric Curves and Rational Splines Parametric curves and surfaces are interesting because they provide a convenient method of representing closed curves, e.g., airfoil shapes, without the need to decompose the geometry into a number of domains where it can be represented directly as a function. Rational splines are interesting in that they provide a spline representation for the conic sections so useful in the aerospace and automotive industries. The actual construction of parametric and rational curves usually rely upon repeated application of univariate methods as covered in the previous section or direct construction methods, especially those for conics [6]. In this section we concentrate on what’s different when dealing either with parametric curves or rational curves.

27.7.1 Parametric Curves Given a set of data points {(xi , yi)}ni=1 in the plane, a typical geometric design problem is to construct a curve C(t) = (x(t),y(t)) passing through or near the given points. That is, so that C(ti) ≈ (xi, yi). Before the problem can be solved, parameter values {ti }ni=1 must be known. But these are usually not part of the problem statement and must be constructed from the data. The construction of parametric values must be done with care. If not, the curves may display unwanted behavior such as wild excesses or self-intersections.* It is generally recognized that a uniform parametrization ti = (i – 1)/(n – 1) is prone to giving ill-behaved curves. A more acceptable parametrization is *Even with a good parametrization the curve may have unwanted characteristics.

©1999 CRC Press LLC

that of normalized chord lengths. In this parametrization, the spacing between the parametric values is made proportional to the physical distance between the points themselves. Other alternatives [14] are available. After the parametrization has been selected, any of the methods based on univariate splines may be used to define a curve by fitting each coordinate in sequence. Thus, to construct a planar curve, construct the two functions x(t) =

∑

m−k j =1

x j Bi (t )

xjBi(t) and y(t) =

∑

m−k j =1

y j Bi (t ) yjBi(t) independently using the parameter values and the x

and y data as appropriate. Since the coordinate functions are constructed independently, these methods do not necessarily produce curves that are free from unwanted effects such as self-intersections or wavy shapes. Methods which guarantee that the resulting curves will not have these problems exist. They are, however, highly non-linear and require the simultaneous construction of the components of the curve. As such they are beyond the scope of this chapter ([10, 11]). The B-spline representation of a curve has geometric interest. If the curve is C(t) = (x(t), y(t)) where x(t) =

∑

m−k j =1

x j Bi (t ) xjBi(t) and y(t) = ∑m− k y j Bi (t ) j =1

yjBi(t), let Pj = (xj, yj) and

rewrite the curve as

C(t )∑ j =1 PjBi (t ).. m−k

The quantities Pj are called the control points of the curve C and the polygon formed by the control points is called the control polygon. The curve matches the control polygon at its first and last points. The tangents to the curve at the first and last points are parallel to the first and last legs of the control polygon. Since, at each t the B-splines are positive and sum to 1, the curve is a convex combination of its control points and is contained in the convex hull of its control polygon (the convex hull property). The control polygon provides the basis for much of the interactive curve and surface construction technology such as the classical Bezier methods [8]. Two other interesting properties are: (1) affine transformations (rotation plus translation) of parametric spline curves are accomplished by applying the transformation to each of the control points and (2) if the control polygon is convex, then the curve itself will be convex. (However, convexity of the polygon is not necessary for convexity.)

27.7.2 Rational Splines A rational spline R(t) is defined as the ratio of two splines:

x(t ) ∑ j =1 xi Bi (t ) R(t ) = = m−k . w(t ) ∑ wi Bi (t ) m−k

j =1

A planar rational spline curve is given by

x ( t ) y( t ) C(t ) = , . w( t ) w( t ) –1 The B-spline coefficients {wj }m–k j=1 of the denominator are called weights. The points Pi = wi (xi, yi) are called control points. They, and the corresponding control polygons, have the same properties as the control points and polygons have for planar spline curves.

©1999 CRC Press LLC

The interest in rational splines lies in the fact that they provide a representation for conic sections that is compatible with the spline representation. In fact, a conic section starting at Q0 and ending at Q2 with initial and final tangents intersecting at a third point Q1 has the parametrization ([8])

r (u ) =

w0Q0 (1 − u) + 2 w1Q1u(1 − u) + w2Q2u 2 2 w0 (1 − u) + 2 w1u(1 − u) + w2u 2 2

which is clearly a quadradic, rational spline and further, the weights (coefficients of the denominator) are non-zero.

27.7.3 Representation of Rational Splines and an Example The Spline Geometry Subprogram Library (DT_NURBS) [5] represents rational spline functions, curves, and surfaces in homogeneous coordinates which means that the numerators and denominators are stored separately. For example, the function x(t)/w(t) is stored as the parametric curve (x(t), w(t)). The fact that it is to be rational is indicated by setting the second element of the spline array set to the negative of the number of dependent variables.* Thus, the rational spline curve

x ( t ) y( t ) C(t ) = , w( t ) w( t ) is stored as the space curve (x(t), y(t)) except with the second element of the array set to –3. The spline evaluator returns the values x(t)/w(t) and y(t)/w(t). Example 27.7.1: One rational spline parametrization of a circular arc is

1 − t 2 2t C(t ) = , . 1 + t2 1 + t2 It is represented as

1, –3,3,3,jspan,0,0,0,1,1,1,1,1,0,0,1,2,1,1,2. Storing rational splines this way is a decided departure from standard CAGD practice. In CAGD the convention is to store control points, that is, the B-spline coefficients divided by the weights, in order to make the control polygon the primary data object. This is done to facilitate an interactive approach to curve design. For our purposes, we prefer to store rational splines, curves, and surfaces in B-spline format for two reasons. First, this scheme avoids the continual reconstruction of the actual B-spline coefficients from the weights and control points and, hence, improves computational efficiency. Second, and more importantly, the B-spline format allows for zero or negative coefficients in the denominator. Example 27.7.1 cannot be stored using the CAGD convention but is easily represented in our convention. Mathematically, using the CAGD representation means that the spline spaces will not be closed with respect to limits which is something we have gone to some pains to require by allowing degenerate degrees and inactive knots. (It is a straightforward matter to construct sequences of rational splines with positive weights which converge to Example 27.7.1. Thus, it is easy to construct rational splines having the CAGD representation which converge to a rational spline that cannot be represented that way.) Using B-spline coefficients directly assures that the resulting spline space is closed with respect to limits.

*This is a temporary state. In the future, it is planned to store the rational information as a specific property of the curve.

©1999 CRC Press LLC

27.8 Surfaces In this section definitions of (tensor product) spline surfaces will be given and methods for constructing spline surfaces will be discussed.

27.8.1 Tensor Product Splines A full generalization of univariate splines would be to consider collections of individual polynomial pieces defined over arbitrary n-dimensional domains. Such a generalization would undoubtedly find application within the engineering disciplines. However, at this time, such spaces are a subject of fundamental mathematical research with many open questions, one of which is the basic question of the dimensionality of the resulting spline spaces. Tensor product splines form an intermediate stage highly useful in their own right but without the theoretical complications. They are direct generalizations of univariate splines curves and, as such, they inherit many of the properties of simple splines. The most general tensor product spline is defined as follows. Let D = [a1, b1] × [a2, b2] × … × [am, bm] be a rectangular parallelapiped and, for each [ai, bi] choose knots T = {τp,i}Pip=1 and order ki . Then define F(u1 ,..., um ) =

Pm

P1

∑ ... ∑ fi ,...,i B(u1, T1,i )...B(um , Tm,i )

i1 =1 i m =1

1

m

1

m

where Ti, ij = {τi,ij , …, τi, ij +ki –1}. Rather than work in such generality however, we will concentrate on the most important case of the bivariate tensor product spline. Let knots T = {τp}Pp=1 and X = {ξ q}Qq=1 and orders ku , kv be given. The tensor product splines with these knots and orders is the collection of functions

f (u, v) =

P − ku Q − k v