Data processing and visualization tool for atomic and molecular data for collisional radiative models

The Monte Carlo kinetic code EIRENE (Sect. 2) is used for simulating the behavior of neutral species in the edge of tokamak plasma and coupled with fluid plasma codes for a self-consistent description to be compared with measured experimental conditions. The data and visualization toolbox HYDKIN (Sect. 3) has been developed as a pre-processing tool for validation of those atomic and molecular (A &M) data used in EIRENE simulations, such as cross sections and reaction rates for plasma-neutral and neutral-neutral collisions. The restructuring that is being performed to increase HYDKIN readability and usability is here presented (Sect. 4).


Introduction
The confinement and the sustainability of burning plasma within tokamaks are key aspects of the research on nuclear fusion. In order to reduce the impact of leaks on plasma-facing components, plasma losses are driven toward some targets while being cooled down through the interaction with atomic and molecular species in the so-called divertor region [1]. In particular, seeding the plasma with impurities (nitrogen, neon) and hydrogenic gas puffing reduce the particle and heat loads at the target plates, reaching the so-called detached phase, at which plasma temperature in the divertor drops below few eVs and a key role is played by a chain of reactions involving molecules (molecular assisted dissociation/recombination/ionization, MAD/MAR/MAI) [2]. EIRENE [3,4] (named from the Greek goddess of of peace) is a neutral transport code developed for solving the kinetic equations of neutral particles at the boundary of a tokamak plasma in order to predict the plasma conditions and the heat flux in the divertor for realistic configurations. EIRENE uses a Monte Carlo model for tracking several particle histories and statistically derives the solution of the transport equations. A particle history is made by tracklength estimator and collision events, in which by "collision" it is meant any reaction among particle species parametrized by the corresponding reaction rates. In Dmitry V. Borodin and Bettina Küppers have contributed equally to this work. a e-mail: f.cianfrani@fz-juelich.de (corresponding author) b e-mail: d.borodin@fz-juelich.de c e-mail: b.kueppers@fz-juelich.de this respect, EIRENE must be integrated with atomic and molecular databases. Some particle databases have been intentionally realized in view of the integration with EIRENE and are currently being updated. The first one was AMJUEL [5], collecting data (interaction potentials, cross sections, rates) from different sources represented as the polynomial fits defined in Ref. [6]. HYDHEL [7] contains the same kind of data but corresponding to different processes, all of them derived from Ref. [6], while H2VIBR [8] mostly provides data for those reaction with vibrationally resolved molecules. Other EIRENE databases provide data for the breakup of non-hydrogenic molecules (for instance METHANE for hydrocarbons). They have not being considered for restructuring, and we will not discuss them here.
These databases are available at EIRENE web page [4] and through the online database and data analysis tool-box HYDKIN [9]. HYDKIN was originally just a tool for studying hydrocarbons molecular decay, which has grown into a comprehensive toolbox for plotting and manipulation of data with a user-friendly graphical interface. It also contains a 1D particle solver that can be useful for beam-like scenario or in the presence of symmetries that can reduce the dimensionality of the problem (toroidal and poloidal symmetry or assuming short penetration from an infinite flat surface). Spectral resolution and online sensitivity analysis are possible. Generically, HYDKIN can be used to get some insight into the A&M side of the problem and understand the crucial physical parameters and the most promising measurements for experiments.
The manuscript is organized as follows. In Sect. 2, a general introduction to tokamak edge plasma physics is given and the relevance of EIRENE simulations is outlined. Section 3 provides a description of HYD-KIN toolkit, whose restructuring is presented in detail in Sect. 4 with an emphasis on the default cases for molecular decay described in Sect. 4.1. Brief concluding remarks follow in Sect. 5.

