We wish to demonstrate that automatic differentiation, when coupled with domain knowledge, can efficiently provide accurate sensitivities (derivatives) of real computational fluid dynamics (CFD) codes. Accurate sensitivities are a prerequisite for many efforts in engineering computation.

Background and Project Description

Modern engineering design depends on sensitivity calculations. To obtain these sensitivities, engineers have two choices: use finite differences, or develop a program to compute the analytic derivatives. To avoid programming, engineers have typically chosen to use finite differences. The accuracy of finite difference calculations, however, depends on getting a ``good'' step size. A ``good'' step size, however, depends on two competing factors. To approximate the derivative well, the step size should be ``small.'' On the other hand, to avoid critical cancellation, the step size should be ``moderate.'' Finding an appropriate step size to satisfy both criteria can be difficult, especially for complex processes like CFD calculations. Furthermore, the step size exercise may need to be repeated for each new point in the design space.

Analytic derivatives, by definition, avoid the step size problem. Generating an analytic derivative program by hand, however, is tedious, time consuming, and prone to error. Fortunately, engineers can avoid the ``by hand'' part by using an automatic differentiation (AD) tool. An AD tool automatically applies the derivative chain rule to all of the expressions in a program, thereby generating a program that computes both the desired analytic derivatives, in addition to the function value.

In this work, we describe results obtained by application of the ADIFOR 2.0 automatic differentiation to OVERFLOW, an extensively used CFD code from NASA Ames.