a discrete adjoint-based approach for optimization problems on 3d unstructured meshes
DESCRIPTION
A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes. Dimitri J. Mavriplis Department of Mechanical Engineering University of Wyoming Laramie, WY. Motivation. Adjoint techniques widely used for design optimization - PowerPoint PPT PresentationTRANSCRIPT
A Discrete Adjoint-Based Approach for Optimization Problems on 3D
Unstructured Meshes
Dimitri J. Mavriplis
Department of Mechanical Engineering
University of Wyoming
Laramie, WY
Motivation
• Adjoint techniques widely used for design optimization– Enables sensitivity calculation at cost
independent of number of design variables
• Continuous vs. Discrete Adjoint Approaches– Continuous: Linearize then discretize– Discrete: Discretize then Linearize
Motivation
• Continuous Approach:– More flexible adjoint discretizations– Framework for non-differentiable tasks
(limiters)– Often invoked using flow solution as constraint
using Lagrange multipliers
Motivation
• Discrete Approach:
– Reproduces exact sensitivities of code• Verifiable through finite differences
– Relatively simple implementation• Chain rule differentiation of analysis code• Transpose these derivates
– (transpose and reverse order)
• Includes boundary conditions
Discrete Adjoint Approach
• Relatively simple implementation– Chain rule differentiation of analysis code– Enables application to more than just flow solution
phase• Nielsen and Park: “Using an Adjoint Approach to Eliminate
Mesh Sensitivities in Computational Design”, AIAA 2005-0491: Reno 2005.
• Generalize this procedure to multi-phase simulation process
Generalized Discrete Sensitivities
• Consider a multi-phase analysis code:
– L = Objective(s)– D = Design variable(s)
• Sensitivity Analysis– Using chain rule:
Tangent Model
• Special Case: – 1 Design variable D, many objectives L
• Precompute all stuff depending on single D
• Construct dL/dD elements as:
Adjoint Model
• Special Case:– 1 Objective L, Many Design Variables D– Would like to precompute all left terms
– Transpose entire equation:
Adjoint Model
• Special Case:– 1 Objective L, Many Design Variables D– Would like to precompute all left terms
– Transpose entire equation: precompute as:
Shape Optimization Problem
• Multi-phase process:
Tangent Problem (forward linearization)
• Examine Individual Terms:– : Design variable definition (CAD)
– : Objective function definition
Tangent Problem (forward linearization)
• Examine Individual Terms:
–
–
Sensitivity Analysis
• Tangent Problem:
• Adjoint Problem
Tangent Problem
• 1: Surface mesh sensitivity:
• 2: Interior mesh sensitivity:
• 3: Residual sensitivity:
• 4: Flow variable sensitivity:
• 5: Final sensitivity
Adjoint Problem
• 1: Objective flow sensitivity:
• 2: Flow adjoint:
• 3:Objective sens. wrt mesh:
• 4: Mesh adjoint:
• 5: Final sensitivity:
Flow Tangent/Adjoint Problem:Step 2 or 4
• Storage/Inversion of second-order Jacobian not practical
• Solve using preconditioner [P] as:
Flow Tangent/Adjoint Problem
• Solve using preconditioner [P] as:
• [P] = First order Jacobian– Invert iteratively by agglomeration multigrid
• Only Matrix-Vector products of dR/dw required
Second-Order Jacobian
• Can be written as:
– q(w) = 2nd differences, or reconstructed variables
• Evaluate Mat-Vec in 2 steps as:
• Mimics (linearization) of R(w) routine
Reconstruction
2nd order residual
Second-Order Adjoint
• Can be written as:
– q(w) = 2nd differences, or reconstructed variables
• Evaluate Mat-Vec in 2 steps as:
• Reverse (linearization) of R(w) routine
Memory Savings Store component matrices
But: q=w for 1st order
Storage Requirements
• Reconstructed from preconditioner [P]=1st order
• Trivial matrix or reconstruction coefficients
• Symmetric Block 5x5 (for art. dissip. scheme)
Store or reconstruct on each pass (35% extra memory)
w
R
w
q
q
R
Mesh Motion
• Mesh motion: solve using agg. multigrid
• Mesh sensitivity: solve using agg. multigrid
• Mesh adjoint: solve using agg. multigrid
Modular Multigrid Solver
• Line-Implicit Agglomeration Multigrid Solver used to solve:– Flow equations– Flow adjoint– Mesh Adjoint– Mesh Motion
• Optionally:– Flow tangent
– Mesh sensitivity
Step 3: Matrix-Vector Product
• dR/dx is complex rectangular matrix– R depends directly and indirectly on x– R depends on grid metrics, which depend on x
• Mat-Vec only required once per design cycle
AND/OR
Tangent Problem
• 1: Surface mesh sensitivity:
• 2: Interior mesh sensitivity:
• 3: Residual sensitivity:
• 4: Flow variable sensitivity:
• 5: Final sensitivity
Adjoint Problem
• 1: Objective flow sensitivity:
• 2: Flow adjoint:
• 3:Objective sens. wrt mesh:
• 4: Mesh adjoint:
• 5: Final sensitivity:
Step 3: Tangent Model
• Linearize grid metric routines, residual routine• Call in same order as analysis code
Step 3: Adjoint Model
• Linearize/transpose grid metric routines, residual routine• Call in reverse order
General Approach
• Linearize each subroutine/process individually in analysis code
– Check linearization by finite difference– Transpose, and check duality relation
• Build up larger components– Check linearization, duality relation
• Check entire process for FD and duality• Use single modular AMG solver for all phases
General Duality Relation
• Necessary but not sufficient test– Check using series of arbitrary input vectors
)(xff
11 xx
ff
22 fx
fx
T
1212 .. xxff TT
•Analysis Routine:
•Tangent Model:
•Adjoint Model:
•Duality Relation:
1x 2f
Drag Minimization Problem
• DLR-F6 Wing body configuration• 1.12M vertices, 4.2M cells
Drag Minimization Problem
• DLR-F6 Wing body configuration• Mach=0.75, Incidence=1o , Re=3M
Drag Minimization Problem
• Mach=0.75, Incidence=1o , CL=0.673• Convergence < 500 MG cycles, 40 minutes on 16 cpus (cluster)
Drag Minimization Problem
• Adjoint and Tangent Flow Models display similar convergence• Related to flow solver convergence rate
– 1 Defect-Correction Cycle : 4 (linear) MG cycles
Drag Minimization Problem
• Mesh Motion and Adjoint Solvers Converge at Similar Rates– Fast convergence (50 MG cycles)– Mesh operations < 5% of overall cpu time
Drag Minization Problem
• Smoothed steepest descent method of Jameson– Non-optimal step size
• Objective Function Decreases Monotonically
Drag Minization Problem
• Objective Function Decreases Monotonically– Corresponding decrease in Drag Coefficient– Lift Coefficient held approximately constant
Drag Minimization Problem
• Substantial reduction in shock strength after 15 design cycles• CD: 302 counts 288 counts : -14 counts
– Wave drag
Drag Minimization Problem
• Surface Displacements = Design Variable Values– Smooth– Mostly on upper surface
Drag Minimization Problem
• Total Optimization Time for 15 Design Cycles: 6 hours on 16 cpus of PC cluster
– Flow Solver: 150 MG cycles– Flow Adjoint: 50 Defect-Correction cycles (x 4
MG)– Mesh Adjoint: 25 MG cycles– Mesh Motion: 25 MG cycles
Conclusions• Given multi-phase analysis code can be
augmented be discrete adjoint method– Systematic implementation approach– Applicable to all phases– Modular and verifiable– Mimics analysis code at all stages– No new data-structures required– Minimal memory overheads (50% over implicit solver)
• Demonstrated on Shape Optimization• Exendable to more complex analyses
– Unsteady flows with moving meshes– Multi-disciplinary
Future Work
• Effective approach for sensitivity calculation
• Investigate more sophisticated optimization strategies
• Investigate more sophisticated design parameter definitions and ways to linearize these (CAD based)
• Multi-objective optimizations in parallel– Farming out multiple analyses simultaneously