Skip to main content


Swipe to navigate through the articles of this issue

20-08-2017 | Issue 3/2018 Open Access

Journal of Scientific Computing 3/2018

Field-Aligned Interpolation for Semi-Lagrangian Gyrokinetic Simulations

Journal of Scientific Computing > Issue 3/2018
Guillaume Latu, Michel Mehrenberger, Yaman Güçlü, Maurizio Ottaviani, Eric Sonnendrücker

1 Introduction

In a Tokamak, due to the large confining magnetic field, a fast homogenisation of the different physical quantities occurs along the magnetic field lines; this leads to very smooth and small variations along the field lines, whereas the scale length of the variations is very small (comparable to the gyro-radius) in a perpendicular direction. This should be taken into account for more efficient simulations. It is typically done by using field aligned coordinates in many gyrokinetic codes. However this approach has the drawback of needing a non-conformal correction after one turn, either in the poloidal or the toroidal direction, which yields a break of symmetry on one section of the torus. More importantly, field-aligned coordinates become singular when approaching the separatrix in a divertor configuration, with potentially serious consequences on the robustness of the numerical algorithm that employs them.
A very promising alternative, which is very flexible in regard to the choice of coordinates, has been introduced by Hariri and Ottaviani [1], and an equivalent approach by Stegmeier et al. [2]. The main idea is to compute the derivatives locally along the field lines, getting the needed values for finite differences by interpolation to the intersection points of a field line with the poloidal planes. We are interested here in a thorough numerical investigation of this idea in the context of gyrokinetic simulations using semi-Lagrangian methods. Pioneering in this sense is the recent work by Kwon, Yi, Piao and Kim [3], where “field-aligned interpolation” is employed in a semi-Lagrangian gyrokinetic code for full-f turbulence simulations. Our work complements the above on the numerical analysis side, and it focuses on the following topics: convergence analysis (i.e., stability proof and error estimates), numerical verification against analytical solutions, and benchmarking with the classical (not aligned) algorithm. The reader interested in the physics context can consult the review article [4], and exhaustive information about the semi-Lagrangian method which was introduced in the context of gyrokinetic simulations in [5] and the Gysela code are provided in [6].
In this work we use the so-called ‘backward’ semi-Lagrangian method, which consists of an advection phase, where the characteristic trajectories ending at the grid points are traced back in time from \(t+\Delta t\) to t, and an interpolation phase, where the particle distribution function is interpolated at the origin of these trajectories using the known grid values at time t. By virtue of the method of characteristics, the solution on the grid is therefore known at time \(t+\Delta t\). Moreover, in the Gysela code the motion is split between the poloidal plane and the toroidal direction (and also the parallel velocity, but this will not play any role in this paper). In this context, the idea of taking derivatives along magnetic field lines can be naturally extended to semi-Lagrangian methods by replacing the advection and interpolation in the toroidal (\(\varphi \) coordinate in the torus geometry) direction by an advection and interpolation along magnetic field lines (combining a \(\varphi \) and \(\theta \) motion).

1.1 Model Equations

We are interested in solving the gyrokinetic Vlasov equation
$$\begin{aligned} \left( \frac{\partial }{\partial t} + \mathbf {u}(t,{\mathbf {x}},v_\parallel ,\mu ) \cdot \nabla + a_\parallel (t,{\mathbf {x}},v_\parallel ,\mu ) \frac{\partial }{\partial v_\parallel } \right) f(t,{\mathbf {x}},v_\parallel ,\mu ) = 0, \end{aligned}$$
where \(f\in {\mathbb {R}}^+\) is the gyro-center distribution function of a collection of identical particles having charge \(q\ne 0\) and mass \(m>0\), immersed in a static magnetic field \(\mathbf {B}({\mathbf {x}})\). f is a function of time \(t\in {\mathbb {R}}^+\) and of the phase-space coordinates \(({\mathbf {x}},v_\parallel ,\mu )\) of the gyro-center: position \({\mathbf {x}}\in \varOmega \subseteq {\mathbb {R}}^3\), parallel velocity \(v_\parallel \in {\mathbb {R}}\), and modified magnetic moment \(\mu \approx mv_\perp ^2/(2B)\in {\mathbb {R}}^+\), which is an exact invariant of motion. Here \(v_\perp \) is the component of the particle velocity in the plane perpendicular to \(\mathbf {B}\), and \(B=\Vert \mathbf {B}\Vert \) is the magnetic field intensity.
In a semi-Lagrangian method we use the fact that the exact solution to (1.1) is constant along the phase-space characteristics \(\left( \mathbf {X}(t),V_\parallel (t),M(t)\right) \), namely
$$\begin{aligned} \frac{d}{dt} f(t,\mathbf {X}(t),V_\parallel (t),M(t)) = 0 \qquad \text {with} {\left\{ \begin{array}{ll} \dfrac{d\mathbf {X}}{dt} = \phantom {\parallel }\mathbf {u}(t,\mathbf {X},V_\parallel ,M), \\ \dfrac{dV_\parallel }{dt} = a_\parallel (t,\mathbf {X},V_\parallel ,M), \\ \dfrac{dM}{dt} = \phantom {\parallel } 0. \end{array}\right. } \end{aligned}$$
The fields \(\mathbf {u}\) and \(a_\parallel \), and therefore the characteristic trajectories in (1.2), are completely defined by the modified magnetic field \({\mathbf {B}}^{*}({\mathbf {x}},v_\parallel ) = {\mathbf {B}}({\mathbf {x}}) + (m/q) v_\Vert \nabla \times \mathbf {b}({\mathbf {x}})\), where \(\mathbf {b} = {\mathbf {B}}/B\), and by the gyro-center Hamiltonian \(H(t,{\mathbf {x}},v_\parallel ,\mu )\). Then, defining \(B_{\Vert }^{*}= \mathbf {b}\cdot {\mathbf {B}}^{*}= B + mv_\Vert /(qB) \mathbf {b}\cdot \nabla \times {\mathbf {B}}\), we have (see for example [7])
$$\begin{aligned} \mathbf {u}(t,{\mathbf {x}},v_\parallel ,\mu )&= \frac{1}{B_{\Vert }^{*}} \left( \frac{1}{m} \frac{\partial H}{\partial v_\Vert } {\mathbf {B}}^{*}+ \frac{1}{q} \mathbf {b}\times \nabla H \right) , \end{aligned}$$
$$\begin{aligned} a_\parallel (t,{\mathbf {x}},v_\parallel ,\mu )&= \frac{1}{B_{\Vert }^{*}} \left( -\frac{1}{m} {\mathbf {B}}^{*}\cdot \nabla H \right) . \end{aligned}$$
We now neglect \(\mu \) and focus on the reduced phase-space \(({\mathbf {x}},v_\parallel )\), where we define the phase-space velocity \(\xi =(\mathbf {u},a_\parallel )\). The phase-space divergence of this field is
$$\begin{aligned} \text {div}(\xi ) = \frac{1}{B_{\Vert }^{*}} \left[ \nabla \cdot \left( B_{\Vert }^{*}\mathbf {u} \right) + \frac{\partial }{\partial v_\parallel } \left( B_{\Vert }^{*}a_\parallel \right) \right] , \end{aligned}$$
where \(B_{\Vert }^{*}({\mathbf {x}},v_\parallel )\) is present because \(B_{\Vert }^{*}/m\) is the Jacobian determinant of the coordinate transformation that was used to obtain the gyrokinetic Vlasov equation. It is straightforward to see that
$$\begin{aligned} \left\{ \begin{aligned}&\nabla \cdot \left( B_{\Vert }^{*}\mathbf {u}\right) = \phantom {+}\frac{1}{m} {\mathbf {B}}^{*}\cdot \nabla \left( \frac{\partial H}{\partial v_\parallel } \right) + \frac{1}{q} \left( \nabla \times {\mathbf {b}}\right) \cdot \nabla H \\&\frac{\partial }{\partial v_\parallel } \left( B_{\Vert }^{*}a_\parallel \right) = -\frac{1}{m} {\mathbf {B}}^{*}\cdot \nabla \left( \frac{\partial H}{\partial v_\parallel } \right) - \frac{1}{q} \left( \nabla \times {\mathbf {b}}\right) \cdot \nabla H \\ \end{aligned} \right. \qquad \text {and therefore:} \qquad \text {div}(\xi )=0. \end{aligned}$$
Since the phase-space velocity field is incompressible (i.e., divergence-free), an equivalent formulation of (1.1) is the conservation equation
$$\begin{aligned} \frac{\partial }{\partial t}\left( B_{\Vert }^{*}f\right) + \nabla \cdot \left( \mathbf {u} B_{\Vert }^{*}f \right) + \frac{\partial }{\partial v_\parallel }\left( a_\parallel B_{\Vert }^{*}f \right) =0. \end{aligned}$$
In the electrostatic case the gyro-center Hamiltonian reads
$$\begin{aligned} H(t,{\mathbf {x}},v_\parallel ,\mu ) = \frac{1}{2} mv_\Vert ^2 + \mu B({\mathbf {x}}) + q\langle \phi \rangle _\alpha (t,{\mathbf {x}}), \end{aligned}$$
where \(\phi (t,{\mathbf {x}})\) is the electrostatic potential, and \(\langle \cdot \rangle _\alpha \) is the gyro-average operator. (In the zero-Larmor-radius limit, we simply have that \(\langle \phi \rangle _\alpha =\phi \).)
In general one should solve one gyrokinetic Vlasov equation for each particle species, and couple these to a Poisson equation for the self-consistent \(\phi \). For simplicity, in this paper we model only one ion species kinetically, we assume an adiabatic response of the electrons, and we make use of the quasi-neutrality approximation [6]. Under these hypotheses the electrostatic potential \(\phi (t,{\mathbf {x}})\) satisfies a non-linear integro-differential equation, which is linearized around a given equilibrium to obtain
$$\begin{aligned} -\left( \nabla _\perp \cdot \frac{\rho _{th,i}^2}{\lambda _{D,i}^2}\nabla _\perp \right) \phi + \frac{1}{\lambda _{D,e}^2}\left( \phi - \langle \phi \rangle _f \right) = \frac{q_i}{\epsilon _0} \left( n_i - n_0 \right) , \end{aligned}$$
where \(\nabla _\perp = \nabla - {\mathbf {b}}({\mathbf {b}}\cdot \nabla )\) is the perpendicular gradient operator, \(\langle \cdot \rangle _f\) represents an averaging operator over the whole magnetic flux surface passing through \({\mathbf {x}}\), \(\rho _{th,i}({\mathbf {x}})\) is the thermal ion Larmor radius, and \(\lambda _{D,i}({\mathbf {x}})\) and \(\lambda _{D,e}({\mathbf {x}})\) are the Debye lengths for ions and electrons respectively. On the right-hand-side, \(q_i\) is the charge of an ion particle, \(\epsilon _0\) is the vacuum permittivity and \(n_i(t,{\mathbf {x}})\) is the instantaneous ion number density, while \(n_0({\mathbf {x}})\) is the ion density at equilibrium. \(n_i(t,{\mathbf {x}})\) is obtained from \(f(t,{\mathbf {x}},v_\parallel ,\mu )\) as
$$\begin{aligned} n_i(t,{\mathbf {x}}) = \frac{1}{m_i} \int f(t,{\mathbf {x}}',v_\parallel ,\mu )\, \delta ({\mathbf {x}}'+{\varvec{\rho }}-{\mathbf {x}})\, B_{\Vert }^{*}({\mathbf {x}}',v_\parallel )\, d{\mathbf {x}}' dv_\parallel d\mu \, d\alpha , \end{aligned}$$
where \(\alpha \) is the gyro-phase angle and \({\varvec{\rho }}({\mathbf {x}}',\mu ,\alpha )\) is the gyro-radius vector. \(n_0({\mathbf {x}})\) can be similarly obtained from the equilibrium distribution \(f_\text {eq}({\mathbf {x}},v_\parallel ,\mu )\). The non-dimensional coefficient on the left-hand side of (1.5) may be reformulated as \(\rho _{th,i}^2/\lambda _{D,i}^2 = n_0 m_i / \epsilon _0 B^2 = \mathcal {E}_0/2\mathcal {E}_B\), that is, half the ratio between the rest energy density \(\mathcal {E}_0({\mathbf {x}})= n_0({\mathbf {x}})m_i c^2\) and the magnetic energy density \(\mathcal {E}_B({\mathbf {x}})= B({\mathbf {x}})^2/2\mu _0\) (here \(m_i\) is the mass of an ion particle, c is the speed of light in vacuum and \(\mu _0\) is the vacuum permeability).
We refrain from giving more details on the equations here; the interested reader may refer for example to [4] and references therein. In fact, since our focus is on assessing the field-aligned interpolation method, and not on incorporating all components needed for a realistic turbulence simulation, the equations presented in this section will be further simplified for implementation in the Selalib and Gysela codes (Sects.  4 and 5).

1.2 Magnetic Configurations

For our numerical simulations in Gysela (see Sect. 5), we will consider a circular magnetic equilibrium in a torus as defined in [6], with magnetic field
$$\begin{aligned} {\mathbf {B}}= \frac{B_0R_0}{R} \left( \zeta (r) \hat{{\varvec{\theta }}} +\hat{{\varvec{\varphi }}} \right) , \quad \zeta (r) = \frac{r}{q(r)R_0}, \end{aligned}$$
where \(R_0\) and \(B_0\) are respectively the major radius and the toroidal magnetic field at the magnetic axis, \(R(r,\theta )=R_0+r \cos \theta \), and q(r) is the classical safety factor in the large aspect ratio limit (\(r/R_0\rightarrow 0\)). The unit vectors \((\hat{\mathbf {r}},\hat{{\varvec{\theta }}},\hat{{\varvec{\varphi }}})\) form an orthogonal basis of \({\mathbb {R}}^3\) as long as \(R>0\). We notice that the magnetic field (1.7) depends on r and \(\theta \) through R, but not on \(\varphi \). In order to verify that \(\nabla \cdot \mathbf {B}=0\), we recall that the divergence of a vector \(\mathbf {a}=a_r\hat{\mathbf {r}}+a_\theta {\hat{\varvec{\theta }}}+a_\varphi \hat{\varvec{\varphi }}\) in toroidal components reads
$$\begin{aligned} \nabla \cdot \mathbf {a} = \frac{1}{rR} \left[ \frac{\partial }{\partial r} \left( rR\, a_r \right) + \frac{\partial }{\partial \theta } \left( R a_\theta \right) + r \frac{\partial a_\varphi }{\partial \varphi } \right] , \end{aligned}$$
and we observe that the magnetic field in (1.7) has \(B_r=0\), \(\partial _\theta (RB_\theta )=0\) and \(\partial _\varphi B_\varphi =0\). With regard to the unit vector \({\mathbf {b}}\), we have \(b_r=0\), \(b_\varphi ={{\mathrm{sgn}}}(B_0)/\sqrt{1+\zeta ^2}\) and \(b_\theta =\zeta b_\varphi \), so that \(\nabla \cdot {\mathbf {b}} = -(b_\theta \sin \theta )/R \ne 0\). The magnetic field lines, parametrized by \((r,\theta ,\varphi )\), are defined by the equations
$$\begin{aligned} \frac{\mathrm{d}r}{\mathrm{d}s} = B_r = 0, \quad r\frac{\mathrm{d}\theta }{\mathrm{d}s} = B_\theta = \frac{B_0R_0}{R} \zeta (r), \quad R\frac{\mathrm{d}\varphi }{\mathrm{d}s} = B_\varphi = \frac{B_0R_0}{R}. \end{aligned}$$
From this it follows that
$$\begin{aligned} \frac{\mathrm{d}\theta }{\mathrm{d}s} = R \frac{\zeta (r)}{r} \frac{\mathrm{d}\varphi }{\mathrm{d}s} = \frac{1+(r/R_0)\cos \theta }{q(r)} \frac{\mathrm{d}\varphi }{\mathrm{d}s}, \end{aligned}$$
and so in tokamaks with a medium/large aspect ratio (i.e., with small \(r/R_0\)). The magnetic field lines are close to straight lines in the \((\theta ,\varphi )\) plane for a given r.
For our numerical simulations in Selalib (see Sect. 4) we shall consider the simplified case of a straight periodic cylinder, which amounts to taking \(R=R_0\) in (1.7), and replacing the toroidal angular variable \(\varphi \) by a straight variable \(z=R_0\varphi \). Then
$$\begin{aligned} {\mathbf {B}}= B_0\left( \zeta (r)\hat{{\varvec{\theta }}}+\hat{\mathbf {z}}\right) , \quad \zeta (r) = \frac{\iota (r) r}{R_0}. \end{aligned}$$
We see that the magnetic field is characterized by its central axial component \(B_0\), the major radius \(R_0\) and the rotational transform iota, which satisfies
$$\begin{aligned} \iota (r)=\frac{b_\theta /r}{b_z/R_0}=\frac{1}{q(r)}. \end{aligned}$$
In order to verify that \(\nabla \cdot \mathbf {B}=0\), we recall that the divergence of a vector \(\mathbf {a}=a_r\hat{\mathbf {r}}+a_\theta {\hat{\varvec{\theta }}}+a_z\hat{\mathbf {z}}\) in cylindrical components reads
$$\begin{aligned} \nabla \cdot \mathbf {a} = \frac{1}{r} \frac{\partial }{\partial r} (r a_r) + \frac{1}{r} \frac{\partial a_\theta }{\partial \theta } + \frac{\partial a_z}{\partial z}, \end{aligned}$$
and we observe that the magnetic field in (1.9) has \(B_r=0\), \(\partial _\theta B_\theta =0\) and \(\partial _z B_z=0\). In a similar fashion we also notice that \(\nabla \cdot {\mathbf {b}}=0\) in this case. The magnetic field lines, parametrized by \((r,\theta ,z)\), are defined by the equations
$$\begin{aligned} \frac{\mathrm{d}r}{\mathrm{d}s} = 0, ~~~ r\frac{\mathrm{d}\theta }{\mathrm{d}s} = B_\theta = B_0\zeta (r), ~~~~ \frac{\mathrm{d}z}{\mathrm{d}s} = B_z = B_0, \end{aligned}$$
so that
$$\begin{aligned} \frac{\mathrm{d}\theta }{\mathrm{d}s} = \frac{\zeta (r)}{r} \frac{\mathrm{d}z}{\mathrm{d}s} = \frac{\iota (r)}{R_0} \frac{\mathrm{d}z}{\mathrm{d}s}. \end{aligned}$$
Therefore the magnetic field lines are straight oblique lines in the \((\theta ,z)\) plane for each given r.

1.3 Overview

The remainder of the paper is structured as follows. Section 2 describes the numerical algorithms that are employed for performing interpolation and differentiation in a ‘field-aligned’ fashion. Section 3 details the field-aligned semi-Lagrangian scheme in the simplified setting of the constant advection equation in 2D, and provides a rigorous proof of unconditional stability, together with an extensive error analysis. Section 4 presents a simplified gyrokinetic model in cylindrical geometry (screw pinch), which is implemented in Selalib (semi-Lagrangian library) and verified against an analytical solution. Section 5 presents a gyrokinetic model in toroidal geometry (circular Tokamak), which is implemented in the Gysela code and benchmarked against a standard (not aligned) version of the same code. Finally, Sect. 6 gives our conclusions and an outlook on possible future investigations.

2 Description of the Numerical Tools

2.1 Numerical Scheme for 2D Field-aligned Interpolation

To describe the 2D field-aligned interpolation method, we consider a magnetic flux surface at \(r=r_0\), parametrized by the angular coordinates \((\theta ,\varphi )\in [0,2\pi ]\times [0,2\pi ]\). This setting is natural in toroidal geometry, and it also applies to a periodic cylinder by introducing the straight coordinate \({z=R_0\varphi }\) and considering straight magnetic field lines in the \((\theta ,z)\) plane. Our goal is to interpolate a sufficiently regular function \({g(\theta ,\varphi )}\), \(2\pi \)-periodic in both coordinates, at an arbitrary location \((\theta ^\star ,\varphi ^\star )\). We assume that that the values \({g(\theta _i,\varphi _j)}\) are known on the uniform 2D grid \((\theta _i,\varphi _j)=(i\,\Delta {}\theta ,j\,\Delta {}\varphi )\) with \(\Delta {}\theta =2\pi /N_\theta \), \(\Delta {}\varphi =2\pi /N_\varphi \) and \((i,j)\in [0\cdots N_\theta -1]\times {}[0\cdots N_\varphi -1]\). By periodicity we can extend this to \((i,j)\in {\mathbb {Z}}^2\). There exists a unique index \(j^\star \in {\mathbb {Z}}\) and \(0 \le \beta < \Delta \varphi \) such that
$$\begin{aligned} \varphi ^\star =\varphi _{j^\star }+\beta \ . \end{aligned}$$
We then define
$$\begin{aligned} \varphi _{j^\star +k}=\varphi _{j^\star }+k\,\Delta {}\varphi , \ \ k=r,\ldots ,s\ . \end{aligned}$$
We will use information stored in the 1D slices \(g(\theta =*,\varphi =\varphi _{j^\star +k})_{k=r,\ldots ,s}\) to perform the aligned interpolation at \((\theta ^\star ,\varphi ^\star )\). Let us define a function \({fieldline}_{\theta }(\theta ,\varphi ,j)\) that gives a \(\theta \)-value that corresponds to the intersection of the field line (or an approximation of the field line) that passes by the point \((\theta ,\varphi )\) and the line \((\theta =*,\varphi _j)\). This function is the cornerstone of the method, as it provides a way to interpolate using values that are close to each other, because the locations of these values are aligned to the physical structures. The \({fieldline}_{\theta }\) function is chosen such as all interpolated points \(h_k\) are aligned on a single field line.
The first stage of the method is to compute \({u}_{\theta ^\star ,\varphi ^\star }(k)_{k=r,\ldots ,s}\) by interpolating g at positions \(({fieldline}_{\theta }(\theta ^\star ,\varphi ^\star ,j^\star +k),\varphi _{j^\star +k})_{k=r,\ldots ,s}\). We currently employ cubic splines to interpolate along the \(\theta \) direction on the 1D slices \(g(\theta =*,\varphi =\varphi _{j^\star +k})_{k=r,\ldots ,s}\). The formula for \({fieldline}_{\theta }\) that we have been using so far is the linear approximation
$$\begin{aligned} {fieldline}_{\theta }(\theta ^\star ,\varphi ^\star ,j^\star +k) = \theta ^{\star } + \iota (r_0)\,(\varphi _{j^\star +k}-\varphi ^{\star })\ , \end{aligned}$$
which is the equation of a straight line. This expression is exact in the case of the screw-pinch described in Sect. 4, and it is a good approximation in the case of the circular Tokamak we consider in Sect. 5 (because of its medium-large aspect-ratio). Should this assumption not be fulfilled, one can take a more accurate description for the field line. The \({fieldline}_{\theta }\) function can be easily changed in the code: it is effectively a parameter of the method. The impact on the simulation would be a small additional cost compared to the very cheap linear approximation, along with an improvement in the accuracy of the method.
The second stage of the method consists in interpolating \(g(\theta ^\star ,\varphi ^\star )\) using the values aligned on the parallel direction we just get: \({u}_{\theta ^\star ,\varphi ^\star }(k)_{k=r,\ldots ,s}\). To achieve this, we use Lagrange polynomials of degree \(2d+1\) LAG(2d+1) and take \(r=-d, s=d+1\). The pseudo-code implementation of the scheme is presented in Algorithm 1, and an illustration is given in Fig. 1.

2.2 Field-aligned Computation of Derivatives

In the Gysela code (Sect. 5) we need to evaluate \(\varphi \) derivatives of the electric potential \(\phi (r,\theta ,\varphi )\) to compute the non-linear terms appearing in the advection equations, but also in the diagnostics that compute a set of macroscopic physical variables. In order to do so with a reduced number of points in the \(\varphi \) direction (authorized by the aligned interpolation approach), a scheme should be designed to get an accurate approximation of these derivatives. We have evaluated two alternatives to estimate \({\partial \phi /\partial \varphi }\): the first one relies on separately computing the polar derivative \(\partial \phi /\partial \theta \) and the parallel derivative \(\mathbf {b}\cdot \nabla \phi \), and then using the formula \(\partial \phi /\partial \varphi = \bigl [ \mathbf {b}\cdot \nabla \phi - (b_\theta /r) \partial \phi /\partial \theta \bigr ] R/b_\varphi \); the second one performs a field-aligned interpolation similar to Algorithm 1 to compute two accurate values of \({\phi (r,\theta ,\varphi \pm \epsilon )}\), and then employs the finite difference formula \(\partial \phi /\partial \varphi (r,\theta ,\varphi ) \approx \left[ \phi (r,\theta ,\varphi +\epsilon )-\phi (r,\theta ,\varphi -\epsilon ) \right] / 2\epsilon \). Algorithm 2 describes the second solution, which is effectively used in the Gysela code.
In the Selalib code (Sect. 4) we do not need to evaluate z derivatives of the electric potential \(\phi (r,\theta ,z)\), as in the equations everything is expressed in terms of derivatives in the poloidal plane \((r,\theta )\) or along the parallel direction \(\mathbf {b}\). To evaluate the electric field along \(\mathbf {b}\), we use for example a finite difference formula of order 6, which reads (after setting \(z=R_0\varphi \) and \(\Delta z=R_0\Delta \varphi \))
$$\begin{aligned} \mathbf {b}\cdot \nabla \phi (r_i,\theta _j,z_k) \simeq \frac{b_z(r_i)}{\Delta z}\sum _{\ell =-3}^{3}w_\ell \, \tilde{\phi }(r_i,{fieldline}_{\theta }(\theta _j,z_k,k+\ell ),z_{k+\ell }), \end{aligned}$$
with coefficients
$$\begin{aligned} w_0 = 0,\quad w_1 = -w_{-1}= \frac{3}{4},\quad w_2 = -w_{-2}=-\frac{3}{20},\quad w_3 = -w_{-3}= \frac{1}{60}, \end{aligned}$$
where \(\tilde{\phi }(r_i,{fieldline}_{\theta }(\theta _j,z_k,k+\ell ),z_{k+\ell })\) is obtained by interpolation (for example cubic splines) from the values \(\phi (r_i,\theta _l,z_{k+\ell }), \ l =0,\dots ,N_\theta \).

3 Theoretical Justification of the Approach for 2D Advection

Our drift-kinetic simulations with the Gysela code (presented in Sect. 5) will emphasize the practical advantages of the field-aligned approach over traditional tensor-product 2D interpolation schemes. Nevertheless, in order to trust the output of such a code when no analytical solutions are at hand, it is very desirable to have proven convergence (that is, consistency and stability) of the numerical methods employed. As it often happens in computational physics, we can provide such a proof only for a drastically reduced mathematical model; but even so, we gain useful insight and a certain degree of confidence in the final numerical scheme. Therefore, in this section we assess the convergence of our field-aligned semi-Lagrangian method when applied to the 2D constant advection equation for \(f: {\mathbb {R}}^+\times {\mathbb {R}}^2 \rightarrow {\mathbb {R}}\),
$$\begin{aligned} \left( \partial _t + b_\theta \partial _\theta + b_\varphi \partial _\varphi \right) f(t,\theta ,\varphi ) = 0, \qquad f(t=0,\theta ,\varphi ) = f_0(\theta ,\varphi ), \end{aligned}$$
where the initial function \(f_0: {\mathbb {R}}^2 \rightarrow {\mathbb {R}}\) is \(2\pi \)-periodic in \(\theta \) and \(\varphi \), and \({\mathbf {b}}=(b_\theta ,b_\varphi )\) is the unit vector of a constant magnetic field (therefore \(b_\theta ,b_\varphi \in {\mathbb {R}}\) such that \(b_\theta ^2+b_\varphi ^2=1\)). We assume that \(b_\varphi \ne 0\), because this hypothesis is required by the scheme. The exact solution reads
$$\begin{aligned} f(t,\theta ,\varphi ) = f_0(\theta -b_\theta t,\varphi -b_\varphi t), \end{aligned}$$
while the numerical solution \(f_{i,j}^n \approx f(t_n,\theta _i,\varphi _j)\) is computed on a uniform grid with indices \(n,i,j\in {\mathbb {Z}}\) and discretization parameters \(\Delta t \in {\mathbb {R}}\), \(\Delta \theta = \frac{2\pi }{N_\theta }\), and \(\Delta \varphi = \frac{2\pi }{N_\varphi }\), where \(N_\theta ,N_\varphi \in {\mathbb {N}}^*\). Specifically, we have \(t_n=n\Delta t\) and \((\theta _i,\varphi _j) = (\theta _0+i\Delta \theta ,\varphi _0+j\Delta \varphi )\) with \(\theta _0,\varphi _0\in {\mathbb {R}}\). In our ‘backward’ semi-Lagrangian scheme, the solution at time \(t_{n+1}\) is obtained from the solution at time \(t_n\) as
$$\begin{aligned} f^{n+1}_{i,j} = f^n(\theta _i-b_\theta \Delta t,\varphi _j-b_\varphi \Delta t), \end{aligned}$$
where \(f^n(\theta ,\varphi )\) is reconstructed from \(f^n_{i,j}\) through field-aligned interpolation. By virtue of the linearity of the interpolation operator (essentially a linear discrete convolution), the stability of the scheme will be assessed by means of a standard Von Neumann analysis: upon taking the semi-discrete Fourier transform on both sides of the previous equation, we will get
$$\begin{aligned} \hat{f}^{n+1}(\omega _\theta ,\omega _\varphi ) = \rho (\omega _\theta ,\omega _\varphi ) \hat{f}^n(\omega _\theta ,\omega _\varphi ), \end{aligned}$$
where \(\rho : [-\pi ,\pi ]\times [-\pi ,\pi ] \rightarrow {\mathbb {C}}\) is the ‘Fourier symbol’, or ‘amplification factor’, for a given choice of discretization parameters. We will then prove stability by showing that
$$\begin{aligned} \left| \rho (\omega _\theta ,\omega _\varphi )\right| \le 1 \qquad \forall \ \omega _\theta ,\omega _\varphi . \end{aligned}$$
In the present version of our field-aligned semi-Lagrangian scheme, we make use of centered Lagrange interpolation along both directions \({\mathbf {b}}\) and \(\theta \). In particular, we assume odd order \(2d_b+1\) along \({\mathbf {b}}\), and \(2d_\theta +1\) along \(\theta \), with \(d_b,d_\theta \in {\mathbb {N}}\). For any choice of \((d_b,d_\theta )\), we prove that such a scheme is unconditionally stable, i.e., stable for all values of \((\Delta t, N_\theta , N_\varphi )\).
Finally, we analyze the truncation error for single-mode initial conditions, proving that the scheme converges to the exact solution with order \(2d_\theta +2\) in \(N_\theta \) and \(2d_b+2\) in \(N_\varphi \), as expected. Our error estimates correctly recover the asymptotic behavior for \(b_\theta \rightarrow 0\), where the scheme reduces to 1D Lagrange interpolation. In comparison to classical tensor-product 2D interpolation, we clarify how field-aligned interpolation allows for a reduced \(N_\varphi \) in those situations where the gradients along \({\mathbf {b}}\) are smaller than along the \(\varphi \) direction, as typical in magnetic confinement devices. Because of the additional interpolations along \(\theta \), our estimates suggest a slight increase in the error constant along this direction, but we expect such an effect to be negligible in practice. In fact, the numerical experiments in Sects. 4 and 5 will confirm that this is more than compensated by the gain along \(\varphi \).
We point out that periodic spline interpolation in the \(\theta \) direction is used in the codes (Selalib in Sect. 4 and Gysela in Sect. 5) instead of Lagrange interpolation. In Sect. 4 our preference goes to spline interpolation simply because of its higher accuracy for a given polynomial degree. In Sect. 5 a more important motivation is the requirement of introducing the fewest possible modifications with respect to the standard (not field aligned) simulations, which employ cubic splines along both the \(\theta \) and \(\varphi \) directions: although the advection field is altered according to changes in the operator splitting, the polar advection solver remains substantially unchanged because the original interpolation strategy in \((r,\theta )\) is not modified. When comparing the two kinds of simulations (standard vs. field aligned), we can therefore ascribe any significant difference in the numerical results solely to a) choice of operator splitting, and b) strategy of interpolation along the \(\varphi \) direction.
The outline of this section is as follows: Section 3.1 provides the explicit update formula of our field-aligned scheme, Sect. 3.2 gives a rigorous proof of unconditional stability, and Sect. 3.3 assesses the truncation error of our scheme and compares it with the standard (not field-aligned) algorithm.

3.1 Update Formula for Field-aligned Semi-Lagrangian Scheme

For any given grid point \((\theta _i,\varphi _j)\), we trace the magnetic field line backward in time to obtain the foot of the characteristic \((\theta ^*_i,\varphi ^*_j)\), where \(\varphi ^*_j \in [\varphi _{j^*},\varphi _{j^*+1})\). Since \(b_\varphi \ne 0\) by assumption, the same magnetic field line intersects the grid lines at constant \(\varphi \) at the locations \((\theta ^*_{i,k},\varphi _{j^*+k})\) with \(k\in {\mathbb {Z}}\). The basic idea of the field-aligned semi-Lagrangian method is to use 1D interpolation along \(\theta \) to obtain the intermediate values \(f^{n+1}_{i,j,k}=f^n(\theta ^*_{i,k},\varphi _{j^*+k})\), and then 1D interpolation along \({\mathbf {b}}\) to obtain \(f^{n+1}_{i,j}=f^n(\theta ^*_i,\varphi ^*_j)\). Thanks to the constant \({\mathbf {b}}\) and uniform discretization, the concepts above will be succinctly formalized in the following discussion, leading to a very compact algorithm.
First, we consider the normalized displacement \(-b_\varphi \Delta t/\Delta \varphi \) along the \(\varphi \) direction and decompose it into its integer and fractional parts:
$$\begin{aligned} -b_\varphi \Delta t = (r_\varphi +\alpha _\varphi ) \Delta \varphi , \qquad r_\varphi \in {\mathbb {Z}}, \quad 0\le \alpha _\varphi <1. \end{aligned}$$
For Lagrange interpolation along \({\mathbf {b}}\), the integer shift \(r_\varphi \) is used to correctly place the stencil on the grid, and \(\alpha _\varphi \) is the interpolation variable. We now turn to finding the displacements in the \(\theta \) coordinate, which correspond to the intersections between the magnetic field line and the various grid lines at constant \(\varphi \). For this purpose, we first define the flight times \(\Delta t_k\) such that
$$\begin{aligned} -b_\varphi \Delta t_k = (r_\varphi +k) \Delta \varphi , \qquad k=-d_b,\dots ,d_b+1. \end{aligned}$$
This is possible, as \(b_\varphi \not =0\). At each \(\varphi _{j^*+k}\)–intersection we now have the normalized diplacements along the \(\theta \) direction as \(-b_\theta \Delta t_k/\Delta \theta \), which we also decompose into integer and fractional parts:
$$\begin{aligned} -b_\theta \Delta t_k = (r_{\theta ,k}+\alpha _{\theta ,k}) \Delta \theta , \qquad r_{\theta ,k}\in {\mathbb {Z}}, \quad 0\le \alpha _{\theta ,k} < 1. \end{aligned}$$
For Lagrange interpolation along \(\theta \), the integer shifts \(r_{\theta ,k}\) are used to correctly place each stencil k on the grid, and \(\alpha _{\theta ,k}\) are the interpolation variables. We are now ready to compute the intermediate values \(f^{n+1}_{i,j,k}\) at each \(\varphi _{j^*+k}\)–intersection through Lagrange interpolation along \(\mathbf {\theta }\), as
$$\begin{aligned} f^{n+1}_{i,j,k} = \sum _{\ell =-d_\theta }^{d_{\theta }+1} L^{d_\theta }_\ell (\alpha _{\theta ,k})f^n_{i+r_{\theta ,k}+\ell ,j+r_\varphi +k}. \qquad k=-d_b,\dots ,d_b+1, \end{aligned}$$
and from these we compute the new solution \(f^{n+1}_{i,j}\), using Lagrange interpolation along \({\mathbf {b}}\):
$$\begin{aligned} f^{n+1}_{i,j} = \sum _{k=-d_b}^{d_b+1}L^{d_b}_k(\alpha _\varphi )f^{n+1}_{i,j,k}. \end{aligned}$$
Combining the last two equations leads to the compact update formula
$$\begin{aligned} f^{n+1}_{i,j} = \sum _{\ell =-d_\theta }^{d_{\theta }+1}\sum _{k=-d_b}^{d_b+1} L^{d_b}_k(\alpha _\varphi )L^{d_\theta }_\ell (\alpha _{\theta ,k}) f^n_{i+r_{\theta ,k}+\ell ,j+r_\varphi +k}. \end{aligned}$$
Here we recall that \(i,j \in {\mathbb {Z}}\), and that \(f^0_{i,j}\) is \(N_\theta \)-periodic in i and \(N_\varphi \)-periodic in j. As a result, \(f^n_{i,j}\) is \(N_\theta \)-periodic in i and \(N_\varphi \)-periodic in j for \(n \in {\mathbb {N}}\). For completeness, we also recall that \(L^d_k\) are the elementary Lagrange basis functions defined by
$$\begin{aligned} L_k^d(\alpha ) = \prod _{\ell =-d,\ \ell \not =k}^{d+1}\frac{\alpha -\ell }{k-\ell }, \quad k=-d,\dots ,d+1,\ \alpha \in {\mathbb {R}},\ d\in {\mathbb {N}}. \end{aligned}$$

3.2 Proof of Stability

3.2.1 Fourier Symbol

We now turn to studying the Fourier symbol of our numerical scheme (3.1) and, for simplicity, we redefine \(i {:=} \sqrt{-1}\) as the imaginary unit. Because of its periodicity, the Fourier spectrum of \(f^n_{i,j}\) contains only \(N_\theta \times N_\varphi \) modes. Therefore, we can proceed by taking the 2D discrete Fourier transform of both sides of (3.1). For \(i_1,j_1\in {\mathbb {Z}}\) we get
$$\begin{aligned} \begin{aligned}&\sum _{i_2=0}^{N_\theta -1}\sum _{j_2=0}^{N_\varphi -1} f^{n+1}_{i_2,j_2}\exp \left( 2\pi i\frac{i_1i_2}{N_\theta }\right) \exp \left( 2\pi i\frac{j_1j_2}{N_\varphi }\right) \\&\quad =\rho \left( \frac{2\pi i_1}{N_\theta },\frac{2\pi j_1}{N_\varphi }\right) \sum _{i_2=0}^{N_\theta -1}\sum _{j_2=0}^{N_\varphi -1} f^{n}_{i_2,j_2} \exp \left( 2\pi i\frac{i_1i_2}{N_\theta }\right) \exp \left( 2\pi i\frac{j_1j_2}{N_\varphi }\right) , \end{aligned} \end{aligned}$$
where the Fourier symbol \(\rho : [-\pi ,\pi ]^2 \rightarrow {\mathbb {C}}\) is
$$\begin{aligned} \rho (\omega _\theta ,\omega _\varphi ) = \sum _{\ell =-d_\theta }^{d_{\theta }+1}\sum _{k=-d_b}^{d_b+1} L^{d_b}_k(\alpha _\varphi )L^{d_\theta }_\ell (\alpha _{\theta ,k}) \exp (i(r_{\theta ,k}+\ell )\omega _\theta )\exp (i(r_{\varphi }+k)\omega _\varphi ). \end{aligned}$$
Thanks to the relation
$$\begin{aligned} r_{\theta ,k}+\alpha _{\theta ,k} = (r_\varphi +k)\lambda , \qquad \lambda =\frac{b_\theta N_\theta }{b_\varphi N_\varphi } \in {\mathbb {R}}, \end{aligned}$$
we can parametrize the symbol in the variables \((\lambda ,r_\varphi ,\alpha _\varphi )\) as
$$\begin{aligned} \rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi )= & {} \sum _{\ell =-d_\theta }^{d_{\theta }+1}\sum _{k=-d_b}^{d_b+1} L^{d_b}_k(\alpha _\varphi ) L^{d_\theta }_\ell ((r_\varphi +k)\lambda \nonumber \\&\qquad -\,\lfloor (r_\varphi +k)\lambda \rfloor ) \exp (i(\lfloor (r_\varphi +k)\lambda \rfloor +\ell )\omega _\theta ) \exp (i(r_{\varphi }+k)\omega _\varphi ),\nonumber \\ \end{aligned}$$
where \(\lfloor \cdot \rfloor : {\mathbb {R}}\rightarrow {\mathbb {Z}}\) is the floor function. In the spirit of the Von Neumann stability analysis, we are now led to compute the maximum absolute value S of the symbol above,
$$\begin{aligned} S=\sup _{0\le \alpha _\varphi<1,\ r_\varphi \in {\mathbb {Z}},\ \lambda ,\omega _\theta ,\omega _\varphi \in {\mathbb {R}}} \left| \rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi )\right| = \sup _{0\le \alpha _\varphi ,\frac{\omega _\theta }{2\pi },\frac{\omega _\varphi }{2\pi }<1,\ r_\varphi \in {\mathbb {Z}},\ \lambda \in {\mathbb {R}}} \left| \rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi )\right| , \end{aligned}$$
and to prove that \(S\le 1\).

