## 2 Numerical Modeling and Validation
### Validation of Computation  
During the oscillation of the flapping foil, continuous changes occur in both its position and velocity, accompanied by a significant non-steadiness in the surrounding flow field. Given these dynamic circumstances, the grid division of the flow field and time step utilized in numerical simulation iterations can significantly impact calculation outcomes. To ensure the independence of numerical solutions from the chosen time step and grid, it is imperative to conduct verification tests for time step independence and grid independence before delving into specific research endeavors. To investigate time step independence, three distinct time intervals (quantified as 1200, 2400, and 4800 steps per cycle), have been thoroughly examined. In Figure 3, the change values of the resistance coefficient (\(C_{D}\)), lift coefficient (\(C_{L}\)), and power coefficient (\(C_{P}\)) throughout one cycle are depicted for different time steps. The curves converge notably at 2400 and 4800 steps per cycle, demonstrating excellent agreement. For clarity, Table 1 presents the average power coefficient values and deviations for different time steps. Notably, in reference to the third time step, the relative difference between intermediate time step 2 and time step 3 is merely 0.25%. Striking a balance between calculation accuracy and computational cost, we have selected 2400 steps per cycle for subsequent calculations. The mesh independence of the NACA0015 airfoil is further verified under conditions analogous to a time independence verification, i.e., using three mesh strategies with airfoil surface sizes set to 0.002 m, 0.001 m, and 0.0005 m, resulting in grid quantities of 7.0 \(\times\) 10\({}^{4}\), 1.5 \(\times\) 10\({}^{5}\), and 3.2 \(\times\) 10\({}^{5}\). In Figure 4, the change values of resistance coefficient \(C_{D}\), lift coefficient \(C_{L}\), and power coefficient \(C_{P}\) in one cycle under three grid numbers are presented. Notably, for the medium and fine meshes, the curves of the coefficients tend to be consistent. The average power coefficient values and deviations under different grid numbers are provided in Table 2, with a relative difference between the medium and fine meshes of 0.16%. Thus, grid number 1.5 \(\times\) 10\({}^{5}\) is adopted for subsequent calculations. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Time Criterion** & **Time Steps/Cycle** & **Cells** & \(C_{Pm}\) & **Deviation** \\ \hline Coarse & 1200 & \(1.5\times 10^{5}\) & 0.8954 & 1.87\% \\ Medium & 2400 & \(1.5\times 10^{5}\) & 0.9102 & 0.25\% \\ Fine & 4800 & \(1.5\times 10^{5}\) & 0.9125 & - \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Average total power coefficients and deviations at different time steps. Figure 3: Time independence verification curve. (**a**) Resistance coefficient curve; (**b**) lift coefficient curve; and (**c**) power coefficient diagram. To validate the established numerical simulation method, calculations with time steps of 2400 and a grid number of 1.5 \(\times\) 10\({}^{5}\) are compared with [PERSON] [11]. Figure 5a-c display the comparison results under the chosen operating condition, demonstrating a remarkable congruence in the dynamic transient characteristic parameters. Additionally, a further validation against [PERSON]'s extended research [37] is presented in Figure 5d, where the energy harvesting efficiency of the flapping foil exhibits a consistent congruence, particularly at higher levels of energy harvesting efficiency. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Mesh Criterion** & **Surface Grid Size/m** & **Cells** & **Time Steps/Cycle** & \(C_{Pm}\) & **Deviation** \\ \hline Coarse & 0.002 & \(7.0\times 10^{4}\) & 2400 & 0.8916 & 0.47\% \\ Medium & 0.001 & \(1.5\times 10^{5}\) & 2400 & 0.8944 & 0.16\% \\ Fine & 0.0005 & \(3.2\times 10^{5}\) & 2400 & 0.8958 & - \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Average total power coefficient and deviation for different numbers of mesh cells.