Integrated computational physics and numerical optimization Matthew - - PowerPoint PPT Presentation

integrated computational physics and numerical
SMART_READER_LITE
LIVE PREVIEW

Integrated computational physics and numerical optimization Matthew - - PowerPoint PPT Presentation

Integrated computational physics and numerical optimization Matthew J. Zahr Luis W. Alvarez Postdoctoral Fellow Mathematics Group Computational Research Division Lawrence Berkeley National Laboratory UCB/LBNL Applied Mathematics Seminar


slide-1
SLIDE 1

Integrated computational physics and numerical optimization

Matthew J. Zahr Luis W. Alvarez Postdoctoral Fellow Mathematics Group Computational Research Division Lawrence Berkeley National Laboratory UCB/LBNL Applied Mathematics Seminar University of California, Berkeley, CA September 6, 2018

Collaborators: Daniel Huang, Per-Olof Persson, Johannes Töger, Jingyi Wang

slide-2
SLIDE 2

Integrating computational physics and numerical optimization

Optimize physics Optimize numerics

slide-3
SLIDE 3

Integrating computational physics and numerical optimization

Optimize physics Optimize numerics

slide-4
SLIDE 4

PDE optimization is ubiquitous in science and engineering

Design: Find system that optimizes performance metric, satisfies constraints Aerodynamic shape design of automobile Optimal flapping motion of micro aerial vehicle

slide-5
SLIDE 5

PDE optimization is ubiquitous in science and engineering

Inverse problems: Infer the problem setup given solution observations Material inversion: find inclusions from acoustic, structural measurements Source inversion: find source of contaminant from downstream measurements Full waveform inversion: estimate subsurface of crust from acoustic measurements

slide-6
SLIDE 6

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) U(x, t) PDE solution µ design/control parameters J (U, µ) = Tf

T0

  • Γ

j(U, µ, t) dS dt

  • bjective function

C(U, µ) = Tf

T0

  • Γ

c(U, µ, t) dS dt constraints

slide-7
SLIDE 7

Nested approach to PDE-constrained optimization

Primal PDE Dual PDE Optimizer

slide-8
SLIDE 8

Nested approach to PDE-constrained optimization

Primal PDE Dual PDE Optimizer µ

slide-9
SLIDE 9

Nested approach to PDE-constrained optimization

Primal PDE Dual PDE Optimizer J (U, µ)

slide-10
SLIDE 10

Nested approach to PDE-constrained optimization

Primal PDE Dual PDE Optimizer J (U, µ) µ U

slide-11
SLIDE 11

Nested approach to PDE-constrained optimization

Primal PDE Dual PDE Optimizer J (U, µ)

dJ dµ (U, µ)

