# Propulsion Performance of the Full-Active Flapping Foil in Time-Varying Freestream
## 2 Problem Description and Methodology
### Numerical Methods and Validation  
Based on the sliding mesh technology, the computational domain and boundary conditions for 2D flapping foil is illustrated in Figure 2. We use PointWise software to mesh the 2D flapping foil. The entire computation domain is \(120c\times 120c\), the inner grid diameter is \(35c\). The inlet, outlet, upper wall and low wall are divided into 25 equal parts, the sliding interface is divided into 120 equal parts, and the foil wall is divided into 600 equal parts. The height of the first layer near the foil is set to \(10e^{-5}\), and grows 30 layers at a rate of 1.1, which ensures \(y^{+}<1\). The flow distribution in the viscous sub-layer and transition layer of the foil surface is solved by using the Navier-Stokes (NS) equation discretely. We use a sliding interface to divide the simulation domain into the inner grid and outer grid. The rigid movement of the inner grid can ensure that the inner grid is undeformed and improves the calculation accuracy near the foil. Referring to Equations (1) and (2), we program the user defined functions(UDFs) to control the heaving and pitching motions of the inner grid. With the motion of the inner grid, the outer grid adjusts adaptively. The inlet condition for time-varying flow velocity is controlled by the UDFs according to Equation (3). The outlet condition is a pressure outlet, and the upper and lower wall is symmetry. The Reynolds number is \(Re\) = 42,000, the Sparat-Allmaras turbulence model is used, and the SIMPLE algorithm is selected for pressure-velocity coupling calculation. The discrete methods of gradient and pressure are least squares cell-based and second-order discrete, respectively. Momentum, turbulent flow energy and turbulent dissipation rate are all selected in second-order upwind. Time discretization is set second-order implicit format. The convergence condition of velocity and continuity is \(1e^{-5}\). The judgment condition for the periodic simulation is that the change rate of the mean value of the instantaneous thrust coefficient is less than 1%. According to different simulation parameters of flapping foil, a stable periodic solution of the flapping foil can be obtained after 10 cycles.  
To verify the simulation strategy, the grid, time independence and validation are studied in our previous research [10]. We simulated four grid and time-steps levels. The comparison of the mean value of thrust coefficient, lift coefficient and propulsion efficiency corresponding to the different grid and time-steps levels is shown in Table 1. In order to ensure the accuracy and calculation efficiency, we chose the mesh and time step as 80,000 cells and 800 time-steps for all simulation cases. We also validated the current strategy against the classic literature [36] under the same conditions, as shown in Figure 3, and found that the result agrees well with the [PERSON] and Dumas, which confirm the simulation strategy of this paper is credible and accurate.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Grid** & **Time Step** & \(\overline{C_{PO}}\) & \(\overline{C_{PI}}\) & \(\eta\) \\ \hline \multirow{2}{*}{80,000 cells} & 800 ts & 6.264 & 21.573 & 29.038\% \\  & 1600 ts & 6.293 & 21.752 & 28.930\% \\ \hline \multirow{2}{*}{160,000 cells} & 800 ts & 6.327 & 21.893 & 28.9\% \\  & 1600 ts & 6.407 & 22.210 & 28.846\% \\ \hline \hline \end{tabular}
\end{table}
Table 1: Grid and time independence.  
Figure 2: Computational domain and boundary conditions for two-dimensional (2D) flapping foil.