Error Estimation and Control for Unsteady Flow Problems with

advertisement
Error Estimation and Control for
Unsteady Flow Problems with
Dynamic Meshes using a Discrete
Adjoint Approach
Dimitri Mavriplis
Department of Mechanical Engineering
University of Wyoming
Motivation
• Complex simulations have multiple error sources
• Engineering simulations concerned with specific
output objectives
• Adjoint methods / Goal Oriented Approach
– Methodical approach for constructing discrete adjoint
– Use for a posteriori error estimation
• Spatial error
• Temporal error
• Other error sources
– Use to drive adaptive process
Overview
• Discrete Adjoint formulation for steady
aerodynamics
– Design Optimization problem (3D)
• Discrete Adjoint construction for unsteady
“multiphysics” problem
• Dynamically deforming meshes
• Unsteady flow solution
– Unsteady design optimization
– Unsteady error estimation
3rd CFD Drag Prediction Workshop
San Francisco, California – June 2006
NSU3D=G
CFL3D=1,2
Grid Convergence – All Solutions
Overflow=H,K,..
4
Tinoco
Drag Prediction Workshop
Test Case
•
•
•
•
Wing-Body Configuration
72 million grid points
Transonic Flow
Mach=0.75, Incidence = 0 degrees, Reynolds number=3,000,000
Wing1-Wing2 Grid Convergence Study
(DPW3)
•NSU3D delivers consistent grid convergence provided:
•Flow is mostly attached
•Sequence of refined grids originate from same family with same relative resolution distributions
Discrete Adjoint Approach
• Solution of adjoint problem enables:
– Rapid calculation of sensitivities for design-optimization
– Error estimation based on functional outputs (lift, drag…)
• Sensitivity of local errors to output of interest … adaptive meshing/time stepping
• Sensitivity can be obtained by:
– Finite Difference (perturb input, rerun)
– Tangent Problem: Solve linearization of analysis problem
• Suitable for single design variable (input), many objectives (outputs)
– Adjoint Problem: Transpose of Tangent problem or linearization
• Suitable for many design variables, few outputs (objective)
• Discrete adjoint constructed using modular linearization of individual solver
subroutines
– Flow Adjoint, Mesh Motion Adjoint
• Adjoint Problems Solved using line-implicit multigrid scheme
– Similar convergence as analysis problem (same eigenvalues)
– Formulation enables extension to unsteady and multidisciplinary problems
Drag Minimization Problem
•
•
•
DLR-F6 Wing body configuration
Mach=0.75, Incidence=1o , Re=3M
1.12M grid points, 4.2M cells
Drag Minimization Problem
• Mach=0.75, Incidence=1o , CL=0.673
• Convergence < 500 MG cycles, 40 minutes on 16 cpus
• Change Wing Shape to Reduce Drag
– Objective= Drag
Design Variables = Surface Grid Point Positions
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
Goal-Oriented Spatial Adaptivity
DG Discretization
h-adaptivity
(Drag)
p-adaptivity
(Drag)
Extension to Unsteady Problems
•
•
•
•
•
•
•
•
•
ALE finite-volume formulation (cell-centered)
Satisfies Geometric Conservation Law (GCL)
Unstructured triangular meshes
2nd-order spatial accuracy
Gradient based reconstruction for 2nd-order
accuracy
Temporally 2nd-order accurate (BDF2)
Mesh deformation via linear tension spring
analogy
Roe’s flux model
Linear multigrid for convergence acceleration
Unsteady Discrete Adjoint
• Using chain rule linearization
– New time-step values depend on previous time step
values
– Integrate linearized equation in time (tangent problem)
– Transpose all to get adjoint (and reverse order of matrix
multiplication)
• Integrate backwards in time (Flow and Mesh Motion)
• Gives sensitivity of solution at time t=tfinal to design variables
• Do not use variational formulation
– Finite volume discretization
Flow equations
Conservative form of Euler
equations:
U
   F (U )  0
t
Integrate over moving control volume to get Arbitrary-LagrangianEulerian (ALE) finite-volume form:
AU

  F (U )  xU  ndB  0
t
dB ( t )
Mesh Deformation
Linear Tension Spring Analogy:
Mesh is a series of interconnected
springs
[K]dxint = dxsurf
2 independent force balance
equations at each node
Computational Mesh:
Unstructured triangular elements for
inviscid flows
• ~20,000 elements
• 289 surface nodes
Basic Sensitivity Formulation
L  f (U n , x n )
Objective function
dL
L U n L x n

 n
n
dD U D x D
Forward linearization
Need expressions
for these 2 terms
nT
dL
U

dD
D
T
nT
L
x L

n
U
D x n
T
Easy to compute
T
Transpose = reverse
linearization
Details of Unsteady Adjoint
n n
n 1 n 1
A
U

A
U
Rn 
 S (U n , x n , x n1 )  0
t
R n (U n ,U n1 , x n , x n1 )  0
Flow constraint
equation for BDF1
scheme
R U n
R U n 1 R x n
R x n1

 n
 n 1
