Analysis of the Adjoint Euler Equations as used for Gradient-based Aerodynamic Shape Optimization

Similar documents
A GPU Accelerated Adjoint Solver for Shape Optimization

Studies of the Continuous and Discrete Adjoint Approaches to Viscous Automatic Aerodynamic Shape Optimization

Airfoil shape optimization using adjoint method and automatic differentiation. Praveen. C

Optimization with Gradient and Hessian Information Calculated Using Hyper-Dual Numbers

An Optimization Method Based On B-spline Shape Functions & the Knot Insertion Algorithm

Airfoil Design Optimization Using Reduced Order Models Based on Proper Orthogonal Decomposition

Multi-Element High-Lift Configuration Design Optimization Using Viscous Continuous Adjoint Method

Computation of Fictitious Gas Flow with Euler Equations

Development of a Consistent Discrete Adjoint Solver for the SU 2 Framework

Helicopter Rotor Design Using a Time-Spectral and Adjoint-Based Method

41st AIAA Aerospace Sciences Meeting and Exhibit Jan 6 9, 2003/Reno, Nevada

Adjoint Solver Workshop

1.2 Numerical Solutions of Flow Problems

김태희, 권형일 1, 최성임 2* T.H. Kim, H.I. Kwon, and S.I. Choi

Automatic design procedures that use Computational Fluid Dynamics(CFD) combined with gradientbased

(c)2002 American Institute of Aeronautics & Astronautics or Published with Permission of Author(s) and/or Author(s)' Sponsoring Organization.

SU 2 : Advanced Analysis Topics

Module 1 Lecture Notes 2. Optimization Problem and Model Formulation

Shape optimisation using breakthrough technologies

High-Order Numerical Algorithms for Steady and Unsteady Simulation of Viscous Compressible Flow with Shocks (Grant FA )

Aerofoil Optimisation Using CST Parameterisation in SU2

Aerodynamic Inverse Design Framework using Discrete Adjoint Method

Development of a Maxwell Equation Solver for Application to Two Fluid Plasma Models. C. Aberle, A. Hakim, and U. Shumlak

Multi-point Aero-Structural Optimization of Wings Including Planform Variations

Multigrid Solvers in CFD. David Emerson. Scientific Computing Department STFC Daresbury Laboratory Daresbury, Warrington, WA4 4AD, UK

Adjoint-Based Sensitivity Analysis for Computational Fluid Dynamics

High-fidelity Multidisciplinary Design Optimization for Next-generation Aircraft

Combining source transformation and operator overloading approaches for adjoint CFD solvers

Numerical Methods for PDEs. SSC Workgroup Meetings Juan J. Alonso October 8, SSC Working Group Meetings, JJA 1

Comparison of h- and p- Adaptations for Spectral Difference Methods

Numerical Simulations of Fluid-Structure Interaction Problems using MpCCI

DESIGN OPTIMIZATION OF HIGH-LIFT CONFIGURATIONS USING A VISCOUS ADJOINT-BASED METHOD

Aerodynamic optimization using Adjoint methods and parametric CAD models

Introduction to ANSYS CFX

Single- and Multi-Point Aerodynamic Shape Optimization Using A Parallel Newton-Krylov Approach

Data Assimilation in Fluid Dynamics using Adjoint Optimization

Abstract. Introduction

34th AIAA Aerospace Sciences Meeting and Exhibit January 8 12, 1996/Reno, NV

Gradient and Grid Perturbation. 1. Finite Difference Method 2. Complex-Step Method 3. Grid Perturbation

A Scalable GPU-Based Compressible Fluid Flow Solver for Unstructured Grids

Automatic Differentiation Adjoint of the Reynolds-Averaged Navier Stokes Equations with a Turbulence Model

Backward facing step Homework. Department of Fluid Mechanics. For Personal Use. Budapest University of Technology and Economics. Budapest, 2010 autumn

Model Reduction for Variable-Fidelity Optimization Frameworks

Mesh Morphing and the Adjoint Solver in ANSYS R14.0. Simon Pereira Laz Foley

