GTC-NEO

1. Code Name: GTC-NEO
2. Code Category: Transport (neoclassical)
3. Primary Developer: W.X. Wang
4. Other Developers and Users: G. Rewoldt, R. Kolesnikov, B. Grierson
5. Short description: Given a tokamak numerically-calculated MHD equilibrium (from ESC or JSOLVER), and (TRANSP) density and temperature and toroidal rotation profiles, GTC-NEO calculates the neoclassical fluxes, electric field, poloidal flows and bootrap current etc, including nonlocal physics due to finite-orbit-width effects, by a particle-in-cell delta-f method.
6. Computer Language (Fortran77, Fortran90, C, C++, etc) and approx # of lines: Fortran 90 and some C. 10,000 lines.
7. Type of input required (including files and/or output from other codes). Is there any special input preparation system (eg, GUI): Profile data file in TRANSP time_slices format, MHD equilibrium file in ESC format, GTC-NEO parameter text input file. No.
8. Type of output produced (including files that are read by other codes and sizes of large files and synthetic diagnostics): Many text output files
9. Describe any postprocessors which read the output files: Yes, a number that that do time-averaging, and extract and convert the output quantities of interest.
10. Status and location of code input/output documentation: See documentation below on this web page.
11. Code web site? Here.
12. Is code under version control? What system? Is automated regression testing performed? No.
13. One to two paragraph description of equations solved and functionality including what discretizations are used in space and time: Linearized drift kinetic equations for ions and electrons, and ambipolar potential equation (derived from Poisson and continuity equations). The delta-f equation solved in GTS-NEO is exactly the same equation as the original full-f drift kinetic equation except for the neglect of the nonlinear collision term which is usually small in the core. GTC-NEO is a global PIC code. It uses an initial value approach to follow an initially-loaded tokamak plasma to the neoclassical equilibrium state, in fixed time steps. The radial electric field is calculated using direct time integration. The poloidal electric field is obtained using an algebraic equation based on the charge neutrality condition.
14. What modes of operation of code are there (eg: linear, nonlinear, reduced models, etc ): Initial run for ion quantities. Follow-up run for electron quantities.
15. Journal references describing code: W.X. Wang, et al., Computer Phys. Commun. 164, 178 (2004). W.X. Wang, et al., Phys. Plasmas 13, 082501 (2006). R.A. Kolesnikov, et al., Phys. Plasmas 17, 022506 (2010).
16. Codes it is similar to and differences: NEO (GA). GTC-NEO is a particle-in-cell code, while NEO is a continuum code.
17. Results of code verification and convergence studies (with references): For comparison with analytic theory (Chang-Hinton) for verification and comparison with experiment (NSTX) for validation, cf. W.X. Wang, et al, Phys. Plasmas 13, 082501 (2006).
18. Present and recent applications and validation exercises (with references as available): cf. below and also 17. above.
19. Limitations of code parameter regime (dimensionless parameters accessible): Uses up-down-symmetric, axisymmetric MHD equilibrium at present. Realistic plasma boundary conditions at the separatrix have not been implemented yet. Good performance in general in core region. Realistic edge boundary conditions, such as direct particle loss to SOL, may have strong influence on neoclassical transport at r/a>0.9, which are not taken into account yet.
20. What third party software is used? (eg. Meshing software, PETSc, ...): Libraries used are: NETCDF, SPRNG/2.0, NAG (or CMLIB), and NTCC PSPLINE.
21. Description of scalability: Excellent scalability as offered by particle simulation in general. Scaling studies indicate the minimum total computational cost for a fixed total number of particles (strong scaling) occurs for a moderate number of processors, typically 48 to 64.
22. Major serial and parallel bottlenecks: GTC-NEO uses MPI library for message-passing, and message-passing throughput and latency limits speed of code.
23. Are there smaller codes contained in the larger code? Describe. No.
24. Supported platforms and portability: Has been ported several times. Should work on most Linux (or Unix) systems where libraries are available.
25. Illustrations of time-to-solution on different platforms and for different complexity of physics, if applicable: Code must be run out far enough in pseudo-time such that a steady state is reached, which is typically a few ion-ion collision times in banana regime. Running time is proportional to number of ion species included in calculation.
26. Any additional comments: Linearized Fokker-Planck operators for both like-particle and unlike-particle collisions; Lorentz collision operator is also available for e-i collisions. The linearized collision operators have excellent conservation properties, which are most essential for simulating neoclassical dynamics with a self-consistent electric field, and have been shown to be adequate. The GTC-NEO code solves the drift kinetic equation globally from r/a = 0 to 1. It does not employ an ordering expansion assuming a small parameter such as orbit size for the drift kinetic equation. The delta-f equation solved in GTC-NEO is exactly the same equation as the original full-f DK equation except for the neglect of the nonlinear collision term, which is usually small in the core. A GTC-NEO simulation follows full particle guiding-center orbits according to the Lagrangian equations in magnetic coordinates. The GTC-NEO code also calculates the neoclassical radial electric field self-consistently, which may introduce nonlocal physics through the orbit squeezing effect.

