# Optimal Attitude Determination for the CR200 Underwater Walking Robot
## 2 Problem Definition and Method of Simulation
### CFD Simulation  
#### 2.2.1 Governing Equations  
The seawater flow is considered an incompressible viscous flow governed by the incompressible Navier-Stokes equations [24]. The effects of high Reynolds number turbulent flow are modeled by the incompressible Reynolds-averaged Navier-Stokes (RANS) equations, which consist of the continuity and momentum equations as follows:  
\[\frac{\partial U_{i}}{\partial x_{i}}=0 \tag{1}\]  
\[\frac{\partial(\rho U_{i})}{\partial t}+\frac{\partial}{\partial x_{j}}\Big{(} \rho U_{j}U_{i}\Big{)}=-\frac{\partial P}{\partial x_{i}}+\frac{\partial}{ \partial x_{j}}\Bigg{[}\mu\left(\frac{\partial U_{i}}{\partial x_{j}}+\frac{ \partial U_{j}}{\partial x_{i}}\right)-\rho\overline{u_{j}^{\prime}u_{i}^{ \prime}}\Bigg{]}+\rho f_{i} \tag{2}\]  
where \(\rho\) and \(P\) are density and mean pressure. \(U_{i}\) and \(f_{i}\) stand for the \(i\)-directional component of mean fluid velocity and external body force, respectively, in Cartesian coordinates \(x_{i}(i=1,\ 2,\ 3)\).  
Based on the Boussinesq approximation, the correlation term of fluctuations known as the Reynolds stress tensor can be modeled as  
\[-\rho\overline{u_{j}^{\prime}u_{i}^{\prime}}=\mu_{t}\left(\frac{\partial U_{i }}{\partial x_{j}}+\frac{\partial U_{j}}{\partial x_{i}}\right)-\frac{2}{3} \rho k\delta_{ij} \tag{3}\]  
where \(\mu_{t}\) is turbulent viscosity; \(k\) is turbulent kinetic energy, and \(\delta_{ij}\) is the Kronecker delta.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Size [m] & 2.42 (L) \(\times\) 2.45 (W) \(\times\) 1.16 (H) \\ Weight [kg] & 700 (air)/200 (water) \\ Number of legs & 6 \\ Max. ground clearance [m] & over 0.5 \\ Max. depth of water [m] & 200 \\ Max. walking speed [m/s] & 0.5 \\ Max. endurable current [m/s] & 3 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Specifications of the CR200.  
Figure 1: CR200 appearance and the equipped devices [2].  
RANS equations could be rewritten by substituting Equation (3) into Equation (2) as follows:  
\[\frac{\partial(\rho U_{i})}{\partial t}+\frac{\partial}{\partial x_{j}}\Big{(} \rho U_{j}U_{i}\Big{)}=-\frac{\partial P}{\partial x_{i}}+\frac{\partial}{ \partial x_{j}}\Bigg{[}(\mu+\mu_{t})\Bigg{(}\frac{\partial U_{i}}{\partial x_{ j}}+\frac{\partial U_{j}}{\partial x_{i}}\Bigg{)}\Bigg{]}+\rho f_{i} \tag{4}\]  
The flow around the CR200 has a Reynolds number on the order of \(\mathcal{O}\big{(}10^{6}\big{)}\), and the boundary layer is expected to develop. Consequently, the \(k-\omega\)_SST_ model [25], known for its accurate prediction of separation onset and extent under adverse pressure gradients, is employed to compute the eddy viscosity \(\mu_{t}\).  
In the current study, CFD simulations were conducted using the verified commercial software STAR-CCM+ (ver. 2310), which employs the finite volume method for discretizing the governing equations. An unsteady formulation with a first-order implicit temporal scheme was used. For pressure-velocity coupling, the SIMPLE algorithm was adapted. A second-order upwind scheme was used to compute the convective flux, ensuring improved accuracy in capturing flow characteristics. Additionally, the Venkatakrishnan limiter was implemented to constrain the reconstruction gradients, enhancing numerical stability.