slide-12
SLIDE 12

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 = ∆tnr (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

slide-13
SLIDE 13

Adjoint method to efficiently compute gradients of QoI

Fully discrete output function i.e., either objective or a constraint F(µ) = F(u0, . . . , un, k1,1, . . . , kNt,s, µ)

slide-14
SLIDE 14

Adjoint method to efficiently compute gradients of QoI

Fully discrete output function i.e., either objective or a constraint F(µ) = F(u0, . . . , un, k1,1, . . . , kNt,s, µ) Total derivative with respect to parameters µ DF = ∂F ∂µ +

Nt

  • n=0

∂F ∂un ∂un ∂µ +

Nt

  • n=1

s

  • i=1

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

slide-15
SLIDE 15

Adjoint method to efficiently compute gradients of QoI

Fully discrete output function i.e., either objective or a constraint F(µ) = F(u0, . . . , un, k1,1, . . . , kNt,s, µ) Total derivative with respect to parameters µ DF = ∂F ∂µ +

Nt

  • n=0

∂F ∂un ∂un ∂µ +

Nt

  • n=1

s

  • i=1

∂F ∂kn,i ∂kn,i ∂µ However, 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 that does not require sensitivities

slide-16
SLIDE 16

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 ∂uNt

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 = ∂F ∂µ + λ0

T ∂g

∂µ(µ) +

Nt

  • n=1

∆tn

s

  • i=1

κn,i

T ∂r

∂µ(un,i, µ, tn,i) [Zahr and Persson, 2016]

slide-17
SLIDE 17

Optimal rigid body motion (RBM), time-morph geometry (TMG)

Energy = 9.4096 Thrust = 0.1766 Energy = 4.9476 Thrust = 2.500 Energy = 4.6182 Thrust = 2.500 Initial Guess Optimal RBM Tx = 2.5 Optimal RBM/TMG Tx = 2.5

slide-18
SLIDE 18

Energetically optimal flapping in three dimensions

Energy = 1.4459e-01 Thrust = -1.1192e-01 Energy = 3.1378e-01 Thrust = 0.0000e+00

slide-19
SLIDE 19

Super-resolution MR images through optimization

Experimental setup Noisy, low-resolution MRI data Goal: visualize in vivo flow with high-resolution and accurately compute clinically relevant quantities from quick scans Idea: determine CFD parameters (material properties, boundary conditions) such that the simulation matches MRI data using optimization

slide-20
SLIDE 20

MRI optimization formulation that respects scanner physics

minimize

µ nxyz

  • i=1

nt

  • n=1

αi,n 2

  • di,n(U(µ), µ) − d∗

i,n

  • 2

2

d∗

i,n : MRI measurement taken in voxel i at the nth time sample

di,n(U, µ): computational representation of d∗

i,n

slide-21
SLIDE 21

MRI optimization formulation that respects scanner physics

minimize

µ nxyz

  • i=1

nt

  • n=1

αi,n 2

  • di,n(U(µ), µ) − d∗

i,n

  • 2

2

d∗

i,n : MRI measurement taken in voxel i at the nth time sample

di,n(U, µ): computational representation of d∗

i,n

di,n(U, µ) = T

  • V

wi,n(x, t) · U(x, t) dV dt wi,n(x, t) = χs(x; xi, ∆x)χt(t; tn, ∆t) χt(s; c, w) = 1 1 + e−(s−(c−0.5w))/σ − 1 1 + e−(s−(c+0.5w))/σ χs(x; c, w) = χt(x1; c1, w1)χt(x2; c2, w2)χt(x3; c3, w3) xi center of ith MRI voxel, ∆x size of MRI voxel tn time instance of nth MRI sample, ∆t sampling interval in time

slide-22
SLIDE 22

Model problem with synthetic data

3 14 2 6 Viscous wall ( ), parametrized inflow ( ), and outflow ( ). MRI data collected in the red shaded region.

slide-23
SLIDE 23

High-quality reconstruction from coarse MRI grid (space: 24 × 36, time: 10) and low noise (3%)

Synthetic MRI data d∗

i,n (top) and

computational representation of MRI data di,n (bottom) Reconstructed flow

slide-24
SLIDE 24

High-quality reconstruction from fine MRI grid (space: 40×60, time: 20) and high noise (10%)

Synthetic MRI data d∗

i,n (top) and

computational representation of MRI data di,n (bottom) Reconstructed flow

slide-25
SLIDE 25

High-quality reconstruction with experimental data: pulsatile flow

CFD-based reconstruction from quick, low-resolution scan matches laser PIV measurements better than slow, high-resolution scan MRI data Reconstructed flow

slide-26
SLIDE 26

Extension: Parametrized time domain [Wang et al., 2017]

Parametrization of time domain, e.g., flapping frequency, leads to parametrization

  • f time discretization in fully discrete setting

T(µ) = Nt∆t = ⇒ Nt = Nt(µ) or ∆t = ∆t(µ)

slide-27
SLIDE 27

Extension: Parametrized time domain [Wang et al., 2017]

Parametrization of time domain, e.g., flapping frequency, leads to parametrization

  • f time discretization in fully discrete setting

T(µ) = Nt∆t = ⇒ Nt = Nt(µ) or ∆t = ∆t(µ) Choose ∆t = ∆t(µ) to avoid discrete changes

slide-28
SLIDE 28

Extension: Parametrized time domain [Wang et al., 2017]

Parametrization of time domain, e.g., flapping frequency, leads to parametrization

  • f time discretization in fully discrete setting

T(µ) = Nt∆t = ⇒ Nt = Nt(µ) or ∆t = ∆t(µ) Choose ∆t = ∆t(µ) to avoid discrete changes Does not change adjoint equations themselves, only reconstruction of gradient from adjoint solution

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

slide-30
SLIDE 30

Extension: Multiphysics problems [Huang et al., 2018]

For problems that involve the interaction of multiple types of physical phenomena, no changes required if monolithic system considered M 0 ˙ u0 = r0(u0, c0(u0, u1)) M 1 ˙ u1 = r1(u1, c1(u0, u1))

slide-31
SLIDE 31

Extension: Multiphysics problems [Huang et al., 2018]

For problems that involve the interaction of multiple types of physical phenomena, no changes required if monolithic system considered M 0 ˙ u0 = r0(u0, c0(u0, u1)) M 1 ˙ u1 = r1(u1, c1(u0, u1)) However, to solve in partitioned manner and achieve high-order, split as follows and apply implicit-explicit Runge-Kutta M 0 ˙ u0 = r0(u0, c0(u0, u1)) M 1 ˙ u1 = r1(u1, ˜ c1) + (r1(u1, c1(u0, u1)) − r1(u1, ˜ c1))

slide-32
SLIDE 32

Extension: Multiphysics problems [Huang et al., 2018]

For problems that involve the interaction of multiple types of physical phenomena, no changes required if monolithic system considered M 0 ˙ u0 = r0(u0, c0(u0, u1)) M 1 ˙ u1 = r1(u1, c1(u0, u1)) However, to solve in partitioned manner and achieve high-order, split as follows and apply implicit-explicit Runge-Kutta M 0 ˙ u0 = r0(u0, c0(u0, u1)) M 1 ˙ u1 = r1(u1, ˜ c1) + (r1(u1, c1(u0, u1)) − r1(u1, ˜ c1)) Adjoint equations inherit explicit-implicit structure

slide-33
SLIDE 33

High-order method for general multiphysics problems with uncondi- tional linear stability

Particle-laden flow Fluid-structure interaction

slide-34
SLIDE 34

Optimal energy harvesting from foil-damper system

Goal: Maximize energy harvested from foil-damper system maximize

µ

1 T T (c˙ h2(us) − Mz(uf) ˙ θ(µ, t)) dt

  • Fluid: Isentropic Navier-Stokes on deforming domain (ALE)
  • Structure: Force balance in y-direction between foil and damper
  • Motion driven by imposed θ(µ, t) = µ1 cos(2πft)

c θ(µ, t) h(us) µ∗

1 ≈ 45◦

slide-35
SLIDE 35

High-order methods for PDE-constrained optimization

  • Developed fully discrete adjoint method for high-order numerical

discretizations of PDEs and QoIs

  • Used to compute gradients of QoI for use in gradient-based numerical
  • ptimization method
  • Treatment of parametrized time domain (optimal frequency)
  • Explicit enforcement of time-periodicity constraints
  • Extension to multiphysics (fluid-structure interaction, particle-laden flow, ...)
  • Applications: optimal flapping flight, energy harvesting, data assimilation
slide-36
SLIDE 36

Integrating computational physics and numerical optimization

Optimize physics Optimize numerics

slide-37
SLIDE 37

Discontinuities often arise in engineering systems, particularly in those involving compressible flows: shock waves, contact lines

Supersnoic and transonic flow around commercial planes and fighter jets Hypersonics, e.g., re-entry of vehicles in atmosphere, and scramjets Other applications with discontinuities: fracture, problems with interfaces

slide-38
SLIDE 38

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis

slide-39
SLIDE 39

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis

slide-40
SLIDE 40

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis

slide-41
SLIDE 41

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis

slide-42
SLIDE 42

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement

slide-43
SLIDE 43

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement

slide-44
SLIDE 44

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement

slide-45
SLIDE 45

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement

slide-46
SLIDE 46

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement

slide-47
SLIDE 47

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement Proposed solution: align features of solution basis with features in the solution using optimization formulation and solver

slide-48
SLIDE 48

State-of-the-art numerical methods for resolving shocks

Fundamental issue: approximate discontinuity with polynomial basis Exising solutions: limiting, artificial viscosity Drawbacks: order reduction, local refinement Proposed solution: align features of solution basis with features in the solution using optimization formulation and solver

slide-49
SLIDE 49

Tracking method for stable, high-order resolution of discontinuities

Goal: Align element faces with (unknown) discontinuities to perfectly capture them and approximate smooth regions to high-order

Non-aligned Discontinuity-aligned

slide-50
SLIDE 50

Tracking method for stable, high-order resolution of discontinuities

Goal: Align element faces with (unknown) discontinuities to perfectly capture them and approximate smooth regions to high-order

Non-aligned Discontinuity-aligned

Ingredients

  • Discontinuous Galerkin discretization: inter-element jumps, high-order
  • Optimization formulation that penalizes local instabilities in the solution and

enforces the discrete PDE

  • Full space solver that converges the solution and mesh simultaneously to

ensure solution of PDE never required on non-aligned mesh

slide-51
SLIDE 51

Discontinuity-tracking as PDE-constrained optimization problem

minimize

u, x

f(u, x) subject to r(u, x) = 0

slide-52
SLIDE 52

Discontinuity-tracking as PDE-constrained optimization problem

minimize

u, x

f(u, x) subject to r(u, x) = 0 Objective function Must obtain minimum when mesh face aligned with shock and monotonically decreases to minimum in neighborhood of radius O(h/2) about discontinuity

slide-53
SLIDE 53

Discontinuity-tracking as PDE-constrained optimization problem

minimize

u, x

f(u, x) subject to r(u, x) = 0 Objective function Must obtain minimum when mesh face aligned with shock and monotonically decreases to minimum in neighborhood of radius O(h/2) about discontinuity Optimization approach Cannot use nested approach where constraint r(u, x) = 0 is eliminated because discrete PDE cannot be solved unless x = x∗ = ⇒ full space approach required

slide-54
SLIDE 54

Transformed conservation law from deformation of physical domain

Consider physical domain as the result of a µ-parametrized diffeomorphism applied to some reference domain Ω0 Ω = G(Ω0, µ) Re-write conservation law on reference domain ∇ · F(U) = 0 in G(Ω0, µ) = ⇒ ∇X · F(u, µ) = 0 in Ω0, u = gµU, F(u, µ) = gµF(g−1

µ u)G−T µ ,

Gµ = ∂ ∂X G(X, µ), gµ = det Gµ

X1 X2 N dA Ω0 x1 x2 n da Ω x = G(X, µ)

Mapping between reference and physical domains

slide-55
SLIDE 55

Discontinuous Galerkin discretization of conservation law

Element-wise weak form of transformed conservation law

  • ∂K

ψ · F(u, µ)N dA −

  • K

F(u, µ) : ∇Xψ dV = 0 Global weak form and introduction of numerical flux

  • K∈Eh,p
  • ∂K

ψ · F ∗(u, µ, N) dA −

  • Ω0

F(u, µ) : ∇Xψ dV = 0 Strict requirements on numerical flux since inter-element jumps will not tend to zero on shock surface Fully discrete transformed conservation law in terms of the discrete state vector u and coordinates of physical mesh x r(u, x) = 0

slide-56
SLIDE 56

Objective function: penalize oscillations and mesh distortion

Consider a discontinuity indicator that aims to penalize oscillations in finite-dimensional solution fshk(u, x) = h−2

  • K∈Eh,p
  • G(K, x)
  • uh,p − ¯

uK

h,p

  • 2

W dV,

¯ uK

h,p =

1 |G(K, x)|

  • G(K, x)

uh,p dV, |G(K, x)| =

  • G(K, x)

dV, h0 = |Ω0|1/d

slide-57
SLIDE 57

Objective function: penalize oscillations and mesh distortion

Consider a discontinuity indicator that aims to penalize oscillations in finite-dimensional solution fshk(u, x) = h−2

  • K∈Eh,p
  • G(K, x)
  • uh,p − ¯

uK

h,p

  • 2

W dV,

¯ uK

h,p =

1 |G(K, x)|

  • G(K, x)

uh,p dV, |G(K, x)| =

  • G(K, x)

dV, h0 = |Ω0|1/d Construct objective function as weighted combination between discontinuity indicator and mesh distortion metric f(u, x; α) = fshk(u, x) + αfmsh(x)

slide-58
SLIDE 58

One-dimensional mesh parametrization and objective function test

slide-59
SLIDE 59

One-dimensional mesh parametrization and objective function test

slide-60
SLIDE 60

One-dimensional mesh parametrization and objective function test

slide-61
SLIDE 61

One-dimensional mesh parametrization and objective function test

slide-62
SLIDE 62

One-dimensional mesh parametrization and objective function test

slide-63
SLIDE 63

One-dimensional mesh parametrization and objective function test

slide-64
SLIDE 64

Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p, for a range of α

0.46 0.48 0.5 0.52 0.54 1 2 3 φ (position of node closest to shock) jα(φ), α = 0 jα(φ) = fshk(u(x(φ)), x(φ)) + αfmsh(x(φ))

Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

slide-65
SLIDE 65

Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p, for a range of α

0.46 0.48 0.5 0.52 0.54 1 2 3 φ (position of node closest to shock) jα(φ), α = 1 jα(φ) = fshk(u(x(φ)), x(φ)) + αfmsh(x(φ))

Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

slide-66
SLIDE 66

Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p, for a range of α

0.46 0.48 0.5 0.52 0.54 1 2 3 4 φ (position of node closest to shock) jα(φ), α = 10 jα(φ) = fshk(u(x(φ)), x(φ)) + αfmsh(x(φ))

Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

slide-67
SLIDE 67

Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p, for a range of α

0.46 0.48 0.5 0.52 0.54 2 4 6 φ (position of node closest to shock) jα(φ), α = 20 jα(φ) = fshk(u(x(φ)), x(φ)) + αfmsh(x(φ))

Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

slide-68
SLIDE 68

Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p, for a range of α

0.46 0.48 0.5 0.52 0.54 2 4 6 8 φ (position of node closest to shock) jα(φ), α = 40 jα(φ) = fshk(u(x(φ)), x(φ)) + αfmsh(x(φ))

Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

slide-69
SLIDE 69

Objective function monotonically approaches minimum as mesh aligns with discontinuity, regardless of p, for a range of α

0.46 0.48 0.5 0.52 0.54 50 100 150 φ (position of node closest to shock) jα(φ), α = 1000 jα(φ) = fshk(u(x(φ)), x(φ)) + αfmsh(x(φ))

Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ).

