On an Exact Step Length in Gradient-Based Aerodynamic Shape Optimization—Part II: Viscous Flows

: This study presents an extension of a previous study (On an Exact Step Length in Gradient-Based Aerodynamic Shape Optimization) to viscous transonic ﬂows. In this work, we showed that the same procedure to derive an explicit expression for an exact step length β exact in a gradient-based optimization method for inviscid transonic ﬂows can be employed for viscous transonic ﬂows. The extended numerical method was evaluated for the viscous ﬂows over the transonic RAE 2822 airfoil at two common ﬂow conditions in the transonic regime. To do so, the RAE 2822 airfoil was reconstructed by a Bezier curve of degree 16. The numerical solution of the transonic turbulent ﬂow over the airfoil was performed using the solver ANSYS Fluent (using the Spalart–Allmaras turbulence model). Using the proposed step length, a gradient-based optimization method was employed to minimize the drag-to-lift ratio of the airfoil. The gradient of the objective function with respect to design variables was calculated by the ﬁnite-difference method. Efﬁciency and accuracy of the proposed method were investigated through two test cases.


Introduction
The advent of computers of ever-increasing power, speed, and memory capacity over the past decades has enabled the development of various aerodynamic shape optimization algorithms which rely on combining computational fluid dynamics with numerical optimization methods. Among the optimization methods commonly used in aerodynamic shape optimization problems are gradient-based methods such as the steepest descent, conjugate gradient, and quasi-Newton methods. In these methods, the calculation of two variables (1) direction of descent and (2) step length are needed during the iterative process to update the current solution. The direction of descent determines the direction along which the value of the underlying objective function is reduced and is obtained from the calculation of the gradient of the objective function. The step length specifies the distance that the updated solution should move in the direction of descent to reduce the objective function as efficiently as possible. The effectiveness of a gradient-based aerodynamic shape optimization problem relies very much on the accuracy of the calculation of these two variables. In aerodynamic shape optimization problems, the finite-difference method and the adjoint method are two methods to calculate the gradient of the objective function with respect to design variables. In this study, the central finite-difference method was used to calculate the gradient. The inexact step length used in the aerodynamic shape optimization was calculated using line search or trust-region methods and was chosen so that some conditions, such as the Wolfe conditions, could be satisfied [1]. In [1], the authors proposed an exact step length in aerodynamic shape optimization problems for inviscid transonic flow over an airfoil. The main objective of this study was to extend the derived expression for the exact step length in inviscid flows to the viscous flows. In this work, the RAE 2822 airfoil was used to assess the accuracy and efficiency of the proposed gradient-based shape optimization method due to widespread use of this airfoil in transonic turbulent flows [2][3][4][5][6][7][8][9]. As the state-of-the-art in aerodynamic shape optimization was presented in some detail in the first part of this work [1], in this paper we only state some papers dealing with the shape design optimization of the RAE2822 at the flow conditions of interest in this work. The aerodynamic shape optimization of the RAE 2822 airfoil in some of the above literature is as follows: In [2], a different number of design variables (vertical movements of the free-form deformation (FFD) control points and the angle of attack) ranging from 8 to 52 and Cand O-type structured grids were used to reduce the drag on the airfoil satisfying some constraints. The adjoint method was used to compute the derivatives of objective and constraint functions with respect to large numbers of design variables. In [3], the airfoil was reconstructed using B-spline and the flow domain was meshed using a structured multi-block grid. Then the B-spline control points and angle of attack were considered as design variables in the problem of the drag reduction under some constraints including lift. The gradient of the objective function (drag) was computed by the adjoint method and the sequential quadratic programming (SQP) was employed to solve the constrained minimization problem. In [4], the angle of attack and the deformation of certain pilot points along the airfoil surface were considered as the design variables. The reduction of the drag was considered as the objective function and the adjoint method was used to compute the gradient of the objective function with respect to the design variables. In [5], the airfoil was parameterized with a different number (ranging from 16 to 48) of control points of a third-order B-spline. The B-spline control points and angle of attack were considered as design variables. The constrained optimization of the drag reduction under the specified constraints was defined by a quadratic penalty equation as an objective function. Sparse nonlinear optimizer (SNOPT) was employed to minimize the objective function and the gradient was solved by an adjoint solver. In [6], a class-shape function transformation (CST) method of the order 8 was employed to parameterize the airfoil. The conformal transformation was used to mesh the flow domain. Using 18 design variables and based on surrogate models for the objective function (drag) and constraints, a so-called "multi-round optimization strategy" (with a total cost of 592 CFD calls for global optimization) was used to find the global optimal solution. In [7], an aerodynamic shape optimization code, Jetstream, was used to minimize the airfoil drag satisfying certain constraints. A C-type structured grid was used and the y-coordinates of the B-spline surface control points (ranging from 7 to 37 on the top and bottom surfaces of the airfoil) or FFD control points (ranging from 5 to 37 on the top and bottom surfaces of the airfoil), as well as the angle of attack, were considered as design variables. The discrete-adjoint method was used to compute the gradients and the sequential quadratic programming was employed to minimize the objective function.
The remainder of this paper is organized as follows: The RAE 2822 airfoil was parameterized using a Bezier curve of degree 16 (for either of the upper and lower surfaces). Some of the Bezier curve control points were considered as design variables. The flow domain was meshed using the O-type structured hyperbolic grid generation method and the flow equations were solved using the CFD solver ANSYS Fluent. The square of the drag-to-lift ratio was considered as an objective function. The gradient-based quasi-Newton method was used to minimize the objective function. An explicit expression was derived for the step length needed in the iterative process to update the solution. The gradient of the objective function with respect to the design variables was calculated by the central finite-difference method.

