Plasma motion and purification in an ergodic divertor