adaptive triangular mesh generation

9
1356 AIAA JOURNAL VOL. 25, NO. 10 Adaptive Triangular Mesh Generation Gordon Erlebacher* NASA Langley Research Center, Hampton, Virginia and Peter R. Eisemant Columbia University, New York, New York A general adaptive algorithm is developed on triangular meshes. The adaptivity is provided by a combination of node addition, dynamic node connectivity and a simple node movement strategy. While the local restructur- ing process and the node addition mechanism take place in the physical plane, the nodes are displaced on a monitor surface, constructed from the salient features of the physical problem. An approximation to mean cur- vature detects changes in the direction of the monitor surface, and provides the pulling force on the nodes. Solu- tions to the axisymmetric Grad-Shafranov equation demonstrate the capturing, by triangles, of the plasma- vacuum interface in a free boundary equilibrium configuration. Nomenclature A B = area of triangle labeled B A l + y * = area of triangle /,i + 1,c A cr = critical triangle area ^min = minimum allowable triangle area ^4 max = maximum allowable triangle area c = cell center J T = toroidal current density K = approximate mean curvature f = radius vector (x,y) f' f f r - r i+V2~ r i-V2 s = arc length 5 = triangle area t =unit tangent vector u(x,z) = monitor surf ace function u = solution function w(x,y) = weight density function x,y,z = Cartesian coordinate directions a = parameter in range [0,1] a c = curvature pull a/ = normalization coefficient of the /th feature e = small parameter </> (x,y) = arbitrary function X = parameter in range [0,1] \l/ =poloidal flux function £ = computational coordinate Subscripts c = cell quantity / =node / E,F = diagonals of quadrilaterals found by two adjacent triangles / = intersection point of diagonals E and F x t xx first and second jc-derivatives Presented as Paper 84-1607 at the AIAA Seventh Fluid Dynamics, Plasma Dynamics and Lasers Conference, Snowmass, CO, June 25-27, 1984; received July 24, 1984; revision received Sept. 12, 1986. Copyright © American Institute of Aeronautics and Astronautics, Inc., 1987. All rights reserved. * Computational Methods Branch. tDepartment of Applied Physics and Nuclear Engineering. Member AIAA. Introduction VTI7HEN physical phenomena exhibit features which vary T T rapidly over a wide range of spatial and temporal scales, the corresponding computational simulation is done best in a solution adaptive sense. In this study we concentrate our at- tention on an adaptive mesh strategy. To solve the increasingly complicated problems of current interest (complex shock structures, reacting flows), the physi- cal domain is usually subdivided into a discrete set of nodes with a chosen connectivity (triangles, quadrilaterals), which might or might not have any associated structure. Conven- tional curvilinear grids are one example of structured quadrilaterals. With any structure, the continuous problem is approximated in some sense on the discrete set of nodes. The tradeoff between computational speed and number of nodes usually leads to the search for higher-order numerical schemes that maximize the coarseness of the mesh cells, without sacrificing the accuracy of the computation. With any scheme, the same objective can be achieved by dynamically adjusting the mesh so that ample resolution is supplied for high gra- dients and curvatures in the solution. At other locations, larger cells may be taken without sacrificing accuracy pro- vided that the gradation between large and small cells is suffi- ciently smooth and that the remaining more mildly varying parts of the solution are adequately represented. Many adaptive mesh techniques have been proposed for moving curvilinear grids. 1 ' 7 Each is aimed at the reduction of computational inaccuracies in regions with small-length scales. Embedded mesh algorithms which give local refine- ment without displacing the nodes, have also been exam- ined. 8 In each of the previous methods, no real provision has been made for situations where the global pattern of small- length scales changes in a dynamical manner. It is this situa- tion which motivates this study. A key element is the use of a general triangular mesh that can alter the connectivity be- tween points to conform to dynamically changing configura- tions. This alteration is called restructuring. As a first step toward this objective, an adaptive strategy on a triangular mesh is considered which combines local restructuring, node addition and mesh movement. No at- tempt is made to implement sophisticated numerical solution algorithms for specific problems. Rather, the goal is to find an adaptive mesh algorithm which is as much as possible problem-independent, and which focuses on maintaining a good structure devoid of excessively skewed triangles. It is observed that triangle skewness should be avoided, not on Downloaded by UNIVERSITY OF MARYLAND on October 15, 2014 | http://arc.aiaa.org | DOI: 10.2514/3.9790

Upload: peter-r

Post on 10-Feb-2017

214 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Adaptive triangular mesh generation

1356 AIAA JOURNAL VOL. 25, NO. 10

Adaptive Triangular Mesh Generation

Gordon Erlebacher*NASA Langley Research Center, Hampton, Virginia

andPeter R. Eisemant

Columbia University, New York, New York

A general adaptive algorithm is developed on triangular meshes. The adaptivity is provided by a combinationof node addition, dynamic node connectivity and a simple node movement strategy. While the local restructur-ing process and the node addition mechanism take place in the physical plane, the nodes are displaced on amonitor surface, constructed from the salient features of the physical problem. An approximation to mean cur-vature detects changes in the direction of the monitor surface, and provides the pulling force on the nodes. Solu-tions to the axisymmetric Grad-Shafranov equation demonstrate the capturing, by triangles, of the plasma-vacuum interface in a free boundary equilibrium configuration.

NomenclatureAB = area of triangle labeled BAl + y* = area of triangle /,i + 1,cAcr = critical triangle area^min = minimum allowable triangle area^4 max = maximum allowable triangle areac = cell centerJT = toroidal current densityK = approximate mean curvaturef = radius vector (x,y)

f' — f fr -ri+V2~ri-V2

s = arc length5 = triangle areat = unit tangent vectoru(x,z) = monitor surf ace functionu = solution functionw(x,y) = weight density functionx,y,z = Cartesian coordinate directionsa = parameter in range [0,1]ac = curvature pulla/ = normalization coefficient of the /th featuree = small parameter</> (x,y) = arbitrary functionX = parameter in range [0,1]\l/ =poloidal flux function£ = computational coordinate

Subscriptsc = cell quantity/ =node /E,F = diagonals of quadrilaterals found by two adjacent

triangles/ = intersection point of diagonals E and Fxtxx — first and second jc-derivatives

