SU2 Aerodynamic Shape Optimization: Choosing Between Discrete and Continuous Adjoints

New
License: GNU Lesser General Public License v2.1 · Updated 2026-11-11
My rating

1. Overview

Aerodynamic shape optimization is one of the clearest cases where a solver earns its keep through the gradient rather than through the forward solve. A single airfoil carry-through optimization needs the sensitivity of drag or lift with respect to dozens or hundreds of shape parameters, and a finite-difference evaluation of those sensitivities costs one extra primal solve per parameter. The adjoint method collapses that cost: one primal solve plus one adjoint solve yields the sensitivities for all parameters at once. SU2 is unusual in the open-source CFD landscape because it ships three distinct adjoint routes inside the same code base, and because the maintainers published a head-to-head comparison of those routes on four benchmark geometries. That comparison is the reason this guide exists.

This entry is a case study, not a product page for the code itself; the tool-level profile lives in the SU2 tool entry, which covers build, licensing and the wider multiphysics stack. What follows concentrates on the decision an engineer actually faces: which adjoint formulation to trust for a given mesh and flow condition, how to parameterize the shape, how to verify the gradient before spending a week of compute on it, and what the measured drag reductions actually were in published work. Two published numerical results are reported verbatim and one of them is internally inconsistent with its own figure; that inconsistency is documented rather than smoothed over, because reproducing a headline drag number is exactly where case entries usually go wrong.

2. How It Works

The optimization loop has four layers. First, a geometry parameterization maps a small number of design variables onto the surface. SU2 ships Hicks-Henne bump functions for two-dimensional airfoils and free-form deformation for two- and three-dimensional bodies; published work also couples SU2 to parametric CAD through a design-velocity field computed from faceted approximations of the CAD geometry. Second, the primal problem is solved by the flow solver on an unstructured mesh. Third, the adjoint problem is solved to obtain surface sensitivities, and the sensitivities are projected back into the design space, producing a gradient of the objective with respect to each design variable. Fourth, an optimizer drives the loop; SU2's own tutorials and most published case studies use sequential least squares programming from SciPy.

The adjoint layer is where the engineering choice lives, and SU2 offers three formulations. The continuous adjoint in surface integral form derives the sensitivity purely from an integral over the design surface, with no field integral and no grid-displacement term; it is elegant and cheap, but it assumes a smooth surface, so sharp leading and trailing edges are a weak point. The continuous adjoint in field integral form restores the grid-differentiation terms through a volume integral, which costs extra work per design variable but is markedly more robust near sharp edges and when the numerics change. The discrete adjoint is obtained by algorithmically differentiating the whole code base, including the nonlinear iteration structure, using the CoDiPack library developed at the Technical University of Kaiserslautern; it delivers numerically exact gradients for the implemented discrete system.

3. Scope and Assumptions

Every formulation in the comparison carries an assumption that the reader must hold in mind. The continuous adjoint routes use a frozen-viscosity, frozen-turbulence assumption by default: the adjoint does not linearize the Spalart-Allmaras closure, so the returned sensitivities are consistent with a frozen turbulence field. The discrete adjoint can be run with or without that freezing, which makes it possible to measure directly how much the adjoint turbulence model would have mattered. The published comparison shows that for a transonic case the effect of freezing turbulence was small relative to the effect of including grid terms, which is a useful result to know before spending effort on an adjoint turbulence model.

Mesh quality is the other assumption. The surface integral formulation is accurate on smooth, high-quality grids and can degrade by more than an order of magnitude on coarse mixed-element meshes with highly stretched boundary-layer cells. The field integral formulation recovers much of that robustness, but it needs the volume grid to be perturbed for each design variable, so its cost scales linearly with the number of design variables. The discrete adjoint needs one primal solve, one flow adjoint solve and one grid adjoint solve, and it also carries memory overhead from the algorithmic differentiation tape.

Convergence of the adjoint problem is a practical limitation in its own right. In the automotive case the primal problem converged to machine precision while the continuous adjoint reduced the adjoint density residual by only three to four orders of magnitude. Practically, this means the adjoint solver may need its own numerical method settings, and that a coupled primal-adjoint residual history is worth inspecting before trusting any gradient.

4. Getting Started

