1 Introduction

Improving the surfaces of aircraft wings to reduce aerodynamic drag is a promising direction for increasing the cost-effectiveness of air transportation and reducing the harmful effects on the environment. The choice of wing profile largely determines the aerodynamic characteristics of the aircraft. The optimal profile shape provides high lift and low aerodynamic drag.

A number of published studies [1,2,3] consider methods for optimizing the airfoil and wing surface to improve aerodynamic performance. The papers [4, 5] describe methods for designing airfoils and wings corresponding to the required aerodynamic characteristics.

Information about profile contours is usually presented in the form of an ordered discrete point basis. Profile curves and lines connecting the corresponding cross-sectional points form the frame of the wing surface. The main tool for describing pointwise curves in geometric modeling systems is currently spline functions belonging to the \({C}^{2}\) class. The spline function equations describe the behavior of the flexible rail. The methods for constructing parametric models of airfoils based on Bezier curves and B-splines are discussed in [6, 7].

In addition to obtaining the optimal profile shape to reduce aerodynamic drag, the problem of its smoothing is also relevant. When designing a wing, many iterations of changing the geometric characteristics of the airfoil are performed. Such changes are required in the course of aerodynamic optimization, as well as further design development of the wing surface (Fig. 1). In this case, the appearance of irregularities in the contour of the profile is possible.

Fig. 1
figure 1

Curvature diagrams of a wing’s sections

Irregularities in the profile lead, in turn, to the appearance of irregularities in the surface of the wing. It is pointed out in [8, 9] that the presence of surface roughness in transonic flight modes leads to a significant change in the pressure distribution along the chord compared to a smooth surface with the formation of local supersonic flow regions. At the same time, significant drops in the pressure coefficient ΔCp were observed, which led not only to an increase in resistance, but in some cases to a decrease in lift.

It is also noted in [10] that the existing methods for determining the effect of surface irregularities on drag for transonic velocities give insufficiently accurate and, as a rule, underestimated values. In particular, the revealed quadratic character of the dependence of the increase in resistance on the size of the irregularity is shown.

Since modern long-range aircraft cruise at transonic speeds, then to reduce the harmful drag caused by wing surface irregularities at the design stage, the task of smoothing pointwise given contours of airfoils is an urgent task.

In [11], a general formulation of the smoothing problem is given in relation to the curves of the frame of aircraft surfaces. This problem is presented as minimizing the sum of squared deviations of the values of the function being approximated at the contour nodes. In the general case, it consists in solving one of the following extremal problems:

  1. 1.

    Find the minimum of functionality

    $${\Phi } = \varepsilon V_{2} + U_{2} ,$$

where \(U_{2} = \mathop \sum \nolimits_{i = 0}^{N} \left( {\delta y_{i} } \right)^{2}\)—sums of squared deviations \(y_{i}\), \(V_{2} = \mathop \smallint \nolimits_{\alpha }^{{}} \left( {y^{{^{\prime\prime}}} } \right)^{2} \left( x \right)dx\)—potential energy of an elastic rod. The parameter \(\varepsilon\) characterizes the degree of smoothing: as \(\varepsilon \to 0\) we arrive at a pure interpolation problem.

  1. 2.

    Find

    $$\min U_{2} = \mathop \sum \limits_{i = 0}^{N} \left| {\delta y_{i} } \right|,$$

The smoothing problem is considered solved if the following condition is met:

$$\left| {\delta y_{i} } \right| \le Y_{*} ,\;i = 1, 2, 3, \cdots , N - 1,$$

where \({Y}_{*}\) is given.

There is a known method for solving problem 1—interpolation with smoothing, based on the use of parametric splines, developed by A. D. Tuzov [12]. A feature of the method is that it proposes a clear iterative smoothing process and proves that this process is convergent. The advantage of this smoothing method is that certain points can be fixed during the smoothing process. In addition, the curves themselves obtained by this method meet most of the requirements of aviation production, are easily calculated and belong to the \({C}^{2}\) class. The error \({\delta }_{i}\) for setting the \(i\)-th contour point in this method is defined as half the deviation of the rail at point \(i\) when it is released while simultaneously fixing the rest of the contour.

