Based on the finite volume method, the Navier-Stokes equations was used as the governing equations to develop a new module of the wave generating and absorbing function. The wave generating was introduced as the man-made source terms into the momentum equations, which was suitable for the volume of fluid method (VOF). Within the numerical wave flume, the reflected waves from the construction could be absorbed effectively. The absorbing section arranged at the end of the wave flume was for absorbing the incident wave, which allows for random and effective working time within the reletively smaller computation domain. Consequently, the computation efficiency was greatly improved. Finally, the validity of the absorbing section arranged at the front and end of the wave flume was investigated individually.