3.2.2 Relation to Discrete Fourier Transform (DFT) for Rational \(\lambda \)

We suppose for the moment that \(\lambda \in \mathbb {Q}\), and we represent it as
$$\begin{aligned} \lambda = \frac{m}{q}, \qquad \text { with }\,m\in {\mathbb {Z}}, q\in {\mathbb {N}}^*, \text { and }m,q \text { coprime}. \end{aligned}$$
So, for any \(r_\varphi \in {\mathbb {Z}}\), we observe that \(\alpha _{\theta ,k}\) can only assume at most q different values, all rational:
$$\begin{aligned} \alpha _{\theta ,k} = (r_\varphi +k)\lambda \bmod 1 = \frac{(r_\varphi +k)m \bmod q}{q} = \frac{s_k}{q}, \qquad k=-d_b,\dots ,d_b+1, \end{aligned}$$
where we have introduced the natural sequence
$$\begin{aligned} s_k = (r_\varphi +k)m \bmod q\ \in \ \{0,\dots ,q-1\}. \end{aligned}$$
Under this assumption for \(\lambda \) we can use the following identity for any complex sequence \(a_k\):
$$\begin{aligned} \sum _{k=-d_b}^{d_b+1} a_k = \sum _{k=-d_b}^{d_b+1} \sum _{p=0}^{q-1} \delta _{p,s_k} a_k = \sum _{p=0}^{q-1} \sum _{k=-d_b}^{d_b+1} \delta _{p,s_k} a_k. \end{aligned}$$
Here \(\delta : {\mathbb {Z}}^2 \rightarrow \{0,1\}\) is Kronecker’s delta: for any \(u,v\in {\mathbb {Z}}\), \(\delta _{u,v}=1\) if \(u=v\), and 0 otherwise. In particular, if we let \(a_k = G(\alpha _{\theta ,k})c_k\) with \(G:[0,1)\rightarrow {\mathbb {C}}\) and \(c_k\in {\mathbb {C}}\), we get the important relation
$$\begin{aligned} \sum _{k=-d_b}^{d_b+1} G(\alpha _{\theta ,k}) c_k = \sum _{p=0}^{q-1} \sum _{k=-d_b}^{d_b+1} \delta _{p,s_k}\ G\left( \frac{s_k}{q}\right) c_k = \sum _{p=0}^{q-1} G\left( \frac{p}{q}\right) \sum _{k=-d_b}^{d_b+1} \delta _{p,s_k} c_k. \end{aligned}$$
We can then write
$$\begin{aligned}&\rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi ) \\&\quad = \sum _{\ell =-d_\theta }^{d_{\theta }+1}\sum _{k=-d_b}^{d_b+1} L^{d_b}_k(\alpha _\varphi )L^{d_\theta }_\ell (\alpha _{\theta ,k}) \exp (i((r_\varphi +k)\lambda -\alpha _{\theta ,k} +\ell )\omega _\theta ) \exp (i(r_{\varphi }+k)\omega _\varphi )\\&\quad = \sum _{p=0}^{q-1} \left[ \sum _{\ell =-d_\theta }^{d_{\theta }+1} L^{d_\theta }_\ell \left( \frac{p}{q}\right) \exp \left( i\left( \ell -\frac{p}{q}\right) \omega _\theta \right) \right] \sum _{k=-d_b}^{d_b+1} \delta _{p,s_k} L^{d_b}_k(\alpha _\varphi ) \exp (i(r_{\varphi }+k)(\omega _\varphi +\lambda \omega _\theta )). \end{aligned}$$
We now focus on the term between square brackets, a complex sequence \(w_p\in {\mathbb {C}}\) with \(p=0,\dots ,q-1\), and we represent it as a sum of q Fourier modes by means of a discrete Fourier transform (DFT) and its inverse:
$$\begin{aligned} \sum _{\ell =-d_\theta }^{d_{\theta }+1} L^{d_\theta }_\ell \left( \frac{p}{q}\right) \exp \left( i\left( \ell -\frac{p}{q}\right) \omega _\theta \right) = w_p&= \sum _{p_1=0}^{q-1} t_{p_1} \exp \left( i2\pi \frac{p\,p_1}{q}\right) , \end{aligned}$$
$$\begin{aligned} t_{p_1}&= \frac{1}{q} \sum _{p_2=0}^{q-1} w_{p_2} \exp \left( -i2\pi \frac{p_1p_2}{q}\right) . \end{aligned}$$
Incidentally, we notice that the sum of the Fourier coefficients defined in (3.3b) is equal to 1, as can be proven by looking at the term \(w_0\) in (3.3a):
$$\begin{aligned} \sum _{p_1=0}^{q-1} t_{p_1} = w_0 = \sum _{\ell =-d_\theta }^{d_\theta +1} L^{d_\theta }_\ell (0) \exp \left( i\ell \omega _\theta \right) = \sum _{\ell =-d_\theta }^{d_\theta +1} \delta _{\ell ,0}\, \exp \left( i\ell \omega _\theta \right) = 1. \end{aligned}$$
By substituting (3.3a) into the Fourier symbol \(\rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi )\) we can get rid of one of the sums, as well as of the Kronecker delta:
$$\begin{aligned}&\rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi ) \\&\quad = \sum _{p_1=0}^{q-1}t_{p_1}\sum _{p=0}^{q-1}\exp \left( i2\pi \frac{p_1p}{q}\right) \sum _{k=-d_b}^{d_b+1} \delta _{p,s_k} L^{d_b}_k(\alpha _\varphi ) \exp (i(r_{\varphi }+k)(\omega _\varphi +\lambda \omega _\theta )) \\&\quad = \sum _{p_1=0}^{q-1}t_{p_1}\sum _{p=0}^{q-1}\sum _{k=-d_b}^{d_b+1} \delta _{p,s_k} L^{d_b}_k(\alpha _\varphi ) \exp (i(r_{\varphi }+k)(\omega _\varphi +\lambda \omega _\theta )) \exp \left( i2\pi \frac{p_1 s_k}{q}\right) \\&\quad = \sum _{p_1=0}^{q-1}t_{p_1}\sum _{k=-d_b}^{d_{b}+1} L^{d_b}_k(\alpha _\varphi ) \exp (i(r_{\varphi }+k)(\omega _\varphi +\lambda \omega _\theta )) \exp (i2\pi p_1 \alpha _{\theta ,k}). \end{aligned}$$
Because \(\exp (i2\pi )=1\), we now multiply the right-hand side by \(\exp (i 2\pi p_1 r_{\theta ,k})=1\), use the fact that \(r_{\theta ,k}+\alpha _{\theta ,k}=(r_\varphi +k)\lambda \), and then change \(p_1\) with p to obtain
$$\begin{aligned} \rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi ) = \sum _{p=0}^{q-1} t_p \sum _{k=-d_b}^{d_{b}+1} L^{d_b}_k(\alpha _\varphi ) \exp (i(r_{\varphi }+k)(\omega _\varphi +\lambda \omega _\theta )) \exp (i2\pi p(r_\varphi +k)\lambda ). \end{aligned}$$
By properly rearranging the complex exponential factors according to their dependence on the indexes p and k, we also get
$$\begin{aligned} \rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi ) = \sum _{p=0}^{q-1} t_p \exp (i r_\varphi \omega _p) \sum _{k=-d_b}^{d_{b}+1} L^{d_b}_k(\alpha _\varphi ) \exp (i k \omega _p), \end{aligned}$$
where we have introduced the frequencies \(\omega _p\in {\mathbb {R}}\) for \(p=0,\dots ,q-1\) as
$$\begin{aligned} \omega _p = 2\pi p\lambda + \omega _\varphi + \lambda \omega _\theta . \end{aligned}$$
We now turn to studying the absolute value of the Fourier symbol in (3.5), which is the sum over p of q complex terms. We apply the triangular inequality to such a sum, and use the fact that the modulus of a complex exponential is equal to 1, to obtain the estimate
$$\begin{aligned} \left| \rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta , \omega _\varphi )\right| \le \sum _{p=0}^{q-1} \left| t_p\right| \left| \sum _{k=-d_b}^{d_b+1} L_k^{d_b}(\alpha _\varphi ) \exp (ik\omega _p) \right| , \end{aligned}$$
which can be factorized as
$$\begin{aligned} \left| \rho _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi )\right| \le \left( \sum _{p=0}^{q-1} \left| t_p\right| \right) \left( \sup _{0\le \omega \le 2\pi } \left| \sum _{k=-d_b}^{d_{b}+1}L^{d_b}_k(\alpha _\varphi )\exp (ik\omega ) \right| \right) . \end{aligned}$$
The second factor on the right-hand side is typical of backward semi-Lagrangian schemes applied to the 1D advection equation. The stability analysis in [8], for example, has already shown that
$$\begin{aligned} \sup _{0\le \omega \le 2\pi } \left| \sum _{k=-d_b}^{d_{b}+1}L^{d_b}_k(\alpha _\varphi )\exp (ik\omega ) \right| \le 1. \end{aligned}$$
Therefore our attention will focus on the first factor, which must also be \(\le 1\). If we can prove that \(t_p\in {\mathbb {R}}^+\) for each \(p=0,\dots ,q-1\), then \(|t_p|=t_p\) and we can use our previous result in (3.4) to obtain
$$\begin{aligned} \sum _{p=0}^{q-1} \left| t_p \right| = \sum _{p=0}^{q-1} t_p = 1. \end{aligned}$$
For this purpose we first notice, because \(\exp (i\ell \,2\pi p)=1\), that we can rewrite (3.3b) as
$$\begin{aligned} t_p = \frac{1}{q}\sum _{p_1=0}^{q-1}\sum _{\ell =-d_\theta }^{d_\theta +1} L^{d_\theta }_\ell \left( \frac{p_1}{q}\right) \exp \left( i\left( \ell -\frac{p_1}{q}\right) (\omega _\theta +2\pi p) \right) , \qquad p=0,\dots ,q-1. \end{aligned}$$
Our stability analysis will now proceed in three stages. In Sect. 3.2.3 we will prove that the Fourier coefficients \(t_p\) are all real, and in Sect. 3.2.4 that they are non-negative. This implies (3.8) and therefore stability of our numerical scheme for any rational \(\lambda \), according to (3.6) and (3.7). Finally, in Sect. 3.2.5 we will extend this result to the general situation of real \(\lambda \).
Remark 1
This result of positivity of the DFT has direct connection with results of Ferretti [9, 10] stating equivalence between semi-Lagrangian and Lagrange-Galerkin methods under some assumptions, one of it being the positivity of the (continuous) Fourier transform. Such link may be further studied.