In [13], a technique for automated design of optimal contours, developed by I. R. Esheeva, is considered, designed to correct the coordinates of the points of sections of complex surfaces of aircraft, to obtain the optimal contour of the section. The values of the curvature function and the integral of the curvature function are used as criteria for assessing the optimality of the contour. The technique is intended for smoothing transverse curves of the frame of aircraft fuselage surfaces, therefore, for the smoothed curve, only the continuity of the first derivative of the interpolating contour function is checked. Thus, this method is not applicable for smoothing airfoils, since the continuity requirements for both the first and second derivatives of the function that interpolates the contour are applied to them.

In [14], the least squares method is proposed, adapted for smoothing pointwise given aerodynamic contours. The profile approximation is carried out taking into account the condition of the exact passage of the contour through two points, for example, the initial and final ones.

The authors carried out a comparative analysis of smoothing contours using the least squares method and smoothing cubic splines. The results of the study show that for smoothing contours of the airfoil type, it is most expedient to use the method of smoothing cubic splines due to the more effective elimination of unregulated inflection points.

The method of smoothing a grid of three types of flat sections, described by Keel and Tuzov in [15], is designed to smooth the curves of the skeleton of surfaces when linking the shape of aircraft. The method is essentially a development of Tuzov’s smoothing procedure for the case of a grid of curves in three-dimensional space.

As studies have shown, in some cases, the use of smoothing by cubic splines does not allow eliminating the existing irregularities of the spline. An example of such a circuit is shown in Fig. 2. The figure shows the upper half of the symmetrical convex profile of the vertical tail of a medium-haul passenger aircraft. The calculations performed showed the impossibility of eliminating the existing concavity by the method of A. D. Tuzov due to very small (10–8…10–6 mm) values of the error \({\delta }_{i}\) for setting the points of the section.

Fig. 2
figure 2

Curvature diagram for an airfoil not smoothed by the cubic spline method

In previous works [16,17,18], the authors considered the issues of smoothing the contour, which has sections with different types of smoothness violations.

As a result of applying the developed smoothing procedures, it was possible to eliminate unregulated changes in the sign of curvature, and the contour is convex throughout. However, significant differences in the curvature graph remain (Fig. 3). Thus, it is required to solve the problem of ensuring a smooth change in the curvature of the smoothed contour.

Fig. 3
figure 3

Curvature diagram of smoothed airfoil

2 Materials and methods

2.1 Optimization via smoothing

The table function describing the upper half of the smoothed airfoil is denoted as \(y = f\left( x \right)\). and the following vector is introduced

$$Y = \left( {y_{1} ,y_{2} , \ldots ,y_{n} } \right)^{T} .$$

Here \(y_{i} = f\left( {x_{i} } \right), i = 1,2, \ldots ,n\), \(x_{i}\) and \(y_{i}\) are the abscissa and ordinate of the \(i\) th point, respectively the number of points of the smoothed contour fragment is \(n\), and the transposition sign is \(T\).

Next, we introduced the vector

$$Q = \left( {f^{II} \left( {x_{i} } \right),f^{II} \left( {x_{i} } \right), \cdots ,f^{II} \left( {x_{i} } \right)} \right)^{T} ,$$

where \(f^{II} \left( {x_{i} } \right)\)—is the second derivative of the \(f\) function at the \(i\) th point.

The problem of contour smoothing is considered as a problem of minimizing a function of several variables of the following form

$$F\left( Y \right) = Q^{T} AQ,$$
(1)

where \(A\)—is a one-diagonal matrix of weight coefficients \(a_{i}\), matrix size is \(n \times n\).

2.2 Objective function

