Brian Munguía: SciComp group at the Technische Universität Kaiserslautern
My project focused on the development of a new framework for aerodynamic shape optimization that minimizes the numerical error inherent in computational fluid dynamics (CFD) simulations, ensuring that the final design is accurate and truly optimal. The framework has two main ingredients that will be described in this report: anisotropic mesh adaptation, which is a method to reduce errors in CFD simulations, and a Simultaneous Analysis and Design (SAND) optimization framework, which is an efficient way of performing aerodynamic shape optimization. This work was implemented in SU2, an open-source CFD analysis and design code. The SciComp group in particular has developed the Code Differentiation Package (CoDiPack), an automatic differentiation library currently used by SU2 to efficiently compute sensitivities, known as an adjoint solution, needed for both mesh adaptation and aerodynamic shape optimization.Anisotropic Mesh Adaptation
When we simulate the flow around complex aerodynamic shapes such as aircraft and ground vehicles, we solve the fluid equations of motion on a discrete approximation of the volume surrounding the shape that we call a mesh. These meshes are often generated by the users of simulation software and are rarely optimal. For example, human generated meshes are often too coarse in regions with complex flow features (e.g. shock waves and vortices), resulting in significant numerical errors. Meshes might also have too much resolution in regions with no flow features, resulting in unnecessary computational burden for an already computationally expensive problem.
Figure 1. Example of a mesh (left) for a 2D cross-section of a hypersonic vehicle, and corresponding pressure contours (right) for a converged flow solution.
An estimate of the error in the flow solution can be used to automatically adapt the mesh in a way that increases the accuracy of the simulation without increasing the computational cost required to run a simulation. These error estimates typically depend on the adjoint solution that can be obtained from CoDiPack. Once an error estimate is obtained, the mesh adaptation is performed using AMG, a remeshing tool developed by the GAMMA3 team at Inria in France. My first task this summer was to implement the error estimate and adaptation loop in SU2.
Figure 2. Mesh adaptation framework. Starting with an initial mesh, we compute a flow and adjoint solution using SU2 and CoDiPack, which are used to obtain an adaptive metric. The mesh and adaptive metric are given to AMG which generates a new mesh. This cycle is repeated until the error in the solution is below a desired tolerance.
Figure 3. Flow solution (top left) and adjoint solution (top right) on the original mesh around an airfoil in supersonic flow, and flow solution on the resulting adapted mesh (bottom). The adaptation algorithm refines around the shock wave and stretches elements along the shock wave.Simultaneous Analysis and Design
In a typical aerodynamic shape optimization framework, the flow solution, adjoint solution, and design problem are solved in a nested manner. We first obtain information about the performance of our vehicle (e.g. how efficient is our aircraft? how loud is it?) by solving the fluid equations of motion. We then obtain adjoint solution, or the sensitivity of the performance with respect to the shape. In the simplest terms, the adjoint determines how the vehicle performance is affected with topological changes to the vehicle/shape. In our case, the adjoint solution is obtained using CoDiPack. The performance characteristics and sensitivities are then given to an optimization code, which modifies the shape. The process is repeated until the optimizer can no longer improve the performance. This approach to optimization can be quite expensive, since we typically need to solve anywhere from thousands to billions of equations for each flow and sensitivity analysis.
The SAND optimization framework, also known as the one-shot optimization framework, can significantly reduce the cost of performing aerodynamic shape optimization. By using some clever math to modify how the design is updated, we can prove that the flow, adjoint, and design problems can be solved simultaneously, rather than solving them one at a time like in the nested framework.
Members of the SciComp group have already implemented SAND optimization in SU2, but the existing implementation required the user to tune several parameters. If tuned improperly, these parameters would either result in slow convergence of the optimization or make the system of equations unstable. My second task this summer was to update the code to automatically compute these parameters such that the optimization would converge at a reasonable rate.
Figure 4. Pressure contours around an airfoil in transonic flow (left), and an airfoil optimized using SAND (right). The new airfoil is designed to have minimum drag while maintaining a user-specified lift, a common objective in aerodynamic shape optimization.Future Work
With the mesh adaptation and SAND frameworks implemented, the next step in the project is to combine them into an adaptive SAND framework. There are still several questions that need to be answered about the combined framework, like how should we adapt a mesh for a changing geometry, and how does mesh adaptation affect the convergence guarantees of SAND? Answering these questions and implementing the framework will require further collaboration between Stanford, TU Kaiserslautern, and Inria.