Added buffer for HDF5 output.

Added E-Field container.
This commit is contained in:
Christian
2019-09-03 16:35:55 +02:00
parent 794bfb2b98
commit 1978039630
15 changed files with 1000185 additions and 69 deletions
@@ -49,8 +49,7 @@ Therefore $\upbeta$-electrons are injected by $\upbeta$-decay and then simulated
\section*{Simulation Algorithm}
\begin{figure}[tbp]
\centering
\includestandalone[width=0.8\textwidth]{single_core}% without .tex extension
% or use \input{mytikz}
\includestandalone[width=0.8\textwidth]{single_core}
\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}
@@ -90,9 +89,8 @@ Secondary particles have much lower energies and usually thermalize. Therefore t
\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.}
\includestandalone[width=0.8\textwidth]{parallel}
\caption{Flowchart of parallelization strategy.}
\label{fig:parallel}
\end{figure}
@@ -105,52 +103,4 @@ Averaging after fix number of $\upbeta$-decays can slow down the simulation if t
The IO-strategy is rather simple as output is written to HDF5 files per core and the files are merged in the postprocessing.
\begin{comment}
\newpage
\section*{Simulation Strategy}
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 next subsections.
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.
\subsection*{Parallelization strategy}
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.
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.
The IO-strategy is rather simple as output is written to HDF5 files per core and the files are merged in the postprocessing.
\subsection*{Single core strategy}
In order to properly process secondary particles a "particle queue" is implemented where particles are held.
If the "particle queue" is not empty the first particle of the queue is being processed.
During processing further new particles can be created. Details on the Single particle processing will be discussed in the subsequent subsection.
When the particle queue is empty new primary $\upbeta$-electrons are injecting using standard Monte Carlo simulation methods.
The location is sampled from the $\mathrm{T}_2$ density profile and the energy from the $\upbeta$-decay energy distribution.
The process of either processing the first particle or injecting a new $\upbeta$-electron is repeated until the target number of $\upbeta$-decays is met.
After processing each particle the particle densities are being logged to the outputfile for anayslis purposes.
\subsection*{Single particle processing}
Each particles is simulated until leaving the WGTS, disintegration through physical processes or when reaching thermal equilibrium with the tritium molecules.
Processing starts with propagation 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.
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.
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.
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.
\end{comment}
\end{document}