To solve the problem, it was necessary to represent the objective function in the form of an explicit dependence on the ordinates of the nodes of the smoothed contour. For this, the values of the second derivative \({f}^{II}\left({x}_{i}\right)\) of the \(y=f\left(x\right)\) function were expressed in terms of the values of the function at five points \(i-2, i-1,i,i+1,i+2\), using the non-difference formulas of numerical differentiation [19].

The formula expressing the values of the second derivative of a function in terms of the values of the \(y=f\left(x\right)\) function at five points, after discarding the infinitesimal residual terms, is presented as:

$$\begin{aligned} f^{{II}} \left( {x_{i} } \right) = \frac{1}{{24h^{2} }}\left( { - 2y_{{i - 2}} + 32y_{{i - 1}} - 60y_{i} + 32y_{{i + 1}} - 2y_{{i + 2}} } \right), \end{aligned}$$
(2)

where \(h = x_{i} - x_{i - 1}\).

Since the objective function is a quadratic form given by a diagonal matrix, it is represented as a sum of squares

$$\begin{aligned} &F\left( Y \right) = \mathop \sum \limits_{i = 1}^{n} a_{i} \left[ {\frac{1}{{24h^{2} }}\left( { - 2y_{i - 2} + 32y_{i - 1} - 60y_{i} + 32y_{i + 1} - 2y_{i + 2} } \right)} \right]^{2} .\end{aligned}$$
(3)

2.3 Minimization of the objective function by the method of gradient descent with a constant step

Since the objective function has continuous first partial derivatives at all points of the smoothed contour, the gradient descent method with a constant step is used to find the minimum of the objective function [20].

The search for the minimum of the \(F\left(Y\right)\) function, according to this method, was carried out by constructing a sequence of points \(\left\{{Y}^{l}\right\},\quad l=\mathrm{0,1},\dots\), such that

$$F\left( {Y^{l + 1} } \right) < F\left( {Y^{l} } \right),\quad l = 0,1, \ldots .$$

The points of the \(\left\{ {Y^{l} } \right\}\) sequence were calculated according to the following rule

$$Y^{l + 1} = Y^{l} - t_{l} \nabla F\left( {Y^{l} } \right),\quad l = 0,1, \ldots$$
(4)

Here, the \({Y}^{0}\) point corresponds to the values of the ordinates of the contour points before the start of smoothing according to the developed method; \(\nabla F\left({Y}^{l}\right)\) is the objective function gradient calculated at the \({Y}^{l}\) point; the step size \({t}_{l}\) is set before the first iteration and remains constant as long as the function decreases at the points of the sequence, which is controlled by checking the condition \(F\left({Y}^{l+1}\right)-F\left({Y}^{l}\right)<0\).

The construction of the \(\left\{{Y}^{l}\right\}\) sequence ends at the \({Y}^{l}\) point where one of the three conditions is met:

\(\Vert \nabla F\left({Y}^{l}\right)\Vert <{\varepsilon }_{1}\), where \({\varepsilon }_{1}\)—is small positive number;

\(l\ge M\), where \(M\)—iteration limit;

• The following two inequalities hold twice simultaneously \(\Vert {Y}^{l+1}-{Y}^{l}\Vert <{\varepsilon }_{2}\), \(\left|F\left({Y}^{l+1}\right)-F\left({Y}^{l}\right)\right|<{\varepsilon }_{2}\), where \({\varepsilon }_{2}\)—is small positive number.

For the convenience of calculating the gradient of the objective function (2) is rewritten in matrix form

$$f^{II} \left( {x_{i} } \right) = \frac{1}{{24h^{2} }}\left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\begin{array}{*{20}c} {i - 2} & {i - 1} \\ \end{array} } & { - i} & {\begin{array}{*{20}c} {i + 1} & {i + 2} \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & \cdots & 0 \\ \end{array} }&{} & { - 2 }&{} & {32} \\ \end{array} } & { - 60} & {\begin{array}{*{20}c}{}& {32} & { - 2} & {\begin{array}{*{20}c} 0 & \cdots & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right] \times \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {y_{1} } \\ {y_{2} } \\ \end{array} } \\ \vdots \\ {\begin{array}{*{20}c} {y_{n - 1} } \\ {y_{n} } \\ \end{array} } \\ \end{array} } \right].$$
(5)

