A nonlinear numerical wave tank is established using the Harmonic Polynomial Cell (HPC) method, which is incorporated with a mass source. The numerical wave tank consists of the mass source wave generation region and the working region, with sponge layers at both ends for wave absorption. In the mass source region, a generalized HPC method is applied to solve the inhomogeneous elliptic boundary value problems. The Poisson equation's special solution is represented by a bi-quadratic function. In the remaining domains, the HPC method is employed with harmonic polynomials to solve the problems governed by the Laplace equation in each grid cell. The free surface is tackled by the immersed boundary method (IB-HPC), and the kinematic and dynamic conditions of the free surface are described using a semi-Lagrangian approach. A variety of waves propagation are simulated, including Second-order Stokes wave, fifth-order Stokes wave, solitary wave, fifth-order Fenton stream function wave, random wave and the interaction with a straight vertical wall. The numerical solutions are compared with theoretical solutions. The numerical simulation results demonstrate that the present method can generate arbitrary two-dimensional wave fields by specifying an appropriate source function. Additionally, the reflected waves can propagate through the wave generation region, ensuring that the process of wave generation is not affected by the reflections.