Global Linear and Nonlinear Gyrokinetic Simulations of Tearing Modes

To better understand the interaction of global tearing modes and microturbulence in the Madison Symmetric Torus (MST) reversed-field pinch (RFP), the global gyrokinetic code \textsc{Gene} is modified to describe global tearing mode instability via a shifted Maxwellian distribution consistent with experimental equilibria. The implementation of the shifted Maxwellian is tested and benchmarked by comparisons with different codes and models. Good agreement is obtained in code-code and code-theory comparisons. Linear stability of tearing modes of a non-reversed MST discharge is studied. A collisionality scan is performed to the lowest order unstable modes ($n=5$, $n=6$) and shown to behave consistently with theoretical scaling. The nonlinear evolution is simulated, and saturation is found to arise from mode coupling and transfer of energy from the most unstable tearing mode to small-scale stable modes mediated by the $m=2$ tearing mode. The work described herein lays the foundation for nonlinear simulation and analysis of the interaction of tearing modes and gyroradius-scale instabilities in RFP plasmas.


Introduction
Tearing modes are a well-known fluctuation in toroidally-confined plasmas and can significantly influence the stability and performance of fusion devices.They produce magnetic islands, are associated with cyclical oscillations like sawteeth, drive disruptive events, and interact with turbulence which potentially leads to significant plasma transport and energy losses [1,2].When tearing modes excite a turbulent cascade, fluctuation energy reaches small scales where it can impact micro-scale instabilities and fluctuations [3,4].Extensive research has been dedicated to understanding the linear and nonlinear physics of tearing modes, and in developing effective strategies to mitigate their detrimental effects.
One particular toroidal device where tearing modes are active and play a fundamental role is the reversed-field pinch (RFP) [5,6,7,8,9,10,11].Tearing modes in RFPs are global, system-scale modes driven by the current profile across its radial domain.These modes grow to finite amplitude and exhibit nonlinear couplings with each other and with small-scale fluctuations.Experimental measurements and nonlinear magnetohydrodynamic (MHD) computations have provided detailed analyses, revealing that the coupling between tearing modes of different poloidal and toroidal mode numbers m and n leads to the conversion of poloidal magnetic flux in the plasma core region to toroidal magnetic flux near the reversal surface.This results in a self-generated toroidal flux, commonly referred to as the dynamo effect [5,12].Moreover, interactions among multiple tearing modes resonant at different radii enhance energy and momentum transport [13,14].When the activity of tearing modes is reduced through control of the plasma current profile in pulsed-poloidal-currentdrive (PPCD) experiments, plasma confinement improves, characterized by increasing plasma beta and electron temperature, as well as reduced electron heat diffusivity [10].RFPs can furthermore exhibit a plasma state called quasi-single-helicity (QSH), where the lowest resonant mode at the inner radii singly dominates the tearing-mode spectrum, leaving other, higher-resonant modes at larger radii insignificant.This state is similar to having multiple tearing modes suppressed, which limits nonlinear tearing interactions, resulting in less magnetic stochasticity, increased plasma current, and therefore enhanced confinement [15,16,17].
Nonlinear interactions involving tearing modes occur not only between global-scale modes but also across an extended range of scales, as directly observed and inferred in a number of experiments [18,19,20].As tearing modes cascade to small scales, they continue to interact with MHD fluctuations.They can also interact with driftwave-type microinstabilities and turbulence.Such interactions, which involve not just different scales but different physics, are often described as multi-scale interactions.An example of a multi-scale interaction was demonstrated in a gyrokinetic simulation of density-gradient-driven trapped-electron-mode (∇n-TEM) turbulence in the RFP with a representation of tearing mode activity in terms of a constant-in-time magneticfield perturbation modeling residual tearing fluctuations.The simulations showed that the magnetic fluctuation suppressed the zonal flows generated nonlinearly in TEM turbulence, resulting in an increase of the electrostatic heat flux [4].
Similar effects stemming from large-scale magnetic perturbations on zonal-flowregulated microturbulence have also been observed in the tokamak.Resonant magnetic perturbations (RMPs), which are externally applied to plasmas for the suppression of edge-localized modes [21], were found in DIII-D experiments to increase transport levels and lower energy confinement [22].Local gyrokinetic simulations using a adhoc radial magnetic perturbation similar to that of RFP modeling were carried out for a DIII-D L-mode scenario.The simulations indicate that incremental increases in turbulent fluctuations are related to the reduction of zonal-flow levels by this perturbation [23].Similarly, the interaction between microtearing and electron-scale turbulence is partly governed by zonal flows and can be regulated via the addition of RMPs [24].Thus, the physical mechanism at play is largely the same as that in the RFP.This modeling approach is most appropriate for external perturbations like the RMP.It is an approximation for the effect of internal magnetic perturbations from collective modes, both because collective modes have their internally consistent linear and nonlinear dynamics and because external perturbations cannot capture any possible back-reaction of the microturbulence on the collective mode.This motivates the present, more realistic and accurate approach.
Although extensive investigations have been conducted to examine self-interacting tearing modes within the RFP, interactions simultaneously involving micro-and macroscale fluctuations have received comparatively limited attention and are therefore less understood.The limited progress on multi-scale interactions to date is due, at least in part, to the fact that the self-consistent coupling of two distinct scales is difficult to treat computationally.While studies of single-scale tearing modes and nonlinear couplings of different helicities can be performed entirely within MHD models, coupling with microinstabilities requires models that can capture gyroradius-scale drift-wave physics.One class of drift-wave-capable models is gyrokinetics [25], which generally provides a comprehensive representation of micro-scale instability physics.Efforts have also been made by employing the gyrokinetic model to study global MHD modes.One of the prior studies developed the particle-in-cell gyrokinetic toroidal code (GTC), coupling a fluid electron description with gyrokinetic ions, reproduced resistive tearing modes [26] and collisionless tearing modes [27], and returned correct eigenmode structures and growth-rate scaling in comparison with MHD computations.Self-consistent modeling including kinetic electrons was developed in the continuous δf code GKW, specifically for studying the stability of linear tearing modes in three-dimensional toroidal geometry [28] and to study the seed-island generation and nonlinear interaction of tearing modes and electromagnetic turbulence [1,29].
As already stated, previous gyrokinetic studies of multi-scale interactions in RFP plasmas imposed a constant-in-time external A ∥ as a simple model for a residual tearing fluctuation [4,30].However, tearing-scale instabilities in experiments are internally consistent collective modes driven by a radial gradient in the background current parallel to the mean magnetic field.To better model this situation, a self-consistent description is needed.To this end, Ref. [31] implemented a current-gradient drive as part of the fluctuating distribution function.The implementation, restricted to slab geometry, allowed for a sinusoidal current profile with adjustable magnitude and phase, which are able to drive a (slab) tearing mode.Several aspects of this approach impose limitations: local slab simulations do not allow for a realistic equilibrium, and linear solutions of the gyrokinetic model equations result in slab-specific intermediate-scale modes.As these are not present in the experiment, they interfere with the study of experimentally relevant multi-scale interactions.
To more realistically model tearing modes, a shifted Maxwellian equilibrium distribution is implemented in the global version of the gyrokinetic code Gene [32,33,34,35,36], consistent with a specified safety factor profile.Details related to the implementation of the shifted Maxwellian distribution are presented in this work, including the equilibrium distribution with shifted velocity, its effect on the perturbed distribution and the instability driving terms, and its modification of velocity moments that enter into the calculation of the self-consistent fields.The implementation is then benchmarked against several plasma models, including a reduced fluid model and gyrokinetic codes based on both continuum δf and particle-in-cell full-f approaches.Of particular note is benchmarking with the ORB5 code [37,38], which was also modified to incorporate a shifted Maxwellian equilibrium distribution for current-gradient-driven modes [39,40].In preparation for multi-scale simulations, linear tearing modes in a non-reversed RFP discharge are obtained.Linear initial-value calculations for the fastest-growing mode show that the lowest resonant mode is dominant.At large k y the fluctuations become electrostatic and are identified as ∇n-TEMs [41].The nonlinear evolution of the RFP tearing mode is obtained and studied in detail for the first time in gyrokinetics.These studies provide the basis for carrying out multi-scale interactions of tearing modes with gyroradius-scale turbulence in future work.
The remainder of the paper is organized as follows.Details of the numerical approach as well as the gyrokinetic treatment of the current gradient and its implementation are discussed in Sec. 2. Numerical benchmarking against a variety of published results is elaborated in Sec. 3. Linear and nonlinear tearing mode evolution in the RFP system are studied in Sec. 4, and a summary and discussion are provided in Sec. 5.

