Chapter 35: Grid Control and Adaptation .fr

TABLE 35.2 Computational Electromagnetic Example: Computational Improvements ..... ratio of 2.477, an engine mass flow ratio of 2.733 lb/s, and a jet total ...
3MB taille 2 téléchargements 329 vues
35 Grid Control and Adaptation 35.1 35.2

Introduction Unstructured Mesh Control Characterization of an Unstructured Mesh • Advancing Front Grid Control • Delaunay Grid Control

35.3

Mesh Quality Enhancement

35.4

Mesh Adaption

Mesh Cosmetics • Grid Quality Statistics

O. Hassan E. J. Probert

Introduction • Error Indicator in 1D • Extension to Multidimensions • Mesh Enrichment • Mesh Movement • Adaptive Remeshing • Grid Adaptation using the Delaunay Triangulation with Sources

35.1 Introduction The recent rapid development of solution algorithms in the field of computational mechanics means that presently it is possible to attempt the numerical solution of a wide range of practical problems. The essential prerequisite to a solution process of this type is the construction of an appropriate mesh to represent the computational domain of interest. A widely used approach [17,20] has been to divide the computational domain into a structured assembly of quadrilateral or hexahedral cells, with the structure in the mesh being apparent from the fact that each interior nodal point is surrounded by exactly the same number of mesh cells (or elements). Generally, such meshes are constructed by mapping the domain of interest into a square or cube and then constructing a regular mesh over the mapped domain. The mapping can be accomplished by the use of conformal techniques or differential equations or algebraic methods. To the analyst, a major advantage arising from the use of a structured mesh is that an appropriate solution method can be selected from among the large number of algorithms that are generally available for implementation on meshes of this type. The major disadvantage of the approach is the fact that it is not always possible to guarantee that an acceptable mesh will be produced following the application of a mapping method to regions of general shape. This difficulty can be alleviated by initially constructing an appropriate subdivision of the computational domain into blocks and then producing a mesh by applying the mapping method to each block separately. This results in a powerful multiblock method of mesh generation [1] that has proved extremely successful in a wide variety of applications. However, for domains of extremely complex shape, the elapsed time required by the general analyst to produce a mesh by this approach can be significant, and the approach can still result in the generation of elements of poor quality. The alternative approach is to divide the computational domain into an unstructured assembly of computational cells. The notable feature of an unstructured mesh is that the number of cells surrounding a typical interior node of the mesh is not necessarily constant. We will be concentrating our attention upon the use of triangular meshes. The methods normally adopted to generate unstructured triangular

©1999 CRC Press LLC

FIGURE 35.1

Characterization of the mesh. (a) In two dimensions (b) in three dimensions.

meshes are based upon either the Delaunay [2] or the advancing front [15] approaches. Discretization methods for the equations of fluid flow that are based upon integral procedures, such as the finite volume or the finite element method, are natural candidates for use with unstructured meshes. The principal advantage of the unstructured approach is that it provides a very powerful tool for discretizing domains of complex shape [5,14], especially if triangles are used in two dimensions and tetrahedra are used in three dimensions. In addition, unstructured mesh methods naturally offer the possibility of incorporating adaptivity [6]. Disadvantages following from adopting the unstructured grid approach are that the number of alternative solution algorithms is currently rather limited and that their computational implementation places large demands on both computer memory and CPU [4]. Further, these algorithms are rather sensitive to the quality of the grid being employed, and so great care has to be taken in the generation process. The improvement of grid quality is a problem of major importance, particularly as grid generation techniques mature, and it is an issue that will be addressed in this chapter.

35.2 Unstructured Mesh Control 35.2.1 Characterization of an Unstructured Mesh The provision of an adequate mechanism of mesh control is a key ingredient in ensuring the generation of a mesh of the desired form. To achieve this, the user needs to be able to specify, to the mesh generator, the geometrical characteristics of the required mesh. In the approach described here, the geometrical characteristics of a general unstructured mesh of triangular (2D) or tetrahedral (3D) elements are considered to be defined locally in terms of certain mesh parameters. For a Delaunay approach (see Chapter 16) the parameter used is element size, δ . In the case of an advancing front approach (see Chapter 17) a set of N mutually orthogonal directions α i ; i = 1, ... N, and N associated element sizes δ i ; i = 1, ... N (see Figure 35.1) where N (= 2 or 3), is the number of dimensions. Thus, at a certain point, if all N element sizes are equal, the mesh in the vicinity of that point will consist of approximately equilateral elements. To aid the advancing front mesh generation procedure, a transformation T that 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 is referred to as the normalized space. For a general mesh this transformation will be a function of position. The transformation T is the result of superimposing N scaling operations with factors 1/δ i in each α i direction. Thus N 1 T(α i , δ i ) = ∑ α i ⊗ α i i =1 δ i

©1999 CRC Press LLC

(35.1)

FIGURE 35.2

The effect of transformation T for a constant distribution of mesh parameter.

where ⊗ denotes the tensor product of two vectors. The effect of this transformation in two dimensions is illustrated in Figure 35.2 for the case of constant mesh parameters throughout the domain.

35.2.2 Advancing Front Grid Control The algorithmic procedure for mesh generation by the advancing front method is based upon the method originally proposed in [5] for two dimensions and then extended to three dimensions in [12,13]. The approach has 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. The mechanism that can be employed to achieve the necessary degree of control over the characteristics of the generated mesh in this context is to define the required spatial distribution of the mesh parameters by means of a background mesh and /or by the use of sources. 35.2.2.1 The 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, and hence T, are defined at the nodes of the background mesh. At any point within an element of the background grid, the transformation T is computed by linearly interpolating its components from the element nodal values. The background mesh employed must cover the region to be discretized (see Figure 35.3). 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 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 linear or constant spacing and stretching through the computational domain. The generation process is always carried out in the normalized space. The transformation T 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 tetrahedra 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. The effect of prescribing a variable mesh spacing and stretching is illustrated in Figure 35.3 for a rectangular domain and using a background grid consisting of two triangular elements.

©1999 CRC Press LLC

