Adjoint equations in CFD: duality, boundary conditions and solution behaviour M.B. Giles N.A. Piercey Oxford University Computing Laboratory, Oxford, OX1 3QD, UK.
Abstract
Here Uh is the discrete ow solution and is initially a single design variable. Dierentiating with respect to gives @Rh dUh + @Rh = 0; @Uh d @ which determines the change in Uh due to a change in . Given some nonlinear objective function, Ih (Uh ; ), which, for example, may be a discrete approximation to the lift or drag on an airfoil, the derivative with respect to is simply
The rst half of this paper derives the adjoint equations for inviscid and viscous compressible ow, with the emphasis being on the correct formulation of the adjoint boundary conditions and restrictions on the permissible choice of operators in the linearised functional. It is also shown that the boundary conditions for the adjoint problem can be simpli ed through the use of a linearised perturbation to generalised coordinates. dIh = @Ih dUh + @Ih The second half of the paper constructs the Green's d @Uh d @ functions for the quasi-1D and 2D Euler equations. @Ih @Rh 1 @Rh + @Ih These are used to show that the adjoint variables have a = @U @ @ logarithmic singularity at the sonic line in the quasi-1D h @Uh case, and a weak inverse square-root singularity at the @R @I = VhT @h + @h ; upstream stagnation streamline in the 2D case, but are continuous at shocks in both cases. where Vh is the solution of the adjoint equation
@Rh T
@Ih T V + h @Uh @Uh = 0: The key point is that derivatives of Ih with respect to
1 Introduction The last few years have seen considerable progress in the use of adjoint equations in CFD for optimal design [1{9]. In all of the methods, the heart of the algorithm is an optimisation procedure which uses an adjoint method to compute the linear sensitivity of an objective function with respect to a number of design variables. The simplest approach, at least conceptually, to constructing the discrete adjoint equations begins with the nonlinear discrete residual equations arising from a nite volume discretisation of the original uid dynamic equations, Rh (Uh ; ) = 0:
other design variables can be expressed in a similar manner, using the same adjoint ow solution. The only additional computation for each additional design variable h is the evaluation of @R @ and its vector dot product with Vh . Each of these two steps involves minimal computational eort, and so the overall computational cost is almost independent of the number of design variables. The adjoint solution also plays a critical role in numerical error analysis, analysing the error in the computed airfoil lift and drag due to the truncation error inherent in the discretisation. The solution error eh is de ned by Uh = U (xh ) + eh; Rolls-Royce Reader in CFD, email:
[email protected], where U (xh ) is the analytic ow solution evaluated at Member AIAA y Research Associate, email:
[email protected], the discrete grid points. Linearising the residual equaMember AIAA tions gives c 1997 by M.B. Giles and N.A. Pierce. PubCopyright lished by the American Institute of Aeronautics and Astronautics, Inc. with permission.
h Rh (U (xh )) + @R @U eh 0; h
1
where Rh (U (xh )) is the vector of truncation errors obtained by substituting the analytic solution into the discrete residual operator. If I (U ) is the scalar quantity of interest (e.g. lift or drag) based on the analytic solution, then the error in the corresponding discrete approximation, Ih (Uh ), can be broken into two components, Ih (Uh ) I (U ) = (Ih (Uh ) Ih (U (xh ))) + (Ih (U (xh )) I (U )) : The second term is the truncation error in approximating the operator I . The rst term is due to the error eh in the discrete solution Uh and can be approximated as follows,
Knowledge of the behaviour of the adjoint solution at a shock or sonic line in compressible ow calculations, or within the boundary layer and wake in viscous ow applications, could be very important in constructing accurate error estimates and for optimal grid re nement and adaptation. The objective of this paper is to follow this analytic approach to advance the mathematical theory of adjoint equations for CFD applications. The rst half of the paper is concerned with the construction of the adjoint formulation. This is achieved within a framework of duality in which the original (primal) and adjoint (dual) formulations are equivalent representations of the same linear problem. The general theory is developed rst for a large class of boundary value p.d.e.'s. The theory is then applied to the convection/diusion, Euler and Navier-Stokes equations in two dimensions. The second half investigates the behaviour of solutions of the adjoint Euler equations. By expressing the adjoint solution in terms of the Green's function for the original linearised Euler equations, it is shown that the adjoint solution for the quasi-1D Euler equations has a log x singularity at a sonic line, but is continuous at a shock. The adjoint solution for the 2D Euler equations is broken into four components. When the base
ow eld is isentropic, two of the components can be expressed as solutions of the linearised potential ow equations. The third component causes no perturbation to the pressure eld and so does not aect the lift and drag on an airfoil. The nal component involves perturbations to the stagnation pressure, resulting in an inverse square-root singularity at the stagnation streamline upstream of an airfoil leading edge. This could have signi cant implications for grid generation and adaptation to achieve more accurate predictions of airfoil lift and drag.
@Ih e Ih (Uh ) Ih (U (xh )) @U h h @R 1 @I h = @U @Uh Rh (U (xh )) h h = VhT Rh (U (xh )); where the vector Vh is again the adjoint ow solution.
Thus the adjoint ow solution relates the errors in quantities such as lift and drag, to the underlying truncation errors in the evaluation of nite volume cell residuals. As well as oering useful bounds on the accuracy of lift and drag predictions, this could also be used as the basis for optimal grid adaptation, giving the most accurate predictions for a given level of computational cost. This use of the adjoint solution for error analysis has been developed only recently in the CFD community for incompressible ow [10, 11] but there is a longer history of its use for structural analysis [12, 13]. However, in structural analysis one is primarily concerned with point quantities such as peak stresses and so adjoint equation methods are not used widely. In CFD applications, on the other hand, the most important quantities from an engineering perspective are usually integrals and so error analysis and optimal grid adaptation using the adjoint solution oer much more potential. The above introduction to adjoint equation methods has followed the discrete approach in which one begins with the nonlinear discrete equations and then considers linear perturbations. A drawback of this approach to formulating the adjoint equations is that it does not oer clear insight into the nature of the discrete adjoint solution. The alternative approach is to construct the adjoint p.d.e. together with appropriate boundary conditions, and then discretise that to obtain a discrete adjoint solution. The important advantage of this analytic approach is that the behavior of the adjoint solution can be investigated by considering the adjoint p.d.e.
2 Duality and the adjoint formulation 2.1 General theory If we assume that both the equations and the functional I have been linearised, the discrete approach can be described as a mapping from the original problem, Determine I = (g; U ) given that A U = f into an equivalent dual problem, Determine I = (V; f ) given that AT V = g 2
The rst and last steps involve simple substitutions for
The inner product is simply a vector dot product,
e; f; g; h, so the critical step is the central one which
(V; U ) V T U;
requires the identity (v; Lu)D + (C v; Bu)@D = (L v; u)D + (B v; Cu)@D ; to hold for all u and v. Integrating by parts gives an identity of the form (v; Lu)D = (Lv; u)D + (A1 v; A2 u)@D ; where L is the adjoint partial dierential operator, and A1 and A2 are dierential operators on the boundary @D. Therefore, what needs to be proved is that given L, B and C , there exists a pair of operators B and C such that (A1 v; A2 u)@D = (B v; Cu)@D (C v; Bu)@D :
and the equivalence of the two problems is easily proved, (V; f ) = (V; A U ) = (AT V; U ) = (g; U ): Note that the inhomogeneous term f in the discrete equations in the primal problem, enters the functional in the dual problem, and correspondingly the inhomogeneous term g in the dual problem comes from the functional of the primal problem. Using the analytic approach, the objective is similar, but with linear dierential operators instead of matrices, and two additional inner products, one an integral over the domain of the problem, (v; u)D =
Z
(v; u) dV;
We now prove that such operators exist (and are unique) for a large class of p.d.e.'s subject to two reand the other an integral over the boundary of the do- strictions. main, Z Restriction 1: We restrict the theory to p.d.e.'s for (v; u)@D = (v; u) dA: which the boundary operators B , C , A1 and A2 in@D volve only the values of u and v and any of their normal derivatives, so that With these de nitions, the objective in the analytic approach is to convert the primal problem, Bu Bu D
Cu Cu (A1 v; A2 u) vT Au
Determine I = (g; u)D + (h; Cu)@D given that Lu = f in D and Bu = e on @D:
where B and C are rectangular matrices, A is a square matrix, and u and v are vectors composed of u and v, respectively, together with normal derivatives of the appropriate degree (e.g. the 2D convection/diusion equation requires rst derivatives, whereas the 2D Euler equations need none). Under this restriction, the result to be proved becomes
into an equivalent dual problem, Determine I = (v; f )D + (C v; e)@D given that L v = g in D and B v = h on @D:
Z
L is the linear p.d.e. which is adjoint to L. B and B are boundary condition operators for the primal and dual problems, respectively, and C and C are also op-
@D
vT Au (B v)T Cu + (C v)T Bu dA = 0:
The necessary and sucient condition for this to be true is that the integrand is zero at all points. This reduces the task to the linear algebra problem of proving the existence and uniqueness of matrices B and C at each point of the boundary such that A = (B )T C (C )T B:
erators which may be dierential; these four operators, and hence also e and h, may have dierent dimensions on dierent parts of the boundary (e.g. in ow and out ow parts of the boundary when L correspond to pure convection). The equivalence of the two forms of the problem is to be proved by showing that
It is convenient to de ne matrices T ; T as
(v; f )D + (C v; e)@D = (v; Lu)D + (C v; Bu)@D = (L v; u)D + (B v; Cu)@D = (g; u)D + (h; Cu)@D :
T= 3
! B ; T = C
! C ; B
so that this equation can be re-written as
0 1 A B = rank B B@ B CCA C C !
then m = rank(A) = rank
A = (T )T T :
We now make the second restriction, considering rst The analysis so far has been concerned with the conthe most common case in which A is non-singular. struction of a dual problem in which the linear funcRestriction 2 (non-singular form): If A is non- tional is equivalent to that of the primal problem. This singular, then the matrix T as de ned above is also has been shown to be achievable if the primal p.d.e., its boundary conditions and its linear functional satisfy a non-singular square matrix. certain restrictions. It can also be proved that under If A is non-singular, then under this restriction T is these conditions the dual problem is well-posed if, and only if, the primal problem is well-posed. invertible and so T is uniquely de ned by
T = (T )T AT : 2.2 2D scalar convection/diusion equation From the de nition of T , this then uniquely de nes B The 2D scalar convection/diusion equation in conand C . servative form is If A is singular, then the rst step, both in the theLu r (uw) r u = f; oretical development and in practical applications, is to re-express the problem using reduced vectors u0 ; v0 whose dimension equals the rank of A, and for which the with w being a prescribed convection velocity. Integratcorresponding reduced square matrix A0 is non-singular. ing by parts gives Z This is accomplished using a singular value decomposi v r (uw) r u dA tion of A, D Z A = R L; = u w rv r v dA in which the matrices R and L are each orthogonal (i.e @v ZD @u R = RT , L = LT ) and is a diagonal matrix in + v uwn @n + u @n ds: which the rst m diagonal elements are strictly positive @D 0 and the remainder are zero. We now de ne A to be the m m principal diagonal sub-matrix of so that Here wn w n and @=@n n r, with n being an 1
2
2
2
1
1
outward pointing normal on the boundary. Thus, the adjoint p.d.e. is Lv w rv r2 v = g; where R0 is the rst m columns of R, and L0 is the rst m rows of L, and we de ne the reduced vectors to be and the extended vectors u; v and boundary matrix A are u0 = L0u; v0 = (R0)T v: ! ! ! u v w 1 n u = @u ; v = @v ; A = 1 0 : In order to be able to express the boundary opera@n @n tors Bu; Cu in terms of the reduced vector u0 , we need to make the restriction that each row of B and C can We now consider two dierent pairs of boundary opbe expressed as a linear combination of the rows of A, erators B and C , and in each case apply the theory to and hence as a linear combination of the rows of L0 . construct the corresponding operators B and C . This restriction, together with the requirement that the resulting reduced matrices B 0 and C 0 satisfy Restriction 2 given above, can be expressed in the following Dirichlet b.c.'s @u : Bu u; Cu @n generalised version of Restriction 2. In this case, Restriction 2:
A = R 0 A 0 L0 ;
Given that A 2 Rn Rn and
! B 2 Rm Rn ; C
T 4
1 0 = 0 1
!
=)
T =
!
wn 1 : 1 0
Hence,
B =
C =
1 0 ;
and so
In error analysis, the inhomogeneous term f arises from the truncation error in applying the discrete residual operator to the analytic solution. In a design application, f is zero if u is de ned to be the linear change in the ow solution at a point with xed coordinates (x; y). However, this de nition of u leads to diculties in approximating the boundary conditions on a perturbed surface [9]. The alternative way of formulating the equations for the design application is to de ne u to be the linear perturbation in the ow solution taking into account a linear perturbation in the coordinates. This follows the approach now used for linearised unsteady ow analysis [14, 15, 16] in preference to the previous discretisations using xed grids [17, 18]. The starting point for this formulation is the conservative form of the Euler equation using general curvilinear coordinates,
wn 1 ;
@v : C v wn v @n
B v v;
Neumann b.c.'s @u ; Cu u: Bu @n In this case,
T Hence, and so
0 1 = 1 0
!
=)
B = wn 1 ; @v ; B v wn v + @n
!
1 0 : wn 1
T = C =
1 0 ;
@ @y @x @ @x @y @ Fx @ Fy @ + @ Fy @ Fx @ = 0:
C v v:
We now de ne the perturbed coordinates as
x = + X (; );
2.3 2D Euler equations
y = + Y (; );
where is a design variable. X (; ) and Y (; ) are The nonlinear steady-state Euler equations in conser- smooth functions which match the surface perturbations due to the design variable, so that a point (; ) vation form are which is initially on a solid surface remains so as the @ F (U ) + @ F (U ) = 0; design variable changes. Linearising with respect to @x x @y y yields where U is the vector of conservation variables and @ (A u) + @ (A u) = @ F @Y F @X Fx (U ) and Fy (U ) are the nonlinear ux functions, @ x @ y @ x @ y @
0 1 0 1 0 1 ux uy B C BB u + p CC BB uxuy CC B C u x x B C B C C: U = B C ; Fx = B ; F =B @ uy A @ uxuy CA y B@ uy + p CA
@X @Y @ @ Fy @ Fx @ ;
2
where u is now the perturbation in the ow variables for xed (; ) rather than xed (x; y), and the uxes E ux H uy H Fx and Fy are based on the unperturbed ow variables. Switching notation from (; ) back to (x; y) then proLinearising about a given steady-state solution, duces the equation of the form Lu = f as given above. U (x; y), leads to the equation In essence, this treatment is very similar to that used by Jameson for single-block Euler and Navier-Stokes com@ (A u) + @ (A u) = f; Lu @x x y putations [2, 3]. The dierence is that in his formulation @y the solid surface corresponds to part of the coordinate where u is the linear perturbation, and the spatially surface = 0, whereas in this formulation the solid varying matrices Ax ; Ay are de ned by surface is the original surface de ned in Cartesian coordinates. As a consequence, this new formulation can be @Fy x used with an unstructured grid discretisation for com; A Ax @F y @U U (x;y) @U U (x;y) : plex geometries. 2
5
Returning to the linearised equation, integrating by characteristic in ow/out ow b.c.'s At a subsonic out ow, for which 0 < un < c, the parts over D gives @ characteristic boundary condition is the speci ca@ (A u) = AT @v AT @v ; u tion of the value of the sole incoming characterisv; @x (Ax u)+ @y y y @y x @x D D tic variable, uc4. Thus the characteristic boundary + (v; An u)@D ; condition operator is where Bu u = ) B = : 0 0 0 1 c 4 c An = nx Ax + ny Ay ; and n = (nx ; ny )T is an outward pointing unit normal Because is non-singular, we need T c to be square on the boundary @D. and non-singular and so a suitable characteristic functional is Thus, the adjoint p.d.e. is
L v ATx @v
@x
0 uc B B Cu @ uc
ATy @v @y = g:
1 2
uc3
This can be solved through the evolution to steady-state of the equation
1 CC A
0 1 B B =) C c = @ 0
Together, these give
@v AT @v AT @v = g; @t x @x y @y
0 BB 10 Tc = B B@ 0
0 0 1 0 0
showing that its characteristic behaviour is similar to that of the original unsteady Euler equations, but with the sign of each characteristic velocity reversed so that the characteristic information travels in the opposite direction. In applying the general theory to construct the adjoint boundary conditions, the vectors u and v are just u and v, and the matrix A is simply An . This can be diagonalised to obtain A n = R R 1 ; in which = diag(i ) is the diagonal matrix of eigenvalues i of An . These can be shown to be 1 = un + c; 2 = 3 = un; 4 = un c; where c is the local speed of sound and un is the normal component of velocity. The columns of the matrix R are then the corresponding eigenvectors of A. It is convenient to de ne primal and dual characteristic variables as uc = R 1 u; vc = RT v; so that vT An u = vcT uc: We now consider dierent pairs of boundary operators B and C , expressed in terms of equivalent matrices Bc; C c applied to the characteristic variables. For each pair, we use the theory to construct corresponding matrices B c ; C c , applied to the dual characteristic variables, such that = (T c )T T c:
and so
T c =
1
0 0 0C 1 0 0C A: 0 0 1 0
0 0 0 1
1
1 C 0C C; 0C A 0
1
0 0 0 B B 0 Tc T = B B@ 0
0 4 C 0 0 C 1 C: 0 C 2 0 A 0 0 3 0
1
Hence, the characteristic matrices for the dual formulation are
0 0 B B Bc = @ 0
1
0 0C C 2 0 0 A; 0 0 3 0 1
and
C c =
0 0 0 4 : Because of the reversal of direction of characteristics, each outgoing characteristic of the primal problem corresponds to an incoming characteristic of the dual problem. Therefore, the boundary condition for the dual problem is indeed well-posed. Similarly, at a subsonic in ow the characteristic operators for the primal problem are
0 B uc Bu B @ uc
2 3
uc4
6
1 CC ; A
Cu uc1;
Converting back into the original dual variables gives
and the dual operators are
B v 1 vc1 ;
Bv
1 0 v c C B C v B @ vc CA :
and
2
2
3
3
C v
solid wall
At a solid wall the normal velocity un is zero, so there is only one incoming characteristic for both the primal and the dual problems, and the matrices An and are of rank 2 instead of 4. The reduced vectors u0 ; v0 , as described in the general theory, are ! ! v u c 1 c 1 0 0 ; ; v = u=
ux uy H v:
h1 pe;
then the dual problem has b.c. nx v2 + ny v3 = h1 ; and its linear functional includes a surface integral of the quantity e1 (v1 + uxv2 + uy v3 + Hv4 ):
vc4
and the reduced diagonal matrix 0 is
!
2.4 2D thin shear layer Navier-Stokes equations
c 0 : 0 c
0 =
0 nx ny 0 v;
Thus, if the primal problem has b.c. uen = e1 ; and the linear functional includes a surface integral of the quantity
4 vc4
u c4
The nonlinear steady-state Navier-Stokes equations An important pair of boundary operators for the in conservation form appear as primal problem are @ F (U ) + @ F (U ) = x u u u c 1 c 4 c 1 + uc4 @x @y y Bu uen = 2c ; Cu pe = 2 ; @ F v (U; @U ; @U ) + @ F v (U; @U ; @U ); x @x @y @x @y y @x @y specifying the perturbation to the normal compo@U v @U @U nent of velocity as the boundary condition, and us- where Fxv (U; @U @x ; @y ) and Fy (U; @x ; @y ) are the nonlining the linearised pressure perturbation in the func- ear viscous ux functions. tional. These are the boundary operators used in The linearised equations are optimal design applications. @ @u @u Expressed in terms of the reduced vector of charv Lu @x (Ax Ax)u Dxx @x Dxy @y acteristic variables, these correspond to
B0c = and so
1 2c
1 2c ;
0 1 B@ 2c T 0c = B 1 2
=)
T 0c =
C 0c =
1 1 2 2
;
1 1 2c C CA ; 1 2
others are de ned as
v v x v @Fy Avx @F ; A y @U U (x;y) @U U (x;y) ;
! c c T 0 0 = Tc ; c c 1
2
v @F v ; Dyx @Uy ; Dxx @F@Ux @ ( @x ) U (x;y) @ ( @x ) U (x;y)
2
v @F v Dxy @F@Ux ; Dyy @Uy : @ ( @y ) U (x;y) @ ( @y ) U (x;y)
and hence the dual boundary operators are
B v c (vc1 vc4 );
@ (A Av )u D @u D @u + @y y y yx @x yy @y = f; where matrices Ax ; Ay are as de ned before, and the
C v c2 (vc1 + vc4 ): 7
initially assumed to be locally aligned with the x-axis so that the outward normal from the uid is (0 1)T . Because the viscous uxes involve derivatives of temperature and the two velocity components, it is helpful to switch to new variables, up (e uex uey Te)T , in which e and Te are the linear perturbations in density and temperature, respectively, and uex and uey are the perturbations to the components of velocity in the two coordinate directions. The linearised conservation variables u can be related to the new variables up by
As with the Euler equations, the inhomogeneous term f corresponds to the truncation error in error analysis, and the result of a linear perturbation to the coordinates in a design application. Integrating by parts over domain D gives
@ @u @u v v; @x (Ax Ax )u Dxx @x Dxy @y D @ @u @u
+ v; @y (Ay Avy )u Dyx @x Dyy @y = +
@
u = Sup;
@v T @v T (Ax Avx)T @x @x Dxx @x + Dyx @y ; u D @ DT @v + DT @v ; u (Ay Avy )T @v @y @y xy @x yy @y D
+ v;
nx (Ax Avx)u
@u D @u Dxx @x xy @y
@v
@v
@x ; (nx Dxx + ny Dyx)u
The corresponding extended vectors up and vp are de ned by
0 1 0 1 up S u CA ; up = B @ @up CA = B@ @
@u
@u D + v; ny (Ay Avy )u Dyx @x yy @y +
D
@v
@D
@n
@D
1 @n (S u)
@n
Making a high Reynolds number thin-shear-layer approximation in which streamwise viscous derivatives are neglected, and ignoring the weak temperature dependence of the viscosity and thermal conductivity, the boundary term arising from the integration by parts can eventually be written as vTp Ap up where Ap is
@D
@y ; (nx Dxy + ny Dyy )u @D ; where (nx ; ny )T is again an outward pointing unit normal on the boundary @D. +
0 T 1 S v vp = B @ T @v CA : S
1
0 BB 0 BB 0 BBRT BB BB 0 BB BB 0 BB BB 0 BB BB 0 @
The adjoint p.d.e. is therefore
@v (A Av )T @v L v (Ax Avx)T @x y y @y @ DT @v + DT @v @x xx @x yx @y @ T @v T @v @y Dxy @x + Dyy @y = g; which can be solved through the evolution to steadystate of the equation
0
@v (A Av )T @v (A Av )T @v x x @x y y @y @t @ DT @v + DT @v @x xx @x yx @y @ DT @v + DT @v = g: @y xx @x yx @y
0 0
0
0
0 0
0 0
0
R
0
yy xy cv ( 1)T cv 0 0
0
0 0 2 +
0
0
0
0 0
0 0
0
0
k cv
0
1 CC CC C 0 2+ 0 C CC kC C 0 0 cvC C CC 0 0 0C C 0 0 0C CC CC 0 0 0C A
0
0 0
0 0
0
0
0
Here xy and yy are the x and y components of the shear stress acting on the solid wall, ; and k are the usual coecients of viscosity and thermal conductivity, R is the gas constant, and cv is the speci c heat at constant volume.
We now consider the formulation of adjoint boundary conditions at a solid wall, which for convenience is
The matrix Ap is of rank 6 since each of its rows can 8
be expressed as a combination of the rows ( 0 1 0 0 0 0
0
0 )
( 0 0 1 0 0 0
0
0 )
( 0 0 0 1 0 0
0
0 )
( 0 0 0 0 0
0
0 )
( RT 0 0 R 0 0
C0p = BB 0 BB BB @0
(2 + ) 0 )
( 0 0 0 0 0 0
Converting back into the original variables, the adjoint boundary operators are
0 0 B B B v@0
k )
0
and
Speci ed temperature
If the temperature is speci ed, the boundary operator matrix B p has the form
1
1
0 0 0 0 0 0 C 0 0 R 0 0 (2 + ) 0 C A: 0 0 0 0 0 0 0 k
The rows of B p and C p are then linearly independent, and together form a complete basis for the rows of Ap , which can be factored to obtain the following boundary operator matrices for the adjoint formulation, 1 0 1 0 0 0 0 0 0 0
k
@y
The boundary data for the primal problem is typically uex = 0; uey = 0; Te = e3 ; so that the surface contribution to the linear functional in the dual formulation is
CC C; 0C CC A
0 0 0 0 0 0 0 c1 0 0 0 0 v
0
In the more general case in which the x-axis is not aligned with the surface, the linear functional can be taken to be a surface integral of hT Cu h1 exn + h2 eyn + h3 qen ; where exn and eyn are the linear perturbations to the two components of the force exerted by the
uid on the surface (including both the pressure and shear stress terms), and qen is the perturbation heat ux into the surface. The boundary conditions for the adjoint equations are then v2 = h1 ; v3 = h2 ; v4 = h3 :
A valid choice for the boundary operator C is to select the two components of surface force and the heat ux, giving
BB BB 0 0 1 Bp = B B@
0 1 0 0 0 xy B C C v B @ 0 0 H + yy CA v 0 0 0 0 0 1 0 0 0 BB CC @v : 0 0 2 + 0 @ A 0 0
1 0 0 0 0 0 0C 0 1 0 0 0 0 0C A: 0 0 0 1 0 0 0 0
0 0 B Cp = B RT @
1
1 0 0C 0 1 0C A v; 0 0 0 1
which correspond to perturbations in the two velocity components, the temperature, the two components of surface force, and the surface heat ux, respectively. The Navier-Stokes equations require a total of three boundary conditions at a solid wall. Two of these come from the no-slip condition requiring both components of the velocity to be zero. The third involves the temperature, specifying either its value or its normal derivative.
0 0 B B Bp = @ 0
1 0 xy 0 0 CC cv yy 0 0 2 + 0 C CC 0 0 ( 1)T + c v CA k 0 0 0 0 0 0 cv 0 0
4 eT C v k e3 @v @n :
and 9
This simple form for the adjoint boundary conditions and linear functional can be easily veri ed by using integration by parts to con rm the identity
the boundary conditions for the adjoint equations are v2 = h1 ; v3 = h2 ; @v k @n4 = h3 :
(v; f )D + (C v; e)@D = (g; u)D + (h; Cu)@D : The advantage of deriving it by the more formal procedure above is that it proves the limited options for the operator Cu in the primal functional. For example, one of the rows of Cu can be @T @n , but @p . it could not be @n
The boundary data for the primal problem is uex = 0; uey = 0; qen = e3 ; and the surface contribution to the linear functional in the dual formulation is
Speci ed heat ux
Reverting to the simplifying assumption that the boundary is aligned with the x-axis, the boundary operator matrix B p in the case of speci ed heat
ux is
0 0 B B Bp = @ 0
1
1 0 0 0 0 0 0 C 0 1 0 0 0 0 0 C A; 0 0 0 0 0 0 0 k
eT C v e3 v4 :
3 Green's functions and adjoint solutions
and a valid choice for the boundary operator C p is to select the the two components of surface force In this section the aim is to nd the Green's function and the temperature, giving G(x; ) such that the solution of the inhomogeneous linearised Euler equations, 0 1 0 0 0 0 0 0 0C B Lu = f Cp = B @ RT 0 0 R 0 0 (2 + ) 0 CA : subject to homogeneous b.c.'s can be expressed as 0 0 0 1 0 0 0 0 The only dierence from the previous case is the interchange of the last lines in B p and C p . Following the same procedure, the adjoint boundary operators are found to be
0 B0 Bv B @0
1
0
1
1 0 0C B0 0 0 0C @v 0 1 0C A v + B@ 0 0 0 0 CA @y ; 0 0 0 0 0 0 0 k
and
0 1 0 0 0 xy B Cv Cv B @ 0 0 H + yy C A 0 0 0 1 0 1 0 0 0 BB C @v @ 0 0 2 + 0 CA : 0 0
0
0
u(x) =
Z
D
G(x; ) f () d:
G(x; ) is a matrix function whose dimension d is equal to 3 for the quasi-1D Euler equations, and 4 for the 2D Euler equations. Given d vector functions fn (), let the associated functions un(x; ) be the solution to Lun (x; ) = fn () (x ); where (x ) is the Dirac delta function, and the boundary conditions are again homogeneous. If the vector functions fn are linearly independent at each point , then by linear superposition the Green's function can be expressed as the following combination of two matrices whose columns are the vectors un and fn ,
@y
G(x; ) = u1 u2 ::: ud
f1 f2 ::: fd
1
:
Switching back to general coordinates, with a linear In addition, if In () is the value of the linear funcfunctional which is a surface integral of tional corresponding to un (x; ) then, by de nition, hT Cu h1 exn + h2 eyn + h3 Te; In () = ( v(x); fn() (x ) )D = vT ()fn () (1) 10
then the linear perturbation in mass ux, stagnation enthalpy and stagnation pressure will be constant for x . This observation, together with the fact that the Mach number remains equal to unity at the throat, In the analyses below for the quasi-1D and 2D Eu- leads to the following solutions un and functions fn . ler equations, the approach in each case is to construct functions fn () which produce solutions un (x; ) of a change in mass ow at xed H; po simple form. The objective is to gain insight into the The mass ow is equal to mh where m = q. The nature of the Green's function and the adjoint solution, solution to be constructed corresponds to a unit in particular looking for singularities and discontinuities change in mass ow at the point x = , keeping in the adjoint variables. Furthermore, given a computed H; po unchanged. Because H; po are unchanged and adjoint solution v and a set of perturbation vectors the throat remains sonic, the mass ow through the fn (), it is then possible to evaluate the correspondthroat must remain xed. Hence, if < 0, the mass ing linear functionals In () using Equation (1). This
ow upstream of x = is reduced by a unit amount, provides a means of verifying a number of the adjoint whereas if > 0, it is the mass ow downstream of solution properties derived in the following section. x = which is increased by a unit amount. De ning m = q, and using the Heaviside function 3.1 Quasi-1D Euler equations H(x), this leads to the following function u1 and hence
1
The nonlinear quasi-1D Euler equations in conservation form are
d (hF ) dh P = 0; dx dx
8 1 @U (x) ; < 0 > H ( x ) > < h(x) @m H;p u (x; ) = > 1 H(x ) @U (x) ; > 0 > : h(x) @m H;p o
where h is the streamtube height and
0 1 0 1 q 0C B C B B C B F = @ q + p A ; P = @ p C A;
which is a solution to the linearised ow equations when f (x) = f1 ( )(x ) and
@F ( ) f1 ( ) = @m H;po xed :
2
qH
0
with q being the velocity and the other variables are as de ned previously. The linearised equations are then where
d (hAu) dh Bu = f; Lu dx dx @F ; A = @U
o
1
@P : B = @U
Here, as in several of the cases that follow, the form of the perturbation source vector fn required to produce a prescribed solution perturbation un , is determined by analogy to a Rankine-Hugoniot jump condition expressed in terms of the nonlinear solution and ux vectors U and F . If the linear functional is
I=
3.1.1 Singularity at a sonic throat The rst case to be considered is a convergingdiverging duct with sonic conditions at the throat at x = 0, subsonic ow upstream of it, and supersonic
ow downstream. The in ow boundary conditions at x = 1 are speci ed stagnation enthalpy H and stagnation pressure po , and there are no out ow boundary conditions at x =1. The nonlinear equations ensure that mass ux, stagnation enthalpy and stagnation pressure all remain constant along the duct. Likewise, if f (x) = fn ( )(x ) 11
Z
1 1
pe dx
where pe is the linearised perturbation to the pressure, then
8 Z 1 @p > > < h(x) @m (x) H;p dx; < 0 u (x; ) = > Z 1 @p (x) > : h(x) @m H;p dx; > 0 1
1
o
1
o
Since
@p 1 ; @m x
as x ! 0;
If the shock is displaced to x = xs then this becomes
it follows that
I1 ( ) log( );
+
as ! 0:
[F ]xxss = 0:
and thus there is a logarithmic singularity in the Linearising about the base solution at x = 0 gives the adjoint variables at the sonic throat. following linearised Rankine-Hugoniot equations,
change in H at xed po; M
+
In this case, the stagnation enthalpy downstream Au + xs dF dx 0 = 0: of x = is perturbed by a unit amount, in the linearised sense. Keeping the Mach number unchanged ensures the perturbation in mass ux is If the linear equations have source term f ( ) (x ) at constant. a point just upstream of the shock, the jump condition The solution u2 (x; ) is given by at is + [Au] = f ( ): @U u2 (x; ) = H(x ) @H (x) In the limit as ! 0, this can be combined with the po ;M xed Rankine-Hugoniot jump to give corresponding to 0+ dF Au + xs dx = f ( ): @F (x) f2 ( ) = h( ) @H 0 po;M xed : Repeating this argument for > 0; ! 0 results in the Since po and M are xed, there is no perturbation same expression. Therefore, since the jump equations are the same in the two limits, so too are the Green's to the pressure and hence I2 ( ) = 0. functions. i.e. G(x; ) is continuous in at the shock, change in po at xed H; M even though it is discontinuous in x. A consequence is The nal case perturbs the stagnation pressure by that the adjoint solution v( ) is continuous at the shock. a unit amount downstream of x = , keeping the stagnation enthalpy and Mach number xed. This Further analysis reveals the gradient of v( ) is disconagain implies a uniform perturbation to the down- tinuous at the shock. stream mass ux and so the linearised equations are satis ed by 3.2 2D Euler equations 0
@U (x) u3(x; ) = H(x ) @p o H;M xed
with
@F (x) f3 ( ) = h( ) @p o
H;M xed
Here we consider ow around an isolated airfoil with subsonic freestream conditions. The behaviour of the Green's function and the adjoint variables is determined through the analysis of the response to four linearly independent source terms.
:
The corresponding linearised functional is
mass source at xed po; H
Z @p Z p I ( ) = @p (x) dx = p dx; o o H;M 1
As with the quasi-1D Euler equations, the rst source to be considered is a unit mass source injecting uid with the local values of stagnation pressure and enthalpy. By considering a small control volume surrounding the point at which the mass is being injected, it can be determined that the relevant source term is f1 () (x ) where
1
3
which does not exhibit a singularity at the throat.
3.1.2 Continuity at a shock Suppose now that we have a diverging duct with a shock at x = 0. The nonlinear Rankine-Hugoniot equations prescribe a zero jump in the ux F , +
0 1 BB u1 CC x f () = B B@ uy CCA : 1
H
[F ]00 = 0: 12
turbation to the lift or drag, will also be continuous.
normal force ξ
The second source term corresponds to an applied force in the direction normal to the local ow, 0 1 0
Mach lines
BB u CC y f () = B B@ ux CCA :
M1
2
0
Figure 1: Global domain of in uence due to mass injection in the supersonic region.
If the ow is subsonic, this can again be represented by the linearised potential ow equations, and in this case the point force will correspond to a vortex of unit strength. In the limit as the vortex approaches the surface of the airfoil, a PrandtlGlauert transformation to an incompressible ow eld can again be used, and this time it reveals that u2 (x; ) ! 0 except in the immediate vicinity of x = , and that the force exerted on the surface is q(), where q2 = u2x + u2y . Hence, if the linear functional is (pe; h)@D , then the linear functional due to u2 (x; ) is I2 () = qhjx= :
If the entire ow eld is subsonic, the response u1 (x; ) to this source can be obtained from the linearised potential ow equations. In the limit as approaches the surface of the airfoil, the local behaviour can be analysed by using a Prandtl-Glauert transformation to relate the ow eld to that of an incompressible ow eld with a point mass source. This analysis reveals that there is no singularity as approaches the surface. Similarly there is no singularity as crosses the stagnation streamline either upstream or downstream of the airfoil. Since I2 () = vT () f2 () it follows therefore that If the ow eld is transonic, it raises the question of whether there is a singularity at either the sonic nx v2 + ny v3 = h; line or a shock. At a shock, the quasi-1D analysis which is the adjoint b.c. derived earlier. can be extended to prove that the Green's funcAs with the point mass source, the response to this tion and the adjoint variables are continuous as point force is continuous as crosses the stagnation crosses the shock, although there is a discontinuity streamline, the sonic line, and any shocks. in the gradient of of the adjoint variables. Hence, in particular, u1 (x; ) is continuous with respect to change in H at xed po; p across the shock. The third source term is essentially the same as the The behaviour at the sonic line is very hard to second of those for the quasi-1D equations. Conanalyse, but it appears that in general there is sider an in nitesimal streamtube with mass ux no singularity, in contrast to the logarithmic sin passing through . The uid in the streamgularity for the quasi-1D equations. The reason tube downstream of is subjected to a unit linfor this is that in 2D ows the sonic line is almost earised perturbation to the stagnation enthalpy never perpendicular to the local streamlines. As H , keeping xed the stagnation pressure po, the illustrated in Figure 1, this is important because static pressure p and the ow angle . This perwhen mass is injected into the ow on the superturbed streamtube satis es the linearised Euler sonic side of the sonic line, the in uence of this equations, with the constant pressure being imporextends along the Mach lines coming out of . If tant to maintain pressure equilibrium with neighthe sonic line is not perpendicular to the streambouring streamtubes. lines, the Mach lines reach the sonic line and the inUsing curvilinear streamline coordinates in which
uence then extends throughout the elliptic region s is the distance along the streamline downstream and hence to the whole supersonic region. This of and n is the coordinate perpendicular to the lateral pressure relief mechanism prevents the sinstreamline, and dividing by to re-normalise, the gular response exhibited in the quasi-1D case, and linear solution u3(x; ) is ensures that u1 (x; ) is continuous with respect to @U 1 as crosses the sonic line. Consequently, the u3 (x; ) = H(s)(n) q @H (x) : response of a linearised functional, such as the perpo ;p; xed 13
The perturbation this produces in the streamtube downstream of is
@U (x) H(s)(n) q1 @p : o H;p; xed
n +
ξ
s
Figure 2: Orientation of Heaviside step and Dirac delta functions used to describe the perturbation to a streamtube. The term q1 re ects the fact that the width of the streamtube is inversely proportional to the mass
ow per unit area. The orientation of the Heaviside step function and Dirac delta function with respect to the streamtube is illustrated in Fig. 2, where the in uence of the perturbation source is depicted as a discontinuity at . The source term that creates this solution is f3 () (x ), where
@ 1 ; f () = q @H (nx Fx + ny Fy ) p ;p; xed 3
o
and (nx ; ny )T is the unit vector in the ow direction at . After some algebra, this reduces to
1 H C 0 C C: 0 C A
0 BB f () = B B@
1 2
3
change in po at xed H; p
The fourth source term is similar to the previous, but involves a perturbation to the stagnation pressure instead of the stagnation enthalpy. Therefore the source term is f4 () (x ) where
: f4 () = q1 @p@ (nxFx + ny Fy ) o H;p; xed
4
1
+ M1 2 ) C 1 x + M2 2 ) C C: 1 y + M2 2 ) C A H ( 1 + 1 2 ) p0
M 1
1
o
H;p xed
:
Thus, at a point x0 (s) on the streamline a distance s downstream of , there is a mass transpiration of strength dm e =ds. The response to this is given by the function u1(x; x0 (s)) and hence the full solution u4(x; ) is
@U (x) u4 (x; ) = H(s)(n) q1 @p o H;p; Z 1 dme 0 ds u1 (x; x (s)) ds: 0 I4 () =
If the linearised functional is of the form (pe; h)@D , then since the static pressure is unaected by this source term I3 () is identically zero.
0 BB up0 ((
f () = B B@ upp0 (
0
(q) (x) me = q1 @@p
The corresponding linearised functional is then
1 2
This may be evaluated to give
However, this is not the full form of the solution u4 because it produces a non-uniform perturbation to the mass ux through the streamtube. Note that this is in contrast to the third source term for the quasi-1D analysis for which the perturbation was at constant Mach number, not constant pressure, and so there was a uniform perturbation to the mass
ux. However, in the 2D case, the pressure must remain xed to maintain pressure equilibrium with neighbouring streamtubes. The linearised mass ux perturbation is given by
Z 1 dme 0
0 ds I1 (x (s)) ds:
This solution has an interesting behaviour near the stagnation streamline upstream of the airfoil. As crosses the stagnation streamline, the integral switches abruptly from being along a streamline passing over the suction surface of the airfoil, to one passing over the pressure surface. Thus, at the very least, one would expect a discontinuity in both u4 (x; ) and I4 () as crosses the stagnation streamline. In fact, there appears to be a singularity at the stagnation streamline, with I4 () being proportional to n 1=2 where n is the distance from the stagnation streamline. To show this it is necessary rst to integrate by parts to obtain
I4 () = [me (s)I1 (x0 (s))]1 0 + 14
Z 1 dI me ds ds: 1
0
In incompressible ow,
2
po = p + q 1 2
and hence
2 1.5
@ ( q ) 1 me = q @p (x) = q1 : o H;p
1
0.5
I1
2
0
Also, the asymptotic form of the streamfunction for 6 6 the incompressible ow at the leading edge stagnation point is sonic line shock = cxy; from which it follows that the ow speed is given by q = jcj r; r2 = x2 + y2 ; and that the minimum distance from a particular Figure 4: Surface plot of I1 resulting from a point mass streamline to the stagnation point is source. −0.5
−1
−1.5
−2 −0.8
2 rmin = c :
−0.6
−0.4
−0.2
0 x
0.2
0.4
0.6
0.8
1 2
0.3
Thus, m e = O(r 2 ) and dIds1 = O(1), and so, integrating along a streamline, 12
0.1
jnj 12 :
0 I4
1 I4 () rmin j j
0.2
If there is a stagnation point at the trailing edge of the airfoil, a similar analysis will apply in the limit as approaches the airfoil surface, producing a singularity whose exponent will depend on the trailing edge wedge angle. Having determined the form of the four source perturbations, it is now possible to verify some of the derived adjoint solution properties by examining an adjoint solution generated using Jameson's 2D Euler design code SYN82 [2]. The linear functional for this calculations was of the form (h; pe)@D , and the individual contributions of the four source perturbations to this functional are depicted in the contour plots of Fig. 3. Figure 3a) shows that I1 () is continuous with a steep gradient near the leading edge just downstream of the sonic line. A discontinuity in the gradient of I1 is noticeable at the shock, but is more clearly seen in the surface line plot in Fig. 4. Figure 3b) con rms that I2 () is also continuous, with a discontinuous gradient at the shock. Figure 3c), which is generated using the same contour increment as the other three gures, con rms that I3 is zero to within the limits of numerical truncation error. Figure 3d) reveals a rapid variation in I4 () as crosses the incoming stagnation streamline. Figure 5
−0.1
−0.2
−0.3
−0.4
0
0.1
0.2
0.3
0.4
0.5 y
0.6
0.7
0.8
0.9
1
Figure 5: Plot of I4 along a line crossing the stagnation streamline upstream of the airfoil as indicated in Fig. 3d. shows the variation along the line upstream of the airfoil indicated in Figure 3d). This con rms a combination of a step change in I4 plus some form of apparent singularity. However, a detailed grid convergence study would need to be performed to verify the predicted inverse square-root nature of this singularity.
4 Conclusions In this paper we have considered a number of mathematical aspects of the formulation and solution of the adjoint equations for compressible ow. The boundary condition analysis has shown that at solid walls the linear functional must be a function of the linearised
15
3a: I1 due to point mass source.
3b: I2 due to point force.
3c: I3 due to stagnation enthalpy perturbation.
3d: I4 due to stagnation pressure perturbation.
Figure 3: Contribution of source terms to the linear functional. Contour increment is 0.04 in all cases.
16
pressure perturbation in the case of inviscid ow, and a [7] J. Elliott and J. Peraire. Aerodynamic design using unstructured meshes. AIAA Paper 96-1941, 1996. function of the normal and tangential forces and some combination of the temperature and heat ux in the case of viscous ows. No other choices lead to a well-posed [8] J. Elliott and J. Peraire. Practical 3D aerodynamic design and optimization using unstructured problem. grids. AIAA Paper 96-4122-CP, 1996. Proceedings of 6th AIAA/NASA/ISSMO Symposium on MulThe construction of Green's functions for the Euler tidisciplinary Analysis and Optimization. equations has revealed the behaviour of the adjoint variables. For a quasi-1D duct there is a logarithmic singularity at a sonic throat, whereas at a shock the ad- [9] W.K. Anderson and V. Venkatakrishnan. Aerodynamic design optimization on unstructured grids joint variables are continuous but the gradient is not. with a continuous adjoint formulation. AIAA PaIn 2D, the Green's function and adjoint variables are per 97-0643, 1997. broken into four components. Two of these correspond to potential ow perturbations for which the adjoint [10] C. Johnson and R. Rannacher. On error control solutions are smooth; this is con rmed by numerical rein CFD. Technical report, Universitat Heidelberg, sults which also reveal strong gradients near the sonic 1994. Preprint No. 94-13. line. The third component involves perturbations to the stagnation enthalpy and produces no perturbation to [11] R. Becker and R. Rannacher. Weighted a posteriori error control in nite element methods. Technithe pressure and hence the associated linear functional cal report, Universitat Heidelberg, 1994. Preprint is zero; this is con rmed by the numerical results. The No. 96-1. fourth component involves perturbations to the stagnation pressure. The analysis reveals the existence of an inverse square-root singularity crossing the incoming [12] I. Babuska and A. Miller. The post-processing approach in the nite element method { part 1: calstagnation streamline, but further numerical investigaculation of displacements, stresses and other higher tion is needed to con rm this. derivatives of the displacements. Intern. J. Numer. Methods Engrg., 20:1085{1109, 1984. Acknowledgments [13] I. Babuska and A. Miller. The post-processing approach in the nite element method { part 2: the This research was supported by EPSRC under recalculation of stress intensity factors. Intern. J. search grant GR/K91149. Numer. Methods Engrg., 20:1111{1129, 1984. [14] D.S. Whitehead. A nite element solution of unsteady two-dimensional ow in cascades. Internat. References J. Numer. Methods Fluids, 10:13{34, 1990. [1] A. Jameson. Aerodynamic design via control the- [15] K.C. Hall. A deforming grid variational principle ory. J. Sci. Comput., 3:233{260, 1988. and nite element method for computing unsteady small disturbance ows in cascades. AIAA Paper [2] A. Jameson and J. Reuther. Control theory based 92-0665, 1992. airfoil design using the Euler equations. AIAA Paper 94-4272-CP, 1994. [16] K.C Hall and W.S. Clark. Linearized Euler predictions of unsteady aerodynamic loads in cascades. [3] A. Jameson. Optimum aerodynamic design using AIAA J., 31(3):540{550, 1993. CFD and control theory. AIAA-95-1729-CP, 1995. [4] A. Jameson, N.A. Pierce, and L. Martinelli. Opti- [17] D.S. Whitehead. The calculation of steady and unsteady transonic ow in cascades. University of mum aerodynamic design using the Navier{Stokes Cambridge, Department of Engineering, 1982. Reequations. AIAA Paper 97-0101, 1997. port CUED/A-Turbo/TR 118. [5] O. Baysal and M.E. Eleshaky. Aerodynamic sensitivity analysis methods for the compressible Euler [18] J.M. Verdon and J.R. Caspar. Development of a linear unsteady aerodynamic analysis for niteequations. J. Fluids. Engrg., 113:681{688, 1991. de ection subsonic cascades. AIAA J., 20:1259{ 1267, 1982. [6] S. Ta'asan, G. Kuruvila, and M.D. Salas. Aerodynamic design and optimization in one shot. AIAA Paper 92-0025, 1992. 17