Authors:Yoneda et alAbstract:We investigate the chemistry in a radiation-hydrodynamics model of star-forming core which evolves from a cold (∼10 K) prestellar core to the main accretion phase in ∼105 yr. A rotationally-supported gravitationally unstable disk is formed around a protostar. We extract the temporal variation of physical parameters in ∼1.5×103 SPH particles which end up in the disk, and perform post-processing calculations of the gas-grain chemistry adopting a three-phase model. Inside the disk, the SPH particles migrate both inward and outward. Since a significant fraction of volatiles such as CO can be trapped in the water-dominant ice in the three-phase model, the ice mantle composition depends not only on the current position in the disk but also on whether the dust grain has ever experienced higher temperatures than the water sublimation temperature. Stable molecules such as H2O, CH4, NH3 and CH3OH are already abundant at the onset of gravitational collapse and simply sublimated as the fluid parcels migrate inside the water snow line. On the other hand, various molecules such as carbon chains and complex organic molecules (COMs) are formed in the disk. COMs abundance sensitively depends on the outcomes of photodissociation and diffusion rates of photofragments in bulk ice mantle. As for S-bearing species, H2S ice is abundant in the collapse phase. In the warm regions in the disk, H2S is sublimated to be destroyed, while SO, H2CS, OCS and SO2 become abundant.