EURIDICE : A code-package for gyrotron interaction simulations and cavity design

We report, for the first time comprehensively, on the present status of the code-package EURIDICE for gyrotron interaction simulations and cavity design, developed at the National Technical University of Athens. The area of application, theoretical models, numerical implementation, and features of the codes are discussed.


Introduction
Simulations of the interaction of the electron beam with the electromagnetic field in gyrotron resonators are necessary for their design and support to the experiments.Fast calculations are essential for the interaction codes, in order to be used as efficient designing and/or supportive tools.In the Association EURATOM-Hellenic Republic, and in particular at the National Technical University of Athens, there has been an ongoing, long-term effort aiming towards interaction modelling, gyrotron cavity design, and development of pertinent fast numerical tools, given the importance of gyrotron development for magnetic confinement fusion experiments.About a decade of such endeavours culminated in the integration of all of the developed codes in the code-package EURIDICE, first appeared in 2008 and under continuous extension and improvement since then.
EURIDICE comprises codes for operating mode selection, calculation of the field profile of TE modes in the cold cavity, calculation of the modes' starting currents, self-consistent calculation of the field profile in steady-state single-mode operation, and time-dependent multi-mode simulation of the beam-field interaction.The time-dependent codes are developed under the slow-time-scale approximation and they are parallelised, allowing fast multi-mode simulations.Ohmic losses, axial variation of the magnetostatic field, and spreads in the electron beam parameters are also considered.
EURIDICE has been successfully used for the design and simulation of several gyrotrons developed in Europe and has been benchmarked by comparisons with the well-established codepackage CAVITY [1][2], developed at Karlsruhe Institute of Technology (KIT).More important, the time-dependent, multi-mode, self-consistent interaction code in EURIDICE has been verified through comparisons with existing European codes for fast multi-mode calculations, namely the codes SELFT (in CAVITY) and COAXIAL [3].Additional verification for single-mode calculations and electron trajectories has been achieved by comparisons with the codes TWANG [4] and Ariadne++ [5].EURIDICE simulations are also in satisfactory agreement with experimental results.

Area of application and general features
EURIDICE is addressing gyrotron oscillators.The geometry of the resonator has to be cylindrically symmetric around the z-axis.The outer-wall must be smooth with large finite (or infinite) conductivity, having, in principle, arbitrary shape.Coaxial resonators can also be treated.The coaxial insert may have longitudinal corrugations; then the Surface Impedance Model (SIM) [6][7] is used for obtaining the transverse dependence of the high-frequency (RF) field.In any case, the axial non-uniformity of the resonator has to be mild (typically with tapers < 5 o ).Because of that, the RF field is assumed to be a superposition of independent TE modes [8].TM modes are not considered, being less favoured than TE modes by the gyrotron interaction [9].No mode conversion or mode coupling due to the axial non-uniformity is taken into account.The transverse structure of the modes of the non-uniform resonator is assumed to be fixed and locally, at the point z = z 0 , it is assumed to be the same as the transverse structure of the modes of an axially infinite uniform wave guide, which has the same transverse dimensions as those of the non-uniform resonator at z = z 0 .If the above requirements are met, the geometry addressed by EURIDICE can in principle be the whole region consisting of a smooth beam tunnel, a gyrotron cavity, and a non-linear uptaper.
The electron beam must be an annular beam, whose radius is much larger than the Larmor radius.(Large orbit gyrotrons with axis-encircling beams cannot be treated.)The beam is guided by an axial magnetic field, which can vary mildly along the resonator.Interaction both at the fundamental cyclotron frequency and at the second cyclotron harmonic is considered.Interaction at higher cyclotron harmonics can also be simulated; however there has been no attempt up to now to verify EURIDICE in such calculations.Ohmic losses are treated in all codes.The non-linear interaction codes can consider spreads in the electron energy, velocity ratio α = v ⊥ /v || , and guiding-centre radius.

Hardware and software usage and requirements
The code-package EURIDICE is written in FORTRAN.The Message Passing Interface (MPI) has been used for the parallelisation of the time-dependent codes.EURIDICE uses the codes GEOMT (for the introduction of the resonator geometry) and CHIMP (for the calculation of the eigenvalues of TE modes in a coaxial resonator), both developed at KIT and incorporated in CAVITY.Hardware requirements are not critical.Software requirements include UNIX-like or Windows Systems, FORTRAN Compiler, and MPI interface for parallel runs on UNIX-like systems.
Memory requirements are not critical.The computation time needed by the non time-dependent codes is very short.The time-dependent simulations can be time-consuming depending primarily on the interaction model used, on the number of electrons, and on the simulated time-interval.The more time-consuming simulations are multi-mode simulations of the start-up of the gyrotron.To give some numbers, a "heavy" simulation with 900 electrons, 60 modes, 100000 time-steps, 1000 spacesteps, and a relatively simple but sufficient model, takes ~24 h at 16 processors.

