In order to model nonlinear breaking waves with moving boundary and coastal sandbar migration; we presented a morphodynamic model, where hydrodynamic equations (free surface flows) and sediment transport equation are solved in a coupled manner. The originality lies in the development of an innovative approach, in which, we project the horizontal velocity onto a basis functions depending only on the variable z and we calculate analytically the vertical velocity and the nonhydrostatic pressure. The choice of basis depends on the problem under consideration. This model is numerically stable because there is no mesh in the vertical direction. This model is accurate because we can directly introduce functions that best fits the physical nature of the flow. Our model is validated through laboratory measurements carried out by Dingemans [1994, J. Comput. Phys. 231, 328–344], Cox and Kobayashi [2000, J. Geophys. Res. 105(c6), 223–236. and Dette et al. [2002, Coast. Eng. 47, 137–177].