Presented as Paper 84-1607 at the AIAA Seventh Fluid Dynamics,Plasma Dynamics and Lasers Conference, Snowmass, CO, June25-27, 1984; received July 24, 1984; revision received Sept. 12, 1986.Copyright © American Institute of Aeronautics and Astronautics,Inc., 1987. All rights reserved.

* Computational Methods Branch.tDepartment of Applied Physics and Nuclear Engineering.

Member AIAA.

IntroductionVTI7HEN physical phenomena exhibit features which vary

T T rapidly over a wide range of spatial and temporal scales,the corresponding computational simulation is done best in asolution adaptive sense. In this study we concentrate our at-tention on an adaptive mesh strategy.

To solve the increasingly complicated problems of currentinterest (complex shock structures, reacting flows), the physi-cal domain is usually subdivided into a discrete set of nodeswith a chosen connectivity (triangles, quadrilaterals), whichmight or might not have any associated structure. Conven-tional curvilinear grids are one example of structuredquadrilaterals. With any structure, the continuous problem isapproximated in some sense on the discrete set of nodes. Thetradeoff between computational speed and number of nodesusually leads to the search for higher-order numerical schemesthat maximize the coarseness of the mesh cells, withoutsacrificing the accuracy of the computation. With any scheme,the same objective can be achieved by dynamically adjustingthe mesh so that ample resolution is supplied for high gra-dients and curvatures in the solution. At other locations,larger cells may be taken without sacrificing accuracy pro-vided that the gradation between large and small cells is suffi-ciently smooth and that the remaining more mildly varyingparts of the solution are adequately represented.

Many adaptive mesh techniques have been proposed formoving curvilinear grids.1'7 Each is aimed at the reductionof computational inaccuracies in regions with small-lengthscales. Embedded mesh algorithms which give local refine-ment without displacing the nodes, have also been exam-ined.8 In each of the previous methods, no real provision hasbeen made for situations where the global pattern of small-length scales changes in a dynamical manner. It is this situa-tion which motivates this study. A key element is the use of ageneral triangular mesh that can alter the connectivity be-tween points to conform to dynamically changing configura-tions. This alteration is called restructuring.

As a first step toward this objective, an adaptive strategyon a triangular mesh is considered which combines localrestructuring, node addition and mesh movement. No at-tempt is made to implement sophisticated numerical solutionalgorithms for specific problems. Rather, the goal is to findan adaptive mesh algorithm which is as much as possibleproblem-independent, and which focuses on maintaining agood structure devoid of excessively skewed triangles. It isobserved that triangle skewness should be avoided, not on

Dow

nloa

ded

by U

NIV

ER

SIT

Y O

F M

AR

YL

AN

D o

n O

ctob

er 1

5, 2

014

| http

://ar

c.ai

aa.o

rg |

DO

I: 1

0.25

14/3

.979

0

Page 2: Adaptive triangular mesh generation

OCTOBER 1987 ADAPTIVE TRIANGULAR MESH GENERATION 1357

the physical plane, but rather on a "monitor surface," con-structed from the features to be resolved.

Local restructuring allows the common edge between twoadjacent triangles to be replaced by the second diagonal ofthe resulting quadrilateral.9 If all the edges are periodicallychecked, and "flipped," according to some criterion thatreduces the skewness of the triangles, the mesh retains agood structure. The numerical algorithms implemented atthe present time only require the computation of the physicalvariables at triangle nodes. This eliminates the need for inter-polation procedures when the edges are flipped.

In conjunction with a local restructuring process, addi-tional nodes are inserted at triangle centroids when there aretoo few mesh points to resolve the salient features. On theother hand, within the context of curvilinear grids, insertingnodes entails the addition of a whole coordinate line whichwastes grid points unnecessarily. This problem has been ad-dressed by the use of partial coordinate curves.10 However,the concurrent problem of treating the dangling endpointsthen arises.

To complement the restructuring process, the mesh pointsare allowed to cluster about the salient features of the fluid.For applications with arbitrary mesh topology, a simple, ex-plicit movement algorithm, with little logic, has beendeveloped in a manner which prevents adjacent convex cellsfrom overlapping. While not guaranteed, overlap of concavecells is avoided most of the time. A combination of restruc-turing and movement is necessary to maintain a good meshstructure with an overwhelming majority of convex cells. Analternative approach is a modification of the movementmechanism to directly ensure nonoverlap.

Basic pointwise movement stems from the establishmentof a positive weight on each triangle. The weight is chosen toproperly reflect the features with respect to which the nodesshould cluster. These in turn can be interpreted as mass den-sities over the triangle area, so that each triangle acquires apositive mass. The position of the new mesh point thenbecomes the center of gravity of the polygon formed by thatnode and the triangles adjacent to it.

One of the main goals in the application of adaptivemethods is to decrease the number of arbitrary parameterswhich must be specified by the user on the basis of intuition,and replace them with parameters which have a physical in-terpretation. For two-dimensional problems, the points arepulled along a general surface according to an approxima-tion of its mean curvature. The general surface is used tomonitor salient solution features. Its direct use eliminates theneed to specify a gradient in the weight function since thatinformation is implicitly contained in the triangle area on themonitor surface.

After the introduction of some basic notation required toefficiently describe triangular meshes and operations there-on, successively discussed are the associated data structure,the use of monitor surfaces, local restructuring, node addi-tion, and finally the node movement algorithm. As a testcase, the free boundary axisymmetric plasma equilibria in atokamak configuration is computed. The free boundary istreated from a viewpoint that is directly analogous to shockcapturing, as opposed to shock fitting. The monitor surfaceis carefully chosen to ensure that the mesh points cluster inregions of rapid changes in toroidal current density and inregions of low poloidal magnetic fields. The variations ofcurrent density define the main front, whereas the magneticfield represents a second physical effect.

Triangular MeshesAmong the commonly used triangular meshes, a distinc-

tion must be made between structured and unstructuredmeshes. A structured triangular mesh can be transformedinto a uniform mesh of nearly equilateral triangles by an in-vertable coordinate transformation. Therein, each node liesat the intersection of three coordinate lines. While this

