In this section we introduce the problem of the estimation of the resistance of a hull advancing in calm water. The model hull shape considered in this work is the DTMB 5415, which was originally conceived for the preliminary design of a US Navy Combatant ship. Due to the wealth of experimental data available in the literature (see for example [33, 42]) such shape, which includes a sonar dome and a transom stern (see Fig. 2), has become a common benchmark for naval hydrodynamics simulation tools.

Let \(\varOmega \subset {\mathbb {R}}^3\), be a domain (see Fig. 2) associated with our DTMB 5415 model hull. We call \(\varOmega \) the *reference* domain; for practical reasons this domain happens to correspond to the undeformed hull, even though this assumption is not fundamental for the remainder of the paper. We here remark that the domain considered in the fluid dynamic simulations is in principle the volume surrounding the hull which is occupied by water, namely \(\varOmega _w\). Further details about the fluid dynamic domain will be provided in “Fully nonlinear potential model” section.

Let \({\mathcal {M}}(\varvec{x}; \varvec{\mu }^{\text {GEOM}}): {\mathbb {R}}^3 \rightarrow {\mathbb {R}}^3\) be a shape morphing that maps the reference domain \(\varOmega \) into the deformed domain \(\varOmega (\varvec{\mu }^{\text {GEOM}})\) as follows:

$$\begin{aligned} \varOmega (\varvec{\mu }^{\text {GEOM}}) = {\mathcal {M}}(\varOmega ; \varvec{\mu }^{\text {GEOM}}). \end{aligned}$$

Quite naturally, the results of the fluid dynamic simulations will depend on the specific hull shape considered, which are in turn associated to the parameters defining the morphing \({\mathcal {M}}\) (which will be extensively defined in “Shape morphing based on free form deformation” section). It is worth pointing out here that the geometrical quantity having the most effect on the resistance is the immersed volume of a hull shape, as higher volumes will generate higher drag values. This is clearly due to the fact that higher hull volumes will result in a higher mass of water displaced as the ship advances in the water, and in increased surface exposed to the water friction. This consideration might lead to the naive conclusion that since the shape optimizing the total drag is the one corresponding to zero buoyant volume, the hull volume must be constrained in the optimization algorithm, to avoid a convergence to such trivial shape, which would not generate a vertical force able to sustain the ship weight. In this work, rather than constraining the hull volume through more complex hull deformation algorithms, we decided to impose the weight (or displacement) of the hull in the fluid dynamic simulations, so that each hull would reach its hydrostatic equilibrium position, in which the weight prescribed at the design stage is balanced by the vertical hydrodynamic force. This solution, which of course requires a model accounting for the rigid motions of the hull into the fluid dynamic simulations, is able to lead to design solutions which optimize the total resistance while retaining the required load capability of the ship.

For all the aforementioned reasons, along with the geometrical parameters associated with the hull morphing, the results of our simulations are also affected by the ship displacement and cruise speed, which are instead physical parameters determining the hydrodynamic equilibrium position and forces. Thus, considering both the geometric morphing and variations in the physical parameters, we have a set of \(m\in {\mathbb {N}}\) parameters which affect the output of the fluid dynamic simulations. The parametric domain considered is then defined as \({\mathbb {D}} \subset {\mathbb {R}}^m\), and is assumed to be a box in \({\mathbb {R}}^m\).

By a practical standpoint, once a point in the parameter domain \({\mathbb {D}}\) is identified, the specific hull geometry as well as the desired ship displacement and cruise speed are provided to the fluid dynamic solver, which carries out a flow simulation to provide a resistance estimate. In this framework free form deformation has been employed for the generation of a very large number of hull geometries obtained from the morphing of the DTMB 5415 naval combatant hull. Each geometry generated has been used to set up a high fidelity hydrodynamic simulation with the desired ship displacement and hull speed. The output resistances for all the configurations tested have been finally analyzed by means of active subspaces in order to reduce the parameter space.

In the next subsections, we will provide a brief description of the unsteady fully nonlinear potential fluid dynamic model used to carry out the high fidelity simulations. In addition, we will describe the rigid body equations based on hull quaternions used to compute the hull linear and angular displacements corresponding to the final hydrodynamic equilibrium position reached at the end of each simulation. We refer the interested reader to [29,30,31] for further information on the fully nonlinear potential free surface model, on its application to complex hull geometries, and on the treatment of the hull rigid motions, respectively.

### Fully nonlinear potential model

