Numerical shape optimization and adjoint equations Praveen. C - - PowerPoint PPT Presentation

numerical shape optimization and adjoint equations
SMART_READER_LITE
LIVE PREVIEW

Numerical shape optimization and adjoint equations Praveen. C - - PowerPoint PPT Presentation

Numerical shape optimization and adjoint equations Praveen. C praveen@math.tifrbng.res.in Tata Institute of Fundamental Research Center for Applicable Mathematics Bangalore 560065 http://math.tifrbng.res.in TIFR-CAM 18 August, 2009 Praveen.


slide-1
SLIDE 1

Numerical shape optimization and adjoint equations

  • Praveen. C

praveen@math.tifrbng.res.in

Tata Institute of Fundamental Research Center for Applicable Mathematics Bangalore 560065 http://math.tifrbng.res.in

TIFR-CAM 18 August, 2009

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 1 / 37

slide-2
SLIDE 2

Effect of shape on flow

http://www.aerospaceweb.org

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 2 / 37

slide-3
SLIDE 3

Airfoils

http://www.centennialofflight.gov

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 3 / 37

slide-4
SLIDE 4

Compressible flow and shocks

Mach number, M = speed of air speed of sound Range, R = M a cT CL CD log Wi Wf

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 4 / 37

slide-5
SLIDE 5

Golf ball

http://www.aerospaceweb.org

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 5 / 37

slide-6
SLIDE 6

Effect of shape on flow

http://www.aerospaceweb.org

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 6 / 37

slide-7
SLIDE 7

Objectives and controls

  • Objective function I(β) = I(β, Q)

mathematical representation of system performance

  • Control variables β

◮ Parametric controls β ∈ Rn ◮ Infinite dimensional controls β : X → Y ◮ Shape β ∈ set of admissible shapes

  • State variable Q: solution of an ODE or PDE

R(β, Q) = 0 = ⇒ Q = Q(β)

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 7 / 37

slide-8
SLIDE 8

Mathematical formulation

  • Constrained minimization problem

min

β

I(β, Q) subject to R(β, Q) = 0

  • Find δβ such that δI < 0 (to first order)

δI = ∂I ∂β δβ + ∂I ∂QδQ = ∂I ∂β + ∂I ∂Q ∂Q ∂β

  • G

δβ

  • Steepest descent

δβ = −ǫG⊤, ǫ > 0 δI = −ǫGG⊤ = −ǫG2 < 0 How to compute gradient G cheaply and accurately ?

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 8 / 37

slide-9
SLIDE 9

Elements of shape optimization

Shape parameters β Surface grid Xs Volume grid X CFD solution Q I

dI dβ = dI dX dX dXs dXs dβ

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 9 / 37

slide-10
SLIDE 10

Adjoint approach

  • For shape optimization: I = I(X, Q)

dI dX = ∂I ∂X + ∂I ∂Q ∂Q ∂X

  • Flow sensitivity ∂Q

∂X ; costly to evaluate

  • Differentiate state equation R(X, Q) = 0

∂R ∂X + ∂R ∂Q ∂Q ∂X = 0

  • Introducing an adjoint variable Ψ, we can write

dI dX = ∂I ∂X + ∂I ∂Q ∂Q ∂X + Ψ⊤ ∂R ∂X + ∂R ∂Q ∂Q ∂X

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 10 / 37

slide-11
SLIDE 11

Adjoint approach

  • Collect terms involving the flow sensitivity

dI dX = ∂I ∂X + Ψ⊤ ∂R ∂X + ∂I ∂Q + Ψ⊤ ∂R ∂Q ∂Q ∂X

  • Choose Ψ so that flow sensitivity vanishes

∂I ∂Q + Ψ⊤ ∂R ∂Q = 0

  • r

∂R ∂Q ⊤ Ψ + ∂I ∂Q ⊤ = 0

  • Gradient

dI dX = ∂I ∂X + Ψ⊤ ∂R ∂X

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 11 / 37

slide-12
SLIDE 12

Optimization steps

  • β =

⇒ Xs = ⇒ X

  • Solve the flow equations to steady-state

dQ dt + R(X, Q) = 0 = ⇒ Q, I(X, Q)

  • Solve adjoint equations to steady-state

dΨ dt + ∂R ∂Q ⊤ Ψ + ∂I ∂Q ⊤ = 0 = ⇒ Ψ

  • Compute gradient wrt grid X

dI dX = ∂I ∂X + Ψ⊤ ∂R ∂X dI dβ = dI dX dX dXs dXs dβ = ⇒ β ← − β − ǫdI dβ

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 12 / 37

slide-13
SLIDE 13

Continuous and discrete approaches

  • Continuous approach (differentiate and discretize)

PDE − → Adjoint PDE − → Discrete adjoint

  • Discrete approach (discretize and differentiate)

PDE − → Discrete PDE − → Discrete adjoint

  • We use the discrete approach

R(X, Q) = 0 represent the finite volume equations which are algebraic equations