The fastest path is the official Quick Start tutorial, which runs a steady two-dimensional Euler computation on a NACA 0012 airfoil at an angle of attack of 1.25 degrees, Mach 0.8, with a native SU2 mesh of 10216 triangular cells and 5233 points. The same configuration file then runs the adjoint: the mathematical problem flag selects the direct or the continuous adjoint system, and the output file list controls whether a restart, a ParaView volume file and a surface CSV are written. Reading the surface sensitivity field from that output is the fastest way to build intuition about where the gradient wants to move the shape.

From there the shape-design tutorials are the main path. The official tutorial set includes an unconstrained inviscid NACA 0012 airfoil, a constrained inviscid ONERA M6 wing, a constrained turbulent RAE 2822 airfoil, a multi-objective supersonic ramp, an unsteady shape optimization case, a species-transport design case and a turbulent three-dimensional pipe-bend case with pressure-drop objective. These run the same four-layer loop and differ mainly in the flow condition and the constraint set.

Practical setup notes: the repository ships prebuilt archives for Linux, macOS and Windows in both MPI and OpenMP variants. The Python wrapper was rewritten in version 8.0.0 to support in-memory mesh deformation, which is what makes scripted optimization loops convenient, because the geometry update no longer needs a round trip through the filesystem. CoDiPack 2 was integrated at the same time, and the hybrid parallel discrete adjoint received a dedicated performance pass, so discrete-adjoint runs on multiple nodes are a supported configuration rather than an experiment.

5. Comparison with Alternatives

Against finite differences, the adjoint is not primarily a speed win but a robustness win at scale: finite differences need one extra primal solve and one mesh perturbation per design variable, while the adjoint needs a fixed small number of solves regardless of variable count. On a coarse mesh the finite-difference estimate also inherits the noise of the primal residual, which is exactly the noise the adjoint formulations disagree about.

Against the other adjoint formulations inside SU2, the published evidence is specific. On the NACA 0012 inviscid transonic grid-refinement family, the discrete adjoint and finite differences track each other almost indistinguishably, while the continuous formulations converge to a different asymptotic gradient magnitude, with the field integral form approaching that value faster than the surface integral form. On the RAE 2822 transonic turbulent case and on the NACA 4412 subsonic case, the surface integral form strays near the leading and trailing edges and can be an order of magnitude away from the discrete adjoint once the numerics are changed, while the field integral form recovers the correct sign and trend. On the three-dimensional Ahmed body, the surface integral form is off by an order of magnitude despite correct signs, and the field integral form tracks the discrete adjoint and finite differences closely.

On the parameterization side, an independent 2025 comparison of Hicks-Henne bump functions against free-form deformation on NACA 0012 with the discrete adjoint found the two broadly equivalent in effectiveness, with Hicks-Henne reaching a comparable result in fewer design iterations while free-form deformation gave a smoother, more stable drag decrease and Hicks-Henne showed more unsteadiness during the loop. The choice is therefore about iteration cost versus trajectory smoothness rather than about final quality.

6. Benchmarks and Evidence

The four-geometry adjoint comparison reports the NACA 0012 grid family used for the inviscid transonic case: five successively coarsened structured O-grids with 8385, 33153, 131841, 525825 and 2100225 points, non-dimensional spacing 16, 8, 4, 2 and 1, and drag in counts of 236.42, 235.54, 235.51, 235.54 and 235.55. Nineteen Hicks-Henne bump variables were spaced at 5 percent chord intervals, and the far-field boundary sat about 150 chords away.

The RAE 2822 case used AGARD case 6 conditions: Mach 0.729, angle of attack 2.31 degrees, Reynolds number 6.5 million based on unit chord, free-stream temperature 288.15 K, a mixed-element grid of 13937 points and 22842 elements with 192 edges along the airfoil and 40 along the far field, and 30 free-form deformation control points. The NACA 4412 case ran at Mach 0.09, 13.87 degrees, Reynolds number 1.52 million and 297.778 K on a 598 by 102 all-quadrilateral O-grid of 60996 points. The Ahmed body ran at Mach 0.1728 with zero angle of attack and zero sideslip, Reynolds number 4.29 million on a body length of 1.044 m, free-stream temperature 300 K, on a half-body mixed-element mesh of 247862 points and 508080 elements with 6 control points on the upper rear corner.

