Updated Delta Injection to test Recombination and added T_INTER Parameter to control clustering
This commit is contained in:
@@ -46,26 +46,41 @@ inline int Injector::inject (std::vector<Particle> *particle_queue, const int &l
|
||||
switch(method) {
|
||||
case 0: // Fermi
|
||||
E_eV = roll_FermiEnergy_eV();
|
||||
vec3 v_ms = roll_uniform_direction(rngUni) * calc_v_ms_from_E_eV(E_eV,me_eV);
|
||||
particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
||||
break;
|
||||
case 1: //Delta
|
||||
E_eV = energy_eV;
|
||||
vec3 v_ms = roll_uniform_direction(rngUni) * calc_v_ms_from_E_eV(E_eV,me_eV);
|
||||
particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
||||
break;
|
||||
case 2: //Maxwell Boltzman
|
||||
E_eV = roll_MBEnergy(energy_eV/kb_eVK, me_eV, rngNormal);
|
||||
vec3 v_ms = roll_uniform_direction(rngUni) * calc_v_ms_from_E_eV(E_eV,me_eV);
|
||||
particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
||||
break;
|
||||
case 3: // Delta Injection for Recombination Testing
|
||||
loc_m = vec3(0,0,z_WGTS_end_m);
|
||||
E_eV = energy_eV;
|
||||
vec3 direction = vec3(0,0,-1);
|
||||
vec3 v_ms = direction * calc_v_ms_from_E_eV(E_eV, me_eV);
|
||||
particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
||||
break;
|
||||
default:
|
||||
throw MyException("Katrin::injectElectron: Invalid Injection Method.");
|
||||
break;
|
||||
}
|
||||
vec3 v_ms = roll_uniform_direction(rngUni) * calc_v_ms_from_E_eV(E_eV,me_eV);
|
||||
particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
||||
|
||||
//vec3 v_ms = roll_uniform_direction(rngUni) * calc_v_ms_from_E_eV(E_eV,me_eV);
|
||||
//particle_queue->push_back(PartFac.create_e(loc_m, v_ms, last_ID+1, last_ID+1));
|
||||
|
||||
if (ions == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ions == 2) { // 2: Ion Delta Injection
|
||||
vec3 vTI_ms = roll_uniform_direction(rngUni) * calc_v_ms_from_E_eV(E_eV, 2*mT_eV);
|
||||
if (ions == 2) { // 2: Delta Injection for Testing Recombination
|
||||
vec3 direction = vec3(0,0,-1);
|
||||
vec3 vTI_ms = direction * calc_v_ms_from_E_eV(E_eV, 2*mT_eV);
|
||||
particle_queue->push_back(PartFac.create_T2I(loc_m, vTI_ms, last_ID+2, last_ID+2));
|
||||
return 2;
|
||||
|
||||
|
||||
@@ -170,9 +170,15 @@ Interaction_Channel_Base* Interaction_Builder::build_tritium(Population_Manager
|
||||
Interaction_Channel_Base* Interaction_Builder::build_tritiumI(Population_Manager *Populations, UniRNG *rngUni) {
|
||||
Interaction_Channel_Base *TI_Interaction = new Interaction_Channel_Base(tritiumI, rngUni);
|
||||
Population_Base *T2Population = Populations->find(tritium2);
|
||||
TI_Interaction->add(new TIT2_Elastic(T2Population, rngUni));
|
||||
TI_Interaction->add (new TIT2_RadAsc(T2Population, rngUni));
|
||||
TI_Interaction->add (new TIT2_TerAsc(T2Population, rngUni));
|
||||
|
||||
if (load_parameter("T_INTER") == 1) {
|
||||
TI_Interaction->add(new TIT2_Elastic(T2Population, rngUni));
|
||||
TI_Interaction->add (new TIT2_RadAsc(T2Population, rngUni));
|
||||
TI_Interaction->add (new TIT2_TerAsc(T2Population, rngUni));
|
||||
} else if (load_parameter("T_INTER") != 0) {
|
||||
throw MyException ("T_INTER invalid.");
|
||||
}
|
||||
|
||||
return TI_Interaction;
|
||||
}
|
||||
|
||||
@@ -187,8 +193,12 @@ Interaction_Channel_Base* Interaction_Builder::build_tritium2I(Population_Manage
|
||||
throw MyException ("e_REC invalid.");
|
||||
}
|
||||
//T2I_Interaction->add(new T2Ie_DissExc(ePopulation, rngUni));
|
||||
if (load_parameter("T_INTER") == 1) {
|
||||
T2I_Interaction->add(new T2IT2_Cluster(T2Population, rngUni));
|
||||
T2I_Interaction->add(new T2IT2_CX(T2Population, rngUni));
|
||||
} else if (load_parameter("T_INTER") != 0) {
|
||||
throw MyException ("T_INTER invalid.");
|
||||
}
|
||||
return T2I_Interaction ;
|
||||
}
|
||||
|
||||
@@ -196,10 +206,13 @@ Interaction_Channel_Base* Interaction_Builder::build_tritium3I(Population_Manage
|
||||
Interaction_Channel_Base *T3I_Interaction = new Interaction_Channel_Base(tritium3I, rngUni);
|
||||
Population_Base *T2Population = Populations->find(tritium2);
|
||||
Population_Base *ePopulation = Populations->find(electron);
|
||||
if (load_parameter("T_INTER") == 1) {
|
||||
T3I_Interaction->add(new T3IT2_Elastic(T2Population, rngUni));
|
||||
T3I_Interaction->add(new T3IT2_RadAsc(T2Population, rngUni));
|
||||
T3I_Interaction->add(new T3IT2_TerAsc(T2Population, rngUni));
|
||||
|
||||
} else if (load_parameter("T_INTER") != 0) {
|
||||
throw MyException ("T_INTER invalid.");
|
||||
}
|
||||
if (load_parameter("e_REC") == 1) {
|
||||
T3I_Interaction->add(new T3Ie_Recombination(ePopulation, rngUni));
|
||||
} else if (load_parameter("e_REC") != 0) {
|
||||
@@ -214,8 +227,11 @@ Interaction_Channel_Base* Interaction_Builder::build_tritium5I(Population_Manage
|
||||
Interaction_Channel_Base *T5I_Interaction = new Interaction_Channel_Base(tritium5I, rngUni);
|
||||
Population_Base *T2Population = Populations->find(tritium2);
|
||||
Population_Base *ePopulation = Populations->find(electron);
|
||||
if (load_parameter("T_INTER") == 1) {
|
||||
T5I_Interaction->add(new T5IT2_Elastic(T2Population, rngUni));
|
||||
|
||||
} else if (load_parameter("T_INTER") != 0) {
|
||||
throw MyException ("T_INTER invalid.");
|
||||
}
|
||||
if (load_parameter("e_REC") == 1) {
|
||||
T5I_Interaction->add(new T5Ie_Recombination(ePopulation, rngUni));
|
||||
} else if (load_parameter("e_REC") != 0) {
|
||||
|
||||
@@ -42,13 +42,13 @@ Particle_Logger_Manager Particle_Logger_Builder::build(H5_File *h5f) {
|
||||
|
||||
zValues[0] = start_m;
|
||||
zValues[1] = mid_m;
|
||||
zValues[2] = end_m
|
||||
zValues[2] = end_m;
|
||||
|
||||
ParticleLogger->add(new MultiZ_Particle_Logger(electron, h5f, numberZBins, zValues));
|
||||
ParticleLogger->add(new MultiZ_Particle_Logger(tritiumI, h5f, numberZBins, zValues));
|
||||
ParticleLogger->add(new MultiZ_Particle_Logger(tritium2I, h5f, numberZBins, zValues));
|
||||
ParticleLogger->add(new MultiZ_Particle_Logger(tritium3I, h5f, numberZBins, zValues));
|
||||
ParticleLogger->add(new MultiZ_Particle_Logger(tritium5I, h5f, numberZBins, zValues));
|
||||
ParticleLogger.add(new MultiZ_Particle_Logger(electron, h5f, numberZBins, zValues));
|
||||
ParticleLogger.add(new MultiZ_Particle_Logger(tritiumI, h5f, numberZBins, zValues));
|
||||
ParticleLogger.add(new MultiZ_Particle_Logger(tritium2I, h5f, numberZBins, zValues));
|
||||
ParticleLogger.add(new MultiZ_Particle_Logger(tritium3I, h5f, numberZBins, zValues));
|
||||
ParticleLogger.add(new MultiZ_Particle_Logger(tritium5I, h5f, numberZBins, zValues));
|
||||
|
||||
delete[] zValues;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user