Governing Equations
Viscous flows were governed by the Navier-Stokes equations. If body forces and volumetric heating were negligible, the 2D steady-state Navier-Stokes equations may be written as: ∂F ∂x where the flux vectors F and G are as follows: where u and v are the components of the velocity vector V = ui + vj (i and j are the unit vectors in x and y directions, respectively), p is the pressure, ρ is the density, V = √ u 2 + v 2 is the scalar magnitude of the velocity vector of the fluid flow V, T is the temperature, k T is the thermal conductivity, e is the internal energy, and τ is the shear stress. In transonic turbulent flows, the numerical solution of the full Navier-Stokes equations is prohibitively expensive to adequately resolve time and length scales of the turbulence. The Reynolds-averaged Navier-Stokes (RANS) equations with a turbulence model can be used to reduce the prohibitively high computational cost of the numerical solution and simulate the turbulent flows efficiently. The RANS equations are based on the decomposition of the flow variables into a time-averaged (mean) and fluctuating part. The averaging method results in the equations for the time-averaged part which are of the same form as the original Navier-Stokes equations plus fluctuating quantities known as Reynolds stresses. In turbulence modeling, the Reynolds stresses are related to the time-averaged velocity gradients or time-averaged strain rate tensor through introducing the turbulent eddy viscosity concept. The Spalart-Allmaras (S-A) one-equation turbulence model [10] is one of the most popular turbulence models which was developed specifically for aerospace applications and is widely used in computations of turbulent flows around wings and airfoils. The S-A model is robust, converges fast, and can be easily implemented on structured and unstructured grids with moderate grid resolution requirements in the near-wall region [11]. In this study, the software ANSYS Fluent (V19.2) was used to solve the RANS equations along with the S-A turbulence model in order to compute the drag and lift forces acting on the RAE 2822 airfoil. Here, the viscous flows over the transonic RAE 2822 airfoil at two common flow conditions in the transonic regime were considered. These two flow conditions were referred to as Case 6 (corrected) and Case 9 (corrected) in [12], respectively, and have been extensively used to validate the numerical results from the solution of the RANS equations applied to viscous transonic flows over the RAE 2822 airfoil. The two flow conditions are as follows ( Figure 1): Test case I (Case 6 [12]): • Test case II (Case 9 [12]): where M ∞ and α are the free stream Mach number and the angle of attack, respectively.

