From f4e9a38cd5660b468e5df62ea15df89d0441e7e7 Mon Sep 17 00:00:00 2001 From: csendlinger Date: Wed, 15 Jan 2025 16:09:03 +0100 Subject: [PATCH] Excitation test case text and image --- .../excitation_single_scattering_density.pdf | Bin 0 -> 16770 bytes docs/paper/the-karl-code/paper.tex | 71 +++++++++++++----- 2 files changed, 53 insertions(+), 18 deletions(-) create mode 100644 docs/paper/the-karl-code/figures/excitation_single_scattering_density.pdf diff --git a/docs/paper/the-karl-code/figures/excitation_single_scattering_density.pdf b/docs/paper/the-karl-code/figures/excitation_single_scattering_density.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f65aee409054ca6b7f8125c0b9bd9b77b577c63b GIT binary patch literal 16770 zcmeHvc|29$*MCBCjTuwnDnf=kUvB0Mnd6d-Wx9sUTtX>BM25^$RK|#u2%%CkmZ?Mv zO=PAJ&3^k_=_7f*eO}M+`MrMsJbLZdK6jmc_Fj9fb@pC+t@lYtPen}vC5eRz75Br7 zs$nQN67FVw6ecSRM;Q9Kli&ztE3%cdn>`$%XJt?Ff}=qLB3xb`Msl@<8cMHvK+VmS z498F!AdC-KA0^q4;Zn;#Rej0(4ainx5*)is(6b_wNuI879P|^0FmSN4b#%3dO@wSQRzE3dxrYM`*YJ7WVzDm4DV6aEn#!p#Gcy#5csfCkb%3%szrh@^bU` zv;p&h_$R^PNCxu4Bu^2Sm0)|iqlLAkA!3oPPm0Vrjz%LZkY_%Yu z+bfdOCb`;^9pI>+qp3MMgSo;HYR*6aDkK{>TN1>w7ul0!Vr9#)hnH{;!MoDfr4lXFQD&0IRLv$P#xshXdGJwxAY>4sD4v&QQi39P;59Td9 z5rN!_3B4VzOCJ{AEqon0(4?@0H0K{2II->irWX9ylA8wK^_?M@|nkOY2ynJzkb&6l^8?tt* z!u0%c{N2uug}4){2iw~xro%2|+;KHCt=r~GW@E!>Y4 zZgv*GVa$Aw+`={|Id;}t;&9K+o&n#HtTC?gw?7zOaUv?)l#RI5Sdd>_uW>RbJUbOD zy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39rDaidw|g___$Y@Q{0ssZ~_zvQ)~w zT?P8e+ z*&wemd27%nDkJF~y`#PFljIKU?jm!dyNhrSx6-q#?v(u;lmC=`!W8=$&DPzxrT8dy zt;~0%?uHHQ9uGI#Ueru18+zbYI$yTw(3c-n7xx<`|0y4kgZsy*)<+WT)6v)e4M_kA z?-zmqgbY?82$qxFt8(OM$b$h%qF+%63W5Os6G8At*K3pH>&7VljvN3Vs{BF@prQQ} zd{pxbCh#Y60Ja7>0OcgS+^uZD_c>tyaECsYaVFV;Z*C};o|G&+78tfW$t0QO$QkV#mhqsk8 zNGih-MsNa1Ls`KI;FY!kxy{wE1%O$AEn^lCpl^3L3IfBBLC^-U=L;&puRqA*fwbES zoB_QS&OlMbO7!m^MXyrTDmcR*dI2h@z!)&-f2E=SCol#qdKHX;GCycK{|jTFq{06e z#_(4d1F)a}Sr`LI+5@1$e-p+45E=j(@P7egK>va;Kv0JNzc2>ee}*wg184~ZZ&?Ll zfUZ~I3oG^i7>t3k%~F220Z0yX1*7Z?l=vDL$sLaU zIm$m<3ouT~6RUTapX06UGL%7Kl%0ffI0rrb+@vTw9JC=|e=qlg&>Cj(*p?!LN2;_1Lz)Qu0OvGz^xXj zGWggP0$7Rw1f;vO8`;^>8t#LUl$OMb!yU+Ecdxw&gv+m6l5U>%qA&zNLfU%UfNy74 zKjm&~2e-DeaRQ_K>;bf-bnocqssepuETXa(jYQ*+C=eL~pYbB4#E@uVBvM#(mCSrS zNp>)>mSJH46Zi8EK;Ce`zU|<@Xb=b!`h&avq@i#a0+`ks8VbS_`H2j}3AQ1kL0r1$N zWgq(c#S03Fg_hejG`!SW`Js@~e~gO)BKYH36c)lM|K1;n=l@BQ0x0J-?a 0$ in order to allow for a distance of free propagation. The value of $n_\text{b}$ is chosen to be \SI{3.21e21}{\per\cubic\m} in order to allow for an appropriate MFP. The used interaction (or rather the specific cross section) has an threshold energy $E_\text{th} = \SI{12.754}{eV}$. Therefore the three energies considered are \SI{12}{eV}, \SI{20}{eV} and \SI{500}{eV}. The first energy was chosen such as to test for the threshold energy, the second one allows for a singular interaction and the third one allows for many interaction. For each case a number of \num{8e5} particles are simulated.\\ +The density of the injected particles $n_u$ is expected to follow an exponential distribution, depending on the mean free path of the interaction +\begin{equation} +\label{eq:density_injected} +n_u = n_0 \exp\left(-\frac{z - z_\text{neutral}}{\lambda_\text{mfp}(E_\text{inj})}\right) \commaeq +\end{equation} +with $n_0$ being the density in case no interaction would be performed. +This is valid for any injection energy $E_\text{inj}$.\\ +In case only a single scattering is possible the density of the scattered particles $n_s$ is given by +\begin{equation} +n_s \propto \left(1-\exp\left(-\frac{z - z_\text{neutral}}{\lambda_\text{mfp}(E_\text{inj})}\right)\right) n_0 \fullstop +\end{equation} +Due to the predictable change in velocity as well as the conserved direction of movement it is possible to predict the proportionality factor from equation~\ref{eq:target_field_density}. This leads to +\begin{equation} +\label{eq:density_single_scattering} +n_s = \left(1-\exp\left(-\frac{z - z_\text{neutral}}{\lambda_\text{mfp}(E_\text{inj})}\right)\right) \sqrt{\frac{E_\text{inj}}{E_\text{inj} - E_\text{th}}}n_0 \fullstop +\end{equation} +Adding $n_u$ and $n_s$ yields the expected density profile.\\ +Similar calculations can be done for the case of a maximum of two interactions, but for higher interaction counts this becomes increasingly more difficult. Therefore only the case for a single scattering are shown in Figure~\ref{fig:excitation_test_densities}. In this plot the \SI{12}{eV} is also shown to indicate the value of $n_0$. Furthermore, the density for the \SI{20}{eV} case has been scaled such that it fits to $n_0$ in the non-interaction region. It can be seen that the data fits the expectation very well, with the relative error being below 0.5\% everywhere, showing the correctness of the implementation. +} + +\begin{figure} +\centering +\includegraphics[width=1\textwidth]{figures/excitation_single_scattering_density.pdf} +\caption{Electron densities for two injection energies, one below the threshold of \SI{12.754}{eV} for the interaction and one above. The densities were scaled to be of the same magnitude for $z < 0.5$.} +\label{fig:excitation_test_densities} +\end{figure} \paragraph{Clustering} \changed{In the case of an ion-beam moving with a constant direction and velocity through an background gas, with which it can interact via clustering, it is possible to predict the form of the density of the ion beam \begin{equation} -n_\text{ion} \propto \exp\left(-\frac{z}{\lambda_{mfp}}\right) \fullstop +n_\text{ion} \propto \exp\left(-\frac{z}{\lambda_{\text{mfp}}}\right) \fullstop \end{equation} Since both the profile of the background gas density, the energy of the ions and the cross section of the interactions are known it is easily possible to check if the simulation corresponds to the analytical values.\\ For this test case only the interacting particles are considered, since during the interaction the velocity direction of the products becomes essentially randomized, which makes a prediction more challenging.\\ As described in section~\ref{ssec:interactions}, there are two types of clustering: radiative and tertiary. In case of the tertiary process only rate coefficients are known, s.t. the cross section is only approximated. This leads to \begin{equation} \label{eq:clustering_test_tertiary_mfp} -\lambda_{mfp, \text{ter}} = \frac{v}{k_\text{ter} n_{\text{T}^2}^2} +\lambda_{\text{mfp, ter}} = \frac{v}{k_\text{ter} n_{\text{T}^2}^2} \end{equation} for the mean free path, where $v$ is the velocity of the ion in the rest-frame of the tritium gas, $k_\text{ter}$ is the rate tertiary rate coefficient and $n_{\text{T}^2}$ is the density of the background gas.\\ For the radiative clustering there are two types of cross sections, first for T$^+$ only the rate coefficient is known again, while for T$_2^+$ an expression for the actual cross section is known. This means that there are two different expressions for the mean free path: \begin{equation} \label{eq:clustering_test_radiative_rateCoefficient} -\lambda_{mfp, \text{rad}} = \frac{v}{k_\text{rad} n_{\text{T}^2}} +\lambda_{\text{mfp,rad}} = \frac{v}{k_\text{rad} n_{\text{T}^2}} \end{equation} and \begin{equation} \label{eq:clustering_test_radiative_cross} -\lambda_{mfp, \text{rad}} = \frac{1}{\sigma n_{\text{T}^2}} \fullstop +\lambda_{\text{mfp,rad}} = \frac{1}{\sigma n_{\text{T}^2}} \fullstop \end{equation} All three cases were simulated using the same setup. The ions were injected on the left side of the simulation domain with an energy of \SI{6.8}{\milli eV} and a direction in positive $z$-direction. The neutral gas was chosen to be uniformly distributed in the simulation domain. A number of 80000 events were chosen to be simulated. Furthermore a strong magnetic field of \SI{2.5}{\tesla} was applied. The difference between the simulations is solely the density of the neutral gas due to the different magnitudes of the MFP. Therefore a density of \SI{1e18}{\per\cubic\m} has been chosen for the reaction T$_2^+$ + T$_2$. The cross section for this reaction has a value of $\sigma = \SI{1.91e-18}{\square\m}$. For the tertiary process a density of \SI{1e22}{\per\cubic\m} was chosen. The value of the rate coefficient at \SI{80}{\kelvin} is $ k_\text{ter} = \SI{2.6e-41}{\m\tothe{6}\per\second}$. And lastly for the radiative process of T$^+$ a density of \SI{2e25}{\per\cubic\m} has been chosen with a radiative association rate coefficient of $k_\text{rad} = \SI{5e-23}{\cubic\m\per\s}$ at \SI{80}{\kelvin}.\\ The results of the tree simulations together with the expected result are shown in Figures~\ref{fig:clustering_tp_ter}, \ref{fig:clustering_tp_rad} and \ref{fig:clustering_t2p}.\\ @@ -830,12 +865,12 @@ The spectrum shows very clearly that all processes for the particles interact in \subsection{Comparison to other Monte Carlo tools} -To our knowledge KARL is the only freely available Monte Carlo simulation for tritium based experiments. There are however other attempts to model the processes inside the KATRIN experiment. The earliest example is the paper by Nastoyashchii et al. \citep{Nastoyashchii:2005aa}. They follow the idea of a Monte Carlo code where events are generated from the decay of the tritium gas within the source. Most of the elastic and inelastic scattering processes which are implemented in the KARL code are also present in the code by Nastoyashchii et al with recombination being the remarkable exemption. The most striking difference however is the lack of spatial resolution: The only result of the code is the lifetime of particles in the source (and the spectrum derived from that). Due to the extreme inhomogeneity of the tritium density the results produced by this approach are in many cases not applicable. The results of KARL are compared to this approach in Fig. \ref{fig:Nastoyashchii_comp}. +To our knowledge KARL is the only freely available Monte Carlo simulation for tritium based experiments. There are however other attempts to model the processes inside the KATRIN experiment. The earliest example is the paper by Nastoyashchii et al. \citep{Nastoyashchii:2005aa}. They follow the idea of a Monte Carlo code where events are generated from the decay of the tritium gas within the source. Most of the elastic and inelastic scattering processes which are implemented in the KARL code are also present in the code by Nastoyashchii et al. with recombination being the remarkable exemption. The most striking difference however is the lack of spatial resolution: The only result of the code is the lifetime of particles in the source (and the spectrum derived from that). Due to the extreme inhomogeneity of the tritium density the results produced by this approach are in many cases not applicable. The results of KARL are compared to this approach in Fig. \ref{fig:Nastoyashchii_comp}. \begin{figure}[tbp] \centering \includegraphics[width=0.8\textwidth]{figures/comprarison_ndE_Nastoyashchii.pdf} - \caption{Particle spectra from the KARL code at different positions in the source in comparison with results obtained by \citep{Nastoyashchii:2005aa}. As Nastoyashchii et al only calculate spectra by taking into account the lifetime within the source there is no possibility to derive spectra at a defined position. The spike at around \SI{10}{eV} is due to an incorrect representation of excitation processes. } + \caption{Particle spectra from the KARL code at different positions in the source in comparison with results obtained by \citep{Nastoyashchii:2005aa}. As Nastoyashchii et al. only calculate spectra by taking into account the lifetime within the source there is no possibility to derive spectra at a defined position. The spike at around \SI{10}{eV} is due to an incorrect representation of excitation processes. } \label{fig:Nastoyashchii_comp} \end{figure}