ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

13
Computer Physics Communications 156 (2003) 95–107 www.elsevier.com/locate/cpc ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks R. Sánchez a,, J.R. Martín-Solís a , B. Esposito b a Departamento de Física, Universidad Carlos III, Avda. de la Universidad 30, Leganés, 28911 Madrid, Spain b Associazione Euratom-ENEA sulla Fusione, C.R. Frascati, C.P. 65, I-00044 Frascati (Rome), Italy Received 31 January 2003; accepted 30 July 2003 Abstract ORCO is a new code that estimates the spatial structure of the radial diffusion coefficient for runaway electrons in tokamak geometry. In real experiments, the location of these electrons can be detected by measuring the time evolution of their fast electron bremsstrahlung (FEB) emissivities, usually integrated along several lines of view. ORCO uses a Levenberg–Marquardt algorithm to adjust the free parameters of a generalized transport model to best reproduce the time evolution of these temporal traces. A possible future application for this type of calculations is to use them as indirect probes to test theoretical models of turbulent transport driven by stochastic magnetic fields in tokamaks. 2003 Elsevier B.V. All rights reserved. PACS: 02.60.Lj; 52.35.Py; 52.55.Mc; 52.55.Kj Keywords: Runaway electrons; Tokamaks; Magnetic turbulence; Diffusive transport; Non-orthogonal coordinates; Levenberg–Marquart optimization 1. Introduction In tokamak discharges, runaway electrons can be generated whenever a large toroidal electric field is induced. This is the case, for instance, during the ramp-up or the quench of the toroidal current. This electric field continuously accelerates electrons with initial energies exceeding some critical threshold, that is set by the value beyond which the collisional drag can no longer dissipate all the energy that electrons gain in the electric field. These electrons are known as * Corresponding author. E-mail address: [email protected] (R. Sánchez). first generation or Dreicer runaways [1] and would in principle accelerate with no bound. However, a second energy sink associated to the increasing radiation losses, that eventually dominates at higher velocities, sets the final runaway energy [2]. Once a sufficiently large population of these Dreicer runaways builds up, secondary generation or avalanching runaways can be produced as well as a result of the collisions between Dreicer runaways and thermal electrons [3]. A common feature to both types of runaways is that, since they scarcely collide with thermal parti- cles, they diffuse out of the tokamak by following the magnetic field lines. (This is in contrast to what hap- pens for lower-energy electrons [4].) Thus, the quality of their confinement could be interpreted as an indi- 0010-4655/$ – see front matter 2003 Elsevier B.V. All rights reserved. doi:10.1016/S0010-4655(03)00439-9

Transcript of ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

Page 1: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

c

tokamaktheir fastarquardttemporalodels of

rt

Computer Physics Communications 156 (2003) 95–107

www.elsevier.com/locate/cp

ORCO: A numerical tool to study the radial diffusionof runaway electrons in tokamaks

R. Sáncheza,∗, J.R. Martín-Solísa, B. Espositob

a Departamento de Física, Universidad Carlos III, Avda. de la Universidad 30, Leganés, 28911 Madrid, Spainb Associazione Euratom-ENEA sulla Fusione, C.R. Frascati, C.P. 65, I-00044 Frascati (Rome), Italy

Received 31 January 2003; accepted 30 July 2003

Abstract

ORCO is a new code that estimates the spatial structure of the radial diffusion coefficient for runaway electrons ingeometry. In real experiments, the location of these electrons can be detected by measuring the time evolution ofelectron bremsstrahlung (FEB) emissivities, usually integrated along several lines of view. ORCO uses a Levenberg–Malgorithm to adjust the free parameters of a generalized transport model to best reproduce the time evolution of thesetraces. A possible future application for this type of calculations is to use them as indirect probes to test theoretical mturbulent transport driven by stochastic magnetic fields in tokamaks. 2003 Elsevier B.V. All rights reserved.

PACS:02.60.Lj; 52.35.Py; 52.55.Mc; 52.55.Kj

Keywords:Runaway electrons; Tokamaks; Magnetic turbulence; Diffusive transport; Non-orthogonal coordinates; Levenberg–Marquaoptimization

beis

thehisithhatagonsas

ondtionies,tlyup,

een

isrti-ep-litydi-

1. Introduction

In tokamak discharges, runaway electrons cangenerated whenever a large toroidal electric fieldinduced. This is the case, for instance, duringramp-up or the quench of the toroidal current. Telectric field continuously accelerates electrons winitial energies exceeding some critical threshold, tis set by the value beyond which the collisional drcan no longer dissipate all the energy that electrgain in the electric field. These electrons are known

* Corresponding author.E-mail address:[email protected] (R. Sánchez).

0010-4655/$ – see front matter 2003 Elsevier B.V. All rights reserveddoi:10.1016/S0010-4655(03)00439-9

first generationor Dreicer runaways[1] and would inprinciple accelerate with no bound. However, a secenergy sink associated to the increasing radialosses, that eventually dominates at higher velocitsets the final runaway energy [2]. Once a sufficienlarge population of these Dreicer runaways buildssecondary generationor avalanching runawayscan beproduced as well as a result of the collisions betwDreicer runaways and thermal electrons [3].

A common feature to both types of runawaysthat, since they scarcely collide with thermal pacles, they diffuse out of the tokamak by following thmagnetic field lines. (This is in contrast to what hapens for lower-energy electrons [4].) Thus, the quaof their confinement could be interpreted as an in

.

Page 2: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

96 R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107

ceed,

llyif-

ius

n)ld.fg-siter-enttednttic-

edlie

re-o be

toity-ys,ka-d toin

iousw-tialial

s tohesillve-oron-

s toand

ofdif-ssesIn-tivein aetersrva-of aonntalea-EB)rcebethe

ka-ay

t.geof

hly

blydyave

