  Episodic ejections of blobs (episodic jets) are widely observed in black hole
sources and usually associated with flares. In this paper, by performing and
analyzing three dimensional general relativity magnetohydrodynamical numerical
simulations of accretion flows, we investigate their physical mechanisms. We
find that magnetic reconnection occurs in the accretion flow, likely due to the
turbulent motion and differential rotation of the accretion flow, resulting in
flares and formation of flux ropes. Flux ropes formed inside of 10-15
gravitational radii are found to mainly stay within the accretion flow, while
flux ropes formed beyond this radius are ejected outward by magnetic forces and
form the episodic jets. These results confirm the basic scenario proposed in
Yuan et al.(2009). Moreover, our simulations find that the predicted velocity
of the ejected blobs is in good consistency with observations of Sgr A*, M81,
and M87. The whole processes are found to occur quasi-periodically, with the
period being the orbital time at the radius where the flux rope is formed. The
predicted period of flares and ejections is consistent with those found from
the light curves or image of Sgr A*, M87, and PKS 1510-089. The possible
applications to protostellar accretion systems are discussed.