Description of the codes in EURIDICE
There are six major codes in EURIDICE, briefly described in the following: 1. Design: This code is used as the first step towards a gyrotron design.It provides a group of suitable operating modes, along with the corresponding beam parameters, operating point, and information on the cavity design.The code is based on the normalised variables approach [10] and on the procedure for the operating mode selection found in [11], which is oriented towards optimum efficiency.The user defines the desired values for the frequency and output power, together with several constraints regarding the beam space-charge, the electron gun design, ohmic losses, etc.
2. Coldcav: The code calculates the frequency, diffractive and ohmic quality factors, and the axial field profile of any TE mode in a given resonator without the electron beam (cold-cavity approximation, see Figure 1a).Higher longitudinal harmonics can also be calculated.The wave equation solved for the field profile and the boundary conditions are similar to those of [13].Given an operating mode, the code also provides the list of the possible competing modes at the fundamental and second cyclotron harmonic.The minimum starting current of each mode, relevant to that of the operating mode, is also calculated according to the starting current formulas in [10] (Figure 1b).The obtained list of competing modes is to be used in the multi-mode simulations.
3. Istart: This is a code for the calculation of the starting currents of the TE modes, assuming specific axial field profiles (as obtained by Coldcav or user-defined) and specific parameters for the electron beam.The starting current curves can be calculated versus either the beam voltage or the magnetostatic field (Figure 1c).The expression used for the starting current calculation is obtained by the linearised interaction equations in the small-signal regime and is given by (3.3.14) of [14].For uniform magnetostatic field, it is similar to (5.40) in [15].
4. Self: The code calculates the equilibrium (steady-state) point of operation of a TE mode at given resonator, electron beam and magnetostatic field.The equilibrium frequency, output power, and field profile of the mode are calculated self-consistently.Both stable and unstable equilibria can be determined (Figure 1d).The employed interaction model is similar to that in section 3.4 of [16].
5. Inter: A time-dependent, multi-mode, fixed-field interaction code.It can treat an arbitrary number of TE modes.Simultaneous interaction of different modes at different cyclotron harmonics is permitted.The field profiles of the modes can be those of the cold cavity or others, user-defined.The output power and frequency pulling of the modes are obtained as functions of time.The beam parameters (i.e. voltage, current, α) can vary over time according to the adiabatic approximation ((5.14) in [16]) and the Schottky formula for temperature-limited emission, or according to userdefined tables (obtained from electron gun simulation codes, or from experiment.)The variation of the parameters can be either linear or stepwise.In this way start-up simulations are feasible.The interaction model used [17] is very similar to the model described in section 4.2 of [16].
6. Evridiki: This is a time-dependent, multi-mode, self-consistent interaction code, which has all the features of Inter but now the field profile and frequency of each mode are calculated self- consistently, as functions of time.Spectral information at a given axial point is produced by FFT.
Illustrative results are shown in Figure 1e-f.The electron beam can also be imported particle by particle from an electron gun simulation code (e.g.Ariadne++).A non-uniform guiding magnetic field can be handled, as long as the adiabatic approximation remains valid (i.e. the magnetic moment is conserved).Moreover, the guiding magnetic field can also vary slowly over time, allowing simulations of tuning by means of varying magnetic field.Since Evridiki is the most advanced interaction code in EURIDICE, superseding Self and Inter in many ways, we will devote the next section to a more detailed account of the employed interaction model and its numerical implementation.
3 The time-dependent, self-consistent, multi-mode code in EURIDICE

