In this paper, the potential and viscous flows are simulated numerically around a 2-D floating body with a moonpool (or a small gap) with particular emphasis on the piston mode. The floating body with moonpool is forced to heave in time domain. Linear potential code is known to give overestimated free-surface heights inside the moonpool. Therefore, a free-surface lid in the gap or similar treatments are widely employed to suppress the exaggerated phenomenon by potential theory. On the other hand, Navier-Stokes equation solvers based on a FVM can be used to take account of viscosity. Wave height and phase shift inside and outside the moon-pool are computed and compared with experimental results by Faltinsen et al. (2007) over various heaving frequencies. Pressure and vorticity fields are investigated to better understand the mechanism of the sway force induced by the heave motion. Furthermore, a nonlinear potential code is utilized to compare with the viscous flow. The viscosity effects are investigated in more detail by solving Euler equations. It is found that the viscous flow simulations agree very well with the experimental results without any numerical treatment.