FIGURE 35.3 Variable mesh spacing and stretching for a rectangular domain using a background mesh consisting of two elements.

35.2.2.2 Sources The requirement of constructing an adequate background grid for complex geometries has proved to be a significant barrier to the successful use of the approach by the inexperienced user. To alleviate this problem, the concept of the use of point, line, and plane sources can be added to the process of defining the variation of the grid parameters over the computational domain. For example [11], with the location of a point source specified, the nodal spacing δ defined by the source at location x is determined as

δ ( x) = δ s δ ( x ) = δ se

x1 < r1  2  x1 ln    r2 − r1 

(35.2)

x1 ≥ r1

where | x1 | denotes the distance from x to the point source and δs , r1 and r2 are user-specified constants. Line and plane sources can be constructed in a similar fashion. Point, line, and plane sources defined in this way provide an isotropic distribution in which the element size is specified to be the same in all directions. When combined with the background mesh, the mesh generator will, at a location x, consider the required mesh size to be the minimum of the spacing defined at x by the background mesh and by all the active sources. To illustrate the simplicity of using sources to aid the mesh generation process, consider the problem of producing an adequate mesh for the simulation of inviscid aerodynamic flow over a wing. It is well known that the mesh employed should be clustered in the vicinity of the leading and trailing edges of the wing, while larger elements can be employed elsewhere. A mesh of this type is readily generated by using a background mesh consisting of one tetrahedral element supplemented by line sources lying along the leading and trailing edges of the wing. Figure 35.4 shows a mesh that has been generated on a wing surface when this approach is followed.

35.2.3 Delaunay Grid Control The Delaunay grid generation approach is based on a simple geometrical construction. Given a set of points, a tiling is constructed with the property that each point has an associated region closer to that point than to any other point. The boundary of the tile is formed by the perpendicular bisectors of the lines joining each point and its immediate neighbors. If points having a common tile boundary are connected, then a triangulation of the points is obtained. Points for connection by the Delaunay algorithm can be derived in many ways. Two ways that have been used include superposition methods and points generated from an independent technique (e.g., structured grid methods [18]). The former approach gives rise to good-quality grids in the interior of regions, but grid quality can deteriorate where the

©1999 CRC Press LLC

FIGURE 35.4

Discretization of the surface of a wing.

tetrahedra and the connections are constrained by the boundaries. The latter approach is restrictive for general geometries. New methods have been developed which are flexible, easy and efficient to implement, require minimal manual user input, and provide good grid quality. 35.2.3.1 Automatic Point Creation Driven by the Boundary Point Distribution For grid generation purposes, the boundary of the domain is defined by points and associated connectivities. It will be assumed that the grid points on the surface reflect appropriate variations in surface slope and curvature. Ideally any method which automatically creates points should ensure that the boundary point distribution is extended into the domain in a spatially smooth manner. The method used employs a similar idea to interpolating from a background grid as described in the advancing front method, but here the Delaunay triangulation is used to provide automatically an equivalent background grid whose node spacing is derived from the given boundary point spacing. Consider, in two dimensions, boundary line segments on which points have been distributed that enclose a domain. It is required to distribute points within the region so as to construct a smooth distribution of points. For each point on the boundary, a typical length scale for the point can be computed as the average of the two lengths of the connected edges. No points should be placed within a distance comparable to the defined length scale, since this would inevitably define a badly formed triangle. Hence, for each point, i, it is appropriate to define a region Γi within which no interior point should be placed. In the Delaunay triangulation algorithm, the surface or boundary points are connected together to form an initial triangulation. Points can be placed anywhere within the interior but not inside any of the regions Γi already identified. Hence, points are placed at the centroid of each of the formed triangles and then a test is performed to determine if any of the points lie within any Γi . If a point lies within Γi , it must be rejected; if it does not, then it can be included and connected using the Delaunay triangulation algorithm. Once a point has been inserted, it too must have associated with it a length scale which defines an effective region Γi for point exclusion. A newly inserted point takes a length scale from interpolation of the length scales from the nodes that formed the triangle from which it was created. In this way a smooth transition between boundaries of interior points can be ensured. This process of point insertion continues until no point can be added because the union of all Γi covers the entire interior domain. The interpolation of the boundary point distribution function is linear throughout the field. If required, this can be modified to provide a weighting towards the boundaries so as to ensure greater point density in such regions. The implementation of such a procedure involves a scaling of the point distribution of the nodes that form an element on the surface.

©1999 CRC Press LLC

FIGURE 35.5 The effect of the background grid on the control of grid point clustering. (a) The background grid with specified point spacing, (b) the generated grid.

FIGURE 35.6

Effects of point and line sources

35.2.3.2 Automatic Point Creation Controlled by a Background Mesh Another way to control the point spacing in the domain is to use a background mesh [6,15]. A mesh is overlaid over the domain, and at each node a point spacing is specified. The point distribution function, δ, for a prospective point is obtained from the interpolated spacing from the background mesh. Figure 35.5 shows a grid within a rectangular domain that has used the background grid shown to ensure grid clustering. 35.2.3.3 Automatic Point Creation by the Use of Sources In some cases the boundary point distribution is not the best distribution to use to construct an efficient grid, while the construction of an adequate background grid mesh for a three-dimensional geometry is a tedious process. However, the use of point and line sources has proved to be a successful technique for the advancing front method, and it also proves effective when implemented with the Delaunay triangulation procedure. The spacing δ at a point is taken to be the minimum of the spacing interpolated from the boundary point distribution and the spacing obtained from all the sources using Eq. 35.2. Examples of the use of the sources approach are shown in Figure 35.6.

35.3 Mesh Quality Enhancement 35.3.1 Mesh Cosmetics In the case of simple geometries, and for regularly spaced elements, the mesh generation procedure will often prove satisfactory. However, for more complex configurations, or in situations where variation in ©1999 CRC Press LLC

FIGURE 35.7

Diagonal swapping in two dimensions.

FIGURE 35.8

Skew polygon.