Research and Design working characteristics of orthogonal turbine Nguyen Quoc Tuan (1), Chu Dinh Do (2), Quach Thi Son (2)

I. Introduction. Optimization Algorithm Components. Abstract for the 5 th OpenFOAM User Conference 2017, Wiesbaden - Germany

Tutorial 17. Using the Mixture and Eulerian Multiphase Models

ADJOINT methods for sensitivity analysis involving partial

39th AIAA Aerospace Sciences Meeting and Exhibit January 8 11, 2001/Reno, NV

AERODYNAMIC DESIGN AND OPTIMIZATION TOOLS ACCELERATED BY PARAMETRIC GEOMETRY PREPROCESSING

Stream Function-Vorticity CFD Solver MAE 6263

A Study of the CST Parameterization Characteristics

CONFORMAL MAPPING POTENTIAL FLOW AROUND A WINGSECTION USED AS A TEST CASE FOR THE INVISCID PART OF RANS SOLVERS

SYSTEMS OF NONLINEAR EQUATIONS

Express Introductory Training in ANSYS Fluent Workshop 04 Fluid Flow Around the NACA0012 Airfoil

A Hybrid Cartesian Grid and Gridless Method for Compressible Flows

Faculty of Mechanical and Manufacturing Engineering, University Tun Hussein Onn Malaysia (UTHM), Parit Raja, Batu Pahat, Johor, Malaysia

Semi-automatic transition from simulation to one-shot optimization with equality constraints

Ryan C. Hulguin TACC-Intel Highly Parallel Computing Symposium April 10th-11th, 2012 Austin, TX

Flow Control of Curved Air Ducts using Topological Derivatives

Conceptual Design and CFD

Driven Cavity Example

MATH 573 Advanced Scientific Computing

Efficient Use of Iterative Solvers in Nested Topology Optimization

Gradient-based Optimization of Parameterized CAD Geometries

Debojyoti Ghosh. Adviser: Dr. James Baeder Alfred Gessow Rotorcraft Center Department of Aerospace Engineering

Realistic Animation of Fluids

High-order solutions of transitional flow over the SD7003 airfoil using compact finite-differencing and filtering

Vehicle Sketch Pad Applied To Propulsion-Airframe Integration

THE EFFECTS OF THE PLANFORM SHAPE ON DRAG POLAR CURVES OF WINGS: FLUID-STRUCTURE INTERACTION ANALYSES RESULTS

The Development of a Navier-Stokes Flow Solver with Preconditioning Method on Unstructured Grids

PROTECTION AGAINST MODELING AND SIMULATION UNCERTAINTIES IN DESIGN OPTIMIZATION NSF GRANT DMI

Grid Dependence Study of Transonic/Supersonic Flow Past NACA Air-foil using CFD Hemanth Kotaru, B.Tech (Civil Engineering)

Digital-X. Towards Virtual Aircraft Design and Testing based on High-Fidelity Methods - Recent Developments at DLR -

Solution of 2D Euler Equations and Application to Airfoil Design

The Eikonal Equation

Post Stall Behavior of a Lifting Line Algorithm

Missile External Aerodynamics Using Star-CCM+ Star European Conference 03/22-23/2011

Modeling Unsteady Compressible Flow

The purpose of this tutorial is to illustrate how to set up and solve a problem using the. Moving Deforming Mesh (MDM) using the layering algorithm.

Constrained Aero-elastic Multi-Point Optimization Using the Coupled Adjoint Approach

CFD Best Practice Guidelines: A process to understand CFD results and establish Simulation versus Reality

Summary of the C2.3 test case results

A High-Order Accurate Unstructured GMRES Solver for Poisson s Equation

A Knowledge Based Approach to Mesh Optimization in CFD Domain: ID Euler Code Example

Numerical Analysis of Shock Tube Problem by using TVD and ACM Schemes

Study and implementation of computational methods for Differential Equations in heterogeneous systems. Asimina Vouronikoy - Eleni Zisiou

Interface and Boundary Schemes for High-Order Methods

Multigrid Algorithms for Three-Dimensional RANS Calculations - The SUmb Solver

An Unsteady Discrete Adjoint Formulation for Two-Dimensional Flow Problems with Deforming Meshes

