Updated hpc_antrag.

This commit is contained in:
Christian
2019-08-27 14:05:55 +02:00
parent f50eea7707
commit 794bfb2b98
3 changed files with 154 additions and 22 deletions
@@ -1,4 +1,5 @@
\documentclass[10pt,a4paper,final]{article}
\documentclass[11pt,a4paper,final]{article}
\usepackage[margin=3cm]{geometry}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
@@ -16,7 +17,7 @@
\title{Monte Carlo simulation of electron energy distribution for the KATRIN experiment}
\author{Christian Reiling}
\date{26. August 2019}
\setlength{\droptitle}{-10em}
\setlength{\droptitle}{-3cm}
\begin{document}
\maketitle
@@ -26,44 +27,78 @@ Previous simulation already showed the need of examining these effects qualitati
This next generation Monte Carlo simulation examines these effect with higher statistics and spatial resolution.
\end{abstract}
\section*{Intention}
The KATRIN - KArlsruhe TRItium Neutrino collaboration was founded to determine the electron neutrino mass using single $\upbeta$-decay with a sensibility of \SI{0.2}{\eV}.
In 2015 the experimental setup of the KATRIN was completed and the data taking started in 2018.
For the final result data will be gathered for 5 years.
Beside high statistic a good understanding of systematics is essential.
The Windowless Gaseous Tritium Source (WGTS) holds the molecular tritium $\mathrm{T}_2$ gas and has an activity of \SI{{}e11}{\becquerel}.
The $\upbeta$-decays create high energetic $\upbeta$-electrons which are measured by the experimental setup to determine the electron neutrino mass.
As primary $\upbeta$-electrons pass the WGTS they ionize neutral tritium molecules and create secondary electron and positive ions. These secondary electrons themselves can then ionize further ions if their energy is sufficient. The number of electrons created by one $\upbeta$-electron (including ionizations from secondary electrons) is $\mathcal{O}(10^1)$ - $\mathcal{O}(10^2)$.
The WGTS has a strong magnetic field to guide the $\upbeta$-electrons through the setup.
These magnetic field also limit the movement of low energetic electrons and positive ions strongly and result in a rather high duration of stay within the WGTS.
As the number of charged particles in the WGTS is high, plasma effects have to be examined precisely.
Electrical fields cause by the plasma can accelerate or decelerate the $\upbeta$-electrons and therefore distort the measurement.
A key parameter for understanding and simulating the plasma is the composition of particles in the WGTS both in energy and location.
The aim of this Monte Carlo simulation is to obtain the electron energy distribution with high statistics and spatial resolution.
Therefore $\upbeta$-electrons are injected by $\upbeta$-decay and then simulated using all relevant physical process including those creating secondary particles which are also simulated within the simulation.
\section*{Simulation Algorithm}
\begin{figure}[tb]
\includestandalone[width=\textwidth]{single_core}% without .tex extension
\begin{figure}[tbp]
\centering
\includestandalone[width=0.8\textwidth]{single_core}% without .tex extension
% or use \input{mytikz}
\caption{Flowchart of the Simulation Algorithm. Parallelization Strategy is not represented in this chart.}
\caption{Flowchart of the Simulation Algorithm. The left part of the chart shows the processing of the current particle (CP).}
\label{fig:flowchart}
\end{figure}
The Windowless Gaseous Tritium Source (WGTS) of the KATRIN experiment is implemented as \SI{16}{\meter} long tube with \SI{90}{\milli \meter} diameter. The molecular tritium $\mathrm{T}_2$ density profile and velocity distribution are implemented as constants in time as variations are neglible. For each relevant particle species a numeric density field is implemented for which the WGTS is sliced into cells.
The initial densities are set to zero and calulated within the simulation as discussed in the subsequent paragraphs.
The Windowless Gaseous Tritium Source (WGTS) of the KATRIN experiment is implemented as \SI{16}{\meter} long tube with \SI{90}{\milli \meter} diameter. The molecular tritium $\mathrm{T}_2$ density profile and velocity distribution are implemented as constants in time as variations are negligible. For each relevant particle species a numeric density field is implemented for which the WGTS is sliced into cells.
The initial densities are set to zero and calculated within the simulation as discussed in the subsequent paragraphs.
The final electron energy distribution can be extracted from the density field at the end of the simulation. For more precise resolution "logging barriers" are implemented where passing electrons are logged with their exact energy. These passing electron can be calculated to a high precision electron energy distrubtion.
The final electron energy distribution can be extracted from the density field at the end of the simulation. For more precise resolution "logging barriers" are implemented where passing electrons are logged with their exact energy. These passing electron can be calculated to a high precision electron energy distribution.
The simulation algorithm is displayed in Figure \ref{fig:flowchart}.
Particles are injected into the simulation by $\upbeta$-decay and by subsequent physical processes creating secondary particles.
$\upbeta$-electrons are injected using standard Monte Carlo simulation methods sampling location from the $\mathrm{T}_2$ density profile and the energy from the $\upbeta$-decay energy distribution.
$\upbeta$-electrons are injected using standard Monte Carlo simulation methods.
Secondary particles are created within the simulation and appended to the "particle queue". New $\upbeta$-electrons are only injected once all particles in the "particle queue" are processed and until the target number of decays is met.
Particle simulation is done by iterating propagation and interaction until a terminalization condition is met.
The terminalization conditions for the particles are leaving the WGTS and reaching thermal equilibrium with $\mathrm{T}_2$. Particles can also be terminalized by physical processes though various loss channels.
Physical simulation of the particle is done by iteration of propagation and interaction until a termination condition is met.
Particles are terminated if they leave the WGTS or when reaching thermal equilibrium with $\mathrm{T}_2$. Particles can also be terminated by physical processes though various loss channels.
The iteration is displayed on the right side of Figure \ref{fig:flowchart} labeled as "CP processing".
Propagation is done by movement by one free mean path length (MFP).
The MFP is calculated from the interaction probabilty with relevant interaction partners at the inital position. The particle is then moved using Drift Approximation or Boris Push depending on user preference. Drift Approximation is more cost efficient but does not resolve the electric and magnetic fields as good as Boris Push.
Particles are propagated by one free mean path length (MFP).
The MFP is calculated from the interaction probability with relevant interaction partners at the initial position. The particle is then moved using Drift Approximation or Boris Push depending on user preference. Drift Approximation is more cost efficient but does not resolve the electric and magnetic fields as good as Boris Push.
During propagation the numeric density field is updated.
For electrons it is checked whether a "logging barrier" is crossed and if so the electron's properties are being logged to the output file.
After propagation the particle interacts.
After propagation the particle interacts if no wall was hit during propagation.
Therefore interaction partner and process is rolled at the final position.
The rolled interaction is then performed using standard Monte Carlo methods and changing the properties of the initial particle.
Particles created by the interaction are appended to the "particle queue" and if interaction partners are annhilated the corresponding density field is being updated.
If the current particle is not annhilated in the process or another terminalization condition is met the particle reruns the loop of moving and interacting again and so forth.
The rolled interaction is then performed using standard Monte Carlo methods leading to a change of the particle's properties.
New particles created by the interaction are appended to the "particle queue".
If interaction partners are disintegrated during the interaction the corresponding density field is being updated.
For loss channel reactions the current particle is terminated.
Else other termination conditions are checked.
If the particle is not terminated it reruns the loop of moving and interacting again and so forth.
Primary $\upbeta$-electrons usually loop $\mathcal{O}(10^2)$ times though the loop.
Secondary particles have much lower energies and usually thermalize. Therefore they loop $\mathcal{O}(10^6)$ times.
\section*{Parallelization Strategy}
\begin{figure}[tb]
\centering
\includestandalone[width=0.8\textwidth]{parallel}% without .tex extension
% or use \input{mytikz}
\caption{Flowchart of the Parallelization strategy.}
\label{fig:parallel}
\end{figure}
The current parallelization strategy is displayed in Figure \ref{fig:parallel}.
Plain Monte Carlo simulations can be operated without communicating between the cores by combining the output in the postprocessing.
For this simulation it is important to synchronize the density fields across all cores. Therefore the density fields are averaged over all cores using standard MPI\_ALLGATHER average operations after a given number of $\upbeta$-decays.
For this simulation it is important to synchronize the density fields across all cores. Therefore the density fields are averaged over all cores using standard MPI\_ALLGATHER average operations after a given number of $\upbeta$-decays.
As scaling effects are still being investigated a shift to a more efficient strategy might be required.
Averaging after fix number of $\upbeta$-decays can slow down the simulation if the duration on the cores varies largly. A sufficient strategy can be averaging after fixed simulation time.
@@ -0,0 +1,93 @@
% http://www.texample.net/tikz/examples/flexible-flow-chart/
\documentclass{standalone}
\usepackage{tikz}
\usepackage{upgreek}
\usetikzlibrary{shapes,arrows,chains}
\begin{document}
% -------------------------------------------------
% Color definition
\definecolor{myblue}{HTML}{2B86C0}
\definecolor{myred}{HTML}{C14400}
\definecolor{myyellow}{HTML}{FFD700}
\definecolor{mygreen}{HTML}{3F681C}
%https://www.schemecolor.com/cute-lights.php
\definecolor{startstopcolor}{HTML}{FF555E}
\definecolor{testcolor}{HTML}{FFE981}
\definecolor{proccolor}{HTML}{83B2FF}
% -------------------------------------------------
% Debugging Layer
% top
\pgfdeclarelayer{marx}
\pgfsetlayers{main,marx}
% A macro for marking coordinates (specific to the coordinate naming
% scheme used here). Swap the following 2 definitions to deactivate
% marks.
\providecommand{\cmark}[2][]{\relax}
\providecommand{\cmark}[2][]{%
\begin{pgfonlayer}{marx}
\node [nmark] at (c#2#1) {#2};
\end{pgfonlayer}{marx}
}
% -------------------------------------------------
% Start the picture
\begin{tikzpicture}[%
>=triangle 60, % Nice arrows; your taste may be different
start chain=going below, % General flow is top-to-bottom
node distance=6mm and 60mm, % Global setup of box spacing
every join/.style={arrow}, % Default linetype for connecting boxes
]
% -------------------------------------------------
% Box styles
\tikzset{
base/.style={draw, on chain, on grid, align=center, minimum height=4ex, font=\sffamily, draw=none},
proc/.style={base, rectangle, text width=10em, fill=proccolor},
test/.style={base, diamond, aspect=3, text width=5em, fill=testcolor},
startstop/.style={proc, minimum height=6ex, fill=startstopcolor},
%base/.style={draw, on chain, on grid, align=center, minimum height=4ex, font=\sffamily},
%proc/.style={base, rectangle, text width=10em},
%test/.style={base, diamond, aspect=3, text width=5em},
%startstop/.style={proc, minimum height=6ex},
% Debug styles
coord/.style={coordinate, on chain, on grid, node distance=6mm and 25mm},
nmark/.style={draw, cyan, circle, font={\sffamily}},
% Line styles
arrow/.style={->, draw, black},
slabel/.style={near start, xshift=1em, font=\sffamily},
welabel/.style={near start, yshift=-0.8em, font=\sffamily},
}
% -------------------------------------------------
% Nodes
\node [startstop] (start) {Start of Processing};
\node [test, join] (test) {$n_\mathrm{left} \leq n_\mathrm{step} \cdot n_\mathrm{cores}$ };
\node [proc] (sim) {Run simulation of $n_\mathrm{step}$ on each core};
\node [proc, join] (avg) {Average densities among all cores};
\node [proc, right=of sim, xshift=-3em] (split) {Split up $n_\mathrm{left}$ among cores and simulate};
\node [startstop, join] (end) {End of Processing};
% -------------------------------------------------
% Coordinate markers
\node [coord, below=of avg, yshift=-0.5em] (c0) {}; \cmark{0}
\node [coord, left=of test, xshift=-1.5em] (c1) {}; \cmark{1}
\node [coord, right=of test] (c2) {}; \cmark{2}
% -------------------------------------------------
% North south connectors
\path (test.south) to node [slabel] {no} (sim);
\draw [arrow] (test.south) -- (sim);
% % -------------------------------------------------
% % Complicated connectors
\draw [arrow] (avg.south) -- (c0) -| (c1) -- (test.west);
\draw [arrow] (test.east) -| (split.north);
\path (test.east) to node [welabel] {yes} (c2);
\node [anchor=west] at (3, 0.2) {$n_\mathrm{left}$: Number $\upbeta$-decays left to target.};
\node [anchor=west] at (3, -0.2) {$n_\mathrm{step}$: Number $\upbeta$-decay before averaging};
\node [anchor=west] at (3, -0.6) {$n_\mathrm{cores}$: Number of cores used.};
\end{tikzpicture}
\end{document}
@@ -74,7 +74,7 @@ $\rightarrow$ Log to file };
\node [proc] (interaction) {Do Interaction \\
$\rightarrow$ Update densities \\
$\rightarrow$ Update queue };
\node [test, join] (disint) {Disintegration?};
\node [test, join] (disint) {Loss Channel?};
% -------------------------------------------------
% Coordinate markers
\node [coord, right=of extract] (c0) {}; \cmark{0}
@@ -82,13 +82,12 @@ $\rightarrow$ Update queue };
\node [coord, left=of empty] (c2) {}; \cmark{2}
\node [coord, left=of target, xshift = -2.5em] (c3) {}; \cmark{3}
\node [coord, left=of terminate] (c4) {}; \cmark{4}
\node [coord, left=of wall] (c5) {}; \cmark{5}
\node [coord, left=of wall, xshift=-0.5em] (c5) {}; \cmark{5}
\node [coord, left=of disint] (c6) {}; \cmark{6}
\node [coord, right=of empty] (c7) {}; \cmark{7}
\node [coord, right=of disint] (c8) {}; \cmark{8}
\node [coord, right=of disint, xshift=0.5em] (c8) {}; \cmark{8}
% -------------------------------------------------
% Annotations
%\node [above=0mm of p4, it] {(Queue was empty)};
@@ -122,5 +121,10 @@ $\rightarrow$ Update queue };
\path (disint.east) to node [welabel] {no} (c8);
\draw [arrow] (disint.east) -- (c8) |- (terminate.east);
% Box
\draw[dotted] (3,1.2) rectangle (9,-9.5);
\node at (6,1.4) {CP processing};
\node [anchor=west] at (-3.5, 1.4) {PQ: particle queue};
\node [anchor=west] at (-3.5, 1) {CP: current particle};
\end{tikzpicture}
\end{document}