Lower hybrid Simulation Code (LSC) Manual by DW Ignat, SC Jardin et al

Lower Hybrid Simulation Code Manual

Lower Hybrid Simulation Code Manual

D. W. Ignat,
S. C. Jardin, D. C. McCune and E. J. Valeo
Plasma Physics Laboratory
Princeton University
 
November 2000

Abstract

The Lower hybrid Simulation Code (LSC) is computational model of lower hybrid current drive in the presence of an electric field. Details of geometry and the plasma profiles are treated. Two-dimensional velocity space effects are approximated in a one-dimensional Fokker-Planck treatment. If LSC is coupled with a model that connects local toroidal electric field and local current through Faraday's law, then details of current development can be examined. This Fortran 77 code does not call mathematical subroutines from proprietary libraries, and has been run under several compilers on several platforms. Graphical output is available via the public domain Scientific Graphics library developed at PPPL (sglib) and the gnuplot system, which is also freely available. LSC is therefore portable. The intent is to operate in double precision so results are not sensitive to changes between machines with a natural 64 bit word and 32 bit work stations, but operation in single precision is possible. Operation in double precision does not depend on compiler switches (for example, -r8) but is set up for the use of #define REAL real*8 and the standard C-pre-processor.

To read the mathematics in this version, which was produced by TtH, under Unix and Netscape, put the following line in .Xdefaults or .Xresources:
 
Netscape*documentFonts.charset*adobe-fontspecific: iso-8859-1

Nov 19, 2000



Contents

1  Introduction
2  Theoretical Background
    2.1  Geometrical Configuration
    2.2  Wave Propagation
        2.2.1  Dispersion relation and energy absorption
        2.2.2  Changes to k||
    2.3  Fokker-Planck Equation
        2.3.1  Quasilinear Diffusion Coefficient
        2.3.2  Kinetic Equation
        2.3.3  Some Numerical Details
    2.4  RF-Driven Current
    2.5  Broadening of rf-Driven Current
    2.6  Heuristic Power Diffusion Estimate
    2.7  X-ray Camera Image
3  LSC Usage
    3.1  Input Files
        3.1.1  Plasma
        3.1.2  LH parameters
        3.1.3  Computational parameters
        3.1.4  Flags for graphs and print files
        3.1.5  Calling arguments
    3.2  Output files
    3.3  Output graphs
4  Appendix: Brief Description of Source Files




1  Introduction

Lower hybrid heating has been of interest for some time. Computational analysis perhaps started with an approach to calculating the spectrum of waves launched from a coupler [1]. The eikonal method [2], or geometrical optics [3], also referred to as ray tracing, was known to be available to problems in plasma physics, and several workers started investigating the consequenses of the ray method [4,5,6,7,8]. Success at driving the toroidal current in a tokamak [9,10] following theoretical predictions [11] caused increased interest in theory [12,13], modelling [14,15,16,17] and related considerations [18,19,20,21,22]. A natural extension was to add to the comprehensive analysis tools such as TRANSP [23,24] and TSC [25] the the best models of lower hybrid heating (LHH) and lower hybrid current drive (LHCD). Such an extension was particularly desirable becasue of a possible investment in a major new project to operate a tokamak in a steady state mode [26,27].

A static but magnetically accurate model [28,29] plus studies of wave chaos and accessibility [18,22,30,31] revealed many of the important issues.

The Lower hybrid Simulation Code (LSC) is a computational model of lower hybrid current drive in the presence of an electric field [32] derived from direct forerunners in references [8] and [15]. Heating of electrons and ions is also computed. Details of geometry and the plasma profiles are treated, so that the accessibility problems are treated as fully as possible in the ray model [32,21]. Two-dimensional velocity space effects are approximated in a one-dimensional Fokker-Planck treatment [12]. LSC contains a model of an xray camera to help compare results of the model with the physical camera [33,34,35,36].

Applications include work in references [32], [37] and [38].

The LSC was originally written to be a module for lower hybrid current drive and heating called by the Tokamak Simulation Code (TSC) , which is a numerical model of an axisymmetric tokamak plasma and the associated control systems [25,39,40]. The TSC simulates the time evolution of a free boundary plasma by solving the MHD equations on a rectangular computational grid. The MHD equations are coupled to the external circuits (representing poloidal field coils) through the boundary conditions. The code includes provisions for modeling the control system, external heating, and fusion heating.

The LSC module can also be called by the TRANSP [23,24] code. TRANSP represents the plasma with a axisymmetric, fixed-boundary model and focuses on calculation of plasma transport to determine transport coefficients from data on power inputs and parameters reached.

This manual covers the basic material needed to use the LSC. If run in conjunction with TSC, the ``TSC Users Manual'' should be consulted [39,40]. If run in conjunction with TRANSP, on-line documentation will be helpful.

The few general mathematical subroutines (root finder, matrix invertor, random number generator) were taken from the the standard ``Numerical Recepies'' textbook [41]. X ray cross sections were entered from the literature [42,43]. Therefore no external libraries are needed for LSC.

A theoretical background of the governing equations and numerical methods is given in section 2. Information on obtaining, compiling and running the code is given in section 3.

This manual can be found at w3.pppl.gov through one or all of ~ignat, NTCC or topdac.

At such locations there will be links to the source code .

The manual is available in html written by Ian Hutchinson's program TtH and in html written by latex2html. For viewing TtH output with netscape under Unix you will need to put the following line in either .Xdefaults or .Xresources:

Netscape*documentFonts.charset*adobe-fontspecific: iso-8859-1

Neither html version is meant for printing.

The manual is also available in PostScript as a .ps.gz file and in the Portable Document Format pdf with activated internal links as a .pdf file.



2  Theoretical Background

The following description of the governing equations and numerical methods closely follows the original paper describing the LSC model [32].

2.1  Geometrical Configuration

A cylindrical coordinate system with R as the radial coordinate, Z as the axial coordinate and f as the toroidal symmetry angle is used. In LSC this triple is thought of in as (R,Z,f), whereas in TSC this is considered (R,f,Z). In other words, there can be confusion over the f direction.

For LSC and TSC the poloidal flux is minimum in the center of the plasma and rises toward the plasma boundary. For LSC the BZ at the outer midplane is positive for a positive current.

2.2  Wave Propagation

2.2.1  Dispersion relation and energy absorption