Single and multi-point aerodynamic optimizations of a supersonic transport aircraft using strategies involving adjoint equations and genetic algorithm

ABOUT THE GENERATION OF UNSTRUCTURED MESH FAMILIES FOR GRID CONVERGENCE ASSESSMENT BY MIXED MESHES

Partial Differential Equations

29th AIAA Fluid Dynamics Conference June 15 18, 1998/Albuquerque, NM

HPC Usage for Aerodynamic Flow Computation with Different Levels of Detail

Transition modeling using data driven approaches

Topology optimization of heat conduction problems

A Systematic Study on the Impact of Dimensionality for a Two-Dimensional Aerodynamic Optimization Model Problem

Geometry Parameterization Using Control Grids

Final Report. Discontinuous Galerkin Compressible Euler Equation Solver. May 14, Andrey Andreyev. Adviser: Dr. James Baeder

Transcription:

Analysis of the Adjoint Euler Equations as used for Gradient-based Aerodynamic Shape Optimization Final Presentation Dylan Jude Graduate Research Assistant University of Maryland AMSC 663/664 May 4, 2017

Abstract Adjoint methods are often used in gradient-based optimization because they allow for a significant reduction of computational cost for problems with many design variables. The project focuses on the use of adjoint methods for two-dimensional airfoil shape optimization using Computational Fluid Dynamics to solve the steady Euler equations. Adjoints in CFD 2/36

Design Problem We can change the shape of an airfoil by prescribing sinusoidal bumps along the surface of the airfoil: Known as Hicks-Henne bumps, both the location and the height of the bumps can be changed to alter the airfoil shape. [Hicks and Henne(1977)] Adjoints in CFD 3/36

Design Problem We would want to alter an airfoil to obtain more favorable aerodynamic properties. A simple example would be to approach a desired pressure distribution. Mathematically, we want to minimize the cost function: I c (α) = airfoil where α is the set of design variables and P = P (α) 1 2 (P P d) 2 [Nadarajah and Jameson(2002)] Adjoints in CFD 4/36

Design Problem For a single variable representing the location of one bump on the surface of the airfoil a parametric sweep of the cost function for a given desired pressure distribution shows Adjoints in CFD 5/36

Design Problem The goal of airfoil optimization is to obtain the design variable (airfoil geometry) where the cost function is a minimum. As shown, it is possible to have local minima in the cost function. This can be a challenge for gradient-based optimization methods. This will be discussed in a few slides Parametric sweeps of the design space (as shown above) are very expensive for multiple variables. Adjoints in CFD 6/36

Computing the Cost Function Most design cases will have many variables. Computing the value of the cost function is an expensive process because it requires solving the Euler Equations (using Computational Fluid Dynamics or CFD) to find the pressure. Knowing the gradient of the cost function is often required for gradient-based optimization methods however finding the gradient is non-trivial and expensive. Adjoints in CFD 7/36

Computing the Cost Function We want the gradient of the cost function with respect to the design variables. Using a brute-force approach: I c = I c(α 1 + α 1 ) I c (α 1 ) α 1 α 1 For 2 variables, 3 expensive CFD flow calculations are required to find I c (α 1,2 ), I c (α 1 + α 1 ), I c (α 2 + α 2 ) The adjoint method instead can find N variable sensitivities with the cost of a single CFD flow-computation and an additional adjoint. Adjoints in CFD 8/36

Discrete Euler Equations The Euler equations in coordinate directions ξ: q t + fc,i = 0, i = 1, 2 (1) ξ i ρ ρv 1 ρu q = J 1 1 ρu 1V, f c = J 1 1 + ξ 1,1p (2) ρu 2 ρu 2V 1 + ξ 1,2p e (e + p)v 1 V i = u 1ξ i,1 + u 2ξ i,2 (3) Note: Conventional usage of ρ, u i, e, p for density, velocity, energy, and pressure Adjoints in CFD 9/36