Interaction model
Many variants of the slow-time-scale, self-consistent model for the interaction of the electron beam with the high-frequency electromagnetic field in the gyrotron resonator exist in the literature (ch. of [16] and references therein).The model consists of the equations for the electron motion and the equations for the field profiles of the TE modes of the resonator, which are interacting with the electrons.Several variants of the model are implemented in EURIDICE.We outline here the most advanced variant, in the sense that it is based on the smallest number of approximations.
The RF electric field is represented in the resonator's cylindrical coordinates (R, Φ, z) as a sum of TE modes: ) , where ζ = z/R 0 and τ = tc/R 0 are normalised axial distance and time.(R 0 is a reference radius.)The transverse eigenvector e n of the n-th TE mode is the eigenvector of the corresponding TE mode in a uniform wave guide of infinite length with transverse dimensions equal to the resonator's transverse dimensions at position z.The normalised real frequency ω n is the carrier frequency of the mode (i.e. the frequency of the fast oscillations) and the complex function A n (ζ, τ) represents the axial field profile of the mode, obeying the equation: where Z 0 = (µ 0 /ε 0 ) 1/2 ≅ 120π Ω, V 0 = m e c 2 /e ≅ 511 kV, and the normalised complex transverse wave number k ⊥n accounts also for the ohmic losses.The source term I n depends on the electron beam: where I b is the beam current and the index j refers to the j-th electron.The brackets 〈 〉 denote averaging over the electrons.The coefficient G n , accounting for the coupling between the mode and the electron, depends on the electron guiding-centre coordinates (R e , Φ e ).s n is the mode's cyclotron harmonic index and ω 0 is a normalised reference frequency close to the electron cyclotron frequency.The normalised electron momentum is u = γβ=γv/c, with the indices || and ⊥ denoting the axial and transverse components, ,with φ being the electron angle at the polar coordinate system of the guiding centre, and r L is the normalised Larmor radius.The boundary conditions for (1) are radiation boundary conditions with zero reflection at the carrier ω n [13]: The extension of the model in order to use more general boundary conditions [18], as well as to treat non-zero reflections, is planned for the near future.The equations of motion are the following: Here B || is the axial guiding magnetic field, Ω 0 = (eB || /m e )(R 0 /c) is the normalised non relativistic electron cyclotron frequency, h n = (k ⊥n r L ) 2 Ω 0 /(γω n s n ), and , with 0 ≤ φ 0 < 2π for the initial electron phase φ 0 .
The model ( 1)-( 5) relies on the following fundamental assumptions: (i) The static electric field and the beam space-charge are neglected.(ii) The beam does not influence the transverse structure of the modes.(iii) The axial non-uniformity of the resonator is much weaker than the axial nonuniformity of the field profile A n .(iv) The TE modes involved must be in resonance with the electron beam, that is (ω n -s n ω 0 )/ω n << 1. (v) The calculated quantities A n , p ⊥ , u || are "slow" variables of time with respect to the cyclotron frequency (slow-time-scale approximation).Several additional assumptions are common in order to speed up calculations.Τhe corresponding simplified interaction models are also implemented in EURIDICE.Here are some examples: (i) For a weakly relativistic electron beam (in particular if v ⊥ /c << 1), the axial RF magnetic field can be neglected (|h n | << 1) and the Bessel functions J can be replaced by small-argument expansions.(ii) For modes close to cut-off, the transverse RF magnetic field can be neglected (|ε n | << 1).(iii) If (ii) holds, then for a weakly tapered magnetic field the axial momentum u || may be assumed to be conserved [(dB || /dζ)/B || → 0].(iv) Following (i) and (iii), the axial velocity β || can also be assumed constant, because of the conserved u || and of the small change in the relativistic factor γ of weakly relativistic electrons.

Numerical implementation
For the numerical integration of (1)-( 5) we assume the usual ordering of time-scales ((4.10) in [16]): T cycl << T trans << T field << T param , where T cycl is the electron cyclotron period, T trans is the transit time of the electron through the resonator, T field is the characteristic time of evolution of the field profile A n , and T param is the characteristic time of change of the initial beam parameters and/or of the value of the magnetostatic field.Under this assumption, the self-consistent interaction code is arranged as a trajectory code and the numerical algorithm is shown in Figure 2. The equations of motion are solved for a representative ensemble of electrons differing in initial values.Random initial values are also possible.The key feature is that A n is assumed constant during the electron transit, i. e. the

Fig. 1 .
Fig. 1.Illustrative EURIDICE results for the 170 GHz, 2 MW, EU coaxial gyrotron for ITER [12] (a) Cold-cavity field profiles of the operating TE 34,19 mode and the major competing modes, and (b) relative minimum starting currents of the modes (Coldcav).(c) Starting currents of the modes versus the beam voltage (Istart).(d) Self-consistent stationary field profile along the resonator at the operating point (Self).(e) Output power versus time during the start-up of the tube (beam voltage increases linearly with time), and (f) spectrum of the operating TE 34,19 mode at the resonator output (Evridiki).