Current-Gradient Implementation
The gyrokinetic framework [25] allows for the evaluation of microinstability physics as well as nonlinear interactions between fluctuations across a range of scales.Here, the global version of the gyrokinetic turbulence code Gene [32,33,36], is employed, which has been used with non-Maxwellian background distributions [34,42].Gene solves a Vlasov-Maxwell system of equations with a δf approach, in which the total distribution f is split into the static background distribution F 0 and the perturbed distribution δf , such that f = F 0 + δf , with self-consistent field equations.The gyrokinetic Vlasov equation for each plasma species j is represented by In this equation, L is the linear operator, containing among other terms the instability drive due to profile gradients for small-scale drift-wave instabilities, and N is the electromagnetic version of the E × B nonlinearity that couples different interacting modes.The modifications entailed in the present work will add to L the energy source for large-scale current-driven modes.

Shifted Maxwellian Background Distribution
Global tearing instabilities are driven by the current gradient in the plasma.However, the conventional Gene code assumes a Maxwellian as the background distribution, resulting in zero parallel current density under the first velocity moment.While more recent versions of the code offer non-Maxwellian distributions, e.g., the bi-Maxwellian [34], they still yield a zero current density.To accurately model current-gradientdriven instabilities and replicate experimental observations, a shifted Maxwellian (SM) background distribution is employed to capture the realistic driving mechanism.Specifically, the background distribution for particle species j is expressed as In Eq. ( 2), n 0j (x) and T 0j (x) are the equilibrium density and temperature, m j is the particle mass, B 0 (x) is the equilibrium magnetic field, and v ∥0j (x) is the velocity shift in the parallel direction, normalized to the thermal velocity v Th,j = [2T 0j (x 0 )/m j ] 1/2 at the reference location x 0 of the simulation domain.Although later not explicitly written, this parallel shift is x-dependent.Various terms in the linear operator of the gyrokinetic equation are modified according to the change in the background distribution function.One important term is the radial derivative of the background distribution, contributing to the gradient drive term, Here, ω T j ≡ −L ref ∇ x ln T 0j and ω nj ≡ −L ref ∇ x ln n 0j are the temperature and density gradient scale lengths, respectively.These gradients are the energy source for wellknown, particularly electrostatic, microinstabilities.The parallel velocity and the magnetic moment are denoted, respectively, v ∥ and µ.We note that L ref is a reference length, typically set to be the major radius R 0 for global calculations.The last term, involving the gradient of the shifted velocity, introduces the new driving force into the system, i.e., the current-gradient drive, as ∇v ∥0 ∝ ∇J ∥0 .

Modifications to the Field Equations
The perturbed electrostatic potential ϕ 1 (x) can be evaluated using the Poisson equation Gaussian units are used, and all quantities are later normalized according to the Gene convention, with further details provided in Ref. [35].The perturbed density n 1,j (x) is expressed in terms of the zeroth moment M 00,j (x) of the distribution with respect to v ∥ and µ.In gyrokinetics, the particle coordinates x can be decomposed into the gyration center X and the radial displacement r from the gyration center in the perpendicular plane, such that x = X + r.By employing the appropriate moments described in Refs.[34,35,42], and neglecting parallel magnetic field fluctuations, the Poisson equation can be written as ⟨...⟩ and overbars represent the gyroaverages defined as φ1 = ⟨ϕ 1 (x)⟩ = G[ϕ 1 (x)] = ϕ 1 (X + r(θ))dθ/2π, with the gyroradius vector r(θ) orthogonal to the magnetic field, and gyroangle θ, ⟨ φ1 (x − r)⟩ is the double gyroaverage of ϕ 1 defined as dθ dXδ(X + r(θ)−x) dθ ′ ϕ 1 (X+r(θ ′ ))dθ ′ /4π 2 , which in the global version is written as G † ϕ 1 (x−r)G, as seen in some expressions later in the paper.This double gyroaverage arises from integration of the velocity moment M 00,j , which contains another gyroaverage of the perturbed distribution function [35].The same applies to the electromagnetic vector potential A 1,∥ terms.Under the Coulomb gauge and in the absence of an equilibrium electric field, the parallel vector potential is calculated from Ampère's law and given by This expression can be similarly written in terms of the shifted Maxwellian, yielding Combining Poisson's equation and Ampère's law results in coupled field equations, which can be written in matrix form as The potentials are solved by inverting the matrix [C i ], where )dv ∥ dµ, and The diagonal elements of the gyroaverage matrix are written as 1, while T 0 = T 0 (x 0 ) and n 0 = n 0 (x 0 ) are the temperature and density at the reference position x 0 .The modified field equations couple the electrostatic and electromagnetic potentials, in contrast to the conventional equations derived from the Maxwellian distribution function, where the two are decoupled.This coupling allows for the consideration of the influence of a magnetic perturbation on the electrostatic field, as expected in self-consistent calculations of tearing modes [43,44].The re-derivation of velocity moments related to observable quantities, such as electromagnetic heat and particle fluxes, is also incorporated into the code to account for the modified transport caused by tearing instabilities.