element size is rapid and considerable, deformed elements (i.e., elements with a minimum dihedral angle less than some specified tolerance) may appear. In these situations there are several operations that can be performed to enhance the quality of the mesh that has been generated. Four possible operations are diagonal swapping, element reconnection, element removal, and mesh smoothing. These devices are described below and should be carried out in the following order. 35.3.1.1 Edge Swapping For a mesh of triangular elements, local diagonal swapping is a straightforward procedure performed on a pair of adjacent elements to improve the regularity of the triangles. This situation is illustrated in Figure 35.7. The connectivity of the existing pair of elements is changed if the minimum angle occurring in the new pair of triangles is greater than the minimum angle in the existing pair. In three dimensions, it is possible, although more difficult, to enhance grid quality through the implementation of an edge swapping procedure. The method can be described algorithmically as follows: Loop over sides If (side i1-i2 is not a boundary side) then 1- list all elements which have i1-i2 as an edge 2- determine the minimum dihedral angle(dh) for the elements in list 3- if (dh) is less than α , then 3.1 form the skew polygon from the nodes of the elements excluding i1 and i2, i.e., j1-j2-j3-j4-j5 (Figure 35.8) 3.2 from the sides of the skew polygon determine the two adjacent sides containing the smallest angle n1-n2-n3 ©1999 CRC Press LLC

FIGURE 35.9

Nodal reconnection.

3.3 form two tetrahedral elements n1-n2-n3-i1, n1-n2-n3-i2 3.4 check that neither of the two new elements contains a dihedral angle smaller than (dh) 3.5 update the skew polygon 3.6 go to step 3.2 End if End if End loop 35.3.1.2 Nodal Reconnection A search is made over all distorted elements (containing dihedral angle less than α ), and their neighbors, and the possibility of creating a new element by reconnecting the connectivities of a distorted element and one of its neighbors is investigated. This procedure results in the creation of three elements out of the original pair of adjacent elements, as illustrated in Figure 35.9. The creation and reconnection is performed if the minimum dihedral angle in the new configuration is greater than that in the existing one. The reconnection procedure will not apply for meshes generated using the Delaunay method, as this situation should not arise. For meshes generated by the advancing front method, a significant improvement in mesh quality results from implementing this technique. 35.3.1.3 Edge Deletion If badly deformed elements (containing dihedral angle less than β ) are still present after the previous two operations have been performed, then an attempt is made to remove these elements from the mesh. This is achieved by collapsing one of the sides of the deformed element so that its nodes coincide. When investigating an element, the decision of which side to collapse is made by considering each side in turn and examining the adjacent elements that would exist if that particular side were to be removed. The chosen configuration is the one with the largest minimum dihedral angle. 35.3.1.4 Spatial Smoothing The sides of the element in the mesh are replaced by springs of unit stiffness. The force F ij exerted by the spring connecting nodes i and j is taken to be:

F ij = x i − x j

(35.3)

where xi and xj are the position vectors of nodes i and j, respectively. For badly deformed elements the resulting nodal forces will not be in equilibrium, whereas for regions of well-formed elements the resulting nodal forces will nearly vanish. A relaxation procedure is adopted that moves the nodes until nodal equilibrium of forces is achieved. The new nodal position is accepted provided an improvement in the dihedral angle of the surrounding elements results from the smoothing procedure. A few passes are usually enough to ensure local smoothing of the mesh.

©1999 CRC Press LLC

35.3.2 Grid Quality Statistics It is difficult to display unstructured three-dimensional grids in a way that provides effective information of the grid quality. Planar cuts taken through the unstructured grid provide some information on grid point density, but do not provide any useful information on the quality of the grid connectivity. For further information on grid quality, statistics of the grid should be computed. Statistics that can be computed include the ratio of the dihedral angle within a tetrahedron to the optimum angle, the ratio of volumes of two adjacent tetrahedra, the ratio of the maximum to minimum side length per element and per point, and the number of elements surrounding a point. For comparison, Figure 35.10 shows grid statistics for two distinct grids that have been generated using the same surface grid: one using the Delaunay approach and the other using the advancing front. The advancing front grid contained 231,507 elements and 42,410 points and the Delaunay grid contained 233,182 elements and 40,442 points. The plots of the number of elements surrounding a point show two distinct maxima; one is centered around the optimum value of 24 elements per point, and a second at approximately 12, which is the optimum number of element connections to a boundary point. The plot of dihedral angle shows that the distribution is centered about an angle just less than the optimum of about 72°. The ratios of volumes of two adjacent elements are also well distributed, indicating smoothly varying element sizes. The smoothness of the grid is also confirmed by the plots of maximum side length to minimum side length both per element and per point. The two grids are comparable in the measures chosen. The improvements in mesh quality that can be obtained by the implementation of the four mesh cosmetic operations described in Section 35.3.1 and applied to the previous mesh are displayed in Table 35.1. Figure 3.11 shows a further illustration of the mesh quality enhancement that can be achieved by varying the control parameters α and β. Practical experience shows no significant improvement can be gained from adopting a value of α greater than 50°. In addition, the value of β should be restricted to approximately 10° to avoid the removal of an inordinately large number of points, which would adversely affect the mesh resolution. This mesh cosmetic procedure can prove vital in the case of time-dependent problems, where the solution is advanced at the minimum time step, which is related to the minimum element height. Traditionally this problem is circumvented by using a local time step for the badly distorted elements, hence avoiding the requirement of an excessive number of time steps to perform the simulation. However, the use of local time stepping can cause a deterioration in solution quality. The following computational electromagnetic example demonstrates a reduction in the number of time steps required to perform a calculation and in the number of elements running at local time step. In this example all nodal points connected to elements below a specified minimum height are advanced at local time step. The improvements that can be obtained through application of the mesh cosmetics are clearly shown in Figure 35.12 and Table 35.2.