Discrete Euler Residual Let f denote flux in j-coordinate direction and g denote flux in k-coordinate direction. q t + f + g = 0 ξ 1 ξ 2 Let the Residual of the steady Euler Equation be defined as: R n = qn+1 q n t = 0 (4) The Residual expanded in both dimensions j, k at time n is R n j,k = ( f j+1/2,k f j 1/2,k ) ( gj,k+1/2 g j,k 1/2 ) = 0 (5) Adjoints in CFD 10/36

Approach: Adjoint Equation For our flow solution q and airfoil geometry X = X(α 1,..., α n ) our cost function is I c = I c (q, X) and a perturbation of the cost function is represented as: δi = IT q δq + IT X δx A perturbation of the flow residual R is represented as: [ q δ t + f ] [ ] [ ] c,i R R = δr = δq + δx = 0 ξ i q X Adjoints in CFD 11/36

Using the method of Lagrange multipliers: δi = IT q IT δq + δx ψt X {[ ] R δq + q [ ] } R δx X If the adjoint equation is satisfied: [ ] R T ψ = I q q [ ] R ψ T = IT q q then { I T δi = X ψt [ ]} R δx X Adjoints in CFD 12/36

In this final equation: { I T δi = X ψt [ ]} R δx X the cost function is independent of the flow solution. This means we can calculate all sensitivities I c α 1, I c α 2 from simply solving the adjoint equation ( same cost as Euler equations ) [ ] R T ψ = I q q Adjoints in CFD 13/36

Adjoint and Euler Problem The 2-D problems covered in this project are relatively simple in terms of memory requirements and computational cost. The selected 2D grid dimensions are: 181 (around airfoil) 60 (normal to airfoil) for a total of 10860 points, 43440 degrees of freedom. Euler solver with implicit routine converges 8-orders in 1000 iterations in 10 seconds (Intel i7 : 3.2 GHz). This problem size is intended to be small. More common 2D problems will have O(1 10 5 ) degrees of freedom. Adjoints in CFD 14/36

Summary of Methodology An Euler code, mesh generator, and adjoint code have been written in C++ and wrapped in a Python framework for communication. The Euler code has been Auto-Differentiated using TAPENADE [Hascoët and Pascual(2004)] The discrete adjoint has been derived for the Euler equations. The discrete adjoint equations have been hand-coded and validated against auto-differentiated and brute-force gradients. Gradients from the adjoint solutions have been applied to multi-variable airfoil optimization. Adjoints in CFD 15/36

Summary of Methodology An Euler code, mesh generator, and adjoint code have been written in C++ and wrapped in a Python framework for communication. The Euler code has been Auto-Differentiated using TAPENADE [Hascoët and Pascual(2004)] The discrete adjoint has been derived for the Euler equations. The discrete adjoint equations have been hand-coded and validated against auto-differentiated and brute-force gradients. Gradients from the adjoint solutions have been applied to multi-variable airfoil optimization. Adjoints in CFD 15/36

Summary of Methodology An Euler code, mesh generator, and adjoint code have been written in C++ and wrapped in a Python framework for communication. The Euler code has been Auto-Differentiated using TAPENADE [Hascoët and Pascual(2004)] The discrete adjoint has been derived for the Euler equations. The discrete adjoint equations have been hand-coded and validated against auto-differentiated and brute-force gradients. Gradients from the adjoint solutions have been applied to multi-variable airfoil optimization. Adjoints in CFD 15/36

Summary of Methodology An Euler code, mesh generator, and adjoint code have been written in C++ and wrapped in a Python framework for communication. The Euler code has been Auto-Differentiated using TAPENADE [Hascoët and Pascual(2004)] The discrete adjoint has been derived for the Euler equations. The discrete adjoint equations have been hand-coded and validated against auto-differentiated and brute-force gradients. Gradients from the adjoint solutions have been applied to multi-variable airfoil optimization. Adjoints in CFD 15/36

Summary of Methodology An Euler code, mesh generator, and adjoint code have been written in C++ and wrapped in a Python framework for communication. The Euler code has been Auto-Differentiated using TAPENADE [Hascoët and Pascual(2004)] The discrete adjoint has been derived for the Euler equations. The discrete adjoint equations have been hand-coded and validated against auto-differentiated and brute-force gradients. Gradients from the adjoint solutions have been applied to multi-variable airfoil optimization. Adjoints in CFD 15/36

