Adjoint of a median-dual finite-volume scheme Application ... - CiteSeerX

1 downloads 0 Views 642KB Size Report
ing an edge-based structure, such as the vertex-centered median-dual finite volume discretization ... formed from the median dual grid, as described by Barth [4].
Adjoint of a median-dual finite-volume scheme Application to transonic Aerodynamic Shape Optimization

O. Amoignon a , M. Berggren a,b a Division

of Scientific Computing, Department of Information Technology, Uppsala University, Box 337, SE-751 05 Uppsala, Sweden

b Department

of Computational Physics, Division of Systems Technology, FOI, SE-164 90 Stockholm, Sweden

Abstract The sensitivity analysis is a crucial step in algorithms for gradient-based aerodynamic shape optimization. The analysis involves computing the gradient of functionals such as drag, lift, or aerodynamic moments, with respect to the parameters of the design. Gradients are efficiently calculated by solving adjoints of the linearized flow equations. The flow is modeled by the Euler equations of gas dynamics, solved in Edge, a Computational Fluid Dynamics (CFD) code for unstructured meshes. The adjoint equations and expressions for the gradients are derived here in the fully discrete case, that is, the mappings from the design variables to the functional’s values involve the discretized flow equations, a mesh deformation equation, and the parameterization of the geometry. We present a formalism and basic properties that enable a compact derivation of the adjoint for discretized flow equations obeying an edge-based structure, such as the vertex-centered median-dual finite volume discretization implemented in Edge. This approach is applied here to the optimization of the RAE 2822 airfoil and the ONERA M6 wing. In particular, we show a method to parameterize the shape, in 2D, in order to enforce smoothness and linear geometrical constraints.

Key words: Gradient optimization, Inviscid compressible flow, Adjoint equations, Mesh deformation, Constrained geometric parameterization 1991 MSC: 90C06, 90C90, 93C20, 76M12

1

Introduction

1.1 Background The problem of inverse design of airfoils was rigorously formulated and solved by Lighthill [19] using potential flow analysis. In this approach, the velocity or the pressure are prescribed around the airfoil, and the goal is to find its shape. A review of the developments of similar methods can be found in an article by Jameson [16]. There, Jameson also formulated the inverse design as a problem of optimal control governed by partial differential equations. A more general problem than inverse design is to minimize an objective function constrained by the flow state equation, a system of partial differential equations. Gradient-based optimization algorithms are efficient to solve this problem, but the calculation of the gradient may be too expensive if using a perturbation method like finite differences. Solving an adjoint of the linearized flow state equation enables an efficient alternative, as the cost of the gradient calculation is independent of the number of design variables. For an introduction to the use of adjoint equations in optimal shape design of systems governed by elliptic equations, the reader may refer to a book by Pironneau [24]. For an introduction that is particularly focused on aerodynamic shape optimization, we refer to an article by Giles & Pierce [14]. A short review of existing publications on aerodynamic shape optimization [3,5,7– 9,12,13,17,20,21,25,27,29] shows an increasing interest for the efficient gradient computation allowed by the solution of adjoint equations, a procedure called by many authors the adjoint method. 1.2 The present contribution There are two numerical approaches of the adjoint method. In the so-called continuous approach, the adjoint equations and the expressions of the gradients are derived from the Partial Differential Equations (PDEs) that model the flow. The resulting expressions are then discretized. In the other, so-called discrete approach, numerical approximations of the PDEs, objective function, and constraints are carried out prior to the derivation of the adjoint problem, which yields the gradient of the computed objective function and constraints. Gunzburger [15] discusses both methods, and Nadarajah and Jameson [22] compare them on practical examples. The continuous approach [5,13,17,27,29] and the discrete one [3,9,12,21] are equally advocated, but for different reasons. Operating on the PDE level eliminates the discretization from the algorithm and allows to devise the optimization in an infinite-dimensional functional2

space setting. Another argument in favor of the continuous approach that is often given is the complexity involved in formulating the discrete adjoint equations and gradient expressions. We adopt the discrete approach because it gives the gradient of the actual numerical cost function, which is generally not the case when adopting the continuous approach. In addition, the boundary conditions unfold naturally from the derivation of the discrete adjoint fluxes [22]. However, we do not apply the discrete approach on the artificial viscosity fluxes, a ’facilitator’ as called by Gunzburger [15]. An original contribution of this article is the introduction of a formalism in Section 3, which together with Lemma 1, makes the derivation of the discrete adjoint equations and gradient expressions quite compact. The discrete approach is applied here on the unstructured finite-volume discretization that is implemented in the CFD code Edge [11]. Here, the unknowns are associated with the mesh vertices, and the control volumes are formed from the median dual grid, as described by Barth [4]. One merit of unstructured methods is that they can use meshes that are inexpensive to produce even for complicated geometries. This discretization is common in CFD software for it lowers the cost of mesh generation when dealing with complicated geometries. The discrete adjoint approach applied to unstructured finite-volume schemes similar to the one used here can be found in [3,12], and discussions about the development of the adjoint equations in CFD can be found in [14]. However, there is no derivation in those references, unless at an abstract level, of the complete adjoint equations and gradient expressions. In contrast, a particular effort has been made to present proofs for the expressions presented in this report whenever it felt necessary. The calculation of the gradient, based on the solution of the adjoint equations, is summarized below at an abstract level (§1.3). Later in the article, the gradient calculations, with respect to the data of the dual grid, and with respect to the data of the primal grid – the nodal coordinates – are also given explicit formulations. The authors are not aware, to the best of their knowledge, of a similar presentation other than that given in one of our technical reports [1].

1.3 Overview of the discretized optimization problem We give here an abstract presentation of the fully discretized optimization problems such as the ones solved in Sections 6-7. By the finite volume method, the flow domain is replaced by a meshed bounded 3

domain Ω, with boundary ∂Ω. The shape of a portion of ∂Ω, denoted ∂Ωw , will be subject to optimization. We denote by Xh the set of nodal coordinates of the mesh, and a superscript 0 denotes the mesh or other functional values related to the initial design. The objective function is a mapping from a vector of variables of design ah to the real value J. This mapping is a composition of five mappings, which we now describe in sequence: • Parameterization of the shape: ah → dh Consider the mesh node with index i on ∂Ωw . Its coordinates, denoted xi , are related to the initial shape (∂Ω0w ), through the nodal displacements dh = {di }1≤i≤Nw as xi = x0i + di ,

for i ∈ V(∂Ωw ) ,

(1)

where V(∂Ωw ) denotes the set of indexes of the mesh nodes on ∂Ωw . The mapping of the design parameters ah = {ai }1≤i≤N into displacements dh can be formulated as an equation Sh (dh , ah ) = 0 .

(2)

• Mesh deformation: dh → Xh To retain mesh quality, the coordinates of all mesh nodes Xh must be adapted to the displacements dh of the nodes on the part of the boundary being optimized. This is accomplished by a mesh smoother, formulated as the equation Mh (Xh , dh ) = 0 . (3) • Re-calculation of the control volumes/surface vectors: Xh → nh By deforming the mesh we conserve the connectivities between the nodes, but the control volumes of the dual grid and their surface normals nh need to be re-computed. Therefore, nh is a function of the mesh coordinates, which we denote nh ≡ nh (Xh ) . (4) • Solution of the discretized Euler equations: nh → wh As mentioned previously, the program Edge [11] solves the Euler equations on a the dual grid using an edge-based data structure. The discretized Euler equation in steady state can therefore be formulated as a equation 1 where the discrete flow state wh is the solution and nh are the parameters: Rh (wh , nh ) = 0

(5)

• Calculation of the objective function: Xh , nh , wh → J 1

The discretized Reynolds Averaged Navier–Stokes equations also depend explicitly on Xh .

4

Objective function: {wh , nh , Xh } −→ J (wh , nh , Xh ) subject to (5) (Xh = cte) :

nh −→ Jn (nh ) ≡ J (wh (nh ) , nh , Xh )

subject to (4)-(5):

Xh −→ JX (Xh ) ≡ J (wh (nh (Xh )) , nh (Xh ) , Xh )

subject to (3)-(5):

dh −→ Jd (dh ) ≡ JX (Xh (dh ))

subject to (2)-(5):

ah −→ Ja (ah ) ≡ Jd (dh (ah ))

Table 1 Mappings defined by the objective function (7) and equations (2)-(5).

In our applications we seek a reduction of the drag coefficient (CD ) and penalize changes of the lift (CL ) and pitching moment (CM ). The aerodynamic coefficients (CD , CL , CM ) are defined as CD =

X

i ∈ V(∂Ωw ) CL =

X