hine

ichuse

gles tomtioned.toa-

ma.s-ate

rac-

rect estimation of the levels of magnetic turbulenand stochasticity present inside the tokamak. Indeit has been shown that, in the extreme limit of a fustochastic field in toroidal geometry, the runaway dfusion coefficient can be estimated as [5,6]:

(1)

D(r, v‖) = Dstv‖,

Dst(r) = πR∑m,n

|bmn(r)|2B2

0

δ

(m

q(r)− n

),

wherev‖ is the runaway velocity,bmn is the amplitudeof the resonant field mode located at the minor radr∗ that verifiesι(r∗) = m/n (ι = 1/q(r) is the ro-tational transform of the tokamak-like configuratioandB0 is the non-perturbed toroidal magnetic fieThus, some knowledge of thev‖-averaged value oD could be sufficient to estimate the levels of manetic turbulence present of the device. In the oppolimit, for a magnetic toroidal configuration with pefect closed magnetic surfaces, the diffusive coefficiwould be given by the neoclassical one [7] (evaluain the collisionality and velocity conditions relevafor runaways). In a real tokamak, regions of stochasity would probably alternate with good-quality clossurfaces, and the real diffusive coefficient shouldsomewhere in between these limits [8]. (Morecent discussions on these important issues can alsfound in Refs. [9,10].)

In the last fifteen years, it has been possibleobtain estimations of an spatially-averaged, velocaveraged radial diffusion coefficient for runawafrom a variety of diagnostic systems, in several tomaks [11,12]. These results have been then useestimate the levels of magnetic turbulence existingthese devices, as well as to test to some extent vartheoretical models of stochastic transport [13]. Hoever, no information could be gained about the spadistribution of magnetic turbulence due to the radaveraging.

In this paper, a code is presented that attemptattack the spatial deficiencies of previous approacin a numerically efficient way (some comments wbe made later on the remaining issue of thelocity dependence of the runaway diffusivities). Fthis purpose, the ORCO code (an acronym for nOrthogonal Runaway ConfinementOptimizer) im-plements a generalized transport model that triecapture the basic physics of runaway production

transport in tokamaks while keeping informationtheir spatial structure. The model considers bothfusive and convective transport as possible proceavailable to drive runaways out of the tokamak.formation about the spatial dependence and relaimportance of these transport channels is storedset of free parameters. The values of these paramthat best match the experimental runaway obsetions are then searched for numerically by meansLevenberg–Marquardt optimizing loop. In the versiof ORCO presented in this paper, the experimedata to be matched consist of line-integrated msurements of the fast electron bremsstrahlung (Fradiation emitted by runaways during their scacollisions with other particles. This radiation canroutinely detected in several tokamaks such asJoint European Torus (JET) [14] or the Frascati Tomak Upgrade (FTU) [15], and related to the runawelectron local density by [11]:

(2)IFEB(�r, t) � Crnr(�r, t)ne(�r, t)Zeff(�r, t),where nr denotes the runaway local density,ne isthe local thermal electron density,Zeff is the effec-tive charge number andCr is an unknown constanHowever, it is important to keep in mind that usaof ORCO need not be restricted to the geometrythis particular type of diagnostics, thanks to its higmodular structure.

In order to minimize the errors that are unavoidaadded by the numerical optimization to the alrealarge experimental uncertainties, several issues hbeen taken into account in the transport model witORCO. A first one has to do with the motion of thplasma column relative to the fixed lab frame in whthe FEB data are measured. This motion may cathat distinct spatial locations contribute to a sintemporal trace of FEB data. A second issue hado with the deformation of the plasma equilibriugeometry, that can change as a result of the variaof the plasma currents while data are being recordORCO tries to minimize these problems by usingits advantage other available experimental informtion regarding the position and shape of the plasThis information is accommodated within the tranport model by means of a time-dependent coordinsystem, that constitutes one of ORCO’s most chateristic features.

Page 3: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107 97

theosse-, inin

l ision,md.edto6,

ingitsom

inin

isalddntalising

sultmaBa

ichithith

EBult,t

The paper is thus organized as follows. First,general structure of ORCO is described in detail acrseveral sections. In Section 2, ORCO’s internal timdependent coordinate system is introduced. ThenSection 3, the FEB diagnostic system existingboth JET and FTU, to which the transport modecurrently coupled, is described. In the same sectthe intersection of the lines of view of this systewith the plasma column are analytically calculateNext, ORCO’s transport model equation is derivin Section 4. In Section 5, the numerical schemeintegrate this model is presented. Finally, in Sectionsome details on the Levenberg–Marquardt optimizloop are given. After the presentation of ORCO,application to a test case (a limiter discharge frthe JET tokamak) is described as an exampleSection 7. Finally, some conclusions will be drawnSection 8.

2. ORCO’s geometry and coordinates

As it was mentioned in the introduction, itimportant to minimize any error that the numericestimation of the runaway transport model might ato the uncertainties already present in the experimedata. A first problem that needs to be dealt withthe motion and the changes in shape of the confinmagnetic structure during the discharge. As a reof this motion and changes, the regions of the plasintersected by the fixed (in the lab frame) FEdiagnostic lines of view (see Fig. 1, that showssketch of the FEB diagnostic at JET), along whthe FEB emissivity is integrated, do change wtime. Therefore, these shifts can easily interfere wthe correct interpretation of the experimental Fdata if not properly taken into account. As a resthe reliability of the runaway diffusion coefficien

rtical ones

Fig. 1. Fast Electron Bremsstrahlung (FEB) radiation diagnostic system at JET. Horizontal channels are numbered #1–10, and ve#11–19.
Page 4: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

98 R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107

om

n-t al-ex-theto

ag-tes,g

sur-

ry-hcanor-e

xis

non

cal

etic

CS,

is.of

e-

t

-

gledale2).illnti-em.

obtained by ORCO and the conclusions derived frit might be seriously compromised.

ORCO faces this problem by means of a noorthogonal time-dependent coordinate system thalows to use to its advantage all the availableperimental knowledge of these changes duringdischarge (see Ref. [16] for a thorough introductiongeneralized coordinates). In it, each point in the mnetic configuration is described by three coordina(F,φ, θ), whereF labels a magnetic surface (goinfrom 0, at the magnetic axis, to 1, at the last closedface (from now on, referred to as LCS)) andθ andφare two poloidal and toroidal geometrical angles (vaing between 0 and 2π ) that locate the point on eacmagnetic surface. A mapping to these coordinatesbe easily constructed from the usual cylindrical codinates(R,φ,Z) if it is assumed that the LCS can bwell described by an ellipse of minor and major arespectively given bya andb (see Fig. 2). To do it, afirst functionalF ∗ is defined as follows (this functiois a slightly modified version of a parametric solutiof the Grad–Shafranov equations for a high-β toka-mak geometry [17]):

F ∗(R,Z) =((R −R0)

2

a2+ (Z −Z0)

2

b2− 1

)

(3)×(

1+ k2(R −R0)

a

)+ 1.

Fig. 2. Sketch explaining the relationship between cylindri(R,φ,Z) coordinates and ORCO’s(F,φ, θ) coordinates.�ε is themagnetic axis (MA) shift with respect to the last closed magnsurface (LCS) center.

This functional verifies thatF ∗(R,Z) = 1 corre-sponds to the elliptical shape assumed for the Lwith its center located at(R0,Z0), as long as|k2| < 1.The remaining undefined parameter,k2, is then pre-scribed to match the location of the magnetic axIndeed, it is straightforward to locate the minimumF ∗(R,Z) at (Raxis,Zaxis) given by:

(4)Raxis= R0 +a(

√1+ 3k2

2 − 1)

3k2,

Zaxis= Z0.

Defining now a normalized axis horizontal shift rspect to the center of the LCS,�ε ≡ (Raxis − R0)/a,and inverting Eq. (4), it is easily obtained that:

(5)k2 = 2�ε

1− 3�ε2.

The constraint|k2| < 1 thus limits its applicability todischarges with a maximum Shafranov shift|�ε| �1/3. This condition is however fulfilled by mos[moderate-β ] limiter discharges.

Finally, after normalizingF ∗ appropriately, a suitable expression forF(R,Z) reaching its minimumand vanishing at the magnetic axis is obtained:

(6)F(R,Z) ≡ F ∗(R,Z)− F ∗axis

1− F ∗axis

,

where the value ofF ∗ at the axis is given by:

F ∗axis≡ F ∗(Raxis,Zaxis)

(7)= −�ε2(

�ε2 + 1

1− 3�ε2

).

Regarding theθ coordinate, it is defined by:

(8)θ = tan−1[Z −Zaxis

R −Raxis

],

that corresponds to the geometrical poloidal ancentered at the magnetic axis. Finally, the toroiangleφ is trivially defined to be the same that thazimuthal angle of cylindrical coordinates (see Fig.

Since they will be needed in later sections, we walso give here the prescription to obtain several quaties related to the metric of the new coordinate systIn particular, the Jacobian of the transformation,

√g:

(9)√g = R

[∂F

∂R

∂θ

∂Z− ∂F

∂Z

∂θ

∂R

]−1

Page 5: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107 99

ui-’s

S,f

gelyun-anos-or

on-rgehe

iterhat,iterfu-U

eas-iesterb-

ly

ETra-esrdsdalnt

.e)sedinof

led

bys:

f

ing

hed

iond),

