Implementation of synthetic fast-ion loss detector and imaging heavy ion beam probe diagnostics in the 3D hybrid kinetic-MHD code MEGA

A synthetic Fast-Ion Loss Detector (FILD) and an imaging Heavy Ion Beam Probe (i-HIBP) have been implemented in the 3D hybrid kinetic-magnetohydrodynamic code MEGA. First synthetic measurements from these two diagnostics have been obtained for neutral beam injection (NBI) driven Alfv\'en Eigenmode (AE) simulated with MEGA. The synthetic fast-ion losses show a strong correlation with the AE amplitude. This correlation is observed in the phase-space, represented in coordinates toroidal canonical momentum and energy. Fast-ion losses and the energy exchange diagrams of the confined population are connected with lines of constant E' , a linear combination of E and P{\phi} . First i-HIBP synthetic signals also have been computed for the simulated AE, showing displacements in the strikeline of the order of around 1 mm, above the expected resolution in the i-HIBP scintillator of approximately 100 {\mu}m.


I. INTRODUCTION
In magnetically confined fusion plasmas, Alfvén Eigenmodes (AEs) can be excited by various fast-ion sources, such as neutral beam injection (NBI) and fusion-born alpha particles. In turn, AEs can enhance the fast-ion transport and can lead to fast-ion losses towards the first wall in fusion devices. These uncontrolled fast-ion losses against the wall can result in hazardous heat loads in future reactors, like ITER 1,2 .
Previous work has been carried out to characterize AEs experimentally [3][4][5] , focused on the identification of the fast-ion transport induced by these modes and the poloidal structures of the modes. In the ASDEX Upgrade (AUG) tokamak, the poloidal array of fast-ion loss detectors [6][7][8] have detected that the fast-ion losses are correlated with the AEs amplitude and frequency, demonstrating the AE and fast-ion interaction. Accurate characterization of these losses and the mode structures plays a key role in understanding the fast-ion confinement 9-12 . In this work, these experiments are modelled with the 3D non-linear hybrid kinetic-MHD code MEGA 13 . Two synthetic diagnostics have been developed in MEGA, providing further insight into the Alfvénic activity, by studying two fundamental key points: the fast-ion loss and the radial structures.
These synthetic diagnostics are based on two of the diagnostic systems in AUG: the poloidal array of Fast-Ion Loss Detector (FILD) and the imaging Heavy-Ion Beam Probe 14-16 (i-HIBP). For the first, a realistic 3D wall for the AUG tokamak has been implemented in MEGA showing a correlation between the fast-ion losses towards the wall and the AE activity in the simulations. For the latter, a predictive study of the synthetic signal demonstrates the capability of i-HIBP for measuring an AE located between midradius and the edge of the plasma. This paper is organized as follows. The model implemented in the code MEGA is briefly described in Sec. II where the implementation of the realistic 3D wall is described. The implementation of the synthetic diagnostic for i-HIBP is described in Sec. III. Sec. IV is devoted to the analysis of MEGA simulations showing the fast-ion losses and the synthetic signal for the i-HIBP diagnostic. A summary is given in Sec. V.

II. MEGA AND THE REALISTIC 3D WALL
MEGA is a numerical code that computes the selfconsistent evolution of a bulk plasma and the fast-ion population in realistic 3D configurations using cylindrical coordinates. In this code, the bulk plasma is modelled using the complete non-linear single-fluid resistive-MHD equations 13,17 . Coupling between bulk plasma and fastion population is done via the current density in the momentum balance equation.
The set of MHD equations is spatially discretized using 4 th order finite differences on a cylindrical grid, covering the full tokamak geometry. The fast-ion distribution is sampled by markers covering the 5D reduced phasespace (X, p , µ), X being the guiding-center position; p , parallel momentum; and µ the magnetic dipole moment. These markers are evolved using the gyro-kinetic equations with Finite Larmor Radius (FLR) corrections. The fast-ion distribution is evolved using particle-in-cell with the δf method 18 .
The cylindrical grid resolution has been chosen to be (N R , N φ , N z ) = (128, 64, 256), allowing the evaluation up to the n = 5 toroidal mode number. Higher toroidal mode numbers are filtered out to reduce numerical noise. The time evolution is obtained using an explicit 4 th order Runge-Kutta scheme.
Experimental profiles and magnetic reconstructions from AUG pulse #34570 are used as inputs for the MEGA simulations. In Fig. 1 the initial profiles are presented, corresponding to a discharge at the AUG tokamak. The initial fast-ion distribution is given by a modelled off-axis NBI slowing-down distribution using a Gaussian term 8 for the spatial dependence. The initial distribution function used in this work is: being ρ the normalized poloidal magnetic flux. Spatial parameters have been fixed to ρ 0 = 0.4, ∆ρ = 0.15 in this work. v birth is the birth velocity, has been set to 93 keV, and ∆v = 0.05 · v birth . For the pitch-angle, a Gaussian dependence in Λ ≡ 1 − λ 2 = µB E is introduced. The pitch-angle parameters has been set to Λ 0 = 0.55 and ∆Λ 0 = 0.20 in this work. Finally, v crit is the critical velocity 19 .
The parameter regulating the fast-ion density, β fi = p fi B 2 axis /2µ0 , is set to β fi = 0.67%, being p fi the fast-ion pressure. This value corresponds to the NBI6 for the same discharge. Note that this work does not intend to reproduce the Toroidal Alfvén Eigenmodes (TAEs) observed in the experiment, but to provide a suitable simulation case to test the newly implemented synthetic diagnostics. A detailed comparison to the experiment is ongoing 20 .
A 3D wall has been implemented in MEGA, allowing to stop the evolution of fast-ion markers when they reach the first wall. The mapping of the wall to the cylindrical grid (where the MHD equations are solved) allows for a fast implementation of the 3D wall, without a significant impact on the simulation efficiency (less than 1%). In Fig. 2, a poloidal cut of the mapped wall in MEGA is shown. The regions marked in yellow (some of them lie behind the 2D wall model represented by the thicker black lines) determine where the fast-ion evolution will be stopped and considered as fast-ion losses (FIL).