Airfoil Parameterization
In [1], a Bezier curve of degree 10 was used to parameterize the shape of a NACA 0012 airfoil in steady inviscid transonic flow. In this study, however, since we dealt with a more complicated airfoil shape, a Bezier curve of degree 16 (17 control points) was used to construct the upper and lower surfaces of the RAE 2822 airfoil separately. The Bezier curve is mathematically defined as: where: where is the Bernstein basis polynomial of degree n (in this study, = 16 n ), Î x andy coordinates of the predetermined data points on the airfoil surface. The increase in the degree of a Bezier curve has advantages and disadvantages which should be recognized: Advantage: It improves the flexibility of the Bezier curve, thereby increasing the accuracy of the resulting airfoil shape.
Disadvantage: It increases the computational cost of calculating the sensitivity coefficients when the finite-difference method is used to calculate the derivative of the objective function with respect to the design variables.
Disadvantage: Control points (design variables) with widely varying orders of magnitude may be obtained (problem of poor scaling [13]). It is somewhat the case for the parameterization of the RAE 2822 airfoil using the Bezier curve. A comparison of the Bezier control points for the parameterization of the NACA 0012 and RAE 2822 airfoils by a Bezier curve of degree 16 using 65 points on each surface (upper and lower ones) is shown in Figure 2. Since any point on a Bezier curve is affected by the values of all control points, any change in one control point is felt throughout the entire curve (an inability to produce a local change within a curve). It can be concluded that when dealing with the RAE 2822 airfoil, the effect of the changes to the control points on the variation of the objective function is widely varying, which may result in unphysical airfoil shapes. Moreover, increasing the Bezier curve degree increases the variations of the control points for the RAE 2822 airfoil and makes the scaling issue more severe (Figure 3).

Airfoil Parameterization
In [1], a Bezier curve of degree 10 was used to parameterize the shape of a NACA 0012 airfoil in steady inviscid transonic flow. In this study, however, since we dealt with a more complicated airfoil shape, a Bezier curve of degree 16 (17 control points) was used to construct the upper and lower surfaces of the RAE 2822 airfoil separately. The Bezier curve is mathematically defined as: where: where is the Bernstein basis polynomial of degree n (in this study, n = 16), t ∈ [0, 1], B i are the control points of the Bezier curve, and P(t) = (x(t), y(t)) where x(t) and y(t) are x− and y− coordinates of the predetermined data points on the airfoil surface. The increase in the degree of a Bezier curve has advantages and disadvantages which should be recognized: Advantage: It improves the flexibility of the Bezier curve, thereby increasing the accuracy of the resulting airfoil shape.
Disadvantage: It increases the computational cost of calculating the sensitivity coefficients when the finite-difference method is used to calculate the derivative of the objective function with respect to the design variables.
Disadvantage: Control points (design variables) with widely varying orders of magnitude may be obtained (problem of poor scaling [13]). It is somewhat the case for the parameterization of the RAE 2822 airfoil using the Bezier curve. A comparison of the Bezier control points for the parameterization of the NACA 0012 and RAE 2822 airfoils by a Bezier curve of degree 16 using 65 points on each surface (upper and lower ones) is shown in Figure 2. Since any point on a Bezier curve is affected by the values of all control points, any change in one control point is felt throughout the entire curve (an inability to produce a local change within a curve). It can be concluded that when dealing with the RAE 2822 airfoil, the effect of the changes to the control points on the variation of the objective function is widely varying, which may result in unphysical airfoil shapes. Moreover, increasing the Bezier curve degree increases the variations of the control points for the RAE 2822 airfoil and makes the scaling issue more severe (Figure 3).   Although the scaling of the design variables is a way to alleviate the problem of the poor scaling of the design variables, in this work, the design variables were not scaled. Instead, the exact step length value exact β was modified and only a fraction of it was considered. In doing so, the variations of the design variables were limited and a realistic airfoil shape was obtained at each iteration. For two test cases of interest in this study, we considered some approximate values for the step length modification as follows: For Test case I: For Test case II:    Although the scaling of the design variables is a way to alleviate the problem of the poor scaling of the design variables, in this work, the design variables were not scaled. Instead, the exact step length value exact β was modified and only a fraction of it was considered. In doing so, the variations of the design variables were limited and a realistic airfoil shape was obtained at each iteration. For two test cases of interest in this study, we considered some approximate values for the step length modification as follows: For Test case I: For Test case II:  Although the scaling of the design variables is a way to alleviate the problem of the poor scaling of the design variables, in this work, the design variables were not scaled. Instead, the exact step length value β exact was modified and only a fraction of it was considered. In doing so, the variations of the design variables were limited and a realistic airfoil shape was obtained at each iteration. For two test cases of interest in this study, we considered some approximate values for the step length modification as follows: For Test case I: For Test case II: It should be noted that the modifications values of 0.02 and 0.1 given by Equations (5) and (6) were applied for all iterations and there was no need to change them in every single iteration. Moreover, these modification values depended on the shape of the airfoil used in the study. If, for example, a NACA 0012 airfoil was used, the scaling problem was less severe and larger values of the modification (close to one) could be used.

