Accelerated particle beams in a 3D simulation of the quiet Sun Effects of advanced beam propagation modelling

,


Introduction
Accelerated particles are one of the least understood outcomes of the magnetic field reconnecting in the solar corona.Magnetic reconnection can bring the particle distribution out of thermal equilibrium and produce beams of non-thermal particles travelling along the magnetic field.The beams can, in some cases, contain a significant portion of the released magnetic energy (Lin & Hudson 1971;Emslie et al. 2004Emslie et al. , 2012)).The effects of accelerated particles are routinely observed in large flares, but their role in smaller energy-release events is unclear.
The interactions between the non-thermal particle beams and their environment have been modelled with ever-increasing levels of sophistication.Early models calculated the mean rate of change in the velocities of the beam particles due to Coulomb collisions with free electrons and protons (Brown 1972;Syrovatskii & Shmeleva 1972).This was later generalised to include collisions with neutral hydrogen, initially for when the fraction of ionised hydrogen is uniform (Emslie 1978), and subsequently for a non-uniform ionisation fraction (Hawley & Fisher 1994).Other studies incorporated the effects of a neutralising return current (Knight & Sturrock 1977;Emslie 1980) and deflection of particle velocities due to variations in magnetic flux density (Leach & Petrosian 1981;Chandrashekar & Emslie 1986).Instead of calculating mean rates of change, Leach & Petrosian (1981) numerically solved the Fokker-Planck equation governing the evolution of a distribution of non-thermal particles.By doing this, they could account for pitch angle diffusion (the randomisation of directions resulting from the stochastic nature of collisions) in their beam transport simulations.Further improvements to their model include the incorporation of relativistic effects and energy losses caused by the emission of synchrotron radiation (Petrosian 1985;McTiernan & Petrosian 1990).While early treatments of collisions typically ignored the thermal motion of the ambient plasma, corrected expressions accounting for the ambient temperature were later employed for the mean rate of change in velocity and the rates of energy and pitch angle diffusion (Emslie 2003;Galloway et al. 2005;Jeffrey et al. 2014).
While the models for propagation of non-thermal particle beams have become highly developed, they have mainly been applied to individual beams in isolated one-dimensional (1D) atmospheres, typically combined with hydrodynamics and radiative transfer for the purpose of simulating flares (Hawley & Fisher 1994;Abbett & Hawley 1999;Allred et al. 2005Allred et al. , 2015Allred et al. , 2020;;Liu et al. 2009;Jeffrey et al. 2019) or nanoflares (Testa et al. 2014;Polito et al. 2018;Bakke et al. 2022).In recent times, three-dimensional (3D) atmospheric simulation codes have been developed that reproduce many of the observed features of both the solar corona and lower atmosphere in a small patch of the Sun outside of active regions, by solving the equations of magnetohydrodynamics (MHD) combined with radiative transfer and thermal conduction (Gudiksen et al. 2011;Rempel 2017).However, these simulation codes did not originally account for accelerated particles.
In Frogner et al. (2020, hereafter Paper I), we presented a first approach for integrating the modelling of accelerated electrons into a 3D atmospheric simulation.To let the simulated atmosphere drive the spatial distribution and energetics of the non-thermal electron beams, we detected magnetic reconnection sites and applied a simple parametric model for particle acceleration based on local conditions.We then modelled the collective energy transport by millions of beams by tracing beam trajectories from the reconnection sites and computing the energy deposited into the ambient plasma through collisions between non-thermal electrons and ambient particles.To compute the deposited energy, we employed the relatively basic analytical transport model of Emslie (1978), with the extension by Hawley & Fisher (1994) to support a non-uniform ionisation fraction.
Here we present a more realistic model for the propagation of non-thermal electron beams that is still computationally efficient enough to be applied to millions of beams.The model is based on solving the continuity equation for electron flux by transforming it into a set of ordinary differential equations using the method of characteristics.This method has been applied by Craig et al. (1985), Dobranskis & Zharkova (2014, 2015), and Zharkova & Dobranskis (2016) to find analytical solutions to the continuity equation (although see the correction to Dobranskis & Zharkova 2014 by Emslie et al. 2014).We solve the characteristic equations numerically.By deriving the continuity equation from the Fokker-Planck equation, we show how to incorporate most physical effects accounted for in stateof-the-art models, including magnetic gradient forces, the return current, corrected collisional rates due to the ambient temperature, and contributions to collisions by elements heavier than hydrogen.We additionally consider acceleration along the magnetic field by the ambient electric field, which, to our knowledge, has never been accounted for in models applied to 1D atmospheres.The most notable effects we leave out are collisional randomisation and relativistic effects.We investigate the impact of each new effect on the energy transported by the diverse beams in a 3D atmosphere identical to that used in Paper I.

Atmospheric simulation
We used a snapshot from a 3D simulation of the solar atmosphere to provide a realistic environment for non-thermal par-ticle acceleration and transport.The simulation was performed using the Bifrost code (Gudiksen et al. 2011), which solves the non-ideal equations of MHD, accounting for energy transport through field-aligned thermal conduction and radiative transfer (Hayek et al. 2010;Carlsson & Leenaarts 2012).The region of the atmosphere simulated begins at the top of the convection zone, 2.5 Mm below the photosphere, and ends in the corona, 14.3 Mm above the photosphere.It extends 24 Mm in each horizontal direction and uses horizontally periodic boundary conditions.The spatial resolution is 31 km horizontally and between 12 and 80 km vertically, with the finest vertical resolution near the transition region and the coarsest in the upper corona.
The simulation reproduces the basic structure of the quiet solar atmosphere, with a chromosphere and coronal loops heated by magnetic reconnection and acoustic shocks resulting from convective motions below the photosphere.In the snapshot employed for this paper, the atmospheric structure has been further shaped by a magnetic flux emergence event where, 137 min of solar time earlier, a 2000 G horizontal magnetic field was injected through the bottom boundary.As it rose to the photosphere, the injected magnetic sheet was broken up by convective motions, enhancing the magnetic field in the network regions between convection cells.The current snapshot, which is the same as that used in Paper I, is characterised by a central bubble of cool plasma (carried upwards by the emerging magnetic field), with increased magnetic reconnection at the upper boundaries of the bubble where the emerging and pre-existing coronal fields meet at a large angle.Further details on this particular simulation can be found in Hansteen et al. (2019).However, we note that the reconnection events in this simulation at the most release energies of order 10 25 erg, while most events are much less energetic (see Paper I).Thus, we are operating in the energy regime of nanoflares (Parker 1988).

Accelerated particles
Magnetic reconnection, the diffusion of magnetic tension occurring at the interface of domains with oppositely directed magnetic field, tends to produce environments favourable for the acceleration of ambient charged particles to speeds far exceeding their initial thermal speeds.The strong rotation of the magnetic field induces an electric field in the diffusion region, which, in addition to driving currents in the plasma, may directly accelerate electrons and ions to non-thermal speeds (Speiser 1965;Litvinenko & Somov 1993).Trapping of charged particles in shrinking magnetic islands (Drake et al. 2006) and scattering within magnetic turbulence (Dmitruk et al. 2003) may respectively lead to first-and second-order Fermi acceleration (Fermi 1954(Fermi , 1949)).Modelling typically indicates that the resulting energy spectra of accelerated particles are shaped as a power-law.
The particles, confined by the Lorentz force to gyrating trajectories around magnetic field lines, may leave the reconnection sites in coherent beams.In this work, we restrict our attention to accelerated electrons, as these are more readily accelerated to non-thermal speeds than ions due to their low mass.Consequently, they are more likely to transport their energy a significant distance.We can represent a beam of non-thermal electrons in terms of its phase-space distribution function f (r, u, t), defined such that f (r, u, t) d 3 r d 3 v is the number of beam electrons within the volume d 3 r around the position r with velocities within d 3 v of the velocity u at time t.The CGS unit of f is electrons cm −3 /(cm s −1 ) 3 .We assume that the beam reaches a steady state before the ambient plasma can respond to its presence, so A195, page 2 of 20 we omit the explicit time dependence.By assuming that the distribution is independent of the azimuthal angle and radial distance of the electrons in their gyrating trajectory around the magnetic field line, we can reduce the phase-space coordinates (r, u) down to the three independent coordinates (s, E, µ).Here s is the distance of the electron from its starting position along the field line.E = m e v 2 /2 is the kinetic energy, where m e is the electron mass and v = u is the total speed.µ = cos(β) is the cosine of the pitch angle β between the velocity and the magnetic field, such that ds/dt = µv.With this choice of coordinates, the volume element is d 3 r = ds dA, where A is the cross-sectional area of the beam, and the velocity volume element is d 3 v = (v/m e ) dφ v dµ dE, where φ v is the azimuthal angle of u.When using E and µ as the independent velocity coordinates, it is convenient to use the field-aligned electron flux spectrum, defined by to represent the beam rather than the phase-space distribution.
The quantity in Eq. ( 1) is the rate of electrons with energies within dE of E and pitch angle cosines within dµ of µ flowing through a unit cross-sectional area in the positive magnetic field direction.The CGS unit of F is electrons s −1 cm −2 erg −1 .