We assume that the plasma varies sufficiently slowly on a wave period and a wave length so that the WKB approximation is valid. We therefore assume that the wave electric field can be decomposed into a set of components indexed by j,


E = Sj Ej(r ) expi Fj  ,
(1)
where the rapid space and time variation occurs through the exponential


Fj º ó
õ
kj(r ) ·dr  -  wt  ,
(2)
which depends on the local wave vector kj and the frequency w. Additional time behavior is ignored because the transit time of a wave is short compared to the time scale of plasma evolution. The mode amplitudes Ej vary much less rapidly. Suppressing the index j, each mode locally satisfies the matrix equation, [44]


kk - I k2 + k02 K(r,k, w) ]·E = 0
(3)
where k0 = w/c represents the free-space wavenumber, and K is the dielectric tensor, which has a nontrivial solution for a vanishing determinant


e(w, k, r) º |kk - I k2 + k02 K(r,k, w) ]| = 0     .
(4)
The dispersion relation  (4) connects the vector k and frequency w at the spatial location r (explicit time variation of the dielectric properties are assumed negligible from here on). To proceed it is convenient to choose a local Cartesian coordinate system [44], such that [^(z)] ×B = 0, and k is contained in the x-z plane:


k = k||   ^
z
 
+ k^  ^
x
 
 .
(5)
For lower hybrid waves, the ion cyclotron frequency is much less than the wave frequency which is much less than the electron cyclotron frequency: wci << w << wce, an inequality assumed throughout. In the Hermitian part of the dielectric tensor we keep only cold plasma terms, except that the dominant warm-plasma term is carried to guard against singularity near the lower hybrid resonance.

The anti-Hermitian part of the tensor is retained as a perturbation. For the case at hand, the principal such term enters as an imaginary correction to Kzz, and describes the interaction between the component of the wave electric field parallel to B and electrons whose speed along B matches that of the wave (Landau damping ). Thus, the plasma dielectric behavior is described by the following tensor elements, all other elements being zero:


Kxx = Kyy
=
S - ak^2     ,
(6)
-Kyx = Kxy = i D
=
i wpe2
wwce
   ,
(7)
Kzz
=
P     + i Kzz,i    ,
(8)
where


S
=
1 + wpe2
wce2
-
å
j 
wpi,j2
w2
    ,
(9)
a
=
3
4
wpe2
wce4
vTe2 + 3
å
j 
wpi,j2 vTi,j2
w4
    ,
(10)
P
=
1 - wpe2
w2
    ,
(11)
Kzz,i
=
- p wpe2
w
ó
õ
dv||v|| fe
v||
d(w- k||v||)     ,
(12)
and the new symbols are as follows: wpe is the electron plasma frequency ne e2/(e0 me), wpi,j is the ion plasma frequency of the jth species, vTe and vTi,j are electron and ion thermal velocities ( º kT/m), and fe(v||) is a one-dimensional electron velocity distribution function normalized such that


ó
õ
dv||fe(v||) = 1  .
(13)
The permittivity of free space is e0. The thermal term designated by a would be important near lower hybrid resonance , S = 0. However, in cases treated in this paper S does not approach zero, and a is not important. This would be true whenever w2 >> wcewci. The wave-particle interaction responsible for electron heating and current drive is in Kzz,i. In the event the lower hybrid resonance should become important, a thermal term representing the ion wave-particle interaction would have to be added to Kxx and Kyy, but here we assume such terms vanish.

In the coordinate system of equation (5), we decompose the dispersion relation  (4) into its real and imaginary parts using equations (6) - (12),


e = er + i ei = 0  ,
(14)
where


er
=
-ak^6 + k^4 S + k^2   é
ë
(P + S)(k||2-k02S) +k02D2 ù
û
+P   é
ë
(k||2-k02S)2-k04D2 ù
û
    ,
(15)
ei
=
er
P
Kzz,i     .
(16)

If n º k c / w >> 1 a simplified dispersion relation can be found from the matrix equation leading up to equation (4) by asymptotically expanding


^
n
 
~
^
n
 
0
 
+ 1
n2
^
n
 
1
 
+ O( 1
n4
)  ,
E
~
E0 + 1
n2
E1 + O( 1
n4
)  .
(17)
To lowest order, I^·E0 = 0, where I^ = I - [^(n)] [^(n)], so that E0 = [^(n)]0 E0. In first order, there arises the solubility condition


^
n
 
0
 
·K · ^
n
 
0
 
= 0  ,
(18)
which gives the electrostatic limit of the dispersion relation :


er = - ak^4 + k^2 S + k||2 P     .
(19)
The consistency condition |E1| = |K ·E0| < n-2 |E0| is satisfied for n||2 > 1 + (wpe2 / wce2).

The extension of the local solutions to a spatially inhomogeneous plasma is accomplished by the eikonal method with the useful result that an initial wave field at r with an initial propagation vector k evolves according to Hamiltonian equations which preserve the local dispersion relation er = 0 along the ray trajectories


dr
dt
=
- er
k
/ er
w
(20)
dk
dt
=
+ er
r
/ er
w
(21)

As in Hamiltonian mechanics, the spatial coordinates denoted by r are canonically conjugate to the wave number coordinates denoted by k. For example, in a Cartesian frame one would have (x,y,z) and (kx,ky,kz) and fields varying as expi ò(kx dx +ky dy + kz dz); and in a cylindrical frame one would have (R,Z,f) and (kR,kZ,l) where R, Z have dimensions of length, kR, kZ have dimensions of inverse length (wave number), and l is the dimensionless toroidal mode number. In the study of the axisymmetric tokamak, it is the cylindrical coordinate system that is the most natural since the toroidal wave number l is constant along the ray path ( d l / dt µ er / f = 0).

In formulating er it is necessary to use the canonical forms by writing k|| = k ·B/B and k^2 = k2 - k||2 where B and B are magnitude and vector quantities of the local magnetic field.

A spectral component of power W experiences a change in power DW over time interval Dt:


DW
=
-2  ei / ( er
w
) W Dt
=
- er
P
Kzz,i /( er
w
)  W Dt
=
2p wpe2
w
  ó
õ
dv||v||  fe
v||
 d(w- k||v||)     er
P
/( er
w
)   W Dt     .
(22)