Tokamak plasma: edge simulations and detachment
The magnetic field configuration of a tokamak reactor is designed in order to provide energy and particle confinement in the core region where nuclear reactions occur. However, because of magnetic drifts and turbulent transport some leaks are unavoidable. A technical solution to reduce the energy and particle fluxes to the main chamber walls is to drive particles toward some specific tungsten target plates, usually placed in the lower part of the tokamak poloidal section (see Fig. 1) called the divertor.
In the divertor, some additional particles are present besides bulk ions and electrons coming from the core: They are recombined atoms, molecules injected via external systems and impurities due to the interaction between plasma components and material walls. They Fig. 1 A poloidal section of the planned EU-DEMO tokamak: plasma particles losses from the core region (blue) are driven toward the divertor (green) by the magnetic configuration and hit the target plates (red ). EIRENE simulations cover the triangulated region between the core and the wall. The triangulation gets finer and finer approaching the socalled separatrix (the border between the core region and the external region where particles are driven to the target) and becomes indistinguishable from it are generically denoted as neutrals and they are in a collisional regime in which the fluid approximation fails (relatively high Knudsen number and where the energetic tail of the ions and electrons distributions plays a significant role) [10,11]. For this reason, the threedimensional kinetic code EIRENE [3] has been developed and used to interpret the results of experiments. EIRENE provides a statistical solution to the characteristic of the kinetic equation via a Monte Carlo approach in both stationary and non-stationary cases. It is generically coupled iteratively to a plasma fluid code, as for instance B2.5 in SOLPS-ITER [12], and EIRENE provides the particle, energy and momenta sources due to neutrals, which are then inserted in the next iteration within the plasma code, providing a new background for the next EIRENE iteration and so on up to convergence.
EIRENE takes as input the list of all neutral particle species and the transition data among them, usually in the form of Maxwellian-averaged rates. Essentially EIRENE determines the interplay between particle transport and local chemical equilibrium, that can be studied by solving the corresponding collisional radiative model (CRM). In this respect, the analysis of CRMs is a necessary step to understand the impact of transport.
Several studies of different divertor conditions have been performed in the last decades including EIRENE modeling to get quantitative predictions (see for instance the review [13]). The best operational regime is the socalled detached phase, providing a substantial reduction of ion energy and particle fluxes to the target plates [1]. Atomic and molecular reactions are beneficial for detachments. In fact, the scattering of plasma components by atoms and molecules reduce particle and momentum fluxes to the targets. Moreover, the energy costs of the ionization and/or dissociation reactions due to the impact with bulk ions and electrons reduce the energy content of the plasma and thus the energy fluxes to the targets.
Moreover, atomic and molecular emissions provide spectroscopic signals that can reveal the divertor condition and provide detachment control. For instance, the plasma background temperature and density together with the atomic and molecular concentrations have been determined for the Swiss research fusion reactor "variable configuration tokamak" (TCV) [16] as follows: • plasma density is derived from Stark broadening of atomic Balmer lines, • plasma temperature is derived from the ratio of different Balmer lines, • the density of the donor species, among which there are atoms and molecules, is computed from the absolute line intensities.
This procedure has been applied to atomic lines and the idea is to extend to the molecular emission lines, which have a more complex band structure [14]. The complex band structure for, in particular H 2 , is due largely to the high degree of mixing between excited electronic states in this molecule, leading to highly perturbed rovibrational levels whose energies and corresponding transition intensities has been historically difficult to assign, predict and measure accurately. A crucial aspect of this procedure is thus the availability of reliable physical modeling of particle species and databases for transition data.
As we will discuss in next section, HYDKIN is a toolkit that can be used for checking how reliable are the A&M data by themselves (looking for internal consistency) and with respect to the experiments on fusion reactors modeled through EIRENE simulations. For instance, in real-time control of a burning plasma one needs a prominent spectroscopic features to characterize the degree of detachment by single and reliable lineof-sight integrated measurement. HYDKIN can be used for that. The data analysis tool-box helps the user to define a collisional radiative model, i.e., a representative list of particle/photon states and reactions/transitions for an experimental plasma configuration. The solver provides the densities of particle species in stationary and non-stationary configurations. The visualization tools can give insights into the results and facilitate the identification of the prominent parameters. As an application, a representative scenario for the next generation tokamak EU-DEMO [18,19] is discussed and the associated CRM is analyzed and solved within HYD-KIN in Sect. 4.