Injected distributions
To specify the field-aligned flux spectrum F 0 (E 0 , µ 0 ) ≡ F(s = 0, E, µ) of non-thermal electrons injected into each beam in the simulated atmosphere, we apply the same simple parametric acceleration model as in Paper I. We classify a grid cell in the simulation box as a reconnection site if the quantity exceeds a small threshold.Here E and B are the local macroscopic electric and magnetic fields, respectively.In MHD theory, K = 0 is a criterion for the magnetic topology to be conserved (Biskamp 2005), so we detect reconnection by finding where this criterion is sufficiently violated, with K exceeding some small threshold (of the order of 10 −15 G statV cm −2 ).We discuss how we chose the threshold value in Paper I.
At each reconnection site, we assume that some unspecified time-independent acceleration mechanism maintains a nonthermal power-law tail on top of the local thermal electron distribution.We express this non-thermal component in terms of an injected electron flux spectrum in the form where F beam,0 is the field-aligned energy flux injected into the beam, E c is the lower cut-off energy below which the distribution is empty, and δ is the power-law index describing how strongly the distribution diminishes with increasing energy.We assume that every injected non-thermal electron has the same initial pitch angle cosine µ 0 = μ0 .This is expressed through the Dirac delta function δ(µ 0 − μ0 ).
To determine the injected energy flux F beam,0 , we assume that 20% of the power released from the magnetic field during reconnection goes into electron acceleration (we discuss the choice of this percentage in Paper I).We partition this power between two beams pointed in opposite directions along the magnetic field based on the local alignment of the electric field with the magnetic field.The opposite directions are encoded into the sign that each of the two beams receives for μ0 (and F beam,0 ).The power assigned to each beam is then converted to an energy flux F beam,0 using the cross-sectional area A of the beam, which is computed based on the extent of the grid cell at the reconnection site.We calculate the lower cut-off energy E c as the energy where the resulting non-thermal power-law distribution would intersect the local thermal distribution.The resulting value of E c is approximately proportional to the local temperature T , with E c between 1 and 3 keV at T = 1 MK.For the power-law index δ, we assume the same fixed value for every beam.Finally, we estimate the magnitude of the initial pitch angle cosine, | μ0 |, by assuming that the acceleration process does not alter the initial perpendicular velocity component due to randomised thermal motion.In practice, this results in | μ0 | taking a value slightly below unity for most beams.