III. SYNTHETIC I-HIBP DIAGNOSTIC
The i-HIBP diagnostic injects a heavy-neutral primary beam ( 133 Cs or 85,87 Rb) into the plasma that ionizes due to multiple processes. These ionized particles, forming the secondary beam, start a gyromotion until reaching a scintillator plate. The signal on the scintillator translates into a two-fold information: the intensity of the strike line provides the plasma density (n e ); and the strike line position and shape provides information on the magnetic and electric fields, B and E, respectively 16 .
The synthetic diagnostic of i-HIBP, the new i-HIBPsim code, is based on kinetic simulations for the two main species, the heavy-neutrals (primary beam) and heavyions (secondary beam). Markers are launched at the injection port and tracked into the plasma using a Boris leap-frog scheme 21 . In this work, an infinitely small beam is used, i.e., the width of the beam and divergences are set to zero. The secondary beam birth distribution is obtained by using a beam attenuation model: where the sum is over all possible reactions that attenuate the beam; n k is the secondary reactant density; and σv k is the reaction rate of the k th reaction. Only two reactions are considered to generate the attenuation of the primary: the electron-impact ionization 22 and the charge-exchange reactions with main-ions [23][24][25] . Singleionization step is implemented in the simulation code as the recombination via charge-exchange (i.e., Cs + +D 0 → Cs 0 + D + ) is expected to be much smaller, since the neutral density in AUG is of the order 26 of n 0 ∼ 10 16 m −3 . Impurities induced ionizaation reaction rates, as extrapolated from lithium in 27 , are negligible compared to the main ion charge-exchange and electron-impact ionization rates. This, combined with the typical impurity concentration (∼ 1% after the boronization 28 ), makes this interaction negligible, compared collisions with electrons and main ions.
The secondary beam will travel following gyroorbits until hitting the scintillator, determined via a raytriangle algorithm 29 . The beam-attenuation equation is also used to determine the secondary beam flux into the scintillator. A single-step ionization is used for the secondary beam considering only the electron-impact ionization 30,31 . Charge-exchange recombination for the secondary beam is not taken into account, as for the primary beam.
Markers evolve in a fully 3D input electromagnetic field, allowing for a direct connection with MEGA. The electromagnetic perturbations computed by MEGA for a certain plasma phenomena, can be used to feed the synthetic diagnostic and obtain the predicted signal.
In previous experiments in fusion devices, like TJ-II, a similar diagnostic, the HIBP, has been used to detect and characterize the poloidal mode numbers and structure of AE 32 . The scintillator-based i-HIBP will provide the high spatial resolution measurements, as shown in Fig. 5 (up to 100 µm in the scintillator).

IV. SIMULATION RESULTS
The off-axis fast-ion distribution produces in the plasma a TAE located at the midradius (ρ pol = 0.70). This example case, using the realistic 3D wall, already suggests an important fast-ion loss mechanism, via the wave-particle resonances. The location of the AE, as shown in Fig. 3(b), is close enough to the edge for the heavy-ions in i-HIBP to feel the perturbations. The green lines represent trajectories for 85 Rb under the perturbed magnetic field, proving the possible range of detection.
The implementation of an off-axis initial fast-ion spatial distribution leads to Alfvénic activity closer to the plasma edge. In Fig. 3(a), the toroidal mode energy in the bulk plasma is shown on a logarithmic scale. The |n| = 4 mode shows the largest growth and dominates the plasma phenomena. In dashed, the fast-ion flux for given µ ∈ (3.0, 5.0) · 10 −15 J/T interval has been represented. Note that to avoid the inclusion of unrealistic fast-ion prompt losses in the simulation the quantity |δw j | N j has been presented instead, where |δw j | is the differential weight evolution with respect to the equilibrium, and N j is the number of particles represented initially by the marker. The markers strongly interacting with the mode have a higher |δw j |, hence allowing us to focus on fast-ion loss induced by the mode.
In Fig. 3(b) the poloidal structure of the mode at t = 0.07 ms is shown. The mode is located around the surface ρ pol = 0.7, superimposed for visual guidance. A Fourier transform of its time evolution shows that the frequency of the mode is f = 102 kHz.