regularity simplifies the treatment of rather complicatedgeometries (as demonstrated by Winslow11) and leads to sim-ple movement algorithms, a local restructuring of such amesh destroys the simple connectivity pattern by locallychanging the number of edges connected to each node. Forthis reason, the physical domain is triangulated with norestrictions on the node connectivity, resulting in an unstruc-tured triangular mesh. The main disadvantage is the morecomplex data structure and logic that is required to keeptrack of the various nodes, edges, and triangles. Once thedata structure is established however, it does not change andis mostly transparent to the user.

For a general mesh format, a number of conventions anddefinitions are particularly advantageous and are usedthroughout this study. The nodes on an arbitrary triangle arelabeled in a counterclockwise direction. Node numbers areindicated by subscripts, typically chosen from the set (i,j,k).A cell at a node c is formed from the triangles which containit as a vertex. The cell boundary is defined by successivelyjoining triangular centroids with midpoints of edgesemanating from c until a closed loop is formed, or a bound-ary is encountered. This is illustrated in Fig. 1. A subscript cwill either refer to such a cell or to the cell center. With theabove definitions, the cell area is readily given by

A = (1)B(c)

where the summation index B includes all triangles that havethe point c as a vertex. Triangle edges are defined by theirendpoint indices. For example, the vector between nodes /and /+! is expressed as r / / + 1 . In the case of successive in-dices, the shorter notation r/+1/2 is simpler and is oftenpreferred. A similar alternative notation for triangle areas isAi+1/2, which is interpreted as the area of triangle c, /, /+ 1 incell c. As a general rule, a superscript /+ Vi translates into"evaluated at the centroid of triangle c, /, /+ 1" where c isthe node index whose cell is under discussion.

Discrete formulas for the gradient and Poisson operators,needed in the practical implementation of the adaptivescheme described later are easily obtained from appropriatediscretizations of integral relations. Details are presentedelsewhere.12

It has been shown12 that maximum bounds on the trunca-tion error from gradient and Laplacian operators are in-versely proportional to the triangle area. Nonetheless, thetruncation errors could still be orders of magnitude smallerthan these bounds, even on very skewed meshes. It is theauthors' contention that the triangles must be well structuredon the solution surface itself rather than in the physical

Fig. 1 Cell associated with node c (dotted region).

Dow

nloa

ded

by U

NIV

ER

SIT

Y O

F M

AR

YL

AN

D o

n O

ctob

er 1

5, 2

014

| http

://ar

c.ai

aa.o

rg |

DO

I: 1

0.25

14/3

.979

0

Page 3: Adaptive triangular mesh generation

1358 G. ERLEBACHER AND P.R. EISEMAN AIAA JOURNAL

plane, although no formal proof of this has yet been given.There is, however, the intuitive notion that discrete formulasof a general nature are not as accurate as formulas that ad-just to the object on which they are applied.

Data StucturesThe algorithms developed for an unstructured triangular

mesh depend heavily upon the chosen data structure. The ad-vantages gained from the use of a triangular mesh come atthe additional expense of an increased complexity in the codelogic that is necessary to track the various triangles, edgesand nodes. A library of high-level subroutine modules servesas an interface between the user and the actual low-levelcode. This library is created only once, and is independent ofthe numerical schemes adopted to solve the continuous prob-lem. Examples include node addition routines, diagonal flip-ping routines, and various types of array updates. The mainarrays used for the mesh data (excluding temporary storageand space allocation for solution variables), are defined asfollows:

X(I), Y(I), 7=1, NVT:

NGH(I,J), 7-1,10; /= 1, NVT:

x,y coordinates ofnode 7

7th neighbor ofnode 7

NED(I,J), 1= 1,2; 7= 1, NEDT: the node indices ofthe two extremitiesof edge J

NTRI(I,J), 1=1,3; J=l,NTR: 7th node index oftriangle 7

NTRIE(I,J),I=1,3;J=1,NTR: 7th edge index oftriangle J

NTRIED(I9J),I=1,2;J=1,NEDT: 7th triangle com-mon to edge 7

KH(1),I=19NVT: number of neigh-bors of node 7

NVT, NEDT, and NTR are, respectively, the total numberof vertices, edges, and triangles on the physical domain. Inthis list, an implicit numbering of nodes, edges, and trianglesis assumed. Consecutive boundary nodes and edges, and anode's neighboring indices are numbered counterclockwise.

An estimate of the required memory is possible in the limitof an infinite number of triangles. The number of edges isthen three times, and the number of triangles twice thenumber of nodes. If we allow a maximum of 10 neighborsper node, the total amount of storage required is 37 NVTmemory words, which is quite substantial compared to the 2NVT words needed for curvilinear coordinates.

In view of the evolutionary trend in computer hardwaredevelopment, a choice between striving for low-memory orhigh-speed would favor the latter. The decreasing cost permemory word shows no sign of abatement and moreover theadvent of parallel processing computers promises to multiplyexecution speed by orders of magnitude. What then are theimportant factors to consider? As the number of mesh pointsdecreases, so does the spectral radius of typical iterativemethods, which reduces the total number of work unitsnecessary to obtain a converged solution. This reduction inwork, and consequently the faster execution times, comesboth from a lower number of iterations, and from a loweramount of work per iteration, even though the latter is par-tially offset by the work associated with the adaptive scheme.However, the total CPU time associated with the node move-ment is only a function of the mesh geometry, the totalnumber of mesh points, and the structure of the monitor

surface. It does not depend on the original number of dif-ferential equations to be solved. Therefore, as the systems tosolve increase in complexity, the fraction of CPU time allot-ted to the adaptive portion of the computation becomes lessand less significant.

As a final note, no attempt has been made at this stage tooptimize the movement algorithms with respect to computerarchitecture. This would certainly vary with each computer.In our context, the storage required for the bookkeepingconsists mostly of positive integers less than 10,000 that canbe stored in two-byte words thereby substantially reducingstorage requirements. Moreover, a few mainframe computershave very fast gather and scatter routines that permit very ef-ficient vectorization algorithms on unstructured meshes.

In view of such considerations, it is not the objective hereto present sophisticated numerical schemes, but rather toconcentrate on practical means of detecting and resolvingflow features while maintaining a good mesh structure. Thegoal is feasibility rather than peak efficiency. In this spirit,most numerical schemes are made more useful.

Monitor SurfacesThe dynamic behavior of the solution is usually driven by

