1 Introduction

Inspired by natural selection and evolution, researchers attach great importance to the swimming performance brought by the flexibility of living fish. In the past few decades, the movement theory of fish in the aquatic environment has been continuously expended and applied to autonomous underwater vehicles (AUV) [1,2,3]. For fish-like robots in the process of propulsion, they generally have regular bodies for swimming in waves. The active fish deformation theory [4] is used to explain the interaction between undulating fish and surrounding water, and indirectly proves that the structural toughness of the fish body and fins has a very positive effect on the generation of the driving force and torque [5, 6]. At present, the research on the enhancement of self-propulsion mechanism by chord flexibility has been quite mature. Can spanwise flexibility be used to create new locomotion patterns? The inspiration for this article comes from the fact that fish rely on the flexible caudal fin to achieve multi-dimensional swimming. The realization of self-diving expands the mobility of bionic swimmers in the spatial dimension and is of great significance to the exploration of deep-sea environment.

Previous studies on traditional robotic fish has so far focused on cruising and steering actions with the fixed water depth. The maneuverability of fish-like swimmers can be predicted by direct experiments or indirect simulations. Particle image velocimetry (PIV) is widely applied in various fish measurement experiments [7, 8], and the design and control of underwater robots have also been active in several bionic laboratories in recent years [9, 10]. In terms of indirect simulations, fish kinematics and control equations are established to predict the motion trajectory. In our previous research [11], we numerically explored the self-swimming of virtual tuna based on flexible body and rigid fin, and revealed the mechanism of fish movement from various energy-saving modes [12]. Curatolo [13] constructed the active deformation of flexible fish muscles, and achieved maneuverability through the fundamental kinematics. Xu [14] used the overlapping grid technology to simulate the propulsion ability of a fish-like robot under the action of three-dimensional (3D) rigid pectoral fins. In the environment of computational fluid dynamics (CFD), the motion of fish is not limited to linear propulsion, a manipulable robot based on multiple degrees of freedom (DoFs) is the final research goal. In this article, the caudal fin with spanwise flexibility acts as a diving or ascent tool for the tuna-like robot.

The flexibility of caudal fin was mentioned in some previous reports, but it failed to form a systematic study. Yang et al. [15] revealed that a caudal fin with greater chord bending can produce higher propulsion performance. Feng et al. [16] quantitatively compared the starting ability and cruise stability of fish models with rigid and flexible caudal fins, respectively, under self-propulsion. In terms of spanwise flexibility, Zhu and Shoele [6, 17] extracted the wing-shaped caudal fin that can actively deform along the span direction, and explored the relationship between flexibility and hydrodynamics. Xia [18] appropriately regulated the wingspan flexibility of the caudal fin by dynamic grids, and achieved stronger cruise efficiency through numerical simulation. In previous studies, the development of flexible caudal fins focused on simulating the propulsion performance of live fish more realistically, and was mostly limited to linear motion. There have been few reports on solutions to achieve space mobility, such as transient turning. In this paper, the fin with spanwise flexibility can subtly contribute to the virtual swimmer’s diving function.

Diving is a standard function of natural fish, which can be abstracted as an autonomous movement in a single plane. The 3-DoF motion in the plane differs from a straight-line cruise with symmetry, and its compound mechanism requires the researcher to combine the unknown coupling relationship between each degree of freedom. Therefore, the control law of self-diving is more complicated. Suebsaiprom and Lin [19] adopted a 2-DoF buoyancy mechanism for the mechanical swimmer to achieve multi-DoF motion in space. Morgansen et al. [20] applied a nonlinear control theory to a fin-driven robot and realized the in-plane steering task. Wang [21] designed a mobile dolphin from the perspective of net buoyancy and fluid dynamics, and verified the feasibility from both numerical and experimental aspects. In terms of numerical simulation, the autonomous motion in the plane is limited to C-turns, and the detailed dynamics mechanism and 3D vortex structure provide the theoretical support [22,23,24]. From the biological point of view, these studies concentrate more attention on the active turning or passive ascending function of swimmers under specific circumstances. Although they are all in-plane motion mechanisms, there is still a lack of systematic research on the active diving or ascent caused by the pitching effect of the fish-shaped robot during the traveling process.

In this paper, a bionic thunniform swimmer is selected as the motion carrier to study the effect of caudal fin flexibility on self-diving. We emphasize a detailed quantitative method to control the kinematics of the fin span, and then obtain the diving performance of the bionic tuna in 3D space through numerical simulation. Finally, pressure clouds attached to the fish body and 3D vorticity structures mathematically explain the contribution of kinematics at each phase to the diving performance.

2 Mathematical background

2.1 Computational model and domain

In the case of ignoring the surface details of live fish, a thunniform model with a smooth outline is applied to the main body of this numerical study. The fish body is drawn by the curve fitting method, and the caudal fin is set to hold a high-aspect-ratio feature [25]. The size of the swimmer matches the standard of the child tuna reported by Donley [26], the length of the fish body is Lb, and the overall length is L. The virtual swimmer’s mathematical model and reference frame are shown in Fig. 1. The mold of caudal fin is a symmetrical crescent shape with a span length of b and a chord length of c. The relative coordinate systems of the thunniform body and caudal fin are oxbyb and oxfyf. Regarding the details of the caudal fin, we use 9 points to mark the upper edge line, the central pivot and the lower edge line. Points (1, 4, 7) are located at the caudal stalk of the caudal fin, and points (3, 6, 9) are located at the fin trailing edge. This method of marking fin mold is beneficial for us to study the flexibility kinematics in the span direction [18].

Fig. 1
figure 1

Physical parameters of tuna and caudal fin

This study applies two computational domains: the first is a water tank with a physical size of 10 L × 6 L × 3 L, which has enough space to truly simulate the self-diving of tuna; the second is a body-fitted space of appropriate size to simulate kinematics. The relevant dimensions and boundary conditions of the swimming area are shown in Fig. 2. Therefore, the boundary condition of the upstream inlet is imposed as zero velocity and zero pressure gradient, and the boundary condition of the downstream outlet is set as the velocity and pressure of zero gradient. The fish zone and the outer flow field are connected using dynamic overset technology. At the interface between the thunniform swimmer and the fluid, we ensure the balance between fluid velocity and tuna velocity by imposing a no-slip boundary condition, and assume that the normal and tangential velocities of fluid particles are zero on the surface of the fish body.

Fig. 2
figure 2

Schematic diagram of computing domain division

2.2 Overset grid technique

The overset grid technology opens up the possibility of calculating complex motions, and has been extensively used in the field of fluid mechanics, such as underwater robots and ships [27,28,29]. This grid technology belongs to the domain decoupling method, which can simulate and integrate complex motion systems, including the flexible motion of the fish body and the free motion of the rigid body. In our study, the computational domain mentioned in Fig. 2 is composed of background and component areas. The component area overlays the background area and has the overset boundary near where it connects to the background. We set up different grids to solve these areas separately, and in the iterative process of solving, flow data are transmitted through the embedded boundary.

Our study is set up in ANSYS Fluent by specifying the outer boundary of unstructured meshes as the overset boundary, the key step is to create an overlapping interface in the Overset Interface task page based on the selected Background Zone and Component Zone. When the entire field is initialized, the essential connectivity between different types of grids is built automatically. The cells that help to solve the flow equations are classified as solve cells, while the cells that exceed the calculation range are called dead cells. In addition, receptor cells and donor cells are also defined. Donor cells acting as the subset of solve cells transfer interpolated data to receptor cells. The specific connectivity steps of the overlapping technology in Fluent include hole cutting, overlapping minimization and donor search. Hole cutting is the process of marking cells located outside the flow region as dead cells. The second step, overlapping minimization, is used to minimize the grid overlap between background and component grids by turning the extra solver cells into receptor cells and the unnecessary receptor cells to dead cells. The cell-volume-based approach was adopted in this step due to the relationship between the resolution of different grid areas. The ultimate step in building the zone connection is to perform a donor search, Fluent searches other grids for valid solve cells in advance, these solve cells are used as donor candidates for a given acceptor. The special boundary processing of overlapping grid technology can greatly reduce the difficulty and workload of data transmission between zones.

As displayed in Fig. 3, the entire computational area can be discretized into a background grid domain and a body-fitted grid area (a suitable cube box) covering a bionic swimmer. The mesh generation process is carried out in the software STAR CCM+ , the generated overlapping grids are then exported as plt data recognized by Fluent. The rectangular background domain is constructed as a structured hexahedral grid to capture the 6-DoF rigid displacement of the simulated small cube after the iterative calculation. The volume in the cube box is all discretized into unstructured tetrahedral grids that can adapt to a wide range of deformations. In order to capture complex flow characteristics, the local mesh refinement is performed close to the fish body to ensure that deformation functions of the tuna body and caudal fin are met. Different mathematical models and solving algorithms are used in different region grids, so that under the premise of ensuring the numerical accuracy, the calculation efficiency is significantly improved, and the time is saved.

Fig. 3
figure 3

The specific details of the overlapping grids

2.3 Kinematics

The self-diving motion can be divided into three components: advancing component, descending component, and rotating component. To describe the details of the self-diving tuna, as shown in Fig. 4, we propose three motion phases: (1) in the deflection phase, we set the initialized swimmer to be placed along the negative direction of the x-axis. The first-phase tuna is characterized by a lower starting linear velocity and an explosively increasing angular velocity in the oxy plane. The caudal fin of tuna at this phase has spanwise flexibility. The specific kinematics will be described in detail below; (2) in the transitional phase, the primary function of this phase is to adjust the shape of the tuna’s caudal fin to pave the way for the subsequent propulsion after turning; (3) in the cruise phase, the specific form of thunniform movement is expressed as a symmetrical swing, realizing an almost continuous process of propulsion into deep water.

Fig. 4
figure 4

Schematic illustration of the self-diving behavior. (βc is the inertia compensation angle, βf is the final deflection angle)

During the simulated movement, the swimmer uses the body’s back and abdomen to swing to assist the self-diving [30]. The specific kinematics of this behavior are described by the chordal flexibility, and the traveling wave characteristics can be abstracted as a spine curve that propagates from head to tail. The amplitude envelope function A(x) is based on the empirical report [12, 18]. The kinematics of the chord-oriented flexible body is described as

$$\left\{ {\begin{array}{*{20}c} {z_{b} \left( {x,t} \right) = a(t) \cdot A\left( x \right) \cdot \sin \left( {2\pi ft - \frac{x}{\lambda }} \right)} \\ {A(x) = a(t) \cdot A_{\max } (0.21 - 0.66x + 1.1x^{2} + 0.35x^{8} )} \\ \end{array} } \right.,$$
(1)

where zb(x, t) is the vertical displacement of the body’s traveling wave swing, a(t) is the time-varying function, x is the coordinate along the x-axis, t is the time, f is the frequency of fluctuation, and λ is the wavelength. The compound motion of the caudal fin is composed of undulating motion and pitching motion, and its kinematics can be expressed as

$$\left\{ \begin{gathered} z_{cf} (t) = a(t) \cdot A_{\max } \sin [2\pi (ft - \frac{{L_{b} }}{\lambda })] \hfill \\ \theta (t) = a(t) \cdot \theta_{\max } \sin [2\pi (ft - \frac{{L_{b} }}{\lambda }) - \varphi - \frac{\delta y}{b}] \hfill \\ \end{gathered} \right.,$$
(2)

where zcf(t) is the vertical displacement of the caudal fin shank, θ(t) is the angular displacement of the pitching motion, θmax is its maximum amplitude value, and Lb is the length measured from the head to the tail shank, φ is the phase difference between the pitch locomotion and the vertical swing. In particular, we define the spanwise phase difference δ to quantify the caudal fin flexibility along the span direction. The value of δ represents the phase difference between the series of points (1, 2, 3) on the upper margin of the caudal fin and the series of points (7, 8, 9) on the lower margin.

In order to characterize the details of the caudal fin flexibility more intuitively, we depict Fig. 5, which includes two patterns experienced by the swimmer in this self-diving process. To intuitively observe the tail swing law under two patterns, we select the oyz plane as the main view. The virtual tuna in Pattern A, corresponding to Phase I in Fig. 4, relies on the fin flexible kinematics to realize the active steering during the start. The upper edge (1, 2, 3) of the flexible caudal fin swings faster than the central axis (4, 5, 6) by half the phase difference, and the lower edge (7, 8, 9) swings slower than the central axis (4, 5, 6) by half the phase difference, forming a misaligned traveling wave swing along the span direction, which is the primary driving torque that causes the tuna to dive. The motion law of the tuna in Pattern B, corresponding to Phase III in Fig. 4, is symmetrical about the central axis. The series of points (3, 6, 9) are always perpendicular to the central axis of the spine within half the motion cycle, points 1 and 4, points 2 and 8 and points 3 and 9 are symmetrically distributed. Mathematically, the value of δ is 0 at this time, and the virtual swimmer’s body and caudal fin swing symmetrically. This special working condition is the main motion mode in achieving self-propulsion, which has been extensively documented in previous literature [11, 31,32,33].

Fig. 5
figure 5

Two patterns experienced in this self-diving process

The transition phase is a complex process of connecting steering and propulsion. The flexibility of the caudal fin along the span direction needs to be initialized before starting a new morphological mode. We use the time-varying function a(t) to describe:

$$a(t) = \left\{ {\begin{array}{*{20}c} {1 - \frac{{t - t_{1} }}{{t_{2} - t_{1} }} + \frac{1}{2\pi }\sin \left(2\pi \frac{{t - t_{1} }}{{t_{2} - t_{1} }}\right){\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} t_{1} < t \le t_{2} } \\ {\frac{{t - t_{2} }}{{t_{3} - t_{2} }} - \frac{1}{2\pi }\sin \left(2\pi \frac{{t - t_{2} }}{{t_{3} - t_{2} }}\right){\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} t_{2} < t \le t_{3} } \\ \end{array} } \right.,$$
(3)

where t1 is the time when the tuna ends Phase I, from t1 to t2 is the time period from the tuna with Pattern A to the stationary state, and from t2 to t3 is the time period from the stationary state to restart Pattern B.

3 Computation method

3.1 Numerical method

In this paper, we adopt governing equations to guide the viscous flow covered on the tuna. The theoretical foundations are the Navier–Stokes incompressible equations, which are expressed by:

$$\nabla \cdot {\mathbf{u}} = 0$$
(4)
$$\rho \frac{{\partial {\mathbf{u}}}}{\partial t} + \rho ({\mathbf{u}} \cdot \nabla ){\mathbf{u}} = - \nabla p + \mu \nabla^{2} {\mathbf{u}},$$
(5)

where \(\nabla\) is the gradient operator, u is the fluid velocity vector, ρ is the fluid density, p is the pressure divided by the density and μ is the dynamic viscosity. To solve equations describing the flexible tuna with the prescribed kinematic motion, we ensure a balance between the fluid velocity u and the tuna velocity \({\text{u}}_{T}\) by imposing the no-slip boundary condition:

$${\text{u}}_{T} = {\text{u}}{.}$$
(6)

According to the above description of overlapping grid technology, the fluid–solid system in this study can be decomposed into rigid motion in the background zone and deformation motion in component zone. Then the tuna velocity \({\text{u}}_{T}\) can also be decomposed into:

$${\text{u}}_{T} = {\text{u}}_{c} + {\text{u}}_{r} + \left. {{\text{u}}_{c} } \right|_{deform} + {\text{u}}_{deform} ,$$
(7)

where \({\text{u}}_{c}\) is the linear velocity of the tuna, i.e. the rigid velocity of center of mass (COM),\({\text{u}}_{r} = \omega \times {\text{X}}_{r3}\) is the rotational velocity, Xr3 is the position vector of the tuna surface. It is worth emphasizing that both \({\text{u}}_{c}\) and \({\text{u}}_{r}\) are unknown and need to be obtained in iterative calculation. \(\left. {{\text{u}}_{c} } \right|_{deform}\) is the deforming velocity of COM, which is caused by the prescribed tuna kinematics. \({\text{u}}_{deform}\) is the given deforming motion velocity of the tuna surface. In the study, Newton’s equations are employed as the theoretical basis for the spatial motion in the instantaneous iteration process.

$$m\frac{{{\varvec{d}}u_{c} }}{{{\varvec{d}}{\text{t}}}} = \left( {{\text{F}}_{{\text{x}}} {\text{,F}}_{{\text{y}}} ,{\text{F}}_{z} } \right)$$
(8)
$${\text{J}}\frac{{{\varvec{d}}\omega }}{{{\varvec{d}}{\text{t}}}} + \omega \frac{{{\varvec{d}}{\text{J}}}}{{{\varvec{d}}{\text{t}}}} = {\text{M}}_{{\text{z}}} .$$
(9)

In these equations, (Fx, Fy, Fz) represents flow forces working on the tuna along the advancing, descending and lateral directions, Mz is the driving moment acting on the tuna in z-axis direction. m is the mass of the virtual tuna, J is the moment of inertia of the rotating pivot, and ω is the deviation angular velocity of the tuna along the z-axis. In another form of expression, the flow forces and the moment can also be written as [34]:

$$\left( {{\text{F}}_{{\text{x}}} {\text{,F}}_{{\text{y}}} ,{\text{F}}_{z} } \right){ = }\oint_{S} {{\upsigma } \cdot {\text{n}}dS}$$
(10)
$$M_{z} = \oint_{S} {\left[ {({\upsigma } \cdot {\text{n}}) \times \left( {{\text{x}} - {\text{x}}_{{\text{c}}} } \right)} \right] \cdot {\text{e}}_{{\text{z}}} dS} ,$$
(11)

where σ is the stress tensor, n is the unit vector along the normal direction, dS is the differential unit area of the thunniform force surface. ez is the unit vector along the z-axis direction.

To deal with flexible deformation and rigid movement, this study discretizes governing equations by Finite Volume Method (FVM) based on the mature transient solver ANSYS Fluent [35, 36], which is widely applied in the study of various representative hydrodynamic environments [37,38,39]. Figure 6 shows the numerical calculation process and relevant details. The second-order central difference scheme is used for the diffusion term, the second-order upwind scheme is used for the convection term, and the second-order implicit scheme is used for the transient formation. The pressure–velocity coupling of continuity equation is realized by the SIMPLE algorithm. The motion law of the diving tuna is based on the user-defined function (UDF). Specifically, the iterative motion of tuna body and caudal fin is implemented through the macro DEFINE_GRID_MOTION, the overall displacement and rotation are achieved by the macro DEFINE_ ZONE_MOTION. In order to get more accurate results based on the computational cost, we control the time step dt = 0.005 T, where T is a single swing period. For each step, the smoothing and remeshing methods are used to regenerate meshes. The coupling process is implemented using an improved staggered integration algorithm, which is described as follows:

Fig. 6
figure 6

Numerical calculation process and relevant details

In the beginning, we need to initialize the simulation with the swimmer at rest, the starting velocity \({\text{u}}_{c}^{(0)} = {\text{u}}_{r}^{(0)} = 0\).The next work is to obtain the final force and moment conditions by iterative calculation.

For each step, the numerical computation process of the instant flow-structure scheme is as follows:

1. Calculate the deformation velocity \({\text{u}}_{deform}^{(n)}\) of the body surface S and the deformation velocity of COM \(\left. {{\text{u}}_{c}^{(n)} } \right|_{deform}\) caused by the prescribed kinematics.

2. Calculate the overall velocity of the tuna at the current time step n by Eq. 9. Set the fluid velocity \({\text{u}}^{(n)}\) equal to the tuna velocity \({\text{u}}_{{_{T} }}^{(n)}\) on the fluid–solid interface S:

$$\left. {\left. {{\text{u}}^{(n)} } \right|_{S} = {\text{u}}_{{_{T} }}^{(n)} } \right|_{S} = {\text{u}}_{c}^{(n)} + {\text{u}}_{r}^{(n)} + \left. {{\text{u}}_{c}^{(n)} } \right|_{deform} + {\text{u}}_{deform}^{(n)}$$
(12)

3. Update the fluid dynamic grid on the fluid–solid interface and advance the transient flow solution from n–1/2 to n + 1/2.

4. Compute the fluid force \(F^{{(n + {1/2})}}\) and torque \(M_{Z}^{{(n + {1/2})}}\) acting on the deforming body with respect to its COM. Smooth them with a relaxation factor α expressed as(α is set to 0.25).

$$\hat{F}^{{(n + {1/2})}} = ({1} - \alpha )\hat{F}^{{(n - {1/2})}} + \alpha F^{{(n + {1/2})}}$$
(13)
$$\hat{M}_{Z}^{{(n + {1/2})}} = ({1} - \alpha )\hat{M}_{Z}^{{(n - {1/2})}} + \alpha M_{Z}^{{(n + {1/2})}}$$
(14)

5. Advance the position of COM, the rigid velocity of the mass center \({\text{u}}_{c}\) the rotational velocity \({\text{u}}_{r}\) with the filtered forces \(\hat{F}^{{(n + {1/2})}}\) and the moment \(\hat{M}_{Z}^{{(n + {1/2})}}\).

Since the tuna is undergoing self-diving, the diving velocity, which is equal to the sum of linear velocities along both directions, is not prescribed first, but increases gradually from zero to a steady-constant value. The resulting Reynolds number (Re) based on the diving velocity, is gradually increased from zero too, but its extreme value is limited to a certain range to meet the needs of the simulation environment configuration. Especially in Phase I and Phase II of self-diving, linear velocities of tuna are very small during this time period, and the work of tuna is focused on turning. In addition, it should be noted that the size of the swimmer here is consistent with that of the robotic prototype developed in our laboratory, and a shorter length is used. Based on the law of the diving velocity increasing from zero to the steady-constant value and unchanging length of the swimmer, Re is roughly between (Re ~ 0) and (Re ~ 104). Within this scope of continuous variation of Re, it is very difficult to distinguish clearly how much the critical Re number is. In this condition, a feasible approach might be using the transitional regime to do the research.

3.2 Numerical validation

To further verify that our method is suitable for 3D moving objects, we select the oscillation case of a 3D sphere and calculate two sets of cases with different parameters. One is the same as the work of Erzincanli and Sahin [40], and the other is the same as the work in the literature [41], to double verify the accuracy of the current numerical method. In the first case, the motion of the sphere is prescribed as \(x_{c} (t) = A_{m} \left[ {{1 - }\cos (2\pi f_{s} t)} \right]\), where Am = 0.125d is the oscillating amplitude, d is the diameter, fs = 1 is the oscillating frequency, and the Reynolds number is taken to be Re = 20. For the calculation of the drag coefficient, the dimensionless equation is the same as that in the literature, namely \(C_{D} = {4}F_{x} /(1/2)\rho \pi d^{2} U_{\max }^{2}\), where Fx is the fluid force along the horizontal x-direction, Umax is the maximum speed of the sphere. Figure 7 compares the present results with the results of Erzincanli and Sahin [40] based on the time history curves of CD. In the second case, the motion of the sphere is defined as \(x_{c} (t) = A_{m} \sin (2\pi f_{s} t)\), where Am = 0.125d, fs = 1.2732 Umax/d. It is necessary to note that in this case Re is 78.54 and the Strouhal number is 1.2732. Figure 8 shows the pressure contours at different phase angles, which are also highly similar to the results of Lee and You’s work to double verify the accuracy of the numerical method in this work [41].

Fig. 7
figure 7

Time history curves of CD from the present results (red ball lines) compared with the results of Erzincanli and Sahin [40] (blue dashed lines) (colour figure online)

Fig. 8
figure 8

Pressure areas and contours at three key phase angles

Due to the characteristics of overlapping technology, we need to separate different computing domains in the grid sensitivity testing. For the background area of this paper, we apply three sizes of uniform edge-length structured meshes of 0.04 L, 0.02 L, and 0.0125 L, respectively, and the corresponding mesh numbers are 0.85 (coarse), 6.3 (nominal), and 18.48 (fine) million, respectively. The number of unstructured meshes in the component area is also recorded as 0.25(coarse), 1.46 (nominal) and 3.88 (fine) million according to the roughness. To make the test content informative, we unify the domain size and boundary settings. Afterward, we choose the bionic tuna with six flexible swings (D = 6), and normalize its kinematic quantization parameters. Figure 9 displays the variation of the stable descending velocity coefficient of tuna U2 with respect to the spanwise phase difference δ. It can be seen that under the same parameter conditions, there is a large error in the swimming law simulated by the coarse mesh, while the nominal mesh and the fine mesh can better deal with the hydrodynamic problem of the caudal fin swing. Therefore, the discrete area with nominal grids is a suitable choice.

Fig. 9
figure 9

Convergence test of three different sizes of grids

It is worth noting that the numerical simulation inevitably produce truncation errors due to the limitation of finite step operation, and the truncation error is proportional to the time step. In order to further balance the solution quality and the computing consumption, we conduct a sensitivity study involving three different units of time based on the standard grid. A proper unit time is conducive to the simulation of 3D dynamic mesh, avoiding negative volume and large aspect ratio. Similarly, based on the law of spanwise phase difference δ and the united value (D = 6), we choose the variation of the stable descending velocity coefficient U2 as the research object, as shown in Table 1. The research data at dt = 0.005 T is most convincing. Therefore, we finally choose this time step as an important setting parameter for subsequent simulation.

Table 1 Variations of the stable descending velocity coefficient U2 with the spanwise phase difference δ for different time steps

3.3 Behavior parameters

The self-diving of thunniform swimmer, which is a complicated spatial movement, is different from the linear propulsion in the past. In our research, we adopt various dynamic measurement parameters to describe the working performance of diving behavior. In Fig. 10, we can determine the value decomposition of periodic changes Fi(t) in different motion directions and summarize them into two groups of positive and negative values, the thrust FTi(t) and the resistance FRi(t). In the corresponding equations, ej is the division of the normal vector on the tuna unit surface, and τij is the viscous stress tensor.

Fig. 10
figure 10

The method of decomposing and integrating instantaneous fluid force components

When it comes to spatial steering, we identify that only the change of the transient torque along the z-axis plays a decisive role in the diving. The specific expression is:

$${\text{M}}_{3} (t) = \int_{S} - {\text{X}}_{r3} {\text{pe}}_{3} dS + \int_{S} {{\text{X}}_{r3} } {\uptau }_{3j} {\text{e}}_{j} dS.$$
(15)

During the entire process, the source of kinetic energy obtained by the thunniform swimmer is the flexible swing of the body and caudal fin. We introduce the effective energy and total energy consumption to study the effectiveness of the virtual swimmer’s diving work. In this case, we assume that (1) the tuna at t4 has both a stable deflection angle and a convergent motion speed, that is, the fish at this time has completed the diving work; (2) the movement along the y-axis and the steering of the tuna’s head during self-diving work are effective actions. The energy-related equations are expressed as follow:

$$E_{eff} = \int_{0}^{{t_{4} }} {F_{2} (t)\dot{y}dt + } \int_{0}^{{t_{4} }} {M_{3} (t)\omega dt}$$
(16)
$$E_{all} = \int_{0}^{{t_{4} }} {\left[ {F_{1} (t)\dot{x} + F_{1} (t)\dot{y} + F_{1} (t)\dot{z} + M_{3} (t)\omega } \right]dt} ,$$
(17)

where \(\left( {\dot{x},\dot{y},\dot{z}} \right)\) are the instantaneous forward linear velocity along the negative x-axis, the instantaneous downward linear velocity along the negative y-axis and the instantaneous lateral linear velocity reciprocating along the z-axis, respectively. We also define the stable velocity components of the tuna in three directions after self-diving as \(\left( {\dot{X},\dot{Y},\dot{Z}} \right)\). Therefore, the efficiency η of tuna diving can be defined as

$$\eta = \frac{{E_{eff} }}{{E_{all}^{{}} }}.$$
(18)

To standardize numerical solutions of virtual tuna based on different types and sizes, we nondimensionalize several important kinematic parameters as follow:

$$\left( {u_{1} ,u_{2} ,u_{3} } \right) = \left( {\dot{x},\dot{y},\dot{z}} \right)\frac{T}{L}$$
(19)
$$\left( {U_{1} ,U_{2} ,U_{3} } \right) = \left( {\dot{X},\dot{Y},\dot{Z}} \right)\frac{T}{L}$$
(20)
$$\left( {C_{F1} ,C_{F2} ,C_{F3} } \right) = \frac{{F_{{\text{i}}} (t)}}{{0.5\rho {\text{U}}_{d}^{2} L^{2} }}$$
(21)
$$C_{{{\text{PE}}}} = \frac{{E_{{{\text{eff}}}} }}{{0.5\rho {\text{U}}_{d}^{2} L^{3} }}$$
(22)
$$C_{PA} = \frac{{E_{all} }}{{0.5\rho {\text{U}}_{d}^{2} L^{3} }}.$$
(23)

Among them, (u1, u2, u3) are dimensionless instantaneous velocity coefficients in three directions, (U1, U2, U3) are dimensionless stable velocity coefficients, (CF1, CF2, CF3) are dimensionless force coefficients, Ud is the diving velocity after convergence, CPE and CPA are dimensionless effective energy and dimensionless total energy consumption, respectively.

4 Results and discussion

To verify the feasibility of self-diving, we apply the numerical method to simulate the kinematics of thunniform swimmer and iteratively calculate transient forces and moments. Normally, the tuna gradually forms a tendency to dive after completing a series of prescribed actions. The basis for judging whether the diving performance is effective is mainly the force component along the descending direction and the final deflection angle. This article assumes that the swing frequency f of the tuna is 5 Hz, and selects the spanwise phase difference δ and the number of flexible swings D of Pattern A to study their effects on the body deflection and the corresponding fluid dynamics.

4.1 Time history of deflection angle, linear velocity and force of self-diving behavior

In this section, the research object is defined with the kinematic performance parameters including the number of flexible swings D = 3 and the spanwise phase difference δ = 25°. Figure 11 displays the time history curve of the deflection angular velocity ω and the corresponding change law of the deflection angle β during self-diving. In Phase I, the deflection angular velocity ω gradually fluctuates sharply due to the spanwise flexibility of the caudal fin. In Phase II, the caudal fin is translated from the spanwise yaw mode to the symmetrical cruise mode, and the rise in deflection angular velocity ω slows down, and there is a slight correction. In Phase III, after adjusting the shape of the caudal fin, the tuna continues to perform straight-line cruise, but affected by inertia. The change rule is that ω drops suddenly, then gradually converges to 0, and then fluctuates around the fixed value. At the end of Phase III, the tuna no longer produces a yaw effect, and the self-diving is completed. The corresponding changes in the deflection angle show that Phase I and Phase II contribute most of the yaw driving torque to tuna, while Phase III is a process of gradual convergence.

Fig. 11
figure 11

Time history curve of deflection parameters

When adjusting the direction of movement, the tuna is subjected to the symmetrical or asymmetrical hydrodynamic forces provided by the caudal fin, this behavior inevitably produces displacements along the forward-downward directions. Figure 12 shows that linear velocity coefficients vary in the two main directions. Through the performance of the advancing velocity coefficient u1 in Phase II, we find that the caudal fin does not play a significant propulsion effect during the transition interval. At this time, u1 gradually decreases in a linear manner. u1 in Phase III continuously increases and reaches an asymptotically constant value, the oscillatory convergence law is consistent with previous research conclusions on self-propulsion [11, 12]. The curve is only for the working condition where the final deflection angle βf is less than 90°. The value of u2 grows with significant fluctuation in Phase II, and the convergence speed is slower than that of u1. During the entire diving, the rotation of tuna in Phase I is affected by the starting inertia, and its manifestation is similar to in-situ turning. It is not until the end of the transition period that the tuna begins to descend along the y-axis.

Fig. 12
figure 12

Time history curve of linear velocity coefficients

The self-diving work of tuna is affected by the complex flow dynamics. The forces in the three directions are defined as the advancing force coefficient CF1, the descending force coefficient CF2, and the lateral force coefficient CF3, as shown in Fig. 13. During the whole movement, CF1 is almost unaffected by the variation in the fin shape, and gradually converges from the acceleration mode to the zero-average fluctuation mode. It is worth noting that CF1 is almost zero in Phase II, because the caudal fin retracts during the transition. The law of the second curve shows that the descending force coefficient CF2 fluctuates slightly in the first two phases, which exactly corresponds to the instantaneous change of u2. In Phase III, it also shows the same fluctuation law as CF1. The lateral force coefficient CF3 maintains the zero-average fluctuation mode from the start, but as the tuna moves more violently, the fluctuation amplitude of CF3 gradually increases, and the final energy loss is also greater.

Fig. 13
figure 13

Time history curve of force coefficients in different directions

4.2 Transient analysis of the surface pressure and the flow field

The study of fin surface pressure variations and transient flow field variations plays an auxiliary role in the analysis of self-diving mechanism. By extracting the pressure distribution of the fin surface based on Pattern A and Pattern B, shown in Fig. 5, we can verify the hydrodynamic information that the tuna can dive regularly. Figure 14 gives two perspectives to clearly assist in the analysis of pressure situations. The study interval is from 0 to 1/2 T (the law of movement from 1/2 to 1 T is similar). For Pattern A, the tuna’s caudal fin is the main output for deflection. When t = 1/8 T, due to the spanwise phase difference, the upper edge of the caudal fin starts first with a red high-pressure area appearing at the tip of the upper edge and spreading to the caudal stalk and lower edge. When t = 1/4 T, the lower edge of the caudal fin is also activated. At this time, the surface of the caudal fin presents a global high-pressure state. When t = 3/8 T, the upper edge of the caudal fin is about to reach the amplitude extreme faster than the lower edge. At this time, the high-pressure area of the tip quickly recedes, and the tip movement of the lower edge has a certain phase lag, and the high-pressure area on the lower surface is slightly larger than that on the upper surface. Finally, when t = 1/2 T, due to the movement of the alternating traveling wave, the visible surface of the caudal fin is all turned into a low-pressure zone. In terms of distribution, the pressure on the upper edge is still higher than that on the lower edge. The alternating and asymmetric pressure distribution of the caudal fin is the main cause of deflection. The caudal fin of Pattern B works for linear propulsion, so the pressure distribution is also symmetrical, and the results shown are consistent with the previous literature [42]. As the transient interval ranges from 1/8 to 1/2 T, high-pressure cores are generated from tips of the caudal fin on both sides and gradually cover the entire fin surface. After reaching the amplitude limit, the high-pressure distribution dissipates along the tail handle to tips, and the full fin surface finally turns into a low-pressure core.

Fig. 14
figure 14

Evolution of pressure contours based on two main patterns

Figure 15 shows the evolution law of vorticity contours and velocity vectors at each representative moment during self-diving. At the start time of t = 0.5 T, the upper and lower edges of the caudal fin fall off a pair of vortices almost at the same time. Red and blue spots represent counterclockwise and clockwise directions, respectively. At this time, velocity vectors are concentrated on the trailing edge of the body and the caudal fin, confirming that the tuna is in the stage of accumulating strength before the explosive advance. When t = 4.5 T, the tuna completes the turning action and forms a single row of wake vortex structure along the rear and bottom of the caudal fin, which is the prototype of vortex street. The upper margin of the caudal fin is at the outside of turning trajectory, so the radian generated by the in-situ rotation is relatively large. Correspondingly, the outboard red vortices start to fall off in preference to the blue vortices. Velocity vectors are mainly distributed at the back and bottom of the fish body, which indirectly verifies the characteristics of the rotation. When t = 8.5 T, the tuna that successively completed deflection and transition phases begins to enter the cruise phase. The tuna in Phase II does not produce a wake vortex structure, which is the cause of the interval in the vortex street. Wake vortices generated in the deflection phase gradually dissipate, and vortices in Phase III are still in a circular arc shape under the influence of the turning inertia. When t = 12.5 T, the tuna is the final form of self-diving at this moment, and a single-row vortex street is symmetrically distributed downstream of the caudal fin. This result is consistent with conclusions stated in the previous article on fish self-cruising so that this article does not repeat it [18].

Fig. 15
figure 15

Evolution of vorticity contours and velocity vectors based on two main patterns

4.3 Effect of kinematic parameters on self-diving behavior

To evaluate the diving performance of tuna, we select stable velocity coefficients U1 and U2 along the advancing and descending directions, the final deflection angle βf, the inertia compensation angle βc, the effective energy coefficient CPE, and the diving efficiency η to investigate the self-driving influence. First, we combine the spanwise phase difference δ (5°–30°) and the number of flexible swings D (1–6) to perform multiple numerical cases.

Figure 16 shows the variation of stable velocity coefficients U1 and U2 under different working conditions. When the value of D is small, the rise in the spanwise phase difference δ does not bring an apparent effect to the stable advancing velocity coefficient U1. As the number of flexible swings D increases, the debuff effect becomes more obvious. When D is 3 or 4, the value of U1 moves closer to 0 in a downward trend. When D is 5 or 6, the value of U1 witnesses the convergence of the slowing trend. It is worth mentioning that under some dual-parameter combination conditions, the value of U1 can be lower than 0. At this moment, the tuna can not only realize the diving function, but also produce the U-turn function. The emergence of this special state confirms that the effective control of two parameters is necessary. From Fig. 16(b), we find that when the value of D is small, the value of U2 and U1 are almost in a complementary relationship, and whether it is the increase in the spanwise phase difference or the number of flexible swings, the tuna can have better stable movement performance in the descending direction. When D is 5 or 6, the stable descending velocity coefficient U2 first increases and then decreases with the augment of δ. For different D values, the inflection point of the curve is also different. After the careful comparison of different working conditions, we can find that U2 has a maximum value, that is, when D = 5 and δ = 25°, and it is close to the maximum value of U1 when D is 1 in Fig. 16(a). The existence of this maximum value is the reason for the inflection point or convergence of the curve. In addition, we can combine the angle-related evaluation parameters below to make a comprehensive analysis.

Fig. 16
figure 16

The law between velocity-related parameters and variations of D and δ

Secondly, the important kinematic parameters for evaluating self-diving performance are the final deflection angle βf and the inertia compensation angle βc. Figure 17(a) plots the final deflection angle βf with respect to the spanwise phase difference δ and the number of flexible swings D. As δ rises, βf gradually increases. When the value of D is small, the display form is a curve with a linear rate of growth. When the value of D is large, the display form is a curve in which the rate of growth gradually declines. Figure 17(b) shows that the trend of the inertia compensation angle βc with respect to D and δ is almost the same as Fig. 17(a), which indirectly proves that both βf and βc are affected by changes in quantitative parameters. The specific values emphasize that the ratio of βf to βc is within a certain range under different working conditions. The regular statistics of the inertia compensation angle are helpful for us to control the flexibility of the diving process and predict the final deflection angle based on inherent error conditions. It is worth mentioning that when combining Figs. 16 and 17, we found that the values of stable velocity components and final deflection angle during the cruise period satisfy the following geometric relationship formula U2/U1 = tanβf, confirming the stability of self-diving function.

Fig. 17
figure 17

The law between steering related parameters and variations of D and δ

To further explore the influence of kinematic parameters on the energy-related law, we give variation curves of the effective energy coefficient CPE and the diving efficiency η as functions of D and δ. As shown in Fig. 18, for a given D, the basic trend of CPE and δ is a linear rise, and as D increases, the larger δ is, the faster the effective energy coefficient CPE rises. This is because that with the growth of D and δ, the proportion allocated to the descending component and the deflection component increases, and greater inertia can be formed, causing the force component in the forward direction to be squeezed. While the tuna compresses the displacement in the forward direction as much as possible, it can enter the stable stage of falling in a more energy-efficient way. Figure 18(b) reflects the mapping curve of the diving efficiency η and the kinematic parameters. It can be seen that for a fixed D, η grows with the rise of δ, but the magnitude of the growth is different. When D is small, the growth effect is extremely significant, indicating that the deflection effect of the tuna body currently is very dependent on the rise of δ. When D is larger, the growth effect gradually converges. On one hand, it shows that the value of D accounts for a rise in the weight of the deflection effect. On the other hand, it shows that as D and δ grow, the diving effect gradually approaches the limit position.

Fig. 18
figure 18

Variations of energy parameters as functions of D and δ

4.4 3D wake structure

To further detail flow field laws generated by self-diving work, we use the q criteria [43, 44] to intercept contours of the 3D vortex structure, which is visualized as a transparent blue shown in Fig. 19. The q criteria can effectively distinguish the vortex area and the static area, and help us analyze the complex hydrodynamics during diving. In Phase I, the tuna combines the chordal flexibility of body and the spanwise flexibility of caudal fin to produce trailing vortices that shed backward and downward. The linear velocity at the initial stage of startup is still very small, and the continuous spanwise swing of caudal fin constantly superimposes and squeezes the vortex block to form a vortex stack, as shown in Fig. 19(a). The vortex stack with explosive energy produces effective jet thrust on the rear and lower sides of the tuna, and transforms it into a steering torque for autonomous deflection. Figure 19(b) shows the vortex structure produced in the wake area at the beginning of Phase III. The entire vortex street is affected by the deflection effect and presents an arc-shaped curved single-row Karman shape. The fault of the vortex street is caused by the inaction of the caudal fin in the transition phase. At the beginning of the cruise, vortex rings formed by each beat are glued together. The width of each vortex ring on the inner side of the track is smaller than that on the outer side, making the vortex street more crowded. Figure 19(c) shows the distribution of the stable vortex street in the later stage of the cruise. The curved vortex street at the initial stage is gradually straightened, and the vortex distribution is more regular. [32, 44].

Fig. 19
figure 19

3D wake structures visualized by the iso-surfaces of the q-criterion

5 Conclusion

In this study, a virtual swimmer that can transform the shape of its caudal fin is used to realize self-diving motion. We combine kinematic behaviors with the excited fluid dynamics for numerical simulation, and summarize the following novel findings:

  1. (1)

    The self-diving movement is divided into three phases from start to finish: deflection phase, transitional phase, and cruise phase, in which the body’s traveling wave law is unified, and the caudal fin of each phase corresponds to different kinematic laws. The tuna in Phase I is affected by the spanwise flexibility of caudal fin, and the deflection angular velocity increases rapidly, which is the cause of the diving movement. Phase II slows down the growth in angular velocity of the tuna, while in Phase III, the tuna completely gets rid of the deflection effect and starts the traditional propulsion mode. As a whole, linear velocity curves along the advancing and descending directions are described as a convergence trend.

  2. (2)

    The number of spanwise swings D and spanwise phase difference δ are two control parameters used to quantitatively describe the self-diving law. First of all, increasing the number of spanwise swings D is more conducive to the realization of the deflection motion effect than the spanwise phase difference δ, and the deflection gain brought by δ is more dependent on D. Secondly, the values of stable velocity coefficients U1 and U2 along advancing and descending directions are complementary and satisfy the geometric relationship of tanβf = U2/U1 with the final deflection angle βf. This relationship is only applicable to the working condition where βf is less than 90°. In the end, the superimposed monotonic increase of D and δ both contributes to the rise of the diving energy and efficiency within a certain interval, and its growth effect gradually converges, indicating that the diving effect gradually approaches the limit position.

  3. (3)

    The study of transient pressure changes on the caudal fin surface and the transient flow field is helpful to explain the formation of self-diving motion. First, the alternating and asymmetric pressure distribution of the spanwise flexible caudal fin is the main reason for deflection. The spanwise traveling wave of caudal fin provides a deflection moment to make the tuna rotate rapidly in Phase I. We can also verify from the transient flow field that the shedding direction of the wake vortices in the deflection phase is affected by the chord-oriented flexible body and the span-oriented flexible caudal fin, which interactively provides a turning moment to the tuna. The entire vortex street is affected by the deflection effect and presents a curved single-row Karman shape.

In conclusion, the simulation of the new motion mechanism proves that the caudal fin can also be used as an effective tool for manipulating space activities of fish. Since the diving action has hydrodynamic performance different from traditional self-propelled function, and the research in this field is still in the initial stage of exploration, it is necessary for us to evaluate the accuracy of the deflection function brought by the flexible caudal fin in follow-up research and explore the influence of compound fins on underwater movement. In terms of the numerical model, this paper selects the laminar flow model based on the unpredictability of variable Re number, which has certain limitations. How to introduce the turbulence model into the self-swimming research is also one of the future research subjects.