GTC-NEO Versions & Input:

There are several versions of the GTC-NEO particle-in-cell neoclassical code. Originally, there was version due to W.X. Wang that calculated ion quantities for a single ion species (thermal deuterium). This was extended to handle two ion species (thermal deuterium and carbon) by R.A. Kolesnikov. This two-species version was extended again by G. Rewoldt to handle four ion species (thermal deuterium (D), thermal carbon (C), thermal helium-4 (He), and hot beam deuterium (bD, using a Maxwellian distribution with an effective temperature)). In addition, there is a separate electron version, that is run after the ion version, that calculates electron quantities. The input parameters for GTC-NEO are contained in the file INPUT.d. In addition, GTC-NEO requires a profile data file in (extended) time_slices format (see below) whose name is specified in the INPUT.d file, and an MHD equilibrium file in ESC format (see below) whose name is also specified in the INPUT.d file. The following table describes the input parameters in the INPUT.d file for the current (four-ion-species) version of GTC-NEO. Parameters that should never change are not included here.
Name
Meaning
Values & Comments
eq_data_name
MHD equilibrium file name
file from ESC or JSOLVER (in ESC format); see below
nstep
number of time steps
typically 20,000
dt
time step
typically around 0.2d-2 for NSTX cases, 1.0d-2 for DIII-D cases
ni
number of particles
per processor (NOT total); typically 320,000 each for 48 processors
jce
number of radial zones
for calculation (different from number of zones for output) normally 50
umax
velocity maximum
-umax < v_\| / v_{thermal} < umax, 0 < v_\perp / v_{thermal} < \sqrt{2} * umax; normally 3.0d0
charge_imp_input
impurity charge
RELATIVE to thermal deuterium (6.0d0 for carbon)
mass_imp_input
impurity mass
RELATIVE to thermal deuterium (6.0d0 for carbon)
charge_He_input
helium-4 charge
RELATIVE to thermal deuterium (2.0d0)
mass_He_input
helium-4 mass
RELATIVE to thermal deuterium (2.0d0)
charge_bD_input
beam deuterium charge
RELATIVE to thermal deuterium (1.0d0)
mass_bD_input
beam deuterium mass
RELATIVE to thermal deuterium (1.0d0)
noionsp
number of ion species
used in run, in the order D C He bD (there is are alternate Fortran source files with the order D C bD He; this matters only for nionsp=3); 1 <= noionsp <= 4
(then there are many parameters that should never change) ...


profile_data_name
profiles data file name
file in time_slices format (extended - see below)
cell_w_coll
maximum particle weight
due to collisions
cell_w_flux
maximum particle weight
for contribution to fluxes
(then more parameters that should never change) ...