3.2.3 Proving that the DFT is Real

We now prove that \(t_p \in {\mathbb {R}}\) for each \(p=0,\dots ,q-1\). Given that the \(t_p\) coefficients are obtained through the DFT (3.3), this follows from the symmetry property \(w_{q-p}=w_p^*\) for \(p=1,\dots ,q-1\).
If we introduce the complex function of real variable
$$\begin{aligned} S_{q,d}(\omega ) = \sum _{p_1=0}^{q-1}\sum _{\ell =-d}^{d+1} L^d_\ell \left( \frac{p_1}{q}\right) \exp \left( i\left( \ell -\frac{p_1}{q}\right) \omega \right) , \qquad 0\le \omega \le 2\pi q, \end{aligned}$$
such that
$$\begin{aligned} t_p = \frac{1}{q} S_{q,d_\theta }(\omega _\theta +2\pi p), \qquad p=0,\dots ,q-1, \end{aligned}$$
it suffices to prove that the imaginary part of \(S_{q,d}(\omega )\) is always zero in \([0,2\pi q]\). To show this, we start from Euler’s formula \(\exp (ix)=\cos (x)+i\sin (x)\) and then make use of the symmetry of Lagrange basis functions on a uniform grid, namely
$$\begin{aligned} L^d_\ell (\alpha ) = L^d_{-\ell +1}(1-\alpha ),\qquad \ell =1,\dots ,d+1,\qquad 0\le \alpha \le 1, \end{aligned}$$
together with the identities
$$\begin{aligned} \sum _{\ell =-d}^{d+1} c_\ell = \sum _{\ell =1}^{d+1}(c_\ell + c_{-\ell +1}), \qquad \sum _{p=1}^{q-1} c_{p} = \sum _{p=1}^{q-1} c_{q-p}, \end{aligned}$$
to obtain
$$\begin{aligned} \begin{aligned} {\text {Im}}\bigl \{S_{q,d}(\omega )\bigr \}&= \sum _{p=0}^{q-1}\sum _{\ell =-d}^{d+1} L^{d}_\ell \left( \frac{p}{q}\right) \sin \left( \left( \ell -\frac{p}{q}\right) \omega \right) \\&= \sum _{\ell =-d}^{d+1} L_\ell ^d(0) \sin (\ell \omega ) \\&\quad + \sum _{p=1}^{q-1}\sum _{\ell =1}^{d+1} \left[ L^{d}_\ell \left( \frac{p}{q}\right) \sin \left( \left( \ell -\frac{p}{q}\right) \omega \right) + L^{d}_{-\ell +1}\left( \frac{p}{q}\right) \sin \left( \left( -\ell +1-\frac{p}{q}\right) \omega \right) \right] \\&= \sum _{\ell =-d}^{d+1} \delta _{\ell ,0} \sin (\ell \omega ) \\&\quad + \sum _{p=1}^{q-1}\sum _{\ell =1}^{d+1} \left[ L^{d}_\ell \left( \frac{p}{q}\right) \sin \left( \left( \ell -\frac{p}{q}\right) \omega \right) + L^{d}_\ell \left( 1-\frac{p}{q}\right) \sin \left( \left( -\ell +1-\frac{p}{q}\right) \omega \right) \right] \\&= \sin (0) + \sum _{p=1}^{q-1}\sum _{\ell =1}^{d+1} L^{d}_\ell \left( \frac{p}{q}\right) \left[ \sin \left( \left( \ell -\frac{p}{q}\right) \omega \right) + \sin \left( \left( -\ell +\frac{p}{q}\right) \omega \right) \right] = 0. \end{aligned} \end{aligned}$$
Therefore we have proven that \(t_p\in {\mathbb {R}}\) for \(p=0,\dots ,q-1\).

3.2.4 Proving that the DFT is Non-negative

