Chapter 7
Examples

This chapter is dedicated to the code performances. Since numerous combinations are possible, it is not the purpose to give an exhaustive list of results, but to select different problems that have been addressed by existing codes in simplified magnetic configuration, a condition that allows interesting benchmarks. Moreover, in some cases, analytical expressions are available, and consequently accurate comparisons may be performed.

It is well known that all codes contain numerous hidden bugs, that are difficult to track, even if a careful attention as been paid to avoid as much as possible such problems. The only way to reduce them is to run extensively the code for different purposes. It is the reason why both the documentation and the code have been made as transparent as possible, so that its robustness may be continuously improved. When some difficulties have been encountered, they are reported in the different sections dedicated to benchmarking. However, none of them have made the code so far unable to determine the correct solution, providing input parameters corresponds to assumptions used to derive the equations and their numerical counterpart. It is well known that such kind of codes are often missused, using input parameters well beyond the acceptable range. In some cases, warnings are indicated by the code, but it is the duty of users to take care of this problem before considering that the code gives a wrong answer.

The kernel of the kinetic calculations is contained by the MatLab routine “dke_1_4yp.m”, whish contains both the 3 -D zero-order Fokker-Planck solver, and the first-order neoclassical corrections. Only this routine and all related subroutines must be used in a chain of codes like in CRONOS simulation package ([?]). In order to help how to make this link, and to benchmark the code, a test routine “testdke_1yp.m” has been written. Main global input parameters can be modified in the subroutine “psim_dke_1yp.m” that is called by “testdke_1yp.m”, while parameter that are specific to a machine (Tore Supra, JET, ITER, C-MOD,…) are gathered in the subroutine “ptok_dke_1yp.m”. The machine may be virtual, for benchmarking purposes. The input parameters for the RF wave physics problem have be put in separate files, sinces they are quite independent of the global input parameters. The corresponding file names for simplified RF wave physics are called “psim_idealhcd_jd.m” or “psim_coldlhcd_jd.m” for the Lower Hybrid wave, or “psim_ideaeccd_jd.m” or “psim_coldeccd_jd.m” for the Electron Cyclotron wave. Other types of waves are also available as well as input parameter files for more realistic ray-tracing calculations.

Once input parameters have been set, one runs the code by executing the MatLab script “script_dke_1yp.m”. This structure allows to run several cases in a single run, for systematic studies of the influence of one given parameter on the final result. For example, the role played by the Ohmic electric field may be investigated for a single value “epsi0= 0.01 and epsia= 0.01”, or multiple ones “epsi0= [0.01:0.01:0.05] and epsia= [0.01:0.01:0.05]”. In that case, all the results are saved in different .mat binary MatLab files, in the directory that contains “dke_1_4yp.m”, under the generic name “RESULTS_X_SY.mat” where X is the machine name, and Y the index number of the simulation. The magnetic equilibrium calculated by HELENA is stored in an separate file named “EQUIL_X.mat”, so that it may be used independently by another program for calculating various moments of the electron distribution function like the non-thermal bremsstrahlung emission.

All the results may be displayed using the MatLab routine “display_dke_1yp.m”, with or without graphical outputs. A special interface has been also written for an easy transfer of selected binary data to IGOR scientific display program for final reports.

The full list of routines is given in Appendix G. Except for arbitrary equilibrium cases that require the use of the FORTRAN F77 mexfiles “helmex77.f” and “separatrix.f” which both must be compiled1, all files are standard MatLab scripts. No external functions are used, and once MatLab path is correctly set-up to load text files in the “Project_DKE” directory, the code can be run immediatly on any computer without additional needs.

All benchmark results discussed in the text are gathered in the file “Benchmark.txt”, with the corresponding input parameters.

 7.1 Ohmic conductivity
 7.2 Runaway losses
 7.3 Lower Hybrid Current drive
 7.4 Electron Cyclotron Current drive
  7.4.1 Introduction
  7.4.2 Grid size effects
  7.4.3 Electron trapping effects
  7.4.4 Momentum-space dynamics
  7.4.5 Coupling to propagation models
  7.4.6 Conclusion
 7.5 Fast electron radial transport
 7.6 Fast electron magnetic ripple losses
 7.7 Maxwellian bootstrap current