Note that equations (20), (21), and (22) also carry an index numbering the individual spectral component, which has been suppressed to improve readability. Given the velocity distribution and the profiles of macroscopic plasma parameters, the absorption of a lower hybrid spectrum can be computed. An actual incident wave spectrum is a continuous function of the parallel wave number. Computationally, this continuous spectrum is approximated by assigning the input power to a number of discrete rays as in equation (1), each ray having a definite initial k|| and launched power. The number of rays and their distribution over k|| can be chosen to adequately resolve the spectrum in cases of reasonably strong single-pass damping. On the other hand, if many passes are required to absorb the power, a very dense packing of rays into the spectrum might be required to obtain well behaved results.

The plasma is divided up into discrete shells between flux surfaces, typically 20 - 100. For each ray, equations (20) through (22) allow calculation of the needed quantities. The width of the shells and the detailed trajectory determine Dt in equation (22). As a practical matter, one cannot ensure that the shells are fine enough to keep |DW| / W < 1, so this quantity must be monitored and Dt adjusted downward the amount necessary to keep |DW| < W . The new Dt is recorded for use in equation (26) of section 2.3.1.

2.2.2  Changes to k||

In applications of the model to many devices the following features are significant:

  1. toroidal effects move the value of k|| up and down during propagation - a rise helping absorption, and a fall retarding absorption
  2. the rise in k|| is a stronger effect as density, poloidal field inside the plasma increase, and as aspect ratio (R/a) decreases

These effects are well established in the literature [14,18,19,20,21,32].

An important approximate relationship [18,19,21], exact under the electrostatic form of the cold plasma dispersion relation, between k||0, the the initial k|| of a ray when launched, and k||max, the maximum possible value at a particular point in the plasma is the following.


k||max £ k||0 ×  R0/R
1-(Bp/Bf)( wpe/w) S-1/2
    .
(23)

Here R0 is the initial major radius of the LHCD ray of frequency w, and R, Bp, Bf, wpe are the major radius, poloidal and toroidal magnetic field, and plasma frequency at some point of interest. The perpendicular dielectric constant is represented by S, a slowly varying quantity of order unity. It has been shown, without benefit of approximations [21], that this maximum tends to be reached in elongated plasmas after many reflections from the wall, whereas the maximum may not be reached in similar circular plasmas. It is worth noting that Kupfer, Moreau, and Litaudon [22] have used physics closely related to the basis of Eq. (23) to formulate a statistical theory of current drive with lower hybrid waves under conditions of multi-pass absorption.

2.3  Fokker-Planck Equation

2.3.1  Quasilinear Diffusion Coefficient

An incremental contribution to the quasilinear diffusion coefficient Dql at velocity v|| from a wave field of wave number k|| is given by


Dql(v||) = p
2
æ
ç
è
e
me
ö
÷
ø
2

 
 E||2 d(w- k|| v||),
(24)
where E|| represents the amplitude of the wave field parallel to the local static magnetic field, and the electron charge and mass are e and me [44]. One instructive way to find the relationship between field E|| and wave power W is to equate Pql, the energy per unit time per unit volume going into electrons and out of the wave from the quasilinear point of view,


Pql = - ne me ó
õ
dv||v||Dql (v||) fe
v||
(25)
with the similar quantity from the ray point of view as assembled from equations (12), (16), (22) to obtain


Dql(v||) = 2 æ
ç
è
p
e0
ö
÷
ø
æ
ç
è
e
me
ö
÷
ø
2

 
 W   er /P
wer/w
  æ
ç
è
Dt
DV
ö
÷
ø
 d(w- k|| v||)    
(26)
for the incremental Dql from a wave of power W traversing a flux shell of volume DV in time Dt.

2.3.2  Kinetic Equation

An electron kinetic equation can be written


fe
t
   =   æ
ç
è
fe
t
ö
÷
ø


c 
 +   æ
ç
è
fe
t
ö
÷
ø


w 
(27)
Here the ()c term is the Coulomb collision operator, and the ()w term is the wave diffusion (quasilinear) operator. There is no term involving a steady electric field. The wave diffusion operator is the one-dimensional divergence of the rf-induced flux:


æ
ç
è
fe
t
ö
÷
ø


w 
=
v||
Dql(v||) fe
v||
 ,
(28)
where now the term Dql signifies a sum over all waves in existence on a flux surface, with the appropriate powers and velocities. Note that the use of a simple sum means that we assume there are no interference effects.

We employ a one-dimensional collision operator of the form,


æ
ç
è
fe
t
ö
÷
ø


c 
=
v||
é
ê
ë
æ
ç
è
 Dc(v||)
v||
+ nc(v||)v||  ö
÷
ø
fe(v||) ù
ú
û
    .
(29)
The collisional diffusion and drag coefficients are given by


Dc(v||)
=
bZ  G/vTe  [1 + (v||/ vTe)2]-3/2     ,
(30)
nc(v||)
=
bZ  G/vTe3  [1 + (v||/ vTe)2]-3/2     ,
(31)
where G = lnL  ne e4 / (4pe02 me2 ) and the normalization coefficient bZ is chosen to yield the correct value for the electrical conductivity in the absence of rf. Approximately, bZ = (1 + Z) / 5, with Z the effective ion charge. The collision operator has several correct properties, such as conservation of particles, producing a Maxwellian (with thermal velocity vTe) in the absence of wave power, and correct asymptotic velocity dependence of the coefficients for high speeds v >> vTe.

In solving for fe we set /t = 0 because the time for equilibration between rf power and the electron distribution is short compared to the time for plasma to evolve. Then the solution for fe is an integral in velocity space.


fe(v||) = 1

Ö

2pvTe2
 exp æ
ç
è
- ó
õ
v||

0 
nc(v¢)  v¢ dv¢
Dc(v¢) + Dql(v¢)
ö
÷
ø
(32)

2.3.3  Some Numerical Details

