An Object-oriented Framework for Rapid Discrete Adjoint Development using OpenFOAM

The adjoint method is an efficient approach for computing derivatives because its computational cost is independent of the number of design variables. Using the derivatives computed from the adjoint method, a gradient-based optimization can handle complex design problems such as full-scale aircraft. Despite the above advantages, implementing the adjoint method for a partial differential equation based primal solver is a time-consuming task. To lower the barrier for adjoint implementations, we propose an object-oriented framework to rapidly develop the discrete adjoint method based on OpenFOAM; an open-source, multiphysics package that contains more than 80 primal solvers involving a wide range of disciplines such as aerodynamics, hydrodynamics, heat transfer, structures, combustion, and multiphase flow. The proposed framework provides high-level interfaces that allow us to implement the adjoint method for any existing steady-state OpenFOAM primal solvers by adding or modifying only O(100) lines of source code. In this paper we introduce the overall structure of the proposed adjoint framework and detail the adjoint development process by starting with a simple scalar transport equation and then extending the development to the Navier–Stokes equations. So far, we have implemented adjoint methods for five primal solvers and four turbulence models. We observe excellent adjoint scalability with up to O(10) million cells and O(1000) CPU cores, and the maximal error in the adjoint derivatives is less than 0.1%. To further demonstrate the benefit of having the flexibility to rapidly develop the adjoint method for different solvers and turbulence models, we showcase three successful aerodynamic shape optimizations that cover incompressible, compressible, full turbulence, and transitional turbulence conditions. Our proposed adjoint framework has the potential of becoming a useful tool to handle high-fidelity multidisciplinary design optimization problems for general engineering systems such as aircraft, cars, ships, and turbomachinery.

[1]  E. D. V. Bigarella,et al.  An efficient setup for freestream turbulence on transition prediction over aerospace configurations , 2018, Aerospace Science and Technology.

[2]  Cody A. Paige,et al.  Automatic Differentiation Adjoint of the Reynolds-Averaged Navier-Stokes Equations with a Turbulence Model , 2013 .

[3]  Florian R. Menter,et al.  Correlation-Based Transition Modeling for Unstructured Parallelized Computational Fluid Dynamics Codes , 2009 .

[4]  Antony Jameson,et al.  Aerodynamic design via control theory , 1988, J. Sci. Comput..

[5]  Joaquim R. R. A. Martins,et al.  Aerodynamic Shape Optimization Investigations of the Common Research Model Wing Benchmark , 2015 .

[6]  Darrell Guillaume,et al.  Computational and Experimental Design of a Fixed-Wing UAV , 2015 .

[7]  Charles Mader Stability-constrained Aerodynamic Shape Optimization with Applications to Flying Wings , 2012 .

[8]  J. Eric,et al.  Aerodynamic Design Optimization on Unstructured Meshes Using the Navier-Stokes Equations , 1998 .

[9]  Joaquim R. R. A. Martins,et al.  Aerothermal Optimization of Internal Cooling Passages Using a Discrete Adjoint Method , 2018, 2018 Joint Thermophysics and Heat Transfer Conference.

[10]  Uwe Naumann,et al.  A Discrete Adjoint Model for OpenFOAM , 2013, ICCS.

[11]  Joaquim R. R. A. Martins,et al.  Effective adjoint approaches for computational fluid dynamics , 2019, Progress in Aerospace Sciences.

[12]  J. Martins,et al.  Multipoint Aerodynamic Shape Optimization Investigations of the Common Research Model Wing , 2015 .

[13]  Joaquim R. R. A. Martins,et al.  Design optimization for self-propulsion of a bulk carrier hull using a discrete adjoint method , 2019, Computers & Fluids.

[14]  Joaquim R. R. A. Martins,et al.  Component-Based Geometry Manipulation for Aerodynamic Shape Optimization with Overset Meshes , 2018 .

[15]  Jens-Dominik Mueller,et al.  STAMPS: a Finite-Volume Solver Framework for Adjoint Codes Derived with Source-Transformation AD , 2018, 2018 Multidisciplinary Analysis and Optimization Conference.

[16]  Joaquim R. R. A. Martins,et al.  High-Fidelity Hydrodynamic Shape Optimization of a 3-D Hydrofoil , 2015 .

[17]  J. Alonso,et al.  ADjoint: An Approach for the Rapid Development of Discrete Adjoint Solvers , 2006 .

[18]  Joaquim R. R. A. Martins,et al.  An aerodynamic design optimization framework using a discrete adjoint approach with OpenFOAM , 2018 .

[19]  Eric Blades,et al.  A fast mesh deformation method using explicit interpolation , 2012, J. Comput. Phys..

[20]  Jens-Dominik Müller,et al.  CAD‐based shape optimisation with CFD using a discrete adjoint , 2014 .

[21]  F. R. Menter,et al.  Transition Modelling for General Purpose CFD Codes , 2006 .

[22]  D. Spalding,et al.  A calculation procedure for heat, mass and momentum transfer in three-dimensional parabolic flows , 1972 .

[23]  Tim A. Albring,et al.  Efficient Aerodynamic Design using the Discrete Adjoint Method in SU2 , 2016 .

[24]  Luis Santos,et al.  Aerodynamic shape optimization using the adjoint method , 2007 .

[25]  C. Rhie,et al.  Numerical Study of the Turbulent Flow Past an Airfoil with Trailing Edge Separation , 1983 .

[26]  Zhenping Feng,et al.  Study on continuous adjoint optimization with turbulence models for aerodynamic performance and heat transfer in turbomachinery cascades , 2017 .

[27]  O. Pironneau On optimum profiles in Stokes flow , 1973, Journal of Fluid Mechanics.

[28]  Joaquim R. R. A. Martins,et al.  Multidisciplinary design optimization: A survey of architectures , 2013 .

[29]  Timothy R. Brooks,et al.  Benchmark Aerostructural Models for the Study of Transonic Aircraft Wings , 2018, AIAA Journal.

[30]  Joaquim R. R. A. Martins,et al.  A CAD-Free Approach to High-Fidelity Aerostructural Optimization , 2010 .

[31]  Joaquim R. R. A. Martins,et al.  Design of a transonic wing with an adaptive morphing trailing edge via aerostructural optimization , 2018, Aerospace Science and Technology.

[32]  Jens-Dominik Müller,et al.  Preparation and assembly of discrete adjoint CFD codes , 2011 .

[33]  Graeme J. Kennedy,et al.  Scalable Parallel Approach for High-Fidelity Steady-State Aeroelastic Analysis and Adjoint Derivative Computations , 2014 .

[34]  D. Mavriplis Discrete Adjoint-Based Approach for Optimization Problems on Three-Dimensional Unstructured Meshes , 2007 .