HYDKIN
HYDKIN [9] is a toolbox for plotting and manipulating atomic and molecular data with a user-friendly graphical interface. The data currently available are taken from existing databases. Some of them have been intentionally realized for EIRENE: AMJUEL [5], HYD-HEL [7], H2VIBR [8]. Each datum corresponds to a chemical reaction (ionization, excitation, dissociation, etc.) in which the reactants are a (usually charged) projectile and a (usually neutral) target. The databases have a common structure in terms of the following chapters: • H.0, containing interaction potentials, • H.1, containing the cross sections σ vs energy in the laboratory frame (comoving with the neutral particle species); • H.2, containing rate coefficients σv 1 vs temperature with vanishing neutral particle energy and nondrifting Maxwellian distribution for charged species;  [17]). They have a different structure, some of them are not interoperable with EIRENE and they are out of the scope of the present paper since they were not subject to restructuring.
HYDKIN provides not only some interfaces for plotting cross sections and reaction rates, but also a onedimensional particle solver that can be used to deduce the concentration of particles given a set of chosen reactions solving the associated CRM.
HYDKIN solver provides an exact analytic solution for the so-called Master equation governing particle concentrations y i i = 1, .., n where species are sorted such that the matrix A containing all the reaction rates and loss terms is uppertriangular, while b denotes external source rates. The solution is based on an expansion on A eigenvectors e i , with vanishing eigenvalues λ i for i > m, i.e., λ m+1 = λ m+2 = .. = λ n = 0, corresponding to the final dissociation products, and it is the sum of the homogeneous solution y h and a particular inhomogeneous one y p : The coefficients c i andc i are determined by requiring y p to be a solution of the Master equation (1), while d i are derived from the initial condition (see Sect. 2 in Ref. [9] for further details). The solver allows us to include external sources, reservoirs (an infinite reserve of particles at finite density and temperature, useful for modeling background species) and also to distinguish between P and Q species. 3 Furthermore, one can also add finite velocity for each species along one direction or perform a spectral analysis outlining the relevant time scales and the development of particle concentration up to equilibrium, if any. The solver graphical interface is designed to easily allow the user changing parameters from one run to the other and thus to perform sensitivity analysis.
HYDKIN can be used (see Fig. 2) • to import/export data (json, tabular and other formats), • to produce input data for EIRENE, • to check data for consistency, abnormal features,.., • to check and improve the results of the simulation, • to understand A&M side of the problem and identify the most significant processes (among the selected ones).
For instance, in Fig. 3 it is shown how HYDKIN can be used to compare the recombination reaction rates for different models and/or assumptions.

HYDKIN restructuring
A major restructuring of HYDKIN toolbox is being performed in order to increase accessibility and readability of the available databases and as a first step toward the integration with other sources. The new version is available at HYDKIN web page http://www.eirene.de/ hydkin/ by clicking on "version 2022" and at present it is restricted to those databases containing data for hydrogenic species, namely AMJUEL, HYDHEL and H2VIBR. The access is restricted to registered EIRENE users. Registration can be done at the website http://www.eirene.de/cgi-bin/eirene/registration. cgi, and the access to the resources, included HYDKIN, is regulated by Eirene license for non-commercial and non-military use available at www.eirene.de/Licence/ EPL.pdf.
The restructuring activity has been focused on three main aspects: updating the graphical interface for choosing the reactions for the plotter and the solver, providing manageable output formats suitable for interaction with other codes, making available some default cases for testing. The new interface is shown in Fig. 4.
Concerning the update of the graphical interface, the reactions can now be chosen from a main table in which the reactions coming from different sources (AMJUEL, HYDHEL or H2VIBR) are grouped together and shown as consecutive rows. Furthermore, some columns specifying additional reaction features are now present. The list of the available feature columns is • number: a label for the physical process in the form of three integer digits split by dots, for instance 2.1.5 for hydrogen ionization by electron impact. This classification is directly derived from that of AMJUEL and HYDHEL databases, while H2VIBR data are labeled according with the group they belong to. • reaction: the formula of the reaction, which needs not to be unique for each process as data may refer to different models and/or different particle inter- taken. • data type: the type of data, whether they are "experimental," "calculated" from a theory or "mixed," meaning a combination of experimental data and a theoretical model.
• peculiar properties: a general comment about the data, as for instance the kind of model from which they are taken, some specific properties or features. • generation: a label to keep track of the insertion of new data: 0 for all reaction at present, it will increase in next developments and correlated with next HYDKIN releases. • data origin: a specification of how the data have been obtained, for instance whether it is the original fit present in the reference, or it is an improved fit or for experimental data whether it is the fit of the original data. There are three additional columns that do not refer to data features but they allow the user to select those reactions to be sent to the plotter and to the solver: • the first column selects those processes not to be included into the solver, • the second column is to choose those reactions to include into the solver and for each process only one of them can be chosen (radio button), so avoiding duplicate reactions from different sources (as for instance data coming from different databases or computed from different theoretical models or from different experiments), • the third column selects the reactions for the plotter.
After having chosen the reactions, at the bottom of the page one can find the buttons to access the plotter and the solver and some inputs to fix additional parameters (beam energy, temperature, density, etc.).
The second aspect of HYDKIN restructuring deals with providing a manageable output format for the interaction with EIRENE and with other codes. In particular, the solver now provides an output json file that contains all the specified background parameters (density and temperature), the list of particle species included into the solver and the obtained concentrations, the list of the chosen reactions with all the features into the graphical interface, the corresponding rates and the respective temperature and energy/density parameters where available (see Fig. 5).
The json output represents the first step toward establishing a common manageable format for plasma codes and A&M databases. This file can be used for storing the results of a solver run and also for reloading the same input parameters through the button "Start with own configuration" into the main page (see fig-Fig. 6 The buttons available at the top-right of the main HYDKIN webpage: "Start with own configuration" for loading from the json output file of a previous run, "Unresolved," "Vibrationally resolved 7" and "Vibrationally resolved 14" for loading the corresponding default case ure 6). While for now the main interest is interoperability with EIRENE, whose input files have also been re-written in json format, the next step is to adhere to some standard format also with respect to other A&M databases (as for instance PyValem). In this respect, json format is also quite useful, because reading and manipulating packages are available in most programming languages.
Moreover, a manageable external plotting tool capable of reading json output is also planned such that clear readable plots can be generated even if many data are selected.