Transport equations
The evolution of the steady-state field-aligned electron flux spectrum F(s, E, µ) with distance s is governed by the Fokker-Planck equation: (see Appendix A for the derivation of this equation from the more general Fokker-Planck equation expressed in terms of f (r, u)).In Eq. ( 4), (dE/ds) !C and (dµ/ds) !C are the rates of change in E and µ with distance s due to non-collisional forces.
The main such force is the Lorentz force F L on an electron due to the macroscopic electric and magnetic field.In CGS units, it is given as where e is the elementary charge and c is the speed of light.The electric field E can accelerate electrons in any direction.We only consider the influence of the component E of the electric field parallel with the magnetic field direction where B = B .We ignore the transverse component of the electric field.A non-zero transverse component causes the electron orbit to drift with velocity u d = cE × B/B 2 , either breaking azimuthal symmetry or (if the electric field is azimuthally symmetric) gradually changing the gyroradius.In either case, the drift speed is tiny compared to the parallel speed of the nonthermal electrons.The highest drift speeds in our atmospheric simulation are of order 10 3 cm s −1 , far below even the average thermal speed.
We consider two potential contributions to the electric field E. The first is the MHD electric field E fluid , which may have a parallel component E fluid when the resistivity is significant (as during magnetic reconnection).The second contribution is the electric field produced in response to the charge displacement that occurs when the accelerated electrons leave the acceleration site.This electric field, which we denote E beam , produces a counter-flowing return current in the background A195, page 3 of 20 plasma that cancels out the current associated with the beam (Knight & Sturrock 1977;Emslie 1980).It is always aligned with the magnetic field, so E beam = E beam B/B.As discussed in Emslie (1980), we can compute E beam from the beam electron flux.The field-aligned current density associated with the beam at distance s is where F beam (s) is the total field-aligned flux of the beam electrons at distance s (given by Eq. ( 43)).We note that F beam is positive if the beam travels along the positive magnetic field direction.Assuming that the return current J r exactly neutralises the beam current, we have J r (s) = −J beam (s).From Ohm's law, the electric field is thus where η is the electrical resistivity of the ambient plasma parallel to the magnetic field.We compute η accounting for electron collisions with protons and neutral hydrogen (see, for example, Chae & Litvinenko 2021).
The work the total parallel electric field E = E fluid + E beam does on a beam electron moving with velocity ds/dt = µv along the magnetic field line is where the subfix E stands for electric.The acceleration along the magnetic field line is The magnetic component of the Lorentz force does no work on the electron since u × B is always perpendicular to the velocity u, so we have where the subfix M stands for magnetic.The only direct effect of the magnetic force is to produce the angular velocity dφ v /dt = eB/(m e c) responsible for the gyrating motion.If the magnetic field is uniform, it does not affect the parallel velocity of the electron.However, if there is a weak gradient in the magnetic field, analysis of the linearised equation of motion shows that the electron experiences a net parallel acceleration.This acceleration, due to the magnetic force averaged over one gyration period, is given by (e.g.Bittencourt 2004) where M is the gyromagnetic moment of the electron.This assumes that the electron experiences no other forces than the magnetic force, which is not strictly true in our model, considering that the electron can be affected by a parallel electric field and collisions.However, any parallel electric field is weak compared to the magnetic field, and a comparison of the gyrofrequency and collisional frequency for typical atmospheric conditions shows that the electrons gyrate many times for every collision.Equation (12) thus remains a reasonable approximation even in the presence of other forces.
In addition to the Lorentz force, we could also include the reaction force due to the emission of gyromagnetic radiation.This reaction force is given by the Abraham-Lorentz formula (e.g.Barut 1980).However, as discussed by Petrosian (1985), who derived expressions for the corresponding rates of change in energy and pitch angle, the influence of the reaction force is significant only for highly relativistic electrons.Hence, there is nothing to gain by accounting for gyromagnetic radiation until the transport model is extended to include relativistic effects.We note that in the simulations performed for this paper, the most relativistic beams have δ = 4 and E c ≈ 5 keV.Relativistic electrons with a Lorentz factor exceeding 1.1 account for only 1% of the energy flux injected into these beams, so disregarding relativistic effects is justified.
Adding Eqs. ( 9) and ( 11), the full rate of change in energy due to non-collisional forces becomes while from Eqs. ( 10) and ( 12) the total parallel acceleration becomes Finally, using ds/dt = µv, expanding the derivative in Eq. ( 14), applying Eq. ( 13), we find Returning to the Fokker-Planck equation, the terms involving the coefficients C E , C µ , C E 2 , and C µ 2 in Eq. ( 4) express the evolution of the flux spectrum due to Coulomb collisions between the beam electrons and ambient plasma particles.The coefficients C E and C µ govern the advection of the flux spectrum in energy and pitch angle space, while C E 2 and C µ 2 govern the diffusion.General expressions for all the coefficients are derived in Appendix A. The results for C E and C µ are Each expression has a sum of contributions from collisions with ambient particles of different species.The subscript c denotes a particular species of charged particles, while N denotes a particular species of neutral particles.For each charged particle species c, m c is the particle mass, z c is the charge number, n c is the number density, and ln Λ c is the Coulomb logarithm, for which we follow Emslie (1978) and use the expression where η = v/ν is the electron mean free path and ν is the plasma frequency.The quantity k B is the Boltzmann constant, and T c is the temperature of the species c particles.The functions erf(u) and erf (u) are, respectively, the error function and its derivative, while For each neutral particle species N, Z N is the atomic number, and n N is the number density.The effective Coulomb logarithms ln Λ N and ln Λ N are associated respectively with friction and velocity diffusion due to collisions with the neutral particles.They are given by (Evans 1955;Snyder & Scott 1949) ln where I N is the ionisation potential of a species N particle, c is the speed of light, and α is the fine structure constant.We note that while the Coulomb logarithms ln Λ c , ln Λ N , and ln Λ N technically vary with beam electron speed v, this dependence is relatively slight, so we ignore it and use a representative value corresponding to the mean speed of the initial distribution.Furthermore, the variations due to the specifics of the particular particle species (m c , z c , I N , and Z N ) are even more minor than the variations due to the electron speed.We, therefore, use the electron's value of ln Λ c for all charged particle species and the hydrogen atom's value of ln Λ N and ln Λ N for all neutral particle species and omit the subscripts.
In this work, we account for collisions with free electrons (c = e), free protons (c = p), singly and doubly ionised helium atoms (c = HeI and c = HeII), neutral hydrogen atoms (N = NH), and neutral helium atoms (N = NHe).Because the ambient hydrogen and helium atoms have minimal velocities compared to beam electrons, we have u c 1 for all c except c = e.We can thus use the asymptotic values erf(u) → 1, erf (u) → 0 and G(u) → 0 for u → ∞ for collisions with all charged atoms.Since only u e remains relevant, we use the symbol u as a shorthand for u e .We can neglect the terms in Eq. ( 17) that include the factor m e /m c for collisions with the charged atoms since the hydrogen mass m H and helium mass m He greatly exceed the electron mass.The number densities of the charged atoms can be expressed as n p = x H n H , n HeI = x HeI n He , and n HeII = x HeII n He , where x H , x HeI , and x HeII are ionisation fractions, and n H and n He are the total number densities of respectively hydrogen and helium (including both charged and neutral atoms).For the neutral atoms, we can then write the number densities as n NH = (1 − x H )n H and n NHe = (1 − x HeI − x HeII )n He .To express all number densities in terms of the hydrogen density n H , we further define the electronto-hydrogen ratio r e and helium-to-hydrogen ratio r He such that the electron density becomes n e = r e n H and the helium density becomes n He = r He n H . Equations ( 17) and ( 18) then become where and can be considered effective Coulomb logarithms.The functions encapsulate the dependence of the collision coefficients on the ambient temperature.Equation ( 4) is a linear second-order partial differential equation.It can be solved numerically in many ways, including finite difference methods (e.g.Allred et al. 2020) and stochastic methods (e.g.Jeffrey et al. 2020).Unfortunately, these methods are too computationally expensive for simulating huge numbers of beams.To simplify the problem, we ignore the collisional diffusion of the distribution in velocity space by setting the diffusion coefficients C E 2 and C µ 2 to zero (we consider the consequences of this approximation in our discussion in Sect.4).Equation ( 4) can then be written as where Equation ( 29) is the continuity equation for the flux spectrum in phase space.The right-hand side, given by Eq. ( 30), is the source term, which describes the addition or removal of electron flux due to the macroscopic electric field.Without a parallel electric field, the source term evaluates to zero, meaning that the flux spectrum is conserved as it evolves in phase space.
To solve the continuity equation, we follow Craig et al. (1985) and transform it into a set of ordinary differential equations using the method of characteristics.The characteristics are curves in the (s, E, µ) coordinate space that the flux spectrum F follows, given a set of initial conditions.It is convenient to parametrise the curves by the distance s.Each curve then describes the evolution of energy E(s, E 0 , µ 0 ), pitch angle cosine µ(s, E 0 , µ 0 ), and flux F(s, E 0 , µ 0 ) with distance s for a group of beam electrons given their initial values E 0 , µ 0 , and F 0 at s = 0.The set of ordinary differential equations governing these characteristic curves for Eq. ( 29) are given by Inserting Eqs. ( 15), ( 16), ( 23), and (24), this becomes A195, page 5 of 20 Frogner, L. and Gudiksen, B. V.: A&A, 683, A195 (2024) where and The warm-target contribution functions W E , W µ , and W F are plotted in Fig. 1.In the cold-target limit, when the beam electron speeds are very high compared to the thermal electron speeds (u 1), they all approach unity.When u decreases below ∼4 (this corresponds to a beam electron energy of 2 to 3 keV for typical coronal temperatures in our simulation) the functions deviate from unity.As the energy approaches k B T , W E and W µ decrease, suppressing the collisional rate of energy loss and pitch angle increase.At E ≈ k B T , the beam electrons experience no average loss in energy from collisions with ambient electrons, and for lower energies, they start to gain energy.As evident from the minimum in W F at E ≈ k B T (giving a maximally positive contribution to dF/ds), the influence of the thermal distribution on collisions causes more beam electrons to find themselves with energies close to the mean thermal energy.

Computing macroscopic quantities
The ultimate objective of determining the electron flux spectrum F(s, E, µ) is to compute macroscopic quantities associated with the non-thermal electron beam.We can evaluate a macroscopic quantity at a specific distance s by appropriately weighting F(s, E, µ) and integrating it over E and µ.In general, we can compute the sum Σ(χ) of any individual electron property χ(s, E, µ) over all the non-thermal electrons at the distance s by evaluating the following integral: From Eq. ( 1), we see that this is equivalent to weighting the phase-space distribution function f by χ and integrating over velocity space.Performing a change of variables from µ to µ 0 , we can write the integral as By using (E, µ 0 ) as primary independent variables instead of (E, µ) and performing the integral over E and µ 0 , we can take advantage of our assumption that every electron in the distribution starts with the same pitch angle cosine µ 0 = μ0 .The Dirac delta function δ(µ 0 − μ0 ) in Eq. ( 3) is present in the flux spectrum at all distances s.Factoring it out, we can write Inserting this into Eq.( 40) and performing the integral over µ 0 , we get The direction-integrated flux spectrum F(s, E, μ0 ) corresponds to the flux spectrum F(s, E, µ 0 ) integrated over µ 0 .We have thus reduced the problem of solving for F, which is two-dimensional in velocity space, to solving for F, which is one-dimensional in velocity space, with the additional complication of having to determine the Jacobian determinant |∂µ(s, E, μ0 )/∂ μ0 |.
In terms of the generic integral in Eq. ( 42), the total fieldaligned electron flux at the distance s can be written while the field-aligned energy flux becomes The non-thermal electron number density n beam (s) at the distance s is simply The corresponding integrand in Eq. ( 42) is This quantity, the number density of non-thermal electrons per energy interval, provides an informative way of visualising the distribution.
The total power density Q beam (s) deposited by the nonthermal electrons at the distance s is found by integrating up the collisional rate of energy loss for the individual electrons: The collisional rate of change in energy is found by taking the collisional part of Eq. ( 34) and multiplying with ds/dt = µv: We find the total heating power per volume Q(s) resulting from the beam by adding the contribution Q r (s) from the resistive heating due to the return current J r , where A195, page 6 of 20

