This paper discusses the importance of realistic implementation of the physical boundary conditions into computational domain for the simulation of the oscillatory turbulent boundary layer flow over smooth and rough flat beds. A mathematical model composed of the Reynolds averaged Navier-Stokes equation, turbulent kinetic energy (k) and dissipation rate of the turbulent kinetic energy (epsilon) has been developed. Control-volume approach is used to discretize the governing equations to facilitate the numerical solution. Non-slip condition is imposed on the bottom surface, and irrotational main flow properties are applied to the upper boundary. The turbulent kinetic energy is zero at the bottom, whereas the dissipation rate is approaching to a constant value, which is proportional to the kinematic viscosity times the second derivative of the turbulent kinetic energy. The output of the model is compared with the available experimental studies conducted in oscillatory tunnels and wave flume. It is observed that the irrotational flow assumption at the upper boundary is not realistic in case of water tunnels. Therefore, new upper boundary conditions are proposed for oscillatory tunnels. The data of wave flume show good agreement with the proposed numerical model. Additionally, several factors such as grid aspect ratio, staggered grid arrangement, time-marching scheme and convergence criteria that are important to obtain a robust, realistic and stable code are discussed. Copyright (C) 2009 John Wiley & Sons, Ltd.