i ∈ V(∂Ωw ) CM =

pi ni · dD 1 ρ v2 S 2 ∞ ∞ ref

,

pi ni · dL 1 ρ v2 S 2 ∞ ∞ ref

,

(6) 



pi dM · xi − O ref. × ni

X

1 ρ v2 S L 2 ∞ ∞ ref ref

i ∈ V(∂Ωw )

,

were dD = v ∞ /|v ∞ |, v ∞ is the constant velocity of the air, in the far field, dL is a upward oriented unit vector orthogonal to dD , dM is a unit vector orthogonal to dD and dL , pi is the pressure at node i, ni , an element of nh , is the outward-oriented surface normal at the boundary node i, ρ∞ denotes the air density in the far-field, Sref the measure of a reference surface, Lref the measure of a reference length. The objective function reads: 

J (wh , nh , Xh ) =µD CD (wh , nh ) + 12 µL CL (wh , nh ) − CL0 1 µ 2 M



0 CM (wh , nh , Xh ) − CM

2

,

2

+

(7)

where µ are positive scalars. To summarize, the discretized optimization problem is: Find ah that minimizes the objective function (7) subject to the constraints (2)-(5). It will be convenient to use the notations of Table 1. We assume that all functions in expressions (2)-(7), detailed below in this report, are continuously 5

differentiable 2 . The sequence of computations to perform in order to compute the reduced gradient ∇Ja , that is, the gradient of objective function (7) subject to constraints (2)-(5) (see Table 1), is obtained by formulating the sensitivity equations of each of the equations (2)-(5). After some simple algebra it reads: (i) For a given design ah and corresponding mesh Xh (2)-(3), dual grid data nh (4) and discrete flow solution wh (5), compute the adjoint flow solution wh∗ by solving ∂Rh ∂wh

!∗

wh∗

∂J = ∂wh

!T

.

(8)

(ii) Calculate the gradient with respect to the dual grid data ∇Jn and the gradient with respect to the nodal coordinates ∇JX as follows: ∂Rh ∇Jn = − ∂nh dnh ∇JX = dXh

!∗

!T

∂J + ∂nh

!T

,

(9)

∂J ∇Jn + ∂Xh

!T

.

(10)

wh∗

(iii) Solve the adjoint mesh deformation equation: ∂Mh ∂Xh

!∗

X∗h = −∇JX .

(11)

(iv) Calculate the gradient with respect to the shape deformations ∇Jd : ∂Mh ∇Jd = ∂dh

!∗

X∗h .

(12)

(v) Solve the adjoint parameterization equation: ∂Sh ∂dh

!∗

d∗h = −∇Jd .

(13)

(vi) Finally, calculate the reduced gradient: ∂Sh ∇Ja = ∂ah

!∗

d∗h ,

(14)

2

Neglecting the artificial diffusivities used in the solution procedure of the flow equations.

6

where ∗ denotes either the adjoint (transpose) of a linearized vector of residuals or the unknown in an equation involving an adjoint operator. The rest of the presentation is structured as follows. The edge-based formulation of the discretized flow equations (5), as implemented in Edge [11], is presented in Section 2. Section 3 contains the derivation of an edge-based formulation of the adjoint state equation (8) and the expression (9) of the gradient with respect to the dual grid data ∇Jn . Section 4 details how expressions for the dual data nh (4) are obtained from the nodal coordinates Xh and the mesh connectivities, in the order to present the assembly of the gradient with respect to the primal grid data ∇JX , operations (10). A mesh deformation mapping (3) suitable for unstructured meshes, the adjoint equation (11), and the gradient with respect to the deformation of the parameterized boundary (12) are briefly described in Section 5. The parameterization (2), the adjoint equation (13) and the gradient calculation with respect to the parameters of design (14) are presented in Section 6 for the 2D example and in Section 7 for the 3D example. Expressions necessary for the demonstration or for the implementation are detailed in the appendix.

2

Finite volume discretization of the state equations

The system of Euler equations governs the flow of an inviscid compressible fluid and expresses the conservation of mass, momentum, and energy. In steady state, the following integral form holds for any fixed region V with boundary ∂V Z f ·n ˆ dS = 0 , (15) ∂V

where n ˆ is the unit normal, outward oriented, of the control volume V , and f is the 3-by-1 matrix of tensors f = [ρu, ρ u ⊗ u + Ip, u (E + p)]T and n · f = f · n = [ρu · n , ρuu · n + np , Eu · n + p u · n]T ,

(16) (17)

where E, the total energy per unit volume, is related to the pressure p, the density ρ and the velocity u. In the framework of ideal fluids, assuming the law of perfect gas applies, E is given by E=

p 1 + ρu2 . γ−1 2

(18)

In the case of an inviscid fluid, the condition u·n ˆ=0 7

(19)

applies at solid walls. The fluid state in conservative variables is denoted w and is the 3-by-1 matrix w = [ρ, m, E]T ,

where m = ρu .

(20)

Primitive variables are also used at some parts of the presentation and are denoted as the 3-by-1 matrix v = [ρ, u, p]T .

(21)

In order to solve (15)-(19), the flow domain is replaced by a bounded computational domain Ω. Artificial boundary conditions are thus needed, and in the case of external flow, these are usually farfield conditions. Given a meshing of the discrete domain Ω, we will denote by V(Ω) the set of all interior node indexes, V(∂Ω) the set of all boundary node indexes, V(Ω) = S V(Ω) V(∂Ω), Vi the measure of the dual control volume with center at node ~ , and ni the surface normal i, nij the surface normal associated with edge ij associated with the boundary node i ∈ V(∂Ω) (see Figures 1-4). The system of equations (15) is approximated by explicit time marching of the system dwi Vi (22) + Ri = 0, ∀i ∈ V(Ω), dt until the residuals Ri vanish within some tolerance. Here, wi ≈ w (xi ), and the residuals Ri are  X  (nij · fij + dij ) ∀i ∈ V(Ω) , R =  i   j∈Ni X Ri =   (nij · fij + dij ) + ni · fibc ∀i ∈ V(∂Ω) .  Ri = 

(23)

j∈Ni

where Ni is the set of indexes of nodes that are connected to node i with an edge. The residuals may be assembled by a single loop over all edges and a single loop over all boundary nodes [11]. The fluxes on a control surface associated with nij is approximated by fij which in this study is fij =

1 (fi + fj ) 2

with

fi = f (wi ) ,

(24)

giving a central scheme. An artificial dissipation flux dij , a blend of second and fourth-order differences [18], is used in (23): 



(25)

∀i ∈ V(Ω) .

(26)

ij 2 2 dij = ǫij 2 (wi − wj ) + ǫ4 ∇ wi − ∇ wj ,

with ∇2 wi =

X

(wk − wi )

k∈Ni

8

The second-order dissipation is active where pressure gradients are large in order to prevent oscillations in the vicinity of shocks. The fourth-order dissipation is meant to remove oscillating solutions from grid point to grid point while preserving the second-order accuracy of the central scheme away from the shocks. Boundary conditions are weakly imposed through the flux f bc in (23). At node i on a solid wall, applying (19) for computing fi · ni amounts to taking fibc = [0 , Ipi , 0]T

(27)

At node i on a farfield boundary, the fluxes (16) are computed using either the primitive farfield data v∞ for incoming characteristics, or an extrapolation of the primitive variables vi for characteristics leaving the domain of computation, see [11]: fibc = f (vic (ˆ ni )) , c vi (ˆ ni ) = L (ˆ ni , v∞ ) H (λi ) L−1 (ˆ ni , v∞ ) vi + L (ˆ ni , v∞ ) (I − H (λi )) L−1 (ˆ ni , v∞ ) v∞ ,

(28)

where L (ˆ ni , v∞ ) is a matrix of right eigenvectors that diagonalizes the Jacobian matrix of the flux in primitive variables along the outward-directed unit normal n ˆ i , H (λi ) is a diagonal matrix whose diagonal is 0 for negative eigenvalues and 1 for positive ones, and I is the identity matrix. Convergence of (22) until steady-state is accelerated by local time stepping, multigrid, and implicit residual smoothing. The notations used in (5) involve: Rh = {Ri }i∈V(Ω) ,

wh = {wi }i∈V(Ω) ,

and wi = [ρi , mi , Ei ]T ,

(29)

and for the surface normals: h

i

nh = {ni }i∈V(Ω) , {nij }ij∈E(Ω) , ~

(30)

where E(Ω) is the set of oriented edges of the mesh.

3

Adjoint equations and dual grid gradients