In the simulations we are only considering the motion of a ship advancing at constant speed in calm water. For such reason we solve the problem in a *global*, translating reference frame \({\widehat{XYZ}}\), which is moving with the constant horizontal velocity of the boat \(\varvec{V}_\infty = (V_\infty ,0,0)\). Thus, the *X* axis of the reference frame is aligned with \(\varvec{V}_\infty \), the *Z* axis is directed vertically (positive upwards), while the *Y* axis is directed laterally (positive port side).

As aforementioned, the domain \(\varOmega _w(t)\) in which we are interested in computing the fluid velocity and pressure is represented by the portion of water surrounding the ship hull. The time varying shape of such domain—and in particular that of its boundary with the air above—is one of the unknowns of the fluid dynamic problem. By convention, we place the origin of the vertical axis *Z* in correspondence with the undisturbed free surface level, and we start each simulation at time \(t=0\) from such undisturbed configuration. Thus, at least in its initial configuration, the flow domain is represented by \(\varOmega _w(t=0) = {\mathbb {R}}^3_{Z-}\backslash \varOmega \), which is the boolean subtraction of the hull volume from the lower half-space of \({\mathbb {R}}^3\) for which \(Z\le 0\), here indicated with \({\mathbb {R}}^3_{Z-}\).

If overturning waves are not observed (which is typically the case for low cruise velocities typical of a ship), the domain \(\varOmega _w(t)\) is simply connected. So under the assumptions of irrotational flow and non viscous fluid the velocity field \(\varvec{v}(\varvec{X},t)\) admits a representation through a scalar potential function \(\varPhi (\varvec{X},t)\), namely

$$\begin{aligned} \varvec{v}= {\varvec{\nabla }}\varPhi = {\varvec{\nabla }}(\varvec{V}_\infty \cdot \varvec{X}+ \phi ) \qquad \qquad \forall \ \varvec{X}\in \varOmega _w(t), \end{aligned}$$

(1)

in which \(\phi (\varvec{X},t)\) is the *perturbation potential*. Under the present assumptions, the equations of motion simplify to the unsteady Bernoulli equation and to the Laplace equation for the perturbation potential:

$$\begin{aligned}&\frac{\partial \phi }{\partial t}+\frac{1}{2}\left| {\varvec{\nabla }}\phi +\varvec{V}_\infty \right| ^2 +\frac{p-p_a}{\rho }-\varvec{g}\cdot \varvec{X}= C(t) \qquad \text { in } \varOmega _w(t) , \end{aligned}$$

(2a)

$$\begin{aligned}&\varDelta \phi = 0 \qquad \text { in } \varOmega _w(t), \end{aligned}$$

(2b)

where *C*(*t*) is an arbitrary function of time, and \(\varvec{g}= (0,0,-g)\), is the gravity acceleration vector, directed along the *z* axis. The unknowns of such mathematical problem \(\phi \) and *p* are uncoupled. This means that the solution of the Poisson problem in Eq. (2b) can be obtained independently of the pressure field. Once such solution is obtained, the pressure can be obtained through a postprocessing step based on Bernoulli Eq. (2a). Thus, the Laplace equation is the governing equation of our model. Such equation is complemented by non penetration boundary conditions on the hull surface \(\varGamma ^{b}(t)\) and water basin bottom boundary \(\varGamma ^{bot}(t)\), and by homogeneous Neumann boundary conditions on the truncation boundaries \(\varGamma ^{far}(t)\) of the numerical domain. The bottom of the basin is located at a depth corresponding to 2 boat lengths, while the truncation boundaries are located approximatively at a distance from the boat of 6 boat lengths in the longitudinal direction *X* and of 2 boat lengths in the lateral direction *Y*). On the water free surface \(\varGamma ^{w}(t)\), we employ the kinematic and dynamic Semi-Lagrangian fully nonlinear boundary conditions, which respectively read

$$\begin{aligned} \frac{\delta \eta }{\delta t}= & {} \frac{\partial \phi }{\partial z}+{\varvec{\nabla }}\eta \cdot \left( \varvec{w}-{\varvec{\nabla }}\phi -\varvec{V}_\infty \right) \qquad \text { in } \varGamma ^{w}(t) , \end{aligned}$$

(3)

$$\begin{aligned} \frac{\delta \phi }{\delta t}= & {} -g\eta + \frac{1}{2}|{\varvec{\nabla }}\phi |^2 + {\varvec{\nabla }}\phi \cdot \left( \varvec{w}-{\varvec{\nabla }}\phi -\varvec{V}_\infty \right) \qquad \text { in } \varGamma ^{w}(t). \end{aligned}$$

(4)

The former equation expresses the fact that a material point moving on the free surface will stay on the free surface—here assumed to be a single valued function \(\eta (X,Y,t)\) of the horizontal coordinates *X* and *Y*. The latter condition is derived from Bernoulli Eq. (2a), under the assumption of constant atmospheric pressure on the water surface. This peculiar form of the fully nonlinear boundary conditions was proposed by Beck [4]. Eq. (3) allows for the computation of the vertical velocity of markers which move on the water free surface with a prescribed horizontal speed \((w_X,w_Y)\). Eq. (4) is used to obtain the velocity potential values in correspondence with such markers. The resulting vector \(\varvec{w}=(w_X,w_Y,\frac{\delta \eta }{\delta t}) = {\dot{\varvec{X}}}\) is the time derivative of the position of the free surface markers. In this work, such free surface markers are chosen as the free surface nodes of the computational grid. To avoid an undesirable mesh nodes drift along the water stream, the markers arbitrary horizontal velocity is set to 0 along the *X* direction. The *Y* component of the water nodes in contact with the ship—which is moved according with the computed linear and angular displacements—is chosen so as to keep such nodes on the hull surface. As for the remaining water nodes, the lateral velocity value is set to preserve mesh quality.

### Three dimensional hull rigid motions

The ship hull is assumed to be a rigid body. A second, *hull-attached* reference frame \({\widehat{xyz}}\), which follows the hull in its translations and rotations is employed to study the ship motions. The center of such reference frame is located at the ship center of gravity, which in the global reference frame reads \(\varvec{X}^G(t) = X^G(t)\varvec{e}_X+Y^G(t)\varvec{e}_Y+Z^G(t)\varvec{e}_Z\), where \(\varvec{e}_X\), \(\varvec{e}_Y\), \(\varvec{e}_Z\) are the unit vectors along the global system axes. See Fig. 3 for a detailed sketch.

The rotation matrix *R*(*t*) is used to convert the coordinates of a point \(\varvec{x}\) written in the hull-attached reference frame, to those in the global frame \(\varvec{X}\), namely

$$\begin{aligned} \varvec{X}(t) = R(t)\varvec{x}+\varvec{X}^G(t). \end{aligned}$$

(5)

The global frame velocity of a point having coordinates \(\varvec{x}\) in the hull-attached frame is obtained as

$$\begin{aligned} \varvec{V}^{\text {hp}}(t) = {\varvec{\omega }}(t)\times \varvec{x}+{\dot{\varvec{X}}}^G(t), \end{aligned}$$

(6)

in which \({\varvec{\omega }}\) is the angular velocity vector.

Equations (5) and (6) imply that once \(\varvec{X}^G(t)\), *R*(*t*), and \({\varvec{\omega }}(t)\) are known at time *t*, the position and velocity of each point of the hull can be obtained. For this reason, writing the time evolution equations for \(\varvec{X}^G(t)\), *R*(*t*), and \({\varvec{\omega }}(t)\) is sufficient to fully determine the hull dynamics. In the next sections, we will present such evolution equations written in the global reference frame, as presented in [1, 17].

The evolution equation for \(\varvec{X}^G(t)\) is obtained via the linear momentum conservation equation, which in the case of our hydrodynamics simulation framework reads

$$\begin{aligned} m_s\ddot{\varvec{X}}^G(t) = m_s\varvec{g}+ \varvec{F}^w(t). \end{aligned}$$

(7)

In Eq. (7), \(m_s\) is the mass of the ship, while the hydrodynamic force vector \(\varvec{F}^w(t)\) is in the present work obtained as the sum of the pressure and viscous forces on the hull.

The evolution equation for \({\varvec{\omega }}\) is obtained writing the angular momentum conservation, namely

$$\begin{aligned} R(t) I^G R(t)^T{\dot{{\varvec{\omega }}}}(t) + {\varvec{\omega }}(t) \times R(t) I^G R(t)^T {\varvec{\omega }}(t) = \varvec{M}^w(t), \end{aligned}$$

(8)

where \(I^G\) is the matrix of inertia of the ship in the hull-attached reference frame, and hydrodynamic moment vector \(\varvec{M}^w(t)\) is the sum of the moment about the ship center of gravity of the pressure and viscous forces on hull, propeller and appendages.

To write an evolution equation for *R*, starting from the angular velocity vector \({\varvec{\omega }}(t)=[\omega _X(t),\omega _Y(t),\omega _Z(t)]\), we first introduce the skew symmetric tensor

$$\begin{aligned} \omega (t) = \left[ \begin{array}{c c c} 0 &{} -\omega _Z(t) &{} \omega _Y(t) \\ \omega _Z(t) &{} 0 &{} -\omega _X(t) \\ -\omega _Y(t) &{} \omega _X(t) &{} 0 \end{array}\right] . \end{aligned}$$

(9)

Note that tensor \(\omega (t)\) will act on a vector \(\varvec{u}\in {\mathbb {R}}^3\) as if the vector product by \({\varvec{\omega }}(t)\) were applied to \(\varvec{u}\):

$$\begin{aligned} {\varvec{\omega }}(t)\times \varvec{u}= \omega (t)\varvec{u}. \end{aligned}$$

(10)

Making use of such tensor, an evolution equation for the rotation matrix *R*(*t*) reads

$$\begin{aligned} {\dot{R}}(t) = \omega (t) R(t), \end{aligned}$$

(11)

which can be advanced in time to obtain the components of *R* and close the equations of motions of a rigid body in three dimension. Yet, in the common practice of rigid body simulations, direct numerical integration of Eq. (11) is avoided. The most important reason for this is related to numerical drift. If we in fact keep track of the orientation of a rigid body integrating Eq. (11), numerical error will build up in the entries of *R*(*t*), so that it will no longer be a rotation matrix, losing its properties of orthogonality and of having determinant equal to 1. Physically, the effect would be that applying *R*(*t*) to a body would cause a skewing effect.

A better way to represent the orientation of a rigid body in three dimensions (even with large rotations) is represented by the use of *unit quaternions* (see the work of [41] for details). For our purposes, quaternions can be considered as a particular type of four element vector, normalized to unit length. If we indicate the quaternion \(\varvec{q}= s + v_X\varvec{e}_X + v_Y\varvec{e}_Y + v_Z\varvec{e}_Z \) as \(\left[ s,\varvec{v}\right] \), the internal product of two quaternions \(\varvec{q}_1\) and \(\varvec{q}_2\) is defined as

$$\begin{aligned} \varvec{q}_1\varvec{q}_2 = \left[ s_1,\varvec{v}_1\right] \left[ s_2,\varvec{v}_2\right] = \left[ s_1s_2-\varvec{v}_1\cdot \varvec{v}_2\, , \, s_1\varvec{v}2+s_2\varvec{v}1+\varvec{v}_1\times \varvec{v}_2\right] . \end{aligned}$$

(12)

The norm of a quaternion \(\varvec{q}\) is defined as \(||\varvec{q}|| = \sqrt{s^2+v_X^2+v_Y^2+v_Z^2}\). Unit quaternions can be used to represent rotations in a three dimensional space. In fact, given a quaternion \(\varvec{q}(t): ||\varvec{q}(t)||=1 \quad \forall t\), we can obtain the corresponding rotation matrix as

$$\begin{aligned} R = \left[ \begin{array}{c c c} 1-2v_Y^2-2v_Z^2 &{} 2v_Xv_Y-2s v_Z &{} 2v_Xv_Z+2s v_Y \\ 2v_Xv_Y+2s v_Z &{} 1-2v_Y^2-2v_Z^2 &{} 2v_Yv_Z-2s v_X \\ 2v_Xv_Z-2s v_Y &{} 2v_Yv_Z+2s v_X &{} 1-2v_Y^2-2v_Z^2 \end{array}\right] , \end{aligned}$$

(13)

in which to lighten the notation we omitted the time dependence of both *R*(*t*) and the components of \(\varvec{q}(t)\).

Finally, the equation needed to describe the time evolution for the hull quaternion \(\varvec{q}(t)\) is

$$\begin{aligned} {\dot{\varvec{q}}}(t) = \frac{1}{2}{\varvec{\omega }}_q(t)\varvec{q}(t), \end{aligned}$$

(14)

where \({\varvec{\omega }}_q(t) = \left[ 0,{\varvec{\omega }}(t)\right] \) is the quaternion associated with the angular velocity vector \({\varvec{\omega }}(t)\). As quaternions only have four entries, there only is one extra variable used to describe the three degrees freedoms of a three dimensional rotation. A rotation matrix instead employs nine parameters for the same three degrees of freedom; thus, the quaternions present far less redundancy than rotation matrices. Consequently, quaternions experience far less numerical drift than rotation matrices. The only possible source of drift in a quaternion occurs when the quaternion has lost its unit magnitude. This can be easily corrected by periodically renormalizing the quaternion to unit length [41].