1 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 track-length estimator and collision events, in which by “collision” it is meant any reaction among particle species parametrized by the corresponding reaction rates. In 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 HYDKIN 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.

2 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.

Fig. 1
figure 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 so-called separatrix (the border between the core region and the external region where particles are driven to the target) and becomes indistinguishable from it

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 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 three-dimensional 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 so-called 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 line-of-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 HYDKIN in Sect. 4.

3 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], HYDHEL [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 \(\sigma \) vs energy in the laboratory frame (comoving with the neutral particle species);

  • H.2, containing rate coefficients \(\langle \sigma v\rangle \)Footnote 1 vs temperature with vanishing neutral particle energy and non-drifting Maxwellian distribution for charged species;

  • H.3, same as H.2 with non-vanishing energy and/or drifting Maxwellian distribution for charged species, resulting in a double fit in temperature and energy;

  • H.4, containing rate coefficient vs temperature and density obtained by solving a CRM accounting for ladder-like processes,

  • H.8, projectile cooling rates vs temperature, obtained as the energy-weighted rate coefficient \(\langle \sigma v E_p\rangle \)Footnote 2 with \(\langle \sigma v\rangle \) from H.2,

  • H.9, projectile cooling rates vs temperature and neutral energy, obtained from energy-weighted rate coefficient \(\langle \sigma v E_p\rangle \) with \(\langle \sigma v\rangle \) from H.3,

  • H.10, projectile cooling rates vs temperature and density, obtained from the CRMs in H.4.

  • H.11 and H.12, containing other parameters, mainly population coefficients, used by EIRENE.

Data are stored as plain text in .tex file of the databases.

Indeed other databases are present in HYDKIN for hydrocarbons (Janev-Reiter databases, Ehrhardt-Langer database, ADAS), nitrogenic species (ADAS, open ADAS), beryllium and helium molecules (ADAS, FLYCHK [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.

Fig. 2
figure 2

A sketch of HYDKIN utilities: In the preprocessing phase for EIRENE, it can be used for checking data, understanding the relevant A &M processes and including the relevant species/reactions, generating json input files for the considered A &M model; in the post-processing phase it can be used for checking the simulation results, understanding the relevant reactions and the role of transport (by comparing with CRM), suggesting and generating new inputs looking at those species/reactions that have not been included but could be relevant given the plasma conditions

HYDKIN provides not only some interfaces for plotting cross sections and reaction rates, but also a one-dimensional 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\)

$$\begin{aligned} \frac{\text {d}{} \textbf{y}}{\text {d}t} = A \textbf{y} + \textbf{b}\,, \end{aligned}$$
(1)

where species are sorted such that the matrix A containing all the reaction rates and loss terms is upper-triangular, while \(\textbf{b}\) denotes external source rates. The solution is based on an expansion on A eigenvectors \(\textbf{e}_i\), with vanishing eigenvalues \(\lambda _i\) for \(i>m\), i.e., \(\lambda _{m+1}=\lambda _{m+2}=..=\lambda _n=0\), corresponding to the final dissociation products, and it is the sum of the homogeneous solution \(\textbf{y}^h\) and a particular inhomogeneous one \(\textbf{y}^p\):

$$\begin{aligned} \textbf{y}= & {} \textbf{y}^h + \textbf{y}^p \end{aligned}$$
(2)
$$\begin{aligned} \textbf{y}^h= & {} {\sum }_{i=1}^n d_i \,\textbf{e}_i \,\exp {\lambda _i t}\nonumber \\ \textbf{y}^p= & {} {\sum }_{i=1}^{m} c_i\,\textbf{e}_i + {\sum }_{i=m+1}^n \tilde{c}_i\,t\,\textbf{e}_i. \end{aligned}$$
(3)

The coefficients \(c_i\) and \(\tilde{c}_i\) are determined by requiring \(\textbf{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.Footnote 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.

Fig. 3
figure 3

Rate coefficients for recombination \(H^+ + e \rightarrow H\): Sawada-Fujimoto [21] (blue) and Johnson-Hinnov [20] (green) CRMs with three body recombination and radiation, Sawada-Fujimoto model with Lymann-\(\alpha \) line removed (red) and H in Rydberg states \(n=1\) (purple) and \(n=2\) (brown), Johnson-Hinnov model with opaque Lymann-\(\alpha \) line (orange)

4 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.

Fig. 4
figure 4

A snapshot of the graphical interface for choosing reactions in HYDKIN. Some columns have been turned off for clariness

Fig. 5
figure 5

A snapshot of the output json format: each reaction provides the entry shown on the left, while the background parameters are shown on the right

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 internal states (electronic, vibrational and/or rotational ones).

  • range: the limits of validity of the data in energy for cross sections (section H.1), in temperature for those rates in chapters H.2 and H.8, in temperature and energy for those rates in sections H.3 and H.9, in temperature and density for those rates in chapters H.4 and H.10.

  • reference: the main reference from which data are 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.

  • File/chapter: the corresponding section and database, for now only AMJUEL, HYDHEL and H2VIBR.

These column are retractable and the user can freely choose the features to be shown. The novel grouping structure and the availability of additional feature columns under user control are intended to simplify and fasten the comparison and validation of data sources.

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 figure 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.

Fig. 6
figure 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

Table 1 The list of reactions: the databases for rates are AMJUEL and H2vibr [9]. The model parameters are \(n_e=n_i\), \(T_e=T_i\) and the molecular source
Fig. 7
figure 7

Reaction rates for \(H_2\) dissociation reactions: neutral dissociation (blue), dissociative ionization (yellow) and dissociative recombination (green)

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.

4.1 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 purposes. 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 ladder-like 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].

Fig. 8
figure 8

Reaction rates for \(H_2^+\) dissociation reactions: molecular ionization (blue), neutral dissociation (yellow), dissociative ionization (green) and charge exchange by heavy particle collisions (red)

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).

Fig. 9
figure 9

The output plot in HYDKIN solver for the unresolved case at \(T=10eV\): the concentrations in \(cm^{-3}\) of H (blue), \(H_2\) (orange), \(H_2^+\) (green) and background plasma \(n_e=10^{13}cm^{-3}\) (red) are shown

Including vibrational resolved molecular states and tracking them as separate species is computationally expensive, but it provides nontrivial results in view of the following reasons:

  1. (i)

    the dissociation rate is overestimated in the unresolved case, as shown in Ref.  [26],

  2. (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]),

  3. (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 unresolved 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.

Fig. 10
figure 10

The reaction rate for charge exchange reaction \(H^++H_2\rightarrow H_2^+ + H\) in the unresolved case is shown in blue, while other curves are for resolved vibration states from \(\nu =0\) (orange) to \(\nu =5\) (pink)

5 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.