35.4 Mesh Adaption 35.4.1 Introduction The procedures described above allow for the computation of an initial approximation to the steady state solution of a given problem. This approximation can generally be improved by adapting the mesh in some manner. Here, we follow the approach of using the computed solution to predict the desired characteristics (i.e., element size and shape) for a new, adapted mesh. The ultimate aim of the adaptation procedure is to predict the characteristics of the optimal mesh. This can be defined as the mesh in which the number of degrees of freedom required to achieve a specified level of accuracy is a minimum. Alternatively, it can be interpreted as the mesh in which a given number of degrees of freedom are distributed in such a manner that the highest possible solution accuracy is achieved. We have made an attempt to develop a heuristic adaptive strategy that uses error estimates based upon concepts from interpolation theory. The possible presence of discontinuities in the solution is taken into account and, in addition, the procedure provides

©1999 CRC Press LLC

FIGURE 35.10

TABLE 35.1 Mesh Initial α = 70, β = 10 α = 50, β = 10

Grid statistics for grids around an Onera M6 wing.

Improvements in Mesh Quality Around an Onera M6 Wing Number of Elements

Number of Points

Min. Volume

Min. Dihedral

Ratio of Adjacent Volumes

202,091 187,463 188,270

35,482 35,478 35,481

2.2e-05 1.1e-05 1.5e-05

0.032 6.270 6.2

2891 17 17

©1999 CRC Press LLC

FIGURE 35.11

Mesh quality enhancement by varying the control parameters α and β.

information about any directionality that may be present in the solution. The advantages of using directional error indicators become apparent when we consider the nature of the solutions to be computed involving flows with shocks, contact discontinuities, etc. Such features can be most economically represented on meshes that are stretched in appropriate directions. Although these error estimates have no associated mathematical rigor, considerable success has been achieved with their use in practical situations. The computed error, estimated from the current solution, is transformed into a spatial distribution of “optimal” mesh spacings that are interpolated using the current mesh. The current mesh is then modified with the objective of meeting these optimal distribution of mesh characteristics as closely as possible. Three alternative procedures will be discussed here for performing the mesh adaption. The resulting mesh is employed to produce a new solution and this procedure can repeated several times until the user is satisfied with the quality of the computed solution.

35.4.2 Error Indicator in 1D The development of a method for error indication is considerably simplified if we restrict consideration to problems involving a single scalar variable. For this reason, when solving the Euler equations, a key variable is identified and then the mesh adaptation is based on an error analysis for that variable alone. The choice of the best variable to use as a key variable remains an open question, but the Mach number has been adopted for the computations reported in the chapter.

©1999 CRC Press LLC

FIGURE 35.12

©1999 CRC Press LLC

Improvement in the number of nodes violating the minimum time step.

TABLE 35.2 Computational Electromagnetic Example: Computational Improvements Achieved Through the Implementation of Mesh Cosmetics Number of Points at Local Time Step Min. Height 3.e-6 0.0001 0.0005 0.001 0.005 0.01

Number of Time Steps per Cycle

Initial Mesh

Mesh 1

Mesh 2

Mesh 3

Initial Mesh

Mesh 1

Mesh 2

Mesh 3

0 8 12 52 3670 7624

0 0 0 0 41 125

0 0 0 0 42 101

0 0 0 4 44 84

15135 5001 5001 1000 101 79

204 204 204 204 101 79

204 204 204 204 101 79

1000 1000 1000 500 101 79

Consider first the one-dimensional situation in which the exact values of the key variable σ are approximated by a piecewise linear function s . The error E is then defined as E = σ ( x1 ) − σˆ ( x1 )

(35.4)

We note here that if the exact solution is a linear function of x1, then the error will vanish. This is because our approximation has been obtained using piecewise linear finite element shape functions. Moreover, if the exact solution is not linear, but is smooth, then it can be represented, to any order of precision, using polynomial shape functions. To a first order of approximation, the error E can be evaluated as the difference between a quadratic finite element solution s and the linear computed solution. To obtain a piecewise quadratic approximation, one could obviously solve a new problem using quadratic shape functions. This procedure, however, although possible, is not advisable as it would be even more costly than the original computation. An alternative approach for estimating a quadratic approximation from the linear finite element solution is therefore employed. Assuming that the nodal values of the quadratic and linear approximations coincide, i.e., the nodal values of E are zero, a quadratic solution can be constructed on each element, once the value of the second derivative is known. Thus the variation of the error E within an element e can be expressed as

d 2σ˜ 1 Ee = ζ (he − ζ ) 12 2 dx

(35.5) e

where ζ denotes a local element coordinate and he denotes the element length. A procedure for estimating the second derivative of a piecewise linear function is described below. The root-mean-square value EeRMS of this error over the element can be computed as 12

he Ee2  1 2 d 2σ˜ RMS Ee =  ∫ dζ  = he 2 120 dx1  0 he 

(35.6) e

where | . | stands for absolute value. We define the “optimal” mesh, for a given degree of accuracy, as the mesh in which this root- meansquare error is equal over each element. In the present context, this requirement may be regarded as being somewhat arbitrary. However, it has been shown [9] that the requirement of equidistribution of the error leads to optimal results when applied to certain elliptic problems. This requirement is therefore written as

he2

©1999 CRC Press LLC

d 2σ˜ 2 = C dx1

(35.7)

where C denotes a positive constant. Finally, the requirement of Eq. 35.7 suggests that the “optimal” spacing δ on the new adapted mesh should be computed according to

δ2

d 2σ˜ 2 = C dx1

(35.8)

The first derivative of the computed solution on a mesh of linear elements will be piecewise constant and discontinuous across elements. Therefore, straightforward differentiation of s leads to a second derivative which is zero inside each element and is not defined at the nodes. However, by using a recovery process, based upon a variational or weighted residual statement [21], it is possible to compute nodal values of the second derivatives from element values of the first derivatives of s . The use of Eq. 35.8 then yields directly a nodal value of the “optimal” spacing for the new mesh.

35.4.3 Extension to Multidimensions Equation 35.8 can be directly extended to the N-dimensional case by writing the quadratic form

 n  δ β2  ∑ m ij β i β j  = C  i; j =1 

(35.9)

where β is an arbitrary unit vector, δβ is the spacing along the direction of β, and mij are the components of a N × N symmetric matrix of second derivatives:

m ij =

∂ 2σˆ ∂x i∂x j