timeonhe

ist ofell

els.e totes

and the contravariant metric elementgFF :

(10)gFF = ∇F · ∇F =(∂F

∂R

)2

+(∂F

∂Z

)2

.

In summary, the shape and evolution of the eqlibrium geometry is totally determined in ORCO(F,φ, θ) coordinates by five functions of time:a(t)and b(t) that give the change of shape of the LCR0(t) andZ0(t) that give the motion of the center othe LCS, and�ε(t) that contains any possible chanof the Shafranov shift. All of them can be routineobtained from the reconstruction of the dischargeder analysis with the EFIT code [18]. [EFIT isMHD equilibrium solver that, thanks to the additioof appropriate response functions for existent diagntics (such as magnetic probes, poloidal flux loopsMotional Stark Effect measurements), is able of recstructing the magnetic geometry of a given dischafast and efficiently.] It is also relevant to say that trepresentation presently chosen forF is only validfor ellipsoidal plasmas, as those encountered in limtokamak discharges. The reason for this choice is tup to now, the code has been used to analyze limdischarges from the JET tokamak and, in the nearture, it is also to be applied to FEB data from the FTtokamak. However, other representations could beily implemented to parametrize different geometr(for instance,D-shaped divertor plasmas). As a matof fact, envisioning the future use of the EFIT equilirium solution (or that of any other MHD equilibriumsolver) within ORCO would not pose a particulardifficult problem.

3. Description of the FEB diagnostic system