Next, we introduce a five-diagonal matrix of dimension \(n \times n\).

$${\text{K = }}\frac{{1}}{{{\text{24h}}^{{2}} }}\left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\begin{array}{*{20}c} { - {60}} & {{32}} \\ {{32}} & { - {60}} \\ { - {2}} & {{32}} \\ \end{array} } & {\begin{array}{*{20}c} { - {2}} & {0} & {0} \\ {{32}} & { - {2}} & {0} \\ { - {60}} & {{32}} & { - {2}} \\ \end{array} } \\ \end{array} } & \cdots & {\begin{array}{*{20}c} {\begin{array}{*{20}c} {0}&{} & {0}&{} \\ {0}&{} & {0} \\ {0}&{} & {0} \\ \end{array} } & {\begin{array}{*{20}c} {{0}}&{} & {{0}}&{} & {{0}} \\ {0}&{} & {0}&{} & {0} \\ {0}&{} & {0}&{} & {0} \\ \end{array} } \\ \end{array} } \\ \vdots & \ddots & \vdots \\ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {{0}}&{} & {{0}}&{} \\ {0}&{} & {0} \\ {0}&{} & {0} \\ \end{array} } & {\begin{array}{*{20}c} {{0}}&{} & {{0}}&{} & {{0}} \\ {0}&{} & {0}&{} & {0} \\ {0}&{} & {0}&{} & {0} \\ \end{array} } \\ \end{array} } & \cdots & {\begin{array}{*{20}c} {\begin{array}{*{20}c} { - {2}} & {{32}} \\ {0} & { - {2}} \\ {0} & {0} \\ \end{array} } & {\begin{array}{*{20}c} { - {60}} & {{32}} & { - {2}} \\ {{32}} & { - {60}} & {{32}} \\ { - {2}} & {{32}} & { - {60}} \\ \end{array} } \\ \end{array} } \\ \end{array} } \right].$$
(6)

After that, the vector of values of the second derivatives was redefined as follows

$$Q = {{KY}}.$$
(7)

Taking into account Eq. (7), the objective function was written as

$$F\left( Y \right) = K^{T} Y^{T} {{AYK}}.$$
(8)

Thus, to find the gradient of the objective function, the following formula is obtained

$$\nabla F\left( Y \right) = 2\left[ {K^{T} {{AYK}}} \right].$$
(9)

2.4 Objective function minimization algorithm

  • Step 1. Set \({Y}^{0}\), \(0 < \varepsilon < 1\), \({\varepsilon }_{1}>0\), \({\varepsilon }_{2}>0\), \(M\);

  • Step 2. Set \(l=0\);

  • Step 3. Set \(\nabla F\left({Y}^{l}\right)\);

  • Step 4. Verify that the algorithm termination criteria are met. \(\Vert \nabla F\left({Y}^{l}\right)\Vert <{\varepsilon }_{1}\): if the criterion is met, the calculation is finished, \({Y}^{*}={Y}^{l}\); if the criterion is not met, then go to step 5;

  • Step 5. Check the fulfillment of the inequality \(l>M\): if the inequality is satisfied, then the calculation is over: \({Y}^{*}={Y}^{l}\); if not, then go to step 6;

  • Step 6. Set the step size \({t}_{l}\);

  • Step 7 Calculate \({Y}^{l+1}={Y}^{l}-{t}_{l}\nabla F\left({Y}^{l}\right)\);

  • Step 8. Check if the condition is met \(F\left({Y}^{l+1}\right)-F\left({Y}^{l}\right)<0\): if the condition is met, then go to step 9; if the condition is not met, set \({t}_{l}=\frac{{t}_{l}}{2}\) and go to step 7.

  • Step 9. Check the conditions \(\Vert {Y}^{l+1}-{Y}^{l}\Vert <{\varepsilon }_{2}\), \(\left|F\left({Y}^{l+1}\right)-F\left({Y}^{l}\right)\right|<{\varepsilon }_{2}\): if both conditions are met at the current value of \(l\) and \(l=l-1\), then the calculation is over, \({Y}^{*}={Y}^{l}\); if at least one of the conditions is not met, set \(l=l+1\) and go to step 3.