(35.10)

These derivatives are computed, at each node of the current mesh, by using the N-dimensional equivalent of the procedure presented in the previous section. The meaning of Eq. 35.9 is graphically illustrated in Figure 35.13, which shows how the value of the spacing in the β direction can be obtained as the distance from the origin to the point of intersection of the vector β with the surface of an ellipsoid. The directions and lengths of the axes of the ellipsoid are the principal directions and eigenvalues of the matrix m, respectively. Several alternative procedures exist for modifying an existing mesh in such a way that the requirement expressed by Eq. 35.9 is more closely satisfied. Three such methods will be described here. In the first procedure, called mesh enrichment, the nodes of the current mesh are kept fixed but some new nodes/elements are created. In the second procedure, referred to as mesh movement, the total number of elements and nodes remains fixed but their position is altered. Finally, in the adaptive remeshing algorithm, the mesh adaption is accomplished by completely regenerating a new mesh.

35.4.4 Mesh Enrichment In order to adapt a mesh using mesh enrichment, a sweep over all the sides in the mesh is made and the “optimal” spacing in the direction of each side is computed according to expression 35.9. For each side, the matrix m is taken to be the average of its value at the two nodes of the side. The enrichment procedure consists of introducing an additional node for each side for which the calculated spacing is less than the length of the side. For interior sides, this additional node is placed at the mid-point of the side, whereas for boundary sides, it is necessary to refer to the boundary definition and to ensure that the new node is placed on the true boundary. When any side is subdivided in this manner, the elements associated with that side will also need to be subdivided in order to preserve the consistency of the final mesh. ©1999 CRC Press LLC

FIGURE 35.13

Determination of the value of the spacing along the β direction.

FIGURE 35.14

Mesh enrichment: three possible cases of refinement.

Figure 35.14 illustrates the three possible ways in which this element subdivision might have to be performed in two dimensions. The number of sides to be refined depends on the choice of the constant C in Eq. 35.9. To avoid excessive refinement in the vicinity of discontinuities, a minimum threshold value for the computed spacing can be used. When the mesh enrichment procedure has been completed, the values of the unknowns at the new nodes are linearly interpolated from the original mesh and the solution algorithm is restarted. This procedure has been successfully implemented in two and three dimensions, and several impressive demonstrations of the power of this technique have been made [6,10,13]. ©1999 CRC Press LLC

FIGURE 35.15 Supersonic flow past a double ellipse configuration. Sequence of meshes and solutions obtained using adaptive enrichment.

The application of the enrichment procedure in the solution of a two-dimensional example is illustrated in Figure 35.15. The problem solved is a Mach 8.15 flow past a double ellipse configuration at 30o angle of attack. The initial mesh and two adaptively enriched meshes are shown together with the computed Mach number solutions. The application of the enrichment algorithm in three dimensions is shown in Figure 35.16. The inviscid flow past a double ellipsoid is solved. The free stream Mach number is 8.15 at 30°. The starting mesh and the refined mesh are shown together with the corresponding Mach number controus.

©1999 CRC Press LLC

FIGURE 35.16 Supersonic flow past a double ellipsoid configuration. Sequence of meshes and solutions obtained using adaptive enrichment.

It can be observed, from the examples presented, how the quality of the solution is significantly improved by the application of the enrichment procedure. The main drawback of the approach is that the number of elements increases considerably following each application of the procedure. This means that, in the simulation of practical three-dimensional problems, only a small number of such adaptations can be contemplated.

©1999 CRC Press LLC

FIGURE 35.17

Mesh movement: element sides are replaced by springs.

35.4.5 Mesh Movement For the mesh movement alogrithm, the element sides are considered as springs of prescribed stiffness and the nodes are moved until the spring system is in equilibrium. Consider two adjacent nodes J and K as shown in Figure 35.17. The force fJK exerted by the spring connecting these two nodes can be taken to be

f JK = CJK (r J − r K )

(35.11)

where CJK is the stiffness of the spring and rJ and rK are the position vectors of nodes J and K, respectively. Assuming that

h = rJ − rK

(35.12)

the adaptation requirement of Eq. 35.11 will be satisfied if the spring stiffnesses are defined as N

CJK = h ∑ m ij nJK i nJK i

(35.13)

i ; j =1

Here n JK is the unit vector in the direction of the side joining nodes J and K. For equilibrium, the sum of spring forces at each node should be equal to zero. The assembled system can be brought into equilibrium by simple iteration. In each iteration, a loop is performed over all the interior nodes and new nodal coordinates are calculated according to the expression SJ

rJ

NEW

=

∑C

r

JK K

K =1 SJ

∑r

(35.14) K

K =1

where the summation extends over the number of nodes, SJ, which surround node J. Sufficient convergence is normally achieved after three to five passes through this procedure. ©1999 CRC Press LLC

FIGURE 35.18

Example of node movement on an unstructured grid.

This technique will not necessarily produce meshes of better quality, as badly formed elements can appear in regions (such as shocks) in which the spring coefficients CJK vary rapidly over a short distance. To avoid this problem, the definition of the value of CJK given in Eq. 35.13 can be replaced by an expression of the form

CJK MOD = 1 +

ACJK B + CJK

(35.15)

This can be regarded as a blending function definition for the spring stiffnesses, and it has been constructed so as to ensure that, with a suitable choice for the constants A and B, excessively small or excessively large element sizes are avoided. This, in turn, means that meshes of acceptable quality will be produced. More sophisticated procedures for controlling the quality of the mesh during movement can also be devised [11], and mesh movement algorithms have been successfully used in two- and threedimensional flow simulations on both structured and unstructured meshes [7,11]. The mesh movement algorithm described has been applied to the problem of viscous flow past an aerofoil. Figure 35.18 shows the initial mesh and the final mesh obtained after applying the mesh movement routine every 500 time steps for 9 times. It can be seen that the final mesh inherited all the solution features solutions produced following a series of mesh movement adaption. In some cases the improvement obtained using this method is minor. This is because the algorithm does not allow for the creation of new nodes, and so the quality of the final solution is very much dependent on the topology of the initial mesh. This is a major drawback of the mesh movement strategy. A possible remedy to this problem is to combine mesh enrichment and mesh movement procedures.