Numerical solution
For each non-thermal electron beam, we obtain its trajectory by tracing the magnetic field line from the reconnection site in the appropriate direction (as determined by the sign of μ0 ) in the same manner as in Paper I. In Frogner & Gudiksen (2022), we covered the procedure for accurately tracing the magnetic field lines in detail.In tandem with tracing the trajectory, we integrate Eqs. ( 34)-( 36) simultaneously to obtain the evolution of energy E(s, E 0 , μ0 ), pitch angle cosine µ(s, E 0 , μ0 ) and flux F(s, E 0 , μ0 ) with distance s.We start with a set of initial energies E (i) 0 and pitch angle cosines µ (i)  0 for i = 0 . . .(N − 1) at s = 0.The energies are evenly distributed in log space with a spacing ∆ log 10 E, and the pitch angle cosines all have the same value μ0 .We then evaluate F0 (E 0 , μ0 ) (Eq. ( 3) without the Dirac delta function) to obtain a corresponding set of injected flux values, F(i) 0 = F0 (E (i) 0 , μ0 ).Using Eqs. ( 34)-( 36), we advance E (i) 0 , µ (i) 0 , and F(i) 0 a small distance ∆s (with the same sign as μ0 ) using a third-order Runge-Kutta method, to obtain their values Ẽ1 (i) , μ1 (i) , and F1 (i) at s 1 = ∆s.After the step, some of the lowest energies may have reached zero, meaning that the corresponding particles have been thermalised.If we kept advancing the remaining particles in the same manner, we would soon be left with too few nonzero energies to represent the distribution properly.Moreover, because the derivatives are larger in magnitude for smaller E and µ, the spacing between the lower energies would increase rapidly and amplify the undersampling problem.
To avoid this, we apply a re-meshing procedure after each step.We calculate a new set of energies , where m is an integer that may be positive or negative.The new energies are equal to the previous energies E (i) 0 except shifted up or down in log space by a whole number m of the interval ∆ log 10 E. We set m so that the first re-meshed energy E (0) 1 is as small as possible while still exceeding the smallest non-zero advanced energy Ẽ1 (i) .In this way, we ensure good sampling coverage even if the distribution shifts significantly in energy.We then calculate the piecewise linear functions μ(E) and F(E) that yield μ( Ẽ1 (i) ) = μ1 (i) and F( Ẽ1 (i) ) = F1 (i) for all non-zero Ẽ1 (i) .For all re-meshed energies E (i) 1 not exceeding the highest advanced energy Ẽ1 (n−1) , we use these interpolating functions to calculate µ (i) 1 = μ(E (i) 1 ) and F(i) 1 = F(E (i) 1 ).For the re-meshed energies exceeding Ẽ1 (N−1) , we have no samples of the flux spectrum and thus can no longer rely on interpolation.Instead, by selecting a sufficiently high upper limit for the initial energies, we can ensure that the highest advanced energy Ẽ1 (N−1) is large enough that the following high-energy limit versions of Eqs. ( 34)-( 36) are valid: In the high-energy limit, the influence of collisions is negligible.
Only the field-aligned electric field affects the energy of a particle, and only the magnetic gradient force affects the pitch angle and flux.From Eq. ( 51), the initial energy of a high-energy elec-tron with energy E at the distance s is given by Integrating Eq. ( 52), the pitch angle cosine at the distance s for a high-energy electron with initial pitch angle cosine µ 0 becomes Combining Eqs. ( 52) and ( 53) and integrating, we obtain the expression for the flux of a high-energy electron at the distance s given an initial flux F 0 : For all E (i) 1 above the highest advanced energy Ẽ1 (N−1) , we can obtain the value of µ (i) 1 from Eq. ( 55).To calculate F(i) 1 , we evaluate Eq. ( 54) to find the initial energy of the electron, sample the initial flux spectrum F0 at this energy and insert the resulting initial flux into Eq.( 56): When the re-meshing is complete, we advance E (i) 1 , µ (i) 1 , and F(i) 1 to obtain Ẽ2 (i) , μ2 (i) , and F2 (i) at s 2 = 2∆s, re-mesh these to 2 , and F(i) 2 , and repeat the procedure.We update the values of the integrals in Eqs. ( 54) and ( 55) continually during propagation.With the sets of values E (i)  k and F(i) k , we then have a discrete version of the flux spectrum F(s, E, μ0 ) at s k = k∆s.
In addition to the flux spectrum F(s, E, μ0 ), we need to determine the Jacobian determinant |∂µ(s, E, μ0 )/∂ μ0 |.It can be calculated analytically for simplified versions of Eqs. ( 34) and (35) (ignoring ionisation fraction variations, magnetic gradient forces, electric fields and the ambient temperature) by solving for E(s, E 0 , µ 0 ) and µ(s, E 0 , µ 0 ), combining these to obtain µ(s, E, µ 0 ) and computing its partial derivative with respect to µ 0 .Unfortunately, this is not possible for the more general case.Instead, we compute the Jacobian numerically by evolving a second set of electrons with the same initial energies but with the initial pitch angle cosine μ0 = (1 − ε) μ0 reduced by a small fraction ε 1 .So at any given depth s k , we have the pitch angle cosines µ (i)  k for the "perturbed" electrons with µ (i) 0 = μ0 in addition to the original solution values E (i)  k , µ (i) k , and E (i) 0,k for µ (i) 0 = μ0 .We note that we advance the perturbed electrons in tandem with those in the original distribution and use the same value for m when re-meshing them.Consequently, after re-meshing, the perturbed electrons always have the same energies E (i)  k as the original electrons.We then compute the Jacobian determinant as follows: At each distance s k , we use the evolved electron properties , and E (i) 0,k and flux spectrum F(i) k along with the Jacobian determinant |∂µ/∂ μ0 | (i)  k to numerically evaluate Eq. ( 43) for the total field-aligned electron flux F beam (s k ) and Eq. ( 49) for the heating power density Q(s k ).We use F beam (s k ) to calculate the return current resistive heating Q r (s k ) (Eq. ( 50)) and to estimate the return current electric field E beam (s k+1 ) (Eq. ( 8)) for the following distance s k+1 .We also use the total flux to decide when the beam has lost enough energy that we can terminate propagation.

Results
The transport model presented in this paper, hereafter referred to as the continuity equation characteristics (CEC) model, can account for a variety of additional physical effects that are ignored in the analytical transport model employed in Paper I (originally from Emslie 1978;Hawley & Fisher 1994).While significantly more computationally intensive than the analytical model, the CEC model remains sufficiently lightweight to be applied on the scale of millions of beams.We can thus compare it directly with the analytical model in the same atmospheric simulation.Our main objective with the results presented in this paper is to highlight the changes in the spatial distribution of beam energy deposition Q resulting from accounting for the additional physical effects.
To verify the CEC model, we ran it under the same assumptions as the analytical model2 and compared the resulting energy deposition.To match the CEC model with the analytical model, we neglected collisions with helium by setting the helium-tohydrogen ratio r He to zero, we ignored the ambient temperature by setting W E , W µ , and W F to unity, we omitted electric fields and magnetic gradient forces by setting E and d ln B/ds to zero, and we left out ambient electrons from other elements than hydrogen by setting the electron-to-hydrogen ratio r e equal to the hydrogen ionisation fraction x H .The results showed good agreement between the analytical and CEC models, indicating that the latter is sound.
In each of the following sections, we present the results from running the CEC model with one of the additional physical effects included and the others ignored.All runs use N = 300 energies to represent the electron flux spectrum F and a powerlaw index of δ = 4 for the injected flux spectrum.To avoid potential confusion, we do not distinguish whether beams travel along the positive or negative magnetic field direction in the results.Hence, µ and s can always be considered positive.