◮ Use ordinary calculus to differentiate ◮ Need to compute

∂I ∂Q, ∂I ∂X , ∂R ∂Q ⊤ Ψ, ∂R ∂X ⊤ Ψ

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 13 / 37

slide-14
SLIDE 14

Automatic differentiation

  • Computer code available to compute

I(X, Q), R(X, Q)

  • Code is made of composition of elementary functions

T0 = X r′th line of program: Tr = Fr(Tr−1) Y = F(X) = Fp ◦ Fp−1 ◦ . . . ◦ F1(T0)

◮ Use differentiation by parts formula

˙ Y = F ′(X) ˙ X = F ′

p(Tp−1)F ′ p−1(Tp−2) . . . F ′ 1(T0) ˙

X

◮ Automated using AD tools: Algorithmic Differentiation

Computer code P Automatic Differentiation New code ˙ P

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 14 / 37

slide-15
SLIDE 15

Reverse differentiation

  • Reverse mode computes transpose: (X, ¯

Y ) − → ¯ X ¯ X = [F ′(X)]⊤ ¯ Y = [F ′

1(T0)]⊤[F ′ 2(T1)]⊤ . . . [F ′ p(Tp−1)]⊤ ¯

Y

  • Forward sweep and then reverse sweep

Func: T0 − → F1

T1

− → F2

T2

− → . . .

Tp−1

− → Fp Grad: Tp−1, ¯ Y − → [F ′

p]T ¯ Tp−2

− → [F ′

p−1]T ¯ Tp−3

− → . . .

¯ T0

− → [F ′

1]T

Forward variables Tj required in reverse order: store or recompute

  • Reverse mode useful to compute

∂I ∂Q ⊤ , ∂I ∂X ⊤ , ∂R ∂Q ⊤ Ψ, ∂R ∂X ⊤ Ψ

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 15 / 37

slide-16
SLIDE 16

Shape parameterization

  • Parameterize the

deformations xs ys

  • =
  • x(0)

s

y(0)

s

  • +

nx ny

  • h(ξ)

h(ξ) =

m

  • k=1

βkBk(ξ)

  • Hicks-Henne bump functions

Bk(ξ) = sinp(πξqk), qk = log(0.5) log(ξk)

  • Move points along normal to

reference line AB

A B

  • n

ξ

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 ξ h(ξ)

Exact derivatives dXs

dβ can be

computed

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 16 / 37

slide-17
SLIDE 17

Grid deformation

  • Interpolate displacement of

surface points to interior points using RBF ˜ f(x, y) = a0 + a1x + a2y +

N

  • j=1

bj| r − rj|2 log | r − rj| where

  • r = (x, y)
  • Results in smooth grids
  • Exact derivatives

dX dXs can be

computed Initial grid Deformed grid

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 17 / 37

slide-18
SLIDE 18

Test cases: airfoil shape optimization

RAE2822: M∞ = 0.729, α = 2.31o

min I = Cd Cd0 s.t. Cl = Cl0

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 18 / 37

slide-19
SLIDE 19

RAE2822: Lift-constrained drag minimization

0.2 0.4 0.6 0.8 1

x/c

  • 1
  • 0.5

0.5 1 1.5

  • Cp

ipopt Initial 0.2 0.4 0.6 0.8 1

  • 0.06
  • 0.04
  • 0.02

0.02 0.04 0.06 ipopt Initial

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 19 / 37

slide-20
SLIDE 20

Sensitivity to perturbations

0.7 0.71 0.72 0.73 0.74 0.75 0.76 Mach number 0.01 0.02 0.03 0.04 Drag coefficient Initial Optimized 0.7 0.71 0.72 0.73 0.74 0.75 0.76 Mach number 50 100 150 200 Lift/Drag Initial Optimized

(a) (b) Variation of (a) drag coefficient and (b) L/D with Mach number for RAE2822 airfoil and optimized airfoil Need for robust aerodynamic optimization

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 20 / 37

slide-21
SLIDE 21

Wing optimization

Initial shape

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 21 / 37

slide-22
SLIDE 22

Wing optimization

Optimized shape

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 22 / 37

slide-23
SLIDE 23

ATR

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 23 / 37

slide-24
SLIDE 24

Planform optimization for propeller aircraft

(Rakshith, JNCASR)

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 24 / 37

slide-25
SLIDE 25

Unmanned air vehicle

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 25 / 37

slide-26
SLIDE 26

Adjoint-based aposteriori error estimation

  • uh = numerical solution on grid h
  • Numerical analysis

u − uh = O(hp), p > 0 as h → 0+ How to choose the grid size ?

  • Functional of interest J(u)

J(u) − J(uh) = O(hp) Choose grid so that error in J is small

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 26 / 37

slide-27
SLIDE 27

Cartesian Points

NACA-0012 - coarse M∞ = 1.2, α = 0o

  • 2
  • 1.5
  • 1
  • 0.5

