diff --git a/docs/paper/the-karl-code/paper.tex b/docs/paper/the-karl-code/paper.tex index 4753099..3da13c8 100755 --- a/docs/paper/the-karl-code/paper.tex +++ b/docs/paper/the-karl-code/paper.tex @@ -178,6 +178,7 @@ After initialization (see section~\ref{ssec:initialization}), the simulation sta For each movement step, the mean free path $\lambda_\text{mfp}$ of the corresponding particle is calculated through \citep{hussein2010radiation} \begin{equation} +\label{eq:mean_free_path} \lambda_\text{mfp} = \frac{1}{\sum_i \sigma_i(E) n_i} \commaeq \end{equation} @@ -332,12 +333,24 @@ In addition to the terminator class, the user can choose to add a deletion logge \subsection{Interactions} \label{ssec:interactions} -Interactions of particles are processed in the interaction class. Additionally, it is used to provide access to the cross section of the interaction and the macroscopic cross section, which can be used in the calculation of the MFP and in the selection of the interaction, see section~\ref{ssec:general_diagram}. The interaction class itself is an interface class. The details of the interaction are implemented in the derived classes. This way it is easy to add more types of interactions in the future. All interactions are initiated using a given cross section and target specie. For the cross section, we decided to use a one dimensional functional. This way the user can either specify an implemented cross section to be used, or can also provide an own function in the configuration file, see section~\ref{ssec:initialization}. The target specie can either be a tracked or background specie. This allows for a high flexibility of the interaction class. +Interactions of particles are processed in the interaction class. Additionally, it is used to provide access to the cross section of the interaction and the \changed{target-density scaled} cross section, which \changed{is} used in the calculation of the MFP, \changed{see equation \eqref{eq:mean_free_path}}, and in the selection of the interaction, see section~\ref{ssec:general_diagram}. The interaction class itself is an interface class. The details of the interaction are implemented in the derived classes. This way it is easy to add more types of interactions in the future. All interactions are initiated using a given cross section and target specie. For the cross section, we decided to use a one dimensional functional. This way the user can either specify an implemented cross section to be used, or can also provide an own function in the configuration file, see section~\ref{ssec:initialization}. The target specie can either be a tracked or background specie. This allows for a high flexibility of the interaction class. Currently there are seven types of interactions implemented: elastic scattering, clustering, recombination, free movement, charge exchange, excitation and ionization. In general, all types can be added to all species. However, the user has to decide if the specific use is sensible. In the following, the implementation of each interaction will be described. For the physical explanation, please refer to \citep{Kellerer_2022}. \paragraph{Elastic scattering} +\changed{ +The type of elastic scattering interactions considered are of the form: +\begin{align} +\label{eq:elastic_scattering} +\begin{split} +e^- + X &\rightarrow e^- + X \quad \text{and} \\ +I + X &\rightarrow I + X \, , +\end{split} +\end{align} +where $X$ describes any background particle species, e.g. $T_2$ and $I$ any of the simulated ion species, e.g. $T^+$, $T_2^+$ or $T_3^+$. +} + The elastic scattering class is initiated using the cross section, the target species and a scattering angle distribution. This distribution can be used to draw a scattering angle, given the energy of the incoming particle. It can be set to an isotropic distribution, to a distribution provided by a file and a composite of distributions. If the distribution is provided by a file, the angle distribution inside the file has to be provided given an energy binning. During evaluation of the scattering angle, the corresponding energy bin is determined and the corresponding angle distribution selected. The scattering angle is then determined from the selected angle distribution. @@ -347,21 +360,70 @@ In some cases, there is not enough data from one source alone, to cover the whol The interaction itself is performed in multiple steps. First, the velocity of a target particle is determined. It is compound of the drift velocity of the species and a velocity, which is drawn from the underlying velocity distribution. For the tritium gas, the drift velocity is determined in external simulation and the velocity distribution is given by a Maxwell-Boltzmann distribution \citep{Kellerer_2022}. For tracked particles the drift velocity is assumed to be zero and the velocity distribution is given by the density field. The velocity of the target particle is used to determine the impact energy in the laboratory frame. This energy is then used for the evaluation of the polar scattering angle $\theta$. A second scattering angle is drawn in the interval $[0, 2\pi)$, responsible for the change of momentum in azimuthal direction. Both angles and the target velocity are then used to rotate the velocity vector of the impact particle in the center of mass frame, see \citep{Kellerer_2022} for the full calculation. This rotated velocity is then used as the new velocity of the impact particle. \paragraph{Clustering} +\changed{ +There are currently two types of clustering reactions implemented. The first one is either a radiative association process or one in which the reaction partner is changed: +\begin{align} +\label{eq:clustering_radiative} +\begin{split} +Y^+ + X &\rightarrow YX^+ + h\nu \quad \text{or} \\ +Y^+ + YZ &\rightarrow YY^+ + Z \, , +\end{split} +\end{align} +where $X$ is a background species particle, e.g. $T_2$, $YZ$ is a multi-atomic background species particle, e.g. $T_2$ again and $I$ is any simulated ion species, e.g. $T^+$. +} + +\changed{ +The second type of clustering includes three interaction partners: +\begin{equation} +\label{eq:clustering_tertiary} +Y^+ + X + X \rightarrow YX^+ + X \, , +\end{equation} +where $Y^+$ is again a simulated ion species and $X$ a background species. +} The clustering class is initiated using the cross section \citep{Gerlich.1992,Paul.1995}, the target specie and the specie, which is the result of the clustering process. In the interaction itself it is assumed that the new particle follows the direction of movement of the target particle, but with different absolute velocity. The new absolute velocity is calculated from the velocity of a target particle and the new particles mass, since the initial direction is less important due to a high probability of collisions with the neutral gas, which quickly randomizes the velocity direction. The velocity of a target particle is determined analogue to its calculation in elastic scattering. \paragraph{Recombination} +\changed{ +Recombination is the interaction in which an ion species $X^+$ and an electron species $e^-$ form the neutral particle $X$: +\begin{equation} +\label{eq:recombination} +X^+ + e^- \rightarrow X \, . +\end{equation} +} The recombination class is initiated using the cross section and the target specie. The interaction itself has only two steps. First, the target density field logs one deletion at the corresponding position, see section~\ref{ssec:denstiy_fields}. Second, the impact particle is marked for deletion. The different recombination cross sections are given by \citep{Janev.2003,Kotelnikov.2019,Pettersson.2015} \paragraph{Free movement} The free movement interaction is only a helper class, which is necessary to be used if no other interaction should be used. It provides the simulation with a very small cross section, which results in a very large mean free path. This large mean free path guarantees a free movement through the simulation domain. If the interaction step is evoked for a particle nothing is done. \paragraph{Charge exchange} +\changed{ +Only the following type of charge exchange interactions is considered +\begin{equation} +\label{eq:charge_exchange} +X^+ + X \rightarrow X + X^+ \, , +\end{equation} +where $X$ is a particle of a background species and $X^+$ is the singly charged ion of the afore mentioned background particle. +} The charge exchange class is initiated using the cross section and the target specie. No product specie is necessary, because product and impact specie are the same. In the interaction, only the velocity of a target particle is determined, analogue its calculation in elastic scattering. This velocity is then used as the new velocity of the impact particle. Cross sections for this process class can be found in \citep{Janev.2003}. \paragraph{Excitation} +\changed{ +\begin{equation} +\label{eq:excitation} +e^- + X \rightarrow e^- + X^* +\end{equation} +$X^*$ either rotationally, vibrationally or electronically excited version of $X$. +} The excitation class is initiated using the cross section, the target specie and the excitation energy. In the interaction itself, first the velocity and direction of movement of the impact particle is determined. Second the kinetic energy of the particle calculated and reduced by the excitation energy. Lastly, the new velocity is determined from the reduced energy and direction of movement. This is a simple but effective method for excitation processes. However, no scattering is considered here. This is justifiable, because excitation processes are often much more unlikely than elastic scattering processes und therefore scattering angle effects do not play a significant role. The excellent paper by \citep{Janev.2003} provides more insight into the cross sections. \paragraph{Ionization} +\changed{ +\begin{equation} +\label{eq:ionization} +e^- + X \rightarrow e^- + e^- + X^+ +\end{equation} +$X$ background species +} The ionization class is initiated using the cross section, the target specie, the new electron specie, the new ion specie, the ionization energy and distribution and the scattering angle distribution. It is developed for ionization of the target specie by impact of a particle, which is much lighter than the target. However, the code does not check for this condition. In the interaction, first the velocity of a target particle is determined analogue to its calculation in elastic scattering. Then, the impact energy in the laboratory frame $E_\text{i}$ is calculated. If the impact energy is below the ionization energy $E_\text{ion}$, no ionization could occur and a new target particle velocity is drawn. This procedure can take a long time. However, the cross section of ionization decreases significantly before the ionization energy. Thus, very few particles with energies close to the ionization energy will undergo ionization, which will therefore not increase the simulation time significantly. When a suitable target particle velocity is determined, the impact energy is used in the ionization energy distribution to draw the impact energy after collision $E_\text{i}^\text{new}$. The energy of the new electron $E_\text{e}$, also called ejected electron in the following, then follows through @@ -431,7 +493,10 @@ The initialization of the simulation is administered by the simulation class usi The JSON file is structured, such that each of the sections corresponds to one main idea of the code or class. Subsections are used, when the class is a composite of other classes. This way the parameter file stays extensible in the face of new methods and classes, which will be added in the future. A collection of JSON files for each generator is provided together with the code for easy usage. A selections of generators will be discussed in the following. -If energy or length values are to be input by the user, the corresponding value has to be provided by its value and its unit. An automatic unit conversion will be taken care of by the program. Currently there are conversions available for \SI{}{cm}, \SI{}{mm} and \SI{}{m}, and for \SI{}{J} and \SI{}{eV}. +\changed{ +For input quantities that have a physical unit attached to them, e.g. the height and radius of the cylinder, the user can choose the units in the JSON file. During the parsing of the file an automatic conversion to SI units is performed. The conversion currently supports \si{mm}, \si{cm} and \si{m} for length units and \si{J} and \si{eV} for energy units.} + +%If energy or length values are to be input by the user, the corresponding value has to be provided by its value and its unit. An automatic unit conversion will be taken care of by the program. Currently there are conversions available for \SI{}{cm}, \SI{}{mm} and \SI{}{m}, and for \SI{}{J} and \SI{}{eV}. \paragraph{Functions} Functions are an integral part of the code, used for example to express cross sections. There are two types of functions implemented: a mapping of $\mathbb{R} \to \mathbb{R}$, called later on 1D-function or a mapping of $\mathbb{R}^3 \to \mathbb{R}$, called later on 3D-function. diff --git a/docs/paper/the-karl-code/referee_report_2.md b/docs/paper/the-karl-code/referee_report_2.md index 393048f..390ee6f 100644 --- a/docs/paper/the-karl-code/referee_report_2.md +++ b/docs/paper/the-karl-code/referee_report_2.md @@ -7,6 +7,7 @@ fs { color: Yellow; background-color: Black} csfs {color: Orange; background-color: #5f6a6a } done {color: green} reply {color: blue; font-weight: bold} +note {color: red; background-color: Black; font-style: italic; font-weight: bold} ## Reviewer #2 @@ -30,7 +31,7 @@ The paper omits much of the information that is the most interesting about this 4. C: I took a look at the source code. There are almost no comments anywhere, in either the headers or source, and this is especially problematic when many of the functions accept an argument that is simply named "object". It seems to me it would be good practice to add comments to at least add comments to explain what each function does, what it accepts as input and gives as output. - + Comments written, feedback desired 5. C, F: There are some example scripts given in the codebase, but they are not referenced in the paper, do not come with documentation, and it is not clear what they do in terms of expected input, processing and output. Somewhere it should be made clear how one should run these examples, what they do, and what the expected output is. Furthermore, the examples should contain at least some semi-realistic use cases of the code for addressing relevant physics questions for tritium experiments. @@ -79,11 +80,11 @@ Page 11-12: F: It reads oddly that the drift mover is treated in so much m Page 13: C, F: I see that trapped particles are killed by the simulation. But doesnt this invalidate the density field calculation, since trapped particles should have a very long retention time and hence contribute a lot to the density? Do trapped particles also -Line 36: C: what does "macroscopic" mean in this sentence? +Line 36: C: what does "macroscopic" mean in this sentence? changed; let someone read over to check if better Figure 1: C, F: Don't the ions and electrons - especially trapped ones - contribute to the space charge in the volume, and hence affect the E and B fields? So shouldn't there be a line "into" the E and B fields box from somewhere? How are the effects of space charge handled in general? -General comment: C: for each kind of interaction I recommend to include an equation so its clear to the reader what the process is, e.g. "elastic scattering e + X -> e+ X, where X=[T2, ….or whatever else]". I understand that the code is written to allow flexibility so these can be extended, but explaining what is implemented now will help the reader understand the role of each process. +General comment: C: for each kind of interaction I recommend to include an equation so its clear to the reader what the process is, e.g. "elastic scattering e + X -> e+ X, where X=[T2, ….or whatever else]". I understand that the code is written to allow flexibility so these can be extended, but explaining what is implemented now will help the reader understand the role of each process. Clustering muss nochmal komplett ueberarbeitet werden: unterschied tertiary und radiative association; evtl besser anstelle von abstrakten Reaktionen ein prototypisches Beispiel hernehmen? Page 14: C, F: Elastic scattering: please include figures of the various cross sections, indicating the models that are combined, the data, and the version recommended for use in simulations in KARL. @@ -125,7 +126,7 @@ Line 16: C: less than 1Gb, but for how many events? Lines 20-21: ?: I find it hard to understand what this sentence is trying to tell me. -Line 37: C: Value has to be provided by its value and its unit; dual use of the word value, seems circular? +Line 37: C: Value has to be provided by its value and its unit; dual use of the word value, seems circular? changed, proof-reading neccessary Line 42: "Functions are an integral part of the code", is this not a statement about code in general, or perhaps even mathematics in general?