The FEB experimental diagnostic available at J[19] consists of two cameras that provide line-integted temporal signals of the X-ray FEB emissivitialong ten vertical chords and nine horizontal chothat intersect with the plasma at constant toroiangle (see Fig. 1). It collects data in four differeenergy windows (in KeV):[133,200], [200,266],[266,333] and [333,400] (see Ref. [11] for details)A similar FEB system (on loan from CEA-Cadarachconsisting of one camera with 17 chords was also uin FTU during the period 1998–1999 (see Fig. 2Ref. [15]). Currently, a new FEB system consisting

two cameras (vertical and horizontal) is being instalin FTU and will be operative in the near future.

In ORCO, all the FEB chords are parametrizedstraight lines using the usual cylindrical coordinate

(11)Z = mkR + ck,

so that a pair of values(mk, ck) represents each othem. Then, the intersection of thekth chord with thechanging plasma is calculated analytically by lookfor solutions of the following system of equations:

(12)

[Z −Z0(t)

]−mk

[R −R0(t)

]= Ck(t)

[R −R0(t)]2a(t)2

+ [Z −Z0(t)]2b(t)2

= 1

whereCk(t) ≡ ck −Z0(t)+mkR0(t). A necessary andsufficient condition for the actual intersection of tkth chord with the plasma at timet can then be stateas:

(13)�k(t)2 ≡ b(t)2 +m2

ka(t)2 −Ck(t)

2 � 0,

and the coordinates of the two points of intersectof the chord and the LCS (when Eq. (13) is satisfie(Rk−,Zk−) and(Rk+,Zk+), by:

(14)Rk±(t) = R0(t) − mka(t)Ck(t) ∓ b(t)�k(t)

b(t)2 +m2ka(t)

2

and

(15)Zk±(t) = Z0(t) + b(t)

a(t)

√a(t)2 − [

Rk± −R0(t)]2.

The analytic knowledge of(Rk±,Zk±) will prove veryuseful later, since ORCO has to compute at eachthe line-integrated FEB intensities from the solutiof the transport model to compare them with texperimental FEB data.

4. Runaway transport model

In ORCO, a single partial differential equationused to describe the radial transport of runaways outhe tokamak. It includes a runaway source term as was possible diffusive and convective loss channHowever, an extra term must also be included duthe built-in time dependence of ORCO’s coordinathrough a(t), b(t), �ε(t), R0(t) and Z0(t). Thisdependence makes the local volume differential, dV =

Page 6: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

100 R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107

√hese

rces

n-

bee ofnet

illD)

ngn

fi-calthe21],eratex-2],t inx-

ruc-ort

atcedford.ybe

er-

y

ate

heo aing.

aces

g dF dφ dθ , to depend also on time. Therefore, tlocal runaway density may change with time in thecoordinates, even in the absence of local souand/or sinks!

However, the fact that the local number of ruaways must be conserved implies that

nr(F, θ,φ, t)√g(F, θ,φ, t)

(16)= nr(F, θ,φ, t +�t)√g(F, θ,φ, t +�t).

Using this equation, the extra term needed caneasily estimated by calculating the temporal changrunaway density in the absence of any source orflux of runaways:

∂nr

∂t= lim

�t→0

nr(F, θ,φ, t +�t)− nr(F, θ,φ, t)

�t

(17)= − nr√g

∂√g

∂t.

