Adjoint-Based Aerodynamic Shape Optimization on Unstructured Meshes Giampietro Carpentieri Delft university of technology, Kluyverweg 1, 2629 HS, Delft, The Netherlands September 14, 2007
1- Numerical results 2- Optimization framework 3- Flow solver 4- Adjoint solver 5- Gradient, Geometric sensitivities and mesh deformations 6- Shape Parameterization 7- Optimizer
RAE2822 =2, Mach =0.73 -60 % Lift Relative max thickness Upper nose radius Lower nose radius Trailing edge angle 30% reduction 10% reduction
RAE2822 =2, Mach =0.73 Drag Lift Thickness Nose U. Nose L. TE Angle Pressure, RAE2822 Pressure, OPTIMIZED Final CL = (1 + h) CL0 = (1 - 5.0x10-5 ) CL0 CL = 0.005 % CL0 Constraints Drag Lift Thickness Nose U. Nose L. TE Angle 0.40 -5.0x10-5 -1.1x10-2 -3.6x10-1 -9.9x10-1 -6.4x10-2
NACA64A410 =0, Mach =0.75 -86 % Lift Relative max thickness Upper nose radius Lower nose radius Trailing edge angle 10% reduction
NACA64A410 =0, Mach =0.75 Drag Lift Thickness Nose U. Nose L. Pressure, NACA64A410 Pressure, OPTIMIZED Constraints Drag Lift Thickness Nose U. Nose L. TE Angle 0.14 -6.5x10-5 -2.3x10-3 -4.4 -1.7x10-1 -9.9x10-3
NACA0012 =2, Mach =0.75 -90% Lift Relative max thickness Upper nose radius Lower nose radius Trailing edge angle 10% reduction
NACA0012 =2, Mach =0.75 Drag Lift Thickness Nose U. Nose L. TE Angle Pressure, NACA0012 Pressure, OPTIMIZED Constraints Drag Lift Thickness Nose U. Nose L. TE Angle 0.1 -6.4x10-6 -1.1x10-3 -1.1x10-2 -3.15 -4.4x10-1
NACA0012 =2, Mach =1.5 -71% Lift Relative max thickness Upper nose radius Lower nose radius Trailing edge angle 50% reduction 90% reduction
NACA0012 =2, Mach =1.5 Drag Lift Thickness Nose U. Nose L. TE Angle Pressure, NACA0012 Pressure, OPTIMIZED 1% c Nose close-up Constraints Drag Lift Thickness Nose U. Nose L. TE Angle 0.29 -8.8x10-5 -6.5x10-4 -5.0x10-3 -6.0x10-3 -6.6
NACA64A410, Cm CONSTRAINT Optimized, no Cm constraint Optimized, Cm constraint
ONERA @ =3.6 Mach =0.84 INITIAL PRESSURE OPTIMIZED Shock strength reduced
ONERA @ =3.6 Mach =0.84 Starting from the ONERA wing: 1) WING-L = 2 times the lift of the ONERA wing; 2) WING-R = WING-L optimized for Drag reduction. WING-L WING-R
ONERA XZ PLANE XY PLANE ROOT TIP TIP ROOT LE TE TE ONERA WING-L WING-R
Airfoil sections WING-L WING-R ROOT HALF SPAN TIP
1- Numerical results 2- Optimization framework 3- Flow solver 4- Adjoint solver 5- Gradient, Geometric sensitivities and mesh deformations 6- Shape Parameterization 7- Optimizer
OPTIMIZER SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT Functionals OPTIMIZER Shape Parameters Gradients SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT ASSEMBLY Boundary displacement Adjoint variables MESH DEFORMATION IF GRADIENT ADJOINT SOLVER Updated mesh Flow variables FLOW SOLVER IF GRADIENT
OPTIMIZER SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT Functionals OPTIMIZER Shape Parameters Gradients SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT ASSEMBLY Boundary displacement Adjoint variables MESH DEFORMATION IF GRADIENT ADJOINT SOLVER Updated mesh Flow variables FLOW SOLVER IF GRADIENT
OPTIMIZER SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT Functionals OPTIMIZER Shape Parameters Gradients SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT ASSEMBLY Boundary displacement Adjoint variables MESH DEFORMATION IF GRADIENT ADJOINT SOLVER Updated mesh Flow variables FLOW SOLVER IF GRADIENT
OPTIMIZER SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT Functionals OPTIMIZER Shape Parameters Gradients SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT ASSEMBLY Boundary displacement Adjoint variables MESH DEFORMATION IF GRADIENT ADJOINT SOLVER Updated mesh Flow variables FLOW SOLVER IF GRADIENT
OPTIMIZER SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT Functionals OPTIMIZER Shape Parameters Gradients SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT ASSEMBLY Boundary displacement Adjoint variables MESH DEFORMATION IF GRADIENT ADJOINT SOLVER Updated mesh Flow variables FLOW SOLVER IF GRADIENT
OPTIMIZER SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT Functionals OPTIMIZER Shape Parameters Gradients SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT ASSEMBLY Boundary displacement Adjoint variables MESH DEFORMATION IF GRADIENT ADJOINT SOLVER Updated mesh Flow variables FLOW SOLVER IF GRADIENT
OPTIMIZER SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT Functionals OPTIMIZER Shape Parameters Gradients SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT ASSEMBLY Boundary displacement Adjoint variables MESH DEFORMATION IF GRADIENT ADJOINT SOLVER Updated mesh Flow variables FLOW SOLVER IF GRADIENT
OPTIMIZER SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT Functionals OPTIMIZER Shape Parameters Gradients SHAPE PARAMETERIZATION GEOMETRIC SENSITIVITIES GRADIENT ASSEMBLY Boundary displacement Adjoint variables MESH DEFORMATION IF GRADIENT ADJOINT SOLVER Updated mesh Flow variables FLOW SOLVER IF GRADIENT
1- Numerical results 2- Optimization framework 3- Flow solver 4- Adjoint solver 5- Gradient, Geometric sensitivities and mesh deformations 6- Shape Parameterization 7- Optimizer
Median-dual discretization Control volume for node i MESH DUAL MESH
Euler equations Conservative form Conservative variables Inviscid flux vector Conservative form Finite-volume discretization, i=1,Nodes Residual = Sum of Numerical fluxes
Numerical fluxes = Roe averages Numerical flux (interface ij) =Roe’s approximate Riemann solver Farfield Boundary flux Wall
MUSCL scheme Primitive variables reconstruction at mid-point of edge ij = Venkatakrishnan’s limiter = Least squares/Green Gauss gradient = Primitive variable 2nd order accuracy: evaluate flux with reconstructed variables
Implicit solution Compact form Discretize time + Defect correction Low-order residual Backward Euler with approximate Jacobian Matrix of volume/local delta_t Local delta_t increased according to CFL update discrete norm
Low-order Jacobian
Linear system At each iteration n, solve the linear system iteratively = Preconditioner = Linear residual Iterates k times until 1 order of magnitude reduction is satisfactory (c=0.1)
Symmetric Gauss-Seidel preconditioning No preparatory work or sparse matrix data format required. Preconditioner applied by means of a forward and a backward sweeps on the nodes Sub-matrices of , and : Forward solve Backward solve and can be computed on-the-fly matrix-free preconditioning
2D Test Cases (AGARD) RAE2822 – Mach = 0.75 = 3.0
2D Test Cases (AGARD) NACA0012 – Mach = 0.8 = 1.25
2D Test Cases (AGARD) NACA0012 – M = 0.85 = 1.0
Onera-M6 wing & DLR-F6 wing body
Comparison with Edge, =3.6 Mach =0.84 y/b = 20% y/b = 45% y/b = 95% Edge is the flow solver of the FOI (Swedish Defence Research Agency)
Onera-M6 convergence history Average number of linear iterations = 6 Lift is converged after 50 iterations
Comparison with Edge, =0 Mach =0.75 y/b = 15% y/b = 40% y/b = 85%
1- Numerical results 2- Optimization framework 3- Flow solver 4- Adjoint solver 5- Gradient, Geometric sensitivities and mesh deformations 6- Shape Parameterization 7- Optimizer
Sensitivity Analysis Parameter Functional (e.g., lift, drag or pitch moment) State equation (steady solution) Sensitivity wrt Equation Cost Primal, Linearized Flow sensitivity Dual, Adjoint Adjoint variables
Continuous vs Discrete approach Major difficulties of the Discrete approach are - the differentiation; and - the transposition. It is not trivial to implement an adjoint code that has the same memory and CPU-time requirements as that of the original flow solver.
Definitions Gradient Limiters Vectors of length N (number of nodes) Reconstructed left states Reconstructed right states Numerical fluxes Vectors of length E (number of edges) The residuals vector can be written as where and To simplify the derivation, the limiters are neglected:
Adjoint assembly After chain rule and transposition, the LHS of the adjoint equation may be written as 1st order part 2nd order part
Topology of the matrices column e Differentiation of the numerical fluxes EDGES row e EDGES Differentiation of the reconstruction operator column i column i row e row e EDGES EDGES NODES NODES
sub matrices The numerical flux Jacobian is approximated, the Roe matrix is frozen Inverse of Transformation matrix, evaluated with averaged variables Transformation matrix, evaluated with reconstructed variables Since and
Matrix-free assembly IN OUT RES_DIFF Given the adjoint variables, the differentiated residual routine compute the matrix-vector products; Only the original edge-based data structure is used. The differentiated gradient routine completes the assembly: IN OUT The transposed gradient takes a multi-component vector as input and gives a vector as output, it is the reverse of the gradient routine.
Example: Green-Gauss LINEARIZED ADJOINT Gathering Scaling Gathering OUT OUT Gathering Scaling Gathering Scaling
Solution of the adjoint equations The Adjoint equation is linear 2nd order Jacobian is poorly diagonally dominant Linear solver fails Solution: use the same scheme as for the flow equations, i.e., Constrained shape optimization may require more than one adjoint solution, one for each functional
Simultaneous solution of the Adjoints NJ adjoint equations have the same Jacobian. One has to solve a linear system with multiple RHS: Simultaneously solution gives appreciable time saving compared to sequential solutions. Time saving is obtained since the matrix terms are expensive to evaluate
CPU-time stored on-the-fly CPU time Flow = CPU time Adjoint CPU time Adjoint = 8.5% more CPU time Flow CPU-time savings of simultaneous Adjoint solutions compared to sequential solutions: 2 Adjoints = 25%; 3 Adjoints = 33%. 2 Adjoints = 45%; 3 Adjoints = 60%.
CPU-time stored on-the-fly CPU time Flow = CPU time Adjoint
Storage requirements Flow solver: storage requires 2.7 times more memory than matrix-free; Storage: 3 Adjoints require 1.4 times more memory than flow solver; Matrix-free: 3 Adjoints require 2.1 times more memory than flow solver.
Visualization of the Adjoint variables NACA0012 @ Mach = 1.2 = 7.0 Mach number Some algebra shows that E.g., the 3rd adjoint variable of the lift reads . It is the lift sensitivity wrt vertical momentum !
Exact vs approx Adjoint code Due to the approximations (fluxes and limiters), the sensitivity is not exact, error ~ 1-2% In 2D, if the gradient is included, the approximated adjoint code produces almost the same results as the exact code. Only when the gradient is neglected, the optimization stalls. small differences no differences
Verification of the Adjoint code Exact and approximate Adjoint: Primal and dual sensitivities must converge to the same value. Exact Adjoint only: Quadratic convergence must be obtained for Newton’s iterations.
1- Numerical results 2- Optimization framework 3- Flow solver 4- Adjoint solver 5- Gradient, Geometric sensitivities and mesh deformations 6- Shape Parameterization 7- Optimizer
Mesh deformation = Boundary displacement according to shape parameterization = Volume mesh displacement Given compute Spring analogy solved by Jacobi iterations: is stiffness of edge ij, inverse of edge length
Gradient and geometric sensitivities Since after the Adjoint compute Mesh coordinates , Mesh metrics , Boundary deformations , Limiters , Gradient Coordinates depend on shape parameter: Residuals depend on coordinates: Chain rule Each term is a differentiated subroutine. In 2D source code generated by Tapenade is used. In 3D finite differences are used (temporarily).
1- Numerical results 2- Optimization framework 3- Flow solver 4- Adjoint solver 5- Gradient, Geometric sensitivities and mesh deformations 6- Shape Parameterization 7- Optimizer
Chebyschev polynomials Shape can be parameterized using orthogonal Chebyschev polynomials. Basis function Parameter/Design variable First basis, k=0, resembles an airfoil shape.
Nose radius and TE angle The derivatives of the polynomial read 1st 2nd where It is possible to evaluate the TE angle (1st derivative) and the curvature radius:
Shape approximation Quadratic Error Function Gradient Hessian The set of parameters that minimize the error reads
Number of basis functions Maximum difference between the approximation and the original coordinates. In the case of: 1) unit chord airfoils; and 2) finite-volume solvers that use linear boundary representations, it is recommended that A lower error may results in discrepancies between the flow computed on the original and on the approximated airfoils.
Approximation of airfoils WHITCOMB BWB-F BWB-W EPPLER NACA0012 ONERA RAE2822 NASA-HSNLF NLR7301
Parameterization of Wing Displacements In the case of wings, it is more convenient to parameterize the displacements: = dimensionless chord-wise coordinate where = dimensionless span-wise coordinate The coefficients change along the span-wise direction as: There are a total of N x M design variables
1- Numerical results 2- Optimization framework 3- Flow solver 4- Adjoint solver 5- Gradient, Geometric sensitivities and mesh deformations 6- Shape Parameterization 7- Optimizer
Problem Statement Minimize function with equality/inequality constraints and bounds on the variables Objective function, scaled drag coefficient Relative maximum thickness constraint Upper nose radius constraint Lower nose radius constraint Trailing edge angle constraint Lift equality constraint
Sequential Linear Programming Linearization point Center of the circle Optimum Linearized problem Optimum Non-Linear problem It lies outside of the feasible design space It lies inside the feasible design space The optimum may be approached from the feasible region by moving to the center of the largest circle that fits into the linearized design space.
The method of centers A Liner Programming problem is obtained for the vector The new design is then updated as In practice, move limits + reduction factors must be introduced for underconstrained problem, which has the tendency to be unbounded after linearization. I.e., smaller bounds are used for the vector s:
Thank you for your interest