0
n
n 1
U D U
D
x D x
D
nT
U
D
T
T
T
T
n 1 T
nT
n 1 T

R
x R
x
R  R 
 U
 


n 1
n
n 1 
n

D

U

D

x

D

x

U






Continued…..
T
 U n 1 T R T x n T R T x n 1 T R T  R  T L T x n T L
dL
 



n 1
n
n 1 
n
n
dD
D x
D x
D x n
 D U
 U  U
Flow Adjoint at n:
U
n
 R 
 n
 U 
T
L
U n
T
T
 U n 1 T R T n x n 1 T R T n  x n T  L T R T n 
dL

 n  n  




n

1
n

1

 D U
 D  x
dD

D

x

x




Continued…
[ K ]dx n  dxsurf
nT
xsurf
x

D
D
n
Mesh Motion
constraint equation
nT
[ K ]T
n
T
T
T
T
n 1 T
n 1 T





x
dL

U

R

x

R

L

R
surf
n
n
T
n



 
 
[ K ]  n  n  
n

1
n

1
 D U

dD
D x
D
x
 x



T
T
Mesh adjoint at n:
x
n
T
T



L

R
T
n

 [ K ]  n  n  
x
 x

Continued….
 U
dL

 D
dD

T
n 1 T
n 1 T
R
x
n
 
n 1
U
D
Will need expression
from flow constraint
at n-1
T
 xsurf
R
n
 
n 1

x
D

Will need expression
from mesh constraint
at n-1
T
nT
x
Derivative of
equation that
prescribes
geometry motion
• Results in backward time-integration
• Solve one flow adjoint and one mesh adjoint at each time-step
• Recurrence stops at n=0 via steady state adjoint solution for problems
initiated from a steady state solution
n
Typical Multigrid Convergence
Flow
equations
Flow
adjoint
 R 
 U dU   R (U )
[ K ]dx  dxsurf Mesh motion
[ K ]T  x  rhs
Mesh adjoint
 R 
 U n  U  rhs
T
•All systems converge within 100 MG cycles
Formulated as duality
preserving iterative scheme
•Flow equations & adjoint ~ 45 seconds each
•Mesh equations & adjoint ~ 10 seconds each
Optimization Procedure
Deform airfoil
surface as a
function of D
Perturb D
by dD
Run flow solver to
obtain unsteady
solution: forward
time-integration
Set dD = 0
Compute design variable
perturbation as:

dL
dD   
dD
start
Check Lg
Compute
objective
function Lg
stop
Run adjoint solver to
compute sensitivities:
backward timeintegration
Case 1: Objective Formulation
Time-Dependent Load
Convergence/Comparison
Unsteady Flow Solution
Pressure Contours for Pitching Airfoils
Minf = 0.755, a0 = 0.016o, amax = 2.51o, w = 0.1628, t=0 to 54
27 time-steps with dt=2.0
NACA0012 Baseline Airfoil
Optimized Airfoil
Error Estimation
Test Case Description
Sinusoidally pitching airfoil
Functional scalar is Lift after 1 period
Easily extended to estimate error in time-integrated Lift history
(future work)
Sources of Error
Error in Time domain
Temporal
resolution error
Flow
equations
Mesh motion
equations
Partial
convergence
error
Flow
equations
Mesh motion
equations
Flow equations
Conservative form of
Euler equations:
U
 .F (U )  0
t
Integrate over moving control volume to get Arbitrary-Lagrangian-Eulerian
(ALE) finite-volume form:
AU

  [ F (U )  xU ]  n dB  0
dB ( t )
t
Mesh Deformation
Linear Tension Spring Analogy:
Mesh is a series of interconnected
springs
[K]dxint=dxsurf
2 independent force balance
equations at each node
Temporal Resolution Error
Fine level Taylor expansion of functional objective L:
Lh (U h , xh ) 
 L 
 L 
H
H
Lh (U , x )  
(
U

U
)

(
x

x
h
h
h
h )



 U U hH xhH
 x  xhH U hH
H
h
H
h
h = fine time domain : t/2
H = coarse time domain : t
Evaluation of Flow Contribution to
Temporal Resolution Error
Fine level flow residual Taylor expansion
Rh (U h , xh ) 
 R 
 R 
H
H
Rh (U , x )  
(
U

U
)

(
x

x
h
h
h
h )0



 U U hH xhH
 x  xhH U hH
H
h
H
h
Continued…



 R 
 R 
H
H
H 
(U h  U )   
( xh  xh )
Rh (U h , xh )   


 U U hH xhH 
 x  xhH U hH


1
H
h
 L 
H
(
U

U
h )
 U  H H h

 U h xh



 L 
 R 
 R 
H
H
H 

( xh  xh )
Rh (U h , xh )   




 U U hH xhH  U U hH xhH 
 x  xhH U hH


1
 
T
Uh
Continued…
Adjoint equation over entire fine time domain:
 R 
 L 


 U  H H Uh  U  H H

 U h xh

 U h xh
T
T
Recast on coarse time domain:
 R 
 L 


