Discrete Adjoint OpenFOAM


We develop a discrete adjoint version of OpenFOAM (currently based on OpenFOAM.com v2212). It can be applied to topology and shape optimization cases (i.e. for ductd flows or external aerodynamics).

A wide range of other use-cases can also be tackled due to the flexibility of the discrete adjoint approach. The following features are available:

  • Full first order adjoint of all OpenFOAM main libraries
  • Discrete adjoint versions of selected applications (e.g. discreteAdjointSimpleFoam)
  • Equidistant or Revolve Checkpointing
  • Reverse accumulation and Piggy-back optimization for fixed point iterations
  • Symbolically differentiated linear solvers
  • Parallelization with adjoint-MPI (AMPI)
  • Tangent Linear and Finite Difference Implementations for verification
  • Experimental second order derivatives support

The source is available upon request. Please drop us a mail and we'll grant you access to the repository.

A work in progress wiki with usage instructions can be found here.


Shape Sensitivities of Sonnenwagen / Image Credit: Lennart Moltrecht, sonnenwagen.org


Workshop Materials


Markus Towara





This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software and owner of the OPENFOAM®  and OpenCFD®  trade marks.