Independent CAD-parameterized work on SU2 reported three results. A CATIA V5 NACA 0012 case at Mach 0.8 and 1.25 degrees with a 200-point surface discretization recorded drag coefficient moving from 0.022223 to 0.000959, a figure that does not agree with the optimization history figure in the same paper, whose vertical axis spans 0 to 0.024 with the curve ending near 0.012. An ONERA M6 wing case at Mach 0.8395 and 3.06 degrees on a Gmsh mesh of 154617 nodes and 707115 tetrahedra, with a lift constraint of 0.2864, reduced drag coefficient from 0.011795 to 0.010153, roughly 14 percent, while respecting the constraint. An NLR 7301 high-lift flap case at Mach 0.185, 6 degrees, Reynolds number 2.51 million with a Spalart-Allmaras closure raised lift-to-drag ratio from 79.88 to 81.36, about 1.85 percent, with the per-element force breakdown shifting from the upper wing toward the flap.

7. Role in Physics-AI Workflows

SU2 plays three distinct roles in a physics-AI workflow, and separating them matters for procurement and for research planning. As a high-fidelity reference, it supplies the gradient-corrected simulation that a surrogate is trained against; the machinery described in the guide is exactly what makes the reference trustworthy at the gradient level rather than only at the field level.

As a teacher signal, the adjoint output is a compact, physically meaningful target: a surface sensitivity field, or a gradient with respect to a small parameter set. Learning a model to predict sensitivities from geometry alone is a considerably easier regression problem than predicting the full flow field, and it converts a costly surrogate-training problem into a cheap one. This is the route with the strongest evidence behind it, since the sensitivity field has far lower dimension than the field and inherits the constraint structure of the design problem.

Inside the optimization loop, SU2 itself now contains learning components. Version 8.0.0 introduced data-driven fluid models built on a multilayer perceptron, together with a Newton solver initial guess improved for that data-driven model in version 8.5.0. Version 8.4.0 and 8.5.0 brought Newton-Krylov improvements and switched the Newton-Krylov adjoint to the FGCRODR linear solver. Version 8.6.0 added Jacobian quantization to speed up the linear algebra, an initial end-to-end CUDA FGMRES path, GPU ports of the ILU and LU-SGS preconditioners, multi-zone adjoints for turbomachinery, and a detailed-chemistry solver coupled to Cantera. For a team deciding where machine learning belongs in a CAE pipeline, this is concrete evidence that the open-source CFD stack itself is absorbing learned components at the solver level.

8. Limitations and Failure Modes

The most common failure mode is trusting a gradient without a verification step. The published comparison makes this concrete: change the numerical methods of a continuous adjoint and the surface integral result can move by an order of magnitude away from the discrete adjoint and finite-difference references, while the field integral form recovers agreement. A gradient that was never checked against finite differences on a coarse mesh, and a gradient that was never checked after a numerics change, are both unverified quantities that will silently misdirect an optimizer.

The second failure mode is treating a drag-reduction number as an aerodynamic result. The published CAD-parameterized NACA 0012 figure quoted above is internally inconsistent, and drag minimized at fixed angle of attack can be reduced by shrinking the lifting surface rather than by improving the flow, so the headline number says little about aerodynamic quality unless lift is constrained. The ONERA M6 case, which constrains lift at 0.2864 and reports roughly 14 percent drag reduction, and the NLR 7301 case, which optimizes lift-to-drag ratio directly and reports roughly 1.85 percent, are the more transferable numbers because the objective is defined in a way that resists trivial degradation.

The third failure mode is underestimating adjoint convergence difficulty. The continuous adjoint reduced its density residual by only three to four orders of magnitude on the automotive mesh, and the paper notes that convergence problems with adjoints are common enough that choosing different numerical methods for the adjoint than for the primal is a routine tactic, with an accuracy cost.

The fourth failure mode is scope mismatch. The adjoint machinery described here addresses shape optimization of a fixed geometry family under a stated flow condition. Transonic shocks, unsteady separation, ground effect, transition and multi-fidelity blending all fall outside the verified envelope of the comparisons above.

9. Version and Source Notes

The repository su2code/SU2 was created on GitHub on 28 June 2013, and the first public offering predates that, in January 2012, which is why 2012 is recorded as the first release year. The default branch is master. As of 11 November 2026 the repository shows 1856 stars, 1027 forks and 124 open issues, and the most recent push was on 10 November 2026.