Our calculation requires a discrete grid in v|| indexed by iv and many discrete rays indexed by ir which at each flux shell crossing indexed by iz have a definite w/ k|| and a power W at a definite location in the plasma indexed by ip. The delta function d(w- k||v||) connects the discrete velocity quantity with the discrete wave number quantity and therefore must be interpreted to have a width that causes smooth variations in velocity while the spectrum of waves, represented by a limited number of rays, is not smooth. The width of the delta function in velocity should be such that for two nearby rays separated by Dk|| the range in velocity Dv|| is approximately the relative separation of two nearby rays Dk||/k|| times the phase velocity w/ k||. However, some judgment should enter the actual selection of the width of the smoothing function because k|| and therefore Dk|| can evolve considerably. If the smoothing range is too narrow in velocity, then non-physical ``holes'' can appear in the Dql with a resulting ragged behavior of fe. On the other hand, if the smoothing range is too great, then a wave of phase speed w/k|| interacts with electrons of much different parallel velocity v||, especially much lower parallel speed, since there are many more low speed electrons than high speed electrons. This can lead to spurious power absorption.

The rays do not move monotonically in ``radius'' (which in our calculation is measured by poloidal flux y ) and in fact typically make many in-out changes of direction. To compute needed quantities at each flux surface, the motion of ray number ir must be recorded by a zone number iz, which is sequential with the intersection of that ray with any flux surface. For each zone index, the index ip of the y surface intersected is kept, where ip is 1 at the center of the plasma, increasing toward the edge. For each trajectory the iz starts at 1 and increases to a maximum value; but ip starts near its maximum, decreases initially, and exhibits individual behavior thereafter.

Changes in direction can be of several types. An inward-going ray can change to an outward-going ray, or vice-versa, because:

  1. the roots of the dispersion relation converge (mode conversion);
  2. speaking by analogy to a mechanical Hamiltonian system, the radial penetration limit is reached owing to the inpenetrability of a centrifugal barrier;

  3. the root of the dispersion relation approaches zero (cutoff);

  4. the ray is captured and specularly reflected near the plasma edge. This is accomplished by logic in the calculation which senses that a cutoff is approaching.

The quantities Dql;iv,ip fe;iv,ip, Wiz,ir are all made consistent by iteration, beginning with very small Wiz = 1, ir and ramping up toward the full power launched. We use an under-relaxation algorithm in the iteration of fe, in that the past fe is averaged with the newly computed fe to get the new function propagated to the next cycle.

2.4  RF-Driven Current

We calculate the current driven on each flux surface according to our equation (33) which follows the prescription given in equation (21b) of reference (12), except that we drop the term arising from a non-zero runaway probability , obtaining


Jrf = -e ne
nr
ó
õ
dv||Dql(v||) fe(v||)
v||
· Ws(u)
u
    .
(33)
In the above, nr = G/|vr|3, u = v||/vr, and vr = - sign(eEdc) Ö{meG/|eEdc|}, as explained in the reference [12]. These definitions give as Jrf the current density of stopped electrons, and use the function Ws(u)/u which is given as a tabulation of coefficients fitting simple algebraic terms to solution of the complete Fokker-Planck equation in two velocity dimensions (v^ and v||).

The key quantity is Ws(u), the energy (normalized to me vr2/2) imparted to the electric field Edc by an electron as it slows down. The local electric field Edc is either prescribed for a static simulation (usually set to zero) or supplied by TSC as part of an iteration to be described.

For very small electric field, Ws(u) can be represented in a power series. From the first two terms, one finds


Jrf = -e ne
G
ó
õ
dv||Dql(v||) fe(v||)
v||
  v||3  4
5 + Z
  é
ê
ë
m- 1 + Z/2 + 3m2/2
3+Z
  v||2
vr2
ù
ú
û
    ,
(34)
where m = -1 for cooperative current drive, and m = +1 for current drive into an opposing field.

The function Ws(u) behaves in such a way that for u approaching -1, corresponding to rf current drive cooperating with the ohmic current driven by the ambient electric field Edc at a velocity near the runaway velocity, the calculated current grows extremely large. Because of the runaway condition, this is to be expected. Whenever u » -1, the rf-driven current is not properly calculable from our approach.

It is often necessary to iterate between TSC and LSC for the field and current at the exact time that LSC is called for power and current information, as follows. Suppose at time (n-1) the local total current density is J(n-1), the rf-driven current density is Jrf(n-1), and the local electric field is Edc(n-1). We want to advance quantities to the new time, (n), and be consistent with Ohm's Law: J = sEdc + Jrf, where s is the parallel neoclassical conductivity. An initial guess at what the new electric field Edc(n-) must be is formed from the new total current, as advanced by TSC, and the old rf-driven current and old electric field.


J(n) = sEdc(n-)+Jrf(n-1)(Edc(n-1))     ,
(35)
From the Edc(n-) obtained from equation (35) one can find the estimated new rf current density Jrf(n-) from equation (33). Its derivative with respect to Edc,  ( Jrf/ Edc)(n-), is formed by numerical differentiation. Algebra yields estimates for the new electric field and for the new rf-driven current density,


Edc(n) = Edc(n-) + Jrf(n-1) - Jrf(n-)
s+ ( Jrf/ Edc)(n-)
    ,
(36)


Jrf(n) = Jrf(n-) + ( Jrf/ Edc )(n-)( Jrf(n-1) - Jrf(n-) )
s+ ( Jrf/ Edc)(n-)
    .
(37)

The new values Edc(n) and Jrf(n) may not be consistent. This is checked by assigning them to the previous step labeled (n-1) and repeating the process until the result is stable to a chosen accuracy. At that point, it is desired that the electric field is small enough that the runaway situation does not exist for electrons interacting with the waves. An inequality expressing this condition, as suggested by equation (20) of reference 12, is


tr-loss .
n
 

er 

ne
= tr-lossDql(vr) ê
ê
ê
fe(vr)
v||
ê
ê
ê
  <<  1
(38)
where tr-loss is a loss time for electrons pushed by rf waves into a runaway region and [n\dot]er is rate of increase of the density of runaway electrons owing to the rf diffusion from a lower velocity. A simple estimate for tr-loss would be the confinement time ( ~ 10 msec). If equation (38) is not satisfied, then the calculation is inappropriate.

Iteration is not necessary if when the ambient electric field is low and the density is high, such that w << |vr k|||. In that case the evolution of the electric field and the current is handled without special attention as the transport calculation evolves.

2.5  Broadening of rf-Driven Current

The rf-driven current is subject to diffusion across the confining magnetic field. Magnetic turbulence is often proposed as the dominant mechanism.

Diffusing a velocity distribution is beyond the scope of the LSC, but we have introduced a heuristic approach similar to that used by V. Fuchs and others [17].