Now, it remains to see if we can prove that
$$\begin{aligned} S_{q,d}(\omega ) \ge 0 \quad \text {for all} \ 0\le \omega \le 2\pi q. \end{aligned}$$
If this inequality is true for \(d=d_\theta \), from (3.11) we obtain that \(t_p\ge 0\) for \(p=0,\dots ,q-1\), and therefore (3.8) holds. From this follows the stability of our numerical scheme for any rational \(\lambda \).
For \(q=1\), we have
$$\begin{aligned} S_{1,d}(\omega ) = \sum _{\ell =-d}^{d+1}L^{d}_\ell (0)\cos (\ell \omega ) = 1\ge 0. \end{aligned}$$
For \(q>1\), the situation is much more complicated and it requires a careful study of the function \(S_{q,d}\) in the interval \([0,2\pi q]\). We first notice that we can explicitly compute the values \(S_{q,d}(2\pi n)\) for \(n\in {\mathbb {N}}\), because (3.10) simplifies to
$$\begin{aligned} S_{q,d}(2\pi n) = \sum _{p=0}^{q-1} \left[ \sum _{\ell =-d}^{d+1} L^{d}_\ell \left( \frac{p}{q}\right) \right] \exp \left( -i\frac{p}{q}2\pi n\right) = \sum _{p=0}^{q-1} \exp \left( -i\frac{p}{q}2\pi n\right) , \end{aligned}$$
where we have used the identity \((\exp (i2\pi ))^{n\ell }=1\) together with the partition of unity of the Lagrange interpolant, namely \(\sum _{\ell =-d}^{d+1} L^{d}_\ell (\alpha ) = 1\), for all \(\alpha \in {\mathbb {R}}\). From the last equation we obtain that
$$\begin{aligned} S_{q,d}(0) = q, \qquad S_{q,d}(2\pi n) = 0 \quad \text { for } n=1,\dots ,q-1, \qquad S_{q,d}(2\pi q) = q, \end{aligned}$$
and therefore \(S_{q,d}\) has at least \(q-1\) zeros in \((0, 2\pi q)\) and is strictly positive at the boundaries. In the following discussion we will show that there are no other zeros in the same interval, and that the function is convex at all zeros (and therefore positive in some open interval around each zero). By continuity, this proves that \(S_{q,d}(\omega )\ge 0\) for all \(0\le \omega \le 2\pi q\). Our derivation is somewhat involved because most information will be extracted from \(S'_{q,d}\), as in [11].
The derivative of (3.10) reads:
$$\begin{aligned} S_{q,d}'(\omega ) = i \sum _{p=0}^{q-1}\sum _{\ell =-d}^{d+1} L^{d}_\ell \left( \frac{p}{q}\right) \left( \ell -\frac{p}{q}\right) \exp \left( i\left( \ell -\frac{p}{q}\right) \omega \right) . \end{aligned}$$
Now, for \(\ell =-d,\dots ,d+1\), we have \(L_\ell ^d(x)=\frac{\prod _{k=-d,\ k\not =\ell }^{d+1}x-k}{\prod _{k=-d,\ k\not =\ell }^{d+1}\ell -k}\) and
$$\begin{aligned} L^{d}_\ell \left( \frac{p}{q}\right) \left( \frac{p}{q}-\ell \right)= & {} \frac{1}{\prod _{k=-d}^{\ell -1}(\ell -k)\prod _{k=\ell +1}^{d+1}(\ell -k)} \prod _{k=-d}^{d+1}\left( \frac{p}{q}-k\right) =\frac{(-1)^{d+1-\ell }}{(d+\ell )!(d+1-\ell )!} \prod _{k=-d}^{d+1}\left( \frac{p}{q}-k\right) , \end{aligned}$$
so that
$$\begin{aligned} S_{q,d}'(\omega ) = -i \left[ \sum _{\ell =-d}^{d+1}\frac{(-1)^{d+1-\ell }}{(d+\ell )!(d+1-\ell )!}\exp (i\ell \omega )\right] \sum _{p=0}^{q-1}\exp \left( -i\frac{p}{q}\omega \right) w_d\left( \frac{p}{q}\right) , \end{aligned}$$
$$\begin{aligned} w_d(x)=\prod _{k=-d}^{d+1}(x-k),\ x\in {\mathbb {R}}. \end{aligned}$$
We point out that \(w_d(x)\) is symmetric about the point \(x=1/2\), as
$$\begin{aligned} w_d(x) = \prod _{k=0}^d (x-k+1)(x+k) = \prod _{k=0}^d \left( \left( x-\frac{1}{2}\right) ^2 - \left( k+\frac{1}{2}\right) ^2 \right) . \end{aligned}$$
Now, if we multiply by \(\exp (id\omega )\) the term within square brackets in the expression for \(S'_{q,d}(\omega )\), we can identify the sum therein as the polynomial expansion of a binomial power,
$$\begin{aligned}&\sum _{\ell =-d}^{d+1}\frac{(-1)^{d+1-\ell }}{(d+\ell )!(d+1-\ell )!} \exp (i(\ell +d)\omega ) = \sum _{\ell =0}^{2d+1}\frac{(-1)^{2d+1-\ell }}{\ell !(2d+1-\ell )!}\exp (i\ell \omega ) \\&\quad = \frac{(-1)^{2d+1}}{(2d+1)!} \sum _{\ell =0}^{2d+1}\left( {\begin{array}{c}2d+1\\ \ell \end{array}}\right) (-\exp (i\omega ))^\ell = \frac{(\exp (i\omega )-1)^{2d+1}}{(2d+1)!}, \end{aligned}$$
and obtain therefore
$$\begin{aligned} S_{q,d}'(\omega ) = \frac{-i\exp (-i\omega d)(\exp (i\omega )-1)^{2d+1}}{(2d+1)!} \sum _{p=0}^{q-1}\exp \left( -i\frac{p}{q}\omega \right) w_d\left( \frac{p}{q}\right) . \end{aligned}$$
The coefficient that appears in front of the summation can be reformulated as
$$\begin{aligned}&-i\exp (-i\omega d)(\exp (i\omega )-1)^{2d+1} = -i\exp \left( i\frac{\omega }{2}\right) \left( \exp \left( -i\frac{\omega }{2}\right) \right) ^{2d+1} (\exp (i\omega )-1)^{2d+1}\\&\quad = -i \exp \left( i\frac{\omega }{2}\right) \left( \exp \left( i\frac{\omega }{2}\right) -\exp \left( -i\frac{\omega }{2}\right) \right) ^{2d+1}\\&\quad = (-1)^{d}2^{2d+1}\sin ^{2d+1}\left( \frac{\omega }{2}\right) \exp \left( i\frac{\omega }{2}\right) , \end{aligned}$$
which yields an expression for \(S'_{q,d}(\omega )\) where all terms are real, apart from the complex exponential coefficients in the summation:
$$\begin{aligned} S_{q,d}'(\omega ) = (-1)^{d}2^{2d+1}\sin ^{2d+1}\left( \frac{\omega }{2}\right) \sum _{p=1}^{q-1}\exp \left( i\left( \frac{1}{2}-\frac{p}{q}\right) \omega \right) w_d\left( \frac{p}{q}\right) . \end{aligned}$$
Because \(S_{q,d}\) is real valued, so must be its derivatives. In fact, the imaginary part of the summation above is zero thanks to the fact that \(w_d(0)=0\) by definition, and \(w_d(x)=w_d(1-x)\) by symmetry. Finally, we obtain
$$\begin{aligned} S_{q,d}'(\omega ) = (-1)^{d}\frac{2^{2d+1}}{(2d+1)!} \sin ^{2d+1}\left( \frac{\omega }{2}\right) \sigma _{q,d}(\omega ), \end{aligned}$$
$$\begin{aligned} \sigma _{q,d}(\omega ) = \sum _{p=1}^{q-1} \cos \left( \left( \frac{1}{2}-\frac{p}{q}\right) \omega \right) w_d\left( \frac{p}{q}\right) . \end{aligned}$$
We will now study separately the two factors \(\sin ^{2d+1}(\omega /2)\) and \(\sigma _{q,d}(\omega )\) that appear in (3.15). The former has zeros at \(2n\pi \) for \(n\in {\mathbb {N}}\), with 2d derivatives also zero at the same location. In fact, if we look at the asymptotic behavior near any of the points \(\omega =2n\pi \), we have
$$\begin{aligned} \sin ^{2d+1}\left( \frac{\omega }{2}\right) = \left[ \left( -1\right) ^n\sin \left( \frac{\omega -2n\pi }{2}\right) \right] ^{2d+1} \underset{\omega =2n\pi }{\sim }(-1)^n \frac{\left( \omega -2n\pi \right) ^{2d+1}}{2^{2d+1}}, \end{aligned}$$
where we used the angle sum identity for sines, together with \(\cos (n\pi )=(-1)^n\) and \(\sin (n\pi )=0\). A comparison with the Taylor expansions around the same locations yields
$$\begin{aligned} \begin{aligned} \left[ \sin ^{2d+1}\left( \frac{\omega }{2}\right) \right] ^{(j)}_{\omega =2n\pi }&=0 \qquad \text { for }j=0,\dots ,2d,\\ \left[ \sin ^{2d+1}\left( \frac{\omega }{2}\right) \right] ^{(2d+1)}_{\omega =2n\pi }&= (-1)^n \frac{(2d+1)!}{2^{2d+1}}. \end{aligned} \end{aligned}$$
We now turn to study the term \(\sigma _{q,d}(\omega )\) at the same locations. If we multiply (3.16) by \((-1)^{n+d}\) and then use the angle sum identity for cosines, again with \(\cos (n\pi )=(-1)^n\) and \(\sin (n\pi )=0\), we obtain
$$\begin{aligned} (-1)^{n+d}\sigma _{q,d}(2n\pi )= & {} (-1)^{n+d}\sum _{p=1}^{q-1} \cos \left( \left( \frac{1}{2}-\frac{p}{q}\right) 2n\pi \right) w_d\left( \frac{p}{q}\right) \\= & {} (-1)^d\sum _{p=1}^{q-1} \cos \left( 2n\pi \frac{p}{q}\right) w_d\left( \frac{p}{q}\right) . \end{aligned}$$
We then will use the following discrete form of a lemma relating real convex functions to positive Fourier transforms (see [12, 13] and [14] for historical notes).
Lemma 1
Let \(q\ge 2\) be an integer and \(f_j\) be a sequence of \(q+1\) real numbers with \(j=0,\dots ,q\), such that \(f_0=f_q=0\) and
$$\begin{aligned} f_{j+1}-2f_j+f_{j-1}\ge 0,\quad j=1,\dots ,q-1. \end{aligned}$$
Then, we have
$$\begin{aligned} \sum _{p=1}^{q-1}\cos \left( 2n\pi \frac{p}{q}\right) f_p\ge 0, \quad n=1,\dots ,q-1. \end{aligned}$$
Moreover, if we have additionally \(f_1>f_2/2\), then (3.18) is strict for all \(n=1,\dots ,q-1\).
Since \(f_q=f_0=0\), and \(0<n<q\), we have
$$\begin{aligned} \sum _{p=1}^{q-1}\cos \left( 2n\pi \frac{p}{q}\right) f_p= & {} \sum _{p=0}^{q-1}\frac{\sin \left( 2n\pi \frac{p+1/2}{q}\right) }{2\sin \left( \frac{n\pi }{q}\right) }f_p - \sum _{p=1}^{q}\frac{\sin \left( 2n\pi \frac{p-1/2}{q}\right) }{2\sin \left( \frac{n\pi }{q}\right) }f_p\nonumber \\= & {} \sum _{p=0}^{q-1}\frac{\sin \left( 2n\pi \frac{p+1/2}{q}\right) }{2\sin \left( \frac{n\pi }{q}\right) }(f_{p}-f_{p+1}). \end{aligned}$$
Now, as \(n \in {\mathbb {N}}\), we have
$$\begin{aligned} \sum _{p=1}^{q-1}\cos \left( 2n\pi \frac{p}{q}\right) f_p= & {} \sum _{p=0}^{q-2}\frac{\cos \left( 2n\pi \frac{p+1}{q}\right) -1}{4\sin ^2\left( \frac{n\pi }{q}\right) }(f_{p+1}-f_{p})\\&+ \sum _{p=1}^{q-1}\frac{\cos \left( 2n\pi \frac{p}{q}\right) -1}{4\sin ^2\left( \frac{n\pi }{q}\right) }(f_{p}-f_{p+1}). \end{aligned}$$
This leads to
$$\begin{aligned} \sum _{p=1}^{q-1}\cos \left( 2n\pi \frac{p}{q}\right) f_p = \sum _{p=1}^{q-1}\frac{\cos \left( 2n\pi \frac{p}{q}\right) -1}{4\sin ^2\left( \frac{n\pi }{q}\right) }(2f_{p}-f_{p+1}-f_{p-1})\ge 0. \end{aligned}$$
Finally, if we also have \(f_1>\frac{f_2}{2}\), we get
$$\begin{aligned} \sum _{p=1}^{q-1}\cos \left( 2n\pi \frac{p}{q}\right) f_p\ge \frac{\cos \left( 2n\pi \frac{1}{q}\right) -1}{4\sin ^2\left( \frac{n\pi }{q}\right) }(2f_{1}-f_{2})>0. \end{aligned}$$
\(\square \)
Proposition 1
Let \(d\in {\mathbb {N}}\) and \(w_d(x)=\prod _{k=-d}^{d+1}(x-k)\). Then \((-1)^dw_d\) is strictly convex on [0, 1].
We know that \(w_d\) is a polynomial of degree \(2d+2\) whose roots are \(k,\ k=-d,\dots d+1\). By Rolle’s theorem and since \(w'_d\) is a polynomial of degree \(2d+1\), \(w'_d\) vanishes exactly one time in each interval \((k,k+1)\). We also have \(w_d(1/2+x)=w_d(1/2-x)\) by symmetry, so the unique zero of \(w'_d\) in (0, 1) is 1 / 2. By Rolle’s theorem and since \(w''_d\) is a polynomial of degree 2d, looking at the variation table, we can see that \((-1)^dw''_d<0\) on \((t_{-1},s_{-1})\cup (s_1,t_1)\) and \((-1)^dw''_d>0\) on \((s_{-1},s_1)\), with \(t_{-1}\) the unique zero of \(w'_d\) in \((-1,0)\) and \(t_1\) the unique zero of \(w'_d\) in (1, 2), and we have \(s_{-1}\in (t_{-1},1/2),\ s_1\in (1/2,t_1)\). From the expression \(w_d(x)=x(x-d-1)\prod _{k=1}^d(x^2-k^2)\) we get \(w_d''(0)=2\prod _{k=1}^d(-k^2)\) (with the convention \(\prod _{k=1}^0=1\)), and thus \((-1)^dw''_d(0)>0\), which implies that \(s_{-1}<0\). By symmetry we have \((-1)^dw_d''(1)>0\), and thus \(s_1>1\). Finally, we have \((-1)^dw_d''>0\) on [0, 1]. \(\square \)
From Lemma 1, Proposition 1 and as \(w_d(0)=w_d(1)=0\), we deduce that
$$\begin{aligned} (-1)^{n+d}\sigma _{q,d}(2n\pi )> 0, \quad n=1,\dots ,q-1,\quad q>2,\quad d\in {\mathbb {N}}. \end{aligned}$$
We now turn to study the asymptotic behavior of \(S_{q,d}(\omega )\) as \(\omega \rightarrow 2n\pi \) for \(n=1,\dots ,q-1\). Thanks to (3.19), we can substitute (3.17) into (3.15) to obtain an asymptotic expression for \(S'_{q,d}\), which we integrate once using (3.13). Finally, we obtain the asymptotic equivalence
$$\begin{aligned}&S_{q,d}(\omega ) \underset{\omega =2n\pi }{\sim }\frac{(-1)^{n+d}\sigma _{q,d}(2n\pi )}{(2d+2)!}(\omega -2n\pi )^{2d+2}, \nonumber \\&\quad n =1,\dots ,q-1,\quad q=2,3,\dots ,\quad d\in {\mathbb {N}}, \end{aligned}$$
which we compare with the Taylor expansion of \(S_{q,d}\) about \(\omega =2n\pi \) for \(n=1,\dots ,q-1\) to find
$$\begin{aligned} \begin{aligned} S_{q,d}^{(j) }(2n\pi )&=0 \qquad \text {for }j=0,\dots ,2d+1,\\ S_{q,d}^{(2d+2)}(2n\pi )&= (-1)^{n+d}\sigma _{q,d}(2n\pi ) > 0. \end{aligned} \end{aligned}$$
Because the first non-zero derivative is of even order and positive, we conclude that \(S_{q,d}\) is convex at each of its zeros \(2n\pi \) for \(n=1,\dots ,q-1\). If we can prove that \(S_{q,d}\) has no other zeros in \([0,2q\pi ]\), it follows that \(S_{q,d}\ge 0\) in the whole interval.
We have now the following lemma.
Lemma 2
If \(q\ge 2\), then \(\sigma _{q,d}(\omega )\) as defined in (3.16) is a polynomial in \(\cos (\frac{\omega }{2q})\) of degree \(\le q-2\).
The result follows from the formula
$$\begin{aligned} \begin{aligned} \cos \left( \frac{\omega }{2q}(q-2p)\right)&= {\text {Re}} \left\{ \left[ \exp \left( i\frac{\omega }{2q}\right) \right] ^{q-2p} \right\} = {\text {Re}} \left\{ \left[ i\sin \left( \frac{\omega }{2q}\right) + \cos \left( \frac{\omega }{2q}\right) \right] ^{q-2p} \right\} \\&={\text {Re}} \left\{ \sum _{k=0}^{q-2p} \left( {\begin{array}{c}q-2p\\ k\end{array}}\right) i^k\sin ^k \left( \frac{\omega }{2q}\right) \cos ^{q-2p-k}\left( \frac{\omega }{2q}\right) \right\} \\&=\sum _{\begin{array}{c} k=0 \\ k \text { even } \end{array}}^{q-2p} \left( {\begin{array}{c}q-2p\\ k\end{array}}\right) (-1)^{k/2} \left( 1-\cos ^2\left( \frac{\omega }{2q}\right) \right) ^{k/2} \cos ^{q-2p-k}\left( \frac{\omega }{2q}\right) . \end{aligned} \end{aligned}$$
\(\square \)
Because of this lemma and the fact that \(\cos (\frac{\omega }{2q})\) is monotonically decreasing in \((0,2q\pi )\), we have that \(\sigma _{q,d}(\omega )\) has at most \(q-2\) zeros in the same interval.
Since \(S_{q,d}(2n\pi )=0\) for \(n=1,\dots ,q-1\), according to Rolle’s theorem there exist \(u_n\in (2n\pi ,2(n+1)\pi )\) such that \(S_{q,d}'(u_n)=0\), for \(n=1,\dots ,q-2\). We then also have \(\sigma _{q,d}(u_n)=0\), because \(\sin (\omega /2)\) has no zeros inside those intervals. So, we have found \(q-2\) distinct roots for the polynomial of Lemma 2, which is non zero and of degree \(\le q-2\). We deduce that there is exactly one zero of \(\sigma _{q,d}\) in the interval \((2n\pi ,2(n+1)\pi )\) for \(n=1,\dots ,q-2\) and no zero of \(\sigma _{q,d}\) in the interval \((0,2\pi )\) and \((2(q-1)\pi ,2q\pi )\), and this is the same for \(S'_{q,d}\). If we combine this information with the convexity of \(S_{q,d}\) at \(\omega =2n\pi \), we conclude that:
  • \(S_{q,d}\) decreases monotonically from \(S_{q,d}(0)=q\) to \(S_{q,d}(2\pi )=0\), and therefore \(S_{q,d}\ge 0\) in \([0,2\pi ]\);
  • In each interval \([2n\pi ,2(n+1)\pi ]\) for \(n=1,\dots ,q-2\), \(S_{q,d}\) increases monotonically from \(S_{q,d}(2n\pi )=0\) to \(S_{q,d}(u_n)>0\) and then decreases monotonically to \(S_{q,d}(2(n+1)\pi )=0\), therefore \(S_{q,d}\ge 0\) in \([2\pi ,2(q-1)\pi ]\);
  • \(S_{q,d}\) increases monotonically from \(S_{q,d}(2(q-1)\pi )=0\) to \(S_{q,d}(2q\pi )=q\), and therefore \(S_{q,d}\ge 0\) in \([2(q-1)\pi ,2q\pi ]\).
This proves that \(S_{q,d}(\omega )\ge 0\) for all \(0\le \omega \le 2q\pi \), and therefore \(t_p\in {\mathbb {R}}^+\) for \(p=1,\dots ,q-1\). Accordingly, we obtain the identity (3.4) and hence the stability of our numerical scheme for any \(\lambda \in \mathbb {Q}\).

3.2.5 Statement of Unconditional Stability

The stability of our numerical scheme for a general \(\lambda \in {\mathbb {R}}\) follows from the stability proof already given, thanks to the density of the rational numbers in \({\mathbb {R}}\). Let \(A:{\mathbb {R}}\rightarrow {\mathbb {R}}\) be the modulus of our Fourier symbol as a function of \(\lambda \), for a given choice of \(r_\varphi \), \(\alpha _\varphi \), \(\omega _\theta \) and \(\omega _\varphi \):
$$\begin{aligned} A(\lambda ) = |\sigma _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi )|. \end{aligned}$$
Because of the floor function that appears in the Fourier symbol (3.2), A presents discontinuities of the first kind at a set of isolated rational locations,
so that the minimum distance between two discontinuities is \(1/(1+d_b+|r_\varphi |)\). Everywhere else A is continuous, and specifically so at all irrational values of \(\lambda \). We now have two cases:
If \(\lambda \in {\mathbb {Q}}\), we have already proven that \(A(\lambda )\le 1\);
If \(\lambda \in {\mathbb {R}}\setminus {\mathbb {Q}}\), the function A is continuous in some open interval \((\lambda -\delta ,\lambda +\delta )\) with \(\delta > 0\). We now suppose that \(A(\lambda )>1\) and show that this leads to a contradiction. Because of continuity, there exists an open interval \((\lambda -\varepsilon ,\lambda +\varepsilon )\) with \(0<\varepsilon \le \delta \) where \(A > 1\). Because of the density of \({\mathbb {Q}}\) in \({\mathbb {R}}\), there exists \(\lambda ^*\in {\mathbb {Q}}\cap (\lambda -\varepsilon ,\lambda +\varepsilon )\) such that \(A(\lambda ^*)>1\), but this contradicts case 1. Therefore we obtain again that \(A(\lambda )\le 1\).
With this we have proven that \(|\sigma _{\lambda ,r_\varphi ,\alpha _\varphi }(\omega _\theta ,\omega _\varphi )|\le 1\) for all \(\lambda \in {\mathbb {R}}\), \(r_\varphi \in {{\mathbb {Z}}}\), \(\alpha _\varphi \in [0,1)\), and \((\omega _\theta ,\omega _\varphi )\in [0,2\pi ]^2\). The numerical scheme so presented is unconditionally stable.

3.3 Truncation Error and Convergence

3.3.1 Approximation Error for 1D Centered Lagrange Interpolation

We now focus on the truncation error due to 1D centered Lagrange interpolation on a uniform grid, of odd order \(2d+1\) with \(d\in {{\mathbb {N}}}\). To this end we repeat here part of the analysis done in [15], with a slight refinement on the final error estimates. The results of this section will then be used for assessing the error of our 2D field-aligned semi-Lagrangian scheme, and to compare it to the classical (non field-aligned) scheme.
Consider a function \(g:{\mathbb {R}}\rightarrow {\mathbb {C}}\) smooth enough, which we sample on a uniform grid \(z_j = j\Delta z\) with \(j\in {\mathbb {Z}}\) and \(\Delta z\in {\mathbb {R}}^*_+\). Without loss of generality, we focus on the location \(z=\alpha \Delta z\) with \(0\le \alpha \le 1\). If we write the interpolation error at \(\alpha \Delta z\) in terms of divided differences, which we reformulate in Peano form, we obtain
$$\begin{aligned} g(\alpha \Delta z) -\sum _{k=-d}^{d+1}L^d_k(\alpha )g(k\Delta z) = \Delta z^{2d+2}\frac{\prod _{\ell =-d}^{d+1}\left( \alpha -\ell \right) }{(2d+1)!} \int _{-d\Delta z}^{(d+1)\Delta z}Q^{2d+2}_{\alpha ,\Delta z}(z)\partial _z^{2d+2}g(z)dz, \end{aligned}$$
where \(Q^{2d+2}_{\alpha ,\Delta z}\) is the B-spline function over the points \(\alpha \Delta z\) and \(\ell \Delta z,\ \text {for}\ \ell =-d,\dots ,d+1\), satisfying
$$\begin{aligned} \int _{-d\Delta z}^{(d+1)\Delta z}Q^{2d+2}_{\alpha ,\Delta z}(z)dz=\frac{1}{2d+2}. \end{aligned}$$
If we introduce the linear change of coordinates \(\eta (z) = (z+d\Delta z)/((2d+1)\Delta z))\), we can write \(Q^{2d+2}_{\alpha ,\Delta z}(z)dz=B_{2d+2,\alpha }(\eta )d\eta \), where \(B_{2d+2,\alpha }\) is the B-spline function over the \(2d+3\) points
$$\begin{aligned} 0< \frac{1}{2d+1}< \dots< \frac{d}{2d+1} \le \frac{d+\alpha }{2d+1} \le \frac{d+1}{2d+1}< \dots< \frac{2d}{2d+1} < 1, \end{aligned}$$
with the (same) normalization \(\int _{0}^{1}B_{2d+2,\alpha }(\eta )d\eta =(2d+2)^{-1}\). We note that \(B_{2d+2,\alpha }(\eta )\ge 0\) for \(0\le \eta \le 1\).
The identity (3.22) then rewrites
$$\begin{aligned}&g(\alpha \Delta z) - \sum _{k=-d}^{d+1}L^d_k(\alpha )g(k\Delta z) \\&\quad = \Delta z^{2d+2}\frac{\prod _{\ell =-d}^{d+1}\left( \alpha -\ell \right) }{(2d+1)!} \int _{0}^{1}B_{2d+2,\alpha }(\eta )\partial _z^{2d+2}g((-d+(2d+1)\eta )\Delta z)d\eta . \end{aligned}$$
We now suppose that the function g is harmonic, i.e., \(g(z)=\exp (i(\omega z+\phi ))\) with \(\omega \in {\mathbb {R}}\) and \(\phi \in [0,2\pi ]\), and we proceed with estimating the maximum magnitude of the interpolation error over all possible values of \(\alpha \) and \(\phi \). Since \(\partial _z^{2d+2}g(z) = (i\omega )^{2d+2}g(z)\), the absolute value of the error is
$$\begin{aligned}&\left| g(\alpha \Delta z) - \sum _{k=-d}^{d+1}L^d_k(\alpha )g(k\Delta z) \right| \\&\quad = (\omega \Delta z)^{2d+2} \frac{\prod _{\ell =-d}^{d+1}\left| \alpha -\ell \right| }{(2d+1)!} \left| \int _{0}^{1}B_{2d+2,\alpha }(\eta )\exp (i(\omega z(\eta )+\phi ))d\eta \right| . \end{aligned}$$
The maximum magnitude of the integral factor is difficult to compute, nevertheless we can obtain an upper bound by using the triangular inequality for integrals, as
$$\begin{aligned} \left| \int _0^1 B_{2d+2,\alpha }(\eta )\exp (i(\omega z(\eta )+\phi )) d\eta \right|\le & {} \int _0^1 B_{2d+2,\alpha }(\eta ) \Bigl | \exp (i(\omega z(\eta )+\phi )) \Bigr | d\eta \\= & {} \int _0^1 B_{2d+2,\alpha }(\eta ) d\eta = \frac{1}{2d+2}, \end{aligned}$$
with the understanding that such an estimate is sharp in the limit as \(\Delta z\rightarrow 0\), which does not depend on \(\alpha \) or \(\phi \):
$$\begin{aligned} \lim _{\Delta z\rightarrow 0} \left| \int _0^1 B_{2d+2,\alpha }(\eta )\exp (i(\omega z(\eta )+\phi )) d\eta \right| = \left| \exp (i\phi ) \int _0^1 B_{2d+2,\alpha }(\eta ) d\eta \right| = \frac{1}{2d+2}. \end{aligned}$$
The product in front of the integral can be written as
$$\begin{aligned} \prod _{\ell =-d}^{d+1}|\alpha -\ell |= & {} \prod _{\ell =-d}^{0} (\alpha -\ell ) \prod _{\ell =1}^{d+1} (\ell -\alpha ) = \prod _{\ell =1}^{d+1} (\ell -(1-\alpha ))(\ell -\alpha )\\= & {} \alpha (1-\alpha ) \prod _{\ell =2}^{d+1} \left[ \left( \ell -\frac{1}{2}\right) ^2 - \left( \alpha -\frac{1}{2}\right) ^2 \right] , \end{aligned}$$
where we have extracted the \(\ell =1\) factor because it goes to zero in the limits as \(\alpha \rightarrow 0\) and as \(\alpha \rightarrow 1\), and we would like to retain such an asymptotic behavior in our estimates. All factors in the final multiplication are strictly positive and achieve their maximum value for \(\alpha =1/2\), and the missing \(\ell =1\) term has value \((1-1/2)^2=1/4\). Therefore we can write the upper bound
$$\begin{aligned} \prod _{\ell =-d}^{d+1}|\alpha -\ell | \ \le \ 4\alpha (1-\alpha ) \prod _{\ell =1}^{d+1} \left( \ell -\frac{1}{2}\right) ^2, \end{aligned}$$
which reduces to an equality for \(\alpha \in \{0,1/2,1\}\). We point out that, although this expression converges to the correct limit for \(\alpha \rightarrow 0\), it overestimates the linear rate of convergence. In other words, this upper bound is not sharp. Such an expression can be explicitly evaluated as
$$\begin{aligned} \begin{aligned} \left[ \prod _{\ell =1}^{d+1} \left( \ell -\frac{1}{2}\right) \right] ^2&= \left[ \frac{1}{2^{d+1}} \prod _{\ell =1}^{d+1} (2\ell +1) \right] ^2 = \left[ \frac{1}{2^{d+1}} \frac{\prod _{k=1}^{2d+2} k}{\prod _{\ell =1}^{d+1} 2\ell } \right] ^2 = \left[ \frac{(2d+2)!}{2^{2d+2}(d+1)!} \right] ^2 \\&= \frac{(2d+2)!}{(2^{2d+2})^2} \frac{(2d+2)!}{(d+1)!(d+1)!} = \frac{(2d+2)!}{4^{2d+2}} \left( {\begin{array}{c}2d+2\\ \phantom {2}d+1\end{array}}\right) , \end{aligned} \end{aligned}$$
where the central binomial coefficient can be approximated very accurately with the following upper bound, which is sharp in the limit as \(d\rightarrow \infty \) and can be obtained in various ways (e.g., from Stirling’s formula):
$$\begin{aligned} \left( {\begin{array}{c}2d+2\\ \phantom {2}d+1\end{array}}\right) < \frac{2^{2d+2}}{\sqrt{\pi (d+1)}}. \end{aligned}$$
Putting everything together we obtain the following upper bound, which is sharp in the limit as \(\Delta z\rightarrow 0\) and \(d\rightarrow \infty \):
$$\begin{aligned} \left| g(\alpha \Delta z) - \sum _{k=-d}^{d+1}L^d_k(\alpha )g(k\Delta z) \right| \le \left( \frac{\omega \Delta z}{2}\right) ^{2d+2} \frac{4\alpha (1-\alpha )}{\sqrt{\pi (d+1)}}. \end{aligned}$$
This formula will be used directly to construct an error bound for the 2D classical semi-Lagrangian scheme, which in turn will be the base of comparison for our 2D field-aligned method. Based on this estimate, we observe that:
The approximation error decreases with order \(2d+2\) in the discretization parameter \(\Delta z\), as expected;
In practical applications one seeks the largest value \(\Delta z\) that yields an error smaller than a certain threshold \(\varepsilon \ll 1\); regardless of the order of the polynomial, this always implies that \(\omega \Delta z < 2\), that is, at least \(\pi \) grid points must fit within the characteristic wavelength of g(z);
When the interpolation procedure is part of a semi-Lagrangian scheme, the time step size \(\Delta t\) must be taken into consideration, because it directly effects the value of \(\alpha \); particularly important is the fact that, in the limit of \(\Delta t/\Delta z\rightarrow 0\), we have \(\alpha \rightarrow 0\) and therefore the error also goes to zero. For an extended discussion over the role of \(\Delta t\) in the convergence of semi-Lagrangian schemes we refer to [15].

3.3.2 Error Estimate for Field-aligned Semi-Lagrangian Scheme

We let \(f(t_n)\) be the exact solution, and \(f^{(n)}\) the numerical solution, at time \(t_n\). We introduce some notation (see [15]): \(\varPi : f \rightarrow (f_{i,j})\) is the discretization (sampling) operator on a uniform 2D grid, and \(\mathcal {T}\) (resp. \(\widetilde{\mathcal {T}}\)) is the numerical (resp. exact) transport operator in direction \({\mathbf {b}}\), over one time step \(\Delta t\). The (global) error then reads
$$\begin{aligned} e^{(n+1)}= & {} \varPi f(t_{n+1})-f^{(n+1)} = \varPi \widetilde{\mathcal {T}} f(t_n) - \mathcal {T}\left( \varPi f(t_n)-e^{(n)}\right) \\= & {} \left( \varPi \widetilde{\mathcal {T}}-\mathcal {T}\varPi \right) f(t_n) + \mathcal {T} e^{(n)}, \end{aligned}$$
where we identify in \((\varPi \widetilde{\mathcal {T}}-\mathcal {T}\varPi )f(t_n)\) the “truncation error” introduced by the numerical scheme between time \(t_n\) and \(t_n+\Delta t\). Since the scheme is proven to be unconditionally stable, the error cannot grow in the \(L^2\)-norm when transported by the numerical scheme, i.e., \(\left\| \mathcal {T}e^{(n)}\right\| _2 \le \Vert e^{(n)}\Vert _2\). The triangular inequality then yields
$$\begin{aligned} \left\| e^{(n+1)} \right\| _2 \le \left\| (\varPi \widetilde{\mathcal {T}}-\mathcal {T}\varPi ) f(t_n) \right\| _2 + \left\| e^{(n)} \right\| _2, \end{aligned}$$
and if we proceed recursively up to time \(t_0\), where \(e^{(0)}=0\) by construction, we obtain the upper bound
$$\begin{aligned} \left\| e^{(n)} \right\| _2 \ \le \ \sum _{k=0}^{n-1} \left\| (\varPi \widetilde{\mathcal {T}}-\mathcal {T}\varPi ) f(t_k) \right\| _2, \end{aligned}$$
that is, the norm of the (global) error at time \(t_n\) cannot be larger than the sum of the norms of the previous n truncation errors. Here we made use of the discrete \(L^2\)-norm, defined as
$$\begin{aligned} \left\| f \right\| _2 = \left[ \frac{1}{N_\theta N_\varphi } \sum _{i_\theta =1}^{N_\theta } \sum _{i_\varphi =1}^{N_\varphi } \left( f_{i_\theta ,i_\varphi } \right) ^2 \right] ^{\frac{1}{2}}. \end{aligned}$$
The upper bound (3.23) provides us with an error estimate at time \(t_n\), if an upper bound for the truncation error is available. Similarly to the analysis in the previous section, we now compute the truncation error for harmonic initial condition \(f_0(\theta ,\varphi ) = \exp (i(n_\varphi \varphi +m_\theta \theta ))\), for which the exact solution is simply
$$\begin{aligned} f(t,\theta ,\varphi ) = \exp (i(n_\varphi (\varphi -b_\varphi t)+m_\theta (\theta -b_\theta t))). \end{aligned}$$
Under this assumption, the local truncation error for our field-aligned semi-Lagrangian scheme can be decomposed into two parts, as
$$\begin{aligned} \left( \varPi \widetilde{\mathcal {T}}-\mathcal {T}\varPi \right) f(t_n)_{i_\theta ,i_\varphi } = A_1+A_2, \end{aligned}$$
where \(A_1\) is the approximation error introduced by Lagrange interpolation in direction \({\mathbf {b}}\),
$$\begin{aligned} A_1 = f(t_{n},\theta _{i_\theta }-b_\theta \Delta t,\varphi _{i_\varphi }-b_\varphi \Delta t) -\sum _{k=-d_b}^{d_b+1}L^{d_b}_k(\alpha _\varphi ) f(t_n,\theta _{i_\theta }-b_\theta \Delta t_k,\varphi _{i_\varphi +r_\varphi +k}), \end{aligned}$$
and \(A_2\) is the approximation error of Lagrange interpolation along \(\theta \), which is then interpolated along \({\mathbf {b}}\):
$$\begin{aligned} A_2 = \sum _{k=-d_b}^{d_b+1}L^{d_b}_k(\alpha _\varphi )\left( f(t_n,\theta _{i_\theta }-b_\theta \Delta t_k,\varphi _{i_\varphi +r_\varphi +k})- \sum _{\ell =-d_\theta }^{d_{\theta }+1} L^{d_\theta }_\ell (\alpha _{\theta ,k}) f(t_n,\theta _{i_\theta +r_{\theta ,k}+\ell },\varphi _{i_\varphi +r_\varphi +k}) \right) . \end{aligned}$$
Here we recall the following definitions:
$$\begin{aligned} -b_\varphi \Delta t_{\phantom {k}}&= \Delta \varphi \,(r_\varphi + \alpha _\varphi ) \quad \text { with }r_\varphi \in {\mathbb {Z}} \text { and } \alpha _\varphi \in {\mathbb {R}}_{[0,1)},\\ -b_\varphi \Delta t_k&= \Delta \varphi \,(r_\varphi + k) \quad \text {with }\Delta t_k\in {\mathbb {R}} \text { and } k=-d_b,\dots ,d_b+1,\\ -b_\theta \Delta t_k&= \Delta \theta \,(r_{\theta ,k} + \alpha _{\theta ,k}) \quad \text { with }r_{\theta ,k}\in {\mathbb {Z}} \text { and } \alpha _{\theta ,k}\in {\mathbb {R}}_{[0,1)}. \end{aligned}$$
Furthermore, in the following calculation we will write \(\theta _{i_\theta } = 2\pi i_\theta /N_\theta \) and \(\varphi _{i_\varphi } = 2\pi i_\varphi /N_\varphi \). We first compute \(A_2\): similarly to the previous section, we formulate the interpolation error in integral form and obtain
$$\begin{aligned} A_2= & {} \left( i\frac{m_\theta }{N_\theta }\right) ^{2d_\theta +2}\frac{(2\pi )^{2d_\theta +2}}{(2d_\theta +1)!}f(t_n,\theta _{i_\theta },\varphi _{i_\varphi +r_\varphi }) \sum _{k=-d_b}^{d_b+1}L^{d_b}_k(\alpha _\varphi )\\&e^{2\pi i\left( \frac{m_\theta }{N_\theta } r_{\theta ,k}+k\frac{n_\varphi }{N_\varphi }\right) }\prod _{\ell =-d_\theta }^{d_\theta +1}\left( \alpha _{\theta ,k}-\ell \right) \int _{0}^{1}B_{2d_\theta +2,\alpha _{\theta ,k}}(\sigma )e^{2\pi i(-d_\theta +(2d_\theta +1)\sigma )\frac{m_\theta }{N_\theta }}d\sigma . \end{aligned}$$
We then have
$$\begin{aligned} |A_2|\le & {} \left( \frac{|m_\theta |}{N_\theta }\right) ^{2d_\theta +2} \frac{(2\pi )^{2d_\theta +2}}{(2d_\theta +1)!}\int _{0}^{1} \left| \sum _{k=-d_b}^{d_b+1}L^{d_b}_k(\alpha _\varphi )\right. \\&\left. \quad e^{2\pi i\left( \frac{m_\theta }{N_\theta } r_{\theta ,k} +k\frac{n_\varphi }{N_\varphi }\right) } \prod _{\ell =-d_\theta }^{d_\theta +1}\left( \alpha _{\theta ,k}-\ell \right) B_{2d_\theta +2,\alpha _{\theta ,k}}(\sigma )\right| d\sigma . \end{aligned}$$
We then get
$$\begin{aligned} |A_2|\le \left( \frac{|m_\theta |}{N_\theta }\right) ^{2d_\theta +2} \frac{(2\pi )^{2d_\theta +2}}{(2d_\theta +2)!} \sum _{k=-d_b}^{d_b+1}|L^{d_b}_k(\alpha _\varphi )| \prod _{\ell =-d_\theta }^{d_\theta +1}\left| \alpha _{\theta ,k}-\ell \right| . \end{aligned}$$
As in the analysis for 1D interpolation, we can provide an error bound for the product term and write therefore
$$\begin{aligned} |A_2| \le \left( \frac{\pi |m_\theta |}{N_\theta }\right) ^{2d_\theta +2} \frac{4}{\sqrt{\pi (d_\theta +1)}} \sum _{k=-d_b}^{d_b+1} |L^{d_b}_k(\alpha _\varphi )|\alpha _{\theta ,k}(1-\alpha _{\theta ,k}). \end{aligned}$$
For \(A_1\) we have, writing \(n_b = m_\theta \frac{b_\theta }{b_\varphi }+n_\varphi \)
$$\begin{aligned} A_1= & {} \left( i\frac{n_b}{N_\varphi }\right) ^{2d_b+2}\frac{(2\pi )^{2d_b+2}}{(2d_b+1)!} f\left( t_n,\theta _{i_\theta }+\frac{b_\theta }{b_\varphi }r_\varphi ,\varphi _{i_\varphi +r_\varphi }\right) \\&\prod _{\ell =-d_b}^{d_b+1}\left( \alpha _\varphi -\ell \right) \int _{0}^{1}B_{2d_b+2,\alpha _\varphi }(\sigma )e^{2\pi i(-d_b+(2d_b+1)\sigma )\frac{n_b}{N_\varphi }}d\sigma , \end{aligned}$$
which leads to
$$\begin{aligned} |A_1|\le \left( \frac{|n_b|}{N_\varphi }\right) ^{2d_b+2}\frac{(2\pi )^{2d_b+2}}{(2d_b+2)!} \prod _{\ell =-d_b}^{d_b+1}\left| \alpha _\varphi -\ell \right| , \end{aligned}$$
and therefore
$$\begin{aligned} |A_1| \le \left( \frac{\pi |n_b|}{N_\varphi }\right) ^{2d_b+2} \frac{4\alpha _\varphi (1-\alpha _\varphi )}{\sqrt{\pi (d_b+1)}}. \end{aligned}$$
Now we want an upper bound for the \(L^2\)-norm of the global error at time \(t_n\). We have
$$\begin{aligned} \begin{aligned} \left\| e^{(n)}\right\| _2&\le \sum _{k=0}^{n-1} \left[ \frac{1}{N_\theta N_\varphi } \sum _{i_\theta =1}^{N_\theta } \sum _{i_\varphi =1}^{N_\varphi } \left( [A_1+A_2]^{(k)}_{i_\theta ,i_\varphi } \right) ^2 \right] ^{\frac{1}{2}} \le \sum _{k=0}^{n-1} \max _{i_\theta ,i_\varphi } \left| [A_1+A_2]^{(k)}_{i_\theta ,i_\varphi } \right| \\&\le n \max _{i_\theta ,i_\varphi ,k} \left| [A_1]^{(k)}_{i_\theta ,i_\varphi } \right| + n \max _{i_\theta ,i_\varphi ,k} \left| [A_2]^{(k)}_{i_\theta ,i_\varphi } \right| . \end{aligned} \end{aligned}$$
Our estimates for \(|A_1|\) and \(|A_2|\) are independent of the grid indices \(i_\theta \) and \(i_\varphi \), and therefore they also apply to the maximum over the domain. Moreover, we observe that such estimates apply to any time instant, because they are invariant to the rigid translation that the exact solution undergoes in time. Accordingly, our upper bound for the global error of the field-aligned semi-Lagrangian scheme is simply \(\Vert e^{(n)}\Vert _2 \le n|A_1| + n|A_2|\), with \(|A_1|\) bounded by (3.26) and \(|A_2|\) bounded by (3.25):
$$\begin{aligned} \left\| e^{(n)}\right\| _2\le & {} n \left( \frac{\pi |m_\theta |}{N_\theta }\right) ^{2d_\theta +2} \frac{4\sum _{k=-d_b}^{d_b+1}|L^{d_b}_k(\alpha _\varphi )| \alpha _{\theta ,k}(1-\alpha _{\theta ,k})}{\sqrt{\pi (d_\theta +1)}} \nonumber \\&\quad +\, n\left( \frac{\pi |n_b|}{N_\varphi }\right) ^{2d_b+2} \frac{4\alpha _\varphi (1-\alpha _\varphi )}{\sqrt{\pi (d_b+1)}}. \end{aligned}$$
We notice that for sufficiently small values of \(b_\theta \) we have \(r_{\theta ,k}=0\) and \(\alpha _{\theta ,k}(1-\alpha _{\theta ,k})\propto |b_\theta |\). Therefore in the limit as \(b_\theta \rightarrow 0\) the first error term goes to zero and we recover the classical error bound for 1D semi-Lagrangian schemes with \(n_b=n_\varphi \). In the following discussion we will assume that \(b_\theta \ne 0\).
We now want to assess the consistency of the scheme, that is, whether at a fixed time \(t_n=n\Delta t=T\) the global error goes to zero in the limit as \(\Delta t,\Delta \theta ,\Delta \varphi \rightarrow 0\) (or equivalently in the limit as \(n,N_\theta ,N_\varphi \rightarrow \infty \)). If we assume that the three parameters converge to zero according to the algebraic relationships
$$\begin{aligned} \Delta \varphi = c\Delta \theta , \qquad \Delta t = \Delta \theta ^\gamma , \qquad c,\gamma \in {\mathbb {R}}_+^*, \end{aligned}$$
we can distinguish between two different cases:
If \(0<\gamma \le 1\), the Courant numbers along \(\theta \) and \(\varphi \) either grow as \(\Delta t\rightarrow 0\) (for \(\gamma <1\)) or they are constant (\(\gamma =1\)), therefore it is appropriate to use the upper bound \(4\alpha (1-\alpha )\le 1\). Moreover, we use the identities
$$\begin{aligned} \begin{aligned} n&= \frac{T}{\Delta t} = \frac{T}{\Delta \theta ^\gamma } = T \left( \frac{2\pi }{N_\theta } \right) ^{-\gamma } = T \left( \frac{\pi |m_\theta |}{N_\theta } \right) ^{-\gamma } \left( \frac{|m_\theta |}{2} \right) ^\gamma , \\ n&= \frac{T}{\Delta t} = \frac{T}{(\Delta \varphi /c)^\gamma } = T \left( \frac{2\pi }{c N_\varphi } \right) ^{-\gamma } = T \left( \frac{\pi |n_b|}{N_\varphi } \right) ^{-\gamma } \left( \frac{c |n_b|}{2} \right) ^\gamma , \end{aligned} \end{aligned}$$
to obtain
$$\begin{aligned} \left\| e^{(n)}\right\| _2\le & {} T\left( \frac{\pi |m_\theta |}{N_\theta }\right) ^{2d_\theta +2-\gamma } \frac{(|m_\theta |/2)^\gamma \,G_{d_b}}{\sqrt{\pi (d_\theta +1)}}+ T\left( \frac{\pi |n_b|}{N_\varphi }\right) ^{2d_b+2-\gamma } \frac{(c|n_b|/2)^\gamma }{\sqrt{\pi (d_b+1)}},\nonumber \\ \end{aligned}$$
$$\begin{aligned} G_{d} = \max _{\alpha \in [0,1]} \left( \sum _{k=-d}^{d+1}\left| L^{d}_k(\alpha )\right| \right) , \qquad d\in {\mathbb {N}}, \end{aligned}$$
is the central local maximum of the Lebesgue function for Lagrange interpolation on \(2d+2\) equispaced nodes [16, 17]. Such a maximum is obtained for \(\alpha =1/2\), and corresponds to the Landau constant [18, 19]. The asymptotic behavior \(G_d\sim \log (d)/\pi \) for \(d\rightarrow \infty \) was predicted by Landau [20], and various bounds valid for all d have been given by many authors (e.g., see [21]). Here we report the computed values of practical interest:
$$\begin{aligned} \begin{aligned} G_0&= 1 , \quad&G_1&= 1.25, \quad&G_2&\approx 1.39, \quad&G_3&\approx 1.49, \quad&G_4&\approx 1.56, \\ G_5&\approx 1.62, \quad&G_6&\approx 1.67, \quad&G_7&\approx 1.72, \quad&G_8&\approx 1.76, \quad&G_9&\approx 1.79. \end{aligned} \end{aligned}$$
If \(\gamma > 1\), the Courant numbers along \(\theta \) and \(\varphi \) go to zero, and therefore for \(\Delta t\) sufficiently small we have one of these two situations:
$$\begin{aligned} \text {a) if } b_\varphi < 0: {\left\{ \begin{array}{ll} r_\varphi = 0 \\ \alpha _\varphi \rightarrow 0^+ \\ \alpha _{\theta ,0} = 0 \end{array}\right. } \qquad \text {b) if } b_\varphi > 0: {\left\{ \begin{array}{ll} r_\varphi = -1 \\ \alpha _\varphi \rightarrow 1^- \\ \alpha _{\theta ,1} = 0 \end{array}\right. } \end{aligned}$$
For the sake of brevity, we only consider case (a); since our Lagrange interpolant is constructed on an even number of equispaced nodes, it can be shown that the final result of this discussion is identical for case (b). As \(\alpha _\varphi \) goes to zero, we now have
$$\begin{aligned} L^{d_b}_0(\alpha _\varphi ) \underset{0}{\sim } 1, \qquad L^{d_b}_k(\alpha _\varphi ) \underset{0}{\sim } \Biggl ( \frac{1}{k} \prod _{\begin{array}{c} \ell =-d_b\\ \ell \notin \{0,k\} \end{array}}^{d_b+1} \frac{\ell }{\ell -k} \Biggr ) \alpha _\varphi = D_k^{d_b} \alpha _\varphi \quad \text {for}~k\ne 0. \end{aligned}$$
In general for \(b_\theta \ne 0\) we have \(\alpha _{\theta ,k}\ne 0\) for \(k\ne 0\). Therefore, if we use the upper bound \(4\alpha _{\theta ,k}(1-\alpha _{\theta ,k})\le 1\) and the asymptotic equivalence
$$\begin{aligned} \sum _{k=-d_b}^{d_b+1}|L^{d_b}_k(\alpha _\varphi )| \underset{0}{\sim } \Biggl ( \sum _{\begin{array}{c} k=-d_b\\ k\ne 0 \end{array}}^{d_b+1} \left| D_k^{d_b} \right| \Biggr ) \alpha _\varphi = C_{d_b} \alpha _\varphi , \end{aligned}$$
we obtain the estimate
$$\begin{aligned} 4 \sum _{k=-d_b}^{d_b+1}|L^{d_b}_k(\alpha _\varphi )| \alpha _{\theta ,k}(1-\alpha _{\theta ,k}) \le \left( C_{d_b} + \mathcal {O}(\Delta t) \right) \alpha _\varphi , \end{aligned}$$
where the \(\mathcal {O}(\Delta t)\alpha _\varphi \) term represents the error that results from truncating the MacLaurin expansion of \(\sum _{k=-d_b}^{d_b+1}|L^{d_b}_k(\alpha _\varphi )|\). Finally, we use this last estimate together with the identities
$$\begin{aligned} \begin{aligned} n \alpha _\varphi&= \frac{T}{\Delta t}\frac{|b_\varphi |\Delta t}{\Delta \varphi } = T \left( \frac{2\pi }{N_\varphi } \right) ^{-1} |b_\varphi | = T \left( \frac{\pi |n_b|}{N_\varphi } \right) ^{-1} \frac{|b_\varphi n_b|}{2}, \\ n \alpha _\varphi&= \frac{T}{\Delta t}\frac{|b_\theta |\Delta t}{\Delta \theta } \left| \frac{b_\varphi \Delta \theta }{b_\theta \Delta \varphi } \right| = T \left( \frac{2\pi }{N_\theta } \right) ^{-1} \left| \frac{b_\theta }{\lambda } \right| = T \left( \frac{\pi |m_\theta |}{N_\theta } \right) ^{-1} \frac{|b_\theta m_\theta |}{2|\lambda |}, \\ \end{aligned} \end{aligned}$$
to get the approximate upper bound (not valid in the limit as \(b_\theta \rightarrow 0\))
$$\begin{aligned} \left\| e^{(n)}\right\| _2\le & {} T\left( \frac{\pi |m_\theta |}{N_\theta }\right) ^{2d_\theta +1} \frac{2 |b_\theta m_\theta |}{\sqrt{\pi (d_\theta +1)}} \left[ \frac{C_{d_b}}{|4\lambda |}+O(\Delta t) \right] \nonumber \\&\quad + \,T\left( \frac{\pi |n_b|}{N_\varphi }\right) ^{2d_b+1} \frac{2 |b_\varphi n_b|}{\sqrt{\pi (d_b+1)}}. \end{aligned}$$
The magnitude of \(\lambda = b_\theta N_\theta /(b_\varphi N_\varphi )\) is discussed in the next section, where a comparison with the classical scheme is presented. Here we compute \(C_{d_b}\), which grows logarithmically with \(d_b\) and has values
$$\begin{aligned} \begin{aligned} C_0&= 1 , \quad&C_1&= 1.5 , \quad&C_2&\approx 1.83, \quad&C_3&\approx 2.08, \quad&C_4&\approx 2.28, \\ C_5&= 2.45, \quad&C_6&\approx 2.59, \quad&C_7&\approx 2.71, \quad&C_8&\approx 2.83, \quad&C_9&\approx 2.93. \end{aligned} \end{aligned}$$
For all possible values of \(\gamma \), we have shown that our field-aligned semi-Lagrangian scheme is consistent (i.e., the error goes to zero as \(\Delta t,\Delta \theta ,\Delta \varphi \rightarrow 0\)). Given stability and consistency, we have proven convergence of our method.
Remark 2
We point out that the limit as \(\gamma \rightarrow 0\) corresponds to a constant \(\Delta t\), i.e., no time refinement: the scheme correctly converges to the exact solution as \(N_\theta \) and \(N_\varphi \) are increased, and our first estimate (3.28) applies. Conversely, the limit as \(\gamma \rightarrow \infty \) corresponds to constant \(N_\theta \) and \(N_\varphi \), i.e., no spatial refinement: our second estimate (3.29) applies, because it is independent of \(\gamma \), and the error goes to a constant value, without diverging, as \(\Delta t\) is reduced.

3.3.3 Comparison with Classical (Not Aligned) Approach

If a standard tensor-product 2D interpolation is used, one could show that the two 1D interpolation operators exactly commute, and their corresponding approximation errors independently contribute to the local truncation error. As a result, an upper bound for the \(L^2\)-norm of the global error is simply
$$\begin{aligned} \left\| e^{(n)}\right\| _2 \le n \left( \frac{\pi |m_\theta |}{N_\theta }\right) ^{2d_\theta +2} \frac{4\alpha _\theta (1-\alpha _\theta )}{\sqrt{\pi (d_\theta +1)}} + n \left( \frac{\pi |n_\varphi |}{N_\varphi }\right) ^{2d_\varphi +2} \frac{4\alpha _\varphi (1-\alpha _\varphi )}{\sqrt{\pi (d_\varphi +1)}}. \end{aligned}$$
By comparing (3.27) with (3.30), we immediately notice that the second error term is much smaller in the field-aligned case if \(|n_b|<|n_\varphi |\), that is, if the gradients along \({\mathbf {b}}\) are smaller than the gradients along \(\varphi \). Specifically, if we assume that \(d_\varphi =d_b=d\), the error is reduced by a factor \((n_b/n_\varphi )^{2d+2}\). Vice versa, if we seek to reduce the number of points along the \(\varphi \) direction for a given error level, then the field aligned scheme allows us to use only \(N_\varphi |n_b/n_\varphi |\) points.
The first error term is more difficult to compare, because it has a more complicated form in the field aligned case. In general terms, we can say that the error constant is somewhat larger because of the additional interpolations that are required; in order to quantify this overhead, we now look at the rate of convergence of the classical scheme for the various values of \(\gamma \):
For \(0\le \gamma \le 1\) we have the estimate
$$\begin{aligned} \left\| e^{(n)}\right\| _2 \le T\left( \frac{\pi |m_\theta |}{N_\theta }\right) ^{2d_\theta +2-\gamma } \frac{(|m_\theta |/2)^\gamma }{\sqrt{\pi (d_\theta +1)}} + T\left( \frac{\pi |n_\varphi |}{N_\varphi }\right) ^{2d_\varphi +2-\gamma } \frac{(c|n_\varphi |/2)^\gamma }{\sqrt{\pi (d_\varphi +1)}}, \end{aligned}$$
therefore the first error term of the field-aligned scheme in (3.28) is larger by a factor equal to the Landau constant \(G_{d_b}\), which is smaller than 2 for the cases of practical interest;
For \(\gamma >1\) we have the estimate
$$\begin{aligned} \left\| e^{(n)}\right\| _2 \le T\left( \frac{\pi |m_\theta |}{N_\theta }\right) ^{2d_\theta +1} \frac{2 |b_\theta m_\theta |}{\sqrt{\pi (d_\theta +1)}} + T\left( \frac{\pi |n_\varphi |}{N_\varphi }\right) ^{2d_\varphi +1} \frac{2 |b_\varphi n_\varphi |}{\sqrt{\pi (d_\varphi +1)}}, \end{aligned}$$
therefore the first error term of the field-aligned scheme in (3.29) is multiplied by a factor \([C_{d_b}/|4\lambda |+O(\Delta t)]\). We have already shown that \(C_d<3\) for \(d\le 9\), therefore \(C_{d_b}/4<1\) for the cases of practical interest. It now remains to see if \(|\lambda |\ge 1\), which is not an obvious task given that both \(|b_\theta /b_\varphi |\) and \(N_\varphi /N_\theta \) are small numbers in practice. Here we assume that \(|n_b/n_\varphi | \ll 1\), which is the condition that justifies the use of a field-aligned approach. An appropriate mesh for the classical scheme would require \(c=N_\theta /N_\varphi \approx |m_\theta /n_\varphi |\), which yields the estimate
$$\begin{aligned} |\lambda | = \frac{b_\theta N_\theta }{b_\varphi N_\varphi } \approx \left| \frac{b_\theta m_\theta }{b_\varphi n_\varphi } \right| = \left| \frac{b_\theta }{b_\varphi } \frac{1}{n_\varphi } \frac{b_\varphi }{b_\theta }(n_b-n_\varphi ) \right| = \left| \frac{n_b}{n_\varphi } - 1 \right| \approx 1, \end{aligned}$$
while an appropriate mesh for the field-aligned scheme would be coarser in \(\varphi \), specifically \(c=N_\theta /N_\varphi \approx |m_\theta /n_b|\), yielding
$$\begin{aligned} |\lambda | \approx \left| \frac{b_\theta m_\theta }{b_\varphi n_\varphi } \frac{n_\varphi }{n_b} \right| = \left| 1 - \frac{n_\varphi }{n_b} \right| \gg 1. \end{aligned}$$
Therefore, we can say that \(|\lambda |\ge 1\) in all situations where the mesh is not overly refined in \(\varphi \). This leads to \(C_{d_b}/|4\lambda |<1\): for sufficiently small \(\Delta t\) the first error term is smaller for the field-aligned scheme than for the classical scheme.
Overall we can conclude that the field-aligned semi-Lagrangian scheme allows for important computational savings, of the order of \(|n_\varphi /n_b|\), for those situations where the gradients are smaller along \({\mathbf {b}}\) than along \(\varphi \). The price to pay is an increased error constant for convergence in \(N_\theta \). Such an increase is negligible for \(0\le \gamma \le 1\), which are the conditions where refinement usually occurs. In the unusual situation where the \(\Delta t\) refinement dominates (\(\gamma >1\)), the increase may be substantial only if the mesh is overly refined in \(\varphi \) (which are not the conditions in which we intend to use the field-aligned scheme). In all cases, the order of convergence is unaffected.

4 A Screw Pinch Model in Cylindrical Geometry with Selalib

Section 3 extensively analyzed a field-aligned semi-Lagrangian algorithm for solving the constant advection equation on a 2D periodic domain. In particular, the error estimates in Sect. 3.3 carefully described the conditions where the new algorithm is expected to greatly outperform the standard (i.e., not field-aligned) approach. Such analytical results give a solid theoretical basis to previous empirical observations [22]: consistently with the present error estimates, the measured error was found to depend on the ratio \({n_\varphi /N_\varphi }\) for the standard approach and on \({n_b/N_\varphi }\) for the field-aligned algorithm. Since the new method targets applications with strong plasma anisotropy, such that \({n_b \ll n_\varphi }\), it allows working with a much smaller \(N_\varphi \) for an equivalent error. Since the CPU time is roughly proportional to \(N_\varphi \), one can see the advantage of the new method for strongly anisotropic problems, both in terms of CPU time and in terms of storage.
In order to validate the field-aligned approach for application to plasma kinetics, in this section we present a first simplified gyrokinetic simulation, developed in the framework of the Selalib library [23]. The model consists of a 4D drift-kinetic equation in cylindrical geometry, with an oblique magnetic field as defined in (1.9); it is a generalization of the case with a uniform magnetic field in the z direction (corresponding to \(\iota (r)=0\) and thus \(\zeta (r)=0\) in (1.9)), which has been first developed in [5] and then reproduced in [24] for example. The complete derivation of the model is given in “Appendix A”. By virtue of operator splitting, one of the equations to be solved is exactly the same as in Sect. 3, therefore we use the same algorithm presented there, but with one notable difference: instead of Lagrange interpolation in the \(\theta \) direction, we prefer using spline interpolation, as this benefits from a lower error for a given polynomial degree.
In the uniform case, we are able to check the linear phase behaviour by solving numerically the dispersion relation and compare the simulation output with it (see also [25, 26]). Note that the dispersion relation depends on \(k_\parallel \): this permits to compare simulations in the oblique and uniform case, in order to check the correctness of the simulations in the oblique case, as we will see. Another (more straightforward) way to validate the code will be to double the number of points along the \(\varphi \) direction (in practice, we will compare \(N_\varphi =32\) with \(N_\varphi =64\)) and to observe that the results do not significantly change (convergence of numerical discretizations). We could also have compared the code with a standard (i.e., not using a field aligned interpolation) approach with a refined mesh, but this would have required to develop the corresponding code. The latter approach is not tackled in Sect. 4, but it will be employed in Sect. 5 in the framework of the Gysela code.

4.1 Model Equations

We look for \(f=f(t,r,\theta ,z,v_\parallel )\) satisfying
$$\begin{aligned} \partial _t f +[\phi ,f] + v_\parallel \nabla _\parallel f - \nabla _\parallel \phi \, \partial _{v_\parallel } f = 0, \end{aligned}$$
$$\begin{aligned}{}[\phi ,f] = -\frac{\partial _\theta \phi }{rB_0}\partial _rf + \frac{\partial _r\phi }{rB_0}\partial _\theta f,\quad \nabla _\parallel = \mathbf {b}\cdot \nabla , \end{aligned}$$
so that
$$\begin{aligned} \partial _t f -\frac{\partial _\theta \phi }{rB_0}\partial _r f +\left( \frac{\partial _r\phi }{rB_0}+v_\parallel \frac{b_\theta }{r}\right) \partial _\theta f +v_\parallel b_z \partial _z f -\left( b_\theta \frac{\partial _\theta \phi }{r}+b_z\partial _z\phi \right) \partial _{v_\parallel } f = 0, \end{aligned}$$
for \(t\in [0,t_\text {end}]\), \((r,\theta ,z) \in [r_\mathrm{min},r_\mathrm{max}]\times [0,2\pi ]\times [0,2\pi R_0]\), and \(v_\parallel \in [-v_\text {max},v_\text {max}]\). Here, we have \({z=R_0\varphi }\) and \({|B_0|=1}\). The self-consistent potential \(\phi =\phi (t,r,\theta ,z)\) solves the quasi-neutrality equation without zonal flow
$$\begin{aligned} -\left[ \partial _r^2\phi +\left( \frac{1}{r} +\frac{\partial _r n_0}{n_0}\right) \partial _r \phi +\frac{1}{r^2}\partial _{\theta }^2 \phi \right] + \frac{1}{T_e}\phi \,=\, \frac{1}{n_0} \int _{-\infty }^{+\infty } (f-f_{eq})\, dv_\parallel . \end{aligned}$$
When \(\iota =\frac{b_\theta /r}{b_z/R_0}=0\), we recover the classical drift kinetic model given in [5, 24] for example. A similar model has been simulated in [27], with \(\iota =0.8\) as an example, using a Particle in Cell method.
We note that all quantities appearing in these equations are non-dimensional. The equations themselves can be derived from (1.1), (1.3) and (1.5) by neglecting terms in power of \(\iota r/R_0\) (see “Appendix A”).
The boundary conditions on f are the following:
  • Periodicity along \(\theta \), z and \(v_\parallel \);
  • Zeroth-order extrapolation along r, i.e., we give values to f outside the domain (for interpolation at the foot of the characteristic) according to the scheme
    $$\begin{aligned} f(t,r,\theta ,z,v_\parallel ) = {\left\{ \begin{array}{ll} f(t,r_{\min },\theta ,z,v_\parallel ) &{} \text {if }r<r_{\min },\\ f(t,r_{\max },\theta ,z,v_\parallel ) &{} \text {if }r>r_{\max }. \end{array}\right. } \end{aligned}$$
The boundary conditions on \(\phi \) are the following:
  • Periodicity along \(\theta \) and z;
  • Neumann mode 0 (see [24]) at \(r=r_{\min }\), that is, if we decompose \(\phi \) into its Fourier modes \(\widehat{\phi }_k\) along \(\theta \):
    • homogeneous Neumann boundary condition for the Fourier mode 0 (\(\partial _r\widehat{\phi }_0(t,r_{\min })=0\)), i.e., \(\int _0^{2\pi } \partial _r\phi (t,r_{\min },\theta ) d\theta = 0\);
    • homogeneous Dirichlet boundary condition for all other Fourier modes (\(\widehat{\phi }_k(t,r_{\min })=0\) \(\forall k\)), i.e., \(\partial _\theta \phi (t,r_{\min },\theta ) = 0\).
  • Homogeneous Dirichlet at \(r=r_{\max }\), that is \(\phi (t,r_{\max },\theta )=0\);
The initial function is given by
$$\begin{aligned} f(t=0,r,\theta ,z,v_\parallel ) = f_\mathrm{eq}(r,v_\parallel ) \left[ 1+\epsilon \exp \left( -\frac{(r-r_p)^2}{\delta r}\right) \cos \left( m\theta +\frac{n}{R_0}z\right) \right] , \end{aligned}$$
where the equilibrium function is
$$\begin{aligned} f_\mathrm{eq}(r,v_\parallel ) = \frac{n_0(r)}{\sqrt{2\pi T_i(r)}} \exp \left( -\frac{v_\parallel ^2}{2T_i(r)}\right) . \end{aligned}$$
The radial profiles \(\{T_i,T_e,n_0\}\) have the analytical expressions
$$\begin{aligned} \mathcal {P}(r) = C_\mathcal {P}\exp \left( -\kappa _\mathcal {P}\, \delta r_{\mathcal {P}}\tanh \left( \frac{r-r_p}{\delta r_{\mathcal {P}}}\right) \right) ,\quad \mathcal {P}\in \{T_i,T_e,n_0\}, \end{aligned}$$
where the constants are
$$\begin{aligned} \ C_{T_i}=C_{T_e}=1,\quad C_{n_0}=\frac{r_\mathrm{max}-r_\mathrm{min}}{ \int _{r_\mathrm{min}}^{r_\mathrm{max}}\exp \left( -\kappa _{n_0}\delta r_{n_0}\tanh \left( \frac{r-r_p}{\delta r_{n_0}}\right) \right) dr}. \end{aligned}$$
The dispersion relation reads (see “Appendix B”)
$$\begin{aligned}&-\left[ \partial _r^2 +\left( \frac{1}{r}+\frac{\partial _rn_0}{n_0}\right) \partial _r -\left( \frac{m^2}{r^2}+\frac{1}{T_e}\right) \right] \phi _{m,n,\omega }(r) \\&\quad = \left\{ -\frac{1}{T_i}(1+\tilde{z}Z(\tilde{z}))+ \frac{m}{k^*rB_0}\left[ Z(\tilde{z})\bigg ( \frac{\partial _r n_0}{n_0} -\frac{\partial _r T_i}{2T_i} \bigg ) +\tilde{z}(1+\tilde{z}Z(\tilde{z}))\frac{\partial _r T_i}{T_i} \right] \right\} \phi _{m,n,\omega }(r), \end{aligned}$$
with \(\tilde{z}=\omega /k^*\), \(k^*=k_\parallel \sqrt{2T_i}\), and \(k_\parallel =\left( b_\theta m/r + b_z n/R_0\right) \). Here Z is the so-called ‘plasma dispersion function’ [28], defined as
$$\begin{aligned} Z(u)= & {} \frac{1}{\sqrt{\pi }}\int _{-\infty }^{+\infty }\frac{\exp (-x^2)}{x-u}dx \\= & {} i\sqrt{\pi }\exp (-u^2)(1+\text {erf}(iu)),\\ \text {erf}(x)= & {} \frac{2}{\sqrt{\pi }}\int _0^x \exp (-t^2)dt. \end{aligned}$$
We notice that the dispersion relation depends on m and \(k_\parallel \) but not directly on n. This means that taking different values of \(\iota \) and n but with same m and \(k_\parallel \) will lead to the same dispersion relation.

4.2 Numerical Methods

For time-stepping of (4.1) we use a predictor-corrector scheme closely related to the explicit midpoint rule for ordinary differential equations: starting from the solution at time t, the fields at time \(t+\Delta t/2\) are evaluated to first order accuracy in \(\Delta t\) (predictor), and are then used to update the solution at time \(t+\Delta t\) to second order accuracy (corrector). Both the predictor and the corrector algorithms are splitting methods, where the 4D gyrokinetic Vlasov equation (4.1) is decomposed into three separate advection equations:
2D advection on a magnetic flux surface \((\theta ,z)\), with constant velocity \(v_\parallel {\mathbf {b}}\),
$$\begin{aligned} \partial _t f + v_\parallel \nabla _\parallel f = 0; \end{aligned}$$
1D advection along \(v_\parallel \), with constant velocity \(-\nabla _\parallel \tilde{\phi }\),
$$\begin{aligned} \partial _t f - \nabla _\parallel \tilde{\phi }\, \partial _{v_\parallel } f = 0; \end{aligned}$$
2D advection on a poloidal plane \((r,\theta )\),
$$\begin{aligned} \partial _t f + [\tilde{\phi },f] = 0. \end{aligned}$$
Here \(\tilde{\phi }(r,\theta ,z)\) is a constant-in-time approximation of the time varying field \(\phi (t,r,\theta ,z)\). The three equations above are all solved using backward semi-Lagrangian methods. Specifically, for equation A we use the field-aligned algorithm described in Sect. 3, with a slight modification: we use cubic spline interpolation in the \(\theta \) direction, and 5th order Lagrange interpolation (field-aligned) in the z direction. For equation B we use 1D cubic spline interpolation, and the parallel gradient of \(\tilde{\phi }\) is computed by 6th order finite differences (field-aligned) in the z direction. For equation C we use 2D tensor-product cubic spline interpolation in the \((r,\theta )\) plane, and since the flow field is not uniform, we calculate the feet of the 2D characteristic trajectories by means of the Verlet algorithm: let \(\dot{X} = u_1(X,Y)\) and \(\dot{Y} = u_2(X,Y)\) be the characteristic equations of C, and \((X^{n+1},Y^{n+1})=(r_i,\theta _j)\) be the final position of one characteristic trajectory at time \(t_{n+1}\); the foot \((X^n,Y^n)\) of the characteristic is calculated as
$$\begin{aligned} \begin{aligned} X^*&=\ X^{n+1} - \frac{\Delta t}{2}\ u_1(X^*,Y^{n+1}),\\ Y^n&=\ Y^{n+1} - \frac{\Delta t}{2} \left( u_2(X^*,Y^{n+1}) + u_2(X^*,Y^n) \right) ,\\ X^n&=\ X^{*\phantom {+1}} - \frac{\Delta t}{2}\ u_1(X^*,Y^n). \end{aligned} \end{aligned}$$
We use Lie splitting (1st order) as predictor and Strang splitting (2nd order) as corrector; the complete time-stepping algorithm then reads:
Compute \(\tilde{\phi }\) from \(f^n\) by solving the quasi-neutrality equation (4.2);
Compute \(\tilde{f}^{n+1/2}\) using Lie splitting: \(\tilde{f}^{n+1/2} = C(\frac{\Delta t}{2}) B(\frac{\Delta t}{2}) A(\frac{\Delta t}{2}) f^n\);
Compute \(\tilde{\phi }\) from \(\tilde{f}^{n+1/2}\) by solving (4.2) again;
Compute \(f^{n+1}\) using Strang splitting: \(f^{n+1} = A(\frac{\Delta t}{2}) B(\frac{\Delta t}{2}) C(\Delta t) B(\frac{\Delta t}{2}) A(\frac{\Delta t}{2}) f^n\).
The quasi-neutrality equation (4.2) is an elliptic partial differential equation in the variables \((r,\theta )\), therefore it can be solved independently on each poloidal plane \(z=z^*\). Taking advantage of the linearity of the differential operator and of the periodicity of the domain, we apply the discrete Fourier transform in \(\theta \) to both sides of (4.2). Since the factor in front of \(\partial ^2_\theta \) does not depend on \(\theta \) and the boundary conditions in r are homogeneous, each Fourier coefficient \(\hat{\phi }_m(r)\) solves a separate 1D boundary value problem on \([r_{\min },r_{\max }]\) and is independent of the other coefficients:
$$\begin{aligned} -\left[ \partial _r^2 + \left( \frac{1}{r} {+} \frac{\partial _r n_0(r)}{n_0(r)} \right) \partial _r - \left( \frac{m^2}{r^2} {+} \frac{1}{T_e(r)} \right) \right] \hat{\phi }_m(r) {=} \hat{\rho }_m(r), \qquad m=0,1,\dots ,N_\theta -1. \end{aligned}$$
For each mode m, this ordinary differential equation is collocated at the grid points \(r=r_i\), and the derivatives are approximated by 2nd-order central finite differences. Once the proper boundary conditions are taken into account (see previous section), calculating \(\{\hat{\phi }_m(r_i):\forall i\}\) requires the solution of a tridiagonal linear system of size \(N_r\). When all modes m are computed, the potential on the polar plane \(z=z^*\) is reconstructed.

4.3 Numerical Results

We consider the parameters of [25] (MEDIUM case)
$$\begin{aligned}&B_0 = 1, \qquad R_0 = 239.8081535,\qquad r_\mathrm{min} = 0.1, \qquad r_\mathrm{max} = 14.5, \qquad r_p = \frac{r_\mathrm{min}+r_\mathrm{max}}{2},\\&\epsilon = 10^{-6},\qquad \kappa _{n_0} = 0.055, \qquad \kappa _{T_i} = \kappa _{T_e} = 0.27586,\qquad \delta r_{T_i} = \delta r_{T_e} = \frac{\delta r_{n_0}}{2} = 1.45,\qquad \delta r = \frac{4 \delta r_{n_0}}{\delta r_{T_i}}. \end{aligned}$$
Given the magnetic field (1.9), we recall that \(b_\theta =\zeta b_z\) and \(\zeta =\iota r/R_0\), therefore \(k_\parallel =(\iota m + n)b_z/R_0\). We use a large value of \(R_0/r_{\max }\) so that \(\zeta \ll 1\) everywhere in the domain, and the reduced model (4.1) is a good approximation of the gyrokinetic Vlasov equation (see “Appendix A”). As our first test-case we consider a straight magnetic field with \(\iota =0\) and excite the mode \((m,n)=(15,1)\), which leads to \(k_\parallel =1/R_0\). In our second test-case we consider a twisted magnetic field with \(\iota =0.8\) and choose \((m,n)=(15,-11)\), which leads to \(k_\parallel =\left( 0.8\cdot 15-11\right) b_z/R_0=b_z/R_0\). We note that we have for the second case \(b_z=1/\sqrt{1+\zeta ^2}\) with \(0\le \zeta =\iota r/R_0\le \iota r_{\max }/R_0 \le 0.05\), so that \(|b_z-1|\le 1.25\cdot 10^{-3}\). The two cases have the same value of m and, thanks to the fact that \(b_z\approx 1\), almost identical values of \(k_\parallel \). Thus the dispersion relation, which only depends on m and \(k_\parallel \), yields almost the same result in both cases, which means that the two simulations should give very similar results in the poloidal plane, at least in the linear phase (as it is also observed in [27]). The test-case parameters are summarized in Table 1, together with the resulting frequencies calculated from the analytical dispersion relation.
Table 1
Screw-pinch gyrokinetic model: input parameters and linear response
\(\iota \)
\(k_\parallel \)
\(\mathfrak {R}(\omega )\)
\(\mathfrak {I}(\omega )\)
Case 1
\( 1/R_0\)
\(-2.0485\times 10^{-3}\)
\(3.8295\times 10^{-3}\)
Case 2
\(-2.0476\times 10^{-3}\)
\(3.8288\times 10^{-3}\)
\(\iota \) is the (constant) magnetic rotational transform, m and n are the polar and axial mode numbers of the initial conditions, \(k_\parallel \) is the resulting parallel wave number, and \(\omega \) is the complex frequency calculated from the dispersion relation. The first three significant digits of \(\omega \) (both real and imaginary parts) are the same in both test-cases
In all simulations we take \(v_{\max }=7.32\), \(N_r=255\), \(N_\theta =512\) and \(N_v=128\); we use \(N_\varphi =32\) for \(\iota =0\), and \(N_\varphi \in \{32,64\}\) for \(\iota =0.8\).
On Fig. 2 we report the time evolution of the discrete \(L^2\)-norm of the electrostatic potential \(\phi \) over configuration space. To this end we approximate the continuous \(L^2\)-norm of \(\phi (t,r,\theta ,z)\), defined as
$$\begin{aligned} \Vert \phi \Vert _2(t) {:=} \sqrt{ \int _{r=r_{\min }}^{r=r_{\max }} \int _{\theta =0}^{\theta =2\pi } \int _{z=0}^{z=2\pi R_0} \phi (t,r,\theta ,z)^2\, r\, dr\, d\theta \, dz}, \end{aligned}$$
with a quadrature formula based on the numerical solution \(\phi _{ijk}^n\approx \phi (t_n,r_i,\theta _j,z_k)\):
$$\begin{aligned} \Vert \phi \Vert _2(t_n) \approx \sqrt{ \sum _{i=1}^{N_r} \sum _{j=1}^{N_\theta } \sum _{k=1}^{N_z} w_i (\phi _{ijk}^n)^2 r_i\, \Delta r \Delta \theta \Delta z}, \quad \text {where}\ w_i = {\left\{ \begin{array}{ll} 1/2 &{} \text {if }i=1 \text { or } i=N_r,\\ 1 &{} \text {otherwise.} \end{array}\right. } \end{aligned}$$
The linear phase (left plot) is in accordance with the dispersion relation, and differences between the three runs become significant only in the non-linear phase (right plot).
On Fig. 3 we see poloidal cuts \(\mathcal {P}_T(r,\theta ) {:=} f(t=T,r,\theta ,z=0,v_\parallel =0)\) of the distribution function, at time \(T=4000\) (end of the linear phase) and time \(T=6000\) (non-linear phase). Again there is accordance between the figures with more visible differences in the non-linear phase. Note that the solution becomes very complex at \(T=6000\) with lot of small scales which are difficult to capture; we already observe some diffusion effect, due to the finite grid size; this is not the case at time \(T=4000\), where convergence still seems to occur.
On Fig. 4 we see magnetic-surface cuts \(\mathcal {S}_T(\theta ,z) {:=} f(t=T,r=(r_{\min }+r_{\max })/2,\theta ,z,v_\parallel =0)\) of the distribution function, again for \(T=4000\) and \(T=6000\). Since the number of points \(N_\varphi \) is purposely low, in order to produce meaningful plots the numerical solution had to be reconstructed on a finer mesh using our field-aligned interpolation algorithm. At the end of the linear phase (\(T=4000\)) we clearly see the structure of the mode \((m,n)=(15,1)\) in the straight case and \((m,n)=(15,-11)\) in the oblique case. Later in the non-linear phase (\(T=6000)\) the solution presents extensive filamentation, which is not properly resolved on the grid; nevertheless, we notice that in the case of closed flux-surfaces (\(\iota =0.8\)) these chaotic structures are roughly aligned with the magnetic field.
On the basis of these numerical experiments we can conclude that field-aligned interpolation performs as well as expected, and enables us to run simulations in cylindrical geometry with an oblique magnetic field (screw-pinch configuration) using limited computational resources. Simulations in a more realistic toroidal geometry will be performed in the next section, where we will compare the efficiency of the new field-aligned approach to its standard (not aligned) counterpart.

5 Physical Cases in Gysela (Toroidal Geometry)

5.1 Gysela Model

The Gysela code computes the 5D ion gyro-center distribution \(f(t,r,\theta ,\varphi ,v_\parallel ,\mu )\) by solving the gyrokinetic Vlasov equation (1.1) in the electrostatic limit (1.4). All quantities appearing in the code are non-dimensional. Temperatures are normalized to \(T_{e0}\), i.e., the initial electron temperature at the mean radius \(r_p=(r_{\min }+r_{\max })/2\), the electric potential is normalized to \(KT_{e0}/{q_i}\), where K is the Boltzmann constant, and the magnetic field is normalized to \(|B_0|\), i.e., its intensity at the magnetic axis. Time is normalized to the inverse of the ion cyclotron frequency \(\omega _{c,i} = q_i\,|B_0|/m_i\) and velocities are given in units of the ion sound speed \(v_{T_0}=\sqrt{KT_{e0}/m_i}\). Consequently, lengths are normalized to the ion “sonic” Larmor radius \(\rho _s = m_i\, v_{T_0}/(q_i |B_0|)\) and the magnetic moment \(\mu \) to \(KT_{e0}/|B_0|\). Finally, number densities are normalized to \(N_0\), i.e., the ‘reference’ equilibrium density at the mean radius \(r_p\), the distribution function f is normalized to \({N_0/(v_{T_0})^3}\), and electric currents are normalized to \(\mu _0|B_0|/\rho _s\). Under these assumptions we simplify the phase-space flow field (1.3) as
$$\begin{aligned} \mathbf {u}(t,{\mathbf {x}},v_\parallel ,\mu )&= \frac{1}{B_{\Vert }^{*}} \Bigl [ v_\parallel {\mathbf {B}}^{*}+ {\mathbf {b}} \times \nabla \left( \mu B + \langle \phi \rangle _\alpha \right) \Bigr ], \end{aligned}$$
$$\begin{aligned} a_\parallel (t,{\mathbf {x}},v_\parallel ,\mu )&= \frac{1}{B_{\Vert }^{*}} \Bigl [ -{\mathbf {B}}^{*}\cdot \nabla \left( \mu B + \langle \phi \rangle _\alpha \right) \Bigr ], \end{aligned}$$
with \({\mathbf {B}}^{*}= \mathbf {B} + v_\parallel \nabla \times {\mathbf {b}}\) and \(B_{\Vert }^{*}={\mathbf {b}}\cdot {\mathbf {B}}^{*}\). In tokamak configurations, the plasma quasi-neutrality approximation is often made [5]. Electron inertia is ignored, which means that an adiabatic response of the electrons is assumed. Three additional simplifying hypotheses are used in the quasi-neutrality equation (1.5) for the electrostatic potential \(\phi (t,r,\theta ,\varphi )\):
In the differential operator on the left-hand side spatial variations of the magnetic field intensity are neglected, so that \(B(r,\theta )\approx 1\) (normalized intensity at magnetic axis);
Everywhere on the left-hand side any dependence of the equilibrium density on the polar angle \(\theta \) is neglected, and the nominal radial density profile \(n_0(r)\) is employed instead (which is used to construct the kinetic equilibrium, as described later);
In the integral operator on the right-hand side the so-called “Pade approximation” is used [6].
Further, we define the operator \(\nabla _\perp =(\partial _r,\frac{1}{r}\partial _{\theta })\) and let \(T_e(r)\) be the electron temperature. Under all the given assumptions, Gysela’s quasi-neutrality equation reads
$$\begin{aligned}&-\frac{1}{n_0(r)}\nabla _{\perp }\cdot \bigl [n_0(r)\nabla _{\perp }\phi \bigr ]+ \frac{1}{T_e(r)}\left[ \phi -\langle {\phi }\rangle _f\right] \nonumber \\&\quad = \frac{2\pi }{n_0(r)}\int \int \, ({f}-{f}_\mathrm{eq}) J_0(k_{\perp }\sqrt{2\mu }) B_{\Vert }^{*}(r,\theta ,v_\parallel )\,dv_{\parallel }\,d\mu . \end{aligned}$$
where \(J_0\) is the Bessel function of first order and \(k_{\perp }\) is the transverse component of the wave vector. \({f_{\text {eq}}(r,\theta ,v_\parallel ,\mu )}\) is the reference state for the quasi-neutrality approximation (that is, the plasma is neutral when \({f\equiv f_{\text {eq}}}\)), and it is also an equilibrium solution of the gyrokinetic Vlasov equation (1.1) in toroidal geometry, in the limit of vanishingly small electric field. We notice that the solution \(\phi \) to (5.2) couples back into the characteristic equations (5.1) through the spatial derivatives of its gyro-average \(\langle \phi \rangle _\alpha (t,r,\theta ,\varphi ,\mu )\).
A detailed description of the model equations can be found in [6]. As usual, \(\theta \in [0,2\pi ]\) and \(\varphi \in [0,2\pi ]\); the radial domain is \(r\in [r_{\min },r_{\max }]\) and the parallel velocity domain is \(v_\parallel \in [-v_{\max },v_{\max }]\). For simplicity, all simulations in this section are carried out with the 4D toroidal version of Gysela, using a single value of \({\mu =0}\). The safety factor profile is , i.e., parabolic with free parameters and \(q_a\), where a is the minor radius of the torus. Periodic boundary conditions along \(\theta \) and \(\varphi \) are considered. For interpolation outside the computational domain of the Vlasov solver, zeroth-order extrapolation along r and \(v_\parallel \) is performed: for example, we assume that whenever we interpolate f at \(r<r_{\min }\) then \(f(t,r,\theta ,\varphi ,v_\parallel ) = f(0,r_{\min },\theta ,\varphi ,v_\parallel )\). The initial conditions for all simulations presented in this section are of the form
$$\begin{aligned} f(t=0,r,\theta ,\varphi ,v_\parallel ) = f_{\text {eq}}(r,\theta ,v_\parallel ) \left[ 1 + g(r) h(v_\parallel ) \delta p(\theta ,\varphi ) \right] , \end{aligned}$$
where \(f_{\text {eq}}\) is a so-called “canonical Maxwellian”, which is a global kinetic equilibrium obtained as a phase-space transformation of an isotropic (but inhomogeneous) Maxwellian distribution [29, 30]. Specifically, we use the definition of \(f_{\text {eq}}\) from [31, pp. 102-103], constructed from the nominal radial profiles of density and temperature, given as
$$\begin{aligned} \frac{d}{dr}\left( \log n_0 \right) = -\frac{\kappa _{n_0}}{R_0} \cosh ^{-2} \left( \frac{r-r_p}{a\,\Delta _{r\,n_0}} \right) , \qquad \frac{d}{dr}\left( \log T_i \right) = -\frac{\kappa _{T_i}}{R_0} \cosh ^{-2} \left( \frac{r-r_p}{a\,\Delta _{r\,T_i}} \right) , \end{aligned}$$
with parameters \({\kappa _{n_0}=25}\), \({\Delta _{r\,n_0}=0.08}\), \({\kappa _{T_i}= 3}\), \({\Delta _{r\,T_i}=0.08}\). We recall that \({n_0(r_p)\,=\,1}\) after normalization; by assuming \({T_e \equiv T_i}\) we also have \({T_i(r_p)=T_e(r_p)=1}\). The expression between square brackets in (5.3) represents a perturbation of the equilibrium distribution [5, p. 398]: g(r) and \(h(v_\parallel )\) are Gaussian functions centered at \(r=r_p\) and \(v_\parallel =0\) respectively, which ensure that the perturbation vanishes (in the sense that it is smaller than unit roundoff for double precision arithmetic) at the boundaries of the r and \(v_\parallel \) domains; \(\delta p(\theta ,\varphi )\) is a bath of accessible Fourier modes in the form
$$\begin{aligned} \delta p(\theta ,\varphi ) = \sum _{m,n} \epsilon _{mn} \cos \left( m\varphi + n\theta + \chi _{mn} \right) , \end{aligned}$$
where \(\epsilon _{mn}\in [0,\epsilon _{\max }]\) and \(\chi _{mn}\in [0,2\pi ]\) are the amplitude and phase for mode (mn), randomly sampled from a uniform distribution over the given intervals, with \({\epsilon _{\max }=10^{-4}}\).

5.2 Parallel Algorithms

The algorithms and the parallelization strategies used in the Gysela code have been already described in previous works [3234]. Algorithm 3 sketches the main features concerning the Vlasov solver that we are interested in here. The usual way to perform a single Vlasov solving in the Gysela code [5] consists of a series of directional advections: \((\hat{v_\parallel }/2,\hat{\varphi }/2,\hat{r\theta },\hat{\varphi }/2,\hat{v_\parallel }/2)\). Each directional advection is performed with the semi-Lagrangian scheme. This procedure is named Strang-splitting and converges in \(O(\Delta t^2)\). It decomposes the Vlasov solver into four 1D advections and one central 2D advection (in the poloidal plane \((r,\theta \))). This solver uses two parallel domain decompositions for the distribution function f. The main rationale that justifies this approach is that advections along a given dimension need all points along this dimension in f. This constraint comes from the spline interpolants that we use actually. Therefore, the 1D advections along \(\varphi \) and \(v_\parallel \) are performed with a domain decomposition that retains all points of f along these two dimensions \((\varphi , v_\parallel )\) locally in the MPI process. Then, a transpose of the distributed data structure f is performed that involves large collective communications. Then, the 2D advection along both r and \(\theta \) dimensions can be done, this step uses a local subdomain in \(\varphi \), \(v_\parallel \) and \(\mu \) directions. After a second tranposition of f, two 1D advections are again performed.
In order to depart from the original algorithm to accommodate the aligned strategy, one can list the different constraints that must be taken into account. First, to use the aligned advection approach in \((\theta ,\varphi )\) plane, it is of outmost importance to treat these two directions in a single step, it permits to apply easily the scheme introduced in Sect. 2.1. Second, 2D advections in \((r,\theta )\) can not be suppressed or transformed into a simple advection along the r direction, because the non-linear terms in r and \(\theta \) interact tightly. Third, to evaluate a new algorithm and a new Strang splitting, we should not undermine the existing parallelization strategy (to keep it simple in the Gysela code).
The proposed Algorithm 4 fulfills these constraints. The advections along \(v_\parallel \) are unchanged. The aligned advections along \((\theta ,\varphi )\) (lines 2, 4, 7, 9) replace the previous advections along the \(\varphi \) direction. All advective terms (except the non-linear ones) along the \(\theta \) direction are treated in this aligned advection in \((\theta ,\varphi )\). The 2D advections along \((r,\theta )\) are modified in order to keep only nonlinear terms in the \(\theta \) direction. All other advective terms along \(\theta \) are transfered to the 2D advection operator in \((\theta ,\varphi )\). Finally, this solution uses a new parallel decomposition at one single location only (distributing over MPI processes along \(\mu , v_\parallel \)) in the 2D aligned advection (lines 4 and 9). Compared to the standard algorithm, the extra transpose and redistribute steps constitute a communication overhead. Another overhead comes from the computation of the feet of the characteristics (lines 2 and 7) that are performed in an already known parallel decomposition in order to have access to needed values that are stored with these parallel decompositions.
We then have a robust parallel solution that does not require an entire overhaul of the Gysela code. Nevertheless some extra communications are created that we measure in the following discussion. In a future work, we will be able to cut costs with a more sophisticate implementation. Indeed, several fixes can be foreseen. One among other solutions is described shortly hereafter. First, one can execute aligned advections (lines 4 and 7) using the usual parallel decomposition of line 6 (\(\forall (\mu ,\varphi ,v_{\parallel })=[local], \forall (r,\theta )=[*]\)). It will require tricky (but not so costly) communication patterns to deal with the parallel decomposition along \(\varphi \) direction. Second, when this first change will be made we can mix the computations of feet (lines 2 and 7) with the corresponding 2D aligned advections and then eliminate the transposes of lines 5 and 8. Finally, with this new solution to come, we will reduce the communication volume: avoid transfer of the feet (lines 3 and 8) and remove the need of specific data distribution (lines 4 and 9) and associated data redistribution.
We now describe in detail the equations to be solved at each step of Algorithm 4. Following [35, Section 2.1] we define \({{\mathbf {b}}^*({\mathbf {x}},v_\parallel ) {:=} \mathbf {B}/B_{\Vert }^{*}+ (v_\parallel /B_{\Vert }^{*})(\mathbf {J}/B)}\), where \({\mathbf {J}({\mathbf {x}})=\nabla \times \mathbf {B}}\) is the equilibrium plasma current, and reformulate the phase-space flow field (5.1) as
$$\begin{aligned} \mathbf {u}(t,{\mathbf {x}},v_\parallel ,\mu )&= v_\parallel {\mathbf {b}}^* + \mathbf {v}_D +\mathbf {v}_E,\end{aligned}$$
$$\begin{aligned} a_\parallel (t,{\mathbf {x}},v_\parallel ,\mu )&= -{\mathbf {b}}^* \cdot \nabla \Bigl ( \mu B + \langle \phi \rangle _\alpha \Bigr ) +\frac{v_\parallel }{B}\,\mathbf {v}_E \cdot \nabla B, \end{aligned}$$
where \(v_\parallel {\mathbf {b}}^*\) represents the streaming velocity, \(\mathbf {v}_D\) the curvature drift velocity and \(\mathbf {v}_E\) the \(\mathbf {E}\times \mathbf {B}\) drift velocity:
$$\begin{aligned} \mathbf {v}_D({\mathbf {x}},v_\parallel ,\mu ) {:=} \frac{v_\parallel ^2+\mu B}{B_{\Vert }^{*}B}\, {\mathbf {b}}\times \nabla B, \qquad \mathbf {v}_E(t,{\mathbf {x}},v_\parallel ,\mu ) {:=} \frac{1}{B_{\Vert }^{*}}\,{\mathbf {b}}\times \nabla \langle \phi \rangle _\alpha . \end{aligned}$$
After normalization, the 5D gyrokinetic Vlasov equation (1.1) with flow field (5.4) is expressed with toroidal coordinates \((r,\theta ,\varphi )\) and decomposed into three separate advection equations:
1D advection along \(v_\parallel \), which is left untouched compared to the original algorithm,
$$\begin{aligned} \partial _t f + a_\parallel \partial _{v_\parallel } f = 0; \end{aligned}$$
2D advection on a magnetic flux surface \((\theta ,\varphi )\), where field-aligned interpolation is used,
$$\begin{aligned} \partial _t f + \left[ (v_\parallel {\mathbf {b}}^* + \mathbf {v}_D) \cdot \nabla \theta \right] \partial _\theta f + \left[ (v_\parallel {\mathbf {b}}^* + \mathbf {v}_D + \mathbf {v}_E) \cdot \nabla \varphi \right] \partial _\varphi f = 0; \end{aligned}$$
2D advection on a poloidal plane \((r,\theta )\), where only the nonlinear \(\mathbf {E}\times \mathbf {B}\) velocity is retained along \(\theta \),
$$\begin{aligned} \partial _t f + \left[ (v_\parallel {\mathbf {b}}^* + \mathbf {v}_D + \mathbf {v}_E) \cdot \nabla r \right] \partial _r f + \Bigl [ \mathbf {v}_E \cdot \nabla \theta \Bigr ] \partial _\theta f = 0. \end{aligned}$$
It is important to notice that Equation B above is more complicated than the oblique advection of Sects. 3 and 4. However, this approach permits to avoid large modifications of the Gysela code which was a constraint. An illustration is given in Fig. 5, where we plot the streamlines for the advection field of Equation B, in the limit of vanishing electric field (\(\mathbf {v}_E=0\)). We consider the same geometrical parameters of the test-cases in the next section (namely \({a=40}\), \({[r_{\min },r_{\max }]=[0.1\,a,a]}\), and \(R_0=3\,a\)), and we set and \({q_a=2.5}\) in our parabolic safety factor profile q(r), which yields a local value \({q(r_p)=1.45375}\). For brevity we set \(\mu =0\), select a single magnetic flux surface at \(r=r_p\), and focus on four different values of \(v_\parallel \in \{-2,-1,1,2\}\). (We recall that all velocities are normalized to the thermal velocity \(v_{T_0}\).) For comparison we also plot the streamlines of the magnetic field passing through the same points at \(\varphi =0\): as expected, the misalignment between the advection velocity and the magnetic field grows with \(v_\parallel \), but remains reasonably small throughout this range of velocity. Finally, in the background is shown a set of straight lines with \(d\theta /d\varphi \equiv \iota (r_p)\), which approximate the magnetic field on this flux surface: these are used for field-aligned interpolation of the distribution function f (Sect. 2.1), as well as for field-aligned differentiation of the electric potential \(\phi \) (Sect. 2.2).

5.3 Numerical Results with Gysela

In a gyrokinetic simulation with kinetic ions and adiabatic electrons it is to be expected that the smallest length scale is of the order of the ion Larmor radius \(\rho _s\). This is due in part to the gyroaverage operator in configuration space, and in part to the averaging over \(\mu \) that takes place when computing the charge density. Since \(\rho _s\) is also the quantity used for normalization of all lengths, we can say that a well-refined numerical simulation requires \(\Delta r \ll 1\) and \(r_{\max }\Delta \theta \ll 1\). A fundamental non-dimensional parameter in magnetic fusion devices is the ratio \(\rho ^* = \rho _s/A\), where A is the minor radius of the device. (In terms of non-dimensional quantities, the minor radius of the device is \(a=A/\rho _s\) and therefore \(\rho ^*=1/a\).) The number of degrees of freedom needed to represent a poloidal cut of the solution scale with \((\rho ^*)^{-2}\), therefore smaller values of \(\rho ^*\) lead to larger numerical simulations.
In order to have accurate and converged simulations, in this section we use a setup with a relatively large value of \(\rho ^*=1/40\), and we consider a single \(\mu \)-value of \(\mu =0\). Strictly speaking, in such a situation there is neither gyro-averaging nor \(\mu \)-averaging, therefore there is no physical lower bound on the characteristic length scales; nevertheless, the solution is still well resolved at the end of our simulations. We investigate two physical cases with geometrical parameters
$$\begin{aligned} a=40,\quad r_{\min }=0.1\,a,\quad r_{\max }=1.0\,a,\quad R_0=3\,a. \end{aligned}$$
that differ in their safety factor profiles q(r). The parallel velocity domain is truncated at \(v_{\max }=6.3\). Benchmarks have been realized with the 4D toroidal version of the Gysela code, on a fine computational domain of size
$$\begin{aligned} N_r=256,\quad N_\theta =256,\quad N_\varphi =<not\ fixed>,\quad N_{v_\parallel }=48. \end{aligned}$$
In order to keep the time integration error low compared to interpolation errors, a small time step \(\Delta t=1\) was chosen.
A first case with an almost constant safety factor q(r), slowly varying between \({q(0)=1}\) and \({q(a)=1.1}\), is illustrated by Figs. 6a and 7. A second case with a safety factor strongly depending on r, varying between \({q(0)=1}\) and \({q(a)=2.5}\), is illustrated by Figs. 6b and 8. The second case could be slightly more difficult to handle for the aligned approach, because the \({\mathbf {b}}\) direction depends on the r position through equation (1.10). Indeed, for each hyper-plane at a given r, the aligned advection algorithm uses possibly a different direction than for another r value. Figure 6 reports the time evolution of the electrostatic energy (integrated over the domain). The left columns of Figs. 7 and 8 show the electrostatic energy on the magnetic flux surface at \({r=127\Delta r}\approx {r_p=0.55 a}\), at time \({t=1672}\). The right columns of Figs. 7 and 8 show the electrostatic energy on the poloidal plane at \({\varphi =0}\), also at time \({t=1672}\).
One can see on Fig. 6a that the standard approach with \(N_\varphi =128\) gives a similar result compared to the aligned method with \(N_\varphi =32\). The two other curves with standard method and \(N_\varphi =32\) and \(N_\varphi =64\) are not converged along the \(\varphi \) direction and give substantially different potential energy evolutions. Figure 7 corroborates this fact by showing different cuts of the electric potential: the graphs at the middle and bottom rows show quite identical structures. It is important to notice that we have reconstructed finely the graph with \(N_\varphi =32\) in order to recover a fine resolution on the plots (through 4 aligned interpolations per original grid point, leading to a virtual \(N_\varphi =128\)). In order to do that, we use Algorithm 1 with \((\theta ^\star ,\varphi ^\star )\) being the grid points on the fine mesh. As stated in [35], global conservation of mass and energy in toroidal geometry is quite difficult to achieve in practice, due to boundary conditions within Gysela. Therefore, these quantities have not been used to estimate the benefits of the aligned method in this paper.
Figures 6b and 8 show results for the second simulation with a strongly varying safety factor. Conclusions are quite analogous as the first simulation. On the left-hand side, one can see elongated structures along the parallel direction, which constitute the rationale that justifies why the aligned method reduces interpolation approximation errors. For these two simulations, we conclude that the aligned approach works well and permits to reduce by a factor of 4 the number of grid points in the \(\varphi \) direction for these cases at \(\rho ^\star =1/40\). From the previous analysis, we also expect that, as \(\rho ^*\) is further reduced to approach the ITER values of the order of \(10^{-3}\) [36], it would not be necessary to increase the number of grid points in the \(\varphi \) direction in order to achieve comparable precision. Thus, our method could allow a saving of the order of 100 in grid points when employed in the context of realistic simulations of reactor scale devices.
Table 2
Time (in seconds) of a short Gysela run in the same configuration described in Sect. 5.3
Execution time
Aligned \(N_\varphi =32\)
Standard \(N_\varphi =32\)
Standard \(N_\varphi =64\)
Standard \(N_\varphi =128\)
Total run time

5.4 Execution Times Comparison

As a matter of comparison between the standard and aligned methods, Table 2 gives typical execution times of Gysela for four short runs that employ the same configuration and grid size already described in Sect. 5.3 (\(N_r=256\), \(N_\theta =256\), \(N_{v_\parallel }=48\)). For the aligned scheme we take \(N_\varphi =32\), while for the standard scheme we consider three different simulations with \(N_\varphi \in \{32,64,128\}\). The time breakdown of specific regions of the code are shown in addition to the total run time.
Let us compare the timings for the aligned and standard methods at \(N_\varphi =32\). Firstly we observe that the execution times for the transposes is much higher with the aligned scheme, mainly because there are four transpose steps required (Algorithm 4) instead of two (Algorithm 3). The advection steps are also slightly more expensive with the aligned scheme, because the 1D advection along \(\varphi \) is replaced by the 2D advection aligned in \((\theta ,\varphi )\). In fact, the 2D field-aligned interpolation of Algorithm 1 requires additional computations compared to simple 1D interpolations. The improvements and optimizations addressed at the end of Sect. 5.2 can contribute to decrease these overheads in the future.
Nevertheless, one can see that the aligned strategy with \(N_\varphi =32\) is already competitive against the standard approach with \(N_\varphi =64\) in terms of total run time, with the big benefit of requiring two times less memory to store the distribution function. Since Sect. 5.3 has shown that the aligned approach with \(N_\varphi =32\) is more accurate than the standard approach with \(N_\varphi =64\) (at least in the linear phase), we can conclude that there is a clear gain in using field-aligned interpolation in Gysela.

6 Conclusions

We have described a semi-Lagrangian method based on field-aligned interpolation, for the solution of the gyrokinetic Vlasov equation. The application of interest is the numerical simulation of magnetically confined plasmas in fusion devices. Thanks to the smooth variation of the solution in the direction of the magnetic field, field-alignment enhances the accuracy of the interpolation: for a given level of accuracy, this allows us to reduce the number of discretization points along the toroidal direction.
In the simplified setting of 2D constant advection, we have given a rigorous proof of convergence, as well as extensive error estimates which underline the advantages of field-aligned interpolation. We have implemented the scheme into two semi-Lagrangian codes, Selalib and Gysela, for the solution of the 4D gyrokinetic Vlasov equation in the zero-Larmor-radius limit. We have used the ion temperature gradient (ITG) instability as a standard verification test-case in cylindrical (screw-pinch) and toroidal (circular Tokamak) geometries. In our benchmarks against the standard (not aligned) interpolation scheme, we have observed large reductions in memory footprint (up to a factor of 4), as well as moderate (but improvable) simulation speed-ups. Our estimates suggest that these gains will be even larger in reactor-scale simulations.
Field-aligned interpolation does not pose constraints on the 2D poloidal grids, and the use of magnetic flux coordinates is not necessary. Accordingly, the magnetic axis, as well as the X-point in a divertor configuration, do not pose theoretical problems. Therefore our semi-Lagrangian algorithms can be extended to more complex magnetic geometries, enabling the global simulation of diverted Tokamaks and Stellarators.


Open access funding provided by Max Planck Society. The authors are grateful to Edoardo Zoni for carefully reading our manuscript and pointing out some typos and mistakes, which we have corrected; we also acknowledge his help with the streamline plots in Fig. 5. This work has been carried out within the framework of the EUROfusion Consortium and has received funding from the Euratom research and training programme 2014–2018 under Grant Agreement No. 633053. The views and opinions expressed herein do not necessarily reflect those of the European Commission.
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://​creativecommons.​org/​licenses/​by/​4.​0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Appendix A: Derivation of the Model of Section 4

We consider a system of ion particles having \(\mu ={\bar{\mu }}\ge 0\) at time \(t=0\); since \(\mu \) is a constant of motion, the gyro-center distribution function can be written as \(f(t,{\mathbf {x}},v_\parallel ,\mu )=f_{{\bar{\mu }}}(t,{\mathbf {x}},v_\parallel )\,\delta (\mu -{\bar{\mu }})\) for all times \(t\ge 0\). Substituting this expression for f into the gyrokinetic Vlasov equation (1.1) and integrating over the variable \(\mu \) yields an equation for \(f_{{\bar{\mu }}}\), namely
$$\begin{aligned} \left( \frac{\partial }{\partial t} + \mathbf {u}(t,{\mathbf {x}},v_\parallel ,{\bar{\mu }})\cdot \nabla + a_\parallel (t,{\mathbf {x}},v_\parallel ,{\bar{\mu }}) \frac{\partial }{\partial v_\parallel } \right) f_{{\bar{\mu }}}(t,{\mathbf {x}},v_\parallel ) = 0. \end{aligned}$$
We restrict ourselves to the zero-Larmor-radius limit, so that the ion density can be calculated from (1.6) by letting \({|\varvec{\rho }|\rightarrow 0}\) and substituting our expression for f:
$$\begin{aligned} n_i(t,{\mathbf {x}}) = \frac{2\pi }{m_i} \int _{-\infty }^{+\infty } f_{{\bar{\mu }}}(t,{\mathbf {x}},v_\parallel ) B_{\Vert }^{*}({\mathbf {x}},v_\parallel )\, dv_\parallel . \end{aligned}$$
With a slight abuse of notation, in the following discussion we shall drop the \({\bar{\mu }}\) subscript and rescale our distribution function, so that \({f(t,{\mathbf {x}},v_\parallel ){:=}(2\pi /m_i)f_{{\bar{\mu }}}(t,{\mathbf {x}},v_\parallel )}\) and \({n_i(t,{\mathbf {x}})=\int f(t,{\mathbf {x}},v_\parallel )B_{\Vert }^{*}({\mathbf {x}},v_\parallel )dv_\parallel }\). We shall further assume that we are in the electrostatic limit, and set \({{\bar{\mu }}=0}\) for simplicity. We then proceed with the normalization of the equations: the full procedure is described in Sect. 5.1 for the Gysela code, but the same non-dimensional equations are also obtained by formally setting \({m=q=1}\). The gyro-center Hamiltonian then reads \(H(t,{\mathbf {x}},v_\parallel ) = v_\parallel ^2/2 + \phi (t,{\mathbf {x}})\), and the phase-space flow field (1.3) reduces to
$$\begin{aligned} \left\{ \begin{aligned} \mathbf {u}(t,{\mathbf {x}},v_\parallel )&= \frac{1}{B^*_\parallel } \left( v_\parallel \mathbf {B}^* +{\mathbf {b}}\times \nabla \phi \right) , \\ a_\parallel (t,{\mathbf {x}},v_\parallel )&= \frac{1}{B^*_\parallel } \Bigl ( -\mathbf {B}^*\cdot \nabla \phi \Bigr ), \end{aligned} \right. \end{aligned}$$
where the modified magnetic field is
$$\begin{aligned} \mathbf {B}^* = \mathbf {B} + v_\parallel \nabla \times {\mathbf {b}}, \qquad B^*_\parallel = \mathbf {B}^*\cdot {\mathbf {b}} = B + v_\parallel \nabla \times {\mathbf {b}}\cdot {\mathbf {b}}. \end{aligned}$$
In the screw-pinch model of Sect. 4 we use the cylindrically symmetric magnetic equilibrium (1.9), where
$$\begin{aligned} \mathbf{B}(r,\theta ) = B\mathbf{b},\quad \mathbf{b}(r,\theta ) = b_z\hat{\mathbf{z}} + b_\theta \hat{{\varvec{\theta }}}, \end{aligned}$$
$$\begin{aligned} B(r)= & {} |B_0| \sqrt{1+\zeta ^2}, \quad b_\theta (r) = \frac{s\zeta }{\sqrt{1+\zeta ^2}},\quad b_z(r) = \frac{s}{\sqrt{1+\zeta ^2}},\quad \\ \zeta (r)= & {} \frac{\iota r}{R_0}, \quad s = {{\mathrm{sgn}}}(B_0). \end{aligned}$$
Here the rotational transform iota only depends on the radius, that is \(\iota =\iota (r)\). In order to be consistent with the Gysela model in Sect. 5.1, the magnetic field is normalized to its intensity at the magnetic axis, and therefore we have \(|B_0|=1\).
We now proceed with projecting the phase-space flow field onto the non-orthogonal basis \((\hat{\mathbf {r}},{\hat{\varvec{\theta }}},{\mathbf {b}})\); in this process we make the dependence of each component on \(\zeta \) explicit. We recall that the curl of a vector \({\mathbf {A} = A_\theta (r)\hat{{\varvec{\theta }}}+A_z(r)\hat{\mathbf {z}}}\) reads \(\nabla \times \mathbf{A} = -A'_z(r){\hat{\varvec{\theta }}}+\frac{1}{r}(rA_\theta (r))'\hat{\mathbf{z}}\), therefore
$$\begin{aligned} \nabla \times \mathbf{b} = \frac{s\,\zeta \zeta '}{(1+\zeta ^2)^{3/2}}\hat{{\varvec{\theta }}} +\frac{s}{r}\left( \frac{(\zeta r)'}{\sqrt{1+\zeta ^2}} -\frac{\zeta ^2r\zeta '}{(1+\zeta ^2)^{3/2}} \right) \hat{\mathbf{z}}, \end{aligned}$$
which leads to
$$\begin{aligned} \nabla \times \mathbf{b} \cdot \mathbf{b} = \frac{\zeta ^2\zeta '}{(1+\zeta ^2)^{2}} +\frac{1}{r}\frac{(\zeta r)'}{1+\zeta ^2} -\frac{\zeta ^2\zeta '}{(1+\zeta ^2)^{2}} = \frac{1}{r}\frac{(\zeta r)'}{1+\zeta ^2} = \frac{\zeta '+\zeta /r}{1+\zeta ^2}. \end{aligned}$$
From this it follows that
$$\begin{aligned} B^*_\parallel = |B_0|\sqrt{1+\zeta ^2} + \frac{\zeta '+\zeta /r}{1+\zeta ^2}v_\parallel . \end{aligned}$$
We then write
$$\begin{aligned} \nabla \times {\mathbf {b}}= & {} (\nabla \times {\mathbf {b}})_\theta \hat{{\varvec{\theta }}} +(\nabla \times {\mathbf {b}})_z \hat{\mathbf {z}} = \left( (\nabla \times {\mathbf {b}})_\theta -\frac{b_\theta }{b_z}(\nabla \times {\mathbf {b}})_z \right) \hat{{\varvec{\theta }}}+\frac{(\nabla \times {\mathbf {b}})_z}{b_z}{} \mathbf{b} \\= & {} s \left( \frac{\zeta \zeta '}{\sqrt{1+\zeta ^2}}-\frac{\zeta }{r}\frac{(\zeta r)'}{\sqrt{1+\zeta ^2}}\right) \hat{{\varvec{\theta }}} +\frac{1}{r}\left( (\zeta r)'-\frac{\zeta ^2r\zeta '}{1+\zeta ^2}\right) {\mathbf {b}} = \frac{-s \zeta ^2}{r\sqrt{1+\zeta ^2}}\hat{{\varvec{\theta }}}\\&+\left( \frac{\zeta '+\zeta /r}{1+\zeta ^2}+\frac{\zeta ^3/r}{1+\zeta ^2}\right) {\mathbf {b}} \end{aligned}$$
so that
$$\begin{aligned} {\mathbf {B}}^* = \left( B^*_\parallel + \frac{\zeta ^3/r}{1+\zeta ^2}v_\parallel \right) \mathbf{b} -\left( \frac{s\zeta ^2/r}{\sqrt{1+\zeta ^2}}v_\parallel \right) \hat{{\varvec{\theta }}}. \end{aligned}$$
Before proceeding, we replace \(\partial _z\phi \) with derivatives along the directions \((\hat{\mathbf {r}},{\hat{\varvec{\theta }}},{\mathbf {b}})\): since \({{\mathbf {b}}\cdot \nabla \phi = b_\theta \partial _\theta \phi /r+b_z\partial _z\phi }\), we get \({\partial _z\phi = (1/b_z){\mathbf {b}}\cdot \nabla \phi -(b_\theta /b_z)\partial _\theta \phi /r}\). With this we can write
$$\begin{aligned} \mathbf{b} \times \nabla \phi= & {} \left( -b_z\frac{\partial _\theta \phi }{r} + b_\theta \partial _z\phi \right) \hat{\mathbf{r}} +b_z\partial _r\phi \,\hat{{\varvec{\theta }}}-b_\theta \partial _r\phi \,\hat{\mathbf{z}}\\= & {} \left( -\frac{1}{b_z}\frac{\partial _\theta \phi }{r} + \frac{b_\theta }{b_z} \mathbf{b}\cdot \nabla \phi \right) \hat{\mathbf{r}} +\frac{1}{b_z}\partial _r\phi \,\hat{{\varvec{\theta }}}-\frac{b_\theta }{b_z}\partial _r\phi \,\mathbf{b} \end{aligned}$$
$$\begin{aligned} {\mathbf {B}}^*\cdot \nabla \phi = \left( B^*_\parallel +\frac{\zeta ^3/r}{1+\zeta ^2}v_\parallel \right) \mathbf{b}\cdot \nabla \phi -\left( \frac{s\zeta ^2/r}{\sqrt{1+\zeta ^2}}v_\parallel \right) \frac{\partial _\theta \phi }{r}. \end{aligned}$$
Finally, the phase-space flow field in the \((\hat{\mathbf {r}},{\hat{\varvec{\theta }}},{\mathbf {b}})\) basis reads
$$\begin{aligned} \left\{ \begin{aligned} B^*_\parallel \mathbf {u}&= \left( -s\sqrt{1+\zeta ^2}\frac{\partial _\theta \phi }{r}+\zeta \mathbf {b}\cdot \nabla \phi \right) \hat{\mathbf {r}} +\left( s\sqrt{1+\zeta ^2}\partial _r\phi -\frac{s\zeta ^2/r}{\sqrt{1+\zeta ^2}}v_\parallel ^2\right) \hat{{\varvec{\theta }}}\\ {}&\quad +\left( B^*_\parallel v_\parallel +\frac{\zeta ^3/r}{1+\zeta ^2}v_\parallel ^2-\zeta \partial _r\phi \right) \mathbf {b},\\ B^*_\parallel a_\parallel&= -\left( B^*_\parallel +\frac{\zeta ^3/r}{1+\zeta ^2}v_\parallel \right) \mathbf {b}\cdot \nabla \phi +\left( \frac{s\zeta ^2/r}{\sqrt{1+\zeta ^2}}v_\parallel \right) \frac{\partial _\theta \phi }{r}, \end{aligned} \right. \end{aligned}$$
where \(B^*_\parallel =|B_0|\sqrt{1+\zeta ^2}+v_\parallel (\zeta '+\zeta /r)/(1+\zeta ^2)\). If we now let \(\zeta \rightarrow 0\) and \(\zeta '\rightarrow 0\) while keeping our basis unchanged, the equations above reduce to
$$\begin{aligned} \left\{ \begin{aligned} \mathbf {u} (t,r,\theta ,z,v_\parallel )&= -\frac{\partial _\theta \phi }{rB_0}\hat{\mathbf {r}}+ \frac{\partial _r\phi }{B_0}{\hat{\varvec{\theta }}}+v_\parallel {\mathbf {b}},\\ a_\parallel (t,r,\theta ,z,v_\parallel )&= -{\mathbf {b}}\cdot \nabla \phi , \end{aligned} \right. \end{aligned}$$
which correspond to (4.1). We notice that under this approximation we have let \(B^*_\parallel \rightarrow |B_0|\), and we recall that \({|B_0|=1}\). Thanks to the fact that the magnetic field (1.9) has the property \(\nabla \cdot {\mathbf {b}}=0\), the resulting phase-space flow is still divergence-free, as
$$\begin{aligned} \nabla \cdot \mathbf {u} = \frac{1}{r}\frac{\partial }{\partial r} \left( -\frac{\partial _\theta \phi }{B_0} \right) + \frac{1}{r}\frac{\partial }{\partial \theta } \left( \frac{\partial _r \phi }{B_0} \right) + v_\parallel \nabla \cdot {\mathbf {b}} = 0, \qquad \frac{\partial a_\parallel }{\partial v_\parallel } = \frac{\partial }{\partial v_\parallel }\left( -{\mathbf {b}}\cdot \nabla \phi \right) = 0. \end{aligned}$$
Therefore, given appropriate boundary conditions on f, the reduced model (4.1) conserves the total number of particles, defined as the phase-space integral of f.
Consistently with the derivation above, we can simplify the quasi-neutrality equation (1.5) to obtain (4.2). We set \(m_i=q_i=\epsilon _0=1\) and assume that the equilibrium profiles only depend on the radial coordinate r to obtain
$$\begin{aligned} -\frac{n_0}{B^2}\left[ \partial _r^2\phi + \left( \frac{1}{r}+\frac{\partial _r n_0}{n_0}-2\frac{\partial _r B}{B} \right) \partial _r\phi +\frac{1}{r^2}\partial _{\theta }^2 \phi \right] + \frac{n_0}{T_e} \left( \phi -\langle \phi \rangle _f \right) \,=\, n_i - n_0, \end{aligned}$$
where \(B=B(r)\), \(n_0=n_0(r)\) and \(T_e=T_e(r)\). The densities on the right hand side are calculated as
$$\begin{aligned} n_i(t,r,\theta ,z)= & {} \int _{-\infty }^{+\infty } f(t,r,\theta ,z,v_\parallel ) B_{\Vert }^{*}(r,v_\parallel )\, dv_\parallel , \qquad \\ n_0(r)= & {} \int _{-\infty }^{+\infty } f_\text {eq}(r,v_\parallel )\, B_{\Vert }^{*}(r,v_\parallel )\, dv_\parallel . \end{aligned}$$
If we now let \(\zeta \rightarrow 0\) it follows that \(B(r)\rightarrow |B_0|\) and \(B_{\Vert }^{*}(r,v_\parallel )\rightarrow |B_0|\), yielding
$$\begin{aligned} - n_0 \left[ \partial _r^2\phi + \left( \frac{1}{r}+\frac{\partial _r n_0}{n_0} \right) \partial _r\phi + \frac{1}{r^2}\partial _{\theta }^2 \phi \right] + \frac{n_0}{T_e} \left( \phi -\langle \phi \rangle _f \right) \,=\, \int _{-\infty }^{+\infty } \left( f - f_\text {eq} \right) dv_\parallel , \end{aligned}$$
where we have used the fact that \({|B_0|=1}\) after normalization. Finally we obtain (4.2) by removing the flux-surface average \(\langle \phi \rangle _f\) and dividing both sides of the equation by \(n_0(r)\).

Appendix B: Dispersion Equation

We make the following expansions:
$$\begin{aligned} f=f_0+\varepsilon f_1+\mathcal {O}(\varepsilon ^2), \quad \phi =\phi _0+\varepsilon \phi _1+\mathcal {O}(\varepsilon ^2) \end{aligned}$$
$$\begin{aligned} f_0(r,v) = f_\text {eq}(r,v) = \frac{n_0(r)}{\sqrt{2\pi T_i(r)}} \exp \left( -\frac{v^2}{2T_i(r)}\right) , \quad \phi _0=0. \end{aligned}$$
The gyrokinetic Vlasov equation (4.1) then reads
$$\begin{aligned} \partial _t f_1 -\frac{\partial _{\theta }{\phi }_1}{rB_0}\partial _r f_0+ vb_z\partial _z f_1+v\frac{b_\theta }{r}\partial _\theta f_1- \left( b_\theta \frac{\partial _\theta \phi _1}{r}+b_z\partial _z\phi _1\right) \partial _{v} f_0 =\mathcal {O}(\varepsilon ), \end{aligned}$$
and the quasi-neutrality equation (4.2) reads
$$\begin{aligned} -\left[ \partial _r^2\phi _1 + \left( \frac{1}{r}+\frac{\partial _r n_0}{n_0}\right) \partial _r \phi _1 + \frac{1}{r^2}\partial _{\theta }^2 \phi _1 \right] + \frac{1}{T_e}\phi _1 \,=\, \frac{1}{n_0}\int _{-\infty }^{+\infty } f_1 dv + \mathcal {O}(\varepsilon ). \end{aligned}$$
We assume that the solutions have the form
$$\begin{aligned} f_1 = f_{m,n,\omega }(r,v)\,e^{i(m\theta +kz-\omega t)}, \quad \phi _1 = \phi _{m,n,\omega }(r) \,e^{i(m\theta +kz-\omega t)}, \end{aligned}$$
with \(k=n/R_0\). The integers (mn) identify the Fourier mode of interest, for which we want to evaluate the complex frequency \(\omega \) together with the corresponding profile \(\phi _{m,n,\omega }(r)\). After discarding the \(\mathcal {O}(\varepsilon )\) terms, the gyrokinetic Vlasov equation yields the linear algebraic relation
$$\begin{aligned} \left( v k_\parallel -\omega \right) f_{m,n,\omega } = \left( \frac{m}{rB_0}\partial _r f_0 + k_\parallel \partial _v f_0 \right) \phi _{m,n,\omega }, \qquad k_\parallel (r) = b_\theta \frac{m}{r} + b_z \frac{n}{R_0}, \end{aligned}$$
and the quasi-neutrality equation yields the linear integro-differential relation
$$\begin{aligned} -\left[ \partial _r^2\phi _{m,n,\omega } +\left( \frac{1}{r}+\frac{\partial _r n_0}{n_0}\right) \partial _r \phi _{m,n,\omega } -\frac{m^2}{r^2} \phi _{m,n,\omega }\right] +\frac{1}{T_e}\phi _{m,n,\omega } = \frac{1}{n_0}\int _{-\infty }^{+\infty } {f}_{m,n,\omega }\,dv. \end{aligned}$$
If we solve (B.1) for \(f_{m,n,\omega }\) and substitute the resulting expression in (B.2) we obtain
$$\begin{aligned}&-\left[ \partial _r^2\phi _{m,n,\omega } +\left( \frac{1}{r}+\frac{\partial _r n_0}{n_0}\right) \partial _r \phi _{m,n,\omega } -\frac{m^2}{r^2} \phi _{m,n,\omega }\right] +\frac{1}{T_e}\phi _{m,n,\omega }\\&\quad = \frac{1}{n_0} {\phi }_{m,n,\omega } \int _{-\infty }^{+\infty }{\frac{\frac{m}{rB_0}\partial _r f_0 + k_\parallel \partial _v f_0}{vk_\parallel -\omega } dv}. \end{aligned}$$
By using the expression of \(f_0(r,v)\), the integral on the right-hand side may be written as
$$\begin{aligned} \begin{aligned} \frac{1}{n_0} \int _{-\infty }^{+\infty }{\frac{\frac{m}{rB_0}\partial _r f_0 + k_\parallel \partial _v f_0}{vk_\parallel -\omega } dv} =&\, \frac{1}{n_0} \int _{-\infty }^{+\infty }{ \frac{-\frac{v}{T_i} + \frac{m}{k_\parallel rB_0} \left( \frac{\partial _r n_0}{n_0} -\frac{\partial _r T_i}{2 T_i} +\frac{v^2 \partial _r T_i}{2 T_i^2} \right) }{v-\omega /k_\parallel } f_0(r,v)\,dv }= -\frac{1}{T_i}I_1\biggl (r,\frac{\omega }{k_\parallel }\biggr )\\&+\frac{m}{k_\parallel rB_0} \left[ \left( \frac{\partial _r n_0}{n_0}-\frac{\partial _r T_i}{2T_i}\right) I_0\biggl (r,\frac{\omega }{k_\parallel }\biggr ) +\frac{\partial _r T_i}{2 T_i^2} I_2\biggl (r,\frac{\omega }{k_\parallel }\biggr )\right] , \end{aligned} \end{aligned}$$
where we have introduced the functions
$$\begin{aligned} I_\ell (r,u) {:=} \frac{1}{n_0(r)} \int _{-\infty }^{+\infty } \frac{v^\ell }{v-u} f_0(r,v)\,dv, \quad \ell \in {\mathbb {N}}, \quad u\in {\mathbb {C}}. \end{aligned}$$
These can be computed analytically using the formulas
where Z is the so-called ‘plasma dispersion function’ [28], defined as
$$\begin{aligned} Z(u)= & {} \frac{1}{\sqrt{\pi }}\int _{-\infty }^{+\infty }\frac{\exp (-x^2)}{x-u}dx = i\sqrt{\pi }\exp (-u^2)(1+\text {erf}(iu)), \quad \\ \text {erf}(x)= & {} \frac{2}{\sqrt{\pi }}\int _0^x \exp (-t^2)dt. \end{aligned}$$
Finally the dispersion relation is
$$\begin{aligned}&-\left[ \partial _r^2 +\left( \frac{1}{r}+\frac{\partial _rn_0}{n_0}\right) \partial _r -\left( \frac{m^2}{r^2}+\frac{1}{T_e}\right) \right] \phi _{m,n,\omega }(r) \\&\quad = \left\{ -\frac{1}{T_i}(1+\tilde{z}Z(\tilde{z}))+ \frac{m}{k^*rB_0}\left[ Z(\tilde{z})\bigg ( \frac{\partial _r n_0}{n_0} -\frac{\partial _r T_i}{2T_i} \bigg ) +\tilde{z}(1+\tilde{z}Z(\tilde{z}))\frac{\partial _r T_i}{T_i} \right] \right\} \phi _{m,n,\omega }(r), \end{aligned}$$
with \(\tilde{z}=\omega /k^*\) and \(k^*=k_\parallel \sqrt{2T_i}\). We note that the dispersion relation depends on m and \(k_\parallel \) but not directly on n. By recalling that \(\iota (r)=\frac{b_\theta /r}{b_z/R_0}\) we can write \(k_\parallel (r)=(\iota m+n)b_z/R_0\); therefore, for any given mode (mn) and profile \(\iota (r)\), it is theoretically possible to select another mode \((m,n^*)\) and compute a profile \(\iota ^*(r)\) that yields the same value of \(k_\parallel (r)\) and hence the same dispersion relation. In practice it is not easy to obtain this condition exactly, but a very good approximation may be achieved as long as \(b_z(r)\approx 1\).

Our product recommendations

Springer Professional "Wirtschaft+Technik"


Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 69.000 Bücher
  • über 500 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Umwelt
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Testen Sie jetzt 30 Tage kostenlos.

Basis-Abo der Gesellschaft für Informatik

Sie erhalten uneingeschränkten Vollzugriff auf die Inhalte der Fachgebiete Business IT + Informatik und Management + Führung und damit auf über 30.000 Fachbücher und ca. 130 Fachzeitschriften.

Premium-Abo der Gesellschaft für Informatik

Sie erhalten uneingeschränkten Vollzugriff auf alle acht Fachgebiete von Springer Professional und damit auf über 45.000 Fachbücher und ca. 300 Fachzeitschriften.

Show more products
About this article

Other articles of this Issue 3/2018

Journal of Scientific Computing 3/2018 Go to the issue

Premium Partner

    Image Credits