1 Introduction

Wind turbines convert wind energy into mechanical energy and then into electricity. This energy has great potential to promote sustainable and low-carbon energy. Therefore, improving the performance of wind turbines is of great importance. Dynamic stall is one of the common phenomena that happens in wind turbines [1]. Dynamic stall is a nonlinear unsteady aerodynamic phenomenon due to the rapidly changing angle of attack. Although it delays the stall compared to the static case, with the passage of the dynamic stall vortex from the trailing edge, the lift drastically decreases, and the stall occurs. Many experimental and numerical studies have been done on the physical perception of the dynamic stall and the effect of oscillation frequency [2,3,4,5]. Pruski and Bowerso [6] experimentally investigated the leading-edge flow structure of the NACA0012 airfoil under dynamic stall conditions. They showed that the leading-edge vortex acted as a mechanism of momentum exchange. They also realized that the flow of the leading edge region remained attached above the static stall angle during the upstroke motion. In contrast, the flow separation remained on the downstroke until past the static stall angle.

Lee and Gerontakos [7] studied stall events on an oscillating NACA0012 airfoil experimentally at Re \(= 1.35 \times 10^{5}\). They reported on sequences of boundary-layer events before, during, and after the stall. They expressed that the sequence for the deep dynamic stall includes upward spread of flow reversal, turbulent breakdown, and the formation of leading edge vortex (LEV), LEV growth and rearward convection, LEV catastrophic detachment, separated flow, and rearward reattachment. Wang et al. [8] numerically perused the dynamic stall phenomenon of an oscillation NACA0012 airfoil at the low Reynolds number. They applied two URANS models, namely the standard \(k - \omega\) model and the \(SST k - \omega\) model with transition for their simulation. They showed that SST k-ω model could predict the experimental data with reasonable accuracy other than at very high angles of attack where the flow is fully detached and the 3D effect is expected to be more significant. Visbal and Garmann [9] analyzed the onset of unsteady separation and dynamic stall vortex formation over a pitching NACA 0012 airfoil section. They described the unsteady boundary-layer behavior that precedes the dynamic stall vortex formation in detail. They found that the laminar separation bubble (LSB) is critical in initiating the events culminating in dynamic stall vortex (DSV) formation. In another work, Visbal and Garmann [10] surveyed the impact of moderate sweep on the dynamic stall of a pitching NACA0012 section. They reported that the dynamic stall vortex evolves into an arch-type structure that is shed following its transformation into a ring vortex. Benton and Visbal [11] studied the dynamic stall of a pitching NACA 0012 airfoil at Re \(= 1 \times 10^{6}\). They indicated for the first time that a small LEV structure was generated due to turbulent-separation-induced bursting of a small LSB. The dynamic stall is common in horizontal and vertical axis wind turbines, which may cause unsteady performance, blade dynamic loads or faults in blade structure. Therefore, many authors have investigated this phenomenon with a wind turbine approach. Their target was to explore the influence of parameters such as the geometry of the Gurney flap [12], leading-edge slat [13, 14], high reduced frequencies of pitching motion [15], wake dynamics modeling of floating [16], airfoil maximum thicknesses [17] and entropy analysis [18] on the wind turbine blade.

In summary, studies of the dynamic stall phenomenon indicated that the drag force intensively increases near the angle of the dynamic stall while the lift force is reduced drastically. Therefore, studies have been performed on delaying separation and preventing dynamic stall from improving wind turbine performance. Two general flow control mechanisms are utilized for this purpose: passive and active flow controls. The pulsating blowing jet [19], steady blowing jet [20, 21], tangential synthetic jet [22, 23], airfoil surface modification [24], leading-edge rod [25], steady suction jet [26], discharge plasma actuator [27, 28], the leading-edge tubercles [29] are samples of flow controls that have been used in researcher studies. Among the studies that have been done on the blowing jet actuator, the following can be mentioned. Müller et al. [20] experimentally perused the influence of steady blowing in the dynamic stall of a NACA0018 airfoil. They put the jet slot near the leading edge and at mid-chord. They deduced that constant blowing at the 5% chord was more effective than blowing at the mid-chord. They also indicated that the blowing slot has the potential as a tool for load control on wind turbine blades. Tadjfar and Asgari [21] numerically investigated the effect of a steady tangential blowing jet in the dynamic stall of a NACA0012 airfoil at high Reynolds. They analyzed the effect of jet slot location. They significantly improved the lift and drag coefficient by placing a blowing jet near the leading-edge vortex. Tadjfar and Asgari [22] also numerically studied the role of the excitation frequency of a tangential synthetic jet actuator on the dynamic stall of a NACA0012 airfoil and showed that the synched frequency case with phase 180 was the best in all controlled cases. Jaburi and feszty [24] numerically perused passive flow control based on modifying the airfoil surface in the dynamic stall of a NACA0012 airfoil. They showed that the upper surface modifications could reduce the negative impact of dynamic stall better than the lower surface. Using a leading-edge rod, Zhong et al. [25] numerically surveyed the passive flow control for a NACA0018 airfoil dynamic stall. They concluded that the diameter of the rod and the gap between the rod and the leading edge are critical parameters for improving the performance of the airfoil. Rezaeiha et al. [26] numerically implemented an active flow control mechanism for the power enhancement of a wind turbine. They found that suction location is an important parameter for controlling when the amplitude is sufficient and comprehended that the optimal location jet is sensitive to the Reynolds number. Yu and Zeng [27] numerically analyzed a barrier discharge plasma actuator for the control flow of a NACA0015 airfoil dynamic stall. They realized that a nanosecond plasma actuator is better than other controller means because of the thermal convection characteristic particular of the nanosecond plasma actuator. Guoqiang and Shihe [28] investigated flow control for the dynamic stall of wind turbine airfoils. They understood that flow control is influenced by the two unsteady control parameters, including pulse frequency and duty cycle. They concluded that unsteady pulse flow control saves energy consumption and improves the aerodynamic coefficient better than continuous flow control. Hrynuk and Bohl [29] experimentally implemented the leading-edge tubercles on the dynamic stall of a NACA0012 airfoil as a passive flow control mechanism. Their idea for control flow is based on the flippers of humpback whales. They showed that the dynamic stall vortex for the modified airfoil was stronger and remained closer to the airfoil.

