1. Introduction
Fish schooling, which can be observed over a wide range of aquatic environments, is one of the most interesting biological phenomena on the Earth (Lopez et al. Reference Lopez, Gautrais, Couzin and Theraulaz2012). What is the function of such collective locomotion? It has attracted the curiosity of biologists, physicists and engineers for a long time (Krebs Reference Krebs1976; Larsson Reference Larsson2012). Although some social traits have been proposed (Larsson Reference Larsson2012), it still poses many open questions (Romanczuk, Couzin & Schimansky-Geier Reference Romanczuk, Couzin and Schimansky-Geier2009). From the fluid mechanics perspective, the hydrodynamic interaction between individuals may be important for the emergence of collective motion (Weihs Reference Weihs1973; Lighthill Reference Lighthill1975). By using living fish schools, it has been shown that a hydrodynamic benefit can be achieved by individuals through the collective motion, such as reducing energy consumption (Liao et al. Reference Liao, Beal, Lauder and Triantafyllou2003; Marras & Porfiri Reference Marras and Porfiri2012; Marras et al. Reference Marras, Killen, Lindstrom, Mckenzie, Steffensen and Domenici2015; Ashraf et al. Reference Ashraf, Godoy-Diana, Halloy, Collignon and Thiria2016). However, since the number of bodies in fish schools is huge (larger than hundreds), the hydrodynamic interaction between individuals is very complex and thus hard to measure. As a consequence, the hydrodynamic function for fish schools is still poorly understood.
To further investigate the hydrodynamic interaction in fish schools, the group is simplified as a model consisting of two flapping foils arranged in regular formations. It has been shown that the foils can achieve a hydrodynamic benefit in various arrangements, such as tandem formation and side-by-side formation (Dong & Lu Reference Dong and Lu2007; Boschitsch, Dewey & Smits Reference Boschitsch, Dewey and Smits2014; Kurt & Moored Reference Kurt and Moored2018). In the side-by-side formation, the phase difference significantly influences the hydrodynamic interaction (Gungor & Hemmati Reference Gungor and Hemmati2020). The thrust of each foil can be increased when they have antiphase motions, but decreased for in-phase motions, as compared with an isolated one (Dewey et al. Reference Dewey, Quinn, Boschitsch and Smits2014). In the tandem formation, the performance of the follower is obviously affected by the hydrodynamic interaction, since the effective angle of attack of the follower is changed by the vortices shed from the leader (Xu, Duan & Xu Reference Xu, Duan and Xu2017). The follower can generate a larger thrust when it slaloms between vortices, but produces smaller thrust when it intercepts the vortices, as compared with a single foil (Muscutt, Weymouth & Ganapathisubramani Reference Muscutt, Weymouth and Ganapathisubramani2017). Moreover, the performance of the leader is also influenced by the hydrodynamic interaction (Lagopoulos, Weymouth & Ganapathisubramani Reference Lagopoulos, Weymouth and Ganapathisubramani2020). When the distance between them is small, the leader can achieve a performance enhancement (Khalid, Akhtar & Dong Reference Khalid, Akhtar and Dong2016; Maertens, Gao & Triantafyllou Reference Maertens, Gao and Triantafyllou2017). Furthermore, Saadat et al. (Reference Saadat, Berlinger, Sheshmani, Nagpal, Lauder and Haj-Hariri2021) pointed out that there are two mechanisms by which two tandem foils can obtain hydrodynamic benefit, i.e. the vortex suction effect on the leading edge of the follower, and the added-mass push effect on the trailing edge of the leader. However, it should be pointed out that the regular formations in these previous studies are artificially fixed. Namely, the effect of hydrodynamic interaction on the movement of the flapping foils is neglected. Consequently, the stability of the regular formation in which a hydrodynamic benefit can be achieved by the flapping foils is still unknown.
On the other hand, in order to investigate the dynamic response of an individual to the hydrodynamic interaction, a simplified model consisting of two self-propelled flapping foils has been proposed. It is found that the hydrodynamic interaction strongly influences the self-propulsion of two foils (Zhu, He & Zhang Reference Zhu, He and Zhang2014). For two foils initially in side-by-side formation, the hydrodynamic interaction can result in three types of regular formations, i.e. staggered formation, alternate-leading formation and side-by-side formation, and which one occurs depends on the lateral separation distance and the phase difference between the two foils (Dai et al. Reference Dai, He, Zhang and Zhang2018; Park & Sung Reference Park and Sung2018; Peng, Huang & Lu Reference Peng, Huang and Lu2018). For two foils initially in tandem formation, there are compact and sparse formations, and which one occurs depends on the initial distance and the phase difference between the two foils (Zhu et al. Reference Zhu, He and Zhang2014; Lin et al. Reference Lin, Wu, Zhang and Yang2019b). In the compact formation, velocity enhancement can be achieved by the two foils (Lin et al. Reference Lin, Wu, Zhang and Yang2019b; Ryu et al. Reference Ryu, Yang, Park and Sung2020). In the sparse formation, the follower always intercepts the vortices shed from the leader (Ramananarivo et al. Reference Ramananarivo, Fang, Oza, Zhang and Ristroph2016; Lin et al. Reference Lin, Wu, Zhang and Yang2019b), instead of slaloming between the vortices, and the follower has an energetic advantage as compared with the isolated one (Zhu et al. Reference Zhu, He and Zhang2014; Lin et al. Reference Lin, Wu, Zhang and Yang2019b). This is different from the result of previous studies in which two flapping foils are fixed in tandem formation (Muscutt et al. Reference Muscutt, Weymouth and Ganapathisubramani2017). It should be pointed out that in the previous self-propelled model, the flapping foils were free only in the longitudinal direction, and they were restrained in the lateral direction. Moreover, when a flapping foil is free in the lateral direction, it would swim on the outside of the reverse Kármán vortex street (Lin et al. Reference Lin, He, He and Wang2018). It seems that both longitudinal and lateral freedom are important for the hydrodynamic schooling behaviour of flapping swimmers. In fact, individuals in fish schools are free in multiple directions during their collective locomotion. However, few studies focus on the hydrodynamic interactions between individuals which are free in multiple directions (Lin et al. Reference Lin, Wu, Zhang and Yang2021).
To better understand the collective motion of fish schools, the performance of two tandem flapping foils, which are free in both the longitudinal and lateral directions, are numerically studied in this paper. The current work differs from previous studies in several ways. In most of the previous studies (Zhu et al. Reference Zhu, He and Zhang2014; Ramananarivo et al. Reference Ramananarivo, Fang, Oza, Zhang and Ristroph2016; Lin et al. Reference Lin, He, He and Wang2018, Reference Lin, Wu, Zhang and Yang2019b), only one degree of freedom in the longitudinal or lateral direction was considered. Consequently, the first difference of the current study is that flow-mediated organization in both longitudinal and lateral directions are simultaneously implemented, i.e. the two-dimensional collective locomotion between two swimmers has been studied here. Although a similar model has been used in our previous study (Lin et al. Reference Lin, Wu, Zhang and Yang2021), only the situation where two foils are initially arranged in the side-by-side formation was considered, in which the lateral interference between two swimmers dominates their collective dynamics. However, when two swimmers are initially arranged in tandem formation, their two-dimensional schooling behaviour has not been studied. Therefore, the second difference of the current work is that the two-dimensional schooling behaviour of two tandem swimmers is mainly considered. It is still an open question whether a two-dimensionally stable formation can be achieved through hydrodynamic interactions by two swimmers initialized in a tandem configuration. Some previous studies have pointed out that for multiple swimmers which are free in two dimensions, a specific control algorithm is necessary to maintain a regular formation (Gazzola, Hejazi & Koumoutsakos Reference Gazzola, Hejazi and Koumoutsakos2014; Verma, Novati & Koumoutsakos Reference Verma, Novati and Koumoutsakos2018). The specific aim here is to demonstrate that sparse formations can be achieved by two swimmers that are free in two dimensions via only hydrodynamic interactions, without any control algorithm. The remainder of this paper is organized as follows. The problem description and methodology are presented in § 2. The simulation results are addressed in detail with discussion in § 3. Finally, some conclusions are drawn in § 4.
2. Problem description and methodology
In this paper, a two-dimensional model consisting of two flapping foils initially in tandem formation is proposed, as shown in figure 1(a). Each foil is driven by a harmonic pitching motion, i.e.
where θ(t) is the instantaneous pitching angle of each foil, θm and f are respectively the pitching amplitude and frequency, and t is the time. In this work, the pivot location of each foil is fixed at 0.05c. The self-propulsion of each foil is controlled by Newton's second law, which can be described as (Lin, Wu & Zhang Reference Lin, Wu and Zhang2020)
where X = (X, Y) is the position vector of the pivot point of each foil, F = (Fx, Fy) is the hydrodynamic force applied on each foil surface, which is calculated through integrating the local hydrodynamic forces over the whole body, and
$m = {\rho _s}s$ is the mass of each foil, where
${\rho _s}$ and s are respectively the density and area of the foil. When a fish is swimming in a flow, its gravity is equal to the buoyancy generally, i.e. the flow mass with equivalent volume of fish is the same as that of fish. Thus, the mass ratio is chosen as
$\bar{m} = m/{m_f} = 1$ in this study, where
${m_f} = {\rho s}$ is the flow mass with equivalent area, and
$\rho$ is the fluid density. It should be pointed out that the rotational degrees of freedom of each foil are constrained, since only the cruising motion of fish schools is considered, and the turning manoeuvre of fish schools is neglected here.
Sketch view of (a) the simulation model and (b) the computational grid. Here b is the thickness of each foil, and c is the chord length of each foil.

The separation distance between two foils, i.e. Dx and Dy, are respectively defined as
where (X 1T, Y 1T) is the coordinate of the trailing edge of foil 1, and (X 2L, Y 2L) is the coordinate of the leading edge of foil 2.
The cycle-averaged velocity of each foil can be calculated as
\begin{equation}\left.
{\begin{array}{l@{}}
{{{\bar{u}}_x} = \dfrac{1}{T}\displaystyle\int_0^T {{u_x}\,\textrm{d}t} =
\dfrac{1}{T}\int_0^T {\left( {\dfrac{{ -
\textrm{d}X}}{{\textrm{d}t}}} \right)\textrm{d}t} ,}\\
{{{\bar{u}}_y} = \dfrac{1}{T}\displaystyle\int_0^T {{u_y}\,\textrm{d}t}
= \dfrac{1}{T}\int_0^T {\left(
{\dfrac{{\textrm{d}Y}}{{\textrm{d}t}}} \right)\textrm{d}t,}
} \end{array}}
\right\}\end{equation}
where T is the flapping period. Meanwhile, the cycle-averaged power consumption of each foil is defined as
where M is the hydrodynamic torque applied on each foil surface, which is calculated through integrating the local hydrodynamic torques over the whole body.
The propulsive efficiency of the two-foil system can be calculated as
\begin{equation}\eta = \frac{{\sum\limits_{i = 1}^2 {{{\bar{E}}_{ik}}} }}{{\sum\limits_{i = 1}^2 {({{\bar{P}}_i}\,T)} }},\end{equation}
where
${\bar{E}_k} = (m/(2T))\int_0^T {[{{(\textrm{d}X/\textrm{d}t)}^2} + {{(\textrm{d}Y/\textrm{d}t)}^2}]\,\textrm{d}t}$ is the cycle-averaged kinetic energy of each foil.
The flow is considered to be incompressible and viscous, and the flow motion is governed by the Navier–Stokes equations as follows:
where u is the flow velocity vector, p is the pressure, and
$\nu$ is the kinematic viscosity of the fluid. A simplified circular function-based gas kinetic method (Yang et al. Reference Yang, Shu, Yang and Wang2017) is used to solve the Navier–Stokes equation, and the implicit velocity correction-based immersed boundary method (Wu & Shu Reference Wu and Shu2009) is used to resolve the interaction between the flapping foils and the surrounding flow. For more details about the numerical method adopted, please refer to our previous work (Wu & Shu Reference Wu and Shu2009; Yang et al. Reference Yang, Shu, Yang and Wang2017; Lin, Wu & Zhang Reference Lin, Wu and Zhang2019a). The numerical method and corresponding code have been validated for flapping foil simulations over a wide range of kinematics (Lin et al. Reference Lin, Wu and Zhang2019a,Reference Lin, Wu, Zhang and Yangc, Reference Lin, Wu and Zhang2020).
In the current work, the grid is of size 100c × 20c, in which the region of 90c × 10c is discretized by a uniform grid with spacing of Δx = 0.01c, as shown in figure 1(b). The no-slip boundary condition is applied on the foil surface, and the Neumann boundary conditions are applied to the entire boundaries of the computational domain (i.e.
$\partial \boldsymbol{u}/\partial {x_{x = 0,100c}} = \partial \boldsymbol{u}/\partial {y_{y = 0,20c}} = 0$). The sensitivity test has been accomplished and reported in our previous studies (Lin et al. Reference Lin, He, He and Wang2018, Reference Lin, Wu and Zhang2020). In addition, the length is non-dimensionalized by using c, the time is scaled by
${10^{ - 2}}{c^2}/(2\nu )$, the velocity is scaled by
$U = {10^2}\nu /(0.5c)$, and the Reynolds number is defined as
$Re = Uc/v$.
3. Results and discussion
3.1. Emergence of stable formations
In this paper, the self-organization of two flapping foils that can self-propel in both x- and y-directions is numerically investigated. The control parameters used in the current work are listed in table 1, in which the flapping parameters are based on the kinematic data of fish and cetaceans in Nature (Rohr & Fish Reference Rohr and Fish2004). Initially, two foils are arranged in tandem formation, i.e. Dx 0 = 0.5 and Dy 0 = 0. The variables are flapping frequency ( f) and amplitude (θm). The results are illustrated in figure 2. It is surprising that two tandem swimmers that are free in two dimensions can spontaneously achieve stable formations via only hydrodynamic interactions, without any control algorithm. Moreover, it can be seen from figure 2 that large amplitude and high frequency are necessary for the stable formation.
Values of the control parameters used in the current simulations. The delta symbol denotes the value by which the parameter is incremented.

Phase diagram for the regular formations on the f − θm plane (Dx 0 = 0.5, Dy 0 = 0). In panel (a), the blue circular symbol represents the semi-tandem formation (as shown in (bI)), the green diamond symbol represents the staggered formation (as shown in (bII)), the red square symbol represents the transitional formation (as shown in (bIII)), and the grey cross symbol represents the case that is unable to form a stable formation.

Based on the absolute value of the cycle-averaged distance between two foils in the y-direction, i.e.
$|{\bar{D}_y}|$ (
$= \left|{(1/{T^\ast })\int_0^T {{D_y}\,\textrm{d}t} } \right|$, where T* is the oscillating period of Dy), three types of regular formations can be classified for two flapping swimmers, i.e. semi-tandem formation (the blue circular symbol in figure 2a) in which
$0 < |{{{\bar{D}}_y}} |< 0.5A$ (as shown in figure 2bI, where A is the peak-to-peak amplitude of the trailing edge of the pitching foil), staggered formation (the green diamond symbol in figure 2a) in which
$|{{{\bar{D}}_y}} |> 0.5A$ (as shown in figure 2bII), and transitional formation (the red square symbol in figure 2a) in which
$|{{{\bar{D}}_y}} |= 0$ (as shown in figure 2bIII).
It should be pointed out that T* equals the pitching period in the semi-tandem formation and staggered formation, but it is larger than the pitching period in the transitional formation. This means that, although one has
$|{{{\bar{D}}_y}} |= 0$ in the transitional formation, the motion behaviour is different from the tandem formation, since the lateral position of the follower varies periodically, which will be discussed in detail in the following section. Moreover, it is surprising that the tandem formation is not observed here. It seems that the tandem formation, which has been widely observed in previous studies (Ramananarivo et al. Reference Ramananarivo, Fang, Oza, Zhang and Ristroph2016; Park & Sung Reference Park and Sung2018; Lin et al. Reference Lin, Wu, Zhang and Yang2019b; Ryu et al. Reference Ryu, Yang, Park and Sung2020), is unstable for two flapping foils when they can self-propel in both the x- and y-directions. Furthermore, it is clear that which kind of regular formation occurs strongly depends on the flapping parameters. The characteristics of each formation will be discussed in the following section, and then the propulsive speed and efficiency of two foils in different formations will be discussed.
3.2. Characteristics of stable formations
The time histories of the longitudinal and lateral distances (Dx and Dy) between two foils in several cases, in which the semi-tandem formation can be observed, are illustrated in figure 3(a,b). It can be seen that both Dx and Dy become periodic after several flapping cycles. Namely, the equilibrium positions in both longitudinal and lateral directions can be formed by two foils through the fluid–structure interaction. Moreover, it is clear that Dy is not zero, as shown in figure 3(b). For example, the cycle-averaged lateral distances
$({\bar{D}_y})$ in the cases of ( f, θm) = (1.25, 35°), (1.75, 35°) and (1.75, 30°) are respectively
${\bar{D}_y} ={-} 0.08$, 0.13 and 0.06. In addition, the cycle-averaged longitudinal distances
$({\bar{D}_x})$ in these cases are respectively
${\bar{D}_x} = 0.45$, 0.48 and 0.43. Moreover, it is clear that
${\bar{D}_y}$ is much smaller than
${\bar{D}_x}$.
Time histories of (a) longitudinal distance and (b) lateral distance between two foils in the semi-tandem formation. (c,d) Instantaneous vorticity contours and (e) trajectories of the pivot point of two foils at time t/T = 0.25 (c) and 0.75 (d), in the case of ( f = 1.75, θm = 30°).

Instantaneous vorticity contours at two instants (t/T = 0.25 and 0.75) in the semi-tandem formation are illustrated in figure 3(c,d). It can be seen that the follower intercepts the vortices shed from the leader. This is similar to the vortex locking behaviour observed in previous studies (Ramananarivo et al. Reference Ramananarivo, Fang, Oza, Zhang and Ristroph2016; Lin et al. Reference Lin, Wu, Zhang and Yang2019b). For more details, please refer to supplementary movie 1 available at https://doi.org/10.1017/jfm.2022.315. Moreover, it is clear that the wake of the follower is deflected significantly. In particular, the sign of
${\bar{D}_y}$ is related to the wake deflection of the follower. Thus
${\bar{D}_y}$ is negative when the wake of the follower is deflected towards the left side, but it is positive when the wake of the follower is deflected towards the right side (here, the left (right) side is identified by –y (+y) direction). However, it should be pointed out that each foil in the semi-tandem formation can swim approximately in a straight line, as shown in figure 3(e), although the wake of the follower is deflected.
Figure 4(a,b) show the time histories of the longitudinal and lateral distances between two foils in the staggered formation. It can be seen that Dx and Dy respectively converge to constant values after several flapping cycles. Moreover, it is clear that
${\bar{D}_y}$ in the staggered formation is larger than that in the semi-tandem formation. In the staggered formation, the follower swims outside the vortex street of the leader, as shown in figure 4(c,d). For more details, please refer to supplementary movie 2. Moreover, the trajectory of each foil in the staggered formation is deflected, and the deflected direction is determined by the position of the follower. When the follower swims on the left side behind the leader, the swimming of each foil deflects towards the right side, as shown figure 4(e) for example. However, when the follower swims on the right side behind the leader, the swimming of each foil deflects towards the left side. For the cases of ( f = 1.25, θm = 20°), ( f = 2.0, θm = 15°) and ( f = 2.25, θm = 15°), the deflection angles of swimmers are respectively 1.4°, 2.5° and 1.0°. This is because the interaction between the wake of the leader and the follower can induce the deflection of the wake of swimmers, which can generate a net lateral force and results in lateral drifting (Cleaver, Wang & Gursul Reference Cleaver, Wang and Gursul2012).
Time histories of (a) longitudinal distance and (b) lateral distance between two foils in the staggered formation. (c,d) Instantaneous vorticity contours and (e) trajectories of the pivot point of two foils at time t/T = 0.25 (a) and 0.75 (b), in the case of ( f = 2.0, θm = 15°).

Figure 5(a,b) shows the time histories of longitudinal and lateral distances between two foils in the transitional formation. It can be seen that Dx and Dy can periodically vary after several flapping cycles, and the periods of Dx and Dy are much larger than the flapping cycle. Moreover, the period of Dy is twice that of Dx. For example, the oscillating period of Dx is approximately Tx = 11T, and that of Dy is approximately Ty = 22T. This is different from the semi-tandem formation and staggered formation, in which the oscillating period of Dx is equal to that of Dy, and they are also the same as the flapping cycle. Furthermore, in the transitional formation, the position of the follower periodically changes from the left side to the right side behind the leader. Consequently, the wake of the follower alternately deflects to the right side and the left side. For example, the follower swims on the right side behind the leader when t/T ≈ 94, and its wake is deflected towards the right side at this moment, as shown in figure 5(c). However, when t/T ≈ 112, the follower swims on the left side behind the leader, and its wake is deflected towards the left side, as shown in figure 5(d). For more details, please refer to supplementary movie 3. Therefore, each foil in the transitional formation swims with wavy trajectory, as shown in figure 5(e). However, it should be pointed out that the cycle-averaged
${\bar{D}_y}$ is approximately zero in the transitional formation. Consequently, there is no obvious lateral propulsion for two foils in the transitional formation.
Time histories of (a) longitudinal distance and (b) lateral distance between two foils in the transitional formation. (c,d) Instantaneous vorticity contours and (e) trajectories of the pivot point of two foils at time t/T ≈ 94 (a) and 112 (b), in the case of ( f = 1.0, θm = 30°).

In order to further investigate the characteristics of the collective locomotion of two foils, the schooling number in different cases have been calculated. The schooling number is defined as
$N\textrm{ = }{\bar{D}_x}/L$, where L is the wavelength of the horizontal motion of the leader (Becker et al. Reference Becker, Masoud, Newbolt, Shelley and Ristroph2015). As shown in figure 6(a), it can be seen that, in the semi-tandem formation, half-integer values, instead of integer values, can be observed for N. Moreover, it can be seen from figure 6(b) that the mean value of the lateral distance between two foils is much smaller than 0.5A, but not zero. It is clear that the half-integer value of schooling number is different from the previous study (Ramananarivo et al. Reference Ramananarivo, Fang, Oza, Zhang and Ristroph2016), which pointed out that integer values of the schooling number occur when vortex interception appears.
(a) Schooling number in various cases. (b) The relationship between the schooling number and the lateral cycle-averaged distance.

The reason why half-integer values of the schooling number occur during the vortex locking behaviour can be explained as follows. Vortex interception is determined by the motion of the leading edge of the follower. For a pitching foil that is free in both the x- and y-directions, the leading edge of the pitching foil moves downwards when the foil is pitching upwards, and vice versa (Lin et al. Reference Lin, Wu and Zhang2020). Namely, the follower intercepts the negative vortex when it is pitching upwards, but the positive vortex when it is pitching downwards, as shown in figure 3(c,d) for example. Namely, the phase difference between the motion of the leading edge of the follower and the trailing edge of the leader is approximately
$\varphi = {\rm \pi}$. Considering the effect of phase difference on the schooling number (Lin et al. Reference Lin, Wu, Zhang and Yang2019b), one finds that
$\bar{N} = {\bar{D}_x}/L + \varphi /2{\rm \pi} = {\bar{D}_x}/L + 0.5$. Thus, the schooling number here is
$N\textrm{ = }\bar{N} - 0.5$, i.e. there are half-integer values for the schooling number. Moreover, approximately half-integer values of schooling number can also be observed in the staggered formation, as shown in figure 6(a). Namely, the vortex locking behaviour still occurs in the staggered formation. However, the mean value of the lateral distance between two foils in the staggered formation is obviously larger than 0.5A, as shown in figure 6(b). On the other hand, in the transitional formation, arbitrary values of the schooling number can be observed, as shown in figure 6(a). Meanwhile, the mean value of the lateral distance between two foils is approximately zero, as shown in figure 6(b).
3.3. Effects of initial distance and phase difference
In order to investigate the influence of initial longitudinal distance (Dx 0) on the emergence of regular formations, the flow-mediated organization of two tandem foils with different values of Dx 0 are studied here. Three cases of ( f = 1.75, θm = 30°), ( f = 2.0, θm = 15°) and ( f = 1.0, θm = 30°) respectively are selected as examples of semi-tandem formation, staggered formation and transitional formation. The time histories of the longitudinal and lateral distances between two foils in the different cases are illustrated in figure 7. It is clear that in the case of ( f = 1.75, θm = 30°),
$|{{{\bar{D}}_y}} |\approx 0.06$, which is much smaller than 0.5A (≈ 0.475), as shown in figure 7(b). Moreover, N ≈ 0.5 in the cases of Dx 0 = 0.1 and 0.5, and N ≈ 1.5 in the cases of Dx 0 = 1.0 and 2.0. Namely, the half-integer values of schooling number can still be observed in the cases of ( f = 1.75, θm = 30°) with different Dx 0. Thus, the semi-tandem formation can still be achieved by two swimmers when Dx 0 ≤ 2.0. On the other hand, for the case of ( f = 2.0, θm = 15°), it can be seen that
$|{{{\bar{D}}_y}} |\approx 0.5$, which is larger than 0.5A (≈ 0.25), as shown in figure 7(d). Furthermore, for the case of ( f = 2.0, θm = 15°), N ≈ 0.5 when Dx 0 = 0.1, and N ≈ 2.5 when Dx 0 = 0.5, 1.0 and 1.5. Namely, the staggered formation can be achieved by two swimmers with various Dx 0 when the perturbation of Dx 0 is small, such as Dx 0 ≤ 1.5. In addition, for the case of ( f = 1.0, θm = 30°),
$|{{{\bar{D}}_y}} |= 0$, as shown in figure 7( f). The three trajectories converge to the same solution in the long-time limit, illustrating that the same transitional formation can be achieved by two swimmers when Dx 0 ≤ 2.0. Therefore, it seems that the type of regular formation is independent of Dx 0 when the variation of Dx 0 is small, such as Dx 0 ≤ 2.0.
Time histories of (a,c,e) longitudinal distance and (b,d, f) lateral distance between two foils with different values of Dx 0 in the cases of (a,b) f = 1.75 and θm = 30°, (c,d) f = 2.0 and θm = 15°, and (e, f) f = 1.0 and θm = 30°.

However, it should be pointed out that the values of
${\bar{D}_x}$ and
${\bar{D}_y}$ depend significantly on Dx 0. For example, in both the semi-tandem and staggered formations,
${\bar{D}_x}$ increases with the rise of Dx 0, and only discrete values of
${\bar{D}_x}$ can be observed, as shown in figure 7(a,c). Moreover, the sign of
${\bar{D}_y}$ is determined by the value of Dx 0, as shown in figure 7(b,d). For instance, in the case of ( f = 2.0, θm = 15°), as shown in figure 7(d),
${\bar{D}_y} \approx 0.5$ when Dx 0 = 0.1, 0.5 and 1.0, but
${\bar{D}_y} \approx{-} 0.5$ when Dx 0 = 2.0. This means that the side on which the follower swims in both the semi-tandem and staggered formations is affected by Dx 0. In addition, it should be pointed out that trajectories that have the same absolute values of
${\bar{D}_y}$ in the long-time limit can be seen as the same trajectory, since the system is invariant under reflection around the midplane. For instance, for the case of ( f = 2.0, θm = 15°) in figure 7(c,d), the blue trajectory can be seen to be the same as the black and green trajectories.
It is noted that only the in-phase motion of two flapping swimmers is considered above. In order to study the effect of phase difference on the collective motion of two tandem flapping swimmers, the phase differences of ϕ = 0.0π, 0.5π, 1.0π and 1.5π are considered for three typical cases, i.e. ( f = 1.75, θm = 30°), ( f = 2.00, θm = 15°) and ( f = 1.00, θm = 30°). In this section, the front foil (i.e. foil 1) is driven by
$\theta (t) = {\theta _m}\,\textrm{sin}(2{\rm \pi} ft)$, and the rear foil (i.e. foil 2) is driven by
$\theta (t) = {\theta _m}\,\textrm{sin}(2{\rm \pi} ft + \phi )$. The time histories of the longitudinal and lateral distances between the two foils in the different cases are illustrated in figure 8. It can be seen that, for the semi-tandem formation and staggered formation, the type of the final formation is independent of the phase difference, as shown in figure 8(a–d). However, it should be pointed out that the cycle-averaged values of
${\bar{D}_x}$ and
${\bar{D}_y}$ are significantly affected by the phase difference. For example, in the semi-tandem formation (as shown in figure 8a),
${\bar{D}_x}/L \approx 0.47$, 0.24, 1.11 and 0.83 respectively when
$\phi = 0$, 0.5π, 1.0π and 1.5π. Moreover, considering the phase difference, the schooling number can be calculated as
$N = {\bar{D}_x}/L + \phi /2{\rm \pi}$ (Lin et al. Reference Lin, Wu, Zhang and Yang2019b), and one obtains N ≈ 0.47, 0.49, 1.61 and 1.58 respectively when
$\phi$ = 0, 0.5π, 1.0π and 1.5π. Thus, it can be seen that a half-integer value of the schooling number can still be observed in the semi-tandem formation, even though there are various
$\phi$ values between the two swimmers. On the other hand, for the transitional formation, the phase difference significantly determines the type of the final formation. For example, for two foils in the case of ( f = 1.00, θm = 30°), the transitional formation can be observed when ϕ = 0.0π and 1.0π, the staggered formation can be observed when ϕ = 1.5π, but no stable formation can be observed when ϕ = 0.5π in which two foils swim away from each other in the y-direction, as shown in figure 8(e, f). Consequently, the phase difference can influence the emergence of stable formations.
Time histories of (a,c,e) longitudinal distance and (b,d, f) lateral distance between two foils with different values of ϕ in the cases of (a,b) f = 1.75 and θm = 30°, (c,d) f = 2.0 and θm = 15°, and (e, f) f = 1.0 and θm = 30°.

3.4. Performance enhancement of regular formations
In order to quantify the propulsive performance of two foils in regular formations, the relative difference of velocity and efficiency between the two-foil system and a single foil are calculated, i.e.
$\Delta U = [({\bar{u}_x} - {\bar{u}_{xs}})/{\bar{u}_{xs}}] \times 100\%$ and
$\Delta \eta = [(\eta - {\eta _s})/{\eta _s}] \times 100\%$, where the subscript ‘s’ represents the single foil. From the previous studies (Khalid et al. Reference Khalid, Akhtar and Dong2016; Maertens et al. Reference Maertens, Gao and Triantafyllou2017; Lin et al. Reference Lin, Wu, Zhang and Yang2019b; Saadat et al. Reference Saadat, Berlinger, Sheshmani, Nagpal, Lauder and Haj-Hariri2021), it is known that the longitudinal distance between two foils significantly influences their schooling performance. Thus, the relationship between
${\bar{D}_x}$ and the performance of two foils in different regular formations is illustrated in figure 9, in which
${\bar{D}_x}$ is quantized by the wavelength of the horizontal motion of the leader (L). It is clear that the performance augmentation of two foils in regular formations is determined by
${\bar{D}_x}/L$. The performance enhancement can be achieved by a two-foil system only when
${\bar{D}_x}/L < 1$. But two foils in regular formations perform like a single one when
${\bar{D}_x}/L > 1$. This is in agreement with the experimental result in the previous work (Saadat et al. Reference Saadat, Berlinger, Sheshmani, Nagpal, Lauder and Haj-Hariri2021), where it was concluded that the performance enhancement may be due to two sources, i.e. the suction effect on the head of the follower that is produced by the wake of the leader, and the added-mass push effect on the tail of the leader that is produced by the follower (Saadat et al. Reference Saadat, Berlinger, Sheshmani, Nagpal, Lauder and Haj-Hariri2021).
The relative difference of (a) propulsive speed and (b) propulsive efficiency between the two-foil system and a single foil as a function of the cycle-averaged longitudinal distance between the two foils.

4. Conclusions
In summary, the two-dimensional hydrodynamic schooling behaviour of two flapping swimmers initially in tandem formation is numerically studied in this work. The results obtained here indicate that the tandem formation is unstable for two flapping foils when they are free in both longitudinal and lateral directions. Three types of regular formations are observed, i.e. semi-tandem formation, staggered formation and transitional formation. The flapping parameters determine which type of regular formation occurs, and the type of the final formation is independent of the initial longitudinal distance between the two foils when the perturbation is small.
In the semi-tandem formation, the follower always swims on one (left or right) lateral side of the leader with a small cycle-averaged lateral distance, and it intercepts the vortices shed from the leader during propulsion. In the staggered formation, the follower swims on one lateral side of the vortex street that is generated by the leader. The cycle-averaged lateral distance between the two foils in the staggered formation is much larger than that in the semi-tandem formation, and the deflected trajectory can be observed for each foil in the staggered formation. In the transitional formation, the position of the follower periodically varies from one lateral side to the other lateral side of the leader, and the variation period of the position of the follower is much larger than its flapping period. Moreover, it is shown that the performance of the two-foil system is determined by the cycle-averaged longitudinal distance
$({\bar{D}_x})$, and both velocity enhancement and efficiency augmentation can be achieved by two foils when
${\bar{D}_x}$ is smaller than the wavelength of the horizontal motion of the leader.
Finally, it should be pointed out that the model used here is highly simplified as compared with living fish schools. Thus, the current results still have some limitations for understanding the hydrodynamics of fish schools. For example, the number of individuals considered here is much smaller than that of fish schools (Larsson Reference Larsson2012), the three-dimensional effect of fish fins is neglected (Verma et al. Reference Verma, Novati and Koumoutsakos2018), the rotational degree of freedom is constrained, and the Reynolds number is smaller than that of fish schools (Fukuda et al. Reference Fukuda, Torisawa, Sawada and Takagi2010). The hydrodynamic interactions in fish schools may be different compared with the current results. Therefore, the collective performance of multiple three-dimensional bodies at higher Reynolds numbers is worth while to be studied in detail in the future.
Supplementary movies
Supplementary movies are available at https://doi.org/10.1017/jfm.2022.315.
Funding
J.W. acknowledges the support of the National Natural Science Foundation of China (grant no. 12072158), the Natural Science Foundation of Jiangsu Province (grant no. BK20191271), and the Research Fund of State Key Laboratory of Mechanics and Control of Mechanical Structures (Nanjing University of Aeronautics and Astronautics) (grant no. MCMS-I-0120G02). This work is also supported by the Priority Academic Program Development of Jiangsu Higher Education Institutions (PAPD).
Declaration of interests
The authors report no conflict of interest.





