Transport dynamics of ultracold atoms in a double-well potential