Benjamin

Cyprien Florence

Fabien

Valentin

Je tiens à remercier tout d'abord Frédéric Alauzet, mon directeur de thèse, qui m'a donné la possibilité de découvrir le monde de la recherche en me proposant ce sujet. Je lui suis très reconnaissant de m'avoir fait partager son savoir et son expérience avec patience et disponibilité.

Je suis particulièrement reconnaissant envers Paul Louis George, responsable du projet Gamma, pour son encadrement strict mais juste dès mon arrivée dans le projet, et pour m'avoir patiemment transmis une petite part de son savoir (qui est grand...).

Je suis très honoré que Messieurs Jean-François Remacle et Michel Visonneau aient accepté de rapporter mon travail et je les en remercie. Je suis également reconnaissant envers Messieurs Thierry Coupez, Alain Dervieux, Miguel Fernández, Paul Louis George et Dave Marcum pour leur participation à mon jury.

Un grand merci à tous les membres du projet Gamma que je vois tous les jours depuis cinq ans, pour les discussions intéressantes avec certains, et les bons moments de détente avec d'autres, les deux ensembles n'étant pas d'intersection nulle: Adrien -qui mériterait une phrase à lui tout seul si mon répertoire de synonymes était plus éto↵é-, Loïc, Dave, Houman, Patrick, Victorien, Alexis, Olivier, Loïc sans oublier Maryse pour son aide précieuse. Mention spéciale à Julien, Alex et Eleonore, pour m'avoir supporté dans le même bureau. Merci aussi à Stéphanie, Bruno et Estelle, ainsi qu'à Géraldine, sans son travail approfondi cette thèse n'aurait pas été bien loin. Mes remerciements à tous les gens des autres équipes et bâtiments croisés plus ou moins longuement ici et là.

Je remercie mes amis, qui auront supporté mes sautes d'humeur et que j'ai parfois injustement négligés, Antoine, Camille, Cédric, Jeanne, Lindsay, Maïssane, Marion, Mélanie, Nicolas, Paco, Sibylle, tous ceux d'IRC, Dominique,

Résumé

Les simulations dépendant du temps sont devenues une nécessité pour l'industrie, et notamment celles mettant en oeuvre des géométries mobiles, avec mouvement imposé ou avec des interactions de type fluide-structures. Toutefois, de nombreuses di cultés subsistent qui empêchent d'e↵ectuer de telles simulations de manière quotidienne à une précision acceptable. Parmi ces di cultés, les géométries mobiles, en particulier celles présentant des grands déplacements, ne sont en général pas traitées de façon satisfaisante, aussi bien du point de vue du temps de calcul que de la précision des algorithmes. L'adaptation de maillage anisotropes basée sur les métriques a prouvé son e cacité pour améliorer la précision des calculs stationnaires pour un coût en temps maîtrisé. Mais son extension aux problèmes dépendant du temps est loin d'être évidente, et l'ajout de géométries mobiles complique encore plus le problème. Dans cette thèse, on s'intéresse à divers éléments des simulations instationnaires en géométrie mobile, avec l'objectif global de les rendre automatiques et d'en améliorer les performances. Dans la continuité de [Olivier 2011a], des contributions sont apportées à tous les éléments de la chaîne, algorithme de bouger de maillage, solveur Arbitrairement Langrangien Eulerien (ALE) et adaptation instationnaire, conduisant à la mise au point d'un algorithme d'adaptation de maillage pour des simulations en géométrie mobile.

On considère un algorithme de bouger de maillage fondé sur des changements de connectivité (swaps) pour préserver la qualité du maillage. Une nouvelle méthode de calcul de la déformation du maillage, par interpolation directe (méthode IDW), a été ajoutée, et comparée à la méthode préexistante par résolution d'une EDP d'élasticité linéaire. Ces deux méthodes présentent toutes deux des performances excellentes, ce qui prouve la robustesse de l'algorithme pour gérer des maillages mobiles sans remaillage global, y compris avec de grands déplacements. Dans cette thèse, on aborde également les corps déformables avec des couches limites ou des grandes variations de volume.

Cet algorithme de bouger de maillage a été conçu pour être utilisé avec un solveur ALE, que l'on présente en détail. Une discrétisation par Volumes Finis est e↵ectuée, avec un solveur de Riemann approché de type HLLC, et une reconstruction des gradients de type MUSCL pour obtenir un ordre 2 en espace. La discrétisation en temps repose sur une analyse fine de la Loi de Conservation Géométrique (GCL), qui permet de construire des schémas de Runge-Kutta à plusieurs pas d'ordres élevés. Le calcul de certaines quantités géométriques en trois dimensions est clarifié. Les changements de connectivité du maillage sont traités par une interpolation linéaire entre deux pas de temps du solveur.

Ce solveur a été implémenté en trois dimensions, parallélisé et validé sur plusieurs cas. Ces derniers ont confirmé les ordres de convergence attendus. En particulier, l'influence des swaps a été étudiée, et il en découle que le faible nombre de ces opérations rend leur influence négligeable sur la convergence et la précision des solutions. D'autres exemples tri-dimensionnels sont présentés dans le champ de la Mécanique des Fluides Numérique (CFD), plus complexes en terme de flux étudiés, de géométries et de déplacements des géométries, avec des déplacements imposés ou dérivant d'un couplage Fluide-Structure. Ils prouvent l'e cacité de l'approche retenue, qui permet de simuler des problèmes en maillage mobile complexes dans un temps Contents raisonnable sans jamais remailler globalement.

Des progrès ont été réalisés depuis le premier algorithme d'adaptation instationnaire de point fixe dans [Alauzet 2003a]. Dans cette thèse, une nouvelle version de l'algorithme de point fixe est utilisée, fondée sur une nouvelle analyse de l'erreur espace-temps dans le cadre de la théorie du maillage continu. Théorie et expérimentation ont permis de clarifier et valider certains points cruciaux du processus, notament le choix d'une Hessienne moyennée essentielle à l'algorithme. Grâce à une parallélisation e cace de type p-threads, dont on fournit une analyse, plusieurs cas d'adaptation instationnaire en 3D ont été simulés avec une précision di cilement concevable il y a encore quelques années.

Finalement, toutes ces briques ont été assemblées pour conduire à un algorithme d'adaptation pour simuler des phénomènes physiques instationnaires en maillage mobile utilisant l'algorithme de bouger de maillage avec changements de connectivité. La métrique ALE qui avait été présentée dans [Olivier 2011a] et permettait de bouger un maillage en un maillage adapté est intégrée à une analyse d'erreur fondée sur l'approche du maillage continu. Cela conduit à une correction de la métrique optimale dans l'algorithme de point fixe. En plus de l'utilisation de cette nouvelle métrique, d'autres ajouts ont été e↵ecutés par rapport à l'algorithme standard pour utiliser des maillages mobiles. En particulier la métrique sur laquelle les optimisations de maillage de l'algorithme de bouger sont e↵ectuées est modifiée. Finalement, plusieurs exemples sont présentés, qui confirment que l'adaptation de maillage anisotrope permet un gain de précision en un temps raisonnable pour les simulations en maillage mobile complexes.

Conventions Simplicial mesh

Let n be the dimension of the physical space and let ⌦ ⇢ R n be the non-discretized physical domain. ⌦ is an a ne space. The canonical basis of its vectorial space is noted (e 1 , e 2 , . . . , e n ) in general, but notations (e

x , e y ) and (e

x , e y , e z ) can also be used in two and three dimensions. Vectors of R n are noted in bold font. The coordinate vector of a point of ⌦ is generally noted x = (x 1 , . . . , x n ). The boundary of ⌦, noted @⌦, is discretized using simplicial elements the vertices of which are located on @⌦. In two dimensions, @⌦ is discretized with segments while in three dimensions, boundary surfaces @⌦ are represented by triangles. The discretized boundary is noted @⌦ h and ⌦ h denotes the sub-domain of R n having @⌦ h as boundary. Building a mesh of ⌦ h consists in finding a set of simplicial elements -triangles in two dimensions, tetrahedra in three dimensions -noted H, satisfying the following properties:

• Non-degenerescence: Each simplicial element K of H is non-degenerated (no flat elements of null area or volume),

• Covering:

⌦ h = [ K 2 H K ,
• Non-overlapping: The intersection of the interior of two di↵erent elements of H is empty:

Ki \ Kj = ?, 8 K i , K j 2 H, i 6 = j .

• Conformity: The intersection of two elements is either a vertex, an edge or a face (in three dimensions) or is empty.

The conformity hypothesis is adopted here, because the meshes will be used with a Finite-Volume solver which requires the enforcement of this constraint. Besides, it facilitates the handling of data structures on the solver side and also enables to save a consequent amount of CPU time.

Finally, a mesh is said to be uniform if all its elements are almost regular (equilateral) and have the same size h.

Notations and orientation conventions

The following notations will be used in this thesis: K is an element of the mesh H, P i is the vertex of H having i as global index, e ij is the edge linking P i to P j . The number of elements, vertices and edges are noted N t , N v and N e , respectively. The vertices and the edges of an element K are also numbered locally. Vertex numbering inside each element is done in a counter-clockwise (or trigonometric) manner, which enables Contents to compute edges/faces outward normals in a systematic way. This numbering, as well as unit outward normals n and edges/faces orientations are shown for triangles and tetrahedra in Figure 1. Non-normalized normals will be noted ⌘.

Introduction

In 1953, the first civil numerical simulation, also know as Fermi-Pasta-Ulam-Tsingou experiment, focused on a unidimensional system with 64 masses coupled with springs (i.e. 64 vertices). In sixty years, numerical simulation has come a long way, together with the development of computing resources. As it became possible to model and simulate more complex problems, industry started to take advantage of its potentialities. In particular, the aeronautic industry quickly saw a way to avoid costly full-size experiments, and has, together with military applications, been a driving force in the development of numerical simulation.

Nowadays, computers with hundreds of thousands of cores are available, and sophisticated numerical models enable running complex multiphysics simulations, involving fluid mechanics, structural mechanics, thermodynamics and electromagnetism. Most of the fields of scientific research resort to numerical simulation, from physics to social sciences through engineering and medicine, with more or less success. However, as the simulation capabilities grow, so do the requirements of both industries and researchers, and a whole set of problems have arisen. Notably, the increase in computational power allows scientists to not content themselves with steady approximations of the physical phenomena, and to study the e↵ects of time-dependent parameters.

In this thesis, we focus on Computational Fluid Dynamics (CFD), i.e. the science of simulating numerically fluid flows, and its applications to aeronautic, although the results presented can be used in a vast field of research and industry. The theme of this thesis is unsteady simulations, and in particular simulations with moving boundaries. This subject is tackled from the points of view of meshes and mesh adaptation.

Problem

Most real-life phenomena are unsteady, but scientists are still far from running simulations close to real life on a daily basis. Problems arising from unsteady simulations are of multiple kind. To be used by industry, the results of numerical simulations have to be trusted, and the certification of the accuracy of the solutions is harder than for steady problems. Instabilities impact more the solution, and it is di cult to control the error in time at long temporal scales. Unsteady simulations are intrinsically longer than steady simulations, due to restrictions on the solvers time steps, and it is all the more di cult to control the error over time at a reasonable CPU time cost. Solutions to e ciency issues have to be found. Unsteady simulations often involve the interactions of one or several bodies evolving in one or several fluids, which require considering Fluid-Structure Interaction coupling techniques. Very often, moving boundaries have to be dealt with, which is often done by moving the mesh. This proves to be complex, especially for large displacements and in three dimensions, where meshing techniques are still evolving.

Contents

State of the art

Mesh adaptation has proved over the past twenty-five years its ability to increase significantly the accuracy of numerical simulations for a reasonable CPU time cost. A large number of di↵erent approaches have been considered, for various applications, from aerodynamics to biomechanics and magnetodynamics. Metric-based mesh adaptation has notably resulted in considerable gain in terms of accuracy and CPU time for steady problems [Hecht 1997, Bottasso 2004[START_REF] Gruau | [END_REF], Loseille 2010a, Guégan 2010]. A first attempt at extending it to unsteady simulations was carried out in [Alauzet 2003a], which was promising. This work was carried on in [Olivier 2011a], in which more solid theoretic bases were brought to support the method, and in which metric-based mesh adaptation was used for the first time on two dimensional moving meshes.

Objective

The works presented in this thesis follow on from [Olivier 2011a]. I focused on two aspects of mesh adaptation for moving mesh problems: on the one hand, the handling of moving meshes themselves, and on the other hand metric based mesh adaptation for unsteady simulations. First, I aimed at improving the strategy for simulations with moving meshes developed in [Olivier 2011a, Alauzet 2014a], based on a connectivity-change moving mesh algorithm coupled to an ALE solver. Variants to the algorithm needed to be considered, as well as the implementation and validation of the solver in 3D. Regarding unsteady simulations, the objective was to integrate the latest theoretic updates to the adaptation algorithm, both for fixed and moving meshes, and to extend to 3D the work of [Olivier 2011a] on adaptation for moving meshes.

Numerical context

The present work was conducted in the GAMMA3 research group at INRIA. Most numerical choices naturally stem from those made in the group, to benefit from both the considerable experience and the valuable software of its members.

We consider unstructured meshes, i.e. meshes made up of triangles (in 2D) or tetrahedra (in 3D). This is due to the fact that it is easier to mesh complex geometries with simplexes, resulting in several fully automatic unstructured three-dimensional meshing codes, and to the flexibility of such elements enabling anisotropic mesh adaptations.

Anisotropic metric-based mesh adaptation techniques are considered, which present several advantages compared to other adaptation techniques. First, it allows us to handle anisotropic meshes, which are of great value in mesh adaptation because they enable a more optimal distribution of the mesh vertices, and because the orientation of the elements is accorded to the physical phenomena at stake. Moreover, the theory of metric-based adaptation is well established, and several research groups contribute to its development. In particular, the recent advent of the continuous mesh framework [Loseille 2011a, Loseille 2011b] was a major breakthrough in this field, opening the way to a more rigorous analysis of error optimization problems. Finally, several research works establish the ability of metric-based mesh adaptation to handle complex steady simulations in three dimensions, which is promising for unsteady problems.

Regarding moving-boundary meshes, the body-fitted approach has been preferred to immersed boundaries and Chimera (overset) methods. We consider a unique body-fitted mesh, that follows the moving geometry in time, because it enables an accurate treatment of boundaries, unlike immersed boundaries methods where the boundary is not explicitly meshed, and because there is no interpolation step unlike Chimera methods where the solutions on the different sub-grids have to be transferred to one another, resulting in spoiling interpolation error. From the solver point of view, the classic Arbitrary-Lagrangian-Eulerian (ALE) framework is used, that enables writing the physical equations on a mesh moving with an arbitrary movement.

Finally, application examples have been chosen in the field of CFD, and only mono-fluid problems modeled by the inviscid compressible Euler equations are considered. Driven by industrial concern, most of the simulations are three dimensional.

Main contributions

During this thesis, I updated the existing algorithms both for moving mesh handling and for unsteady mesh adaptation. I implemented these updates and tested them on a wide variety of test cases. Notably, I extended the previous works of [Olivier 2011a] to 3D.

• I added a new mesh deformation method (the Inverse Distance Weighted (IDW) method) to our moving mesh code, and compared it to the elasticity-like method already implemented.

• I partially implemented and parallelized the ALE solver from [Olivier 2011a] in 3D, validated it on academic test cases and ran complex 3D ALE simulation both with imposed motion and FSI.

• I updated the unsteady adaptation algorithm with the latest theoretical results, using the continuous mesh framework to derive a better expression for the averaged "Hessian-metric", and ran 3D simulations of unprecedented size thanks to an e cient parallelization of the algorithm.

• I updated the error analysis from [Olivier 2011a] for adaptative moving mesh problems, implemented the resulting algorithm, and ran several 3D adaptive simulations with moving boundaries.

Outline

This thesis is structured in two parts, that cover the two aspects of adaptation for moving mesh problems.

In the first part (Part I), aspects linked to the moving mesh computations are considered. First, we focus on the moving mesh strategy used in the whole thesis, describing every aspects of the algorithm, and analyzing the performance of updates to this algorithm. It is notably based on mesh connectivity changes (edge/face swaps), to preserve the quality of the mesh throughout large displacements without remeshing. This algorithm was designed to run ALE simulations on the moving meshes, and an ALE solver was actually implemented in 3D. It is described in details, from the formulation of the equations and the choices of numerical methods to implementation and parallelization considerations. Validation examples of the solver are presented, followed by Contents more complex CFD cases coupling the ALE solver and the connectivity-change moving mesh algorithm, proving the e ciency of the approach in 3D.

The second part (Part II) deals with mesh adaptation, from the basics of metric-based adaptation to adaptation with moving meshes, through unsteady simulation on fixed meshes. All the theoretical background necessary for the rest of the part is recalled, notably the continuous mesh framework and multiscale mesh adaptation. The continuous mesh framework enabled a new analysis of the space-time error for unsteady simulations, which is presented, and leads to a new version of the unsteady adaptation algorithm. Practical aspects of the implementation of this algorithm are reviewed, and new 3D examples are given. This algorithm is extended to moving meshes: the ALE metric introduced in [Olivier 2011a] is plugged into the unsteady error analysis, and the resulting adaptation algorithm is described. Finally, examples of 3D adaptative simulations with moving mesh are exhibited, that validate the whole approach followed in this thesis.

Scientific communications

Journal articles

• Three-dimensional large displacement CFD simulations using a connectivitychange moving mesh approach, N. Barral and F. Alauzet, Journal of Computational Physics, submitted.

• Construction and geometric validity (positive Jacobian) of serendipity Lagrange finite elements, theory and practical guidance, P.L. George, H. Borouchaki and N. Barral, Mathematical Modelling and Numerical Analysis, submitted.

• Geometric validity (positive Jacobian) of high-order Lagrange finite elements, theory and practical guidance, P.L. George, H. Borouchaki and N. Barral, Engineering with computers, accepted.

Proceedings with peer review

• Metric-Based Anisotropic Mesh Adaptation for Three-Dimensional Time-Dependent Problems Involving Moving Geometries, N. Barral, F. Alauzet and A.

Loseille, 53th AIAA Aerospace Sciences Meeting, AIAA Paper 2015-2039, Kissimmee, FL, USA, Jan 2015.

• Two mesh deformation methods coupled with a changing-connectivity moving mesh method for CFD Applications, N. Barral, E. Luke and F. Alauzet, Proc. of the 23th International Meshing Roundtable, Procedia Engineering, vol 82, pp. 213-227, London, England, 2014.

• Large displacement body-fitted FSI simulations using a mesh-connectivitychange moving mesh strategy, N. Barral • Large displacement simulations with an e cient mesh-connectivity-change moving mesh strategy, N. [START_REF] Barral | [END_REF]F. Alauzet, ECCOMAS 2014, Barcelona, Spain, July 2014.

• Parallel time-accurate anisotropic mesh adaptation for time-dependent problems, N. [START_REF] Barral | [END_REF]F. Alauzet, ECCOMAS 2014, Barcelona, Spain, July 2014.

Research reports

• Construction et validation des éléments Serendip associés à un carreau de degré arbitraire, P.L George, H. Borouchaki and N. Barral, INRIA RR-8572, 2014.

• Construction et validation des éléments réduits associés à un carreau simplicial de degré arbitraire, P.L George, H. Borouchaki and N. Barral, INRIA RR-8571, 2014.

Talks and seminars

• Adaptation de maillages non structurés pour des problèmes instationnaires, et maillage en géométrie mobile, N. Barral, Groupe de travail "Analyse Numérique et EDP", Ecole Centrale Paris, November 2014.

• Du réel au numérique : la science des maillages, P.L. George and N. Barral, Pint of Science, May 2015.

Awards

• IMR Meshing Contest Award, 23th International Meshing Roundtable, London, October 2014.

Fluid-structure interaction (FSI) simulations are required for a wide variety of subjects, from the simulation of jellyfish [Etienne 2010] to the releasing of a missile [START_REF] Murman | [END_REF], Hassan 2007], through the simulation of aortic valves [Astorino 2009], cardiovascular systems [Formaggia 2009[START_REF] Gerbeau | [END_REF]], ship propellers [Compère 2010], tuning forks [START_REF] Froehle | [END_REF]], wind turbines [START_REF] Bazilevs | [END_REF]], 2D airbag deployment and balloon inflation [START_REF] Saksono | [END_REF]]. Other problems such as icing [START_REF] Tong | [END_REF], Pendenza 2014] or blast studies [START_REF] Baum | [END_REF]] do not involve FSI but share a lot of common problems with FSI simulations. The recent development of computing capacities has made it possible to run increasingly complex simulations where moving bodies interact with an ambient fluid in an unsteady way. However, engineers are still far from performing such simulations on a daily basis, largely due to the di culty of handling the moving meshes induced by the moving geometries.

When the displacement of the geometry is small enough, slightly deforming the original mesh [Batina 1990, Degand 2002] can generally be acceptable. But when large deformation of the boundaries is considered, the mesh quickly becomes distorted and the numerical error due to this distortion quickly becomes too great, until the elements of the mesh finally become invalid, and the simulation has to be stopped. Specific strategies need to be developed to deal with large displacement moving boundary problems. In the case of FSI problems, another di culty arises from the fact that the displacement of the boundaries is by definition an unknown, and the deformation of the mesh cannot be imposed a priori. Addressing the issue of the mesh movement cannot be separated from addressing the issue of the solver that will compute on these moving meshes. Depending on the strategy employed to deal with the movement, specific numerical methods must be designed to take into account the displacement of the mesh.

The question this part focuses on is: how can we e ciently move the mesh for large displacement 3D FSI simulations and what numerical schemes need to be associated to such a strategy ? Three main approaches to address the mesh movement problem can be found in the literature. The first approach consists in having a single body-fitted mesh [START_REF] Baum | [END_REF], Hassan 2007], and moving it along with the moving boundaries. The mesh may thus undergoe large deformation. The second approach is the Chimera (or overset) method [START_REF] Benek | [END_REF]], in which each moving body has its own body-fitted sub-mesh, and the sub-meshes move rigidly together with their body and can overlap one another. Finally the embedded boundary approach [Bruchon 2009, Löhner 2001] uses meshes that are not body-fitted at all: the bodies are embedded in a fixed grid, and techniques such as level-sets are used to recover their moving boundaries. All three approaches have their own strengths and weaknesses. For meshing purposes and to fit our mesh adaptation context, we focus on body-fitted approaches with one single mesh. Our approach was introduced in [Alauzet 2014a] and was enhanced during this thesis.

In some works, a mesh motion that is directly adapted to the physical phenomena in question is applied, using for instance either so-called Moving Mesh PDEs [Huang 2010b] or a Monge-Ampère equation [Chacón 2011]. More generally, these approaches come under the r-adaptation category (see Section 4.1.3). However interesting these approaches may be, they still seem to be time consuming, especially in 3D, due to the solution of a non-linear equation, and it is unsure whether they can handle complex 3D geometries. Therefore we prefer to prescribe arbitrary movements to the mesh, and use our mesh adaptation framework [Loseille 2011a] when necessary, as will be detailed in Part II, Chapter 6.

As regards numerical solvers, we consider a classic framework for moving meshes: the Arbitrary Lagrangian Eulerian (ALE) framework, which is based on a formulation of the equations that takes into account an arbitrary movement of the vertices. This technique was introduced in the 70s in [START_REF] Hirt | [END_REF][START_REF] Hughes | [END_REF][START_REF] Donea | [END_REF]. Since then, so many developments have been made in that field that a complete list of them would not fit in this thesis. However, one may in particular refer to [START_REF] Nkonga | [END_REF][START_REF] Baum | [END_REF][START_REF] Farhat | [END_REF], Formaggia 2004, Mavriplis 2006, Hassan 2007[START_REF] Hay | High-order temporal accuracy for 3D finite-element ALE flow simulations[END_REF]], which mainly focus on improving temporal schemes for ALE simulations.

To our knowledge, very few examples of ALE solvers coupled with connectivity-change moving mesh techniques can be found in the literature. In [Kucharik 2008] a conservative interpolation is proposed to handle the swaps. In [Guardone 2011, Olivier 2011b] an ALE formulation of the swap operator is built. However, these studies are limited to 2D. Driven by the requirements of industry, we are interested in designing a method that works in 3D. In this thesis, a linear interpolation is carried out after each swap instead of using a specific ALE formulation, and we will evaluate the numerical error due to these swaps.

The goal of this part is to demonstrate that three-dimensional FSI simulations with large displacement can be run e ciently by coupling an ALE solver to our connectivity-change moving mesh strategy. This part is structured as follows. In Chapter 1, the moving mesh strategy used and improved during this thesis is described in detail, and analyzed on purely moving-mesh simulations. In Chapter 2, the ALE solver that was implemented in 3D during this thesis is described, from the formulation of the equations to implementation considerations. Finally Chapter 3 presents a large number of moving-mesh ALE simulations, both academic test cases and more complex CFD simulations, coupling the moving mesh strategy and ALE solver.

Chapter 1

Connectivity-change moving mesh strategy

When dealing with a unique body-fitted moving mesh, two main approaches are used.

The first one is simply to move the mesh for as long as possible, with a constant topology, and remesh when the quality becomes critical. For each remeshing, the simulation has to be stopped, a new mesh must be generated (a whole new mesh or parts of it), new data structures must be created, and the solution must be transferred to the new mesh. This approach can be e cient, especially when small displacements are considered and very few remeshings are necessary, because the solver and the meshing aspects are decoupled. Between two remeshings the simulation is fully ALE and free from interpolation errors due to connectivity changes. However, for larger displacements, the number of remeshings increases to prevent invalid elements from appearing, especially if shearing appears. This can be costly in terms of CPU, but also result in poor accuracy due to the numerous solution transfer steps. This strategy is for instance used in [START_REF] Murman | [END_REF]] with hexaedral Cartesian meshes, or [Löhner 1990a, Hassan 2000, Jayaraman 2000] on unstructured meshes.

The second approach tries to preserve a good mesh quality throughout the simulation by performing local remeshing operations such as vertex insertion, vertex collapse, connectivity changes and vertex displacements. It is used for example in [Dobrzynski 2008, Compère 2010]. The advantage of this method is that it maintains an acceptable mesh quality without needing to stop, remesh and resume the simulation. However, it requires fully dynamic mesh data structures that are permanently updated, which can lead to a loss of CPU e ciency, and the numerous mesh modifications tend to lead to a loss of accuracy due to interpolation errors.

In our case, we want to address the case of large and complex displacements of the boundaries, with potentially highly non-linear trajectories as may occur in FSI simulations. This requires that the moving mesh strategy fulfills a number of properties:

• It must above all preserve the validity of the mesh, and never create elements with a negative volume.

• It must preserve the quality of the elements of the mesh all along the simulation, to ensure a good solution accuracy and reasonable solver time steps.

• It must be e cient in terms of CPU since the mesh must be moved at each solver iteration. It must not take for more than a small fraction of the total simulation time.

• It must be robust, and be able to deal with very small elements, and large shearing constraints.

• It must be able to preserve the anisotropic adaptation if any.

For e ciency purposes, we add that we want to remesh as little as possible, and that most cases should be run without remeshing at all.

Remark 1. What we call remeshing entails: stopping the simulation, calling meshing software to generate either a whole new mesh or parts of it, and interpolate the solution on the new mesh. This is costly because (a) it usually requires the use of an external code, with its own data structures, requiring CPU-expensive data transfers, (b) the meshing step can be long (and might not even complete) in the case of complex geometries, (c) an interpolation step which produces not too much error is long too, especially if the whole mesh or large portions of it are considered. On the other hand, our mesh optimizations (a) are performed on the go, within the numerical solver code, using the same semi-dynamic data-structures, (b) concern only a limited set of elements, and are performed element by element, only if the quality of the element requires them, (c) no global interpolation procedure is required since the number of vertices is constant.

The previous strategies do not match these requirements, either in terms of preserving the mesh quality or in terms of e ciency for large displacements. That is why we adopt a strategy based on only vertex displacements and connectivity changes. Improvements in the way to compute the displacement of the vertices makes that strategy very e cient, while the connectivity changes makes it robust, as will be demonstrated in Section 1.3. Besides its CPU e ciency, this strategy presents some very interesting features considering numerical simulations:

• Since no vertex insertion or deletion occurs, and no remeshing is performed, a source of large spoiling interpolation errors is removed, and the accuracy of the numerical simulations should be improved. The use of an ALE treatment for connectivity changes would allow the simulation to be fully ALE.

• It is especially e cient with a vertex-centered Finite-Volume approach, since the number of vertices is preserved, the number of dual cells is preserved as well.

• Our unsteady adaptation algorithm, that will be detailed in Part II, Chapter 5, requires a set number of vertices within each adaptation sub-interval to control the error. Our strategy keeps constant the number of vertices and is thus compatible with our adaptation algorithm.

One might wonder why perform connectivity changes (edge/face swaps) in the first place, if they are a priori not ALE compliant. First, performing local mesh modifications within the solver is far simpler and more e cient than remeshing globally. Moreover, connectivity changes can be relatively simply interpreted in terms of evanescent cells for purposes of ALE numerical schemes. In many body-fitted moving mesh strategies, a lot of CPU time is dedicated to computing the displacement of the mesh, in order to make it follow the moving boundaries. Thanks to frequent mesh optimizations, the cost of this step is reduced by computing the mesh deformation for a large number of solver time steps (i.e. we do it only a few times during the simulation).

In the present chapter, I will first detail the moving mesh algorithm that was used during this thesis (Section 1.1), and present a variant of the algorithm developed during the thesis (Section 1.2). Then I will present various examples of purely moving mesh simulations to study the e ciency of the algorithm and compare its two variants. The behavior of the algorithm with viscous-like boundary layers is studied in Section 1.4. In these sections, we only consider displacements with no volume variation, or a small one. The case of large volume deformation is tackled at the end of the chapter in Section 1.5.

The works presented in this Chapter were published in [Barral 2014d].

Our moving mesh algorithm 1.A two step process

The connectivity-change moving mesh algorithm (MMA) is a two-step process:

• A mesh deformation step, in which a trajectory is assigned to each inner vertex, depending on the displacement of the boundaries.

• A mesh optimization step, in which the trajectories of the vertices are modified, and connectivity changes are performed, to preserve the quality of the mesh.

Mesh deformation step

For body-fitted moving mesh simulations, the whole mesh must be deformed to follow the moving boundaries. During the mesh deformation step, a displacement field is computed for the whole computational domain, given the displacement of its boundaries. Trajectories, or in other words, positions at a future solver time step, can thus be assigned to inner vertices. Several techniques can be found to compute this displacement field:

• implicit or direct interpolation [de Boer 2007, Luke 2012], in which the displacement of the inner vertices is a weighted average of the displacement of the boundary vertices,

• solving PDEs -the most common of which being Laplacian smoothing [Löhner 1998],

Winslow equation [START_REF] Masters | Mesh Manipulation for 3D Tetrahedral Meshes[END_REF]], a spring analogy [Degand 2002] and a linear elasticity analogy [Baker 1999].

It is this last method that we selected at first, due to its robustness in 3D [START_REF][END_REF]]. In Section 1.2, a direct interpolation procedure will also be considered.

In the case of the elasticity analogy, the computational domain is assimilated to a soft elastic material, which is deformed by the displacement of its boundaries. More precisely, the inner vertices movement is obtained by solving an elasticity-like equation with a P 1 Finite Element Method (FEM):

div( (E)) = 0 , with E = rd + T rd 2 , (1.1)
where and E are respectively the Cauchy stress and strain tensors, and d is the Lagrangian displacement of the vertices. The Cauchy stress tensor follows Hooke's law for isotropic homogeneous medium, where ⌫ is the Poisson ratio, E the Young modulus of the material and , µ

Chapter 1. Connectivity-change moving mesh strategy are the Lamé coe cients:

(E) = trace(E) I d + 2 µ E or E( ) = 1 + ⌫ E ⌫ E trace( ) I d .
In our context, ⌫ is typically chosen of the order of 0.48, which corresponds to a very soft, nearly incompressible material1 . Dirichlet boundary conditions are used and the displacement of vertices located on the domain boundary is strongly enforced in the linear system. The linear system is then solved with a P 1 Finite Element Method (FEM) by a Conjugate Gradient algorithm coupled with an LU-SGS pre-conditioner (See [Olivier 2011a] for more details).

Basic elasticity-based algorithm

The classic algorithm to move the mesh using the elasticity-based deformation method is simply to solve the elasticity problem at every time step and then move the mesh using the solution of the problem. This strategy is described in Algorithm 1. In this algorithm, H stands for meshes, S for solutions and v for vertex speed.

Algorithm 1 Basic Moving Mesh Algorithm Input: H 0 , S 0 While (t < T end ) 1. t = Get solver time step H k , S k , v, CF L
|@⌦ h , t (c) v = Deduce inner vertices speed from displacement d 3. S k+1 = Solve Equation of State H k , S k , t, v 4. H k+1 = Move the mesh H k , t, v 5. t = t + t

EndWhile

The computation of the mesh deformation -here the solution of a linear elasticity problem -is known to be an expensive part of dynamic mesh simulations. Performing it at every solver time step makes it all the more so. In order to reduce significantly the CPU time of that part, this step needs to be enhanced.

Improvements to the mesh deformation steps

Several improvements to the mesh deformation step are brought compared to the basic approach.

Local material properties alteration. First, the linear elasticity analogy allows us to modify the local material properties according to the distortion and e↵orts born by each element. In particular, small elements are made sti↵er than others, which has the advantage of limiting their deformation, and thus avoiding the creation of false elements. To do so, the way the Jacobian of the transformation from the reference element to the current element is accounted for in the FEM matrix assembly is modified as in [Stein 2003]. The classic P 1 FEM formulation of the linear elasticity matrix leads to the evaluation of quantities of the form:

Z K s @' J @x k @' I @x l dx = s |K| @' J @x k @' I @x l ,
where s is either , µ or + 2µ and |K| is the volume of tetrahedron K. The above quantity is replaced by:

Z K s | K| |K| ! @' J @x k @' I @x l dx = s |K| | K| |K| ! @' J @x k @' I @x l ,
where > 0 is the sti↵ening power and K is the reference element. This technique locally multiplies and µ by a factor proportional to |K| . determines how sti↵er than large elements small elements are. In this work, we chose = 1.

Rigidify regions. Some regions of the mesh can also be rigidified, i.e. their vertices are all moved with the same displacement. Typically, this is done for a few layers of tiny elements around moving rigid bodies, that are moved together with the body. Rigidifying elements close to complex features of the geometries reduces the risk of creating bad elements in those regions, and also removes sti↵ elements from the FEM matrix. We can also chose to enclose moving bodies with a complex geometry into boxes or spheres, and rigidify the whole region inside these boxes and spheres: the objects moved are then much simpler.

Elasticity on reduced regions. The elasticity can also be solved on a reduced region: if the domain is very large compared to the size of the moving bodies and the length of the displacement, it is sometimes possible to solve the elasticity problem for a few layers around the moving bodies only. The idea is the same as the previous one, but now it is the far field that is rigidified. It has to be noted that the elastic region has to be large enough to let the moving bodies evolve in it.

Elasticity dedicated mesh. A way to reduce significantly the CPU time of the mesh deformation computation is to consider two meshes: one on which the physical equations are solved, and one on which the elasticity problem is solved. The elasticity-dedicated mesh can be much coarser than the computational one, since a precise elasticity solution is not needed -especially when using mesh optimizations as described below. This strategy could also be mandatory when considering adapted meshes with high aspect-ratio elements, on which the FEM elasticity system could be practically impossible to solve. More precisely, we consider two meshes with the same boundary mesh, the elasticity-dedicated mesh being coarser than the computational one. The displacement of the boundary vertices is the same for both meshes (whether it is imposed to the bodies, or whether a FSI motion is considered: in this case, the displacement of the bodies is computed on the computational mesh, then transferred to the elasticity mesh). The elasticity FEM system is then assembled on the coarse mesh, and solved. The solution of the elasticity problem is then transferred to the computational mesh using a P 2 -Lagrangian scheme, which is su ciently accurate considering the intrinsic smoothness of the solution of the above elasticity equation. Then both meshes are moved with the same time step. If mesh optimizations are performed, they are performed on both meshes, so that the elasticity mesh remains valid too. The cost of moving the coarse mesh is shown to be very small compared to the gain in solving the elasticity problem.

Reduced number of solutions. The main improvement to the basic algorithm 1 is that we do not solve an elasticity problem at each FSI solver time step t. Instead, we consider a larger time step t, and the elasticity problem is solved for this time step, and the trajectory of the vertices is kept constant on this whole larger time step. While there is a risk of a less good mesh displacement solution, this strategy is worthy if mesh optimizations are used to preserve the mesh quality, as explained in Section 1.1.3.

High order trajectories. Since the trajectories are computed for a large time step, it is worthwhile to consider vertex paths that are more complex than mere straight lines (linear trajectories). This is especially true if the moving bodies undergo rotation or accelerated movements. The paths of inner vertices is improved providing a constant acceleration a to each vertex in addition to its speed, which results in an accelerated and curved trajectory. During time frame [t, t + t], the position x and the velocity v of a vertex are updated as follows:

x(t + t) = x(t) + t v(t) + t 2 2 a v(t + t) = v(t) + t a .
Prescribing a velocity vector and an acceleration vector to each vertex requires solving two elasticity systems. For both systems, the same matrix, thus the same pre-conditioner, is considered. Only boundary conditions change. If inner vertex displacement is sought for time frame [t, t + t], boundary conditions are imposed by the location of the body at time t + t/2 and t + t. These locations are computed using body velocity and acceleration. Note that solving the second linear system is cheaper than solving the first one as a good prediction of the expected solution can be obtained from the solution of the first linear system. Now, to define the trajectory of each vertex, the velocity and acceleration are deduced from evaluated middle and final positions:

t v(t) = 3 x(t) + 4x(t + t/2) x(t + t) t 2 2 a = 2x(t) 4 x(t + t/2) + 2x(t + t) .
In this context, it is mandatory to make sure that the mesh remains valid for the whole time frame [t, t + t], which is done computing by the sign of the volume of the elements all along their path [Alauzet 2014a].

Mesh optimization step

Mesh optimizations are performed regularly to preserve the quality of the mesh. The optimization procedure consists in one or several passes of vertex smoothing and one or several passes of generalized swapping, and is described below.

For 3D adapted meshes, an element's quality is measured in terms of the element's shape by the quality function:

Q M (K) = p 3 216 ✓ 6 P i=1 `2 M (e i ) ◆ 3 2 |K| M 2 [1, +1] , (1.2)
where `M(e) and |K| M are the edge lengths and element volume in metric M. Metric M is a 3 ⇥ 3 symmetric positive definite tensor prescribing element sizes, anisotropy and orientation to the mesh generator (see Chapter 4). Q M (K) = 1 corresponds to a perfectly regular element and Q M (K) < 2 correspond to excellent quality elements, while a high value of Q M (K) indicates a nearly degenerated element. For non-adapted (uniform) meshes, the identity matrix I 3 is chosen as metric tensor.

Mesh smoothing. The first mesh optimization tool is vertex smoothing which consists in relocating each vertex inside its ball of elements, i.e., the set of elements having P i as their vertex. For each tetrahedron K j of the ball of P i , a new optimal position P opt j for P i can be proposed to form a regular tetrahedron:

P opt j = G j + r 2 3 n j `(n j )
, where F j is the face of K j opposite vertex P i , G j is the center of gravity of F j , n j is the inward normal to F j and `(n j ) the length of n j . The final optimal position P opt i is computed as a weighted average of all these optimal positions {P opt j } K j P i , the weight coe cients being the quality of K j . This way, an element of the ball is all the more dominant if its quality in the original mesh is bad. Finally, the new position is analyzed: if it improves the worst quality of the ball, the vertex is directly moved to its new position.

Edge/face swapping. The second mesh optimization tool to improve mesh quality is generalized swapping/local-reconnection. Let ↵ and be the two tetrahedra vertices opposite the common face P 1 P 2 P 3 . Face swapping consists of suppressing this face and creating the edge e = ↵ . In this case, the two original tetrahedra are deleted and three new tetrahedra are created. This swap is called 2 ! 3. The reverse operator can also be defined by deleting three tetrahedra sharing such a common edge ↵ and creating two new tetrahedra sharing face P 1 P 2 P 3 . This swap is called 3 ! 2.

A generalization of this operation exists and acts on shells of tetrahedra [Alauzet 2014a, Frey 2008]. For an internal edge e = ↵ , the shell of e is the set of tetrahedra having e as common edge. From a shell of size n, a non-planar pseudo-polygon formed by n vertices P 1 ...P n can be defined. Performing a three-dimensional swap of edge ↵ requires (i) suppressing edge ↵ and all tetrahedra of the shell, (ii) defining a triangulation of the pseudo-polygon P 1 ...P n and (iii) finally creating new tetrahedra by joining each triangle of the pseudo-polygon with vertices ↵ and . The number of possible triangulations depends on n the number of vertices of the pseudo-polygon. The di↵erent swaps are generally denoted n ! m where m is the number of new tetrahedra. In this work, edge swaps 3 ! 2, 4 ! 4, 5 ! 6, 6 ! 8 and 7 ! 10 have been implemented. In our algorithm, swaps are only performed if they improve the quality of the mesh.

Optimization procedure

The optimization procedure is made up of one or several passes of swapping and then one or several passes of smoothing. The number of passes is given by the user as input.

The time step t opt after which optimizations are performed is defined using a parameter named CF L geom . This parameter tells how many elements a mesh vertex is virtually crossing along his trajectory before optimizations become necessary to preserve the quality of the mesh. It is named from the CF L number, which controls the propagation of the information that can be accepted within one solver time step. In other words, the optimization stage is performed when the mesh "reaches a certain degree of deformation". The optimization time step is given by:

t opt = CF L geom max P i h(x i ) v(x i ) , (1.3)
where h(x i ) is the smallest height of all the elements in the ball of vertex P i , and v(x i ) is the speed of vertex P i . The swaps are performed according to an analysis of the quality of the elements at the current time and in the future. First, a list of tetrahedra whose current quality is bigger than a certain threshold Q swap is built. This list is then sorted in descending order of the current quality, so that the worst elements are on top of the list. Then the list is processed from top to bottom. For each element, and for each edge/face of the element, all the swaps in the corresponding shell of tetrahedra -among the swap operators implemented -are simulated, and the resulting qualities both at current time and in the future and configurations are analyzed: if they are smaller than a certain factor c swap times the quality of the current configuration, the configuration is stored temporarily, else it is discarded. Once all the possible swaps for one element have been simulated, if no new configuration has been stored, the mesh remains unchanged, and if one or several new configurations have been stored, the one with the best quality at current time is selected, and the swap is actually performed. The neighboring tetrahedra are then frozen for the remaining of the pass, and a new tetrahedron from the list is analyzed and swapped.

As concerns vertex smoothing, the vertices are processed in the order in which they are stored in memory. For each vertex, the current quality of its ball of tetrahedra is computed. If the maximal quality (i.e. worst quality) is below a certain threshold Q smoothing , nothing is done. Else, the optimal position of the vertex in its ball is computed, and the new maximal quality corresponding to the position is evaluated. If this maximal quality is below a certain factor c smoothing times the current maximal quality, then the vertex is moved to the optimal position and frozen for the rest of the pass. If the quality resulting from the optimal position is not satisfactory, other positions between the optimal position and the current position are tried. Note that if the resulting configuration is invalid, i.e a volume is negative, and the optimization is discarded.

Handling of boundaries

The mesh of the boundaries is moved rigidly, and the vertices are not usually moved on the surface (no displacement in the tangential directions). However, in some cases, such as when a body is moving very close to the bounding box of the domain, it can be useful to move the vertices of the bounding box as well. In this case, we can allow tangential displacement on the boundary. The risk of deforming a curved surface being too great, we only do this for planes aligned with the Cartesian frame. To do so, the displacements along the tangential axes are simply considered as new degrees of freedom. For instance, for a plane (x,y), the displacements along the x-axis and the y-axis are considered as degrees of freedom and are added to the elasticity system. The displacement along the z-axis is still set to 0, and thus is not added to the system.

Algorithm

The overall connectivity-change moving mesh algorithm is described in Algorithm 2, where the di↵erent phases described above are put together. When coupled with a flow solver (see Chapter 2), the flow solver is called after the optimization phase. In this algorithm, H stands for meshes, S for solutions, Q for quality (see Relation (1.2), d |@⌦ h for the displacement on the boundary, and v and a for speed and acceleration.

Choice of the di↵erent parameters for a robust algorithm

In the previous sections, several parameters have been mentioned. It must be stated that the success and robustness of the moving mesh algorithm is due to the choices made for these parameters. They were set experimentally, and several tests were run during this thesis to adjust them. smoothing is set to 0.99: the smoothing has to increase the quality of at least one percent, whereas c swap is set between 1.2 and 1.8 in 3D. This means that we allow swaps to degrade slightly the quality of one element, because this may help swapping other elements farther away. This is essential to the robustness of the algorithm in 3D, and forbidding any degradation leads to failure of the algorithm in many cases we tried. The side e↵ect is that some elements are swapped in areas far from the moving bodies, and keep uselessly swinging between two states throughout the simulation. To prevent this, we tried to prevent swaps if the velocity of the vertices of the elements is small compared to the maximal velocity (close to the moving bodies). However, the gain in terms of number of swaps was negligible.

k , S k , v, CF L (b) t = min( t opt , t solver ) (c) If t > t opt i. H k = Swaps optimization H k , Q swap target ii. v opt = Vertex smoothing ⇣ H k , Q smoothing target , Q max ⌘ iii. t opt = Get optimization time step H k , v, CF L geom iv. t opt = t + t opt (d) S k+1 = Solve Equation of State H k , S k , t, v, v opt (e) H k+1

Mesh deformation with Inverse Distance Weighted method

So far, we have considered solving a linear-elasticity-like PDE to compute the mesh deformation. Another big family of methods for that step is interpolation methods, either direct or indirect. These methods compute the displacement of the inner vertices as an algebraic interpolation function of the displacement of the boundary vertices, i.e. the volume displacement field is seen as some kind of average of the boundary displacement. The most widespread of these method is known as Radial Basis Functions [de Boer 2007]. But this is an implicit methods, which means that the coe cients of the interpolation function are found solving a linear system the size of the number of vertices. It can thus be time consuming. Explicit interpolation methods on the other hand directly build the interpolation function, but the interpolation functions must be designed with care to handle large displacement and avoid creating false elements.

We chose to add such a direct interpolation method in our code, and to compare it with the elasticity analogy. The method that we chose, the Inverse Distance Weighted (IDW) method, is described at length in [Luke 2012]. In the following, I will recall this method, then I will explain how we plugged the code implementing it into our own code.

IDW method

In the IDW method, the displacement of a volume vertex is computed as a weighted average of the displacements of the boundary vertices, the weight being the inverse of the distance between the volume point and the boundary ones. In other words, the closer a boundary vertex is to the considered volume vertex, the stronger is its influence on the displacement of the volume vertex.

The displacement field in the volume mesh is defined as:

d(r) = P w i (r)d i (r) P w i (r) , (1.4)
where r is the coordinate vector in the original mesh, d(r) is the displacement field, d i (r) is the nodal displacement field around boundary vertex i, and w i is a weight coe cient computed as explained below. In our case, the nodal displacement field around a boundary vertex is simply the di↵erence of the positions:

d i (r) = x i (t + t) x i (t) . (1.5)
It can take several forms, whether rigid or non rigid displacements of the geometries are considered. Due to the way the algorithm is written, in [Luke 2012], the field is decomposed into a rotation matrix and and a displacement vector:

d i (r) = M i r + b i r , (1.6)
where M i is a rotation matrix that is interpolated from the displacement of the neighboring boundary vertices, and b i is the displacement vector. In the case of a rigid body, M i is its rotation matrix and b i is the translation term. The weight corresponding to the ith boundary vertex is computed as a function of the inverse of the distance between the volume vertex and the boundary vertex:

w i (r) = A i ⇤ " ✓ L def kr r i k ◆ a + ✓ ↵L def kr r i k ◆ b # , (1.7)
where r i is the position of the boundary vertex, A i is the area around vertex i, L def is a reference length of the deformation domain, and a and b are given coe cients. We use a = 3 et b = 5 in 3D, and a = 2 et b = 4 in 2D. L def can be computed automatically, but in our case it is a parameter given by the user. The ↵ factor controls the relative weights of nearby surface vertices and farther ones, and is computed from a mean displacement:

d mean = N X i=1 a i ⇤ d i (r i ) , (1.8)
where a

i = A i P N j=1 A j
is the normalized weight of vertex i. ↵ is then written:

↵ = ⌘ L def N max i=1 kd i (r i ) d mean k . (1.9)
⌘ is usually set to 5, and ↵ must be greater than 0.1. Further discussion on the choice of the parameters can be found in [Luke 2012].

If the above method is implemented straightforwardly, it results in a quadratic algorithmor more precisely an algorithm O(n ⇤ m) where n is the number of volume vertices and m the number of boundary vertices. In 2D, the number of surface vertices is usually small enough for a naive algorithm to run quite fast. However in 3D, the number of boundary vertices is much larger, and the cost of the naive algorithm is prohibitive. Fortunately, the solution of the mesh deformation problem does not need to be very precise -which is even more true with our connectivity-change moving mesh algorithm -and thus approximations can be made that improve the e ciency of the method. More precisely, when computing the displacement of a volume vertex, the impact of boundary vertices far from it is limited, and thus their contribution can be simplified.

Based on that observation, a tree-code algorithm was proposed in [Luke 2012], similar to those used for the N-body problem. This is possible because the form of d(r) is similar to gravitational potentials. The principle of the algorithm is to build a tree of the boundary mesh, in the form of a KD-tree, where the leafs are the boundary vertices, and the nodes are groups of neighboring vertices, more or less large depending the depth in the tree. For each set of nodes, the partial sum is approximated by the sum of 4 optimal quad-points. For each volume point, this tree is then descended recursively: the farther the vertex is from a zone of the surface, the less we descend the tree and only the approximate contribution of a node is used. An error evaluation is used to decide when to stop descending the tree.

With this algorithm, the displacement of vertices close to boundaries is very close to the one given by the exact formulation, and the error is somewhat larger for points far from boundaries, where no precise displacement is necessary. Besides being much faster than the naive algorithm, this algorithm preserves the property of being easily parallelizable: once the tree is built, the computation of the displacement of one vertex is independent of the displacement of the other vertices, and they can thus be run in parallel.

Remark 2. Since the method described in [Luke 2012] is plugged into our algorithm, it is important to notice that our version has some di↵erences with the version described in [Luke 2012]. Notably, the deformation field d is computed between the beginning and the end of a mesh deformation step, while it is computed between the current time and the beginning of the simulation in [Luke 2012]. In our version, the parameter L def needs to be specified by the user. The parameters a, b and ⌘ are also specified by the user, although no major di↵erence has been observed when changing them. The impact of these values may appear when dealing with viscous boundary layer meshes.

The main advantages of this method are the easy parallelization, and the handling of boundary layers: there is no extra-cost to compute the displacement of thin boundary layer vertices, whereas to preserve the structure of the layers, the elasticity approach requires creating very small and rigid elements, resulting in very sti↵ and hard to solve FEM systems.

Implementation

An MPI code implementing the optimized IDW method was written at Mississippi State University by Prof. Ed. Luke and Eric Collins: gridMover, and they allowed us to use this code and plug it into our in-house code Wolf.

The code implements the method described in [Luke 2012] rather straightforwardly. Its input is a mesh and a displacement of its boundary, then it computes the weights and rotors for the boundary surface nodes, the reference length and the alpha factor. Then, the KD-tree of the surface mesh is built and filled. Finally, the displacement of the volume vertices is computed descending the tree. The code was parallelized using MPI: the KD-tree is built in parallel, then sent to all the processors, and the volume vertices are split into chunks, each chunk being run independantly on the available processors.

Chapter 1. Connectivity-change moving mesh strategy

The code was plugged into our code. Our goal was to adapt the method to fit as much as possible into our moving mesh algorithm, so we call the entire gridMover code instead of calling our elasticity solution routines. More precisely, everything is done as usual, including the computation of the displacement of the boundary mesh, except that instead of calling the routine that builds the elasticity system and solves it, we call the gridMover main routine: Algorithm 2 remains unchanged except that "elasticity system" is replaced by "IDW problem". To do so, several changes to gridMover were necessary. At the beginning of the gridMover code, we had to add a converter from Wolf data structures into gridMover structures. The way the boundary displacement is prescribed is modified too. To facilitate the compilation, the gridMover code is put in an independent Wolf module, and is compiled as an independent dynamic library, that is called from the core Wolf code. The main di culty is that gridMover is a MPI code, so Wolf had to be converted into an MPI code too. The choice that was made was to run most Wolf routines on one processor, which required a delicate handling of data structures

Examples

We now consider several examples of moving mesh simulations, and study the performance of our connectivity-change moving mesh algorithm, both with the elasticity-like and the IDW methods for the mesh deformation step. The next examples are purely moving mesh simulations and we will focus our analysis on mesh quality criteria. A comparison of the two methods for real ALE simulations will be provided in section 3.2.

In particular, we show that the moving mesh algorithm (MMA) applies successfully to rigid body with large shearing and deformable bodies. In this section, we only address the case of 3D.

Rigid-body examples

Rotation and translation case

The first example seems to be very simple, a cube is moved in translation and rotation in a box, but the strong rotation and acceleration of the cube makes it less easy than expected. The dimension of the box are 15 ⇥ 10 ⇥ 10, and the side of the cube is 1. The accelerated translation and rotation vectors are:

v = 0 B B @ 0.2 t 0 0.05 t 1 C C A and r = 0 B B @ 10 30 10 1 C C A .
The initial mesh has 40, 000 vertices and 220, 000 tetrahedra. The simulation is run until T end = 10. For both mesh deformation methods, 10 mesh deformation steps are set, i.e. t = 1, and we set CF L geom = 8. Both methods result in excellent quality meshes. Statistics can be found in Table 1.1. Images of the initial and final meshes can be found in Fig. 1.2. However, the IDW method has required significantly more mesh deformation steps than the elasticity-based method, respectively 20 and 10, due to automatic adjustment of the mesh deformation time step when the quality in the future becomes bad. Without these adjustments, the simulation cannot be run until the end, which highlights their importance in some cases. A comparison of the solutions of the mesh deformation problem, see Fig. 1.2 (middle), explains why more solutions of that problem are required with the IDW method. Indeed, the IDW method tends to only move vertices close to the moving body, whereas the elasticity makes more room for the cube ahead of it.

Interpenetrating cylinders

This example is a challenging academic test case with rigid bodies, and has been presented in [Alauzet 2014a]. Two cylinders interpenetrate each other and there is only one layer of elements between both cylinders, i.e. internal edges connect both cylinders. The geometry of the domain is shown in Fig. 1.3. To make this test case more complicated, we add rotation to the top cylinder:

✓ top = (0, 0, 5) , v top = (0, 0, 0.1) and ✓ bottom = (0, 0, 0) , v bottom = (0, 0, 0.1) .

The initial mesh is composed of 34, 567 vertices and 188, 847 tetrahedra. The simulation is run until T end = 100.

A shear layer appears between the two cylinders, that is only one element wide. Therefore, the swapping optimization has just a little of freedom to act. Moreover, it is obvious that too large t will lead to an invalid mesh: such a simulation requires a relatively large number of mesh deformation solutions. For both mesh deformation methods, 50 mesh deformation steps are set, i.e. t = 2, and we set CF L geom = 2.

The changing-connectivity MMA proves to be extremely robust in both cases, by keeping the mesh worst element quality below 100 and by ensuring a final excellent mean quality of 1.5. Because of the shearing, a large number of swaps -around 1 million -have been performed. For that test case, results with both mesh deformation methods are very similar. However, Fig. 1.4 (center) points out a major di↵erence between elasticity and IDW: elasticity creates rotational displacements in the mesh above and under the cylinder, that push vertices in front, attract vertices behind the moving inner cylinder, and thus move vertices to empty areas instead of crushing them, while the IDW method tends to produce straighter displacements. Table 1.2 provides a comparison of the MMA with the two mesh deformation methods.

Shuttle

The last rigid example is the Space Shuttle ejecting its two Solid Rocket Boosters (SRB) after burnout. SRBs separation occurs just after 2 min into the flight, at an altitude close to 50 km Figure 1.2: Accelerated cube test case. Initial mesh (top), mesh deformation solution at t = 8 (center) and final meshes (bottom), with the elasticity-based method (left) and the IDW method (right). and a Mach number above 4. The objective of such a numerical simulation is to understand the separation dynamics of the SRBs attached to the space shuttle, notably to know if the separating booster motor plume will hit the orbiter wind-shield.

The di culty of this example is the very complex geometry, see Fig. 1.5, and the large size of the mesh, since we consider an isotropic mesh with 996, 599 vertices and 5, 505, 036 tetrahedra. The two SRBs have a parabolic trajectory and they rotate at the same time. The movement of the SRBs together with meshes can be seen in Fig. 1.6.

The simulation is run until T end = 25 and t is set to 0.1. The density of the mesh in which the SRBs evolve is a lot greater at the beginning than at the end, so the CF L geom parameter # mesh deform. # optim. is changed throughout the simulation to speed it up:

Q mean end 1 < Q end < 2 Q worst overall #
CF L geom = 8 > > < > > : 5 if t < 3 10 if 3  t < 10 40 if t 10
.

Both methods preserve an excellent mesh quality throughout the simulation, and the final statistics for both are equivalent. 250 elasticity solutions were required by the IDW method, and 251 by the elasticity-based method: in the latter case, after the first elasticity solution, the expected future quality of the mesh moved with the prescribed displacement was too bad, so a new elasticity solution was computed for a smaller time step. This way to robustify the code proves its e ciency, since it costs only one elasticity solution and preserves the mesh quality. In both cases, the final average quality is 1.4 which is excellent, and around 4.5 millions of swaps were performed. The meshes and mesh deformation solutions at time t = 12 are shown in Fig. 1.7. The palette is the same in both cases, and we can see that the elasticity-based method moves vertices much farther away from the moving bodies than the IDW method. This results in smoothing the trail of the SRBs, while it is very visible above them with the IDW method.

# mesh deform. # optim. Q mean end 1 < Q end < 2 Q worst overall #
Both methods manage to preserve the layers of small elements close to the SRBs, which would be important in a physical computation context. Finally, in terms of CPU, where a di↵erence may be expected, the simulation time is equivalent in both cases, around 2 hours, with the elasticity code run serially and the IDW code run on 20 cores. The mesh deformation solution only accounts for a small part of the overall algorithm.

Figure 1.5: Shuttle test case. Geometry and surface mesh in initial state.

Deformable-body examples

Squeezing can

The next test case deals with deformable geometries. It represents a can which is squeezed.

The can is a cylinder of length 5 units and diameter 2 units inside a spherical domain of radius 10 units. The can is centered at the origin and is aligned along the z-axis. The simulation runs up to T end = 1 and the temporal deformation function is given by:

if |z(0)| < 2 then x(t) = 8 > > < > > : x(t) = x(0) y(t) = ↵ + (1 ↵)(1 t 2 ) y(0) z(t) = z(0) with ↵ = 1 2.2 ⇣ 1.2 cos ⇣ ⇡ 2 |z(0)| ⌘⌘ .
The can deformation is shown in Fig. 1.8 and 1.9. For this case, the moving mesh simulation is done for the inside and the outside meshes of the can geometry. The inside case mesh is composed of 7, 018 vertices and 36, 407 tetrahedra and the outside mesh contains 43, 631 vertices and 250, 152 tetrahedra. Two mesh deformation steps are initially prescribed for the outside case and four for the inside one. The other simulations parameters are exactly the same for both cases. CF L geom is fixed to 1. Statistics for both cases are given in Table 1.4. The outside mesh case is known to be problematic for spring-analogy methods because spring sti↵ness is proportional to the element size, i.e., the smaller an element is, the sti↵er it is. Therefore, when the can is squeezed, elements close to the can are elongated in one direction leading to a poor quality mesh for numerical simulation. No vertices come to fill the freed space. As illustrated in Fig. 1.8, the changing-connectivity MMA coupled with both mesh deformation methods behaves properly. In the case of the elasticity-based method, the elasticity solutions move vertices to fill the freed space. The same phenomenon can be observed with the IDW method. In fact, this test case presents no di culty: it is fast, few swaps are performed and the quality is very good. The elements of worst quality are connected to the squeezed can and are located where the can is crushed. If swaps were performed on the surface, their quality would be improved.

The inside mesh case is also successfully achieved, cf. Fig. 1.9 (bottom). We clearly see that the elasticity methods has moved vertices away from the squeezed region while keeping an excellent mesh quality, whereas the IDW tends to let them crush. For this case, the swap optimization are essential to preserve the quality of the mesh all along the movement. The mesh quality behavior for the inside case is similar to that for the outside one.

Bending beam

This test case has been proposed in [Luke 2012]. It is a general deformation test on a threedimensional bending beam. The beam is 8 units long, 2 units wide and 0.1 unit thick inside a spherical domain of radius 25 units. The beam is deformed such that the beam center-line is mapped onto a circular arc:

x(t) = 8 > > < > > : x(t) = (R z(0)) sin(✓) y(t) = y(0) z(t) = z(0) + (R z(0))(1 cos(✓)) with ✓ = x(0) R and R = R min + (R max R min ) e t e  1 e  .
where R min and R max are the radii of curvature at t = 0 and t = 1, respectively.  is a parameter that controls how rapidly the radius and center of curvature move from the initial to final values. For this test case, R min = 2, R max = 500 and  = 10. mesh deformation steps, the final mesh is excellent as shown in Table 1.5 and no skewed element appears inside the mesh. There again, we can see in Fig. 1.10 that the elasticity-based method tends to move points farther from the body than the IDW method, thus requiring significantly

Boundary layers for deformable geometries

Dealing with boundary layer (BL) meshes for rigid bodies is rather easy: the whole mesh layers are rigidified and moved together with the body. However, it is a lot more di cult with deformable bodies, since the mesh structured layers must both follow the deformation of the body and keep their structure. It was a priori not certain that the movement provided by the elasticity or IDW step would be precise enough to preserve that structure. In the sequel we demonstrate that both methods can move one thick layer with a good accuracy, and that such layers can also be moved correctly with the elasticity method.

One boundary layer

For this case, we consider the bending beam studied previously, to which we add one thin structured mesh layer of height a quarter of the height of the beam, see Fig. 1.11. The movement of the beam is the same and no swap or smoothing optimizations are done in the BL. At the end of the simulation, we observe in Fig. 1.11 that the structured aspect of the BL has been well preserved. In Table 1.6, we gather quality indicators depending on di↵erent moving mesh parameters. We consider the variation of the distance of the layer vertices to the body, that is expected to remain constant in ideal cases. We can see that taking acceleration into account in the trajectories is very important: indeed, as the movement of the beam is accelerated, the layer under the beam tends to thicken while the layer above it tends to be crushed. We can also see that less IDW steps are required to reach an equivalent mean quality, but the maximal distance variation is less good. This result is very promising, because the structured aspect of the BL mesh is well preserved. This lets us consider a clever strategy to move BL meshes with deformable geometries.

Several boundary layers

The elasticity mesh deformation method is also actually capable of moving several thinner BL, provided the mesh deformation time step is small enough to handle the displacement of the smallest elements against the body. The simulation was run with a boundary layer containing 10 thin layers (the smallest height is 0.0017 units): the structure inside the layer is still well preserved all along the movement, and the quality of the layer looks good even at the end of the deformation of the beam. Close-ups on the BL meshes are show in Fig. 1.12. We were not able to move these layers with the IDW mesh deformation, which needs to be further investigated.

Large volume variations

So far, we have only dealt with the case of moving geometries with no or small volume variation. In these case, we have demonstrated that our moving mesh algorithm preserves the quality of the mesh without vertex addition, and in particular preserves the size of the elements. However, in the case of large volume variation, the deformation of the mesh is going to result in large variation of the sizes of the elements: if the volume is greatly increased, some of the elements (at least) are going to have a volume that increases greatly too. This is illustrated in Fig. 1.13, where a tube is expanded by a factor 7: in one case, only the vertices of the side of the tube are moved, in the other case, all the vertices inside the tube are moved proportionally to their initial coordinates. In both cases, part or all of the elements are stretched a lot. In some cases, it might not be a problem (if the accuracy required in the expanding areas is low), but if we want to preserve a certain element size throughout the simulation, some specific strategies need to be considered.

Figure 1.13: Tube in expansion. Top, the initial mesh. Center and bottom, meshes moved, respectively moving only one side of the tube, and moving all the vertices proportionally to their coordinates.

The obvious choice is to mesh the expanding domain with very small elements at the beginning of the simulation, so that they reach the desired size once expanded. However, several issues arise from this simplistic strategy. The first one is that the size of the elements can be very small at the beginning of the simulation if the volume is to vary greatly. This is a problem from the solver point of view, since smaller elements usually require smaller time steps, which may slow the solver down a lot if the elements are too small. The second question is: if the elements do not expand uniformly, what is the optimal size they should be given at the beginning to reach to desired size at the end ? And finally, this strategy is only possible if the displacement of the boundaries is know in advance. In the case of a FSI simulation, where the displacement is a priori an unknown of the problem, we cannot predict the volume variation and thus the size of the elements required.

For a better result, the problem has to be seen as a mesh adaptation problem: given a metric at a certain time of the simulation, and given a displacement of the mesh vertices to this time, what should the metric at the beginning of the simulation be, so that the mesh is adapted at time t ? This question will be addressed at length in Part II of this thesis. In what follows, we expose a moving mesh strategy for large volume deformation on one example. This strategy does not use the formalism of metric based mesh adaptation, but it answers to the problematic of controlling the sizes of the mesh throughout the deformation.

Engine piston

An example of such large volume variation simulation is the case of an engine piston. This test case was provided by IFP Energies nouvelles.

The geometry is represented in Fig. 1.14, with the piston in compressed and expanded positions. The piston is a cylindrical chamber whose bottom end can translate downward. The top of the chamber is closed by a mechanical piece with pipes and valves, forming on the left (x < 0) the admission system and on the right (x > 0) the exhaust system.

Definition of the geometry displacement

The displacement is given a priori for each moving boundary. There are three di↵erent displacements: for the piston itself, for the admission valves and for the exhaust valves. The displacement is given as a function of the angle of crank, a given rotation speed allowing to convert times into angles. The initial angle is 2 . Note that, as the displacement of the geometry was prescribed, there seems to be a slight shifting between the valves and the piston.

The height z piston of the bottom side of the piston is given by: h = 0.5 S sin(✓)

s = p C 2 h 2 z = 0.5 S cos(✓) + s + 0.5 S C z piston = z S + z 0 , (1.10)
where ✓ is the crank angle in radians, S = 83.5mm is the stroke, C = 144mm is the connecting rod length and z piston is the actual height of the piston. z 0 = 0.032305 is a constant used to ensure the consistency between the given geometry and the formulas. All the lengths are given in millimeters.

The position of the valves on their axis is tabulated, the tables being provided by IFPEN. The position at a time t is then interpolated linearly between the two closest tabulated values. Since the axis of the valves was not provided, it had to be computed numerically. Note that the movement is periodic, but is not perfectly synchronous as for real engines.

We consider a four-stroke engine, so a full engine cycle corresponds to a 720 crank angle run: the piston is fully expanded and compressed twice, while the admission and exhaust valves are opened and closed once for each pair: first the admission valves open to let gas in while the piston is expanded, then the valves are closed, the piston is compressed, when the piston is compressed an explosion makes it expand itself once more, and then the exhaust valves open to let the gas out.

Note that, in the three cases, a rigid displacement is given for the bottom of the object, but this object is connected to a fixed boundary, and no information is given for the displacement of these points. To avoid having expanding elements only at the junction, each moving body is divided into a rigid body and a deformable body: the bottom wall of the piston and its side wall, the bottom part of the valves and their rods, as shown in Fig. 1.15. The rigid parts are moved with the prescribed rigid displacement, whereas we impose a movement to the deformable bodies that is proportional to the distance to the fixed boundary.

!"#$%&'()"* ($!+",* %+-+!* ($!+",*

Moving mesh strategy

The moving mesh strategy must be able to handle two aspects: the rigid movement of the valves into the piston, that creates a lot of shearing of the mesh, and the expansion of the piston that results in largely stretched elements. To handle the displacement of the valves, the connectivity-change moving mesh algorithm is very e cient, and preserves the quality of the mesh around the valves. However, as discussed above, it is not enough to handle the large volume variation. To avoid creating too large elements (when the piston is expanded) or too small elements (when the piston is compressed), we have chosen to cut the simulation interval into smaller sub-intervals, where we can more easily control the sizes of the elements. Since the displacement of the piston is non linear, cutting into sub-interval of the same size would not be e cient, so we cut into sub-intervals such that the volume variation is the same. More precisely, on each sub-interval, the volume is at most multiplied or divided by two. To be more generic, the code computes the initial domain volume and the volume variation and exits when it reaches 2 or 1 2 with respect to the initial volume, or when a change in the volume variation is detected. The piston is then remeshed to control the sizes of the elements. The first idea was to remesh with the initial size h (that is considered as the best for this mesh). However, this would double or be reduced by half the size of the elements by the end of the sub-interval.

Chapter 1. Connectivity-change moving mesh strategy

To stay closer to the "best" size, we remesh prescribing a size of h p 2 or p 2h (depending on whether the volume is increasing or decreasing). This way, the sizes of the elements within a sub-interval are expected to stay in the interval

h h p 2 , p 2h
i that is around h.

Some gradation can be added in the volume, to have bigger elements at the center of the chamber. In this case, there is no physical simulation coupled to the moving mesh, so we have to invent an acceptable metric. If a real simulation were run, the metric would be derived from the solution, as explained in Part II.

The volume meshes at di↵erent times are showed in Fig. 1.16. One can see that, unlike in Fig. 1.14, the volume of the piston is meshed with regular elements all the time. The remeshings at chosen times avoid the elements to be too stretched, as can be seen in Fig. 1.17, where the mesh at the beginning and at the end of a sub-interval without remeshing is shown. 0, 13, 25, 37, 50, 62, 75, 88 and 100. Figure 1.17: Engine piston. Volume mesh at the beginning and at the end of a sub-interval (t = 14 and 21), i.e. just after (left) and just before (right) a remeshing.

Conclusion

In this chapter, the connectivity-change moving mesh algorithm used and improved during this thesis was presented. It is based on an elasticity-like mesh deformation step performed for a large time step and mesh optimization, in particular swaps, performed in between to preserve the mesh quality without ever remeshing. A new method to compute the mesh deformation solution was considered, the IDW method. It is a direct interpolation method, in which the movement of inner vertices is computed as a weighted average of the movement of the boundaries. An MPI code implementing this method was plugged into our moving mesh code. A comparison of the two methods was performed on several 3D examples, that demonstrates the e ciency and the robustness of the moving mesh algorithm with both methods. The main di↵erence lies in the fact that the elasticity-like method moves vertices farther away from the moving bodies, which facilitates the movement in the case of sharp shearing, while the IDW method is very rigid around the moving bodies, facilitating the translation of small details. If small di↵erences appear depending on the cases, both methods eventually result in high quality meshes. Finally, the case of boundary layer meshes and of large volume variations was considered, opening the way for specific moving mesh approaches for these cases.

Chapter 2

ALE solver

An Arbitrary Lagrangian Eulerian (ALE) flow solver has been coupled to the moving mesh process described in Algorithm 2 Section 1.1. In this chapter, we discuss in detail the implemented solver, and all the choices that were made from the numerous possibilities available in the literature.

The conventions adopted, notably for the normals, are recalled at the beginning of this thesis (page 3).

The works presented in this Chapter were published in [Barral 2014a].

Euler equations in the ALE framework

We consider the compressible Euler equations for a Newtonian fluid in their ALE formulation. The ALE formulation allows the equations to take arbitrary motion of the mesh into account. Assuming that the gas is perfect, inviscid and that there is no thermal di↵usion, the ALE formulation of the equations is written, for any arbitrary closed volume C(t) of boundary @C(t) moved with mesh velocity w:

d dt Z C(t) Wdx ! + Z @C(t) (F(W) W ⌦ w) • n ds = Z C(t) F ext dx () d dt Z C(t) Wdx ! + Z @C(t) (F (W) W(w • n)) ds = Z C(t) F ext dx , (2.1)
where

8 > > > > < > > > > :
W = (⇢, ⇢u, ⇢e) T is the conservative variables vector

F(W) = (⇢u, ⇢u x u + pe x , ⇢u y u + pe y , ⇢u z u + pe z , ⇢uh) is the flux tensor F (W) = F(W) • n = (⇢⌘, ⇢u x ⌘ + pn x , ⇢u y ⌘ + pn y , ⇢u z ⌘ + pn z , ⇢e⌘ + p⌘) T F ext = (0, ⇢ f ext , ⇢u • f ext )
T is the contribution of the external forces, and we have noted ⇢ the density of the fluid, p the pressure, u = (u x , u y , u z ) its Eulerian velocity, ⌘ = u • n , q = kuk, " the internal energy per unit mass, e = 1/2 q 2 + " the total energy per unit mass, h = e + p/⇢ the enthalpy per unit mass of the flow, f ext the resultant of the volumic external forces applied on the particle and n the outward normal to interface @C(t) of C(t).

Spatial discretization

As regards spatial discretization of the solver, we use an edge-based finite-volume approach, with an HLLC Riemann approximate solver and second-order MUSCL gradient reconstruction.

The main di↵erence when translating these schemes from the standard formulation to the ALE formulation is the addition of the mesh velocities in the wave speeds of the Riemann problem.

Edge-based Finite-Volume solver

The domain ⌦ is discretized by a tetrahedral unstructured mesh H. The vertex-centered Finite Volume formulation consists in associating a control volume denoted C i (t) with each vertex P i of the mesh and at each time t. The dual Finite Volume cell mesh is built by the rule of medians. The common boundary @C ij (t) = @C i (t) \ @C j (t) between two neighboring cells C i (t) and C j (t) is decomposed into several triangular interface facets. The normal flux F ij (t) along each cell interface is taken to be constant (not in time but in space), just like the solution W ij on the interface. Rewriting System (2.1) for C(t) = C i (t), we get the following semi-discretization at

P i : d dt (|C i (t)|W i (t)) + X P j 2V i |@C ij (t)| ij (W i (t), W j (t), n ij (t), ij (t)) = 0 , (2.2) • W i (t) is the mean value of state W in cell C i at time t • V
i is the set of all neighboring vertices of P i , i.e. the mesh vertices connected connected to P i by an edge

• n ij is the outward normalized normal (with respect to cell C i ) of cell interface @C ij • F ij (t) = F(W ij (t)) • n ij (t) is an approximation of the physical flux through @C ij (t) 1 • ij (t) = 1 |@C ij (t)| Z @C ij (t) w ij (t) • n ij (t)ds is the normal velocity of cell interface @C ij (t) • ij (W i (t), W j (t), n ij (t), ij (t)) ⇡ F ij (t) W ij (t) ij (t)
is the numerical flux function used to approximate the flux at cell interface @C ij (t). The computation of the convective fluxes is performed mono-dimensionally in the direction normal to each Finite Volume cell interface. Consequently, the numerical evaluation of the flux function ij at interface @C ij can be achieved by solving, at each time step, a one-dimensional Riemann problem in direction n ij = n with initial values W L = W i on the left of the interface and W R = W j on the right. The normal speed to the interface is temporarily noted for clarity.

HLLC numerical flux

The methodology provided by Batten [Batten 1997] can be extended to the Euler equations in their ALE formulation. The HLLC flux is then described by three waves phase velocities:

S L = min(⌘ L c L , ⌘ c) and S R = max(⌘ R + c R , ⌘ + c) S M = ⇢ R ⌘ R (S R ⌘ R ) ⇢ L ⌘ L (S L ⌘ L ) + p L p R ⇢ R (S R ⌘ R ) ⇢ L (S L ⌘ L )
and two approximate states:

W ⇤ L = 8 > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > : ⇢ ⇤ L = ⇢L SL ⌘L SL SM p ⇤ L = p ⇤ = ⇢L (⌘L SL) (⌘L SM ) + pL (⇢u) ⇤ L = (SL ⌘L) ⇢u L + (p ⇤ pL) n SL SM (⇢e) ⇤ L = (SL ⌘L) ⇢e L pL⌘L + p ⇤ SM SL SM , W ⇤ R = 8 > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > : ⇢ ⇤ R = ⇢R SR ⌘R SR SM p ⇤ R = p ⇤ = ⇢R (⌘R SR) (⌘R SM ) + pR (⇢u) ⇤ R = (SR ⌘R) ⇢u R + (p ⇤ pR) n SR SM (⇢e) ⇤ R = (SR ⌘R) ⇢e R pR⌘R + p ⇤ SM SR SM ,
where ⌘ = u • n is the interface normal velocity and . are Roe average variables [Roe 1981]. The HLLC flux through the interface is finally given by:

HLLC (W L , W R , n, ) = 8 > > > > < > > > > : F L W L if S L > 0 F ⇤ L W ⇤ L if S L  0 < S M F ⇤ R W ⇤ R if S M  0  S R F R W R if S R < 0 .
The HLLC approximate Riemann solver has the following properties. It automatically: (i) satisfies the entropy inequality, (ii) resolves isolated contacts exactly, (iii) resolves isolated shocks exactly and (iv) preserves positivity.

High-order scheme

The previous formulation reaches at best a first-order spatial accuracy. A MUSCL type reconstruction method has been designed to increase the order of accuracy of the scheme. The idea is to use extrapolated values U ij and U ji of U at interface @C ij to evaluate the flux, where U = (⇢, u, p) is the vector of physical variables. The following approximation is performed:

ij = (U ij , U ji , n ij , ij )
with U ij and U ji linearly interpolated state values on each side of the interface:

U ij = U i + 1 2 (rU) ij • P i P j , and
U ji = U j + 1 2 (rU) ji • P i P j . (2.3)
In contrast to the original MUSCL approach, the approximate "slopes" (rU) ij and (rU) ji are defined for each edge using a combination of centered, upwind and nodal gradients. The centered gradient related to edge P i P j , is defined implicitly along edge

P i P j via relation: (rU) C ij • P i P j = U j U i .
(2.4) Upwind and downwind gradients, which are also related to edge P i P j , are computed using the upstream and downstream tetrahedra associated with this edge. These tetrahedra are respectively denoted K ij and K ji . K ij is the unique tetrahedron of the ball of P i (resp. P j ) whose opposite face is crossed by the straight line prolongating edge P i P j , see Figure 2.1. Upwind and downwind gradients of edge P i P j are then defined as:

(rU) U ij = (rU) | K ij and (rU) D ij = (rU) | K ji , where rU | K = X P 2K (r P ⇥ U P )
is the P 1 -Galerkin gradient on element K, P is the basis function associated with P and ⇥ is the Hadamard product (term-by-term product). Parametrized nodal gradients are built by introducing the -scheme:

rU ij • P i P j = (1 ) (rU) C ij • P i P j + (rU) U ij • P i P j , rU ji • P i P j = (1 ) (rU) C ij • P i P j + (rU) D ij • P i P j ,
where 2 [0, 1] is a parameter controlling the amount of upwinding. For instance, the scheme is centered for = 0 and fully upwind for = 1.

M j M i P i P j K ij K ji Figure 2.1: Downstream K ij and upstream K ji tetrahedra associated with edge P i P j .
The most accurate -scheme is obtained for = 1/3, also called the V4-scheme. This scheme is third-order for the two-dimensional linear advection problem on structured triangular meshes [Debiez 2000]. In our case, for the non-linear Euler equations on unstructured meshes, a second-order scheme with a fourth-order numerical dissipation is obtained. The high-order gradients are given by:

(rU) V 4 ij • P i P j = 2 3 (rU) C ij • P i P j + 1 3 (rU) U ij • P i P j , (rU) V 4 ji • P i P j = 2 3 (rU) C ij • P i P j + 1 3 (rU) D ij • P i P j .

Limiter

The previous MUSCL schemes are not monotone. Therefore, limiting functions must be coupled with the previous high-order gradient evaluations to guarantee the Total-Variation-Diminishing (TVD) property of the scheme. To this end, the gradient of Relation (2.3) is replaced by a limited gradient denoted rU lim ij . Here, the three-entry limiter introduced by Dervieux [Cournède 2006], which is a generalization of the SuperBee limiter, will be used :

⇣ rU lim ⌘ ij • P i P j = L ⇣ rU D ij • P i P j , rU C ij • P i P j , rU V 4 ij • P i P j ⌘ with: L (a, b, c) = ( 0 i f ab  0 sign(a) min(2 |a|, 2 |b|, |c|) otherwise .

Boundary conditions

Boundary conditions are computed vertex-wise. Several types of boundary conditions are considered, but only one, the slipping condition, is applied to moving bodies.

Slipping condition

The ALE slipping boundary flux of vertex P i reads:

slip (W i , n i , i ) = 0 B B @ 0 p i n i p i i 1 C C A |@C i | , (2.5)
where p i is the vertex pressure, n i =

P K j P i |K j |n K j P K j P i |K j | is the mean outward normal of the boundary interface, |@C i | = P K j P i 1 3 |K j |
is the interface area and i is the boundary interface celerity, see Section 2.3.5.

Symmetry condition

The flux for symmetry boundary conditions is the same as for the slipping condition.

Free-stream condition

An inflow/external flow condition is also used, to model a flow coming from an infinite known state W 1 . An upwind Steger-Warning [Steger 1981] flux is used:

free-stream (W i , n i ) = A + (W i , n i )W i + A (W i , n i )W 1 , (2.6)
where

A + = |A|+A 2 and A = |A| A 2
and A is the Jacobian matrix A = @F W .

Transmitting condition

For this boundary condition we assume that the state behind the boundary is the same as the one inside. Therefore, the flux through the boundary is given by:

transmitting (W i , n i ) = HLLC (W i , W i , n i ) .
(2.7)

Time discretization

Temporal discretization is a more complex matter, as there is no consensus on some key aspects.

We chose an explicit time discretization, which is simpler than implicit discretizations, and seems more natural when dealing with FSI simulations. The most controversial subject is the Geometrical Conservation Law, whose application is a matter of debate, but which can be used to rigorously determine when the geometrical parameters that appear in the fluxes should be computed.

The Geometric Conservation Law

We need to make sure that the movement of the mesh is not responsible for any artificial alteration of the physical phenomena involved, or at least, to make our best from a numerical point of view for the mesh movement to introduce an error of the same order as the one introduced by the numerical scheme. If System (2.1) is written for a constant state, assuming F ext = 0, we get, for any arbitrary closed volume C = C(t):

d (|C(t)|) dt Z @C(t) (w • n) ds = 0 . (2.8)
As the constant state is a solution of the Euler equations, if boundaries transmit the flux towards the outside as it comes, we find a purely geometrical relation inherent to the continuous problem.

For any arbitrary closed volume C = C(t) of boundary @C(t), this relation is integrated into:

|C(t + t)| |C(t)| = Z t+ t t Z @C(t) (w • n) dsdt, with t and t + t 2 [0, T ] , (2.9)
which is usually known as the Geometric Conservation Law (GCL). From a geometric point of view, this relation states that the algebraic variation of the volume of C between two instants equals the algebraic volume swept by its boundary. The role of the GCL is still controversial, and many papers have tried to analyze its role in ALE simulations. Should Relation (2.8) be satisfied at the discrete level? What are the e↵ects of respecting this law at a discrete level on the consistency, stability and accuracy of the numerical scheme? How can it be enforced at a discrete level? A recent review on the subject can be found in [Etienne 2009]. It has been shown that the GCL is neither a necessary nor a su cient condition to preserve time accuracy, however violating it can lead to numerical oscillation [Mavriplis 2006]. In [START_REF] Farhat | [END_REF]] the authors show that compliance with the GCL guarantees an accuracy of at least the first order in some conditions. Therefore, most would agree that the GCL should be enforced at the discrete level for a large majority of cases.

Discrete GCL enforcement

A new approach to enforcing the Discrete GCL was proposed in [Mavriplis 2006, Yang 2005[START_REF][END_REF]], in which the authors proposed a framework to build ALE high order temporal schemes that reach approximately the design order of accuracy. The originality of this approach consists in precisely defining which ALE parameters are true degrees of freedom and which are not. In contrast to other approaches [Koobus 1999, Lesoinne 1996, Nkonga 2000], they consider that the times and configurations at which the fluxes are evaluated do not constitute a new degree of freedom to be set thanks to the ALE scheme. To maintain the design accuracy of the fixed-mesh temporal integration, the moment at which the geometric parameters, such as the cells' interfaces' normals or the upwind/downwind tetrahedra must be computed, is entirely determined by the intermediate configurations involved in the temporal scheme chosen. The only degree of freedom to be set by enforcing the GCL at the discrete level is . Incidentally, it is implicitly stated that w is never involved alone but only hidden in the term knk which represents the instantaneous algebraic volume swept.

In practical terms, the interfaces normal speeds are found by simply rewriting the scheme for a constant discrete solution, which leads to a small linear system that is easily invertible by hand. This procedure is detailed in the next section for one Runge-Kutta scheme. Any fixed-mesh explicit RK scheme can be extended to the case of moving meshes thanks to this methodology, and the resulting RK scheme is naturally DGCL. Even if this has not been proven theoretically, the expected temporal order of convergence has also been observed numerically for several schemes designed using this method [Yang 2005].

RK schemes

Runge-Kutta (RK) methods are famous multi-stage methods to integrate ODEs. In the numerical solution of hyperbolic PDEs, notably the Euler equations, the favorite schemes among the huge family of Runge-Kutta schemes are those satisfying the Strong Stability Preserving (SSP) property. A Runge-Kutta scheme is said to be SSP if [Shu 1988, Spiteri 2002].

|W n+1 |  |W n |, | • | being a chosen semi-norm
In what follows, we denote by SSPRK(S,P ) the S-stage RK scheme of order P . We adopt the following notations: Superscript notation X s indicates that the quantity considered is the X obtained at stage s of the Runge-Kutta process. For instance, C s i is the cell associated with vertex P i when the mesh has been moved to its s th Runge-Kutta configuration. Coe cients (c s ) 0sS indicate the relative position in time of the current Runge-Kutta configuration: t s = t n + c s ⌧ with ⌧ = t n+1 t n . Finally, we denote by A s ij the volume swept by the interface around edge e ij of cell C i between the initial Runge-Kutta configuration and the s th configuration.

f s i = n i X j=1 (W s i , W s j , ⌘ s ij , s ij ) with 8 > > > > > > > > > > < > > > > > > > > > > :

Application to the SSPRK(4,3) scheme

This approach was used, for example, to build the 3rd order 4-step Runge-Kutta scheme [Olivier 2011b], whose Butcher and Shu-Osher representations are given below:

Butcher representation Shu-Osher representation t s = t n + c s ⌧ Y i 0 = Y i n Y i 0 = Y i n c 0 = 0, t 0 = t n Y i 1 = Y i 0 + ⌧ 2 f 0 i Y i 1 = Y i 0 + ⌧ 2 f 0 i c 1 = 1 2 , t 1 = t n + 1 2 ⌧ Y i 2 = Y i 0 + ⌧ 2 f 0 i + f 1 i Y i 2 = Y i 1 + ⌧ 2 f 1 i c 2 = 1, t 2 = t n+1 Y i 3 = Y i 0 + ⌧ 6 f 0 i + f 1 i + f 2 i Y i 3 = 2 3 Y i 0 + 1 3 Y i 2 + ⌧ 6 f 2 i c 3 = 1 2 , t 3 = t n + 1 2 ⌧ Y i 4 = Y i 0 + ⌧ 2 ✓ 1 3 f 0 i + 1 3 f 1 i + 1 3 f 2 i + f 3 i ◆ Y i 4 = Y i 3 + ⌧ 2 f 3 i c 4 = 1, t 4 = t n+1
For this scheme to be DGCL, it must preserve a constant solution W i = W 0 , as stated in Section 2.3.1. In this specific case, our conservative variable is Y i = |C i |W 0 and the purely physical fluxes vanish, leading to

f s i = W 0 n i P j=1 ⌘ s ij s ij .
Therefore, the scheme reads:

|C 0 i | = |C n i | |C 1 i | |C 0 i | = ni X j=1 A 1 ij = ⌧ 2 ni X j=1 ⌘ 0 ij 0 ij |C 2 i | |C 0 i | = ni X j=1 A 2 ij = ⌧ 2 ni X j=1 ⌘ 0 ij 0 ij + ⌘ 1 ij 1 ij |C 3 i | |C 0 i | = ni X j=1 A 3 ij = ⌧ 6 ni X j=1 ⌘ 0 ij 0 ij + ⌘ 1 ij 1 ij + ⌘ 2 ij 2 ij |C 4 i | |C 0 i | = ni X j=1 A 4 ij = ⌧ 2 ni X j=1 ✓ 1 3 ⌘ 0 ij 0 ij + 1 3 ⌘ 1 ij 1 ij + 1 3 ⌘ 2 ij 2 ij + ⌘ 3 ij 3 ij ◆ ,
where A s ij is the volume swept by the interface around edge e ij of cell C i between the initial and the s th Runge-Kutta configuration. A natural necessary condition for the above relations to be satisfied is to have, for each interface around edge e ij of each Finite Volume cell C i :

0 B B B B @ A 1 ij A 2 ij A 3 ij A 4 ij 1 C C C C A = ⌧ 0 B B B B @ 1 2 0 0 0 1 2 1 2 0 0 1 6 1 6 1 6 0 1 6 1 6 1 6 1 2 1 C C C C A 0 B B B B @ ⌘ 0 ij 0 ij ⌘ 1 ij 1 ij ⌘ 2 ij 2 ij ⌘ 3 ij 3 ij 1 C C C C A , 0 B B B B @ ⌘ 0 ij 0 ij ⌘ 1 ij 1 ij ⌘ 2 ij 2 ij ⌘ 3 ij 3 ij 1 C C C C A = 1 ⌧ 0 B B B B @ 2 0 0 0 2 2 0 0 0 2 6 0 0 0 2 2 1 C C C C A 0 B B B B @ A 1 ij A 2 ij A 3 ij A 4 ij 1 C C C C A .
(2.10)

Therefore, the normal speed of the interface around edge e ij of cell C i must be updated in the Runge-Kutta process as follows :

0 ij = 2A 1 ij ⌧ ⌘ 0 ij , 1 ij = 2A 1 ij + 2A 2 ij ⌧ ⌘ 1 ij , 2 ij = 2A 2 ij + 6A 3 ij ⌧ ⌘ 2 ij , 3 ij = 2A 3 ij + 2A 4 ij ⌧ ⌘ 3 ij , (2.11)
and the ⌘ s ij and A s ij are computed on the mesh once it has been moved to the s th Runge-Kutta configuration.

Practical computation of the volumes swept

In this section, we detail how the volumes swept by the cells' interfaces are computed. The calculations are only presented in 3D, 2D formulas in our formalism can be found in [Olivier 2011a].

Normal of a moving triangle

The volume swept by a triangle T between two timesteps t 1 and t 2 is approximated by the volume for a constant straightline displacement, as proposed in [START_REF] Nkonga | [END_REF]]:

A = (t 2 t 1 ) w ⌘ , (2.12)
where w is the speed of the center of gravity of the triangle, and ⌘ is an averaged outward pseudo normal:

⌘ = Z t 2 t 1 Z T n(t)d⇠dt , (2.13)
where n is the outward normal of the triangle.

If one writes N (x, y) = 1 2 (x P 0 ^yP 1 + x P 1 ^yP 2 + x P 2 ^yP 0 ) where x and y are two vector fields and P 0 , P 1 , P 2 are the vertices of triangle T , the pseudo-normal is written:

⌘2 (T ) = 1 6 2N x(t 2 ), x(t 2 ) + N x(t 2 ), x(t 1 ) + N x(t 1 ), x(t 2 ) + 2N x(t 1 ), x(t 1 ) ,
(2.14) where x1 and x2 are the coordinate fields at times t 1 and t 2 . Thus,

⌘2 (T ) = 1 12 ⇥ 2(P 2 0 ^P2 1 + P 2 1 ^P2 2 + P 2 2 ^P2 0 ) + (P 2 0 ^P1 1 + P 2 1 ^P1 2 + P 2 2 ^P1 0 ) + (P 1 0 ^P2 1 + P 1 1 ^P2 2 + P 1 2 ^P2 0 ) + 2(P 1 0 ^P1 1 + P 1 1 ^P1 2 + P 1 2 ^P1 0 ) ⇤ ,
thus, opening the cross products in P 0 :

⌘2 (T ) = 1 12 h 2(P 2 0 ^(P 2 0 + P 2 0 P 2 1 ) + (P 2 0 + P 2 0 P 2 1 ) ^(P 2 0 + P 2 0 P 2 2 ) +(P 2 0 + P 2 0 P 2 2 ) ^P2 0 ) + (P 2 0 ^(P 1 0 + P 1 0 P 1 1 ) + (P 2 0 + P 2 0 P 2 1 ) ^(P 1 0 + P 1 0 P 1 2 ) +(P 2 0 + P 2 0 P 2 2 ) ^P1 0 ) + (P 1 0 ^(P 2 0 + P 2 0 P 2 1 ) + (P 1 0 + P 1 0 P 1 1 ) ^(P 2 0 + P 2 0 P 2 2 ) +(P 1 0 + P 1 0 P 1 2 ) ^P2 0 ) + 2(P 1 0 ^(P 1 0 + P 1 0 P 1 1 ) + (P 1 0 + P 1 0 P 1 1 ) ^(P 1 0 + P 1 0 P 1 2 ) +(P 1 0 + P 1 0 P 1 2 ) ^P1 0 ) i , thus: ⌘2 (T ) = 1 12 h 2(P 2 0 ^P2 0 P 2 1 + P 2 0 ^P2 0 P 2 2 + P 2 0 P 2 1 ^P2 0 + P 2 0 P 2 1 ^P2 0 P 2 2 +P 2 0 P 2 2 ^P2 0 ) + (3P 2 0 ^P1 0 + P 2 0 ^P1 0 P 1 1 + P 2 0 ^P1 0 P 1 2 + P 2 0 P 2 1 ^P1 0 +P 2 0 P 2 1 ^P1 0 P 1 2 + P 2 0 P 2 2 ^P1 0 ) + (3P 1 0 ^P2 0 + P 1 0 ^P2 0 P 2 1 + P 1 0 ^P2 0 P 2 2 + P 1 0 P 1 1 ^P2 0 +P 1 0 P 1 1 ^P2 0 P 2 2 + P 1 0 P 1 2 ^P2 0 ) + 2(P 1 0 ^P1 0 P 1 1 + P 1 0 ^P1 0 P 1 2 + P 1 0 P 1 1 ^P1 0 + P 1 0 P 1 1 ^P1 0 P 1 2 +P 1 0 P 1 2 ^P1 0 ) i .
All simplifications done,

⌘2 (T ) = 1 12 2P 2 0 P 2 1 ^P2 0 P 2 2 + 2P 1 0 P 1 1 ^P1 0 P 1 2 + P 2 0 P 2 1 ^P1 0 P 1 2 + P 1 0 P 1 1 ^P2 0 P 2 2 . (2.15)
Let us now use this result to compute the volumes swept by cells' interfaces, made up of several triangles.

Volume swept by inner interfaces

The interface of a finite volume cell is made up of several triangles, connecting the middle of an edge to the center of gravity of a face and the center of gravity of that tetrahedron, see Figure 2.2. The two triangles of the interface sharing one edge within a tetrahedron are coplanar (i.e. the middle of an edge, the center of gravity of the two faces neighboring this edge and the center of gravity of tetrahedron are coplanar). The union of these two triangles is called the facet associated to the edge and the tetrahedron. At configuration t s = t 0 + c s ⌧ , (with t 0 = t n ), the outward non-normalized normal ⌘ s ij and the volume swept A s ij are computed as described in [START_REF] Nkonga | [END_REF]]. As the cell interface is made up of several facets, the total swept volume is the sum of the volumes swept by each facet.

P 0 P 2 P 1 I 01 I 02 I 03 M 1 M 2 M 3 G P 0 P 1 P 2 G M 1 M 2 M 0 G 02 G 01 G 10 G 12 G 20 G 21 boundary triangle K T 02 T 01 T 10 T 12 T 21 T 20 I 2 I 0 I 1
Let us assume that the facet considered is associated with edge e ij = P i P j and belongs to tetrahedron K = (P 0 , P 1 ,P 2 ,P 3 ). In what follows,i 6 = j 6 = l 6 = m 2 [[0,3]], G denotes the center of gravity of tetrahedron K, M m denotes the gravity center of face F m = (P i , P j , P l ) of tetrahedron K and M l the center of gravity of face F l = (P i , P j , P m ). The outward nonnormalized normal of the facet is given by:

⌘s ij,K = 1 4 G 0 M 0 m ^Gs M s l + 1 4 G s M s m ^G0 M 0 l + 1 2 G 0 M 0 m ^G0 M 0 l + 1 2 G s M s m ^Gs M s l , where
G 0 M 0 m = 1 12 P 0 i + P 0 j 3P 0 m + P 0 l , G s M s m = 1 12 P s i + P s j 3P s m + P s l , G 0 M 0 l = 1 12 P 0 i + P 0 j + P 0 m 3P 0 l and G s M s l = 1 12 P s i + P s j + P s m 3P s l .
The volume swept by the facet is:

A s ij,K = c s ⌧ (w G ) s ij,K • ⌘s ij,K , (2.16)
with the mean velocity written as:

(w G ) s ij,K = 1 36 c s ⌧ 13w s i + 13w s j + 5w s m + 5w s l with w s ⇠ = P s ⇠ P 0 ⇠ .
Finally, the total volume swept by the interface around edge e ij of cell C i is obtained by summing over the shell of the edge, i.e. all the tetrahedra sharing the edge:

A s ij = X K2Shell(i,j) A s ij,K .
(2.17)

It is important to understand that normals ⌘s ij,K are pseudo-normals which are used only to compute the volumes swept by the facets. They must not be mistaken for normals to facets taken at t s , ⌘ s ij,K , which are used for the computation of ALE fluxes.

Volumes swept by boundary interfaces

The pseudo-normals and swept volumes of boundary faces are computed in a similar way. Let K = (P 0 , P 1 , P 2 ) be a boundary triangle, as in Figure 2.2. Let M 0 , M 1 and M 2 be the middles of the edges and G the center of gravity of K. The triangle is made up of three quadrangular finite volume interfaces:

(P 0 , M 2 , G , M 1 ) associated with cell C 0 , (P 1 , M 0 , G , M 2 ) with C 1 and (P 2 , M 1 , G , M 0 ) with C 2 . Each boundary interface I i is made of two sub-triangles, noted T ij and T ik with j, k 6 = i.

The volume swept by interface I

i between the initial and current Runge-Kutta configurations is the sum of the volumes swept by its two sub-triangles:

A s i,K = A s T ij + A s T ik = c s ⌧ w s G ij • ⌘s ij + c s ⌧ w s G ik • ⌘s ik , (2.18)
where w s G ij is the velocity of the center of gravity G ij of triangle T ij and ⌘s ij is the pseudo-normal associated with T ij , computed between the initial and current Runge-Kutta configurations. The six triangles T ij are coplanar, so their pseudo-normals have the same direction. Moreover, as median cells are used, their pseudo-normals also have the same norm, which is equal to one sixth of the norm of the pseudo-normal to triangle K. This common pseudo-normal is therefore equal to :

⌘s = 1 6 ⌘s K = 1 6 • 1 3  1 4 P 0 0 P 0 1 ^Ps 0 P s 2 + 1 4 P s 0 P s 1 ^P0 0 P 0 2 + 1 2 P 0 0 P 0 1 ^P0 0 P 0 2 + 1 2 P s 0 P s 1 ^Ps 0 P s 2 , (2.19) thus A s i,K = c s ⌧ h w s G ij + w s G ik i • ⌘s , (2.20)
where :

w s G ij = 1 18 c s ⌧ 11w s i + 5w s j + 2w s k with w s ⇠ = P s ⇠ P 0 ⇠ .
Finally, the total volume swept by the boundary interface is:

A s i = X K2Ball(i) A s i,K .
(2.21)

MUSCL approach and RK schemes

As regards spatial accuracy, we have seen that the order of accuracy can be enhanced using the MUSCL technique coupled with a limiter, thereby guaranteeing that this ALE scheme is intrinsically TVD. However, one must determine how to compute upwind/downwind gradients which are necessary for the V4-schemes. Still following [Yang 2005], it is clear that preserving the expected order of accuracy in time imposes that the upwind/downwind elements are computed on the current Runge-Kutta configuration, i.e., on the mesh at t s .

Computation of the time step

The maximal allowable time step for the numerical scheme is:

⌧ (P i ) = h(P i ) c i + ku i w i k (2.22)
where h(P i ) is the smallest height in the ball of vertex P i , c i is the speed of sound, u i is the Eulerian speed (the speed of the fluid, computed by the solver) and w i is the speed of the mesh vertex. The global time step is then given by ⌧ = CF L min

P i (⌧ (P i )).

Handling the swaps

An ALE formulation of the swap operator, satisfying the DGCL, was proposed in 2D in [Olivier 2011b], but its extension to 3D is somewhat delicate because it requires to handle 4D geometry, and it has not been carried out yet. Instead of considering an ALE scheme for the swap operator, our choice in this work is to perform the swaps between two solver iterations, i.e. at a fixed time t n . This consequently means that during the swap phase, the mesh vertices do not move, and thus the swaps do not impact the ALE parameters ⌘ and w, unlike [Olivier 2011b] where the swaps are performed during the solver iteration, i.e. between t n and t n+1 . After each swap step, a linear interpolation is performed to recover the solution.

In other words, the solution at the vertices does not change, which is not conservative. The data of the finite volume cells (volume and interface normals) are then updated, together with the topology of the mesh (edges and tetrahedra). This approach however is DGCL compliant, since the constant state is preserved (in fact, any linear state is preserved). A better approach would be to use conservative interpolation [Alauzet 2010b] which is conservative and DGCL compliant and the best would be to develop the ALE formulation of the generalized swap in 3D. In Section 3.1.1, we will quantify the error due to the use of swaps in numerical simulations.

FSI coupling

The moving boundaries can have an imposed motion, or be driven by fluid-structure interaction.

A simple solid mechanics solver is coupled to the flow solver described previously. The chosen approach is the 6-DOF (6 Degrees of Freedom) approach for rigid bodies.

Movement of the geometries

In this work, the bodies are assumed to be rigid, of constant mass and homogeneous, i.e., their mass is uniformly distributed in their volume. The bodies we consider will never break into di↵erent parts. Each rigid body B is fully described by: Physical quantities: its boundary @B and its associated inward normal n, its mass m assumed to be constant, its d⇥d matrix of inertia J G computed at G which is symmetric and depends only on the shape and physical nature of the solid object2 . Kinematic quantities: the position of its center of gravity x G = (x(t), y(t), z(t)), its angular displacement vector ✓ = ✓(t) and its angular speed vector d✓/dt.

F

ext denotes the resultant vector of the external forces applied on B, M G (F ext ) the kinetic moment of the external forces applied on B computed at G and g the gravity vector. We assume that the bodies are only submitted to forces of gravity and fluid pressure. The equations for solid dynamics in an inertial frame then read:

8 > > < > > : m d 2 x G dt 2 = F ext = Z @B p(s)n(s)ds + mg J G d 2 ✓ dt 2 = M G (F ext ) = Z @B ⇥ (s x G ) ⇥ p(s)n(s) ⇤ ds .
(2.23)

Discretization

The equation governing the position of the center of gravity of the body is easy to solve since it is linear. Its discretization is straightforward. However, the discretization of the second equation, which controls the orientation of the body, is more delicate. Since the matrix of inertia J G depends on ✓, it is a non-linear second order ODE. The chosen discretization is extensively detailed in [Olivier 2011a] and is based on rewriting of the equations in the frame of the moving body.

Explicit coupling

As the geometry must be moved in accordance with the fluid computation, the same time integration scheme has been taken to integrate the fluid and the solid equations. Therefore, time-advancing of the rigid bodies ODE System is performed using the same RKSSP scheme as the one used to advance the fluid numerical solution. The coupling is loose and explicit as the external forces and moments acting on rigid objects are computed on the current configuration.

Implementation

Non-dimensionalization

For some aeronautics inspired cases, better convergence of the solver is observed if the physical quantities are non-dimensioned. Solving the non-dimensioned equations is also necessary when considering models scaled to lower dimensions. Details on the non-dimensionalization of the Euler equations are given in [Alauzet 2014b].

When considering FSI problems, it seems crucial to be coherent and non-dimensionalize the solids equations too. To that end, the following reference quantities are defined: a density ⇢ 1 a length L 1 , a mass M 1 , an acceleration of gravity g 1 and a moment of inertia I 1 , such that:

M 1 = ⇢ 1 L 3 1 g 1 = a 2 1 L 1 I 1 = M 1 L 2 1 , (2.24)
and ⇢ 1 and L 1 are given as input (or computed using aeronautic considerations, as explained in [Alauzet 2014b]). The corresponding non-dimensioned variables x are then written as:

x = x x 1 , (2.25)
where x is the regular dimensioned value.

Parallelization

Most parts of the code are parallelized for shared memory multi-core computers with a p-threads approach using a semi-automatic p-thread parallelization library [Maréchal 2016] coupled with a space filling curve renumbering strategy [Alauzet 2009].

The automatic parallelization library cuts the data into small chunks that are compact in terms of memory (because of the renumbering), then uses a dynamic scheduler to allocate the chunks to the threads to limit concurrent memory accesses. In the case of a loop performing the same operation on each entry of a table, the loop is split into many sub-loops. Each sub-loop will perform the same operation (symmetric parallelism) on equally-sized portions of the main table and will be concurrently executed. It is the scheduler's job to make sure that two threads do not write on the same memory location simultaneously. When indirect memory accesses occur in loops, memory write conflicts can still arise. To deal with this issue, an asynchronous parallelization is considered rather than of a classic gather/scatter technique, i.e., each thread writes in its own working array and then the data are merged.

However, with this approach, a subtle management of cache misses and cache-line overwrites is required to avoid drops in scaling factors. Space filling curves exhibit clustering properties very helpful for renumbering algorithms [Sagan 1994]. The Hilbert space filling curve based renumbering strategy is used to map mesh geometric entities, such as vertices, edges, triangles and tetrahedra, into a one dimensional interval. In numerical applications, it can be viewed as a mapping from the computational domain onto the memory of a computer. The local property of the Hilbert space filling curve implies that entities which are neighbors on the memory 1D interval are also neighbors in the computational domain. Therefore, such a renumbering strategy has a significant impact on the e ciency of a code. We can state the following benefits: it reduces the number of cache misses during indirect addressing loops, and it reduces cache-line overwrites during indirect addressing loops, which is fundamental for shared memory parallelism.

Conclusion

In this chapter, the 3D ALE solver for the compressible Euler equations that was implemented in three dimensions and used during this thesis was presented. It is based on a Finite Volume approach, with an HLLC approximate Riemann solver, and high-order schemes using a MUSCL gradient reconstruction technique. As regards time discretization, multi-step Runge-Kutta schemes are derived from the enforcement of the Geometric Conservation Law. Details on the computation of the geometric parameters are provided. A 6-DOF mechanical model for rigid bodies was considered to add FSI coupling to the fluid solver. This solver was implemented in 3D in the same code as the moving mesh algorithm, and was plugged into it as explained in Algorithm 2. In the following section, we are going to present numerous cases using this ALE solver and the connectivity-change moving mesh method.

Chapter 3

Numerical Examples

In this chapter, the strategy described previously is applied to a variety of test cases, in order to validate the chosen approach and to prove its e ciency. In the first section, we aim at validating the ALE solver, study its convergence both in space and time, and at validating the FSI coupling. Then we discuss the parallel performance of the solver. Finally, we present more complex ALE test cases from the aeronautic industry.

The works presented in this Chapter were published in [Barral 2014a, Barral 2014b].

Validation of the solver

Static vortex in a rotating mesh

The first test case is used to validate the ALE solver, and study the impact of the moving mesh on the accuracy of the solution. We study the conservation of a static vortex (similar to [START_REF] Kitamura | [END_REF]]) on a rotating mesh. This case is an extension of a 2D case: we consider an extruded cylinder, and the initial solution is constant along the z axis. The domain is a cylinder of radius 5 and of height 1. The initial solution is defined as follows. Let r 0 = 1 be a characteristic radius and the reference state be:

⇢ 1 = 1, u x1 = 0, u y1 = 0, u z1 = 0, p 1 = 1 . (3.1)
Let us define the following quantities:

D 1 = 1 2 1 (2⇡) 2 ⇢ 1 p 1 , B 1 = 2r 2 0 1 D 1 , E 1 = (2r 2 0 ) 2 B 2 1 .
For a point of cylindrical coordinates (r, ✓, z), the enthalpy and speed of the vortex are:

H vor = 1 p 1 ⇢ 1 + 1 2 (u 2 x1 + u 2 y1 + u 2 z1 ), v vor = 1 2⇡ r r 2 + 1 .
And finally the initial solution is:

8 > > > > > > > > > < > > > > > > > > > : u x0 = u x1 + v vor sin ✓ u y0 = u y1 + v vor cos ✓ u z0 = 0 p 0 = p 1 exp ⇣ 2D1 p E1 atan ⇣ 2r 2 +B1 p E1 ⌘ ⇡ 2 ⌘ ⇢ 0 = 1 p 0 H vor 1 2 v vor . (3.2)
This initial configuration results in a cylindrical vortex rotating around the z axis, that remains in a constant state over time (density, pressure and speed are preserved). To avoid errors due to boundary conditions, the exact solution is enforced for every vertex farther than 90% of the cylinder radius (typically just a few layers of elements). The mesh is rotated rigidly around the z axis. Several rotation speeds were considered, all of which led to the same conclusions. Here, we only present the results for an angular speed of 0.34 o per time unit, which corresponds approximately to the speed of the vortex at a radius r = 5. We address both space and time convergence.

Space convergence

For the space convergence study, we consider a set of uniform meshes of sizes varying from 10, 000 vertices to 1.8 million vertices, see Table 3.1. The simulation is run until time t = 540, which corresponds to half a revolution of the cylinder. Since an exact solution is known, it is easy to compute an error with respect to this exact solution on each mesh. Two cases are compared: in one case the mesh is fixed, and in the other case the mesh is rotated as described previously. Since no mesh optimizations are performed, it allows us to make sure that the extra ALE terms are well computed. The results are shown in Fig. 3.1. On the left graph, we plot the error varying with time for the di↵erent meshes, fixed (red) and rotating (blue). We can see that, as expected, the error diminishes as the size of the mesh grows, but more significantly the curves of the error for the moving and static meshes are almost superimposed. This confirms the accuracy of the ALE scheme. To study the spatial order of convergence, the error is plotted with respect to the mesh size at di↵erent times on the right-hand graph. We can see that the order of convergence reached is slightly greater than 2, which is coherent with the space scheme used.

Time convergence

This study was carried out in 2D for reasons of e ciency. Our goal was to study the impact of the Runge-Kutta schemes used and the CFL parameter. We consider a disc of radius 5, with the same initial solution as previously (Eq. (3.2)) and rotating with the same speed. Three time discretizations are used: a standard first order explicit scheme (SSPRK(1,1)), a five-step second order Runge-Kutta scheme (SSPRK(5,2)) and a four-step third order Runge-Kutta scheme (SSPRK(4,3)) described in Section 2.3.4. Four CFL numbers are set for each case: CF L max , 3/4 ⇥ CF L max , 1/2 ⇥ CF L max and 1/10 ⇥ CF L max . CF L max is respectively 1, 4 and 2 for the schemes SSPRK(1,1), SSPRK(5,2) and SSPRK(4,3). Error curves comparing the simulation on a fixed mesh (red) and on a moving mesh (blue) for several mesh sizes. Left, the evolution of the error over time, right convergence curves with respect to the size of the mesh.

The results are gathered in Fig. 3.2. On the first graph, the error over time is plotted for the di↵erent schemes and CFL numbers, while on the second, we plot the error varying with the CFL number at di↵erent time steps. On both graphs, we can see that the error decreases with the order of the Runge-Kutta scheme and with the CFL number. Whereas the standard explicit scheme is very sensitive to the time step, the error does not vary much for the SSPRK(4,3) and SSPRK(5,2). What is interesting to notice is that we have to use a CFL number of 0.1⇥CF L max for a standard explicit scheme to reach the same level of accuracy as the SSPRK(4,3) scheme with a CFL number at its maximum, or the the SSPRK(5,2) scheme with a CFL number of 0.75 times its maximum. To reach a non-dimensional time equal to 3 with the standard explicit scheme with a CFL of 0.1, 30 time steps are required, whereas only 5 are required for the SSPRK(5,2) scheme with a CFL of 3, and 6 for the SSPRK(4,3) with a CFL of 2. Thus we can go 6 times faster with the high-order Runge-Kutta schemes and still obtain the same solution accuracy, which is obviously interesting.

Influence of swaps

It is important to study the impact of edge/face swaps on the solution accuracy in 3D as we do not a have specific ALE treatment for them. However, it is di cult to set up a meaningful test case with swaps. The number of swaps should be constant (in proportion to the size of the mesh), and they should also be uniformly distributed in both time and space. Moreover, if you force swaps on good quality tetrahedra, the quality of the resulting tetrahedra can degrade significantly and a↵ect substantially the accuracy of the solution. On all the simulations run with the connectivity-change moving mesh strategy, we noticed that, on average, less than one swap per 10, 000 tetrahedra and per time step is performed. To fit this observation, in this example, we swap all the bad elements to preserve the mesh quality every 15 solver time steps. Then, if not enough swaps were performed, we randomly swap elements to reach a number of 1 swap per 666 tetrahedra. Not all swaps are actually performed, because some of them a↵ect the quality of the mesh too drastically, so the number of swaps is not perfectly controlled and Error curves comparing several temporal schemes: standard explicit Euler scheme (blue), SSPRK(4,3) (green), SSPRK(5,2) (red). Left, evolution of the error over time and right, error at a fixed time varying with the CFL number. may vary at each mesh optimization step, but this method allows us to have an average number of swaps close to one per 10, 000 tetrahedra and per time step for all the meshes, as stated in Table 3 We again consider 3D meshes, rotating with the same speed of 0.34 o per time unit, and the simulations are run up to 270s. The results are gathered in Fig. 3.3. The error is slightly higher with swaps (in green) than without (in blue and red), however the error curves remain very close to those without swaps. The discrepancy can be explained partly by the quality of the mesh that decreases due to the forced swaps. But the main reason is because no specific treatment is applied to the swaps, so the conservation laws are violated. A conservative treatment is required, such as the 2D ALE formulation of the swap described in [Olivier 2011b], but the 3D version has not yet been developed, or a conservative interpolation such as the one from [Alauzet 2010b]. Even without such a formulation, the error introduced in this example is not so large, and the same second order convergence rate is observed, which validates our approach. Error curves comparing the simulation on a fixed mesh (red), on a moving mesh without swaps (blue) and on a moving mesh with swaps (green) for several mesh sizes. Left, the evolution of the error over time, right convergence curves with respect to the size of the mesh.

Conclusion

To sum up, this static vortex test case validates our ALE solver. We asymptotically reach an order of convergence of 2 for the spatial error, and we made sure there was no additional error introduced by the ALE terms. As regards temporal convergence, the importance of a high order Runge-Kutta scheme was established. Finally, we showed that edge/face swapping only creates a small error, even if used without some specific conservative treatment. Moreover, swaps are mandatory to preserve the quality of the mesh (and thus the accuracy of the solution) when complex geometric displacements are involved.

Flat plate in free fall

This case is run to validate the rigid body dynamics in the FSI solver. We consider a flat plate of length l, width l and height h. The top and bottom sides are split into four quadrants, see Figure 3.4. Di↵erent pressure conditions are imposed on each quadrant, and the plate is in free-fall. The plate is at rest at the beginning of the simulation and we set the pressure to p 0 = 1 everywhere on the plate, except on two opposite quadrants where we set it to p 1 = p 0 + 1 = 2. The pressure on the body is imposed element-wise throughout the simulation and the pressure of the surrounding fluid is not taken into account. The only other force is gravity. We expect the plate to spin around its corresponding diagonal axis and fall due to gravity. An exact solution to this problem can be computed, using Newton's second law for the translation motion and the conservation of momentum on the rotation axis. The translation motion is z(t) = z(0) 1 2 gt2 , where g is the gravity vector norm. The rotation axis ( ) is obviously (G, u), where G is the center of gravity of the plate and the unit direction vector u is

1 p forces is thus M F/ = ((GA 1 ^P1 ) + (GA 2 ^P2
)) .u, where A 1 and A 2 are the centers of the quadrants considered, P 1 = l 2 2 e z and P 2 = l 2 2 e z are the pressure forces. Finally M F/ = l 3 8 . The conservation of momentum law on the axis ( ) is written:

J d 2 ✓ dt 2 = M F/ , thus d 2 ✓ dt 2 = cst = 3l 2m(l 2 + h 2 )
,

and thus d✓(t) dt = 3l 2m(l 2 + h 2 ) t and ✓(t) = 1 2 3l 2m(l 2 + h 2 ) t 2 .
Comparison between the theoretical solutions and computed solutions are shown in Figure 3.5, where it can be seen that both curves are the same, and only diverge slowly over time, due to discrete integration errors.

Piston

The third validation test case is an FSI piston case from [START_REF] Lefrançois | [END_REF]]. It is originally a 1D problem, which is extended to 3D. As shown in Fig. 3.6, we consider a gas contained in a 3D cylindrical chamber, closed at one end by a wall, and at the other end by a moving piston of mass m p and of cross-section A p . Besides the forces of pressure, the piston is submitted to a restoring force modeled by a spring of rigidity k p . A natural frequency of the piston can be defined by f p = 1 2⇡ q kp mp . Let L 0 be the length of the chamber at rest, and u(t) be the displacement of the piston with respect to the position at rest. The gas is initially at rest, and the piston is held in position u 0 . We consider that all the variables are uniform on each cross-section of the cylinder (1D assumption). It is shown in [START_REF] Lefrançois | [END_REF]] that the piston is submitted to a resultant force applied to its center of gravity:

F p = k p ⇤ u(t) + A p (p(t) p(0)) , (3.3)
with p(t) being the pressure on the piston. No e↵ects of gravity are taken into account.

In practice, the domain at

t = 0 is a rectangular box of dimensions [ 1, 0.2] ⇥ [ 0.1, 0.1] ⇥ [ 0.1, 0.1].
The vertical face at x = 0.2 is mobile, and all the other faces are fixed, which corresponds to l 0 = 1 and u 0 = 0.2. The piston rigidity is set to k p = 10 7 N.m 1 , and a variety of piston masses (and thus frequencies) are considered: m p = 10 kg, 100 kg, 1000 kg, corresponding respectively to f p = 159 Hz, 50 Hz, 16 Hz. The other parameters are: ⇢ 0 = 1.1612 kg.m 3 , p 0 = 10 5 P a, u 0 = 0 m.s 1 . Slipping conditions are imposed on all the boundary faces (fixed and mobile). From a practical point of view, since this is a 1D case extended to 3D, the code of the FSI solver has to be modified to avoid 3D e↵ects: the speeds in the tangential directions are forced to 0 at every time step, as is the rotation matrix. From a moving mesh point of view, it is essential to allow tangential movement of the vertices on the fixed faces of the box.

The quantities of interest are the displacement and the pressure of the piston. For the pressure, we consider the pressure at its center of gravity. These two quantities are plotted in Fig. 3.7. Regarding the piston movement, it is periodic, as expected, with a period T p = 1/f p (see Table 3.3). The attenuation of the amplitude due to di↵usion is negligible on two periods.

As concerns the piston pressure, the results also correspond to [START_REF] Lefrançois | [END_REF]]. We ran the case with several mesh sizes (from 200, 000 to one million vertices) and several temporal schemes, and all results are consistent. The pressure fields at a time around 2/5 of the final time are shown in Fig. 3.8 for the three masses considered. We can see that the 1D structure of the

Numerical examples

AGARD test cases

AGARD test cases are famous test cases for moving geometry problems. The cases are described in detail and experimental data is published in [Landon 1982], which makes it an excellent validation case. Here, we consider two cases, often referred as AGARD CT 1 and AGARD CT 5. Both involve a NACA 0012 airfoil pitching with an angle of attack that is analytically prescribed:

↵(t) = ↵ m + ↵ 0 sin(t) . (3.4)
For CT 1, ↵ m = 2.89, ↵ 0 = 2.41 and  = 0.0808, and for CT 5, ↵ m = 0.016, ↵ m = 2.51 and  = 0.0814. The inflow Mach number is 0.6 for CT 1 and 0.755 for CT 5, which correspond respectively to a subsonic and transsonic simulation. The meshes are isotropic and have 4, 200 vertices, see Fig. 3.9. The simulations are run up to times t CT 1 = 77.8 and t CT 5 = 77.2, which correspond to two periods. That way, the flow establishes itself, before reaching its periodic state. Snapshots of the solution at di↵erent times of the second period are visible in Fig. 3.10 and 3.11. The two periods can be distinguished in Fig. 3.12 and 3.13, where three aeronautic coe cients are plotted over the angle of attack and over time: the lift, the drag and the pitching moment. On these plots, the available experimental data is also reported, for comparison. We observe that the lift coe cient fits the experimental data with some discrepancies due to the coarseness of the mesh, whereas the pitching moment di↵ers from the experimental data. These results are coherent with other results in the literature, for example [McCullen 2003]: the discrepancies observed are due to the fact that inviscid flows are considered, and the addition of viscosity would improve significantly the accordance of numerical results to experimental data.

F117 nosing up

The second example is a subsonic F117 aircraft nosing up, that creates a vortical wake. An inflow of air at Mach 0.4 arrives in front of the aircraft, initially in horizontal position, that noses up, stays up for a while, then noses down. In this example, the aircraft rotates around its center of gravity. Let T = 1s be the characteristic time of the movement and ✓ max = 20 o the maximal angle reached, the movement is defined by its angle of rotation, of which the evolution is divided in 7 phases:

✓(t) = 8 > > > > > > > > > > > > > > > > > > < > > > > > > > > > > > > > > > > > > : 0 i f 0  t  T /2 (i) ✓ max ✓ 2(t T 2 ) T 2 ◆ if T 2 < t  T (ii) ✓ max ✓ 1 2 + 2 ( 2 (t T 2 ) T 1) 1 2 ( 4 (t T 2 ) 2 T 2 1) ◆ if T < t  3T 2 (iii) ✓ max if 3T 2 < t  7T 2 (iv) ✓ max ✓ 1 2 (t 7T 2 ) T ◆ if 7T 2 < t  4T (v) ✓ max ✓ 1 2 2 ( 2 (t 7T 2 ) T 1) + 1 2 ( 4 (t 7T 2 ) 2 T 2 1) ◆ if 4T < t  9T 2 (vi) 0 i f 9T 2 t  5T (vii) .
Phases (i) is an initialization phase, during which the flow around the aircraft is established. Phase (ii) and (iii) are respectively phases of accelerated and decelerated ascension. Vortices start to grow behind the aircraft, and they expand during phase (iv), where the aircraft stays in upward position. Phases (v) and (vi) are phases of accelerated and decelerated descent, the vortices start to move away and they slowly disappear in phase (vii). Free-stream conditions are imposed on the faces of the surrounding box, and slipping conditions on the aircraft.

The initial mesh has 501, 859 vertices and 3, 012, 099 tetrahedra. The mesh used and snapshots of the solutions are shown in Figures 3.14 and 3.15. A di culty of this test case is the uneven movement of the aircraft, with strong acceleration and deceleration during the phases of ascension and descent, and the inversion of the acceleration in the middle of these phases. It is necessary to solve enough mesh deformation problems to avoid that the body boundaries cross small elements close to it. Statistics of the moving mesh characteristics are show in Table 3.4. We can see that the two proposed mesh deformation methods produce rather similar results in terms of mesh quality, but the case requires only half as many mesh deformation steps if the IDW method is used. This is probably due to the fact that the displacement of the geometry is relatively small, and most of the vertices of the mesh are located close to the moving body: thus, a method that moves these vertices rigidly predicts better trajectories for them.

# mesh deform. # optim. Q mean end 1 < Q end < 2 Q worst overall #

Two F117 aircraft crossing flight paths

The third example models two F117 aircraft with crossing flight paths. This problem illustrates well the e ciency of the connectivity-change moving mesh algorithm in handling large displacements of complex geometries without global remeshing. When both aircraft cross each other, the mesh deformation encounters a large shearing due to the opposite flight directions.

The connectivity-change mesh deformation algorithm easily handles this complex displacement thanks to the mesh local reconnection. Therefore, the mesh quality remains very good during the whole displacement, without any remeshing step.

The aircraft are imposed the following displacement:

( v lef t = (1, 0, 0) ✓left = ( 1, 0, 0)
and

( v right = ( 1, 0, 0) ✓right = (1, 0, 0)
and the simulation is run until dimensionless time t = 150. As concerns the fluid simulation, the aircraft are moved with an imposed motion of translation and rotation at a speed of Mach 0.4, in an initially inert uniform fluid: at t = 0 the speed of the air is null everywhere. Transmitting boundary conditions are used on the sides of the surrounding box, while slipping conditions are imposed on the two F117 bodies. After a short phase of initialization, the flow is established when the two F117s pass each other, and the density fields around the aircraft and in their wake interact. Acoustic waves are created in front of the F117s due to the instantaneous setting in motion of the aircraft. This is not realistic, but our aim was to validate our moving mesh approach rather than run a physically realistic simulation. In Fig. 3.16, a zoom on the geometry of the two aircraft is shown. In Fig. 3.18, we show both the moving mesh aspect of the simulation and the flow solution at di↵erent time steps.

The mesh is composed of 585, 000 vertices and (initially) 3.5 million tetrahedra. The two methods available were tested for the movement of the mesh. Statistics for both methods are presented in Table 3.5. In both cases, the whole simulation requires 22 elasticity solutions and 1, 600 optimization steps for a total of 2, 500, 000 swaps. The final mesh average quality of 1.4 is excellent and we notice that more than 99.7% of the elements have a quality smaller than 2 and only 52 elements have a quality higher than 5. The main di↵erence between both methods lies in the number of swaps, that is almost 5 times bigger for the IDW method. This is due to the fact that with the elasticity-based approach, vertices tend to bypass the moving bodies, while their trajectories are straighter with the IDW, thus creating a lot of shearing. Visualization of a mesh deformation solution just before the aircraft pass each other is telling: the IDW method only moves vertices in the vicinity of the moving bodies, whereas the elasticity method impacts vertices much farther from the bodies, enabling the algorithm to push elements away from the aircraft and fill the gaps behind them.

This simulation was run in a reasonable time: 18 hours were necessary to do 39, 000 time steps on a machine with 20 hyperthreaded i7 cores at 2.5 GHz. The total time required for the solution of the elasticity problems is only 25 minutes for the elasticity method and 5 minutes for the IDW method, which represents only 2.3% (resp. 0.4%) of the total time. The good quality of the mesh ensures an acceptable solution accuracy throughout the simulation. The optimization steps (swapping and smoothing) only take 25 minutes. As for the impact of the swaps, it is di cult to evaluate, since the simulation cannot be run without them. One can notice that on average, only 66 swaps per solver time step were performed, which is less than 0.0002% of the number of elements of the mesh, and so is likely to have little influence on the solution.

# mesh deform. # optim. Q mean end 1 < Q end < 2 Q worst overall #

Ejected cabin door

The last example is the FSI simulation of the ejection of the door of an over-pressurized aircraft cabin. This is a usual industrial benchmark for aircraft designers, and the aim is to evaluate when the door hinge will yield under cabin pressure. Generally, such experiments are done in a hangar and numerical simulations must be able to predict if the door will impact the observation area.

From a purely moving mesh point of view, the di culty is that the geometry is anisotropic and rolls over the elements while progressing inside a uniform mesh composed of 965, 000 vertices. Another di culty lies at the beginning of the movement when the door is ejected from its frame. The gap between the door and the frame is very small, and the mesh is sheared in the interstice, see Figure 3.19. However, no remeshing is needed. The connectivity-change moving mesh strategy is able to get rid of these skewed elements quite rapidly to finally achieve an excellent quality throughout the door displacement.

From the FSI point of view, we present a simplified version of the case -and thus probably not very representative of the actual physics involved. However, we make sure that the solution is physically coherent with the simplified initial conditions. At time t = 0, the volume is divided into two parts: outside and inside the cabin, see Figure 3.19. The inside of the cabin and the outside are not insulated, so the pressurized air leaks out of the cabin. The small volume surrounding the door is considered initially as being outside the cabin. The outside of the cabin is initialized to classic atmospheric values at 10, 000 m (⇢ = 0.44 kg.m 3 , u = (0, 0, 0) m.s 1 , p = 20 kP a). At this altitude, the air of the cabin should be pressurized to simulate an altitude of 2, 500m (⇢ = 0.96 kg.m 3 , u = (0, 0, 0) m.s 1 , p = 75 kP a). To simulate a blast, those values are multiplied by 10 inside the cabin (⇢ = 9.6 kg.m 3 , u = (0, 0, 0) m.s 1 , p = 750 kP a). The mass of the door is set to 100 kg.

Snapshots of the solution at di↵erent time steps are shown in Figure 3.20. We can see features similar to mach diamonds at the rear of the door, due to the high speed of the door. As concerns the door movement, the door is blown away from the cabin as expected. Its trajectory is rather straight, because it is guided between the walls of the cabin at the beginning, like a cannon ball. However, it acquires a slow rotation movement. For the time frame considered (T end = 0.2s), gravity has a negligible impact on the trajectory. The mesh is composed of 965, 000 vertices and 5.6 millions of tetrahedra. The whole simulation requires 29 elasticity solutions and 540 optimization steps for a total of 875, 000 swaps. The final mesh average quality of 1.33 is excellent and we notice that 99.95% of the elements have a quality smaller than 2 and only 1 element has a quality higher than 5.

The total time of the simulation is 2 hours on a machine with 20 hyperthreaded i7 cores at 2.5 GHz, for 1, 100 solver time steps, including 43 minutes of elasticity solution. Due to the a priori unpredictable trajectory of the door, and to the di cult part when the door is moving in its frame, the number of elasticity steps is slightly higher than with analytic imposed motion. However, the number of elasticity solutions is still small compared to the number of time steps (29 elasticity solutions and 1, 122 solver time steps), and elasticity solutions do not account for more than a third of the total time. The optimization step only takes 3 minutes. Once again, only an average of 0.0001% swaps per tetrahedra and solver time step are performed, which is not a lot. Figure 3.19: Test case of the door ejection. Surface mesh and cut plane just after the beginning of the simulation. Note that the gap between the door and its frame is very small, and meshed with only one layer of elements, which increases the di culty of the moving mesh problem.

Parallel performance

The parallelization of the code described in Section 2.5.2 was studied on the problem of the two F117s crossing each other introduced in section 3.2.3. The mesh is made up of 586, 610 vertices and 3, 416, 809 tetrahedra. The simulation is run from time t = 78 to time t = 108, which corresponds to the interval where the two aircraft actually pass each other. In this interval, 9 elasticity solutions are performed, as well as 317 optimization stages, 941, 337 swaps and 9050 solver time steps. The machine considered is a Xeon E5-2670 with two chips with 10 cores at 2.5 GHz each, with hyperthreading capabilities (see Part II Section 5.5 for more details on the machine).

Timings and speed-ups can be found in Table 3.6. First of all, it must be noted that running the case in parallel results in a substantial time-saving. The code scales well up to 4 cores, then scaling factors start to decrease. However, up to 20 cores the speed-up factor increases to finally reach 10. In this case, the hyperthreading extra cores are not useful, the case probably being too small and memory access becoming a bottleneck. To understand these results, a closer look at the parallel performances of each part of the code is necessary.

Detailed timings can be found in Table 3.7. The code was divided into several big parts (underlined). First, the flow solver, Wolf, itself decomposed into the computation of the ALE geometric parameter, the computation of the gradients for the high order scheme, the computation of the fluxes in the volume mesh, the computation of boundary fluxes, the computation of the time step and the advance in time of the solution. The other parts concern the moving of the mesh: the computation of the mesh deformation (the two elasticity solutions), the mesh optimizations (smoothing and swapping), the actual moving of the mesh (update of the positions), and the update of the data structures (edges, tetrahedra, neighbors and parallel structures). As already observed, the predominant part is the solver, and more specifically the computation of the fluxes and the geometric parameters. Whereas the computation of the fluxes scales relatively well, the computation of the geometric parameters scales less well, reaching a speed-up factor of 10 on 20 cores. This can notably be explained by the complexity of this loop (multiple indirections, searches in the data structures) and the dynamic character of some of the data. The parallel data structures and sorting of the data helps improving the e ciency of the parallelization, but after each mesh optimization stage, the sorting is no more accurate and the parallel e ciency decreases a little. This is partly solved by sorting the data when a parallel e ciency factor provided by the lplib reaches a certain threshold. For the other parts of the code, the scaling factors are not great, but they account for a small portion of the total CPU time. The update of the data structure account for a non negligible part of the total time, and it scales up to a certain point. However it is di cult to improve this, notably due to memory access speed. The mesh optimizations are relatively fast, and the parallelization of the computation of the qualities enables some speed-up, even though the optimizations themselves are serial. Note that for some parts, the speed-ups are very bad with hyper-threading, which can probably be explained by memory access bottlenecks and should be analyzed more in depth.

Nbr

Conclusion

The aim of this chapter was to demonstrate that the strategy developed in the two previous chapters, coupling a changing-connectivity moving mesh algorithm and an ALE solver, actually works and allows us to run complex simulation in a reasonable time. This was demonstrated on a wide variety of 3D cases. First academic cases that validate the ALE solver, then more complex CFD cases were run, without ever remeshing. In particular, the influence of swaps on the solution accuracy appears to be negligible. An analysis of parallel timings confirms that the moving mesh part takes little time compared to the solver part, and an e cient parallelization of the solver allows us to save substantial CPU time.

Nbr

Conclusion

In this part, we have seen the two aspects of simulations with moving boundaries: the handling of the moving mesh, and its consequences on the solver side. In the first chapter, we have presented a connectivity-change moving mesh algorithm, based on a mesh deformation computed for a large time step, and mesh optimizations performed in between. This algorithm allows us to run large displacement complex moving mesh simulations without remeshing. On this moving meshes, an ALE solver is used, which is described in details in the second chapter. It is based on an HLLC approximate Riemann solver with high order MUSCL-like gradient reconstruction for spatial discretization. Temporal schemes used are high-order multistep Runge-Kutta schemes, built by a local enforcement of the Geometric Conservation Law. This solver was coupled to the moving mesh algorithm to run a large number of simulations in the third chapter. Academic examples are used to validate the solver, in particular in presence of swaps, whereas more complex CFD cases demonstrate the capabilities of the approach.

Following from [Olivier 2011a], several novelties were presented in this part, notably:

• A new mesh deformation method was introduced in the moving mesh algorithm, the Inverse Distance Weighted (IDW) method. It was implemented in the moving mesh code and compared to the elasticity-like method on several cases, where it proved to have comparable performance.

• Moving mesh with boundary layer meshes and large volume variation were addressed, and the results suggest an e cient strategy for these cases.

• The ALE solver was implemented and parallelized in 3D. The formulas for the computation of the geometric parameters were clarified.

• The solver was validated on academic test cases. In particular, the linear interpolation method chosen to handle swaps was shown to have a negligible impact on the solution accuracy.

• ALE simulations were run in 3D, both with imposed motion and Fluid-Structure Interaction.

Perspectives arising from this work concern both the moving mesh aspect and the solver side.

• A strategy for moving boundary layer meshes around deformable geometries naturally arises from what is presented. It needs to be developed and applied on various cases.

• More generally, handling boundary layer meshes would make it possible to run Navier-Stokes simulations.

• E cient implicit solvers must be considered to speed-up low mach simulations, such as subsonic aeronautic cases and wind turbines.

• More complex FSI simulations are now within range. Now, there remains to improve the accuracy of these moving mesh simulations without increasing unreasonably their cost, which is performed in the next part using metric-based mesh adaptation.

Simulating complex moving geometries evolving in unsteady flows in three dimensions, such as those presented in the previous part, and which is more and more required by industry, still remains a challenge, because it is very time consuming.

To reduce the CPU time of these simulations while preserving their accuracy, anisotropic metric-based mesh adaptation has already proved its e ciency for steady problems, and appears as a salutary perspective. However, its extension to the unsteady case is not straightforward. These simulations combine the di culties arising from unsteadiness and geometrical complexity: global time step driven by the mesh smallest altitude, evolution of the phenomena in the whole domain, interpolation spoiling, but also three-dimensional meshing and remeshing issues with an imposed discretized surface. The introduction of moving geometries in this process even raises new di culties, due to the handling of the mesh movement and the deterioration of its quality, the specific numerical schemes imposed by moving mesh schemes and their restrictions, as well as fluid/structure coupling and contact handling. Three di↵erent approaches dealing with time-dependent mesh adaptation in the literature can be distinguished in the literature: re-meshing methods, fixed-point algorithms and adaptative moving meshes. First, an isotropic mesh is adapted frequently in order to maintain the solution within refined regions and a safety area around critical regions is introduced [Löhner 1990b[START_REF] Löhner | [END_REF][START_REF] Rausch | [END_REF], Speares 1997]. Another approach is to use an unsteady mesh adaptation algorithm [de Sampaio 1993[START_REF] Wu | [END_REF]] based on the estimation of the error every n flow solver iterations and global remeshing techniques. If the error is greater than a prescribed threshold, the mesh is re-adapted. A similar strategy is adopted in [Picasso 2003, Picasso 2009], where, at each re-adaptation step, a nearly optimal metric is found by scaling the metrics in every directions depending on directional error factors. More recently, local adaptive remeshing enabling the construction of anisotropic meshes has been considered. In this case [START_REF] Pain | Tetrahedral mesh optimisation and adaptivity for steady-state and transient finite element calculations[END_REF], Remacle 2005, Compère 2008], the mesh is frequently adapted in order to guarantee that the solution always evolves in refined regions. All these approaches involve a large number of adaptations while introducing unquantified errors due to the transfer of the solution from the old mesh to the new one. Moreover, none of them considers the inherent non-linear nature of the mesh adaptation problem: the convergence of the mesh adaptation process is never addressed and therefore obtaining the optimal mesh cannot be expected.

A first answer to these issues has already been proposed in [START_REF] Alauzet | [END_REF]]. It relies on the assumption that the temporal error is always controlled by the spatial error, which is indeed the case when solving a linear advection problem under a CFL condition. A fixedpoint algorithm is used to predict the solution and converge the couple mesh/solution. The simulation interval is split into fixed-size sub-intervals on which a unique adapted mesh is used. More recently, mesh adaptation and adaptive time-stepping methods were combined for incompressible unsteady simulations [Coupez 2013]. In that approach, moving boundaries are handled via level-set methods.

In adaptative moving meshes, also called r-adaptation, the mesh is moved at each time step into a mesh adapted to the solution via a mesh equation. A large range of methods share this common principle, the di↵erences between each lying in the adaptation criterion, the way it influences the mesh movement and the way the mesh movement is taken into account reciprocally in the physical equations. In general, they strongly couple the mesh movement and the physical equation being solved, resulting in methods with no spoiling interpolation errors. Some methods are velocity-based, meaning the mesh position is found through the vertices velocity. They include Lagrangian methods, where the velocity of the mesh is the actual Lagrangian velocity of the fluid [START_REF] Loubère | [END_REF]], Moving Finite Elements, where the mesh celerity is the solution of a minimization problem [START_REF] Miller | [END_REF], Baines 1994], and methods based on the conservation of the Geometric Conservation Law [Cao 2002]. These methods tend to quickly produce tangled meshes. In location-based methods, the mesh equation directly gives the position of the vertices. The adapted meshes are seen as images of a reference mesh by a coordinate transformation that is the solution of a minimization problem. This problem usually involves a monitor function to specify the sizes of the meshes, which is either heuristic or derived from error estimates. The problems can be based on Laplace [Winslow 1963] or Poisson [Thompson 1983] equations, or harmonic maps [Dvinsky 1991]. The application of the equidistribution principle leads to so called Moving-Mesh PDEs (MMPDEs) [Huang 2010b]. More recently, Monge-Ampère equation was also used to determine the mesh movement [Chacón 2011, Browne 2014]. These approaches seem very time-consuming for now, since the PDEs are solved at every solver time step. Moreover, the solution of the Monge-Ampère equation is known to be very di cult in three dimensions.

In this thesis, we have chosen to work with a fixed-point algorithm following on from [START_REF] Alauzet | [END_REF]]. This is motivated by a reduced CPU consumption with regards to most other methods, by a theoretical background available to control errors both in space and time and by the generic nature of the process: it can work with any physical equation, any solver and any remeshing tool. However, this algorithm is valid only when the space-time interpolation error is controlled in L 1 norm. Since multiscale mesh adaptation has now proved its e ciency for steady CFD computations [START_REF] Loseille | [END_REF], Loseille 2011a, Loseille 2011b, Alauzet 2010a], it seems relevant to extend the fixed-point algorithm proposed in [START_REF] Alauzet | [END_REF]] to this framework.

Regarding adaptative strategies for moving mesh simulations, only a few attempts can be found in the literature, among which [Löhner 1989a, Löhner 1990c, Baum 1991[START_REF] Saksono | [END_REF], Hassan 2007, Compère 2010]. As impressive as they can be, these results nevertheless still su↵er from some of the weaknesses described above, i.e. mainly very frequent remeshing and spoiling interpolation stages. Very recently, the problem was addressed in [Isola 2015], where the mesh is adapted with local mesh modifications that are integrated directly into the ALE schemes to avoid interpolation errors. However, these local remeshing occur at every solver time step, which can be very costly, and only results in 2D with a small number of vertices were presented.

A two-dimension extension of the fixed point algorithm to moving-geometry problems was introduced in [Alauzet 2011b, Olivier 2011a], in which an e↵ort was made to quantify the impact of the mesh motion on the adaptation process. The goals of the following part of this thesis are first to present updates of the error analysis and the adaptation algorithm for fixed-mesh time-dependent simulations, extending the previous works to multiscale adaptation, and second to extend these updates to adaptative simulations with moving meshes. This part is structured as follows. In chapter 4, we recall basics of metric-based mesh adaptation, and present all the concepts and tools that will be used in the next chapters. Chapter 5 focuses on time-dependent adaptation for fixed meshes, and important updates of the unsteady adaptation algorithm are presented, both to the theory behind the algorithm and to its practical implementation. Finally, in Chapter 6, we consider mesh adaptation for moving mesh problems: a corrected metric is derived, leading to a modified adaptation algorithm, which is used to run three-dimensional adaptive simulations with moving meshes to validate our approach.

Chapter 4

Basics of metric based mesh adaptation

In this chapter, we are going to set up the notions and formalism necessary for this whole part, defining the metric-based mesh adaptation framework in which our work on unsteady mesh adaptation fits. I am first going to draw up an history of mesh adaptation, then I will discuss the concept of metric, and show how it is used for mesh adaptation. The next section will focus on a powerful framework to model adapted meshes mathematically and compute error estimates. Finally, I will show how all this is used for multiscale mesh adaptation.

State of the art

Most numerical methods used are based on the subdivision of the spatial domain in polyhedra. This discretization of the space is called a mesh, the polyhedra being the elements of the mesh. The generation of this mesh is an unavoidable step in the numerical simulation workflow. Before it, is the definition of the computational domain, either using analytic functions, such as in CAD (Computer Aided Design), often based on generalizations of Bézier's curves, or using discrete data such as clouds of points. Once the geometry is correctly defined -and it is much harder than it might look -the next step is the meshing, in which we are more particularly interested.

A mesh of the surface of the domain has to be generated first, based on the prescription of the geometry. Then a volume mesh is generated that is constrained by the surface mesh: the volume is filled with elements, with the constraint of preserving the surface elements given as input.

Meshing status

With the increase of the computational power in the 1980s, together with the arrival of advanced numerical methods, scientists embarked on simulating complex physical phenomena on complex geometries, and started to do three-dimensional simulations. Very quickly, the generation of the mesh became a major issue in the analysis workflow. The need for automated methods to generate meshes became vital, as analysts could spend several months on generating a mesh by hand for a complex geometry. As a result, many books were published on that topic and conferences dedicated to meshing appeared: the annual International Meshing Roundtable, the bi-annual ISGG Conference on Numerical Grid Generation,. . . Since then, so many works have been carried out on this subject that the list could not fit in this thesis. Many di↵erent meshing technologies were considered and developed, with more or less success. Currently, the main approaches for generality and ease of use in CFD are: multiblock grids [Shaw 1992],

adaptive Cartesian grids [START_REF] Aftosmis | Applications of Space-Filling Curves to Cartesian Methods for CFD[END_REF]] and unstructured mono-element meshes [Coupez 2000, George 1991a[START_REF] Löhner | [END_REF][START_REF] Marcum | Unstructured grid generation using automatic point insertion and local reconnection[END_REF], Weatherill 1994, Yerry 1984].

Pure tetrahedral meshes have now become the most wide-spread technology in engineering compared to other methods, thanks to its ability to mesh automatically complex geometries. Indeed, it is the only method that allows to mesh automatically a wide range of geometries. Other methods still require occasional manual intervention or are only able to handle a small spectrum of geometries, and with some of them, it is usual to spend 6 months on the mesh for complex geometries which is far beyond the expected timeline of a study [Löhner 2001, Puigt 2011]. The exception is simple geometries, such as unit cubes, where Cartesian grids are generally preferred, because they are easy to create and because some numerical schemes are easier to write and more e cient on such discrete support.

As a result, powerful and, by now, mature techniques emerged for tetrahedral mesh generation.

Four approaches can be identified: spatial decomposition based methods [Yerry 1984], advancing-front methods [START_REF] Löhner | [END_REF]], Delaunay type methods [George 1991a, Weatherill 1994] and minimal volume principle based methods [Coupez 2000]. Combinations of these approaches have also been considered, see for instance [START_REF] Marcum | Unstructured grid generation using automatic point insertion and local reconnection[END_REF]] for a coupled advancing front -Delaunay type method. They handle currently most of the cases, even if they still require development to handle the increasing complexity of the geometries and physics considered.

That is why mainly unstructured tetrahedral meshes have been used for mesh adaptation. The other reason for this is the flexibility of the simplex, which allows us to generate anisotropic elements -which is impossible with structured grids -and e ciently modify the mesh density.

History of metric-based mesh adaptation

Adapting the mesh to the simulation run has been considered ever since numerical simulations were run. Since the 1960s, a large number of papers have addressed this topic (Google Scholar finds more than 650, 000 results to the query "mesh adaptation"!). However, in most of these works, the adaptation is isotropic and done by successively splitting elements with predefined patterns: a square is split into four squares, a triangle into four triangles, . . . It is only after breakthroughs in both fields of error estimates and mesh generation that the idea of anisotropic adapted meshes could emerge.

In 1987, Peraire et al. were the first to point out the directional property of the interpolation error [START_REF] Peraire | [END_REF]], from which they had the idea of generating elements with aspect ratios. They considered a local mapping procedure to generate elongated elements, which, coupled with an advancing front technique, allowed them to generate slightly anisotropic meshes, i.e., a 1:5 ratio. After them, Löhner [Löhner 1989b], Selmin and Formaggia [Selmin 1992] considered similar approaches. Löhner [Löhner 1989b] and Peraire et al. [Peraire 1992] extended the method to 3D, but the meshes considered were almost isotropic. In 1994, Zienkiewicz and Wu [Zienkiewicz 1994] stated that: "Unfortunately the amount of elongation which can be used in a typical mesh generation by such mapping is small..." , although they recognized some success with this approach.

Simultaneously, Mavriplis [Mavriplis 1990] considered the meshing point of view to match aeronautical simulations requirements: he generated high aspect ratio elements in boundary layers and wake regions using a Delaunay approach in a locally stretched space.

The idea of metric was close, and a year later, George and al. introduced the use of metrics in a 2D Delaunay mesher to generate anisotropic meshes. This work synthesized the previous ones: on the one hand, they pointed out that the absolute value of the Hessian of a solution is a metric, and on the other hand they used the metric field induced by the Hessian to compute lengths and areas in the mesher. They proposed to generate a mesh that would be uniform and isotropic in the metric space, which would be adapted and anisotropic in the physical space.

Since then, the concept of metric has been widely exploited 2D anisotropic mesh adaptation. In the late 1990s, the following papers can be referenced among many others: [START_REF] Fortin | [END_REF], Castro-Díaz 1997, Hecht 1997[START_REF] Dompierre | [END_REF], Buscaglia 1997]. In 1997, Baker gave a stateof-the-art [Baker 1997] and wrote: "Mesh generation in three dimensions is di cult enough task in the absence of mesh adaptation and it is only recently that satisfactory three-dimensional mesh generators have become available. [...]. Mesh alteration in three dimensions is therefore a rather perilous procedure that should be under taken with care". 3D mesh generation has indeed to face new pathologies, and the very existence of the mesh is not guaranteed, which makes 3D anisotropic mesh adaptation even more complicated.

Meshing blocking points have been partly solved through the use of local remeshing approach: instead of directly generating an adapted mesh, an existing mesh is modified to be adapted (and the existence problem is no more a problem). In the early 2000s, the first results with truly 3D anisotropic mesh adaptation for applications were published [Tam 2000[START_REF] Pain | Tetrahedral mesh optimisation and adaptivity for steady-state and transient finite element calculations[END_REF], Bottasso 2004, Belhamadia 2004[START_REF] Gruau | [END_REF], Li 2005, Alauzet 2006a]. In the meantime, a lot of work has been done in the field of error estimates, and new more accurate anisotropic error estimates have been proposed: a posteriori estimates [Picasso 2003, Formaggia 2004, Bourgault 2009], a priori estimates [Formaggia 2001, Huang 2005, Alauzet 2006b, Loseille 2009a], and goal-oriented estimates for functional outputs [START_REF] Venditti | [END_REF], Jones 2006, Loseille 2010b, Alauzet 2011a].

Thanks to its generality and modularity, metric-based mesh adaptation has been used in various research fields: for example, it has been applied successfully in three-dimensions to the sonic boom simulation [Alauzet 2010a], multi-fluid flows [Compère 2007, Guégan 2010], blast problems [START_REF] Alauzet | [END_REF]], Stefan problems [Belhamadia 2004], metal forming processes [Bruchon 2009], cardiac activity [Southern 2010] as well as ocean modelling [Piggott 2009] or ship hulls [Wackers 2014]. It has also been used with various numerical methods, among which the Finite Volume [Alauzet 2010a[START_REF] Hay | Adaptive finite-volume solution of complex turbulent flows[END_REF], Finite Element [Allain 2009], Stabilized Finite Element [Bruchon 2009] and Discontinuous Galerkin Finite Element [Remacle 2005, Lacasse 2007] methods.

In [Wackers 2012], the authors apply metric-based adaptation methods to semi-structured hexahedral meshes. In all these cases, large improvements in terms of accuracy and CPU performances have been established. There are currently many adaptive software using Riemannian metrics. Let us cite AFLR2D [START_REF] Marcum | Aligned metric-based anisotropic solution adaptive mesh generation[END_REF]], BAMG [Hecht 1998] and BL2D [Laug 2003] in two dimensions, YAMS [START_REF] Frey | [END_REF]] for discrete surface mesh adaptation and Feflo.a [Loseille 2009b], Forge3d [Coupez 2000], FUN3D [Jones 2006], EPIC [START_REF][END_REF]], GAMMANIC3D [George 2003], MadLib [Compère 2010], MeshAdap [Li 2005], MMG3D [Dobrzynski 2008], MOM3D [Tam 2000], TANGO [Bottasso 2004] and LibAdaptivity [START_REF] Pain | Tetrahedral mesh optimisation and adaptivity for steady-state and transient finite element calculations[END_REF]] in three-dimensions. It is worth mentioning that all these codes have arisen from di↵erent mesh generation methods. The method used in [George 2003, Hecht 1998] is based on a global constrained Delaunay kernel. In [Laug 2003], the Delaunay method and the frontal approaches are coupled. [START_REF] Frey | [END_REF], Loseille 2009b, Compère 2010, Dobrzynski 2008] are based on local mesh modifications. [Coupez 2000] is based on the minimal volume principle. Nowadays, metric-based mesh adaptation has become a mature field of research which has now proved its relevance for steady industrial problems. For instance in [Alauzet 2010a], the authors report a mean anisotropic ratio of 1:400 and a mean anisotropic quotient of 50 000 for adapted meshes containing more than 50 millions tetrahedra. Computations involving several millions of tetrahedra can now be considered on a daily basis, with moderate investments.

Other mesh adaptation approaches

Deriving from the pioneer works in mesh adaptation, other techniques have been developed and are worth mentioning: h-, p-and r-refinement. h-refinement is the enrichment of the mesh by splitting elements, p-refinement is the enrichment of the functional space associated to the mesh in the context of Finite Element Methods, and r-refinement consists in moving the vertices of the mesh with a constant number of vertices.

h-refinement is usually associated with Cartesian grids [START_REF] Berger | [END_REF], where the squares or cubes are split in four or eight. h stands for the size of the elements of the mesh that is modified by this method. It can also be applied to unstructured tetrahedral meshes, as done in [START_REF] Löhner | [END_REF]]. It is still used for a wide variety of problems where structured grids are required -either due to intrinsic physics of the problems or to the solver used.

p-refinement was introduced in the 1980s [Babuska 1981]. It is used in the context of FEM methods, and consists in increasing the order of the polynomials (hence the p) element by element. It is often used in combination with h-refinement, resulting in the hp-refinement method [Babuska 1994].

Finally, r-refinement consists in relocating (hence the r ) the vertices of the mesh to move them closer to the areas of interest of the solution. References [START_REF] Miller | [END_REF], Baines 1994, Huang 2010b] can be pointed out for introduction to these methods. Authors sometimes call this process "generation of adaptive meshes", although it is not really generation of a mesh but the modification of a pre-existing mesh, usually a Cartesian mesh. These methods present a specific interest, because they can easily be adapted to the case of simulations with moving boundaries and moving meshes.

Principle of metric-based adaptation

Adapting a mesh means changing the sizes of its elements to optimize a certain quantity. These sizes need to be represented with a mathematical tool, that needs to be easily derived from error models, and that is convenient for the meshing software. One way to represent size charts are so called monitor functions [Huang 2010a]. In this work, we will consider metrics, and more generally Riemannian metric spaces, that are convenient to define the fundamental concept of unit mesh. The question is then how to compute such metrics that lead to adapted meshes, which we will explain with the basic steady adaptation algorithm.

Euclidian and Riemannian metric spaces

Euclidian space

We consider the vector space R n , typically n = 2 or 3 in our case. A scalar product is a Symmetric Positive Definite (SPD) form. This form can be represented by a SPD matrix M = (m ij ) 1i,jn , which is called a metric tensor or simply metric. The scalar product is then written:

( • , • ) M : R n ⇥ R n ! R + (u, v) 7 ! (u, v) M = u T M v = n X j=1 n X i=1 m ij u i v i .
(4.1)

In the simple case were M = I where I is the identity matrix, the scalar product is the canonical Euclidian dot product. A vector space with a scalar product is called an Euclidian space.

The scalar product is useful to compute lengths and angles in the Euclidian space. We can define:

• a distance:

d M : ⌦ ⇥ ⌦ ! R + (P, Q) 7 ! d M (P, Q) = p PQ T M PQ , (4.2)
which induces a metric space structure on the vector space,

• and a norm:

|| • || M : R n ! R + u 7 ! ||u|| M = p u T M u . (4.3)
From these distance and norm, we deduce the classic geometrical quantities:

• the length of an edge e is given by: `M (e) = p e T M e , (4.4)

• the angle between two vectors v 1 and v 2 is the unique real number ✓ 2 [0, ⇡] such that:

cos ✓ = (v 1 , v 2 ) M ||v 1 || M ||v 2 || M (4.5)
• the volume of element K is:

|K| M = p det M |K| I . (4.6)
A very useful result on metrics is that M is diagonalizable in an orthonormal basis:

M = R ⇤ R T , where 8 > > > > < > > > > : ⇤ = diag ( 1 , . . . , n ) is the diagonal matrix made of the eigenvalues of M , R = ( r 1 | r 2 | . . . |r n )
T is the unitary matrix (i.e. R T R = I) made of the eigenvectors of M .

(4.7)

We will very often use the geometric representation of a metric tensor. In the vicinity V(a) of point a, the set of points that are at distance " of a, is given by: i . This unit ball is depicted in Figure 4.1 in two and three dimensions. A metric tensor M provides another useful information: the application that maps the unit ball associated with I to the unit ball associated with M. The matrix of this transformation in canonical basis (e 1 , e 2 , . . . , e n ) is:

M (") = {x 2 V(a) | d M (x, a) = "} .
h 2 = 1 p 2 r 2 r 1 r 3 h 1 = 1 p 1 h2 = 1 p 2 h 3 = 1 p 3 h 1 = 1 p 1 r 1 r 2
M 1 2 = R ⇤ 1 2 R T , where ⇤ 1 2 = diag ✓ h 1 = 1 2 1 , . . . , h n = 1 2 n ◆ . (4.9)
This natural mapping corresponds to the change of basis from the canonical basis to the orthonormal diagonalization basis of M and is depicted in Figure 4.2.

M 1 2 M 1 2 e 2 e 1 h 1 h 2 e 2 e 1 R 2 , M R 2 , I 2 1 1

Riemannian metric space

The scalar product of Euclidian spaces is the same on the whole space, which means that the distance definition is the same for each point of the space (the unit ball is the same everywhere).

However, when used to generate adapted meshes with di↵erent element sizes in the domain, it is convenient to have a distance that depends on the position of the space. We now consider a set of SPD tensors M = (M(P ))

P 2⌦ , also called metric tensor field, defined on the whole domain ⌦ ⇢ R n . Locally at point P , M(P ) induces a scalar product on R n ⇥ R n . The vector space, with this new structure, is called a Riemannian metric space. In this thesis, we will use the same notation M to speak of the metric field and of the metric tensor at a given point. Notation M will only be used if the distinction is necessary for pedagogical purposes.

Remark 3. Unlike usual Riemannian spaces, there is no notion of manifold in Riemannian metric spaces. However, Riemannian metric spaces can be assimilated to functions representing Cartesian surfaces, and the metric tensor defined for a point of the space is a scalar product on the tangent plane for that point. There is no global notion of scalar product in a Riemannian metric space, thus no global distance or norm. However, we can extend the notions of length, angle and volume from the Euclidian space case. To do so, we have to consider the variation of the metric between two points. The following geometrical quantities are defined:

• the length of edge e = PQ parametrized by : t 2 [0, 1] 7 ! P + t PQ is computed with the following formula:

`M (e) = 1 Z 0 || 0 (t)|| M( (t)) dt = 1 Z 0 q PQ T M(P + t PQ) PQ dt , (4.10)
• the angle between two vectors v 1 = PQ 1 and v 2 = PQ 2 is the unique real ✓ 2 [0, ⇡] such that:

cos ✓ = (v 1 , v 2 ) M(P ) ||v 1 || M(P ) ||v 2 || M(P )
, (4.11)

• the volume of element K with respect to M is more di cult to apprehend. Indeed, due to metric variations, element K, as seen with respect to metric field M is generally curved: it is not a simplex anymore and normally, its volume should be computed with an integration formula:

|K| M = Z K p det M(x) dx . (4.12)
However, this volume can be approximated at first order:

|K| M ⇡ |K| I p det M(G K )
, where G K is the barycenter of K. (4.13)

Unit mesh

Metric fields, as defined in the previous section, allow us to modify locally geometric quantities such as lengths and volumes as well as to provide a local orientation (prescribing two privileged axes). They are thus a good way, both elegant and mathematically e cient, to prescribe sizes and orientations for the elements of an anisotropic adapted mesh. The main idea of metricbased mesh adaptation, introduced for the first time in [George 1991b], is to use directly a Riemannian metric space within the mesher to compute the necessary geometrical quantities, and to generate a unit mesh with respect to this Riemannian metric space.

A tetrahedron K, defined by its list of edges (e i ) i=1..6 , is said to be a unit element with respect to a metric tensor M if the length of all its edges is unit in metric M: where |K| is its Euclidean volume. Although this definition is very simple, things are more complicated when it comes to defining a unit mesh. Stricto sensu, a unit mesh is mesh whose edges are all unit with respect to the prescribed metric field. However, the existence of a mesh made of unit elements is not assured. For example, in the simplest case of M(P ) = I(P ) for each point P , i.e. the canonical Euclidian space, it is well known that R 3 cannot be filled with regular tetrahedra (that are unit with respect to the identity metric). So the constraint on the sizes of the edges has to be relaxed, but this can lead to meshes with very bad elements (flat elements), so we have to add a constraint on the volume of the elements, through a quality function.

We have to introduce the notion of quasi unit element. A tetrahedron is said to be quasi unit with respect to a metric field M if its edges are close to unit, i.e. 8i, `M(e

i ) 2 [ 1 p 2 , p 2
]. To avoid elements with a null volume (see [Loseille 2011a]), we have to add a constraint on the volume, which is achieved through a quality function:

Q M (K) = p 3 216 ⇣ P 6 i=1 `2 M (e i ) ⌘ 3 2 |K| M 2 [1, +1] . (4.16)
For the regular tetrahedron, the quality function is equal to 1, whereas it tends to +1 for a null volume tetrahedron. So an element close to a perfectly unit element has a quality close to 1. This leads to the following definition. A tetrahedron K defined by its list of edges (e i ) i=1...6

is said quasi-unit for Riemannian metric space (M(x))

x2⌦ if 8i 2 [1, 6], `M(e i ) 2  1 p 2 , p 2 and Q M (K) 2 [1, ↵] with ↵ > 1 , (4.17)
The definition of unit mesh consequently becomes: a unit mesh with respect to a Riemannian metric space (M(x))

x2⌦ is a mesh made of quasi-unit elements. In practice, it is this definition that is used in meshing software. For any kind of desired mesh (uniform, adapted isotropic, adapted anisotropic), the mesh generator will generate a mesh that is unit with respect to the prescribed metric space. The resulting mesh is uniform in the metric space while it is adapted in the canonical Euclidian space. This is illustrated in Figure 4.4.

Inputs (H 0 , M i ) i2H
Output H

Operations on metrics

The main advantage of using metrics is the existence of well-posed operations on metrics, that have a direct geometric interpretation with unit ellipsoids. The most useful ones are metric intersection and metric interpolation.

Metric intersection

When several metrics are specified at a point of the domain, all these metric tensors must be reduced to a single one due to mesh generation concerns. The metric intersection consists in keeping the most restrictive size constraint in all directions imposed by this set of metrics.

Let M 1 and M 2 be two metric tensors given at a point. The intersection of M 1 and M 2 is the metric tensor M 1\2 that prescribes the largest possible size under the constraint that the size in each direction is always smaller than the sizes prescribed by M 1 and M 2 . From a geometric point of view, the intersection between two metrics is not the intersection between two ellipsoids as their geometric intersection is not an ellipsoid, but it is the largest ellipsoid representing M 1\2 included in the geometric intersection of the ellipsoids associated with M 1 and M 2 , cf. Figure 4.5, left.

The ellipsoid (metric) verifying this property is obtained by using simultaneous reduction of the quadratic forms associated with the two metrics. During this thesis, I showed that the definition of the metrics intersection used so far [Alauzet 2003a] did not work in some cases, especially when the two metrics are identical, and I proposed a new definition, that is equivalent to the one proposed in [START_REF] Mckenzie | [END_REF]].

Simultaneous reduction theory for two quadratic forms, one of which being positive definite, tells that there exist a common basis that is orthonormal for the positive definite form and orthogonal for the other. In other words, there is a basis in which the matrix of the first form is the identity and in which the matrix of the other form is diagonal. We place ourselves in this basis in two steps.

First, let us consider M 1/2 1 (which exists because M 1 is positive definite):

M 1 = Pdiag( 1 , 2 , 3 )P T ) M 1/2 1 = Pdiag(1/ p 1 , 1/ p 2 , 1/ p 3 )P T
). This matrix represents a mapping that sends metric M 1 onto the identity.

Let :

M 1 = M 1/2 1 T M 1 M 1/2 1 = I , M 2 = M 1/2 1 T M 2 M 1/2 1 .
We diagonalize M 2 , noting P the matrix whose columns are the eigenvectors:

M 2 = P 0 B B @ 1 0 0 0 2 0 0 0 3 1 C C A P T , M 1 = P IP T .
The two metrics are then intersected in this latter basis:

M 1\2 = P 0 B B @ max( 1 , 1) 0 0 0 max( 2 , 1) 0 0 0 max( 3 , 1) 1 C C A P T .
So finally:

M 1\2 = M 1/2 1 T M 1\2 M 1/2 1 . (4.18)
Remark 4. The intersection operation is not commutative. Consequently, when more than two metrics are intersected, the result depends on the order of intersection. In this case, the resulting intersected metric is not anymore optimal. If, we seek for the largest ellipsoid included in the geometric intersection region of several (> 2) metrics, the John ellipsoid can be used after solving an optimization problem [Loseille 2008].

Metric interpolation

In practice, the metric field is only known discretely at mesh vertices. The definition of an interpolation procedure on metrics is therefore mandatory to be able to compute the metric at any point of the domain. For instance, the computation of the volume of an element with Relation (4.12) is generally performed using quadrature points to approximate the integral. It thus requires the computation of some interpolated metrics inside the considered element. Figure 4.5 illustrates metric interpolation along a segment, for which the initial data are the endpoints metrics. Several interpolation schemes have been proposed in [Alauzet 2003b, Alauzet 2003a] which are based on the simultaneous reduction. The main drawback of these approaches is that the interpolation operation is not commutative, and the result depends on the order in which the operations are performed when more than two metrics are involved. Moreover, some useful properties such as the maximum principle are not verified by these schemes. A consistent operational framework, the log-Euclidian framework, was introduced in [START_REF] Arsigny | [END_REF]], which we use to design an interpolation scheme.

We first define the notion of metric logarithm and exponential:

ln(M) := R ln(⇤)R T and exp(M) := R exp(⇤)R T ,
where ln(⇤) = diag(ln( i )) and exp(⇤) = diag(exp( i )). We can now define the logarithmic addition and the logarithmic scalar multiplication :

M 1 M 2 := exp (ln(M 1 ) + ln(M 2 )) ↵ M := exp (↵. ln(M)) = M ↵ .
The logarithmic addition is commutative and coincides with matrix multiplication whenever the two tensors M 1 and M 2 commute in the matrix sense. The space of metric tensors, supplied with the logarithmic addition and the logarithmic scalar multiplication is a vector space.

We use the linear interpolation operator derived from the log-Euclidean framework. Let (x i ) i=1...k be a set of vertices and (M(x i )) i=1...k their associated metrics. Then, for a point x of the domain such that:

x = k X i=1 ↵ i .x i with k X i=1 ↵ i = 1 ,
the interpolated metric is defined by:

M(x) = k M i=1 ↵ i M(x i ) = exp k X i=1 ↵ i ln(M(x i )) ! . (4.19)
This interpolation is commutative. Moreover, it has been demonstrated in [START_REF] Arsigny | [END_REF]] that this interpolation preserves the maximum principle, i.e., for an edge pq with endpoints metrics M(p) and M(q) such that det(M(p)) < det(M(q)) then we have det(M(p)) < det(M(p + t pq)) < det(M(q)) for all t 2 [0, 1].

The non-linear adaptation loop

So far, we have seen fundamental mathematical concepts used in metric-based mesh adaptation.

Let us now see how they are involved in mesh adaptation.

Steady algorithm

The basic principle of metric-based mesh adaptation is: from an initial solution on an initial mesh, an error estimate is computed (based on an error estimate model), from which a metric field is computed, which is used to generate a mesh adapted to the solution. However, the mesh will be adapted to the numerical solution on the initial mesh, but not necessarily to the physical solution: if a new numerical solution is computed on the adapted mesh, new physical features may appear, to which the mesh is not adapted. This why the mesh adaptation problem is intrinsically a non-linear problem. Therefore, an iterative process is necessary to converge the mesh/solution couple, that generates a sequence of consecutively adapted meshes. In the steady state case, there is only one mesh and one solution. The algorithm is illustrated in Figure 4.6. As input is given a pair of initial mesh and solution: (H 0 , S 0 ). (Note that the first solution can be the uniform solution or any partly converged solution). A first solution S 1 is computed, from which a metric field M 1 is deduced as will be explained further (Section 4.4), and a new mesh H 1 is generated using this metric field. Solution S 1 is then transferred to H 1 (see Section 4.2.4). The new pair (H 1 , S 1 ) is then used as input for a new iteration of the algorithm.

The process ends when the solution stops evolving, for a given number of vertices, or formally speaking when an error threshold is reached. It is because the number of vertices is fixed that the process eventually converges: at some point, the vertices are optimally distributed, and only increasing the number of vertices could reduce the error. In practice, the number of vertices is given approximately through the notion of mesh complexity (see Section 4.3), and the number of iterations of the algorithm is set in advance to reach a good level of convergence (typically five iterations are performed).

In the following sections, we review several important steps of the adaptation algorithm.

(H i , S i ) (H i , M i ) (H i , S 0 i ) (H 0 , S 0 0 ) (H i+1 , S i , H i ) S i M i H i+1 S 0 i+1
Compute Solution

Compute Metric

Generate Mesh

Interpolate Solution

Figure 4.6: The non-linear steady adaptation loop. i is the adaptive loop iteration index, H i , S i , S i 0 and M i denote the mesh, the solution, the initial solution and the metric field at iteration i, respectively.

Error estimates

The metric field is computed so that the mesh generated will minimize an error. This error is defined by an error estimate model, about which a lot will be said in the next chapters of this thesis. For now, let us just say that the error that we control is the interpolation error, under the assumption that the global error is controlled by the interpolation error, which is true for order two elliptic problems (See Céa's Lemma [Ciarlet 1991]). Several models were considered over time, but they all are based on the computation of the Hessian of the solution. It is indeed the variation of the first order derivatives that give us enough information on the features of the solution, notably on the directions of the features. It also has to be noted that Hessian matrices are n ⇥ n matrices, n being the space dimension, that are easily converted into metrics.

Choice of the sensor

The adaptation is performed on a sensor function, which is a function of the solution, and on which the modeled error is computed. Usually, one field of the solution vector is selected as sensor (density, momentum or pressure in the case of the Euler equations), but a combination of fields is also possible. The choice of this sensor is very important in the adaptation process, since it influences greatly the final solution. This problematic can be illustrated with the classic case of Sod shock tube (see Section 5.3): all the phenomena of the solution are not visible on some fields, for instance, the contact discontinuity cannot be observed on pressure curves. If the pressure was chosen as adaptation sensor, the area of the contact discontinuity would be meshed with large elements, leading to a loss of accuracy of the solution.

Gradient and Hessian recovery techniques

Since Hessians are the basis of the computation of metrics, it is important to compute them with enough accuracy. From a non smooth piecewise P 1 function u h , the chosen method must be able to recover a smooth Hessian field. Two main approaches coexist: a double L 2 projection method, and a weighted least square method. The second method is detailed in [Menier 2015], and is better in particular in the case of boundary layer meshes. The first one is the one generally used in this thesis, and works as follows.

Nodal gradients. Let P 0 and P 1 are the set of polynomials of degree respectively 0 (constant polynomials) and 1. Let K be a tetrahedron and (P i ) i=0...3 its vertices. Let x 2 K. u h is written:

u h (x) = 3 X j=0 u h (P j ) ' j (x) ,
where (' j ) j are the P 1 shape functions, given by:

r x ' 0 | K = 1 6|K| ⌘ 0 , r x ' 1 | K = 1 6|K| ⌘ 1 , r x ' 2 | K = 1 6|K| ⌘ 2 , r x ' 3 | K = 1 6|K| ⌘ 3 ,
where ⌘ i denotes the outward normal of the face opposite to vertex P i (see conventions on page 3).

The expression is di↵erentiated term by term:

ru h | K = 3 X j=0 u h (P j ) r x ' j | K .
As ru h is not defined at the vertices of the mesh, the nodal gradients are recovered from the gradients to the elements using a L 2 local projection and Clément's interpolation operator.

Let P i be a vertex of H. The stencil of the shape function ' i is the ball of vertices around P i , B(P i ). The following spaces are introduced:

V 0 h = {v 2 L 2 (⌦) v |K 2 P 0 8K 2 H} V 1 h = {v 2 C 0 (⌦) v |K 2 P 1 8K 2 H} . For v 2 L 2 (⌦), we set ⇧ L 2 v 2 V 0 h : 8 B(P i ) ⇢ H , 8 < : (⇧ L 2 v) |B(P i ) 2 P 0 R B(P i ) (⇧ L 2 v v) w = 0 , 8w 2 P 0 . Clement's operator ⇧ c : V 0 h ! V 1 h is defined as follows: ⇧ c v = n X i=0 ⇧ L 2 v(P i ) ' i .
With Clément's operator, we can recover nodal gradients from the ru h 2 P 0 . For each B(P i ) ⇢ H we can in particular take v = 1 2 P 0 as test function:

Z B(P i ) (⇧ L 2 (ru h ) ru h ) = 0 () Z B(P i ) ⇧ L 2 (ru h ) = Z B(P i ) ru h () |B(P i )| ⇧ L 2 (ru h ) |B(P i ) = X K j 2B(P i ) Z K j ru h () ⇧ L 2 (ru h ) |B(P i ) = P K j 2B(P i ) |K j | ru h|K j P K j 2B(P i ) |K j |
, where |K| is the volume of element K . For each vertex P i , we can write:

r R u h (P i ) = P K j 2B(P i ) |K j | ru h|K j P K j 2B(P i ) |K j | .
This procedure comes to recovering the gradient as an average of the gradients at the elements, weighted by the volume of the elements.

We thus have defined values to the vertices for the gradient, and consequently, thanks to Clément's operator, a piecewise P 1 gradient on the mesh.

Hessian recovery. To recover the Hessian matrix by means of a double L 2 projection, the same procedure is applied once more, but using the gradient as input. Several methods are available. We chose to perform a double L 2 projection, which means applying the previous procedure once again but on the gradients.

Interpolation step

In the case of steady simulations, after each mesh adaptation iteration, the solution is not known on the newly generated mesh. Computing the solution from scratch being too costly in terms of CPU time, we prefer to transfer it from the old mesh to the new one, and restart the simulation from this already partly converged state.

The classic approach involves two steps: first the localization of the vertices of the new mesh in the background mesh, and then the application of an interpolation scheme. The localization step is described in several references [Frey 2008, Alauzet 2010b]. As concerns interpolation schemes, the easiest is the classic P 1 interpolation, which is written:

u(P ) = 3 X i=0 i (P ) u(Q i ) , (4.20)
where P is a vertex of the new mesh that has been located in tetrahedron

K = [Q 0 , Q 1 , Q 2 , Q 3 ]
of the background mesh and i are the barycentric coordinates of p with respect to K. Higher order interpolation schemes can be devised, for instance using P 2 Lagrange test functions. However these schemes do not conserve the mass.

For the adaptation of unsteady simulations, we will see later that this step is even more important because a large number of interpolations are performed, spoiling the accuracy of the solution. In the context of the resolution by a second order numerical scheme of a PDE system of conservation laws, such as the compressible Euler system, the interpolation method seems to have to satisfy the following properties to obtain a consistent mesh adaptation scheme: (i) mass conservation, (ii) P 1 exactness preserving the second order of the adaptive strategy and (iii) verify the maximum principle.

A new conservation scheme was devised to match these criteria [Alauzet 2010b]. The mass conservation property of the interpolation operator is achieved by local mesh intersections, i.e., intersections are performed at the element level. The use of mesh intersection to build a conservative interpolation process seems natural for unconnected meshes (i.e. meshes that are not nested). The idea is to find, for each element of the new mesh, its geometric intersection with all the elements of the background mesh it overlaps and to mesh this geometric intersection with simplices. We are then able to use a Gauss quadrature formula to exactly compute the mass which has been locally transferred.

High-order accuracy is obtained through the reconstruction of the gradient of the solution from the discrete data and the use of some Taylor formulas. Unfortunately, this high-order interpolation can lead to a loss of monotonicity. The maximum principle is recovered by correcting the interpolated solution in a conservative manner. Finally, the solution values at vertices are reconstructed from this piecewise linear by element discontinuous representation of the solution. The algorithm is summarized in Algorithm 3. As regards CPU time overhead, it is minor in 2D but a major issue in 3D. Fortunately, the procedure is easily parallelized and scales very well, and the CPU overhead becomes admissible with the parallelization.

Mesh gradation

The size field provided by the metric field can have huge variations or be very irregular, especially since they are computed from a numerical solution with sharp features (discontinuities or steep gradients). This may result in poor quality anisotropic meshes. To generate high quality anisotropic meshes, the metric field needs to be smoothed: the sizes prescribed are bound to avoid too large variations. Several methods have been proposed [Borouchaki 1998, Alauzet 2010b]. This procedure should not impact the accuracy of the solution, since the elements can only have a smaller size than the one prescribed by the error model. However, if the procedure is not applied correctly, it may have a noticeable impact on the mesh sizes and anisotropy, and thus the step is worth mentioning.

The continuous mesh framework

In [Loseille 2008, Loseille 2011a, Loseille 2011b] the concept of continuous mesh was introduced, that has become central in our way to consider metric-based mesh adaptation. We have seen that Riemannian metric spaces are a useful tool to generate adapted meshes, but the continuous mesh framework brings them to another stage, and establishes a duality between the discrete domain and the continuous domain which is based of Riemannian metric fields. This duality enables a practical mathematical representation of adapted meshes, and allows us to use powerful tool from calculus of variations. This is particularly useful to derive appropriate error estimates, and find meshes that are optimal with respect to the error model.

The results for this section are presented in 3D, although they are easily extended to nD.

Duality discrete-continous: a new formalism

The key notion of unit element, defined in section 4.2.2, is once again fundamental to draw a correspondence between the discrete and the continuous domain. It is actually used to define classes of equivalence of discrete elements: let M be a metric tensor, there exists a non-empty infinite set of unit elements with respect to M. Conversely, given an element K such that |K| 6 = 0, then there is a unique metric tensor M for which element K is unit with respect to M.

Consequently, a discrete element can be viewed as a discrete representative of an equivalence class formed by all the unit elements of a metric M. Figure 4.8 depicts some unit elements with respect to a metric tensor, which is geometrically represented by its unit-ball. M denotes the class of equivalence of all the elements which are unit with respect to M and is called continuous element. This local relation of equivalence concerns elements, and needs to be somehow extended to whole meshes. Intuitively, the notion of Riemann metric space is going to play that role. The main di culty is to take into account the variation of the function x 7 ! M(x). The analysis can be simplified if M is rewritten as follows, separating its local and global properties. A Riemannian metric space M = (M(x))

x2⌦ locally writes:

8x 2 ⌦, M(x) = d 2 3 (x) R(x) 0 B B @ r 2 3 1 (x) r 2 3 2 (x) r 2 3 3 (x) 1 C C A R T (x), (4.23)
where

• density d is equal to: d = ( 1 2 3 ) 1 2 = (h 1 h 2 h 3 ) 1 , with i the eigenvalues of M • anisotropic quotients r i are equal to: r i = h 3 i (h 1 h 2 h 3 ) 1
• R is the eigenvectors matrix of M representing the orientation.

The density d controls only the local level of accuracy of M: (increasing or decreasing it does not change the anisotropic properties or the orientation), while the anisotropy is given by the anisotropic quotients and the orientation by matrix R. The notion of complexity C of M can also be defined:

C(M) = Z ⌦ d(x) dx = Z ⌦ p det(M(x)) dx. (4.24)
This quantifies the global level of accuracy of (M(x)) x2⌦ . From this formulation of a Riemannian metric field arises a duality between meshes and Riemannian metric spaces. This duality is justified by the strict analogy between the following discrete and continuous notions: orientation vs. R, stretching vs. r i , size vs. d and number of vertices vs. C(M). However, the class of discrete meshes represented by M is complex to describe. Indeed, we have seen that a unit mesh cannot be defined as a set of strictly unit elements, but the notion of quasi-unit elements has to be invoked once again. The following definition is adopted: in the continuous mesh framework, a continuous mesh of a domain ⌦ is defined by a set of continuous elements M = (M(x))

x2⌦ , i.e., a Riemannian metric space. It represents all the meshes that are unit for M.

Continuous linear interpolation

The model that we have just defined is used to derive error estimates. The goal was to avoid to use upper bounds of the interpolation error to derive adapted meshes, as it is usually done in studies on the interpolation error, and to be able to compute the error for any function on any continuous mesh.

Let (M(x)) x2⌦ be a continuous mesh of a domain ⌦ and let u be a non linear function which is assumed to be only twice continuously di↵erentiable. We seek a well-posed definition of the continuous linear interpolation error ku ⇡ M uk L 1 (⌦) related to a continuous mesh (M(x))

x2⌦ which implies a well-posed definition of a linear continuous interpolate ⇡ M u. More precisely, we would like the continuous linear interpolation error to be a reliable mathematical model of ku ⇧ h uk

L 1 (⌦ h )
where ⇧ h is defined by a mesh H of a discretized domain ⌦ h which is a unit mesh with respect to (M(x))

x2⌦ . The interpolation error is first derived locally (on an element) for a quadratic function, then is extended to a global definition (for any point of the domain).

Local continuous interpolate

Let us first consider a quadratic function u defined on a domain ⌦ ⇢ R 3 , and a continuous element M. For all unit elements K with respect to M, the interpolation error of u in L 1 norm does not depend on the element shape and is only a function of the Hessian H u of u and of continuous element M.

• In 3D, for all unit elements K for M, the following equality holds:

ku ⇧ h uk L 1 (K) = p 2 240 det(M 1 2 ) trace(M 1 2 H u M 1 2 ).
(4.25)

• In 2D, for all unit elements K for M, the following equality holds:

ku ⇧ h uk L 1 (K) = p 3 64 det(M 1 2 ) trace(M 1 2 H u M 1 2 ).
For all the discrete elements that are unit with respect to M, the interpolation error is the same, and is only based on continuous quantities (metric and Hessian). This last remark is important, since it shows metrics contain all the information required to compute the interpolation error, and are thus well adapted for anisotropic control of this error.

Global continuous interpolate

To define a global continuous linear interpolate, the problem is once again how to move from an expression valid for one continuous element to an expression for the case in which the metric varies point-wise. Let us now suppose now that the continuous mesh (M(x))

x2⌦ is varying and that the function u is no more quadratic but only twice continuously di↵erentiable. Equality (4.25) does not hold anymore, but all the terms of the right-hand-side M and H are still well defined continuously.

In the vicinity of a, u Q is the quadratic approximation of smooth function u and (M(x))

x2⌦ reduces to M(a) in the tangent space. There exists a unique function ⇡ M such that:

8a 2 ⌦ , |u ⇡ M u|(a) = ku Q ⇧ h u Q k L 1 (K) |K| = 1 20 trace M(a) 1 2 |H(a)| M(a) 1 2 , (4.26)
for every K unit element with respect to M(a). This result underlines another discrete-continuous duality by pointing out a continuous counterpart of the interpolation error. For this reason, the following formalism was adopted: ⇡ M is called continuous linear interpolate and |u ⇡ M u| represents the continuous dual of the interpolation error. From a practical point of view, we deduce the following analogy. Given a unit mesh H of a domain ⌦ h with respect to a continuous mesh (M(x)) x2⌦ , the global interpolation error is:

ku ⇧ h uk L 1 (⌦ h ) = X K2H ku ⇧ h uk L 1 (K) . (4.27)
In the continuous case, the discrete summation becomes an integral:

ku ⇡ M uk L 1 (⌦) = Z ⌦ |u ⇡ M u|(x) dx. (4.28)
There is no global guarantee on the reliability of the continuous interpolation error given by Relation (4.28), and in particular, there is no a priori relationship between (4.27) and (4.28). The only guarantee is the local equivalence given by Equation (4.26). However, the local guarantee becomes global when the mesh is unit with respect to a constant metric tensor and when the function is quadratic. In the latter case, by neglecting error due to the boundary discretization, we have the equality:

ku ⇧ h uk L 1 (⌦ h ) = ku ⇡ M uk L 1 (⌦) , (4.29)
for all unit meshes H with respect to (M(x))

x2⌦ . Several examples are given in [Loseille 2011b], both analytic and numerical, that confirm the validity of this analogy. They show that the model is accurate and the equivalence (4.27)⇡(4.28) is observed even for non quadratic functions and non-constant continuous meshes, and that the error due to the fact that the mesh generator generates edges with length not strictly equal to one is negligible. In particular, the range for the lengths of the edges given in Section 4.2.2 ensures reliable numerical results.

Summary

We have presented a framework that draws a correspondence between the discrete domain and the continuous domain. This framework is summarized in Table 4.1.

DISCRETE CONTINUOUS Element K Metric tensor M Element volume |K| d 1 = p det(M 1 ) Mesh H of ⌦ h Riemannian metric space M(x) = (M(x)) x2⌦ Number of vertices N v Complexity C(M) = Z ⌦ d(x) dx P 1 interpolate ⇧ h P 1 -continuous interpolate ⇡ M
Local element-wise interpolation error Local point-wise interpolation error

e h (K) = ||u ⇧ h u|| K e(x) = (u ⇡ M u) (x) e h (K) = |K| 40 6 X i=1 e T i |H u |e i (for u quadratic) e(x) = 1 20 trace M(x) 1 2 |H(x)| M(x) 1 2
Global interpolation error

X K2H ||u ⇧ h u|| K Global interpolation error Z x2⌦ e(x) dx
Table 4.1: The continuous mesh model draws a correspondence between the discrete domain and the continuous domain.

Multiscale mesh adaptation

In the previous section, we have presented the continuous mesh model, on which is based a powerful framework to handle mathematically adapted meshes. It reinforces the use of metrics that was made previously, since it establishes a duality between metric fields and adapted meshes, and it allows us to work with metrics instead of discrete meshes.

In the following section, we explain how this framework is used for mesh adaptation.

Optimal control of the interpolation error and optimal meshes

Mesh adaptation consists in finding the mesh that minimizes a certain error on a domain, for a certain sensor function. As already mentioned previously, the error we consider is the interpolation error, that we control in L p norm -depending on the choice of p, di↵erent aspects of the solution are captured, as will be seen later. The problem is stated a priori:

Find H opt having N vertices such that E L p (H opt ) = min H ku ⇧ h uk L p (⌦ h ) .
(P ) (P ) is too complex to be solved directly, since the unknown, i.e. the mesh, is made up of vertices and their topology, which is far too many degrees of freedom. Besides, several optimal meshes can be found for one sensor function (think about merely swapping an element), so the problem is ill-posed. On the other hand, it is possible to show that the problem moved to the continuous domain is well posed, and can be solved using calculus of variations. What is more, the continuous formulation of the adaptation problem uses a global point of view, while usual methods focus on a local analysis of the error. The reformulated problem is:

Find M opt having a complexity of N such that E L p (M opt ) = min M ku ⇡ M uk L p (⌦) . (4.30)
Using the definition of the linear continuous interpolate ⇡ M given by Equation (4.26), the well-posed global optimization problem of finding the optimal continuous mesh minimizing the continuous interpolation error in L p norm can be established:

Find M L p = min M E L p (M) = ✓Z ⌦ u(x) ⇡ M u(x) p dx ◆ 1 p (4.31) = ✓Z ⌦ trace ⇣ M(x) 1 2 |H u (x)|M(x) 1 2 ⌘ p dx ◆ 1 p , under the constraint C(M) = Z ⌦ d(x) dx = N.
The constraint on the complexity notably avoids the trivial solution where all (h i ) i=1,3 are zero which provides a null error. Contrary to a discrete analysis, this problem can be solved globally by using a calculus of variations that is well-defined on the space of continuous meshes. In [Loseille 2011b], it is proved that Problem (4.31) admits a unique solution. In addition, the following properties hold. Let u be a twice continuously di↵erentiable function defined on ⌦ ⇢ R 3 , H u its Hessian, the optimal continuous mesh M L p (u) minimizing Problem (4.31) reads locally:

M L p (x) = N 2 3 ✓Z ⌦ det(|H u (x)|) p 2p+3 dx ◆ 2 3 det(|H u (x)|) 1 2p+3 |H u (x)| . (4.32)
It verifies the following properties: L p (u) provides an optimal explicit bound of the interpolation error in L p norm:

• M L p (u) is unique • M L p (u)
ku ⇡ M L p uk L p (⌦) = 3 N 2 3 ✓Z ⌦ det (|H u |) p 2p+3 ◆ 2p+3 3p .
(4.33)

• For a sequence of continuous meshes having an increasing complexity with the same orientation and anisotropic quotients (M N L p (u)) N =1...1 , the asymptotic order of convergence verifies:

ku

⇡ M N L p uk L p (⌦)  Cst N 2/3 . (4.34)
Relation (4.34) points out a global second order of mesh convergence.

Controlling the approximation error

In practice, we do not know the whole solution, but only the solution at the vertices of the mesh. Let us now describe how the interpolation theory is applied when only u h , a piecewise linear approximation of the solution, is known. Indeed, in this particular case, the interpolation error estimate is not applied directly to u nor to u h . Let V k h be the space of piecewise polynomials of degree k (possibly discontinuous) and V k h be the space of continuous piecewise polynomials of degree k associated with a given mesh H of domain ⌦ h . We denote by R h a reconstruction operator applied to numerical approximation u h . This reconstruction operator can be either a recovery process [Zienkiewicz 1992a], a hierarchical basis [Bank 1993], or an operator connected to an a posteriori estimate [Huang 2010a]. We assume that the reconstruction R h u h is more accurate than u h for a given norm k.k in the sense that:

ku R h u h k  ↵ku u h k where 0  ↵ < 1 . From the triangle inequality, we deduce:

ku u h k  1 1 ↵ kR h u h u h k .

If reconstruction operator R h has the property: ⇧

h R h h = h , 8 h 2 V 1
h , the approximation error of the solution can be bounded by the interpolation error of reconstructed function

R h u h : ku u h k  1 1 ↵ kR h u h ⇧ h R h u h k .
From previous section, if H L p is an optimal mesh to control the interpolation error in L p norm of R h u h , then the following upper bound of the approximation error can be exhibited:

ku u h k L p (⌦ h )  3 N 2 3 1 ↵ ✓Z ⌦ det (|H R h u h (x)|) p 2p+3 dx ◆ 2p+3 3p .
Remark 5. It is important to note that M L p defined by Relation (4.32) applied to R h u h does not allow us to generate an optimal adapted mesh to control the approximation error ku u h k. If all assumptions are verified, this analysis states that such generated adapted meshes control the approximation error (we have only an upper bound).

In the context of numerical simulations, u

h lies in V 1 h and its derivatives ru h in V 0 h . We propose a reconstruction operator from V 1 h into V 2 h based on P 2 Lagrange finite element test functions. This operator was already used for gradients and Hessian matrices reconstruction in Section 4.2.4 As approximate solution u h is only known at mesh vertices, we need to reconstruct mid-edge values. To this end, we consider the L 2 -projection operator P : V 0 h ! V 1 h defined by [Clément 1975]:

r R u h = P(ru h ) = X p i 2H r R u h (p i ) i where r R u h (p i ) = P K j 2S i |K j |r(u h|K j ) P K j 2S i |K j |
, where p i denotes the i th vertex of mesh H, S i is the stencil of p i , the basis function of V 1 h and |K j | denotes the volume of element K j . These nodal recovered gradients are used to evaluate mid-edge values. For edge e = pq, the mid-edge value u h (e) is given by:

u h (e) = u h (p) + u h (q) 2 + r R u h (p) r R u h (q) 8
. pq , which corresponds to a cubic reconstruction.

⇧ h R h u h = u h thus ⇧ h z h = 0 . Therefore, we deduce: kR h u h ⇧ h R h u h k = ku h + z h u h k = kz h ⇧ h z h k .
Finally, the approximation error can be estimated by evaluating the interpolation error of z h :

ku u h k  1 1 ↵ kz h ⇧ h z h k  3 N 2 3 1 ↵ ✓Z ⌦ det (|H z h (x)|) p 2p+3 dx ◆ 2p+3 3p .
Note that the Hessian of z h lies in V 0 h . If nodal values are needed to build M L p , then the L 2projection operator can be applied to these Hessians, as explained in Section 4.2.4. This recovery procedure is similar to the ones of [Zienkiewicz 1992a, Zienkiewicz 1992b]. Other reconstruction operators can be applied such as the double L 2 -projection, the least square method or eventually the Green formula based approach [START_REF] Frey | [END_REF]].

Control of the error in L p norm

The classic analysis for mesh adaptation [Alauzet 2003a, Castro-Díaz 1997] was performed in L 1 norm. However this resulted in a loss of anisotropy of the adapted meshes in some cases [START_REF] Loseille | [END_REF]]. Indeed, let us consider the Heaviside function with a > 0 step: u(x) = if x > 0 and u(x) = 0 if x  0, on the segment [ 1,1]. Given a uniform mesh of this domain with size parameter h, then we can demonstrate that the interpolation error in L p norm converges at order O(h 1 p ) and thus the spatial convergence order is O(h 1 p ). When p tends to infinity, the expected convergence order is O(1). In other words, the L 1 norm will never converge in presence of discontinuities. In practice, thanks to the prescription of a minimal size, the algorithm does not diverge. An L 1 error estimate is thus not suitable for solutions with discontinuities. Consequently, L p strategies become of main interest in the case of discontinuous solutions.

Another problem with the use of L 1 error estimates is that a control of the interpolation error in L 1 does not capture the small-scale features of the solution. Several modifications of the L 1 interpolation error estimate have been considered [Castro-Díaz 1997, Löhner 1990b[START_REF] Frey | [END_REF] to overcome this issue. However, such local normalizations are only slightly more sensitive and the control of the interpolation error remains in L 1 norm. Another interest of the optimal metric in L p norm lies in its ability to catch physical phenomena of the solution which are of di↵erent scales. To illustrate this, we copy here the analytical example given in [Loseille 2011b]. We consider a function f 1 which is a smooth function involvingvariations of small and large amplitudes. The function is defined as follows: This function is composed of variations having a unit amplitude along with small variations having an amplitude of 0.01. This feature is illustrated in Figure 4.9 (top left) where a cut through the line y = 0 is depicted. The mesh adaptation process based on the control of the interpolation error is analyzed for the L 1 , L 2 and L 4 norms. Figure 4.9 shows adapted meshes composed of almost 7 000 vertices for each norm. We observe that the small amplitude waves regions are better captured when using a L p norm with a lower p (L 1 is the best) whereas the L 4 norm ignores small amplitudes regions and clearly refines more large amplitudes areas. This behavior is due to the term det

f 1 (x, y) = 8 > > > > < > > > > : 0.
|H u | 1 2p+n
in Relation (4.32) which gives more sensitivity to lower p norm. It illustrates that controlling the interpolation error in L p norm with a small value of p enables to capture all the scales of the solution.

Conclusion

In this chapter, we have presented the fundamental concepts of metric based mesh adaptation. It lies on the concept of Riemannian metric field, that allows us to compute distances varying on the computational domain. An adapted mesh with respect to a metric field is a unit mesh, ı.e a mesh whose edges have lengths close to 1 in the considered metric field. Adapting a mesh to a solution means minimizing the error of the solution on the mesh. Several error models can be considered, in this work they are based on the interpolation error. This error model is used to compute the metric fields from which the adapted mesh is generated. An iterative process is used to converge the couple mesh/solution. The introduction of the continuous mesh model, that draws a formal correspondence between discrete entities such as elements and continuous entities such as metric fields, allows us to derive more precise error models, and to perform multiscale mesh adaption. In this chapter, the basic adaptation loop for steady cases was presented, in the following chapter, we are going to see how it is extended to unsteady simulations.

Chapter 5

Unsteady mesh adaptation

In the previous chapter, mesh adaptation has been considered for steady problems only, for which there is only one solution and one mesh. In this chapter, we are going to extend the concept to unsteady simulations, where the solution is time dependent: there are now an infinity of solutions.

Generating one adapted mesh for every solver time step is not conceivable for industrial applications, because the accuracy required results in too many very small time steps and thus too many meshes to generate, which is very time consuming. Adapting the mesh every few solver iterations (i.e. adapting it at time t n then keeping the same mesh for the next few time steps) is not satisfactory either, because there is a time shift between the mesh and the solution: the mesh is adapted at time t n , but not t n+1 , t n+2 ... The evolution of the solution in the adaptation interval has to be anticipated to generate a good mesh.

This lead to the idea of splitting the simulation interval into several sub-intervals, and considering one mesh for each sub-interval, adapted to the solution at every time of the subinterval. The error estimate described for the steady state has to be modified to take into account this whole time frame.

Furthermore, the non-linearity of the adaptation problem that was highlighted in the steady case is still present in the unsteady case, and needs to be addressed. The same idea of convergence of the couple mesh/solution is applied, except that now we have several meshes and solutions. In the first works on metric-based adaptation for unsteady flows [START_REF] Alauzet | [END_REF]], each couple mesh/solution on one sub-interval could be converged independently from the others. In other words, the adapted mesh for a sub-interval only depended on the solution on this sub-interval, and one could apply a fixed-point procedure similar to the steady-case procedure for each sub-interval. Recently, a new error analysis was carried out, which is based on the continuous mesh model. In this analysis, an e↵ort is made to control the error globally -in a way that will be detailed farther -which results in a global fixed-point procedure: a couple mesh/solution is not converged alone, but the whole set of meshes and the whole solution are converged together.

This chapter aims at describing the whole adaptation loop, from theory to practice. We detail our space-time error analysis based on the continuous mesh model, and present the resulting unsteady adaptation algorithm. Then we describe how the algorithm is implemented in practice, and we present a comparison of two methods to compute a quantity called average Hessian-metric involved in the algorithm. Finally, numerical examples are given, and the parallelization of the loop is analyzed.

In this chapter, the solver used in the examples is Wolf, whose ALE version was presented in Chapter 2. Here, a standard non ALE version is used, but the spatial and temporal schemes are the same.

The works presented in this Chapter were published in [Barral 2014c[START_REF] Barral | [END_REF].

Error estimate

Let us first detail the error analysis that leads to the adaptation algorithm for unsteady simulations. This analysis is performed in the context of the continuous mesh model: first, an error model is proposed, then this error is minimized to derive an optimal mesh.

In the context of time-dependent problems, the error analysis for the steady case detailed in Section 4.4 is not su cient, since it controls only spatial errors, whereas temporal errors need to be addressed too. In this work, we do not account for time discretization errors but we focus on a space-time analysis of the spatial error. In other words, we seek for the optimal space-time mesh controlling the space-time spatial discretization error. For the type of simulations that are considered in this work, the assumption is made that as an explicit time scheme is used for time advancing, then the error in time is controlled by the error in space under CFL condition. This has been demonstrated under specific conditions in [START_REF] Alauzet | [END_REF]]. As long as this hypothesis holds, the spatial interpolation error provides a fair measure of the total space-time error of the discretized unsteady system. Notably in the case of implicit time advancing solvers, the analysis would have to be completed to take into account the temporal discretization error, as is done in [Coupez 2013].

Error model

Our goal is to solve an unsteady PDE which is set in the computational space-time domain Q = ⌦ ⇥ [0, T ] where T is the (positive) maximal time and ⌦ ⇢ R 3 is the spatial domain. Let ⇧ h be the usual P 1 projector, we extend it to time-dependent functions:

(⇧ h ') (t) = ⇧ h ('(t)) , 8 t 2 [0, T ] .
(5.1)

The considered problem of mesh adaptation consists in finding the space-time mesh H of ⌦ that minimizes the space-time linear interpolation error u ⇧ h u in L p norm. The problem is thus stated in an a priori way:

Find H opt having N st vertices such that E L p (H opt ) = min H ku ⇧ h uk L p (⌦ h ⇥[0,T ]) .
(5.2)

This problem is ill-posed and has far too many unknowns to be solved directly, as was explained previously. So it is rewritten in the continuous mesh framework under its continuous form:

Find M L p = (M L p (x, t)) (x,t)2Q such that E L p (M L p ) = min M ku ⇡ M uk L p (⌦⇥[0,T ]) , (5.
3) under the space-time constraint:

C st (M) = Z T 0 ⌧ (t) 1 ✓Z ⌦ d M (x, t) dx ◆ dt = N st .
(5.4)

where ⌧ (t) is the time step used at time t of interval [0, T ]. Introducing the continuous interpolation error, we recall that we can write the continuous error model as follows:

E L p (M) = ✓Z T 0 Z ⌦ trace ⇣ M 1 2 (x, t)|H u (x, t)|M 1 2 (x, t) ⌘ p dx dt ◆ 1 p .
(5.5)

Error estimate 123

where H u is the Hessian of sensor u. To find the optimal space-time continuous mesh, ) is solved in two steps:

(i) First, a spatial minimization is done for a fixed t.

(ii) Second, a temporal minimization is performed.

Note that both minimizations are performed formally.

Spatial minimization for a fixed t

Let us assume that at time t, we seek for the optimal continuous mesh M L p (t) which minimizes the instantaneous error, i.e., the spatial error for a fixed time t:

ẼL p (M(t)) = Z ⌦ trace ⇣ M 1 2 (x, t) |H u (x, t)| M 1 2 (x, t) ⌘ p dx ,
under the constraint that the number of vertices is prescribed to

C(M(t)) = Z ⌦ d M(t) (x, t) dx = N (t).
(5.6)

Similarly to 4.4, solving the optimality conditions provides the optimal instantaneous continuous mesh in

L p -norm M L p (t) = (M L p (x, t))
x2⌦ at time t defined by:

M L p (x, t) = N (t) 2 3 M L p ,1 (x, t) , (5.7) where M L p
,1 is the optimum for C(M(t)) = 1:

M L p ,1 (x, t) = ✓Z ⌦ (det |H u (x, t)|) p 2p+3 dx ◆ 2 3 (det |H u (x, t)|) 1 2p+3 |H u (x, t)|.
(5.8)

The corresponding optimal instantaneous error at time t writes:

ẼL p (M L p (t)) = 3 p N (t) 2p 3 ✓Z ⌦ (det |H u (x, t)|) p 2p+3 dx ◆ 2p+3 3 = 3 p N (t) 2p 3 K(t) .
(5.9)

For the sequel of this thesis we denote:

K(t) = ✓Z ⌦ (det |H u (x, t)|) p 2p+3 dx ◆ 2p+3 3 .

Temporal minimization

To complete the resolution of optimization Problem (5.3-5.4), a temporal minimization is performed in order to get the optimal space-time continuous mesh. In other words, we need to find the optimal time law t ! N (t) for the instantaneous mesh size. In this work, we consider the case where the time step ⌧ is specified by the user as a function of time t ! ⌧ (t). The analysis can be extended to the case of an explicit time advancing solver subject to Courant time step condition [Alauzet 2012], but the resulting optimal mesh is too complex to be used in practice.

Let the time step ⌧ be specified by a function of time t ! ⌧ (t). After the spatial optimization, the space-time error writes:

E L p (M L p ) = ✓Z T 0 ẼL p (M L p (t)) dt ◆ 1 p = 3 ✓Z T 0 N (t) 2p 3 K(t) dt ◆ 1 p , (5.10)
and we aim at minimizing it under the following space-time complexity constraint:

Z T 0 ⌧ (t) 1 N (t) dt = N st .
(5.11)

We are trying to find the optimal distribution of N (t) when the space-time total number of nodes N st is prescribed. We can apply the following one-to-one change of variables:

Ñ (t) = N (t)⌧ (t) 1 and K(t) = ⌧ (t) 2p 3 K(t) .
Then, the temporal optimization problem becomes:

min M E L p (M) p = 3 p Z T 0 Ñ (t) 2p 3 K(t) dt under constraint Z T 0 Ñ (t) dt = N st .
The solution of this problem is given by:

Ñopt (t) 2p+3 3 K(t) = const ) N opt (t) = C(N st ) (⌧ (t) K(t)) 3 2p+3 .
Here, constant C(N st ) can be obtained by introducing the above expression in space-time complexity Constraint (5.11), leading to:

C(N st ) = ✓Z T 0 ⌧ (t) 2p 2p+3 K(t) 3 2p+3 dt ◆ 1 N st ,
which completes the description of the optimal space-time metric for a prescribed time step. Using Relations (5.7) and (5.8), the analytic expression of the optimal space-time metric in L p -norm M L p writes:

M L p (x, t) = N 2 3 st ✓Z T 0 ⌧ (t) 2p 2p+3 ✓Z ⌦ (det |H u (x, t)|) p 2p+3 dx ◆ dt ◆ 2 3 ⌧ (t) 2 2p+3 (det |H u (x, t)|) 1 2p+3 |H u (x, t)| .
(5.12)

We get the following optimal error:

E L p (M L p ) = 3 N 2 3 st ✓Z T 0 ⌧ (t) 2p 2p+3 ✓Z ⌦ (det |H u (x, t)|) p 2p+3 dx ◆ dt ◆ 2p+3 3p .
(5.13)

Error analysis for time sub-intervals

The previous analysis provides the optimal size of the adapted meshes for each time level. Hence, this analysis requires the mesh to be adapted at each flow solver time step. In practice this approach involves a very large number of remeshings which is very CPU consuming and spoils solution accuracy due to many solution transfers. In consequence, an adaptive strategy has been proposed in [START_REF] Alauzet | [END_REF], Alauzet 2011b] where the number of remeshings is controlled (thus drastically reduced) by considering a coarse adapted discretization of the time axis, and generating adapted meshes for several solver time steps.

The idea is to split the simulation time interval into n adap sub-intervals

[t i 1 , t i ] for i = 1, .., n adap . Each spatial mesh M i is then kept constant during each sub-interval [t i 1 , t i ].
We could consider this partition as a time discretization of the mesh adaptation problem. In other words, the number of nodes N i of the i th adapted mesh M i on sub-interval [t i 1 , t i ] should for example be taken equal to:

N i = R t i t i 1 N opt (t)⌧ (t) 1 dt R t i t i 1 ⌧ (t) 1 dt .
Here, we propose a di↵erent option in which we get an optimal discrete answer.

Spatial minimization on a sub-interval

Given the continuous mesh complexity N i for the single adapted mesh used during time subinterval [t i 1 , t i ], we seek for the optimal continuous mesh M i L p solution of the following problem: min

M i E i L p (M i ) = Z ⌦ trace ⇣ (M i ) 1 2 (x) H i u (x) (M i ) 1 2 (x) ⌘ p dx such that C(M i ) = N i ,
(5.14) where matrix H i u on the sub-interval can be defined by either using an L 1 or an L 1 norm average:

H i L 1 (x) = Z t i t i 1 |H u (x, t)| dt or H i L 1 (x) = t i max t2[t i 1 ,t i ] |H u (x, t)| , with t i = t i t i 1 .
Processing as previously, we get the spatial optimality condition:

M i L p (x) = (N i ) 2 3 M i L p ,1 (x) with M i L p ,1 (x) = ✓Z ⌦ (det H i u (x)) p 2p+3 dx ◆ 2 3 (det H i u (x)) 1 2p+3 H i u (x)
. The corresponding optimal error E i (M i L p ) writes:

E i L p (M i L p ) = 3 p (N i ) 2p 3 ✓Z ⌦ (det H i u (x)) p 2p+3 dx ◆ 2p+3 3 = 3 p (N i ) 2p 3 K i .
(5.15)

where

K i = ✓Z ⌦ det H i u (x) p 2p+3 dx ◆ 2p+3 3 .
To complete our analysis, we shall perform a temporal minimization. Again, we consider the case where the time step ⌧ is specified by a function of time.

Chapter 5. Unsteady mesh adaptation Temporal minimization for specified ⌧ .

After the spatial minimization, the temporal optimization problem reads:

min M E L p (M) p = n adap X i=1 E i L p (M i L p ) = 3 p n adap X i=1 (N i ) 2p 3 K i
under the constraint:

n adap X i=1 N i Z t i t i 1 ⌧ (t) 1 dt ! = N st .
We set the one-to-one mapping:

Ñ i = N i Z t i t i 1 ⌧ (t) 1 dt ! and Ki = K i Z t i t i 1 ⌧ (t) 1 dt ! 2p 3 ,
then the optimization problem reduces to:

min M n adap X i=1 ( Ñ i ) 2p 3 Ki such that n adap X i=1 Ñ i = N st .
The solution is:

Ñ i opt = C(N st ) ( Ki ) 3 2p+3 with C(N st ) = N st n adap X i=1 ( Ki ) 3 2p+3 ! 1 ) N i = N st 0 @ n adap X i=1 (K i ) 3 2p+3 Z t i t i 1 ⌧ (t) 1 dt ! 2p 2p+3 1 A 1 (K i ) 3 2p+3 Z t i t i 1 ⌧ (t) 1 dt ! 3 2p+3 .
and we deduce the following optimal continuous mesh M L p = {M i L p } i=1,..,n adap and error:

M i L p (x) = N 2 3 st ✓n adap X i=1 (K i ) 3 2p+3 ⇣ Z t i t i 1 ⌧ (t) 1 dt ⌘ 2p 2p+3 ◆ 2 3 ⇣ Z t i t i 1 ⌧ (t) 1 dt ⌘ 2 2p+3 (det H i u (x)) 1 2p+3 H i u (x) ,
(5.16)

E L p (M L p ) = 3 N 2 3 st ✓n adap X i=1 (K i ) 3 2p+3 ⇣ Z t i t i 1 ⌧ (t) 1 dt ⌘ 2p 2p+3 ◆ 2p+3 3p ,
(5.17)

with K i = ✓Z ⌦ (det H i u (x)) p 2p+3 dx ◆ 2p+3 3 .

Global fixed-point mesh adaptation algorithm

Finally, the unsteady adaptation algorithm can be derived from this error analysis. Three main ideas govern this algorithm:

• It is based on splitting the simulation into sub-intervals.

• It is an iterative fixed point algorithm.

• It is a global algorithm.

The basic idea consists in splitting the simulation time frame [0, T ] into n adap adaptation sub-intervals:

[0, T ] = [0 = t 0 , t 1 ] [ . . . [ [t i , t i+1 ] [ . . . [ [t n adap 1 , t n adap ] ,
and to keep the same adapted mesh for each time sub-interval. On each sub-interval, the mesh is adapted to control the solution accuracy from t i to t i+1 . Consequently, the time-dependent simulation is performed with n adap di↵erent adapted meshes. This drastically reduces the number of remeshing during the simulation, hence the number of solution transfers. It can been seen as a coarse adapted discretization of the time axis, the spatial mesh being kept constant for each sub-interval when the global space-time mesh is visualized, thus providing a first answer to the adaptation of the whole space-time mesh.

We have seen in Chapter 4 that mesh adaptation is a non-linear problem, and that this is addressed with iterative algorithms to converge the mesh/solution couple. To that end we propose a fixed-point mesh adaptation algorithm. This is also a way to predict the solution evolution within a sub-interval and to adapt the mesh accordingly.

Previously, the optimal metric of a sub-interval could be computed directly once the simulation on the sub-interval had been run [START_REF] Alauzet | [END_REF]]. However, the computation of the optimal continuous mesh for sub-intervals given by Relation (5.16) involves a global normalization term which requires the knowledge of quantities over the whole simulation time frame. In this case, the normalization term is:

N 2 3 st ✓Z T 0 ⌧ (t) 2p 2p+3 ✓Z ⌦ (det |H u (x, t)|) p 2p+3 dx ◆ dt ◆ 2 3
, which requires to know all the time steps ⌧ (t) and Hessians H u (x, t) over time frame [0, T ]. Thus, the complete simulation must be performed before evaluating any continuous mesh.

To solve this issue, we suggest to consider a global fixed-point mesh adaptation algorithm covering the whole time frame [0, T ]. All the solutions and Hessian-metrics are computed, and only then can the global normalization term and thus the metrics for each sub-interval be computed. This algorithm is schematized in Algorithm 4 where H, S and M denote respectively meshes, solutions and metrics, and H is the Hessian-metric.

For i = 1, n adap (a) S j 0,i = Interpolate conservatively next sub-interval initial sol. from (H j i 1 , S j i 1 , H j i ); (b) S j i = Compute solution on sub-interval from pair (S j 0,i , H j i ); (c) |H| j i = Compute sub-interval Hessian-metric from sol. sample (H j i , {S j i (k)} k=1,nk ); EndFor 2. C j = Compute space-time complexity from all Hessian-metrics ({|H| j i } i=1,n adap ); 3. {M j i } i=1,n adap = Compute all sub-interval unsteady metrics (C j , {|H max | j i } i=1,n adap ); 4. {H j+1 i } i=1,n adap = Generate all sub-interval adapted meshes ({H j i , M j i } i=1,n adap ); EndFor

From theory to practice

Computation of the mean Hessian-metric

The optimal L p metric involves an averaged Hessian-metric H i u on sub-interval i, but it still remains to know how to compute it practically, i.e., how it is discretized. The strategy adopted [START_REF] Alauzet | [END_REF]] is to sample the solution on the time sub-interval. More precisely, n k solutions equally distributed on the sub-interval time frame are saved, including the initial solution at t i 1 and the final solution at t i . Positive Hessian |H u (x, t k )| is evaluated for each sample. If samples are distributed regularly in time, the time elapsed between two samples is

t i n k 1 .
In practice, 20 samples per sub-intervals are usually used.

The Hessian matrices are computed using a double L 1 projection as described in Section 4.2.4, or a double least-square procedure: first the gradients are computed using a linear least-squares reconstruction procedure, and a similar procedure is applied to recover the Hessians. Once these Hessians are computed, one needs to average them. In the previous algorithm [START_REF] Alauzet | [END_REF]], the following discretization was used:

H i L 1 (x) = t i n k \ k=1 |H u (x, t k )| = t i |H i max (x)| ,
where \ has to be understand as the metric intersection in time of all samples. This corresponds to an integration in time in L 1 norm of the Hessians. However, the new error analysis leads to write H i as the integral over time of the Hessian matrices, and thus the following discretization is preferred:

H i L 1 (x) = 1 2 t i n k 1 |H u (x, t i 1 )| + t i n k 1 n k 1 X k=2 |H u (x, t k )| + 1 2 t i n k 1 |H u (x, t i )| = t i |H i avg (x)| ,
where t i = t i t i 1 is the sub-interval time length and t k = t i 1 + k 1 n k 1 t i . This corresponds to an integration in time in L 1 norm of the Hessians.

A comparative study of both discretizations was performed and will be detailed in section 5.3.

Choice of the optimal continuous mesh

The optimal adapted mesh for each sub-interval is generated according to analysis of Section 5.1.4. For the numerical results presented below, we select the optimal mesh given by Relation (5.16) and the following particular choices have been made:

• the Hessian-metric for sub-interval i is discretized in time in L 1 norm.

• function ⌧ : t ! ⌧ (t) is constant and equal to 1

• all sub-intervals have the same time length t.

Moreover, it is clear that integral R

t i t i 1 ⌧ (t)
1 dt corresponds to the number of time steps (iterations) performed by the flow solver during the i th sub-interval. In practice using the number of iterations of the flow solver for each sub-interval to define the continuous mesh is an issue because it highly depends on the discrete representation of the continuous mesh, i.e., the generated discrete mesh. Thus, the number of iterations of a sub-interval may substantially vary between two fixed-point iterations. To avoid this issue, we prefer considering the flow solver time step constant on each sub-interval, and consider the time step ⌧ (t) constant equal to t (because of the global normalization term). The integral R t i t i 1 ⌧ (t) 1 dt then reduces to 1. With these choices, the optimal continuous mesh M L p = {M i L p } i=1,..,n adap simplifies to:

M i L p (x) = N 2 3 st 0 @ n adap X j=1 ⇣ Z ⌦ (det |H j L 1 (x)|) p 2p+3 dx ⌘ 1 A 2 3 det |H i L 1 (x)| 1 2p+3 |H i L 1 (x)| . (5.18)
In that case, as we assume that theoretically, one time step is done by sub-interval, and N st /n adap represents the average spatial complexity by sub-interval and thus N st is the total spatial complexity by summing the sub-intervals average complexity. We do not prescribe the temporal complexity, i.e., we do not control the number of time steps done at each sub-interval.

Specification of the space-time complexity

The optimal continuous mesh from Equation (5.16) is obtained for a given space-time complexity that is the number of vertices times the number of solver time steps. Such a complexity should thus be prescribed for each adaptative simulation. However, in practice, it depends on the time discretization of the sub-intervals. Moreover, as explained above, the number of solver time steps is highly dependent on the sizes of the elements of the mesh, which is not perfectly controlled throughout the algorithm. For these reasons, we prefer to prescribe an average number of vertices per sub-interval, which we sometimes refer to as "simplified space-time complexity" in what follows. The first steps towards a study of the space-time complexity is proposed in [Alauzet 2012].

Matrix-free P1-exact conservative solution transfer

For the unsteady adaptation algorithm, the interpolation step is crucial. Indeed, when moving from a sub-interval to the following, the solution has to be transferred from the mesh of the current sub-interval to the mesh of the following sub-interval, and this is done as many times as there are sub-intervals. It is obvious that if information is lost during the transfer process, then the accuracy of the global solution is greatly a↵ected. As stated in Section 4.2.4, the following properties seem desirable for the interpolation method: (i) mass conservation, (ii) P 1 exactness preserving the second order of the adaptive strategy and (iii) verify the maximum principle. The interpolation scheme used is detailed in Section 4.2.4.

The remeshing step

The remeshing step is also crucial in the adaptation process, as a poorly adapted mesh or a mesh with bad quality elements will impact the accuracy of the solution and spoil the e↵orts on all other parts of the process. In this work, the remesher Feflo.a [Loseille 2013] was used. Feflo.a belongs to the class of 3D anisotropic local remeshers. It aims at generating a unit mesh with respect to a prescribed metric field. Its main particularity is to adapt the volume and the surface mesh in a coupled way so that a valid 3D mesh is always guaranteed on output. It uses a unique cavity-based operator (that generalizes standard operators: point insertion, edge removal, edges swapping, point smoothing). This operator is governed by dedicated metricbased quality functions. This allows to reach a good balance between high level of anisotropy, necessary to capture the physical features of the solution, and mesh quality, necessary to ensure the stability and accuracy of the numerical scheme. Feflo.a has several enhancements designed for CFD computations, including explicit control and optimization of tetrahedra sizes to ensure a maximal time step for unsteady simulations, and surface mesh re-projection based either on CAD or on background discrete meshes.

Software used

Our implementation of the mesh adaptation algorithm described above requires successively four di↵erent software components:

• Wolf the second order Finite-Volume flow solver, whose ALE version was described in Chapter 2 -when fixed-mesh simulations are run, a standard version is used, but the numerical schemes are the same as the ALE ones, without the extra ALE velocity terms -,

• Metrix to compute the continuous space-time mesh and perform the metric fields gradation,

• Feflo.a the local adaptive remesher based on the cavity operator, described in Section 5.2.4,

• Interpol for the P 1 -conservative solution transfer, described in Section 5.2.3.

Choice of the mean Hessian-metric 131

Choice of the mean Hessian-metric

All the unsteady adaptation algorithm lies on the computation of a mean metric for each subintervals. Instead of averaging real metrics, we average the Hessians on the go during the solver iterations.

There is a choice to make concerning the way this average is done, between the historical intersection or the sum dictated by theory. The intersection of metrics reads:

H i L 1 (x) = t i n k \ k=1 |H u (x, t k )| = t i |H i max (x)| ,
It comes to making an average in L 1 norm, and has the advantage of having a clear geometric interpretation: the intersection of two metrics is the largest metric included in the two metrics.

In the context of unsteady adaptation, this means that the mean Hessian-metric has the smallest sizes met over the sub-interval. The sum of metrics comes to making an average in L 1 norm, and reads:

H i L 1 (x) = 1 2 t i n k 1 |H u (x, t i 1 )| + t i n k 1 n k 1 X k=2 |H u (x, t k )| + 1 2 t i n k 1 |H u (x, t i )| = t i |H i avg (x)| ,
It seems to be more coherent with theory. Indeed, when writing the minimization problem (5.14) with sub-intervals, we can formally derive the error from the unsteady error without subintervals (5.5) by moving the integral over time into the trace. However, it is only a formal manipulation, and the geometrical interpretation of the sum is much less clear: a term-to-term sum of metrics is clearly still a metric (a symmetric positive definite form), but the sizes of the axes of the resulting metric are not the sum of the sizes of the two input metrics. This justifies numerical experimentation to select the best approach in practice. The computation of the Hessians is performed as detailed in Section 4.2.4. The absolute value of a hessian is a metric, however, numerical Hessians need to be corrected. The absolute value of the eigenvalues is taken, and too small eigenvalues are brought to a value ensuring that a maximal anisotropic ratio is not exceeded. These modified Hessians are called Hessian-metrics.

Even so, degenerated cases can appear, i.e. cases where the linear form associated to the matrix is not positive and definite, for instance if one eigenvalue is null. This is not a problem as far as sums of Hessian-metrics are performed, but in the case of metric intersection, the operator defined in 4.2.3 is not defined. Numerically, even almost null eigenvalues (if both eigenvalues are very small for instance) are enough to put out of action the standard definition. So a procedure was devised to handle all degenerate cases. This procedure is based on appropriate changes of bases. It is too long to enumerate all the di↵erent cases here, but the procedure is detailed in Appendix A.

Both intersection and sum of metrics were tested on numerous test cases. We present here the most significant. The study was carried out in 2D for time e ciency purposes, and because the observation of the meshes is easier than in 3D. In all the following examples, the adaptation is performed in L 2 norm (i.e. p = 2). Figure 5.1: Adapted meshes on the last sub-interval of an adaption loop for the accelerated square. Left, using the sum of metrics and right, using the metric intersection.

x 2 [0.65, 0.85] and y 2 [0.4, 0.6] for the first case, and Zalesak's disk of radius 0, 2 centered in (0.75, 0.5) for the second. The velocity vector is defined for any point of the domain by: v = ( (y 0.5), x 0.5). Regarding the adaptation, the number of fixed-point iterations is set to n adap = 6, the number of sub-interval varying. A complexity is set so that the meshes have an average size of 12, 500 vertices. These cases are harder to analyze. It overall appears that the sum of Hessians gives better results (Fig. 5.2). Considering the previous analysis, and in the absence of shocks, it appears that the sum has lead to capturing better the rotation of the objects. We can see on 5.2 that the method with intersection of metrics is less good in capturing the angles of the crack.

Finally, we consider the advection of sine curves, parallel or orthogonal to the displacement. The definition of these cases is similar to the definition of the case of the accelerated square. The only di↵erence is that the scalar function is not set to 1 on the square but to cos(⇡/0.6(x 0.2)) for the parallel sine and cos(⇡/0.6(y 0.2)) for the orthogonal one. Regarding the adaptation, the number of fixed-point iterations is set to n adap = 6, the number of sub-interval varying. A complexity is set so that the meshes have an average size of 15, 000 vertices. These cases seem to confirm our previous analysis (see Fig. 5.3). In the case of the the sine parallel to the displacement, the intersection of Hessians leads to meshing the inside of the curve, while the sides are neglected. When the sine is orthogonal to the displacement, both methods are equivalent for capturing the oscillations, even if the intersection of metrics meshes more the top and bottom sides of the sine curves.

Sod shock tube

A classic Sod shock tube was also studied. This case is helpful since, not only do we known an almost analytic solution to the problem, but the solution presents two discontinuities (the shock and the contact discontinuity) and a smoother phenomenon (the rarefaction wave) to study the behavior of the adaptation algorithm.

The problem is the following: on a rectangular domain, with x 2 [0, 1] and y 2 [0, 0.2] a gas Figure 5.2: Two cases of advection with rotation: a square and Zalesak's disk. Adapted meshes on the last sub-interval of an adaption loop. Left, using the sum of metrics and right, using the metric intersection. of heat capacity ratio = 1.4 is split into two states, a left state and a right state:

W lef t (x < 0.5, t = 0) = 0 B @ ⇢ lef t u lef t p lef t 1 C A = 0 B @ 1.0 0 1.0 1 C A and W right (x 0.5, t = 0) = 0 B @ ⇢ right v right p right 1 C A = 0 B @ 0.125 0 0.1 1 C A .
The simulation is stopped at t = 0.25, before the waves reach the end of the tube. On the top and bottom sides of the tube, slipping boundary conditions are imposed, and Dirichlet conditions are imposed right and left of the tube.

The analytic solution of this problem is the classic solution of a one-dimension Riemann problem. There are three simple waves that delimit four areas. These waves are a shock, a contact discontinuity and an isentropic rarefaction. The analytic solution is described in details in the literature, for instance in [Liepmann 2002]. The main di culty in the computation of the solution is that only an implicit form of the pressure behind the shock can be found.

This example also illustrates the importance of the choice of the sensor on which the adaptation is performed, since not all fields of the solution display all the physical phenomena. Indeed, the pressure does not see the contact discontinuity: if the pressure was chosen as adaptation sensor, the area around this discontinuity would not be refined, and the physical phenomenon would be lost. The density allows us to see all the phenomena so it is chosen as sensor. The adaptation loop was used on this test case, with n adap = 15 sub-intervals and 4 fixedpoint iterations. A space-time complexity was prescribed so that the meshes have between 4, 200 and 4, 900 vertices, for an average mesh size of 4, 500 vertices. Snapshots of adapted meshes and of the solution are presented in Fig. 5.5.

Since an analytic solution is known for this problem, we can compute an error with respect to this analytic solution. To do so, we extract the solution along a line of the mesh, in this case the line y = 0.1. The line is discretized with 800 vertices regularly distributed on it. A linear interpolation is performed from the solution on the adapted mesh to this line, and the analytic solution is computed for each of the 800 vertices too. The error is then computed in L 1 norm. We find an error E = 0.12 for the simulation with the sum of metrics, and E = 0.2 for the simulation with the intersection of metrics. A close look at the solutions along this extraction line in Fig 5 .6 confirms this result: the three curves, corresponding to the solution with sum of metrics, the solution with intersection of metrics, and the analytic solution are very close and almost indistinguishable. However, a closer look at the curves, when the solution gradients vary a lot, shows the di↵erence between the two methods: at the beginning and the end of the rarefaction, the solution with sum of metrics is closer to the reference solution than the solution with metric intersection, and on a large part of the rarefaction the sum of metrics is better. Close to the shock, the solution with metric intersection is slightly better, but the di↵erence is smaller than the di↵erence in the rarefaction. These di↵erences can be explained if we look at the meshes in Fig. 5.7. The method with L 1 average tends to mesh the rarefaction with more vertices, whereas the method with L 1 norm tends to gather most of the points in the band corresponding to the shock, which is very obvious if we zoom in this band. Figure 5.7: Sod shock tube: adapted meshes of the final sub-interval for the L 1 average (left) and the L 1 average (right). Bottom, zoom on the band corresponding to the shock for these meshes.

Choice of the mean

Shock-bubble interaction

Finally, a more complex CFD case was studied: an interaction between a shock (pressure discontinuity) and a bubble (area of lower density), that is a 2D version of a problem proposed in [Langseth 2000].

The domain is a 2D cylinder, in which three regions are defined that create a shock and a bubble, see Fig. 5.8. The initial conditions are:

0 B @ ⇢ lef t u lef t p lef t 1 C A = 0 B @ 1 0 10 1 C A , 0 B @ ⇢ bubble u bubble p bubble 1 C A = 0 B @ 0.1 0 1 1 C A and 0 B @ ⇢ right u right p right 1 C A = 0 B @ 1 0 1 1 C A ,
The simulation is run until time t = 0.45. Complex pattern are created behind the shock as it moves forward in and past the bubble. The aim of multiscale mesh adaption is to capture both the moving shock and these small features of the flow as precisely as possible. The adaptation loop was used on this test case, with n adap = 25 sub-intervals and 6 fixedpoint iterations. A space-time complexity was prescribed so that the meshes have between 9, 000 and 18, 000 vertices, for an average mesh size of 14, 600 vertices. Snapshots of adapted meshes and of the solution are presented in Fig. 5.9.

Comparing the two methods for averaging the Hessians is more di cult than in the previous cases. Indeed, no analytic solution is known, and the phenomena behind the shock are instabilities and depend on the mesh on which they are computed, which means we cannot compute a reference solution on a very fine mesh, and computed errors with respect to that reference solution. Therefore, we are limited to a qualitative analysis of the results. The meshes and solutions at final time t = 0.45 are represented in Fig. 5.10 for both methods. The di↵erence between both is easy to observe: the instabilities are much better refined -and thus accurately captured -with the sum of metrics than with the intersection. The intersection of metrics tends to refine more the shock, and less the smaller amplitude phenomena. This had already been observed for the advection cases, but in this case it is not desirable, since it leads to losing a part of the solution.

Conclusion

In conclusion of this study, it appears that both methods result in similar meshes in most cases. The purely advective cases have shown both have advantages and drawbacks. However for CFD simulations, the L 1 average tends to result in meshes where the vertices are concentrated on the higher scale phenomena (typically shocks), whereas the L 1 average tends tor result in meshes where the smaller scale features are better captured. This is why we use preferably the L 1 average, or "sum of metrics".

Numerical examples

The previous unsteady adaptation algorithm is applied on numerous cases, to demonstrate its ability to improve significantly the accuracy of the solution.

2D shock-bubble interaction

First, another version of a shock-bubble interaction case was studied, with an imposed speed for the shock. The setup is showed in Fig. 5.11. A circle of radius 0.2 is centered at (0.3, 0.0) in the domain [ 0.1, 1.5] ⇥ [ 0.5, 0.5]. The gas is initially at rest and has unit density and pressure. Inside the circle the density is ⇢ bubble = 0.1. The incoming shock wave starts at x = 0 and propagates towards the bubble. The pressure behind the shock is p lef t = 10. A Mach number of M s = 2.95 is prescribed for the shock, which requires a small computation to derive the velocity u lef t behind the shock. Rankine-Hugoniot relations read:

c right M s (⇢ right ⇢ lef t ) = ⇢ right u right ⇢ lef t u lef t , c right M s (⇢ right u right ⇢ lef t u lef t ) = (⇢ right u 2 right + p right ⇢ lef t u 2 lef t p lef t ) , c right M s (⇢ right E right ⇢ lef t E lef t ) = ((⇢ right E right + p right )u right (⇢ lef t E lef t + p lef t )u lef t ) ,
(5.21) where c right is the sound celerity in the state in front of the shock, and the invariants: The simulation is run until time t = 0.4. Again, complex vorticity and mixing pattern are created behind the shock after it hits the bubble. Multiscale mesh adaption aims at capturing both the moving shock and these small features of the flow as precisely as possible. The adaptation is performed on the density, in L 2 norm, with 60 sub-intervals and 5 fixedpoint iterations. As already mentioned, it is very di cult to predict the space-time complexity of a simulation since it involves the number of vertices and the number of solver time steps. So we consider a simplified complexity, that is the sum of the numbers of vertices of the meshes of each sub-intervals, which does not depend on the time discretization of the sub-intervals. The desired accuracy was set to reach a simplified space-time complexity of 16, 000, 000 vertices, i.e. a mean complexity of 275, 000 per mesh, with a maximal mesh size of 411, 385 vertices for the final sub-interval.

⇢ lef t ⇢ right = ✓ 1 2 + 1 (1 M 2 s ) ◆ 1 , (5.22)
Snapshots of the meshes and solutions are shown in Fig 5 .12. On the solution, one can see the level of accuracy of the instabilities behind the shock, as well as the multiple shock reflections and interactions. The accuracy of the solution is such that the fractal structure of the instabilities appears clearly. This accuracy is obtained thanks to the adaptation of the meshes, which are refined in the shock areas but also in the vicinity of the smaller scale features. On this example, one can clearly see anisotropic band-shaped areas, which are typical of our algorithm with sub-intervals: they correspond to the zones of evolution of the physical phenomenon during one sub-interval. The more sub-intervals we use, the thinner these bands are, and for a constant number of vertices per sub-interval, the more accurate the solution is. This is illustrated in Fig 5 .13, where the final meshes and solutions for two adaptation loops with 10 and 60 sub-intervals are shown. The same average number of vertices per sub-interval was prescribed: 200, 000 vertices. It appears clearly that the bands are much thicker with 10 sub-intervals, while the accuracy of the solution is less good, notably on the shock, and in the areas where the flow is winding behind the shock, where less details are captured. This is due to the fact that a larger area has to be meshed with the same number of elements, resulting in larger elements, and thus a less precise solution.

Figure 5.12: 2D shock-bubble case: snapshots of adapted meshes (left) and solution (right) at dimensionless times t = 0.007, t = 0.1, t = 0.23, t = 0.4 from top to bottom.

3D circular blast

We then consider a purely three-dimensional blast problem proposed in [Langseth 2000]. In this simulation, shock waves are reflected on a box and interact with each other.

The gas is initially at rest in a box of dimension [ 1.5, 1.5] ⇥ [ 1.5, 1.5] ⇥ [0, 1]. The density . and pressure equal one everywhere, except for a sphere of radius 0.2 centered in (0, 0, 0.4), in which the pressure is 5. The gas is then left to evolve freely until time t = 0.7. Spherical shock waves emanate from the central region due to the overpressure. Wall conditions are imposed on the boundaries, so that the shock waves are reflected on them, and create complex pattern when they interact with each other.

The density of the flow is chosen as sensor variable for our mesh adaptation process. The space-time interpolation error on the solution is controlled in L 2 norm. The time frame was split into 40 adaptation sub-intervals and 5 fixed-point iterations were used to converge the non-linear mesh adaptation problem. The initial mesh is uniform and has 800, 000 vertices and 4, 700, 000 tetrahedra. The desired accuracy was set to reach a simplified space-time complexity of 40, 000, 000 vertices, i.e. a mean complexity of 1, 000, 000 per mesh.

Figures 5.14 shows the solutions and the adapted meshes at di↵erent dimensionless times. The 3D mesh adaptation for the whole sub-interval is clearly illustrated. Indeed, the mesh refinement along band-shaped regions, is clearly visible, which correspond to the evolution zone of the physical phenomena during an adaptation sub-interval. The size of the depicted meshes varies between 600, 000 and 1.3 millions of vertices.

Thanks to multiscale mesh adaptation, the complex patterns of reflected weaker shocks interacting with each other are well captured even if strong shocks are moving in the flow field. It results in an accurate solution with very few vertices compared with a uniform mesh with the smallest element size. In the moving shock region, the mesh accuracy is around 1.2 e 4 at dimensionless time 0.07 and 9.8 e 5 at dimensionless time 0.7 for a domain size of [ 1.5, 1.5] ⇥ [ 1.5, 1.5] ⇥ [0, 1].

The CPU time to perform the whole adaptive computation (i.e., the 5 loops with the 40 iterations of flow solver and solution transfer, the computation of the metric, the generation of the adapted mesh) is about 8 hours on a 20-core Intel Xeon processor at 2.5Ghz.

Figure 5.14: Adapted meshes and density solutions for the 3D blast test case, at dimensionless times 0.07, 0.315, 0.455 and 0.7. Cuts into the volume mesh are made along the plane x = 0.

3D shock-bubble interaction

We consider a 3D version of the case proposed in Section 5.3. The 3D setup is presented in Fig. 5.15: a shock wave emanates from a corner of a box and hits a bubble, a half-cylinder orthogonal to the shock, creating complex vorticity and mixing patterns. The three states are prescribed explicitly: Regarding the adaptation parameters, 60 sub-intervals are used, and 5 fixed-point iterations are performed. The initial mesh has 180, 000 vertices, and the space-time complexity is set so that the average number of vertices for the adapted meshes is 1, 000, 000. More precisely, the number of vertices is in a range from 821, 064 to 1, 504, 609 vertices. The adaptation sensor is the density and space-time interpolation error on the solution is controlled in L 2 norm.

Snapshots of the mesh and of the solution can be found in Fig. 5.16 and 5.17. It can be noted that this case is not a 3D extrusion of the 2D case, and the patterns created are really three-dimensional. The adaptation bands are clearly visible on the meshes, and the accuracy of the shock waves is greatly improved. Compared to the previous case, smaller scale mixing features are present in the flow, and multiscale adaptation aims at capturing them as well as the shock waves. A closer look at Fig. 5.16 and 5.17 confirms that these flow features are indeed captured, on the surface and in the volume. Quantitatively speaking, the mesh accuracy is around 5.7 e 6 at dimensionless time 0.080 and 2 e 5 at dimensionless time 0.5 for a domain size of [0, 1.5] ⇥ [0, 1] ⇥ [0, 0.5].

Figure 5.16: 3D shock-bubble interaction: snapshots of adapted meshes (left) and solution (right) at dimensionless times t = 0.025, t = 0.14, t = 0.26, t = 0.38 and t = 0.5 from top to bottom.

Figure 5.17: 3D shock-bubble interaction: snapshots of adapted meshes (left) and solution (right) at dimensionless times t = 0.06, t = 0.21, t = 0.35, t = 0.5 from top to bottom.

3D blast on the London Tower Bridge

Finally, the last example involves a very complex geometry. Indeed, we consider a blast on the London Tower Bridge, whose geometry was the object of the meshing contest of the 23rd International Meshing Roundtable meshing context. A CAD description of the bridge was provided, from which an initial surface and volume mesh were generated by us. The geometry and surface mesh are shown in Fig. 5.18, on which one can see all the tiny details of the surface of the building. These details are a challenge for mesh adaptation, because they result in complex pattern of the solution that the error estimate has to be able to capture, and because the adaptative (re)mesher has to be able to preserve them and preserve the anisotropy in their vicinity.

Figure 5.18: London tower bridge case: geometry and initial surface mesh.

The gas is initially at rest in a box of dimension [ 130,130] ⇥ [ 72, 77] ⇥ [0, 100]. The gas is in a constant state U 0 everywhere, except for a sphere of radius 1 centered in (3.5, 20, 10), where it is in state U

blast : 0 B B @ ⇢ 0 ⇢u 0 ⇢E 0 1 C C A = 0 B B @ 1 0 2.5 1 C C A and 0 B B @ ⇢ blast ⇢u blast ⇢E blast 1 C C A = 0 B B @ 10 0 250 1 C C A
The gas is then left to evolve freely until dimensionless time t = 25, and wall conditions are imposed on the boundaries. The spherical shock expands in the volume and hits the walls of the bridge, and insinuates itself in any hole of the geometry, while a "mushroom" develops itself in the center. We expect the adaptation algorithm to be able to capture both phenomena: the shocks and as many of their reflection as possible as well as the smaller scale instabilities of the mushroom.

To that aim, the simulation interval was split into 80 sub-intervals. The density field of the solution is chosen as sensor for the adaptation, and the error is controlled in L 2 norm.

To speed the computation up, the adaptation loop was run several times with growing spacetime complexities: first one iteration with 40 sub-intervals, the solutions and hessians being used as input for another loop of 5 iterations with 80 sub-intervals but and a lower spacetime complexity constraint, and finally one iteration with 80 sub-intervals and the targeted complexity constraint. This approach is faster than running 5 iterations of the loop with a high complexity from the start. For the last iteration, the complexity constraint was set such that the meshes have a size between 1 million and 3.8 million vertices, and the average mesh size is 2.97 million vertices. A total time of 144 hours was necessary to run the whole simulation (the iteration with 40 sub-intervals: 13 hours, the 5 iterations with 80 sub-interval and a smaller complexity: 110 hours, and the iteration with 80 sub-intervals and targeted complexity: 21 hours).

Snapshots of the meshes and solutions are shown in Fig. 5.21. The band-shaped regions distinctive of the adaptation sub-intervals are clearly visible. The accuracy of the solution is remarkable: the shocks are captured precisely, their reflections on the walls as well, even recirculations around the pillars of the bridge can be observed. The mushroom at the center of the blast is also captured with a great level of detail, as can be seen in Fig. 5.20. Views of the surface mesh can be seen in Fig. 5.19. One can notably see that the surface mesh is also adapted and anisotropic, regardless the complexity of the geometry.

At dimensionless time 3.125, the mesh accuracy is around 1.4 e 3 , and 1.1 e 3 at dimensionless time 25 for a domain size of [ 130,130] ⇥ [ 72, 77] ⇥ [0, 100]. If the domain had had to be meshed uniformly with this mesh size, several billions of elements would have been required, and the computational time would have exploded. This illustrates clearly the interest of unsteady mesh adaptation, if need still be. the mesh adaptation algorithm described above requires successively the four software components listed in Section 5.2.5.

Two di↵erent approaches are used for the two big parts of the loop: The solution computation, the solution transfer procedure and the estimation of the error are parallelized using a p-thread paradigm, whereas a pipelining strategy was selected for the metrics gradation and the generation of the meshes.

P-threads parallelization. The first strategy is an intrusive parallelization of the code using the p-threads paradigm for shared-memory cache-based parallel computers. It was already detailed in Part I Section 2.5.2. One of the main assets of this strategy resides in a slight impact on the source code implementation and on the numerical algorithms. Parallelization is at the loop level and requires few modifications of the serial code [Maréchal 2016]. However, to be e cient, this approach requires the use of a renumbering strategy, based of Hilbert space filling curves [Alauzet 2009].

Pipelining parallelization. After Step 3 of Algorithm 4, the metrics for all the sub-intervals have been computed, and there remains only to perform metric gradation and to generate the corresponding meshes. These tasks are totally independent for each sub-interval and can thus be run at the same time. Hence the pipelining approach adopted for these steps: each available processor executes the two tasks in serial for a given sub-interval, and then handles another subinterval when it is done with the first one, until all the meshes have been generated. The main advantages of this method is that it requires no modification of the serial codes, and that it can be easily used either on a single machine or on an heterogeneous architecture. To improve the e ciency of the parallelization, it is necessary to organize the distribution of the sub-intervals on the processors to balance the load on each processor. In our implementation, the sub-intervals are sorted in descending order of the expected size of the corresponding mesh, supposing that the time to generate a mesh is approximately proportional to its size. Figure 5.22 explains why this is better than sorting in ascending order: if we have four meshes of di↵erent sizes and two processors available, and that the two smaller ones are sent on the two processors first, then the two larger ones, the first processor will handle the second and the fourth meshes, whose accumulated size is larger than the accumulated sizes of the first and third meshes handled by the first processor. If the meshes are sorted in descending order, the second processor has the time to handle two meshes while the first one handles the longest one. Ascending time order Descending time order Data communication. In our implementation of the mesh adaptation algorithm, independent dedicated software are used for each step of the adaptation loop. The advantage of the proposed strategy is its flexibility. Each software block can be developed independently with its own programming language and its own optimal internal database. For instance, the flow solver can keep a static database, the mesh generator can use specific topological data structures such as the elements neighbors, etc. Consequently, we may expect a higher e ciency in memory and in CPU time for each software. The main drawback is that between two stages, the data is stored on the disk, and each software component has to write and read the data on the disk -typically a mesh and a solution field -and to rebuild its internal database. This results in a larger part devoted to I/O as compared to the all-in-one approach. However, it is expected that the CPU time for the I/O is generally negligible compared to the global CPU time. To reduce these communications, the amount of transfer out-of-core data is minimized and binary files are used.

A solution to improve the I/O overhead would be to let each software component read and build its database while the previous one is still computing. Of course, not all of the data could be loaded before the end of a computation, but in some cases a large part of it is already available. For instance, during the part of the loop where the solver and the interpolation code are alternating, the meshes are already known in advance, and could be pre-loaded, and the costly building of the topological database done in advance. Only the solution, which is lighter than the mesh, would have to be transferred between two code runs. This approach would however require some important changes in the organization of the initialization parts of the concerned codes, and the codes would have to communicate in some way that is robust and cross-platform to know when they can start reading the data and when they have to wait for the end of the data to be written.

Analysis of parallel timings

In what follows, we present an analysis of parallel timings carried out on the blast test case presented previously.

Test case considered. The test case considered is the 3D spherical blast in a box presented in Section 5.4.2.

Machines used. Parallel performance has been analyzed on two di↵erent shared-memory multi-core computers with di↵erent processors and memory access speeds:

• Computer 1:

-2 chips: Xeon E5-2670 10 cores 2.5 GHz both chips are connected by 2 QPI links with a speed of 16 GB/s

• Computer 2:

-4 chips: Xeon E7-4850 10 cores 2 GHz all chips are connected to all by 1 QPI link with a speed of 16 GB/s The characteristics of the machines and the memory mapping are represented in Figure 5.23. The machines considered have hyper-threading (HT) capabilities. For each physical core, the operating system sees two virtual cores, and distributes the workload between both when possible. Notably, it hides memory latency and cache-misses by running two processes alternatively, running one when the other is waiting for the memory. In this study, hyper-threading has been used by launching twice as many threads as the CPU has physical cores. For instance, the 4HT run means than 4 cores have been used but 8 threads have been launched. Hyperthreading clearly benefits to parallel performance, as is visible in the parallel timings (see tables below) by comparing the serial run and the parallel run on one core with hyper-threading, i.e., the 1HT columns. It is also mandatory to reach a good speed-up on multi-chips architectures by counterbalancing slower speed memory access between chips.

Timings for the solver. For the flow solver profile, the solution is computed from adimensioned time 0.6945 to 0.7 which corresponds to the last sub-interval when n adap = 128. The mesh size is 2, 173, 612 vertices, 13, 037, 975 tetrahedra and 75, 090 boundary triangles. The solver performs 36 Runge-Kutta iterations with a 5-step scheme, leading to a total of 180 time steps. The initialization stage of the code and the I/O are not taken into account. Timings and speed-ups for Computer 1 and 2 are summarized in Table 5.1 and 5.2, respectively. We can see that the strong speed up is almost perfect up to 1 chip with 10 cores with hyper-threading. The speed-up decreases when 2 chips are used, which is due to memory access speed between chips, but it still remains good and very good on Computer 1 and 2, respectively. However, the speed-up drops drastically on 4 chips on Computer 2 because there is not enough memory links between the chips. Timings for the interpolation code. The five solution fields at a-dimensioned time 0.6945 of the spherical blast problem are interpolated. The background mesh size is 2, 166, 190 vertices and 12, 993, 399 tetrahedra and the new mesh size is 2, 173, 612 vertices and 13, 037, 975 tetrahedra.For that case, 226 million tetrahedron-tetrahedron intersections have been computed and 1.7 billion tetrahedra have been generated to mesh the intersections. The initialization stage of the code and the I/O are one again not taken into account. Timings and speed-ups for Computer 1 and 2 are summarized in Table 5.3 and 5.4, respectively. We observe that the speed-ups are excellent on both computers and even super-linear for a low number of cores thanks to hyper-threading which reduces memory latency. However, for Computer 2, when more chips are used, the speed-up degrades, which is again mainly due to slower memory access between the chips (only one link between each).

Nbr. cores

Timings for a full adaptation cycle. Finally, the parallel performance of a full adaptation cycle is analyzed: all the codes involved are timed, and everything is taken into account, including software initializations and I/O. to 2, 067, 655, i.e. an average spatial mesh size for each sub-interval of 1, 631, 056 vertices and 9, 769, 645 tetrahedra. Timings and speed-ups for Computer 1 are given in Table 5.5. Several points can be noted:

• Global speed-ups are good, considered the complexity of the task, with a speed-up of 13 for 20 cores.

• Hyper-threading has a significant impact to accelerate the codes.

• One of the main reasons why the scaling is not perfect is the time dedicated to I/O and file management. This is particularly true for the solver code that often needs to save solutions in an unsteady context. A discussion on that topic was already proposed previously.

• The pipelining approach for the generation of the mesh is e cient up to a certain point: when the number of meshes is of the same order of magnitude than the number of available processors, the whole step can be slowed down by the largest mesh to generate.

• Most of the CPU time is spent on the computation of the solution and then interpolation step: respectively 60% and 30% of the total CPU time. In other words, the overhead due to the adaptation process is not so big, compared to the gain in terms of accuracy of the solution.

Conclusion

In conclusion of that study, let us give one more figure: the solver in the last fixed-point iteration, i.e. on the last series of adapted meshes, takes 16 hours in serial. In contrast, the whole adaptation process on an hyper-threaded 20-core machine takes only 4 hours. The impact of the parallelization of the process becomes obvious: even if the speed-ups are not perfect, the whole process is much faster when using the parallel capabilities of a modern computer than just computing the solution on the adapted meshes in serial. Speed-up 1.0 1.9 3.6 6.0 10.8 12.2 13

Table 5.5: Full adaptation cycle (4 iterations) timings and speed-up on computer 1 up to 20 cores with hyper-threading.

Conclusion

In this chapter, we have presented an analysis of the space-time interpolation error based on the continuous mesh framework, that results in a new optimal L p unsteady metric and leads to improving the unsteady adaptation algorithm and turn it into a global fixed-point algorithm.

The di↵erent steps of the practical implementation of the algorithm have been described. Two di↵erent methods to compute the average Hessian-metric have been compared, and we concluded that the L 1 average ("sum of metrics") was preferable to the L 1 average ("intersection of metrics"). Thanks to its e cient parallelization, the algorithm allows us to run adaptative simulations on both complex CFD cases in a very reasonable time, with a huge gain in terms of solution accuracy. Several examples of such simulations, complex notably due to the size of the meshes, the complexity of the flow and of the geometry, have been run using the unsteady adaptation algorithm, demonstrating the e ciency of the approach.

Chapter 6

Extension of unsteady mesh adaptation to moving mesh simulations

The global fixed-point adaptation algorithm being e cient to deal with time-dependent simulations with fixed meshes, we would like to extend it to time-dependent simulations with moving boundaries. The strategy adopted to move the meshes is the one described in Part I: one bodyfitted mesh is deformed to follow the moving boundaries, and an Arbitrary-Lagrangian-Eulerian (ALE) formulation of the equations is solved on this moving mesh. This moving mesh strategy preserves the number of vertices (no vertex insertion or deletion), which is a requirement in our error analysis framework. However, the error analysis presented in Chapter 5 does not take into account a possible motion of the vertices.

Several approaches can be considered to handle moving meshes within the adaptation algorithm. The main question is: how should metrics be handled ? The first approach is a Eulerian approach: the metric field is a "background" field, evolving in space and time but independently from the moving mesh. To know the value of the metric at a vertex, a projection and an interpolation has to be performed. This approach is simpler from a theoretical point of view, since the movement of the mesh is not taken into account in the metric field. However, it may be very costly in terms of CPU due to the numerous interpolations throughout a whole simulation. That is why the approach considered in this work is a Lagrangian approach: a metric is attached to a moving vertex and moves with it. If no costly interpolation step is necessary, the metric has to be corrected to take the motion into account. In pioneer works [Alauzet 2011b], no correction was performed, which gave satisfying results provided that the mesh displacement is not too large with respect to solution evolution. In this thesis, following [Olivier 2011a], we propose an ALE correction of the optimal unsteady metric, allowing us to plug it into the adaptation algorithm.

An ALE metric, which brings a first answer to this problem, was proposed in [Olivier 2011a]. In this chapter, after recalling this ALE metric, we analyze its performance on 2D and 3D analytic test cases. Then we propose an error analysis, which leads to integrating this ALE metric into the global fixed-point algorithm, and we detail how the algorithm is modified to handle the moving mesh. Finally, several examples of adaptative simulations in three dimensions and with moving boundaries are given and analyzed.

The works presented in this Chapter were published in [START_REF] Barral | [END_REF]].

ALE metric

We consider a time evolving sensor u(t), and a mesh moved with the strategy we just described. The problem is now: how to make sure that the mesh adapted to the beginning of a sub-interval will still be adapted all along the sub-interval, as it is moved with the displacement prescribed by the elasticity solution?

Let us first consider a simplified problem. t n and t n+1 are two times, ⌦ n and ⌦ n+1 the spatial domain at t n and t n+1 respectively, and is a mapping between those two domains (we assume that this mapping exists and is a di↵eomorphism):

: ⌦ n ! ⌦ n+1 x n 7 ! x n+1 = (x n ) . (6.1)
and d is the corresponding mesh displacement field, such that:

x n+1 = (x n ) = x n + d(x n ) . (6.2)
We want to find the metric M n,ALE L p from which we will generate a mesh at time t n that, once moved with displacement d, will be adapted to the sensor u at time t n+1 .

In [Alauzet 2011b], analyzing an edge between t n and t n+1 , and considering that the optimal metric at time t n+1 is the multiscale L p metric found previously in Equation (5.7), the following ALE metric at time t n was proposed 1 :

M ALE L p (x n ) = D ALE L p h Det| c H u (x n , t n+1 )| i 1 2p+3 ⇣ r n (x n ) • | c H u (x n , t n+1 )| • r n T (x n ) ⌘ , (6.3) with D ALE L p = N n+1 2 3 Z ⌦ n h det ⇣ | c H u (x n , t n+1 )| ⌘i p 2p+3 | det r n (x n )| dx n ! 2 3 . ( 6
n : c H u (x n ) = H u ( (x n ), t n+1
) and r n is the gradient on domain ⌦ n . Practically, the gradients are computed using the position of the vertices at time t n .

This can be rewritten in the more compact form:

M ALE L p (x n ) = 0 B B B B @ N n+1 Z ⌦ n h det |H ⇤ u | i p 2p+3 dx n 1 C C C C A 2 3 n Det|H ⇤ u | o 1 2p+3 |H ⇤ u | , (6.5) with |H ⇤ u | = det r n (x n ) 1 p ⇣ r n (x n ) • | c H u (x n , t n+1 )| • r n T (x n ) ⌘ . (6.6)
1 r n denotes the gradient operator performed on domain ⌦ n . Note that the gradient is not the Jacobian, i.e.

for an arbitrary vector field f = (f1, . . . , fn), its gradient matrix is rf =

⇣ @f j @x i ⌘ ij .
The latter formulation is similar to the classic unsteady L p metric formulation of Equation (5.7), except that a Hessian matrix corrected with r n is used, and it is thus the one used in practice. Relation (5.16) is then used to derive a metric for sub-intervals.

Analytic examples

The previous result gives us the optimal metric that will lead to an adapted mesh once the mesh it was used to generate is moved with a given displacement. Let us illustrate this result on analytic examples. We consider a variety of sensor functions and displacements, both in 2D and 3D.

Procedure

A uniform mesh H n 0 , a displacement field d between two times t n and t n+1 , and a sensor u n+1 at the final time are given. The goal is to generate a mesh H n at the initial time that, once moved into H n+1 ALE = d(H n ) will be adapted to the sensor. At the same time, a reference adapted mesh is computed, that is directly adapted to sensor u n+1 . To do so, the classic steady-state procedure described in Section 4.2.4 is considered. Since the sensor is analytic and to be fair with the ALE version, only one iteration of the algorithm is performed. The metric used is normalized to look like the regular optimal metric for unsteady simulations, obtained from the hessian of the sensor. In what follows, we note H n+1 ALE the mesh obtained with the ALE procedure and H n+1 ref the mesh directly adapted. The procedure is detailed in Algorithm 5.

Algorithm 5 Procedure used to generate the meshes with the ALE metric and the regular metric in order to compare the output.

• Generation of an adapted mesh with the ALE metric

1. r n = Compute transformation gradient ((H n 0 , d) 2. H n+1 0 = Move mesh (H n 0 , d) 3. u n+1 = Compute target sensor H n+1 0 4. M n,ALE L p = Compute ALE metric H n+1 0 , u n+1 , r n 5. H n = Adapt mesh ⇣ H n , M n,ALE L p ⌘ 6. H n+1 ALE = Move mesh (H n , d) • Generation of an adapted with the standard method 1. M n+1 L p = Compute metric H n 0 , u n+1 , H u n+1 2. H n+1 ref = Adapt mesh H n 0 , M n+1 L p
According to the above developments, we expect the mesh H n+1 , obtained by moving the vertices of H n with d, to be optimal for the control of the interpolation error of u n+1 in L 1 norm.

To study the adapted characteristic of the resulting meshes, two quantities are considered:

• the mesh quality, computed using the metric M n+1 L p of the reference adapted mesh (i.e. the one that was adapted directly). The quality measure is the one recalled in Section 4.2.2, Equation (4.16).

• the error committed when the sensor function is projected on the mesh remains the best way to evaluate if the mesh is really adapted to a sensor. Here we consider the interpolation error k⇧ h u uk for sensor u, where ⇧ h u is the piecewise P 1 function with ⇧ h u(P i ) = u(P i ) for any vertex P i of the mesh. The displacement considered are straight-line displacements of somewhat large amplitude, whereas infinitesimal displacements have been considered in the theoretical analysis. However, this is closer to real life simulations, with large displacements even within a sub-interval. Note that the ALE metric does not guarantee that the mesh moved at time t n+1 is still valid. In practice, mesh optimizations deal with this issue and ensure the validity of the mesh together with its quality. In this study, no mesh optimization is performed on the adapted mesh, or during the adaptation or moving process, to avoid altering the results of the quality analysis. For the same reason, unlike in the actual adaptation loop, no gradation is performed.

Computation of the error

We compute the error with respect to the analytic solution. To do so, we use quadrature formulas:

k⇧ h u uk L 1 = R ⌦ |⇧ h u u| = P K R K |⇧ h u u| = P K |K| P P Q j w j |⇧ h u(P Q j ) u(P Q j )| (6.7)
where K are the elements (triangles or tetrahedra), P Q j are the quadrature points for each element and w j are the weights of the quadrature scheme. Let K be an element K in dimension n, and (P i ) i=1...n+1 its vertices. A quadrature point P Q is identified with its barycentric coordinates ( i ) i=1...n+1 . Its Cartesian coordinates are a linear combination of the Cartesian coordinates of the vertices:

P Q = X i=1...n+1 i P i .
The analytic function can thus easily be computed on each quadrature point. The value of ⇧ h u(P Q ) is a linear combination of the values at the vertices:

⇧ h u(P Q ) = X i=1...n+1 i u(P i ) .
We use the third order quadrature schemes described in [START_REF] Dunavant | High degree e cient symmetrical Gaussian quadrature rules for the triangle[END_REF]] for 2D and in [Jinyun 1984] for 3D. In 2D, there are 4 quadrature points, of multiplicity 1 and 3, cf Table 6.1, and in 3D there are 5 quadrature points of multiplicity 1 and 4, cf

Functions considered

The sensor functions here are taken from [Olivier 2011a], so we can confirm and complete the analysis proposed in this work. Each sensor presents specific features (smoothness, discontinuities, features of di↵erent scales...) that are as many di culties for the adaptation process, so that handling them correctly shows the robustness of the approach. As for the displacements, they are set so that the displacement is null on the boundaries.

In 2D. We have a set of sensors represented in Fig. 6.1: and a set of displacements (note that we have corrected the formulas from [Olivier 2011a]) represented in Fig. 6.4:

u n+1 0 (x, y) = x 2 + y 2 , u n+1 1 (x, y) = 8 > > > < > > > : 0.01 sin (50xy) if |xy| 2⇡ 50 sin (50xy) if |xy| < 2⇡ 50 , u n+1
d 3 (x, y, z) = 2 6 6 6 6 6 6 6 6 6 6 4 0 ( 0.3 (y + 1) z 2 1 exp 5y 2 , if y 0 0.3 (y 1) z 2 1 exp 5y 2 , if y < 0 ( 0.3 y 2 1 (z + 1) exp 5z 2 , if z 0 0.3 y 2 1 (z 1) exp 5z 2 , if z < 0 , d 4 (x, y, z) = 0.5(x 2 1)(y 2 1)(z 2 1) 2

Results

Images of the meshes adapted with the ALE metric at time t n (before being moved) and t n+1 (after being moved) are shown in Fig. 6.5 6.6 6.7 6.8 in 2D and Fig 6.9 and 6.10 in 3D. Visually, we can see that the meshes at time t n+1 are indeed adapted to the sensors as expected. Looking at the meshes at time t n illustrates the mechanism of this adaptation: before the movement, the adapted mesh is deformed so that the areas with small elements are carried away by the displacement. Stretching and compression of the mesh are anticipated by creating smaller or bigger elements.

Results for the error

In Tables 6.3 and 6.4, we show the error for the 2D cases, for a uniform mesh, for a mesh adapted directly and for a mesh adapted with the ALE metric and moved. Two mesh complexities are considered: a small one, with 25, 000 vertices, and a bigger one with 250, 000 vertices. First, we can note that for all the sensors, the error on the adapted mesh is generally significantly lower than on the uniform mesh, for the same number of vertices, even when the uniform mesh has small elements. Actually, we can see that the error on an adapted mesh with 25, 000 vertices is close to the error on a uniform mesh with 250, 000 vertices. There is one exception to this observation, for sensor u 0 , which is a smooth quadratic function, for which the adapted mesh is slightly less good. Indeed in this case, the optimal mesh is the uniform mesh: the adaptation tends to be over-sensitive to discrete errors when generating the metric, which results in a non perfectly uniform mesh. However, the error for the adapted mesh is still very close to the error for the (optimal) uniform mesh, so the adapted mesh is good.

We can now compare the error for the meshes adapted directly and the meshes adapted with the ALE procedure. In all the cases, the error for the two meshes is very close (around 5% of relative di↵erence), which clearly indicates that the ALE procedure results in meshes that are actually adapted as expected. The error for the meshes adapted with the ALE procedure is always slightly higher, which could have been predicted, due to the extra approximation made when deriving the ALE metric. Moreover, in these cases without mesh optimizations, a few elements may have a bad quality that influences the error.

Convergence curves are represented in Fig. 6.11, for sensor u 1 and displacement d 1 . The error is plotted for meshes ranging from 13, 000 vertices to 500, 000 vertices. To avoid bias, the initial mesh (on which the metric is computed) is the same in all cases, and has a large enough number of vertices. First, we can see both error curves are very close, the curve of the meshes adapted with the ALE method being only slightly above the reference curve. Furthermore, both curves are straight lines, with the same slope, which is the order 2 slope (see Relation 4.34).

The study of the error for the 3D cases, given in Tables 6.5 and 6.6, for meshes of complexities 600, 000 and 6, 000, 000, confirms the e ciency of both direct and with the ALE procedure, adaptation to reduce the error. Once again, the error on the adapted meshes is one order of magnitude smaller than the error on the uniform mesh for the non quadratic sensor, and is very close to the error on the uniform mesh for the quadratic sensor. For the 3D cases, the error for meshes adapted with the ALE metric is still slightly higher. This can be explained by a larger number of bad quality elements obtained after the mesh displacement, which is mainly due to the absence of mesh optimization.

Results for the quality

The analysis of the meshes quality is in agreement with the analysis of the error. We have gathered some quality statistics for the mesh adapted directly with the standard procedure (H n+1 ref ), and the meshes adapted with the ALE procedure (H n+1 ALE ) with the two displacements. Only the small complexity cases are shown here (25, 000 vertices in 2D and 600, 000 vertices in 3D) because the results are the same for the larger complexity. We can see that the quality of the meshes adapted with the standard procedure is excellent for all sensors, with generally more than 99% of the elements having a quality between 1 and 2, which could be expected since the quality is computed using the metric that was used to generate these meshes: it proves the quality of the remesher feflo.a, both in 2D and 3D. If we have a look at the qualities for the meshes adapted with the ALE metric, we can see that the quality of these meshes is excellent. This clearly shows that meshes that have been generated at t n with the ALE metric are almost perfectly adapted to the corresponding analytic sensors once moved at time t n+1 . More precisely, the meshes for the quadratic sensors u 0 (Tables 6.7) and u 4 (Table 6.11) have virtually no bad element, with the both displacements, since the worst quality is 13 in 2D and 36 in 3D. For the other sensors, u 1 (Tables 6.8), u 2 (Tables 6.9), u 3 (Tables 6.10) in 2D and u 5 (Table 6.12) in 3D, although the overall quality is excellent, a few bad elements may appear (less than 0.01% of the total number). These bad elements mostly appear close to the boundaries of the domain, and are very likely due to the fact that we explicitly do not move vertices of the boundaries. More particularly, bad elements appear for sensor u 5 with displacement d 4 . In this case the displacement is really complex, and maybe too far from the order 1 at which the analysis of Section 6.1 was carried on. Maybe higher order terms would help handling this case. However, it must be noted that the overall quality for this case is still very good.

The corresponding error is:

E ALE,i L p (M ALE,i L p ) = 3 p (N i ) 2p 3 ✓Z ⌦ (det H ALE,i u (x)) p 2p+3 dx ◆ 2p+3 3 = 3 p (N i ) 2p 3 K ALE,i , (6.10) where K ALE,i = ✓Z ⌦ det H ALE,i u (x) p 2p+3 dx ◆ 2p+3 3
. The error being constant on the subintervals by hypothesis, the temporal optimization problem for the case where the time step ⌧ is specified by a function of time reads: min

M ALE E ALE L p (M ALE ) p = n adap X i=1 E ALE,i L p (M ALE,i L p ) = 3 p n adap X i=1 (N i ) 2p 3 (K ALE,i ) 2p+3 3
, under constraint:

n adap X i=1 N i Z t i t i 1 ⌧ (t) 1 dt ! = N st .
Finally, proceeding as in Section 5.1.4, we write the optimal ALE metric for sub-intervals:

M ALE,i L p (x) = N 2 3 st ✓n adap X i=1 (K ALE,i ) 3 2p+3 ⇣ Z t i t i 1 ⌧ (t) 1 dt ⌘ 2p 2p+3 ◆ 2 3 ⇣ Z t i t i 1 ⌧ (t) 1 dt ⌘ 2 2p+3 (det H ALE,i u (x)) 1 2p+3 H ALE,i u (x) .
(6.11)

Once again, we stress that preserving the number of degrees of freedom when moving the mesh is essential in the process.

Algorithm

Few things need to be modified to extend the fixed-point algorithm to moving mesh ALE simulations. The overall algorithm remains unchanged: the simulation time frame is still divided into sub-intervals, and a global fixed-point strategy is used to converge the meshes and the solutions. On each sub-interval, the mesh remains the same, in that no remeshing is performed. However, and it is the first di↵erence, within a sub-interval, the mesh is moved using the algorithm presented in Part I Section 1.1. One or several mesh deformation steps are performed during a sub-interval. To compute the ALE metrics at each sampling time, we use the displacement given by the mesh deformation step (elasticity or IDW solution), without taking into account the optimizations. To justify this, we consider that the displacement due to the smoothing is small compared to the mesh deformation. Moreover, the displacement due to the smoothing cannot be predicted. The second di↵erence concerns the computation of the metrics in the solver. The metric is no more associated to a fixed location in space, but it is rather attached to the moving vertices. Moreover, the ALE metric from (Eq. 6.11) must now be used. As in the standard algorithm, the average Hessian-metric is computed from the modified Hessian given by Relation 6.6 and averaged in L 1 norm (performing a sum of metrics rather than an intersection), and the average is performed on a sample of Hessians of the solution.

Update of the metric for optimizations

As regards the mesh optimization procedure, which is applied throughout the sub-interval time frame during the displacement of the mesh, special care must be given to the choice of the metric on which the computation of the quality is based. Indeed, the use of an incorrect metric will drive the optimizations to move vertices to a wrong location and to break the anisotropy, thus spoiling the adaptation of the mesh. At a given fixed-point iteration j, the metric corresponding to the current solution is not known, since the global normalization term cannot be computed before the end of the iteration. Thus, we have to use the ALE metric of the previous subinterval. However, since the mesh is deformed throughout a sub-interval, the metric M ALE,i L p that is used to generate the mesh at the beginning of the sub-interval at time t i 1 does not correspond to the mesh at time t > t i 1 . In the theory developed in the previous sections, the ALE correction is applied on the Hessian matrices H before the normalization and not on the metrics M. Therefore, from the ALE metric at the beginning of a sub-interval [t ) could be pre-calculated at fixed times t j , and then the metric at time t would be interpolated from two of these precalculated metrics. This method has two drawbacks: it requires storing the modified Hessian matrices H⇤ throughout the sub-intervals to be able to compute the pre-calculated metrics, which is costly in terms of memory and I/O, and the numerous interpolations are costly in terms of CPU time. The second possibility is to derive an approximate metric at time t from the ALE metric at the beginning of the sub-interval and the displacement. We chose this last possibility, and deform the metric together with the mesh.

Here, we propose to adopt the same reasoning as the one that lead to the ALE metric in Section 6.1, but on a reverse time interval. Let our sub-interval be [t i 1 , t i ], t a time in this sub-interval and d the displacement field of the mesh between t i 1 and t. Our goal is to "move" the metric that is given at the beginning of the sub-interval t i 1 into a metric at t. The problem is reversed, and we seek for the metric at time t that will result in a mesh adapted to the metric at time t i 1 once moved with displacement d. At time t i 1 , the metric is M ALE,i L p

(the mesh at time t i 1 is generated directly using this metric). For easier notation, we set t = t k+1 and t i 1 = t k . Displacement d is the displacement of vertices between t k and t k+1 :

x k+1 = x k + d(x k ) and we write d 0 (x k+1 ) = x k x k+1 = d(x k ). We define 0 : ⌦ k+1 ! ⌦ k x k+1 7 ! x k = 0 x k+1 = x k+1 + d 0 (x k+1
) . (6.12)

Following [Alauzet 2011b], we consider an edge e k+1 at time t k+1 , and write that we want it to be adapted to metric M ALE,i

L p at time t k . 1 = h e k ⇣ 0 (x k+1 ) ⌘i T • M ALE,i L p ⇣ 0 (x k+1 ) ⌘ • e k ⇣ 0 (x k+1 ) ⌘ = ✓ h r k+1 0 (x k+1 ) i T • e k+1 (x k+1 ) ◆ T • M ALE,i L p (x k ) • ✓ h r k+1 0 (x k+1 ) i T • e k+1 (x k+1 ) ◆ = ⇣ e k+1 (x k+1 ) ⌘ T • n r k+1 0 (x k+1 ) • M ALE,i L p (x k ) • r k+1 0 T (x k+1 ) o • ⇣ e k+1 (x k+1 ) ⌘ .
In other words, the metric we are looking for at time t is: 6.13) and we expect that this metric is close to M ALE (x(t)). This metric is easy to compute on the fly, because the central term M ALE,i L p (x(t i 1 )) is known and the gradients are easy to compute, since the displacement considered in 0 is the opposite of the current displacement of a vertex.

M optim,i L p (x(t)) = r 0 (x(t)) • M ALE,i L p (x(t i 1 )) • r 0 T (x(t)) , (

Handling of the surface

In the present algorithm, we stick to the choice presented in Part I, Section 1.1.5, and mentioned in the previous section. The boundary vertices are not moved on the surfaces, except in the specific case of planes orthogonal to the axes of the frame. This may result in a small loss of accuracy close to the surfaces, where one might want the adaptation band-shaped areas to move consistently in the volume and on the surface, however, since the boundary displacement is consistent from one fixed-point iteration to the other, the ALE metric should be able to handle it.

3D numerical examples

A few examples in 3D are given to validate our approach. The codes used are the same as those listed in the previous chapter (see Section 5.2.5), with the exception that the solver is used in its ALE version detailed in Chapter 2.

Shock tube in expansion

The first example is a variation of the classic Sod shock-tube problem, with a tube being homogeneously expanded in one direction. This a priori simple test case shows that the refined regions follow the physical phenomena of interest, and that the anisotropy is well preserved despite the mesh being moved.

The tube initial dimensions are [0, 1] ⇥ [ 0.15, 015] ⇥ [0, 1], and the gas is split in two regions: for x  0.5 the state is (⇢ lef t , u lef t , p lef t ) = (1, 0, 1) whereas for x > 0.5 the state is (⇢ right , u right , p right ) = (0.125, 0, 1). The gas is then left to evolve freely, and the classic rarefaction wave, contact discontinuity and shock wave appear and evolve in the tube. The tube is expanded to the right with the following movement imposed to the mesh vertices:

8 > > < > > : x(t) = x 0 + 1.5x 0 • t y(t) = y 0 z(t) = z 0 .
The simulation is run until time t = 0.66 so that the size of the tube doubles. Special transmitting conditions are prescribed in x = 0, so that the rarefaction wave can go out of the tube. For that case, 20 sub-intervals were prescribed, and 4 fixed-point iterations were performed. The density field is used as sensor for the adaptation, and the error is controlled in L 2 norm. A simplified space-time complexity of 400, 000 vertices was prescribed (i.e. the sum of the numbers of vertices per interval), and the meshes have an average size of 21, 000 vertices.

The meshes at di↵erent time steps and the corresponding solution are shown in Figure 6.12. Not only do the waves evolve in the refined bands, but those bands also move as the tube is expanded. The adapted regions are transported together with the mesh in accordance with our algorithm, that associates metrics to a moving vertex rather than to a fixed position in space. In Figure 6.14, we zoom on the solution at the beginning and the end of the eighth sub-interval to stress the evolution of the physical phenomena inside an adaptation band during a sub-interval. In Figure 6.13, we show the mesh at the beginning and at the end of the last sub-interval, to emphasize the movement of the adapted regions together with the movement of the tube boundaries, preserving the anisotropy. Figure 6.12: Adapted meshes and density solutions for the expanding shock tube case at time 0, 0.5 and 0.66. Cuts into the volume mesh are made along the plane y = 0. Figure 6.13: Mesh at the beginning (top) and end (bottom) of the eighth sub-interval. One can see the bands are move forward as the tube is being expanded.

Moving ball in a shock tube

In the second example, we take the same shock tube as previously, but we add a moving ball inside the tube instead of the expansion, that interacts with the shock and the contact discontinuity. At initial time, the gas is split in two states: for x  0.5 the state is (⇢ lef t , u lef t , p lef t ) = (1, 0, 1) whereas for x > 0.5 the state is (⇢ right , u right , p right ) = (0.125, 0, 1). A ball of radius r = 0.02 is immersed in the gas, its center being in position (0.75, 0, 0). The tube is fixed, while the ball has a constant speed v ball = 0.3 e x . The simulation is run until final time t f = 0.5. After a while, the ball goes through the shock and the contact discontinuity, creating complex patterns both in front of it and in its wake. We expect all these physical phenomena to be captured correctly by the multiscale adaptation algorithm. For that case, 80 sub-intervals were prescribed, and 5 fixed-point iterations were run, and the density field is used as sensor for the adaptation. A simplified space-time complexity of 21, 000, 000 vertices was prescribed, and the meshes have an average size of 260, 000 vertices with a size range going from 100, 000 to 450, 000 vertices.

The meshes at di↵erent time steps and the corresponding solution are shown in Figure 6.15. Since we are interested in the interaction of the ball with the shock and contact discontinuity, we only show the part x > 0.5 of the tube. The meshes shown are the ones at the end of the sub-intervals, i.e. the meshes that have been moved. The adaptation allows us to capture the two waves with a good accuracy all along the simulation, but also to recover some more complex features around the ball. It is interesting to note that the shock is perfectly meshed as soon as the ball has gone through it. A closer look at the surface of the ball also shows that it is adapted with highly anisotropic elements, and the anisotropy close to the surface is well preserved.

For this simulation, allowing mesh optimization (smoothing and edge/face swapping) is mandatory, otherwise, the shearing created by the advance of the ball in the volume mesh quickly creates invalid elements. Consequently, it is crucial to compute the quality criteria that triggers optimization with regards to the actual metric of the mesh. In this case, it is clear on the figures that the swaps did not break the anisotropy in the anisotropic adapted regions, although nearly 4.5 millions of swaps were performed during the last fixed-point iteration (around 55, 000 per sub-interval). Figure 6.15: Adapted meshes and density solutions for the ball in a shock tube test case, at times 0.07, 0.12, 0.19 and 0.44. Cuts into the volume mesh are made along the plane y = 0.

Nosing-up f117

The following example has already been presented in Part I Section 3.2.2. We consider a F117 aircraft nosing up and down inside a susbsonic flow, creating vorticity in its wake.

The total simulation interval t 2 [0, 816] was divided into 96 adaptation sub-intervals, and 5 fixed-point iterations were used. The adaptation sensor is the local Mach number, and the error is controlled in L 2 norm. The number of vertices per mesh is 649, 242 on average, ranging from 100, 000 to 1, 380, 000. The minimal tetrahedron height is 7e 4 at the beginning of the 66th sub-interval, where the number of vertices is maximal, while the aircraft is 230 units long.

Views of the adapted meshes and the corresponding solution are displayed in Fig. 6.16. In comparison with the simulation without adaptation, the vortical wake is propagated much farther from the plane, and the patterns of the vortices are more precisely captured. The observation of the meshes shows that the the meshes are actually refined only in the vicinity of the wake, and with such a precision that one can see the vortices being created, evolving and vanishing just by looking at the meshes. A view at several meshes within the same sub-interval shows that the mesh evolves continuously following the physical phenomena. In the wake far from the aircraft, the elements are highly anisotropic, whereas they have to be isotropic in the area of vorticity due to the characteristic of the physical phenomena (smaller size of the details).

Two F117 aircraft flight paths crossing

Finally, our last example was also presented in Part I Section 3.2.3. Two F117 aircraft have crossing flight paths, at a speed of Mach 0.4. This example was challenging in terms of moving mesh, due to the large displacement of the geometries and the shearing induced by the movement of the aircraft, and is all the more so with adapted meshes.

The adaptation parameters are the following: the adaptation is performed on the density field, the error is controlled in L 2 norm, the time interval is divided into 50 sub-intervals, 3 fixedpoint iterations are performed, and a simplified space-time complexity of 38, 000, 000 vertices is targeted. The meshes have between 360, 000 and 825, 000 vertices, for an average mesh size of 380, 000 vertices. The smallest height generated is 5.5 e 4 at the beginning of the tenth sub-interval, for a domain of dimension [ 1800, 2400] ⇥ [ 800, 1000] ⇥ [ 1200,1200].

The meshes and density solutions at di↵erent time steps are shown in Figure 6.18. The meshes are well adapted to the solution. Compared to the simulation without adaptation, the wakes of the F117s are captured far from the aircrafts, and their interactions with the waves are clearly visible. The anistropy of the meshes is clearly visible, in front of the aircrafts (corresponding to the acoustic waves), and in their wake, even if the anisotropic ratios are not so large, due to limitations in terms of computing power and time. On Figure 6.17, a close up on the two aircrafts is made, that shows the adapted surface mesh and solution.

Conclusion

In this section, we have recalled the formulation of an ALE metric, that is used to generate a mesh at a certain time t n that will be adapted at a later time once moved with a certain displacement. We have verified this formulation on a variety of analytic cases, establishing that the ALE metric results in meshes almost as good as the meshes adapted with the standard procedure, both in terms of error and quality. The error analysis from Chapter 5 has then been modified to take into account the mesh movement, resulting a slightly modified global fixedpoint adaptation algorithm: a corrected Hessian-metric is computed instead of the regular Hessian-metric, and the mesh is moved with the connectivity-change moving mesh algorithm presented in Chapter 1. This algorithm was used to run adaptative simulations in 3D, for which the gain in terms of solution accuracy validates the chosen adaptation approach.

Conclusion

This part addressed metric-based mesh adaptation for time dependent simulations. In Chapter 4, a brief survey of mesh adaptation is presented, and all the concepts of metric-based adaptation on which this thesis is based are introduced, notably the concept of continuous mesh which enables new error analysis and optimization. This concept is used in Chapter 5 to derive an improved version of the unsteady fixed-point mesh adaptation algorithm. Notably, a global normalization term arises, which results in a global fixed-point algorithm. Two methods to compute a mean Hessian-metric on the adaptation sub-intervals are analyzed. An e cient parallelization of the algorithm was carried out, which makes it possible to run a number of unsteady 3D simulations with an accuracy unthinkable a few years ago, see [START_REF] Alauzet | [END_REF]]. Finally, in Chapter 6, all the previous works converge to the design of a mesh adaptation algorithm for moving meshes. An ALE metric proposed in [Olivier 2011a] allows to generate meshes that will be adapted once moved with a certain displacement. Analytic examples validated this metric, and it was used within a new error analysis, to derive an ALE metric for adaptive sub-intervals. The regular time-dependent algorithm was modified to use this metric, and coupled with the moving mesh algorithm. Three dimensional adaptive simulations with moving boundaries are presented and analyzed, as proofs of concept of our approach.

The main contributions of this thesis with respect to pre-existing work in the GAMMA group are:

• A new formulation of the metric intersection was proposed.

• A new version of the global fixed-point unsteady mesh adaptation algorithm was used.

• Two methods to compute the average Hessian-metric were compared, in L 1 norm (sum of metrics) and L 1 norm (intersection), leading to the use of the first instead of the latter that was used so far.

• An analysis of the parallel performance of the adaptation loop was carried out, resulting in improvements to the parallelization. Thanks to this parallelization, 3D unsteady adaptive simulations were run, with much larger mesh sizes than before.

• A study of the error on analytic cases for the ALE metric confirmed its adapted characteristic.

• A new error analysis was carried out for adapted moving meshes and the adaptation algorithm was deduced from it.

• An update strategy was proposed for the metric at mesh optimization times, to avoid spoiling the adaptation with optimizations.

• Several adaptive simulations with moving meshes were run in three dimensions.

Several perspective arise from this work, notably:

• To improve the adaptation algorithm, the next step is to control the temporal error. This would in particular lead to automatic adaptation of the size of the sub-intervals. This appears to be all the more important with moving meshes, where the size of the mesh is not even constant throughout a sub-interval.

• The convergence of this unsteady adaptative method needs to be studied, depending on the number of vertices and/or the size of the sub-intervals, as well as the influence of the initial solution on the final solution, and the ability of the algorithm to recover features of the solution lost due to coarse initial meshes.

• The metric used for optimizations during the adaptation loop should be analyzed in detail. Indeed, this step is crucial in the adaptation process, since it controls where the elements actually go.

• Vertices should be allowed to move on non plane surfaces. However, this is very complicated, since it requires reconstructing the surfaces with a good geometric accuracy to avoid introducing errors due to bad surface representation.

• At longer term, adaptative moving mesh methods mentioned in 4.1.3 appear as an interesting alternative to prescribe the displacement of the vertices, and possible interactions with metric based unsteady adaptation should be investigated.

Conclusion and perspectives Conclusion

In this thesis, we have covered the whole chain of adaptive simulations with moving boundaries: moving mesh algorithms, ALE solvers and adaptation for unsteady flows have been studied, all finally converging to an adaptation algorithm for moving mesh simulations in three dimensions.

The work presented here follows from [Olivier 2011a], and presented updates for most stages of the adaptation chain. It also presents a 3D implementation of our approach, demonstrating the e ciency of metric-based mesh adaptation for complex 3D adaptive time-dependent simulations with moving meshes involving large displacements.

The main improvement concerning moving meshes was the addition of a di↵erent mesh deformation method in the connectivity-change algorithm. The mesh deformation, i.e. the displacement of the vertices following the moving bodies, can be computed either via a PDE (with an elastic analogy) or via a direct interpolation method (the Inverse Distance Weighted method). Although a few di↵erences appeared, both methods present generally excellent results, which proves the robustness of the overall moving mesh algorithm. Large displacement of the geometries can be handled e ciently without remeshing. So far, mostly rigid moving bodies had been considered. In this thesis, we addressed deformable geometries, on which the moving mesh algorithm works perfectly, and started to look into boundary layer meshes and large volume variations.

This moving mesh algorithm was devised to be used with an Arbitrary-Lagrangian-Eulerian solver, that was presented in detail. This solver is based on already existing schemes, but a choice was made among the numerous possibilities available in the literature to make it both robust and accurate. Spatial discretization mostly consisted in adding ALE velocity terms to the standard fixed mesh version of our in-house solver: second order spatial accuracy is reached thanks to an HLLC approximate Riemann solver and MUSCL-like gradient reconstruction. Regarding temporal discretization, an approach based on the Geometric Conservation Law allowed us to build high-order multi-step Runge-Kutta schemes. The computation of the geometric parameters required by these schemes was clarified in 3D. Swaps, that allow us to preserve a good mesh quality throughout the simulation, are handled with a linear interpolation between two solver time steps.

This solver was implemented in 3D and parallelized with a multi-thread paradigm. Several validation test cases were run, which confirmed the expected order of accuracy. Notably the influence of swaps, essential to the moving mesh algorithm, was studied and proved to be of little influence on the solution accuracy due to the limited number of such operations. Other 3D examples were run, involving complex geometries, displacements and flows, both with imposed motion or with Fluid-Structure Interaction. They prove the e ciency of the chosen approach, allowing us to run complex moving mesh simulations in a reasonable time, without ever remeshing. Some progress had been made since the first unsteady fixed-point adaptation algorithm in [Alauzet 2003a]. In this thesis, a new version of the fixed-point algorithm is used, based on a new analysis of the space-time error using the recent continuous mesh theory. Theory and experiment combined enabled to clarify certain points of the process, notably the choice of an averaged Hessian term essential in the algorithm. Thanks to an e cient parallelization, an analysis of which being provided, several 3D adaptative simulations were run with an accuracy unthinkable a few years ago.

Finally, all the bricks presented above are gathered and combined to result in an adaptation algorithm for unsteady simulations with moving meshes. An ALE metric had been presented in [Olivier 2011a], that makes it possible to move a mesh into an adapted mesh. This metric was plugged into an error analysis based on the continuous mesh model, and results in a correction to the optimal metric for the global fixed-point algorithm. Besides the use of this novel metric, a few updates were made to the fixed-mesh unsteady algorithm to handle moving meshes, notably the metric on which optimizations are performed had to be studied. Finally, several 3D simulations were run, that validate the chosen approach: adaptative 3D complex simulations with moving meshes can be run, bringing a noticeable gain in accuracy for a reasonable time.

Perspectives

This thesis is a small step in the field of mesh adaptation, but a wide variety of perspective stem from this work.

The unsteady fixed-point algorithm has proved to be remarkably e cient and flexible when it came to improve it with new theoretical results. Future work will certainly focus on improving the space-time error analysis with moving meshes, notably by introducing a better control of the temporal error. This would notably result in an automatic adaptation of the sizes of adaptation the sub-intervals of the fixed-point algorithm. More generally, the convergence of unsteady adaptative simulations must be addressed.

Concerning the solver, the handling of the swaps can also be improved, to make them totally transparent even on simulations where a large number of swaps would be required. Two trails are withing range: first, an ALE version of the operator was introduced in [Olivier 2011a] in 2D and could be extended to 3D, second, a conservative interpolation of swaps could be performed, using the interpolation procedure already used in the adaptation process. The first solution has the advantage of being fully ALE, but the second is much easier to design. Explicit solvers may not be optimal for some unsteady simulations, due to their limiting of the solver time step. Implicit solvers have been reported in the literature to improved the simulation cost and should be investigated.

Time consumption is a huge limitation in the size and the complexity of the problems considered. Mesh adaptation appears as an answer to this problem, by helping to reduce greatly the size of the meshes while preserving the solution accuracy. However, it is only really e cient if it is coupled to an e cient parallelization of the codes. In this thesis, only shared memory parallelization has been considered. In the medium term, it seems that considering other kinds of parallelization will be unavoidable: reflections on parallelization of meshing software on distributed memory were started in [Loseille 2013], and the parallelization of the fluid solver on GPU was started in this thesis (see Appendix B). Both approaches may have to be combined in order to take advantage of recent hybrid computation clusters.

The work presented in this thesis is an open gate to more complex problems. The ALE simulations that have been showed involve inviscid flows modeled by the Euler equations and rigid bodies. However, we have shown that moving deformable bodies with boundary layer meshes is within range, which opens the way to Navier-Stokes simulations. Already, a lot of ALE schemes are available for viscous simulations [START_REF] Hay | High-order temporal accuracy for 3D finite-element ALE flow simulations[END_REF]], which facilitate the task, together with many works on adaptation for viscous flows [Menier 2015, Gammacurta 2010]. The FSI aspect can also be improved, by replacing the 6-DOF model by continuous elastic materials. The loose coupling could be replaced by more sophisticated strong coupling schemes. In this way, complex problems from aeroelasticity to biology could be run, in the interest of both industries and researchers.

Adaptative moving meshes are a very dynamic field of research, parallel to metric based adaptation. By coupling strongly the physical equations and the mesh movement, the vertices are moved at the same time as the solution to keep the meshes adapted at any time. These methods get rid of interpolation issues, with meshes of sensibly smaller size than those generated with the fixed point algorithm. However, most research on this subject has been so far limited to simple (convex) 2D geometries. Both approaches could be combined, for instance moving mesh equations providing the mesh deformation in the current fixed-point adaptation algorithm. During this thesis, preliminary works have been carried out to study Monge-Ampère equation [Chacón 2011] or a modified elasticity problem [Arpaia 2015] as moving mesh equations, and opened interesting perspectives.

Another promising research perspective is goal-oriented adaptative simulations, that reduce the size of the meshes by only meshing the features useful for the computation of a certain quantity. Goal-oriented metric based mesh adaptation has produced interesting results for steady problems [Loseille 2010a, Power 2006] and has been extended to unsteady ones [Belme 2011]. The latter work could be used as a starting point to derive a goal oriented adaptation strategy for moving meshes. Currently, one of the main bottleneck is the backward computation of the solution required by adjoint schemes, which requires to store the positions of the mesh at every time step. If an e cient strategy was found, the interest of industry would definitely be aroused, notably for Fluid-Structure Interaction problems.

Finally, the high-order elements have been used for a long while, mostly in Finite Element Methods (FEM), but only by increasing the order of the approximation polynomials. It has not been followed by meshing software, who have been generating flat pseudo high-order elements until very recently, i.e. standard P 1 elements with more nodes on the edges. The generation of really high-order meshes is only in its earliest infancy. Lately, progress has been made on the generation of P 2 curved meshes [Johnen 2013, Abgrall 2014], but theoretic results show the limitations of such approaches for too high orders for a whole mesh [George 2015b, George 2015a]. However, a smart use of curved meshes seems to be promising, notably by enabling a much more accurate representation of curved boundaries. The extension of metric-based mesh adaptation to such meshes has not been undertaken yet, let alone for moving boundary problems, but it seems to be an exciting field of research, full of new problems to solve.

There are more degenerate cases to handle in 3D and some are more complex. Geometrically speaking, a degenerate metric with one null eigenvalue is represented by a cylinder with an elliptic basis, and a degenerate metric with two null eigenvalues is represented by two parallel planes. As previously, let us write:

M 1 = 0 B B @
u 1 • • • • • • v 1 • • • • • • w 1 • • • • • • 1 C C A ,
and

M 2 = 0 B B @
u 2 • • • • • • v 2 • • • • • • w 2 • • • • • • 1 C C A .
1. If (at least) one of the matrices is null or if (at least) one the matrices is definite positive, the procedure defined in 2D is applied.

2. If each metric has two null eigenvalues (let us suppose µ 1 = ⌫ 1 = µ 2 = ⌫ 2 = 0), two cases are distinguished depending on whether the planes corresponding to the two metrics are parallel or not. u 1 and u 2 are the eigenvectors corresponding to the non null eigenvalue (and are thus vectors normal to the planes of the degenerate directions). Let u = u 1 ^u2 . (a) If u = 0, i.e. if the planes are parallel, the intersection is made of the pair of planes with the smallest gap between them :

M 1\2 = P 0 B B @ max( 1 , 2 ) 0 0 0 0 0 0 0 0 1 C C A P T ,
where P is made up with u 1 , v 1 and w 1 . (b) If u 6 = 0, the planes are intersected, but direction u is still infinite (a straight line along u = u 1 ^u2 cannot intersect either M 1 or M 2 by definition). The intersection is represented by a cylinder with an elliptic basis. To find this ellipse, a 2D basis is build with vectors included in the degenerate directions of M 1 and M 2 : e 1 = u ? 1 and e 2 = u ? 2 with e 1 , e 2 2 vect(u 1 , u 2 ). M 1 and M 2 are written in this basis: Then, to move back to 3D, a classic change of basis is performed: where P is made up of eigenvectors v 1 , w 1 and w 2 (see 2D case 5b). Alternatively, one can take the basis of M 2 , and truncate it in the degenerate direction:

M 1 = e 1 T M
M 1\2 = P 1 T 0 B B @
M 1\2 = P 1 T 0 B B @ 2 0 0 0 µ 2 0 0 0 ⇠ 1 C C A P 1 ,
where P is made up of eigenvectors u 2 , v 2 and w 2 and ⇠ = 1 <u 1 ,w 2 > 2 . 4. If both metrics have one and only one null eigenvalue (⌫ 1 = ⌫ 2 = 0), we intersect cylinders with elliptic bases.

(a) If the degenerate directions are the same, the intersection is represented by a cylinder. Finding its basis comes to finding the intersection of two 2D non degenerate metrics. The same procedure as in the 3D case 3a is applied.

(b) If the degenerate directions are not the same, the metric can be expressed simply in basis (w 1 , w 2 , w = w 1 ^w2 ).

M 1\2 = P 1 T 0 B B @ w 1 T M 2 w 1 0 0 0 w 2 T M 1 w 2 0 0 0 max(w T M 1 w, w T M 2 w) 1 C C A P 1 ,
where P is the matrix made up with vectors w 1 , w 2 and w. Remark 6. If these procedures are applied, one is sure to have a resulting metric included in the metrics to be intersected, and the degenerate cases are no more blocking points for the code. However, it remains to be proved that the resulting metrics are indeed of maximal volume, which is not obvious, especially in some 3D cases.

the sub-arrays is reduced and the result is stored in the first sub-array. This method gives way to a lot of optimizations, but our global strategy (with no explicit management of memory and workgroups) prevents us from making it really e cient.

Our alternative method consists in preparing in advance arrays of reduced sizes, and then reduce consecutive portions of the array to iteratively have arrays of size n/8 instead of arrays of size n, until we reach an array of size 256 that can be processed serially. In order to test both methods, the computation of the time step was implemented with the classic method and the computation of the residual with the other method.

Flux computation. The computation of the flux is the trickiest part of the code, because the flux at the vertices is updated by computing fluxes at the edges. In the sequential code, the edges are processed linearly, the formulas of the flux are applied on each edge, and the states of the two vertices at the ends of the edge are updated with the edge flux. On a GPU, this does not work anymore: if the computations of the fluxes of each edge are run in parallel all the threads corresponding to an edge sharing one vertex are going to try to update the state of this vertex at the same time, resulting in an undetermined state for the vertex (concurrency issue).

To overcome this issue, we adopted a simple solution. The computation is split in two steps: first, the edges are processed, storing the edge flux in an array indexed by the indexes of the edges, then the vertices are updated linearly using this edge flux array. To that end, it is required to compute the ball of edges neighboring a vertex at the initialization stage of the code. This way, concurrency issues are avoided, but the drawbacks are first the use of an extra array of size 5 times the number of edges to store the edge flux, and second the need to launch a second kernel to update the vertices (time is lost due to the overhead when launching a kernel, and due to the time necessary to go through all vertices).

B.5 Results and timings

To validate the code and test its performances, we have used a classic test case provided by the ONERA: a subsonic flow around a M6 wing geometry. The liberty to chose the parameters of the solver being reduced, this case o↵ered a good balance, simple enough to run with the simplified solver but complex enough to be meaningful. The validation of the code was performed step by step: after having implemented one part of the code on GPU, its output was tested against the output of the CPU version. The global output of the solver was also tested all the time, with the remaining parts being launched in their CPU version. On Fig. B.2, we show the density field of the solution after 1, 000 solver iterations on the bigger mesh, and we can see that the solutions are the same, although numerical artifacts such as a di↵erent handling of floating point numbers lead to tiny (negligible) di↵erences.

Timings

We have realized some interesting timings on these two test cases and on several machines. The three considered GPUs are:

• (GPU 1) an NVIDIA Tesla m2070 board (448 cores and 6 GB of memory), on the computation cluster of the Jacques Louis Lions Laboratory at University of Paris VI, which is a board dedicated to scientific computation,

• (GPU 2) an NVIDIA GeForce GT 330M board (48 cores and 512 MB of memory) on a Two series of timings are presented in Tables B.1 and B.2. They both confirm the interest of the chosen approach, since the code is always faster on GPU, despite its many imperfections. However it is clear that reaching the same speed-up factors as on structured grids will be di cult.

On the smaller mesh, the computation-dedicated GPU is more than twice as fast as the CPU code on a 4-core hyperthreaded processor, which is reasonable for a first version. On the desktop computer, the GPU version is 1.75 times faster than the CPU version using all the cores: comparing the price and the energy consumption of both devices, the gain is obvious. On the bigger case, the GPU is still faster than a computation-dedicated server. The speed-up factor is lower (but still > 1), due to the limitations of our implementation choices, but the GPU code can still compete with a fast hyperthreaded 8-core CPU, with extreme memory conditions (for the bigger case, the memory of the GPU is full). In general, the laptop GPU is relatively slow, which was expected for laptop hardware, mostly designed for video display. To reach good performance, GPU devices with a large number of cores and e cient memory bandwith.

The timings can be analyzed more in depth, in relation with the 4 big parts described in section B.4.

The time required to initialize the data is clearly more important for the GPU, which is normal because all the data has to be converted in to the structures for the GPU, which leads to going through the whole mesh several extra times, and then the data has to be copied to the GPU memory, which is a slow process. However, the initialization stage is short relatively to the rest of the computation, all the more short as the size of the simulation is large.

The two reductions, implemented with two di↵erent methods, are interesting. The partlyoptimized version (computation of the residual) is a little faster than the other (computation of the minimal time step). On the smaller mesh, the di↵erence is very slight, but it is very perceptible on the bigger mesh, since the optimized version is twice as fast as the other. This observation should lead to go back on our choice to not handle explicitly memory levels. As expected, reduction is a bottleneck in GPU code: it is hardly faster on GPU than on CPU. The performance of these loops are very di↵erent depending on the GPU device, which is the occasion to observe the influence of the material architecture of GPUs on their performance: two big boards built with di↵erent designs can have very di↵erent behaviors.

The computation of boundary conditions is fast, which is due to the small number of boundary vertices. However, relatively to the number of vertices, the GPU time required is disappointing, and requires further investigation.

A lot of time is gained on the advance in time stage, which can be explained by the simplicity of the corresponding code, which is a textbook case for GPU programming: the sum of two arrays.

Finally, let us examine the longest part of the code, the computation of the volume fluxes. On GPU or CPU, it is the heart of the solver, and it is the part where a lot of time can be gained or lost. This stage is faster on GPU on the smaller mesh, but loses in e ciency on the bigger mesh. The longest part of this stage is the gather of the edge fluxes on the vertices: the code goes through the vertices, and for each vertices it goes through its ball of edges to access the corresponding edge fluxes. The ball of edges does not have the same size for every vertices, which is a problem since workgroups have only one control unit. Moreover, this loops su↵ers from multiple indirections and cache misses. Indirections cannot be circumvented, because we part that requires the most CPU e↵ort is going through the ball of edges, which represents a third of the total simulation time, and which we will be trying to speed up again.

B.6 Conclusion

These results are promising. With a reasonable investment in terms of man-time, and without dwelling into the subtle arcana of GPU architecture, we wrote a code that is five times as fast as the same code running on all the cores of a recent computation-dedicated server. These performances, in relation to the price of a GPU and to its electric consumption, make GPUs interesting for the conception of simulation codes, including complex codes.

At longer term, the success of such architectures will depend on their capability to evolve as fast as CPUs to remain competitive, to larger memories on the devices or to faster access to the central memory of the host machines, and probably as well on the existence of wrappers such as the gmlib, to facilitate semi-automatic conversion to GPU languages. In the mean time, hybrid architectures such as Intel Xeon Phi processors are developing, answering partially to the problems raised by GPUs, and may be the future of High Performance computing.

=

  Compute body vertex displacement from current translation speed v body , rotation speed ✓ body and acceleration a body for [t, t + t] (b) d = Solve elasticity system d body

Figure 1

 1 Figure1.1: Top left, the swap operation in two dimensions. Top right, edge swap of type 3 ! 2 and face swap 2 ! 3. Bottom left, the five possible triangulations of the pseudo-polygon for a shell having five elements. Bottom right, an example of 5 ! 6 edge swap. For all these figures, shells are in black, old edges are in red, new edges in green and the pseudo-polygon is in blue.

Figure 1 . 3 :

 13 Figure 1.3: Interpenetrating cylinders test case. Initial (left) and final meshes with the elast elasticity-based (center) and IDW (right) methods.

Figure 1 . 4 :

 14 Figure 1.4: Interpenetrating cylinders test case. Evolution of the mesh and solution of the mesh deformation problem with the elasticity-based (top) and IDW (bottom) mesh deformation methods at times 12, 18 and 25.

Figure 1 . 6 :

 16 Figure 1.6: Shuttle test case. Snapshots of the ejection of the SRBs at times 0, 5, 10, 15, 20 and 25.

Figure 1

 1 Figure 1.7: Shuttle test case. Mesh deformation solution at time 12 (top) and final meshes at time 25 (bottom) for the elasticity-based method (left) and the IDW method (right).

Figure 1 . 8 :

 18 Figure 1.8: Squeezing can test cases: outside mesh. Initial mesh (left), displacement given by the elasticity-based (top left) and IDW (top right) mesh deformation problems at time 0.5, and final meshes with elasticity (bottom left) and (bottom right) IDW.

Figure 1 . 9 :

 19 Figure 1.9: Squeezing can test cases, inside mesh. Initial mesh (left), displacement given by the elasticity-based (top left) and IDW (top right) mesh deformation problems at times 0.75, and final meshes with elasticity (bottom left) and (bottom right) IDW.

Figure 1 .

 1 Figure 1.10: Bending beam test case. Top: initial mesh. Center: displacement given by the elasticity-based (left) and IDW (right) mesh deformation problems at time 0.8. Bottom: final meshes with both methods.

  Figure 1.11: One BL test case. Initial mesh (a) and close up on the BL (b), final mesh with elasticity (c) and IDW (d), and close-ups on the final BL meshes with elasticity (e) and IDW (f).

Figure 1 .

 1 Figure 1.12: Ten BL test case. Initial mesh (left) and close-ups on the final BL mesh (right), with the elasticity-based mesh deformation method.

Figure 1 .

 1 Figure 1.14: Engine piston. Left: provided surface mesh with the piston in upward position (time t = 0). Right: cut in the mesh with the piston is in extended position. The valves are visible, the one of the left is half open and the one on the right is closed.

Figure 1 .

 1 Figure 1.15: Engine piston. The moving bodies (the valves and the piston) are decomposed into a deformable part and a rigid part.

Figure 1 .

 1 Figure 1.16: Engine piston. Volume mesh at di↵erent times of the first crank cycle: t =0, 13, 25, 37, 50, 62, 75, 88 and 100.

  the interface around edge e ij of cell C s i .

Figure 2

 2 Figure 2.2: Interface of a finite volume cell made up of facets (left) and boundary interface (right).

Figure 3 . 1 :

 31 Figure3.1: Test case of the static vortex (3D). Error curves comparing the simulation on a fixed mesh (red) and on a moving mesh (blue) for several mesh sizes. Left, the evolution of the error over time, right convergence curves with respect to the size of the mesh.

  Figure3.2: Test case of the static vortex (2D). Error curves comparing several temporal schemes: standard explicit Euler scheme (blue), SSPRK(4,3) (green), SSPRK(5,2) (red). Left, evolution of the error over time and right, error at a fixed time varying with the CFL number.

Figure 3 . 3 :

 33 Figure3.3: Test case of the static vortex (3D). Error curves comparing the simulation on a fixed mesh (red), on a moving mesh without swaps (blue) and on a moving mesh with swaps (green) for several mesh sizes. Left, the evolution of the error over time, right convergence curves with respect to the size of the mesh.

Figure 3

 3 Figure 3.4: Test case of the plate. Initial conditions of pressure on the plate: the pressure is set to 1 everywhere, except on dark red areas where it is set to 2.

  Figure 3.6: Piston test case. 2D representation of the problem.

Figure 3

 3 Figure 3.7: Piston test case. Displacement (top) and piston pressure (bottom).

Figure 3

 3 Figure 3.8: Piston test case. Pressure fields at 2/5 of the final time. m = 10 and t = 0.0025 (top), m = 100 and t = 0.0079 (center), m = 1000 and t = 0.025 (bottom). The mobile piston is on the right.

Figure 3

 3 Figure 3.9: Initial meshes for the AGARD CT 1 (left) and CT 5 (right).

Figure 3 .

 3 Figure 3.10: AGARD CT 1: Snapshots of the solution at di↵erent times of the second period.

Figure 3 .

 3 Figure 3.11: AGARD CT 5: Snapshots of the solution at di↵erent times of the second period.

  Figure 3.12: AGARD CT case 1.

Figure 3 .

 3 Figure 3.14: Test case of the nosing up F117. Semi-structured meshes in initial horizontal position, and upward position.

Figure 3 .

 3 Figure 3.15: Test case of the nosing up F117. Isolines on several cutting planes of the mach field at di↵erent time steps (t = 0.49, 0.85, 1.22, 1.47, 2.08, 2.82, 3.31, 3.80, 4.28 and 4.90).

Figure 3 .

 3 Figure 3.16: Test case of the two F117s. Zoom on the aircraft mesh (left) and solution (right) just before they pass each other.

Figure 3 .

 3 Figure 3.17: Test case of the two F117s. Mesh deformation solution at time t = 81 with the linear elasticity method (left) and the IDW method (right).

Figure 3 .

 3 Figure 3.18: Test case of the two F117s. Snapshots of the moving geometries and the mesh (left) and density (right).

Figure 3 .

 3 Figure 3.20: Test case of the door ejection. Snapshots of the moving geometry and the mesh (left) and pressure (right).

  an ellipsoid of center a and whose axes are aligned with the eigen directions r i of M. The set M (1) is called the unit ball of M, and the sizes of its axes are h i = 1 2

Figure 4 . 1 :

 41 Figure 4.1: Unit balls associated with metric M = R ⇤ R T in two and three dimensions.

Figure

  Figure 4.2: Natural mapping M 1 2 associated with metric M in two dimensions. It sends the unit ball of I 2 onto the unit ball of M.

  Figure 4.3 gives an example of a Cartesian surface associated with a Riemannian metric space. This Riemannian metric space is pictured by drawing the unit ball of the metric at some points of the domain. A link with di↵erential geometry is proposed in [Olivier 2011a].

Figure 4

 4 Figure 4.3: Left, example of a Cartesian surface embedded in R 3 . Right, geometric visualization of a Riemannian metric space (M(x)) x2[0,1]⇥[0,1] associated with this surface. At some points x of the domain, the unit ball of M(x) is drawn.

  composed only of unit length edges then its volume |K| M in M is constant equal to:

Figure 4

 4 Figure 4.4: Metric-based mesh generation. Left, specified Riemannian metric space. Right, unit mesh in the prescribed Riemannian metric space which becomes adapted anisotropic in the Euclidean space.

Figure 4 . 5 :

 45 Figure 4.5: Left, view illustrating the metric intersection procedure with the simultaneous reduction in 3D. In red, the resulting metric of the intersection of the blue and green metrics. Right, metric interpolation along a segment where the endpoints metrics are the blue and violet ones.

Figure 4 .

 4 Figure 4.7 points out the superiority of the P 1 -conservative solution transfer (right) compared with the classic P 1 interpolation (left) on an adaptive blast simulation in two dimensions. For both simulations, all parameters are the same except for the solution transfer stage. This figure shows the final solution obtained with 70 mesh adaptations, i.e., a total of 70 solution transfers. The di↵usion and the error introduced by the classic P 1 solution transfer clearly spoils the solution accuracy while the solution remains very accurate with the P 1 -conservative operator.

Figure 4 . 7 :

 47 Figure 4.7: Final result of a blast adaptive simulation with 70 mesh adaptations. Left, using a classic P 1 solution transfer. Right, using the P 1 -conservative solution transfer.

Figure 4 •

 4 Figure 4.8: Several unit elements with respect to a metric tensor in 3D.

Figure 4 . 9 :

 49 Figure 4.9: Top left, representation of function f 1 along the cut line y = 0. Optimal adapted meshes for norms L 1 (top right), L 2 (bottom left) and L 4 (bottom right). Each mesh is composed of about 7 000 vertices.

Algorithm 4

 4 Mesh Adaptation Loop for Unsteady Flows Initial mesh and solution(H 0 , S 0 0 ) and set targeted space-time complexity N st // Fixed-point loop to converge the global space-time mesh adaptation problem For j = 1, n ptf x 1. // Adaptive loop to advance the solution in time on time frame [0, T ]

Figure 5 . 3 :

 53 Figure 5.3: Two advection cases of sine curves, parallel (top) and orthogonal (bottom) to the velocity vector . Adapted meshes on the last sub-interval of an adaption loop. Left, using the sum of metrics and right, using the metric intersection.

Figure 5

 5 Figure 5.4: Sod shock tube solution. Region IV, the shock is moving to the right, region III the contact discontinuity moves to the right and region II the rarefaction moves to the left.[Image from Wikipedia]

Figure 5 . 6 :

 56 Figure 5.6: Sod shock tube: plots of 1D extraction of the solution for both L 1 average (sum) , L 1 average (intersection) and analytic solution. Full solution (top left) and zooms on the discontinuities.

Figure 5 . 8 :

 58 Figure 5.8: Shock bubble interaction test case.

5. 3 .

 3 Figure5.9: Leveque's shock-bubble interaction problem: snapshots of adapted meshes (left) and solution (right) at times t = 0.018, t = 0.09, t = 0.18, t = 0.45 from top to bottom.

Figure 5 .

 5 Figure 5.10: Leveque's shock-bubble interaction problem: solution (top) and mesh (bottom) at final time for the L 1 average (left) and the L 1 average (right).

  of the case, and setting = 1.4, Relations (5.22) and (5.23) directly lead to: ⇢ lef t ⇡ 1 and p lef t ⇡ 10. From which we can deduce the sound celerities (c =

  Figure 5.11: Shock bubble interaction test case.

Figure 5 .

 5 Figure 5.13: Comparison of final meshes and solutions for an adaptation loop with 10 (top) and 60 (bottom) sub-intervals..

  Figure 5.15: Initial configuration for the 3D shock-bubble problem.

Figure 5 .

 5 Figure 5.19: London tower bridge case: surface mesh at dimensionless time t = 21.

Figure 5 .

 5 Figure 5.21: London tower bridge case: snapshots of adapted meshes and solution at dimensionless times t = 0.63, t = 8.6, t = 17.2, t = 25.

Figure 5 .

 5 Figure 5.22: Sorting the sub-intervals in descending order of their expected runtime results in better balancing of the e↵ort and a smaller overall runtime.

Figure 5 .

 5 Figure 5.23: The two machines used to analyze the parallel performances of the adaptation loop. The squares represent the chips, and the arrows the memory links between the chips.

  .4) where N n+1 stands for the complexityC M n+1 L p ⇥ u n+1 ⇤, and the b . operator transports a quantity from ⌦ n+1 to ⌦

(

  Figure 6.1: Adaptation sensors used: u n+1 0

  Figure 6.3: Adaptation sensors used: u n+14

Figure 6 . 4 :

 64 Figure 6.4: Displacements used: uniform mesh moved with displacements d 3 (left) and d 4 (right).

Figure 6 . 5 :

 65 Figure 6.5: Mesh adapted with the ALE metric at time t n (left) before the displacement and t n+1 (right) after the displacement, for sensor u n+1 0 and displacements d 1 (top) and d 2 (bottom).

Figure 6 . 6 :

 66 Figure 6.6: Mesh adapted with the ALE metric at time t n (left) and t n+1 (right), for sensor u n+1 1

Figure 6

 6 Figure 6.7: Mesh adapted with the ALE metric at time t n (left) and t n+1 (right), for sensor u n+1 2

Figure 6 .

 6 Figure 6.14: Zoom on the mesh and solution at the beginning (top) and at the end (bottom) of the last sub-interval. Once can see the two waves move forward in the adapted bands.

Figure 6 .

 6 Figure 6.16: Nosing up F117 test case: adapted meshes (view from the top) and local Mach number isolines at di↵erent time steps.

Figure 6 .

 6 Figure 6.17: Two F117s test case : close-ups on the surface mesh of the aircraft and the corresponding solution.

Figure 6 .

 6 Figure 6.18: Two F117s test case: adapted meshes and density solutions at di↵erent time steps. Cuts into the volume mesh are made along the plane y = 0.

  where P is the matrix made up with vectors e1 , e 2 et u. 3. If one of the two metrics has two null eigenvalues and the other has only one null eigenvalue, intersecting the metrics comes to intersecting two parallel planes with a cylinder. Let us suppose µ 1 = ⌫ 1 = ⌫ 2 = 0. u 1 is normal to the degenerate planes of M 1 , and w 2 is the infinite direction of the cylinder of M 2 .

  Two meshes were used (see Fig.B.1): one not too big to run tests on it with 58, 619 vertices and 311, 310 tetrahedra and a bigger one with 1,015, 149 vertices, et 5, 448, 373 tetrahedra.

Figure B. 1 :

 1 Figure B.1: Volumic and surfacic view of the meshes used, left with 58, 619 vertices and right with 1, 015, 310 vertices.

Figure B. 2 :

 2 Figure B.2: Reference solution and solution fully computed on a GPU.

  Anisotropic Error Estimates for Adapted Dynamic Meshes, N.[START_REF] Barral | [END_REF] F. Alauzet, ADMOS 2015, Nantes, France, June 2015.

	Contents	9
	Communications
	•

and F. Alauzet, 44th AIAA Fluid Dynamics Conference, AIAA Paper 2014-2773, Atlanta, GA, USA, June 2014.

  Chapter 1. Connectivity-change moving mesh strategy Algorithm 2 Connectivity-Change Moving Mesh Algorithm with Curved Trajectories Input: H 0 , S 0 , t 0 = Compute boundary vertices displacement from current translation speed v body , rotation speed ✓ body and acceleration a body for [t, t + t/2] d(t + t/2) = Solve elasticity system d |@⌦ h (t + t/2), t/2 (c) d |@⌦ h (t + t) = Compute boundary vertices displacement from current translation speed v body , rotation speed ✓ body and acceleration a body for [t, t + t] d(t + t) = Solve elasticity system d |@⌦

	While (t < T end )
	1. Solve mesh deformation: compute vertices trajectories
	(a) t 0 = t
	(b) d |@⌦	h (t + t/2)

h (t + t), t (d) {v, a} = Deduce inner vertices speed and acceleration from both displacements {d(t + t/2), d(t + t)} (e) If predicted mesh motion is invalid then t = t/2 n and goto 1. Else T els = t + t 2. Moving mesh stage, with mesh optimizations and solver solution While (t < T els ) (a) t solver = Get solver time step H

  Notably, the Young modulus is set to = 1 and the second Lamé's coe cient to ⌫ = 0.48. The local properties are adjusted proportionally to |K| with = 1.For the optimizations, two parameters come into play: the quality thresholds that triggers optimizations Q swap and Q smoothing , and the improvement factors c swap and c smoothing . The simulation of the optimizations is triggered ifQ current > Q optim ,and the optimization is actually performed if Q resulting < c optim Q current . Q swap and Q smoothing are usually set to 2. Concerning the improvement factors, c

= Move the mesh and update vertex speed H k , t, v, v opt , a (f) Check mesh quality. If too distorted: solve new deformation problem or stop. (g) t = t + t EndWhile EndWhile Concerning the elasticity problem, the material properties can be tuned to improve the solution of the problem, as explained in Sections 1.1.2.

Table 1 .

 1 4: Squeezing can test case: outside (top) and inside (bottom) of the can. Final mesh statistics and total number of swaps with the changing-connectivity MMA.

	The initial mesh is composed of 58, 315

Table 1

 1

	.5.
	# mesh deform. # optim. Q mean end	1 < Q	overall end < 2 Q worst	# swaps
	Elasticity	5	211	1.3		99.9%	4.4 479, 182
	IDW	4	40	1.3		99.8%	5.9 149, 536
	Table 1.5: Bending beam test case. Final mesh statistics and total number of swaps with the
	changing-connectivity MMA.

Table 3

 3

.1: Test case of the static vortex without swaps. Sizes of the meshes used and number of solver time steps performed.

  .2.

		Mesh 1 Mesh 2 Mesh 3 Mesh 4 Mesh 5 Mesh 6 Mesh 7
	# tetrahedra (⇥10 3 )	48	211	942	1, 965	3, 122	5, 287	10, 218
	# time steps	2, 338	3, 647	7, 493	8, 948	12, 040 16, 085 21, 449
	# swaps (⇥10 3 )	21	114	996	2, 319	5, 204	10, 838 26, 719
	# swaps/timestep/tet(⇥10 4 ) 1.80	1.49	1.41	1.32	1.38	1.27	1.22

Table 3

 3

.2: Test case of the static vortex with swaps. Number of swaps for each mesh. On the last line, the number of swaps is close to one swap per time step and per 10, 000 tetrahedra for all the meshes.

Table 3 .

 3 3: Piston test case. Natural frequencies and periods for the di↵erent masses used.

	solution is well preserved.
	m p (kg)	10	100	1000
	f	p (Hz)	159	50	16
	T p (s)	0.00628	0.0199	0.0628

Table 3 .

 3 5: Two F117s test case. Final mesh statistics and total number of swaps with the connectivity-change MMA.

	swaps

  Table 3.6: Parallel Wolf timings and speed-up up to 20 cores with hyper-threading.

	. cores	1	2	4	8	15	20	20 HT
	Timing	40h40 22h35 12h37 7h14 5h05 4h10	4h01
	Speed-up	1	1.8	3.2	5.6	8	9.8	10.1

  Knew using Gauss quadrature formulas =) a piecewise linear discontinuous representation of the mass on H new is obtained 3. Correct the gradient to enforce the maximum principle 4. Set the solution values to vertices by an averaging procedure.

	Algorithm 3 Conservative Interpolation Process
	Piecewise linear (continuous or discontinuous) representation of the solution on H
					K back
	2. For all elements K	new 2 H new , recover solution mass m	Knew and gradient r	Knew :
	(a) compute the intersection of K new with all K i back 2 H back it overlaps
	(b) mesh the intersection polygon/polyhedron of each couple of elements (K	new , K i back )
	(c) compute m	Knew and r

back 1. For all elements K back 2 H back , compute solution mass m K back and gradient r

  is locally aligned with the eigenvectors basis of H u and has the same anisotropic quotients as H

u

• M

  Table5.1: Flow solver timings and speed-up on computer 1 up to 20 cores with hyper-threading.

		Serial 1 HT 2 HT 4 HT 8 HT 10 HT 20 HT
	Timings (sec.) 1,054	878	423	236	133	112	71
	Speed-up	1.0		1.2	2.5	4.5	7.9	9.4	14.9
	Nbr. cores	Serial 1 HT 2 HT 4 HT 8 HT 10 HT 20 HT 40 HT
	Timings (sec.) 2,072 1,506	759	393	228	193	121	117
	Speed-up	1.0	1.4	2.8	5.2	9.1	10.7	17.1	17.7
	Table 5.2: Flow solver timings and speed-up on computer 2 up to 40 cores with hyper-threading.

  The time frame has been split into 20 sub-intervals, i.e., n adap = 20. The space-time complexity prescription leads to meshes of sizes from 1, 096, 498 Table 5.4: Solution transfer timings and speed-up on computer 2 up to 40 cores with hyperthreading.

	Nbr. cores	Serial 1 HT 2 HT 4 HT 8 HT 10 HT 20 HT
	Timings (sec.) 1,435 1,071	562	301	158	126	72
	Speed-up	1.0	1.3	2.6	4.8	9.1	11.3	19.93
	Table 5.3: Solution transfer timings and speed-up on computer 1 up to 20 cores with hyper-
	threading.
	Nbr. cores	Serial 1 HT 2 HT 4 HT 10 HT 20 HT 40 HT
	Timings (sec.) 2,087 1,625 1,011	413	193	115	63
	Speed-up	1.0	1.3	2.0	5.0	10.8	18.1	33.1

  Table 6.2.

		w	i	1	2	3
	-0.5625 1/3 1/3 1/3
	0.520833 0.6 0.2 0.2
	0.520833 0.2 0.6 0.2
	0.520833 0.2 0.2 0.6
	Table 6.1: 2D quadrature points for order 3 approximation.
	w	i	1	2	3	4
	-0.8 1/4 1/4 1/4 1/4
	0.45 1/2 1/6 1/6 1/6
	0.45 1/6 1/2 1/2 1/6
	0.45 1/6 1/6 1/2 1/6
	0.45 1/6 1/6 1/6 1/2
	Table 6.2: 3D quadrature points for order 3 approximation.

  : average and worst quality and quality histograms with the number of elements and the percentage for the mesh adapted directly H n+1 ref and the meshes adapted with the ALE procedure H n+1 ALE for the two displacements considered.

			H n+1 ref	H n+1 ALE with d 1	H n+1 ALE with d 2
	Average quality		1.0498		1.0498		1.0524
	Worst quality		2.1572		3.0465		8.5746
	1.00 < Q < 2.00	25,431 99.99 % 25,449 100.00 % 25,383 99.91 %
	2.00 < Q < 3.00	3	0.01 %	0	0.00 %	16	0.06 %
	3.00 < Q < 4.00	0	0.00 %	1	0.00 %	4	0.02 %
	4.00 < Q < 5.00	0	0.00 %	0	0.00 %	1	0.00 %
	5.00 < Q < 10.00	0	0.00 %	0	0.00 %	2	0.01 %
	Table 6.7: Quality statistics for sensor u n+1 0

  ] without knowing the modified Hessian H ⇤ (t), which means without storing them. Two possibilities arise from this remark. First, several M ALE L

	t 2 [t	i 1 , t	i 1 , t i ] M ALE,i L p	L p (x(t)) for (x), we cannot find directly M ALE

i p (x(t j )

Note that the closer to 0.5 ⌫ is, the harder to solve the system is.

Our convention is that the flux is positive if it goes in the same direction as the normal. Thus, Fij > 0 means that the flux goes from cell C i to Cj. If ij > 0, the geometrical flux Wij(t) ij is negative and therefore oriented from Cj to Ci.

The moment of inertia relative to an axis of direction a passing through G where a is an arbitrary unit vector is given by: J (Ga) = a T JGa

(1, 1, 0). The momentum of inertia of the plate on this axis is: J = 1 12 m(l 2 + h 2 ). For symmetry reasons, we can consider only the extra pressure on the two quadrants with a greater pressure (the constant pressure p 0 cancels itself out everywhere). The moment of the pressure

Remerciements Acknowledgments

This thesis was partially funded by a grant from the Airbus Group Foundation.

Contents

Part I

Part II Extension of anisotropic metric-based mesh adaptation to moving mesh simulations

Advection

The two metric averages were first compared on pure advection cases, where it is easy to control the solution. To that end, a specific module was added to the flow solver to solve the linear advection equation: (5.19) where v is the velocity vector. A scalar quantity, defined by a function at time t = 0, is advected, which comes to considering

The numerical method is the same as described previously, but a specific upwind flux is used. Let v mean be an average velocity on edge e ij :

where n ij is the normal to the edge. Then the flux on this edge is: (5.20) where the edges are defined so that vertex P i is on the left and vertex P j is on the right (ij • n ij > 0). Several functions (shapes) and velocities were considered. The most meaningful cases were: accelerated translation of a square, rotation of a square and of Zalesak's disk and translation of sine curves. Each of these cases presents a specific feature of interest. The square has edges that are both parallel and orthogonal to the displacement, the first ones being a simplified model of shocks. Zalesak's disk allows to look at the rotation of both straight lines and curves. The sine curves are phenomena that vary continuously and potentially quickly.

The first case is the advection of an accelerated square in a tube. The tube dimensions are: x 2 [0, 10] and y 2 [0, 1], the scalar function is initially set to 0 everywhere except on a square, defined by x 2 [0.2, 0.8] and y 2 [0.2, 0.8], where the function is set to 1, and the velocity vector is v = (1 + 0.3t, 0). Regarding the adaptation, the number of fixed-point iterations is set to n adap = 5, the number of sub-interval is varying. A complexity is set so that the meshes have an average size of 11, 000 vertices. This simple case shows that the error is smaller for the intersection of metrics for all the number of sub-intervals. Incidentally, one can notice that the more sub-intervals there are, the more accurate the solution is, but the bigger the total space-time complexity is. The aim of unsteady adaptation is to find a good trade o↵ between both. The observation of the meshes for that case (Fig. 5.1) explains why the L 1 average is better: the resulting metric leads to putting much more vertices on the "shocks", which are the areas of interest here. The L 1 average is very sensitive to the orthogonal phenomenon, and leads to meshing more the edges orthogonal to the shocks. This can be simply explained: the Hessians are large in the directions orthogonal to the shocks, so their sum is large too, whereas their intersection is very small since they are all parallel and shifted. In this case, capturing the shocks is eventually more important than capturing the orthogonal phenomena.

Then two cases of rotating objects are considered. The domain is a square of dimensions x 2 [0, 1] and y 2 [0, 1]. The scalar function is initially set to one on a square of dimensions Chapter 6. Extension of unsteady adaptation to moving meshes

Error for mesh H unif 4.36e-4 4.36e-4 2.69e-2 2.69e-2 9.05e-2 9.05e-2 1.18e-1 1.18e-1

Error for mesh H n+1 ref 4.63e-4 4.63e-4 2.93e-3 2.93e-3 3.09e-2 3.09e-2 3.64e-2 3.64e-2

Error for mesh H n+1 ALE 4.65e-4 4.55e-4 3.57e-3 3.56e-3 3.17e-2 3.31e-2 3.95e-2 4.07e-2 Table 6.3: L 1 error for 2D meshes of complexity 25, 000

Error for mesh H unif 4.69e-5 4.69e-5 2.96e-3 2.96e-3 2.60e-2 2.60e-2 3.81e-2 3.81e-2

Error for mesh H n+1 ref 4.89e-5 4.89e-5 2.36e-4 2.36e-4 5.48e-3 5.48e-3 6.71e-3 6.71e-3

Error for mesh H n+1 ALE 4.69e-5 4.59e-5 2.70e-4 2.72e-4 5.65e-3 5.92e-3 7.26e-3 7.47e-3 Table 6.4: L 1 error for 2D meshes of complexity 250, 000

Chapter 6. Extension of unsteady adaptation to moving meshes . The initial uniform mesh is the same and of size bigger than all the others.

Error for mesh H unif 6.23e-3 6.23e-3 2.32e-1 2.32e-1

Error for mesh H n+1 ref 6.31e-3 6.31e-3 1.85-2 1.85e-2

Error for mesh H n+1 ALE 6.35e-3 6.31e-3 2.16e-2 2.17e-2 Table 6.5: L 1 error for 3D meshes of complexity 600, 000

Error for mesh H unif 1.33e-3 1.33e-3 5.44e-2 5.44e-2

Error for mesh H n+1 ref 1.35e-3 1.35e-3 3.84e-3 3.84e-3

Error for mesh H n+1 ALE 1.36e-3 1.35e-3 4.50e-3 4.54e-3 : average and worst quality and quality histograms with the number of elements and the percentage for the mesh adapted directly H n+1 ref and the meshes adapted with the ALE procedure H n+1 ALE for the two displacements considered.

Update of the adaptation algorithm

The ALE metric was developed to be used in the unsteady algorithm described in Chapter 5.

The simulation time interval is split into n adap sub-intervals [t i 1 , t i ] for i = 1, .., n adap . On each sub-interval, the mesh remains "constant" -meaning there is no remeshing, but it is moved to follow the geometry displacement. At each time step of the sub-interval, we want the mesh to be moved to its adapted configuration. To do so, we are going to use the ALE metric defined in Section 6.1. In order to have a mesh adapted for each time of the sub-interval, we are going to average these ALE metrics in some way or another, similarly to what is done in the fixedmesh case, to come up with an averaged Hessian-metric. To take into account the displacement at each time step, we have no other choice than applying the ALE correction to the Hessian matrices throughout the sub-interval before averaging them. From these modified Hessians, an ALE metric is computed so that the mesh generated for the beginning of a sub-interval is still adapted once moved with the elasticity displacement.

Error analysis

To derive the metric that will be used in the algorithm we take inspiration from the analysis of the error in the unsteady case with fixed meshes. First, the error minimization problem from Eq. (5.14) is modified to take into account the mesh movement. Let us consider sub-interval

In the fixed-mesh analysis, we simply move the integral over time into the Trace to make the mean Hessian metric appear, and this results in an error E i L p constant on the whole sub-interval. Here, we still want to use a mean Hessian metric, but we cannot move the integral over time because M i (t) is not constant anymore. However, we make the hypothesis that, at first order, the mesh is constant and equal to the mesh at the beginning of the sub-interval:

With this approximation, the error on the sub-interval is constant:

where matrix H ALE,i u is the mean Hessian metric. This Hessian is built by averaging the modified Hessians H ⇤ from Eq. (6.6):

This way, the mesh generated at time t i 1 is adapted to the solution at any time t > t i 1

within the subinterval once moved with the mesh deformation displacement. The optimization problem then becomes finding the mesh M ALE,i that minimizes the error from Eq. (6.8). This problem, under the previous hypothethis that M ALE,i is constant, is solved exactly like the fixed mesh problem in Section 5.1.4. First a spatial optimization leads to:

Update of the adaptation algorithm Chapter 6. Extension of unsteady adaptation to moving meshes

Appendix

Appendix A

Intersection of metrics

In Part II, Section 4.2.3, a new way to compute the intersection of two metrics is presented. It is based on simultaneous reduction and successive changes of basis. In the solver code, metrics are intersected on the fly. More precisely, Hessian-metrics are intersected, i.e. absolute values of Hessians, whose eigenvalues will be truncated later to make real metrics.

Hessian matrices can be degenerate quadratic forms, i.e. they can have null eigenvalues. When one eigenvalue is null or close to null (or more than one), the intersection procedure from Section 4.2.3 does not behave correctly. Specific treatments are thus required in those cases. In the following sections, we present what is done in each case.

Most of the times, the technique relies on the geometric interpretation of a metric: a metric can be represented by an ellipsoid whose axes are the eigenvectors and the sizes the axes the inverse of the eigenvalues. Degenerate (null) eigenvalues correspond to infinite sizes in the corresponding directions, leading to geometric representations such as cylinders, parallel lines or planes, or the whole space.

A.1 In two dimensions

Let us consider two real symmetric positive matrices:

and

2 are the eigenvectors, and 1 , µ 1 , 2 , µ 2 the eigenvalues. This decomposition is always possible because the matrices are real and symmetric, but the eigenvalues can be null. The eigenvectors of a matrix are considered normalized and orthogonal in twos.

The following degenerate cases can be distinguished:

1. If both matrices are null, the matrix of the intersection is null.

2. If one of the matrices is null, the intersection is the other matrix. (The non null metric is necessarily included in the null metric that has infinite sizes in both directions.)

3. If M 1 has one null eigenvalue and not M 2 : one cannot take the inverse of the square root of M 1 , thus M 1 and M 2 are swapped, and the standard procedure is applied.

4. If M 2 has one null eigenvalue and not M 1 : the standard procedure is applied without problem.

5. If M 1 and M 2 each have one and only one null eigenvalue (let us suppose µ 1 = µ 2 = 0), two cases are distinguished depending on whether the degenerate axis is the same or not.

(a) If v 1 and v 2 are collinear, i.e if one metric is included in the other, the intersection is degenerated in this direction. The other direction is orthogonal and its size is given by the maximum of the non null eigenvalues.

where P is the matrix made up with u 1 et v 1 . (b) If the degenerate directions are di↵erent, the intersection is build considering the two degenerate axes: let us move to basis B = (v 1 , v 2 ), made up with the two degenerate directions. If M 1 and M 2 are written in this basis, writing P the matrix whose columns are v 1 and v 2 :

(a) If u 1 and w 2 are orthogonal, i.e. if the cylinder is parallel to the planes, the intersection is a cylinder of direction w 2 . To find its basis, we move to a cutting plane orthogonal to w 2 , and it comes up to the 2D case 4. As previously, we write

GPU acceleration of a 3D Finite Volume flow solver

The use of graphic boards (Graphics Process Units, ou GPU) appears as a salutary perspective to match the ever increasing need for computational power that classic process units have di culties matching, notably due to the mediocre energetic e ciency. The specific architecture of GPUs is supposed to allow them to reach an energetic e ciency far above the one of classic CPUs. During this thesis, as part of technological surveillance, we have tried to explore this trail. Many examples of the performances of GPU computations are available in the literature, however, the examples of implementation of complex software are very scarce. We have decided to progressively implement on GPU our in-house solver Wolf and to compare the performances of both GPU and CPU versions. In this study, we took particular care to give meaning to timings, comparing the GPU code to a CPU code that we believe to be e cient and on comparable machines.

Note. This study was carried out in 2012 at the beginning of this thesis. Since then, the performance of computation dedicated machines has evolved, but the main lessons are still valid.

B.1 Solver used

We have parallelized a simplified version of our in-house solver Wolf, which is described in great detail in its ALE version in Chapter 2.

Simplified version for GPU

The parallelization of such a code raises a lot of algorithmic di culties, which is why we consider a reduced version of the solver in a first phase. We consider the pseudo-steady solver of the compressible Euler equations. We have only kept the HLLC solver of order 1, with an explicit advance in time using an order 2 Runge-Kutta with 2 steps (RK 2-2). The computation of the MUSCL reconstructed gradients presents a lot of di culties that will be dealt with later. Local time-stepping is kept as well to avoid artificially slowing down convergence.

A module was added to the code in which this simplified version is coded. This module only uses the initialization routines of the standard code (I/Os and allocation and initialization of data structures) and is totally autonomous after that. This module contains side by side the CPU and GPU functions, ensuring that the code is the same in both cases so that the output is the same.

B.2 GPU acceleration

Architecture of a GPU

Modern GPUs all respect the CUDA architecture, on which is also based the OpenCL model. This architecture is still heavily influenced by the graphic usage of these boards, the prime objective being to be able to run massively parallel simple computations.

Modern GPU architecture is based on two points: massive multicore and a reduced latency. A GPU is made up of a large number of cores (from a few tenths to a thousand or more) that are relatively slow, and that are organized in 3D groups, each group having one control unit for all its cores. This way, each of the cores of a group processes exactly the same task in parallel, possibly on di↵erent data (Single Instruction Multiple Data programming model). These control units have a very small latency compared to the one of a classic CPU, which enables running a large number of threads on each group. There are several levels of shared memory, a registry for each core, a shared memory for each group, possibly shared memories for groups of groups, a global memory for the whole board and several levels of cache. The distribution of the threads on the groups of cores and the transfers between the di↵erent levels of memory are explicitly handled by the programmer. These main ideas are shared by CUDA and OpenCL, the di↵erences between both lying in the vocabulary and in details.

Programming model

A good understanding of the architecture of GPUs is mandatory to write appropriate code. The principle is to run a simple task on big data. The simplest and most typical example is the addition of two big arrays: two arrays of size N have to be added term by term, which requires N operations. These N operations are divided into groups of N t threads, N t being set by the programmer. The task of each of these threads is to add one element of each array, and the groups of threads are executed successively by the groups of cores of the GPU (all at once if N t is smaller than the number of cores by group, or some after the others else). Since a group of cores has only one control unit, the threads running in parallel on a group all execute exactly the same instruction at the same time.

The work of a programmer on GPU is to parallelize operations executed on big data, and to remove all that would make two threads di↵erent (conditions on the index of an element in an array for instance). Data structures that enable unconditional linear processing must be set up.

An important characteristic of GPUs is that access to their central memory of the CPU is very slow, so trying to avoid memory exchanges between the CPU and the GPU is one of the central axes of GPU programming. However, the memory on classic GPUs is relatively small, so algorithms reducing the use of memory on the GPU and the communications with the central memory have to be found. On top of this, cache misses and indirections also slow down considerably a GPU code, for the reasons explained above.

B.3. State of the art 205

OpenCL

Two GPU development platforms coexist: CUDA and OpenCL. Our choice immediately fell on OpenCL due to its portability. Not only is it compatible with most GPU manufacturers, but it also addresses all kinds of generic parallel architecture, including usual multicore CPUs and coming hybrid processors.

OpenCL is more precisely a set of specifications: both for the language on the GPUs and for a library interfacing CPUs and GPUs. An OpenCL code is always included in a standard code on CPU, the "host" program. This host code is responsible for executing OpenCL functions that handle the interface with the GPU: compilation of GPU code, data exchange and trigger of the GPU code execution. The GPU code itself is defined in special functions known as kernels: a kernel is a standard C function, but it is compiled on the fly and is aimed at being executing on one or several groups of cores. A kernel is coded in C99, enhanced with a set of commands facilitating the use of many cores. An instance of a kernel is contained in a thread, the threads are gathered into workgroups, the workgroups are assigned to one or several work units (i.e. group of cores with a single control unit). In what follows, workgroup will both designate the pool of threads and the corresponding cores. For more details on the architecture and the API, see the o cial documentation [Munshi 2008].

B.3 State of the art

The use of GPUs in scientific computing is fairly recent, and the first serious attempts date back to around 2005. It is a novel field of research, with a lot of publications, but no reference has really imposed itself. Many research labs began porting very di↵erent codes on GPUs, with very di↵erent approaches and variable performances. Most article on this topic focus on the performance optimization of generic algorithms, without context. They are not about implementing simulation codes, but about trying to get the best out of available GPU devices, using generic approaches [START_REF] Appleyard | [END_REF].

A trend tends to stand out from this abundance of works: the implementation of solvers on structured grids. Structured grids perfectly correspond to the material architecture of GPUs, and the transcript of structured codes is both easy and e cient. Finite Di↵erence methods in particular lead to remarkable performance. Other methods such as Lattice-Boltzmann methods can also be well parallelized. More generally, GPU acceleration seems to be adapted to methods with structured grids and/or of order 1.

There are very few available articles on the parallelization of bigger codes, such as the one with which we work. Many documents are available on the web, presenting on-going work, but not many present finished works. Two articles are representative of the literature, in which the authors adopt the same approach as ours: start from a complex CFD code and simplify it to parallelize it. In [Kuo 2011], a structured solver is considered, allowing the authors to reach high speed up factors, but the details of the GPU implementation are omitted, and the authors provide us with no way to compare their GPU timings to CPU performance. In [Elsen 2008], the authors give more details on the adopted strategy. The code solves the 3D Euler equations on structured grids with a Finite Di↵erence method. The authors explain the problems they met (numerical precision, mapping from the computational grid onto the grid of the GPU,. . . ), and present their results on well-documented test cases, notably a 3D supersonic vehicle. The main lesson from this article is that on big 3D structured cases, speed-ups of 15 or 20 are satisfying.

Our study follows from these works: we aim at implementing on GPU an inviscid solver, in 3D and on unstructured meshes. The main novelty of the work is to consider unstructured meshes, whose topology does not map to the topology of the GPU.

B.4 Principles of implementation

Choices of implementation

Some choices had to be made prior to the implementation on GPU, more or less directly related to OpenCL, which we list here. The first determinant choice was to use a wrapper library written by Loïc Maréchal [Maréchal 2012]. This wrapper simplifies greatly the communications between the CPU and the GPU, notably the initialization of the connection to the GPU device, the compilation and instanciations of kernels and memory accesses. In standard OpenCL, each of theses tasks requires a consequent number of lines of code using several complex routines, that are factored in this wrapper. This way, the use of OpenCL is simplified in the host code, and one can focus on writing kernels. The consequence of this factoring is the use of default parameters in OpenCL routines. This could be a drawback if we were trying to optimize the code in detail, trying to use all subtleties of GPU architecture, but for a first attempt, we will only focus on algorithmic principles.

The other main choice, which may have more consequences, is to forget the distribution into workgroups, and act as if there was only one workgroup with all the cores and on which the whole pool of threads is executed. The distribution into workgroups is left to an OpenCL built-in routine, according to a heuristic based on the number of registries used by the kernels, and we do not use the manual handling of the di↵erent memory levels. This choice probably results in a sensible loss of performance, but we supposed it was su cient to reach a good speed-up factor in a first phase.

Finally, the third choice is to use floating point numbers with simple precision on the GPU, in order to save some memory space, since it is limited on GPU devices. This may result in slowing down the convergence of the solver, and even preventing it in some specific cases.

Identification of 4 parts in the code

To simplify the code of the solver, we have identified four big parts, relatively autonomous, and their corresponding data structures. This segmentation allows us to work step by step in the parallelization of the code: one part can be ported to GPU while the other still run on CPU, so that each part can be debugged independently.

These parts come from the natural structure of the code, corresponding to the four big steps of the loop of a pseudo-steady solver:

• Computation of the time step: computation of the local CFL number, of the global minimal CFL number and of the local time step.

B.4. Principles of implementation

207

• Computation of the flux: application of the HLLC Riemann solver.

• Computation of the boundary conditions: application of di↵erent correction to the flux at the boundaries.

• Advance in time: computation of the new state and of the pseudo-steady residual.

Memory being a bottleneck of GPUs, early identification of all the structures that will be necessary is required to devise the code. These tables mainly contain:

• the current solution, of size 5 times the number of vertices,

• the initial solution (for each time step), of size 5 times the number of vertices,

• the flux, of size 5 times the number of vertices,

• the local time step, of size the number of vertices,

• geometrical parameters of the control volumes, of size twice the number of vertices,

• the normal to the edges, of size 4 times the number of edges,

• the vertices of the edges, of size twice the number of edges,

• a description of boundary tetrahedra, of size at least 7 times the number boundary tetrahedra,

• various details on the mesh topology. . .

Let us recall that the descritezation is done with a vertex-centered Finite Volume method, so the number of vertices is equal to the number of control volumes. In practice, for the solutions and the flux, we use arrays of width 6, because each line of these arrays is considered as small OpenCL vector, which are of sizes multiple of 2. In general, we use data structures as linear as may be (adjacent in memory, being read and written linearly. . . ).

Implementation details

I cannot give all the details of the implementation here, so I only focus on the two main problems that had to be overcome.

Reduction. Reduction is a classic problem in parallel computing, which proves to particularly di cult on GPUs. There are two reductions in the solver code: the computation a minimal time step over the whole domain is necessary to set up a maximal bound for the local time step, and the computation of the residual is an integration over the domain, thus a sum over all vertices. We have tested two strategies: the classic one described in the literature, and a simpler one. Both eventually come to iteratively dividing the size of the array to reduce.

The classic method reduces the array step by step, by storing the result in the first elements of the array, which results in reducing the size of the data they handle every time. In other words, the array is split into 2 sub-arrays, and each pair of elements having the same index in Macbook Pro laptop, typical of GPUs in everyday computers,

• (GPU 3) and an AMD Radeon HD 6750M board (480 cores and 512 MB of memory), which is a little bit old.

The CPU version was run on:

• (CPU 1) A server dedicated to scientific computation with a multicore processor: a 8 core Intel Xeon at 2.93 GHz and with hyperthreading,

• (CPU 2) A desktop computer with an hyperthreaded 4 core Intel i5 processor at 2.5 GHz, with GPU 3 integrated to the motherboard. A last point worth looking at is memory usage. We expected the limits of the central memories of GPUs to be quickly reached, but finally, we were able to run a relatively big case with a million of vertices.

Improvement of the flux computation

Considering the previous remarks, the longest loop (i.e. the computation of volume fluxes) was improved. In particular, we have used as much as possible small OpenCL vectors, and have re-organized the ball of edges structure. Instead of arrays of di↵erent sizes for every vertex, we have created a fixed size array of 16 edges. If a vertex does not have 16 neighbors, the array is filled with 0, and a small array containing the extra edges is created if necessary. This way, going through the ball of edge is the same thing for most of the vertices: going through an array of 16 indexes. This kind of data structure is much more adapted to GPU parallelization, and results in a much smaller time for this part.

With this improvement, we have run again the tests, on a new GPU device, a NVIDIA quadro 6000 (GPU 4). The device is supposedly the same as GPU 1, but with optimized and updated drivers. The timings reported in Table B.3 confirm that all this lead to better performance of the GPU code. In that table the two steps for the flux computation (computation of the edge flux, and assembly of the flux at the vertices) were separated for a better analysis.

Timings (in sec)

GPU 4 GPU 1 CPU 1 CPU 1 (serial) These timings (Table B.3) are really interesting, since the GPU code is 5 times as fast as a computation-dedicated 8-core hyperthreaded CPU, with a speed-up factor of 27. This relatively simple correction resulted in a great gain in GPU time, which shows the room for improvement ahead. The other parts have better timings due to the upgrade of the hardware drivers. The Time-accurate anisotropic mesh adaptation for three-dimensional moving mesh problems Abstract: Time dependent simulations are still a challenge for industry, notably due to prob- lems raised by moving boundaries, both in terms of CPU cost and accuracy. This thesis presents contributions to several aspects of simulations with moving meshes. A moving-mesh algorithm based on a large deformation time step and connectivity changes (swaps) is studied. An elasticity method and an Inverse Distance Weighted interpolation method are compared on many 3D examples, demonstrating the e ciency of the algorithm in handling large geometry displacement without remeshing. This algorithm is coupled with an Arbitrary-Lagrangian-Eulerian (ALE) solver, whose schemes and implementation in 3D are described in details. A linear interpolation scheme is used to handle swaps. Validation test cases showed that the use of swaps does not impact notably the accuracy of the solution, while several other complex 3D examples demonstrate the capabilities of the approach both with imposed motion and Fluid-Structure Interaction problems. Metric-based mesh adaptation has proved its e ciency in improving the accuracy of steady simulation at a reasonable cost. We consider the extension of these methods to unsteady problems, updating the previous fixed-point algorithm thanks to a new space-time error analysis based on the continuous mesh model. An e cient p-thread parallelization enables running 3D unsteady adaptative simulations with a new level of accuracy. This algorithm is extended to moving mesh problems, notably by correcting the optimal unsteady metric. Finally several 3D examples of adaptative moving mesh simulations are exhibited, that prove our concept by improving notably the accuracy of the solution for a reasonable time cost.

Keywords: CFD, Unsteady simulations, moving mesh, swaps, ALE, metric-based mesh adaptation, continuous mesh framework