To derive an explicit expression for the adjoint equation (8), we need to differentiate and transpose the residual Rh . Section 3.1 introduces an algebra on objects such as the fluid state wh , which will simplify the expressions in the derivation of Section 3.2. We show in Section 3.3 that defining a specific adjoint equation allows to obtain at once all components of the gradient ∇Jn with respect to the dual data. 9

3.1 Inner product and differentiation Let Vw be the vector space of all grid functions like wh (29). If z and q are in Vw , and zi and qi are their components associated with mesh point i, we define the scalar zTi qi by the usual matrix operation, complemented with a dot product for the second element. Moreover, by summing over all nodes V(Ω), we define the inner product X

hz, qi =

zTi qi .

(31)

i∈V(Ω)

The adjoint of a linear operator L : Vw → Vw , denoted L∗ is defined by hz, Lqi = hL∗ z, qi

for all z and q in Vw .

(32)

For f being defined by (16), the Jacobian matrix of f · n with respect to the conservative variable w (20) is "

#

∂(f · n) ∂(f · n) ∂(f · n) ∂(f · n) = , , , ∂w ∂ρ ∂m ∂E

(33)

whose components are given by (A.1) in the appendix. The Jacobian matrix of the same quantity with respect to the primitive variables v (21) is "

#

∂(f · n) ∂(f · n) ∂(f · n) ∂(f · n) = , , , ∂v ∂ρ ∂u ∂p

(34)

and is detailed by (A.2). The Jacobian matrix of the dot product f bc · n denoted ∂(f bc · n)/∂w is given by (A.3) at wall boundaries and by (A.4) at farfield boundaries. The Jacobians above are 3-by-3 matrices in which the elements are zeroth-, first-, and second-order tensors. For q = (q1 , q 2 , q3 )T a 3-by-1 matrix containing tensors of dimensions like the matrix of conservative variables (20), we define the matrix operations T

q

"

#

∂(f · n) , ∂w

"

∂(f · n) ∂w

#T

q,

(35)

in which the component-wise multiplication also includes a dot product for the second element of q. Moreover, the operation qT f = f T q ,

(36)

returning a first-order tensor, may also be defined unambiguously. A dot product is also here involved when multiplying the second component of f and q. 10

3.2 Sensitivities and adjoint fluxes

Sensitivity equations For the ease of the presentation, the residual Rh (29), whose nodal values are defined by expressions (23), is split into a convection and a boundary term: Rh (wh , nh ) ≡ Ph (wh , nh ) + Bh (wh , nh ) ,

(37)

where the artificial dissipation fluxes in (23) are neglected, and where  X   fij · nij  Ph (wh , nh )i =

∀i ∈ V(Ω) , (38)

j∈Ni

   B (w , n ) = f bc · n h h h i i i

∀i ∈ V(∂Ω) and 0 otherwise.

For an arbitrary variation δnh of the dual grid data nh , defined by (30), the first variation of equation (5), defines the flow sensitivities equation ∂Rh ∂Rh δwh = − δnh ∂wh ∂nh

∀δnh ,

(39)

where

 ∂Ph ∂Bh ∂Rh   δwh = δwh + δwh 

and where               

∂wh

∂wh

∂wh

∂nh

∂nh

∂nh

∂Rh ∂Ph ∂Bh    δnh = δnh + δnh , "

∂Ph δwh ∂wh

!

=

∂Bh δwh ∂wh

!

∂(fibc · ni ) δwi = ∂wi

              

i

∂(fj · nij ) ∂(fi · nij ) δwi + δwj ∀i ∈ V(Ω) , 2 ∂wi ∂wj

X 1

j∈Ni

i

∂Ph δnh ∂nh

!

=

∂Bh δnh ∂nh

!

= fibc · δni

i

#

(40)

X

(41)

∀i ∈ V(∂Ω) and 0 otherwise ,

fij · δnij ∀i ∈ V(Ω) ,

j∈Ni

(42) ∀i ∈ V(∂Ω) and 0 otherwise.

i

11

Inner product We form a product like (32) where L = ∂Rh /∂wh and, zh and qh are two arbitrary elements in Vw : +

*

*

+

*

+

∂Ph ∂Bh ∂Rh qh = zh , qh + zh , qh . zh , ∂wh ∂wh ∂wh

(43)

Definition (31) and relations (41) yield that *     zh ,    *     zh ,   

+

"

#

X X 1 ∂(fj · nij ) ∂(fi · nij ) ∂Ph qh = qi + zTi qj , zTi ∂wh 2 ∂w ∂w i j j∈N i i∈V(Ω)

(44)

bc X ∂Bh T ∂(fi · ni ) zi qh = qi . ∂wh ∂wi i∈V(∂Ω)

+

In order to identify the adjoint operator L∗ = (∂Rh /∂wh )∗ , as defined by (32), we must express the double summation in (44) as a sum over all nodes i of a term that can be factorized by qi , that is, a term of the form qTi Gi . The vector Gi will then be the component, at node i, of the adjoint of the convection fluxes ∂Ph /∂wh times the vector zh . Note that the summation involving the Jacobians of the boundary fluxes in (44) can trivially be expressed in that way, simply by transposing the term under the summation, since these are scalars: X ∂Bh ∂(fibc · ni ) zh , qh = qTi ∂wh ∂wi i∈V(∂Ω)

*

Thus

"

+

∂Bh ∂wh

!∗

zh

!

i

∂(fibc · ni ) = ∂wi "

#T

#T

zi =

zi

*

∂Bh ∂wh

!∗

zh , qh

+

,

(45)

∀i ∈ V(∂Ω) and 0 otherwise.

(46) Observe that the double sum on the right side of (44) is of the form X

X

eij ,

i∈V(Ω) j∈Ni

~ Contributions in which eij is an algebraic expression associated with edge ij. ~ occur once for i ∈ V(Ω) when to the double sum associated with edge ij j ∈ Ni and once for j ∈ V(Ω) when i ∈ Nj . Thus, instead of a double sum over all nodes and all neighbors, we may equivalently sum once over all edges, ~ This gives a and add contributions from both nodes associated with edge ij. proof for the following Lemma: Lemma 1 Let G ≡ (V, A) be an oriented graph, in which V is the list of vertices (i) and A is the list of edges (i, j). Let Ni , for each vertex i 6= j in V , 12

be the list of vertices j in V such that there is an edge in A connecting i and j. Given a list of edge-based data {eij , eji }ij∈A , it holds that ~ X X

X

eij =

i∈V j∈Ni

[eij + eji ] .

~ ij∈A

Transposition Denoting by E(Ω) the list of oriented edges and applying Lemma 1 to the double summation in (44), yields *

+

"

X 1 ∂Ph ∂(fj · nij ) ∂(fi · nij ) zh , qh = qi + zTi qj zTi ∂wh 2 ∂wi ∂wj ~ ij∈E(Ω)

#

∂(fj · nji ) ∂(fi · nji ) +zTj qj + zTj qi . ∂wj ∂wi

(47)

Transposing the products vector-matrix-vector and observing that nij = −nji (see §4), we obtain +

*



"

X 1 ∂(fi · nij ) ∂Ph qT qh = zh , i ∂wh 2 ∂wi ~ ij∈E(Ω)

+qTj

"

∂(fj · nji ) ∂wj

#T

#T

(zi − zj ) 

(48)

(zj − zi )

The summation over the edges in (48) is of the same type than the summation on the right side of the identity of Lemma 1, therefore "

+

*

X X 1 ∂(fi · nij ) ∂Ph qh = qTi zh , ∂wh ∂wi j∈Ni 2 i∈V(Ω)

#T

(zi − zj ) .

(49)

from which we may identify the adjoint of the Jacobian of the convective fluxes as ∂Ph ∂wh

!∗

zh

!

i

=

j∈Ni

"

∂(fi · nij ) 2 ∂wi

X 1

#T

(zi − zj )

∀i ∈ V(Ω) .

(50)

Expressions (50) and (46) together define the adjoint of ∂Rh /∂wh , that is, for any zh " !∗ !∗ !∗ # ∂Rh ∂Ph ∂Bh zh ≡ + zh . (51) ∂wh ∂wh ∂wh

13

3.3 Adjoint equation and gradient ∇Jn We denote by wh∗ the adjoint state, that is the steady state solution of the adjoint equation dw∗ Vi i + dt

∂Rh ∂wh

!∗

wh∗

!

= i

∂J ∂wh

!

, for all i ∈ V(Ω) ,

(52)

i

