ADJOINT METHODS HIGHER ORDER SPACE-TIME D -G …L. Diosady 03-01-17 Approach • Turbulent flows...
Transcript of ADJOINT METHODS HIGHER ORDER SPACE-TIME D -G …L. Diosady 03-01-17 Approach • Turbulent flows...
ADJOINT METHODS IN A HIGHER-ORDER SPACE-TIME DISCONTINUOUS-GALERKIN SOLVER FOR TURBULENT FLOWS
Laslo DiosadyScience & Technology Corp.
Patrick BloniganUSRA
Scott MurmanNASA ARC
Anirban GaraiScience & Technology Corp.
https://ntrs.nasa.gov/search.jsp?R=20170002294 2020-02-21T14:56:34+00:00Z
L. Diosady 03-01-17
Motivation
• Perform detailed time-accurate scale-resolving simulations of practical, complex, compressible flows
• High-Reynolds-number separated flows involving large-scale unsteadiness, where RANS models are unreliable
2
L. Diosady 03-01-17
Approach
• Turbulent flows involve a large range of spatial and temporal scales which need to be resolved
• Efficient algorithms and implementation necessary for wall-resolved high Reynolds number flows
• Numerical method must be capable of handling complex geometry
• Numerical method must be “robust”
3
Developed higher-order space-time discontinuous-Galerkin spectral element framework
L. Diosady 03-01-17
• Gradient computation needed for error-estimation, adaptation, design, sensitivity analysis, etc.
• Tangent and adjoint methods have been successfully applied to a variety of steady and unsteady flows
• High-fidelity simulations we are targeting are chaotic • Can traditional tangent/adjoint methods work? • Develop efficient implementation of tangent and adjoint method in space-time discontinuous solver
• Assess the applicability of traditional adjoint and tangent methods for chaotic flows
4
Approach
L. Diosady 03-01-17
Outline
• Space-time DG formulation
• Discrete primal formulation
• Discrete tangent and adjoint formulations
• NACA0012
• Flow sensitivity with increasing Reynolds number
• Properties of adjoint for chaotic flows
• T106a LPT
• Adjoint solutions corresponding to a practical simulation
• Summary/Outlook
5
L. Diosady 03-01-17
Space-Time Discontinuous-Galerkin (DG) Formulation
• Compressible Navier-Stokes Equations: • Space-Time Discontinuous-Galerkin Discretization:
• Entropy variables: Hughes (1986)
• Inviscid Flux: Ismail & Roe (2009) • Viscous Flux: Interior penalty method with penalty parameter
given by 2nd method of Bassi and Rebay (2007) • Integrals evaluated using numerical quadrature with 2N points • Discrete entropy stability: Barth (1995)
6
@u
@t+r · F (u,ru) = 0
Ao
v,t
+Ai
v,i
� (Kij
v,j
),i
= 0
SPD Sym SPSDv =
2
64� s
��1 + �+1��1 � ⇢E
p⇢ui
p
�⇢p
3
75
(⇢s),t +
✓qicvT
◆
,i
= vT,iKijv,j � 0
L. Diosady 03-01-17
Discrete Formulation• Discrete system solved each time-slab:
• where:
• beginning/end of time-slab
7
w(tn+) = Iswn
w(tn+1� ) = Iew
n
Rn(un, wn) +Gn(un�1, wn) = 0
Rn(un, wn) =X
⇢Z
I
Z
�✓@w
@tu+rw · F
◆+
Z
I
Z
@w[F · n+
Z
w(tn+1
� )u(tn+1� )
�
Gn(un�1, wn) =X
⇢Z
�w(tn+)u(t
n�)
�
L. Diosady 03-01-17
Discrete Tangent formulation
• Output: • where α is a parameter (i.e. angle of attack, Reynolds number etc.)
• Compute sensitivity of output to parameters:
• Tangent equation:
• Matrix form:
8
J(u;↵)
@Rn
@un (�un, wn) + @Gn
@un�1 (�un�1, wn) = �@Rn
@↵
2
64
@Rn�1
@un�1 0 0@Gn
@un�1@Rn
@un 0
0 @Gn+1
@un@Rn+1
@un+1
3
75
2
4�un�1
�un
�un+1
3
5 = �
2
64
@Rn�1
@un�1
@Rn
@un
@Rn+1
@un+1
3
75
dJ
d↵=
@J
@↵+
@J
@u
@u
@↵=
@J
@↵+
@J
@R̄
@R̄
@↵
L. Diosady 03-01-17
Discrete Adjoint Formulation• Lagrangian:
• Stationarity of Lagrangian:
• Adjoint equation:
• Matrix Form:
9
Adjoint Sensitivity
L(u, ;↵) = J(u;↵) + T R̄(u;↵)
�L =
@J
@u
T�����↵
+ T @R̄
@u
����↵
!�u+
@J
@↵
T�����u
+ T @R̄
@↵
����u
!�↵ = 0
@Rn
@un (wn, n) + @Gn
@un�1 (wn�1, n) = �@Jn
@un ( n)
2
664
@Rn�1
@un�1
T@Gn
@un�1
T0
0 @Rn
@un
T @Gn+1
@un
T
0 0 @Rn+1
@un+1
T
3
775
2
4 n�1
n
n+1
3
5 = �
2
64
@Jn�1
@un�1
@Jn
@un
@Jn+1
@un+1
3
75
L. Diosady 03-01-17
Primal Solver: Implementation Details• Efficient implementation of higher order DG
• Tensor-product basis
• Take advantage of hardware (SIMD/optimized kernels)
• Jacobian-free Approximate Newton-Krylov solver
• Tensor-product based ADI-preconditioner
• Primal Residual Evaluation:
1. Evaluate state/gradient at quadrature points
2. Evaluate flux at quadrature points
3. Weight fluxes with gradient of test functions
10
Optimizedsum-factorization
Vectorized Kernels
L. Diosady 03-01-17
Tangent/Adjoint: Implementation Details• Reuse optimization from primal for tangent and adjoint
• Tangent Residual Evaluation:
1. Evaluate state/gradient and update/gradient at quadrature points
2. Evaluate linearized flux at quadrature points
3. Weight fluxes with gradient of test functions
• Adjoint Residual Evaluation:
4. Evaluate state/gradient and adjoint/gradient at quadrature points
5. Evaluate adjoint flux at quadrature points
6. Weight fluxes with gradient of test functions
11
Optimizedsum-factorization
Vectorized Kernels
L. Diosady 03-01-17 12
• At high angle of attack, flow over NACA0012 airfoil exhibits vortex shedding which become chaotic with increasing Reynolds number. (Pulliam 1993)
• Examine primal and adjoint solutions
NACA0012, α = 10
L. Diosady 03-01-17
NACA0012, Re = 800, α = 10
13
0 50 100-Time
10 -2
10 -1
10 0
Adjo
int M
agni
tude
0 50 100Time
0
0.1
0.2
0.3
0.4
0.5
Force
Directional Force Output Adjoint Magnitude
• Unsteady shedding gives periodic output signal • Adjoint solution also periodic (after initial transient)
L. Diosady 03-01-17
NACA0012, Re = 1600, α = 10
14
Directional Force Output Adjoint Magnitude
• With increasing Reynolds number force has multiple frequencies • Adjoint solution still essentially appears periodic
0 50 100-Time
10 -2
10 -1
10 0
10 1
Adjo
int M
agni
tude
0 50 100Time
0
0.1
0.2
0.3
0.4
0.5
Force
L. Diosady 03-01-17
NACA0012, Re =2400, α = 10
15
Directional Force Output Adjoint Magnitude
• With increasing Reynolds number simulated flow become chaotic • Adjoint solution begins to grow unboundedly
0 50 100Time
0
0.1
0.2
0.3
0.4
0.5
Force
0 50 100-Time
10 -2
10 0
10 2
10 4
Adjo
int M
agni
tude
L. Diosady 03-01-17
NACA0012, Re =800-2400, α = 10
16
Adjoint Magnitude• With increasing Reynolds number simulated flow become chaotic • Adjoint solution begins to grow unboundedly
0 50 100-Time
10 -2
10 0
10 2
10 4
Adjo
int M
agni
tude
Re = 800Re = 1600Re = 2400
L. Diosady 03-01-17
NACA0012, Re =800-2400, α = 10
17
Adjoint Magnitude
• Solution is in fact chaotic at Re = 1600, but growth rate is much slower than at Re = 2400
• Windowing approaches may be successful at Re = 800, 1600
0 50 100 150 200-Time
10 -5
10 0
10 5
10 10
Adjo
int M
agni
tude
Re = 800Re = 1600Re = 2400
L. Diosady 03-01-17
T106c Low Pressure Turbine
18
• Re = 80,000, Minflow = 0.243, alpha = 32.7, Mexit = 0.65
• Periodic BCs in span-wise and pitch-wise directions • No free-stream turbulence • Spanwise domain is 20% of chord
L. Diosady 03-01-17
Primal Solution
19
• Nearly steady flow upstream and over first 2/3 of blade
• Separation leading to transition/vortex shedding on suction-side of blade
• Fully turbulent wake
L. Diosady 03-01-17
0 0.5 1 1.5Time
1
1.1
1.2
1.3
1.4
1.5Ax
ial F
orce
, = 32.7, = 32.701
Sensitivity to Inflow Boundary Condition
20
• Modify inlet flow angle from α = 32.7 to α = 32.701
Domain flow-through time
Convective disturbancehits leading edgeAcoustic disturbance
hits leading edge
L. Diosady 03-01-17
0 0.5 1 1.5Time
-0.05
0
0.05
Axia
l For
ce D
iffer
ence
0 0.5 1 1.5Time
10 -7
10 -5
10 -3
10 -1
10 1
|Axi
al F
orce
Diff
eren
ce|
Sensitivity to Inflow Boundary Condition
21
Domain flow-through time
Convective disturbancehits leading edge
Acoustic disturbance hits leading edge
L. Diosady 03-01-17
Adjoint of mean Axial Force
22
• Output is integrated axial force
• Also define output without temporal normalization
J̄ =1
T
ZT
0Fx
(u(⌧))d⌧
J(t) =
Zt
0Fx
(u(⌧))d⌧
Range: [-1e6, 1e6]
L. Diosady 03-01-17
Sensitivity computed using adjoint
23
0 0.5 1 1.5Time
10 -8
10 -4
10 0
10 4
10 8
|J(,
+"
,)-J
(,)|
Finite DifferenceAdjoint
�J(t) = J(t;↵+�↵)� J(t;↵) =
Zt
0Fx
(u(⌧ ;↵+�↵))� Fx
(u(⌧ ;↵))d⌧
⇡Z
t
0 (⌧ ; t,↵)TR(u(⌧);↵+�↵)
L. Diosady 03-01-17
Sensitivity computed using adjoint
24
• Approximation holds since flow upstream of blade is essentially time-independent
• Adjoint correctly captures sensitivity in part of flow upstream of separation
�Fx
(⌧) = Fx
(u(⌧ ;↵+�↵))� Fx
(u(⌧ ;↵))
?? ⇡ (t� ⌧ ; t,↵)TR(u;↵+�↵)
0 0.5 1 1.5Time
10 -11
10 -9
10 -7
10 -5
10 -3
10 -1
10 1
|Axi
al F
orce
Diff
eren
ce|
Finite DifferenceAdjoint T=0.1Adjoint T=0.2Adjoint T=0.3Adjoint T=0.4Adjoint T=0.7
L. Diosady 03-01-17
Sensitivity computed using adjoint
25
• Sensitivity computed using adjoint only valid for very short time windows
• Adjoint computed using long time window blows up
• Sensitivity computed using short time window, not representative long time behaviour
0 0.5 1 1.5Time
10 -810 -610 -410 -210 010 210 410 610 8
|" J
- *
T R|
L. Diosady 03-01-17
Graphical demonstration of concepts
26
• Adjoint correctly captures sensitivity in part of flow upstream of separation
• Sensitivity computed using adjoint only valid for very short time windows
• Sensitivity computed using short time window, not representative long time behaviour
27
Adjoint-based Error Estimation
Element-based error-indicator
S. Murman 20-oct-15
• Estimate error using dual-weighted residual method (Becker & Rannacher 1995)
• Localize error
• Flag elements with largest error for refinement
Primal Solution
✏ = J(u)� J(uH) ⇡ RH(uH , h)
✏ ⌘ RH(uH , h|)
28
Adjoint-based error indicator
S. Murman 20-oct-15
• Unbounded adjoint not useful for error estimation
• Estimate is orders of magnitude larger than actual signal
• Error localization simply flags regions where adjoint is large
L. Diosady 03-01-17
Adjoint growth with mesh resolution
29
• Refined mesh has essentially double mesh resolution near separation region
• Increase mesh resolution results in faster growth of adjoint (i.e. larger Lyapunov exponent)
• Adaptation mechanism is not convergent
0 0.5 1 1.5Time
10 -110 110 310 510 710 9
|*|
CoarseFine
29
L. Diosady 03-01-17
Summary
• Presented space-time adjoint solver for turbulent compressible flows
• Confirmed failure of traditional sensitivity methods for chaotic flows
• Assessed rate of exponential growth of adjoint for practical 3D turbulent simulation
• Demonstrated failure of short-window sensitivity approximations.
30
L. Diosady 03-01-17
Outlook/Future Work:• Lyapunov exponents, least-square shadowing and beyond…
31
Questions??