Therefore, ORCO’s runaway transport model wbe derived from the following three-dimensional (3partial differential equation:

∂nr

∂t+ nr√

g

∂√g

∂t

(18)= �Vc · ∇nr + ∇ · �Γ dr + Sr (�r, nr , t),

where �Γ dr is a diffusive runaway electron flux and�Vc

is a runaway convective or drift velocity. Regardithe runaway source,Sr , it includes the two generatiomechanisms mentioned in the introduction:

(19)Sr (�r, nr , t) = Spr (�r, t)+ nr

τs(�r, t) .

Spr gives the Dreicer generation rate. Its original de

nition can be found in Ref. [1], and a better analytiestimate in Ref. [20]. However, the one used incode is based on the calculations reported in Ref. [that includes relativistic corrections. On the othhand, 1/τs represents the characteristic production rvia avalanching, first estimated in Ref. [3]. The epression actually used in ORCO is that of Ref. [2which is based on the calculations first carried ouRef. [23]. Both of them are functions of available eperimental data such as the electron density,ne , elec-tron temperature,Te, effective charge numberZeff andelectric field,E‖. [The electric field is obtained eithefrom the experimental loop voltage or by reconstrtion with the JETTO code [24]. JETTO is a transp

code widely used within the tokamak community thworks on a two-step basis: first, profiles are advanaccording to a prescribed transport model; then,fixed profiles, a new equilibrium solution is computeBy using appropriate initial conditions provided bexperimental data, many quantities of interest caneasily computed. Information on the most recent vsion can be found in Ref. [25].]

Regarding the diffusive runaway flux, it is given bFick’s law:

(20)

�Γ dr = D(F,φ, θ)

[∂nr

∂F∇F + ∂nr

∂φ∇φ + ∂nr

∂θ∇θ

],

and its divergence is equal to:

∇ · �Γ dr = 1√

g

[∂

∂F

(√gD

[gFF ∂nr

∂F+ gFθ ∂nr

∂θ

])

+ ∂

∂θ

(√gD

[gFθ ∂nr

∂F+ gθθ ∂nr

∂θ

])

(21)+ ∂

∂φ

(gφφ√

gD∂nr

∂φ

)],

wheregij ≡ ∇i · ∇j (i, j = F , θ or φ) stands forthe different upper metric elements of the coordintransformation.

Since we will restrict ourselves to studying tradial transport of runaways, Eq. (18) is reduced tone-dimensional (1D) equation by surface-averagThe surface-average of any arbitrary functionA(F,φ,

θ) is defined to be:

(22)〈A〉 ≡ 1

4π2G

2π∫0

2π∫0

dφ dθ√gA(F,φ, θ),

where the functionG is defined by:

(23)G(F, t) ≡ 1

4π2

2π∫0

2π∫0

dφ dθ√g,

that can be interpreted by realizing that 4π2G(F, t)�F

is the volume enclosed between the magnetic surflabeled byF andF +�F .

The surface-average of Eq. (18) then yields:

Page 7: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107 101

⟨ √ ⟩

on

ev-

-

m-re-ceer-tiveop-yeri-

ndingmelf)

izes

he

r:

e

tri-

x

∂〈nr 〉∂t

+ nr√g

∂ g

∂t

= 1

G

∂F

(G

⟨D

[gFF ∂nr

∂F+ gFθ ∂nr

∂θ

]⟩)(24)+ 〈 �Vc · ∇nr 〉 + 〈Sr 〉.

Then, the runaway density is rewritten asnr(F,φ, θ)

= t〈nr 〉 + nr,1(F,φ, θ) and it is assumed that|nr,1| �〈nr 〉. An effective surface-averaged radial diffusicoefficient is defined as well:

(25)D(F) ≡ 〈gFFD〉〈gFF 〉 .

This allows to reduce the transport equation, after seral straightforward manipulations, to its final form:

∂〈nr 〉∂t

+ 〈nr 〉G

∂G

∂t

= 1

G

∂F

(G〈gFF 〉D∂〈nr 〉

∂F

)

(26)+ 〈V Fc 〉∂〈nr 〉

∂F+ 〈nr 〉

〈τs 〉 + ⟨Spr

⟩,

where the surface-average of theF -contravariant component of the drift velocity is defined as:

(27)⟨V Fc

⟩≡ 〈 �Vr · ∇F 〉,and that must satisfy that:

(28)limF→0

⟨V Fc

⟩= 0,

since∇F vanishes at the magnetic axis.When examining Eq. (26), it is clear that the co

plete determination of the transport model onlyquires the finding of two free functions of the surfalabel F : a surface-averaged convective velocity ppendicular to the magnetic surfaces and an effecsurface-averaged radial diffusion coefficient. Thetimizing loop inside ORCO will search for them brequesting Eq. (26) to be able to reproduce the expmental FEB measurements (see Section 6).

5. Numerical scheme

To integrate Eq. (26) numerically, a stable aaccurate iterative algorithm has been derived by usa second order Crank–Nicholson differencing sche[26]. The temporal and spatial (both full and ha

meshes are built using temporal and spatial step srespectively given by:

(29)�t ≡ tf − t0

Nt − 1and �F ≡ 1

N − 1,

wheretf andt0 are the final and initial times;Nt andN are the total number of points respectively in ttemporal and (full) spatial meshes:

(30)tj = t0 + j�t, j = 0,1, . . . ,Nt − 1,Fk = k�F, k = 0,1, . . . ,N − 1,Fl+1/2 = Fl + (�F/2), l = 0,1, . . . ,N − 2.

The solution at timetj is represented by the vecto

(31)Njr ≡ [

(nr )j

1, (nr )j

2, . . . , (nr )j

N−1

].

Note that the values ofnr at F0 andFN are fixed forall time by the boundary conditions chosen:(nr )

j0 =

(nr )j

1, ∀j and(nr )jN = 0, ∀j , so they do not need b

included in the iterating scheme.The resulting iterating scheme can be set in ma

cial form:

(32)Aj+1Nj+1r = BjN

jr +Cj,j+1,

whereA is a (N − 2) × (N − 2) tridiagonal non-symmetric matrix given by:

Ajkl = δkl

[3

2− G

j−1k

2Gj

k

− �t

2〈τs〉jk+ �t

2(�x)2Gj

k

(〈gFF 〉jk−1/2Dk−1/2

+ 〈gFF 〉jk+1/2Dk+1/2

)]

−δk,l+1�t

2(�x)2

[ 〈gFF 〉jk+1/2Dk+1/2

Gjk

−�x〈V Fc 〉k

]

(33)

−δk,l−1�t

2(�x)2

[ 〈gFF 〉jk−1/2Dk−1/2

Gjk

+�x〈V Fc 〉k

],

being δjk the usual Kronecker delta.B is a second(N − 2)× (N − 2) tridiagonal non-symmetric matrirelated toA through (I is the identity matrix):

Page 8: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

102 R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107

[ (j+1 j−1

)]

erfullm-nm-

ce-ote.

Ofor

e

o-heeentions:

illa-

etar-atatheriza-essis

get

t

m-e-

osenc-

ypehe

e

cur-

ns-ty:

nt

n

ucein

nes atals

(34)Bjkl = 3− 1

2

Gk +Gk

Gjk

δkl −Ajkl.

Finally, the independent(N − 2)-vectorCj,j+1 isgiven by:

(35)Cj,j+1k = �t

2Gjk

[G

j+1k 〈Sp〉j+1

k +Gjk〈Sp〉jk

].

Notice that in all the previous definitions, integ[semi-integer] subscripts denote evaluation on the[half] spatial grid, while superscripts refer to the teporal mesh. TheAx = B linear system of Eq. (32) canow be easily solved by using a standard LU decoposition routine for tridiagonal matrices [26], sinCj,j+1 is independent ofNj+1

r , being completely determined at all times from the experimental data. Nas well that allGj

k are known analytically at all times

6. Levenberg–Maquardt FEB scheme

The optimization module is the part of ORCthat explores the free parameter space in searchthe D and 〈V F

c 〉 functions that best reconstruct thexperimental FEB measurements.

This search is carried out using an optimizing algrithm based on a Levenberg–Marquardt loop [27]. Tway it is done follows a scheme that has already bproved very successful in the design and optimizaof compact stellarators [28–30]. It goes as followfirst, a target function is built that the optimizer wtry to minimize with respect to a vector of free parmeters, �p = (p1,p2, . . . , pMp). This vector includesbothD and〈V F

c 〉 (using a representation that will bdiscussed below) as well as the unknown constanCr

appearing in Eq. (2). The target function mainly cries information about how well the experimental dcan be reconstructed from the model. But some oconstraints that must be satisfied during the optimtion are also included (for instance, the positivenof the diffusion coefficient on all surfaces). Thus, itbuilt as a sum ofMt partial target functionsχk :

(36)χ2( �p) =Mt∑k=1

χ2k ( �p)σ 2k

,

normalized using adjustable weightsσk that allow torescale the relative contributions of each partial tar

function to the totalχ2. Naturally, it must hold thaMt >Mp in order to get meaningful results.

Usual partial target functions are those that copare the time trace of the experimental FEB linintegrated emissivities along each chord with thpredicted by the numerical reconstruction. These futions are usually computed as integrals of the t([t0, tf ] denotes the temporal interval over which treconstruction is done):

(37)

(χ2k )

int( �p) =tf∫

t0

dt ′ h(t ′)[L

expk (t ′) −LORCO

k (t ′, �p)],where L

expk (t ′) is the experimental FEB time trac

along thekth chord andLORCOk (t ′, �p) is the time trace

predicted by ORCO on the same chord using therent set of values for�p. LORCO

k is computed frominserting the runaway density obtained from the traport model into Eq. (2) to get the local FEB emissivi

(38)IFEB(F, t, �p) = Crne(F, t)nr (F, t, �p)Zeff(t).

Then, line-integration along thekth chord gives:

(39)LORCOk (t, �p) =

∫kth-chord

IFEB(lk(F ), t, �p)dlk,

where dlk is the length element along the relevachord. Finally, the functionh(t ′) in Eq. (37) is a tem-poral window that allows to focus the optimizatioeffort within a prescribed temporal interval[td , tu]. Itis defined as:

h(t) = H(t − td) −H(t − tu),

(40)t0 � td < tu � tf ,

whereH(t) is the usual Heaviside step function.Sometimes, it may also be important to reprod

the times at which the signals reach their maximaintensity at the different chords. This can be dousing as target functions the comparison of the timewhich the maximum of the line-integrated FEB signare reached:

(χ2k )

max( �p)

(41)

=[

maxt∈[t0,tf ]

{L

expk (t)

}− maxt∈[t0,tf ]

{LORCOk (t, �p)}]2

,

Page 9: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107 103

sethe

avetant

s ofms

the

forxisialsre,

teditye-

-

he, as].)n-

aly-iterd el-use

sti-1)

