Energetically Optimal Flapping Flight via a Fully Discrete Adjoint - - PowerPoint PPT Presentation

energetically optimal flapping flight via a fully
SMART_READER_LITE
LIVE PREVIEW

Energetically Optimal Flapping Flight via a Fully Discrete Adjoint - - PowerPoint PPT Presentation

Energetically Optimal Flapping Flight via a Fully Discrete Adjoint Method with Explicit Treatment of Flapping Frequency Jingyi Wang, Matthew J. Zahr , and Per-Olof Persson CFD-36, Optimization Techniques for CFD AIAA Aviation Sheraton


slide-1
SLIDE 1

Energetically Optimal Flapping Flight via a Fully Discrete Adjoint Method with Explicit Treatment of Flapping Frequency

Jingyi Wang, Matthew J. Zahr†, and Per-Olof Persson

CFD-36, Optimization Techniques for CFD AIAA Aviation Sheraton Denver Downtown Hotel, Denver, CO June 9, 2017

† Luis W. Alvarez Postdoctoral Fellow

Department of Mathematics Lawrence Berkeley National Laboratory University of California, Berkeley 1 / 28

slide-2
SLIDE 2

Understand and design energetically optimal flapping motions

Energetically optimal flapping flight critical to

  • understand biological systems
  • design Micro Aerial Vehicles (MAVs)

Optimal flapping motion of micro aerial vehicle

2 / 28

slide-3
SLIDE 3

Understand and design energetically optimal flapping motions

Energetically optimal flapping flight critical to

  • understand biological systems
  • design Micro Aerial Vehicles (MAVs)

Optimal flapping motion of micro aerial vehicle Flapping frequency critical consideration in energetically optimal flapping

2 / 28

slide-4
SLIDE 4

Challenge: Parametrize frequency = ⇒ parametrize time domain

  • Nt uniform timesteps per period required for accuracy
  • Flapping frequency (period) is parametrized f = f(µ) (T = T(µ))

T(µ) = Nt∆t

3 / 28

slide-5
SLIDE 5

Challenge: Parametrize frequency = ⇒ parametrize time domain

  • Nt uniform timesteps per period required for accuracy
  • Flapping frequency (period) is parametrized f = f(µ) (T = T(µ))

T(µ) = Nt∆t Fix Nt, parametrize ∆t = ∆t(µ)

3 / 28

slide-6
SLIDE 6

Generalization beyond flapping

Generalization: PDE-constrained optimization with parametrized time domain

  • Optimal control
  • Determination of fundamental frequency, e.g., von Karman vortex shedding
  • Path/trajectory optimization: find motion that achieves desired final

position in least amount of time

4 / 28

slide-7
SLIDE 7

Unsteady PDE-constrained optimization formulation

Goal: Find the solution of the unsteady PDE-constrained optimization problem minimize

U, µ

J (U, µ) subject to C(U, µ) ≤ 0 ∂U ∂t + ∇ · F (U, ∇U) = 0 in v(µ, t) where t ∈ [0, T(µ)] and

  • U(x, t)

PDE solution

  • µ

design/control parameters

  • J (U, µ) =

1 T(µ) T (µ)

  • Γ

j(U, µ, t) dS dt

  • bjective function
  • C(U, µ) =

1 T(µ) T (µ)

  • Γ

c(U, µ, t) dS dt constraints

5 / 28

slide-8
SLIDE 8

Nested approach to PDE-constrained optimization

PDE optimization requires repeated queries to primal and dual PDE

Primal PDE Dual PDE Optimizer 6 / 28

slide-9
SLIDE 9

Nested approach to PDE-constrained optimization

PDE optimization requires repeated queries to primal and dual PDE

Primal PDE Dual PDE Optimizer µ 6 / 28

slide-10
SLIDE 10

Nested approach to PDE-constrained optimization

PDE optimization requires repeated queries to primal and dual PDE

Primal PDE Dual PDE Optimizer J (U, µ) 6 / 28

slide-11
SLIDE 11

Nested approach to PDE-constrained optimization

PDE optimization requires repeated queries to primal and dual PDE

Primal PDE Dual PDE Optimizer J (U, µ) µ U 6 / 28

slide-12
SLIDE 12

Nested approach to PDE-constrained optimization

PDE optimization requires repeated queries to primal and dual PDE

Primal PDE Dual PDE Optimizer J (U, µ)

dJ dµ (U, µ)

6 / 28

slide-13
SLIDE 13

High-order discretization of PDE-constrained optimization

  • Continuous PDE-constrained optimization problem

minimize

U, µ

J (U, µ) subject to C(U, µ) ≤ 0 ∂U ∂t + ∇ · F (U, ∇U) = 0 in v(µ, t)

  • Fully discrete PDE-constrained optimization problem