slide-70
SLIDE 70

Proposed discontinuity indicator is monotonic and attains minimum at discontinuity, whereas other indicators are not monotonic

−0.06 −0.03 0.03 0.06 10 20 φ (position of node closest to shock) fshk(u(x(φ)), x(φ))

Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ).

slide-71
SLIDE 71

Proposed discontinuity indicator is monotonic and attains minimum at discontinuity, whereas other indicators are not monotonic

−0.06 −0.03 0.03 0.06 20 40 60 80 φ (position of node closest to shock) residual-based indicator

Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ).

slide-72
SLIDE 72

Proposed discontinuity indicator is monotonic and attains minimum at discontinuity, whereas other indicators are not monotonic

−0.06 −0.03 0.03 0.06 2 4 6 φ (position of node closest to shock) physics-based indicator

Objective function as an element face is smoothly swept across discontinuity ( ): p = 1 ( ), p = 2 ( ), p = 3 ( ).

slide-73
SLIDE 73

Cannot use nested approach to PDE optimization because it requires solving r(u, x) = 0 for x = x∗ = ⇒ crash

Full space approach: u → u∗ and x → x∗ simultaneously

1usually requires globalization such as linesearch or trust-region

slide-74
SLIDE 74

Cannot use nested approach to PDE optimization because it requires solving r(u, x) = 0 for x = x∗ = ⇒ crash