With magnetic gradient forces
The run that included magnetic gradient forces, where the d ln B/ds factor in Eq. ( 35) was allowed to be non-zero, revealed some significant changes to the energy deposition in the atmospheric simulation compared to the results from the analytical model.Figure 2 shows the net beam heating power accumulated over the y-axis of the simulation box for the run with magnetic gradient forces.This figure is analogous to Fig. 10 in Paper I, which shows the corresponding result produced with the analytical model.In both cases, regions of particle acceleration, indi- cated by negative power (blue colour) due to the absorption of reconnection energy by new beams, appear along the interfaces of misaligned coronal loops and near loop footpoints directly above the transition region (TR).No difference in the distribution of acceleration regions is to be expected between the models, as the treatment of particle acceleration is identical.The distribution of deposited energy (orange colour) is broadly similar for both models, with the most intense beam heating occurring close to the boundaries of the acceleration regions and in the TR.However, for the model with magnetic gradient forces, the energy deposition in the corona is somewhat higher.At the same time, the beams do not penetrate as deep into the chromosphere, stopping abruptly around 500 km above the photosphere.
To enable a closer analysis of the differences made by magnetic gradient forces, we extracted three separate sets of beams demonstrating different energy transport scenarios.Figure 3 displays the three sets of beams.The figure is akin to Fig. 2, but contains only the net beam heating power due to the selected sets of beams.In set 1, the electrons are accelerated at the top of a coronal loop and follow one of the loop legs down into the TR.In set 2, acceleration occurs at various locations in the corona, but the resulting bundles of beams converge at the same location in the TR.In set 3, the acceleration region is a strong current sheet situated just above the TR, and the non-thermal electrons are ejected downwards in a coherent bundle.These sets correspond to those selected for the results in Paper I. In the following, we analyse the energy deposition for representative beams in the three sets.

Coronal loop (set 1)
Due to the high coherency of the beams in set 1, they all have a very similar heating profile, so it suffices to look at one of them.A comparison of Q(s) between the runs with and without A195, page 8 of 20 magnetic gradient forces for one of the beams is shown in Fig. 4. In the basic model, Q has a peak in the corona around s = 6.5 Mm and another, much stronger peak at s = 20.15Mm in the TR.The location of the TR and chromosphere can be inferred from the mass density profile in the figure.When magnetic gradient forces are included, a second coronal peak appears around s = 15.5 Mm, followed by a steep drop in Q and then a peak in the TR and chromosphere that is smaller but approximately 100 km deeper than the peak in the basic model.
It is informative to consider the microscopic physical mechanisms leading to these features in the heating profile.To aid the discussion, Fig. 5 displays the non-thermal electron number distribution dn/dE as a function of energy E for the two models at some selected distances.The injected distribution has the most electrons at the lower cut-off energy E c ≈ 5 keV, about 100 times more than at 15 keV (see panel a in Fig. 5, where the distributions are very close to the injected ones).As the electrons begin to propagate, the least energetic electrons lose energy and parallel velocity rapidly, their rate of loss with distance increasing as their energy decreases (due to the 1/E factor in Eq. ( 34) and 1/E 2 factor in Eq. ( 35)) in a runaway deceleration.This produces a steady rise in Q with distance, peaking at the point where the abundant least energetic electrons have lost all their excess energy and joined the thermal distribution (panel b in Fig. 5).
The initially more energetic electrons experience a slower rate of energy and parallel velocity loss at first (contributing a small part to Q) but eventually slow down enough to go through the same rapid deceleration that leads to thermalisation.Because there are fewer of these more energetic electrons (the peak number densities decrease from panel b to c in Fig. 5), the total power deposited as they become thermal is smaller than that deposited when the least energetic electrons were thermalised, so Q now decreases with distance.
When the electrons enter a region of denser plasma, as in panel d in Fig. 5, the collision rate increases, leading to more rapid energy loss and hence an instant proportional increase in Q (due to the n H factor in Eq. ( 48)).The increased collision rate is evident when comparing the rate of energy loss (dE/dt) coll in panel d to the other panels.But with the higher rate of collisions, thermalisation depletes the distribution from the lowest-energy end more rapidly, causing a steeper decrease in Q with distance.This is the reason for the falloff of Q following the TR peak for the basic model in Fig. 4. Entering a region of lower plasma density would have the opposite effect, with less energy deposition and slower depletion of the distribution.
When the electrons experience a rising magnetic flux density as they propagate, the magnetic gradient force deflects the electron velocities, transforming some parallel velocity into transverse velocity and hence reducing their pitch angle cosine µ (a positive d ln B/ds gives a proportionally negative contribution to dµ/ds in Eq. ( 35)).A reduction in µ means less of the electron's velocity is directed forwards, so it must endure more collisions to advance along the field line.This leads to an increased rate of energy loss with distance (hence the 1/µ factor in Eq. ( 34)).
Less energetic electrons tend to be more susceptible to magnetic deflection because their velocities typically are partially deflected already due to their more frequent collisions.As Eq. ( 35) shows, the magnetic contribution to dµ/ds increases with decreasing µ.Still, because the deflection rate is not directly dependent on electron energy, arbitrarily energetic electrons in the distribution can be affected if their velocities are not entirely parallel to the magnetic field.And once magnetic deflection begins, it proceeds equally rapidly regardless of energy.As a result, the magnetic gradient force causes even the more energetic electrons in the distribution to lose energy faster with distance, making them join the less energetic part of the distribution sooner.This positive contribution to the less energetic part A195, page 9 of 20  4, both for a simulation that ignores (solid green curve) and includes (dashed purple curve) magnetic gradient forces.Also included is the collisional rate of energy loss for a single electron, −(dE/dt) coll , from Eq. (48) (solid grey curve).Summing a distribution curve and energy loss rate curve would yield a log-space curve of the integrand for the deposited power density Q beam (Eq.( 47)).
of the distribution (evident from comparing the two models in panel c in Fig. 5), where most of the energy transfer to the ambient plasma takes place, leads to an increase in Q.This is the reason for the second coronal peak in Q for the model with magnetic gradient forces in Fig. 4.
The increase in Q is only temporary, as it is counteracted by the loss of electrons whose velocities become entirely transverse, µ = 0, and thus are left behind.This initially only happens for electrons whose energies are nearly lost already (as in panel c in Fig. 5, where the distribution affected by magnetic gradient forces vanishes below E ≈ 1 keV), but subsequently for electrons with more and more energy remaining (the distribution vanishes at increasingly large energies between panels c and d).The eventual result of the loss of increasingly energetic electrons is a steep drop in Q with distance, as seen after the second coronal peak for the model with magnetic gradient forces in Fig. 4.
After leaving behind the forward-propagating beam, the lost electrons keep accelerating in the opposite direction due to the magnetic gradient force and begin travelling back along the field line in the direction they came from.This phenomenon, known as magnetic mirroring, is not accounted for in the CEC model because the transport equations (Eqs.( 34)-( 36)), being parametrised by distance s, become singular for µ(s) = 0.In the model, the energy contained in reflected electrons is lost.For the beam we are considering, the fraction of the injected flux lost to reflected electrons is only a few percent.
An implication of the gradual reflection of increasingly energetic electrons caused by magnetic gradient forces can be seen when the distribution enters a region dense enough to absorb its remaining energy.Because the electrons remaining are relatively energetic (evident from the very high average energy in the distribution affected by magnetic gradient forces compared to the unaffected one in panel d in Fig. 5), they penetrate deeper into the region before becoming thermal.Consequently, the peak of deposited power occurs deeper than it would if the less energetic electrons filtered out by magnetic gradient forces remained in the distribution.This explains the deeper peak location in Q for the model with magnetic gradient forces in the right panel of Fig. 4.