an

ede-

which can be useful to follow the propagation of themaxima as a runaway population generated atcentral locations is transported outwards.

Coming now to the free parameter vector, we hchosen as its first component the unknown consappearing in Eq. (2):p1 = Cr . The rest of thecomponents are provided by the representationbothD and〈V F

c 〉, that have been expressed in terof expansions in orthogonal polynomials [31]:

(42)D(F, �p) =lD∑l=1

pl+1Hl(F )

and

(43)〈V Fc 〉(F, �p) =

lV∑l=1

pl+lD+1H2l−1(F ).

Thus, the total number of free parameters inoptimization isMp = lD + lV +1. Notice that only oddpolynomials have been included in the expansion〈V F

c 〉 to enforce that it vanishes at the magnetic a(see Section 4). Several choices for the polynomHl are available inside ORCO including the LegendGegenbauer and Tchebyschev families.

7. Test case: JET limiter discharge 29586

As an example of application we have estimaD(F) during the current-up phase of a low-denslimiter JET discharge (#29586). The main paramters of this shot areB = 2.5 T, a = 1 m, b = 1.3 m,toroidal currentIp = 1–1.6 MA, line-integrated central densityne = (0.5–1.5) · 1019 m−3, Te = 2–3 KeVandZeff = 1.5–3.5. (Detailed temporal traces of tplasma current, loop voltage and electron densitywell as many other details can be found in Ref. [11The evolution of the electric field has been recostructed by means of the JETTO code [24].

The main reasons for choosing this case for ansis are two. First, because the geometry of limdischarges resembles more closely the axis-shifteliptical geometry assumed by ORCO. Second, becaone of the averaged runaway diffusion coefficient emations mentioned in the introduction (see Sectionwas obtained with this JET discharge:Dr � 0.2 m2/s[11]. Therefore, the results obtained with ORCO cbe compared with an independent assessment.

The evolution of the experimental line-integratFEB emissivity signals is shown in Fig. 3 for repr

Fig. 3. Temporal evolution of the FEB emissivities (in a.u.) detected in vertical (left) and horizontal (right) chords.

Page 10: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

104 R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107

icaltheds

sof

(seeat-ithis-kesp-ngt isch

lyig-terrted

atherdsest-

oseToly3–

theltstn

on,

).

eeenles.utting

rtch-g aeme

t

rget

-bera-

r-n.

isoe ifver,tal10,berighsig-thatare

ried

lyrget

sentative vertical and horizontal chords (the physlocation of the chords can be seen in the sketch ofdiagnostic shown in Fig. 1). The signal corresponto the [133,200] KeV energy window, since that ithe one with best statistics. Clearly, the maximumthe signals is first reached at the central chordshorizontal chord #5 and vertical chord #15). Correling the time of appearance of these first maxima wthe current and density time evolution during the dcharge, it is realized that the runaway generation taplace in the central region during the current ramup phase, when the parallel electric field is stroand the density low. Their energy at that momenestimated to be (1–2) MeV [11], and seem to reaquickly their radiation-limit energy at approximate2.5 MeV [32]. It is also observed that the FEB snals from the outer chords reach their maxima at latimes, suggesting the these electrons are transpooutwards with time.

In the analysis of Ref. [11] it was found thdiffusive transport might be sufficient to explain ttime evolution of the FEB signal at the central cho(in particular, only chords 15–18 were used, and a tand-error method was used to determineDr ), whilst itfailed to account for the behavior at the ones whdominant contribution was supplied by the edge.check this conclusion, we first use ORCO with onthe central chords (vertical: #13–17; horizontal: #7), imposing that〈V c

F 〉 = 0. It will however proveuseful later, as a way to check the robustness ofresults of the optimization. Coming now to the resuof this first optimization, it is shown in Fig. 4 thathe shape ofD obtained depends at first heavily othe number of polynomials included in the expansik. Indeed, the total target functionχ2 decreases withincreasingk until k � 4 (see inset of the same figureThen, the shape (and the value ofχ2) stays roughlythe same untilk > 8, beyond which convergencbecomes more dubious due to the similarity betwthe number of dependent and independent variabThe resulting diffusion coefficient is not constant, bincreases towards the edge, being able of simulathe FEB traces pretty well (see Fig. 5).

As a test to confirm that the diffusive transpochannel provides indeed a plausible dominant meanism, we have repeated the calculations allowinnon-zero drift velocity profile. But, the best fit to thFEB signals is again obtained by [almost] the sa

Fig. 4. Profiles forD that yield a minimum of the total targefunction for different number of polynomials (k) using only thecentral chords in discharge 29586. Inset: value of the total tafunction as a function ofk.

shape forD and a negligible drift velocity. This insensitivity to the existence of a possible drift mightinterpreted as a confirmation of the dominance ofdial diffusion for the runaway core transport.

To continue with the analysis, all vertical and hoizontal chords are now included in the optimizatioAgain, we will set first〈V F

c 〉 = 0. The shape ofD pro-viding with a minimum for the total target functionshown in Fig. 6. Clearly, diffusivity remains similar tthat obtained with the central chords (as it should bit is to reproduce the traces at those chords). Howethe value ofχ2 deteriorates notably since the topenalty function increases by a factor close to 8–even after normalizing to account for the extra numof chords. The reason must be looked for in the hvalue of the partial targets associated to the FEBnals of the chords #1, #9, #11 and #19 (see Fig. 7),the algorithm reconstruct much more poorly: theseprecisely the ones looking at the plasma edge!

If we now repeat the same robustness test carout before by allowing〈V F

c 〉 �= 0, a non-negligible[outward] drift velocity profile is obtained, particularat the plasma edge (see Fig. 8). The total partial taχ2 is reduced around a 30% with the change, whileD

Page 11: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107 105

Fig. 5. Comparison of experimental and simulated FEB emissivities at central chords for the diffusive coefficient shown in Fig. 4 withk = 6.

tf

arilyutt beta

EB

too

seur

Fig. 6. Profiles forD that yield a minimum of the total targefunction as a function ofk using all FEB chords. Inset: value othe total target function.

changes appreciably. These results do not necessimply the physical meaningfulness for such a drift, bthey suggest instead that diffusive transport may nosufficient to explain the contribution to the FEB da

Fig. 7. Contributions to the total target function of the different Fchannels for the optimization done withk = 6 and all FEB chords.

from edge runaways or that those edge signals aremuch distorted by noise.

Finally, we will compare these results with thoreported in Ref. [11]. It is first necessary to convert o

Page 12: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

106 R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107

andis

sily

ent-.c-

c-hiftg-theal-ut itthaterds

tionri-theis.

e.

d todialontoure-

s antheofur-

cal, thetry.ithsnt

e-byisto-

usedchEB

Fig. 8. Test of robustness for the results obtained with all chordsk = 6. The profile of the drift velocity that yields the best resultsplotted with a black thick line.

diffusive coefficient to real-space. This can be eadone by rewriting the argumentF as a function of thecylindrical coordinates:

(44)D = D[F(R,Z)

].

In Fig. 9, we compare the constant diffusive coefficireported in Ref. [11] with the diffusive coefficient obtained previously, usingk = 6, for the central chordsThree curves forD have been included, that respetively correspond to the values along theZ-axis andthe R-axis. Notice that there are two different funtions for the latter, since the plasma Shafranov spreventsD to be symmetric with respect to the manetic axis. Two conclusions can be extracted fromfigure: (1) that diffusivity seems to be much larger (most seven times) closer to the plasma edge (bmust be said that accuracy is worst there) and (2)the values ofD found at the low-field side of the cor(that correspond to the region explored by the cho#15–18 that were used in that reference),∼ 0.3 m2/sare in good agreement with the previous estima∼ 0.2 m2/s. Especially, when considering the expemental uncertainties, the cylindrical geometry andabsence of any optimization of the previous analys

Fig. 9. Profiles forD along theR-axis andZ-axis corresponding tothe results obtained withk = 6 and using only the central chords.Dr

obtained in Ref. [11] is also included (dashed line) as a referenc

8. Conclusions

We have developed a code that can be useestimate the spatial structure of the runaway radiffusive coefficient in tokamaks. The code reliesthe optimization of an internal transport modelbest reconstruct some set of experimental measments related to runaway electrons. It representimprovement with respect to other codes due toincorporation to the optimization effort of detailsthe plasma evolution through the discharge. In its crent implementation, only discharges with an elliptiplasma shape are amenable of analysis. Howevermain algorithm does not assume any type of geomeTherefore, it could also be applied to discharges wdifferent shapes (for instance, toD-shaped plasmas athose characteristic of divertor operation) if a differefunctionF is chosen, or even if a fully numerical dscription of the equilibrium (such as that providedEFIT [18] or other similar codes) is implemented. Thupgrade would not present major difficulties thanksthe highly moduler structure of ORCO. Similar comments can be made about the diagnostic systemto supply to ORCO with experimental data on whito base the optimization. In the present version, a F

Page 13: ORCO: A numerical tool to study the radial diffusion of runaway electrons in tokamaks

R. Sánchez et al. / Computer Physics Communications 156 (2003) 95–107 107

mis-heticssotothe

ent

tsoniveiseof

ofonalasceoflessbleithatthergeoverrgymitheblerasribethetillofort

entyansthetics

earsingluea

onh-pan-

hys.

8.

.

5.

85)

ield

ess,

ix-

ya,39

55.int

ry,986.9.

.A.

al68.hys.

en,

diagnostic system that measures line-integrated esivities has been used. This will prove useful for tanalysis of the data obtained with the FEB diagnoscurrently being upgraded at FTU. But it would albe easy to modify the diagnostic module in ORCOaccommodate other runaway diagnostics, such asinfrared cameras existent in the Toroidal EXperimfor Technically Oriented Research (TEXTOR) [33].

Finally, we would like to make some commenabout the possibility of obtaining some informatiof the velocity dependence of the runaway diffuscoefficient within the framework presented in thpaper. Clearly, the possibility of introducing somv‖ dependence on the transport coefficients, andevolving a transport equation forf (�r, v‖) (the v⊥-averaged runaway distribution function insteadnr(�r)) appears to be feasible. A similar optimizatimight then yield information, not only of the spatidependences ofD, but on its velocity dependenceswell. This would allow not only to estimate turbulenlevels, but also to test experimentally the reliabilityEq. (1). However, this approach is presently hopeunless the experimental diagnostic system is ato collect separate information from runaways wdifferent energies. The only information of this kindour disposal is provided by the energy windows ofFEB diagnostic. But, in the case of the JET dischawe analyzed in the present paper, these windows conly energies between 133–400 KeV, while the eneof the runaways seems to reach the radiation-liat approximately 2.5 MeV as they diffuse out of ttokamak. An improved analysis could be availaat JET in the near future, as the JET FEB camehave been upgraded since the measurements descin these paper were performed: at present [34],FEB energy range extends up to 6 MeV (with sfour energy windows available) and some studythe velocity dependence of the runaway transpcoefficient should be possible. As a final commit is fair to say that, even with this lack of energresolution, the results herein reported are by no meworthless. In many experimental cases similar toone analyzed in this paper, independent diagnosstrongly suggest that the runaway population appto be forming a quasi-monoenergetic beam durmost of the analysis time [32]. In this sense, the vaof D obtained by ORCO pertains to runaways withwell defined energy.

d

Acknowledgements

Valuable discussions with M. Varela and advicethe Levenberg-Marquardt algorithm from S.P. Hirsman are acknowledged. Research supported by Sish DGES Project No. FTN2000-0965.

References

[1] H. Dreicer, Phys. Rev. 117 (1960) 329.[2] J.R. Martín-Solís, J.D. Alvarez, R. Sánchez, B. Esposito, P

Plasmas 5 (1998) 2370.[3] R. Jayakumar, et al., Phys. Lett. A 172 (1993) 447.[4] J.W. Connor, Plasma Phys. Contr. Fus. 35 (1993) B293.[5] A. Rechester, M. Rosenbluth, Phys. Rev. Lett. 40 (1978) 3[6] H.E. Mynick, J.D. Strachan, Phys. Fluids 24 (1981) 695.[7] F.L. Hinton, R.D. Hazeltine, Rev. Mod. Phys. 48 (1976) 239[8] C.C. Hegna, J.D. Callen, Phys. Fluids B 5 (1993) 1804.[9] R.W. Harwey, et al., Phys. Plasmas 7 (2000) 4590.

[10] P. Helander, et al., Phys. Plasmas 7 (2000) 4106.[11] B. Esposito, et al., Plasma Phys. Contr. Fus. 38 (1996) 203[12] R. Jaspers, et al., Nucl. Fusion 33 (1993) 1775.[13] R.J. Bickerton, Plasma Phys. Control. Fus. 39 (1997) 339.[14] P.H. Rebut, R.J. Bickerton, B.E. Keen, Nucl. Fusion 25 (19

1011.[15] B. Esposito, et al., Phys. Plasmas 10 (2002) 2350.[16] W.D. D’Haeseleer, et al., Flux Coordinates and Magnetic F

Structure, Springer-Verlag, New York, 1991.[17] J. Freidberg, Ideal Magnetohydrodynamics, Plenum Pr

New York, 1987.[18] L.L. Lao, et al., Nucl. Fusion 25 (1985) 1611.[19] P. Froissard, Ph. Thesis, Universite de Provence, A

Marseille, 1992.[20] R.M. Kulsrud, et al., Phys. Rev. Lett. 31 (1973) 390.[21] J.W. Connor, R.J. Hastie, Nucl. Fusion 15 (1975) 415.[22] S.V. Putvinski, P. Barabaschi, N. Fujisawa, N. Putvinska

M.N. Rosenbluth, J. Wesley, Plasma Phys. Control. Fusion(1997) B157.

[23] M.N. Rosenbluth, S.V. Putvinski, Nucl. Fusion 37 (1997) 13[24] G. Cenacchi, A. Taroni, Rep. JET-IR(88) 03, JET Jo

Undertaking, Abingdon, 1988.[25] A. Airoldi, G. Cenacchi, Nucl. Fusion 37 (1997) 1117.[26] W.H. Press, S.A. Teukolsky, W.T. Vetterling, B.P. Flanne

Numerical Recipes, Cambridge Univ. Press, Cambridge, 1[27] F. Gill, Practical Optimization, Prentice-Hall, New York, 198[28] S.P. Hirshman, et al., Phys. Plasmas 6 (1999) 1858.[29] R. Sanchez, S.P. Hirshman, A.S. Ware, L.A. Berry, D

Spong, Plasma Phys. Contr. Fusion 42 (2000) 641.[30] A.H. Reiman, et al., Phys. Plasmas 8 (2001) 2083.[31] M. Abramowitz, I.A. Stegun, Handbook of Mathematic

Functions, Natl. Bureau of Standards, Washington, DC, 19[32] J.R. Martín-Solís, B. Esposito, R. Sánchez, J.D. Alvarez, P

Plasmas 6 (1999) 238.[33] R. Jaspers, Ph. Thesis, Technical University of Eindhov

1995.[34] V.G. Kiptily, Private communication, 2003.