  Since the DIII-D resonant magnetic perturbation experiment [Nucl. Fusion
$\bm{59}$, 126010 (2019)] suggests that the neoclassical toroidal viscosity due
to the collisional effects associated with the non-resonant magnetic
perturbations is not enough to explain the observed toroidal rotation, it is of
interest to investigate the toroidal rotation induced by the anomalous
diffusion due to the resonant magnetic perturbations. Gyrokinetic simulation of
the toroidal rotation of plasma in a stochastic magnetic field is carried out
to investigate the resonant magnetic perturbations effects on toroidal
rotation. The simulation results suggest that, in a stochastic magnetic field,
resonant magnetic perturbations drive the plasma to toroidally rotate through
the ambipolar radial electric field. It is found that this spontaneous flow
driven on the time scale less than an ion-ion collision time is the parallel
return flow of the $\bm{E}_r\times\bm{B}_0$ drift, which is due to the the
ambipolar radial electric field induced by the non-ambipolar radial diffusion
in the stochastic magnetic field. Collisional effect changes the plasma
toroidal rotation from the return flow to the rigid-body flow after a few
ion-ion collision times. The toroidal rotation observed in DIII-D resonant
magnetic perturbation experiment [Nucl. Fusion $\bm{59}$, 126010 (2019)], can
be explained by the rigid-body rotation driven by the ambipolar radial electric
field generated by the stochastic magnetic field layer.
