# Numerical Simulation and Analysis of Fish-Like Robots Swarm
## 2 Computational Methods
### Performance Measurements  
Steady undulatory swimming is characterized by two non-dimensional parameters, the flow Reynolds number \(Re\) and the Strouhal number \(St\), which can be defined as follows:  
\[Re=\frac{UL}{\
u}, \tag{6}\]  
\[St=\frac{fA}{U}, \tag{7}\]  
where \(U\) is the steady swimming speed, \(\
u\) is the kinematic viscosity of the fluid, \(f\) is the tail-beat frequency and \(A\) is two times the lateral excursion of the tail tip. For the reason to introduce the viscous effect, we set the Reynolds number at a relatively low value (\(1\times 10^{3}\)) [30]. In order to obtain a constant swimming speed \(U\), we attach the fish to a rigid tether at a given constant inlet velocity \(U\). As the \(Re\) and \(U\) is set constant throughout the whole simulations, we vary the \(St\) only by setting different values of the tail-beat frequency. The work of [PERSON] and [PERSON] [44; 45] proposes the method that can change the \(St\) whilst keeping constant swimming speed \(U\) and Reynolds number \(Re\). The flow induced by a model fish is simulated. The model fish is attached to and dragged by a rigid tether that translates the fish in a stationary fluid at a given constant velocity \(U\). The desired value of \(Re\) can be obtained by a fixed speed of the tether \(U\). We can adjust the \(St\) through modifying the beating frequency of the fish tail \(f\), and the fish always undulates its tail at the required constant frequency. The force acting on the fish body by the water flow is set to be \(F\). If \(F\
eq 0\), the hypothetical tether absorbs the surplus force. Therefore, the net force exerting on the fish is zero, and it meets the constant swimming velocity assumption. In these cases, if the assumed tether is cut off instantaneously, the fish will accelerate or decelerate under the influence of the extra force \(F\). For a given \(Re\), the \(St\) is changed until the net average force that exerted on the fish is zero, i.e., \(F=0\). In this case, the assumed tether clearly has no effect on the fish. This is because if the hypothetical tether is cut off, the fish will also keep swimming at a constant speed \(U\). The fishes can follow this procedure to keep formation configurations and simulate natural \"free swimming\" conditions. In other words, the simulations use \"pinned\" formation configurations for the simulated fishes, where the fishes are not allowed to deviate from their assigned positions, and an inflow velocity is imposed. The tail-beat frequency is then adjusted until the average thrust is approximately equal to the average drag, which is necessary to emulate the natural \"free-swimming\" condition. It is still controversial and ambiguous to measure the swimming efficiency in numerical simulations. The Froude efficiency that indicates the proportion of the useful power in the total power is a relatively accurate and reasonable parameter, which is defined as:  
\[\eta=\frac{\overline{T}U}{\overline{T}U+\overline{P_{y}}}, \tag{8}\]  
where \(\overline{T}\) is the average thrust, \(U\) is the swimming speed, and \(\overline{P_{y}}\) is the average power loss due to the lateral undulations. To obtain the Froude efficiency during the steady swimming, the instantaneous thrust force and lateral power should be calculated first. In our simulations, the fishes were placed in the middle of the computational domain and swim steadily along the \(x\) direction. Here the fluid force along the \(x\) direction can be computed by integrating the pressure and viscous forces on the fish body [44]:  
\[F(t)=\int_{S}(pn_{x}-\tau_{xj}n_{j})dS, \tag{9}\]where \(n_{j}\) is the \(j\)-th component of the unit normal vector on \(dS\), \(\tau\) is the viscous stress tensor, \(S\) is the surface of the body.