Computer Physics
Computer Physics Communications 76 (1993) 3 18—327 North-Holland
Communications
A post-processor for the PEST code S. Preische, J. Manickam and J.L. Johnson Princeton Plasma Physics Laboratory, Princeton University, Princeton, NJ 08543-0451, USA Received 13 January 1992; in revised form 22 June 1992
A new post-processor has been developed for use with output from the PEST tokamak stability code. It allows us to use quantities calculated by PEST and take better advantage of the physical picture of the plasma instability which they can provide. This will improve comparison with experimentally measured quantities as well as facilitate understanding of theoretical studies.
1. Introduction The PEST code [1] is used to determine the linear ideal MHD stability of axisymmetric tokamak configurations. It is a variational code which determines the set ofdisplacement vectors ~ which minimizes the Lagrangian, oW w2K, where OW and K are the potential and kinetic energies associated with perturbations from a given equilibrium. The PEST code is used for a variety of purposes including tokamak machine design, the determination of /1 limits and their dependence on current and pressure profiles, and study of the physics of instabilities, for example, by analysis of the mode structure. We are concentrating here on the latter use. The mode structure of the perturbed quantities gives us some clues into the physical origin of the instability. The PEST code has not fully exploited this capability. In fact, even the usual plots of the Fourier components of ~, are misleading since they do not include the proper normalizations. To remedy this deficiency, and enhance the capabilities of the code, we have constructed a post-processor. The new code is able to: —
Correspondence to: J.L. Johnson, Princeton Plasma Physics Laboratory, Princeton University, Princeton, NJ 085430451, USA. 0O10-4655/93/$06.00 © 1993
—
a) construct properly normalized components of the eigenfunction ~ in order to see the true relative amplitudes of the various modes, b)look at the eigenfunction in an orthogonal hasis, as opposed to PEST’s non-orthogonal basis, as an orthogonal basis may be easier to work with for some analyses, c)compute and display quantities which can be measured experimentally, e.g., components of the perturbed magnetic field Q, in order to compare a known mode structure from PEST with experimental measurements, and d)test the degree of compressibility for a specific eigenvalue by evaluating V .
2. Formulation 2.1. PEST representation of ~ For a given tokamak plasma equilibrium, with B
=
[f(~i’) Vq5xVw + R g(~i’)Vç~],
(1)
j
=
(V~xVO.V~y’,
(2)
where J is the Jacobian, R is the major radius of the plasma, and ~ji is a normalized poloidal flux, the PEST code determines where the displacement vector ~ for perturbations about the equilibrium is
Elsevier Science Publishers By. All rights reserved
~,
~
~,
S. Preische ci a!. / A post-processor for the PEST code
from the major axis to the point (w,8)}~have 0 dependencies so that graphs of these Fourier coefficients, ~mfl’ without the appropriate normalization do not descibe the physical eigen-
/
/
r
/.....
/
I
‘~
functions. 2.2. Normalized components of ~ To get a better physical picture of the Fourier modes of the displacement vector, we define a set of unit vectors _VOxB
/
5_
~
~=
_B
BlVd/I
(5)
~=
+ c~ses+ c~Beb 3 [R2g2~vei2
=
2irgR
1/2
+f2(VYJ.V0)2]
B x Vyi
-
+ ~
e
write
VOxB +
~
_BxV~
IVOxBI’
=
Fig. I. Usual toroidal coordinates r,O,4 compared with PEST coordinates ~ Solid lines show contours of constant g’ and 8; dotted lines show usual r, U coordinates for one point on the grid. Both systems use the same toroidal coordinate ~.
=
319
B.
(3)
Fig. 1 compares the usual toroidal coordinate system with the PEST coordinate system, where 0 surfaces are chosen to enclose equal amounts of toroidal flux. Each component, a, of ~ has been decomposed such that
~,, ~ ~
x~~ 1R2 a2 + (2 Viii 21 1/2 ~P e 2irgR3 1~1 L ~ ‘ ~ J S 5
+ .
+ ~ [R~g~ +
f2IVWI2]
1/2
t~e~,
(6)
and Fourier decompose ~ in 0. This set of Fourier coefficients is properly normalized and comparision of the relative amplitudes is meaningful. 2.3. Orthogonal projection of ~
Since the PEST basis vectors are not orthogonal, i.e., V~•V0~ 0, it is useful to look at ~ in an orthogonal system. To do this we define a
=
~‘~mn(Y’)
e1(me_~.
(4)
new set of orthogonal unit vectors: _Vyi
Since axisymmetry is assumed, the Fourier coefficients for different values of n decouple and each toroidal mode number can be exammed separately. However, the magnitudes of the PEST coordinates V~, VO, V~,and the Jacobian, J = vX2/2irR [with X the distance
er
ee
=
_BxVyí = BIVwI’
Then we can write
~=
~
+ ~ee
+ ~b
_B eb =
S. Prcischc ci al. / A post-processor for the PEST code
320
____ {R2g2 + f2IVWI2] (.~ V~’.V0)~\ Ivy/I2 )~e
=RIVWIer + vXIVdl’I 2irgR3 ><
-
-
S
+ ~
+ f2IVyIl2]’~eb.
___
+ [x~RIvw2~~P ;(~RlVYJl~ 2 ~ + ~(VyI
1/2
(8)
+
j~2~2
This form is useful for looking at radial displacements, as er is always perpendicular to a flux surface and in a toroidal cross section, whereas e~has components in all three coordinate directions, because
—
ilvy/12
(vd’.ve~J
f~ a L~ i
I
+
ae
(~j~Ivwl2)
~
+
VBxB
=
RgJ~V0I2
~
(~V~.V0)} 2
RgJ(Vçu.V0) VO -
+
+ ~IV~II
_________
f(VdL’.VO) Vq~.
(9)
X2 ~
-
a (f~~\
~j-~ ~,—~--)
a
(JB2~\ g ) 2~’ JBg
JR21DyJ(~
Note, however, that e 9 does not lie completely in a toroidal cross section.
+ ~a
2.4. Perturbed magnetic field
~
( )}
(Vv/.V0)~j Vç~.
(10)
+
Another interesting quantity is the perturbed magnetic field, Q = V x (~x B), which can be measured with Mirnov loops,
~
___
Q.V~
[x~R~
=
f~\ + X2R(Vd~tVO)Odv
+
~IV9I~
+
f2 8~ X2gRä~
+
X2gR2 (V82~
The most useful components of mental measurements are
=
(—i--)
lVwI
Q for experi-
Q.(Vç5xV~)
IV~lIVwI
Qo
‘
Q.Vç5
(11)
IV~I where the component Qo now liesarein a toriodal cross section. These components 1
=
I2mf O~
x2i~~
J2B2
IVwI Qe=_-~-[ ad’ ~
+
+
a~)
g-~-~,
(12)
S. Preische ci a!. / A post-processor for the PEST code
-
XRIVyII
(V w.Ve)9~ 00
2
2gR3 [f2IVy/I2 + R2g2] — 4ir
~ [(VW.V0)~.~. — iV~I2~]
=
,
(13)
f~ I a ~ Vy/12) XgR2 ~taw ‘t~X a + ~
(~j~Vw.Ve)}
f’~4\ + ~IVWI2~
(i)
______
+ XgR2 (V~.V0 00
x
I
a I JB2~1”~I ~-,I’J
g
a
)
~
(JB2~\ g
____ L
of + 2ngR3
(r, 0, ~)
(14)
i
a
=
Q~,rnn(a, 0,0) (—)
m+1
xcos(mO+n~),
(16)
where a is the plasma minor radius.
The post-processor can also be used to determine how well the incompressibility assumption, V ~= 0, is satisfied. This is done by calculating
a(X2~) a~
The new Fourier decomposition of the different projections of the displacement vector give a better physical picture for analysis of the instability’s mode structure. Q can be calculated at any point inside the plasma and compared with experimentally measured values. The components of Q may also be Fourier decomposed to look at the mode structure. As an example of more direct comparision with experiments, the signal OE/at from a poloidal array of Mirnov coils can be Fourier decomposed in 0 to find the amplitudes of the various poloidal modes. By knowing the calculated Q at the plasma edge, values of Q outside the plasma may be determined with Green function techniques and compared with measurements of the perturbed field. For approximate comparison ofcalculated and measured values the cylindrical circular cross-section limit may be used, in which case the mth component of the field decays as r(m~):
2.5. Evaluation ofcompressibility
1
321
a(X2~) ao
The importance of the compressible term in OW can be measured by comparing the ypIV ~J2 term with the other terms in OW, .
ow=~
f
dV1~
plasma
1V~.V8~- iIVyJI 20i~s -~-]
B2 + —IV~±+2~.KI2 —2 (~.Vp)(i~I.ic)— J
i2irRf 2 0~ ~ + iRg O~ + oX
11 (~I x
(15)
+ypIV.~I2].
(17)
3. Applications
3.1. Pressure modifIed kink
We now demonstrate some applications of computing these quantities from the PEST output.
We first consider a large aspect ratio (R/a = 10) circular cross-section discharge, which is chosen to illustrate pressure modification of
mode
5. Preischc ct a!. / A post-processor for the PEST code
322
0.1 2.4
2.0 1.6
Z
—~
0
~
//
;:~:::::~ 1 .2 /
0.8
/1
04
0
_____________________________________________________________________
0.1
0 0.9
1.0
x
0.5
1 0
1.1
Fig. 2. Displacement vector for the pressure modified n = 1 kink mode. The length denotes the magnitude of the displacement at a point located at the start of the arrow.
an external kink mode. The parameters defining this case are: /1 = 0.69%, fl~= qaxis = 1.05, qedge = 2.95, Troyon factor CT flaB/I = 3.69. This configuration is unstable with respect to the global instability shown in fig. 2 with an eigenvalue pa2 w2/itoB2 = 0.247. The Fourier decomposition of the displacement that is presently available from the PEST code, of Eq. (3), is shown in fig. 3. The decomposition of the properly normalized component, ~, of Eq. (6), is shown in fig. 4. The decomposition in the orthogonal projection, ~ of Eq. (8), is very similar in both magnitude and form to fig. 4. The change in normalization between ~ and ~, modifies the relative magnitudes and introduces sign changes in the modes as well as an m = 0 component. This indicates that the lower-m modes contribute much more to the instability than one would have believed from looking at the original decomposition. The behavior of the displacement ~ of Eq. (8) is given in fig. 5. It has some of the properties of c~,and ~r, but is far from identical. We do not show the component c~, which represents the flow along the field line that is necessary to mm-
Fig. 3. Fourier decomposition of the unnormalized perturbation, ~, for the pressure modified kink mode.
-~—m=1
m-2 -
m=3
012
~‘
0.06
m=5
0
m=O 0
0.5
1.0
Fig. 4. Fourier decomposition of the normalized perturbation, ~,, for the pressure modified kink mode.
imize V since it is small. The quantity V on several flux surfaces is illustrated in fig. 6. The components of the perturbed field, Q~,,and Q~, that are associated with this displacement are shown in figs. 7 and 8. The Fourier decompositions of Q~, and Qo are shown in figs. 9 and . ~,
.
S. Preische ci a!. / A post-processor for the PEST code
:.:
\~m=~~’~
0.1
~e008~
323
“
zo
~1.0
Fig. 5. Fourier decomposition of ~ the normalized orthogonal perturbation in the B x V~vdirection, for the pressure modified kink mode
::~
~
.\
.
X
Fig. 7. Contour plot of Q
5, for the pressure modified kink mode. The solid lines denote fields in the positive Qv’ direction; the dotted lines are for fields in the opposite
direction.
0.1 ~4!0.1
~
Fig. 6. The function V . ~ for the pressure modified kink mode as a function of 8 on a magnetic surface.
10. Comparison of these with ~, in fig. 4 shows somewhat different structures. 3.2. External kink mode Ourcircular secondcross-section illustration plasma. is also aItlarge aspect ratio is unstable
___
o.g
1.0
11
x Fig. 8. Contour plot of Q~for the pressure modified kink mode.
with respect to an m = 3 current driven kink mode. The discharge has fi = 0, qaxis = 1.05 and qedge = 2w2/~zoB2 2.95. The= fastest instabil0.004,growing is localized near ity, plasma with pasurface as can be seen in fig. 11. The the
S. Preischc ci a!. / A post-processor for the PEST code
324
0.1
/
.~
.
.
.~
004 3~ 0.02
..
~
041
4~ .., .~
/
/ 0
0
Z
-
5~ .
.~
6~
7.~ —
—
——
.
—\
ml 01
002 0
0.5
0.9
1.0
Fig. 9. Fourier decomposition of the perturbed field, ~ perpendicular to a flux surface for the pressure modified kink mode.
Fig. 11. Displacement vector for the n mode.
4/~
_______________
/
0.08 m=1 0.04
1.0
1.1
=
1 external kink
I \\~
I
W=1
2
‘\~\
~/
~
~:
O~ ~
~=0 5
-2
~oQ~ 3 -012 016
-4 .
_______________
-it
it
0.20 1 0 Fig. 10. Fourier decomposition of‘I! the component of the perturbed field, Q~, for the pressure modified kink mode.
Fig. 12. The perturbed external field kink Q~eas mode. a function of 8 for the in figs. 13 and 14 show coupling to neighboring
perturbed field on a flux surface, fig. 12, shows a nearly pure m = 3 mode that is localized near the edge. Nevertheless, plots of a Fourier decomposition of the perturbed magnetic field
3.3. Ballooning mode
harmonics.
Our third case is a low aspect ratio (R/a = 3.33), elliptic cross-section discharge chosen to
S. Preische ci a!. / A post-processor for the PEST code
0
_-~~
-0004
0.4
~
~m~2
325
..
4
~
. ,,‘
\.\ ~
_~
~
0012
-0.016
,
,
NN~~.~../“
~
Fig. 13. Fourier decomposition of the perturbed field Q~, for the external kink mode. __________________________________________
-0.4
0.6
..s’.~~’~~1)i’
1.4
x Fig. 15. Displacement vector for the n mode.
3 ballooning
=
4
2
~
1 2
with K = 1.5 and 0 = 0.26. We have fi = 6.33%, f3~= 2.62, qaxis = 1.15, qedge = 4.54, and CT = 6.92. The dominant instability, fig. 15, has a large growth rate, pa2w2/~uoB2= 1.10, and has a strong ballooning character. The Fourier decompositions of the displacement vectors normal to the magnetic field, ~r and are given in figs. 16 and 17, and V ~ is given in fig. 18. These, together with pictures of the perturbed magnetic field, such as figs. 19 and 20, show that this ballooning mode contains much more structure than might have been ~,
.
4 O
0.5
1.0
Fig. 14. Fourier decomposition of the perturbed magnetic field Q~for the external kink mode.
illustrate a high-n ballooning mode instability. The plasma boundary is defined by
anl.iClpaLe An application of this processor is to compare the contributions from the various terms in OW, Eq. (17). For example, the comparison of the 2 2 IQ±I/~term with ypIV on a surface in fig. 21 shows that the sloshing of sound waves to equilize the pressure on the magnetic surfaces can be roughly 5% of the stabilization effect associated with shear Alfvén waves. .
X
=
R + a cos (0 + 0 sin 0),
(18)
Z
=
a sin (0 + 0 sin 0),
(19)
S. Preische et at. / A post-processor for the PEST code
326
C
20
~
41 1
1.4_9 .4-8
1
10 4101
S
I
~(
10
Fig. 16. Fourier decomposition of the normalized orthogonal radial perturbation, ~r, for the ballooning mode.
0.4
m=5—#
-
I
.
Fig. 18. The function V . ~ for the ballooning mode as a function of e on a magnetic surface.
6
0 5
-
- --
1~
.:
02
.~‘
~
0
~ ~
z
15
-02
0
05
Fig. 17. Fourier decomposition of the normalized orthogonal perturbation ~ for the ballooning mode.
C5~
10
-
15
X
Fig. 19. Contour plot of Q
0, for the ballooning mode.
4. Summary We can now calculate many quantities of physical interest using given tokamak equilibrium values and the eigenfunctions ~ found by the PEST code. Application of this program has al-
ready proven to be useful in analysis ofdata from PBX-M plasmas [2] As an extension of this work, values of the perturbed field, Q, can be predicted for a given instability at any point outside the plasma by us-
S. Prcischc ci a!. / A post-processorfor the PEST code
327
15
16
IQ.LI2~LO ~ 10
8
/~5
0
~
~
~
~ ~
2
.
~
5.
-8
Fig. 20.
Qo as a function of 8 for the ballooning mode.
Fig. 21. The QJ surface with
ing the extrapolation of Eq. (16). This will provide direct comparison with experimental measurements. At present we calculate and plot only some of the terms in OW. Calculating all of these terms will provide an opportunity to investigate the sources of energy drive and stabilization for a particular unstable mode, shedding light on mechanisms for optimizing the stability properties of a configuration. Acknowledgements This work was supported by the U.S. Department of Energy contract No. DE-ACO2-76CHO-3073 with Princeton University. Much of the work was performed while one of us (SP) was under appointment to the Magnetic Fusion Science Fellowship program, U.S. Department of Energy.
2/~t 0
w
=
and ypIV . ~2 terms in c5w on a 0.1 for the ballooning mode.
References [ii R. C. Grimm, J. M. Greene and J. L. Johnson, in: Methods in Computational Physics, Vol. 16, ed. J. Killeen (Academic Press, New York, 1976) p. 253. [2] D.W. Roberts, Ph. D. Thesis (Princeton University, 1991).