Parallel Current Profile
The shifted Maxwellian distribution function requires as input the velocity shift profile v ∥0 (x), which can be evaluated from the equilibrium parallel current density based on the equation of the first velocity moment of the shifted Maxwellian In the common scenario of a two-component-plasma current, ions and electrons tend to flow in opposite directions in response to an applied parallel electric field such that v ∥0,i = v ∥0,i b and v ∥0,e = v ∥0,e (− b), with b the direction of the magnetic field.We assume that the flow velocities are on the order of the species' thermal velocities, with normalization v ∥0,j = v∥0 v Th,j , where v∥0 a dimensionless quantity assigned to be equal for electrons and ions.This is equivalent to writing In small-mass-ratio scenarios, the ion flow can be much smaller than the electron flow, but if not explicitly stated otherwise, all simulations performed in Gene employ the velocity-shift contribution from both species.Hence, the total current density can be written as Taking q i = e, q e = −e, invoking the quasi-neutrality condition n 0e = n 0i = n 0 (x), the magnitude of total current density is written as and thus the velocity shift reads The current can also be extracted from the equilibrium profile of the safety factor q, as the q-profile contains information about the toroidal and poloidal magnetic fields.
To enable benchmarks for established tearing mode behavior in tokamak geometry, we develop expressions relating q to the current that is appropriate for a large-aspectratio tokamak.Later, when the RFP is considered, we will directly use experimentally relevant current profiles generated from the equilibrium solver MSTfit.For a largeaspect-ratio circular cross-section, the q-profile can be written in terms of the cylindrical approximation as where B φ (r) and B θ (r) are toroidal and poloidal magnetic fields, respectively, and r denotes the radial coordinate, which from this point can be used interchangeably with x.Starting with Ampère's law (4π/c)J = ∇ × B, the cylindrical approximation with B θ ≪ B φ ∼ B 0 yields a parallel current density given by The prefactor cB 0 /(4πR 0 ) is equivalent to the current density J ∥0 at the axis.Equating this expression to Eq. ( 12), the velocity shift can be written as In terms of normalized parameters, the dimensionless velocity shift is equivalently given by v∥0 where β e = 8πn 0e T 0e /B 2 0 , ρ * i = ρ i /a, ε a = a/R 0 , and n0 (r) = n 0 (r)/n 0 (r 0 ), with r 0 the reference position in the simulation domain.Also note that the electron skin depth δ e can be written directly as and that this form relates to the strength of velocity shift as shown in Eq. ( 16).The electron skin depth is related to the singular layer width for collisionless tearing modes, allowing the determination of tearing mode behavior and stability regimes [44,45].

Benchmarking of the Current-Gradient Drive
The implementation of a shifted Maxwellian based on a velocity shift in the Vlasov-Maxwellian system of equations represents a significant modification to Gene, enabling self-consistent global simulations of current-driven instabilities.Before deploying this upgraded code to study linear tearing instability, nonlinear tearing evolution, and Equilibrium ORB5 GKW Two-Fluid Hornsby et al. [28,29] Ishizawa et al. [46] q(xa)  1. Analytic forms of equilibrium profiles and parameters used for benchmarks in this work.Note that x a = x/a is the normalized radius.q, T eq , n eq , β e , ρ i , a, R 0 , m e , and m i are safety factor, equilibrium temperature, equilibrium density, plasma beta, ion gyroradius, device minor radius, major radius, electron mass, and ion mass, respectively.Note for the safety factor profile in the ORB5 case, q(x a ) = 8 i=0 c i x i a , with coefficients c i =(1.4950, −0.0052, 0.7969, −1.2433, 6.0576, −14.4208, 20.4868, −15.1526, 4.8045).The bottom half panel displays the boundary constraints [47] and hyperdiffusivities [48] set in Gene.x min a and x max a are the left and the right ends of the simulation domain, respectively, buffer refers to the size of the left and right buffer zones, measured in minor radius a, and D x , D z , and D v are the hyperdiffusivities applied to the x, z, and v ∥ discretization, respectively.later multi-scale interactions in the RFP, it is important to test the fidelity of the implementation against different computational models.The analytic forms of the equilibrium profiles and other input parameters, for which tearing modes are unstable, are listed in Table 1.

