  (Abridged) We investigate non-spherical behavior of gas accreting onto a
central supermassive black hole performing simulations using the SPH code
GADGET-3 including radiative cooling and heating by the central X-ray source.
As found in earlier 1D studies, our 3D simulations show that the accretion mode
depends on the X-ray luminosity (L_X) for a fixed density at infinity and
accretion efficiency. In the low L_X limit, gas accretes in a stable,
spherically symmetric fashion. In the high L_X limit, the inner gas is
significantly heated up and expands, reducing the central mass inflow rate. The
expanding gas can turn into a strong enough outflow capable of expelling most
of the gas at larger radii. For some intermediate L_X, the accretion flow
becomes unstable developing prominent non-spherical features, the key reason
for which is thermal instability (TI) as shown by our analyses. Small
perturbations of the initially spherically symmetric accretion flow that is
heated by the intermediate L_X quickly grow to form cold and dense clumps
surrounded by overheated low density regions. The cold clumps continue their
inward motion forming filamentary structures; while the hot infalling gas slows
down because of buoyancy and can even start outflowing through the channels in
between the filaments. We found that the ratio between the mass inflow rates of
the cold and hot gas is a dynamical quantity depending on several factors:
time, spatial location, and L_X; and ranges between 0 and 4. We briefly discuss
astrophysical implications of such TI-driven fragmentation of accreting gas on
the formation of clouds in narrow and broad line regions of AGN, the formation
of stars, and the observed variability of the AGN luminiosity.