Full space approach: u → u∗ and x → x∗ simultaneously Define Lagrangian L(u, x, λ) = f(u; x) − λT r(u; x) First-order optimality (KKT) conditions for full space optimization problem ∇uL(u∗, x∗, λ∗) = 0, ∇xL(u∗, x∗, λ∗) = 0, ∇λL(u∗, x∗, λ∗) = 0 Apply (quasi-)Newton method1 to solve nonlinear KKT system for u∗, x∗, λ∗

1usually requires globalization such as linesearch or trust-region

slide-75
SLIDE 75

Implementation mostly requires standard terms in implicit code

Gradient-based optimizers for the tracking optimization problem will require f(u, x), ∂f ∂u(u, x), ∂f ∂x(u, x), r(u, x), ∂r ∂u(u, x), ∂r ∂x(u, x)

  • r and ∂ur required by standard implicit solvers
  • Same terms required for reduced space approach
slide-76
SLIDE 76

L2 projection of discontinuous function on DG basis

η(x) =

  • 2,

x2 + y2 < r2 1, x2 + y2 > r2

Non-aligned (left) vs. discontinuity-aligned mesh with linear (middle) and cubic (right) elements

slide-77
SLIDE 77

Resolution of modified Burgers’ equation with few elements

−2 −1.5 −1 −0.5 0.5 1 1.5 2 −3 −2 −1 1 2 3 x

Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

