![]() |
ORB5
v4.9.4
|
How to use the Phase Space Zonal Structure (PSZS) diagnostic.
In the diag section of the input file, the PSZS diagnostic can be enabled and configured. Some recommended settings might be:
pszs_freq controls how frequently (every N timesteps) the PSZS diagnostic should be performed. Due to the nature of the PSZS in constants of motion, the diagnostic is expected not to be needed more frequently than the timescales set by (phase-space) transport.nsel_pszs controls if the diagnostic is disabled (off), run online (online), or run offline (offline). In the case that it's run "offline" (recommended), only spline coefficients will be stored during the simulation, with post-processing required after the simulation (see below for more details).pszs_ntam sets the number of points in the TAM (toroidal angular momentum) dimension.pszs_nke sets the number of points in the KE (kinetic energy) dimension.pszs_nmu sets the number of points in the mu (magnetic moment) dimension.pszs_freq is not to high, the cost is not too large. In such a case, OpenMP threads can be used to speed up the deposition on the CPU. (This feature is not yet merged into the master branch).When running the code with the PSZS diagnostic, there is some initial diagnostic information output in the standard output (orb5.out), initially when setting up the simulation, but also every time the PSZS data is computed. Running the diagnostic creates an additional output hdf5 file, matrix.h5.
This file contains the raw output from the code for the PSZS, and (in the case of the offline PSZS) everything needed for the post-processing calculation. The quantities stored in the output file depend on the value of nsel_pszs_type (default f0): we always have f = f0 + w, and we additionally have either f0 or w (default: f0).
Shown below is an example of the outputs for nsel_pszs = "offline", nsel_pszs_type = "f0", pszs_ntam = 16, pszs_nmu = 8, pszs_nke = 8:
bs/f0/3d and bs/f/3d (slashes added for emphasis), which are arrays of length 1800=(17+1)*(9+1)*(9+1) per timepoint, are the /BS/plines coefficients of the RHSs corresponding to the 3d expressions of f0 and f respectively.Shown below is an example of the outputs for nsel_pszs = "online", nsel_pszs_type = "f0", pszs_ntam = 16, pszs_nmu = 8, pszs_nke = 8:
Here we see that the deuterium/f3d and deuterium/f03d diagnostic objects contain /data, /time, /coord{1,2,3} which can be read and plotted just like standard ORB5 diagnostics.
In the case of the "offline" version, we still have to perform another step. For this, we build an additional binary file, make pszs_offline, which builds bin/pszs_offline by symmetry with bin/orb5.
This additional binary can then be run after the simulation, and will then produce the same type of output as-produced by the "online" version of the code.
The pszs_offline file requires an input file named input_pszs3d, which requires the following:
Running this file (only 1 MPI rank, but can use OpenMP threads) creates a file matrix_out.h5 which contains the "full" PSZS data
Now we would be able to plot the 3D data from the PSZS (now stored in matrix_out.h5) in the same was as we can do for the online version.
pszs_offline and it would only append the steps which were not already calculated. If zero steps are to be calculated, it will not spend time assembling and factorizing the matrix. The pszs_offline code should not be run while an ORB5 simulation is running. input_pszs3d file, but are disabled by default.