where (∂Rh /∂wh )∗ is defined by (51), (∂J/∂wh ) is given by (A.5) and (A.10)(A.12). The residuals of the adjoint equation (52) have an edge-based formulation, which means that the numerical fluxes associated with (50) can be computed doing one loop over all edges. The artificial dissipation fluxes were not differentiated but the same scheme is used for solving the adjoint equation to steady state. Convergence is obtained by explicit time integration and accelerated by local time stepping, multigrid, and implicit residual smoothing, similarly as for equation (22). Let δwh be the solution of the sensitivity equations (39) given an arbitrary variation δnh , the variation of Jn (see Table 1) is expressed as δJn =

*

+

∂J ∂J , δwh + δnh . ∂wh ∂nh

(53)

Making use of the adjoint equation (52) at steady state, expression (53) is equivalent to !∗ + * ∂J ∂Rh ∗ wh , δwh + δnh , (54) δJn = ∂wh ∂nh which, using the definition (32) of the adjoint, and that δwh and δnh satisfy equation (39), yields δJn = −

*

wh∗ ,

+

∂Rh ∂J δnh + δnh . ∂nh ∂nh

(55)

We replace the product ∂Rh /∂nh with δnh by expressions (42) and use the inner product definition (31) in order to express (55) as X

δJn = −

i∈V(Ω)

wi∗ T

X

j∈Ni

fij · δnij −

X

wi∗ T fibc · δni +

i∈V(∂Ω)

∂J δnh , ∂nh

(56)

where ∂J/∂nh is given by (A.7) and (A.13)-(A.15) in appendix. The components of the gradient ∇Jn are better identified using Lemma (1) together with the fact that nij = −nji (see Section 4), and fij = fji (24) in (56), which yields X 

δJn = −

~ ij∈E(Ω)

wi∗ − wj∗

T

fij · δnij −

X

i∈V(∂Ω)

14

wi∗ T fibc · δni +

∂J δnh . ∂nh

(57)

Expression (57) gives the components of ∇Jn , that is, the operations described by (9).

4

Primal grid gradient

Following the descriptions given in Section 1.3, and using the notations in Table 1, we proceed by computing the gradient of function JX with gradient expression (57) as starting point. For variations δnh due to a variation of the nodal coordinates δXh , obtained by differentiating expression (4), the corresponding variation of the function JX is given by expression (57), plus the explicit partial derivative of J with respect to Xh : δJX = −

X 

~ ij∈E(Ω)

wi∗ − wj∗

T

fij · δnij −

X

i∈V(∂Ω)

∂J ∂J δnh + δXh . + ∂nh ∂Xh

wi∗ T fibc · δni (58)

In order to give expressions that allow an efficient computation of ∇JX we must express δnh from δXh . The surface normals, as described for the median dual grid in [4], are expressed for 2D meshes in Section 4.1 and for 3D meshes in Section 4.2. Given the gradient with respect to the surface normals ∇Jn , application of the chain rule leads to algorithms in Section 4.3 to compute the three first terms in (58). These terms, denoted GX , are the implicit part of the gradient with respect to the nodal coordinates. The partial derivative with respect to the nodal coordinates is given in appendix by (A.9) and (A.16). The gradient of JX is thus: ∂J ∇JX = GX + ∂Xh

!T

.

(59)

4.1 2D dual grid

Let P denote any 2Domesh element (a triangle or a quadrilateral) with mP n vertices xk1 , ..., xkmP , where kl , 1 ≤ l ≤ mP , are nodal indexes, and xkl the d coordinates of node kl (in 2D, d = 2). Let ez be a unit vector, perpendicular to the plane, whose direction defines the ordering of P ’s vertices by the “right15

P2 P3

i

P1 j nij P4

ez

Q1 Fig. 1. In 2D the orientation of one vector ez , perpendicular to the plane of the mesh, gives the orientation of elements vertices P1 , ..., P4 . The median dual grid used by Edge is depicted by dashed lines.

P2

i Q2 P1

ni

Fig. 2. The vertices at boundary edges in 2D are ordered according to the ordering of the interior elements. The dual control volume associated with node i is depicted by dashed lines.

~ be a directed edge of P . We define hand-rule” (Figure 1). Let ij ~ coincides if the orientation of ij γijP~ =  with the orientation given by ez ,   −1 otherwise.    1

(60)

We denote by xP the centroid of the element P and by xij the midpoint of ~ edge ij,  mP  1 X   xP = xk , mP l=1 l (61)    x = 1 (x + x ) . ij i j 2

~ as an edge (that is, two elements Let Eij~ be the set of elements that admit ij for an interior edge and one element for an edge on the boundary). The surface vector nij for this dual mesh [4], is given by nij = −ez ×

X

P ∈Eij ~





γijP~ xP − xij .

(62)

The vertices of a boundary edge E are ordered as the vertices of the interior element P to which it belongs (Figure 2). Let Ei be the set of boundary edges containing node i (that is two). Denoting k1 , k2 the vertices of E, the integrated normal to the dual control face at node i is X 1 ni = − ez × (xk2 − xk1 ) . 2 E∈Ei

(63)

Expressions (60)-(63) give the explicit form of the function (4) in the 2D case. 16

P1

ni

i P4 P3

nij

S2

i

E1

S1

S2

P8

P2

E2

S3

j P5

S1

P6

S4

P7 Fig. 3. The dual grid control surface ~ and contained in attributed to edge ij element P is depicted by the dotted lines.

Fig. 4. The dual grid control surface attributed to boundary node i and contained in the surface element S (vertices S1 , S2 , S3 and S4 ) is delimited by the dotted lines.

4.2 3D dual grid Let P be any 3D element and denote by S1 and S2 the two faces of P sharing ~ The ordering of the vertices of P is matter of convention and, the edge ij. in the case of the hexahedron, Figure 3 respects the convention used by the preprocessor of Edge. It is also a convention to chose the ordering of the faces S1 and S2 , and we chose it to be like in Figure 3. Let xP be the centroid of P , ~ and xS1 , xS2 the centroids of S1 and S2 , respectively. xij the mid-point of ij, ~ is The integrated surface normal associated with edge ij nij =

1 2

X 







xP − xij × xS2 − xS1 ,

P ∈Eij ~

(64)

~ as an edge. A similar expression where Eij~ is the set of elements that admit ij defines the surface vector at the boundary node i, ni . Let S be a surface element on the boundary containing node i. Call E1 and E2 the two edges of S for which i is a vertex. If E1 and E2 are ordered as given by the direction of the outward-directed vector ni (in Figure 4), then ni =

1 2

X 







xS − xi × xE2 − xE1 ,

S∈Ei

(65)

where Ei is the set of surface elements on the boundary that contain node i. Expressions (64)-(65) give the explicit form of the function (4) in the 3D case. 17

4.3 Gradients on the primal grid The relation between the gradients ∇Jn and GX in expression (59) is X

X

(GX )i · δxi =

(∇Jn )ij~ · δnij +

~ ij∈E(Ω)

i∈V(Ω)

X

(∇Jn )i · δni ,

(66)

i∈V(∂Ω)

where, given the mapping Xh → nh , defined in 2D by (62)-(63) and in 3D by (64)-(65), δnij and δni are defined by δnij =

dnij δXh dXh

and δni =

dni δXh dXh

∀δXh .

(67)

4.3.1 Gradient in 2D For an arbitrary δXh , differentiating relations (62)-(63) yields X

δnij = −ez ×





γijP~ δxP − δxij ,

P ∈Eij ~

(68)

X 1 (δxk2 − δxk1 ) . δni = − ez × 2 E∈Ei

Making use of (68) in (66) yields X

(GX )i · δxi = −

X

(∇Jn )ij~ · ez ×





γijP~ δxP − δxij

P ∈Eij ~

~ ij∈E(Ω)

i∈V(Ω)

X



X 1 (∇Jn )i · ez × (δxk2 − δxk1 ) , 2 E∈Ei i∈V(∂Ω) X



(69)

T



where (∇Jn )ij~ = −fij T wi∗ − wj∗ and (∇Jn )i = −fibc wi∗ +∂J/∂ni , according to (57). Using the identities v 1 · v 2 × v 3 = −v 3 · v 2 × v 1 = v 2 · v 3 × v 1 ,

(70)

which hold between three vectors v 1 , v 2 , v 3 in R3 , expression (69) may be written X

i∈V(Ω)

X

(GX )i · δxi =

X



P ∈Eij ~ ~ ij∈E(Ω)

+



γijP~ δxP − δxij · ez × (∇Jn )ij~

1 (δxk2 − δxk1 ) · ez × (∇Jn )i , 2 i∈V(∂Ω) E∈Ei X

X

(71)

which is an edge-based formula for the calculation of GX . An element-based formula is also given in [1]. 18

4.3.2 Gradient in 3D For an arbitrary δXh , relations (64)-(65) yield δnij =

