Merged function containers. Added HDF5 output and reworked Logger class into Base class and 2 derived classes ASCI_Logger and H5_Logger
81 lines
2.4 KiB
C++
81 lines
2.4 KiB
C++
//
|
|
// katrin.hpp
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 20.09.18.
|
|
// Copyright © 2018 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef katrin_hpp
|
|
#define katrin_hpp
|
|
|
|
#include "constants.hpp"
|
|
#include "logger.hpp"
|
|
#include "electron.hpp"
|
|
|
|
#include "blitz/tinyvec2.h"
|
|
#include "blitz/array.h"
|
|
#include <random/uniform.h>
|
|
#include <random/normal.h>
|
|
|
|
|
|
class Katrin {
|
|
public:
|
|
Katrin() {};
|
|
|
|
// Katrin Properties
|
|
public:
|
|
vec3 getMagField_T(vec3 loc_m);
|
|
vec3 getElField_Vm(vec3 loc_m);
|
|
double getTritiumDensity_m3(vec3 loc_m);
|
|
|
|
vec3 getTotSpeedT2_ms(vec3 loc_m, ranlib::Uniform<double> *rngUni, ranlib::NormalUnit<double> *rngNormal);
|
|
vec3 getFlowSpeedT2_ms(vec3 loc_m);
|
|
vec3 getTempSpeedT2_ms(vec3 loc_m, ranlib::Uniform<double> *rngUni, ranlib::NormalUnit<double> *rngNormal);
|
|
private:
|
|
static const double wgtsMagField_T;
|
|
static const double wgtsLength_m;
|
|
static const double wgtsRadius_m;
|
|
static const double wgtsT2MaxDensity_m3;
|
|
static const double wgtsTemp_K;
|
|
static const double wgtsT2FlowSpeed_ms;
|
|
|
|
// Electron Injection
|
|
public:
|
|
Electron injectElectron(int newId, ranlib::Uniform<double> *rngUni, ranlib::NormalUnit<double> *rngNormal);
|
|
private:
|
|
double roll_FermiEnergy_eV(ranlib::Uniform<double> *rngUni);
|
|
double get_FermiDecaySpectrumDensity(double Ekin_eV);
|
|
double get_FermiFunction(double Z, double Ekin_eV);
|
|
|
|
static const int injectionMethod;
|
|
static const double injectionEnergy_eV;
|
|
|
|
// Move Electrons
|
|
public:
|
|
double get_MFP_m(Electron *moveElectron);
|
|
void do_BorisPushMovement(Electron *moveElectron, double distance_m, H5_Logger *Log);
|
|
void do_DriftApproximationMovement(Electron *moveElectron, double distance_m, H5_Logger *Log);
|
|
private:
|
|
double getDrift_znew_m(double MFP_m, Electron *moveElectron);
|
|
void doDrift_WallInteraction(vec3 *oldLoc_m, double *znew_m, Electron *moveElectron, H5_Logger *Log);
|
|
void doBoris_WallInteraction(Electron *moveElectron);
|
|
void doBoris_LogzDirChange(Electron *moveElectron, double *oldzDir, vec3 *oldLoc_m, H5_Logger *Log);
|
|
|
|
static const double dt_s;
|
|
|
|
|
|
// Terminate Electrons
|
|
public:
|
|
bool check_Termination(Electron checkElectron);
|
|
private:
|
|
bool check_EnergyTermination(double Ekin_eV);
|
|
bool check_EnergyTermination(Electron checkElectron);
|
|
bool check_WallTermination(vec3 loc_m);
|
|
bool check_WallTermination(Electron checkElectron);
|
|
|
|
static const double cutoffEnergy_eV;
|
|
};
|
|
|
|
#endif /* katrin_hpp */
|