minimize

u0, ..., uNt∈RNu, k1,1, ..., kNt,s∈RNu, µ∈Rnµ

J(u0, . . . , uNt, k1,1, . . . , kNt,s, µ) subject to C(u0, . . . , uNt, k1,1, . . . , kNt,s, µ) ≤ 0 u0 − ¯ u(µ) = 0 un − un−1 −

s

  • i=1

bikn,i = 0 Mkn,i − ∆tn(µ)r (un,i, µ, tn,i(µ)) = 0

7 / 28

slide-14
SLIDE 14

Highlights of globally high-order discretization

  • Arbitrary Lagrangian-Eulerian formulation:

Map, G(·, µ, t), from physical v(µ, t) to reference V ∂U X ∂t

  • X

+ ∇X · F X(U X, ∇XU X) = 0

  • Space discretization: discontinuous Galerkin

M ∂u ∂t = r(u, µ, t)

  • Time discretization: diagonally implicit RK

un = un−1 +

s

  • i=1

bikn,i Mkn,i = ∆tn(µ)r (un,i, µ, tn,i(µ))

  • Quantity of interest: solver-consistency

F(u0, . . . , uNt, k1,1, . . . , kNt,s)

X1 X2 NdA V x1 x2 nda v G, g, vX

Mapping-Based ALE DG Discretization c1 a11 c2 a21 a22 . . . . . . . . . ... cs as1 as2 · · · ass b1 b2 · · · bs Butcher Tableau for DIRK

8 / 28

slide-15
SLIDE 15

Adjoint method to efficiently compute gradients of QoI

  • Consider the fully discrete output functional F(un, kn,i, µ)
  • Represents either the objective function or a constraint
  • The total derivative with respect to the parameters µ, required in the context
  • f gradient-based optimization, takes the form

dF dµ = ∂F ∂µ +

Nt

  • n=0

∂F ∂un ∂un ∂µ +

Nt

  • n=1

s

  • i=1

∂F ∂kn,i ∂kn,i ∂µ

  • The sensitivities, ∂un

∂µ and ∂kn,i ∂µ , are expensive to compute, requiring the solution of nµ linear evolution equations

  • Adjoint method: alternative method for computing dF

dµ that require one linear evolution evoluation equation for each quantity of interest, F

9 / 28

slide-16
SLIDE 16

Adjoint equation derivation: outline

  • Define auxiliary PDE-constrained optimization problem

minimize

u0, ..., uNt∈RNu, k1,1, ..., kNt,s∈RNu

F(u0, . . . , uNt, k1,1, . . . , kNt,s, µ) subject to R0 = u0 − ¯ u(µ) = 0 Rn = un − un−1 −

s

  • i=1

bikn,i = 0 Rn,i = Mkn,i − ∆tnr (un,i, µ, tn,i) = 0

  • Define Lagrangian

L(un, kn,i, λn, κn,i) = F − λ0

T R0 − Nt

  • n=1

λn

T Rn − Nt

  • n=1

s

  • i=1

κn,i

T Rn,i

  • The solution of the optimization problem is given by the

Karush-Kuhn-Tucker (KKT) sytem ∂L ∂un = 0, ∂L ∂kn,i = 0, ∂L ∂λn = 0, ∂L ∂κn,i = 0

10 / 28

slide-17
SLIDE 17

Dissection of fully discrete adjoint equations

  • Linear evolution equations solved backward in time
  • Primal state/stage, un,i required at each state/stage of dual problem
  • Heavily dependent on chosen ouput

λNt = ∂F ∂uNt

T

λn−1 = λn + ∂F ∂un−1

T

+

s

  • i=1

∆tn ∂r ∂u (un,i, µ, tn−1 + ci∆tn)T κn,i M T κn,i = ∂F ∂kn,i

T

+ biλn +

s

  • j=i

aji∆tn ∂r ∂u (un,j, µ, tn−1 + cj∆tn)T κn,j

  • Gradient reconstruction via dual variables

dF dµ = ∂F ∂µ + λ0

T ∂¯

u ∂µ(µ) +

Nt

  • n=1

∆tn

s

  • i=1

κn,i

T ∂r

∂µ(un,i, µ, tn,i)

11 / 28

slide-18
SLIDE 18

Dissection of fully discrete adjoint equations

Parametrized time domain: modifies gradient reconstruction from adjoint solution, not adjoint equations themselves dF dµ = ∂F ∂µ + λT ∂¯ u ∂µ(µ) +

Nt

  • n=1

∆tn

s

  • i=1

κT

n,i

∂r ∂µ(un,i, µ, tn,i) +

Nt

  • n=1

s

  • i=1

bi

  • ∆tn

