A device and method for manipulating and mixing magnetic particles in a liquid medium