The idea is that the actual, diffused, RF-driven current Jd is modified from the computed RF-driven current Jrf by slowing-down, characterized by an inverse-time nslow, and a cross-field diffusion, characterized by DJrf.

Assuming for the moment slab geometry with x the spatial variable the diffusion-like equation we use is:


Jd/ t = nslow ( Jrf- Jd)  +  /x  ( DJrf Jd/ x )
(39)

This can be transformed to a normalized flux coordinate [^x] º (y- ymin)/(ymax - ymin) with standard transformations for curvilinear coordinates. Under the reasonably good assumption that y ~ r2 the result is:


Jd/ t = nslow ( Jrf- Jd)  +  (4/a2)  / ^
x
 
 ( ^
x
 
 DJrf Jd/ ^
x
 
)    ,
(40)
where a represents the nominal minor radius of the plasma.

Equation 40 clearly has desirable properties: if DJrf is small then the Jd moves to Jrf on the nslow time scale; and if DJrf is large then Jd and Jrf can be quite different, in particular Jd will be smooth compared to Jrf over a length of order Ö{ DJrf /  nslow}.

In LSC DJrf on input is one number, constant across the plasma, in units of meter2 per second. Internally, DJrf is an array, so generalization would be simple. The nslow are found from equation 31 for a particular phase speed, corresponding to n|| = 2, also constant across the plasma. The diffusion process is imagined to be complete at each call to LSC, so that the time derivative is set to zero. Under that condition, the solution for Jd comes from one inversion of a tridiagonal matrix.

The boundary condition on Jd at the outer boundary is a zero value. At the inner boundary, the center, the condition of zero flux (zero derivative with respect to radius) translates to the derivative with respect to [^x] being better behaved than 1/Ö{[^x]}, which cannot be expressed in a manner practical for the finite difference equations. Instead, we force dJd/d[^x] to be constant over the first two grid spacings. This is equivalent to specifying a zero value for a certain linear combination of Jd and dJd/d[^x] at the first interior grid point.

The rf-driven current found Jrf leads directly to the smoothed (diffused) Jd after the inversion of a tri-diagonal matrix [41].

Note that the integral of Jd over the plasma cross section, or total diffused rf-driven current, is not constrained to have any particular relationship with the same integral over Jrf, the total undiffused current. In fact, it seems reasonable that diffusion can in some circumstances increase current by moving fast electrons to regions of lower collision rate. However, it appears that the diffused current is less than the undiffused current for many actual situations, typically having deposition at mid-radius and mildly peaked density profile.

The heuristic smoothing method of V. Fuchs [17] is similar to the method described here, but apparently treats DJrf and nslow as constants, sets the change in total current from an estimate incorporating the formula for nslow, and finds the value needed for DJrf as an eigenvalue.

Our model is not a simulation of energetic electron diffusion in that it does not transport fast particles or change the rf wave damping because of their motion.

2.6  Heuristic Power Diffusion Estimate

The undiffused current Jrf was computed from the ray tracing, quasi-linear development of an electron distribution function in the parallel velocity giving the local power deposition per unit volume P0, and finally the Karney-Fisch [12] electric field adjustment to current density.

As explained in the previous section, the diffused current density Jd can be quite different from Jrf, and therefore quite different in radial distribution from the P0 found from ray tracing. This situation is contrasts with the intuition that power density is proportional to current density times background number density. Therefore, we added an option to spread the deposited rf power according to


P( ^
x
 
) = as   
|Jd( ^
x
 
)|  ne( ^
x
 
)

ó
õ
|Jd( ^
x
 
)|  ne( ^
x
 
)  dV( ^
x
 
)
   ó
õ
P0 dV  + (1-as) P0( ^
x
 
)     ,
(41)
where P is the diffused power, P0 is the power deposited from the ray tracing and quasilinear calculation, as ranges from 0 (no spreading of P0) to 1 (full spreading), dV is a volume element.

2.7  X-ray Camera Image

The PBX-M experiment to which we have applied our calculation the most has a 2-dimensional x-ray camera with an axis roughly tangent to a mid-plane circle just inside the major radius of the the plasma. The images found by this camera reveal clues to the behavior of the fast electrons in the plasma. At the same time, such images can be computed from the electron velocity distribution we establish in our model.

Taking account of obstructions, the actual location of pinhole, focal plane, etc., we evaluate the 2-d image with the following formula.


Ix-p
=
1
dAp
ó
õ
dl dA(l) dWp(l)  ni(y(l))  ne(y(l)) ×
ó
õ
dv||v||fe(v||,y( l)) ×
ó
õ
E(v||)

0 
dE¢E¢ 2 sei
E¢W
[E(v||), E¢, ^
n
 
· ^
b
 
] T(E¢)
(42)

In the above, Ix-p is the x-ray intensity on pixel p of area dAp at the camera focal plane, dl is an element of path length in the plasma on a line passing through the pinhole and the pixel, dA is an area element for emission into the pixel p, dWp is the solid angle subtended by the pinhole as seen from the emitting volume element, ni(e) is the ion (electron) density at the emitting location, E¢ denotes photon energy emitted by an electron of energy E, 2 sei/E¢W is the cross section for electron-ion bremsstrahlung differential in energy and solid angle, [^(n)] is a unit vector connecting the emitting volume with the camera element, and [^(b)] is a unit vector along the magnetic field, and T(E¢) is the transmission factor through vessel windows and other absorbers. The differential cross section used in our calculation is that given by formula 2BN of Koch and Motz [42]. The significance of ``2'' is the differential in energy and angle; ``B'' is Born approximation; ``N'' is no screening of the ions. Note that the distribution function fe is that computed from the one-dimensional Fokker-Planck model, and is itself not influenced by the electric field Edc. The absorption from vessel and windows is computed from fits to experimental absorption data [43].



3  LSC Usage

The LSC code is written in standard Fortran and has run on all Unix/Linux machines available at PPPL, including the Cray machines at NERSC , and VAXes. There are no mathematical library calls; interpolators, integrators, root solvers, look-up searchers, and Bessel function approximations are part of the source code. Routines are taken directly from Numerical Recipes [41] are: LAGUERnr, ZROOTSnr, RAN3nr, HUNTnr, PIKSRTnr, and PIKSR2nr, and TRIDAInr. The trailing ``nr'' denotes the source, where as the preceding characters are the same as in the book [41].