a small number of critical variables. For example, theevaluation of safety factors and current profiles in plasmaequilibria dictate that the poloidal current variations and thelocation of the magnetic axis be accurately determined.These critical features are loosely defined as quantities that,when properly resolved, generate numerical solutions of ade-quate accuracy. Another example is given by shock waveswhere pointwise locations are determined by accuratelyresolving variations in pressure. In many cases, the control-ling feature is not the solution vector, but some suitable com-bination of its components. These form a vector in their ownright which can be evaluated at each point in physical space.Collectively, all evaluations form an abstract surface called amonitor surface.13 Herein, only two-dimensional problemsare considered. The feature vector is a scalar function of thetwo independent variables. As the physical solution evolvesin time, so does the monitor surface. Ideally, the meshpoints are uniformly distributed on the monitor surface withlocal concentrations in regions of high curvature. With themonitor surface, the essential adaptive data have been ex-tracted from the solution and have been expressed in thissingle purely geometric object typically considerably simplerthan the solution itself. This surface contains all of the perti-nent input information, quite unlike the formulation ofAniywo14 which is similar in spirit but which is dispersedinto many distinct objects.

Once a strategy is agreed upon to resolve the monitor sur-face, the solution vector must still be interpolated onto thenew grid, in a manner consistent with the numerical schemeused to advance the solution to its next step. This last issue isseparate from the adaptive strategy and is not addressedhere. A number of issues immediately come to mind, and arepartially addressed as follows:

1) How are the various features combined to form themonitor surface?

2) Should the surface be considered as a coordinate-freegeometric entity, or as a function that spans the physicaldomain?

3) Armed with an answer to question 2, how are the gridpoints distributed across the monitor surface? Or stated dif-ferently, what are the appropriate controls that will ensure asatisfactory mesh structure that adequately dissects thesurface?

These questions are addressed in the following sections.

Local RestructuringTo take full advantage of the general connectivity of the

triangular mesh, and to avoid excessively distorted cells or

Dow

nloa

ded

by U

NIV

ER

SIT

Y O

F M

AR

YL

AN

D o

n O

ctob

er 1

5, 2

014

| http

://ar

c.ai

aa.o

rg |

DO

I: 1

0.25

14/3

.979

0

Page 4: Adaptive triangular mesh generation

OCTOBER 1987 ADAPTIVE TRIANGULAR MESH GENERATION 1359

NODE ADDITIONADD

Fig. 2 Diagonal flipping technique: a), b) edge E is replaced by F;b) locally improved structure; c), d) triangle overlap, d) caused byswitching when the parameter (AF)7 is not in the unit interval.

triangles, the diagonal flipping technique first employed byCrowley15 and illustrated in Fig. 2 is adopted. By replace-ment of the common edge E with the opposite diagonal F,two new triangles appear with F as the common edge andwith an improvement in structure over the ones initiallydisplayed. Various schemes have been proposed to determinethe most appropriate conditions under which to flip theedge, the simplest being to take the shortest diagonal, whichis the approach adopted. On the other hand, Fritts9 takes thediagonal that minimizes the sum of the cotangents of itssubtended angles. He has shown that this guarantees adiagonally dominant coefficient matrix for his discreteLaplace operator. The algorithm used here is as follows:

1) Express the diagonals E and F as parametric linesegments with the respective parameters \E and XF linearlyvarying from 0 to 1 in going between the diagonalextremities.

2) Calculate the intersection, /, of the two diagonals. Atthis point, the parameters take on the values (XF)7 and(M/.

3) If 0.2<(XF)7<0.8 and (XF)7<0.2 or (XF)7>0.8, flipthe diagonal.

4) When both (XF)7 and (XF)7 lie within the range0.2, 0.8, pick the shortest diagonal.

If the intersection results in either parameter (XF)7 or(XF)7 being outside of the unit interval, then a diagonal fallsoutside of the quadrilateral. When (\E)7 is out of range, themisplaced diagonal is F, and similarly for (XF)7 and E. Anillustration is given in Fig. 2. Since the misplacement issmoothly approached in a linear fashion, an excessively thintriangle would result near the endpoints. To maintain goodstructure by biasing against such thin triangles, preference isgiven to the midrange which we take as the interval from 0.2to 0.8. Upon starting with E in place, we know that the cor-responding (XF)7 is in the unit interval but is possibly out-side of the midrange. If it misses the midrange while thecompeting (XF)7 lands there, then an improvement resultswith a diagonal flip from E to F. This is just step 3. If both(XF)7 and (XF)7 fall in the midrange, then each diagonalavoids the excessively thin triangle problem and the beststructure results from the choice of the shortest diagonal.This is step 4.

Each interior edge is systematically checked for the need toflip. To reduce the influence of a particular ordering in theedge index storage, successive sweeps are performed until nomore flips occur. However, the cost of more than a singlesweep through the mesh is wasteful, given that only in thoseregions where the movement is substantial, or where nodesare added, does the structure deteriorate. A limitation to oneoverall edge sweep is not overly restrictive unless these

a)

FLIP

c)

Fig. 3 Node addition: a), b) node is inserted at the centroid of Atriangle that requires refinement; c) mesh structure is recovered bylocal restructuring.

regions cover a large fraction of the computational domain.At present, the edges are scanned once after every applica-tion of the movement algorithm.

Node AdditionAs nodes cluster around regions of high information con-

tent, the intermediate regions might become depleted. Nodeaddition, followed by local restructuring, reduces local trun-cation errors, as well as the number of skewed triangles thatresult because of the mesh topology. Node enrichment isuseful in shock structures, in boundary layers, and instrategic locations such as sonic points. Although node inser-tion is important and has many uses, its only application inthe code so far is in the initialization process where the meshmust adapt to an initial solution profile.12

Criteria to decide whether a triangle needs refinement arealways converted into area comparisons. The refinementtakes place with the addition of an extra node at the trianglecentroid, which is then joined to the original three trianglevertices. This generates two new triangles and three newedges. After all the additional nodes have been inserted, asweep through the edges is executed for possible diagonalflips (Fig. 3). An absence of this second scan quickly resultsin extremely skewed cells.

Clearly, a wide variety of schemes exist to assess whetheror not a node should be inserted. The simplest criterion is tostipulate that each triangle area vary inversely with somepositive weight function. Herein, the weight is the magnitudeof the gradient of the initial solution guess. Other possibleweight functions include monotone functions of triangleskewness, measured as a departure from equilateral tri-angles, or functions that increase sharply when critical pa-rameters vary rapidly over a short distance.

