1 Introduction

In order to calculate power and current deposition from RF waves in plasmas, it is necessary to determine the wave characteristics inside the plasma. In a quasi-stationary plasma where the equilibrium varies on a scale that is much larger than the wavelength, it is possible to calculate the wave propagation from antenna or mirror conditions and equilibrium properties using the ray-tracing techniques. This method has been used extensively for calculating lower-hybrid and electron cyclotron wave propagation [1234].

Many ray tracing codes in axisymmetric toroidal plasmas use the toroidal coordinates (R,Z,ϕ) which are attractive because of the simplicity of implementing the equations in this system [5674]. In this work we use the flux coordinates (ρ,θ,ϕ) instead. While the equations in this system require somewhat more complicated metric coefficients, there are several advantages to this choice: first, any equilibrium property that is a flux function, such as the density and temperature - or more generally the distribution function -, depends upon ρ only; second, the periodicity of the coordinate θ allows the use of Fourier series that are particularly useful for accurate interpolation and the calculation of derivatives up to second order; third, this system is used by a variety of codes that are coupled to the ray-tracing solver, such as equilibrium codes (HELENA) and Fokker-Planck solvers (LUKE) [89]. Using the same system in the ray-tracing code saves any coordinates conversions and grid interpolations which introduce numerical errors.

The new ray-tracing code developed here is designed for arbitrary wave frequencies (including the lower hybrid and electron cyclotron frequency ranges), provided the WKB approximation is valid. The structure of the code allows to choose from several dielectric tensor types: cold plasma, "warm" plasma [10], and kinetic plasma in the non-, weakly-, or fully relativistic regime. In addition to ray trajectories, the code calculates waves properties of interest for heating and current drive calculations such as the polarization, energy flow and linear absorption.

Based on a standard 6th order Runge-Kutta differential scheme [11], the ray-tracing code uses a spline-Fourier expansion for equilibrium interpolation, which results in fast yet accurate calculations. The code is distributed as a mexfile1 written in C language. It is benchmarked extensively for various types of waves against both existing codes and analytical models. In Sec.2, the linear wave theory in an infinite uniform medium is presented. Ray-tracing in slowly varying plasma is derived in Sec.3. The curvilinear canonical flux coordinates in an axisymmetric toroidal plasma are introduced in Sec.4. In Sec.5 numerical methods are presented. A conclusion is given in Sec.6. The Appendix includes some properties of the coordinate system (A), explicit expressions for the dispersion relations and some derivatives (B), the cold and hot plasma dielectric tensors (C,D), and the benchmarking results (E).