An efficient solver for nearshore flows