Optimization Method
In this study, the unconstrained nonlinear minimization problem was solved by a quasi-Newton method (BFGS) which is a gradient-based optimization approach. The algorithm and the details of this optimization method used in this study are explained in [1]. The objective function considered in this study is defined as: where D and L are the drag and the lift, respectively. The angle of attack α is considered constant during minimization of the objective function J. Some Bezier control points were considered as the design variables. On either of the upper and lower surfaces of the parameterized airfoil, three control points at the leading edge and four control points at the trailing edge were fixed to obtain a sharp trailing edge and a round leading edge. Thus, there were 2 × 10 = 20 design variables for each test case which were denoted by B DV i (i = 1, . . . , 20) ( Figure 4). As shown by the optimization results, such a high number of fixed control points did not restrict the effectiveness of the optimization process.
Fluids 2021, 6, x FOR PEER REVIEW 6 of 17 It should be noted that the modifications values of 0.02 and 0.1 given by Equations (5) and (6) were applied for all iterations and there was no need to change them in every single iteration. Moreover, these modification values depended on the shape of the airfoil used in the study. If, for example, a NACA 0012 airfoil was used, the scaling problem was less severe and larger values of the modification (close to one) could be used.

Optimization Method
In this study, the unconstrained nonlinear minimization problem was solved by a quasi-Newton method (BFGS) which is a gradient-based optimization approach. The algorithm and the details of this optimization method used in this study are explained in [1]. The objective function considered in this study is defined as: where D and L are the drag and the lift, respectively. The angle of attack α is considered constant during minimization of the objective function J . Some Bezier control points were considered as the design variables. On either of the upper and lower surfaces of the parameterized airfoil, three control points at the leading edge and four control points at the trailing edge were fixed to obtain a sharp trailing edge and a round leading edge. Thus, there were ´= 2 10 20 design variables for each test case which were denoted by  The derivation of the objective function J with respect to the design variables The derivation of the objective function J with respect to the design variables B DV i is: where the terms ∂D are calculated using the central finite-difference method as follows: where ε = 0.01. The total drag D is the sum of the drag due to pressure D p and the drag due to skin friction D f .
where D p and D f are given as ( Figure 5).
The total drag D is the sum of the drag due to pressure p D and the drag due to skin friction f D .
= + p f D D D (11) where p D and f D are given as ( Figure 5).
( ) In aerodynamic shape optimization, thex coordinates of airfoil nodes are usually considered fixed during the optimization and only they coordinates of airfoil nodes In aerodynamic shape optimization, the x− coordinates of airfoil nodes are usually considered fixed during the optimization and only the y− coordinates of airfoil nodes are optimized. Therefore, the terms N p and A f , which are functions of x− coordinates, are considered constants. Thus, from Equation (11), we have: The term N f sin α is very small compared to the other terms and can be ignored (both the normal force due to the wall shear stress τ j , N f , and sin α have small magnitude). Thus: The total lift L is the sum of the lift due to pressure L p and the lift due to skin friction L f :

Exact Step Length
Following an argument given in Equations (23)-(25) in [1], it can be concluded that for the minimization of the defined objective function, J = D L 2 , an expression for the exact step length can be derived as follows: By following the same procedure in [1], we can derive the following exact step length for viscous flows: where the term A f cos α is added to the numerator of the exact step length expression for the inviscid flows derived in [1].

