XGC-S Input Parameters¶
At the moment XGC-S has a separate input from the main tokamak XGC code, although some input variables are the same. Here we list the most important differences. It is recommended to start from a stellarator example in XGC-Examples when preparing an input file for relevant input variables.
- XGC-S has an additional namelist
&sml_param_stellarator
that contains the following input variables: sml_special_s
- Simulation mode: 1 = general, 2 = flux-ave (default), 4 = trace.sml_dir_file_s
- (8 characters) directory name for equilibrium data (../equilibrium/****/ folder).sml_infile_s
- (8 characters) equilibrium files prefix.sml_outfile_s
- (6 characters) output files prefix.sml_prf_file_s
- (14 characters) profiles filename (../profile/**********/ file).sml_step1_s
- Initial time step of simulation.sml_step2_s
- Final time step of simulation.sml_delta_s
- Time step length in seconds.sml_icon_vol_s
- Node volume data (*.vol
files insml_dir_file_s
): 0 = generate volume data, 1 = read volume data (default). For option 1 the*.vol
files for the node volumes of all planes must already exist in the equilibrium data folder.sml_icon_dlf_s
- 0 = full-f, 1 = delta-f (default). Must use 1, full-f is not implemented.sml_icon_bnd_s
- Particle boundary condition at last closed flux-surface (not completed), must use 0 at present.sml_icon_poi_s
- Finite element Poisson solver: 0 = one dimensional field equation (default), 1 = Poisson solver (turbulence component), 2 = Poisson solver (average component), 3 = Poisson solver (turbulence + average component).sml_icon_iso_s
- Switch for mixed isotope plasma, not used at the moment.sml_prep_poi_s
- Iterative solver preparation (initial flux). Use 0.sml_prep_poi_e
- Iterative solver preparation (last flux). Use 0.sml_icon_col_s
- Collision scheme: 0 = no collisions. Collisions not implemented yet.sml_icon_tokamak_s
- Switch for equilibrium: 0 = stellarator simulation (default), 1 = tokamak wedge simulation.sml_eqcef_s
- Coefficient for equilibrium magnetic field. Normally use 1.0 (default).sml_rdcef_s
- Size of applied background radial electric field. Normally use 0.0 (default).sml_diag_freq
- Diagnostics time step output frequency.
- XGC-S has an additional namelist
In namelist
&sml_param
the input variablessml_dt
,sml_mstep
,sml_restart
andsml_restart_write_period
are ignored and replaced by the corresponding input in&sml_param_stellarator
. If restarting a simulation setsml_step1_s
to the next step aftersml_step2_s
in the previous simulation.In namelist
&sml_param
the input variablessml_node_file
andsml_ele_file
are ignored and replaced by the equilibrium input in&sml_param_stellarator
.In namelist
&sml_param
the input variablessml_mode_select_on
andsml_mode_select_n
are ignored unlesssml_icon_tokamak_s = 1
because it is not possible to select a mode in a stellarator simulation.In namelist
&sml_param
the input variablessml_nphi_total
andsml_wedge_n
must be consistent with the flag -nv for the number of toroidal cross-sections and the toroidal periodicity from the VMEC file (or torus wedge number for a tokamak) used when generating the equilibrium files with VMEC2XGC2 to ensure that the simulation is correct. Normallysml_wedge_n
should be set to the toroidal periodicity andsml_nphi_total
should be set to the value of -nv subtracted by 1 and then divided by 2, e.g. if using-nv 9
then setsml_nphi_total = (9 - 1)/2 = 4
when running XGC-S. However, it is also possible to use another combination of multiples of the -nv value and the periodicity, e.g. if using-nv 9
for the mesh and the periodicity is 5 one can also run XGC-S withsml_nphi_total = 4*5 = 20
andsml_wedge_n = 1
instead of usingsml_nphi_total = 4
andsml_wedge_n = 5
. For a tokamak simulation,sml_icon_tokamak_s = 1
, these restrictions do not apply since all cross-sections are identical.In namelist
&sml_param
the input variablessml_outpsi
,sml_bd_ext_delta3
,sml_bd_ext_delta4
,sml_bd_ext_delta3h
andsml_bd_ext_delta4h
must be consistent with the flag -truncate used when generating the equilibrium files with VMEC2XGC2.sml_outpsi
minus each ofsml_bd_ext_delta3
,sml_bd_ext_delta4
,sml_bd_ext_delta3h
orsml_bd_ext_delta4h
should be smaller than the value of -truncate to avoid errors in the Poisson solver.In namelist
&eq_param
the input variableseq_filename
,eq_den_file
,eq_tempi_file
andeq_tempe_file
are ignored and replaced by the corresponding input in&sml_param_stellarator
.Several namelist in main XGC are not included in XGC-S and many input variables in main XGC are either not included or ignored in XGC-S.
Profiles¶
The input profiles specified in the file given by sml_prf_file_s
has a different format than the main tokamak XGC code. The header line contains the number of equidistant intervals in normalized poloidal flux (label) that the profiles are specified on. This should typically be set to 1000. Then the 1st column is the label index and should run from 0 to 1001. The remaining 4 columns contain ion density in \({\mathrm{m}}^{-3}\), ion density gradient, ion temperature in \({\mathrm{eV}}\) and ion temperature gradient for the flux-surfaces. The gradients are with respect to the normalized poloidal flux \(\psi/\psi_a\). Note that the label index 1000 corresponds to the last closed flux-surface \(\psi/\psi_a = 1.0\), i.e. label 1001 is one radial grid point outside the last flux-surface. Label 0 corresponds to the axis \(\psi/\psi_a = 0.0\).
1000
0 5.624773740559e+19 0.000000000000e+00 7.118281580739e+02 0.000000000000e+00
1 5.624773740559e+19 1.346323821783e+17 7.118281580739e+02 5.111429221637e+00
2 5.624784215859e+19 7.466412884047e+16 7.118321351095e+02 2.834688018309e+00
3 5.624788688332e+19 3.953354175467e+16 7.118338331249e+02 1.500927420624e+00
4 5.624792130482e+19 3.173288427232e+16 7.118351399692e+02 1.204768440686e+00
[...]
i n_i d(n_i)/d(psi/psi_a) T_i d(T_i)/d(psi/psi_a)
[...]
999 4.460481422239e+19 3.640960420413e+14 3.549810715080e+02 8.692819217686e-03
1000 4.460481459376e+19 3.778929072538e+14 3.549810803744e+02 9.022220619954e-03
1001 4.460481459376e+19 0.000000000000e+00 3.549810803744e+02 0.000000000000e+00
Example of a profiles file for XGC-S.