Converging bundles (set 2)
Most of the beams in set 2 (including the majority of beams accelerated near the height of 5 Mm to the far right in Fig. 3) follow a field line downwards in a converging magnetic field and thus have a heating profile qualitatively similar to that in Fig. 4. Some beams, however, experience a diverging magnetic field (that is, a reduction in the magnetic flux density) in the first part of their trajectory.This applies to the beams accelerated between the heights of 10.5 and 12.5 Mm in Fig. 3, as the coronal loop leg they travel along expands with depth for the first 10 Mm, before contracting again along the last stretch to the lower atmosphere.Figure 6 shows the heating profile for one of the beams following such a trajectory.
For this beam, Q remains lower throughout the corona in the model with magnetic gradient forces than in the model without.This is caused by the initial reduction in magnetic flux density with distance.From Eq. ( 35), the negative value of d ln B/ds counteracts the decrease in µ due to collisions.All electrons, including the more energetic ones, thus retain a higher value of µ, causing them to lose energy more slowly with distance.Since the more energetic electrons join the lower-energy part of the distribution at a reduced pace, the population at low energies decreases, reducing the energy deposition rate Q.This is precisely the opposite of what happens in a converging magnetic field.
A195, page 10 of 20 Although Q does exhibit a second coronal peak in the model with magnetic gradient forces due to the eventual convergence of the magnetic field, similarly to the beam in Fig. 4, the energy deposition is nearly always lower than in the basic model.The only exception is at the end of the peak in the TR, as the energetic electrons that reach this depth have been subjected to slightly fewer collisions than in the basic model due to the earlier diverging magnetic field.Despite this, a significant proportion of the injected energy is clearly never deposited for the beam affected by magnetic gradient forces; upon inspection, around 50%.The culprit is heavy magnetic mirroring in the last 7 Mm of the trajectory, where the magnetic convergence is strong.This is clear from Fig. 7, which shows the minimum energy of electrons remaining in the distribution as a function of distance.When the magnetic convergence is negative or slightly positive, the minimum energy is close to zero, meaning that electrons are being thermalised.After s = 16 Mm, when the magnetic convergence increases significantly, the minimum energy increases as the electrons reach µ = 0 and get reflected before they lose their energy to collisions.The energy of reflected electrons increases more and more rapidly with distance.The figure also shows with colour the number density dn/dE of electrons with the minimum energy, indicating the number of electrons reflected at each distance.It peaks shortly after the onset of mirroring when the abundant electrons with energies around 4 keV are reflected.The number of reflected electrons then decreases rapidly with distance as the distribution gets depleted of increasingly energetic electrons.
The main reason this beam is particularly strongly affected by magnetic mirroring is the initial diverging magnetic field.Collisions, being more frequent at lower energies, remove less energetic electrons more efficiently and thus flatten the distribution as it propagates.By increasing µ and thus decreasing the number of collisions per unit of distance, the diverging magnetic field enables the distribution to retain not only more of its total flux but also more of its original steepness.This means that more beam flux is concentrated in the least energetic electrons when magnetic mirroring kicks in, and these are the electrons that get reflected first.The result is that more of the energy injected into the beam is lost to reflected electrons compared to what would have been lost in the absence of a diverging magnetic field.4, but for an electron beam in set 3 in Fig. 3 that is ejected straight down into the transition region.The beam has F beam,0 ≈ 6.4 × 10 5 erg s −1 cm −2 and E c ≈ 1.8 keV.
The other notable group of beams subjected to a diverging magnetic field in set 2 are those accelerated near the height of 2.5 Mm around x = 14 to 17 Mm in Fig. 3 and ejected upwards along magnetic field lines that diverge with height.Some travel the length of the periodic simulation domain along the near horizontal magnetic field at the top of the domain before re-entering a coronal loop in the same downward trajectory as the beam in Fig. 6.They produce tiny Q values in their long journey through the upper corona, particularly for the model accounting for magnetic gradient forces.Otherwise, their heating profiles exhibit the same features as seen in Fig. 6, and they typically lose around 25% of their injected energy to magnetic mirroring.

Current sheet leg (set 3)
The beams in set 3 are very different from those in the other two sets in that they originate in a relatively dense environment and are ejected almost directly into the TR from the acceleration region.Figure 8 shows a typical heating profile from set 3. In both models, the vast majority of energy deposition occurs near the beginning of the trajectory owing to the immediately high density.In the basic model, Q decreases monotonically with distance after the first 50 km.However, in the model with magnetic gradient forces, the decrease in Q is strongly counteracted once the magnetic convergence becomes sufficiently high.The mechanism is the same as that responsible for the second coronal peak in Q for the beams starting higher in the corona: a faster decrease in µ with distance for all electrons, leading to a slight steepening of the distribution and thus more efficient energy deposition.The beam is effectively depleted after about 1 Mm of travel with enhanced energy deposition.In the basic model, the beam continues with a steady decrease in Q.
Some of the beams in set 3 travel upwards along a diverging magnetic field for a short distance before the field line turns sharply downwards, leading the beam down into the TR.The heating profile for such a case is shown in Fig. 9.In the basic model, the evolution of Q with distance is effectively the same as in Fig. 8.In the model with magnetic gradient forces, the initial strong decrease in magnetic flux density prevents much of the early collisional deflection of parallel velocity so that µ remains A195, page 11 of 20  4, but for an electron beam in set 3 in Fig. 3 whose trajectory initially is directed upwards.The beam has F beam,0 ≈ 1.7 × 10 7 erg s −1 cm −2 and E c ≈ 2.7 keV.
higher than in the basic model throughout the distribution.This reduces the subsequent efficiency of energy loss by collisions.The intense magnetic field convergence ensuing as soon as the beam trajectory turns downwards quickly reflects the least energetic electrons, which are relatively abundant as collisions have not significantly depleted them.Hence, the beam loses most of its electrons and about 50% of its total energy to magnetic mirroring over the first hundreds of kilometres following the switch from magnetic field line divergence to convergence.Near s = 400 km, the magnetic convergence starts to diminish.This reduces the rate of magnetic reflection and allows the least energetic electrons to lose more energy to collisions before being reflected.Consequently, the deposited power Q increases.After about 300 km, magnetic convergence intensifies again, and magnetic reflection rapidly depletes the remaining beam electrons.

With non-hydrogen electrons
We performed another run with the basic version of the CEC model configured to use an electron-to-hydrogen ratio r e computed from the actual electron and hydrogen densities in the atmospheric simulation rather than using r e = x H . Since the electron density in the simulation includes electrons contributed from elements other than hydrogen, r e exceeds the hydrogen ionisation fraction x H in the parts of the atmosphere hot enough to ionise the heavier elements.In the hot corona, we have x H = 1 and r e ≈ 1.1.As a result, the beams in this run typically showed a slightly elevated and earlier peak in energy deposition in the corona compared to the beams in the analytical model (where r e = x H ). For example, the coronal peak in Q for the beam in Fig. 4 was elevated by 5% and occurred 1 Mm earlier.

With helium collisions
We performed a run to investigate the impact of including collisions with ambient helium.The only difference between the parameters of this run and the run with the most basic CEC model was that we calculated the helium-to-hydrogen ratio r He ≈ 0.085 from the hydrogen and helium mass fractions rather than setting it to zero.The low value of r He suggests that the influ-ence of helium collisions is minor compared to the influence of collisions with electrons and hydrogen.Our results confirm this, showing only a minor increase in peak coronal energy deposition due to the extra collisions with fully ionised helium and a tiny decrease in chromospheric penetration depth caused by the extra collisions with singly ionised and neutral helium.

With non-zero ambient temperature
To explore the effect of accounting for the non-zero temperature of the ambient plasma, we performed another run with the basic CEC model configured to employ the warm-target transport equations (evaluating W E , W µ , and W F from Eqs. ( 27), ( 28), and ( 38)) instead of the cold-target equations.The most affected beams were those with a high temperature in the coronal part of their trajectory, such as the beam in Fig. 4.They experienced a modest decrease in Q throughout the corona (no more than 10%, typically less).This is caused by the suppressed energy loss rate and slower decrease in µ for beam electrons with energies approaching the mean thermal energy, as explained by the curves in Fig. 1.

With the ambient electric field
To investigate the influence of the parallel component of the ambient electric field, we performed a run with E = E fluid , computed using the electric field E fluid supplied by the MHD simulation.Otherwise, the model was configured in the same way as the most basic version of the CEC model.The results showed that most beams have two sections of notable parallel electric field along their trajectory; at the very beginning and at the end.
The parallel electric field at the beginning is caused by the same reconnection event that produced the beam.Depending on the details of the reconnection event and the direction of the beam, the resulting value of E fluid can be either positive or negative, with a magnitude typically between 10 −9 and 10 −8 statV cm −1 .The distance after which E fluid vanishes corresponds roughly to the extent of the corresponding blue acceleration region in Fig. 2, but naturally depends on how deep within the region the beam originates.For some beams, the parallel electric field near their origin is sufficiently strong to accelerate or decelerate the non-thermal electrons slightly.The result is a minor shift in energy deposition towards smaller (if decelerated) or larger (if accelerated) distances.This shift is typically no longer than 1 Mm.
The parallel electric field often present at the end of a beam trajectory is also associated with reconnection, this time in the TR and chromosphere.Here the resistivity is generally higher than in the corona, so reconnection is more pervasive.However, the resulting electric fields are typically not strong enough to significantly influence the beam evolution, which is heavily dominated by the local high collision rates.