Results
Initially, the numerical solutions of the viscous transonic flow over the RAE 2822 airfoil for the two considered flow conditions obtained by the software ANSYS Fluent were validated by the experimental data in [12]. To do so, the original RAE 2822 airfoil [14] was reconstructed using a Bezier curve of degree 16 to obtain the initial control points (Figure 6). Then a structured hyperbolic grid generation method was used to generate an O-type mesh over the whole flow domain (Figure 7). The grid size was 129 × 129 (129 nodes on the airfoil surface and 129 nodes in the normal direction to the airfoil surface). For both flow conditions, the S-A turbulence model was used and the wall spacing was 5 × 10 −5 m (y + ≈ 30). In ANSYS Fluent, when using the Spalart-Allmaras turbulence model, y + of the wall-adjacent cells was either very small (on the order of y + = 1) or approximately 30 or greater [15]. A summary of the data used in the numerical simulation and the results including the drag D, the lift L, the coefficient of the drag c d , and the coefficient of lift c l for both flow conditions are given in Table 1. The comparisons between the results obtained from the numerical solution (ANSYS Fluent, S-A turbulence model) and the experimental data [12] are shown in Figure 8a (for the first flow condition) and Figure 8b (for the second flow condition). As can be seen, a very good agreement was obtained between the numerical results (using the reconstructed RAE 2822 airfoil) and experimental data for both flow conditions. The Mach number distributions for both test cases are shown in Figure 9. in the numerical simulation and the results including the drag D , the lift L , the coefficient of the drag d c , and the coefficient of lift l c for both flow conditions are given in Table 1. The comparisons between the results obtained from the numerical solution (ANSYS Fluent, S-A turbulence model) and the experimental data [12] are shown in Figure 8a (for the first flow condition) and Figure 8b (for the second flow condition). As can be seen, a very good agreement was obtained between the numerical results (using the reconstructed RAE 2822 airfoil) and experimental data for both flow conditions. The Mach number distributions for both test cases are shown in Figure 9.        As stated previously, two flow conditions were considered here to investigate the performance of the proposed numerical approach in the shape optimization of the RAE 2822 airfoil in viscous transonic flows. In both flow conditions, there was a shock on the upper surface, as can be seen in Figure 10a (for Test case I) and Figure 11a (for Test case II). Moreover, the optimal shapes for the both test cases (Figures 10b and Figure 11b) were approximately shock-free with a significantly reduced drag. The numerical solution of the initial shape (reconstructed RAE 2822 airfoil) gave a total drag of 126.8 counts (75.3 counts due to pressure and 51.5 counts due to skin friction) in Test case I (Table 2) and a total drag of 204.3 counts (155.1 counts due to pressure and 49.2 counts due to skin friction) in Test case II ( Table 3). The corresponding values of the drag for the optimal shape for both test cases were a total drag of 99.9 counts (47.8 counts due to pressure and 52.1 counts due to skin friction) in Test case I (Table 2) and a total drag of 110.3 counts (58.4 counts due to pressure and 51.9 counts due to skin friction) in Test case II (Table 3). Therefore, the drag reduction (21.2% in Test case I and 46.0% in Test case II) was mainly As stated previously, two flow conditions were considered here to investigate the performance of the proposed numerical approach in the shape optimization of the RAE 2822 airfoil in viscous transonic flows. In both flow conditions, there was a shock on the upper surface, as can be seen in Figure 10a (for Test case I) and Figure 11a (for Test case II). Moreover, the optimal shapes for the both test cases (Figures 10b and 11b) were approximately shock-free with a significantly reduced drag. The numerical solution of the initial shape (reconstructed RAE 2822 airfoil) gave a total drag of 126.8 counts (75.3 counts due to pressure and 51.5 counts due to skin friction) in Test case I (Table 2) and a total drag of 204.3 counts (155.1 counts due to pressure and 49.2 counts due to skin friction) in Test case II ( Table 3). The corresponding values of the drag for the optimal shape for both test cases were a total drag of 99.9 counts (47.8 counts due to pressure and 52.1 counts due to skin friction) in Test case I (Table 2) and a total drag of 110.3 counts (58.4 counts due to pressure and 51.9 counts due to skin friction) in Test case II (Table 3). Therefore, the drag reduction (21.2% in Test case I and 46.0% in Test case II) was mainly due to the pressure drag. The skin friction drag contribution to the drag reduction was insignificant, as explained earlier in Section 3.2 and Equation (14). Moreover, as can be seen in Tables 2  and 3, the increase in the lift (7.9% in Test case I and 4.3% in Test case II) was totally due to the pressure lift. The lift due to skin friction was negligible. As the drag reduction due to the skin friction was insignificant, the drag reduction problem could be considered as the minimization of the pressure drag only. Thus, the exact step length expression obtained already for the inviscid flows [1] could also be used to deal with the viscous flows. If in Equation (20), A f cos α = 0, then the expression for the inviscid flows was obtained. In this case, when A f cos α = 0, the numerator of Equation (20) became smaller and we could consider larger modification values (Equations (5) and (6)) for the modified step length. Thus, the modified step length became closer to the exact step length value. If we considered the pressure drag reduction only and neglected the insignificant variation of the skin friction drag during the optimization process, the drag reductions of 36.5% (27.5 drag counts) and 62.3% (96.7 drag counts) were obtained in Test cases I ( Table 2) and II (Table 3), respectively. A summary of the results including the values of the objective function, the step length, the drag, the drag coefficient, the lift, and the lift coefficients in all iterations during the optimization process is presented in Table 4 (for Test case I) and Table 5 (for Test case II). The results showed that the objective function reduction was 46.7% for Test case I and 73.3% for Test case II. As can be seen in the trend of the minimization of the objective function, the vast majority of the reduction in the objective function value happened in the first iteration. This resulted in a very efficient optimization procedure because a desirable airfoil shape based on the design requirements was achieved in only one iteration. This matter (major reduction in the objective function value in the first iteration) was also observed in the optimization problem for the inviscid transonic flow presented in [1]. The comparison of the initial and optimal airfoils and the corresponding airfoil surface pressure coefficients are shown in Figure 12 (Test case I) and Figure 13 (Test case II). The gradient of the objective function with respect to the design variables for the initial and optimal airfoil shapes as well as the history of the objective function during the shape optimization process are shown in Figure 14 (Test case I) and Figure 15 (Test case II). As given in Tables 6  and 7, the reduction in the norm of the gradient of the objective function (which is usually considered as a measure to verify a sufficient decrease in the objective function value to reach the optimal solution) was 88% (Test case I) and 95.5% (Test case II). The value of the lift-to-drag ratio for the initial and optimal shapes were 60.35 and 82.65 for Test case I (Table 8) and 41.87 and 80.95 for Test case II ( Table 9). As can be seen, the lift-to-drag ratio for both test cases was improved significantly. The optimization process for each test case stopped when a negative step length was obtained as long as a sufficient reduction in the norm of the gradient (or the objective function value) was achieved. Moreover, by considering the results reported in the literature concerning the aerodynamic design optimization of the RAE 2822 airfoil at these two flow conditions, it can be seen that the final results for both test cases considered in this paper were comparable and competitive to the results presented in the literature.
As stated previously, the two test cases considered in this study were as follows: Test case I: M ∞ = 0.729, α = 2.31 • : Fluids 2021, 6, x FOR PEER REVIEW 12 of 17 length value. If we considered the pressure drag reduction only and neglected the insignificant variation of the skin friction drag during the optimization process, the drag reductions of 36.5% (27.5 drag counts) and 62.3% (96.7 drag counts) were obtained in Test cases I (Table 2) and II (Table 3), respectively. A summary of the results including the values of the objective function, the step length, the drag, the drag coefficient, the lift, and the lift coefficients in all iterations during the optimization process is presented in Table 4 (for Test case I) and Table 5 (for Test case II). The results showed that the objective function reduction was 46.7% for Test case I and 73.3% for Test case II. As can be seen in the trend of the minimization of the objective function, the vast majority of the reduction in the objective function value happened in the first iteration. This resulted in a very efficient optimization procedure because a desirable airfoil shape based on the design requirements was achieved in only one iteration. This matter (major reduction in the objective function value in the first iteration) was also observed in the optimization problem for the inviscid transonic flow presented in [1]. The comparison of the initial and optimal airfoils and the corresponding airfoil surface pressure coefficients are shown in Figure 12 (Test case I) and Figure 13 (Test case II). The gradient of the objective function with respect to the design variables for the initial and optimal airfoil shapes as well as the history of the objective function during the shape optimization process are shown in Figure 14 (Test case I) and Figure 15 (Test case II). As given in Tables 6 and 7, the reduction in the norm of the gradient of the objective function (which is usually considered as a measure to verify a sufficient decrease in the objective function value to reach the optimal solution) was 88% (Test case I) and 95.5% (Test case II). The value of the lift-to-drag ratio for the initial and optimal shapes were 60.35 and 82.65 for Test case I (Table 8) and 41.87 and 80.95 for Test case II ( Table 9). As can be seen, the lift-to-drag ratio for both test cases was improved significantly. The optimization process for each test case stopped when a negative step length was obtained as long as a sufficient reduction in the norm of the gradient (or the objective function value) was achieved. Moreover, by considering the results reported in the literature concerning the aerodynamic design optimization of the RAE 2822 airfoil at these two flow conditions, it can be seen that the final results for both test cases considered in this paper were comparable and competitive to the results presented in the literature. As stated previously, the two test cases considered in this study were as follows: Test case I: (a) (b) Figure 10. Absolute pressure distribution for the initial shape (RAE 2822) (a) and the optimal shape (at iteration 5) (b) for Test case I.
Test case II: 2.79 M α : Figure 10. Absolute pressure distribution for the initial shape (RAE 2822) (a) and the optimal shape (at iteration 5) (b) for Test case I. (a) (b) Figure 11. Absolute pressure distribution for the initial shape (RAE 2822) (a) and the optimal shape (at iteration 19) (b) for Test case II.
(a) (b) Figure 12. Comparison of initial and optimal airfoils used in the transonic turbulent flow shape optimization (a) and the corresponding airfoil surface pressure coefficients (b) for Test case I.
(a) (b) Figure 13. Comparison of initial and optimal airfoils used in the transonic turbulent flow shape optimization (a) and the corresponding airfoil surface pressure coefficients (b) for Test case II.  Figure 11. Absolute pressure distribution for the initial shape (RAE 2822) (a) and the optimal shape (at iteration 19) (b) for Test case II.   Figure 11. Absolute pressure distribution for the initial shape (RAE 2822) (a) and the optimal shape (at iteration 19) (b) for Test case II.
(a) (b) Figure 12. Comparison of initial and optimal airfoils used in the transonic turbulent flow shape optimization (a) and the corresponding airfoil surface pressure coefficients (b) for Test case I.
(a) (b) Figure 13. Comparison of initial and optimal airfoils used in the transonic turbulent flow shape optimization (a) and the corresponding airfoil surface pressure coefficients (b) for Test case II.   Figure 14. The gradient of the objective function with respect to the design variables (a) and the history of the objective function during the shape optimization process (Test case I).  −73.25% −46.00% +4.41% Table 6. Reduction in the norm of gradient of the objective function (Test case I).