An ideal numerical mesh should have a triangle area thatincreases as the weight evaluated at its centroid decreases,and vice versa. However, the finite amount of available com-puter storage dictates that the area should not be allowed todecrease below a prescribed minimum (Amin), while accuracyconsiderations restrict the area to lie below some maximumvalue ^4max, usually chosen as the ratio of the total area ofthe physical domain over the strict minimum number oftriangles necessary to cover the domain if the solution weresmooth. The critical triangle area is chosen to vary linearly

max according tobetween Amin and A

(3)

where a is the weight function, normalized to unity andcalculated at the triangle centroid. A node is inserted if thetriangle area is greater than Acr. This of course leads totriangles with areas less than Amin because of the fourfoldreduction in area after the node has been inserted.

Dow

nloa

ded

by U

NIV

ER

SIT

Y O

F M

AR

YL

AN

D o

n O

ctob

er 1

5, 2

014

| http

://ar

c.ai

aa.o

rg |

DO

I: 1

0.25

14/3

.979

0

Page 5: Adaptive triangular mesh generation

1360 G. ERLEBACHER AND P.R. EISEMAN AIAA JOURNAL

To ensure that the variation of adjacent triangle areas isriot too severe in the rapidly varying regions of the monitorsurface, the weights are shifted toward higher values. Thisinduces the addition of nodes in triangles whose actualweight is below the critical threshold. With an assumedsmooth transition, these extra nodes become part of a bufferregion that surrounds the small length scale regions. Conse-quently the critical local disturbances are prevented fromleaving the resolved domain before the next mesh adjust-ment.

Grid MovementMany of the node movement concepts implemented on

triangular meshes are direct extensions of their one-dimensional counterparts. Grid movement concepts andalgorithms from the one-dimensional viewpoint are examinedfirst. This is followed by the two-dimensional generalizationwhere the main differences between the two formulations arepointed out.

As stated earlier, the objective pursued is to properlyrelocate a discrete set of nodes on a monitor surface u(x).Confusion of u(x) with the solution of the original set ofPDEs is avoided since the original problem is now decoupledinto two independent components: 1) the numerical algo-rithm that solves the PDE, and 2) the resolution of the mon-itor surface, which in one-dimension becomes a monitorcurve. In reality, these two components are coupled throughthe interpolation of the solution vector back onto the newmesh, which leads to an even wider range of possiblealgorithms.12'16

Local geometric properties of curves and surfaces are easilyderived from a Taylor expansion of the vector r = (x,u) withrespect to some independent variable, for which the two ob-vious choices are the abscissa x and the arc length s. Choos-ing x as an expansion parameter isolates a particular coor-dinate direction and does not take full advantage of thecurve's intrinsic properties. Keeping terms up to second-order in AXj, uj+l =u(xj+l) is, approximately,

(4)

where AXJ—XJ+I—XJ. The coefficients of Axj and Axj arerespectively proportional to the first and second derivativesof u. These are often used as weights to attract nodes towardregions where u varies rapidly. As ux and uxx increase, it

V/////////A

VACUUM

PLASMA

@ TOROIDAL COILS

.© /©*-—'

V//////777XFig. 4 Cross section of an axisymmetric toroidal device. Thetoroidal coils are placed symmetrically with respect to the midplane

seems natural to decrease the node interspacing so that theremainder of the Taylor series remains below a specifiederror tolerance. The generalization of Eq. (4) to two-dimensions is straightforward: replace ux by the gradient ofu, and uxx by the coefficients uxx, uxy, uyy. To simplify mat-ters somewhat, one can combine the last three coefficientsinto V2w.

However, uxx is not always appropriate as a measure of at-traction. A more precise measure is given by the actual cur-vature, which is the change in direction of the unit tangentvector with respect to arc length. The curvature K is definedby

K = dtK=- \3/2 (5)

where t= (dr/ds) is the unit tangent vector along u(x), and sis the cumulative arc length. It is also interesting to note thatthe curvature appears as the coefficient of the secondderivative in a Taylor expansion of r with respect to arclength. To emphasize the importance of curvature for properfeature capturing, consider the function u(x)=x2. Firstderivative clustering would concentrate the nodes in theregions furthest away from the origin. The second derivativeis constant, so it has no effect. Nonetheless, it seems in-tuitively obvious that the origin of u should attract morenodes than the outer regions. This is the case if secondderivative pull is replaced by curvature pull, since

K=2/(\+4x2)3/2

It is maximum at the origin and decreases toward zero as xtends to infinity. Second derivatives and curvature are ap-proximately equal only in regions where ux <t 1.

Movement AlgorithmTo allow a natural extension to two-dimensional triangular

configurations, the movement algorithm must satisfy thefollowing conditions:

1) The maximum displacement of any node is constrainedto the region formed by its nearest connecting neighbors.

2) The weight function (defined below) must only dependon properties of the monitor curve (or surface) within thearea defined in condition 1.

3) In the absence of curvature, the nodes must beuniformly distributed on the monitor surface.

Condition 2 is included for simplicity, because it is dif-ficult to increase the domain of dependency of a node on anunstructured triangular mesh beyond its nearest neighbors.Condition 3 immediately suggests the mapping

(6)

where w(r) is a positive weight function. This formula is ob-tained from the observation that if d£ is kept fixed, the spac-ing of nodes with respect to arc length s decreases with in-creasing weight, and is constant in the limit of vanishingweight. The arc length is related to the x coordinate by

(7)

which automatically includes gradient effects without theneed to introduce an extra free parameter to control its pull-ing strength. If ds is replaced by djc in Eq. (6), and if w(r) isa linear combination of the two derivative magnitudes,Dwyer's formulation is obtained.2 Motivated by the discus-sion on curvature, the weight function is chosen to be pro-portional to the curvature magnitude as performed by Ablowand Schecter17 in one dimension, and Eiseman3 in higherdimensions. Clearly, conditions 1 and 2 place restrictions onthe discretization of Eq. (6). After dividing both sides of Eq.

Dow

nloa

ded

by U

NIV

ER

SIT

Y O

F M

AR

YL

AN

D o

n O

ctob

er 1

5, 2

014

| http

://ar

c.ai

aa.o

rg |

DO

I: 1

0.25

14/3

.979

0