Comparing Hand-Coded vs. Auto-Diff Adjoint Use of TAPENADE very convenient for auto-differentiation however Unable to auto-differentiate certain, more complicated section of code (ie. Implicit routines of the Euler solver) Creates complex code more difficult to read, optimize, and parallelize with OpenMP Hand-coded Adjoint was challenging to implement but gives full control over memory usage and code optimization Auto-Diff By-hand By-hand + OpenMP Time (s) 126.3 120.5 15.1 Speedup 1.0 1.05 8.36 Timing Results for 10000 Adjoint iterations (8-core CPU) Adjoints in CFD 16/36

Optimization Algorithm The final step for airfoil optimization is to use the gradients from the adjoint solution in a gradient-based optimization algorithm Entire courses are taught on optimization algorithms Many algorithms are readily available in pre-packaged libraries The Scientific Python SciPy optimization library has been specifically for use with: Conjugate Gradient (CG) method, variant of the Fletcher-Reeves method [Nocedal and Wright(2006)] Sequential Least SQuares Programming (SLSQP) [Kraft(1988)] Adjoints in CFD 17/36

1-Variable Results Recall the 1-variable case of moving a single bump along the surface of an airfoil Adjoints in CFD 18/36

1-Variable Results Recall the 1-variable case of moving a single bump along the surface of an airfoil Adjoints in CFD 18/36

1-Variable Results Brute-Force Auto-Diff Adjoint By-Hand Adjoint Gradients -0.0054687-0.0054693-0.0055054 Note: difference in by-hand adjoint from approximation of dissipation flux Adjoints in CFD 19/36

Optimization Method: SLSQP The Sequential Least SQuares Programming (SLSQP) method for gradient-based optimization is effectively Newton s method for unconstrained problems. 4-iterations: 5 Adjoint calls, 5 Euler calls, 209.7 seconds Adjoints in CFD 20/36

Optimization Method: Conjugate Gradient The Conjugate Gradient (CG) method of non-linear Possibly multiple function calls and adjoint calls per iteration. 4-iterations: 14 Adjoint calls, 14 Euler calls, 469.7 seconds Adjoints in CFD 21/36

Optimization Methods: Comments Both CG and SLSQP only found local minima of the single-variable cost function. CG converged faster to the solution with 4 iterations however each iteration required more function and adjoint calls. Because SLSQP required less function and adjoint calls, the 4 iterations ran in less wall-clock time. Adjoints in CFD 22/36

Optimization: Local Minima By changing the location of the initial guess, a different local minima is reached Adjoints in CFD 23/36

6-Variable Results 3 bumps on the lower surface, 3 on the upper surface Location of the bumps fixed at 25%, 50%, and 75% along the airfoil Only bump amplitudes are changed 6 total design variables Initial Gradients: I/ α 1 I/ α 2 I/ α 3 I/ α 4 I/ α 5 I/ α 6 Brute-Force -0.8495-0.4387-0.1935-3.588-0.8853-0.1000 AD Adjoint -0.8495-0.4389-0.1937-3.588-0.8855-0.1003 Adjoint -0.8549-0.4365-0.1851-3.635-0.8902-0.0946 Note: Discrepancy between AD adjoint and by-hand adjoint from approximation of dissipation terms Adjoints in CFD 24/36

SLSQP 6-variable Results Adjoints in CFD 25/36

SLSQP 6-variable Results Adjoints in CFD 26/36

Multi-variable Results: Comments Pressure matched relatively well except at trailing edge By adding additional bumps near the trailing edge this should help the solution Adjoints in CFD 27/36

8-Variable Results One more bump added on both the upper and lower surface at 95% along airfoil helps to reduce the error at the trailing edge. The solution after 7 SLSQP iterations is shown below. Adjoints in CFD 28/36

8-Variable Results One more bump added on both the upper and lower surface at 95% along airfoil helps to reduce the error at the trailing edge. The solution after 7 SLSQP iterations is shown below. Adjoints in CFD 28/36

