A simple way to determine whether the point p is inside a given element el is to determine the shape-function values of p with respect to the coordinates of the points belonging to el: F
Trang 1the ring region between these two are allowed to deform One can then either remesh thisregion or simply switch the diagonals However, simply switching diagonals will not alwayswork, as points that have slightly different radii will tend to overtake each other, potentiallycreating very small elements Thus, the option of adding or removing points, which is alwayspossible with local remeshing, should always be available.
Figure 12.11 Simultaneous seat ejection
12.9 Applications
The following section shows the mesh velocity fields obtained using the techniques described
in this chapter for several examples
12.9.1 MULTIPLE SPHERES
The last decade has seen a continuous interest in the dynamics of bubbles or granular materialimmersed in a fluid Figure 12.10 shows a planar cut for a simulation with 36 spheres fallingtowards the bottom surface As the spheres get close to the bottom wall, they are removedautomatically and the resulting voids are remeshed Similarly, new spheres are introduced atthe top One can clearly see the velocity field of the mesh movement Note the almost constantcontour levels close to the spheres, which indicates that the mesh in the vicinity of the spheremoves almost rigidly
Trang 2(a) (b)
(c)
Figure 12.12 Tanker Fleet: (a) free surface; and (b) mesh velocity in two planes; (c) mesh velocity
(detail)
12.9.2 PILOT EJECTION FROM F18
Every new generation of ejection seat must be tested for safe deployment Figure 12.11 shows
a planar cut for a simulation with two pilots ejecting simultaneously (Sharov et al (2000b)).
As before, the velocity field of the mesh movement displays almost constant contour levelsclose to the pilots, indicating nearly rigid mesh movement
12.9.3 DRIFTING FLEET OF SHIPS
This case, taken from Löhner et al (2007c), considers a fleet of tankers that are freely floating
objects subject to the hydrodynamic forces of an incoming wavefield The surface nodes ofthe ships move according to a 6 degree of freedom integration of the rigid body motion
Trang 3equations, and 30 layers of elements surrounding the ships are moved The volume meshhas approximately 10 million elements Figure 12.12(a) shows the free surface at 200 s Theabsolute value of the mesh velocity in two planes, as well as a detailed view of the meshvelocity on the surface of one of the tankers and a plane are displayed in Figures 12.12(b)and (c) Several local and global remeshings were required during the run to keep the meshquality acceptable.
Trang 413 INTERPOLATION
The need to interpolate quickly fields of unknowns from one mesh to another is common
to many areas of CFD and, more generally, to computational mechanics and computationalphysics The following classes of problems require fast interpolation algorithms
(a) Simulations that require different grids as the solution proceeds Examples of this
kind are adaptive remeshing for steady-state and transient simulations (Löhner and
Ambrosiano (1990), Peraire et al (1992b), Weatherill et al (1993b)), as well as
simple remeshing for problems where grid distortion due to movement becomes too
severe (Baum and Löhner (1993), Mestreau et al (1993), Löhner et al (1999)) (b) Simulations with overlapping grids The key idea here is to simplify the mesh
generation process and to avoid the regeneration of grids for problems with movingbodies by generating for each component (e.g., wing, pylon, tail, engine inlet, etc.)
a local, independent grid These independent grids overlap in certain regions Thesolution to the global problem is obtained by interpolating between the grids after each
timestep (Benek et al (1985), Dougherty and Kuan (1989), Meakin and Suhs (1989), Meakin (1993, 1997), Rogers et al (1998), Nakahashi et al (1999)).
(c) Loose coupling of different codes for multi-disciplinary applications In this case, if any
of the codes in question are allowed to perform adaptive mesh refinement, the case scenario requires a new interpolation problem at every timestep (Guruswamy and
worst-Byun (1993), Rausch et al (1993), Löhner et al (1995, 2004d), Cebral and Löhner
(1997))
(d) Interpolation of discrete data for the initialization or continuous update of boundary conditions Common examples are meteorological simulations, as well as geotechnical
data for seepage problems
(e) Particle/grid codes These codes, commonly used for plasma and particle beam
simulations, as well as solid rocket motor applications, require the efficient tracking
of a large number (>106) of particles, making an efficient interpolation algorithm aprime requirement
(f) Visualization This large class of problems makes extensive use of interpolation
algorithms, especially for the comparison of different data sets on similar problems
In the following, the focus will be on the fast interpolation between different unstructuredgrids that are composed of the same type of elements, surface-grid-to-surface-grid interpo-lations and element-to-particle interpolations In particular, linear triangles and tetrahedra
Applied Computational Fluid Dynamics Techniques: An Introduction Based on Finite Element Methods, Second Edition.
Trang 5are considered The ideas developed are general and can be applied to any type of elementand grid On the other hand, other types of grids (e.g Cartesian structured grids) will lendthemselves to specialized algorithms that may be more efficient and easier to implement.
13.1 Basic interpolation algorithm
Consider an unstructured finite element or finite volume mesh, as well as a point p with
coordinates xp A simple way to determine whether the point p is inside a given element el
is to determine the shape-function values of p with respect to the coordinates of the points belonging to el:
For other types of elements more nodes than equations are encountered The easiest way
to determine whether a point is inside an element is to split the element into triangles
or tetrahedra and evaluate each of these sub-elements in turn If the point happens to be
in any of them, it is inside the element This procedure may not be unique for highlydeformed bricks, as shown in Figure 13.1 Depending on how the diagonals are taken forthe face A–B–C–D, the point to be interpolated may or may not be inside the element.Therefore, subsequent iterations may be required for bricks or higher-order elements withcurved boundaries Other ways to determine whether a point is inside a bilinear element may
be found in Westermann (1992)
The criterion set forth in (13.5) is used to determine whether a point lies within the confines
of an element In what follows, different ways of determining the element in question asquickly as possible are considered The possible improvements in speed depend mostly onthe assumptions one can make with respect to the information available
Trang 6B C
D
Point to be Interpolated
Figure 13.1 Interpolation for a deformed brick element
13.2 Fastest 1-time algorithm: brute force
Suppose we only have a given grid and a point p with coordinates x p The simplest way to
find the element into which point p falls is to perform a loop over all the elements, evaluating
their shape functions with respect to xp:
Evaluate N i from Eqn.(13.4);
if: Criterion (13.5) is satisfied: exit
enddo
Since the outer loop over all the elements can readily be vectorized and/or parallelized, thisalgorithm is extremely fast This brute force search is used in more refined algorithms both
as a start-up procedure and as a fall-back position
13.3 Fastest N-time algorithm: octree search
Suppose that as before we only have a given grid, but instead of just one point p a
considerable number of points needs to be interpolated In this case, the brute-force algorithmdescribed before will possibly require a complete loop over the elements for each point to
be interpolated, and, on average, a loop over half the elements A significant improvement inspeed may be realized by only checking the elements that cover the immediate neighbourhood
of the point to be interpolated
A number of ways can be devised to determine the neighbourhood (see Figure 13.2 andChapter 2):
- bins, i.e the superposition of a Cartesian mesh (Löhner and Morgan (1987),Meakin (1993));
- octrees, i.e the superposition of an adaptively refined Cartesian mesh (Knuth (1973),Samet (1984)); and
- alternate digital trees (Bonet and Peraire (1991))
Trang 7We consider octrees here, as bins perform poorly for problems where the nearest-neighbourdistances vary by more than two orders of magnitude in the domain One may form anoctree with the element centroids or points It is advisable to choose the latter option, as for3-D tetrahedral grids the number of points is significantly less than the number of elements.Denoting bycoint(1:ndimn,1:npint)the coordinates of the npint points to beinterpolated, the octree search algorithm proceeds as follows:
For the given mesh:
Form the octree for the points
Form the list of elements surrounding points (esup1,esup2)
Obtain close points of given mesh from the octree;
Obtain the elements surrounding the close points from esup1,esup2,and store in
lcloe(1:ncloe)
ielem=lcloe(icloe)
Evaluate N i from equation (13.4);
if: Criterion (13.5) is satisfied: exit
enddo
As we have failed to find the host element: Use brute-force
enddo
) )
Figure 13.2 Algorithms to determine spatial proximity: (a) bin; (b) quadtree
Several improvements are possible for this algorithm One may, in a first pass, evaluate
the point of the given mesh closest to xp, and only consider the elements surrounding thatpoint In general this pass is successful Should it fail, the elements surrounding all the closepoints are considered in a second pass If this second pass also fails (see Figure 13.3 forsome pathological cases), one may either enlarge the search region, or use the brute-forcealgorithm described above The octree search algorithm is scalar for the first (integer) phase
Trang 8Closest point of Known Grid Point to be Interpolated
Point to be Interpolated
Closest point of Known Grid
Figure 13.3 Interpolation with internal boundaries
(obtaining the close points and elements), but all other stages may be vectorized The vectorlengths obtained for 3-D grids are generally between 12 and 50, i.e sufficiently long for goodperformance
13.4 Fastest known vicinity algorithm: neighbour-to-neighbour
Suppose that as before we only have a given grid and a considerable number of points need
to be interpolated Moreover, assume that, for any given point to be interpolated, an element
of the known grid that is in the vicinity is known In this case, it may be faster to jump fromneighbour to neighbour in the known grid, evaluating the shape-function criterion given by(13.5) (see Figure 13.4)
Point to be Interpolated
Figure 13.4 Neighbour-to-neighbour search
Trang 9If the element into which x falls can be found in a few attempts (<10), this procedure,
although scalar, will outperform all other ones The neighbour-to-neighbour search algorithmmay be summarized as follows:
For the given mesh:
Form the list of elements adjacent to elements
For iesta: Evaluate N i from equation (13.4);
if (13.5) is satisfied then
exit
else
Obtain node inminfor min(N i)
iestais: it can be provided by bins, octrees or alternate digital trees On the other hand,due to its scalar nature, such an algorithm will not be able to compete with the octree searchalgorithm described in Chapter 3 Its main use is for point-to-grid or grid-to-grid transfer,where a very good guess foriestamay be provided This fastest grid-to-grid interpolationtechnique is described in the next section
Boundary
IESTA
Point to be Interpolated
Figure 13.5 Internal boundaries13.5 Fastest grid-to-grid algorithm: advancing-front vicinity
The crucial new assumption made here as opposed to all the interpolation algorithmsdescribed so far is that the points to be interpolated belong to a grid, and that the gridconnectivity (e.g the points belonging to each element) is given as input In this case,whenever the elementieendof the known grid into which a point of the unknown grid falls
is found, all the surrounding points of the unknown grid that have not yet been interpolated
Trang 10are given as a starting guessieend, and stored in a list of ‘front’ pointslfrnt The nextpoint to be interpolated is then drawn from this list, and the procedure is repeated until allpoints have been interpolated The procedure is sketched in Figure 13.6, where the notion of
‘front’ becomes apparent
The complete algorithm may be summarized as follows:
For the given mesh:
Form the list of elements adjacent to elements
For the unknown mesh:
Form the list of points surrounding points ⇒ psup1, psup2
lfrnt(1)=1
lpunk(1)=1
while(nfrnt.gt.0):
Attempt nearest neighbour search for ntryattempts
if Unsuccessful: Use brute force
if Unsuccessful: Stop or skip
else
endif
endif
Store shape-functions and host elementieend
! Loop over points surrounding ipunk
Trang 11Several possible improvements for this algorithm, layering of brute-force searches, inside-outinterpolation, measuring concavity and vectorization, are detailed in the following.
3 4
5
6 7
8
Known Grid Unknown Grid
Step 3
Active Front
Figure 13.6 Advancing-front vicinity search
13.5.1 LAYERING OF BRUTE-FORCE SEARCHES
In most instances (the exception being grids with very large disparity in element size where
ntryattempts are not sufficient), the neighbour-to-neighbour search will only fail on theboundary Therefore, a first brute-force search over the boundary elements of the knowngrid will reduce brute-force search times considerably Note, however, that one has toknow the boundary points in this case The elements of the known grid are renumbered
so that all elements with three or more nodes on the boundary in three dimensions andtwo or more nodes on the boundary in two dimensions appear at the top of the elementlist Thesenelbo <nelemelements are scanned first whenever a brute-force search isrequired Moreover, after a front has been formed, only these elements close to boundariesare examined whenever a brute-force search is required
Trang 1213.5.2 INSIDE-OUT INTERPOLATION
This improvement is directed to complex boundary cases Under this category we group caseswhere the boundary has sharp concave corners or ridges, or those cases where, due to theconcavity of the surface, points may be close but outside of the known grid (see Figure 13.7)
Known Grid Unknown Grid
Figure 13.7 Problems at concave boundaries
In this latter case, it is advisable to form two front lists, one for the interior points and onefor the boundary points The interpolation of all the interior points is attempted first, and onlythen are the boundary points interpolated This procedure drastically reduces the number ofbrute-force searches required for the complex boundary cases listed above This may be seenfrom Figure 13.8, where the brute-force search at the corner was avoided by this procedure
As before, knowledge of the boundary points is required for this improvement
Nearest Neighbour Algorithm Will Fail Here
2 3 4 5
Figure 13.8 Inside-out interpolation