With the return current
We also performed a run including only the effects of the return current on top of the most basic model.We thus used E = E beam , with E beam computed from Eq. ( 8), and included the return current heating term Q r from Eq. ( 50) in the total heating power Q.The results were practically identical to those obtained without the return current.In the corona, E beam is of order 10 −14 statV cm −1 for most beams.As the beams enter the TR, where the resistivity increases enormously from the extremely low coronal values, E beam increases by roughly three orders of A195, page 12 of 20 magnitude.The value decreases rapidly with depth as the beams lose flux to collisions, except for the beams accelerated just above the TR (such as the beams in set 3), which retain their flux for longer.Even for the most affected beams, the return current electric field is too weak to alter the flux spectrum in any way, and the return current resistive heating Q r is lower than the collisional heating Q beam by at least five orders of magnitude.

Discussion and conclusions
Magnetic gradient forces are the most consequential phenomenon ignored in the analytical model of Paper I that can be accounted for in the CEC model.For beams travelling along coronal loops, the converging magnetic field in the lower part of the loop legs deflects the electrons, causing a peak in energy deposition followed by a substantial dip as electrons of increasingly high energy get reflected and leave the beam.When the beam enters the lower atmosphere, the resulting peak in energy deposition occurs slightly deeper since magnetic mirroring has filtered out all but the relatively energetic electrons.After this peak, energy deposition drops immediately to zero as the last electrons are reflected.For beams ejected directly into the TR from the acceleration region, the heating peaks immediately due to the high density and then decreases rapidly, but magnetic convergence can hamper this decrease for a distance until all electrons have been reflected.A diverging magnetic field in the initial part of the trajectory focuses the beam.This makes it less susceptible to collisions, reducing the collisional flattening of the distribution and immediate energy deposition.When the beam enters a converging magnetic field with a steeper distribution, more electrons and energy are lost to magnetic mirroring.
An increase in coronal energy deposition combined with reduced penetration depth in the lower atmosphere, as we see in our heating profiles with magnetic convergence, was reported by Chandrashekar & Emslie (1986;and later Emslie et al. 1992), who modified the analytical expression for Q derived in Emslie (1978) to account for a converging magnetic field with d ln B/ds ∝ n H .In their case, however, the increase in energy deposition was more evenly distributed.It did not include the second coronal peak and associated dip evident in many of our heating profiles.This discrepancy is because d ln B/ds typically increases significantly more steeply with depth than n H in the lower parts of the coronal loops in our atmospheric simulation.Magnetic gradient forces can thus assert their influence on the beam quite abruptly before it becomes heavily depleted by collisions, which is the cause of the second coronal peak.
Numerical simulations of electron beam transport in isolated coronal loops with varying magnetic field strength (e.g.Leach & Petrosian 1981;Emslie et al. 1992;Allred et al. 2015) typically assume a purely converging magnetic field along the beam trajectory.In our atmospheric simulation, however, beams commonly find themselves in a diverging magnetic field.Our results (specifically Sect.3.1.2)indicate that even a weakly diverging magnetic field in the initial parts of the trajectory can focus the distribution enough to resist collisional flattening and make it more susceptible to magnetic mirroring when the field subsequently converges.This suggests that magnetic mirroring may be of greater importance for collective non-thermal energy transport in realistic 3D atmospheres than one would infer from most existing simulations based on isolated loops.
Although the CEC model does not account for the reflected electrons, we can reason how they would affect the energy deposition.For the beam in Fig. 6 (from set 2), which is particularly strongly affected by magnetic mirroring, about 45% of the total injected energy is deposited in the corona, 5% is deposited in the lower atmosphere, and 50% is lost to magnetic mirroring.Figure 7 suggests that most of the mirrored energy is contained in electrons with relatively low energies reflected several megametres above the TR.Most of the energy lost to magnetic mirroring would thus be deposited in the corona.Consequently, this beam's total coronal energy deposition would roughly double if reflected electrons were accounted for.A similar analysis for the beam in Fig. 4 (from set 1), where magnetic mirroring is less prominent, suggests a more modest increase of about 5% in coronal energy deposition due to reflected electrons.For beams ejected directly into the TR from the acceleration region (such as the beams in set 3), the electrons are reflected in a relatively dense environment, and most of the reflected energy would likely end up close to the acceleration region.Overall, the total fraction of injected energy lost to magnetic mirroring in our simulations is not very high: about 15% in beam set 1, 5% in set 2, 10% in set 3, and 5% in the atmosphere at large.
Likely, the most prominent changes the inclusion of magnetic gradient forces would make to synthetic observables from the electron beam simulations (such as those presented in Bakke et al. 2023) would be in the thermal and non-thermal emission produced at the locations of peak energy deposition in the TR and chromosphere.While the peak deposited energy is higher without magnetic convergence, the peak typically occurs a couple hundred kilometres deeper when magnetic convergence influences the beam.This extra depth could easily mean an order of magnitude higher density and a significantly lower ambient temperature, which would affect both the observed intensity and spectral signature.
The other physical effects supported by the CEC model that were neglected in the analytical model all had a much lower impact on the energy deposition than magnetic gradient forces.Coronal energy deposition was slightly increased by including electrons from ionised elements heavier than hydrogen or collisions with ambient helium and modestly reduced by accounting for a non-zero ambient temperature.Incorporating the parallel ambient electric field shifted energy deposition slightly towards smaller or larger distances for some beams.Modelling resistive heating from the return current and energy loss to the electric field driving it had no visible effect on the results.
The insignificance of the return current in our results is not surprising.As we argued in Paper I, the fluxes of the non-thermal electron beams accelerated in our atmospheric simulation are too small to produce significant charge separation and the associated return current.Nevertheless, being able to account for this effect opens up for applying the model to much more energetic beams where the return current plays an important role.To assess when the return current becomes significant, we artificially increased the energy flux F beam,0 injected into the beam in Fig. 4. For this beam, F beam,0 is originally of order 10 12 erg s −1 cm −2 .After increasing this flux by five orders of magnitude, the influence of the return current started to become visible as an increase in Q along the first stretch of the trajectory and a decrease along the remainder.
From the limited difference using the warm-target transport equations made to our results, it is clear that the relatively high coronal temperatures of up to 2 million kelvin present in our atmospheric simulation are not sufficient to considerably influence the mean rates of change in energy and pitch angle for the non-thermal electrons.Even when we artificially increased the temperature along the coronal part of the trajectory of the beam in Fig. 4 from 2 to 10 million kelvin, the resulting reduction in coronal energy deposition remained minor.While the potential A195, page 13 of 20 importance of the ambient temperature for non-thermal electron transport has been clearly demonstrated (Galloway et al. 2005;Jeffrey 2014;Kontar et al. 2015), our results attest that this mainly comes into play in more accurate transport models where collisional diffusion of energy and pitch angle is included.
The primary weakness of the non-thermal electron transport model presented here is that it neglects velocity randomisation by setting the collisional diffusion coefficients C E 2 and C µ 2 in Eq. ( 4) to zero.While the randomisation of energy only affects the evolution of the non-thermal distribution for energies approaching the mean thermal energy (see Eq. (A.60)), pitch angle diffusion becomes significant as soon as |µ| deviates appreciably from unity (see Eq. (A.61), as well as Bian et al. 2016).Emslie et al. (2018) show that the most prominent change to the energy deposition caused by accounting for pitch angle diffusion is the disappearance of the peak associated with the almost simultaneous thermalisation of electrons with energies near the lower cut-off energy E c (visible, for example, at distance (b) in Fig. 4).Instead, these beam electrons scatter to different pitch angles, many being prevented from propagating far due to low values of µ.Hence, the highest energy deposition becomes concentrated near the point of injection.In addition, it seems plausible that by spreading out the electrons with a given energy across a range of different pitch angles, pitch angle diffusion would somewhat dampen the features associated with magnetic gradient forces apparent in the heating profiles presented here.
For the results presented in this paper, we used a power-law index of δ = 4.This gives a relatively flat injected distribution that is probably not representative of the weak beam type present in our simulation (Lin et al. 2001;Krucker et al. 2002).We did this to make the beams somewhat more resistant to collisions, making it easier to isolate and present the non-collisional influences on beam transport emphasised in this paper.This also makes the presented results more relevant for understanding more energetic beams.That being said, we also performed runs with higher values of δ.With the exception that a higher proportion of the injected energy is deposited in the corona for higher δ (Paper I covers the effect of varying δ in the analytical model), the results were qualitatively similar to those obtained with δ = 4.
Unlike the analytical transport model used in Paper I, we did not embed the CEC model directly into the Bifrost code.Instead, we applied the model on snapshots of the simulated atmosphere outputted from Bifrost, using the standalone Rust-based tool Backstaff 3 .As discussed in Frogner & Gudiksen (2022), there are significant challenges in efficiently implementing global energy transport in the domain decomposition-based parallelisation scheme used in Bifrost.These difficulties are magnified with the CEC model due to the considerable amount of data associated with each beam that must be communicated between processes.While the data usage of the model could likely be optimised, this is outside the scope of this paper.
Because the electron transport simulations are run after the fact, we are currently unable to model the magnetohydrodynamic response of the ambient plasma to the non-thermal energy transport computed with the CEC model.However, our results in this paper show that the analytical transport model running inside Bifrost does a decent job of matching the energy deposition computed with the CEC model, with the only significant deviations coming from the absence of magnetic gradient forces in the analytical model.The fact that the CEC model represents the electron flux spectrum explicitly opens up applications that the analytical model does not support.For example, the injected flux spectrum does not have to be a simple power-law but can take on an arbitrary distribution over energy.Hence, the model could be combined with a more sophisticated treatment of particle acceleration than the simple parametric acceleration model employed here.Another example is the computation of non-thermal bremsstrahlung spectra for comparison with observations.
The CEC model is a major step towards bridging the gap between the basic analytical beam propagation model used in Paper I and the state-of-the-art models based on the direct numerical solution of the Fokker-Planck equation.Our starting point for the CEC model is a fairly comprehensive version of the Fokker-Planck equation, including all relevant contributions from the Lorentz force as well as a detailed treatment of collisions.By neglecting diffusion in velocity space, we can convert the Fokker-Planck equation into a set of ordinary differential equations for the mean evolution of beam electrons.We can solve these efficiently enough to simulate millions of beams.This enables us to model non-thermal electrons in a realistic 3D atmosphere with their spatial distribution, energetics, and trajectories emerging from the atmospheric simulation rather than being prescribed ad hoc.Thus, we sacrifice some realism in the physical modelling of electron transport (no velocity randomisation) for increased realism in the context in which this modelling is applied.The trajectories that beams follow in our simulation and the conditions along them are highly diverse.As we have shown, the diversity in conditions leads to equal diversity in the behaviour of the electron beams.This sometimes exposes interesting phenomena (such as the amplification of magnetic mirroring by a preceding magnetic field line divergence) that are easily overlooked in electron beam modelling with a more manually prescribed atmospheric structure along the trajectory.are potentials satisfying Poisson's equations: .14)Disregarding, for now, the contribution of collisions with neutral particles, we can apply Eqs.(A.8) and (A.9) so that Eq. (A.4) becomes (A.15) where ∇ v ∇ v ψ c represents the Hessian matrix of ψ c .Using the identity .16)we obtain an alternative version of Eq. (A.15): (A.17 The velocity v is conveniently expressed in spherical coordinates (v, β, φ v ), where v is the speed, the pitch angle β is the angle between v and the local magnetic field vector B, and φ v is the angle of v within the plane perpendicular to B. The velocity volume element then becomes d 3 v = v 2 sin β dφ v dβ dv.Again, assuming azimuthal symmetry lets us ignore any dependence on φ v and consider the distribution f (s, v, β, t) constant for all azimuthal velocity orientations.In terms of the remaining spherical coordinates (v, β), the divergence of a vector field V is A.19) the gradient of a scalar field f has components A.21) while the Hessian matrix has components .24)In terms of (v, β) coordinates, ds/dt = v cos β, so Eq.(A.Here Z N and n N are, respectively, the atomic number and number density of neutral particles of species N, while ln Λ N and ln Λ N are effective Coulomb logarithms (Evans 1955;Snyder & Scott 1949).We can now write Eq. (A.27) as  We also switch from using the phase-space distribution f (v, β) to using the field-aligned electron flux spectrum F(E, µ) for representing the beam.The field-aligned electron flux spectrum is defined such that F(E, µ) dµ dE is the rate of electrons with energies within dE of E and pitch angle cosines within dµ of µ flowing in the positive magnetic field direction through a unit cross-sectional area.We can express this as F(E, µ) dµ dE =  The collisional coefficients are given by  Using this, we find C F = 0, (A.68) A195, page 20 of 20 tc ) is the beam electron speed normalised by the thermal speed v tc = √ k B T c /m c , where A195, page 4 of 20