Page 6: Adaptive triangular mesh generation

OCTOBER 1987 ADAPTIVE TRIANGULAR MESH GENERATION 1361

(6) by d£ and differentiating them with respect to £, thediscretization of the resulting equation is given by

(8)

where the subscript j + 1A denotes the midpoint between jandy + 1 and where a. is an adjustable parameter. ExtractingSj from Eq. (8) leads to

.new _ SJ+l~———

(9)

where the superscripts new and old emphasize values beforeand after displacement, the curvatures being held constant.Equation (8) is a tridiagonal system of equations that iseasily solved for the Sj. New values of s, are interpolatedonto the old grid, and new values of (xJfUj) are derived fromknowledge of cumulative arc length Sj along the monitorcurve prior to the node displacements. Equation (9) clearlysatisfies conditions 1 and 2. Also, when a = 0,

and the solution to Eq. (9) is a uniform arc lengthdistribution.

Two-Dimensional MovementTwo of the formulas derived in the one-dimensional con-

text cannot be easily extended to two dimensions. These are1) the curvature and 2) the geometrical interpretation of themovement algorithm.

The problem of resolving a two-dimensional monitor sur-face with a finite number of mesh points, in a coordinate-free environment is complicated by the fact that there arevery few intrinsic properties of that surface akin to curva-ture. The best known among these is the Gaussian curvature,which is simply the product of the two principle cur-vatures.3 Its expression in terms of the Riemanian metric israther expensive to compute on a triangular mesh. On theother hand, the average of the principle curvatures, calledthe mean curvature, can be approximated to yield a simpleformula, which is a natural two-dimensional generalizationof the curvature of one-dimensional functions

\V2u\2 [ l + ( V w ) 2 ] 3 7 2 (10)

When gradients are small relative to unity, K is well approx-imated by the Laplacian of u. Otherwise it is always scaleddown. The basic property of Eq. (10) is that K approximatesthe mean curvature. By contrast, the Gaussian curvature isinappropriate because it vanishes along steep fronts if theirproperties vary in only one primary direction. For conve-nience, the term curvature, when applied to a two-dimensional triangulated surface, will refer to the approx-imate formula of Eq. (10).

The second point that must be addressed is the extensionof Eq. (9) to a two-dimensional formulation where arc lengthbecomes the area of the triangles on the monitor surface.However, an update of triangle areas is not easily translatedinto an update of node positions. Equation (9) is thereforemodified, and replaced by

c l ^

where ry = (xjtyj) is the radius vector of node j, Si+l/2 is thearea of triangle c, /, /+ 1 on the monitor surface, and r /+I /2 isthe vector that joins node c to the centroid of triangle c, /,

/+1 . Equation (11) can be physically interpreted on the sur-face as moving node c to the centroid of its surroundingpolygon, composed of triangles of area S /+1/z, and of massdensity (\+aKi+V2). When the curvature vanishes, nodesconverge to the geometrical center of gravity of the polygonsthat enclose them. This is the definition adopted for meshuniformity, which is now a function of the mesh convectiv-ity. To support this idea of uniformity, a uniform mesh ofequilateral triangles, after distortion, drift back to itsoriginal state, if K is set to zero. Gradient effects are im-plicitly included in Si+l/2 through the relation

5/+>/2 = y4/+ 1 /2

Upon downward projection, this produces gradient cluster-ing in the physical region. By its very construction, Eq. (11)guarantees that the nodes remain within their cells inphysical space when their nearest neighbors form convex, ornot too severely concave, polygons. After each movementsweep over the nodes, the local restructuring algorithmchecks all the interior nodes for possible diagonal flipping.This helps ensure that the cells retain an adequategeometrical structure.

Plasma EquilibriumTo test the adaptive mesh strategy, free-boundary plasma

equilibrium configurations in axisymmetric toroidal deviceson an unstructured triangular mesh are calculated. Fixed-boundary equilibrium configurations are preferably solved influx coordinates because they automatically resolve the struc-ture of the magnetic surface.18 However, since the presenceof a separatrix in the vacuum region can greatly complicatethe numerical algorithm, flux coordinates are not practicalfor free-boundary calculations. Furthermore, by their verynature, flux coordinates cannot properly treat geometrieswith multiple magnetic axes such as those found in multipolemachines.19 At the other end of the spectrum, fixed gridalgorithms are relatively simple to implement for free- orfixed-boundary configurations with single or multiplesingularities, but they require a large number of grid pointsto resolve the crowded flux surfaces at high beta.20 Unlessthe structure of the plasma equilibrium is initially known atthe onset of the computation, one must provide a fine grid-ding over the entire physical domain.

Adaptive triangular meshes retain the better features ofboth the flux- and the fixed-coordinate systems, at the ex-pense of more complicated data structures. Since all calcula-tions are performed on the physical plane with dynamicallyreconnecting triangular meshes that are free from overlap,the numerical algorithm adopted to solve the equilibriumequation is easily implemented in both fixed- and free-boundary modes.12 Excessive nodal points in the mildlyvarying regions are avoided by properly defining the monitorsurface.

Monitor SurfaceMany of the stability results for high-beta equilibrium con-

figurations under small perturbations can be traced to thestructure of the safety factor profile, particularly its value atthe magnetic axis. Accordingly, to accurately calculate theposition of the magnetic axis, the first term in the monitorsurface definition is inversely proportional to the magnitudeof the flux gradient, which is zero at the magnetic axis. Withonly a concern for the axis resolution, the monitor surfaceamplitude is given by

M(x,z)=-1

(12)

which decreases away from the axis. The variables x, z arethe radial and axial coordinates in the poloidal plane (Fig. 4)

Dow

nloa

ded

by U

NIV

ER

SIT

Y O

F M

AR

YL

AN

D o

n O

ctob

er 1

5, 2

014

| http

://ar

c.ai

aa.o

rg |

DO

I: 1

0.25

14/3

.979

0

Page 7: Adaptive triangular mesh generation

1362 G. ERLEBACHER AND P.R. EISEMAN AIAA JOURNAL

and e is a small positive parameter to prevent division byzero.

