a discrete adjoint-based approach for optimization problems on 3d unstructured meshes

42
A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes Dimitri J. Mavriplis Department of Mechanical Engineering University of Wyoming Laramie, WY

Upload: winona

Post on 07-Jan-2016

26 views

Category:

Documents


0 download

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 Presentation

TRANSCRIPT

Page 1: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

A Discrete Adjoint-Based Approach for Optimization Problems on 3D

Unstructured Meshes

Dimitri J. Mavriplis

Department of Mechanical Engineering

University of Wyoming

Laramie, WY

Page 2: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 3: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Motivation

• Continuous Approach:– More flexible adjoint discretizations– Framework for non-differentiable tasks

(limiters)– Often invoked using flow solution as constraint

using Lagrange multipliers

Page 4: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 5: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 6: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Generalized Discrete Sensitivities

• Consider a multi-phase analysis code:

– L = Objective(s)– D = Design variable(s)

• Sensitivity Analysis– Using chain rule:

Page 7: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Tangent Model

• Special Case: – 1 Design variable D, many objectives L

• Precompute all stuff depending on single D

• Construct dL/dD elements as:

Page 8: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Adjoint Model

• Special Case:– 1 Objective L, Many Design Variables D– Would like to precompute all left terms

– Transpose entire equation:

Page 9: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Adjoint Model

• Special Case:– 1 Objective L, Many Design Variables D– Would like to precompute all left terms

– Transpose entire equation: precompute as:

Page 10: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Shape Optimization Problem

• Multi-phase process:

Page 11: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Tangent Problem (forward linearization)

• Examine Individual Terms:– : Design variable definition (CAD)

– : Objective function definition

Page 12: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Tangent Problem (forward linearization)

• Examine Individual Terms:

Page 13: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Sensitivity Analysis

• Tangent Problem:

• Adjoint Problem

Page 14: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Tangent Problem

• 1: Surface mesh sensitivity:

• 2: Interior mesh sensitivity:

• 3: Residual sensitivity:

• 4: Flow variable sensitivity:

• 5: Final sensitivity

Page 15: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Adjoint Problem

• 1: Objective flow sensitivity:

• 2: Flow adjoint:

• 3:Objective sens. wrt mesh:

• 4: Mesh adjoint:

• 5: Final sensitivity:

Page 16: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Flow Tangent/Adjoint Problem:Step 2 or 4

• Storage/Inversion of second-order Jacobian not practical

• Solve using preconditioner [P] as:

Page 17: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 18: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 19: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 20: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Memory Savings Store component matrices

But: q=w for 1st order

Page 21: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 22: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Mesh Motion

• Mesh motion: solve using agg. multigrid

• Mesh sensitivity: solve using agg. multigrid

• Mesh adjoint: solve using agg. multigrid

Page 23: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Modular Multigrid Solver

• Line-Implicit Agglomeration Multigrid Solver used to solve:– Flow equations– Flow adjoint– Mesh Adjoint– Mesh Motion

• Optionally:– Flow tangent

– Mesh sensitivity

Page 24: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 25: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Tangent Problem

• 1: Surface mesh sensitivity:

• 2: Interior mesh sensitivity:

• 3: Residual sensitivity:

• 4: Flow variable sensitivity:

• 5: Final sensitivity

Page 26: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Adjoint Problem

• 1: Objective flow sensitivity:

• 2: Flow adjoint:

• 3:Objective sens. wrt mesh:

• 4: Mesh adjoint:

• 5: Final sensitivity:

Page 27: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Step 3: Tangent Model

• Linearize grid metric routines, residual routine• Call in same order as analysis code

Page 28: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Step 3: Adjoint Model

• Linearize/transpose grid metric routines, residual routine• Call in reverse order

Page 29: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 30: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 31: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Drag Minimization Problem

• DLR-F6 Wing body configuration• 1.12M vertices, 4.2M cells

Page 32: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Drag Minimization Problem

• DLR-F6 Wing body configuration• Mach=0.75, Incidence=1o , Re=3M

Page 33: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Drag Minimization Problem

• Mach=0.75, Incidence=1o , CL=0.673• Convergence < 500 MG cycles, 40 minutes on 16 cpus (cluster)

Page 34: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 35: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Drag Minimization Problem

• Mesh Motion and Adjoint Solvers Converge at Similar Rates– Fast convergence (50 MG cycles)– Mesh operations < 5% of overall cpu time

Page 36: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Drag Minization Problem

• Smoothed steepest descent method of Jameson– Non-optimal step size

• Objective Function Decreases Monotonically

Page 37: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Drag Minization Problem

• Objective Function Decreases Monotonically– Corresponding decrease in Drag Coefficient– Lift Coefficient held approximately constant

Page 38: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Drag Minimization Problem

• Substantial reduction in shock strength after 15 design cycles• CD: 302 counts 288 counts : -14 counts

– Wave drag

Page 39: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

Drag Minimization Problem

• Surface Displacements = Design Variable Values– Smooth– Mostly on upper surface

Page 40: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 41: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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

Page 42: A Discrete Adjoint-Based Approach for Optimization Problems on 3D Unstructured Meshes

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