Fig. 1 .
Fig. 1.Plots of the warm-target contribution functions W E (orange), W µ (purple), and W F (green) as functions of the normalised speed u = v/( √ 2v t ) = √ E/k B T .The dotted grey curves show the mapping between u and energy E for different temperatures T .The dashed blue line highlights the location of u = 1, corresponding to E = k B T .
Fig. 2. Net change in heating power due to non-thermal electrons in the atmospheric simulation accumulated over the y-axis of the simulation box.Approximately 1.25 million beams were simulated using the Fokker-Planck-based model, with magnetic gradient forces accounted for in the electron transport equations.Blue regions have a net reduction in heating power resulting from released reconnection energy that would otherwise be released as local heating instead of going into particle acceleration.Orange regions indicate where the non-thermal energy is deposited as heat.

Fig. 4 .
Fig. 4. Deposited power density Q as a function of propagation distance for a representative beam in set 1 in Fig. 3 for two separate simulations, one with magnetic gradient forces (points with colour varying between blue and red) and one without (green points).The colours for the former simulation indicate the local relative change in magnetic flux density B with distance s.Blue colours imply that the magnetic field decreases in strength in the direction of propagation, while red colours imply that the magnetic field increases in strength.The local plasma mass density is shown as a solid grey curve.The right panel with a yellow background gives a magnified view of the plot in the left panel around the lower atmosphere, over the distance range indicated by the yellow band in the left panel.The labelled vertical lines mark locations of interest along the trajectory: (a) is near the site of injection, (b) is at the first coronal peak in Q, (c) is at the second coronal peak present only in the simulation with magnetic gradient forces, and (d) is near the peaks in Q below the transition region.The beam has F beam,0 ≈ 1.4 × 10 4 erg s −1 cm −2 and E c ≈ 5 keV.

FrognerFig. 5 .
Fig.5.Distribution dn/dE of beam electrons over energy E at the four separate distances s (with a separate panel for each distance) indicated in Fig.4, both for a simulation that ignores (solid green curve) and includes (dashed purple curve) magnetic gradient forces.Also included is the collisional rate of energy loss for a single electron, −(dE/dt) coll , from Eq. (48) (solid grey curve).Summing a distribution curve and energy loss rate curve would yield a log-space curve of the integrand for the deposited power density Q beam (Eq.(47)).

Fig. 6 .
Fig.6.As in Fig.4, but for an electron beam in set 2 starting at x = 7.1 Mm and a height of 12.1 Mm in Fig.3.The beam has F beam,0 ≈ 1.1 × 10 4 erg s −1 cm −2 and E c ≈ 5.4 keV.

Fig. 7 .
Fig. 7. Minimum energy E of unreflected electrons (µ > 0) remaining in the distribution as a function of distance s for the beam in Fig. 6.The colours of the points indicate the number density dn/dE of electrons with that energy.Included as a dark grey curve is the magnetic convergence d ln B/ds.

Fig. 8 .
Fig.8.As in Fig.4, but for an electron beam in set 3 in Fig.3that is ejected straight down into the transition region.The beam has F beam,0 ≈ 6.4 × 10 5 erg s −1 cm −2 and E c ≈ 1.8 keV.