- Moved to array operations for main loops. - Changed to setting pointers to operator only once before loop. - Changed Population Containers - Added Recombination - Added Inelastic Scattering Kinematics - Reworked Elastic Scattering Cross Section - Reworked Elastic Scattering Kinematics - Reworked organisation of different particle species and corresponding operators
63 lines
1.9 KiB
C++
63 lines
1.9 KiB
C++
//
|
|
// thermal_katrin_base.h
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 27.05.19.
|
|
// Copyright © 2019 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef thermal_katrin_base_h
|
|
#define thermal_katrin_base_h
|
|
|
|
#include "thermal_base.h"
|
|
|
|
|
|
class Thermal_Katrin_Base : public Thermal_Base {
|
|
static const double wgtsTemp_K;
|
|
static const double wgtsT2FlowSpeed_ms;
|
|
|
|
double m_eV;
|
|
|
|
public:
|
|
Thermal_Katrin_Base(species this_species, Timer *timer, UniRNG *rngUni, NormalRNG *rngNormal, int num_z_bins, int num_r_bins, int num_phi_bins) : Thermal_Base(this_species, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins) {
|
|
m_eV = get_species_mass(this_species);
|
|
};
|
|
|
|
vec3 get_average_speed_ms(const vec3 &loc_m);
|
|
vec3 roll_speed_ms(const vec3 &loc_m);
|
|
private:
|
|
vec3 roll_thermSpeed_ms(const vec3 &loc_m);
|
|
};
|
|
|
|
|
|
const double Thermal_Katrin_Base::wgtsTemp_K = getParameter("wgtsTemp_K");
|
|
const double Thermal_Katrin_Base::wgtsT2FlowSpeed_ms = getParameter("wgtsT2FlowSpeed_ms");
|
|
|
|
inline vec3 Thermal_Katrin_Base::get_average_speed_ms(const vec3 &loc_m) {
|
|
if (Katrin_Geo::inWGTS(loc_m)) {
|
|
double z_wgtsHalf_m = Katrin_Geo::get_z_WGTSstart_m() + (Katrin_Geo::get_z_WGTSend_m() - Katrin_Geo::get_z_WGTSstart_m())/2;
|
|
double sign = (loc_m[2] < z_wgtsHalf_m) ? -1 : 1;
|
|
double zSpeed_ms = sign*wgtsT2FlowSpeed_ms;
|
|
return ( vec3(0,0,zSpeed_ms) );
|
|
} else {
|
|
return (vec3(0,0,0));
|
|
}
|
|
}
|
|
|
|
inline vec3 Thermal_Katrin_Base::roll_speed_ms(const vec3 &loc_m) {
|
|
Katrin_Geo::check_inKatrin(loc_m);
|
|
return (get_average_speed_ms(loc_m) + roll_thermSpeed_ms(loc_m));
|
|
}
|
|
|
|
|
|
inline vec3 Thermal_Katrin_Base::roll_thermSpeed_ms(const vec3 &loc_m) {
|
|
double E_eV = roll_MBEnergy(wgtsTemp_K, m_eV, rngNormal);
|
|
double abs_speed_ms = calc_Speed_from_Ekin_eV(E_eV, m_eV);
|
|
vec3 speed_ms = roll_uniform_direction(rngUni)*abs_speed_ms;
|
|
return(speed_ms);
|
|
}
|
|
|
|
|
|
|
|
#endif /* thermal_katrin_base_h */
|