## 1 Introduction  
Drag reduction has long been noticed and studied as an important way to achieve long voyage goals and energy-saving requirements in marine strategies [1]. Especially for micro underwater vehicles with small size and less power sources, it is more important to reduce energy consumption. There are active methods for drag reduction, which require additional energy consumption, such as reverse jet [2] and cavitation [3], and passive methods such as groove structures [4] and hydrophobic surfaces [5]. At the beginning of the above optimization methods, the optimal design of a hydrodynamic body shape is a rather important antecedent in the drag-reduction step of underwater vehicles, and a good streamlined body shape contributes a large percentage to the drag reduction. Current research on underwater body shape for drag reduction mainly focuses on the parametric optimization using simplified models or constructing alternative models [6; 7; 8; 9; 10; 11; 12]. The vast majority of them are shape optimization of existing models, which are empirical, intuitive and not optimal results in a certain range of operating conditions. In order to obtain the optimal flexible choice for different design objectives in different flow field conditions, we introduce the variable density method to realize the topology optimization of the body shape. Topology optimization is a powerful method for the structural inverse design, which generates structures that meet the optimization objectives directly in the design domain through a holistic mathematical approach [13]. Compared with the shape optimization and the dimensional optimization, topology optimization has a greater design freedom and requires low priori for defining the initial structure. In addition, topology optimization can also ensure the manufacturability of the generated structures by using additional constraints [14; 15]. Its concept originates in the field of solid mechanics and first appeared in the design of truss structures [16]. Since [PERSON] and [PERSON] [17] pioneered the homogenization method to describe structural topology in terms of material distribution in 1988, various topology optimization methods, such as the asymptotic structure optimization method [18], the variable density methods [19] and the level set method [20], have been widely used in multiple research fields, such as acoustics, optics, electronics, heat conduction, fluid flow and combined applications of multiphysics disciplines [21; 22; 23; 24; 25; 26]. The problem of the optimal body shape can be traced back to [PERSON]'s research [27] on the minimum drag in Stokes flow. Later on, some problems on drag and lift were studied [28; 29; 30; 31; 32]. Reference [29] studies the drag and lift of the 2D time-dependent flow around a cylinder. As the fluid stream passes the topmost part of the cylinder, it tends to separate from the top surface and peel off in a clockwise motion as it approaches the rear end of the cylinder, ending up as a shed vortex which can be quantified [33] and represents a dangerous structural problem [34]. In relevant fluid dynamics problems, uncertainty quantification is often used to introduce the uncertainty into a mathematical and physical model to make it more realistic [35; 36]. In the topology optimization of fluid, [PERSON] and [PERSON] [37] develop a porous media model for the Stokes flow, which was soon extended to the Navier-Stokes flow [38; 39]. In this model, porous media is filled in the two-dimensional(2D) or three-dimensional(3D) design domain, and the artificial Darcy friction is added to the Stokes equation and the Navier-Stokes equation to characterize the effect of the material on the fluid. [40] gives a detailed introduction to density-based topology optimization of fluid flow problems with implementation in MATLAB. Compared with [38; 39], we extend topology optimization to 3D external flow problems. In this paper, porous media is filled in a steady incompressible fluid, and material density is applied for implementing material interpolation.