eikplot - Plotting and interpreting results from eiktest and/or gridgen *********************************************************************** eik5.out can be used to generate plots of various quantities vs. the poloidal angle theta. To plot curvature drift vs. theta, do: % gnuplot gnuplot> set data s l gnuplot> plot 'eik5.out' u 1:7 To compare two eik runs, rename one of them (e.g. to 'eik5_32.out') and do: gnuplot> p=7 gnuplot> plot 'eik5.out' u 1:p , 'eik5_32.out' u 1:p (One can then use the up-arrow key to recall previous commands and easily edit p=7 to look at other variables instead.) To make a plot of similar quantities from rungridgen, you have to hand edit the grid.out file to put it into a format that gnuplot can read. For example, with an editor, pull out the section of the grid.out file that starts with the line cvdrift gds2 bmag tgrid and ends just before the line gds21 gds22 tgrid Change the first line to "# cvdrift gds2 bmag tgrid" (so it looks like a comment to gnuplot), and put the results into a file grid_gnu.out. Then you can do gnuplot> plot 'grid_gnu.out' u 4:1, 'eik5.out' u 1:7 to compare the gridgen output and the eik results it was based on. A trick to plot the theta grid spacing generated by gridgen: % gnuplot gnuplot> set data s i gnuplot> plot 'grid.bmag.out' u 1:2 ******************************************* The complete set of data in eik5.out is summarized in the first line: #theta1 gradpar2 bmag3 grho4 gbdrift5 gbdrift06 cvdrift7 cvdrift08 gds29 gds2110 gds2211 Name (and column number) Description theta1 poloidal angle theta gradpar2 Jacobian for grad_par = gradpar2 * d/d(theta) bmag3 |B|, magnitude of B grho4 |grad rho|, B_poloidal=d(psi)/d(rho) * |grad rho| / R gbdrift5 part of Grad(B) drift independent of theta_0 gbdrift06 part of Grad(B) drift proportional to theta_0 (and thus to k_x0) cvdrift7 part of curvature drift independent of theta_0 cvdrift08 part of curvature drift proportional to theta_0 gds29 part of k_perp^2 independent of theta_0 gds2110 part of k_perp^2 proportional to theta_0 gds2211 part of k_perp^2 proportional to theta_0^2 i.e., gds211 involves grad(alpha).grad(psi), and gds22 involves grad(psi).grad(psi). ******************************************* To compare a numerical and s-alpha equilibrium (which should agree in the circular limit and r/R -->0 limit), in gnuplot do: > alpha=0 > s=1 > Rmaj=3 > plot 'eik5.out' u 1:5, 2./Rmaj*(cos(x) + (s*x-alpha*sin(x))*sin(x)) ******************************************* Most of the eiktest results will be in eik*.out files. Results that eiktest print on the screen are: d beta/d rho = 0.E+0 , -0. s_hat 12.749387635024357 , 1. The first numbers in each row is from numerical equilibrium (not meaningful for local equilibrium), the second numbers are final equilibrium used (sometimes one does Bishop/Greene-Chance modifications of the s_hat and alpha of a given equilibrium. ******************************************* eik2.out contains some quantities of interest rho = r/a is defined in Dorland's geometry paper to always be the half-width of the flux surface at the height of the magnetic axis. rp is the flux label internal to the code (in the units chosen by the irho variable in the input namelist). (Does it have to be consistent with the flux label used in the equilibrium being read, i.e., sqrt(Poloidal flux) in some equilibria??) drhodrp = d(rho)/d(rp) dpsidrp = d(psi_norm)/d(rp) where psi_norm is the normalized poloidal flux defined in Dorland's paper by psi = a^2 B_a psi_norm dV/drhon = d(Volume)/d(rho) / a^3 (normalized dV/drho) At the end are various diagnostic quantities (q_0, q_95, akappa, etc.) interpolated out of the numerical equilibrium (or from the local Miller equlibrium). ?? tri seems to be a factor of ~2 too low for some reason? But this is only a diagnostic and doesn't effect anything? ******************************************* eik.out contains the same complete set of ballooning coordinate information as tht above files, but is in a format that is read by subsequent codes (such as the gyrofluid and gryokinetic codes, a ballooning code, etc.). The theta grid index runs from -ntgrid to +ntgrid, where 2*ntgrid = (nperiod+1)*ntheta. For example, for ntheta=32, nperiod=2, theta runs from -3*pi to 0 to +3pi, with the theta grid index going from -48 to +48.