35.4.6 Adaptive Remeshing The basic idea of the adaptive remeshing technique is to use the computed solution to provide information on the spatial distribution of the mesh parameters. This information will be used by the mesh generator described in Sections 35.1 and 35.2 to generate a completely new adapted mesh for the problem under investigation.

©1999 CRC Press LLC

The “optimal” values for the mesh parameters are calculated at each node of the current mesh. The directions α i ; i = 1, ..., N, are taken to be the principal directions of the matrix m. The corresponding mesh spacings are computed from the eigenvalues ei ; i = 1, ..., N, as

δi =

C ei

for i = 1,..., N

(35.16)

The spatial distribution of the mesh parameters is defined when a value is specified for the constant C. The total number of elements in the adapted mesh will depend upon the choice of this constant. For smooth regions of the flow, this constant will determine the value of the root-mean-square error in the key variable that we are willing to accept. Therefore this constant should be decreased each time a new mesh adaption is performed. On the other hand, solutions of the Euler equations are known to exhibit discontinuities. At such discontinuities, the root-mean-square error will always remain large, and therefore a different strategy is needed in the vicinity of such features. In the practical implementation of the present method, two threshold values for the computed spatial distribution of spacing are used: a minimum spacing δmin and a maximum spacing δmax, so that

δ min ≤ δ i ≤ δ max for i = 1,..., N

(35.17)

The reason for defining the maximum value δmax is to account for the possibility of a vanishing eigenvalue in Eq. 35.16 which would render that expression meaningless. The value of δmax is chosen as the spacing that will be used in the regions where the flow is uniform (the far field, for instance). On the other hand, maximum values of the second derivatives occur near the discontinuities (if any) of the flow where the error indicator will demand that smaller elements are required. By imposing a minimum value δmin for the mesh size, we attempt to avoid an excessive concentration of elements near discontinuities. As the flow algorithm is known to spread discontinuities over a fixed number of elements (i.e., two or three), δmin is therefore set to a value that is considered appropriate to ensure that discontinuities are represented to a required accuracy. This treatment also accounts for the presence of shocks of different strength in which, since the numerical values of the second derivative are different, Eq. 35.16 will assign them different mesh spacings (e.g., larger spacings in the vicinity of weaker shocks). The total number of elements generated in the new mesh will now depend on the values selected for C, δmax, and δmin. However, it turns out that this number is mainly determined by the choice of the constant C, which is somewhat arbitrary. The criterion employed here is to select a value that produces a computationally affordable number of elements. The adaptive remeshing strategy presented in this section is illustrated in Figure 35.19 by showing the various stages during the adaptation process. Figure 35.19a shows the initial mesh employed for the computation of the supersonic flow past a double ellipse configuration. The Mach number contours of the solution obtained on the inital mesh are shown in Figure 35.19b. The flow conditions are a free stream Mach number of 8.15 and an angle of attack of 30°. The application of expression 35.16 to the solution obtained produces the distribution of spacing and stretching displayed in Figures 35.19c and 35.19d respectively. In Figure 35.19d, the contours corresponding to the value of the minimum spacing occuring in any direction is shown, whereas in Figure 35.19c the value and the direction of stretching are displayed in the form of a vector field. The magnitude of the vector represents the amount of stretching, i.e., ratio between maximum and minimum spacings, and the direction of the vector indicates the direction along which the spacing is maximum. In this example, expression 35.17 has been applied to the computed spacings with values of δmax = 15 and δmin = 0.9. Figures 35.19e and 35.19h show various stages during the regeneration process. The completed mesh is shown in Figure 35.19h. The regeneration process uses the current mesh as the background mesh. Such a background mesh clearly represents accurately the geometry of the computational domain. In this case, the number of elements to be generated, denoted by Ne, can be estimated as follows. Once the values of C, δmax, and

©1999 CRC Press LLC

FIGURE 35.19

Illustration of the adaptive remeshing procedure.

δmin have been selected, the spatial distribution of mesh parameters di, α i ; i = 1, ..., N is computed. For each element of the background mesh, the values of the transformation T is computed at the centroid. The transformation is applied to the nodes of the element and its volume Ve in the normalized space is computed. The number of elements Ne is assumed to be proportional to the total volume in the unstretched space, i.e., Nb

Ne ≈ χ ∑ Ve

(35.18)

e =1

where Nb is the number of elements in the background mesh. The value of χ is calculated as a statistical average of the values obtained for several generated meshes. The calculated value is χ ≈ 9. This procedure gives estimates of the value of Ne with an error of less than 20%, which is accurate enough for most practical purposes. If the estimated value of Ne is either too big or too small, then the value of C is reduced or increased and the process repeated until the value of C produces a number of elements which is regarded as being computationally acceptable.

©1999 CRC Press LLC

FIGURE 35.20

Adaptive remeshing applied to the supersonic flow past a double ellipse.

TABLE 35.3 Double Ellipse (M∞ = 8.15, α = 300): Mesh Characteristics Mesh

Elements

Points

δmin

1 2 3

2027 3557 6403

1110 1864 3294

4.0 0.9 0.25

The adaptive remeshing procedure is applied twice to the problem of flow past a double ellipse. The flow conditions are those previously considered for this configuration. The inital and two adapted meshes and the solutions for Mach number are shown in Figure 35.20. The characteristics of the meshes employed are displayed in Table 35.3. It is observed how the application of the adaptive procedure, when compared to the enrichment strategy, allows for a larger increase in the resolution at the expense of a smaller increase on total number of elements. On the other hand the remeshing procedure does not suffer from the limitations inherent in the mesh movement algorithm.

©1999 CRC Press LLC

FIGURE 35.21

3D adaptive remeshing. Shock interaction on a swept cylinder.

TABLE 35.4 3D Shock Interaction on a Swept Cylinder Mesh Characteristics Mesh

Elements

Points

δmin

δmax

1 2 3

51 190 100 071 171 800

10 041 18 660 31 083

