# BORAY: A ray tracing code for various magnetized plasma configurations

## Description

Ray tracing codes are useful to study the electromagnetic wave propagation and absorption in the geometrical optics approximation. In magnetized fusion plasma community, most ray tracing codes assume the plasma density and temperature be functions of the magnetic flux and study waves only inside the last closed flux surface, which are sufficient for the present day tokamak. However, they are difficult to be used for configurations with open magnetic field line plasmas, such as mirror machine and field-reversed-configuration (FRC). We develop a ray tracing code in cylindrical coordinates (r, ϕ, z) to support arbitrary axisymmetric configurations with both closed and open field lines plasmas. For wave propagation, the cold plasma dispersion relation is usually sufficient, and we require the magnetic field B(r, z) and species densities n_s0(r, z) profiles as input. For wave absorption, we require a further temperature T_s0(r, z) profile to solve a hot kinetic plasma dispersion relation. In difference to other ray tracing codes which calculate the imaginary part of wave vector k_{⊥, i} for wave absorption, we calculate the imaginary part of wave frequency w_i, which is shown to be equivalent with the former technique under weak damping approximation. The code can use either numerical or analytical equilibrium. Examples and benchmarks with electron cyclotron wave, lower hybrid wave and ion cyclotron wave for tokamak, spherical tokamak (ST), FRC and mirror machine are shown.