∂f h ∂t (un,i, µ, tn,i)∂tn,i ∂µ (µ) + f h(un,i, µ, tn,i)∂∆tn ∂µ (µ)

  • +

Nt

  • n=1

s

  • i=1

κT

n,i

  • ∆tn

∂r ∂t (un,i, µ, tn,i)∂tn,i ∂µ (µ) + r(un,i, µ, tn,i)∂∆tn ∂µ (µ)

  • where f h(u, µ, t) is DG approximation to
  • Γ j(U, µ, t) dS and

F(u0, . . . , uNt, k1,1, . . . , kNt,s, µ) =

Nt

  • n=1

∆tn(µ)

s

  • i=1

bif h(un,i, µ, tn,i(µ))

12 / 28

slide-19
SLIDE 19

Implementation details

  • Implementation of the fully discrete adjoint method relies on the computation
  • f the following terms from the spatial discretization

M, r, ∂r ∂u, ∂r ∂µ, ∂r ∂t , f h, ∂f h ∂u , ∂f h ∂µ , ∂f h ∂t , and terms from the temporal discretization tn,i, ∆tn, ∂tn,i ∂µ , ∂∆tn ∂µ .

  • In the case of deforming domain problems treated with ALE formulation:

r = r(u, x(µ, t), ˙ x(µ, t)) f h = f h(u, x(µ, t), ˙ x(µ, t))

  • Partial derivatives w.r.t. µ and t computed as:

∂r ∂µ = ∂r ∂x ∂x ∂µ + ∂r ∂ ˙ x ∂ ˙ x ∂µ ∂fh ∂µ = ∂fh ∂x ∂x ∂µ + ∂fh ∂ ˙ x ∂ ˙ x ∂µ ∂r ∂t = ∂r ∂x ∂x ∂t + ∂r ∂ ˙ x ∂ ˙ x ∂t ∂fh ∂t = ∂fh ∂x ∂x ∂t + ∂fh ∂ ˙ x ∂ ˙ x ∂t

13 / 28

slide-20
SLIDE 20

Time-periodic solutions desired when optimizing cyclic motion

  • To properly optimize a cyclic, or periodic problem, need to simulate a

representative period

  • Necessary to avoid transients that will impact quantity of interest and may

cause simulation to crash

  • Task: Find initial condition, ¯

u, such that flow is periodic, i.e. uNt = ¯ u

14 / 28

slide-21
SLIDE 21

Time-periodic solutions desired when optimizing cyclic motion

Vorticity around airfoil with flow initialized from steady-state (left) and time-periodic flow (right) 2 4 −60 −40 −20 time power 2 4 −4 −2 time power Time history of power on airfoil of flow initialized from steady-state ( ) and from a time-periodic solution ( )

15 / 28

slide-22
SLIDE 22

Time-periodicity constraints in PDE-constrained optimization

Recall fully discrete PDE-constrained optimization problem minimize

u0, ..., uNt∈RNu, k1,1, ..., kNt,s∈RNu, µ∈Rnµ

J(u0, . . . , uNt, k1,1, . . . , kNt,s, µ) subject to C(u0, . . . , uNt, k1,1, . . . , kNt,s, µ) ≤ 0 u0 − ¯ u(µ) = 0 un − un−1 +

s

  • i=1

bikn,i = 0 Mkn,i − ∆tnr (un,i, µ, tn,i) = 0

16 / 28

slide-23
SLIDE 23

Time-periodicity constraints in PDE-constrained optimization

Slight modification leads to fully discrete periodic PDE-constrained optimization minimize

u0, ..., uNt∈RNu, k1,1, ..., kNt,s∈RNu, µ∈Rnµ

J(u0, . . . , uNt, k1,1, . . . , kNt,s, µ) subject to C(u0, . . . , uNt, k1,1, . . . , kNt,s, µ) ≤ 0 u0 − uNt = 0 un − un−1 +

s

  • i=1

bikn,i = 0 Mkn,i − ∆tnr (un,i, µ, tn,i) = 0

17 / 28

slide-24
SLIDE 24

Adjoint method for periodic PDE-constrained optimization

  • Following identical procedure as for non-periodic case, the adjoint equations

corresponding to the periodic conservation law are λNt = λ0 + ∂F ∂uNt

T

λn−1 = λn + ∂F ∂un−1

T

+

s

  • i=1

∆tn ∂r ∂u (un,i, µ, tn−1 + ci∆tn)T κn,i M T κn,i = ∂F ∂uNt

T

+ biλn +

s

  • j=i

aji∆tn ∂r ∂u (un,j, µ, tn−1 + cj∆tn)T κn,j

  • Dual problem is also periodic
  • Solve linear, periodic problem using Krylov shooting method