slide-78
SLIDE 78

Resolution of modified Burgers’ equation with few elements

−2 −1.5 −1 −0.5 0.5 1 1.5 2 −3 −2 −1 1 2 3 x

Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

slide-79
SLIDE 79

Resolution of modified Burgers’ equation with few elements

−2 −1.5 −1 −0.5 0.5 1 1.5 2 −3 −2 −1 1 2 3 x

Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

slide-80
SLIDE 80

O(hp+1) convergence rates demonstrated for Burgers’ equation

100 101 102 103 10−8 10−6 10−4 10−2 100 Number of elements L1 error

p = 1 ( ), p = 2 ( ), p = 3 ( ), p = 4 ( ), p = 5 ( ), p = 6 ( ) The slopes of the best-fit lines to the data points in the asymptotic regime are: ∠ − 2.0 ( ), ∠ − 3.1 ( ), ∠ − 3.9 ( ), ∠ − 5.5 ( ), ∠ − 4.4 ( ), ∠ − 8.7 ( )

slide-81
SLIDE 81

Convergence: tracking vs. uniform/adaptive refinement

100 101 102 103 10−7 10−4 10−1 L1 error 100 101 102 103 10−7 10−4 10−1 number of elements L1 error 100 101 102 103 number of elements

discontinuity-tracking p = 1 ( ) p = 2 ( ) p = 3 ( ) uniform refinement p = 1 ( ) p = 2 ( ) p = 3 ( ) adaptive refinement p = 1 ( ) p = 2 ( ) p = 3 ( )

slide-82
SLIDE 82

Nozzle flow: quasi-1d Euler equations

0.5 0.5 1 0.8 A(x) Inviscid wall ( ), inflow ( ), outflow ( )

slide-83
SLIDE 83

Resolution of quasi-1d Euler equations with few elements

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.2 0.4 0.6 0.8 1 x

Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

slide-84
SLIDE 84

Resolution of quasi-1d Euler equations with few elements

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.2 0.4 0.6 0.8 1 x

Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

slide-85
SLIDE 85