Optimization is utilized to find the best value of variables so that the performance function is maximized. Many studies have been done on optimizing the flow control parameter [30,31,32,33,34,35]. All studies related to flow control optimization have paid attention to the static stall. Optimization of the synthetic jet actuator [30, 33], aerodynamic shape and [31, 34], vortex generator [32], blowing and suction jets [35, 36], and blown flap [37] parameters are the studies samples in the static stall of an airfoil. Duvigneau and Visonneau [30] optimized the frequency, the angle with respect to the wall and the velocity amplitude of a synthetic jet actuator in the static stall of a NACA0015 airfoil using the derivative-free multi-directional search algorithm of Torczon. This algorithm is inspired by the Nelder–Mead simplex method. Fouatih et al. [32] investigated the optimization of passive flow control on the static stall of a NACA4415 airfoil experimentally. They considered five geometrical parameters: the vortex generator's thickness and height, orientation angle, position and spacing in the spanwise direction. They demonstrated that the triangular shape vortex generator could control boundary layer separation better than other shapes. They used a random search to optimize their parameters. Duvigneau et al. [33] obtained the optimization results for active flow control over the backward step. They used the RANS model, considered the amplitude and frequency of actuation as design parameters, and minimized length separation for the objective function. Their optimization method was based on the construction of Gaussian Process models. Kamari et al. [35] investigated the parameters of blowing and suction jets applied on the static stall of an SD7003 airfoil. They considered lift to drag ratio as the objective function. Their study chose the location, opening length, velocity, and angle of the jet as design parameters and used the genetic algorithm coupled with an artificial neural network for their optimization. They found that suction was more effective than blowing for the control flow. Nair et al. [36] developed a model-free flow characterization technique and optimized cluster-based feedback control. They implemented this model for the post-static stall of NACA0012. They partitioned the flow trajectories into clusters and minimized power consumption for each cluster state using iterative evaluation and downhill simplex search. They used simplex search algorithm, a gradient-free multidimensional unconstrained optimization technique. Yuhui and Yufei [37] numerically studied a new configuration of an internally blown flap. They utilized tirobjective optimization to cover the large lift, small drag, and enough robustness for high-lift devices. They adopted a hybrid surrogate-aided differential evolution for optimization. Gautier et al. [38] applied machine learning to design optimum closed-loop separation control. They experimentally reduced the backward-facing step flow recirculation zone by a slotted jet. In their study, optimization concerning objective function based on minimizing the recirculation area and penalizing the actuation was feedback control law. Genetic programming was used for this optimization and to obtain the function of the jet. Li et al. [39] experimentally investigated open and closed loop control for drag reduction in a car model. They used a pulse jet for active flow control and applied genetic programming as the control strategy. They showed that the feedback actuation emulates periodic high-frequency forcing. Tadjfar and Kamari [40] optimized the parameter of a synthetic jet to prevent a static stall of an SD7003 airfoil by genetic algorithm and neural network. They selected aerodynamic performance on a period of the synthetic jet as the objective function. They adopted the genetic algorithm coupled with an artificial neural network for their optimization. They found that when the nondimensional frequency was increased, the separation onset was moved further downstream on the airfoil's upper surface. Several methods have been developed for optimization; classical methods like Newtonian, heuristic approaches like genetic algorithm (GA), ant colony, bee colony, and particle swarm optimization algorithms. The use of computational intelligence technics in the optimization process has attracted the attention of researchers [38,39,40]. Among the various methods used in this category, we can mention genetic algorithms, neural networks [35, 40], and genetic programming [38, 39]. Classical methods are generally gradient based and have very good convergence speed in the continuous domain. In contrast, heuristic methods are powerful and robust in continuous and dispersed domains because they depend on the objective function and not on derivatives. Simplex is a popular algorithm for linear programming and is ineffective for nonlinear. A random search costs a lot and may not reach the optimal value. Evolutionary algorithms such as genetic algorithms, genetic programming, or ant colony require much time and computational cost to reach the optimal solution. The coupling technique of neural networks and genetic algorithms allows optimal values with a reasonable number of simulations. The authors' previous study [41] discussed the effect of the jet angle on liquid spraying in transverse gas. The authors showed that liquid jet injection at different angles affects the spray parameters, including the jet trajectory and breakup length. Also, the authors discussed the effect of selecting the functional parameters of the location, opening length, angle and speed of the blowing and suction jets in other studies [42, 43]. They showed that if any of the parameters are not selected correctly, the performance of the control jet will be greatly reduced. The previous studies concentrated on the effects of one or two flow parameters of blowing during flow control under the dynamic stall. In the present work, however, we were interested in finding the optimum combination of many flow parameters in a blowing jet flow control system.

The literature survey on pitching airfoils under deep dynamic stall conditions shows the need to determine the optimal blowing jet parameters to reach maximum efficiency. Considering the optimal selection importance of these parameters, the optimization of the blower jet has been discussed in this study. The main aim of this study is to find the optimum value for the operational parameters of a blowing jet in an oscillating airfoil. In this study, blowing jet parameters are optimized for the first time on a wind turbine airfoil under dynamic stall condition. Two-dimensional computation fluid dynamic was utilized for this investigation because the two-dimensional simulation of URANS gives acceptable results for dynamic stall and can capture the main structure flow and vortexes [15]. There are many optimization methods. The genetic algorithm was used in this study. This population-based algorithm can easily escape local optimums and converge to global optimum values. The neural network was employed to decrease the number of simulations and was trained with an online strategy. After learning, they could estimate aerodynamic coefficients with high accuracy. This study proposes a technique for optimizing the dynamic stall's transient phenomenon. The objective function for this phenomenon was considered an average of the aerodynamic performance over a period. The optimal case results are compared with uncontrolled and other controlled cases. These comparisons include hysteresis curves of aerodynamic loadings \(C_{l}\) and \(C_{d}\), performance coefficient, vorticity and velocity contours, pressure coefficient distribution and streamlines.