There are graphics calls embedded in the code for PPPL's ``Scientific Graphics,'' or SGlib , or just SG, and for ``gnuplot.''

Information and source for SGlib is at:
w3.pppl.gov/rib/repositories/NTCC/catalog/Asset/sglib.html.

Information and source for gnuplot is at:
www.cs.dartmouth.edu/gnuplot_info.html.

The combination LSC/gnuplot should work on any Unix, VMS, MS-DOS, or Windows system with a Fortran 77 compiler. Gnuplot for he Macintosh has been reported, but not found on the Internet in September 2000.

The combination LSC/sglib should work on any Unix or VMS system with a Fortran 90 compiler and a C compiler.

The source for LSC is constructed with calls for both sglib and gnuplot imbedded, but there are exceptions, as follows. Contour plots and the 3-D-like isometric sketch of ray paths in the toroid require sglib to be loaded; and, none of the graphs used by the X ray camera have been converted to gnuplot. Converting contour plots to gnuplot does not appear to be possible in a satisfactory way with a modest amount of work, and will probably never be done. Fortunately, these plots never seemed to be particularly useful. Converting the 2-D plots of the X ray camera to gnuplot is probably easy enough, and can be done if there is a demand for these graphs under gnuplot.

By default all calls to sglib are compiled into the executable code as no-operations with the cpp command #ifndef USE_SGLIB. In a similar way the X ray camera is not compied via the cpp command #ifndef USE_X_RAY_CAMERA.

As mentioned in the introduction, this manual and links to the source code can be found at w3.pppl.gov, through one of ~ignat, NTCC or topdac . The source code should be accompanied by at least one ``Makefile'' which works in the development environment, Linux Fujitsu Fortran, for the stand-alone code. Linux GNU Fortran 77 (g77) was also used in the development, however, the g77 executable is somewhat slower.  LSC is constructed as a subroutine to be called as a module of a transport code such as TSC or TRANSP, but stand-alone use with a simple driver program is easily done. The distribution provides a driver, lscdrive.F , and a simplifed mock-equilibrium writer, WrCircEq.F . Stand-alone runs can be extremely useful in studying the behavior and assuring reasonable convergence with the parameters chosen.

Naturally, stand-alone computations cannot show the interaction of the current driven with the electric field generated, reacting to the current, in a complete calculation.

3.1  Input Files

Call to LSC, whether from a transport code or a stand-alone driver, needs to specify

  1. The plasma (geometry, fields, density, temperature); This specification is done through a large, strictly formatted, equilibrium file. The name given this file is arbitrary, but stand-alone runs have commonly used jardin.d and TSC runs have commonly used lhcdoua . For TRANSP the ``file'' is in memory; in other words there are no disk read/writes for the equilibrium. (Im vague on this; needs checking.)
  2. LH parameters such as the frequency, the spectrum, and current/power diffusion. This specification is done through short NAMELIST (list-directed) file input.lhh under the namelist name inpvalue
  3. Computational paramers such as the step size and the number of steps for each ray, strategy for smoothing in velocity space , number of iterations in constructing the distribution function. This specification is done through the same short NAMELIST file input.lhh under the namelist name inpexprt . (Putting the two namelists in different files might be a good idea in some cases, and doing so would be simple enough.)
  4. Flags to specify graphs and printouts. This specification is also under the namelist name inpexprt .
  5. LHCD power, i/o unit numbers, a flag on the strategy for re-tracing rays, and a flag which can turn off all plots . This specification comes in the argument list in the statement calling LSC.

Details follow in the following sub-sections.

3.1.1  Plasma

The data on the plasma (geometry, fields, density, temperature) is read by a subroutine rdTSC in the source file grapgrd.F .

A header line (informational comments) equhd is read first followed by integers npsitm, nspc, kcycle, a plasma-time in the calling program, times (which is ignored by LSC) plasma parameters anecc, tekev, anicc, tikev, amass, achrg, the electric field (loop voltage) voltlp, and specifications of the equilibrium, rho, vptemp, xsv, pary, ppary, gary, gpary, nx, nz, isym, iplim, psimin, psilim, xmag, zmag, rgzero, bgzero, apl.

The meaning of the variables, and units used, are documented in the source.

3.1.2  LH parameters

The specification is done through the NAMELIST (list-directed) file input.lhh under the namelist name inpvalue

The namelist variables are documented in source file Inpval.inc .

The number of rays to be launched is nrays, which decomposed into the product of ntors and npols, so each toroidal spectral component can have a number of poloidal components, each of which behave somewhat differntly. Defaults are in params.inc .

There are two methods of representing the spectrum, a simple model of Gaussian shapes, and a calculation stemming from Brambilla paper [1].

Three tables list the LH parameters according to the following plan.

Table 1 lists the most important input paramters, and also the ones needed to specify a Gaussian spectrum.

Table 2 lists the input parameters to choose a Brambilla calculation of the waveguide spectrum. Note that some of the parameters of Table 1 are ``recycled'' for the Brambilla case, and therefore have a somewhat different meaning: nGrps, powers.

Table 3 lists the input parameters for the heuristic model of current and power diffusion.

Table 1: LSC input parameters related to the launched lower hybrid rays
 
fghz The launched LH wave frequency (in GHz), typically 2.45 or 4.6 (GHz).
nGrps The number of groups (or couplers, which see) used in calculating the launch spectrum; the default is NGRPDIM (3).
centers() The location of the peaks in the Gaussian-model spectrum, in n||; the three defaults are all 4.0 .
widths() The widths of the model spectrum peaks, as Dn||; the three defaults are all 1.0 .
powers() The relative powers in either the Gaussian-model spectrum components (if DoBram is zero) or in the couplers (if DoBram is equal to unity); as an example, if powers(1) and powers(2) are both 1.0, LSC will assign equal powers to the first two components/couplers, whereas if powers(1) = 1.0 and powers(2) = 0.5, LSC would assign twice as much total power to the first component/coupler as the second. The default values are 1.0, 0.1 and 0.1 for elements 1, 2 and 3, respectively.
nrays The number of rays LSC will trace; its most natural value (also the default) is the product of ntors with npols, but if nrays is given as something different, then a sensible action is taken.
ntors The number of distinct toroidal components in the number of rays (nrays); the default setting for ntors is NTORDIM (30).
npols The number of poloidal variations to each toroidal variation; in part, this is a way to increase the number of rays launched from the same Bramilla spectrum, but also effective for the model spectrum. The default 1.
nparmax, nparmin The floating point numbers giving the maximum and minimum values of n|| over which to distribute the ntors number of toroidal values when using the Maxwellian-model spectrum (hence, these inputs are ignored when DoBram is set to 1). The defaults are 5.5 for nparmax and 2.5 for nparmin.
npolmax, npolmin The floating point numbers giving the maximum and minimum values of nq over which to distribute the npols number of poloidal values when using either the Brambilla or Gaussian spectrum; their default values are 1.0 for npolmax and -1.0 for npolmin.