Resolution of quasi-1d Euler equations with few elements

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.2 0.4 0.6 0.8 1 x

Exact solution ( ), tracking solution ( ) and mesh ( ) for p = 3

slide-86
SLIDE 86

O(hp+1) convergence rates demonstrated for nozzle flow

100 101 102 103 10−5 10−4 10−3 10−2 10−1 100 Number of elements L1 error

p = 1 ( ), p = 2 ( ) Slope of best-fit line: ∠ − 2.0 ( ), ∠ − 2.7 ( ) Reference second-order method (p = 1) with adaptive mesh refinement ( )

slide-87
SLIDE 87

Supersonic flow (M = 2) around cylinder: 2D Euler equations

3 8 1 Inviscid wall/symmetry condition ( ) and farfield ( )

slide-88
SLIDE 88

Resolution of 2D supersonic flow with 48 elements

Density (ρ)

Left: Solution on non-aligned mesh with 48 linear elements and added viscosity (initial guess for shock tracking method). Remaining: solution using shock tracking framework corresponding to mesh with 48 p = 1, p = 2, p = 3, p = 4 elements.

slide-89
SLIDE 89

Resolution of 2D supersonic flow with 48 elements

Density (ρ)

Left: Solution on non-aligned mesh with 48 linear elements and added viscosity (initial guess for shock tracking method). Remaining: solution using shock tracking framework corresponding to mesh with 48 p = 1, p = 2, p = 3, p = 4 elements.

slide-90
SLIDE 90

Resolution of 2D supersonic flow with 48 elements

Shock tracking objective (fshk)

Left: Solution on non-aligned mesh with 48 linear elements and added viscosity (initial guess for shock tracking method). Remaining: solution using shock tracking framework corresponding to mesh with 48 p = 1, p = 2, p = 3, p = 4 elements.

slide-91
SLIDE 91

Resolution of 2D supersonic flow with 48 elements

Distortion metric (fmsh)

Left: Solution on non-aligned mesh with 48 linear elements and added viscosity (initial guess for shock tracking method). Remaining: solution using shock tracking framework corresponding to mesh with 48 p = 1, p = 2, p = 3, p = 4 elements.

slide-92
SLIDE 92

Convergence to optimal solution and mesh

slide-93
SLIDE 93

Discontinuity-tracking performance summary

Polynomial order (p) 1 2 3 4 Degrees of freedom (Nu) 576 1152 1920 2880 Enthalpy error (eH) 0.0106 0.000462 0.00151 0.000885 Stagnation pressure error (ep) 0.0711 0.00479 0.0112 0.000616

slide-94
SLIDE 94

Supersonic flow (M = 4) around blunt body: 2D Euler equations

4 9 1 Inviscid wall/symmetry condition ( ) and farfield ( )

slide-95
SLIDE 95

Resolution of 2D supersonic flow with 102 quadratic elements

Left: Solution (density) on non-aligned mesh with 102 linear elements and added viscosity (initial guess for shock tracking method). Middle/right: solution using shock tracking framework corresponding to mesh with 102 linear (middle) and quadratic (right) elements.

slide-96
SLIDE 96

Resolution of 2D supersonic flow with 102 quadratic elements

Left: Solution (density) on non-aligned mesh with 102 linear elements and added viscosity (initial guess for shock tracking method). Middle/right: solution using shock tracking framework corresponding to mesh with 102 linear (middle) and quadratic (right) elements.

slide-97
SLIDE 97

Convergence to optimal solution and mesh

slide-98
SLIDE 98

Solver simultaneously minimizes objective and solves PDE

50 100 150 200 250 300 350 400 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Iteration Objective function ( ) 10−10 10−8 10−6 10−4 10−2 100 102 Residual norm, ||r(u, x)||∞ ( )

Convergence of residual and objective function

slide-99
SLIDE 99

Conclusions and future work

  • Introduced high-order shock tracking method based on DG discretization and

PDE-constrained optimization formulation

  • Key innovations: objective function that monotonically approaches a minimum

as mesh face aligns with shock and full space solver

  • Optimal convergence O(hp+1) rates obtained and used to resolve a number of

transonic and supersonic flows on very coarse meshes

  • Future work
  • numerical flux consistent with integral form (jumps do not tend to 0)
  • solver that exploits problem structure and incorporates homotopy
  • local topology changes to reduce iterations and improve mesh quality

Mach 2 flow around cylinder (left), Mach 4 flow around blunt body (middle), and L2 projection of discontinuous function (right).

slide-100
SLIDE 100

References I