Default cases
The third aspect of HYDKIN restructuring is the introduction of some default cases that can be useful as benchmarks for molecular decay and for testing pur- poses. The default models are a set of pre-selected options in the GUI described in Fig. 4. Three decay models for H 2 molecules with a parametric source term are now present: the vibrationally unresolved one and two vibrationally resolved ones, with seven and fourteen internal molecular states. They can be accessed through the buttons at the top-right of the main page shown in Fig. 6. The list of reactions is shown in Table 1 and it contains four ionization/dissociation reactions for H 2 , one by proton impact (charge exchange) and three by electron impact, and three dissociation reaction for molecular ion H + 2 . All these three defaults models are built selecting as reactions the ones detailed in Table 1 including ladderlike vibrational transitions by electron impact in the two vibrationally resolved cases only. The list of reactions is taken from EIRENE simulations for JET [22] and EU-DEMO tokamaks [23].
HYDKIN plotter can be useful to identify the relevant reaction channels with temperature. By inspecting the dissociation reactions for H 2 and H + 2 in Figs. 7 and 8, one can see how at low plasma temperature (T < 3eV ) heavy particle collisions is the main dissociation channel providing molecular ions (red curve in Fig. 7) which experience mainly neutral dissociation and secondarily dissociative recombination (yellow and green curves in Fig. 8, respectively), whose branching ratio increases with decreasing temperature. The resulting reaction chains are molecular assisted dissociation and recombination (MAD and MAR), the former dominating but becoming less relevant at very low temperature. This example outlines the utility of HYDKIN plotter for analyzing the relevant physical processes in CRMs.
This scenario is confirmed by solving the model and deriving the concentration of particles. This has been originally done through the flexible Yacora solver [24] in Ref. [25] at equilibrium that has been here used for validation. The HYDKIN output shown in Fig. 9 provides time evolution up to equilibrium, and it is useful to determine the relevant time scales (spectral analysis).
Including vibrational resolved molecular states and tracking them as separate species is computationally  (i) the dissociation rate is overestimated in the unresolved case, as shown in Ref. [26], (ii) emission bands for different electronic transitions overlap and it is experimentally hard to separate them, so that one generically gets measurements of single lines coming from vibrationally (and also rotationally) resolved states (see for instance [14]), (iii) vibrational distribution is generically not Boltzmann one and its shape should be determined by solving CRMs or from EIRENE simulations.
HYDKIN plotter can give an hint on (i). In Fig. 10 the rate for the charge exchange reaction in the unre-solved case (blue) is compared with those vibrationally resolved and it is generically larger with respect to the rates for the ground (orange) and the first excited states (green and red). Combining the vibrationally resolved rates with those concentrations obtained by solving the CRM, one obtains a lower overall dissociation rate with vibrational resolution.

Conclusions
Reliable models and interaction data for atomic and molecular species are crucial for simulating and understanding the behavior of particles in tokamak divertor region, especially in view of getting and controlling detached conditions. HYDKIN has been developed as a comprehensive tool for testing some databases intentionally realized for EIRENE in order to provide proper input data to simulations. A major HYDKIN restructuring has started in view of facilitating the interaction with other codes/databases and the comparison among different sources. Some models of H 2 molecules decay have been added to HYDKIN as default cases and they guide the user across the novel features.
The restructuring is still in progress along the following guidelines: • including a bundle structure for internal states resolution, • including additional CRMs and further data sources, in particular for vibrationally resolved molecules and for isotopes/isotopologues (in order to avoid the isotope scaling usually adopted in EIRENE simulations), such as Molecular Convergent Close-Coupling database [27], • increasing readability and usability, correcting server errors and bugs, providing a novel reaction classification related with a search functionality, • linking to EIRENE input files.
On the physical side, the main goal is to identify spectroscopic signals characterizing detached divertor conditions for next forthcoming tokamak experiments (EU-DEMO) by systematic testing different data sources and models (reaction lists, bundle states, etc.), by introducing a compact and effective description of vibrational and rotational excitations and through the comparison between EIRENE simulations and experiments. Molecular spectroscopy requires reliable models and databases to analyze correctly the local chemical equilibrium and to determine emissivities. In this respect, HYDKIN provides very useful tools for the quality check on data and the comparison between different sources.