Formation of sand ripples in an oscillating viscous flow