Barter, G. E. (2008). Shock capturing with PDE-based artificial viscosity for an adaptive, higher-order discontinuous Galerkin finite element method. PhD thesis, M.I.T. Huang, D. Z., Persson, P.-O., and Zahr, M. J. (2018). High-order, linearly stable, partitioned solvers for general multiphysics problems based on implicit-explicit Runge-Kutta schemes. Computer Methods in Applied Mechanics and Engineering. Wang, J., Zahr, M. J., and Persson, P.-O. (6/5/2017 – 6/9/2017). Energetically optimal flapping flight based on a fully discrete adjoint method with explicit treatment of flapping frequency. In Proc. of the 23rd AIAA Computational Fluid Dynamics Conference, Denver, Colorado. American Institute of Aeronautics and Astronautics.

slide-101
SLIDE 101

References II

Zahr, M. J. and Persson, P.-O. (1/8/2018 – 1/12/2018b). An optimization-based discontinuous Galerkin approach for high-order accurate shock tracking. In AIAA Science and Technology Forum and Exposition (SciTech2018), Kissimmee, Florida. American Institute of Aeronautics and Astronautics. Zahr, M. J. and Persson, P.-O. (2016). An adjoint method for a high-order discretization of deforming domain conservation laws for optimization of flow problems. Journal of Computational Physics, 326(Supplement C):516 – 543. Zahr, M. J. and Persson, P.-O. (2018a). An optimization-based approach for high-order accurate discretization of conservation laws with discontinuous solutions. Journal of Computational Physics, 365:105 – 134.

slide-102
SLIDE 102

References III

Zahr, M. J., Persson, P.-O., and Wilkening, J. (2016). A fully discrete adjoint method for optimization of flow problems on deforming domains with time-periodicity constraints. Computers & Fluids, 139:130 – 147.

slide-103
SLIDE 103

PDE optimization is ubiquitous in science and engineering

Control: Drive system to a desired state Boundary flow control Metamaterial cloaking – electromagnetic invisibility

slide-104
SLIDE 104

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 − g(µ) = 0 un − un−1 −

s

  • i=1

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

slide-105
SLIDE 105

Discrete adjoint equations can be derived from an algebraic manip- ulation to save computations

Let u(µ) be the solution of r(·, µ) = 0 r(µ) = r(u(µ), µ) = 0, F(µ) = F(u(µ), µ)

slide-106
SLIDE 106

Discrete adjoint equations can be derived from an algebraic manip- ulation to save computations

Let u(µ) be the solution of r(·, µ) = 0 r(µ) = r(u(µ), µ) = 0, F(µ) = F(u(µ), µ) The total derivative of r leads to the sensitivity equations Dr = ∂r ∂µ + ∂r ∂u ∂u ∂µ = 0 = ⇒ ∂u ∂µ = − ∂r ∂u

−1 ∂r

∂µ

slide-107
SLIDE 107

Discrete adjoint equations can be derived from an algebraic manip- ulation to save computations

Let u(µ) be the solution of r(·, µ) = 0 r(µ) = r(u(µ), µ) = 0, F(µ) = F(u(µ), µ) The total derivative of r leads to the sensitivity equations Dr = ∂r ∂µ + ∂r ∂u ∂u ∂µ = 0 = ⇒ ∂u ∂µ = − ∂r ∂u

−1 ∂r

∂µ The total derivative of F DF = ∂F ∂µ + ∂F ∂u ∂u ∂µ

slide-108
SLIDE 108

Discrete adjoint equations can be derived from an algebraic manip- ulation to save computations

Let u(µ) be the solution of r(·, µ) = 0 r(µ) = r(u(µ), µ) = 0, F(µ) = F(u(µ), µ) The total derivative of r leads to the sensitivity equations Dr = ∂r ∂µ + ∂r ∂u ∂u ∂µ = 0 = ⇒ ∂u ∂µ = − ∂r ∂u

−1 ∂r

∂µ The total derivative of F DF = ∂F ∂µ + ∂F ∂u ∂u ∂µ = ∂F ∂µ − ∂F ∂u ∂r ∂u

−1 ∂r

∂µ

slide-109
SLIDE 109

Discrete adjoint equations can be derived from an algebraic manip- ulation to save computations

Let u(µ) be the solution of r(·, µ) = 0 r(µ) = r(u(µ), µ) = 0, F(µ) = F(u(µ), µ) The total derivative of r leads to the sensitivity equations Dr = ∂r ∂µ + ∂r ∂u ∂u ∂µ = 0 = ⇒ ∂u ∂µ = − ∂r ∂u

−1 ∂r

∂µ The total derivative of F DF = ∂F ∂µ + ∂F ∂u ∂u ∂µ = ∂F ∂µ − ∂F ∂u ∂r ∂u

−1 ∂r

∂µ = ∂F ∂µ − λT ∂r ∂µ

slide-110
SLIDE 110

Discrete adjoint equations can be derived from an algebraic manip- ulation to save computations

