the continuous adjoint method for the computation of first
TRANSCRIPT
NATIONAL TECHNICAL UNIVERSITY OF ATHENS Parallel CFD & Optimization Unit
Laboratory of Thermal Turbomachines
The Continuous Adjoint Method for the Computation
of First- and Higher-Order Sensitivities (Activities, Recent Findings, Tips & Suggestions)
Kyriakos C. GIANNAKOGLOU, Professor NTUA [email protected]
http://velos0.ltt.mech.ntua.gr/research/
MUSAF-II Toulouse
20/9/2013
Introduction
K. GIANNAKOGLOU, NTUA 2
Dr. Dimitrios Papadimitriou Dr. Evangelos Papoutsis-Kiachagias Dr. Alexandros Zymaris Dr. Evgenia Kontoleontos Dr. Xenofon Trompoukis Dr. Varvara Asouti
Acknowledgements: The “Adjoint” Group of the PCOpt/LTT/NTUA
Ioannis Kavvadias (PhD Student) Konstantinos Tsiakas (PhD Student) George Karpouzas (PhD Student) Christos Vezyris (PhD Student) Mehdi Ghavami Nejad (PhD Student) Christos Kapellos
Research Activities: (A) CFD (running on GPUs) (B) Evolutionary Algorithms (“plus”) (C) Adjoint Methods
Funding: (A) European Industries (turbomachinery, automotive, etc) (B) EU-funded Projects (C) CFD Software Developers
Activities related to the Adjoint Methods
K. GIANNAKOGLOU, NTUA 3
q Development of both continuous and discrete adjoint methods. q For compressible fluids (in-house, primitive variable solver, GPU-enabled). q For incompressible fluids (OpenFOAM or in-house code). q For steady & unsteady flows (check-pointing, storage of approximates). q Internal (turbomachinery) & external aerodynamics (wings, cars). q Development of Adjoint Methods for:
l Shape Optimization, l Optimization of Flow Control systems, l Robust-design Optimization, l Topology Optimization.
Selected Topics for MUSAF II - Outline
K. GIANNAKOGLOU, NTUA 4
q Continuous adjoint method for widely-used turbulence models, including wall functions. Recent findings.
q Computation of high-order sensitivities, using both continuous & discrete adjoint, for: l Exact Newton methods, l Truncated Newton methods, l Robust Design-Optimization methods.
q Continuous Adjoint for Flow-Control. Steady & unsteady problems. q Various (Topology Optimization), On-going Research
Parallel CFD & Optimization Unit, NTUA, Greece 5
Starting Point: A reliable adjoint for Laminar Flows
Computation of Sensitivity Derivatives on the starting airfoil Laminar Subsonic Flow in a 2D Compressor Cascade, Fixed stagger angle & solidity.
Without running the Optimization Loop
in out
n t n tS S
F V p dS V p dSρ ρ= −∫ ∫
Adjoint Pressure
D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘A Continuous Adjoint Method with Objective Function Derivatives Based on Boundary Integrals for Inviscid and Viscous Flows’, Computers & Fluids, Vol. 36, pp. 325-341, 2007.
D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘Total Pressure Losses Minimization in Turbomachinery Cascades, Using a New Continuous Adjoint Formulation’, Proc. IMechE, Part A: Journal of Power and Energy (Special Issue on Turbomachinery), Vol. 221, pp. 865-872, 2007.
Continuous Adjoint Methods for Turbulent Flows
K. GIANNAKOGLOU, NTUA 6
• State Equations
• Development of the Adjoint Equations & Boundary Conditions For any objective function F:
(plus the turbulence model eqs.)
Differentiate Faug w.r.t. to bm, where bm are the N design variables… • Adjoint Equations
No adjoint equation to the turbulence model!
The commonly used approach - The “frozen turbulence assumption” Demonstrated for incompressible flows, exists & runs also for compressible flows
Adjoint to the Spalart-Allmaras (SA) Turbulence Model
K. GIANNAKOGLOU, NTUA 7
p pressure q Adjoint pressure
vi velocities ui Adjoint velocities
turbulence variable Adjoint turbulence variable
Exact Differentiation of the Turbulence Model Eqs. Demonstrated for incompressible flows, exists & runs also for compressible flows Demonstrated for the Spalart-Allmaras model. Exists for k-ε & k-ω SST.
A.S. ZYMARIS, D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU, C. OTHMER: ‘ Continuous Adjoint Approach to the Spalart-Allmaras Turbulence Model for Incompressible Flows’, Computers & Fluids, 38, pp. 1528-1538, 2009.
Adjoint to the Spalart-Allmaras (SA) Turbulence Model
K. GIANNAKOGLOU, NTUA 8
Re=1×106
Re=3.5×105
How Important is to Differentiate the Turbulence Model Eqs.? The computationally expensive Direct Differentiation (DD) method
is used to compute reference sensitivities (to compare with).
in out
n t n tS S
F V p dS V p dSρ ρ= −∫ ∫
CONCLUSION: Depending on the case & the Reynolds number, the “frozen turbulence assumption” may lead to wrongly signed sensitivity derivatives!
Two Good Reasons for Differentiating the TM Eqs.
K. GIANNAKOGLOU, NTUA 9
in out
n t n tS S
F V p dS V p dSρ ρ= −∫ ∫
RED : inwards displacement BLUE : outwards displacement
Ω= ∫Ω
dF t/
2ν
CONCLUSIONS: (a) Some problems are solved faster if the exact gradient is used. (b) Some problems cannot be solved without differentiating the turbulence model!
Adjoint Wall Functions (k-ε Model)
K. GIANNAKOGLOU, NTUA 10
Δ
A.S. ZYMARIS, D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU, C. OTHMER: ‘Adjoint Wall Functions: A New Concept for Use in Aerodynamic Shape Optimization’, J. Comp. P hysics, 229, pp. 5228–5245 , 2010.
Adjoint friction velocity
Friction velocity
Differentiation of High-Re Turbulence Models A New Adjoint Law of the Wall
Demonstrated for the k-ε model. Exists for Spalart-Allmaras & k-ω
Adjoint Wall Functions (k-ε Model)
K. GIANNAKOGLOU, NTUA 11
Computation of Sensitivity Derivatives on the starting geometry Subsonic Flow in an axial diffuser, with incipient separation, Re=1x106
Objective function: mass-averaged total pressure losses
Without running the Optimization Loop
CONCLUSION: Turbulence models based on the wall function technique may/should be differentiated!
Adjoint Wall Functions (Spalart-Allmaras)
K. GIANNAKOGLOU, NTUA 12
Computation of Sensitivity Derivatives on the starting geometry Subsonic Flow around NACA4415
CONCLUSION: Primal model with Wall Functions? Using the adjoint “low-Re” model yields worst results than the “Frozen Turbulence Assumption”!!!
Applications of the Adjoint Method in Turbomachinery
K. GIANNAKOGLOU, NTUA 13
Reference Blade
Optimal Blade
Reference Blade
Optimal Blade
Row 1 Row 2
Design-Optimization of two Peripheral Compressor Cascades Target: Minimum Viscous Losses
Constraints on the Flow Turning & the Blade Thickness Turbulence Model: Spalart-Allmaras
Differentiation of Distance Δ (in Turbulence Models)
K. GIANNAKOGLOU, NTUA 14
Applied for Turbulence Models involving the Distance from the Wall Including Wall Functions
Inspired by the AIAA J. paper, March 2012 by Bueno-Orovio, et al. Differentiate the Hamilton-Jacobi eq., governing the distance Δ
,New State Eq.:
New Adjoint Eq. (decoupled):
New Sensitivity Derivatives:
Differentiation of Distance Δ (in Turbulence Models)
K. GIANNAKOGLOU, NTUA 15
Demo: In some cases, ignoring δ(Δ) might be detrimental NACA12 Airfoil, Re=6x106, ainf=3o
NACA12 F= -Lift, Sensitivities wrt the y of Bezier control points Spalart-allmaras, low-Re model, Re=6x106, ainf=3o
CONCLUSION: In some cases, the “frozen distance assumption” produces wrongly signed sensitivities!
Newton Method & Hessian(F) Computation
K. GIANNAKOGLOU, NTUA 16
Newton Method:
k=1,…,N design variables
► Cost of the DD-DD approach scales with N2.
The straightforward way to compute the Hessian Twice application of the Direct Differentiation Method (DD-DD)
Shown in Discrete. Formulated and programmed also in Continuous Mode
Computation of the Hessian Matrix, via DD-AV
K. GIANNAKOGLOU, NTUA 17
System solutions (EFS)
EFS The Adjoint equation is the same with that solved to compute the Gradient !!!
► The cost per Newton cycle is N+1+1=N+2 EFS! Scales with N, not N2.
How to compute the Hessian with the lowest CPU cost DD-AV, equivalent to “tangent mode, then reverse mode”
Shown in Discrete. Formulated and programmed also in Continuous Mode
CONCLUSION: Much better if N<<. But, what about N>>!
Computation of the Hessian Matrix, via DD-AV
K. GIANNAKOGLOU, NTUA 18
D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘Direct, Adjoint and Mixed Approaches for the Computation of Hessian in Airfoil Design Problems’, Int. Num. Meth. in Fluids, 56, 1929-1943, 2008.
D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘Computation of the Hessian Matrix in Aerodynamic Inverse Design using Continuous Adjoint Formulations’, Computers & Fluids, 37, 1029-1039, 2008.
K.C. GIANNAKOGLOU, D.I. PAPADIMITRIOU: ‘Adjoint Methods for gradient- and Hessian-based Aerodynamic Shape Optimization’, EUROGEN 2007, Jyvaskyla, Finland, June 11-13, 2007.
D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘Aerodynamic Shape Optimization using Adjoint and Direct Approaches’, Arch. Comp.Meth. Engi.(State of the Art Reviews), Vol. 15(4), pp. 447-488, 2008 .
D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘The Continuous Direct-Adjoint Approach for Second Order Sensitivities in Viscous Aerodynamic Inverse Design Problems’, Computers & Fluids, 38, 1539-1548, 2009.
With Continuous Adjoint See references (on both discrete & continuous approaches)
An Improved Approach – Application 1
K. GIANNAKOGLOU, NTUA 19
The Exactly-Initialized-then-Quasi-Newton method & its One-Shot variant
Application: Inverse design of a Compressor blading Compute the Hessian only in the first cycle, then switch to quasi-Newton method (BFGS)
D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘One-Shot Shape Optimization Using the Exact Hessian’, ECCOMAS CFD 2010, 5th European Conference on CFD, Lisbon, Portugal, June 14-17, 2010.
CONCLUSION: Quite often, it suffices to initialize the solution with the exact Hessian. Work with the one-shot approach!
The AV-DD Truncated Newton Method (with CG)
K. GIANNAKOGLOU, NTUA 20
Total Cost= 2+2MCG << N
Handling problems with N>> Compute Hessian-vector products instead of the
Hessian itself
Ax=b
AV-DD Truncated Newton method – Why?
K. GIANNAKOGLOU, NTUA 21
AV-DD Truncated Newton method Quasi-Newton BFGS (Exact) Newton
D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘Aerodynamic design using the truncated Newton algorithm and the continuous adjoint approach’, Int. J.for Numerical Methods in Fluids, 68, 6, pp. 724-739, 2012.
Application: Inverse design of an isolated airfoil, N=42 DOFs Compute Hessian-vector products instead of the Hessian itself
Comparison of three solution methods
CONCLUSION: Truncated Newton method is a viable alternative!
Robust Design
K. GIANNAKOGLOU, NTUA 22
The Second-Order, Second-Moment (SOSM) Approach For N design (bi) & M environmental (ci) variables
Minimize the estimated mean & standard deviation of F Third-order mixed derivatives must be computed Proposed method: DDc-DDc-Avb (if M<N)
Robust Design - Application
K. GIANNAKOGLOU, NTUA 23
E.M. PAPOUTSIS-KIACHAGIAS, D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘Robust Design in Aerodynamics using 3rd-Order Sensitivity Analysis based on Discrete Adjoint. Application to Quasi-1D Flows’, International Journal for Numerical Methods in Fluids, Vol. 69, No. 3, pp. 691-709, 2012. E.M. PAPOUTSIS-KIACHAGIAS, D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: Discrete and Continuous Adjoint Methods in Aerodynamic Robust Design problems, CFD and Optimization 2011, ECCOMAS Thematic Conference, Antalya, Turkey, May 23-25, 2011. D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘Third-Order Sensitivity Analysis for Robust Aerodynamic Design using Continuous Adjoint’, International Journal for Numerical Methods in Fluids, Vol. 71, No. 5, pp. 652-670, 2013.
Robust Design of a Compressor Cascade Two environmental variables (M=2): Inlet flow angle & exit isentropic Mach number
CONCLUSION: Robust Design? Don’t go with EAs!
Flow Control Optimization
K. GIANNAKOGLOU, NTUA 24
FDrag=0.0222 FDrag=0.0095
Controlled Case
A.S. ZYMARIS, D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU, C. OTHMER: ‘Optimal Location of Suction or Blowing Jets Using the Continuous Adjoint Approach’, ECCOMAS CFD 2010, Lisbon, June 14-17, 2010.
A.S. ZYMARIS, D.I. PAPADIMITRIOU, E.M. PAPOUTSIS-KIACHAGIAS, K.C. GIANNAKOGLOU, C. OTHMER: ‘The Continuous Adjoint Method as a Guide for the Design of Flow Control Systems Based on Jets”, Engineering Computations, to appear 2013.
Optimal flow control using suction/blowing/pulsating jets Idea: Compute the sensitivity derivatives by solving the flow & adjoint problem once,
for normal_jet_velocity=0. Use the computed sensitivity maps to optimally locate the jets and their sign to decide whether suction or blowing is needed.
Stop here or iterate to optimize all jet parameters.
Unsteady Continuous Adjoint for Flow Control
K. GIANNAKOGLOU, NTUA 25
Slot Amplitude
1 0.0484
2 0.0707
3 0.0721
4 0.0186
5 -0.0124
6 -0.0218
7 -0.0264
8 -0.0260
9 0.0400
10 0.0948
11 0.0193
Flow around a square cylinder (Re=100) – Control with Pulsating Jets
Unsteady Continuous Adjoint for Flow Control
K. GIANNAKOGLOU, NTUA 26
Flow around a circular cylinder (Re=100) – “More” Control Case A: Design variables=Amplitudes
Case B: Design variables=Amplitudes & phases
Flow Control Optimization - Application
K. GIANNAKOGLOU, NTUA 27
Optimal flow control of a Compressor Cascade Sensitivity maps were computed & then the jets were placed “manually”
With the continuous adjoint to the k-ω SST model
no jets F = 9.59
slot 1 active F = 8.12
Why Continuous Adjoint?
K. GIANNAKOGLOU, NTUA 28
Topology Optimization: Formulations based on porosity (a)
E.A. KONTOLEONTOS, E.M. PAPOUTSIS-KIACHAGIAS, A.S. ZYMARIS, D.I. PAPADIMITRIOU, K.C. GIANNAKOGLOU: ‘Adjoint-based constrained topology optimization for viscous flows, including heat transfer, Engineering Optimization, 2012.
Primal Equations: Std_Continuity=0 Std_Momenumi+avi=0 Std_Energy+a(T-Tw)=0 Std_TurbModel(νt)+aνt=0
Why Continuous Adjoint?
K. GIANNAKOGLOU, NTUA 29
AFTER
OptimalPorosity
Field BEFORE
Objective: Min. pt Losses – Continuous Adjoint to [RANS & Spalart-Allmaras]. Recirculation areas disappeared - 15% reduction in total pressure losses.
Primal Velocity
Adjoint Velocity
CONCLUSION: Interesting physical interpretation of the adjoint fields!
On-going Research
► Make the continuous adjoint as consistent as the discrete adjoint. Consistent discretization schemes for the adjoint PDEs & their boundary conditions. The Think-discrete-do-continuous approach.
► Low(er)-cost solution of robust design problems using adjoint methods and truncated Newton methods.
► Efficient adjoint methods for Pareto optimization. Truncated Newton. ► Approximate adjoints for DES solutions.
K. GIANNAKOGLOU, NTUA 30