X 

1 2

P ∈Eij ~

+ δni =

1 2

X 

1 2



S

1 2





X 

 



E2

δx − δxi × x

S∈Ei

+



xP − xij × δxS2 − δxS1 ,

P ∈Eij ~

X 



δxP − δxij × xS2 − xS1



E1

−x





(72)



xS − xi × δxE2 − δxE1 .

S∈Ei

Making use of (72) in (66) yields X

(GX )i · δxi =

1 2

X

(∇Jn )ij~ ·

+

1 2

X

(∇Jn )ij~ ·

X

+

1 2

(∇Jn )i ·

+

1 2

X

(∇Jn )i ·

where (∇Jn )ij~ = −fij to (57).



wi∗



wj∗

X 











X 



δxS − δxi × xE2 − xE1 





 

xS − xi × δxE2 − δxE1 ,

S∈Ei

i∈V(∂Ω)



xP − xij × δxS2 − δxS1

S∈Ei

i∈V(∂Ω)

T

X 

P ∈Eij ~

~ ij∈E(Ω)



δxP − δxij × xS2 − xS1

P ∈Eij ~

~ ij∈E(Ω)

i∈V(Ω)

X 

and (∇Jn )i =

T −fibc wi∗ +∂J/∂ni ,

(73) according

Using the identities (70), the relation (73) is rewritten as X

(GX )i · δxi =

1 2

i∈V(Ω)

X

X 

 

P ∈Eij ~ ~ ij∈E(Ω)



1 2

+

1 2



1 2

X

X 

X

X 

 



δxS2 − δxS1 · xP − xij × (∇Jn )ij~

P ∈Eij ~ ~ ij∈E(Ω)

 



δxS − δxi · xE2 − xE1 × (∇Jn )i

i∈V(∂Ω) S∈Ei

X



δxP − δxij · xS2 − xS1 × (∇Jn )ij~

X 

 



δxE2 − δxE1 · xS − xi × (∇Jn )i ,

i∈V(∂Ω) S∈Ei

(74) which is an edge-based formula for the calculation of GX . The equivalent element-based expression is given in [1]. 19

5

Mesh deformation

The mesh deformation (3) is defined here, which also defines the function Jd according to Table 1. After a description of the mesh equation, we detail the calculation of the gradient ∇Jd from ∇JX obtained above, that is, operations (12). The mesh deformation equation (3) is an edge-based smoother suggested in [6]. Recalling that the superscript 0 refers to the mesh at initial design, we will denote by v i ∈ Rd the vector of displacement at node i, kij0 a strictly positive ~ n0ij the normal surface vector associated scalar associated with the edge ij, ~ (see §4), and t0ij the vector x0j − x0i . The set of equations for the mesh to ij deformation is  0 X kij |n0ij |    (v j − v i ) = 0  0    j∈Ni |tij |

∀i ∈ V(Ω) , ∀i ∈ V(∂Ωw ) ,

 v i = di      

(75)

∀i ∈ V(∂Ω) , i 6∈ V(∂Ωw ) ,

vi = 0

where di is the imposed displacement at node i. Note that for constant coefficients kij0 the equation (75) defines one un-coupled system of equations per component in the system of coordinates. The diffusivity kij0 is chosen as kij0 =

1 , |t0ij |

(76)

in order to create a larger diffusion of the displacements along short edges than along long edges. Using matrix and vector notations we rewrite the above system of equations as: 









′′  0  A Cv  , =   dh v′ 0 I

(77)

where v′′ is the vector of all nodal displacements for the interior nodes, v′′ = {v}i∈V(Ω) , v′ is the vector giving the nodal displacements on the boundary, A is the block matrix associated to the interior nodes, C is the block matrix that couples the interior nodes to the boundary nodes and I is the identity block on the boundary. Note that we extended here the definition (1) of the vector of nodal displacements dh to all boundary nodes; this means that di = 0 for i ∈ V(∂Ω) , i 6∈ V(∂Ωw ). The matrix formulation (77) is used here for the sake of the presentation. 20

Solving the adjoint problem (the matrix A is symmetric) Av∗ ′′ = ∇JX ′′ ,

(78)

where v∗ ′′ and ∇JX ′′ denote the interior node values of the adjoint displacements vector and of the gradient with respect to the nodal coordinates, respectively. The expression for the gradient ∇Jd reads ∇Jd = −CT v∗ ′′ + ∇JX ′ ,

(79)

where ∇JX ′ denotes the boundary node values of the gradient with respect to the nodal coordinates. Finally, equations (77) and (78) are solved using a textbook Jacobi preconditioned conjugate gradient algorithm.

6

2D optimization at transonic speed

The shape of the RAE 2822 airfoil is here optimized with respect to the cost function (7) at Mach number M = 0.734, and angle of attack α = 2.19 degrees. The mesh is of medium size, with 13352 nodes in total and 224 nodes on the airfoil. Preliminary tests suggested the choice of the following parameters in (7): µD =

1 0 , 10CD

µL = 

10 2 CL0

,

µM = 

10 0 CM

2 ,

The optimization is performed using a limited memory quasi-Newton algorithm described in this reference [10]. The parameterization is described in Section 6.1 and the results are presented in Section 6.2. 6.1 Parameterization with constraints We briefly describe the airfoil shape parameterization, introduced in [1], which defines (2) and the function Ja (Table 1). Thereafter, the calculation of the gradient ∇Ja from the gradient with respect to the displacements ∇Jd is detailed, that is, the operations (13) and (14) in the introduction.. We allow only displacements normal to the reference shape. The displacements (1) are thus defined by scalars ri , and a unit normal vector n ˆ 0i on the reference shape: di = ri n ˆ 0i ∀i ∈ V(∂Ωw ) . (80) 21

In order to avoid wavy shapes and to impose linear geometrical constraints, the method presented in [1] imposes that the normal displacements ri are solutions of a Karush-Kuhn-Tucker (KKT) system of equation: 









 K −B   rh   Mah     =  , −BT 0 λ −b

(81)

where rh = {ri }i∈V(∂Ωw ) is the vector of normal displacements, K is the stiffness matrix associated with the discretization of d2 /d2 s, denotes the curvilinear coordinates s on the airfoil with homogeneous Dirichlet boundary conditions at the trailing edge. Moreover, M is a mass matrix, the columns of the matrix B are the gradients of the constraints imposed on the displacements (in Rn×mg if n is the size of V(∂Ωw ) and mg is the number of geometrical constraints), b is the vector of values of the constraints (in Rmg ), and, λ ∈ Rmg is a vector of Lagrange multipliers associated with the constraints. In the application presented below, the geometrical constraint is to impose a constant (linearized) cross-sectional area of the airfoil. Denoting by S this area, a variation with respect to the initial design can be written S (rh ) − S0 = −

X

ri |ni | ,

i∈V(∂Ωw )

where we neglected second order terms, and it should be equal to zero (b = 0 in (81)). The coefficients of B (here a vector) are (B)i,1 = −|ni | . Given the gradient of the cost function (7) with respect to the displacements ∇Jd , the components of the gradient with respect to rh , denoted ∇Jr are obtained by (∇Jr )i =

2 X

(∇Jd )i,l n ˆ 0i,l ,

l=1

where the second underscript system of adjoint equations 

 K 

T

refers to l Cartesian coordinate. Solving the

,l



−B   r∗h

−BT 0



λ∗







 ∇Jr    , =

0

(82)

yields the reduced gradient ∇Ja = MT r∗h .

22

(83)

0.9

140

0.8 120

104 CD

0.7 100

0.6 0.5

80

0.4 60 0.3 40

0

10

20 30 iteration

40

0.2

50

0

10

20 30 iteration

40

50

Fig. 5. Pressure drag (square-solid), lift (triangle-solid) and pitching moment (circle-solid) coefficients. The values at initial design are indicated by horizontal lines (solid).

6.2 Results The results are summarized in Table 2. The reduction of the drag is achieved by a smoothing of the shock wave on the suction side, see Figure 6. The changes on the geometry of the airfoil are a reduction of the thickness on the first half of the airfoil, between the leading edge and half the chord length, and an increase of the thickness on the second half of the airfoil. Changes on the pressure side of the airfoil are due to the constraint imposed on the displacement, that is, to conserve the linearized cross sectional area of the wing, as well as to conserve the pitching moment. Note that the variations of lift and pitching moment are less than one percent (Table 2). Moreover, 1.5

0.08

1 0.04

−Cp

y/c

0.5 0

0

−0.5 −0.04 −1 −1.5

0

0.2

0.4

0.6

0.8

1

x/c

−0.08

0

0.2

0.4

0.6

