  A complete understanding of solar radio bursts requires developing numerical
techniques which can connect large-scale activities with kinetic plasma
processes. As a starting point, this study presents a numerical scheme
combining three different techniques: (1) extrapolation of magnetic field
overlying a specific active region in order to derive the background field, (2)
guiding-center simulation of dynamics of millions of particles within a
selected loop to reveal the integral velocity distribution function (VDF)
around certain sections of the loop, and (3) particle-in-cell (PIC) simulation
of kinetic instabilities driven by energetic electrons initiated by the
obtained distributions. Scattering effects at various levels (weak, moderate,
and strong) due to wave/turbulence-particle interaction are considered using
prescribed time scales of scattering. It was found that the obtained VDFs
contain strip-like and loss-cone features with positive gradient, and both
features are capable of driving electron cyclotron maser emission (ECME), which
is a viable radiation mechanism for some solar radio bursts, in particular,
solar radio spikes. The strip-like feature is important in driving the harmonic
X mode, while the loss-cone feature can be important in driving the fundamental
X mode. In the weak-scattering case, the rate of energy conversion from
energetic electrons to X2 can reach up to ~2.9 * 10^-3 Ek0, where Ek0 is the
initial kinetic energy of energetic electrons. The study demonstrates a novel
way of exciting X2 mode in the corona during solar flares, and provides new
sight into how escaping radiation can be generated within a coronal loop during
solar flares.