1.0 0.5 0.18

1.0 3.0 3.0

The application of this method in three dimensions is demonstrated on the solution of shock interaction on a swept cylinder. The numerical simulation has been carried out for a sweep angle of 15° on a cylinder of diameter D equal to 3 in. and length L equal to 9 in. The undisturbed free stream Mach number is 8.03. The fluid which has been turned by the shock generator enters the computational domain with a Mach number of 5.26. The initial mesh and those obtained after two adaptive remeshings and the density contours distribution are shown in Figure 35.21 The characteristics of the meshes are shown in Table 35.4.

©1999 CRC Press LLC

The potential advantages of the adaptive remeshing procedure are clearly illustrated in this threedimensional example. The final adapted mesh has a resolution of more than five times that of the inital mesh, whereas the total number of degrees of freedom increases by only a factor of 3.4.

35.4.7 Grid Adaptation Using the Delaunay Triangulation with Sources Here we outline a method that uses the automatic point creation and the ideas outlined for point clustering using sources [19]. The new approach is a combination of h-refinement and remeshing and recovers both these procedures for given input parameters. The technique is equally applicable for steady and transient adaptation. The main steps are as follows. Algorithm I 1. Generate an initial mesh capable of providing an initial solution. 2. Obtain a flow solution. 3. Derive sources. a. On the line segments between surfaces. b. On surface triangles on the surfaces. c. In the field. 4. Generate the adapted surface grid. 5. Generate the adapted field grid. 6. Return to step 2. Once a flow solution has been obtained the sources are derived by detecting regions in the domain where solution or error activity is high. Several approaches have been implemented, including taking measures of gradients within an element and introducing directional measures of the gradient in the direction of the velocity vector. Typically, density is used as the basis of the error indicator. Once an element has been identified as requiring enrichment, a source is defined with a position inside the element and a strength that is obtained by performing a statistical analysis of the error measure as computed for all elements. A minimum and maximum source strength is set, which controls the degree of enrichment to be provided by the sources. 35.4.7.1 Surface Adaptation Grid adaptation on the configuration surface is performed as outlined in Algorithm II. Algorithm II 1. Input the previous surface mesh. 2. Derive the surface sources. a. On line segments between surfaces. b. On triangles on the surface. 3. Perform adaptation on line segments between surfaces. a. Insert points on line segment and connect to surrounding points. b. Modify the values of the point distribution function at the surrounding points. 4. Perform adaptation on surface triangles. a. Insert a point at the position of the source and connect to form triangles using a “local Delaunay edge swapping” algorithm. b. Modify the values of the point distribution function at the nodes that form the element. 5. Perform the automatic point creation with a specified value of concentration factor αa to generate additional points, connecting the points with a “local Delaunay edge swapping” algorithm. In the surface triangulation grid adaptation the point connection is performed by a direct connection between the new point and the three points that form the triangle that contains it, followed by several implementations of a “local Delaunay incircle criterion” diagonal swapping routine. This latter approach

©1999 CRC Press LLC

is used, since a two-dimensional Delaunay algorithm is not applicable on a three-dimensional surface. It is noted that if αa is large, typically the order of 103, then the automatic point creation algorithm will not create any additional points and the surface grid is refined in the standard h-refinement manner. In the generation of adapted surface grids it is necessary to ensure that the added points are placed on the geometrical surface of the configuration. The traditional method is to use the given geometrical definition of the configuration. However, for complex configurations this data can be very extensive, involving very large data sets. For grid adaptation, where it is the aim to couple the grid generation fully within a flow or solution module, the use of such potentially large data files can be problematic. An alternative method for adding points onto surface geometries is explored here. The method adopted is to reconstruct the surface geometry using a transfinite, visually continuous, triangular interpolant [8]. It is viewed that this approach is more efficient and applicable than returning to the original geometrical definition of the surfaces. However, it is relatively easy to provide the necessary calls to the geometry data base if this is desired. The interpolant utilizes outward surface normals, unlike such methods as the Ferguson patch, which uses partial derivatives on boundaries. The resulting reconstructed surface is G1 in that the surface has a continuously varying outward normal vector. When compared with results obtained using linear interpolation, it is apparent that the use of the G1 patch to calculate the position of points being inserted reduces the displacement error by a factor in excess of 4, for both the average and maximum displacement values. 35.4.7.2 Field Adaptation Grid adaptation in the field is performed as follows. Algorithm III 1. Generate a mesh from the nonadapted surface mesh with a concentration factor α 1. If appropriate, a different concentration factor α can be used from the previous grid or input the previous volume mesh. 2. Input the additional surface points that are included in the adapted surface grid and connect with the Delaunay algorithm. 3. Input the field sources. a. Determine the elements that contain the sources. b. Insert a point at the position of the source and connect with the Delaunay algorithm. c. Modify the values of the point distribution function at the nodes in the element. 4. Perform automatic point creation to generate the adapted field with a concentration factor α 2. Steps 1 and 2 are straightforward to apply. Step 3 requires a searching process to find the elements that contain the sources. This type of search is similar to the one used in the Delaunay algorithm to find all spheres that contain a point. Hence, in the implementation of Step 3a. the Delaunay algorithm search routine is used with the addition of a routine to determine the element rather than the sphere which contains the source. The important issue in the search is that a tree data structure, which is essential for an efficient implementation of the Delaunay algorithm, is used. If the parameter α 2 is small, typically in the range 0.8 to 1.4, then points will, in general, be added by the automatic point creation procedure until the point distribution satisfies that which was specified with the sources. If, however, α 2 is large, say the order of 103, then after the insertion of a point corresponding to the position of the source, the automatic point creation procedure will not add points. In this way, with the appropriate values of α, the proposed adaptation procedure degenerates to standard h-refinement. This was also the case for the surface grid as considered in Section 35.4.7.1. It is clear, therefore, that the method proposed generalizes h-refinement so that an arbitrary number of points can be added. Furthermore, since α1 can be varied it is possible to regenerate a mesh prior to the inclusion of sources so that once features in the flowfield have been detected and sources defined, the initial mesh can be coarsened. Hence, the proposed method has a remeshing capability to ensure that with successive adaptation the number of grid points does not always increase. As with remeshing, the proposed procedure can result in a final adapted mesh having fewer points than the initial mesh.