2 Numerical Method

2.1 Governing Equations

Unsteady Reynolds averaged Navier–Stokes (URANS) equations were utilized in this study. Air was considered an incompressible and Newtonian fluid. Thus, the mass conservation equation is as follows:

$$ \frac{{\partial \overline{u}}}{\partial x} + \frac{{\partial \overline{v}}}{\partial y} = 0 $$
(1)

Considering that \(\overline{V} = \left( {\overline{u},\overline{v}} \right)\), so linear momentum conservation equations can be written as below:

$$ \frac{{\partial \overline{V}_{i} }}{\partial t} + \overline{V}_{j} \frac{{\partial \overline{V}_{i} }}{{\partial x_{j} }} = - \frac{1}{\rho }\frac{{\partial \overline{P}}}{{\partial x_{i} }} + \frac{\partial }{{\rho \partial x_{j} }}\left( {2\mu \overline{e}_{ij} - \rho \overline{{V_{i}^{^{\prime}} V_{j}^{^{\prime}} }} } \right) $$
(2)

In this equation, \(\overline{e}_{ij}\) is the strain tensor and is determined from the following relation:

$$ \overline{e}_{ij} = \frac{1}{2}\left( {\frac{{\partial \overline{V}_{j} }}{\partial x}_{i} + \frac{{\partial \overline{V}_{i} }}{\partial x}_{j} } \right) $$
(3)

According to the Boussinesq assumption, the Reynolds stress can be obtained from the following equation:

$$ \tau_{ij} = - \rho \overline{{V_{i}^{^{\prime}} V_{j}^{^{\prime}} }} = 2\mu_{t} \overline{e}_{ij} - \frac{2}{3}\rho k\delta_{ij} $$
(4)

where \(\mu_{t}\) is the eddy viscosity, \(k\) is the mechanical energy of turbulence, and \(\delta_{ij}\) is the kronecker delta. In dynamic stall conditions, \(k - \omega SST\) model performs better than other turbulence models and its results are accurate enough for simulation. In this model, two equations of turbulent kinetic energy and specific dissipation rate are added to the system of equations for eddy viscosity modeling as follows:

$$ \frac{{\partial {\text{k}}}}{\partial t} + \overline{V}_{j} \frac{{\partial {\text{k}}}}{\partial x}_{j} = P_{k} - \beta^{*} \omega k + \frac{\partial }{\rho \partial x}_{j} \left[ {\left( {\mu + \sigma_{k} \mu_{t} } \right)\frac{{\partial {\text{k}}}}{\partial x}_{j} } \right] $$
(5)
$$ \frac{\partial \omega }{{\partial t}} + \overline{V}_{j} \frac{\partial \omega }{{\partial x}}_{j} = \alpha S^{2} + \frac{\partial }{\rho \partial x}_{j} \left[ {\left( {\mu + \sigma_{\omega } \mu_{t} } \right)\frac{\partial \omega }{{\partial x}}_{j} } \right] + 2\left( {1 - F_{1} } \right)\frac{{\sigma_{{\omega_{2} }} }}{\omega }\frac{{\partial {\text{k}}}}{\partial x}_{j} \frac{\partial \omega }{{\partial x}}_{j} - \beta \omega^{2} $$
(6)

\(F_{1}\), \(P_{k}\), \(\alpha\), \(\beta\), \(\beta^{*}\), \(S\), \(\sigma_{k}\),\( \sigma_{{\omega_{2} }}\) and \(\sigma_{\omega }\) are closure parameters. \(P_{k}\) and \(F_{1}\) are the production of turbulence and the blending function, respectively. \(F_{1}\) is obtained from the following equation:

$$ F_{1} = {\text{tanh }}\left\{ {{\text{min }}\left[ {{\text{max}}\left( {\frac{\sqrt k }{{\beta^{*} \omega d}},\frac{500\upsilon }{{\omega d^{2} }}} \right),\frac{{4\rho \sigma_{{\omega_{2} }} k}}{{CD_{k\omega } d^{2} }}} \right]} \right\} $$
(7)

The coefficients of the transport equations (\(\sigma_{k} , \sigma_{\omega } , \alpha and \beta \)) are calculated based on the coefficients of \(k - \omega\) and \(k - \varepsilon\) equations from the following relation:

$$ \varphi = F_{1} \varphi_{1} + \left( {1 - F_{2} } \right)\varphi_{2} $$
(8)

where \(\varphi\) represents the transport coefficients and subscripts 1 and 2 show that the parameter is related to \(k - \omega\) and \(k - \varepsilon\) models, respectively. Eddy viscosity is:

$$ \mu_{t} = \frac{{0.31\alpha^{*} }}{{{\text{max}}\left( {0.31\omega ,F_{2} } \right)}}k $$
(9)

where

$$ F_{2} = {\text{tanh }}\left\{ {{ }\left[ {{\text{max}}\left( {\frac{2\sqrt k }{{\beta^{*} \omega d}},\frac{500\upsilon }{{\omega d^{2} }}} \right)} \right]^{2} } \right\} $$
(10)

With \(a_{1}\), \(\alpha^{*}\) and \(\beta^{*}\) are constant coefficients that are obtained from the k-ω model and d is the distance to the nearest surface.

In this study, a second-order two-dimension finite volume method was applied and SIMPLE algorithm was utilized for coupling pressure–velocity [21]. URNAS models modeled the turbulent property. The kω SST was used because of reported accuracy in previous studies [44]. The discretization method adopts the second-order upwind scheme. The internal iteration of 20 iterations each time was selected. The simulation convergence was checked by monitoring residuals less than 10−6.

The SIMPLE algorithm uses a relationship between velocity and pressure corrections to enforce mass conservation and to obtain the pressure field. If the momentum equation is solved with a guessed pressure field (\(p^{*}\)), the resulting face flux (\(J_{f}^{*}\)), computed from discretization of the Continuity Equation as:

$$ J_{f}^{*} = \widehat{{J_{f} }}^{*} + d_{f} \left( {p_{c0}^{*} - p_{c1}^{*} } \right) $$
(11)

That \(p_{c0}^{*}\),\( p_{c1}^{*}\) are the pressures within two cells on either side of the face. \(\widehat{{J_{f} }}^{*}\) contains the influence of velocities in these cells. The term \(d_{f}\) is a function of linearized coefficients for normal velocities (the average momentum equation coefficients for the cells on either side of the face).This equation does not satisfy the continuity equation. Consequently, a correction (\(J_{f}^{^{\prime}}\)) is added to the face flux (\(J_{f}\)):

$$ J_{f} = J_{f}^{*} + J_{f}^{^{\prime}} $$
(12)

So that the corrected face flux satisfies the continuity equation. The SIMPLE algorithm postulates that \(J_{f}^{^{\prime}}\) be written as:

$$ J_{f}^{^{\prime}} = \widehat{{J_{f}^{^{\prime}} }} + d_{f} \left( {p_{c0}^{^{\prime}} - p_{c1}^{^{\prime}} } \right) $$
(13)

where \(p^{^{\prime}}\) is the cell pressure correction. The SIMPLE algorithm substitutes the flux correction equations [Eqs. (12) and (13)] into the discrete continuity equation to obtain a discrete equation for the pressure correction \(p^{^{\prime}}\) in the cell:

$$ a_{p} p^{^{\prime}} = \mathop \sum \limits_{nb} a_{np} p_{nb}^{^{\prime}} + b $$
(14)

where \(a_{p}\) and \(a_{np}\) are linearized coefficients for cell pressure correction and normal cell pressure correction, respectively. b is the source term and is the net flow rate into the cell:

$$ b = \mathop \sum \limits_{f}^{{N_{{{\text{faces}}}} }} J_{f}^{*} A_{f} $$
(15)

That \(A_{f}\) is the area of face.

2.2 Simulation Set-Up

A pitching NACA0012 airfoil at Reynolds \(1.35 \times 10^{5}\) was selected to optimize the operational parameters of a blowing jet. The airfoil oscillated sinusoidal motion between AOA of − 5° and 25°. The center of oscillations is about its quarter-chord [7]. The equation of motion is:

$$ \alpha = \alpha_{0} + A\sin \left( {2 \pi ft} \right) $$
(16)

In Eq. (16), \(\alpha_{0}\) and A have values of 10° and 15°. The reduced frequency is equal to k = 0.1. With this movement, the airfoil experiences a deep dynamic stall. The schematic of the pitching airfoil is presented in Fig. 1.

Fig. 1
figure 1

The schematic of the pitching airfoil

The momentum coefficient for a blowing jet case is defining as below:

$$ C_{\mu } = \frac{{S_{{{\text{jet}}}} }}{S} \times \frac{{\left( {U_{{{\text{jet}}}} {\text{sin}}\left( \beta \right)} \right)^{2} }}{{0.5 \times U_{\infty }^{2} }} $$
(17)

That \(S_{{{\text{jet}}}}\) and \(\beta\) are the opening length and angle of the blowing jet, respectively. The angle used in defining the momentum coefficient of a blowing jet is presented in Fig. 2.

Fig. 2
figure 2

Definition of the blowing jet angles

2.3 Computational Domain and Boundary Conditions

A structured O-type mesh was generated. The computational domain on each side was considered 19 times the length of the chord. This distance is sufficient to ensure that the entrance conditions did not affect the values of the aerodynamic coefficients. Free stream velocity was assigned to the inlet boundary. No-slip boundary condition was imposed on the pitching airfoil surface. The mesh was divided into three zones; the first two zones moved based on Eq. (1) as dynamic mesh parts. The computational domain, zones of the domain and the mesh in the leading and trailing edges vicinity are shown in Fig. 3.

Fig. 3
figure 3

a Computational domain b Zone of the computational domain c Grid in the vicinity of the leading and trailing edges

2.4 Numerical Verification

According to Tadjfar and Asgari’s [21] study, two separate time scales were considered for time resolution: one was the time scale of vortex shedding moving past the airfoil \(\left( {t_{1}^{^{\prime}} = \frac{c}{U}_{\infty } } \right)\) and another was the time scale of the airfoil oscillation \(\left( {t_{2}^{^{\prime}} = \frac{1}{f}} \right)\). We define the minimum of these two time scales as \(t^{^{\prime}}\)\(\left( {t^{^{\prime}} = {\text{min}}\left( {t_{1}^{^{\prime}} , t_{2}^{^{\prime}} } \right)} \right)\). After several trials, it was found that the time-step size of \(\Delta t = \frac{{t^{^{\prime}} }}{110}\) is sufficient for this unsteady simulation. To ensure that this time step was sufficient and check the independence of simulation to time step choice, we also considered \(\Delta t = \frac{{t^{^{\prime}} }}{220}\).No differences between their results were observed. The time step size effect on aerodynamic coefficients is presented in Fig. 4.

Fig. 4
figure 4

Impact of time-step size on a the lift coefficient b the drag coefficient

The grid resolution study in both directions was performed to verify that the final grid was adequate. The final grid contains the total cell number of 203,000 for the baseline flow. The results of the grid resolution study on the aerodynamic coefficients are presented in Fig. 5. \(\Delta y^{ + }\) values were below 1 over most zones of the airfoil surface, and the maximum value of it was 3.

Fig. 5
figure 5

Impact of grid size on a the lift coefficient b the drag coefficient

Stern et al. [45] indicated that numerical uncertainty (\(\varepsilon_{N}\)) consists of iterative convergence uncertainty (\(\varepsilon_{I}\)), grid-spacing uncertainty (\(\varepsilon_{G}\)) and time-step uncertainty (\(\varepsilon_{T}\)). Therefore, we have:

$$ \varepsilon_{N} = \sqrt {\varepsilon_{I}^{2} + \varepsilon_{G}^{2} + \varepsilon_{T}^{2} } $$
(18)

Enshaei [46] expressed that the uncertainty of \(\varepsilon_{I}\) is negligible. However, the grid spacing and time step were major sources of uncertainty investigated here for pitch airfoil. The simulation results for the various cases of mesh or time refinement including, coarse (S3), medium (S2) and fine (S1) with a refinement ratio \(r_{G }\) are calculated by the following equations:

$$ \left\{ {\begin{array}{*{20}c} {{\Delta }_{S32} = {\text{S}}3 - {\text{S}}2} \\ {{\Delta }_{S21} = {\text{S}}2 - {\text{S}}1} \\ {R_{G} = {\Delta }_{S21} /{\Delta }_{S32} } \\ \end{array} } \right. $$
(19)

where \({\Delta }_{S32}\), \({\Delta }_{S21}\) are the variation of the simulation results for different cases and \(R_{G}\) is the convergence ratio. Jin et al. [47, 48] referred to the method for grid spacing and time step uncertainty analysis. The uncertainties are calculated and presented in Table 1 using the method mentioned in their study. For more details on the calculation, see Jin et al. [48]. Three grids of 203, 400 and 744 thousand were used in \(t^{*} /110\) time step to analyze the mesh uncertainty. The ratio of the average lift to drag coefficient in a period of motion was considered the investigated quantity due to the unsteady flow. In the time step size uncertainty, the mesh was fixed and equal to 203 thousand. Three time steps \(t^{*} /65\),\( t^{*} /110\) and \(t^{*} /220\) were considered for analysis. According to the table, the uncertainty of grid spacing and the time step is 2.126% and 2.053%, respectively. Therefore, the numerical uncertainty is equal to 2.955%.

Table 1 Uncertainty analysis

2.5 Numerical Validation

Our numerical results were evaluated with the experimental result of Lee and Gerontakos [7] and the numerical data of Gharali et al. [49] for validation. These comparisons are presented in Fig. 6. In this figure, hysteresis curves of \(C_{l}\) and \(C_{d}\) with respect to AOA are shown. According to the figure, our simulation predicts \(C_{l}\) relatively well and slightly better than the numerical simulation of Gharali et al. [49] in upstroke movement. However, there are oscillations in our simulation during the downstroke motion that are absent in the experiments. These oscillations are reported and explained in other studies such as Tadjfar and Asgari [21] and Gharali et al. [49]. After the dynamic stall vortex separation and the start of vortex shedding, we face a very complex flow. This complex flow physics reduces the accuracy of the simulation. Therefore, the physics of the flow is so complicated that the URANS approach cannot capture all the phenomena and only reveals the general structures. In addition, usually in experimental research, averaging is done in the structures and eddies, which is the main reason for the smoothness of the experimental results in downward movement. Even large eddy simulation approaches perform poorly when the airfoil comes to dynamic stall conditions and have similar disparities. So, our result is similar to previously reported numerical data at the qualitative and quantitative levels and matches the experimental result. Analogous interpretations can be expressed for the \(C_{d}\) hysteresis.

Fig. 6
figure 6

Hysteresis curve of a the lift coefficient b the drag coefficient

3 Optimization

3.1 Design Variables

This study aimed to find the optimum value for the operational parameters of the blowing jet. So, the jet parameters were considered as the design parameters. The number of design parameters affects the computational cost. If the numbers are too many, the computational costs significantly increase. According to Kamari et al. [35] research, the design variables were chosen in this study. These parameters are jet location, jet opening length, velocity, and angle of jet. Perusing the researchers' paper and investigating the upper and lower bounds of design parameters in their study, we considered the upper and lower bounds of the variables according to Table 2.

Table 2 Design variable bounds

3.2 Optimization Methodology and Objective Function

In this study, machine learning flow control (MLFC) is used. MLFC is a branch of flow control that solves the optimization problem by utilizing machine learning techniques. MLFC has four types: flow control parameter identification such as genetic algorithm (GA), flow control design as a first-kind regression problem for instance artificial neural network (ANN), flow control design as a second-kind regression problem for example genetic Programming (GP), and reinforcement learning flow control. This classification is summarized in Fig. 7. The first type is applied when the structure of the flow control parameter is specified, but the parameters are unknown. When it is necessary to approximate a general nonlinear mapping from flow control parameters to system output, the second type of MLFC is utilized. If we want to optimize the flow control parameter without available mapping and law structure of parameters, we must use the third type of MLFC. This type optimizes only based on the flow control performance (cost function) with different structures of flow control parameters that make them themselves. The last type implements the semi-supervised method. The flow control law is continually updated over control performance changes (rewards) using reinforcement learning. In this study, GA was applied as the optimization flow control parameter and ANN to decrease computational costs.

Fig. 7
figure 7

Machine learning control classification

Our optimization methodology is presented in Fig. 8. Initially, 50 CFD cases are prepared as the initial database. Then, ANNs trained to find the relation between the operational parameters of the jet and the objective function. This training is kept on until the criteria of regression are satisfied. These ANNs are coupled with GA to find the optimum values of parameters. The GA utilizes networks to evaluate individuals. In other words, the GA determines the value of the objective function for cases with different design parameters using networks. After converging GA, the optimum case is simulated and compared with the result of the GA. For this purpose, based on the optimal parameters, the airfoil with the optimal jet automatically meshes and is numerically simulated. After CFD convergence, the value of the mean drag and lift coefficients are obtained, and the objective function is determined based on them. If optimization convergence criteria are satisfied, the algorithm stops. Otherwise, these data add to the database and repeat for a new case.

Fig.8
figure 8

Scheme of optimization methodology

The objective function is one of the main and effective parameters in the optimization method. Finding the jet parameters to maximize aerodynamic performance (lift to drag ratio) is the ultimate purpose of this optimization. In this study, we must consider the objective function in such a way that the function considers the time effect due to the unsteady flow. Therefore, the objective function was chosen minimization of the mean drag coefficient to the mean lift coefficient ratio that is defining as below:

$$ {\text{Objective}}\,\,{\text{ function}} = \frac{{\overline{{C_{d} }} }}{{\overline{{C_{l} }} }} = \frac{{\frac{1}{T}\int_{T} {C_{d} {\text{d}}t} }}{{\frac{1}{T}\int_{T} {C_{l} {\text{d}}t} }} = \frac{{\mathop \sum \nolimits_{i = 1}^{N} C_{di} }}{{\mathop \sum \nolimits_{i = 1}^{N} C_{li} }} $$
(20)

In this relation, T is the time of periodicity and N is the number of time steps in a period.

3.3 Genetic Algorithm

The genetic algorithm is a meta-heuristic algorithm that originated from Darwin's theory and can find optimal values well. One of the important capabilities of GA is to escape from local optimums and converge to the global optimum. This population-based algorithm uses an initial population as the initial generation of individuals and tries to create the next generation in such a way that they are better in terms of the objective function. The criterion of evaluation and competence of individuals is the same as the objective function. It applies selection, transmission, crossover and mutation in individuals and their genes. The general process of the GA is presented in Algorithm 1.

figure a

For each calculation of the objective function, a simulation should be performed. It was not possible in terms of computational cost. The number of the required simulations was decreased by utilizing the neural network to obtain the objective function. The three main operations in the genetic algorithm are selection, crossover, and mutation. Selection is used to choose parents that produce offspring and the population for the next generation. Crossover is utilized to convert two-parent genes into offspring genes. The mutation is a random natural error that causes a change in the offspring's genes. The two main parameters that greatly impact finding the correct optimal point are the population of each generation and the number of generations. Mutation makes a margin of confidence, so the algorithm does not get stuck in the local minimum. Since the neural networks are coupled with it, the calculations for the convergence of the genetic algorithm are not very time-consuming. The properties of GA that were used are given in Table 3.

Table 3 The property of GA

3.4 Artificial Neural Network

Artificial neural networks derived from the human brain have become a powerful tool for machine learning. These tools have provided acceptable results in machine learning, whether supervised, semi-supervised or unsupervised. Therefore, we applied the artificial neural network in this study for function approximation and regression. These networks are made up of units called neurons, which alone do not have much ability, but a network of them has a remarkable ability to learn. Each neuron receives inputs and produces outputs. From a mathematical point of view, each neuron collects the inputs based on its weights, and if it exceeds a limit activation, it produces the output as a function of the inputs, weights and activation. Learning aims to correctly determine the value of weights and the activation threshold of neurons to bring the desired input to the desired output. An iterative algorithm determines these parameters. The general algorithm of the learning process in artificial neural networks is presented in Algorithm 2. A neural network consists of at least three input, hidden and output layers. When the number of hidden layers is more than one, we are faced with networks that are called deep neural networks (DNNs). This network's learning process consists of forward feeding and backward propagation. In the forward section, values of weights are easily determined based on the inputs, and this step ends with the determination of the outputs. The backward propagation step compares the network outputs with the desired outputs. Based on Algorithm 3, the error is propagated from output layer neurons to the other layer’s neurons, and the weights are updated. This process is performed for all the training data. The termination condition is that the training data's network output errors are minimal.

figure b
figure c

Two neural networks were trained, one for the relation between jet parameters and the mean of lift coefficient over a period and the other for the relation between jet parameters and the mean of drag coefficient over a period. Because our problem was a regression and function approximation, the multilayer perceptron (MLP) neural network was used. This type of network is supervised learning-based, so it requires initial and labeled data for training. An initial database containing 50 simulation samples has been prepared. In our study, these networks have been online trained. It means the networks are retrained each time the optimal values are obtained from GA and simulation is done. This online training method is also named active learning. The utilized neural network architecture is presented in Fig. 9, and the property of these networks is given in Table 4.

Fig. 9
figure 9

Architecture of Artificial Neural Networks

Table 4 The property of ANN

4 Results and Discussion

In this study, the dynamic stall of the airfoil and its separation were controlled by a machine-learning controller mechanism. For this work, the blowing jet with optimal operational parameters was used. To find the optimal point correctly, we ensured that every part of our methodology did its tasks correctly. Therefore, the result of each part of the algorithm was checked. The algorithm converged after almost 115 simulations (with initial data). The ANNs in the last simulation were able to predict the input data with 92% and 93% regression coefficients for average drag and lift coefficient values in terms of the operational parameters of the jet, respectively. The comparison of the predicted and input data is presented in Fig. 10. This figure shows that ANNs were trained well and could make acceptable predictions of the mean lift and drag coefficients with given inputs (design variables). GA was coupled with these ANNs and got the fitness function for each individual quickly from these networks. Figure 11 presents the convergence of the genetic algorithm. According to this figure, each generation's population and the number of generations were sufficient because, as it can be seen, from the 40th generation, the average and the best fitness of each generation are almost equal. It should be noted that each case of this simulation with the Intel(R) Core(TM) i7-4790 CPU series system took about one day, and the entire optimization process (115 Cases) took about 115 days.

Fig. 10
figure 10

ANNs’ data for a the average of lift and b the drag coefficient

Fig. 11
figure 11

Convergence of the genetic algorithm

Variation of design parameter versus optimization loop iteration is plotted in Fig. 12. The first fifty iterations are initial data picked randomly. As presented in Fig. 12a, the jet's location is beginning to converge to the optimal value from iteration 80 and the range of optimal location is between 2 and 5% chords. There is a range for the optimal location because the angle of the jet can change. We found that the area and velocity of the jet have a great effect on improving aerodynamic performance and they converge to the upper bound. According to Eq. (17), these parameters want to maximize the jet momentum coefficient. Variations of velocity and area of the jet can be seen in Fig. 12b and c, respectively. As can be observed, these parameters quickly converged to their upper limit values. In Fig. 12b for jet opening length, data fluctuate between two values. The reason for the fluctuation between the upper and lower limit in the opening length variable is the change in the jet angle. However, after this parameter has converged, the opening length has also converged to its maximum. The bigger the opening, the better the performance of the flow controller. Nevertheless, the energy consumption will be high and the existence of the jet will be economically and technically unjustifiable. Therefore, a reasonable upper limit should be chosen, which has been discussed in detail by Kamari et al. [35]'s study. The convergence behavior and variations of the blowing jet angle relative to the chord axis (θ) and relative to the local surface (β) are presented in Fig. 12d and e, respectively. According to the figures, a wide range can consider for the optimal jet angle. This phenomenon was seen in the optimization method of Kamari et al. [40] for the static stall of an airfoil. This phenomenon is because the algorithm earns almost the same objective function value for all angles in this range and the objective function does not separate these values well. Hence, the algorithm converges to one of these values each time. It should be noted that in such cases, the performance of the jet is outstanding and similar. The range of optimal value for jet angle relative to the chord axis is 55°–70° and relative to the local surface is 30°–45°. According to Eq. (17), this range of angle makes the jet momentum coefficient not maximize. Therefore, the jet momentum coefficient is unnecessary to converge to the upper band for the optimal blowing jet. Figure 12f also indicates this issue.

Fig. 12
figure 12

Variation of design parameter versus optimization loop iteration

Mean aerodynamic performance versus the design parameter is presented in Fig. 13. As can be seen, the aerodynamic performance changes at a constant value of the design parameter and there is a large functional difference in the optimal location and momentum ratio range. Therefore, two jets with approximately similar locations with different performance coefficients (Case A and B) and two jets with approximately similar jet momentum ratios with different performance coefficients (Case A and C) have been selected to investigate the reason for this issue. These cases are represented in Fig. 13. Since the parameters of simulations were stored in an excel file, it is easy to find these cases and extract the relevant jet parameters for them. The specifications of the jets are presented in Table 5. Studies have shown that these drastic changes occur due to the inadequacy of other design parameters. The jet with the optimal momentum coefficient operates improperly in flow control because of the unsuitable location and the optimum location due to the inadequacy of the parameters required for the jet momentum coefficient (angle, opening length, and velocity of the blowing jet).

Fig. 13
figure 13

Mean aerodynamic performance relative to a the jet location b the jet momentum coefficient

Table 5 Specifications of jets in Fig. 13

Presented in Fig. 14 are the distribution of the pressure coefficient on the upper and lower surfaces of the airfoil for the three cases examined in Table 5 and the uncontrolled case over one pitching time cycle. The jet location is the same for cases A and B, and the jet momentum coefficient is the same for cases A and C. The flow has not separated much in the uncontrolled case at t = 0, so the pressure distribution is the same for the four cases. Only we observe a peak at the jet location for the cases with jets due to the momentum resulting from the blowing jet. By moving toward t = T/2, the airfoil locates at the angle of attack 25°, and the effect of the leading edge in creating lift decreases so that the share of force generation near the trailing edge is higher than the leading edge in the uncontrolled case. In the B and C cases, although the production force caused by the part near the leading edge is more than the trailing, the jet could not control the flow well because the jet momentum coefficient is insufficient. In case A, the negative level of the pressure coefficient diagram in the suction surface is significantly increased near the leading edge, which indicates that the flow is controlled and the lift coefficient is increased. At time t = T/2, the airfoil is moving downwards at an angle of attack of 10°. The separation is reduced and the flow begins to attach for the uncontrolled case. In case B, we see an increase in the force at the trailing edge at this time due to the delay and not the complete elimination of the leading edge vortex, but the flow is controlled in the other two cases. At the t = 3 T/4, the flow is fully attached when the angle of attack is − 5. It can be seen in the CP diagram of the uncontrolled. In other cases, the pressure graphs are almost similar to the uncontrolled case and have only shifted above near the jet location.

Fig. 14
figure 14

Distribution of pressure coefficient over one pitching time cycle for a Case A, b Case B, c Case C, d Uncontrolled

For better comprehension, the streamline of these cases is shown in Fig. 15 for the angle of attack 25° in upstroke motion. As can be observed, since case B does not have a suitable jet momentum coefficient, the trailing-edged vortex (TEV) is formed at angle of 25°. The dynamic stall occurs, so the jet cannot control the flow. Its separation is significant so that even the flow near the leading edge is completely separated. For case C, which can control the flow, the jet is not in the right place, so it still cannot eliminate the separation of the leading edge. Still, the flow remains attached almost to the leading edge in case A. Therefore, performance is improved significantly. In contrast, the separation occurs from trailing and leading edges in case (d). Also, the LEV and TEV have been formed, significantly increasing the drag coefficient and decreasing the lift coefficient.

Fig. 15
figure 15

Streamlines at the angle of attack 25 in upstroke motion for a Case A, b Case B, c Case C, d Uncontrolled

The boundary-layer velocity profiles are presented at different chordwise positions on the surface of the airfoil in Fig. 16. Three cases indicated in Table 5 and the uncontrolled case over one pitching time cycle are selected for this investigation. According to figure, there is not much difference between the velocity profiles at t = 0 for different cases because there is slight separation. Only the velocity along the x-axis has increased slightly at the beginning due to the jet's presence. As we move away from the leading edge, the other blowing jets' (Case B and C) behavior becomes closer to Case A jet. In the t = T/4, due to the proximity to the dynamic stall angle, we see a lot of flow separation. This separation in the uncontrolled case is accompanied by a positive pressure gradient, which has caused the direction of the velocity vectors to change against the free flow. The better the performance of the blowing jet, the more this pressure gradient is damped. We can see the disappearance of the positive pressure gradient and no change in the direction of the velocity profile in the boundary layer in Case A that the parameters of the jet have been well chosen. In the t = T/2, we observe a positive pressure gradient, which has caused the direction of the velocity vectors to change against the free flow. This positive pressure gradient is due to the shedding vortex under downward movement after a dynamic stall. The blowing jets of Case B and C could not change the pressure gradient, and their boundary layer profile at this time is similar to the uncontrolled case, but Case A was able to overcome this pressure. In time t = 3 T/4, we do not have much separation. Therefore, the velocity boundary layer profile of all the cases is similar. Only the velocity profile is more stretched toward the free flow in the cases with blowing jets because of the increased momentum.

Fig. 16
figure 16

The boundary-layer velocity profiles at different chordwise positions on the surface of the airfoil over one for pitching time cycle a t = 0, b t = T/4, c t = T/2, d t = 3 T/4

Several jets with different mean lift to drag ratios have been selected to investigate the physics of the flow. The specifications of the jets are presented in Table 6. Case 3 was the optimal case that existed in our database. The lift and drag hysteresis for these jets are presented in Fig. 17. As can be seen, case 1 is behaviorally and functionally very similar to the uncontrolled case, which indicates that the jet parameters were not selected correctly. Therefore, case 1 could not control the flow properly. The two cases 2 and 3 are almost the same behavior, and the jets were able to control the flow. In case 1, the momentum coefficient is so low that the jet is practically ineffective and this seems that there is no jet. We already found that the momentum coefficient does not need to maximize for the optimal case but should not be so low that the jet loses its effect on flow. This low momentum ratio jet caused the behavior of case 1 to be similar to the uncontrolled case. Examining the characteristics of cases 2 and 3, we conclude that the difference between these two jets is in the blowing angle. The sensitivity of the drag coefficient to the jet angle variations is greater than the lift coefficient. Therefore, the drag coefficient is the reason for the significant difference in performance. At the upstroke motion in the lift coefficient hysteresis, the two cases have the same behavior and are only slightly different in the downward movement.

Table 6 Specification of the selected jets
Fig. 17
figure 17

Hysteresis curve of the a lift coefficient b drag coefficient

Vorticity contours for selected jets in Table 6 are presented in Fig. 18. As can be seen, at the beginning of the movement and the angle of attack 10° in upstroke movement, all jets act the same and like the uncontrolled case. There is no difference in their vorticity contour. Only the difference between two cases 2 and 3 can be observed on the airfoil surface. The upper part of the airfoil surface has positive vorticity due to the blowing jet for cases 2 and 3, but this positive vorticity is not visible in case 1 because the impact of the jet is low. With the increasing angle and continued motion, the effect of the jets becomes more evident. In cases 2 and 3, dynamic stall vortex (DSV) is not seen at 20° in upstroke motion and most of the flow is attached. However, DSV is forming and growing in case 1. The turbulent separation vortex (TSV) is formed simultaneously with the formation of LEV and downward movement. By combining these two vortices, DSV is formed. This final clockwise vortex, created from the combination of two clockwise vortexes, moves downward and continues to grow. Until it finally separates from the airfoil surface and causes the dynamic stall. At the angle of 25° in upstroke movement, dynamic stall occurred and DSV separated even though TEV had been formed in two cases (uncontrolled case and case 1). Nevertheless, this has yet to happen for cases 2 and 3. In case 2, the flow was separated more than in case 3. This issue has caused more separation in the downstroke movement for case 2 compared to case 3, while we see a deep separation for another two cases (case 1 and uncontrolled case). The flow is starting to attach to the airfoil surface by decreasing the angle in downstroke movement for all cases.

Fig. 18
figure 18

Vorticity contours for specific jets

5 Conclusions

Machine learning flow control (MLFC) was utilized to find the optimum operating parameters of active flow control in a NACA0012 airfoil under dynamic stall conditions. Airfoil pitched between angles of attack of − 5° and 25° with sinusoidal movement. The sinusoidal motion of the airfoil was about its quarter-chord. The genetic algorithm (GA) was applied as the optimization method, and deep artificial neural networks (DANNs) were trained to predict the objective function regarding the jet operational parameters. Using machine learning caused the computational cost of optimization to be reduced. The design variables of the jet were considered, including location, opening length, velocity and blowing angle. The ratio of the mean drag coefficient to the mean lift coefficient over a period of oscillation \(\left( {\frac{{\overline{{C_{d} }} }}{{\overline{{C_{l} }} }}} \right)\) was chosen as the objective function. The optimized jet increased the average aerodynamic performance by 4.717 times. This improvement is associated with a decrease of 2.452 times in the mean drag coefficient and an increase of 1.937 times in the mean lift coefficient. The results showed that in the optimal jet, the jet momentum coefficient is not maximum while the velocity and opening length of the jet converged to their upper band value. The jet location and angle do not converge to a specific value, and an optimal range can be considered. The optimal location is between 2 and 5% of the chord, and the optimal blowing jet angle (θ) is 55°–70°. The optimal jet could improve the mean of the aerodynamic performance significantly in comparison with the uncontrolled case. The reason for the drastic change in these parameters during the optimization process was studied by surveying the impact of design parameters on the mean aerodynamic performance. Results showed that these drastic changes occur due to the inadequacy of other design parameters. Examination of the vorticity contour for the jets with different mean performances revealed that suppression and postponement of the LEV and DSV are the main factors for controlling the flow of the dynamic stall. The optimal jet does not permit LEV to be grown and postponed it. This action makes DSV, a combination of LEV and TSV, not form. In addition, the lack of a dynamic stall causes the non-formation of TEV. Investigation of the hysteresis diagrams exhibited that the effect of the jet is more visible in the downstroke flow and improves the coefficient of lift and drag significantly in the downstroke.

Briefly, the following main results can be considered as Remarks:

  • The optimized jet increased the average aerodynamic performance by 4.717 times.

  • In the optimal jet, the jet momentum coefficient is not maximum while the velocity and opening length of the jet converge to their upper band value.

  • The optimal location is between 2 and 5% of the chord and the optimal blowing jet angle (θ) is between 55° and 70°.

  • Suppression and postponement of the LEV and DSV are the main factors for controlling the flow of the dynamic stall.

  • The effect of the jet is more visible in the downstroke flow and improves the coefficient of lift and drag significantly in the downstroke.