Comparisons with ORB5
Linear global tearing modes simulated in the Gene code are compared with the results obtained from the gyrokinetic PIC code ORB5.Prior to this investigation, both codes have demonstrated successful benchmarking for scenarios involving global ion temperature gradient (ITG) and kinetic ballooning modes (KBMs) [33], geodesic acoustic modes (GAMs) [49], energetic-particle-driven GAMs (EGAMs) [42], and toroidal Alfvén eigenmodes (TAEs) [50] which later was extended to the Alfvén-ITG system [54].Notably, a recent extension of the ORB5 code incorporates the currentgradient drive [39], similar to the capabilities of Gene presented here.Consequently, this benchmarking exercise presents the first simulations of linear tearing modes using the ORB5 code.
The equilibrium safety factor q(x a ), where x a = x/a and a is a minor radius, for this test is an 8th-order polynomial which is unstable to an m/n = 2/1 tearing mode, where m and n are the poloidal and toroidal mode numbers, respectively.The polynomial coefficients c i are given in Table 1, and the corresponding profiles are shown in Fig. 1, including the velocity shift profile calculated under the cylindrical approximation, see Eq. ( 16).While simulations in Gene include velocity shifts for electrons and ions, ORB5 considers only the contribution from electrons; this, however, results in only minute differences, less than the convergence threshold for either code.The background temperature and density are assumed to be radially constant to avoid pressure-gradient-driven modes and diamagnetic effects.A small-inverse-aspect-ratio concentric circular geometry is used, making the cylindrical approximation justifiable and minimizing curvature effects.This makes comparison of the numerical growth rates with theoretical scalings of slab current sheets possible [44,45].For simplicity, the standard case sets collisionality ν ei to zero, resulting in a collisionless tearing mode.A list of other plasma parameters is given in Table 1.For n = 1, corresponding to k y ρ s = 0.034, Gene produces a tearing mode with growth rate γ Gene = 0.045 c s /R 0 = 4.5 × 10 −5 Ω ci , where c s = T 0e /m i is ion acoustic speed, and Ω ci = (c s /R 0 )/(ε a ρ * i ) is the ion cyclotron frequency.ORB5 gives γ ORB5 = 4.9 × 10 −5 Ω ci , in good agreement with Gene.The growth rates are very small compared to the cyclotron frequency, and are roughly an order of magnitude lower than those of ion-scale instabilities, correctly reflecting the characteristic time scale of tearingmode fluctuations.The radial ϕ and A ∥ eigenmode structures from Gene are shown in the middle panel of Fig. 1 and trace with those of ORB5.Discontinuities across the rational surface q = 2 of ϕ and A ∥ showing ∆ ′ > 0 are well-known indications of an unstable tearing mode.
In MHD, tearing modes are destabilized by resistivity [28,43,44,45].Here, the collision frequency, which relates to resistivity in MHD, is varied, and the response of the tearing mode is recorded.Collisionality in Gene for this paper, except where stated otherwise, is modeled by a Landau collision operator to reduce the computational cost; other collision operators produce comparable growth rates but with higher computational expense.The normalized collision frequency used in Gene is defined as where constituting quantities are given in Gaussian units.ln Λ is the Coulomb logarithm, which can be expressed as 24 − ln √ 10 13 n ref /(10 −3 T ref ) , with the reference value of background density n ref in units of 10 19 m −3 and temperature T ref in units of keV, and L ref is the reference length in meters.The electron-ion collision frequency can be written in units of c s /R 0 as with the ion charge number Z and sound speed c s = T 0e /m i , and m i and m e are ion and electron mass, respectively.ν ei , hence, has the same unit as growth rate.The growth rate of the tearing mode as a function of collisionality is plotted in Fig. 2. Two collisionalality regimes are evident, a collisionless and a semi-collisional regime.In the limit of collisionless tearing, growth rates approach a constant when ν ei ≪ γ, while in the semi-collisional regime ν ei ∼ γ, growth rates approach a scaling of γ ∝ ν 1/3 ei [44,45].Simulations at higher collision frequencies were also attempted to see if the collisional regime could be reached; however, numerical instability prevented further study of this  regime.This scaling behavior confirms that the instability reproduced by the modified Gene is indeed a tearing mode.
To assess the agreement between Gene and ORB5 across varying plasma parameters and to investigate the scaling behavior of tearing modes in accordance with theoretical predictions, systematic scans of mass ratios at different β e are conducted using the initial setup, focusing on the standard collisionless case.Fig. 3 presents the tearing-mode growth rates at different mass ratios, compared with the corresponding computations from ORB5.Not only do the growth rates obtained from the two codes exhibit good agreement, but they also exhibit consistent scaling with the theoretical prediction γ ∝ m e /m i [44].Additionally, a β scan is performed and compared with the results from ORB5 as depicted in Fig. 4, which shows that growth rates follow each other and fall into correct theoretical scaling γ ∝ 1/β e [44].Also confirmed by this figure is the fact that Gene is capable of reproducing the expected β-scaling in the semi-collisional limit.

Comparison with GKW
Simulations of tearing modes are conducted to compare the results with published findings from another gyrokinetic code, GKW [51].Similar to Gene, GKW is a global gyrokinetic code that uses a δf -approach capable of computing current-gradientdriven instabilities [5].Previous studies employing GKW have examined the linear and nonlinear evolution of global-scale tearing modes in tokamak systems using a shifted-Maxwellian distribution function [1,28,29].Detailed information regarding code implementation can be found in those publications, noting the distinction that the field equations are coupled in Gene but decoupled in GKW.The decoupling arises from a very small magnitude of the velocity shift v ∥0 ≪ 1, causing coefficients C 2 and C 3 in Eq. ( 8) to become negligible.The approximation breaks down when the shifted velocity becomes significant relative to the thermal velocity.The assumption retains its validity within the scope of this benchmark due to the smallness of velocity shift; notwithstanding, a notable velocity gradient, or equivalently current gradient, exists.The successful simulation of tearing-mode evolution in GKW establishes it as a suitable computational tool for comparison with Gene.
The present benchmark is based on the equilibrium and parameters utilized by Hornsby et al. [28,29], as also listed in Table 1.A concentric circular magnetic geometry is adopted, with temperature and density profiles, as shown in the top panel of Fig. 5.It is worth noting that the normalization differs between the two codes, such that ρ * Gene = (ρ * GKW / √ 2)(R/a).Moreover, it is important to highlight that the study by Hornsby et al. solely focuses on an electron current density and does not consider an ion current density.Hence we apply the same convention in Gene for this particular benchmark.
The radial tearing-mode structures obtained from Gene, depicted in the bottom panel of Fig. 5, match those from GKW.These mode structures exhibit a fundamental tearing feature, characterized by abrupt changes in radial mode structures at rational surfaces, i.e., q = 2/1 at x/a = 0.5 and q = 3/1 at x/a = 0.9.The ratio of the peaks of electrostatic to electromagnetic potentials, as determined by Gene, is comparable to the ratio reported in Ref. [29] for GKW.A comparison of growth rates and frequencies at different values of plasma β and pressure gradients, as presented in Table 2, demonstrates good agreement between the two codes.Slight deviations in Cases 4 and 5 can be attributed to small growth rates, as they fall within the range of computational error bars.
The comparison shows that GKW and Gene, though implemented slightly differently, agree on global-tearing growth rates and frequencies, even under the influence of diamagnetic effects, i.e., density and temperature gradients.The growth rate dependence on R/L T also follows the analytical predictions made by Ref. [52] and a [Top] Equilibrium quantities used for the benchmark with GKW [28,29] (case 3 in Table 2).Profiles of safety factor (black solid line), temperature (blue dashdotted), and density (red dotted) are referenced on the left axis, and velocity shift (red dashed) is referenced on the right axis.
[Bottom] The corresponding normalized radial eigenmode structures obtained from Gene in comparison with GKW.
unified theory of internal kink and tearing mode instabilities [53]. Case