The latest release is version 8.6.0, published on 30 October 2026. Its release notes list updates to the linear solver to run on GPUs, a new pressure-based incompressible solver, multi-zone adjoint support for turbomachinery, a detailed chemistry solver coupled with Cantera, multigrid improvements and scalar solver improvements. Version 8.5.0, published on 27 April 2026 under the Harrier codename, brought significant multigrid improvements, a grey-area mitigation strategy for hybrid RANS-LES, fully functional thermo-elasticity coupling and the adjoint thermo-elasticity work. Version 8.4.0 followed on 12 January 2026 with the FGCRODR linear solver and Newton-Krylov improvements. Version 8.0.0, published on 29 August 2023, is the release that introduced the rewritten Python wrapper, combustion modelling through the flamelet approach, data-driven fluid models, hybrid parallel discrete adjoint performance work, CoDiPack 2, and SST-2003m as the new default SST variant. Versions 8.1.0 through 8.3.0, released between September 2024 and September 2025, carry the Harrier codename, and the 7.x series used the Blackbird codename.

Two corrections to earlier statements about this entry. The licence was previously given as "see the LICENSE file"; the repository LICENSE.md is the GNU Lesser General Public License version 2.1, February 1999, and version 1.0 and 2.0 of the code were distributed under GPL-3.0 before the move to LGPL-2.1 from version 2.0.7 onward. Note that the GitHub API reports the licence as unset for this repository, because the file is named LICENSE.md rather than LICENSE, which is a metadata artifact rather than a licence change. The second correction concerns the adjoint: this entry previously described SU2 as being defined by its continuous adjoint, whereas the code ships the surface integral continuous adjoint, the field integral continuous adjoint and the algorithmic-differentiation discrete adjoint, and the published comparison indicates the discrete adjoint is the numerically exact one. The description also understated the contributor base: the code is led from Stanford University but developed jointly with groups at Delft University of Technology, the Technical University of Kaiserslautern, the Politecnico di Milano and Imperial College London, and is now hosted by the SU2 Foundation, a non-profit organization formed in the United States.

10. References

  1. Economon T. D., Palacios F., Copeland S. R., Lukaczyk T. W., Alonso J. J., "SU2: An Open-Source Suite for Multiphysics Simulation and Design", AIAA Journal, Vol. 54, No. 3, March 2016, pp. 828-846, DOI 10.2514/1.J053813
  2. Economon T. D., Alonso J. J., Albring T., Gauger N. R., "Adjoint Formulation Investigations of Benchmark Aerodynamic Design Cases in SU2", AIAA 2017-4363, 38th AIAA Aerospace Sciences Meeting, DOI 10.2514/6.2017-4363
  3. Agarwal D., Marques S., Robinson T., Armstrong C., Hewitt P., "Aerodynamic Shape Optimization Using Feature based CAD Systems and Adjoint Methods", AIAA 2017-3999, 18th AIAA/ISSMO Multidisciplinary Analysis and Optimization Conference, DOI 10.2514/6.2017-3999
  4. Nguyen Trung H., Hoang Gia L., Nguyen Huy D., Nguyen Quoc B., Pham Van S., "Two-Dimensional Gradient-Based Aerodynamic Shape Optimization with Two Geometry Parameterization Techniques using SU2 Code", Smart Systems and Devices, Vol. 35, No. 3, 2025, pp. 45-52, DOI 10.51316/jst.184.ssad.2025.35.3.6
  5. su2code/SU2 code repository and LICENSE.md carrying the GNU Lesser General Public License version 2.1, https://github.com/su2code/SU2
  6. SU2 official Quick Start tutorial for the NACA 0012 airfoil, https://su2code.github.io/docs_v7/Quick-Start/
  7. SU2 official shape design tutorial set, https://su2code.github.io/tutorials/home/
  8. SU2 official verification and validation case index, https://su2code.github.io/vandv/home/
  9. SU2 release notes for versions 8.6.0, 8.5.0, 8.4.0 and 8.0.0, https://github.com/su2code/SU2/releases
  10. SU2 project home page and SU2 Foundation description, https://su2code.github.io
  11. SciCompKL CoDiPack algorithmic differentiation library, https://github.com/SciCompKL/CoDiPack
Tags: