**2. Mathematical Model**

#### *2.1. Governing Equations and Turbulence Model*

The in-house CFD code HUST-Ship, based on the finite difference method (FDM), is employed to solve the unsteady incompressible RANS equations coupled with the continuity equation:

$$\frac{\partial u\_i}{\partial x\_i} = 0, \ (i = 1, 2, 3) \tag{1}$$

$$\frac{\partial \underline{u\_i}}{\partial t} + \underline{u\_j}\frac{\partial \underline{u\_i}}{\partial \underline{x\_j}} + \frac{\partial \underline{\rho}}{\partial \underline{x\_i}} - \frac{1}{\aleph\_\varepsilon}\frac{\partial^2 \underline{u\_i}}{\partial \underline{x\_j}^2} - \frac{\partial}{\partial \underline{x\_j}}\left(-\overline{u\_i \acute{\prime} \, u\_j \acute{\prime}}\right) = 0, \quad (i, j = 1, 2, 3) \tag{2}$$

where *ui uj* is the Reynolds stress with turbulent pulsation; *ui* is the fluctuating velocity, *p*ˆ = *p*−*p*<sup>∞</sup> ρ*U*<sup>0</sup> <sup>2</sup> + *<sup>z</sup> Fr* 2 is the dynamic pressure coefficient, *ui* , *uj* , is Reynolds stress tensor, and *Re* is the Reynolds number.

The Froude number and Reynolds number are defined as:

$$F\_r = \frac{u\_0}{\sqrt{gL\_{pp}}},\ R\_{\mathfrak{e}} = \frac{u\_0 L\_{pp}}{\nu} \tag{3}$$

where ν is the fluid viscosity coefficient, g is the acceleration of gravity, and *u*<sup>0</sup> and *Lpp* are the ship service speed and the length between perpendiculars, respectively.

The turbulent equation uses an SST (shear–stress transport) equation turbulence model to close the governing equation. The equations for turbulent flow energy k and turbulent dissipation rate ω are:

$$\frac{\partial}{\partial t}(\rho k) + \frac{\partial}{\partial x\_j}(\rho k u\_i) = \frac{\partial}{\partial x\_j} \left(\Gamma\_k \frac{\partial k}{\partial x\_j}\right) + \mathcal{G}\_k - \mathcal{Y}\_k + \mathcal{S}\_k \tag{4}$$

$$\frac{\partial}{\partial t}(\rho \omega) + \frac{\partial}{\partial x\_j}(\rho \omega u\_i) = \frac{\partial}{\partial x\_j} \Big(\Gamma\_{\omega} \frac{\partial \mathbb{K}}{\partial x\_j}\Big) + \mathcal{G}\_{\omega} - \mathcal{Y}\_{\omega} + \mathcal{S}\_{\omega} + D\_k \tag{5}$$

where Γ*<sup>k</sup>* and Γ<sup>ω</sup> are the diffusion ratios of k and ω, respectively; *Yk* and *Y*<sup>ω</sup> are the turbulent diffusion terms for k and ω, respectively; *Gk* is the turbulent kinetic energy generated by the average velocity gradient; *G*<sup>ω</sup> is the production term of the ω equation; and *Sk* and *S*<sup>ω</sup> are the custom source terms for the k and ω equations respectively.

#### *2.2. Coordinate System and 6-DOF Equations*

In the process of the towing simulation, the attitude (pitch and heave) of a KCS always changes with the pressure distribution on the hull surface, hence the need for the 6-DOF equations [25]. The equations involve a time item; therefore, the unsteady RANS equation was solved with the 6-DOF system integrated into the solution program. Figure 1 shows the coordinate system of the HUST-Ship program. The 6-DOF equations can be written as:

$$\mathbf{m}\left[\dot{\boldsymbol{\mu}} - \mathbf{v}\mathbf{r} + \mathbf{w}\mathbf{q}\right] = \boldsymbol{\lambda} \tag{6}$$

$$\mathbf{m} \left[ \dot{\boldsymbol{v}} - \mathbf{w} \mathbf{p} + \mathbf{u} \mathbf{r} \right] = \mathbf{Y} \tag{7}$$

$$\mathbf{m}\left[\dot{w} - \mathbf{u}\mathbf{q} + \mathbf{v}\mathbf{p}\right] = \mathbf{Z} \tag{8}$$

$$I\_x \dot{p} + \left[ I\_z - I\_y \right] qr = K \tag{9}$$

$$I\_y \dot{q} + [I\_x - I\_z]rp = M\tag{10}$$

$$I\_x \dot{r} + \left[ I\_y - I\_x \right] pq = N \tag{11}$$

in which, *Ix*, *Iy* and *Iz* are the components of moment of inertia with respect to the gravity center; X, Y, Z and K, M, and N are the components of external forces and moments acting on the hull, respectively. The ship position is described in an earth fixed coordinate system with X pointing south, Y pointing east, and Z pointing upward. The origin of the ship local coordinate system is set at the intersection of the design waterline and the bow. The velocities for 6-DOF motions (u, v, w, p, q, r) are reported in a ship local coordinate system with the x-axis positive toward stern, the y-axis positive toward starboard and the z-axis positive upward. The 6-DOF motions of the ship are reported at the center of gravity.

**Figure 1.** The coordinate system of HUST-Ship.

To obtain the trim angle and sinkage of a KCS, only 2-DOF motion related to pitching and heaving are solved in this paper.