©1999 CRC Press LLC

FIGURE 35.22

FIGURE 35.23

Hypersonic flow over a double ellipsoid. Meshes and source strength.

Hypersonic flow over a double ellipsoid. Mach number contours.

Two examples are now presented of the application of the grid adaptation method described here. The first example is the hypersonic flow over a double ellipsoid. The flow conditions are Mach number of 8.15 and 30° of incidence. Figure 35.22 shows cuts through the initial and the adapted meshes together with the distribution of the source strength. Several views of the flow solutions obtained using this method on the initial and second adapted grids is shown in Figure 35.23.

©1999 CRC Press LLC

FIGURE 35.24

Adapted B60 configuration. Surface meshes and contours of pressure.

The next example is that of a transport wing-body-pylon-nacelle configuration. Figures 35.24 and 35.25 show the results of grid adaptation of the B60 configuration. The freestream Mach number was 0.801 and the angle of attack 2.738° . For the simulation the engine conditions imposed were a jet pressure ratio of 2.477, an engine mass flow ratio of 2.733 lb/s, and a jet total temperature of 370.04 K. It is clear from these results the distinct effects of the grid adaptation. The shock wave resolution is greatly improved both on the wing and in the field, and the comparison of the pressure coefficient on the wing with experiment shows an incremental improvement.

©1999 CRC Press LLC

FIGURE 35.25

Adapted B60 configuration. Coefficient of pressure on the wing and nacelle.

References 1. Allwright, S., Multiblock topology specification and grid generation for complete aircraft configurations, Applications of Mesh Generation to Complex 3-D Configurations, AGARD Conference Proceedings. 1990, No. 464, 11.1–11.11. 2. Baker, T.J., Unstructured mesh generation by a generalized Delaunay algorithm, Applications of Mesh Generation to Complex 3-D Configurations, AGARD Conference Proceedings. 1990, No. 464, 20.1–20.10. 3. Donéa, J. and Giuliani, S., A simple method to generate high-order accurate convection operators for explicit schemes based on linear finite elements, Int. J. Num. Meth. Fluids 1, 1981, pp 63–79.

©1999 CRC Press LLC

4. Formaggia, L., Peraire, J., Morgan, K., and Peiro, J., Implementation of a 3D explicit Euler solver on a CRAY computer, Proc. 4th Int. Symposium on Science and Engineering on CRAY Supercomputers, Minneapolis, 1988, pp 45–65. 5. Jameson, A., Baker, T.J., and Weatherill, N.P., Calculation of inviscid transonic flow over a complete aircraft, AIAA Paper 86-0102, 1986. 6. Löhner, R., Morgan, K., and Zienkiewicz, O.C., Adaptive grid refinement for the compressible Euler equations, Babuska, I., et al., (Ed.), Accuracy Estimates and Adaptive Refinements in Finite Element Computations, Wiley, 1986, pp 281–297. 7. Nakahashi, K. and Deiwert, G.S., A practical adaptive-grid method for complex fluid flow problems, Lecture Notes in Physics. Springer Verlag, 1985, Vol. 218, pp 422–426, 8. Nielson, G.M., The side vertex method for interpolation in triangles, Journal of Approximation Theory, 1979, 25, pp 318–336. 9. Oden, J.T., Grid optimisation and adaptive meshes for finite element methods, University of Texas at Austin, Notes, 1983. 10. Palmerio, B., Billey, V., Dervieux, A., and Periaux, J., Self-adaptive Mesh Refinements And Finite Element Methods For Solving the Euler equations, Numerical Methods for Fluid Dynamics II, Morton, K.W. and Baines, M.J., (Eds.), 1985, Clarendon Press, Oxford, pp 369–388. 11. Palmerio, B. and Dervieux, B., 2D and 3D Unstructured mesh adaption relying on physical analogy, Proc. of the Second International Conference on Numerical Grid Generation in Computational Fluid Mechanics, Miami Beach, FL, 1988. 12. Peraire, J., Morgan, K., and Peiro, J., Unstructured finite element mesh generation and adaptive procedures for CFD, Applications of Mesh Generation to Complex 3-D Configurations, AGARD Conference Proceedings, 1990, No. 464, 18.1–18.12. 13. Peraire, J., Morgan, K. Peiro, J., and Zienkiewicz, O.C., An adaptive finite element method for high speed flows, AIAA Paper 87-0558, 1987. 14. Peraire, J. Peiro, J., Formaggia, L, Morgan, K., and Zienkiewicz, O.C., Finite element Euler computations in three dimensions, Int. J. Num. Meth. Eng. 26, 1988. 15. Peraire, J., Vahdati, M., Morgan, K., and Zienkiewicz, O.C., Adaptive remeshing for compressible flow computations, J. Comp. Phys. 1987, 72, pp 449–466. 16. Peiro, J., Peraire, J., and Morgan, K., FELISA System Reference Manual. Part I: Basic Theory, Technical Report CR/821/94, University of Wales, Swansea, 1994. 17. Thompson, J.F., Warsi, Z.U.A., and Mastin, C.W., Numerical Grid Generation — Foundations and Applications. North-Holland, 1985. 18. Watson, D.F., Computing the n-dimensional Delaunay Tessellation with application to Voronoï polytopes, The Computer Journal. 1981, 24, pp 167–172. 19. Weatherill, N.P., Hassan, O., Marchant, M.J., and Marcum, D.L., Adaptive inviscid flow solutions for aerospace geometries on efficiently generated unstructured tetrahedral meshes, AIAA CFD Conference, July, 1992. 20. Weatherill, N.P., Mesh generation in computational fluid dynamics, von Karman Institute for Fluid Dynamics, Lecture Series 1989-04, Brussels, 1989. 21. Zienkiewicz, O.C., and Morgan, K., Finite Elements and Approximation, Wiley, 1983.

©1999 CRC Press LLC