3 Results

On the basis of the above algorithm, a computer program was developed, with the help of which the considered airfoil was smoothed.

The program is written in C++ . To obtain the initial data, files are used to export an array of point coordinates from the CAD system. Using the NX system as an example, these are text files with the.dat extension, in which each line contains the\(x\), \(y\) and \(z\) coordinates of one point in the array, separated by tabs. Data for the vector \({Y}^{0}\) are taken from the y coordinates, the value \(h={x}_{i}-{x}_{i-1}\) is obtained from the x coordinates.

The block diagram of the program is shown in Fig. 4. After entering the initial data, the program is executed in the sequence described below.

Fig. 4
figure 4

Program flowchart

The number of points of the smoothed fragment of the curve \(N\) and the weight coefficients \({a}_{i}\) are set, the variables used in the calculations and arrays for storing the values of the matrices are declared. The dimensions of the arrays are 1 more than the dimensions of the matrices for storing their values at each iteration of the algorithm.

\({Y}^{0}\), \({\varepsilon }_{1}>0\), \({\varepsilon }_{2}>0\), \(M\) are set (step 1 of the algorithm).

The iteration cycle \(l=\mathrm{0,1},\dots ,M\) is initiated, within which further operations are performed. The beginning of the cycle \(l=0\) corresponds to step 2 of the algorithm, reaching the limit number of iterations \(l=M\) corresponds to step 5.

For values \(l>0\), the values of the elements of the vector \({Y}^{l+1}={Y}^{l}-{t}_{l}\nabla F\left({Y}^{l}\right)\) are calculated, which corresponds to step 7 of the algorithm. For iteration \(l=0\), these operations are skipped.

The gradient vector of the objective function \(\nabla F\left({Y}^{l}\right)\) is calculated (step 3 of the algorithm). This is done in several steps.

A five-diagonal matrix \(K\) is introduced by formula Eq. (6). To obtain the vector of second derivatives \({Q}^{l}\) in accordance with Eq. (7), the matrix \(K\) is multiplied by the vector \({Y}^{l}\) (Fig. 5).

Fig. 5
figure 5

Fragment of the source code of the program

The transposition of the vector \({Q}^{l}\) is performed.

A one-diagonal matrix \(A\) of weight coefficients \({a}_{i}\) is written.

The transposed vector \({Q}^{l}\) is multiplied by the matrix \(A\). Further, to obtain the value of the objective function \(F\left({Y}^{l}\right)\), the result of this operation is multiplied by the vector \({Q}^{l}\) (Fig. 6).

Fig. 6
figure 6

Fragment of the source code of the program

Further, to calculate \(\nabla F\left({Y}^{l}\right)\) in accordance with Eq. (9), the matrix \(K\) is multiplied by 2 and by the matrix \(A\) (since the matrix \(K\) is diagonal, then \({K}^{T}=K\)). Since \({Q}^{l}={{KY}}^{l}\), the result, in turn, is multiplied by the vector \({Q}^{l}\) (Fig. 7).

Fig. 7
figure 7

Fragment of the source code of the program

Next, \(\Vert \nabla F\left({Y}^{l}\right)\Vert\) is calculated and the condition \(\Vert \nabla F\left({Y}^{l}\right)\Vert <{\varepsilon }_{1}\) is checked (step 4 of the algorithm).

