adjoint-based error estimation and mesh adaptation for ... · 20.01.2015 · context and motivation...
TRANSCRIPT
Adjoint-Based Error Estimation and MeshAdaptation for Problems with Output
Constraints
Marco CezeNASA - ORAU
Ben Rothacker and Krzysztof FidkowskiUniversity of Michigan
AMS SeminarJanuary 20, 2015
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 1/33
Context and MotivationOutput-based error estimation and mesh adaptation
Demonstrated applicability to a wide range of aerospaceengineering problems.Present in production-level codes, e.g.: Cart3D, FUN3D.Many challenges have been addressed: turbulence modeling,unsteady flows, mesh optimization, hp-adaptation, and complexgeometries.
Constrained problems are ubiquitousOutput prediction under trimmed conditions, e.g.: DPW.Current multi-output adaptive strategies consider staticcombinations of outputs.Various outputs have different domains of dependence.Most interesting optimization problems are constrained – how toincorporate constraint errors in the objective function?
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 2/33
Outline of this work
Discontinuous Galerkin spatial discretization.CPTC nonlinear solver with relaxed line-search.Exact Jacobian with element-line-Jacobi preconditioner andGMRES linear solver.Roe solver for inviscid flux and BR2 for viscous discretization.MPI parallelization node-edge weighted mesh partitioning.ICCFD7 version of the SA turbulence model.ALE mesh deformation for trimming.
In this talkDerive an error correction procedure for output-constrainedproblems.Demonstrate adaptive benefits of including constraint-relatederror.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 3/33
Problem StatementSolve the residual equation:
R(U,α) = 0,
where:R ∈ RN : vector of N residuals that must be driven to zeroU ∈ RN : state vector that encodes the flow stateα ∈ RNα : trimming parameter vector (trimming "knobs")Jadapt(U,α): scalar output on which we want to adaptJtrim(U,α) ∈ RNα : vector of outputs used to define trimmingconstraints
We want to predict Jadapt(U,α) to εadapt accuracy, subject to flowequations and the following Nα constraints:
Jtrim(U,α)− Jtrim= 0
Jtrim ∈ RNα is a set of user-specified trim outputs/constraints.AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 4/33
Problem Statement: Example
Consider drag prediction under fixed lift:Nα = 1α: single trimming parameter (angle of attack, for example)
Lift = Lift =
Drag =
AoA =
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 5/33
Key ingredient: an adjointSensitivity of the output w.r.t. residuals in the physics.Input perturbations are converted into residual perturbations.Advantage: residuals are generally cheap to compute.
Flow simula+on
Post-‐processing e.g.: drag, li7.
J(U)
Input parameters ↵
�R�J
26664
R1(U)R2(U)
...Rn(U)
37775 =
26664
00...0
37775
Adjoint variables
U
“Mesh” +
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 6/33
Key ingredient: an adjointSensitivity of the output w.r.t. residuals in the physics.Input perturbations are converted into residual perturbations.Advantage: residuals are generally cheap to compute.
Flow simula+on
Post-‐processing e.g.: drag, li7.
J(U)
Input parameters ↵
�R�J
26664
R1(U)R2(U)
...Rn(U)
37775 =
26664
00...0
37775
Adjoint variables
U
�↵
“Mesh” +
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 6/33
Sensitivity analysis
Key ingredient: an adjointSensitivity of the output w.r.t. residuals in the physics.Input perturbations are converted into residual perturbations.Advantage: residuals are generally cheap to compute.
Flow simula+on
Post-‐processing e.g.: drag, li7.
J(U)
Input parameters ↵
�R�J
26664
R1(U)R2(U)
...Rn(U)
37775 =
26664
00...0
37775
Adjoint variables
U
“Mesh” +
Residual evalua+on
in finer space
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 6/33
Output errorestimation
A derivation of the adjoint equation
Consider an output J ((α),u) where u satisfies R((α),u) = 0 fora fixed input parameter set α.We form a Lagrangian L((α),u,ψ) to incorporate the constraint:
L((α),u,ψ) = J (u) +ψTR((α),u).
We take the variation of the Lagrangian assuming R((α),u) = 0:
δL((α),u,ψ) =
(∂J∂u
T+ψT ∂R
∂u
)
︸ ︷︷ ︸= 0
Adjoint equation
δu +
(∂J∂α
T+ψT ∂R
∂α
)δα.
︸ ︷︷ ︸= 0
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 7/33
Making δL = 0 selects only realizable δJ ’s.
Linearequation!
Single output error estimation and adaptationuH,p will generally not satisfy the original PDE: R(uH,p,w) 6= 0Instead, it satisfies the weak form:
R(u,w) + δR(w) = 0 where δR(w) = −R(uH,p,w).
ψ ∈ V relates the residual perturbation to an output perturbation:
δJ = J(uH,p)− J(u) ≈ −R(uH,p,ψ)
We approximate ψ in a higher order space VH,p+1 ⊃ VH,p andestimate the error as:
δJ ≈ −∑
κH∈T H
RκH (uH,p,ψH,p+1 − ψH,p),
We assign an adaptive indicator to κH based on its contribution tothe error estimate:
ηκH =∣∣∣RκH (uH,p,ψH,p+1 − ψH,p)
∣∣∣.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 8/33
Coupled flow-trim solve
In an output-constrained run we solve:{
R(U,α) = 0 ← N flow equationsRtrim(U,α) = 0 ← Nα trim conditions
where Rtrim(U,α) = Jtrim(U,α)− Jtrim.We seek variations of Jadapt that satisfy the constraints above, so:
δL = δJadapt +ψT δR︸ ︷︷ ︸(a)
+φT δRtrim︸ ︷︷ ︸
(b)
= 0.
“a” is the output error estimate for fixed α, “b” is the influence ofthe trim error in the output error due to inexact constraintsatisfaction.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 9/33
Coupled adjoint solutionWe have an adjoint contribution from both the flow and trimmingresiduals: [
∂R∂U
T ∂Rtrim
∂UT
∂R∂α
T ∂Rtrim
∂α
T
] [ψφ
]+
[∂Jadapt
∂UT
∂Jadapt
∂α
T
]=
[00
]
ψ = −(∂R∂U
)−T[∂Jadapt
∂U
T
+∂Rtrim
∂U
T
φ
]
= −(∂R∂U
)−T ∂Jadapt
∂U
T
︸ ︷︷ ︸ψadapt
−(∂R∂U
)−T ∂Jtrim
∂U
T
︸ ︷︷ ︸Ψtrim
φ
= ψadapt +Ψtrimφ
Finally, the sensitivity of Jadapt to trim residuals is:
φ = −[
dJtrim
dα
]−T dJadapt
dα
T
= −
[dJadapt
dα
(dJtrim
dα
)−1]T
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 10/33
Constrained error estimate and adapt indicator
We get the output error estimate for the constrained case via a changeto the total adjoint:
δJ ≈ −[ψ
adapth +Ψtrim
h φ]T
Rh(UHh ,αH) = δJadapt + φT δJtrim
and the modified adaptive indicator is given by:
ηκ = ηadaptκ︸ ︷︷ ︸
Unconstrained
+ |φ|Tηtrimκ
︸ ︷︷ ︸Constrained
"Unconstrained" - adaptation uses ηk = ηadaptk
"Constrained" - adaptation uses ηk = ηadaptk + |φ|Tηtrim
k
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 11/33
Trim-constraint solver
At each adaptation iteration, we trim parameters to satisfy constraints:
Trimming implementationCurrent meshCurrent state, UCurrent αTrim tolerance, εtrim
Solve R(U,α) = 0Yes‖Jtrim(U,α)− J
trim‖ < εtrim Done
No
Compute output sensitivity matrix: dJtrim
dαUpdate parameters:
α← α+ dJtrim
dα
−1∆Jtrim
∆Jtrim ≡ Jtrim− Jtrim
1. Solve for Nα adjoints:
3. Form sensitivity matrix:
∂R∂U
Tψtrimi +
∂Jtrimi
∂U
T
= 0
∂R∂α (cheap finite differences)
dJtrimi
dα =(ψtrimi
)T∂R∂α +
∂Jtrimi
∂α
2. Compute Nα residual linearizations:
One can also solve flow and trimming equations simultaneously
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 12/33
Mesh adaptation mechanics
Select a fraction f frac of elements with largest error indicators foradaptation.
Isotropic refinement performed in reference space.
New boundary nodes are projected to the geometry.
One level of refinement is kept between adjacent cells.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 13/33
Arbitrary Lagrangian-Eulerian mapping
We consider geometric parameters.Solve transformed PDE on an undeformed reference domain.Near-field rigid body motion blended into static farfield mesh.Quintic polynomial (in radial coordinate) blending functions.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 14/33
Supersonic biplaneTrim on total biplane lift via changes to global angle of attack.Output of interest is drag on lower airfoil.Inviscid flow at M∞ = 1.5 with p = 2 approximation order.
Initial mesh Mach contours
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 15/33
Supersonic biplane
c`,total = 0.25 trimming constraint.cd ,lower adapt output.Different converged outputs.
0 2 4 6 8 101.61
1.615
1.62
1.625
1.63
1.635
Adaptive Iteration
An
gle
of
Att
ack (
o)
Unconstrained
Constrained
Angle of Attack Convergence
0 2 4 6 8 100.0426
0.0426
0.0426
0.0426
0.0427
0.0427
0.0427
0.0427
0.0427
0.0428
Adaptive Iteration
Dra
g C
oe
ffic
ien
t o
n L
ow
er
Airfo
il
Unconstrained: J
Unconstrained: J + δ Jadapt
Constrained: J
Constrained: J + δ Jadapt
Constrained: J + δ Jadapt
+ δ Jtrim
Drag Convergence
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 16/33
Supersonic biplaneTrim and adapt outputs have different domains of dependence.Unconstrained adaptation does not target the upper airfoil.
Unconstrained adaptation Constrained adaptation
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 17/33
NACA 0012
M∞ = 0.5, Re = 5000, p = 1.Lift-constrained drag prediction.Trimming parameter is the angle of attack.
StrategyCompute "exact" lift at α = 1◦
⇒ cexact` = 0.018250.
Set ctarget` = 0.018250.
Use cexact` and cexact
d to evaluateconstrained vs. unconstrainedadaptation.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 18/33
NACA 0012
Trimming history:
0 2 4 6 8 10 12 140
0.5
1
1.5
2
2.5
Adaptation Iteration
An
gle
of
Att
ack (
o)
Unconstrained
Constrained
Ref. value
6 8 10 120.9
0.95
1
1.05
1.1
Angle of Attack Convergence
0 2 4 6 8 10 12 1410
−4
10−3
10−2
10−1
100
101
Adaptation Iteration
Angle
of A
ttack E
rror
(o)
Unconstrained
Constrained
Angle of Attack Error
Trimming parameter converges faster for constrained adaptation.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 19/33
NACA 0012
Output history:
0 2 4 6 8 10 12 140.0545
0.055
0.0555
0.056
0.0565
0.057
0.0575
0.058
0.0585
Dra
g C
oeffic
ient
Adaptation Iteration
6 8 10 12 14
0.0553
0.0553
0.0554
0.0554
0.0554
0.0554
Drag Convergence
0 2 4 6 8 10 12 1410
−8
10−7
10−6
10−5
10−4
10−3
10−2
Adaptation IterationD
rag
Co
eff
icie
nt
Err
or
Unconstrained: J
Unconstrained: J+δ Jadapt
Constrained: J
Constrained: J+δ Jadapt
Constrained: J+δ Jadapt
+δ Jtrim
Drag Error
Unconstrained adaptation lags behind constrained adaptation.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 20/33
NACA 0012Difference in the final lift adjoints between constrained and unconstrained:
Density component of lift adjoint
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 21/33
High-lift configurationMDA 30P-30N main airfoil with NACA 0012 elevator.M∞ = 0.2, ReCw = 9x106 with p = 1.Freestream at 10◦.ctarget` = 3.0, ctarget
m = 0.0
Case ParametersTrim lift and momentconstraints via changes toangle of attack.Output of interest is total drag.Wing chord, Cw = 0.5588Tail chord, Ct = 0.3 ∗ Cw
Separation = 4.0 ∗ Cw
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 22/33
High-lift configurationFlow/trim solve for first adaptive iteration:
0 100 200 300 400 500 600 700 80010
−10
10−8
10−6
10−4
10−2
100
102
Nonlinear iteration
Resid
uals
Flow residual
Lift−constraint residual
Moment−constraint residual
Note: trimming succeeds despite flow solution stall.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 23/33
High-lift configuration
Output and trimming history:
1 2 3 4 5 6 7 8
0.04
0.045
0.05
0.055
0.06
0.065
0.07
0.075
0.08
0.085
0.09
Tota
l D
rag C
oeffic
ient
Adaptation iteration
Unconstrained: J
Unconstrained: J+δ Jadapt
Constrained: J
Constrained: J+δ Jadapt
+δ Jtrim
2 4 6 80.039
0.0395
0.04
0.0405
0.041
0.0415
Drag Convergence
1 2 3 4 5 6 7 8 9 100
1
2
3
4
5
6
7
8
Angle
of attack (
o)
Adaptation iteration
Unconstrained: αwing
Unconstrained: αtail
Constrained: αwing
Constrained: αtail
Angle of Attack Convergence
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 24/33
High-Lift configuration - why the similarity?Adaptation targets same area with and without constraint:
Unconstrained Mesh
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 25/33
High-lift configuration - why the similarity?Adaptation targets same area with and without constraint:
Constrained Mesh
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 26/33
DPW5 caseNo-tail CRM geometry at M∞ = 0.85, Re = 5× 106, and C target
L = 0.5.
Approximation order is p = 1.
The output of interest is the total drag.
Initial cubic (q = 3) mesh generated by agglomerating 3 linear cells ineach direction.
Trimming diagram. 6th adapted mesh (155661 elements).AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 27/33
DPW5 case
Adaptation proceeds with under-converged constraint residual due toexcessively coarse initial mesh.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 28/33
DPW5 case
Initial Mach contours Final Mach contoursAMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 29/33
DPW5 case
Initial Mach contours Final Mach contoursAMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 30/33
DPW5 case
Including the constraint error smoothes the error correction.
Note: we are not fully solving the fine-space adjoints.
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 31/33
Concluding remarks
We extended the adjoint-based error estimation method to problemswith output constraints.
We demonstrated this extension in several problems with varyingcomplexity.
In cases where the domains of dependence largely overlap, the benefitsof the constrained adaptation is marginal.
In cases with disjoint outputs, the constrained adaptation method offersa clear advantage – most evident in the convergence of the trimmingparameter.
Future developments: simultaneous flow-trim solve, extension to errorsampling adaptive strategies e.g.: optimization-based hp (Ceze andFidkowski) and MOESS (Yano and Darmofal).
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 32/33
Acknowledgments
University of Michigan
NASA Ames computational resources
AFOSR FA9550-10-C-0040
Thank you!
AMS Seminar, Jan. 20, 2015 Constrained Adjoint-Based Error Estimation and Mesh Adaptation 33/33