Comparison with Fluid Model
A resistive reduced two-fluid model has successfully described tearing modes and has been utilized to investigate the interactions between large-scale tearing modes and smallscale KBM [46].It is useful to compare tearing modes modeled with the gyrokinetic model with those produced by the fluid model.Hence, we adopt the safety factor and pressure profiles employed in Ref. [46] in this benchmark.These equilibrium profiles have been previously demonstrated to generate tearing modes for the investigation of thermal transport in the presence of magnetic fluctuations, as well as island formation and rotation [2].
Table 1 shows the analytical expressions of the safety factor, temperature, and density profiles.The safety factor at the magnetic axis is q 0 = 1.7, and the value at the minor radius is q a = 4.0, as illustrated in the top panel of Fig. 6.The corresponding shifted velocity calculated from Eq. ( 16) is also shown.Notably, the q-profile exhibits resonance of the tearing mode at the q = 2 surface located at x/a = 0.65.[Top] Equilibrium quantities used for the benchmark with a two-fluid model [46].The left axis are profiles of safety factor (black solid), temperature (blue dashdotted), and density (red dotted); on the right axis is the velocity shift (red dashed).
[Bottom] The corresponding normalized radial eigenmode structures of the n = 1 tearing mode The tearing-mode's radial mode structure produced in Gene is shown in the bottom panel of Fig. 6, highlighting the characteristics of the m/n = 2/1 mode and the subdominant structure of the m/n = 3/1 mode.Fig. 7 shows the poloidal crosssection with a 2/1 island feature, closely matching the corresponding result shown in Ref. [46].Fig. 8 shows a collisionality scan that demonstrates destabilization of tearing modes by collsionality.The growth rate of the n = 1 mode scales as the theoretical prediction [44,45].The growth rate spectrum is shown in Fig. 9.Although the growth rate for each toroidal mode number n does not exactly trace the points obtained from the fluid model, they agree within the uncertainty implied by the scatter of the data points of the fluid model.
These benchmarking studies demonstrate that the modified Gene code is able to effectively model global tearing.This modeling capability enables the quantitative, bidirectional, and self-consistent study of multi-scale interactions between tearing modes and microinstabilities.

Tearing Modes in the RFP
Verification of the modified global Gene code against various computational models, as demonstrated in the preceding section, indicates the capability to accurately reproduce linear tearing modes in the RFP.Furthermore, it provides confidence that the code will serve as a valuable tool for investigating the nonlinear evolution of tearing modes, TEMs, and multi-scale interactions within the RFP system.Analysis of multi-scale interactions is a major undertaking and initial efforts will be presented in a separate paper.In this section, simulation of linear tearing modes for an RFP equilibrium will be shown and analyzed, followed by simulation of nonlinear tearing modes and their saturation.
RFPs are characterized by toroidal (B φ ) and poloidal (B θ ) magnetic-field components that are of comparable magnitude.As a result, the safety factor in RFPs is much lower than unity.Specifically, at the magnetic axis, the safety factor value is typically given by q(r a = 0) ∼ a/(2R).As we move towards the plasma edge, the magnitude of the toroidal magnetic field gradually decreases, in standard RFP discharges eventually reversing its direction.Consequently, q decreases with minor radius and becomes negative at the edge, which is in contrast to tokamaks where q increases toward the edge.Both the toroidal and poloidal magnetic-field components in RFPs vary strongly with minor radius, which leads to significant magnetic shear.Combined with the low value of q, this enables the formation of low-order rational surfaces, making the plasma vulnerable to tearing modes [11].
Previous numerical investigations of RFP plasmas were carried out using the nonlinear single-fluid visco-resistive MHD code DEBS [58].The code successfully modeled linear tearing modes and subsequent nonlinear evolution, agreeing with experimental observations, and enhancing our understanding of critical phenomena such as the dynamo effect, sawtooth oscillations, and nonlinear tearing saturation.Of particular significance is its capacity to include the reversal surface and m = 0 modes in the analysis, which is a significant mediator of the energy cascade [5,60].Another computational tool in the study of RFP tearing phenomena is NIMROD, a nonlinear extended MHD code [59].NIMROD's unique feature lies in its ability to self-consistently account for drift effects and profile relaxation, enabling the investigation of fluctuationinduced transport impacting the plasma equilibrium [61,62].The code accounts for profile evolution and relaxation similar to experiments.In contrast, Gene offers distinct advantages by incorporating drifts, kinetic microturbulence effects, and zonal flows in the computation.This feature enables the study of multi-scale interactions.It is also important to note that Gene is unable to include the reversal surface in its simulation domain, as its coordinate system is not well-defined at this radius.Thus, the present study focuses on a non-reversed discharge, referred to as an F = 0 discharge, where F = B φ (a)/⟨B θ ⟩ is the reversal parameter.We obtained semi-analytical equilibrium profiles of the RFP from the MSTFit reconstruction code [56], which solves the Grad-Shafranov equation using experimental data from the Madison Symmetric Torus (MST), discharge #1130819032.In Fig. 10a, the q-profile is presented, with the reversal surface located at the plasma edge.This F = 0 discharge avoids encountering the reversal surface with q = 0. Unlike reversed discharges, where the turbulent cascade is mediated by m = 0 modes, the specific nonlinear saturation mechanism for tearing modes in F = 0 discharges has not yet been identified.
The total current profile, shown in Fig. 10b, is utilized to calculate the shifted velocity (see Fig. 10e) for the shifted Maxwellian distribution function, as outlined in Eq. (12).To mitigate numerical instability near the edge, we introduce a flattened region in the shifted velocity.This adjustment is expected to have a negligible impact on the linear growth rates and structures of tearing modes.The same adjustment is applied to nonlinear simulations.It is important to note that the edge region displays significant density and temperature gradients, seen in Fig. 10c-d, which can give rise to microinstabilities, particularly the ∇n-driven TEM [4,30].
The nominal plasma parameters are computed at the center of the computational domain, i.e., at r/a = 0.45.The reference β e is found to be 0.69%.The normalized gyroradius ρ * i is calculated to be 1.46 × 10 −2 .Since deuterium was used in the experimental setup of MST, the mass ratio employed in the simulation is m e /m i = 2.73 × 10 −4 .The electron temperature T 0e serves as a reference temperature, while T 0i is set at 40% of T 0e [9].Considering collisions, the simulation incorporates the Landau collision operator with a collision frequency of ν ei = 0.242 c s /R 0 .Various other collision operators were tested and yielded comparable linear growth rates.To maintain numerical stability and prevent fluctuations near the boundaries, a Dirichlet boundary condition with the Krook damping operator is applied to the buffer zones, which occupy 5% of the radial domain on both ends.Heat and particle sources are applied in these zones to prevent the fluctuating quantities from deviating strongly from equilibrium, which can violate the δf approximation.The n = 5 resonant surface is close to the magnetic axis, so the simulation domain is positioned as close as feasible to the axis to mitigate mode suppression by the boundary.Accordingly, the simulation conducted is within the range r/a = [0.005,0.885].The resolution employed in this case involves grid point counts for radial and parallel displacements, and for the parallel velocity and magnetic moment, with values of N x = 512, N z = 16, N v ∥ = 32, and N µ = 16, respectively.
In light of the distinct magnetic geometry of the RFP compared to that of the tokamak, the standard concentric circular magnetic geometry often used in Gene is ill-suited for accurately representing its true geometry.To overcome this constraint, Carmody et al. [30] proposed an alternative circular geometry that accounts for the specific characteristics of RFPs.This modified approach, known as adjusted circular geometry, employs circular flux surface cross sections while incorporating a polynomial fit factor f (r/R 0 ) to precisely capture the spatial variations of the total magnetic field across the radial extent.Specifically, where R 0 and r are the major and minor radii at the axis and of the flux surface, respectively, R = R 0 + r cos θ, while B 0 is the total background magnetic field on the axis, and θ is the poloidal angle.The safety factor at the center of the simulation domain is denoted as q, and q = q 1 − (r/R 0 ) 2 .The polynomial fit f (r/R 0 ) allows consistency for the toroidal field when r approaches the edge of the plasma.The model has been benchmarked and validated in studying microturbulence in the RFP [30], and we modified and implemented this geometry for global simulations.