0.8

1

x/c

Fig. 6. Pressure coefficients and shapes at initial (solid) and final design (dash).

comparing the curvature of the optimized shape with the one of the initial geometry (Figure 7) indicates that the parameterization (see §6.1) produces smooth designs. Note that such is the case at each iteration of the optimization 23

104 · CD

CL

CM

Initial

130

8.38 × 10−1 3.42 × 10−1

Optimized

56

8.33 × 10−1 3.42 × 10−1

Table 2 Minimization of the pressure drag of the RAE 2822 at constant linearized volume (cross sectional area) with penalties on the variations of the lift and pitching moment coefficients.

process. 3

10

2

curvature(s/L)

10

1

10

0

10

−1

10

−2

10

0

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 s/L

1

Fig. 7. Curvature distribution in non dimensionalized curvilinear coordinate (s/L) at initial (solid) and final design (dash).

7

3D optimization at transonic speed

The ONERA M6 wing, described in the AGARD report [26], is optimized at Mach number M = 0.8395 and angle of attack α = 3.06o . The parameterization is described in the following Section 7.1 and the results are presented and discussed thereafter in Section 7.2. The optimization is performed using a the BFGS quasi-Newton algorithm with Hessian update [23], combined with a line search. The parameters in (7) were chosen as: µD = 1 ,

µL = 

1 CL0

2 ,

24

µM = 

1 0 CM

2 ,

1

x

0.8

z

θ(y)

n,i

s (y)

y 0.6 0.4

cz (x,y)

0.2 0 0

0.2

0.4

y/L

0.6

0.8

1

Fig. 8. Left: Basis functions (n = 6) for the parameterization of the distributions of twist, camber and thickness, in the spanwise direction (fixed geometry at the root y = 0). Right: a sketch representing effects of the twist (θ (y)) about the trailing edge and of a camber deformation on the parameterized shape.

7.1 Parameterization of the twist, camber and thickness

We detail here what was presented formally in introduction by the operations (2), (13) and (14), for the case of explicit relations defining the mapping ah → dh , the one formulated as a residual equation (2). Functions controlling the camber, denoted c (y), the twist about the trailing edge, denoted θ (y), and the relative distance to the z = 0 plane of the nodes in the z > 0 half domain, denoted d+ (y), and the relative distance to the z = 0 plane of the nodes in the z < 0 half domain, denoted d− (y), are parameterized by a representation in a basis of functions as follows:

c (y) = θ (y) = +

d (y) = d− (y) =

n+1 X

i=1 n+1 X

i=1 n+1 X

i=1 n+1 X

cn,i sn,i (y) , θn,i sn,i (y) , (84) d+ n,i sn,i

(y) ,

d− n,i sn,i (y) ,

i=1

− where cn,i , θn,i , d+ n,i and dn,i are real numbers and sn,i (y) are splines (see

25

Figure 8):            

y sn,i (y) = 3 L hn,i

!2

y −2 L hn,i

!3

, i ≤ n , y ≤ hLn,i ,

!2

y − hLn,i y − hLn,i sn,i (y) = 1 − 3 +2    hR hR  n,i n,i        2 3  y y    sn,n+1 (y) = 3 −2 , y ≤ L, L L

!3

, i ≤ n , hLn,i ≤ y ≤ L ,

(85)

where L is the span width and:

 L R   hn,i + hn,i =L ,  

hLn,i =

iL . n+1

(86)

The leading and trailing edges are lines in the plane z = 0. The streamwise coordinate is x, and we denote by xT (y) the x-coordinate of the point on the trailing edge, respectively, xL (y) the x-coordinate of the point on the leading edge, at coordinate y in the spanwise direction. Thus the x- and z- coordinates of any point on the parameterized geometry, denoted with upperscript new , in the section y of the wing is mapped here from the reference geometry, denoted (x, z), and the parameters of the camber and twist (84) as: y new = y , !2

x4 − x2 , (scaling) c˜ (y) = c (y) xT (y) − xL (y) cz (x, y) = c˜ (y) (x − xT (y)) (xL (y) − x) , 1 , nz (x, y) = q 2 2 1 + c˜ (y) (xT (y) + xL (y) − 2x) nx (x, y) = c˜ (y) nz (x, y) (2x − xT (y) − xL (y)) , new x (x, y) = xT (y) + cos (θ (y)) (x + znx (x, y) − xT (y)) + sin (θ (y)) (cz (x, y) + znz (x, y)) , new z (x, y) = −sin (θ (y)) (x + znx (x, y) − xT (y)) + cos (θ (y)) (cz (x, y) + znz (x, y)) .

(87)

In (87), cz (x, y) parameterizes a camber ’line’ at constant y, and (nx (x, y) , nz (x, y)) are the coordinates of the unit normal vector to this camber line. We denoted by x4 , respectively x2 , the streamwise coordinate of the leading edge, respectively the trailing edge, at the tip of the wing. The parameterization (84)-(87) is called ’CT’ in the following. Adding the thicknesses, to the camber and the 26

twist parameterizations yields: 





z˜ (x, y) = 1 − ω sin d+ (y) 





z˜ (x, y) = 1 − ω sin d− (y) new

z , if z ≥ 0 z , if z ≤ 0

(x, y) = xT (y) + cos (θ (y)) (x + z˜ (x, y) nx (x, y) − xT (y)) + sin (θ (y)) (cz (x, y) + z˜ (x, y) nz (x, y)) , new z (x, y) = −sin (θ (y)) (x + z˜ (x, y) nx (x, y) − xT (y)) + cos (θ (y)) (cz (x, y) + z˜ (x, y) nz (x, y)) ,

x

(88)

where cz , nx , nz are calculated as in (87), and ω = 0.3 is used to bound the changes of thickness. In the following the parameterization (84)-(88) is called ’TCT’. In the present case, the gradient ∇Ja is obtained by applying the chain rule: ∇Ja =

ddh dah

!T

∇Jd ,

(89)

where the Jacobian matrix can be obtained at a cost that is negligible in regard to, say, the mesh deformation, if using a perturbation technique. The present technique involves complex arithmetic [28], which avoids the round-off errors of finite differences methods, while producing derivative approximations to almost machine precision.

In the following CT refers to the tests where the wing is parameterized in terms of the camber and twist distributions, and TCT refers to the parameterization in terms of the thicknesses, the camber and the twist distributions. The extension ’-3s’, for example, refers to a parameterization with n = 3 in (84).

7.2 Results

The gradients of the drag, lift and pitching moment coefficients, obtained by the method of adjoints, are compared to finite differences approximations. For clarity of presentation, the results shown in Figure 9 are for the components relative to the twist, but the behavior is the same for components relative to the camber and the thicknesses parameters. The method of finite differences, used here to give an approximation of the exact gradient, suffers from round-off errors for too small perturbation parameters and inaccuracy for too large perturbation parameters. The results indicate however that the adjoint gradients are accurate with at most one percent error. 27

C : adj. vs FD sensitivities w.r.t twist

C : adj. vs FD sensitivities w.r.t twist

L

D

−1

−1

10

relative error

relative error

10

−2

10

−3

−3

10 −6 10

−2

10

−4

10 −6 10

−2

10 10 perturbation

−4

−2

10 10 perturbation

C : adj. vs FD sensitivities w.r.t twist M

−1

relative error

10

−2

10

−3

10

−4

10 −6 10

−4

−2

10 10 perturbation

Fig. 9. Comparison finite difference approximations against adjoint method, of the derivatives with respect to parameters of the twist distribution for the case n = 3: θ3,1 (circles), θ3,2 (squares), θ3,3 (crosses), θ3,4 (triangles).

The results of the optimizations are summarized in Table 3. Figures 10-13, show the pressure coefficients and sections of the re-designed wings, at locations indicated in % of wingspan, where 0 is at the root and 100 is at the tip. Note that the data used in these plots are obtained by interpolation in the cutting plane from computed pressures at nodes that do not always lay in the plane, as we use an unstructured mesh. In Figure 14 the pressure iso-surfaces and a number of streamlines are plotted in order to illustrate important features of the flow before and after optimization, such as the strength of the shocks on the suction side and the vortex at the tip. The common trends are illustrated by the examples of results shown in the figures. The reduction of the drag is achieved in all cases by a weakening of the shocks and of the lift-induced drag. In particular, in Figure 14, we observe a downstream shift of the wingtip vortex, more pronounce as the parameterization is finer (larger n in (84)). The same behavior has been observed for all the tests. In Figure 10 and 11 we compare the results obtained for n = 1 from the CT 28

0 = 144 C 0 = 0.331 CD L

104 .∆CD

∆CL /CL0