Let u(µ) be the solution of r(·, µ) = 0 r(µ) = r(u(µ), µ) = 0, F(µ) = F(u(µ), µ) The total derivative of r leads to the sensitivity equations Dr = ∂r ∂µ + ∂r ∂u ∂u ∂µ = 0 = ⇒ ∂u ∂µ = − ∂r ∂u

−1 ∂r

∂µ The total derivative of F DF = ∂F ∂µ + ∂F ∂u ∂u ∂µ = ∂F ∂µ − ∂F ∂u ∂r ∂u

−1 ∂r

∂µ = ∂F ∂µ − λT ∂r ∂µ Algebraic equations leads to adjoint equations ∂r ∂u

T

λ = ∂F ∂u

T

slide-111
SLIDE 111

Sensitivity vs. adjoint method to compute gradient of F ∂F ∂u ∂r ∂u

−1 ∂r

∂µ

∂r ∂u

−1

∂F ∂u ∂r ∂µ

slide-112
SLIDE 112

Sensitivity vs. adjoint method to compute gradient of F ∂F ∂u ∂r ∂u

−1 ∂r

∂µ

∂F ∂u ∂u ∂µ Sensitivity method requires nµ linear solves and nF nµ inner products (Rnu)

slide-113
SLIDE 113

Sensitivity vs. adjoint method to compute gradient of F ∂F ∂u ∂r ∂u

−1 ∂r

∂µ

∂r ∂u

−1

∂F ∂u ∂r ∂µ Sensitivity method requires nµ linear solves and nF nµ inner products (Rnu)

slide-114
SLIDE 114

Sensitivity vs. adjoint method to compute gradient of F ∂F ∂u ∂r ∂u

−1 ∂r

∂µ

∂r ∂µ λT Sensitivity method requires nµ linear solves and nF nµ inner products (Rnu) Adjoint method requires nF linear solves and nF nµ inner products (Rnu)

slide-115
SLIDE 115

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 − g(µ) = 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

slide-116
SLIDE 116

High-quality reconstruction from coarse MRI grid (space: 24 × 36, time: 20) and low noise (3%)

Synthetic MRI data d∗

i,n (top) and

computational representation of MRI data di,n (bottom) Reconstructed flow

slide-117
SLIDE 117

High-quality reconstruction from fine MRI grid (space: 40×60, time: 20) and low noise (3%)

Synthetic MRI data d∗

i,n (top) and

computational representation of MRI data di,n (bottom) Reconstructed flow

slide-118
SLIDE 118

Extension: constraint requiring time-periodicity [Zahr et al., 2016]

Optimization of cyclic problems requires finding time-periodic solution of PDE; necessary for physical relevance and avoid transients that may lead to crash

minimize

U, µ

F(U, µ) subject to U(x, 0) = U(x, T) ∂U ∂t + ∇ · F (U, ∇U) = 0 λNt = λ0 + ∂F ∂uNt

T

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

T

+

s

  • i=1

∆tn ∂rn,i ∂u

T

κn,i M T κn,i = ∂F ∂uNt

T

+ biλn +

s

  • j=i

aji∆tn ∂rn,i ∂u

T

κn,j

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 ( )

slide-119
SLIDE 119

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.

slide-120
SLIDE 120

Initial guess for optimization: u0, φ0

  • Initial guess for u and φ critical given the non-convex nonlinear optimization

formulation of our shock tracking method

  • Homotopy: define a sequence of shock tracking problems where the solution of

problem j is used to initialize problem j + 1

  • Sequence of problems chosen using homotopy in polynomial order and Mach

number (for high Mach flows)

  • For initial problem in homotopy sequence:
  • φ0 chosen such that resulting mesh is identical to the reference mesh
  • u0 chosen as the solution of the discrete conservation law with enough added

viscosity ν rν(u, x(φ0)) = 0

slide-121
SLIDE 121

Modified Burgers’ equation with discontinuous source term

Inviscid, modified one-dimensional Burgers’ equation with a discontinuous source term from [Barter, 2008] ∂ ∂x 1 2u2

  • = βu + f(x),

for x ∈ Ω = (−2, 2), where u(−2) = 2, u(2) = −2, β = −0.1 and f(x) =

  • (2 + sin( πx

2 ))( π 2 cos( πx 2 ) − β),

x < 0 (2 + sin( πx

2 ))( π 2 cos( πx 2 ) + β),

x > 0 Analytical solution u(x) =

  • 2 + sin( πx

2 ),

x < 0 −2 − sin( πx

2 ),

x > 0

slide-122
SLIDE 122

High-order meshes and parametrization

Reference domain and mesh with 48 elements and polynomial orders p = 1 (left), p = 2 (middle left), p = 3 (middle right), and p = 4 (right). The blue circles identify parametrized nodes.