## 4 Results
### Forward Motion  
A total of 117 different cases, as described in the previous section, were modeled in OpenFOAM for 13 different speeds (0.25, 0.35, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4 and 1.5 m/s). Therefore, all 117 cases listed in Appendix A were analyzed. OpenFOAM computation for each of the 117 cases lasted for about 18,000 s, so the total running time was about 35,100 min. Results of the analysis were presented in Figure 6. The resistance coefficient for the forward motion in Figure 7 were presented against \(L/D_{S}\) and Reynolds number, given by the following expression:  
\[R_{ef}=\frac{V_{f}D_{S}}{v} \tag{16}\] \begin{table}
\begin{tabular}{c c c c} \hline
**Case** & \(L\) **(m)** & \(D_{S}\) **(m)** & \(L/D_{S}\) \\ \hline
1 & 25 & 2.44 & 10.2 \\
2 & 24 & 2.49 & 9.6 \\
3 & 23 & 2.54 & 9.1 \\
4 & 22 & 2.59 & 8.5 \\
5 & 21.06 & 2.64 & 8.0 \\
6 & 20 & 2.7 & 7.4 \\
7 & 19 & 2.76 & 6.9 \\
8 & 18 & 2.83 & 6.4 \\
9 & 17 & 2.9 & 5.9 \\ \hline \end{tabular}
\end{table} 
Table 2: The dimensions of a submarine for different \(L/D_{S}\) ratios. Figure 6: The resistance coefficient and total resistance of different geometries against fluid flowing at different Reynolds numbers (**a**) a cube of 0.45m length, (**b**) a sphere of 2.64 m diameter. In the present case, \(\upsilon\) is the dynamic viscosity of \(10^{-6}\frac{\mathrm{m}^{2}}{8}\)[39]. The results shown in Figure 7 indicate that the relationship between the resistance coefficient in the forward direction (\(C_{D\_f}\)) and \(L\)/\(D_{S}\) is almost linear. However, the change of this parameter is somewhat nonlinear at the low (e.g., 0.5 m/s) and high (e.g., 1.5 m/s) speeds. On the other hand, for all \(L\)/\(D_{S}\), the relationship between \(C_{D\_f}\) and forward speed (\(V_{g}\)) is nonlinear. Next, \(N\)\(N\)\(L\)\(S\) and \(ANN\) methods were applied to fit the best curve to the results shown in Figure 7 and find a nonlinear equation to estimate the resistance coefficient of the bare hull based on two dimensionless parameters, \(L\)/\(D_{S}\) and Reynolds number (\(R_{\_{\_}{\mathit{eff}}}\)). The following equations were derived for the resistance coefficient of the submarine with the forward speed using the developed code in MATLAB. For the \(ANN\), 70%, 15%, and 15% of data (corresponding to 83, 17, and 17 data) were used in training, testing, and evaluation steps, respectively:  
\(N\)\(N\)\(L\)\(S\):  
\[ \begin{array}{rl}C_{R-f}=5.372&-0.34\frac{L}{D_{\_}{S}}+1.625 log(R_{\_}{ \mathit{eff}})+0.0031\Big{(}\frac{L}{D_{\_}{S}}\Big{)}^{2}+0.096\frac{L}{D_{\_} {S}}log(R_{\_}{\mathit{eff}})+0.125\Big{(}log(R_{\_}{\mathit{eff}})\Big{)}^{2} \\ &-0.000534\Big{(}\frac{L}{D_{\_}{S}}\Big{)}^{3}-0.0002102\Big{(}\frac{L}{D_{\_} {S}}\Big{)}^{2}\Big{(}log(R_{\_}{\mathit{eff}})\Big{)}+0.007171\frac{L}{D_{\_} {S}}\Big{(}log(R_{\_}{\mathit{eff}})\Big{)}^{2}\end{array}  \tag{17}\]  
_ANN_ (Figure 3):  
\[C_{R-f}=0.0971+0.0827 tanh\Big{(}-0.146\frac{L}{D_{\_}{S}}-1.584 log(R_{\_}{ \mathit{eff}})+9.578\Big{)} \tag{18}\]  
_ANN_ (Figure 4):  
\[ \begin{array}{rl}C_{R-f}=0.112+0.0547 tanh\Big{(}-0.161\frac{L}{D_{\_}{S}}+ 1.971 log(R_{\_}{\mathit{eff}})-13.066\Big{)}+0.047 tanh\Big{(}-0.119\frac{L}{D_ {\_}{S}}\\ -2.004 log(R_{\_}{\mathit{eff}})+12.325\Big{)}\end{array}  \tag{19}\]  
To assess that accuracy of Equations (17)-(19), \(ANN\)s with larger number of neurons (\(N\)\(ON\)) in the hidden layer (see Figure 8) are also trained. Figure 7: Variation of \(C_{R\_f}\) versus the dimensionless parameters, \(L\)/\(D_{\_}{S}\) and log (\(R_{\_}{\mathit{eff}}\)) for the forward direction. In _ANN_, the optimal _NON_s in the hidden layers is determined by trial and error and not straightforwardly. However, it was advised to use 2-4 times the input layer's number of nodes [40,41].