A methodology for the development of discrete adjoint solvers using automatic differentiation tools

  • Authors:
  • A. C. Marta;C. A. Mader;J. R. R. A. Martins;E. Van der Weide;J. J. Alonso

  • Affiliations:
  • Stanford University, Stanford, CA, USA;University of Toronto, Toronto, Ont., Canada;University of Toronto, Toronto, Ont., Canada;Stanford University, Stanford, CA, USA;Stanford University, Stanford, CA, USA

  • Venue:
  • International Journal of Computational Fluid Dynamics
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

A methodology for the rapid development of adjoint solvers for computational fluid dynamics (CFD) models is presented. The approach relies on the use of automatic differentiation (AD) tools to almost completely automate the process of development of discrete adjoint solvers. This methodology is used to produce the adjoint code for two distinct 3D CFD solvers: a cell-centred Euler solver running in single-block, single-processor mode and a multi-block, multi-processor, vertex-centred, magneto-hydrodynamics (MHD) solver. Instead of differentiating the entire source code of the CFD solvers using AD, we have applied it selectively to produce code that computes the transpose of the flux Jacobian matrix and the other partial derivatives that are necessary to compute sensitivities using an adjoint method. The discrete adjoint equations are then solved using the Portable, Extensible Toolkit for Scientific Computation (PETSc) library. The selective application of AD is the principal idea of this new methodology, which we call the AD adjoint (ADjoint). The ADjoint approach has the advantages that it is applicable to any set of governing equations and objective functions and that it is completely consistent with the gradients that would be computed by exact numerical differentiation of the original discrete solver. Furthermore, the approach does not require hand differentiation, thus avoiding the long development times typically required to develop discrete adjoint solvers for partial differential equations, as well as the errors that result from the necessary approximations used during the differentiation of complex systems of conservation laws. These advantages come at the cost of increased memory requirements for the discrete adjoint solver. However, given the amount of memory that is typically available in parallel computers and the trends toward larger numbers of multi-core processors, this disadvantage is rather small when compared with the very significant advantages that are demonstrated. The sensitivities of drag and lift coefficients with respect to different parameters obtained using the discrete adjoint solvers show excellent agreement with the benchmark results produced by the complex-step and finite-difference methods. Furthermore, the overall performance of the method is shown to be better than most conventional adjoint approaches for both CFD solvers used.