Linear Analysis
Since the q-profile on the axis has a maximum value slightly above 0.2, this allows the lowest possible resonating (m, n) = (1, 5) tearing mode to occur at q = 0.2.Linear simulations performed with n ≥ 5 are shown in Fig. 11, illustrating the radial structures of the electrostatic potential ϕ and the electromagnetic parallel vector potential A ∥ of the n = 5 and n = 6 modes, along with some of their corresponding higher harmonics.Mode structures extend throughout the radial domain and exhibit well-known characteristics similar to those found in the benchmarking cases, i.e., an abrupt change in ϕ and A ∥ at the rational surfaces.The poloidal cross-section of the electrostatic potential of the n = 5 and n = 6 modes is illustrated in Fig. 12, clearly exhibiting the presence of an m = 1 island, which is indicative of a tearing mode.
Fig. 13 shows the linear spectrum for different values of n.Among these modes, the ones with n = 5 and n = 6 exhibit linear instability, as they are directly driven by gradients in the background current.On the other hand, the mode with n = 7 is marginally stable.Higher-order modes that are not resonant with n = 5 and n = 6, e.g., n = 8, 9, ..., are found to be stable.Linear simulation in Gene allows for a single n value but encompasses all attainable m modes at different rational surfaces.For n = 5, only the m = 1 resonant surface lines withing the simulation domain, while for n = 10, two m modes can be resonance: m = 1, which resonates near r a = 0.74, and m = 2, which coincides with the resonance location of (m, n) = (1, 5), see Fig. 11.
The spectrum in Fig. 13 indicates that the growth rates of the dominant n modes are approximately three orders of magnitude smaller than the Alfvén frequency γ A .This observation reflects the characteristic behavior of tearing modes, which exhibit significantly slower growth than an inverse Alfvén time.Additionally, our analysis reveals that the fundamental mode frequencies fall within the range of frequencies obtained from the MST experiment, specifically around 5-25 kHz [18,57].This correspondence suggests that the tearing modes generated in our simulation are consistent with those observed in the experimental setting.
As n, and correspondingly k y , increases, the growth rates gradually diminish, eventually stabilizing at approximately k y = 0.15.For n ≥ 35, the instabilities exhibit more electrostatic behavior, with |ϕ|/|A ∥ | > 10, with the mode peak localized near the plasma edge.These particular instabilities are identified as ∇n-TEM and will be the subject of comprehensive discussion in a separate publication.Consistent with the benchmark cases, the collisionality scans with n = 5 and n = 6 show destabilization at larger collision frequencies, indicating tearing instability for the RFP equilibrium.Fig. 14 shows the collisionality scan and indicates that there are collisionless and semi-collisional regimes at lower and higher collisionalities, respectively.The mode with n = 5 shows a scaling γ ∝ ν 1/7 ei , while the n = 6 mode scales as γ ∝ ν 1/3 ei in the semi-collisional regime.Eq. (17) shows that both n = 5 and n = 6 modes fall into a large-gyroradius regime in which the ion gyroradius is roughly on the same order as the resistive width characterized by the electron skin depth, ρ i ∼ δ e , and Ref. [45] predicts that a tearing mode in such regime follows a γ ∝ ν 1/7 ei scaling.The behavior of n = 5 mode, with ρ i = 2.4δ e , aligns with this prediction, unlike the n = 6 mode, with ρ i = 2.6δ e , that exhibits a growth rate scaling γ ∝ ν 1/3 ei which matches predictions for the ρ i < δ e regime.The underlying reasons for this counter-intuitive behavior of the n = 6 mode will be left for future work to resolve.
Linear simulations enable the identification and characterization of RFP tearing modes.These simulations offer valuable insights into the behavior of constituent modes and shed light on anticipated outcomes in nonlinear simulations.Notably, unstable tearing modes acquire energy from the background current gradient, thereby enabling their coupling with linearly stable modes.

