Three-dimensional magnetohydrodynamical simulation of expanding magnetic flux ropes