A numerical model of flow over sand waves in water of finite depth