UH
 U 
 U 

U H xH

U H xH
T
U h  I hH U H
T
n
n
R (U ,U
At each time level n for BDF1:
n 1
n
,x ,x
n 1
)0
Discrete form for BDF1:
  R1  T
 1 
  U 
 















 R 2 
 1
 U 


T
0

 
 
 R n  2 
 n2 
 U 
0
T
T
 R n 1 
 n2 
 U 
T
 R n 1 
 n 1 
 U 












T

 R n  
 n 1  
 U 
T 
 R n  
 n 
 U  
 L T 


1

U
1


 U 











  








 

  
T

L


 n2 
n2 


 U 
U
 L T 
 n 1 


 U 
n 1
n

U


 U 
T
 L 
 U n 
Can be solved by block backsubstitution = backward recurrence relation in time
(backward integral in time)
Continued…


 T  R 

 L 
H
 Rh (U , x )  Uh  
 
(
x

x
 h h)

 x  xhH U hH  x  xhH U hH 


T
Uh
H
h
H
h
Contribution to
temporal resolution
error from flow
equations
Eh ( xh  xhH )
Remaining temporal resolution error
(due to mesh motion equations, but also feeds into flow state )
TUh Rh (U hH , xhH )  T1 R1  T2 R2  T3 R3  
Intepret as sum of dot products of adjoint and residual at each time step
Evaluation of Mesh contribution to
Temporal Resolution Error
G ( x)  [ K ]dx  dxsurf  0
 G 
H
G ( x h )  G ( x )    ( xh  xh )  0
 x  xhH
H
h
1
( xh  x )  [ K ] G ( x )
H
h
H
h
1
E h ( xh  x )   E h [ K ] G ( x )
H
h
H
h
 Txh
Continued…
[ K ]  xh   E
T
T
h
[ K ]T  xH   E HT
 xh   I  xH
H
h
 Gh ( x )
T
xh
H
h
Contribution temporal
resolution error from mesh
motion equations
 Rh (U , x )
T
Uh
H
h
H
h
Contribution temporal
resolution error from flow
equations
Summary of Temporal Resolution
Error Evaluation
• Compute unsteady flow solution on coarse time domain
• Compute adjoint variables on coarse time domain
– Integrating backward in time
• Project adjoint variables, flow solution and mesh solution
onto fine time domain
• Temporal resolution error is then dot product of adjoint
with corresponding non-zero residual on fine time
domain
– Distribution in time is used to drive adaptation
Validation
•Adjoint is linearization about current state (16 time steps) to
predict objective value on modified state (32 time steps)
Partial Convergence Error
Coarse level Taylor expansion about partial solution functional:
LH (U H , xH ) 
 L 
 L 
LH (U H , xH )  
(U H  U H )   
( xH  xH )

 U U hH xhH
 x  xhH U hH
U H , xH 
U H , xH 
Partially converged flow and mesh solution
Fully converged flow and mesh solution
Partial Convergence Error
Fine level flow residual Taylor expansion
RH (U H , xH ) 
 R 
 R 
RH (U H , xH )  
(U H  U H )   
( xH  xH )

 U U hH xhH
 x  xhH U hH
non-zero due to partial convergence
Continued…
 R 
 L 
U H  
 U 


U H xH
 U U H xH
T
K T x U
H
T
Same adjoint equations
as those for temporal
resolution error
T



E
H
xH
xH U H
Partial convergence error due
to flow equations:
Partial convergence error due
to mesh equations:
TU H RH (U H , xH )
TxH GH ( xH )
Non-zero
residuals due
to partial
convergence
Summary of Total Error Evaluation
and Decomposition
•
Compute partially converged flow and mesh solution on coarse time domain
•
Compute adjoint variables on coarse domain using partially converged
solution
•
Compute partial convergence error on coarse level time domain
– Inner product of adjoint with partially converged (non-zero) residual
•
Project partially converged solution and adjoint variables onto fine time
domain
•
Evaluate fine level error estimate as previously
– Combined temporal resolution and partial convergence error
•
Determine temporal resolution error by subtracting partial convergence error
from total error estimate on fine time domain
Validation
Adaptation
• Compute time-integrated averages of error
component distributions
• Adapt where error is greater than timeintegrated average
– Time resolution error: divide time step by 2
– Convergence error: tighten tolerance by
predetermined factor
Adaptive Time Step and
Convergence Criteria Example
Distribution of time steps and convergence limits in
the time domain after 6 adaptation cycles
Time steps
Flow limits
Mesh limits
Distribution of Error Components
Resolution error
Flow convergence error
Mesh convergence error
Conclusions
•
Rigorous procedure for determining global error
•
Identifies individual error contributions from each set of governing equations
•
Distribution of each component available and can be used for adaptation
•
Can be extended to problems involving multiple sets of governing equations
such as conjugate heat transfers, structural equations etc.
•
Address other errors such as coupling errors
– Aero-structural coupling
•
Further extensions to incorporate space adaptivity non-trivial
– Space-time formulations most obvious path forward
Download