0 = 0.113 CM

J 0 = 0.0144

0 ∆CM /CM

∆J/J 0

CT-1s

−25

−1.406E − 02 2.984E − 03 −1.572E − 01

CT-2s

−27

−1.051E − 02 9.323E − 04 −1.812E − 01

CT-3s

−29

−8.323E − 03 −3.716E − 04 −1.931E − 01

CT-4s

−28

−7.842E − 03 −6.184E − 04 −1.915E − 01

CT-5s

−29

−8.643E − 03 −1.937E − 04 −1.928E − 01

CT-6s

−29

−8.542E − 03 −4.367E − 04 −1.951E − 01

TCT-1s

−30

−1.633E − 02 1.376E − 03 −1.927E − 01

TCT-2s

−32

−1.285E − 02 3.627E − 03 −2.113E − 01

TCT-3s

−31

−8.430E − 03 8.615E − 05 −2.075E − 01

TCT-4s

−31

−1.089E − 02 −2.345E − 03 −2.035E − 01

TCT-5s

−31

−9.962E − 03 1.397E − 03 −2.078E − 01

TCT-6s

−31

−1.162E − 02 −1.803E − 04 −2.091E − 01

Table 3 Variations in comparison to the values at initial design, of the drag, in drag counts (104 .CD ), lift (CL ), and pitching moment (CM ) coefficients, and of the objective function (J). The results are shown for the parameterizations CT (camber and twist) and TCT (thickness, camber and twist), varying the number of splines in the spanwise direction.

and TCT tests to the initial design. The optimized designs are significantly different due to the addition of the thickness parameters in the case TCT-1s in comparison with CT-1s. For TCT-1s, the pressure coefficients at more than 50% from the root exhibit weaker shocks after optimization. Near the root (at 20% and 44% of the wingspan on the figures), the second shock, at around half of the chord length in Figure 10, is significantly weakened for the TCT design compared to the CT design, which seems to be obtained by a thinning of the wing at those locations (Figure 11). From the Table 3 we notice that, for all cases, the addition of the thicknesses improves the reduction of the cost function (J), but that differences are smaller if the number of degrees of freedom is larger. Indeed, the behavior varies a bit for cases with a larger number of design variables (n > 1) as the differences between the designs are less visible. The common behavior is the one given in Figures 12 and 13 by the pressure coefficients and the shapes of the TCT-6s case. That is, under 40% of the span, the local angle of attack is increased, as well as the average curvature of the pressure side, while the average curvature on the suction side is decreased. 29

The opposite changes occur at spanwise positions larger than 50% and tend to be maximum at the tip.

8

Summary and outlook

The derivation of the adjoint of the Euler equations has been given in details for the case of an edge-based discretization. Expressions of the gradient, based on the discrete adjoint method, was given with respect to the data that describe the computational grid (dual grid ), and with respect to all the coordinates of the mesh (primal grid ). The latter is the result of applying the chain rule and using that the dual grid data (nh ) are differentiable functionals of the nodal coordinates. This exact transformation, from the gradient with respect to the dual data to the gradient with respect to the primal data, is executed at a cost of one loop over all edges. The implementation of this algorithm (see Section 4) depends on the dimension of the physical space (2D or 3D) but not on the shape of the elements or on the type of the discretized flow equations. It is therefore a worthy investment for future developments using the same type of discretization. All of these expressions were applied to the aerodynamic optimization of an airfoil, in 2D, and of a wing, in 3D. There, the optimal control approach, at the discrete level, involves the unstructured finite volume method for the flow equations, the mesh deformation equation and, for the 2D example, a variational formulation to parameterize the shape with constraints. The design optimization of the airfoil at transonic speed involved more than 200 design variables, and succeeded to reduce the drag while preserving the coefficients of lift and pitch of the initial design, the RAE 2822. The method of parameterization enabled to keep constant the linearized cross-sectional area while ensuring the smoothness of each design during the optimization without explicit reduction of the size of the design space. The optimization of the wing (ONERA M6) at transonic flow conditions similarly succeeds to reduce the drag at constant lift and pitching moment, using a parameterization with splines of the camber, twist, and thickness in the spanwise distribution. Concerning the type of applications, the programs developed here have been used elsewhere for multi-point optimization (optimizing simultaneously at different flight conditions) or coupled to other equations involving the modeling of multi-physics or multi-scale phenomena, as presented in [1] and [2]. 30

Acknowledgements Funding from the Parallel and Scientific Computing Institute (PSCI) is greatly acknowledged. This research has received support from the AEROSHAPE project funded by the European Commission, DG Research, under the GROWTH initiative (Project Ref: GRD1-1999-10752). The authors are thanksfull for the comments and suggestions of Per Weinerfelt, Per L¨otstedt and Adam Jirasek.

31

1

0.5

0.5

−Cp

−Cp

1

0 −0.5 −1

20% 0

0.2

0.4

0.6

0.8

0 −0.5 −1

1

44% 0

0.2

0.4

1

1

0.5

0.5

0 −0.5 −1

0.2

0.4

0.6

0.8

−1

1

0.2

0.4

1 0.5

−Cp

−Cp

1

0 −0.5 0.4

0.6

0.8

0.6

0.8

0 −0.5

90% 0.2

1

x/c

0.5

0

0.8

80% 0

x/c

−1

0.6

1

0 −0.5

65% 0

0.8

x/c

−Cp

−Cp

x/c

0.6

−1

1

95% 0

0.2

0.4

x/c

1

x/c

0.1

0.1

0.05

0.05 z/c

z/c

Fig. 10. Pressure coefficients at initial design (line), optimized design CT-1s (dots) and TCT-1s (dashed line).

0 −0.05 −0.1

−0.05

20% 0

0.2

0.4

0.6

0.8

0

−0.1

1

44% 0

0.2

0.4

0.1

0.1

0.05

0.05

0 −0.05 −0.1

0.2

0.4

0.6

0.8

−0.1

1

80% 0

0.2

0.4

0.1

0.1

0.05

0.05

0 −0.05 0.2

0.4

0.8

1

0.6

0.8

0 −0.05

90% 0

0.6 x/c

z/c

z/c

x/c

−0.1

1

0 −0.05

65% 0

0.8

x/c

z/c

z/c

x/c

0.6

−0.1

1

x/c

95% 0

0.2

0.4

0.6

0.8

1

x/c

Fig. 11. Initial design (line), optimized design CT-1s (dots), TCT-1s (dashed line).

32

1 0.5

−Cp

−Cp

1 0.5 0 −0.5 −1

20% 0

0.2

0.4

0.6

0 −0.5

0.8

−1

1

44% 0

0.2

0.4

1

1

0.5

0.5

0 −0.5 −1

0.2

0.4

0.6

0.8

−1

1

0.2

0.4

1 0.5

−Cp

−Cp

1

0 −0.5 0.4

0.6

0.6

0.8

0 −0.5

90% 0.2

1

x/c

0.5

0

0.8

80% 0

x/c

−1

0.6

1

0 −0.5

65% 0

0.8

x/c

−Cp

−Cp

x/c

0.6

0.8

−1

1

95% 0

0.2

0.4

x/c

1

x/c

0.1

0.1

0.05

0.05 z/c

z/c

Fig. 12. Pressure coefficients at initial design (line), optimized design TCT-1s (dots) and TCT-6s (dashed line).

0 −0.05 −0.1

−0.05

20% 0

0.2

0.4

0.6

0.8

0

−0.1

1

44% 0

0.2

0.4

0.1

0.1

0.05

0.05

0 −0.05 −0.1

0.2

0.4

0.6

0.8

−0.1

1

0.05

0.05 z/c

z/c

0.1

0 −0.05

0.2

0.4

0.4

1

0.6

0.8

0 −0.05

90% 0.2

0.8

80% 0

x/c

0.1

0

0.6

1

0

x/c

−0.1

0.8

−0.05

65% 0

0.6 x/c

z/c

z/c

x/c

−0.1

1

x/c

95% 0

0.2

0.4

0.6

0.8

1

x/c

Fig. 13. Initial design (line), optimized design TCT-1s (dots), TCT-6s (dashed line).

33

Fig. 14. Pressure iso-surfaces and particle tracing around the original design (top). In the left column, from the second row to the bottom, the optimized designs TCT-1s, TCT-3s, and TCT-6s. In the right column in grey (dark grey in BW) the shape at initial design and in yellow (light grey in BW) the optimized shape. Note the weakened shock and the downstream shift of the tip vortex for the optimized designs in comparison with the original design.

34

A

Jacobians and partial derivatives

The relation (18) between the total energy per unit volume E, the pressure p and the velocity u was used for deriving the following expressions. In conservative variables: 



