## Research

### Overall Objectives

• AD theory: We study software engineering techniques, to analyze and transform programs mechanically. Algorithmic Differentiation (AD) transforms a program P that computes a function $F$ , into a program P' that computes analytical derivatives of $F$ . We put emphasis on the adjoint mode of AD, a sophisticated transformation that yields gradients for optimization at a remarkably low cost.

• AD application to Scientific Computing: We adapt the strategies of Scientific Computing to take full advantage of AD. We validate our work on real-size applications.

We aim to produce AD code that can compete with hand-written sensitivity and adjoint programs used in the industry. We implement our algorithms into the tool Tapenade, one of the most popular AD tools at present.

Our research directions :

• Evolution of the adjoint AD model to keep in pace with with modern programming languages constructs.

• Optimal shape design and optimal control for steady and unsteady simulations. Higher-order derivatives for uncertainty quantification.

## Results

#### Towards Algorithmic Differentiation of C++

Our goal is to extend Tapenade for C++. We further developed our external parser for C++, built on top of Clang-LLVM https://clang.llvm.org/. This parser is now connected to the input formalism “IL” of Tapenade. Tapenade now manages enough constructs of Object languages to be able to build its own Internal Representation (IR) and to regenerate back from the IR a non-transformed C++ source.

In the present development stage, this back-and-forth chain works on several small C++ codes. Still, many issues remain on the large example provided by the ABS team. We are working to solve those progressively. The lack of serious development documentation on the Clang internals obviously doesn’t help.

The next development stage will be to adapt the analysis and differentiation components of Tapenade to the new Object constructs of the IR. This development has not started yet. Upstream this development, we need to devise an extended AD model correspondingly. This research part is in progress.

We extend Tapenade to differentiate codes that mix different languages, for both tangent and adjoint modes of AD. Our motivating application is Calculix, a 3-D Structural Finite Element code that mixes Fortran and C. This year we improved the memory representation of Tapenade’s IR to handle the C-Fortran memory correspondence (commons, structs…) defined by the Fortran standard.

C files (aka “translation units”) and Fortran modules are two instances of the more general notion of “package” for which we have developed a unified representation in Tapenade, that also handles C++ namespaces.

#### Application to large industrial codes

We support industrial users with their first experiments of Algorithmic Differentiation of large in-house codes. This concerned two industrial codes this year.

The other application ultimately targets AD of the “Jaguar” code, developed jointly by ONERA, CERFACS, and IMFT in Toulouse. This is a collaboration with Jose I. Cardesa and Christophe Airiau, both at IMFT. After a relatively easy tangent differentiation, most of the effort was devoted to obtaining a running and efficient adjoint code. Not too surprisingly, the main source of trouble was the Message-Passing parallel aspect on the application code. This underlined a lack of debugging support for adjoint-differentiated code. Given the run-time of the simulation that we consider (from hours to a few days on a 4110 processors platform), efficiency is crucial. We used the optimal binomial checkpointing scheme at the time-stepping level. However, performance of the adjoint code can probably be improved further with a better checkpointing scheme on the call tree. This calls in particular for AD-specific performance profiling tools, that we are planning to develop. We prepared together an article that describes this succesful experiment, which is now submitted to “Journal of Computational Science”.

Two collaborations are in preparation for next year, one with Jan Hueckelheim at Argonne National Lab. about SIMD parallel codes, and one with Stefano Carli at KU Leuven about adjoint AD of the plasma code SOLPS-ITER.

#### Control of approximation errors

Reducing approximation errors as much as possible is a particular kind of optimal control problem. We formulate it exactly this way when we look for the optimal metric of the mesh, which minimizes a user-specified functional (goal-oriented mesh adaptation). In that case, the usual methods of optimal control apply, using adjoint states that can be produced by Algorithmic Differentiation.

This year, we published the final revised versions of two conference papers [article], [article], we published in a journal the final version of the adjoint-based mesh adaptation for Navier-Stokes flows [article]), and we published in “Numerical Methods in Fluids” a work on nonlinear correctors extending [article]. Let us also mention the final publication of the book “Uncertainty Management for Robust Industrial Design in Aeronautics”, edited by C. Hirsch et al. in the Springer series Notes on Numerical Fluid Mechanics and Multidisciplinary Design (2019) in which we have contributed chapters 20, 21, 45, and 48.

The monography on mesh adaptation currently being written by Alauzet, Loseille, Koobus and Dervieux now involves all its chapters (14 chapters) and is being finalized.

#### Turbulence models

Modeling turbulence is an essential aspect of CFD. The purpose of our work in hybrid RANS/LES (Reynolds Averaged Navier-Stokes / Large Eddy Simulation) is to develop new approaches for industrial applications of LES-based analyses. In the applications targetted (aeronautics, hydraulics), the Reynolds number can be as high as several tens of millions, far too high for pure LES models. However, certain regions in the flow can be predicted better with LES than with usual statistical RANS models. These are mainly vortical separated regions as assumed in one of the most popular hybrid models, the hybrid Detached Eddy Simulation (DES) model. Here, “hybrid” means that a blending is applied between LES and RANS. An important difference between a real life flow and a wind tunnel or basin is that the turbulence of the flow upstream of each body is not well known.

The development of hybrid models, in particular DES in the litterature, has raised the question of the domain of validity of these models. According to theory, these models should not be applied to flow involving laminar boundary layers (BL). But industrial flows are complex flows and often present regions of laminar BL, regions of fully developed turbulent BL and regions of non-equilibrium vortical BL. It is then mandatory for industrial use that the new hybrid models give a reasonable prediction for all these types of flow. We concentrated on evaluating the behavior of hybrid models for laminar BL and for vortical wakes. While less predictive than pure LES on laminar BL, some hybrid models still give reasonable predictions for rather low Reynolds numbers.

We have developed a new model relying on the hybridation of a DES model based on a k- $ϵ$ closure with our dynamic VMS model [article] [article]. Our purpose is to propose a model rather predictive in condition where the engineer has not much information concerning the turbulence in the flow under study. This year, we continued to improve this model and to test it for a large set of configurations with Reynolds numbers ranging from low (laminar flows) to very large.

#### High order approximations

High order approximations for compressible flows on unstructured meshes are facing many constraints that increase their complexity i.e. their computational cost. This is clear for the largest class of approximation, the class of $k$ -exact schemes, which rely on a local polynomial representation of degree $k$ . We are investigating schemes which would solve as efficiently as possible the dilemma of choosing between an approximation with a representation inside macro-elements which finally constrains the mesh, and a representation around each individual cell, as in vertex formulations. This is a cooperation with the Keldysh Institute of Russian Academy which whom we have already developed several families of superconvergent schemes.

#### Aeroacoustics

The progress in highly accurate schemes for compressible flows on unstructured meshes (together with advances in massive parallelization of these schemes) allows us to solve problems previously out of reach. The three teams of Montpellier university (coordinator), Inria-Sophia and Keldysh Institute of Moscow have written a proposal for cooperation on the subject of the extension of these methods to simulate the noise emission of rotating machines (helicopters, future aerial vehicles, unmanned aerial vehicles, wind turbines…). The proposal has been selected by ANR and RSF (Russian Science Foundation) for support for a program duration of 4 years.