A. Synthetic fast-ion losses
In the AUG tokamak, strong TAE-coherent fast-ion losses have been detected with the fast-ion loss detector poloidal array 11 . The induced losses can be explained by the magnetic perturbation producing an open trajectory, without a net energy exchange; or via a power exchange with the mode resulting in an orbit kick away from the confined region.
Fast-ion losses in MEGA simulations have been obtained using a self-consistent approach, capturing the fast-ion markers during the simulations. To identify whether these losses are produced by a significant interaction with the AE, the phase-space, represented in variables (P φ , E, µ), being toroidal canonical momentum, energy and magnetic moment, respectively. In Fig. 4 (ab) the phase-space for µ ∈ (3.0, 5.0) · 10 −15 J/T is shown. For the confined population (a) the instantaneous energy exchange is presented, indicating the region where the mode is interacting the strongest with the fast-ions. For the FIL (b) the impinging flux onto the 3D wall is presented.
In the presence of a wave with a given low and constant frequency, ω n , and toroidal mode number n, the conserved quantity 4 is E = E − ωn n P φ . Contour lines with this quantity have been superimposed in both Fig.  4(a,b). Fast-ions that drive the AE, drift away and hit the wall following constant E lines. As a visual guidance, the divertor region is represented in both figures as cyan dashed line, which is the region with the largest heat loads. In Fig. 4(c), the FIL flux is represented in the angular plane only below the midplane (θ = 0), since it is the region receiving most of the FIL flux.
A simulation with only the toroidal mode numbers |n| = 0, 4, i.e., filtering the rest of the Fourier components, shows that both the confined population energy exchange is still present in the same location. The FIL in these simulations do not differ significantly from the multi-n simulation. We can conclude that the fast-ion transport and losses are dominated by their interaction with the toroidal mode number n = 4. This analysis suggests that the fast-ion losses are predominately expulsed from the plasma due to the energy exchange with the AE during the linear growth phase. This would play a central role in the interpretation of the FILD experiments in the AUG tokamak, since it connects the fast-ion loss measurements to an energy exchange with the mode.

B. Synthetic i-HIBP signal
The simulated AE is used here to construct the i-HIBP synthetic signal. The radial structures, as shown in Fig.  3(b) are located in an off-axis location, ρ pol ≈ 0.55−0.75. The total mode amplitude is of the order of δB r /B axis ∼ 10 −3 , typical from NBI-driven AE experiments in the AUG tokamak, allowing us to obtain realistic estimates of the i-HIBP signal.
The signal on the scintillator has been obtained by tracking both the primary and secondary beam using the i-HIBPsim synthetic diagnostic, described in Section III. The long gyro-radius (of the order of 20 cm in the current setup, with E = 70 keV for the 85,87 Rb, E = 50 keV for the 133 Cs; and B = 2.5 T) of the heavy-ion takes them further within the plasma where electromagnetic perturbations modify their orbits before reaching the scintillator. In Fig 5, the strikeline on the scintillator for the 87 Rb is shown for the baseline scenario, i.e., without perturbations. For visual guidance, points with the birth ρ pol location are superimposed, and the sign convention for the line perturbation is presented.
Simulations with and without the AE perturbations have been carried out in order to assess the changes in the strike line on the scintillator. The perturbation case has been analyzed with and without the generated AE electric field (δE r ∼ 6 kV/m), in order to isolate the impact of the electric field on the strike pattern. Two key parameters are studied to determine the impact on the strike line: the perpendicular displacement of the strikeline (perpendicular to the case without perturbation), δ ⊥ in Fig. 6(a); the modification of the intensity in the strike line due to the density and temperature perturbations, in Fig. 6(b). Both species, 85,87 Rb and 133 Cs, available as separate sources in the AUG i-HIBP diagnostic, have been used in the analysis.
The relevant comparison in the strikeline is the case without electric field (solid lines) and with the electric field (dashed lines). For both species, the displacement caused only by the magnetic field perturbation lies in the range of ∼ 40 µm, while the electrostatic potential induces a deviation up to ∼ 2 mm, above the expected optical resolution (∼ 100 µm) on the scintillator. For the intensity pattern variation, Fig. 6(b), the deviation due to the electric perturbation is negligible. The relative pattern variation is an order of magnitude different between Cs and Rb beams, being ≈ 75% and ≈ 15% respectively. This systematic deviation in intensity points to the possibility of measuring δn e due to Alfvénic modes in i-HIBP.

V. CONCLUSIONS
In this work, the synthetic diagnostics for fast-ion losses and the i-HIBP diagnostic have been developed and applied to a MEGA simulation. The synthetic fastion loss diagnostic shows already promising results, connecting the fast-ion losses to the interaction with Alfvénic phenomena, through E lines. This methodology can now be extended to the rigorous study of plasma instabilities and understanding the fast-ion losses associated to them.
The preliminary study of the synthetic i-HIBP signal for the simulated AE shows that the radial structures may be resolved by the i-HIBP diagnostic. The impact on the strikeline due to the electric perturbation induced by the AEs will be measurable with the i-HIBP scintillator (≈ 2 mm).