0.5 1 1.5 2

  • 1.5
  • 1
  • 0.5

0.5 1 1.5 2 2.5

Points Mach number (Mohan Varma)

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 27 / 37

slide-28
SLIDE 28

Cartesian Points

NACA-0012 - coarse M∞ = 1.2, α = 0o

  • 2
  • 1.5
  • 1
  • 0.5

0.5 1 1.5 2

  • 1.5
  • 1
  • 0.5

0.5 1 1.5 2 2.5

Points Mach number (Mohan Varma)

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 28 / 37

slide-29
SLIDE 29

PDE with homogeneous BC

  • Linear PDE

Lu = f in D

  • Adjoint operator

(v, Lu) = (L∗v, u)

  • Functional of interest

J = (g, u)

  • Adjoint PDE

L∗v = g

  • Primal-dual equivalence

J = (g, u) = (L∗v, u) = (v, Lu) = (v, f)

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 29 / 37

slide-30
SLIDE 30

Error estimation: homogeneous BC

fh := Luh, gh := L∗vh The functional can be written as J = (g, u) = (g, uh) − (gh, uh − u) + (gh − g, uh − u) = (g, uh) − (L∗vh, uh − u) + (gh − g, uh − u) = (g, uh) − (vh, L(uh − u)) + (gh − g, uh − u) = (g, uh) − (vh, fh − f) + (gh − g, uh − u) J − Jh = −

Computable error

  • (vh, fh − f) +(gh − g

O(hp)

, uh − u

O(hp)

) J − [Jh + (vh, fh − f)] = O(h2p)

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 30 / 37

slide-31
SLIDE 31

PDE with non-homogeneous BC

  • Linear PDE

Lu = f in D Bu = e

  • n

∂D

  • Functional of interest

J = (g, u)D + (h, Cu)∂D

  • Adjoint PDE

L∗v = g in D B∗v = h

  • n

∂D

  • Primal-dual equivalence

J = (g, u)D + (h, Cu)∂D = (v, f)D + (C∗v, e)∂D

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 31 / 37

slide-32
SLIDE 32

PDE with non-homogeneous BC

Given approximate solutions uh, vh we define fh := Luh, gh := L∗vh eh := Buh, hh := B∗vh The error in output functional is J − Jh =

Computable error

  • − (vh, fh − f))D − (C∗vh, eh − e))∂D

+ (gh − g, uh − u)D + (hh − h, C(uh − u))∂D

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 32 / 37

slide-33
SLIDE 33

Goal-based grid adaptation

D = ∪kDk J − Jh = −(vh, fh − f)D = −

  • k

(vh, fh − f)Dk Divide element Dk if |(vh, fh − f)Dk| > e0 where e0 is user-specified error level.

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 33 / 37

slide-34
SLIDE 34

Example: Linear scalar convection

y∂u ∂x − x∂u ∂y = 0

IsoValue

  • 0.0526316

0.0263158 0.0789474 0.131579 0.184211 0.236842 0.289474 0.342105 0.394737 0.447368 0.5 0.552632 0.605263 0.657895 0.710526 0.763158 0.815789 0.868421 0.921053 1.05263

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 34 / 37

slide-35
SLIDE 35

Example: Linear scalar convection

y∂u ∂x − x∂u ∂y = 0

IsoValue

  • 0.194481
  • 0.1701
  • 0.153846
  • 0.137591
  • 0.121337
  • 0.105083
  • 0.0888287
  • 0.0725745
  • 0.0563203
  • 0.040066
  • 0.0238118
  • 0.00755758

0.00869664 0.0249509 0.0412051 0.0574593 0.0737136 0.0899678 0.106222 0.146858 Error from LTM IsoValue

  • 0.00332113

0.00166056 0.00498169 0.00830282 0.0116239 0.0149451 0.0182662 0.0215873 0.0249084 0.0282296 0.0315507 0.0348718 0.0381929 0.0415141 0.0448352 0.0481563 0.0514775 0.0547986 0.0581197 0.0664225 Error indicator

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 35 / 37

slide-36
SLIDE 36

Application to compressible flows

  • H = grid on which computations are performed
  • h = finer grid, perhaps h = H/2
  • We try to estimate

J(uh) − J(uH) by using discrete adjoint method. Not on that, it will tell us how to adapt the grid, in an optimal way, to control errors in J.

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 36 / 37

slide-37
SLIDE 37

Application to compressible flows

2000 4000 6000 8000 10000 0.3 0.305 0.31 0.315 0.32 N CL JH Jh Jh

H+Jcc

(a) M∞ = 0.63, α = 2◦

2000 4000 6000 8000 10000 0.108 0.11 0.112 0.114 0.116 0.118 0.12 N CD JH Jh Jh

H+Jcc

(b) M∞ = 0.95, α = 0◦

Figure: Adjoint-based Lift and drag correction for NACA 0012 airfoil section

  • Praveen. C

(TIFR-CAM) Shape Optimization TIFR, 18 Aug 2009 37 / 37