Dynamic mesh adaptation on unstructured grids, by localised refinement and derefinement, is a very efficient tool for enhancing solution accuracy and optimising computational time. One of the major drawbacks, however, resides in the projection of the new nodes created, during the refinement process, onto the boundary surfaces. This can be addressed by the introduction of a library capable of handling geometric properties given by a CAD (computeraided design) description. This is of particular interest also to enhance the adaptation module when the mesh is being smoothed, and hence moved, to then reproject it onto the surface of the exact geometry.
The accuracy of a numerical simulation is strongly dependant on the distribution of grid points in the computational domain. For this reason grid generation remains a topical task in CFD (computational fluid dynamics) applications. Prior knowledge of the flow solution is usually required for a grid to be efficient, that is, matching the features in the flow field with appropriate grid resolution. This, however, may not be available, requiring human intervention in analysing the results of an initial solution, going back to the preprocessing stage, and taking an educated guess at how the mesh should be modified (Figure
Manual adaptation process.
Let us consider the case with manual intervention by the user. This step can be automated by adaptation, whereby the flow solution is analysed automatically, following some predefined criteria, and the grid resolution adjusted to the problem. The use of such techniques allows for computationally precise distribution of grid points (rather than eye precision), and for extremely reduced user intervention, thus addressing the time and effort issues. It also resolves problems related to computational time and costs, as the adapted grid can have fewer overall points, with similar resolution in areas of interest, than an unadapted fine mesh.
The adaptive method used here is that of hrefinement as described in [
One of the major drawbacks in most of the adaptation techniques resides in the projection of the new nodes created, during the refinement process, onto the boundary curves and surfaces defining the original geometry. Without this step, the adaptation process will be limited in its potential use. It will still be able to capture flow features such as shocks and adapt to geometries with little or no gradient, but will need a “final” mesh resolution where geometric features are most important. This last point clearly defeats an important aspect of mesh adaptation, as it requires prior knowledge of the importance of such features, and of what mesh size should be considered as “final.” Ideally, the best solution would be to integrate the CAD system used to generate the original geometry, which is unfeasible since this may change from one project to the next. This can be overcome by the introduction of a library capable of handling geometric properties given by a CAD description.
For largescale problems, these algorithms require an efficient and scalable implementation of calculation techniques on unstructured grids, therefore parallel codes have to be developed. Data, including the grid’s geometry description, the successive adapted grid structures, the solution solver’s Jacobian matrix, the solution state variable, and work vectors, must be partitioned among the processors in order to minimise the amount of intraprocessor communications. The definition of a distributed data structure, wellsuited for all the computational phases, is the first problem to be addressed. The meshes change during the solution progress, hence a dynamic partitioning is required to rebalance the separate partitions on the chosen number of processors [
Similar techniques have been mainly implemented for mesh adaptation by either global remeshing, where the entire mesh is regenerated through the use of a mesh metric, or local remeshing, where only a part of the mesh is regenerated [
The insertion of a library capable of making use of the geometric data from a commercial CAD package is essential for the accuracy of calculations. However, this requires particular care and attention from the initial design stages. It will be seen later in the description of the methodology for implementation, how every step from the conceptual design down to the mesh generation is important for the success of the adaptive projection procedure.
In order to be as general as possible in the capability of gathering the data from CAD/CAM packages, it is important to have a library that is able to make full use of CAD definitions. Hence, the use of Bsplines and NURBS (nonuniform rational Bsplines) must be an integrating part of such a library.
The possibility of linking directly with a commercial design software has been discarded as it would create a dependency to it. This would be disadvantageous both financially and in case the distribution would cease. It may also be more complex to implement than one would think, as source codes are generally unavailable, which implies an external call to carry out the point projection.
On the other hand, the development of such a library is not a trivial task. It was therefore chosen to address the problem with the use of a library of C functions to perform the necessary operations on NURBS geometries. This consists in the SINTEF Spline Library (SISL), developed at the Scandinavian research group SINTEF, and available under the GNU General Public License. It is particularly suitable since it allows also the handling of interaction between implicit geometric representations such as planes, and tori, and NURBS, which is very popular in modern CAD/CAM systems. A general view of where the geometric toolkit interacts with the adaptation module is shown in Figure
Brief schematic of the geometric library placement.
Although NURBS have increased precision, they also have disadvantages when compared to Bsplines, it is therefore desirable to use the latter when the option is available. Due to the vast amount of literature on the subject, for an indepth explanation and background of curves and surfaces in CAGD we refer the reader to [
The addition of such a library is not a simple task, not only in terms of programming and data structures, but primarily in terms of different cases that can and will occur, such as the intersection between surfaces. A more detailed schematic view of where the projection algorithm is placed inside the source code is shown in Figure
Brief schematic of the reprojection algorithm placement.
First of all we consider the patch structure that is inherent in the adaptation module. The boundary description is defined at the lowest level with the help of faces (or segments in 2D), which are grouped in patches. Therefore, each patch contains a specified number of faces and corresponds in fact to a surface in the CAD definition of the geometry. This is a fundamental aspect of the projection algorithm, since if more than a surface belonged to a patch, it would be much more complex to tell which surface to project the new node is onto. Patches work in both three dimensions and two dimensions. In the former they described the finite discretisation of a surface, in the latter segments describe the boundary.
The CAD geometry descriptions are divided in a curves and surface data files, which are linked to two other files with the number of entities in each. These last two files also contain the individual names of each geometric entity. The surface file contains also information regarding the curves that define each surface, in particular the number of curves and the identifying number of each.
At this point curves, in 2D, and surfaces, in 3D, are matched to patches with the use of boundaries file information. Segments that belong to the surface and that are marked for refinement are then identified. Note that this step is straightforward in 2D, where a segment may only belong to one boundary and is defined as a face itself. Hence, it will be associated to a distinct single curve.
In 3D things become a little more complex since a segment is the interface of two surface faces. This limitation is assumed to be always true, since only a structure of zero thickness, at the point of intersection with other two surfaces, may produce an ambiguous segment belonging to more than two faces. Moreover, it would be undesirable to model an unrealistic feature of this type. The complexity resides in the parenting of the segment, since the faces it belongs to could lie on two different surfaces, in which case a decision must be made onto which surface the new node should be projected.
The problem can be clearly seen in Figure
Projection to the wrong surface for segments on the intersection between patches. (a) Detail of the channel exit with a false step created. (b) Front view of the channel exit. (c) Relative solution with erroneous results due to wrong placement of new nodes.
This would be correct, if it was not for the fact that the new node splits a segment that lies on the frontier of two patches, and the parent face to which it should have been referred for projection should have been the one describing the wall of the channel. In fact, if this had been done to begin with, the problem would go unnoticed.
This is overcome with the information gathered earlier on the curves defining the surfaces. The curve that describes the intersection of the two patches is taken as the geometry definition to project onto. The result of this is shown in Figure
Projection to the defining curve of the patches frontier. (a) Detail of the channel exit. (b) Front view of the channel exit. (c) Relative solution with correct results.
Particular care has to be taken when preparing the curves and surfaces however. This method requires each surface to have only one curve in common with another surface. In this way the frontier curve between patches can be clearly found.
Let us take as an example a blade in a cylindrical channel as shown in Figure
Blade in cylindrical channel.
From a design point of view it would be natural to draw the blade as two surfaces with the leading edge and trailing edge in common. This however would create the condition described above and, hence, is not viable. Therefore, the blade is split in four surfaces as shown in Figure
Detail of the blade from above with halfwall channel blanked.
Hence the walls are split in four surfaces, at the
Curve connecting the top wall surfaces divided by the blade. The black dots are existing segment nodes, and the empty dots are the new nodes to be placed.
A further feature, that is an important part of the algorithm, is that of being able to specify the surfaces to project onto. This has been implemented only for 3D applications since it has less (if any) appeal in two dimensions. The choice is made through the surfaces information file, where only the selected surfaces and their defining curves are taken into consideration. In the latter stages only on these entities the projection is carried out. It can be of particular interest in cases such as that shown in Figure
Bump in a channel—surface initial mesh and patches shown in different colours with one side blanked, viewed from the down side.
Finally, the projection algorithm is generalised for all elements that lie on the boundary. This is used in the case where the smoothing routine is selected. In fact, the smoothing may cause some problems when used, particularly when the starting mesh is very coarse and a few adaptation steps are necessary. In these cases the multiple iterations of the smoothing procedure may cause the boundary nodes to slowly drift away from the geometrical definition, despite all the checks in place to avoid this [
Hence, the generalised projection routine is called at the end of each smoothing iteration to check that all nodes are correctly placed on the geometry and reposition them when this is not the case. The effect of this can be clearly seen from Figure
Projection curves and surfaces during the smoothing iterations—(a) without projection of all nodes, (b) with projection after each smoothing iteration.
This can be summarised as the search of the minimal distance from the point P in space to the geometric entity onto which it should lie. The possibility of the point being at the same minimal distance between more than one entity is cancelled. This is done by identifying the node as belonging to a specific geometric entity, with the use of its parent nodes, as explained earlier. There remains therefore only the problem of finding the point on the geometric entity for which the distance to the point in space is minimised. This problem can be approached in various ways and is most commonly referred to in the literature as the foot point problem [
Three possible choices for carrying out such a task are given in the library. The first consists in a Newton iteration on the distance function between the point and the curve/surface, though if a bad initial guess is made then the iteration may give a local rather than a global closest point. However, since in our case the point is already close to the surface, the local minimum problem is not a concern. The second option is based on the first since it makes use of the same algorithm, but rather than having a user input initial guess, it takes the closest control point and estimates the corresponding curve parameter value or pair for the surface case. The value, or values, obtained is then used as the starting point for the iteration. The last option in the library is that of entering the equation of the curve/surface into the equation of a circle/sphere having P as its centre and radius zero. This results in a onedimensional curve/surface for which the minima is found [
In order to verify the effectiveness of the procedures introduced in this section, three test cases were considered. The first is the earlier mentioned blade in a cylindrical channel (Figure
This geometry has been taken as example for describing the design approach, and proves a good test case for it’s simplicity in the design process and yet complexity in the geometry conservation during the adaptation process. The initial flow conditions are set to Mach number 2.0 at zero angle of attack in order to obtain some interesting flow features. Here we look principally at the adaptation projection process rather than the solution, hence only a firstorder scheme is used.
The blade is described by two arcs of 4 units chord length and has a maximum width of 0.6, whilst the distance from the tips of the blade to the ends of the pipe is 28 units. Finally the diameter of the pipe is of 4 units. The initial coarse grid is uniform and contains 2486 nodes, 10683 tetrahedra, and 2384 triangular surface elements (Figure
Four distinct adaptation steps were then performed in series, each restarting with the previous steps adapted mesh. The adaptation is performed with respect to the difference in density on the segment. An identical procedure was also done without the projection algorithm and used as comparison. This last computation serves also as illustration of initial mesh dependency when no projection is applied.
Considering the steps of the adaptation cycles reported in Table
Grid sizes for adapted pipe blade calculations: with and without projection algorithm.
Adaptation step  With Projection  Without Projection  






 
First  6 024  29 110  4 458  6 011  29 077  4 440 
Second  20 755  110 287  9 790  21 711  115 361  10 326 
Third  86 876  493 771  22 264  95 565  538 420  27 318 
Fourth  314 652  1 854 594  42 718  381 353  2 219 641  69 152 
Grids and density solution downstream of the blade—(a) and (b), first step with and without projection, respectively.
Grids and density solution downstream of the blade—(a) and (b), second step with and without projection, respectively.
The percentage change was taken as
Percentage difference between mesh characteristic sizes of adaptations with and without projection.
Furthermore, by overlapping the original grid to the adapted grid after only two steps, there is a remarkable difference between the two. This is clearly shown in Figure
Detail of the difference between adapted projected mesh and the original grid of one side of the blade, view from—(a) outside, (b) inside and (c) top with gap detail.
Although the solution itself might not be of particular interest, it is important to notice how and if this is improved by the projection process in order to verify its effectiveness. A closeup of the zone at the location of the blade in the pipe is shown in Figures
Details of the solution in proximity of the blade and downstream, viewed from underneath—(a) with projection, (b) without.
Detail of the area behind the blade of Figure
Detail of the solution in proximity of the blade and downstream, viewed from the side—(a) with projection, (b) without.
This is a classical test case which offers the possibility to test all aspects of the adaptation process including the solution. The initial grid is that shown previously in Figure
The geometry consists in a 10% circular bump in a channel, of unit chord length and 0.1 maximum thickness. Height, length and width of the channel are respectively 1, 3 and 0.2 units. The freestream velocity is set to Mach number 0.675 at zero angle of attack, which causes the flow to be transonic. The initial grid consists of 184 nodes, 426 tetrahedra, and 364 triangular surface elements.
At a first glance it is clear to see the differences with the prior test case from Table
Grid sizes for adapted channel bump calculations and relative flow solver step—with and without projection algorithm.
Adaptation/  Projection  No projection  

flowstep 






Firstflow 1  600  2 058  908  600  2 058  908 
Secondflow 2  1 731  7 390  1 804  1 717  7 318  1 800 
Thirdflow 3  5 104  25 204  3 506  4 952  24 373  3 430 
Fourthflow 5  13 362  71 143  6 388  15 625  84 313  6 716 
Fifthflow 6  31 933  179 573  10 236  48 158  273 635  12 830 
For compressible CFD, when performing a steady state or transient solution computation, the following steps are usually carried out.
On the initial grid, perform a firstorder spatial accurate solution technique to obtain a provisional approximate solution. This solution will have an initial position of shock waves and discontinuities, but will be very dissipative and not capture finer details.
This first solution can then be used for a first step of adaptation and/or serve as the initial condition for a further number of iterative cycles using a secondorder scheme, which will resolve more precisely the solution. At this point the mesh can be further adapted.
This procedure is standard and removes some stiffness from the problem resolution. It is also known as “Blending” first and second order solutions.
Initially a first order scheme is used to advance the solution and adapt the mesh, up until the third adaptation step (adaptation and flow steps 1–3). After this refinement the solution and grid obtained are used to start the second order solution, without adaptation (flow step 4). Once a solution is obtained, it is then used to start the following adaptation steps with the secondorder solutions (adaptation steps 4, 5, and flow steps 5, 6). In all steps the adaptation is performed with respect to the difference in density on the segment.
A detail of the difference in the projected part of the grid is shown in Figure
Details of the differences between original and adapted projected grid for the channel bump—(a) view from the side, (b) tilted view from underneath the bump.
The grids and solutions produced from the various steps are shown in Figures
Adaptation/flow steps with (left) and without (right) projection—(a) first, (b) second, and (c) third. Solution field is
Adaptation/flow steps with (left) and without (right) projection—(a) only flow calculation step 4, (b) adapt fourthflow 5, and (c) adapt fifthflow 6. Solution field is
Final solutions with (left) and without (right) projection. (a) Mach number solution field and
Unlike the previous test cases, an exploitable mesh is used to recover a usable set of curves to reconstruct the geometry. Although the geometrical information of the ONERA M6 wing can be easily obtained, this test case is also used as basis to check the feasibility of recovering a usable geometry from an available mesh. The mesh used to recover the initial set of curves is shown in Figure
Original ONERA M6 wing grid and patches.
The procedure consisted first in recovering the nodes, at the sections described by the patches borders, which are then used as points to construct the curves. The curves are then split accordingly to the guidelines given earlier in Section
Figure
Patches of the reconstructed ONERA M6 wing mesh—(a) side view, (b) detail of the tail (left) and tip (right).
Initial ONERA M6 wing mesh.
For all the following examples, an initial firstorder solution is carried out to start off the computation, and used in the second stage as a restart for a secondorder solution. This solution then becomes the base for all subsequent meshes in the first adaptation step. The first and second order solutions are shown in Figure
First and secondorder solutions (
A first adaptation step is then performed, with respect to the difference in Mach number. The smoothing factor is kept to a minimum number of iterations and a relatively high boundary constraint in order to avoid as much as possible the unprojected solution to be influenced by excessive smoothing. The results of a computation with and without the projection algorithm are shown in Figure
Solution (
Grid on the ONERA M6 wing with (a) and without (b) projection.
Adapting a second time gives us a clearer view of the differences on the solution, due to the effect of projecting the nodes onto the surface. The overall solution gives a relatively good result as we can see from Figure
Solution (
IsoMach lines and solution
As described in [
We now examine the execution times of the various adaptation blocks as described in [
Grid sizes for CAD projection after 1 adaptation step with 16 processors. ONERA M6 wing.
Projection type 




No projection  171 219  955 543  57 700 
CAD new nodes  171 194  955 793  57 660 
CAD new and smoothing  171 192  955 863  57 658 
Adaptation blocks times for CAD projection after 1 adaptation step with 16 processors. ONERA M6 wing.
Projection and smoothing time breakdown for CAD projection during smoothing. ONERA M6 wing.
When creating a computational discretisation of an object, the precise geometrical definition is required in order to generate a grid. This is also true when refining the mesh in locations where the stresses will be higher, or where flow features are going to appear. However, it is rare to know the exact location of these stresses and flow features a priori, hence the mesh is adapted manually in large portions of a computational domain. The use of dynamic integrated mesh adaptation avoids the need of prior knowledge of the solution features and their locations. Given an initial coarse grid, the mesh adaptation process will automatically detect the critical zones of the solution, and adapt the mesh accordingly, enhancing the accuracy and rendering an improved solution.
There remains a problem in the process described above. Just as one cannot discretize geometry without the set of curves and surfaces defining it, the adaptation algorithm cannot place the refined elements on the underlying geometry without its computational representation. This was the first goal achieved here, by inserting a dedicated library for the treatment of the most commonly used geometric representations in present day CAD software. The results presented clearly show the importance of maintaining the geometric representation, with undoubted benefits to the acquisition of a precise solution.
In order to carry out all the above processes on realistic simulations with computational meshes of more than one million nodes, mono processorserial calculations are not feasible. It is hence mandatory that the above techniques be developed in parallel. Numerical investigations on the parallel performances of these methods proved the efficiency of all parts of the adaptation process. Execution time of the adaptation is low compared to that of the physics solver. These were computationally efficient as shown from the results presented.