Monte-Carlo finite elements gyrokinetic simulations of Alfven modes in tokamaks. A. Bottino 1 and the ORB5 team 1,2,3 1 Max Planck Institute for Plasma Physics, Germany, 2 Swiss Plasma Center, Switzerland, 3 University of Warwick, UK NUMKIN 2016 : International Workshop on Numerical Methods for Kinetic Equations with contributions from: A. Biancalani 1, J. Dominski 2, E. Sonnendruecker 1 and N. Tronko 1 in the framework of the Eurofusion ER projects: VeriGyro (E. Sonnendruecker) and NLED (F. Zonca)
Outline GOAL: Illustrate the progress made with the electromagnetic global gyrokinetic code ORB5. Going from turbulence to MHD: Kinetic effects on MHD instabilities in tokamaks Kinetic destabilisation of MHD-stable modes, energetic particle physics EM mictroturbulence Interaction between MHD and microturbulence
A problem to face... Trustable nonlinear electromagnetic gyrokinetic simulations require a robust self-consistent discrete GK model, obvious for electrostatic, not at all for electromagnetic 1) Alfvén dynamics opens a lot of new channels for energy transfer in the system. Interaction between Alfvén waves and energetic particles. The model and the code must know where the energy goes. 2) kinetic electrons (real mass ratio) do not forgive careless numerical discretisation (e.g. boundary conditions,...). On the plus side: consistent physics model when kinetic electrons are included, no artifacts as the electrostatic limit of the Alfven oscillations, a.k.a. Ω H mode.
The discrete ORB5 model from GK field theory Discrete electromagnetic gyrokinetic equations are suited for simulations if 1) preserve symmetries: conserved quantities (energy). 2) contain (only) relevant physics: approximation are needed, but must not break self-consistency. The ORB5 model is based on the following: Establish a GK Lagrangian. Discretise the Lagrangian. Construct discrete equations from the discrete Lagrangian. The resulting discrete Vlasov-Maxwell equations will keep the nice symmetry properties of the discrete Lagrangian.
Particle Lagrangian with time dependence in Hamiltonian STARTING POINT: Gyrocenter coordinate (Lie, Gauge,...) transformed low-frequency particle Lagrangian ( e ) L p c A + p b Ṙ + mc e µ θ H R, gyrocenter positions; µ mv 2 2B, magnetic moment; p mu e c J 0A, canonical parallel momentum; θ, gyroangle; B = A, background (static) magnetic field; J 0 gyroaverage operator, U parallel velocity. Coordinate transform method is rather general: choices can be made to arrange L p so that the symplectic part depends only on the background, while all the time varying fields are contained in the Hamiltonian H. [Hahm 1988, Brizard 2007, Miyato 2009, Scott 2015,...].
GK total Lagrangian contains all the needed physics Following [Sugama 2000], Lagrangian for particles AND fields is: L = dw 0 dv f(z 0, t 0 )L p (Z(Z 0, t 0 ; t), Ż(Z 0, t 0 ; t), t) sp + dv E2 B 2 8π Z (R, p, µ, θ); dw 2π/(m 2 )B dp dµ; B 2 = A 2 f (Z 0, t 0 ) is the distribution function for the species sp at an arbitrary initial time t 0. L p is the particle Lagrangian written in terms of the gyro-center coordinates Z. The second term is the Lagrangian for the perturbed electromagnetic fields.
Total Lagrangian with second order Hamiltonian L = sp L p = dwdv f(z, t)l p + ( e c A + p b) Ṙ + mc e µ θ H H = m U2 2 + µb + ej 0Φ mc2 2B 2 Φ 2 dv E2 B 2 8π H = H 0 + H 1 + H 2, 2 nd order in both fields: p mu e c J 0A H 0 p2 2m + µb H 1 e(j 0 Φ p mc J 0A ) ej 0 Ψ e 2 H 2 2mc 2 (J 0A ) 2 mc2 2B 2 Φ 2 Contains reduced MHD [Miyato 2009, Krommes 2013].
Total Lagrangian with second order Hamiltonian L = sp L p = dwdv f(z, t)l p + ( e c A + p b) Ṙ + mc e µ θ H H = m U2 2 + µb + ej 0Φ mc2 2B 2 Φ 2 dv E2 B 2 8π H = H 0 + H 1 + H 2, 2 nd order in both fields: p mu e c J 0A H 0 p2 2m + µb H 1 e(j 0 Φ p mc J 0A ) ej 0 Ψ e 2 H 2 2mc 2 (J 0A ) 2 mc2 2B 2 Φ 2 Contains reduced MHD [Miyato 2009, Krommes 2013].
Total Lagrangian with second order Hamiltonian L = sp L p = dwdv f(z, t)l p + ( e c A + p b) Ṙ + mc e µ θ H dv E2 B 2 8π H = p2 2m + µb + e(j 0Φ p mc J 0A ) + e2 2mc 2 (J 0A ) 2 mc2 2B 2 Φ 2 This is all we need from GK... from now on, field theory. In the context of field theory, this Lagrangian can be further approximated, without loosing self-consistency and energetic consistency of the final equations. Symmetry property of the Lagrangian will be automatically transferred to the equations.
Quasi-neutrality approximation L = sp L p = dwdv f(z, t)l p + ( e c A + p b) Ṙ + mc e µ θ H ( ) E 2 dv 8π B2 8π H = p2 2m + µb + e(j 0Φ p mc J 0A ) + e2 2mc 2 (J 0A ) 2 mc2 2B 2 Φ 2 Actually it is not directly a statement about quasi-neutrality, statement about relative magnitude of electric field energy and particle v E B kinetic energy.
L = sp L p = Quasi-neutrality approximation dwdv f(z, t)l p + ( e c A + p b) Ṙ + mc e µ θ H ( ) E 2 dv 8π B2 8π H = p2 2m + µb + e(j 0Φ p mc J 0A ) + e2 2mc 2 (J 0A ) 2 mc2 2B 2 Φ 2 dv E2 8π + dwdv f m 2 c 2 B 2 Φ 2 = 1 8π λ 2 d k BT e Debye length; ρ 2 4πne 2 S k BT emc 2 e 2 B 2 ( ) dv 1 + ρ2 S λ 2 Φ 2 d ion sound Larmor radius. In fusion plasmas : ρ 2 S λ 2 d = 4πnmc2 B 2 where v a is the Alfvén velocity, c speed of light. = c2 v 2 a 1
Linearised polarisation approximation L = sp (( e ) dvdw c A + p b Ṙ + mc e µ θ ) H f dv B2 8π Start from H = H 0 + H 1 + H 2 In the Lagrangian H 0 + H 1 only multiplies f : (H 0 + H 1 )f For H 2, f is replaced by an equilibrium distribution function f M independent of time: H 2 f M L = sp (( e ) dvdw c A + p b Ṙ + mc e µ θ ) H 0 H 1 f + sp dvdwh 2 f M This approximation will lead to linearised field equations. dv B2 8π
Discretized Lagrangian: Monte Carlo + finite elements L = sp (( e ) dvdw c A + p b Ṙ + mc e µ θ ) H 0 H 1 f + sp dvdwh 2 f M dv B2 8π If in this expression we discretize all the integrals in f via Monte-Carlo, discretize all the dynamic fields using finite elements, we will automatically get the discrete model of the ORB5 code. No need to introduce markers as physically meaningful quantities: Note: PIC from a Lagrangian is not new... [Lewis 1970,..]
Monte-Carlo approximation, operative definitions The principle of a Monte Carlo method is to approximate the expected value of a random variable by an average over a large number of samples. For our purposes a random variable X is a function that can take values in R which are distributed according to a probability density function. Vlasov-Maxwell GK: the random variable X is a phase space position, Z, distributed according to the initial particle phase-space density f. PIC language: each marker can then be seen as one realization (i.e. one random draw) of the random variable Z.
Monte-Carlo approximation, operative definitions Assume that a random variable X of probability density function f is available. Arbitrary smooth functions ψ of X define new random variables, and we can compute expected values of these using the definition: E(ψ(X )) = ψ(x)f (x) dx. The Monte Carlo method consists in approximating the expected value of random variables by a sample average. To approximate E(ψ(X )) we consider a sequence of independent random variables (X i ) i distributed like X and approximate E(ψ(X )) by the sample mean E(ψ(X )) M N = 1 N N ψ(x i ). i=1
Discretized Lagrangian: MC Lagrangian Go back to the general formulation of the Lagrangian: L = f sp (Z, t)l sp (Z, Ż)dZ + L F. sp The particle contribution to the Lagrangian is a sum of integrals with densities f sp. Each integral them can be replaced by an expected value of a random variable Z sp (t) of probability density f sp (, t): L = ( ) E L sp (Z sp (t), Ż sp (t)) + L F. sp MC method can be applied by replacing the expected value by a sample mean over a large number of samples being drawn independently according to the initial distributions f sp (, t 0 ): L MC = sp 1 N p L sp (z k (t), ż k (t)) + L F. N p k=1
Discrete Lagrangian: finite elements Basis functions Λ ν of the finite dimensional function space, all the functions in this space can be expressed as N g Φ h (x, t) = Φ µ (t)λ µ (x); A h (x, t) = A µ (t)λ µ (x) µ=1 N g µ=1 Replacing Φ by Φ h and A by A h in the Lagrangian: + sp L h,mc = sp 1 N p N p k=1 (( e ) w k c A(R k) + p,k b(r k ) Ṙk + mc e µ θ k k m U2 2 µ kb(r k ) ej 0 Φ h (R k ) ep,k mc J 0A h (R k ) dω mc2 2B 2 Φ h 2 f M + sp e2 dω 2mc 2 (J 0A h ) 2 f M ) dv 1 8π A h 2.
GK field and particle equations from variational principles Action functional I [Sugama 2000,...]: δi [Z, Φ, A ] = t2 t1 δl[z, Φ], A dt, Functional derivative of L with respect to a function ψ is defined for an arbitrary variation δψ in the same function space as ψ δl δψ δψ = d L(ψ + ɛδψ) L(ψ) L(ψ + ɛδψ) = lim. dɛ ɛ=0 ɛ 0 ɛ Particle equations of motion can obtained by taking the functional derivatives with respect to the particle phase space positions Z = (R, p, µ): δi δz = 0 δl δz = 0 as t 1 and t 2 are arbitrary.
GK field and particle equations from variational principles The equations of motion for the gyrocenters are Ṙ = (H 0 + H 1 ) B p B p = B B (H 0 + H 1 ) where we denote by B = B b. Polarization equation: Induction equation: c eb δi δφ = 0 δl δφ = 0 δi δa = 0 δl δa = 0 b (H 0 + H 1 )
Variational principle on the discrete Lagrangian, hints Field equations are obtained by taking the variation of the spline coefficients Φ µ (t) and A µ (t). Note: field equations for A µ (t) are difficult to solve properly. At the moment, ORB5 uses methods developed based on control variates by Mishchenko, Hatzky et al. Functional derivatives become partial derivatives [Bottino, Sonnendruecker JPP 2015; Tronko et al., to be submitted, 2016]. As a results, the weak form of the field equation (Galerkin) is automatically obtained. The combination of GK field theory, finite elements and Monte Carlo provides a self-consistent discrete model, with nice symmetry properties, perfect for code developping. Physics can be added by modifying the Lagrangian step by step.
Polarization equation from the discrete Lagrangian 0 = L = Φ ν sp N g Φ µ µ=1 sp 1 N p N p N g Φ h (x, t) = Φ µ (t)λ µ (x) µ=1 k=1 w k ( ej 0 Λ ν (R k ))+ sp dω mc2 B 2 Λ ν Λ µ = sp A µν Φ µ = b ν A µν = sp µ dω mc2 N B 2 g Λ ν ( Φ µ Λ µ ) 1 N p N p k=1 dω mc2 B 2 Λ ν Λ µ µ=1 w k (ej 0 Λ ν (R k )) b ν = sp 1 N p w k (ej 0 Λ ν (R k )). N p k=1
Discretized Lagrangian, comments No time discretisation has been performed, semi-discrete As the semi-discrete Lagrangian is still invariant with respect to a time translation, the corresponding Noether energy is exactly conserved. Time discretisation in the equation breaks the exact energy conservation. Time integrators: RK or symplectic Gauss-Legendre method [Krauss 2014] Where are the markers, the δ-functions the phase-space volumes associated to the markers??? Of course, the same exact discrete quations could be reconstructed in the traditional way. The PIC formalism is entirely reformulated as Monte Carlo, all the noise reduction methods of the MC community are available: control variates (δf PIC), importance sampling, dissipation...
ITPA EP-TAE linear benchmark Benchmark of gyrokinetic, kinetic MHD and gyrofluid codes for the linear calculation of energetic particle (EP) driven Toroidal Alfven Eigenmodes (TAE) dynamics [Köenies, IAEA FEC 2012]. Around 10 codes involved. Circular large aspect ratio plasma, ɛ = 0.1, β e = 9.1 10 4, ρ = 2/1854. Toroidal mode number n = 6. No energetic particle finite-larmor-radius retained (in this benchmark).
. NLED project: ITPA EP TAE linear benchmark. Equilibrium differences, quasi-neutrality was not enforced in ORB5 simulations (flat electron density profiles in ORB5), new simulations on the way... [A. Biancalani et al., PoP 2016]
NLED project: linear vs nonlinear EP finite-larmor-radius retained (T EP =500 kev). Wave-particle nonlinearities retained. Nonlinear structure modification observed. φ max (t)/φ max (t=0) 10 2 LIN NL 10 1 10 0 10 1 0 2 4 6 8 10 1 t (Ω i ) x 10 4 [A. Biancalani et al., submitted to PPCF]
VeriGyro project: EM global benchmark. Global Cyclone base case. Circular equilibria. 2 Vlasov and 2 PIC codes involved. Linear β scan. T. Goerler, N. Tronko, W. Hornsby et al. PoP 2016 [T. Goerler, N. Tronko, W. Hornsby et al. PoP 2016]
VeriGyro project: EM global benchmark. 2 Vlasov and 2 PIC codes involved. Electromagnetic Global Cyclone case. Circular equilibria. Linear toroidal mode number scan. Difference at high n, due to long wavelength Poisson solver in ORB5. [T. Goerler, N. Tronko, W. Hornsby et al. PoP 2016]
Global ORB5 code: implementation of a field solver Implementation of a new field solver in order to account for short scales (fine radial structures) [Dominski, PhD 2016] Gyrokinetic quasi-neutrality equation for arbitrary wavelength solver with finite-elements, following a variation of [Z. Lin and W.W. Lee, PRE 1995] and [A. Mishchenko PoP 2005], q j dzδ(x + ρ x)δ φ q j f 0j = q s dzδ(x + ρ x)δf j, B 0 µ }{{} j {kin} }{{} linearized polarization-drift gyro-density j {kin} QNE for Padé approximant in a 2 species plasma qi 2 N i0 φ = q i (1 ρ 2 i ) dzδ(x + ρ x)δf j. m i Ω 2 0i j=i,e QNE for long wavelength approximation in a 2 species plasma qi 2 N i0 φ = q i dzδ(x + ρ x)δf j. m i Ω 2 0i j=i,e
Benchmark against the global version of the GENE code ω r,γ R/c s 2 ORB5 (arbitrary) Full line: growth rate 1.5 ORB5 (Pade) ORB5 (long wav. approx.) 1 GENE 0.5 0 0.5 1 1.5 Dashed line: real frequency 2 0 0.5 1 1.5 k θρ s [Dominski, PhD 2016] n s = 240 n θ = 1024 n ϕ = 512 n avg = 9 nptot = 16M φ θ 1 0.8 0.6 0.4 0.2 n = 24 Fully kinetic n s = 800 Eigenmode envelope ORB5 (arbitrary) ORB5 (Pade) GENE 0 0.3 0.4 0.5 0.6 0.7 ρ vol FWHM 0.3ρ i #part 32M (Padà ), 64M (arb)
Conclusions The combination of GK field theory, finite elements and Monte Carlo provides a perfect tool for constructing fully consistent (kinetic electrons) GK EM codes. The discrete equations have the same symmetry properties of the discrete Lagrangian. Physics can be add (or removed) just by changing the Hamiltonian. Most of the Monte Carlo noise reduction methods known in literature can, in principle, be applied.
L = sp L p = Quasi-neutrality approximation dwdv f(z, t)l p + ( e c A + p b) Ṙ + mc e µ θ H ( ) E 2 dv 8π B2 8π H = p2 2m + µb + e(j 0Φ p mc J 0A ) + e2 2mc 2 (J 0A ) 2 mc2 2B 2 Φ 2 dv E2 8π + dwdv f m 2 c 2 B 2 Φ 2 = 1 8π λ 2 d k BT e Debye length; ρ 2 4πne 2 S k BT emc 2 e 2 B 2 ( ) dv 1 + ρ2 S λ 2 Φ 2 d ion sound Larmor radius. Fusion plasmas : ρ 2 S λ 2 d = 4πnmc2 B 2 where v a is the Alfvén velocity, c speed of light. = c2 v 2 a 1
GK field and particle equations from variational principles Action functional I [Sugama 2000,...]: δi [Z, Φ, A ] = t2 t1 δl[z, Φ], A dt, Functional derivative of L with respect to a function ψ is defined for an arbitrary variation δψ in the same function space as ψ δl δψ δψ = d L(ψ + ɛδψ) L(ψ) L(ψ + ɛδψ) = lim. dɛ ɛ=0 ɛ 0 ɛ Particle equations of motion can obtained by taking the functional derivatives with respect to the particle phase space positions Z = (R, p, µ): δi δz = 0 δl δz = 0 as t 1 and t 2 are arbitrary.
GK field and particle equations from variational principles The equations of motion for the gyrocenters are Ṙ = (H 0 + H 1 ) B p B p = B B (H 0 + H 1 ) where we denote by B = B b. Polarization equation: Induction equation: c eb δi δφ = 0 δl δφ = 0 δi δa = 0 δl δa = 0 b (H 0 + H 1 )
Vlasov equation Distribution function is conserved along the particle trajectories f (Z(Z 0, t 0 ; t), t) = f (Z 0, t 0 ) yields the GK Vlasov equation by taking the time derivative d dt f (Z(Z 0, t 0 ; t), t) = dz f (Z, t) + t dt f (Z, t) = 0. Z The particle number conservation follows from Liouville s theorem for a time independent Jacobian: Z dz (B dt ) = 0 and the Vlasov equation can be written in the conservative form t ( 2π m 2 B f ) + Z ( 2π dz m 2 B dt f ) = 0. Full derivation, for example: [Miyato 2009].
Induction equations n 0 e 2 Σ sp mc 2 A + Σ sp e kbtn 0 4B 2 A 1 4π 2 A = Σ sp The p z formulation implies the appearance of large unphysical terms in the parallel Ampère s law. One can define the adiabatic part of the equlibrium distribution function as dw e p z c m J 0f f 0 = f M + f ad (1) and f ad ef M ( ) J0 Φ p z J 0 A k B Tc and an adiabatic current j ad j ad Σ sp e mc : = Σ sp e 2 mc 2 k B T (2) dwδ(r + ρ x)f ad p z dwδ(r + ρ x)f M p 2 z J 0 A (3)
Induction equations note that the simmetry of the Maxwellian in p z implies: ( pz ) 2 dwf M = n 0 k B T (4) m p z dwf M m = 0 (5) for electrons J 0 = 1: j ad e dwf ad p z = cm e 2 mc 2 k B T A n 0 k B T = e2 n 0 mc 2 A f = δf nonad + f M + f ad (6) n 0 e 2 Σ sp mc 2 A + Σ sp e kbtn 0 4B 2 A 1 4π 2 A = (7) Σ sp dw e ( p z c m J 0 δf nonad ef ) M k B Tc p za Σ sp dw p z e 2 f M m k B Tc 2 p zj 0 A
Energy theorem Thanks to its derivation from a Lagrangian density which does not directly depend on time, there is a conserved energy. In our case the following energy is conserved: E(t) = ( dω(h 0 + H 1 )f + sp dωh 2 f M ). (8) Let us verify this by direct computation. As H 0 and f M do not depend on time de dt (t) = ( dω(h 0 + H 1 ) f t + dω H 1 t f + dω H ) 2 t f M. sp (9) We first notice that H i t so that ( dω H 1 t f + = δh i δφ Φ t dω H ) 2 t f M = δl δφ Φ = 0. (10) t
Energy theorem On the other hand, we have for each species independently, denoting by H e = H 0 + H 1, dωh e f t = 0. This follows from the Hamiltonian structure of the Vlasov equation (Poisson brackets), but can also be verified as follows. As B = 0 and B / p = c/e b, we have (B H2 e f )+ (f (He 2 B )) = B f H2 e B H 2 f e c p p p p e f b H2 e. Integrating over phase space, the terms on the left hand side vanish. On the other hand (11) f b H 2 e = H 2 e (b f + (f b)). (12)
using the variational form of the polarisation equation Eq. (??) with δφ = Φ which reads Energy theorem Then, as dvdp dµ H 2 e (fb) = 0, using the GK Vlasov equation we get 2 ( dvdp dµb H f e t = dvdp dµ H 2 e c e b f B f H2 e (13) In the electrostatic, quasi-neutral limit that we consider, we have ) H 2 f e p p H 0 = m U2 2 + µb, H 1 = ej 0 Φ, H 2 = mc2 2B 2 Φ 2. (14) Then our conserved energy from Eq. (8) becomes: E(t) = ) dωf (m U2 2 + µb + ej mc 2 0Φ dωf M 2B 2 Φ 2 sp = ) dωf (m U2 2 + µb mc 2 + dωf M 2B 2 Φ 2 (15) sp
sp Energy theorem dωf M mc 2 B 2 Φ 2 = sp dωfej 0 Φ. (16) Note that the same relation can be obtained by multiplying the polarisation equation Eq. (??) by Φ and integrating (by part) over volume. Because of this last relation the energy can be written equivalently E = sp dωf(m U2 2 + µb + 1 2 ej 0Φ) E K + E F (17) with E F 1/2 sp dωefj0 Φ. The power balance equation, also called E B-thermal transfer equations is: de k dt (t) = de F (t) (18) dt
Energy theorem It can be verified, using the Euler-Lagrange equations, that de k dt (t) = dωfe (J 0 Φ) Ṙ0, (19) sp where R 0 represents the part of Eq.(??) which does not contain terms in Φ. This quantity can be compared to the time derivative of the field energy: de F dt (t) = d dt ( sp dωf 1 2 ej 0Φ In numerical simulations it is particularly useful to consider the following form of the power balance equation: ) (20) 1 de k E F dt (t) = 1 de F (t). (21) E F dt