0





 ∂(f · n)  2  = ,  −u · n u + n(γ − 1) |u| 2   ∂ρ   2 n · u (−γE/ρ + (γ − 1)|u| ) 

  ∂(f · n)  =  ∂m  

n

   u · n I + u ⊗ n − (γ − 1)n ⊗ u  , !  |u|2 

γnE/ρ − (γ − 1) n · u u +





2

(A.1)

n



0    ∂(f · n)    . = (γ − 1)n ∂E   γu · n

In primitive variables:  

u·n

 

 ∂(f · n)    u · nu  , =   ∂ρ   1 2 |u| u · n 2 



ρn    ∂(f · n)     , = ρu · n I + ρu ⊗ n   ∂u   2 1 ρu · n u + 2 ρ|u| n + γpn 



 0   ∂(f · n)   =  n .   ∂p   γu · n

At a wall boundary

(A.2)





0 0 0    ∂(f bc · n) 1  2 = (γ − 1)  . |u| n −n ⊗ u n 2   ∂w   0 0 0

At a farfield boundary (unless one of the eigenvalues vanish):

35

(A.3)





∂ f bc · n ∂w

=

∂ (f · n) dv L (ˆ n, v∞ ) H (λ) L−1 (ˆ n, v∞ ) , c ∂v dw

(A.4)

where ∂ (f · n) /∂vc is obtained by evaluating (A.2) at v = vc given by (28), and dv/dw is the usual Jacobian of the mapping v → w. In the following expressions, used in the definition of the adjoint of the Euler equations and in the gradient calculation, the index i is one of the nodes on the wing or the airfoil (i ∈ V(∂Ωw )): ∂J ∂wh

!

∂CD ∂wh

= µD

i

!



+ µL CL −

i



+µM CM − ∂J ∂nh

!

= µD

i

∂CD ∂nh

!



= µM CM − i

Noting qi = ∂CD ∂wh

!

∂CL ∂wh





0 CM

0 CM

T

1 |ui |2 , −ui , 1 2

γ−1



i

+µM CM − !

0 CM

!

∂CM ∂wh



∂CM ∂nh

∂CL ∂wh

!

(A.5) i

,

(A.6)

!



∂CL ∂nh

!

(A.7) i

(A.8)

i

!

(A.9)

· dD ,

(A.10)

· dL ,

(A.11)

∂CM ∂Xh





i

+ µL CL − CL0



∂J ∂Xh

CL0

i

,

=

qi ni 1 ρ |u |2 Sref 2 ∞ ∞

!

=

qi ni 1 ρ |u∞ |2 Sref 2 ∞

∂CM ∂wh

!

=

  γ−1 q d · x − O i M i 1 ref × ni , ρ |u∞ |2 Sref Lref 2 ∞

(A.12)

∂CD ∂nh

!

=

pi dD 1 ρ |u |2 Sref 2 ∞ ∞

,

(A.13)

∂CL ∂nh

!

=

pi dL 1 ρ |u∞ |2 Sref 2 ∞

,

(A.14)

i

i

i

i

∂CM ∂nh

i

!

i

=

γ−1

  pi d × x − O M i 1 ref , ρ |u∞ |2 Sref Lref 2 ∞

36

(A.15)

∂CM ∂Xh

!

i

=

pi ni 1 ρ |u∞ |2 Sref Lref 2 ∞

× dM ,

(A.16)

References [1] O. Amoignon, Adjoint-based aerodynamic shape optimization, Tech. Report IT Licentiate theses 2003-012, Department of Information Technology, Division of Scientific Computing, Uppsala University, Box 337, SE-751 05 Uppsala, Sweden, October 2003. [2] O. Amoignon, Jan O. Pralits, A Hanifi, M. Berggren, and D.S. Henningson, Shape optimization for delay of laminar-turbulent transition, Accepted for publication in AIAA Journal (2005). [3] W.K. Anderson and D.L. Bonhaus, Airfoil design on unstructured grids for turbulent flows, AIAA Journal 37 (1999), no. 2, 185–191. [4] T.J. Barth, Aspects of unstructured grids and finite-volume solvers for the Euler and Navier–Stokes equations, Special Course on Unstructured Methods for Advection Dominated Flows, AGARD Report 787, May 1991, pp. 6–1–6–61. [5] O. Baysal and K. Ghayour, Continuous adjoint sensitivities for optimization with general cost functionals on unstructured meshes, AIAA Journal 39 (2001), no. 1, 48–55. [6] M. Berggren, Edge-based mesh movement strategies, 2003, Unpublished preprint, Sandia National Laboratories. [7] F. Beux and A. Dervieux, Exact-gradient shape optimization of a 2D Euler flow, Tech. Report RR-1540, INRIA Sophia Antipolis, 2004 Route des Lucioles, 06360 Valbonne, France, 1991. [8] G. Bugeda and E. O˜ nate, Optimum aerodynamic shape design for fluid flow problems including mesh adaptivity, Int. J. Numer. Meth. Fluids 30 (1999), 161–178. [9] G.W. Burgreen, O. Baysal, and M.E. Eleshaky, Improving the efficiency of aerodynamic shape optimization, AIAA Journal 32 (1994), no. 1, 69–76. [10] R.H. Byrd, P. Lu, J. Nocedal, and C. Zhu, A limited memory algorithm for bound constrained optimization, Tech. Report NAM-08, Northwestern University, Department of Electrical Engineering and Computer Science, Evanston Il 60208, 1994. [11] P. Eliasson, Edge, a Navier–Stokes solver, for unstructured grids, Tech. Report FOI-R–0298–SE, Swedish Defence Research Agency, Stockholm, November 2001.

37

[12] J. Elliot and J. Peraire, Aerodynamic design using unstructured meshes, AIAA Paper (1996), no. 96-1941. [13] O. Enoksson and P. Weinerfelt, Numerical methods for aerodynamic optimization, 8th International Symposium on Computational Fluid Dynamics (Bremen), September 1999. [14] M.B. Giles and N.A. Pierce, An introduction to the adjoint approach to design, Flow, Turbulence and Combustion 65 (2000), 393–415. [15] M.D. Gunzburger, Perspectives in flow control and optimization, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2002. [16] A. Jameson, Aerodynamic design via control theory, Journal of Scientific Computing 3 (1988), 233–260. [17] A. Jameson and S. Kim, Reduction of the adjoint gradient formula for aerodynamic shape optimization problems, AIAA Journal 41 (2003), no. 11. [18] A. Jameson, W. Schmidt, and E. Turkel, Numerical solution of the Euler equations by finite volume methods using Runge-Kutta time stepping schemes, AIAA Paper (1981), no. 81-1259. [19] M.J. Lighthill, A new method of two-dimensional aerodynamic design, Tech. report, ARC, 1945. [20] B. Mohammadi, A new optimal shape procedure for inviscid and viscous turbulent flows, Int. J. Numer. Meth. Fluids 25 (1997), 183–203. [21] S.K. Nadarajah, The discrete adjoint approach to aerodynamic shape optimization, Ph.D. thesis, Aeronautics and Astronautics Department, University of Stanford, 2003. [22] S.K. Nadarajah and A. Jameson, Studies of the continuous and discrete adjoint approaches to viscous automatic aerodynamic shape optimization, AIAA Paper (2001), no. 2001-2530. [23] J. Nocedal and S. Wright, Numerical optimization, Springer Series in Operations Research, 1999. [24] O. Pironneau, Optimal shape design for elliptic systems, Springer Verlag, 1984. [25] J. J. Reuther, A. Jameson, J. J. Alonso, M. J. Rimlinger, and D. Saunders, Constrained multipoint aerodynamic shape optimization using an adjoint formulation and parallel computers, part 1, J. Aircraft 36 (1999), no. 1, 51– 60. [26] V. Schmitt and F. Charpin, Pressure distributions on the ONERA-M6-WING at transonic mach numbers, Experimental Data Base for Computer Program Assessment, AGARD-AR-138, May 1979, pp. B1–1–B1–44. [27] B.I. Soemarwoto, Multi-point aerodynamic design by optimization, Ph.D. thesis, Delft University of Technology, Faculty of Aerospace Engineering, P.O. Box 5058, 2600 GB Delft, Netherlands, 1996.

38

[28] W. Squire and G. Trapp, Using complex variables to estimate derivatives of real functions, SIAM Review 40 (1998), no. 1, 110–112. [29] C. Sung and J.H. Kwon, Accurate aerodynamic sensitivity analysis using adjoint equations, AIAA Journal 38 (2000), no. 2, 243–250.

39

Suggest Documents