Summary / Discussion Use of adjoint methods significantly reduces the cost of computing gradients of a cost function where the Euler equations must be solved. Use of both the auto-differentiated and by-hand Adjoint codes provide accurate gradients of a cost function with respect to a set of variables. These gradients can be used with gradient-based optimization methods to approach local minima of the cost function Converging to a local minima is sufficient for aerodynamic shape optimization problems since commonly engineers are interested in incremental changes from an initial, trusted guess. Adjoints in CFD 29/36

Milestones Functioning airfoil perturbation function in combination with mesh generation and 2D Euler Solver. Functioning brute-force method for sensitivity of Pressure cost function to airfoil perturbation variables. Auto-differentiation of Euler CFD solver. Validate auto-diff and brute-force method for simple reversedesign perturbations. Hand-coded explicit discrete adjoint solver. Implicit routine OpenMP Acceleration for discrete adjoint solver. Validate discrete adjoint solver against auto-diff and bruteforce methods. Late Oct Early Nov Late Nov Mid Dec Mid Feb March 6 March Early April March Mid April Test discrete adjoint solver with full reverse-design cases. Mid April Early May Adjoints in CFD 30/36

Deliverables Bitbucket GIT Repository of Euler, Grid-Generation, and Airfoil perturbation code in Python Framework Auto-differentiated Adjoint Code Hand-differentiated Adjoint Code Equations of hand-derived Adjoint relations for flux and dissipation terms. Sample run files for Euler-only, Adjoint-only, and full design case. Adjoints in CFD 31/36

References I [Hicks and Henne(1977)] R. Hicks and P. Henne. Wing design by numerical optimization. Aircraft Design and Technology Meeting. American Institute of Aeronautics and Astronautics, Aug 1977. doi: 10.2514/6.1977-1247. URL http://dx.doi.org/10.2514/6.1977-1247. [Nadarajah and Jameson(2002)] Siva Nadarajah and Antony Jameson. Optimal Control of Unsteady Flows Using a Time Accurate Method. Multidisciplinary Analysis Optimization Conferences, (June): -, 2002. doi: 10.2514/6.2002-5436. URL http://dx.doi.org/10.2514/6.2002-5436. [Hascoët and Pascual(2004)] Laurent Hascoët and Valérie Pascual. TAPENADE 2.1 user s guide. 2004. URL http://www.inria.fr/rrrt/rt-0300.html. [Nocedal and Wright(2006)] Jorge Nocedal and Stephen J. Wright. Numerical optimization. Springer series in operations research and financial engineering. Springer, New York, 2006. Adjoints in CFD 32/36

References II [Kraft(1988)] Dieter Kraft. A software package for sequential quadratic programming. Technical Report DFVLR-FB 88-28. Institut fur Dynamik der Flugsysteme, Oberpfaffenhofen, July 1988. [Nadarajah(2003)] S. Nadarajah. The Discrete Adjoint Approach to Aerodynamic Shape Optimization. Stanford University PhD Dissertation, 2003. Adjoints in CFD 33/36

Appendex Additional Slides Adjoints in CFD 34/36

Comments: Dissipation The main reason for the mismatch between the auto-differentiation result and by-hand result is the dissipation in the flux routine If I remove the dissipation from the auto-differentiated code, I get exactly the same sensitivity Looking at just the j-direction: ( R j = f j+ 1 2 + f j 1 2 ) ( h j+ 1 2 Where the scalar dissipation term h j+ 1 2 h j+ 1 2 is: = ɛσ (q j+1 q j ) + h j 1 2 ) Adjoints in CFD 35/36

Dissipation Approximations h j+ 1 2 = ɛσ (q j+1 q j ) ɛ is a constant, approximately 0.25 [Nadarajah(2003)]. σ is the spectral radius scaled by the face area: σ = V + c S j+ 1 2 and c is the speed of sound. Both V and c are functions of the flow q however according to Nadarajah [Nadarajah(2003)], σ does not vary significantly and can be considered constant in deriving the adjoint dissipation terms. While this may be the case for the variation of the residual with respect to q, my results show this is not the case for the variation of the residual with respect to X. Adjoints in CFD 36/36