Dipole Electron terminilization

Added Electron Dipole terminilization. New Parameter: dipole_cutoffE_eV
This commit is contained in:
Christian
2019-09-24 10:34:44 +02:00
parent 7994e979de
commit dbb97eff7d
11 changed files with 31 additions and 12 deletions
+12 -3
View File
@@ -13,21 +13,30 @@
class Negative_Terminator : public Terminator_Base {
double dipole_cutoffE_eV;
public:
Negative_Terminator(species this_species, long int max_interactions, double cut_off_energy_eV) : Terminator_Base(this_species, max_interactions, cut_off_energy_eV) {};
Negative_Terminator(species this_species, long int max_interactions, double cut_off_energy_eV, double dipole_cutoffE_eV) : Terminator_Base(this_species, max_interactions, cut_off_energy_eV) {
this->dipole_cutoffE_eV = dipole_cutoffE_eV;
};
private:
bool check_walls(const vec3 &loc_m);
bool check_walls(const Particle &movePart);
};
inline bool Negative_Terminator::check_walls(const vec3 &loc_m) {
inline bool Negative_Terminator::check_walls(const Particle &movePart) {
vec3 loc_m = movePart.get_x_m();
double E_eV = movePart.get_E_eV();
double z_m = calc_z_m(loc_m);
double r_m = calc_r_m(loc_m);
if (z_m <= z_RW_m) {
stats.n_rw += 1;
return true;
}
if (z_m >= z_WGTS_end_m && E_eV <= dipole_cutoffE_eV) {
stats.n_rw += 1;
return true;
}
if (r_m >= r_WGTS_m) {
stats.n_radial += 1;
return true;
+5
View File
@@ -15,6 +15,7 @@ const int Injector::injectionMethod = load_parameter("injectionMethod");
const double Injector::injectionEnergy_eV = load_parameter("injectionEnergy_eV");
Particle Injector::injectElectron (const int &newId) {
double r_m = r_WGTS_m*sqrt(rngUni->random());
double phi = rngUni->random()*2*pi;
@@ -43,6 +44,10 @@ Particle Injector::injectElectron (const int &newId) {
}
vec3 v_ms = roll_uniform_direction(rngUni) * calc_v_ms_from_E_eV(E_eV,me_eV);
return PartFac.create_e(loc_m, v_ms, newId, newId);
//double v_ms = calc_v_ms_from_E_eV(pow(rngUni->random(),1./3.), me_eV);
//double v_ms = -100;
//return PartFac.create_e(vec3(0,0,z_WGTS_end_m), vec3(0,0,-v_ms),newId, newId);
}
double Injector::roll_FermiEnergy_eV() {
+5 -1
View File
@@ -48,7 +48,11 @@ inline double calc_E_eV_from_v_ms(const double &v_ms, const double &m_eV) {
throw MyException(ss.str());
}
double gamma = calc_gamma_from_beta(beta);
return (gamma-1) * m_eV;
if (gamma == 1) {
return 0.5*beta*beta*m_eV;
} else {
return (gamma-1) * m_eV;
}
}
inline double calc_E_eV_from_v_ms(const vec3 &v_ms, const double &m_eV) {
+1
View File
@@ -31,6 +31,7 @@ public:
}
~MultiZ_Particle_Logger() {
delete[] zLogValues;
delete[] h5tb;
}
private:
void create(H5_File *h5_file, species this_species);
-1
View File
@@ -30,7 +30,6 @@ void Particle_Looper::do_loops(int target_decays) {
int number_decays = 0;
while ( (number_decays < target_decays) || (!particle_queue.empty()) ) {
if (particle_queue.empty()) {
pop_loggers.log();
particle_queue.push(injector.injectElectron(get_new_id()));
number_decays++;
local_decays++;
-1
View File
@@ -91,7 +91,6 @@ public:
Terminator_Manager *get_terminators() {
return &terminators;
}
};
+3 -2
View File
@@ -17,11 +17,12 @@ public:
PosNeu_Terminator(species this_species, long int max_interactions, double cut_off_energy_eV) : Terminator_Base(this_species, max_interactions, cut_off_energy_eV) {};
private:
bool check_walls(const vec3 &loc_m);
bool check_walls(const Particle &movePart);
};
inline bool PosNeu_Terminator::check_walls(const vec3 &loc_m) {
inline bool PosNeu_Terminator::check_walls(const Particle &movePart) {
vec3 loc_m = movePart.get_x_m();
double z_m = calc_z_m(loc_m);
double r_m = calc_r_m(loc_m);
if (z_m <= z_RW_m) {
-1
View File
@@ -39,7 +39,6 @@ inline vec3 roll_uniform_direction(ranlib::Uniform<double> *rngUni) {
}
inline double roll_MBEnergy(const double &Temp_K, const double &m_eV,ranlib::NormalUnit<double> *rngNormal) {
double C = kb_eVK*Temp_K/m_eV;
double beta = 0;
double sum = 0;
+2 -2
View File
@@ -75,14 +75,14 @@ private:
bool check_min_energy(const double &E_eV);
bool check_max_interactions(const long int &Id);
virtual bool check_walls(const vec3 &loc_m) = 0;
virtual bool check_walls(const Particle &movePart) = 0;
};
inline bool Terminator_Base::check_terminlization(const Particle &movePart) {
long int Id = movePart.get_Id();
count_total(Id);
return check_walls(movePart.get_x_m()) ||
return check_walls(movePart) ||
check_min_energy(movePart.get_E_eV()) ||
check_max_interactions(Id);
}
+2 -1
View File
@@ -14,12 +14,13 @@
#include "read_system.h"
const int Terminator_Builder::maxInteractions = load_parameter("maxInteractions");
const double Terminator_Builder::dipole_cutoffE_eV = load_parameter("dipole_cutoffE_eV");
const double Terminator_Builder::cutoffEnergy_eV = load_parameter("cutoffEnergy_eV");
Terminator_Manager Terminator_Builder::build() {
Terminator_Manager Terminator;
Terminator.add(new Negative_Terminator(electron, maxInteractions, cutoffEnergy_eV));
Terminator.add(new Negative_Terminator(electron, maxInteractions, cutoffEnergy_eV, dipole_cutoffE_eV));
//Terminator.add(new Neutral_Terminator(tritium, maxInteractions, cutoffEnergy_eV));
Terminator.add(new PosNeu_Terminator(tritiumI, maxInteractions, cutoffEnergy_eV));
Terminator.add(new PosNeu_Terminator(tritium2I, maxInteractions, cutoffEnergy_eV));
+1
View File
@@ -17,6 +17,7 @@ typedef Manager_Base<Terminator_Base> Terminator_Manager;
class Terminator_Builder {
static const int maxInteractions;
static const double dipole_cutoffE_eV;
static const double cutoffEnergy_eV;
public: