In this study, a mass source wavemaker and a numerical sponge layer were embedded into a three-dimensional (3D) Navier–Stokes equations model to study wave–structure interaction problems. The capability of the numerical sponge layer was first examined and an optimal layout of the sponge layer was determined based on a series of two-dimensional (2D) numerical experiments. Then, the scheme was extended to 3D geometry. In addition, an approach for designing the mass source function for an internal wavemaker was developed. The proposed method was applied to directional wave cases. Regular, irregular, and solitary waves were examined. The numerical results were compared with the analytical solutions and some numerical results obtained using the momentum source method, with good agreements observed for a wide range of relative water depths. Finally, the proposed model was applied to simulate 2D and 3D wave–structure interaction problems. Model-data comparisons show that the proposed model is potentially useful and efficient for examining wave–structure interactions.