Added some recombination and cluster formation channels.
Changed Parameter names to be more consistent.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
class T2IT2_Cluster : public Sub_Interaction_Base {
|
||||
public:
|
||||
T2IT2_Cluster(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {}
|
||||
double get_microSigma_m2(const double &E_eV) {return Janev_T2IT2_Cluster::get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return Janev_T2IT2_Cluster::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class T2IT2_CX : public Sub_Interaction_Base {
|
||||
Elastic_Kinematic_Base kinematics;
|
||||
public:
|
||||
T2IT2_CX(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni), kinematics(2*mT_eV, 2*mT_eV) {}
|
||||
double get_microSigma_m2(const double &E_eV) {return Janev_T2IT2_CX::get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return Janev_T2IT2_CX::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class T2Ie_DissExc : public Sub_Interaction_Base {
|
||||
public:
|
||||
T2Ie_DissExc(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return Janev_eT2I_DissExc::get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return Janev_eT2I_DissExc::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@ class T2Ie_Recombination : public Sub_Interaction_Base {
|
||||
public:
|
||||
T2Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return Janev_eT2I_Recombination::get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return Janev_eT2I_Recombination::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
inline InteractionOut T2Ie_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), 2*mT_eV); // should be computed properly using chances.
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
||||
|
||||
// Maybe add the 2 T atoms.
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
//
|
||||
// T3IT2_cluster.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 16.09.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef T3IT2_cluster_h
|
||||
#define T3IT2_cluster_h
|
||||
|
||||
#include "sub_interaction_base.h"
|
||||
|
||||
// From Duley:1996aa: Molecular clusters in interstellar clouds
|
||||
|
||||
class T3IT2_Cluster : public Sub_Interaction_Base {
|
||||
|
||||
public:
|
||||
T3IT2_Cluster(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {};
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double v_ms = calc_v_ms_from_E_eV(E_eV, 3*mT_eV);
|
||||
return 1e-10/v_ms;
|
||||
}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
inline InteractionOut T3IT2_Cluster::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
vec3 vLab_ms = interPart->get_v_ms() - v2_ms;
|
||||
//vec3 v1_ms = roll_uniform_direction(rngUni) * calc_vec3_abs(vLab_ms) + v2_ms;
|
||||
//Particle TNew = Particle_Builder::create_T(loc_m, v1_ms, -1, interPart->get_Id());
|
||||
Particle T5New = Particle_Builder::create_T5I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
|
||||
//InterOut.add_new_particle(TNew);
|
||||
InterOut.add_new_particle(T5New);
|
||||
InterOut.set_delete_current(true);
|
||||
return InterOut;
|
||||
}
|
||||
|
||||
#endif /* T3IT2_cluster_h */
|
||||
@@ -20,7 +20,7 @@ class T3IT2_Elastic : public Sub_Interaction_Base {
|
||||
public:
|
||||
T3IT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni), kinematics(3*mT_eV, 2*mT_eV) {};
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return tcs_gen.get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return tcs_gen.get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// T3IT2_radasc.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 08.10.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef T3IT2_radasc_h
|
||||
#define T3IT2_radasc_h
|
||||
|
||||
#include "sub_interaction_base.h"
|
||||
// CS from Gerlich:
|
||||
|
||||
class T3IT2_RadAsc : public Sub_Interaction_Base {
|
||||
|
||||
public:
|
||||
T3IT2_RadAsc(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {};
|
||||
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
double v_ms = calc_v_ms_from_E_eV(E_eV, 3*mT_eV);
|
||||
return 5e-23/v_ms;
|
||||
}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
inline InteractionOut T3IT2_RadAsc::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
Particle T5INew = Particle_Builder::create_T5I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
|
||||
InterOut.add_new_particle(T5INew);
|
||||
InterOut.set_delete_current(true);
|
||||
return InterOut;
|
||||
}
|
||||
|
||||
#endif /* T3IT2_radasc_h */
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// T3IT2_terasc.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 08.10.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef T3IT2_terasc_h
|
||||
#define T3IT2_terasc_h
|
||||
|
||||
#include "sub_interaction_base.h"
|
||||
// CS from Gerlich:
|
||||
|
||||
class T3IT2_TerAsc : public Sub_Interaction_Base {
|
||||
|
||||
public:
|
||||
T3IT2_TerAsc(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {};
|
||||
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
double v_ms = calc_v_ms_from_E_eV(E_eV, 3*mT_eV);
|
||||
return 7e-41*Population->get_density_m3(loc_m)/v_ms;
|
||||
}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
inline InteractionOut T3IT2_TerAsc::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
Particle T5INew = Particle_Builder::create_T5I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
|
||||
InterOut.add_new_particle(T5INew);
|
||||
InterOut.set_delete_current(true);
|
||||
return InterOut;
|
||||
}
|
||||
|
||||
#endif /* T3IT2_terasc_h */
|
||||
@@ -16,7 +16,7 @@ class T3Ie_DissExc : public Sub_Interaction_Base {
|
||||
public:
|
||||
T3Ie_DissExc(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return Janev_eT3I_DissExc::get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return Janev_eT3I_DissExc::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class T3Ie_Recombination : public Sub_Interaction_Base {
|
||||
public:
|
||||
T3Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return Janev_eT3I_Recombination::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
inline InteractionOut T3Ie_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), 3*mT_eV); // should be computed properly using chances.
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
||||
|
||||
// Maybe add the 3 T atoms.
|
||||
|
||||
@@ -17,7 +17,7 @@ class T5IT2_Elastic : public Sub_Interaction_Base {
|
||||
public:
|
||||
T5IT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni), kinematics(5*mT_eV, 2*mT_eV) {};
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return tcs_gen.get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return tcs_gen.get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
//
|
||||
// T5Ie_annhilation.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 16.09.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef T5Ie_annhilation_h
|
||||
#define T5Ie_annhilation_h
|
||||
|
||||
|
||||
#include "sub_interaction_base.h"
|
||||
|
||||
// From Duley:1996aa: Molecular clusters in interstellar clouds
|
||||
class T5Ie_Annhilation : public Sub_Interaction_Base {
|
||||
public:
|
||||
T5Ie_Annhilation(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double v_ms = calc_v_ms_from_E_eV(E_eV, 5*mT_eV);
|
||||
return 1e-4/v_ms;
|
||||
}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
inline InteractionOut T5Ie_Annhilation::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), 2*mT_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
||||
|
||||
// Maybe add the 5 T atoms.
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
#endif /* T5Ie_annhilation_h */
|
||||
@@ -12,14 +12,14 @@
|
||||
|
||||
#include "sub_interaction_base.h"
|
||||
|
||||
#include "petterson_eT5I_recombination.h"
|
||||
|
||||
// From Ference = Macdonald:1984aa
|
||||
class T5Ie_Recombination : public Sub_Interaction_Base {
|
||||
public:
|
||||
T5Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
return 1.8e-19/E_eV;
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return Pettersson_eT5I_Recombination::get_TCS(E_eV);
|
||||
}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
inline InteractionOut T5Ie_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), 2*mT_eV); // should be computed properly using chances.
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
||||
|
||||
// Maybe add the 5 T atoms.
|
||||
|
||||
@@ -21,7 +21,7 @@ class TIT2_Elastic : public Sub_Interaction_Base {
|
||||
public:
|
||||
TIT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni), kinematics(mT_eV, 2*mT_eV) {};
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return tcs_gen.get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return tcs_gen.get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// TIT2_radasc.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 08.10.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef TIT2_radasc_h
|
||||
#define TIT2_radasc_h
|
||||
|
||||
#include "sub_interaction_base.h"
|
||||
// CS from Plasil:2012
|
||||
|
||||
class TIT2_RadAsc : public Sub_Interaction_Base {
|
||||
|
||||
public:
|
||||
TIT2_RadAsc(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {};
|
||||
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
double v_ms = calc_v_ms_from_E_eV(E_eV, mT_eV);
|
||||
return 5e-23/v_ms;
|
||||
}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
inline InteractionOut TIT2_RadAsc::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
Particle T3INew = Particle_Builder::create_T3I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
|
||||
InterOut.add_new_particle(T3INew);
|
||||
InterOut.set_delete_current(true);
|
||||
return InterOut;
|
||||
}
|
||||
|
||||
|
||||
#endif /* TIT2_radasc_h */
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// TIT2_terasc.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 08.10.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef TIT2_terasc_h
|
||||
#define TIT2_terasc_h
|
||||
|
||||
#include "sub_interaction_base.h"
|
||||
// CS from Plasil:2012
|
||||
|
||||
class TIT2_TerAsc : public Sub_Interaction_Base {
|
||||
|
||||
public:
|
||||
TIT2_TerAsc(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {};
|
||||
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
double v_ms = calc_v_ms_from_E_eV(E_eV, mT_eV);
|
||||
return 2.6e-41*Population->get_density_m3(loc_m)/v_ms;
|
||||
}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
inline InteractionOut TIT2_TerAsc::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
Particle T3INew = Particle_Builder::create_T3I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
|
||||
InterOut.add_new_particle(T3INew);
|
||||
InterOut.set_delete_current(true);
|
||||
return InterOut;
|
||||
}
|
||||
|
||||
#endif /* TIT2_terasc_h */
|
||||
@@ -18,7 +18,7 @@ using namespace std;
|
||||
|
||||
|
||||
// Redundant Code with h5, but ASCI Logger is kept in code as relict.
|
||||
const int ASCI_Logger::numberZBins = load_parameter("numberZBins");
|
||||
const int ASCI_Logger::numberZBins = load_parameter("LOG_BARS");
|
||||
|
||||
ASCI_Logger::ASCI_Logger() {
|
||||
if (numberZBins == 0) {
|
||||
|
||||
@@ -17,28 +17,30 @@ class Drift_Base : public Mover_Base {
|
||||
public:
|
||||
Drift_Base(species this_species, Particle_Logger_Base *Logger, Population_Base *Population) : Mover_Base(this_species, Logger, Population) {};
|
||||
|
||||
void move(Particle *movePart, const double ¯oSigma_m2);
|
||||
void move(Particle *movePart, const double ¯oSigma_m);
|
||||
|
||||
protected:
|
||||
double get_zNew_m(Particle *movePart, const double ¯oSigma_m2);
|
||||
double get_zNew_m(Particle *movePart, const double ¯oSigma_m);
|
||||
virtual void doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double *znew_m) = 0;
|
||||
virtual void do_E_calculus(Particle *movePart, const vec3 &oldLoc_m, const double ¯oSigma_m) = 0;
|
||||
|
||||
};
|
||||
|
||||
inline void Drift_Base::move(Particle *movePart, const double ¯oSigma_m2) {
|
||||
inline void Drift_Base::move(Particle *movePart, const double ¯oSigma_m) {
|
||||
vec3 oldLoc_m = movePart->get_x_m();
|
||||
vec3 newLoc_m = oldLoc_m;
|
||||
|
||||
double znew_m = get_zNew_m(movePart, macroSigma_m2);
|
||||
double znew_m = get_zNew_m(movePart, macroSigma_m);
|
||||
doWallInteraction(movePart, &oldLoc_m, &znew_m);
|
||||
newLoc_m[2] = znew_m;
|
||||
|
||||
movePart->set_x_m(newLoc_m);
|
||||
do_E_calculus(movePart, oldLoc_m, macroSigma_m);
|
||||
Logger->log(*movePart, oldLoc_m);
|
||||
Population->increase_density(*movePart, oldLoc_m);
|
||||
}
|
||||
|
||||
inline double Drift_Base::get_zNew_m(Particle *movePart, const double ¯oSigma_m2) {
|
||||
inline double Drift_Base::get_zNew_m(Particle *movePart, const double ¯oSigma_m) {
|
||||
double zold_m = movePart->get_x_m()[2];
|
||||
|
||||
vec3 v_ms = movePart->get_v_ms();
|
||||
@@ -46,14 +48,14 @@ inline double Drift_Base::get_zNew_m(Particle *movePart, const double ¯oSigm
|
||||
double vForwardAbs_ms = calc_vec3_abs(vec3(0,0,v_ms[2]));
|
||||
double zDir = v_ms[2] <= 0 ? -1 : 1;
|
||||
double znew_m;
|
||||
if (macroSigma_m2 == 0) {
|
||||
if (macroSigma_m == 0) {
|
||||
if (zDir == -1) {
|
||||
znew_m = z_RW_m - 2*l_WGTS_m;
|
||||
} else {
|
||||
znew_m = z_WGTS_end_m + 2*l_WGTS_m;
|
||||
}
|
||||
} else {
|
||||
double distance_m = 1/macroSigma_m2;
|
||||
double distance_m = 1/macroSigma_m;
|
||||
znew_m = zold_m + zDir*vForwardAbs_ms/vTotAbs_ms * distance_m;
|
||||
}
|
||||
return znew_m;
|
||||
|
||||
@@ -16,13 +16,14 @@ class eT2I_DissExc : public Excitation_Base {
|
||||
public:
|
||||
eT2I_DissExc(Population_Base *T2IPopulation, UniRNG *rngUni, DCS_Base *dcs_gen) : Excitation_Base(T2IPopulation, rngUni, Janev_eT2I_DissExc::get_deltaE_eV(), dcs_gen) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return Janev_eT2I_DissExc::get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return Janev_eT2I_DissExc::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
inline InteractionOut eT2I_DissExc::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res = Excitation_Base::do_Interaction(interPart);
|
||||
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
Population->decrease_denisty(interPart->get_x_m(), 0); // dummy since thermal population
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class eT2I_Recombination : public Sub_Interaction_Base {
|
||||
public:
|
||||
eT2I_Recombination(Population_Base *T2IPopulation, UniRNG *rngUni) : Sub_Interaction_Base(T2IPopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return Janev_eT2I_Recombination::get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return Janev_eT2I_Recombination::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
this->dcs_gen = dcs_gen;
|
||||
}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return tcs_data.get_value(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return tcs_data.get_value(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
eT2_ElExc_Nu_Analytic(Population_Base *T2Population, UniRNG *rngUni, Janev_eT2_ElExc_Nu janev_Nu_in, DCS_Base *dcs_gen) : Excitation_Base(T2Population, rngUni, janev_Nu_in.get_deltaE_eV(), dcs_gen), janev_Nu(janev_Nu_in) {};
|
||||
|
||||
private:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return janev_Nu.get_TCS_m2(E_eV);
|
||||
}
|
||||
};
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
eT2_ElExc_Ng_Analytic(Population_Base *T2Population, UniRNG *rngUni, Janev_eT2_ElExc_Ng janev_Ng_in, DCS_Base *dcs_gen) : Excitation_Base(T2Population, rngUni, janev_Ng_in.get_deltaE_eV(), dcs_gen), janev_Ng(janev_Ng_in) {};
|
||||
|
||||
private:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return janev_Ng.get_TCS_m2(E_eV);
|
||||
}
|
||||
};
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
eT2_ElExc_n_Analytic(Population_Base *T2Population, UniRNG *rngUni, Janev_eT2_ElExc_n janev_n_in, DCS_Base *dcs_gen) : Excitation_Base(T2Population, rngUni, janev_n_in.get_deltaE_eV(), dcs_gen), janev_n(janev_n_in) {};
|
||||
|
||||
private:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return janev_n.get_TCS_m2(E_eV);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
virtual double get_microSigma_m2(const double &E_eV) = 0;
|
||||
virtual double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) = 0;
|
||||
public:
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
protected:
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
eT2_Ionization_BED_Base(Population_Base *T2Population, UniRNG *rngUni) : eT2_Ionization_Base(T2Population, rngUni, EionT2_eV){};
|
||||
|
||||
protected:
|
||||
virtual double get_microSigma_m2(const double &T_eV) = 0;
|
||||
//virtual double get_microSigma_m2(const double &T_eV) = 0;
|
||||
|
||||
protected:
|
||||
void add_Tritiums(InteractionOut *InterOut, const Particle &interPart) {
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
eT2_Ionization_BED_Analytic(Population_Base *T2Population, UniRNG *rngUni) : eT2_Ionization_BED_Base(T2Population, rngUni) {};
|
||||
|
||||
protected:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return BED_eT2_Ionization::calc_TCS(E_eV);
|
||||
}
|
||||
double roll_ionW_eV(const double &T_eV) {
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
{};
|
||||
|
||||
protected:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return tcs_data.get_value(E_eV);
|
||||
}
|
||||
double roll_ionW_eV(const double &T_eV) {
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
eT2_Ionization_Janev_ndiss(Population_Base *T2Population, UniRNG *rngUni) : eT2_Ionization_Base(T2Population, rngUni, Janev_eT2_Ionization_ndiss::get_deltaE_eV()), dcs_data(Janev_eT2_Ionization_ndiss::get_deltaE_eV(), scale_end, 100, 50, (get_data_path() + "eT2_ion_DCS.dat")) {};
|
||||
|
||||
protected:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return Janev_eT2_Ionization_ndiss::get_TCS_m2(E_eV);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
eT2_Ionization_Janev_diss_g(Population_Base *T2Population, UniRNG *rngUni) : eT2_Ionization_Base(T2Population, rngUni, Janev_eT2_Ionization_diss_g::get_deltaE_eV()), dcs_data(Janev_eT2_Ionization_diss_g::get_deltaE_eV(), scale_end, 100, 50, (get_data_path() + "eT2_ion_DCS.dat")) {};
|
||||
|
||||
protected:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return Janev_eT2_Ionization_diss_g::get_TCS_m2(E_eV);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ public:
|
||||
eT2_Ionization_Janev_diss_u(Population_Base *T2Population, UniRNG *rngUni) : eT2_Ionization_Base(T2Population, rngUni, Janev_eT2_Ionization_diss_u::get_deltaE_eV()), dcs_data(Janev_eT2_Ionization_diss_u::get_deltaE_eV(), scale_end, 100, 50, (get_data_path() + "eT2_ion_DCS.dat")) {};
|
||||
|
||||
protected:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return Janev_eT2_Ionization_diss_u::get_TCS_m2(E_eV);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
Excitation_Base(T2Population, rngUni, 0.516, dcs_gen) {};
|
||||
|
||||
private:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return calculator.get_TCS(E_eV);
|
||||
}
|
||||
};
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
Excitation_Base(T2Population, rngUni, 1.003, dcs_gen) {};
|
||||
|
||||
private:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return calculator.get_TCS(E_eV);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ class eT3I_DissExc : public Excitation_Base {
|
||||
public:
|
||||
eT3I_DissExc(Population_Base *T3IPopulation, UniRNG *rngUni, DCS_Base *dcs_gen) : Excitation_Base(T3IPopulation, rngUni, Janev_eT3I_DissExc::get_deltaE_eV(), dcs_gen) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return Janev_eT3I_DissExc::get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return Janev_eT3I_DissExc::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class eT3I_Recombination : public Sub_Interaction_Base {
|
||||
public:
|
||||
eT3I_Recombination(Population_Base *T3IPopulation, UniRNG *rngUni) : Sub_Interaction_Base(T3IPopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {return Janev_eT3I_Recombination::get_TCS(E_eV);}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {return Janev_eT3I_Recombination::get_TCS(E_eV);}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
//
|
||||
// eT5I_annhilation.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 16.09.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef eT5I_annhilation_h
|
||||
#define eT5I_annhilation_h
|
||||
|
||||
#include "sub_interaction_base.h"
|
||||
|
||||
|
||||
// From Duley:1996aa: Molecular clusters in interstellar clouds
|
||||
class eT5I_Annhilation : public Sub_Interaction_Base {
|
||||
public:
|
||||
eT5I_Annhilation(Population_Base *T5IPopulation, UniRNG *rngUni) : Sub_Interaction_Base(T5IPopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double v_ms = calc_v_ms_from_E_eV(E_eV, 5*mT_eV);
|
||||
return 1e-4/v_ms;
|
||||
}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
|
||||
inline InteractionOut eT5I_Annhilation::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
Population->decrease_denisty(interPart->get_x_m(), 0);
|
||||
|
||||
// Maybe add the 5 T atoms.
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
#endif /* eT5I_annhilation_h */
|
||||
@@ -10,14 +10,15 @@
|
||||
#define eT5I_recombination_h
|
||||
|
||||
#include "sub_interaction_base.h"
|
||||
#include "petterson_eT5I_recombination.h"
|
||||
|
||||
// From Ference = Macdonald:1984aa
|
||||
class eT5I_Recombination : public Sub_Interaction_Base {
|
||||
public:
|
||||
eT5I_Recombination(Population_Base *T5IPopulation, UniRNG *rngUni) : Sub_Interaction_Base(T5IPopulation, rngUni) {}
|
||||
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
return 1.8e-19/E_eV;}
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
return Pettersson_eT5I_Recombination::get_TCS(E_eV);
|
||||
}
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
};
|
||||
|
||||
@@ -26,8 +27,6 @@ inline InteractionOut eT5I_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
Population->decrease_denisty(interPart->get_x_m(), 0);
|
||||
|
||||
// Maybe add the 3 T atoms.
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// electron_E_drift.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 05.10.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef electron_E_drift_h
|
||||
#define electron_E_drift_h
|
||||
|
||||
#include "electron_drift.h"
|
||||
#include "katrin_fields.hpp"
|
||||
|
||||
|
||||
class E_Mover_E_Drift : public E_Mover_Drift {
|
||||
public:
|
||||
E_Mover_E_Drift(Particle_Logger_Base *Logger, Population_Base *Population) : E_Mover_Drift(Logger, Population) {};
|
||||
protected:
|
||||
void do_E_calculus(Particle *movePart, const vec3 &oldLoc_m, const double ¯oSigma_m);
|
||||
};
|
||||
|
||||
inline void E_Mover_E_Drift::do_E_calculus(Particle *movePart, const vec3 &oldLoc_m, const double ¯oSigma_m) {
|
||||
if (macroSigma_m <= 0) {
|
||||
return;
|
||||
}
|
||||
double t_s = 1/macroSigma_m/calc_vec3_abs(movePart->get_v_ms());
|
||||
vec3 newLoc_m = movePart->get_x_m();
|
||||
vec3 E_Vm = 0.5 * (Katrin_Fields::getElField_Vm(oldLoc_m) + Katrin_Fields::getElField_Vm(newLoc_m));
|
||||
double B_T = calc_vec3_abs( 0.5 * (Katrin_Fields::getMagField_T(oldLoc_m) + Katrin_Fields::getMagField_T(newLoc_m)) );
|
||||
|
||||
double E_rad_Vm = calc_r_m(E_Vm);
|
||||
double v_rad_ms = E_rad_Vm/B_T;
|
||||
vec3 loc_offset_m = E_Vm;
|
||||
loc_offset_m[2] = 0;
|
||||
loc_offset_m = loc_offset_m/calc_vec3_abs(loc_offset_m) * v_rad_ms * t_s;
|
||||
movePart->set_x_m(newLoc_m + loc_offset_m);
|
||||
|
||||
vec3 v_boost_ms = vec3(0,0, movePart->get_Z()*e_C/movePart->get_m_eV()*E_Vm[2] * t_s/c_ms/c_ms);
|
||||
movePart->set_v_ms(movePart->get_v_ms() + v_boost_ms);
|
||||
}
|
||||
|
||||
#endif /* electron_E_drift_h */
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
this->dt_s = dt_s;
|
||||
};
|
||||
|
||||
void move(Particle *movePart, const double ¯oSigma_m2);
|
||||
void move(Particle *movePart, const double ¯oSigma_m);
|
||||
|
||||
private:
|
||||
double doBoris_singleStep_m(Particle *movePart, const vec3 &E_Vm , const vec3 &B_T);
|
||||
@@ -28,18 +28,18 @@ private:
|
||||
void doBoris_LogzDirChange(Particle *movePart, double *oldzDir, vec3 *oldLoc_m);
|
||||
};
|
||||
|
||||
void E_Mover_Boris::move(Particle *movePart, const double ¯oSigma_m2) {
|
||||
void E_Mover_Boris::move(Particle *movePart, const double ¯oSigma_m) {
|
||||
// Prepare detection for change of z direction for logging
|
||||
double oldzDir = movePart->get_v_ms()[2] < 0 ? -1 : 1;
|
||||
vec3 oldLoc_m = movePart->get_x_m();
|
||||
|
||||
if (macroSigma_m2 == 0) { // If infinite movement distance let electron leave at only exit... Prob extremly faulty, but also impossible.
|
||||
if (macroSigma_m == 0) { // If infinite movement distance let electron leave at only exit... Prob extremly faulty, but also impossible.
|
||||
movePart->set_x_m(z_RW_m);
|
||||
Logger->log(*movePart,oldLoc_m);
|
||||
return;
|
||||
}
|
||||
|
||||
double distance_m = 1/macroSigma_m2;
|
||||
double distance_m = 1/macroSigma_m;
|
||||
|
||||
double traveledDistance_m = 0;
|
||||
vec3 loc_m, E_Vm ,B_T;
|
||||
|
||||
@@ -17,9 +17,10 @@ public:
|
||||
E_Mover_Drift(Particle_Logger_Base *Logger, Population_Base *Population) : Drift_Base(electron, Logger, Population) {};
|
||||
protected:
|
||||
void doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double *znew_m);
|
||||
void do_E_calculus(Particle *movePart, const vec3 &oldLoc_m, const double ¯oSigma_m);
|
||||
};
|
||||
|
||||
void E_Mover_Drift::doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double *znew_m) {
|
||||
inline void E_Mover_Drift::doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double *znew_m) {
|
||||
|
||||
if (*znew_m >= z_WGTS_end_m) { // Moveing into Spectrometer and reversing Speed.
|
||||
vec3 reverseLoc_m = *oldLoc_m;
|
||||
@@ -40,4 +41,8 @@ void E_Mover_Drift::doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double
|
||||
}
|
||||
}
|
||||
|
||||
inline void E_Mover_Drift::do_E_calculus(Particle *movePart, const vec3 &oldLoc_m, const double ¯oSigma_m) {
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* electron_drift_h */
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
private:
|
||||
virtual double get_microSigma_m2(const double &Ekin_EV) = 0;
|
||||
//virtual double get_microSigma_m2(const double &Ekin_EV) = 0;
|
||||
};
|
||||
|
||||
inline InteractionOut Excitation_Base::do_Interaction (Particle *interPart) {
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
tcs_data(scale_start, scale_end, 1e3, get_data_path() + load_file_name) {};
|
||||
|
||||
private:
|
||||
double get_microSigma_m2(const double &E_eV) {
|
||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||
if (E_eV < deltaE_eV) {
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include "injector.hpp"
|
||||
#include "katrin_geo.h"
|
||||
|
||||
const int Injector::injectionMethod = load_parameter("injectionMethod");
|
||||
const double Injector::injectionEnergy_eV = load_parameter("injectionEnergy_eV");
|
||||
const int Injector::injectionMethod = load_parameter("INJECTION");
|
||||
const double Injector::injectionEnergy_eV = load_parameter("INJ_E");
|
||||
|
||||
Particle Injector::injectElectron (const int &newId) {
|
||||
|
||||
|
||||
@@ -29,16 +29,16 @@ public:
|
||||
void add(Sub_Interaction_Base *addSubInteraction);
|
||||
|
||||
InteractionOut do_Interaction(Particle *interPart);
|
||||
double get_macroSigma_m2(const Particle &interPart);
|
||||
double get_macroSigma_m(const Particle &interPart);
|
||||
};
|
||||
|
||||
inline InteractionOut Interaction_Base::do_Interaction(Particle *interPart) {
|
||||
double macroSigma_m2 = get_macroSigma_m2(*interPart);
|
||||
double macroSigma_m = get_macroSigma_m(*interPart);
|
||||
double currentStackedSigma = 0;
|
||||
double targetStackedSigma = rngUni->random() * macroSigma_m2;
|
||||
double targetStackedSigma = rngUni->random() * macroSigma_m;
|
||||
|
||||
for (int i = 0; i < numSubInteractions; i++) {
|
||||
currentStackedSigma += SubInteractions[i]->get_macroSigma_m2(*interPart);
|
||||
currentStackedSigma += SubInteractions[i]->get_macroSigma_m(*interPart);
|
||||
if (currentStackedSigma >= targetStackedSigma) {
|
||||
return SubInteractions[i]->do_Interaction(interPart);
|
||||
}
|
||||
@@ -50,12 +50,12 @@ inline InteractionOut Interaction_Base::do_Interaction(Particle *interPart) {
|
||||
}
|
||||
|
||||
|
||||
inline double Interaction_Base::get_macroSigma_m2(const Particle &interPart) {
|
||||
double macroSigma_m2 = 0;
|
||||
inline double Interaction_Base::get_macroSigma_m(const Particle &interPart) {
|
||||
double macroSigma_m = 0;
|
||||
for (int i = 0; i < numSubInteractions; i++) {
|
||||
macroSigma_m2 += SubInteractions[i]->get_macroSigma_m2(interPart);
|
||||
macroSigma_m += SubInteractions[i]->get_macroSigma_m(interPart);
|
||||
}
|
||||
return macroSigma_m2;
|
||||
return macroSigma_m;
|
||||
}
|
||||
|
||||
inline void Interaction_Base::add(Sub_Interaction_Base *addSubInteraction) {
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "interaction_builder.hpp"
|
||||
|
||||
#include "exc_base.h"
|
||||
|
||||
// e impact
|
||||
#include "eT2_elastic.h"
|
||||
@@ -22,10 +21,11 @@
|
||||
#include "eT3I_disexc.h"
|
||||
|
||||
#include "eT5I_recombination.h"
|
||||
#include "eT5I_annhilation.h"
|
||||
|
||||
// TI impact
|
||||
#include "TIT2_elastic.h"
|
||||
#include "TIT2_radasc.h"
|
||||
#include "TIT2_terasc.h"
|
||||
|
||||
// T2I impact
|
||||
#include "T2Ie_disexc.h"
|
||||
@@ -36,153 +36,130 @@
|
||||
|
||||
// T3I impact
|
||||
#include "T3IT2_elastic.h"
|
||||
#include "T3IT2_cluster.h"
|
||||
#include "T3IT2_radasc.h"
|
||||
#include "T3IT2_terasc.h"
|
||||
#include "T3Ie_recombination.h"
|
||||
#include "T3Ie_disexc.h"
|
||||
|
||||
// T5I impact
|
||||
#include "T5IT2_elastic.h"
|
||||
#include "T5Ie_annhilation.h"
|
||||
#include "T5Ie_recombination.h"
|
||||
|
||||
const int Interaction_Builder::e_direction = load_parameter("e_direction");
|
||||
|
||||
const int Interaction_Builder::eT2elastic = load_parameter("eT2elastic");
|
||||
const int Interaction_Builder::eT2ionization = load_parameter("eT2ionization");
|
||||
const int Interaction_Builder::eT2recombination = load_parameter("eT2recombination");
|
||||
const int Interaction_Builder::eT2excitation = load_parameter("eT2excitation");
|
||||
|
||||
const int Interaction_Builder::ions = load_parameter("ions");
|
||||
|
||||
|
||||
|
||||
Interaction_Manager Interaction_Builder::build(Population_Manager *Populations, UniRNG *rngUni) {
|
||||
Interaction_Manager Interactions;
|
||||
Interactions.add(build_electron(Populations, rngUni));
|
||||
//Interactions.add(build_tritium(Populations, rngUni));
|
||||
if (ions == 1) {
|
||||
Interactions.add(build_tritiumI(Populations, rngUni));
|
||||
Interactions.add(build_tritium2I(Populations, rngUni));
|
||||
Interactions.add(build_tritium3I(Populations, rngUni));
|
||||
Interactions.add(build_tritium5I(Populations, rngUni));
|
||||
} else if (ions == 0){
|
||||
Interactions.add(new Interaction_Base(tritiumI, rngUni));
|
||||
Interactions.add(new Interaction_Base(tritium2I, rngUni));
|
||||
Interactions.add(new Interaction_Base(tritium3I, rngUni));
|
||||
Interactions.add(new Interaction_Base(tritium5I, rngUni));
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss<<"Interaction_Builder::build_electron: ions value invalid.\n";
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
Interactions.add(build_tritiumI(Populations, rngUni));
|
||||
Interactions.add(build_tritium2I(Populations, rngUni));
|
||||
Interactions.add(build_tritium3I(Populations, rngUni));
|
||||
Interactions.add(build_tritium5I(Populations, rngUni));
|
||||
return Interactions;
|
||||
}
|
||||
|
||||
Interaction_Base* Interaction_Builder::build_electron(Population_Manager *Populations, UniRNG *rngUni) {
|
||||
Interaction_Base *eInteraction = new Interaction_Base(electron, rngUni);
|
||||
Population_Base *T2Population = Populations->find(tritium2);
|
||||
Population_Base *T2IPopulation = Populations->find(tritium2I);
|
||||
Population_Base *T3IPopulation = Populations->find(tritium3I);
|
||||
Population_Base *T5IPopulation = Populations->find(tritium5I);
|
||||
DCS_Base *exc_dcs = new ZeroPi_DCS(rngUni);
|
||||
|
||||
DCS_Base *elastic_dcs;
|
||||
DCS_Base *exc_dcs;
|
||||
if (e_direction == 0) {
|
||||
elastic_dcs = new Elastic_DCS(rngUni);
|
||||
exc_dcs = new ZeroPi_DCS(rngUni);
|
||||
} else if (e_direction == 1) {
|
||||
elastic_dcs = new FourPi_DCS(rngUni);
|
||||
exc_dcs = new FourPi_DCS(rngUni);
|
||||
} else if (e_direction == 2) {
|
||||
elastic_dcs = new ZeroPi_DCS(rngUni);
|
||||
exc_dcs = new ZeroPi_DCS(rngUni);
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss<<"Interaction_Builder::build_electron: e_direction value invalid.\n";
|
||||
throw MyException (ss.str());
|
||||
if (load_parameter("eT2_ELA") == 1) {
|
||||
DCS_Base *ela_dcs;
|
||||
if (load_parameter("INT_ELA_DIR") == 0) {
|
||||
ela_dcs = new Elastic_DCS(rngUni);
|
||||
} else if (load_parameter("INT_ELA_DIR") == 1) {
|
||||
ela_dcs = new FourPi_DCS(rngUni);
|
||||
} else if (load_parameter("INT_ELA_DIR") == 2) {
|
||||
ela_dcs = new ZeroPi_DCS(rngUni);
|
||||
} else {
|
||||
throw MyException ("eT2_ELA_DIR invalid.");
|
||||
}
|
||||
eInteraction->add(new eT2_Elastic(T2Population, rngUni, ela_dcs));
|
||||
} else if (load_parameter("eT2_ELA") != 0) {
|
||||
throw MyException ("eT2_ELA invalid.");
|
||||
}
|
||||
|
||||
if (eT2elastic == 1) {
|
||||
eInteraction->add(new eT2_Elastic(T2Population, rngUni, elastic_dcs));
|
||||
} else if(eT2elastic != 0) {
|
||||
std::stringstream ss;
|
||||
ss<<"Interaction_Builder::build_electron: eT2elastic value invalid.\n";
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
|
||||
if (eT2ionization == 1) {
|
||||
|
||||
if (load_parameter("eT2_ION") == 1) {
|
||||
eInteraction->add(new eT2_Ionization_Janev_ndiss(T2Population, rngUni));
|
||||
eInteraction->add(new eT2_Ionization_Janev_diss_g(T2Population, rngUni));
|
||||
eInteraction->add(new eT2_Ionization_Janev_diss_u(T2Population, rngUni));
|
||||
} else if (eT2ionization == 2){
|
||||
} else if (load_parameter("eT2_ION") == 2){
|
||||
eInteraction->add(new eT2_Ionization_BED_Container(T2Population, rngUni));
|
||||
} else if(eT2ionization != 0) {
|
||||
std::stringstream ss;
|
||||
ss<<"Interaction_Builder::build_electron: eT2ionization value invalid.\n";
|
||||
throw MyException (ss.str());
|
||||
} else if(load_parameter("eT2_ION") != 0) {
|
||||
throw MyException ("eT2_ION invalid.");
|
||||
}
|
||||
|
||||
if (eT2excitation == 1 || eT2excitation == 2) {
|
||||
|
||||
if (load_parameter("eT2_ROT") == 2) {
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 4.41e-4, exc_dcs, "rot_exc_j02.dat"));
|
||||
|
||||
if (eT2excitation == 1) {
|
||||
eInteraction->add(new eT2_VibExc01(T2Population, rngUni, exc_dcs));
|
||||
eInteraction->add(new eT2_VibExc02(T2Population, rngUni, exc_dcs));
|
||||
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(B1Sigmau), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Bp1Sigu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Bpp1Sigu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(C1Piu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(D1Piu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Dp1Piu), exc_dcs));
|
||||
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(EF1Sigpg), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(HHb1Sigpg), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(GK1Sigpg), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(I1Pig), exc_dcs));
|
||||
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(a3Sigpg), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(b3Sigpu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(c3Piu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(e3Sigpu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(d3Piu), exc_dcs));
|
||||
} else if (eT2excitation == 2) {
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 0.516, exc_dcs, "vib_exc_v01.dat"));
|
||||
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 8.48, exc_dcs, "el_exc_b3sigpu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.18, exc_dcs, "el_exc_B1sigpu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.76, exc_dcs, "el_exc_c3piu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.79, exc_dcs, "el_exc_a3sigpg.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 12.29, exc_dcs, "el_exc_C1piu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 12.3, exc_dcs, "el_exc_EF1sigpg.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 13.23, exc_dcs, "el_exc_e3sigpu.dat"));
|
||||
}
|
||||
} else if(eT2excitation != 0) {
|
||||
std::stringstream ss;
|
||||
ss<<"Interaction_Builder::build_electron: eT2excitation value invalid.\n";
|
||||
throw MyException (ss.str());
|
||||
} else if (load_parameter("eT2_ROT") != 0) {
|
||||
throw MyException ("eT2_ROT invalid.");
|
||||
}
|
||||
|
||||
if (eT2recombination == 1) {
|
||||
if (load_parameter("eT2_VIB") == 1) {
|
||||
eInteraction->add(new eT2_VibExc01(T2Population, rngUni, exc_dcs));
|
||||
eInteraction->add(new eT2_VibExc02(T2Population, rngUni, exc_dcs));
|
||||
} else if (load_parameter("eT2_VIB") == 2) {
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 0.516, exc_dcs, "vib_exc_v01.dat"));
|
||||
} else if (load_parameter("eT2_VIB") != 0) {
|
||||
throw MyException ("eT2_VIB invalid.");
|
||||
}
|
||||
|
||||
if (load_parameter("eT2_EL") == 1) {
|
||||
build_e_el_janev(eInteraction, rngUni, T2Population, exc_dcs);
|
||||
} else if (load_parameter("eT2_EL") == 2) {
|
||||
build_e_el_exp(eInteraction, rngUni, T2Population, exc_dcs);
|
||||
} else if (load_parameter("eT2_EL") != 0) {
|
||||
throw MyException ("eT2_EL invalid.");
|
||||
}
|
||||
|
||||
if (load_parameter("e_REC") == 1) {
|
||||
eInteraction->add(new eT2I_Recombination(T2IPopulation, rngUni));
|
||||
eInteraction->add(new eT3I_Recombination(T3IPopulation, rngUni));
|
||||
eInteraction->add(new eT5I_Recombination(T5IPopulation, rngUni));
|
||||
} else if(eT2recombination != 0) {
|
||||
std::stringstream ss;
|
||||
ss<<"Interaction_Builder::build_electron: eT2recombination value invalid.\n";
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
if (ions == 1) {
|
||||
eInteraction->add(new eT2I_DissExc(T2IPopulation, rngUni, exc_dcs));
|
||||
eInteraction->add(new eT3I_DissExc(T3IPopulation, rngUni, exc_dcs));
|
||||
} else if(ions != 0) {
|
||||
std::stringstream ss;
|
||||
ss<<"Interaction_Builder::build_electron: ions value invalid.\n";
|
||||
throw MyException (ss.str());
|
||||
} else if (load_parameter("e_REC") != 0) {
|
||||
throw MyException ("e_REC invalid.");
|
||||
}
|
||||
|
||||
//eInteraction->add(new eT2I_DissExc(T2IPopulation, rngUni, exc_dcs));
|
||||
//eInteraction->add(new eT3I_DissExc(T3IPopulation, rngUni, exc_dcs));
|
||||
|
||||
|
||||
return eInteraction;
|
||||
}
|
||||
|
||||
void Interaction_Builder::build_e_el_janev(Interaction_Base* eInteraction, UniRNG *rngUni, Population_Base *T2Population, DCS_Base *exc_dcs) {
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(B1Sigmau), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Bp1Sigu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Bpp1Sigu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(C1Piu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(D1Piu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Dp1Piu), exc_dcs));
|
||||
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(EF1Sigpg), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(HHb1Sigpg), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(GK1Sigpg), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(I1Pig), exc_dcs));
|
||||
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(a3Sigpg), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(b3Sigpu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(c3Piu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(e3Sigpu), exc_dcs));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(d3Piu), exc_dcs));
|
||||
}
|
||||
|
||||
void Interaction_Builder::build_e_el_exp(Interaction_Base* eInteraction, UniRNG *rngUni, Population_Base *T2Population, DCS_Base *exc_dcs) {
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 8.48, exc_dcs, "el_exc_b3sigpu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.18, exc_dcs, "el_exc_B1sigpu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.76, exc_dcs, "el_exc_c3piu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.79, exc_dcs, "el_exc_a3sigpg.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 12.29, exc_dcs, "el_exc_C1piu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 12.3, exc_dcs, "el_exc_EF1sigpg.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 13.23, exc_dcs, "el_exc_e3sigpu.dat"));
|
||||
}
|
||||
|
||||
|
||||
Interaction_Base* Interaction_Builder::build_tritium(Population_Manager *Populations, UniRNG *rngUni) {
|
||||
Interaction_Base *T_Interaction = new Interaction_Base(tritium, rngUni);
|
||||
@@ -193,6 +170,8 @@ Interaction_Base* Interaction_Builder::build_tritiumI(Population_Manager *Popula
|
||||
Interaction_Base *TI_Interaction = new Interaction_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));
|
||||
return TI_Interaction;
|
||||
}
|
||||
|
||||
@@ -201,7 +180,7 @@ Interaction_Base* Interaction_Builder::build_tritium2I(Population_Manager *Popul
|
||||
Population_Base *T2Population = Populations->find(tritium2);
|
||||
Population_Base *ePopulation = Populations->find(electron);
|
||||
T2I_Interaction->add(new T2Ie_Recombination(ePopulation, rngUni));
|
||||
T2I_Interaction->add(new T2Ie_DissExc(ePopulation, rngUni));
|
||||
//T2I_Interaction->add(new T2Ie_DissExc(ePopulation, rngUni));
|
||||
T2I_Interaction->add(new T2IT2_Cluster(T2Population, rngUni));
|
||||
T2I_Interaction->add(new T2IT2_CX(T2Population, rngUni));
|
||||
return T2I_Interaction ;
|
||||
@@ -212,8 +191,10 @@ Interaction_Base* Interaction_Builder::build_tritium3I(Population_Manager *Popul
|
||||
Population_Base *T2Population = Populations->find(tritium2);
|
||||
Population_Base *ePopulation = Populations->find(electron);
|
||||
T3I_Interaction->add(new T3IT2_Elastic(T2Population, rngUni));
|
||||
T3I_Interaction->add(new T3IT2_RadAsc(T2Population, rngUni));
|
||||
T3I_Interaction->add(new T3IT2_TerAsc(T2Population, rngUni));
|
||||
T3I_Interaction->add(new T3Ie_Recombination(ePopulation, rngUni));
|
||||
T3I_Interaction->add(new T3Ie_DissExc(ePopulation, rngUni));
|
||||
//T3I_Interaction->add(new T3Ie_DissExc(ePopulation, rngUni));
|
||||
return T3I_Interaction ;
|
||||
}
|
||||
|
||||
@@ -223,5 +204,5 @@ Interaction_Base* Interaction_Builder::build_tritium5I(Population_Manager *Popul
|
||||
Population_Base *ePopulation = Populations->find(electron);
|
||||
T5I_Interaction->add(new T5IT2_Elastic(T2Population, rngUni));
|
||||
T5I_Interaction->add(new T5Ie_Recombination(ePopulation, rngUni));
|
||||
return T5I_Interaction ;
|
||||
return T5I_Interaction;
|
||||
}
|
||||
|
||||
@@ -12,25 +12,21 @@
|
||||
#include "interaction_base.h"
|
||||
#include "manager_base.h"
|
||||
|
||||
#include "exc_base.h"
|
||||
#include "population_builder.hpp"
|
||||
|
||||
typedef Manager_Base<Interaction_Base> Interaction_Manager;
|
||||
|
||||
class Interaction_Builder {
|
||||
static const int e_direction;
|
||||
|
||||
static const int eT2ionization;
|
||||
static const int eT2elastic;
|
||||
static const int eT2recombination;
|
||||
static const int eT2excitation;
|
||||
static const int ions;
|
||||
|
||||
class Interaction_Builder {
|
||||
public:
|
||||
Interaction_Builder() {};
|
||||
|
||||
static Interaction_Manager build(Population_Manager *Populations, UniRNG *rngUni);
|
||||
private:
|
||||
static Interaction_Base* build_electron(Population_Manager *Populations, UniRNG *rngUni);
|
||||
static void build_e_el_janev(Interaction_Base* eInteraction, UniRNG *rngUni, Population_Base *T2Population, DCS_Base *exc_dcs);
|
||||
static void build_e_el_exp(Interaction_Base* eInteraction, UniRNG *rngUni, Population_Base *T2Population, DCS_Base *exc_dcs);
|
||||
|
||||
static Interaction_Base* build_tritium(Population_Manager *Populations, UniRNG *rngUni);
|
||||
static Interaction_Base* build_tritiumI(Population_Manager *Populations, UniRNG *rngUni);
|
||||
static Interaction_Base* build_tritium2I(Population_Manager *Populations, UniRNG *rngUni);
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
double sig_small_1 = 6.59e-20*pow(E_eV, -0.5)/(1+2.29*pow(E_eV,1.78));
|
||||
|
||||
double numerator1 = 12.85e-20*exp(-1.84*pow(E_eV,-1.55));
|
||||
double denominator1 = pow(E_eV, 0.0673) * (1+ 2.6e-3*pow(E_eV,0.97) + 1.63e-10*pow(E_eV,276));
|
||||
double denominator1 = pow(E_eV, 0.0673) * (1+ 2.6e-3*pow(E_eV,0.97) + 1.63e-10*pow(E_eV,2.76));
|
||||
double sig_small_2 = numerator1/denominator1;
|
||||
|
||||
double numerator2 = 11.38e-20*exp(-61.8*pow(E_eV, 0.54));
|
||||
|
||||
@@ -10,16 +10,22 @@
|
||||
#define janev_eT2I_ionization_h
|
||||
|
||||
#include <cmath>
|
||||
// Janev:2003aa "From Collision processes in low-temperature hydrogen plasmas" 7.1.3.A p.73 formular (185)
|
||||
// Janev:2003aa "From Collision processes in low-temperature hydrogen plasmas" 7.1.3.A p.73 formular (195)
|
||||
|
||||
class Janev_eT2_Ionization {
|
||||
|
||||
public:
|
||||
Janev_eT2_Ionization() {}
|
||||
|
||||
static double get_TCS(const double &E_eV) {
|
||||
double expconst = exp(-0.105*pow(E_eV/15.2-1,1.55))
|
||||
return 7.39/E_eV*log(0.18*E_eV) * (1-expconst) * 1e-20;
|
||||
if (E_eV < get_deltaE_eV()) {
|
||||
return 0;
|
||||
} else {
|
||||
double expconst = exp(-0.105*pow(E_eV/15.2-1,1.55))
|
||||
return 7.39/E_eV*log(0.18*E_eV) * (1-expconst) * 1e-20;
|
||||
}
|
||||
}
|
||||
static double get_deltaE_eV() {return 15.2;}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
#include "read_system.h"
|
||||
|
||||
|
||||
const double Katrin_Fields::wgtsMagField_T = load_parameter("wgtsMagField_T");
|
||||
const double Katrin_Fields::wgtsMagField_T = load_parameter("BFIELD");
|
||||
Vec3_Container Katrin_Fields::e_field(1000, 50, 20, get_data_path() + "e_field.dat");
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "population_logger_base.h"
|
||||
|
||||
const int Particle_Logger_Builder::numberZBins = load_parameter("numberZBins");
|
||||
const int Particle_Logger_Builder::numberZBins = load_parameter("LOG_BARS");
|
||||
|
||||
Particle_Logger_Manager Particle_Logger_Builder::build(H5_File *h5f) {
|
||||
Particle_Logger_Manager ParticleLogger;
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
this->Population = Population;
|
||||
}
|
||||
|
||||
virtual void move(Particle *movePart, const double ¯oSigma_m2) = 0;
|
||||
virtual void move(Particle *movePart, const double ¯oSigma_m) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -11,13 +11,15 @@
|
||||
#include "read_system.h"
|
||||
|
||||
#include "electron_drift.h"
|
||||
#include "electron_E_drift.h"
|
||||
#include "electron_boris.h"
|
||||
#include "postive_drift.h"
|
||||
#include "postive_E_drift.h"
|
||||
#include "neutral_mover.h"
|
||||
|
||||
|
||||
const int Mover_Builder::propagationMethod = load_parameter("propagationMethod");
|
||||
const double Mover_Builder::dt_s = load_parameter("dt_s");
|
||||
const int Mover_Builder::propagationMethod = load_parameter("PROPAGATION");
|
||||
const double Mover_Builder::dt_s = load_parameter("BORIS_T");
|
||||
|
||||
Mover_Manager Mover_Builder::build(Particle_Logger_Manager *Loggers, Population_Manager *Populations) {
|
||||
Mover_Manager Movers;
|
||||
@@ -36,7 +38,15 @@ Mover_Base *Mover_Builder::build_electron(Particle_Logger_Manager *Loggers, Popu
|
||||
Particle_Logger_Base *Logger = Loggers->find(electron);
|
||||
Population_Base *Popultation = Populations->find(electron);
|
||||
if (propagationMethod == 0) {
|
||||
electron_Mover = new E_Mover_Drift(Logger, Popultation);
|
||||
if (load_parameter("E_FIELD") == 0) {
|
||||
electron_Mover = new E_Mover_Drift(Logger, Popultation);
|
||||
} else if (load_parameter("E_FIELD") == 1) {
|
||||
electron_Mover = new E_Mover_E_Drift(Logger, Popultation);
|
||||
} else {
|
||||
throw MyException("E_FIELD invalid");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
electron_Mover = new E_Mover_Boris(dt_s, Logger, Popultation);
|
||||
}
|
||||
@@ -52,23 +62,53 @@ Mover_Base *Mover_Builder::build_tritium(Particle_Logger_Manager *Loggers, Popul
|
||||
Mover_Base *Mover_Builder::build_tritiumI(Particle_Logger_Manager *Loggers, Population_Manager *Populations) {
|
||||
Particle_Logger_Base *Logger = Loggers->find(tritiumI);
|
||||
Population_Base *Popultation = Populations->find(tritiumI);
|
||||
return new Positive_Mover_Drift(tritiumI, Logger, Popultation);
|
||||
if (load_parameter("E_FIELD") == 0) {
|
||||
return new Positive_Mover_Drift(tritiumI, Logger, Popultation);
|
||||
} else if (load_parameter("E_FIELD") == 1) {
|
||||
return new Positive_Mover_E_Drift(tritiumI, Logger, Popultation);
|
||||
} else {
|
||||
throw MyException("E_FIELD invalid");
|
||||
}
|
||||
}
|
||||
|
||||
Mover_Base *Mover_Builder::build_tritium2I(Particle_Logger_Manager *Loggers, Population_Manager *Populations) {
|
||||
Particle_Logger_Base *Logger = Loggers->find(tritium2I);
|
||||
Population_Base *Popultation = Populations->find(tritium2I);
|
||||
return new Positive_Mover_Drift(tritium2I, Logger, Popultation);
|
||||
if (load_parameter("E_FIELD") == 0) {
|
||||
return new Positive_Mover_Drift(tritium2I, Logger, Popultation);
|
||||
} else if (load_parameter("E_FIELD") == 1) {
|
||||
return new Positive_Mover_E_Drift(tritium2I, Logger, Popultation);
|
||||
} else {
|
||||
throw MyException("E_FIELD invalid");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Mover_Base *Mover_Builder::build_tritium3I(Particle_Logger_Manager *Loggers, Population_Manager *Populations) {
|
||||
Particle_Logger_Base *Logger = Loggers->find(tritium3I);
|
||||
Population_Base *Popultation = Populations->find(tritium3I);
|
||||
return new Positive_Mover_Drift(tritium3I, Logger, Popultation);
|
||||
if (load_parameter("E_FIELD") == 0) {
|
||||
return new Positive_Mover_Drift(tritium3I, Logger, Popultation);
|
||||
} else if (load_parameter("E_FIELD") == 1) {
|
||||
return new Positive_Mover_E_Drift(tritium3I, Logger, Popultation);
|
||||
} else {
|
||||
throw MyException("E_FIELD invalid");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Mover_Base *Mover_Builder::build_tritium5I(Particle_Logger_Manager *Loggers, Population_Manager *Populations) {
|
||||
Particle_Logger_Base *Logger = Loggers->find(tritium5I);
|
||||
Population_Base *Popultation = Populations->find(tritium5I);
|
||||
return new Positive_Mover_Drift(tritium5I, Logger, Popultation);
|
||||
if (load_parameter("E_FIELD") == 0) {
|
||||
return new Positive_Mover_Drift(tritium5I, Logger, Popultation);
|
||||
} else if (load_parameter("E_FIELD") == 1) {
|
||||
return new Positive_Mover_E_Drift(tritium5I, Logger, Popultation);
|
||||
} else {
|
||||
throw MyException("E_FIELD invalid");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,16 +15,16 @@ class Neutral_Mover : public Mover_Base {
|
||||
public:
|
||||
Neutral_Mover(species this_species, Particle_Logger_Base *Logger, Population_Base *Population) : Mover_Base(this_species, Logger, Population) {};
|
||||
|
||||
void move(Particle *movePart, const double ¯oSigma_m2);
|
||||
void move(Particle *movePart, const double ¯oSigma_m);
|
||||
private:
|
||||
void wall_correction(vec3 *newLoc_m, const vec3 &oldLoc_m);
|
||||
};
|
||||
|
||||
inline void Neutral_Mover::move(Particle *movePart, const double ¯oSigma_m2) {
|
||||
inline void Neutral_Mover::move(Particle *movePart, const double ¯oSigma_m) {
|
||||
vec3 oldLoc_m = movePart->get_x_m();
|
||||
vec3 v_ms = movePart->get_v_ms();
|
||||
vec3 move_direction = v_ms/calc_vec3_abs(v_ms);
|
||||
double distance = (macroSigma_m2 <= 0) ? 1e3 : 1/macroSigma_m2; //sloppy trick to "leave" wgts
|
||||
double distance = (macroSigma_m <= 0) ? 1e3 : 1/macroSigma_m; //sloppy trick to "leave" wgts
|
||||
|
||||
vec3 newLoc_m = oldLoc_m + distance * move_direction;
|
||||
wall_correction(&newLoc_m, oldLoc_m);
|
||||
|
||||
@@ -46,12 +46,12 @@ void Particle_Looper::process_first(std::queue<Particle> *particle_queue) {
|
||||
Terminator_Base *terminatorPtr = terminators.find(curPart.get_species());
|
||||
|
||||
InteractionOut IntOut;
|
||||
double macroSigma_m2;
|
||||
double macroSigma_m;
|
||||
vec3 oldLoc_m;
|
||||
while (!terminatorPtr->check_terminlization(curPart)) {
|
||||
oldLoc_m = curPart.get_x_m();
|
||||
macroSigma_m2 = interactionPtr->get_macroSigma_m2(curPart);
|
||||
moverPtr->move(&curPart, macroSigma_m2);
|
||||
macroSigma_m = interactionPtr->get_macroSigma_m(curPart);
|
||||
moverPtr->move(&curPart, macroSigma_m);
|
||||
if (terminatorPtr->check_terminlization(curPart)) {
|
||||
break; // Don't double check terminlization, else n_double.
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// petterson_eT5I_recombination.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 08.10.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef petterson_eT5I_recombination_h
|
||||
#define petterson_eT5I_recombination_h
|
||||
|
||||
// From Pettersson:2015aa
|
||||
|
||||
class Pettersson_eT5I_Recombination {
|
||||
public:
|
||||
Pettersson_eT5I_Recombination() {}
|
||||
static double get_TCS(const double &E_eV) {
|
||||
if (E_eV<0.017) {
|
||||
return pow(10,-18.87) * pow(E_eV, -1.2);
|
||||
} else if (E_eV < 0.159) {
|
||||
return pow(10,-19.93) * pow(E_eV, -1.78);
|
||||
} else if (E_eV < 1) {
|
||||
return pow(10,-21.5) * pow(E_eV, -3.75);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* petterson_eT5I_recombination_h */
|
||||
@@ -14,8 +14,8 @@
|
||||
#include "tritium2_population.h"
|
||||
|
||||
|
||||
const double Population_Builder::wgtsTemp_K = load_parameter("wgtsTemp_K");
|
||||
const int Population_Builder::v_flow = load_parameter("v_flow");
|
||||
const double Population_Builder::wgtsTemp_K = load_parameter("TEMP");
|
||||
const int Population_Builder::v_flow = load_parameter("T2_VELO");
|
||||
|
||||
Population_Manager Population_Builder::build(Timer *timer,UniRNG *rngUni, NormalRNG *rngNormal) {
|
||||
Population_Manager Populations;
|
||||
|
||||
@@ -54,8 +54,8 @@ void Population_Load_Saver::write_overhead(ofstream *save_stream) {
|
||||
*save_stream<<r_WGTS_m<<"\t";
|
||||
*save_stream<<" # 1. rear wall pos 2. WGTS start pos 3. WGTS end pos 4. WGTS radius all pos in m \n";
|
||||
|
||||
*save_stream<<load_parameter("wgtsT2MaxDensity_m3")<<"\t";
|
||||
*save_stream<<load_parameter("wgtsTemp_K")<<"\t";
|
||||
*save_stream<<load_parameter("T2_MAXDENS")<<"\t";
|
||||
*save_stream<<load_parameter("TEMP")<<"\t";
|
||||
*save_stream<<" #1. wgtsT2MaxDensity_m3 2. wgtsTemp_K \n";
|
||||
|
||||
*save_stream<<"# Start of populations data \n";
|
||||
@@ -193,11 +193,11 @@ void Population_Load_Saver::check_katrin_geo_line(ifstream *load_stream) {
|
||||
void Population_Load_Saver::check_katrin_T2_line(ifstream *load_stream) {
|
||||
double wgtsT2MaxDensity_m3, wgtsTemp_K;
|
||||
*load_stream>>wgtsT2MaxDensity_m3;
|
||||
if ( wgtsT2MaxDensity_m3 != load_parameter("wgtsT2MaxDensity_m3")) {
|
||||
if ( wgtsT2MaxDensity_m3 != load_parameter("T2_MAXDENS")) {
|
||||
cout<<"Warning while loading populations: wgtsT2MaxDensity_m3 missmatch.\n";
|
||||
}
|
||||
*load_stream>>wgtsTemp_K;
|
||||
if ( wgtsTemp_K != load_parameter("wgtsTemp_K")) {
|
||||
if ( wgtsTemp_K != load_parameter("TEMP")) {
|
||||
cout<<"Warning while loading populations: wgtsTemp_K missmatch.\n";
|
||||
}
|
||||
goto_nextline(load_stream);
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// postive_E_drift.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 05.10.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef postive_E_drift_h
|
||||
#define postive_E_drift_h
|
||||
|
||||
#include "postive_drift.h"
|
||||
|
||||
class Positive_Mover_E_Drift : public Positive_Mover_Drift {
|
||||
public:
|
||||
Positive_Mover_E_Drift(species this_species, Particle_Logger_Base *Logger, Population_Base *Population) : Positive_Mover_Drift(this_species, Logger, Population) {};
|
||||
|
||||
protected:
|
||||
void do_E_calculus(Particle *movePart, const vec3 &oldLoc_m, const double ¯oSigma_m);
|
||||
};
|
||||
|
||||
|
||||
inline void Positive_Mover_E_Drift::do_E_calculus(Particle *movePart, const vec3 &oldLoc_m, const double ¯oSigma_m) {
|
||||
if (macroSigma_m <= 0) {
|
||||
return;
|
||||
}
|
||||
double t_s = 1/macroSigma_m/calc_vec3_abs(movePart->get_v_ms());
|
||||
vec3 newLoc_m = movePart->get_x_m();
|
||||
vec3 E_Vm = 0.5 * (Katrin_Fields::getElField_Vm(oldLoc_m) + Katrin_Fields::getElField_Vm(newLoc_m));
|
||||
double B_T = calc_vec3_abs( 0.5 * (Katrin_Fields::getMagField_T(oldLoc_m) + Katrin_Fields::getMagField_T(newLoc_m)) );
|
||||
|
||||
double E_rad_Vm = calc_r_m(E_Vm);
|
||||
double v_rad_ms = E_rad_Vm/B_T;
|
||||
vec3 loc_offset_m = E_Vm;
|
||||
loc_offset_m[2] = 0;
|
||||
loc_offset_m = loc_offset_m/calc_vec3_abs(loc_offset_m) * v_rad_ms * t_s;
|
||||
movePart->set_x_m(newLoc_m + loc_offset_m);
|
||||
|
||||
vec3 v_boost_ms = vec3(0,0, movePart->get_Z()*e_C/movePart->get_m_eV()*E_Vm[2] * t_s/c_ms/c_ms);
|
||||
movePart->set_v_ms(movePart->get_v_ms() + v_boost_ms);
|
||||
}
|
||||
|
||||
|
||||
#endif /* postive_E_drift_h */
|
||||
@@ -18,10 +18,11 @@ public:
|
||||
|
||||
protected:
|
||||
void doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double *znew_m);
|
||||
void do_E_calculus(Particle *movePart, const vec3 &oldLoc_m, const double ¯oSigma_m);
|
||||
};
|
||||
|
||||
|
||||
void Positive_Mover_Drift::doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double *znew_m) {
|
||||
inline void Positive_Mover_Drift::doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double *znew_m) {
|
||||
if (*znew_m >= z_WGTS_end_m) {
|
||||
*znew_m = z_WGTS_end_m;
|
||||
}
|
||||
@@ -30,5 +31,8 @@ void Positive_Mover_Drift::doWallInteraction(Particle *movePart, vec3 *oldLoc_m,
|
||||
}
|
||||
}
|
||||
|
||||
inline void Positive_Mover_Drift::do_E_calculus(Particle *movePart, const vec3 &oldLoc_m, const double ¯oSigma_m) {
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* postive_drift_h */
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
const long int Simulation::seed = load_parameter("seed");
|
||||
const long int Simulation::numberTotalDecays = load_parameter("numberTotalDecays");
|
||||
const long int Simulation::simulationStepWidth = load_parameter("simulationStepWidth");
|
||||
const long int Simulation::popCalcDecays = load_parameter("popCalcDecays");
|
||||
const long int Simulation::popCalcStep = load_parameter("popCalcStep");
|
||||
const long int Simulation::seed = load_parameter("SEED");
|
||||
const long int Simulation::numberTotalDecays = load_parameter("DECAYS");
|
||||
const long int Simulation::simulationStepWidth = load_parameter("STEP");
|
||||
const long int Simulation::popCalcDecays = load_parameter("POP_DECAYS");
|
||||
const long int Simulation::popCalcStep = load_parameter("POP_STEP");
|
||||
|
||||
Simulation::Simulation() {
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
const long int Simulation::seed = load_parameter("seed");
|
||||
const long int Simulation::numberTotalDecays = load_parameter("numberTotalDecays");
|
||||
const long int Simulation::simulationStepWidth = load_parameter("simulationStepWidth");
|
||||
const long int Simulation::seed = load_parameter("SEED");
|
||||
const long int Simulation::numberTotalDecays = load_parameter("DECAYS");
|
||||
const long int Simulation::simulationStepWidth = load_parameter("STEP");
|
||||
|
||||
std::string Simulation::calc_outfile_path() {
|
||||
string parname = get_parameter_filenamepath();
|
||||
|
||||
@@ -51,11 +51,11 @@ public:
|
||||
this->rngUni = rngUni;
|
||||
};
|
||||
|
||||
double get_macroSigma_m2(const Particle &interPart);
|
||||
double get_macroSigma_m(const Particle &interPart);
|
||||
private:
|
||||
virtual double get_microSigma_m2(const double &E_eV) = 0;
|
||||
double get_macroSigma_m2_thermal(const Particle &interPart);
|
||||
double get_macroSigma_m2_kinetic(const Particle &interPart, const Sum_bounds &bounds);
|
||||
virtual double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) = 0;
|
||||
double get_macroSigma_m_thermal(const Particle &interPart);
|
||||
double get_macroSigma_m_kinetic(const Particle &interPart, const Sum_bounds &bounds);
|
||||
|
||||
public:
|
||||
virtual InteractionOut do_Interaction (Particle *interPart) = 0;
|
||||
@@ -64,30 +64,31 @@ protected:
|
||||
vec3 get_vOff_ms(const Particle &interPart, const double &minE_eV);
|
||||
};
|
||||
|
||||
inline double Sub_Interaction_Base::get_macroSigma_m2(const Particle &interPart) {
|
||||
inline double Sub_Interaction_Base::get_macroSigma_m(const Particle &interPart) {
|
||||
Sum_bounds bounds = Population->get_sumation_bounds(interPart.get_x_m());
|
||||
if (bounds.num_E_bins <= 1) { //thermal
|
||||
return get_macroSigma_m2_thermal(interPart);
|
||||
return get_macroSigma_m_thermal(interPart);
|
||||
} else { //kinetic
|
||||
return get_macroSigma_m2_kinetic(interPart, bounds);
|
||||
return get_macroSigma_m_kinetic(interPart, bounds);
|
||||
}
|
||||
}
|
||||
|
||||
inline double Sub_Interaction_Base::get_macroSigma_m2_thermal(const Particle &interPart) {
|
||||
inline double Sub_Interaction_Base::get_macroSigma_m_thermal(const Particle &interPart) {
|
||||
double E_eV = interPart.get_E_eV();
|
||||
double microSigma_m2 = get_microSigma_m2(E_eV);
|
||||
vec3 loc_m = interPart.get_x_m();
|
||||
double microSigma_m2 = get_microSigma_m2(E_eV, loc_m);
|
||||
double n_target_m3 = Population->get_density_m3(loc_m);
|
||||
return microSigma_m2*n_target_m3;
|
||||
}
|
||||
|
||||
inline double Sub_Interaction_Base::get_macroSigma_m2_kinetic(const Particle &interPart, const Sum_bounds &bounds) {
|
||||
inline double Sub_Interaction_Base::get_macroSigma_m_kinetic(const Particle &interPart, const Sum_bounds &bounds) {
|
||||
// integrate over all energy bins, consider interPart.E_eV << E_eV.
|
||||
vec3 loc_m = interPart.get_x_m();
|
||||
Content cont;
|
||||
double macro_Sigma_m2 = 0;
|
||||
for (int E_bin = 0; E_bin< bounds.num_E_bins; E_bin++) {
|
||||
cont = Population->get_density_m3(E_bin, bounds.loc_bins);
|
||||
macro_Sigma_m2 += get_microSigma_m2(cont.E_eV) * cont.n_m3;
|
||||
macro_Sigma_m2 += get_microSigma_m2(cont.E_eV, loc_m) * cont.n_m3;
|
||||
}
|
||||
return macro_Sigma_m2;
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
|
||||
#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");
|
||||
const int Terminator_Builder::maxInteractions = load_parameter("TERM_MAX");
|
||||
const double Terminator_Builder::dipole_cutoffE_eV = load_parameter("TERM_DI_E");
|
||||
const double Terminator_Builder::cutoffEnergy_eV = load_parameter("TERM_E");
|
||||
|
||||
|
||||
Terminator_Manager Terminator_Builder::build() {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "read_system.h"
|
||||
|
||||
|
||||
const double Timer::wgtsT2MaxDensity_m3 = load_parameter("wgtsT2MaxDensity_m3");
|
||||
const double Timer::wgtsT2MaxDensity_m3 = load_parameter("T2_MAXDENS");
|
||||
using namespace std;
|
||||
|
||||
/*
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
const double T2_Population::wgtsT2MaxDensity_m3 = load_parameter("wgtsT2MaxDensity_m3");
|
||||
const double T2_Population::wgtsT2MaxDensity_m3 = load_parameter("T2_MAXDENS");
|
||||
|
||||
inline void T2_Population::set_regimes() {
|
||||
n_regimes = 4;
|
||||
|
||||
Reference in New Issue
Block a user