Simulation of accretion during galactic mergers