Files
katrin-plasma/docs/paper/the-karl-code/paper.tex
T

544 lines
34 KiB
TeX
Executable File

\documentclass[preprint,12pt]{elsarticle}
%% Use the option review to obtain double line spacing
%% \documentclass[preprint,review,12pt]{elsarticle}
%% Use the options 1p,twocolumn; 3p; 3p,twocolumn; 5p; or 5p,twocolumn
%% for a journal layout:
%% \documentclass[final,3p,times]{elsarticle}
% \documentclass[final,3p,times,twocolumn]{elsarticle}
%% \usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath} % for align
\usepackage{listings}% for code listings
\usepackage{xcolor} % to set colors in code listings
\usepackage{siunitx} % for proper units
\usepackage{upgreek} % for upbeta
\usepackage{mathtools} % for abs
% additional CGS units
\DeclareSIUnit\statcoulomb{statC}
\DeclareSIUnit\statvolt{statV}
\DeclareSIUnit\erg{erg}
% setup syntax highlighting for JSON
\colorlet{punct}{red!60!black}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{digit}{magenta!60!black}
% short cuts
\newcommand{\fullstop}{\text{\,.}} % in equations
\newcommand{\commaeq}{\text{\,,}} % in equations
\DeclarePairedDelimiter\abs{\lvert}{\rvert} % for \abs
%% This list environment is used for the references in the
%% Program Summary
%%
\newcounter{bla}
\newenvironment{refnummer}{%
\list{[\arabic{bla}]}%
{\usecounter{bla}%
\setlength{\itemindent}{0pt}%
\setlength{\topsep}{0pt}%
\setlength{\itemsep}{0pt}%
\setlength{\labelsep}{2pt}%
\setlength{\listparindent}{0pt}%
\settowidth{\labelwidth}{[9]}%
\setlength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\rightmargin}{0pt}}}
{\endlist}
\journal{Computer Physics Communications}
\begin{document}
\begin{frontmatter}
%% Title, authors and addresses
\title{KARL - A Monte Carlo model for atomic and molecular processes in the tritium atmosphere of the KATRIN experiment}
\author[a]{Jonas Kellerer}
\author[b,c]{Felix Spanier \corref{author}} % Todo: aktualisieren
\cortext[author] {Corresponding author.\\\textit{E-mail address:} felix@fspanier.de}
\address[a]{Institut f\"ur Astroteilchenphysik, KIT, Hermann-von-Helmholtz-Platz 1,
76344 Eggenstein-Leopoldshafen, Germany}
\address[b]{Institut f\"ur Theoretische Astrophysik, Universit\"at Heidelberg, Albert-Ueberle-Str. 2 und Philosophenweg 12,
69120 Heidelberg, Germany}
\address[c]{Centre for Space Research, North-West University, South Africa} % Todo: aktualisieren
\begin{abstract}
The karl code is awesome.
\end{abstract}
% submit to http://www.ees.elsevier.com/cpc.
% In addition to the manuscript you must supply: the program source code; job control scripts, where applicable; a README file giving the names and a brief description of all the files that make up the package and clear instructions on the installation and execution of the program; sample input and output data for at least one comprehensive test run; and, where appropriate, a user manual. These should be sent, via email as a compressed archive file, to the CPC Program Librarian at cpc@qub.ac.uk.
\begin{keyword}
%% keywords here, in the form: keyword \sep keyword
Monte Carlo \sep Tritium decay \sep Ionization \sep Scattering
\end{keyword}
\end{frontmatter}
{\bf PROGRAM SUMMARY}
\begin{small}
\noindent
{\em Manuscript Title:} KARL - A Monte Carlo model for atomic and molecular processes in the tritium atmosphere of the KATRIN experiment \\
{\em Authors:} Christian Reiling, Jonas Kellerer, Felix Spanier \\
{\em Program Title:} KARL - \textbf{KA}trin WGTS elect\textbf{R}on and ion spectrum Monte Car\textbf{L}o \\
{\em Journal Reference:} \\ %Leave blank, supplied by Elsevier.
{\em Catalogue identifier:} \\ %Leave blank, supplied by Elsevier.
{\em Licensing provisions:} GNU Public Licence \\ %muss so sein wegen blitz
{\em Programming language:} C++ \\
{\em Computer:} any workstation or cluster that has a modern C++ compiler (e.g. g++ 8.2 or later) an MPI implementation and the required external libraries \\
{\em Operating system:} Linux / Unix \\
{\em RAM:} depending on problem size and number of resolved species between 100 MB and 2 GB; some scratch space \\ %%TODO: Prüfen
{\em Number of processors used:} depending on problem size between one and a few hundred processors \\
{\em Keywords:} semi-classical Monte Carlo \\
{\em Classification:} 19.1 Atomic and Molecular Processes \\ %Classify using CPC Program Library Subject Index, see ( % http://cpc.cs.qub.ac.uk/subjectIndex/SUBJECT_index.html)
{\em External routines/libraries:} C++ compiler (tested with g++ 8.2 and 9.4.0), MPI 1.1 (tested with OpenMPI 3.1), HDF5 with support for parallel I/O (tested with version 1.10.0), Blitz++ (tested with version 1.0.2), Jansson (tested with version 2.12 and 2.13)\\
{\em Nature of problem:} In the KATRIN experiment (and other experiments alike that feature large vessels filled with tritium) electrons from beta decay. These electrons interact with the ambient gas to produce secondary electrons through ionization. Subsequent processes including excitation, secondary ionization and collisions. The resulting electron and ion differential energy spectrum at various positions is relevant for further plasma analysis and the current of charged particles to the ends of the experiments is an observable. \\
{\em Solution method:} Semi-classical Monte Carlo \\
{\em Restrictions:} The geometry of the experiment is currently limited to the KATRIN experiment, but this may easily be changed. Secondary ions are currently assumed as thermal.\\
{\em Unusual features:} The configuration is stored in JSON files. \\
{\em Running time:} minutes to hours; Depending on number of simulated decays \\
\end{small}
%% main text
\section{Introduction}
\label{sec:intro}
The KATRIN experiment is designed to measure the electron neutrino mass to unprecedented sensitivity down to \SI{0.2}{eV} \citep{KATRIN2005}. At the experiment, the mass is inferred from the shape of the $\upbeta$-decay spectrum of tritium. The contribution of the mass on the shape is most dominant in the endpoint region. The experiment can be divided into two parts: the source section and the detector section. In the source section, tritium gas is circulated which provides a high luminous stream of beta electrons. These electrons are magnetically guided to the detector section. There they are separated by their kinetic energy: one stream being recorded by the detector, the other reflected back to the source.
The final neutrino mass sensitivity can only be reached through a precise examination of all systematic effects \citep{Aker.1132021}. One of these effects is the plasma inside the source. It is generated through $\upbeta$-decay and subsequent impact ionization of neutral tritium gas. The resulting charged particle density is sufficient to assume a plasma inside the WGTS \citep{Kuckert.2016}. The effects of this plasma can influence the motion of the electrons.
The plasma, in conjunction with boundaries, exerts a potential throughout the source, also called starting potential, which can show a non-homogeneous structure. The final energy of the $\upbeta$-electrons selected by the spectrometer can therefore be dependent on the original position of $\upbeta$-decay inside the source. Hence, the plasma potential can distort the integral spectrum measured at the detector, and has to be accounted for in the analysis by a quantitative understanding of the plasma. Only the inhomogeneous part of the potential is of special interest, as the homogeneous part shifts the entire $\upbeta$-spectrum and can be easily taken into account.
In the past, the diffusion ansatz was used by L. Kuckert \citep{Kuckert.2016} to provide a quantitative model of the plasma. Recent studies \citep{Kellerer_2022} indicate, that this ansatz may not include all significant plasma effects, such as the high energy tail of the spectrum, the transition between a collisional and non-collisional plasma, as well as all time dependent effects. Therefore, a new kinetic simulation was developed within the KATRIN collaboration \citep{Kellerer2022_1000143868}. A precondition for any theoretical plasma study is the knowledge of electron and ion distributions (and velocities) at any point within the tritium source. Thus, a simulation tool was developed to determine the distributions, named KARL. First physical results of KARL were presented in \citep{Kellerer_2022}. This paper however focuses on the technical realization and provides the code itself.
\section{Description of the method}
\label{sec:method}
Electrons within the WGTS are generated through $\upbeta$-decay and through subsequent secondary processes. For each $\upbeta$-decay, this forms a Markov chain of events, with further branching event chains for secondary particles. This scenario is best simulated using the Monte Carlo technique.
In the simulation, decays are successively processed. Meaning that each decay particle is followed until its destruction, with an optional creation of new secondary particles. All primary and secondary particles are processed first, before new decay particles are added. The particle tracking is divided into two alternating steps. First, the particle is moved according to the electromagnetic fields in the source and the mean free path of the particle. Secondly, an interaction is performed. A detailed description of the simulation flow can be found in section~\ref{ssec:general_diagram}. The simulation ends until a predefined number of decays has been processed. During the simulation it is recorded how long a specific particle resides in predefined sections of the source and how often a particle crosses from one section to another. Both quantities can be used to calculate the particle density and particle currents in the source, see section~\ref{ssec:denstiy_fields} and \ref{ssec:current_collection}, which make up the result of the simulation.
\subsection{General diagram}
\label{ssec:general_diagram}
After initialization (see section~\ref{ssec:initialization}), the simulation starts its iterative cycle, which contains three subcycles, see figure~\ref{fig:simulation_flow}. The first adresses how many primary particles/events are processed, which is predefined by the user. It adds primary particles to the particle queue, if it is empty. In the second subcycle a particle is selected at random from the particle queue. This particle is processed until its termination and a new particle is selected from the queue. Within the third subcycle, the actual particle treatment is performed, which includes alternating between the movement step and interaction step.
For each movement step, the mean free path (MFP) $\lambda_\text{mfp}$ of the corresponding particle is calculated through %todo: citation
\begin{equation}
\lambda_\text{mfp} = \frac{1}{\sum_i \sigma_i(E) n_i} \commaeq
\end{equation}
where $E$ is the kinetic energy of the particle in the lab frame, $\sigma_i$ is the cross section of a specific interaction, and $n_i$ the particle number density of the interaction partner. The cross sections are evaluated from predefined functions. The particle number density of the interaction partner is calculated either from a predefined function for background species, or from the density field for tracked species, see section~\ref{ssec:denstiy_fields} and \ref{sec:implementation} for more information. The actual moved distance $d$ is a statistical quantity, which can be derived from the MFP through %todo: citation
\begin{equation}
d = \lambda_\text{mfp} \cdot \log \frac{1}{\eta} \commaeq
\label{eq:distance_from_mfp}
\end{equation}
where $\eta \in (0, 1]$ is a random number. The particle is then moved by this distance $d$ in dependence on the electromagnetic fields inside the source, see section~\ref{ssec:movement}. During this step the density fields of the corresponding specie are updated.
After the movement step it is evaluated if the particle needs to be terminated, which is mainly a check if the particle has left the simulation domain, or has hit a wall, see~\ref{ssec:termination}. If the particle is still alive, a random interaction is selected from the list of available interactions, weighted by its probability to occur. The probability scales with the cross section of that interaction and the interaction partner particle density. The corresponding interaction is performed and the interaction products, which are not the current particle are added to the particle queue. If the particle does no longer exist after the interaction (through recombination or clustering) it is terminated, otherwise the next movement step is performed.
\begin{figure}[tbp]
\centering
\includegraphics[height=0.8\textheight]{figures/simulation_flow.pdf}
\caption{Simulation diagram. Shows diagram of simulation.}
\label{fig:simulation_flow}
\end{figure}
\subsection{Monte Carlo method}
?
- mean free path, random for change of field\\
- choice of interaction\\
- interaction partner\\
\subsection{Density fields}
\label{ssec:denstiy_fields}
In a general Monte Carlo simulation, each event is assumed to be independent of the other. However, different particles types can in general interact with each other, for example electrons and ions through recombination. Therefore, each Monte Carlo event in our simulation must be dependent on the other events. This dependence is mimicked in the simulation by so-called density fields. These density fields determine the number density of each particle specie during the simulation. These fields are then used to determine the MFP and are used in the selection of the interaction type.
In the simulation, the source is segmented into evenly spaced segments in longitudinal, radial and azimuthal direction, predefined by the user, see figure~\ref{fig:segmentation} for a schematic representation. In each iteration step of the particle queue, it is recorded how long a particle with index $i$ stays in one of the predefined segments, labeled by the time $t_i$. The number density $n_\alpha$ of a species $\alpha$ is then proportional to the total time of all particles of the corresponding species spent in the segment $\sum_i t_i$ and the volume $V$ of the segment. In case of recombination, an additional term has to be added corresponding to the number of recombination $N_\gamma$ of the recombination partner $\gamma$ in the segment, resulting in
\begin{equation}
n_\alpha = \frac{\sum_i t_i}{t_\text{sim} V} - \frac{N_\gamma}{V} \commaeq
\label{eq:target_field_density}
\end{equation}
where $t_\text{sim}$ is called the simulated time \citep{Kellerer_2022}. It describes the simulated physical time that is past after simulating a fixed number of primary events $N_\text{prim.}$. In the case of radioactive beta decay at KATRIN, it can be directly determined by the activity $a$ through
\begin{equation}
t_\text{sim} = \frac{N_\text{prim.}}{a}\, . \label{eq:simulated_time}
\end{equation}
The activity of the source is not dependent on the interaction of the charged particles in the source, and can therefore be evaluated from the predefined amount of neutral gas in the source.
\begin{figure}[tbp]
\centering
\includegraphics[width=0.8\textwidth]{figures/segmentation_for_density_fields.pdf}
\caption{Segmentation. Shows segmentation of simulation.}
\label{fig:segmentation}
\end{figure}
\subsection{Current collection}
\label{ssec:current_collection}
The second main objective of the code is to determine the particle currents in the source. This task is performed through so-called virtual barriers: predefined planes within the source, where each particle is registered, when it crosses from one side to another. The total current through the segment faces is then given by
\begin{equation}
j = \frac{N^+ - N^-}{A \, t_\text{sim}} \commaeq
\end{equation}
(\citep{Kellerer_2022}) where $N^+$ and $N^-$ is the number of particles crossing the faces in positive and negative direction, $A$ is the area of the face and $t_\text{sim}$ the simulated time, see~Eq.~\ref{eq:simulated_time}. For convenience, the location of the virtual barriers are chosen to coincide with the segment boundaries, see figure~\ref{fig:segmentation}, of the density field calculation, see section~\ref{ssec:denstiy_fields}.
\section{Description of the implementation}
\label{sec:implementation}
For the simulation, we decided to use c++ as a programming language for several reasons. First, it can be used for object oriented programming. This makes the code easier to read, because the classes were closely modeled after their physical representation. Secondly, the accuracy of the simulation relies on high statistics. Thus, many particle decays need to be simulated, which requires a fast calculation. For the same reason, we decided to employ parallel calculation, see section~\ref{ssec:parallelization}.
There are three basic building blocks of the simulation. First, the simulation itself is treated as a class, which is responsible for initialization of the simulation environment, see section~\ref{ssec:initialization} and guiding through the flow of the simulation, see figure~\ref{fig:simulation_flow}. Second, the particle class, which represents the simulated physical particles through their physical position, velocity and type of specie. Third, the specie class, which encapsulates the general behavior of each particle type (like electrons) in the simulation.
The main feature of the specie class is provide access to the density, velocity distribution and drift velocity of a specific type of particle. All three quantities are used for the calculation of the MFP and the choice of the interaction partner. However, we decided to distingquish between two types of species, those particles who are tracked throughout the simulation (electrons and ions) and those who act as background (tritium gas). This way, it is more clear which specie fulfills which function, especially in the initialization process. Additionally, the particle class only accepts the tracked specie class as input, reducing programming errors in the development of new injectors or interactions.
The tracked specie class is composed of different classes, providing access to the behavior of each particle type. Hence, each tracked specie can be tailored to the requirements of the user, either for testing, but also for the inclusion of further particles types. Along these lines, the code can be adapted to other experimental environments, provided the knowledge of the interaction and their cross sections. Each of the class members fulfills a special task, which will be described in detail in the following sections.
\subsection{Movement}
\label{ssec:movement}
The movement of particles is outsourced to the mover class. It moves the particle dependent on the E/B fields at the position of the particle, given the integrated distance a particle will move, see section~\ref{ssec:general_diagram}. The movement itself is subdivided into in smaller steps. This way, it can be evaluated if the particle has left the simulation domain between the steps, which stops the movement. Apart from the simulation boundary, the movement is stopped if the particle leaves a segment or energy bin of the density fields, see section~\ref{ssec:denstiy_fields}. No interaction will be performed afterwards, but a new distance will be rolled from the MFP at the new position of the particle, see equation~\ref{eq:distance_from_mfp}. This procedurce does not increase the mean distance a paritcle travels, if the traversted density stays the same. However, large gradients will be taken into account in the calculation. Hence, the distance a particle moves is not over- or underrated when moving into higher or lower density regions respectivly. However, the density fields need a higher resolution than the density difference, which increases the simulation time. Thus, the user needs to evaluate the tradeoff between simulation time and accuracy.
The stop of the movement if a particle has left a density field segment has an additional benefit: it can be easily evaluated how long a particle has stayed in the segment. Each movement step the particle is alive, a counter variable is increased by the time the movement step took. If the movement is stopped this counter variable can be added to the corresponding density field segment.
Two different kinds of movers are implemented (Boris, Drift), which differ in their calculation of the new position and velocity. In general, the Boris mover provides a high accuracy, because it resolves the gyro motion of the particles, but it therefore needs more calculation time. Vise versa, the drift mover provides a fast calculation time, because it does not resolve the gyro motion, but it therefore less accurate. Both movers will be presented shortly in the following.
\paragraph{Boris mover}
The boris mover uses the boris push algorithm \citep{Penn.2003} for the movement step described in the previous paragraph (see \citep{Kellerer2022_1000143868} for a in depth description of the boris push algorithm). However, the steps are not chosen by a given length but a given timestep $\Delta t$, which is needed as an input for the boris push algorithm. The moved distance is calculated after the movement algorithm. This moved distance is then substracted from the total distance the particle has still to move. When this distance is smaller than zero the movement will be ended.
The timestep has to be provided by the user. It should be oriented on the highest gyro frequency possible in the simulation domain $\Omega_{g,\text{max}}$ and fulfill
\begin{equation}
\Delta t < \frac{1}{\Omega_{g,\text{max}}} \fullstop
\end{equation}
This timestep is also used for the determination of the time a paritcle spends in a density field segment, see previous section.
The boris push algorithm was chosen, because it is numerically stable with high precision and efficiency \citep{Kilian.2015}. The method can be used for low relativistic particles, up to a gamma factor of $\gamma \approx 1000$ \citep{Vay.2008}. At the KATRIN experiment, only electrons of energies up to \SI{32}{keV} (Krypton conversion electrons) are created. This results in a gamma factor of $\gamma = 1.06$, which is well below the limit of the Boris push.
\paragraph{Drift mover}
The drift mover is based on the description of the movement of the particle through its movement around its gyro centrum and the drift movement of the gyro centrum, see \citep{Chen.1984}. In the current version of the code, the drift mover should only be used for a constant magnetic field. No magnetic field gradients are considered, because the magnetic field at KATRIN is constant over most parts of the source \citep{Kellerer2022_1000143868}.
In the drift mover, the movement is subdivided into smaller steps, given by the smaller value of the maximal step length $d_\text{max}$ (provided by the user) and the leftover distance the particle has still to move. The movement is ended, when the leftover distance is zero. Each movement step follows the same procedure. It can be subdivided into the change of the particle position and the change of the velocity, both described in the following.
The position change is described by the movement around the gyro centrum $\Delta \vec{x}_\text{c}$, the movement of the gyro centrum parallel to the magnetic field $\Delta \vec{x}_\parallel$ and the drift movement of the gyro centrum $\Delta \vec{x}_\text{D}$.
The drift movement of the gyro centrum is calculated from the $E \times B$ drift velocity
\begin{equation}
\vec{v}_\text{D} = \frac{\vec{E}\times \vec{B}}{\abs{\vec{B}}}
\end{equation}
and the timestep length $\Delta t$
\begin{equation}
\Delta t = \frac{\Delta x}{\abs{\vec{v}_\parallel} + \abs{\vec{v}_\perp} + \abs{\vec{v}_\text{D}}} \commaeq
\end{equation}
where $\Delta x$ is the step length of the movement step and $\vec{v}_\parallel$ and $\vec{v}_\perp$ the velocity parallel and perpendicular to the magnetic field. The moved distance through the drift motion evaluates the to
\begin{equation}
\Delta \vec{x}_\text{D} = \Delta t \cdot \vec{v}_\text{D} \fullstop
\end{equation}
The movement of the gyro centrum parallel to the magnetic field is calculated from
\begin{equation}
\Delta \vec{x}_\parallel = \Delta t \cdot \vec{v}_\parallel \fullstop
\end{equation}
The position change around the gyro centrum is calculated in three steps. First, the gyro radius is determined
\begin{equation}
r_\text{g} = \frac{m \abs{\vec{v}_\perp}}{q \abs{\vec{B}}} \commaeq
\end{equation}
from the perpendicular velocity, the particle mass $m$ and charge $q$, which in turn is then used to determine the vector from the particle to the gyro centrum $\vec{x}_\text{pc}$
\begin{equation}
\vec{x}_\text{pc} = - r_\text{g} \frac{\vec{v}_\parallel \times \vec{v}_\perp}{\abs{\vec{v}_\parallel \times \vec{v}_\perp}} \fullstop
\end{equation}
Second, the gyro frequency is calculated through
\begin{equation}
\omega_\text{g} = \frac{q \cdot \abs{\vec{B}}}{m} \fullstop
\end{equation}
The gyro frequency is then used to calculate the relative angle change towards the gyro centrum
\begin{equation}
\Delta \theta = \Delta t \cdot \omega_\text{g} \fullstop
\end{equation}
Third, the movement of the gyro centrum is calculated by the rotation of $\vec{x}_\text{pc}$ around $\vec{v}_\parallel$ with the angle of rotation $\Delta \theta$ through Rodriges' rotation formula. In total, the position changes calculates to
\begin{equation}
\Delta \vec{x} = \Delta \vec{x}_\text{c} + \Delta \vec{x}_\parallel + \Delta \vec{x}_\text{D} \fullstop
\end{equation}
The velocity after movement is determined by the acceleration of the particle through the electric field $\Delta \vec{v}_\text{E}$, through the rotation of the perpendicular velocity around the gyro center $\vec{v}_\perp^\text{rot}$ and the initial parallel velocity
\begin{equation}
\Delta \vec{v} = \vec{v}_\parallel + \Delta \vec{v}_\text{E} + \vec{v}_\perp^\text{rot} \fullstop
\end{equation}
The acceleration through the electric fields calculates to
\begin{equation}
\Delta \vec{v}_\text{E} = \Delta t \frac{q \vec{E}_\parallel}{m} \commaeq
\end{equation}
where $\vec{E}_\parallel$ is the electric field parallel to the magnetic field.
The rotation of the perpendicular velocity is again calculated using Rodriges' rotation formula with the axis of rotation $\vec{v}_\parallel$ and angle of rotation $\Delta \theta$.
\subsection{Termination}
\label{ssec:termination}
- class to determine if particle needs to be terminated \\
- three types currently: \\
- left simulation domain given by geometry (currently only cylinder geometry) \\
- reached max interactions \\
-> stored particle are neglected but makes simulations more controllable \\
- reached max time alive\\
-> stored particles are neglected, but plasma mostly on short timescales -> large timescales are not as relevant\\
- Deletion logger:\\
- additional output for debugging\\
- used when particle is deleted and saves information\\
- currently: wall, max it, max time, rec, cluster formation\\
- rec, cluster next section\\
\subsection{Interactions}
\label{ssec:interactions}
- class which includes everything relevant for interaction of particles: cross section (used in mfp and interaction selection), interaction itself\\
- creates interaction output, namely all particles, which result of the interaction (new particles, and also recombination)\\
- base class is interface, derived implement details\\
-> easily extendable\\
-> use same interactions for different species (elastic scattering)\\
- always cross section and target specie necessary (background or tracked)\\
- cross section only dependent on energy\\
-> 1d functional\\
- can be easily extended, and own custom function without limitation\\
- predefined functions from literature\\
- selectable by user\\
-> useful for tests of implementation, but also different models\\
- types of interaction:\\
- elastic scattering\\
- clustering\\
- recombination\\
- free movement\\
- charge exchange\\
- excitation\\
- ionization\\
- all types applicable to electrons but also ions (no restrictions)\\
- elastic scattering\\
- cross section, target, and scattering angle\\
- roll interaction partner\\
- transformation to laboratory frame -> energy\\
- rotation of vector along scattering angle (energy), 2 pi in cm frame\\
- clustering\\
- cross section, target, product\\
- get velocity of target\\
- calculate energy of target\\
- use same direction, but scale velocity to mass of product\\
- get new particle at same position, but with new velocity\\
- recombination\\
- only delete particle, and count deletion in density field (see sec ...)\\
- free movement\\
- do nothing (but necessary, if no other interaction given -> very large mfp provided)\\
- cross section at numerical limits\\
- charge exchange\\
- cross section and target\\
- no product, because product is same specie as particle\\
- only determine velocity of target (from distribution of specie)\\
- use velocity of target for new particle\\
- excitation\\
- cross section, target, excitation energy\\
- determine vel dir of particle\\
- reduce energy by excitation energy\\
- simple but effective\\
- no scattering angle etc.\\
- ionization\\
- cross section, target, (new) electron, new(ion), ionization energy distribution, angle distribution\\
- roll target particle\\
- transform into laboratory frame\\
- energy could be below ionization energy\\
- roll new target particle until energy above ionization\\
- could take long time, but cross section decreases significantly before ionization energy\\
- roll new impact energy from distribution\\
- ejected particle (electron) energy rel to total energy and ionization energy\\
- ejected vel from angle distribution (rotation)\\
- backtransformation of lab frame\\
- ejected ion uses target velocity\\
-ignores recoil, but large mass difference\\
- might be different for ion ionization (but not used in code)\\
\subsection{Cross sections}
\label{ssec:cross_sections}
- dunno what here? \\
\subsection{Calculation of fields}
\label{ssec:field_calculation}
- density fields for each specie as its own class\\
- time spend in bin, deletions, density as calculated in eq (above) in 4d arrays\\
- fast axis: 3 (energy), easy to evaluate density at position (mfp)\\
- next axis: 2 (z), longitudinal problem\\
- next axis: 1 (phi), magnetron drift\\
- last: radial: most likely slowest movement change\\
- updated after movement (only in bin)\\
- size of array predefined, with overflow\\
- for debugging\\
- own Binning and energy Binning\\
- can be different for each specie -> resolution of important effects\\
- needs simulation timer\\
- from number of injections\\
- easy and fast to evaluate\\
- during simulation for mfp calculation\\
- similar with current collection\\
- positive and negative crossings (not energy resolved) -> 3d array\\
- but for radial, longitudinal, azimuthal\\
- size dependable on density field resolution\\
- not specific for calculation, but easy in mover (end of movement)\\
- needs also simulation timer\\
\subsection{Injection}
\label{ssec:injection}
- used for initial particles in simulation\\
- from given energy and angular distribution\\
- position distribution\\
- eg. beta particles:\\
- isotropic\\
- fermi distribution\\
- eg. T2+\\
- isotropic\\
- thermal distribution\\
- but also directed\\
- for test purposes\\
- electron gun\\
- currently many particles created at same position (particle decay) -> same time passed\\
- extension possible through multiple injections at same time, but relative factor of activity\\
\subsection{Initialization}
\label{ssec:initialization}
- from json file\\
- each class uses own generator from input\\
- easy to test\\
- easy to modify\\
- extensible\\
- composite classes\\
- call corresponding generator\\
- all constructed in simulation class constructer\\
- scalar field for density\\
- different types\\
- vector field for drift velocity, E/B-field\\
- different types\\
\subsection{Particle queue}
\label{ssec:particle_queue}
nothing special here, so maybe out\\
- particles are added one after the other\\
- could have been done all at once\\
- but paritcles can interact with each other\\
- thus primary particles would be less likely to interact with secondary paritcles -> one after the other\\
\subsection{Output}
\label{ssec:output}
- simulation subdivided into cycles\\
- each cycle performs simulation loop\\
- followed by cpu sync and output\\
- output to hdf5 file\\
- extendable\\
- ordered\\
- selectable output for Density fields, current borders and deletion logger\\
- for each entry\\
- which specie (reduce output time)\\
- output interval (after how many cycles, reduce output time)\\
- overwrite\\
- entry for each output process, or one overwriting\\
- debugging\\
- save space\\
\subsection{Parallelization}
\label{ssec:parallelization}
- Monte carlo method based on high statistics\\
- simple parallelization scheme\\
- devide number of decays evenly per cpu\\
- each cpu works on these decays\\
- cpu sync after simulation cycle (see output)\\
- sync currents borders, fields and deletion loggers\\
- simple additive operation for all (see eq.. ), Allreduce\\
- same load for all cpus\\
- also passed time additive\\
- might have different loads for cpus, because of creation of new particles (ionization)\\
- but with high enough decays in cycle balances out\\
- no need for directing cpu\\
- in principle extendable to as many cpus as needed for statistics\\
- only bound by rec effects if too few decays per cycle\\
- otherwise no limitations\\
- scaling graph?\\
- simulation time per decay vs cpu number\\
- sim with cpu * n decyas\\
\section{Physical processes}
\label{sec:physics}
\section{Test cases}
\label{sec:test}
\section{Results}
\label{sec:results}
\appendix
\section{Parameter file}
\section{Acknowledgments}
%
%
%MPI 1.1 support was provided by the Open MPI implementation under the BSD-new
%license.
Design and implementation of the MPI standard by OpenMPI is described in.
%\cite{Gabriel_2004}.
%
This work is based upon research supported by the National Research Foundation
and Department of Science and Technology. Any opinion, findings and conclusions
or recommendations expressed in this material are those of the authors and
therefore the NRF and DST do not accept any liability in regard thereto.
%% References with bibTeX database:
\section{References}
\bibliographystyle{elsarticle-num}
\bibliography{paper}
\end{document}