A three-dimensional model of sand bank formation