The condition \(l>0\) is checked; for the iteration \(l=0\), all the operations described below are not performed.

The gradient descent step \({t}_{l}\) is set (step 6 of the algorithm).

The fulfillment of the condition \(F\left({Y}^{l+1}\right)-F\left({Y}^{l}\right)>0\) is checked, when it is fulfilled, the step value \({t}_{l}=\frac{{t}_{l}}{2}\) is reduced (step 8 of the algorithm).

If the previous condition is not met, the norm of the difference of vectors \(\Vert {Y}^{l+1}-{Y}^{l}\Vert\) is calculated and the simultaneous fulfillment of the conditions \(\Vert {Y}^{l+1}-{Y}^{l}\Vert <{\varepsilon }_{2}\), \(\left|F\left({Y}^{l+1}\right)-F\left({Y}^{l}\right)\right|<{\varepsilon }_{2}\) (step 9 of the algorithm). If not executed, the value of l is incremented and the next iteration of the loop is executed.

The result is an array of y coordinates for the points of the smoothed fragment of the curve.

As a result of smoothing, the interpolation error was 0.1–0.8%, except for two end points, where it reached 1.5% and 4.3%.

Figures 8 and 9 show a smoothed profile curve built in a CAD system and a diagram of its curvature.

Fig. 8
figure 8

Airfoil curvature diagram after smoothing

Fig. 9
figure 9

Concavity on the airfoil tail curvature diagram after smoothing (enlarged)

4 Discussion and conclusions

As can be seen from Figs. 8 and 9, smoothing made it possible to obtain a fairly smooth curve of the profile curvature, however, an unforeseen concavity appeared in the tail part of the profile.

Also, as a limitation of the developed technique, it should be noted the numerical differentiation method used, designed for equidistant nodes of the curve. In the considered case, this is admissible, since the smoothed fragment is located in the tail part of the profile, where the step of the nodes is constant and equal to 5% of its chord length. However, to smooth the sections that lie closer to the nose of the profile, where smaller values of the step of the nodes of the curve are used, a method for calculating the second derivatives is required, which allows for their uneven location.

Thus, the results of the performed smoothing confirm the correctness of the choice of the objective function and the effectiveness of the developed smoothing technique for the tasks of ensuring the smoothness of the change in curvature. However, the methodology requires some modifications.

First, restrictions should be introduced to prevent the appearance of unforeseen inflections on the curve. The most promising is the use of methods of conditional minimization of the objective function with restrictions that prevent changing the sign of the curvature at the contour nodes.

Secondly, it is required to apply a method for calculating the second derivatives of a function approximating the contour, which can be used in the case of unequally spaced contour nodes.

5 Conclusion

The smoothing of airfoils with tabulated coordinates is considered. The smoothing of the contour, convex throughout, but having significant differences in the curvature diagram, is studied. The problem of ensuring a smooth change in the curvature of the smoothed contour is considered.

The contour smoothing problem is presented as a problem of minimizing the quadratic function of many variables. As arguments of the quadratic function, the values of the second derivatives of the function interpolating the curve of the smoothed airfoil given in a table at its nodes are used.

To solve the problem, the quadratic function is presented in the form of an explicit dependence on the ordinates of the nodes of the smoothed contour. The values of the second derivative of the function interpolating the contour at each of its nodes are expressed in terms of the values of this function at five points using non-difference numerical differentiation formulas.

To find the minimum of the objective quadratic function, the gradient descent method with a constant step was used.

An algorithm for minimizing the objective function using the gradient descent method has been developed. A computer program developed on the basis of this algorithm smoothed the considered airfoil.

The effectiveness of the developed smoothing technique for the problems of ensuring the smoothness of curvature changes is confirmed.

A disadvantage of the technique is revealed in the form of the possibility of unforeseen concavities smoothed airfoil.

Directions for further research are determined to prevent the appearance of unforeseen inflections on the curve and to ensure the possibility of applying the technique with unequal distances between the points of the smoothed curve.