As beta, the ratio of internal to magnetic energy in theplasma increases, the magnetic flux and the current densityvary rapidly in localized regions. This results in a loss of ac-curacy in the numerical solution if the mesh cannot resolvethe small spatial length scales. Rather than directly using theflux function as is most commonly done or even the gradientas above, it is found that better solutions are obtained whenthe nodes move to resolve the current density surface. Thecurrent density JT is proportional to the source term in theequilibrium equation. It is calculated by applying a second-order differential operator to the flux function, which accen-tuates the gradients already present in the flux profile. On anintuitive level, the need to resolve the current is also evidentsince it rapidly changes from zero in the vacuum to nearlypeak values just inside the plasma. From a more analyticalstandpoint, a good resolution of the current profile leads toa good discrete representation of the differential operator,and consequently of the flux, obtained from its inversion.Furthermore, the sharp current profile near the outer edge ofthe plasma delineates the plasma boundary much better thanthe flux, so the plasma-vacuum interface can be captured bynode clustering. Both the magnetic axis and the current den-sity can be readily detected by defining the monitor surface

14- a2/32 \JT(x,z) I (13)

where the two coefficients /^ and /32 normalize their respec-tive terms to unity. This normalization is chosen arbitrarilyin the absence of other criteria. The two remainingparameters a{ and a2 are chosen by the user to control therespective importance attributed to the two terms.

ResultsTo test the accuracy of the discrete representation of the

Grad-Shafranov equation, we reproduce the analytic solutionobtained by Solove'v, in which the toroidal current density isproportional to the radial coordinate, x.12 The plasmaboundary calculated from the exact solution, is kept fixedduring the iterative process. The maximum relative error be-tween the computed and exact flux profiles is 3%. Figures 5and 6 compare the solution on a fixed and adaptive mesh,respectively. Even though the current profile is linear in jc,

Fig. 5a Fixed mesh (Solove'v equilibrium).

and constant in the vertical direction z, it falls abruptly tozero at the boundary.

After every five iterations of the main equilibrium solver,the grid adapts to the monitor surface [Eq. (13)]. This is ac-complished by two applications of Eq. (11) at every interiorgrid point. If the number of iterations between nodemovements is less than five, the convergence rate is ex-tremely low, while if much greater than five, the high cur-vature regions can escape the buffer regions. With ctl=2,and a2 = l in Eq. (13), the magnetic axis is well resolved(Fig. 6a). The flux contours form concentric curves about

Fig. 6a Adapted mesh (Solove'v equilibrium).

Fig. 6b Toroidal plasma current density on adapted mesh(Solove'v equilbirum).

Fig. 7a Mesh adapted to initial current density in free-boundaryequilibrium calculation.

Fig. 5b Toroidal plasma current density on fixed mesh (Solove'vequilibrium).

Fig. 7b Initial current density for free-boundary equilibriumcalculation.

Dow

nloa

ded

by U

NIV

ER

SIT

Y O

F M

AR

YL

AN

D o

n O

ctob

er 1

5, 2

014

| http

://ar

c.ai

aa.o

rg |

DO

I: 1

0.25

14/3

.979

0

Page 8: Adaptive triangular mesh generation

OCTOBER 1987 ADAPTIVE TRIANGULAR MESH GENERATION 1363

Fig. 8a Converged current density (free-boundary equilibrium).

Fig. 8b Converged mesh (free-boundary equilibrium).

the magnetic axis. Notice the clustering of the triangles at theplasma boundary in Fig. 6a. A comparison of Figs. 5b and6b, which show the current profile on the fixed and adaptivemesh, respectively, clearly exhibits the sharper currentdiscontinuity in the adaptive case. The spikes in Fig. 6b cor-respond to triangle edges that are badly oriented relative tothe boundary, and could be removed by better restructuringroutines. The extremely flattened triangles at the boundarydo not deteriorate the solution, contrary to expectation. It isconjectured that the triangles must be well structured on themonitor surface, and not on the physical plane, although thishas not been proven at the present time.

The free-boundary calculation is performed in a rec-tangular domain limited by the vacuum vessel boundaries(Fig. 4). Exterior toroidal current coils surround the vesseland generate the magnetic fields necessary to balance theoutward pressure force in the plasma. A self-consistent solu-tion to the equilibrium is calculated. The poloidal flux at thevacuum walls is due to the exterior current coils and to theinduced current in the plasma. When the distribution of cur-rent in the plasma and the location of the plasma boundaryhave both converged to steady states, an equilibrium isachieved. The exterior coils are symmetrically located aboutthe midplane (z = 0), so that the solution need only bedisplayed in the upper plane z>0. Starting with an initialcurrent profile, 10 successive applications of Eq. (11) overthe mesh results in the node distribution presented in Fig. 7a.Most noticeable is the vertical double band of triangles dueto the high curvature regions of the monitor surface. Thefirst corresponds to the current peak at the midplane, whichtapers off at higher values of z, while the second is locatedjust inside the plasma boundary, where the current abruptlyfalls to zero (Fig. 7b). The 400 nodes used in the computa-tion were not sufficient to resolve the magnetic axis, perhapsbecause the curvature pull, equal to 50, was too strong.However, when it was reduced, the double band disap-peared. At the present time, it seems that the method is verysensitive to the pulling parameter values. In its convergedstate, the plasma boundary is rounded off, and occupies a

smaller fraction of the vacuum chamber (Fig. 8). However,the outer edge is still well defined by the current gradients.The two bands, present in Fig. 7a, have contracted, and thetriangles are smaller. Larger triangles fill the vacuum region,which is for the most part devoid of interesting physics. Aninsufficient number of nodes in the plasma region preventsthe magnetic axis from being seen. This problem could easilybe solved with the addition of a couple of hundred points inthe plasma region, but a lack of computer resources pre-vented the testing of this effect.

From the weight function definition, the curvature of themonitor surface determines the pulling strength on thenodes. Therefore, regions of lesser curvatures, e.g., theplasma boundary to the left of the magnetic axis, are notwell resolved.

ConclusionA general adaptive strategy was developed for dynamically

moving and restructuring triangular meshes. It was appliedto the study of plasma equilibria where the capability to cap-ture free boundaries was demonstrated. In conjunction withbetter restructuring algorithms, the adaptive techniquesdeveloped herein are readily applicable to the study of com-pressible flows around complicated geometries, where inter-nal shocks and boundaries are found. Moreover, from amore general perspective, these methods are also applicableto a wide range of additional physical problems.

AcknowledgmentsThis study was supported by NASA under Grant NAG1-

355, the U.S. Air Force under Grant AFOSR-82-0176, andby DOE under Grant DE-AC02-76753016.

References^nderson, D. A., "Adaptive Mesh Schemes Based on Grid

Speeds," Proceedings of the AIAA 6th Computational FluidDynamics Conference, AIAA, New York, 1983, pp. 311-318.

2Dwyer, H. A., "A Discussion of Some Criteria for the Use ofAdaptive Gridding," Proceedings of the AIAA 6th ComputationalFluid Dynamics Conference, AIAA, New York, 1983, pp. 319-322.

3Eiseman, P. R., "Alternating Direction Adaptive Grid Genera-tion," AIAA Journal, Vol. 23, April 1985, pp. 551-560.

4Ghia, K., Ghia, U., and Shin, C. T., "Adaptive Grid Generationfor Flows with Local High Gradient Regions," Advances in GridGeneration, edited by K. N. Ghia and U. Ghia, FED-Vol. 5, ASME,New York, 1983, pp. 35-48.

5Miller, K. and Miller, R. N., "Moving Finite Element I," SIAMJournal of Numerical Analysis, Vol. 18, No. 6 Dec 1981 pp1019-1032.

6Salzman, J., "A Variational Method for Generating Multidimen-sional Adaptive Grids," Ph.D. Thesis, New York Univ., 1981.

7White, A. B., "On the Numerical Solution of Initial Boundary-Value Problems in Space Dimension," SIAM Journal of NumericalAnalysis, Vol. 19, Aug. 1982, pp. 683-697.

8Berger, M., Gropp, W., and Oliger, J., "Grid Generation forTime-Dependent Problems: Criteria and Methods," Numerical GridGeneration Techniques, Proceedings of NASA Langley WorkshopNASA CP2166, Oct. 1980, pp. 181-188.

9Fritts, M. J. and Boris, J. P., "The Lagrangian Solution to tran-sient Problems in Hydrodynamics Using a Triangular Mesh," Jour-nal of Computational Physics, Vol. 31, No. 2, May 1979 pp173-215.

10Dannenhoffer III, J. F. and Baron, J. R., "Adaptive Procedurefor Steady State Solution of Hyperbolic Equations," AIAA Paper84-0005, Jan. 1984.

HWinslow, A. M., "Numerical Solution of the QuasilinearPoisson Equation in a Nonuniform Triangle Mesh," Journal ofComputational Physics, Vol. 1, No. 2, Nov. 1966, pp. 149-172.

12Erlebacher, G., "Solution Adaptive Triangular Grids with Ap-plication to Plasma Equilibrium," Ph.D. Thesis, Columbia Univ1984.

13Eiseman, P. R., "Grid Generation for Fluid Mechanics Com-putations," Annual Review of Fluid Mechanics, Vol. 17, Jan 1985pp. 487-522.

Dow

nloa

ded

by U

NIV

ER

SIT

Y O

F M

AR

YL

AN

D o

n O

ctob

er 1

5, 2

014

| http

://ar

c.ai

aa.o

rg |

DO

I: 1

0.25

14/3

.979

0

Page 9: Adaptive triangular mesh generation

1364 G. ERLEBACHER AND P.R. EISEMAN AIAA JOURNAL

14Anyiwo, J. A., "Idealized Dynamic Grid Computation ofPhysical Systems," Numerical Grid Generation, edited by J. F.Thompson, North-Holland, Nashville, April 1982.

15Crowley, W. P., "Free Lagrange Method for NumericallySimulating Hydrodynamic Flows in Two Dimensions," 2nd Interna-tional Conference on Numerical Methods in Fluid Dynamics,Berkeley, 1970.

16Harten, A. and Hyman, J. M., "Self-Adjusting Grid Methodsfor One-Dimensional Hyperbolic Conservation Laws," Journal ofComputational Physics, Vol. 50, No. 2, May 1983, pp. 235-269.

17Ablow, C. M. and Schecter, S., "Campolytropic Coordinates,"Journal of Computational Physics, Vol. 27, No. 3, June 1978, pp.351-362.

18Delucia, J., Jardin, S. C., and Todd, A. M., "An IterativeMetric Method for Solving the Inverse Tokamak Equilibrium Prob-lem," Journal of Computational Physics, Vol. 37, No. 2, Sept.1980, pp. 183-204.

19Feneberg, W. and Lackner, K., "Multipole TakamakEquilibria," Nuclear Fusion, Vol. 13, No. 4, Aug. 1973, pp.549-556.

20Johnston, J. L., Dalhed, H. E., Greene, J. M., et al.,"Numerical Determination of Axisymmetric Toroidal MHDEquilibria," Rept. PPPL-1463, Dept. of Energy, Princeton PlasmaPhysics Laboratory, 1978.

From the AIAA Progress in Astronautics and Aeronautics Series...

SPACECRAFT CONTAMINATION:SOURCES AND PREVENTION - v. 91

Edited by J.A. Roux, The University of Mississippiand

T.D. McCay, NASA Marshall Space Flight Center

This recent Progress Series volume treats a variety of topics dealing with spacecraft contamination and con-tains state-of-the-art analyses of contamination sources, contamination effects (optical and thermal), con-tamination measurement methods (simulated environments and orbital data), and contamination-preventiontechniques. Chapters also cover causes of spacecraft contamination, and assess the particle contamination ofthe optical sensors during ground and launch operations of the Shuttle. The book provides both experimentaland theoretical analyses (using the CONTAM computer program) of the contamination associated with thebipropellant attitude-control thrusters proposed for the Galileo spacecraft. The results are also given forparticle-sampling probes in the near-field region of a solid-propellant rocket motor fired in a high-altitudeground test facility, as well as the results of the chemical composition and size distribution of potential parti-cle contaminants.

Published in 1984, 333 pp., 6x9, illus., $39.50 Mem., $69.50 List; ISBN 0-915928-85-X

TO ORDER WRITE: Publications Dept. AIAA, 370 L'Enfant Promenade, S.W., Washington, D.C. 20024-2518

Dow

nloa

ded

by U

NIV

ER

SIT

Y O

F M

AR

YL

AN

D o

n O

ctob

er 1

5, 2

014

| http

://ar

c.ai

aa.o

rg |

DO

I: 1

0.25

14/3

.979

0