Nonlinear Tearing Evolution
To compare quantitatively with experiments, nonlinear simulations are required.The nonlinear simulation employs the same resolutions as those used in the converged linear calculations, with the exception of the number of the toroidal modes where n = 0, 6, 12, and 18.The simulation is initiated at t = 0 and eventually reaches a state where fluxes and mode amplitudes are saturated.The ensemble-averaged nonlinear electromagnetic electron heat flux ⟨Q em e ⟩ plotted in the top panel of Fig. 15 does not have a noticeable magnitude until the (exponentially) growing tearing mode becomes visible at approximately t = 1600, as plotted in the bottom panel of Fig. 15.
In the initial phase of the simulation, prior to t=1600, the simulation reveals no significant mode coupling, as indicated by the small heat flux and wandering phase difference of the three modes resonant at the q = 1/6 surface.As indicated by bispectral Figure 13.Linear tearing mode spectrum with respect to toroidal wavenumber.Note that γ A = B 0 / √ 4πn e m i /L s and L s is the magnetic shear length defined as L s = r s /ŝ = (r s /R)(1/q ′ s )) with r s the plasma radius at the rational surface of interest.analysis [57,63], the excitation of one eigenmode through the interaction of other eigenmodes can result in a locked phase difference of zero; instead there is no locking during this early phase, indicating no clear coupling.To elaborate on this phenomenon, we consider the excitation of the electromagnetic vector potential of a tearing mode A ∥ 3,18 arising from the coupling of A  ). Hence, if A ∥, 3,18 is solely excited by the coupling of A ∥ 1,6 and A ∥ 2,12 , the phase difference ∆δ=δ 1,6 +δ 2,12 −δ 3,18 becomes zero.A fluctuation in phase difference can thus be interpreted as indicating weak coupling.The mode coupling strength is governed by fluctuation amplitude.Hence, when the flux is small, there is weak or no mode coupling and a wandering phase difference; when the flux is larger, three modes couple coherently; and when the flux is still larger, many modes are able to interact and scramble the phase difference of any three modes.
As the system progresses to t > 1600, it becomes evident that the phases become locked, with the phase difference close to zero, showing strong mode coupling.Starting at approximately t ≈ 1850, multiple couplings occur simultaneously, causing an oscillation of mode amplitudes and a fluctuation phase difference around zero, while the flux increases.The couplings continue until the simulation reaches saturation around t ≈ 2000 by cascading.
Strong coupling leads to the onset of a cascade, allowing modes in the core to transfer energy to the edge [57], i.e., a broadening of the tearing spectrum.As shown in Fig. 16, the current density fluctuation at t < 1600 illustrates a weak coupling with the presence of only the dominant tearing mode resonating at a rational surface with q = 1/6.When coupling occurs at t ≈ 1600, the cascade begins, and multiple couplings follow at t ≈ 1850, as observed in the middle panel of the second row of Fig. 16.The fastest-growing mode starts to couple more with the linearly stable mode resonating at q = 1/9, as observed in the amplitude of the current density on the surface.In this simulation, this corresponds to mode m = 2, n = 18, as the mode with n = 9 is not present in the simulation.The coupling occurs between mode m = 2 and mode m = 1, with energy being transferred from mode m = 1 to mode m = 2.As the coupling involves a third mode with (m, n) = (1, 12), observed from the rising amplitude of current density at the last panel of the second row of Fig. 16, fluctuations of the heat flux become more irregular.The interaction among all three modes leads to the saturation phase, where the fluctuation reaches a quasi-stationary state.By t = 2080, the tearing modes are fully nonlinearly coupled, resulting in a higher amplitude of mode (m, n) = (1,12).It is important to note that the m = 0 mode does not play a significant role in energy mediation in this particular scenario, unlike the reversed discharges studied in Ref. [5].In the present case, the m = 0 mode is non-resonant and does not exhibit noticeable coupling with other modes in the system.

Conclusions
Tearing-mode fluctuations are significant players in the dynamics of RFP plasmas.It had been established from nonlinear simulations of ∇n-TEM turbulence with the inclusion of an external magnetic field to model tearing modes, that tearing modes erode the microturbulent zonal flows and enhance the nonlinear electrostatic heat flux.Further studies of the interaction of slab ITG instability with a local code utilizing a shifted Maxwellian in the perturbed distribution had also indicated an effect of the tearing modes on the ITG turbulence level.However, these studies did not realistically model global tearing modes, with a lack of curvature effects, and did not account for the equilibrium current.The work described here is a modification of the global gyrokinetic code Gene to include current-gradient-drive terms arising from a shifted Maxwellian in the equilibrium distribution function.Implementation of the shifted Maxwellian distribution in the gyrokinetic equations enables realistic calculations of toroidal tearing mode instability and its nonlinear evolution self-consistently.The implementation includes modifying field equations and higher velocity moments to obtain physical observables under the shifted Maxwellian.
The modified Gene code was benchmarked against different computational models.Comparisons were performed with the gyrokinetic PIC full-f code ORB5, the δf continuum code GKW, a reduced fluid model, and analytic theory.In comparison with the discrete gyrokinetic PIC code ORB5 utilizing gyrokinetic ions and electrons, scans over electron plasma β and mass ratios show agreement between the two codes and consistency with theoretical scaling.A similar comparison was done using the equilibrium from Ref. [29], where simulations of a linear tearing mode calculation using a continuous gyrokinetic code GKW.The growth rates obtained from Gene with different pressure gradients match well with results from GKW. Radial mode structures of the electrostatic and electromagnetic potentials and their peak ratios also match well.When the equilibria from the fluid simulation of Ref. [46] were introduced for further testing, the modified Gene code produced mode structures that are in good agreement with the mode structures of the fluid calculation.The collisionality scaling and growth rate spectrum additionally confirm the characteristics of global tearing modes.This establishes that the modified Gene code captures global tearing-mode dynamics in tokamak equilibria, and can be used to further study current-gradient-driven modes, especially with the presence of microturbulence.
The modified Gene code is also well equipped to study global tearing modes driven by the background current density in the RFP.While there exists a substantial body of research concerning benchmarking of microinstabilities in gyrokinetic codes, as well as MHD-scale instabilities in MHD codes, code-code comparisons using gyrokinetic simulations for MHD-scale modes have remained relatively limited.The present study represents results addressing this gap.The code is utilized to study the linear stability of a non-reversed F = 0 discharge in MST.With the equilibrium modeled by the adjusted circular magnetic geometry of Gene, the simulation found that the most unstable linear tearing modes are n = 5, which is close to the magnetic axis, and n = 6, which is near the middle of the domain.Modes with n = 10 and n = 12 are also unstable.Higher harmonics eventually become stable, consistent with the stabilizing effect of larger k y .Radial mode structures and collisionality scans confirm that the global instability observed in MST geometry is indeed a tearing instability.
A nonlinear tearing mode simulation was also performed, treating the nonlinear interaction of multiples of n = 6 modes.The nonlinear simulation reaches saturation by excitation and coupling of modes at different n numbers, mediated by interaction with the m = 2 mode, instead of the m = 0 mediator commonly seen in simulations of reversed discharges.The mode coupling transfers energy to higher n, consistent with the well-known magnetic energy cascade in the RFP.
The results from nonlinear simulations provide an illustration of how large-scale tearing modes, active in the core, excite tearing modes at outer radii and thus potentially influence the small-scale TEMs near the edge.Namely, through mode coupling mediated by the m = 2 component, low-order-n modes couple and transfer energy to higher-n, stable tearing modes.The coupling and cascading continue through multiple stages, leading to the spreading of energy towards finer-scale tearing modes at higher n, and progressing towards the edge.As a result, this progression leads to the excitation of stable tearing modes near the plasma edge, demonstrating the capability of exerting an influence on the TEM region of MST.
This study of self-consistent linear and nonlinear tearing modes in the RFP lays the foundation for the investigation of multi-scale interactions with microturbulent fluctuations, which will be carried out in future work.Ongoing investigations of multiscale interactions in the RFP, which will be reported separately, will inform both the magnetic turbulence properties of the RFP and interactions of magnetic perturbations with microturbulence in tokamak systems.

