CFM 2019

Sensitivity computations by automatic differentiation for flow control
José I. Cardesa  1, *@  , Christophe Airiau  2@  
1 : Institut de Mécanique des Fluides de Toulouse  (IMFT)
Institut National Polytechnique de Toulouse - INPT, Université Toulouse III- PaulSabatier, Centre National de la Recherche Scientifique - CNRS, IRT Saint Exupéry - Institut de Recherche Technologique
2 : Institut de Mécanique des Fluides de Toulouse  (IMFT)
Institut National Polytechnique de Toulouse - INPT, Université Paul Sabatier-Toulouse III - UPS, Centre national de la recherche scientifique - CNRS (France)
* : Auteur correspondant

Sensitivities can be generally interpreted as a gradient of any given functional with respect to any input parameter. Their computation is a prerequisite to the implementation of optimization or flow control approaches on modern CFD solvers. The present work is currently in progress inside the RTRA-foundation project « Contrôle des Couches Limites Transitionnelles et Turbulentes » (2018-2020).

High-order methods adapted to compressible/incompressible fluid flow computations on complex geometries have been recently developed, making them suitable candidates to become industrial tools in the near future. One such code is JAGUAR, developed at CERFACS, which has been validated against compressible and incompressible test cases. Its main characteristics are an excellent scalability, the ability to handle structured or unstructured grids, an optimized 6-step time integration scheme and a high-order spatial discretization based on spectral differences. These are positive features which come at a price: the code is long and complex. For this reason, we opted for an automated approach to sensitivity computations using the automatic differentiation (AD) tool developed by INRIA (TAPENADE) to parse and extend JAGUAR in order to compute sensitivities. Before analysing the ca. 30,000 lines of Fortran code with TAPENADE, we had to introduce some preliminary modifications to JAGUAR.

Together with the additional modifications introduced by the AD tool, the resulting code differed significantly from the original one, suggesting the validation of the following two aspects: the ability of the output code to obtain the same flow solution as the original version of JAGUAR, and the ability to calculate accurate sensitivities. We validated both factors on a two-dimensional test case of viscous incompressible flow in a square periodic domain with a double shear layer. The flow solution obtained with JAGUAR was validated against that from a purely spectral code when setting the spatial resolution to be that of a direct numerical simulation. As input parameter we selected the initial shear layer thickness r subject to the constraint of a fixed initial kinetic energy dissipation.

At first we computed sensitivities based on finite differences and found excellent agreement with those from multiple evaluations of the fully spectral code. In a second step, we implemented sensitivity computations by an automatic differentiation process in the forward (tangent) mode of TAPENADE and validated them with the previous reference values. We found that the impact of the heavy code modifications introduced by TAPENADE altered the flow solution only by amounts within machine precision, while the sensitivities were found to differ by up to 0.3% with those computed by finite differences. We found the differentiated code to be 1.9 times slower than the original direct code, a performance penalty comparable to that of the finite differences approach - which doubles the computational time.

We are currently working on the computation of the sensitivities following the backward, or adjoint mode of TAPENADE applied to JAGUAR. The next step will be to validate and analyse the adjoint field. To finalize the study, the present approach will be applied to compute sensitivities and to implement an optimal control loop on a more complex flow : a compressible flow over an airfoil. Control will be performed by some small variation of the boundary conditions over a small part of the wall. The main objective will be to decrease the boundary layer separation in high angle-of-attack configuration.


Personnes connectées : 61