18 / 28

slide-25
SLIDE 25

Energetically optimal flapping under thrust constraint

minimize

µ

− 1 T(µ) T (µ)

  • Γ

f · v dS dt subject to 1 T(µ) T (µ)

  • Γ

f · e1 dS dt = q ∂U ∂t + ∇ · F (U, ∇U) = 0

  • Isentropic, compressible,

Navier-Stokes

  • Re = 1000, M = 0.02
  • y(t), θ(t) parametrized by single

harmonic term

  • Black-box optimizer: IPOPT

y(t) θ(t) l l/3

Airfoil schematic, kinematic description

19 / 28

slide-26
SLIDE 26

Energetically optimal flapping vs. required thrust

Energy = 1.8445 Thrust = 0.06729 Energy = 0.21934 Thrust = 0.0000 Energy = 1.93826 Thrust = 1.0000 Initial Guess Optimal Tx = 0 Optimal Tx = 1.0

20 / 28

slide-27
SLIDE 27

Energetically optimal flapping vs. required thrust

Energy = 1.8445 Thrust = 0.06729 Energy = 0.21934 Thrust = 0.0000 Energy = 3.00404 Thrust = 1.5000 Initial Guess Optimal Tx = 0 Optimal Tx = 1.5

21 / 28

slide-28
SLIDE 28

Energetically optimal flapping vs. required thrust

Energy = 1.8445 Thrust = 0.06729 Energy = 0.21934 Thrust = 0.0000 Energy = 4.6522 Thrust = 2.0000 Initial Guess Optimal Tx = 0 Optimal Tx = 2.0

22 / 28

slide-29
SLIDE 29

Energetically optimal flapping vs. required thrust

Energy = 1.8445 Thrust = 0.06729 Energy = 0.21934 Thrust = 0.0000 Energy = 6.2869 Thrust = 2.5000 Initial Guess Optimal Tx = 0 Optimal Tx = 2.5

23 / 28

slide-30
SLIDE 30

Energetically optimal flapping vs. required thrust

Energy = 0.21935 Thrust = 0.0000 Energy = 3.00404 Thrust = 1.5000 Energy = 6.2869 Thrust = 2.5000 Optimal Tx = 0 Optimal Tx = 1.5 Optimal Tx = 2.5

24 / 28

slide-31
SLIDE 31

Rapid convergence of optimizer to feasible minimizer

10 20 30 5 10 15

  • ptimization iteration

W 10 20 30 0.5 1

  • ptimization iteration

Tx

Convergence of required flapping energy and thrust as a function of optimization iteration corresponding to the thrust constraint ¯ Tx = 1. The final values are W ∗ = 2.1961022 and T ∗

x = 0.9999999 and the first-order optimality conditions are satisfied to a tolerance of

10−8. For a convergence tolerance of 10−4, the optimization iterations could have been terminated after 20 iterations.

25 / 28

slide-32
SLIDE 32

Energetically optimal flapping vs. required thrust: Trajectory

5 10 −1 1 y(t) 5 10 −20 20 θ(t) 2 4 −2 2 t y(t) 2 4 −60 −30 30 60 t θ(t)

Optimal trajectories of y(t) and θ(t) for various value of the thrust constraint: ¯ Tx = 0.0 ( ), ¯ Tx = 1.0 ( ), ¯ Tx = 1.5 ( ), ¯ Tx = 2.0 ( ), ¯ Tx = 2.5 ( ).

26 / 28

slide-33
SLIDE 33

Energetically optimal flapping vs. required thrust: QoI

0.5 1 1.5 2 2.5 2 4 6 W∗ 0.5 1 1.5 2 2.5 0.1 0.15 0.2 0.25 f ∗ 0.5 1 1.5 2 2.5 1.2 1.4 1.6 1.8 2 ¯ Tx y∗

max

0.5 1 1.5 2 2.5 20 40 60 ¯ Tx θ∗

max

The optimal flapping energy (W ∗), frequency (f ∗), maximum heaving amplitude (y∗

max),

and maximum pitching amplitude (θ∗

max) as a function of the thrust constraint ¯

Tx.

27 / 28

slide-34
SLIDE 34

Summary and future work

Summary

  • Extended standard fully discrete adjoint framework to handle parametrization

that affects the time discretization

  • Alters reconstruction of ∇µF from adjoint solution, not adjoint equations
  • Implementation requires velocity of quantity of interest and residual
  • Framework used to study energetically optimal flight
  • Optimal energy approximately linear in required thrust
  • Optimal frequency increases then plateaus as a function of the required thrust

Future work

  • Study 3D flapping with frequency optimization
  • Extension to general time domain/discretization parametrization
  • Trajectory/path optimization

28 / 28