Figure 1 .
Figure 1.[Top] Profiles of the safety factor (black solid line, left axis) and the velocity shift (red dashed line, right axis) used for the benchmark with ORB5, with plasma parameters given in Table1.[Middle] The normalized radial eigenmode structures simulated in Gene are presented in comparison with ORB5, showing tearing features at the rational surface.[Bottom] Comparison of the normalized radial gradient of A ∥ between the two codes, showing an abrupt change in the structure of A ∥ , confirming a (m, n) = (1, 2) tearing mode centered at x/a ≈ 0.74.

Figure 2 .
Figure 2. Tearing-mode growth rate as a function of electron-ion collision frequency, computed with Gene.Scaling consistent with theoretical prediction is shown; i.e., no dependence in the collisionless regime and γ ∝ ν 1/3 ei in the semi-collisional regime.

Figure 3 .
Figure 3. Mass ratio scan, simulations from Gene (red squares) and ORB5 (blue circles) at two different vaules of β e = β Gene e

Figure 4 .
Figure 4.  Collisionless β e scans performed with Gene (red squares) and ORB5 (blue circles).The two codes agree with each other and with the theoretical scaling γ ∝ 1/β e .Blue triangles show Gene data in the semi-collisional regime where the same scaling is recovered.

Figure 5 .
Figure 5.[Top] Equilibrium quantities used for the benchmark with GKW[28,29] (case 3 in Table2).Profiles of safety factor (black solid line), temperature (blue dashdotted), and density (red dotted) are referenced on the left axis, and velocity shift (red dashed) is referenced on the right axis.[Bottom] The corresponding normalized radial eigenmode structures obtained from Gene in comparison with GKW.

Figure 6 .
Figure 6.[Top] Equilibrium quantities used for the benchmark with a two-fluid model[46].The left axis are profiles of safety factor (black solid), temperature (blue dashdotted), and density (red dotted); on the right axis is the velocity shift (red dashed).[Bottom]The corresponding normalized radial eigenmode structures of the n = 1 tearing mode

Figure 7 .Figure 8 .
Figure7.A poloidal cross-section of the electrostatic potential of the n = 1, m = 2 tearing mode obtained from Gene for the equilibrium used in the benchmark against the two-fluid model.This poloidal mode structure agrees with the corresponding structure shown in Ref.[46]

Figure 9 .
Figure 9. Growth rate spectrum of tearing mode obtained from Gene (blue circles) and the two-fluid model (red square).

Figure 10 .
Figure 10.Equilibrium profiles of an F = 0 discharge obtained from the MSTFit reconstruction code.The simulation domain is in the yellow area r a = [0.005,0.885] with the center at r a = 0.45.

Figure 11 .
Figure 11.Radial mode structures of linear tearing modes.[Top] Electrostatic potential structures and [bottom] electromagnetic potential structures.The lowestharmonic modes (e.g., n = 5 and n = 6) higher-harmonic modes (e.g., n = 10 and 12 of n = 5, and n = 12 of n = 6) with different m to resonate at the same rational surfaces.Nonlinearly, this allows different n modes to couple.

Figure 14 .
Figure 14.Collisionality scan for the n = 5 tearing modes, showing two collisionality regimes: a collisionless regime where the growth rate asymptotically approaches a constant at very low collisionality, and a semi-collisional regime where the growth rates increase with a scaling of ν 1/7 ei .Semi-collisional regime of n = 6 is also plotted, showing scaling of ν 1/3 ei .A solid square and a solid diamond mark the growth rates of n = 5 and n = 6, respectively, at the collisionality representing MST-RFP, evaluated from given equilibria.

Figure 16 .
Figure 16.[Top] Time history of electromagnetic electron heat flux, and [bottom] radial profiles of fluctuating parallel velocity representing the parallel current density at different time snapshots.At t ≈ 1300, only the strongest growing mode m = 1, n = 6 leads to a significant fluctuation level at the single rational surface.At t ≈ 1900, modes m = 1 and m = 2 start to couple and lead to oscillations of the heat flux.At t ≈ 2080, energy is transferred to m = 1, n = 12, as mediated by the m = 2 mode.Fluctuations are less periodic at this stage as a result of mode couplings.The m = 1, n = 12 mode grows faster with a larger amplitude.Once the modes reach a quasi-stationary state, energy injected by the instability is balanced by dissipation at smaller scales. Table

Table 2 .
Comparison of growth rates and frequencies between GKW and Gene at different plasma βs and gradients.Here, R/L n and R/L T are density and temperature gradient scale lengths, and v Th,i = 2T i /m i