omegarev
toroidal rotation reversal switch
for ALL species (0 = don't reverse input, 1 = reverse input)
tminfrac
minimum temperature
as fraction of temperature on axis for that species
nminfrac
minimum density
as fraction of density on axis for that species
fixedEr
electric field switch
=0 means to calculate E_r self-consistently, =1 means to input experimental E_r (in DIII-D format) and hold fixed (see below)
collmult
collision frequency multiplier
artificial collision frequency multiplier for all ion species; set to 1.0 to use experimental value from TRANSP time_slices parameters

How to prepare input for and run GTC-NEO

To get started, you need a shot number (say, 129336), and the year for that shot (for this shot, 2008), for a particular tokamak (for this shot, NSTX), and a time in the shot (say, 0.392 s, with time-averaging over +/- 0.001 s), along with a TRANSP run number for that shot (say, A01). These choices will normally be specified by an experimentalist. We will employ a particular file-naming convention here using these items. The examples below use this case, and for your own case, you would substitute your shot number and TRANSP run number and time in the filenames. Then, the steps are:

1. Run time_slices:
time_slices
t
y
nstx.08
q
129336A01
0.392
0.001
tr_129336A01-392
0

This will produce a time_slices file (i.e., an ASCII text file) named tr_129336A01-392. You should spend some time looking through this file to understand its format.

2. Edit the executable script file "runeqjP", which is used to set up input from the tr_129336A01-392 time_slices file to the JSOLVER MHD equilibrium code and to run JSOLVER, by changing the text string in line 14 of runeqjP to "129336A01-392", and then saving runeqjP. Then run runeqjP to calculate the MHD equilibrium (forced here to be up-down symmetric, which is necessary for GTC-NEO).

3. Look at the time_slices file. Find the value of "vacuum BZ * major_radius" in line 3 (here, 46.4309). Divide it by the last entry in the "Midplane major radius" array (here, 86.448), to give a value for B0 (in Teslas), (here, B0 = 46.4309 / 86.448 = 0.53710). Insert the file name string '129336A01-392' in line 8 of the executable script "rungtc", and insert the value of B0 in line 10. Make the same insertions in the executable script file "rungtc02". Then, execute the rungtc script and afterwards change the output file name from "gtcout" to "gtcout129336A01-392". Next, execute the rungtc02 script and afterwards change the output file name from "gtcout" to "gtcp1out129336A01-392". The gtcout129336A01-392 file contains the MHD equilibrium information in ESC format using an equal-arc-length coordinate system, for input to GTC-Neo. The gtcp1out129336A01-392 file contains the MHD equilibrium information in ESC format using a PEST-1 coordinate system, for input to the GTS gyrokinetic turbulence code.

4. The time_slices file needs to be extended with some output for this case from the NCLASS neoclassical code. The data is obtained by running the jython+ script "gtcnclass.py". For this case, the command is:
jython+ gtcnclass.py --squeezing 129336A01 NSTX 08 0.392
(If this run does not converge, try removing the "--squeezing" parameter.) The run produces files named "129336A01.vtorD", "129336A01.vtorC", and "129336A01.vtorHe4", among others. The data in these files needs to be inserted in the time_slices file. First, copy the line in the sample time_slices file containing "VTORD" into the new time_slices file tr_129336A01-392 (just before the line containing "file writen on"), and insert the 129336A01.vtorD file after it (NOT including its first line!). Second, copy the line in the sample time_slices file containing "VTORC" into tr_129336A01-392, and insert the 129336A01.vtorC file after it (NOT including its first line!). Third, copy the line in the sample time_slices file containing "VTORHE" into tr_129336A01-392, and insert the 129336A01.vtorHe4 file after it (NOT including its first line!). Finally, copy the line in the sample time_slices file containing "EREXP" into tr_129336A01-392, as well as the following 101 lines of dummy (zero) E_r data (unless you want to use real experimental data for E_r here, in this DIII-D E_r data format). Rename the time_slices file from "tr_129336A01-392" to "tr_129336A01-392ext", since it has now been extended with the additional NCLASS data.

5. Then copy the tr_129336A01-392ext and gtcout129336A01-392 files into a run directory for GTC-Neo. Also, copy the INPUT.d run parameter file and an appropriate MPI batch run script there, and adjust the INPUT.d parameters as specified above. Finally, copy in the executable file, "NC_run_om" (for the ion species order D C He bD) . GTC-Neo is normally run on 48 processors. Submit the run.

6. After the run finishes, it is necessary to run post-processors to do appropriate time-averaging, and convert the output to normal (SI) units. You would run "get_Er_nstx20000" to obtain the E_r profile in the file "Er_profile_sim.dat". You would run "get_flux_3Er_VtorD", "get_flux_3Er_VtorC", "get_flux_3Er_VtorHe", or "get_flux_3Er_VtorbD", to obtain the E_r components (via force balance) for the corresponding ion species in the files "Er_componentsD.dat", "Er_componentsC.dat", "Er_componentsHe.dat", or "Er_componentsbD.dat", respectively. You would run "flux_history", "flux_history_imp", "flux_history_He", or "flux_history_bD", to obtain the particle flux, energy flux, heat flux, and parallel velocities for species D, C, He, and bD, in the files "Flux_profile_sim.dat", "Flux_profile_imp.dat", "Flux_profile_He.dat", or "Flux_profile_bD.dat", respectively. Usually, these utilities assume 20,000-time-step runs, and time-average over time steps 15,000 to 20,000 (these choices can be changed in the corresponding Fortan source files). The Flux_profile... utilities only output two radial zones (out of ten) at a time (and produce corresponding NCAR graphics files of the flux time histories in the GTC-Neo run), but the choice of the two zones can be changed in the Fortran source files also.

Bibliography for GTC-NEO code applications

1. Comparison of poloidal velocity measurements to neoclassical theory on the National Spherical Torus Experiment
R.E. Bell, R. Andre, S.M. Kaye, R.A. Kolesnikov, B.P. LeBlanc, G. Rewoldt, W.X. Wang and S.A. Sabbagh
Phys. Plasmas 18, 082507 (2010) 12 pp.
2. Characteristic of turbulence driven multi-channel transport in tokamaks, and comparison with experiments
W.X. Wang, T.S. Hahm, S. Ethier, S.M. Kaye, W.W. Lee, G. Rewoldt, W.M. Tang, and P.H. Diamond
presented at Fusion Energy 2010, Daejon, Korea Rep. of, Paper THC/P4-30, Proceedings of the 23nd IAEA Conference, Daejon (2010)
3. Drift-kinetic simulation of neoclassical transport with impurities in tokamaks
R.A. Kolesnikov, W.X. Wang, F.L. Hinton, G. Rewoldt, and W.M. Tang
Phys. Plasmas 17, 022506 (2010), 9 pp.
4. Drift-kinetic studies of neoclassical poloidal rotation with finite orbits
R.A. Kolesnikov, W.X. Wang, F.L. Hinton, G. Rewoldt, and W.M. Tang
Plasma Phys. Controlled Fusion 52, 042002 (2010), 9 pp.
5. Overview of Results from the National Spherical Torus Experiment (NSTX)
D.A. Gates, J. Ahn, J. Allain, R. Andre, R. Bastasz, M. Bell, R. Bell, E. Belova,J. Berkery, R. Betti, J. Bialek, T. Biewer, T. Bigelow, M. Bitter, J. Boedo, P. Bonoli,A. Boozer, D. Brennan, J. Breslau, D. Brower, C. Bush, J. Canik, G. Caravelli,M. Carter, J. Caughman, C. Chang, W. Choe, N. Crocker, D. Darrow, L. Delgado-Aparicio, S. Diem, D. DĀ¢Ippolito, C. Domier, W. Dorland, P. Efthimion, A. Ejiri,N. Ershov, T. Evans, E. Feibush, M. Fenstermacher, J. Ferron, M. Finkenthal,J. Foley, R. Frazin, E. Fredrickson, G. Fu, H. Funaba, S. Gerhardt, A. Glasser,N. Gorelenkov, L. Grisham, T. Hahm, R. Harvey, A. Hassanein,W. Heidbrink, K. Hill,J. Hillesheim, D. Hillis, Y. Hirooka, J. Hosea, B. Hu, D. Humphreys, T. Idehara,K. Indireshkumar, A. Ishida, F. Jaeger, T. Jarboe, S. Jardin, M. Jaworski, H. Ji,H. Jung, R. Kaita, J. Kallman, O. Katsuro-Hopkins, K. Kawahata, E. Kawamori,S. Kaye, C. Kessel, J. Kim, H. Kimura, E. Kolemen, S. Krasheninnikov, P. Krstic,S. Ku, S. Kubota, H. Kugel, R. La Haye, L. Lao, B. LeBlanc, W. Lee, K. Lee,J. Leuer, F. Levinton, Y. Liang, D. Liu, N. Luhmann, Jr., R. Maingi, R. Majeski,J. Manickam, D. Mansfield, R. Maqueda, E. Mazzucato, D. McCune, B. McGeehan,G. McKee, S. Medley, J. Menard, M. Menon, H. Meyer, D. Mikkelsen,G. Miloshevsky, O. Mitarai, D. Mueller, S. Mueller, T. Munsat, J. Myra,Y. Nagayama, B. Nelson, X. Nguyen, N. Nishino,M. Nishiura, R. Nygren,M. Ono,T. Osborne, D. Pacella, H. Park, J. Park, S. Paul,W. Peebles, B. Penaflor,M. Peng,C. Phillips, A. Pigarov,M. Podesta, J. Preinhaelter, A. Ram, R. Raman, D. Rasmussen,A. Redd, H. Reimerdes, G. Rewoldt, P. Ross, C. Rowley, E. Ruskov, D. Russell,D. Ruzic, P. Ryan S. Sabbagh, M. Schaffer, E. Schuster, S. Scott, K. Shaing, P. Sharpe, V. Shevchenko, K. Shinohara, V. Sizyuk, C. Skinner, A. Smirnov, D. Smith,S. Smith, P. Snyder, W. Solomon, A. Sontag, V. Soukhanovskii, T. Stoltzfus-Dueck,D. Stotler, T. Strait, B. Stratton, D. Stutman, R. Takahashi, Y. Takase, N. Tamura, X. Tang, G. Taylor, C. Taylor, C. Ticos, K. Tritz, D. Tsarouhas, A. Turrnbull, G. Tynan, M. Ulrickson, M. Umansky, J. Urban, E. Utergberg, M. Walker, W.Wampler, J.Wang, W.Wang, A.Welander, J.Whaley, R.White, J.Wilgen, R.Wilson, K. Wong, J. Wright, Z. Xia, X. Xu, D. Youchison, G. Yu, H. Yuh, L. Zakharov, D. Zemlyanov, S. Zweben
presented at Fusion Energy 2008, Geneva, Switzerland, Paper OV/3-1, Proceedings of the 22nd IAEA Conference, Geneva (2008)
Princeton Plasma Physics Laboratory Report PPPL--4393 (December 2008) 46 pp.
Nucl. Fusion 49, 104016 (2009), 14 pp.
6. Scaling of electron and ion transport in the high-power spherical torus NSTX
S.M. Kaye, R.E. Bell, D. Gates, B.P. LeBlanc, F.M. Levinton, J.E. Menard, D. Mueller, G. Rewoldt, S.A. Sabbagh, W. Wang, and H. Yuh
Phys. Rev. Lett. 98, 175002 (2007), 4 pp.
7. Momentum-transport studies in high ExB shear plasmas in the National Spherical Torus Experiment
W.M. Solomon, S.M. Kaye, R.E. Bell, B.P. LeBlanc, J.E. Menard, G. Rewoldt, W. Wang, F.M. Levinton, H. Yuh, and S.A. Sabbagh
Phys. Rev. Lett. 101, 065004 (2008), 4 pp.
8. Gyrokinetic Studies of Turbulence-Driven and Neoclassical Nondiffusive Toroidal-Momentum Transport and the Effect of Residual Fluctuations in Strong ExB Shear
W.X. Wang, T.S. Hahm, S. Ethier, G. Rewoldt, W.W. Lee, W.M. Tang, S.M. Kaye, and P.H. Diamond
Phys. Rev. Lett. 102, 035005 (2009), 4 pp.
9. Momentum transport in electron-dominated NSTX spherical torus plasmas
S.M. Kaye, W. Solomon, R.E. Bell, B.P. LeBlanc, F. Levinton, J. Menard, G. Rewoldt, S. Sabbagh, W. Wang, and H. Yuh
presented at Fusion Energy 2008, Geneva, Switzerland, Paper EX/3-2, Proceedings of the 22nd IAEA Conference, Geneva (2008)
Princeton Plasma Physics Laboratory Report PPPL--4387 (December 2008) 10 pp.
Nucl. Fusion 49, 045010 (2009), 7 pp.
10. Interaction between Turbulence and Neoclassical Dynamics and Its Effect on Tokamak Transport: Gyrokinetic Simulations and Theory
W.X. Wang, T.S. Hahm, S. Ethier, G. Rewoldt, W.W. Lee, W.M. Tang, S.M. Kaye, and P.H. Diamond
presented at Fusion Energy 2008, Geneva, Switzerland, Paper TH/P8-44, Proceedings of the 22nd IAEA Conference, Geneva (2008)
11. Scaling of electron and ion transport in the high-power spherical torus NSTX
S.M. Kaye, R.E. Bell, D. Gates, B.P. LeBlanc, F.M. Levinton, J.E. Menard, D. Mueller, G. Rewoldt, S.A. Sabbagh, W. Wang, and H. Yuh
Phys. Rev. Lett. 98, 175002 (2007), 4 pp.
12. Confinement and local transport in the National Spherical Torus Experiment (NSTX)
S.M. Kaye, F.M. Levinton, D.Stutman, K. Tritz, H. Yuh, M.G. Bell, R.E. Bell, C.W. Domier, D. Gates, W. Horton, J. Kim, B.P. LeBlanc, N.C. Luhmann Jr, R. Maingi, E. Mazzucato, J.E. Menard, D. Mikkelsen, D. Mueller, H. Park, G. Rewoldt, S.A. Sabbagh, D.R. Smith, and W. Wang
Nucl. Fusion 47, 499--509 (July 2007)
13. Gyrokinetic studies of Nonlocal Properties of Turbulence-driven and Neoclassical Transport
W.X. Wang, T.S. Hahm, G. Rewoldt, J. Manickam and W.M. Tang
presented at Fusion Energy 2006, Chengdu, China, Paper TH/2-6Ra, Proceedings of the 21st IAEA Conference, Chengdu (2006)
14. Transport with reversed shear in the National Spherical Torus Experiment
F.M. Levinton, H. Yuh, M.G. Bell, R.E. Bell, L. Delgado-Aparicio, M. Finkenthal, E.D. Fredrickson, D.A. Gates, S.M. Kaye, B.P. LeBlanc, R. Maingi, J.E. Menard, D. Mikkelsen, D. Mueller, R. Raman, G. Rewoldt, S.A. Sabbagh, D. Stutman, K. Tritz, and W. Wang
Phys. Plasmas 14, 056119 (May 2007), 9 pp.
15. Studies of improved electron confinement in low density L-mode National Spherical Torus Experiment discharges
D. Stutman, M. Finkenthal, K. Tritz, M.H. Redi, S.M. Kaye, M.G. Bell, B.P. LeBlanc, K.W. Hill, S.S. Medley, J.E. Menard, G. Rewoldt, W.X. Wang, E.J. Synakowski, F. Levinton, S. Kubota, C. Bourdelle, W. Dorland, and the NSTX Team
Phys. Plasmas 13, 092511 (September 2006) 11 pp.
16. Nonlocal Neoclassical Transport in Tokamak and Spherical Torus Experiments
W.X. Wang, G. Rewoldt, W.M. Tang, F.L. Hinton, J. Manickam, L.E. Zakharov, R.B. White, and S. Kaye
Princeton Plasma Physics Laboratory Report PPPL--4156 (March 2006) 38 pp.
Phys. Plasmas 13, 082501 (August 2006) 15 pp.
17. Global delta-f simulation of neoclassical transport and ambipolar electric field in general geometry
W.X. Wang, W.M. Tang, F.L. Hinton, L.E. Zakharov, R.B. White, and J. Manickam
Computer Phys. Commun. 164, 178 (2004)