Table 2: LSC input parameters related to lower hybrid rays computed via the Brambilla method
 
DoBram INTEGER: If DoBram is equal to 1 (the default), then LSC will perform the Brambilla calculation, using nGrps as the number of couplers, and the array powers() as the relative distribution of power between the couplers. If DoBram is 0, LSC uses Gaussian models for the launched spectrum.
couplers() The dimensions of certain couplers are built into LSC in DATA statements; hence, all the user must specify is the eight-character name(s). Presently, LSC will recognize PBXMFAST, PBXMSLOW, TOKDEVAR, SLOWSLOW, TORSUPRA, TFTRLHCD, JET_LHCD, USRSPEC1, USRSPEC2, USRSPEC3 .
phaseDeg() The relative phases (in degrees) applied to the couplers; used in computing the Brambilla spectrum; the default values are 90.0, 180.0 and 135.0, respectively.
nslices The number of slices on the Brambrilla spectrum. The default is 301.



Regarding Table 2, the `USRSPECn' waveguides are set equal to TFTRLHCD in the code as distributed. The intent is for the data statements to be replaced as needed. The format of the specification of the waveguide coupler is the following: az(i) is the toroidal distance to the near edge of ith guide in cm; bz(i) is the toroidal distance to the far edge of ith guide in cm; so that az(2)-bz(1) is the the width of the septum between the first two guides.

Table 3: LSC input parameters related diffusing the deposited power and current
 
DiffuJrf The heuristic diffusivity for rf-driven current in meter squared per second. It balances a collision rate, as shown in equation 40. The default is 0.
PrfSpred This governs the heuristic spreading of rf power as given by a in equation 41. Dimensionless, between 0.0 and 1.0. The default is 0.



3.1.3  Computational parameters

Computational paramers such as the step size and the number of steps for each ray, strategy for smoothing in velocity space , number of iterations in constructing the distribution function. This specification is done through the same short NAMELIST file input.lhh under the namelist name inpexprt. (Putting the two namelists in different files might be a good idea in some cases, and doing so would be simple enough.)

Table 4 gives the computational parameters, and lists the defaults for each one.

Table 4: LSC computational input parameters
 
HstpLH The length of the ray integration step in meters. The default is 0.005 (meters).
nstep The maximum number of integration steps (each having length HstpLH) through which LSC will track a ray; the default is 20,000 steps.
npsi The number of y bins used in LSC (during the Dql calculation); npsi can be either more or less than the npsii from the TSC grid. The default is NPSIDIM (100).
nzones The number of zone (psi surface) crossings through which LSC will trace a ray. The default is NZONDIM (2000).
nv The number of parallel velocity bins; the default is NVELDIM (401).
nsmoo The number of velocity bins over which smoothing is to be done. The default is NSMODEF (9).
nsmw The characteristic width (in number of velocity bins) of the smoothing. The default is NSMWDEF (3).
nRampUp The number of steps taken in ramping up the power for the iteration of fe, Dql and Prf; some of these steps may be with a constant power (controlled by nFlat, above). The default is NRAMPDIM (200).
nFlat The number of ramp-up iterations with a flat (constant) power. The default is NFLATDEF (10).
WeghtItr The proportionality of the weighting of the old and new electron distribution functions during each ramp-up iteration. The default is 0.20 - 20 percent new fe and 80 percent old fe.
Do1Rpr This INTEGER flag modifies the way LSC recalculates rays when it is being called from TSC or TRANSP. If Do1Rpr is equal to 1, then LSC recomputes only 1 ray per call from TSC/TRANSP after the initial computation of all rays; this smooths the dynamic behavior. If equal to 0, then LSC recomputes all rays when called by the driving program.
ScatKdeg The angle in degrees by which the perpendicular component of the wave vector, k^, may be rotated on rms average when the ray ``bounces'' (i.e. as in off of the wall). If ScatKdeg is 0.00 (the default), then there is no scattering - the ray is simply reflected specularly.
TurnNegs If this INTEGER flag is set to one, then any ``negatively-directed'' Brambrilla spectrum elements will be turned around; literally, the corresponding n|| components will be multiplied by a negative one, which will reverse the direction of the spectrum element. The default is zero.



3.1.4  Flags for graphs and print files

Table 5: LSC flags for plotting and printing: flag number and internal name
 
Plot Flag PlFlg(number): Descripton
RAYPL 1: Ray position in r, z, f and in k^,k||; enhancement
SPECPL 2: Launched ray power spectrum vs n|| and v
RFDPL 3: Pray, Jray at 12 y, 6 per page; total Pray Jray vs n|| and v||
RFDPSPL 4: Pray Pql Jrf and integrals vs root y
DAMPL 5: quasi-linear absorption vs root y, 6 rays per page
JRFPL 6: ne Te Edc Itsc dJ/dE (E/J)
PITPRFPL 7: Bz/Bf, pitch, n|| enhance, ne Prf vs Rmajor
DQLFEPL 8: Dql fe vs v|| at several y
Write Flag PrFlg(number): Description
RAYWR 1: much ray information in labeled columns
FSTFRCWR 2: fractions of fast particles
NPAPWRWR 3: n||'s and powers in rays vs index



Table 6: LSC input parameters controling output
 
nfreq After each ray has been traced for an nfreq number of steps, LSC takes stock of what has occurred. This INTEGER has a default value of 100 (steps).
PlFlg() This INTEGER array is made up of the flags that inform LSC as to which (if any) of the possible plots should be produced as output; if a particular plot is desired, then the corresponding PlFlg element should be set to one (1). The default settings are all zeroes (no plots). For a full description of the possible output plots, see the section below on LSC Outputs.
PrFlg() This INTEGER array is similar to PlFlg, above, but holds the flags governing LSC ``screen'' output. LSC has three output channels which have their destinations by the driving program, and conceivably any or all of these channels could be linked with the screen. Alternatively, these channels could be linked to additional output files. For a more complete description of the channels and the possible outputs, see the section below on LSC Outputs. The default setting of this array is all zeroes.
idiag() This INTEGER array specifies at which ramp-up iterations the results of fe and Dql calculations will be ouputted; that is, the first element of idiag tells LSC at which iteration to produce the first set of plots, the second element tells at which iteration to produce the second set, etc. idiag starts out with all IDIAGDIM elements set to zero; the user should (at the very least) set the first element of idiag to nRampUp - otherwise, LSC does not know ``when'' to produce certain outputs, and will not (regardless of the values set in PlFlg).



Typical input namelists, to be found in input.lhh, are found in Table 7.

Table 7: Typical LSC namelist inputs
 
 &inpvalue 
 fghz = 4.6, 
 nGrps = 1,
 powers(1) = 1.00, powers(2) = 1.00,
 phaseDeg(1) = 130., phaseDeg(2) = 130., nslices=301,
 ntors=15, npols=1,
 DoBram = 1, 
 couplers(1)='TFTRLHCD',
 couplers(2)='TFTRLHCD',
 DiffuJrf = 0.00, 
 /
 &inpexprt
 HstpLH = .01,  nstep = 20000,  nfreq = 50,  npsi = 100,
 nzones = 2000,
 nv = 401, nsmoo = 9, nsmw = 3,  weghtitr = .2,
 plflg( 1) = 0, 1, 0, 
 plflg( 4) = 1, 0, 0, 0, 
 prflg( 1) = 0, 0, 0,
 incLabls = 1,
 /


3.1.5  Calling arguments

Table 8 lists the arguments that must be supplied by the calling program, and is largely self-explanatory. The power is the most significant parameter. For use of LSC with a transport code and determination of both current and electric field in a self-consistent way iRayTrsi is crucial, and almost always equal to 0 because of the number of iterations needed.

Table 8: LSC subroutine arguments, to be supplied by calling program
 
LhPwrMW Lower Hybrid power in MW passed from calling program, TSC/TRANSP/etc
nTSCwrit Unit number to which caller writes equilibrium data
nTSCread Unit number from which caller reads Prf, Jrf , etc
nTSCscrn Unit number caller uses for writing to the screen
nTSCgraf Unit number to which LSC commands and data for gnuplot; the name used is date-time.gnp
nLSCcomm Unit number to which LSC sends screen output
nTSCunus Unit number not used by caller; used internally by LSC
iRayTrsi 0 = use old ray data, old fe(v), and use new Edc for the current; 1 = calculate new rays and fe(v) from new equilibrium; 2 = use old ray data, but calculate new fe(v) taking account of new ne and Te and use new Edc for the current
iPlotsig 0 = do not make plots; 1 = make plot files asked in input.lhh
iError 0 = LSC finishes without errors; 1 = one or more error(s) found; -1 = LSC found an error; calling program can keep going






3.2  Output files

Table 9: LSC output files
 
Wr2TSC.out Electron power, electron current, E/J   dJ/dE, ion power
LSCcomm.out  
LSCcom2.out  
ray.dat  






3.3  Output graphs

images/InputsExample.png

Figure 1: ``Graphed'' input parameters to LSC for keeping track of the nature of the calculation by putting important information in the graphics output file.


images/SpectrumExample.png

Figure 2: A launched spectrum from a Brambilla calculation, including the negative-going minor components. Upper-right: Bar graph showing relative powers versus v/c . Lower-left: Same, but represented versus n-parallel. Lower-right: The launched spectrum as smoothed in velocity by the same smoothing function used in constructing the quasi-linear distribution function.


images/RayExample.png

Figure 3: A typical result of the calculation for one ray. Left side: Evolution of n-parallel (top) and n-perpendicular (bottom) versus square root of normalized poloidal flux. The dotted line on the top frame indicates the region of strong damping, ie, if the magnitude of n-parallel is larger than the magnitude shown dotted, then the linear damping is strong. Quasi-linear damping may not be strong, owing to quasi-linear burn-through. Right side: Ray trajectory projected onto a poloidal cross section of the plasma. The ``roundness'' comes from an idealized test case; in general the cross section is elongated with the correct Shafranov shift of flux surfaces.


images/PqlJrfExample.png

Figure 4: Power and current deposited without diffusing the current or the power. More rays would produce a smoother result. Horizontal axis is the square root of normalized poloidal flux. Left two: Volumetric and integrated power from the ray point of view for 1 MW launched power. Center two: As on left, but from the quasi-linear power deposition point of view. Right two: Volumetric and integrated current. The negative current stems from negative-going components of a realistic launched spectrum. The power and current found represented volumetrically and integrated from the center outwards.


images/DiffusJ-PExample.png

Figure 5: Power and current deposited with diffusing the current and then the power. The current diffusion coefficient was set to 0.05 meter-squared per second, and the weighting of the diffusion effect on the power was 90 percent. Note that the center frames show un-diffused power.


images/Fe12psiExample.png

images/Dql12psiExample.png

Figure 6: A typical electron distribution and quasilinear diffusion coefficient





4  Appendix: Brief Description of Source Files

The following is a list of the FORTRAN source files for LSC:

Table 10: Names and functions of fortran files for LSC
 
Name of Module Brief Description of Role in the Computation
AcDc.F Main; changelog; block data; some i/o
Rayini.F Ray initialization
Rayio.F Ray i/o
Raystore.F Ray information stored
Raytrace.F Ray tracing
Wr2TSC.F Write power and current for calling program; other output
WrCircEq.F Write out a `practice' circular equilibrium
XrayCam2.F Predict results for an X ray camera
brambJES.F Compute a launced spectrum from the Brambilla approach
cycle.F Ramp up power to get electron distribution
ezsg.F Scientific Graphics (SG) shell subroutines
fe.F Initialize fe; do smoothing and derivative
fits.F Fits to current response from the Karney-Fisch approach
gnup.F Gnuplot shell subroutines
grap.F Grid interpolations
grapgrd.F Find quantities by interpolation
gridgen.F Generate grids
grids.F Generate grids, also<