Initial Shape Optimal Shape Reduction
3.33 × 10 −2 1.5 × 10 −3 95.46% Table 8. The value of lift-to-drag ratio for the initial and optimal shapes (Test case I).
Airfoil Shape L D Initial 60.35 Optimal 82.65 Variation +36.95% Table 9. The value of lift-to-drag ratio for the initial and optimal shapes (Test case II). (a) Gradient of objective function (b) Objective function history Figure 15. The gradient of the objective function with respect to the design variables (a) and the history of the objective function during the shape optimization process (Test case II).

Conclusions
In this study, the expression for the exact step length which was previously developed by the authors for inviscid transonic flows, was extended to viscous transonic flows over airfoils. The RAE 2822 airfoil was chosen to investigate the accuracy of the proposed step length due to widespread use of the RAE 2822 airfoil in transonic turbulent flows. The RAE 2822 airfoil was reconstructed by a Bezier curve of degree 16 and then some of the Bezier curve control points were considered as design variables. The minimization of the drag-to-lift ratio was performed using the gradient-based optimization method BFGS. The gradient of the defined objective function with respect to the design variables was calculated by the finite-difference method. Two test cases were considered using two common flow conditions and the numerical solution of the transonic turbulent flow over the airfoil was performed using the solver ANSYS Fluent (using the S-A turbulence model). The use of the proposed step length expression resulted in an accurate and efficient optimization process in which the optimal shape was achieved within a few iterations with a significant objective function reduction in the first iteration. The final results for both test cases were comparable and competitive to the results presented in the literature.

Conclusions
In this study, the expression for the exact step length which was previously developed by the authors for inviscid transonic flows, was extended to viscous transonic flows over airfoils. The RAE 2822 airfoil was chosen to investigate the accuracy of the proposed step length due to widespread use of the RAE 2822 airfoil in transonic turbulent flows. The RAE 2822 airfoil was reconstructed by a Bezier curve of degree 16 and then some of the Bezier curve control points were considered as design variables. The minimization of the drag-tolift ratio was performed using the gradient-based optimization method BFGS. The gradient of the defined objective function with respect to the design variables was calculated by the finite-difference method. Two test cases were considered using two common flow conditions and the numerical solution of the transonic turbulent flow over the airfoil was performed using the solver ANSYS Fluent (using the S-A turbulence model). The use of the proposed step length expression resulted in an accurate and efficient optimization process in which the optimal shape was achieved within a few iterations with a significant objective function reduction in the first iteration. The final results for both test cases were comparable and competitive to the results presented in the literature.