Prepared structure for precalculating values.
Reduced number of energy bins and intergration precision to 5.
This commit is contained in:
@@ -13,9 +13,9 @@
|
|||||||
#include "janev_T2IT2_cluster.h"
|
#include "janev_T2IT2_cluster.h"
|
||||||
|
|
||||||
|
|
||||||
class T2IT2_Cluster : public Sub_Interaction_Base {
|
class T2IT2_Cluster : public TI_thermal_Interaction_Base {
|
||||||
public:
|
public:
|
||||||
T2IT2_Cluster(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {}
|
T2IT2_Cluster(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_Interaction_Base(T2Population, rngUni) {}
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {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);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
#include "janev_T2IT2_cx.h"
|
#include "janev_T2IT2_cx.h"
|
||||||
|
|
||||||
|
|
||||||
class T2IT2_CX : public Sub_Interaction_Base {
|
class T2IT2_CX : public TI_thermal_Interaction_Base {
|
||||||
Elastic_Kinematic_Base kinematics;
|
Elastic_Kinematic_Base kinematics;
|
||||||
public:
|
public:
|
||||||
T2IT2_CX(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni), kinematics(2*mT_eV, 2*mT_eV) {}
|
T2IT2_CX(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_Interaction_Base(T2Population, rngUni), kinematics(2*mT_eV, 2*mT_eV) {}
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {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);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,9 +13,9 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
#include "janev_eT2I_disexc.h"
|
#include "janev_eT2I_disexc.h"
|
||||||
|
|
||||||
class T2Ie_DissExc : public Sub_Interaction_Base {
|
class T2Ie_DissExc : public Interaction_Base {
|
||||||
public:
|
public:
|
||||||
T2Ie_DissExc(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
T2Ie_DissExc(Population_Base *ePopulation, UniRNG *rngUni) : Interaction_Base(ePopulation, rngUni) {}
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {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);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
#include "janev_eT2I_recombination.h"
|
#include "janev_eT2I_recombination.h"
|
||||||
|
|
||||||
class T2Ie_Recombination : public Sub_Interaction_Base {
|
class T2Ie_Recombination : public TI_e_Interaction_Base {
|
||||||
public:
|
public:
|
||||||
T2Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
T2Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : TI_e_Interaction_Base(ePopulation, rngUni) {}
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||||
return Janev_eT2I_Recombination::get_TCS(E_eV);
|
return Janev_eT2I_Recombination::get_TCS(E_eV);
|
||||||
|
|||||||
@@ -13,12 +13,12 @@
|
|||||||
#include "tabata_T3IT2_elastic.h"
|
#include "tabata_T3IT2_elastic.h"
|
||||||
|
|
||||||
|
|
||||||
class T3IT2_Elastic : public Sub_Interaction_Base {
|
class T3IT2_Elastic : public TI_thermal_Interaction_Base {
|
||||||
Tabata_T3IT2_Elastic tcs_gen;
|
Tabata_T3IT2_Elastic tcs_gen;
|
||||||
Elastic_Kinematic_Base kinematics;
|
Elastic_Kinematic_Base kinematics;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
T3IT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni), kinematics(3*mT_eV, 2*mT_eV) {};
|
T3IT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_Interaction_Base(T2Population, rngUni), kinematics(3*mT_eV, 2*mT_eV) {};
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {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);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
// CS from Gerlich:
|
// CS from Gerlich:
|
||||||
|
|
||||||
class T3IT2_RadAsc : public Sub_Interaction_Base {
|
class T3IT2_RadAsc : public TI_thermal_Interaction_Base {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
T3IT2_RadAsc(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {};
|
T3IT2_RadAsc(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_Interaction_Base(T2Population, rngUni) {};
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
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);
|
double v_ms = calc_v_ms_from_E_eV(E_eV, 3*mT_eV);
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
// CS from Gerlich:
|
// CS from Gerlich:
|
||||||
|
|
||||||
class T3IT2_TerAsc : public Sub_Interaction_Base {
|
class T3IT2_TerAsc : public TI_thermal_Interaction_Base {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
T3IT2_TerAsc(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {};
|
T3IT2_TerAsc(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_Interaction_Base(T2Population, rngUni) {};
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
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);
|
double v_ms = calc_v_ms_from_E_eV(E_eV, 3*mT_eV);
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
#include "janev_eT3I_disexc.h"
|
#include "janev_eT3I_disexc.h"
|
||||||
|
|
||||||
class T3Ie_DissExc : public Sub_Interaction_Base {
|
class T3Ie_DissExc : public Interaction_Base {
|
||||||
public:
|
public:
|
||||||
T3Ie_DissExc(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
T3Ie_DissExc(Population_Base *ePopulation, UniRNG *rngUni) : Interaction_Base(ePopulation, rngUni) {}
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {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);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
|
|||||||
@@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
#include "janev_eT3I_recombination.h"
|
#include "janev_eT3I_recombination.h"
|
||||||
|
|
||||||
class T3Ie_Recombination : public Sub_Interaction_Base {
|
class T3Ie_Recombination : public TI_e_Interaction_Base {
|
||||||
public:
|
public:
|
||||||
T3Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
T3Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : TI_e_Interaction_Base(ePopulation, rngUni) {}
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||||
return Janev_eT3I_Recombination::get_TCS(E_eV);
|
return Janev_eT3I_Recombination::get_TCS(E_eV);
|
||||||
|
|||||||
@@ -10,12 +10,12 @@
|
|||||||
#define T5IT2_elastic_h
|
#define T5IT2_elastic_h
|
||||||
|
|
||||||
|
|
||||||
class T5IT2_Elastic : public Sub_Interaction_Base {
|
class T5IT2_Elastic : public TI_thermal_Interaction_Base {
|
||||||
Tabata_T3IT2_Elastic tcs_gen; // Obviously wrong, but should be good enough.
|
Tabata_T3IT2_Elastic tcs_gen; // Obviously wrong, but should be good enough.
|
||||||
Elastic_Kinematic_Base kinematics;
|
Elastic_Kinematic_Base kinematics;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
T5IT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni), kinematics(5*mT_eV, 2*mT_eV) {};
|
T5IT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_Interaction_Base(T2Population, rngUni), kinematics(5*mT_eV, 2*mT_eV) {};
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {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);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
|
|
||||||
#include "petterson_eT5I_recombination.h"
|
#include "petterson_eT5I_recombination.h"
|
||||||
|
|
||||||
class T5Ie_Recombination : public Sub_Interaction_Base {
|
class T5Ie_Recombination : public TI_e_Interaction_Base {
|
||||||
public:
|
public:
|
||||||
T5Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : Sub_Interaction_Base(ePopulation, rngUni) {}
|
T5Ie_Recombination(Population_Base *ePopulation, UniRNG *rngUni) : TI_e_Interaction_Base(ePopulation, rngUni) {}
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||||
return Pettersson_eT5I_Recombination::get_TCS(E_eV);
|
return Pettersson_eT5I_Recombination::get_TCS(E_eV);
|
||||||
|
|||||||
@@ -14,12 +14,12 @@
|
|||||||
#include "tabata_TIT2_elastic.h"
|
#include "tabata_TIT2_elastic.h"
|
||||||
|
|
||||||
|
|
||||||
class TIT2_Elastic : public Sub_Interaction_Base {
|
class TIT2_Elastic : public TI_thermal_Interaction_Base {
|
||||||
Tabata_TIT2_Elastic tcs_gen;
|
Tabata_TIT2_Elastic tcs_gen;
|
||||||
Elastic_Kinematic_Base kinematics;
|
Elastic_Kinematic_Base kinematics;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TIT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni), kinematics(mT_eV, 2*mT_eV) {};
|
TIT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_Interaction_Base(T2Population, rngUni), kinematics(mT_eV, 2*mT_eV) {};
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {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);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
// CS from Plasil:2012
|
// CS from Plasil:2012
|
||||||
|
|
||||||
class TIT2_RadAsc : public Sub_Interaction_Base {
|
class TIT2_RadAsc : public TI_thermal_Interaction_Base {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TIT2_RadAsc(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {};
|
TIT2_RadAsc(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_Interaction_Base(T2Population, rngUni) {};
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
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);
|
double v_ms = calc_v_ms_from_E_eV(E_eV, mT_eV);
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
// CS from Plasil:2012
|
// CS from Plasil:2012
|
||||||
|
|
||||||
class TIT2_TerAsc : public Sub_Interaction_Base {
|
class TIT2_TerAsc : public TI_thermal_Interaction_Base {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TIT2_TerAsc(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {};
|
TIT2_TerAsc(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_Interaction_Base(T2Population, rngUni) {};
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
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);
|
double v_ms = calc_v_ms_from_E_eV(E_eV, mT_eV);
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
#include "janev_eT2I_recombination.h"
|
#include "janev_eT2I_recombination.h"
|
||||||
|
|
||||||
class eT2I_Recombination : public Sub_Interaction_Base {
|
class eT2I_Recombination : public e_thermal_Interaction_Base {
|
||||||
public:
|
public:
|
||||||
eT2I_Recombination(Population_Base *T2IPopulation, UniRNG *rngUni) : Sub_Interaction_Base(T2IPopulation, rngUni) {}
|
eT2I_Recombination(Population_Base *T2IPopulation, UniRNG *rngUni) : e_thermal_Interaction_Base(T2IPopulation, rngUni) {}
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||||
return Janev_eT2I_Recombination::get_TCS(E_eV);
|
return Janev_eT2I_Recombination::get_TCS(E_eV);
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
#include "dcs_base.h"
|
#include "dcs_base.h"
|
||||||
|
|
||||||
|
|
||||||
class eT2_Elastic : public Sub_Interaction_Base {
|
class eT2_Elastic : public e_thermal_Interaction_Base {
|
||||||
TCS_Container tcs_data;
|
TCS_Container tcs_data;
|
||||||
DCS_Base *dcs_gen;
|
DCS_Base *dcs_gen;
|
||||||
Elastic_Kinematic_Base kinematics;
|
Elastic_Kinematic_Base kinematics;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
eT2_Elastic(Population_Base *T2Population, UniRNG *rngUni, DCS_Base *dcs_gen) : Sub_Interaction_Base(T2Population, rngUni),
|
eT2_Elastic(Population_Base *T2Population, UniRNG *rngUni, DCS_Base *dcs_gen) : e_thermal_Interaction_Base(T2Population, rngUni),
|
||||||
tcs_data(scale_start, scale_end, 1e3, get_data_path() + "eT2_ela_TCS.dat"),
|
tcs_data(scale_start, scale_end, 1e3, get_data_path() + "eT2_ela_TCS.dat"),
|
||||||
kinematics(me_eV, 2*mT_eV) {
|
kinematics(me_eV, 2*mT_eV) {
|
||||||
this->dcs_gen = dcs_gen;
|
this->dcs_gen = dcs_gen;
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
Ionization:
|
Ionization:
|
||||||
Using BED-Model Kim and Rudd 1994
|
Using BED-Model Kim and Rudd 1994
|
||||||
*/
|
*/
|
||||||
class eT2_Ionization_Base : public Sub_Interaction_Base {
|
class eT2_Ionization_Base : public e_thermal_Interaction_Base {
|
||||||
double deltaE_eV;
|
double deltaE_eV;
|
||||||
public:
|
public:
|
||||||
eT2_Ionization_Base(Population_Base *T2Population, UniRNG *rngUni, double deltaE_eV) : Sub_Interaction_Base(T2Population, rngUni){
|
eT2_Ionization_Base(Population_Base *T2Population, UniRNG *rngUni, double deltaE_eV) : e_thermal_Interaction_Base(T2Population, rngUni){
|
||||||
this->deltaE_eV = deltaE_eV;
|
this->deltaE_eV = deltaE_eV;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
#include "janev_eT3I_recombination.h"
|
#include "janev_eT3I_recombination.h"
|
||||||
|
|
||||||
class eT3I_Recombination : public Sub_Interaction_Base {
|
class eT3I_Recombination : public e_thermal_Interaction_Base {
|
||||||
public:
|
public:
|
||||||
eT3I_Recombination(Population_Base *T3IPopulation, UniRNG *rngUni) : Sub_Interaction_Base(T3IPopulation, rngUni) {}
|
eT3I_Recombination(Population_Base *T3IPopulation, UniRNG *rngUni) : e_thermal_Interaction_Base(T3IPopulation, rngUni) {}
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {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);
|
InteractionOut do_Interaction (Particle *interPart);
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
#include "sub_interaction_base.h"
|
#include "sub_interaction_base.h"
|
||||||
#include "petterson_eT5I_recombination.h"
|
#include "petterson_eT5I_recombination.h"
|
||||||
|
|
||||||
class eT5I_Recombination : public Sub_Interaction_Base {
|
class eT5I_Recombination : public e_thermal_Interaction_Base {
|
||||||
public:
|
public:
|
||||||
eT5I_Recombination(Population_Base *T5IPopulation, UniRNG *rngUni) : Sub_Interaction_Base(T5IPopulation, rngUni) {}
|
eT5I_Recombination(Population_Base *T5IPopulation, UniRNG *rngUni) : e_thermal_Interaction_Base(T5IPopulation, rngUni) {}
|
||||||
|
|
||||||
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
||||||
return Pettersson_eT5I_Recombination::get_TCS(E_eV);
|
return Pettersson_eT5I_Recombination::get_TCS(E_eV);
|
||||||
|
|||||||
@@ -12,13 +12,13 @@
|
|||||||
#include "tcs_container.hpp"
|
#include "tcs_container.hpp"
|
||||||
#include "dcs_base.h"
|
#include "dcs_base.h"
|
||||||
|
|
||||||
class Excitation_Base : public Sub_Interaction_Base {
|
class Excitation_Base : public e_thermal_Interaction_Base {
|
||||||
DCS_Base *dcs_gen;
|
DCS_Base *dcs_gen;
|
||||||
protected:
|
protected:
|
||||||
double deltaE_eV;
|
double deltaE_eV;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Excitation_Base(Population_Base *Population, UniRNG *rngUni, double deltaE_eV, DCS_Base *dcs_gen) : Sub_Interaction_Base(Population, rngUni) {
|
Excitation_Base(Population_Base *Population, UniRNG *rngUni, double deltaE_eV, DCS_Base *dcs_gen) : e_thermal_Interaction_Base(Population, rngUni) {
|
||||||
this->deltaE_eV = deltaE_eV;
|
this->deltaE_eV = deltaE_eV;
|
||||||
this->dcs_gen = dcs_gen;
|
this->dcs_gen = dcs_gen;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,24 +15,24 @@
|
|||||||
#include "process_base.h"
|
#include "process_base.h"
|
||||||
|
|
||||||
|
|
||||||
class Interaction_Base : public Process_Base {
|
class Interaction_Channel_Base : public Process_Base {
|
||||||
Sub_Interaction_Base **SubInteractions;
|
Interaction_Base **SubInteractions;
|
||||||
int numSubInteractions = 0;
|
int numSubInteractions = 0;
|
||||||
|
|
||||||
UniRNG *rngUni;
|
UniRNG *rngUni;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Interaction_Base(species this_species, UniRNG *rngUni) : Process_Base (this_species) {
|
Interaction_Channel_Base(species this_species, UniRNG *rngUni) : Process_Base (this_species) {
|
||||||
this->rngUni = rngUni;
|
this->rngUni = rngUni;
|
||||||
};
|
};
|
||||||
|
|
||||||
void add(Sub_Interaction_Base *addSubInteraction);
|
void add(Interaction_Base *addSubInteraction);
|
||||||
|
|
||||||
InteractionOut do_Interaction(Particle *interPart);
|
InteractionOut do_Interaction(Particle *interPart);
|
||||||
double get_macroSigma_m(const Particle &interPart);
|
double get_macroSigma_m(const Particle &interPart);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline InteractionOut Interaction_Base::do_Interaction(Particle *interPart) {
|
inline InteractionOut Interaction_Channel_Base::do_Interaction(Particle *interPart) {
|
||||||
double macroSigma_m = get_macroSigma_m(*interPart);
|
double macroSigma_m = get_macroSigma_m(*interPart);
|
||||||
double currentStackedSigma = 0;
|
double currentStackedSigma = 0;
|
||||||
double targetStackedSigma = rngUni->random() * macroSigma_m;
|
double targetStackedSigma = rngUni->random() * macroSigma_m;
|
||||||
@@ -44,12 +44,12 @@ inline InteractionOut Interaction_Base::do_Interaction(Particle *interPart) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss<<"Interaction_Base::do_Interaction: No Interactions added.\n";
|
ss<<"Interaction_Channel_Base::do_Interaction: No Interactions added.\n";
|
||||||
throw MyException (ss.str());
|
throw MyException (ss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline double Interaction_Base::get_macroSigma_m(const Particle &interPart) {
|
inline double Interaction_Channel_Base::get_macroSigma_m(const Particle &interPart) {
|
||||||
double macroSigma_m = 0;
|
double macroSigma_m = 0;
|
||||||
for (int i = 0; i < numSubInteractions; i++) {
|
for (int i = 0; i < numSubInteractions; i++) {
|
||||||
macroSigma_m += SubInteractions[i]->get_macroSigma_m(interPart);
|
macroSigma_m += SubInteractions[i]->get_macroSigma_m(interPart);
|
||||||
@@ -57,19 +57,19 @@ inline double Interaction_Base::get_macroSigma_m(const Particle &interPart) {
|
|||||||
return macroSigma_m;
|
return macroSigma_m;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Interaction_Base::add(Sub_Interaction_Base *addSubInteraction) {
|
inline void Interaction_Channel_Base::add(Interaction_Base *addSubInteraction) {
|
||||||
if (numSubInteractions != 0) {
|
if (numSubInteractions != 0) {
|
||||||
Sub_Interaction_Base *tempArray[numSubInteractions];
|
Interaction_Base *tempArray[numSubInteractions];
|
||||||
for (int i = 0; i < numSubInteractions; i++) {
|
for (int i = 0; i < numSubInteractions; i++) {
|
||||||
tempArray[i] = SubInteractions[i];
|
tempArray[i] = SubInteractions[i];
|
||||||
}
|
}
|
||||||
delete[] SubInteractions;
|
delete[] SubInteractions;
|
||||||
SubInteractions = new Sub_Interaction_Base *[numSubInteractions + 1];
|
SubInteractions = new Interaction_Base *[numSubInteractions + 1];
|
||||||
for (int i = 0; i < numSubInteractions; i++) {
|
for (int i = 0; i < numSubInteractions; i++) {
|
||||||
SubInteractions[i] = tempArray[i];
|
SubInteractions[i] = tempArray[i];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SubInteractions = new Sub_Interaction_Base *[numSubInteractions + 1];
|
SubInteractions = new Interaction_Base *[numSubInteractions + 1];
|
||||||
}
|
}
|
||||||
SubInteractions[numSubInteractions] = addSubInteraction;
|
SubInteractions[numSubInteractions] = addSubInteraction;
|
||||||
numSubInteractions += 1;
|
numSubInteractions += 1;
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ Interaction_Manager Interaction_Builder::build(Population_Manager *Populations,
|
|||||||
Interactions.add(build_tritium5I(Populations, rngUni));
|
Interactions.add(build_tritium5I(Populations, rngUni));
|
||||||
return Interactions;
|
return Interactions;
|
||||||
}
|
}
|
||||||
Interaction_Base* Interaction_Builder::build_electron(Population_Manager *Populations, UniRNG *rngUni) {
|
Interaction_Channel_Base* Interaction_Builder::build_electron(Population_Manager *Populations, UniRNG *rngUni) {
|
||||||
Interaction_Base *eInteraction = new Interaction_Base(electron, rngUni);
|
Interaction_Channel_Base *eInteraction = new Interaction_Channel_Base(electron, rngUni);
|
||||||
Population_Base *T2Population = Populations->find(tritium2);
|
Population_Base *T2Population = Populations->find(tritium2);
|
||||||
Population_Base *T2IPopulation = Populations->find(tritium2I);
|
Population_Base *T2IPopulation = Populations->find(tritium2I);
|
||||||
Population_Base *T3IPopulation = Populations->find(tritium3I);
|
Population_Base *T3IPopulation = Populations->find(tritium3I);
|
||||||
@@ -130,7 +130,7 @@ Interaction_Base* Interaction_Builder::build_electron(Population_Manager *Popula
|
|||||||
return eInteraction;
|
return eInteraction;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interaction_Builder::build_e_el_janev(Interaction_Base* eInteraction, UniRNG *rngUni, Population_Base *T2Population, DCS_Base *exc_dcs) {
|
void Interaction_Builder::build_e_el_janev(Interaction_Channel_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(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(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(Bpp1Sigu), exc_dcs));
|
||||||
@@ -150,7 +150,7 @@ void Interaction_Builder::build_e_el_janev(Interaction_Base* eInteraction, UniRN
|
|||||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(d3Piu), 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) {
|
void Interaction_Builder::build_e_el_exp(Interaction_Channel_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, 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.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.76, exc_dcs, "el_exc_c3piu.dat"));
|
||||||
@@ -161,13 +161,13 @@ void Interaction_Builder::build_e_el_exp(Interaction_Base* eInteraction, UniRNG
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Interaction_Base* Interaction_Builder::build_tritium(Population_Manager *Populations, UniRNG *rngUni) {
|
Interaction_Channel_Base* Interaction_Builder::build_tritium(Population_Manager *Populations, UniRNG *rngUni) {
|
||||||
Interaction_Base *T_Interaction = new Interaction_Base(tritium, rngUni);
|
Interaction_Channel_Base *T_Interaction = new Interaction_Channel_Base(tritium, rngUni);
|
||||||
return T_Interaction;
|
return T_Interaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
Interaction_Base* Interaction_Builder::build_tritiumI(Population_Manager *Populations, UniRNG *rngUni) {
|
Interaction_Channel_Base* Interaction_Builder::build_tritiumI(Population_Manager *Populations, UniRNG *rngUni) {
|
||||||
Interaction_Base *TI_Interaction = new Interaction_Base(tritiumI, rngUni);
|
Interaction_Channel_Base *TI_Interaction = new Interaction_Channel_Base(tritiumI, rngUni);
|
||||||
Population_Base *T2Population = Populations->find(tritium2);
|
Population_Base *T2Population = Populations->find(tritium2);
|
||||||
TI_Interaction->add(new TIT2_Elastic(T2Population, rngUni));
|
TI_Interaction->add(new TIT2_Elastic(T2Population, rngUni));
|
||||||
TI_Interaction->add (new TIT2_RadAsc(T2Population, rngUni));
|
TI_Interaction->add (new TIT2_RadAsc(T2Population, rngUni));
|
||||||
@@ -175,8 +175,8 @@ Interaction_Base* Interaction_Builder::build_tritiumI(Population_Manager *Popula
|
|||||||
return TI_Interaction;
|
return TI_Interaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
Interaction_Base* Interaction_Builder::build_tritium2I(Population_Manager *Populations, UniRNG *rngUni) {
|
Interaction_Channel_Base* Interaction_Builder::build_tritium2I(Population_Manager *Populations, UniRNG *rngUni) {
|
||||||
Interaction_Base *T2I_Interaction = new Interaction_Base(tritium2I, rngUni);
|
Interaction_Channel_Base *T2I_Interaction = new Interaction_Channel_Base(tritium2I, rngUni);
|
||||||
Population_Base *T2Population = Populations->find(tritium2);
|
Population_Base *T2Population = Populations->find(tritium2);
|
||||||
Population_Base *ePopulation = Populations->find(electron);
|
Population_Base *ePopulation = Populations->find(electron);
|
||||||
|
|
||||||
@@ -191,8 +191,8 @@ Interaction_Base* Interaction_Builder::build_tritium2I(Population_Manager *Popul
|
|||||||
return T2I_Interaction ;
|
return T2I_Interaction ;
|
||||||
}
|
}
|
||||||
|
|
||||||
Interaction_Base* Interaction_Builder::build_tritium3I(Population_Manager *Populations, UniRNG *rngUni) {
|
Interaction_Channel_Base* Interaction_Builder::build_tritium3I(Population_Manager *Populations, UniRNG *rngUni) {
|
||||||
Interaction_Base *T3I_Interaction = new Interaction_Base(tritium3I, rngUni);
|
Interaction_Channel_Base *T3I_Interaction = new Interaction_Channel_Base(tritium3I, rngUni);
|
||||||
Population_Base *T2Population = Populations->find(tritium2);
|
Population_Base *T2Population = Populations->find(tritium2);
|
||||||
Population_Base *ePopulation = Populations->find(electron);
|
Population_Base *ePopulation = Populations->find(electron);
|
||||||
T3I_Interaction->add(new T3IT2_Elastic(T2Population, rngUni));
|
T3I_Interaction->add(new T3IT2_Elastic(T2Population, rngUni));
|
||||||
@@ -209,8 +209,8 @@ Interaction_Base* Interaction_Builder::build_tritium3I(Population_Manager *Popul
|
|||||||
return T3I_Interaction ;
|
return T3I_Interaction ;
|
||||||
}
|
}
|
||||||
|
|
||||||
Interaction_Base* Interaction_Builder::build_tritium5I(Population_Manager *Populations, UniRNG *rngUni) {
|
Interaction_Channel_Base* Interaction_Builder::build_tritium5I(Population_Manager *Populations, UniRNG *rngUni) {
|
||||||
Interaction_Base *T5I_Interaction = new Interaction_Base(tritium5I, rngUni);
|
Interaction_Channel_Base *T5I_Interaction = new Interaction_Channel_Base(tritium5I, rngUni);
|
||||||
Population_Base *T2Population = Populations->find(tritium2);
|
Population_Base *T2Population = Populations->find(tritium2);
|
||||||
Population_Base *ePopulation = Populations->find(electron);
|
Population_Base *ePopulation = Populations->find(electron);
|
||||||
T5I_Interaction->add(new T5IT2_Elastic(T2Population, rngUni));
|
T5I_Interaction->add(new T5IT2_Elastic(T2Population, rngUni));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "exc_base.h"
|
#include "exc_base.h"
|
||||||
#include "population_builder.hpp"
|
#include "population_builder.hpp"
|
||||||
|
|
||||||
typedef Manager_Base<Interaction_Base> Interaction_Manager;
|
typedef Manager_Base<Interaction_Channel_Base> Interaction_Manager;
|
||||||
|
|
||||||
class Interaction_Builder {
|
class Interaction_Builder {
|
||||||
public:
|
public:
|
||||||
@@ -23,15 +23,15 @@ public:
|
|||||||
|
|
||||||
static Interaction_Manager build(Population_Manager *Populations, UniRNG *rngUni);
|
static Interaction_Manager build(Population_Manager *Populations, UniRNG *rngUni);
|
||||||
private:
|
private:
|
||||||
static Interaction_Base* build_electron(Population_Manager *Populations, UniRNG *rngUni);
|
static Interaction_Channel_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_janev(Interaction_Channel_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 void build_e_el_exp(Interaction_Channel_Base* eInteraction, UniRNG *rngUni, Population_Base *T2Population, DCS_Base *exc_dcs);
|
||||||
|
|
||||||
static Interaction_Base* build_tritium(Population_Manager *Populations, UniRNG *rngUni);
|
static Interaction_Channel_Base* build_tritium(Population_Manager *Populations, UniRNG *rngUni);
|
||||||
static Interaction_Base* build_tritiumI(Population_Manager *Populations, UniRNG *rngUni);
|
static Interaction_Channel_Base* build_tritiumI(Population_Manager *Populations, UniRNG *rngUni);
|
||||||
static Interaction_Base* build_tritium2I(Population_Manager *Populations, UniRNG *rngUni);
|
static Interaction_Channel_Base* build_tritium2I(Population_Manager *Populations, UniRNG *rngUni);
|
||||||
static Interaction_Base* build_tritium3I(Population_Manager *Populations, UniRNG *rngUni);
|
static Interaction_Channel_Base* build_tritium3I(Population_Manager *Populations, UniRNG *rngUni);
|
||||||
static Interaction_Base* build_tritium5I(Population_Manager *Populations, UniRNG *rngUni);
|
static Interaction_Channel_Base* build_tritium5I(Population_Manager *Populations, UniRNG *rngUni);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
vec3 roll_v_ms (const vec3 &loc_m);
|
vec3 roll_v_ms (const vec3 &loc_m);
|
||||||
vec3 get_drift_v_ms(const vec3 &loc_m) {return vec3(0,0,0);} // Dummy as integration is made over energy mids
|
vec3 get_drift_v_ms(const vec3 &loc_m) {return vec3(0,0,0);} // Dummy as integration is made over energy mids
|
||||||
double get_thermal_v_ms(const vec3 &loc_m) {return 0;} // Dummy as integration is made over energy mids
|
double get_thermal_v_ms() {return 0;} // Dummy as integration is made over energy mids
|
||||||
|
|
||||||
Population_Container *access_container();
|
Population_Container *access_container();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ void Particle_Looper::do_loops(int target_decays) {
|
|||||||
void Particle_Looper::process_first(std::queue<Particle> *particle_queue) {
|
void Particle_Looper::process_first(std::queue<Particle> *particle_queue) {
|
||||||
Particle curPart = particle_queue->front();
|
Particle curPart = particle_queue->front();
|
||||||
Mover_Base *moverPtr = movers.find(curPart.get_species());
|
Mover_Base *moverPtr = movers.find(curPart.get_species());
|
||||||
Interaction_Base *interactionPtr = interactions.find(curPart.get_species());
|
Interaction_Channel_Base *interactionPtr = interactions.find(curPart.get_species());
|
||||||
Terminator_Base *terminatorPtr = terminators.find(curPart.get_species());
|
Terminator_Base *terminatorPtr = terminators.find(curPart.get_species());
|
||||||
|
|
||||||
InteractionOut IntOut;
|
InteractionOut IntOut;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
|
|
||||||
virtual vec3 roll_v_ms (const vec3 &loc_m) = 0;
|
virtual vec3 roll_v_ms (const vec3 &loc_m) = 0;
|
||||||
virtual vec3 get_drift_v_ms(const vec3 &loc_m) = 0;
|
virtual vec3 get_drift_v_ms(const vec3 &loc_m) = 0;
|
||||||
virtual double get_thermal_v_ms(const vec3 &loc_m) = 0;
|
virtual double get_thermal_v_ms() = 0;
|
||||||
|
|
||||||
virtual Population_Container *access_container() = 0;
|
virtual Population_Container *access_container() = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Population_Manager Population_Builder::build(Timer *timer,UniRNG *rngUni, Normal
|
|||||||
int num_z_bins = 13;
|
int num_z_bins = 13;
|
||||||
int num_r_bins = 5;
|
int num_r_bins = 5;
|
||||||
int num_phi_bins = 1;
|
int num_phi_bins = 1;
|
||||||
int num_E_bins = 100;
|
int num_E_bins = 50;
|
||||||
Populations.add(new Kinetic_Population(electron, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins));
|
Populations.add(new Kinetic_Population(electron, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins));
|
||||||
if (v_flow == -1) {
|
if (v_flow == -1) {
|
||||||
Populations.add(new Thermal_Population(tritium, new WGTS_Kinematics(mT_eV, wgtsTemp_K, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
Populations.add(new Thermal_Population(tritium, new WGTS_Kinematics(mT_eV, wgtsTemp_K, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||||
|
|||||||
@@ -41,14 +41,153 @@ public:
|
|||||||
Particle *get_new_particles() {return new_particles;}
|
Particle *get_new_particles() {return new_particles;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Interaction_Base {
|
||||||
|
protected:
|
||||||
|
Population_Base *Population;
|
||||||
|
UniRNG *rngUni;
|
||||||
|
public:
|
||||||
|
Interaction_Base(Population_Base *Population, UniRNG *rngUni) {
|
||||||
|
this->Population = Population;
|
||||||
|
this->rngUni = rngUni;
|
||||||
|
};
|
||||||
|
virtual double get_macroSigma_m(const Particle &interPart) = 0;
|
||||||
|
virtual InteractionOut do_Interaction (Particle *interPart) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
class Sub_Interaction_Base {
|
class e_thermal_Interaction_Base : public Interaction_Base { // Interactions of electrons with thermal Populations
|
||||||
|
double v_thermal_ms, v_limit_ms;
|
||||||
|
|
||||||
|
public:
|
||||||
|
e_thermal_Interaction_Base(Population_Base *Population, UniRNG *rngUni) : Interaction_Base(Population, rngUni) {
|
||||||
|
Sum_bounds bounds = Population->get_sumation_bounds(vec3(0,0,0));
|
||||||
|
if (bounds.num_E_bins > 1) {
|
||||||
|
throw MyException("Population is not thermal, when expected thermal.");
|
||||||
|
}
|
||||||
|
v_thermal_ms = Population->get_thermal_v_ms(); // Typical Speed of "Thermal Blur"
|
||||||
|
v_limit_ms = v_thermal_ms * 2000;
|
||||||
|
}
|
||||||
|
|
||||||
|
double get_macroSigma_m(const Particle &interPart) {
|
||||||
|
// Calulate average interaction cross section by integration over theta
|
||||||
|
vec3 loc_m = interPart.get_x_m();
|
||||||
|
double m_eV = interPart.get_m_eV();
|
||||||
|
double v1_ms = calc_vec3_abs(interPart.get_v_ms() - Population->get_drift_v_ms(loc_m)); // Shift to "Labframe without thermal blur"
|
||||||
|
double micro_sigma;
|
||||||
|
if (v1_ms > v_limit_ms) { // 0.005 represents 1% variation in energy
|
||||||
|
double E_eV = m_eV/2 * pow(v1_ms/c_ms,2);
|
||||||
|
micro_sigma = get_microSigma_m2(E_eV, loc_m);
|
||||||
|
} else {
|
||||||
|
auto integrand = [&](double theta) {
|
||||||
|
double E_eV = m_eV/2 * (pow(v1_ms,2) + pow(v_thermal_ms,2) - 2*v1_ms*v_thermal_ms*cos(theta)) * pow(c_ms, -2);
|
||||||
|
return get_microSigma_m2(E_eV, loc_m);
|
||||||
|
};
|
||||||
|
micro_sigma = integrate(integrand, 0., pi, 5, simpson());
|
||||||
|
}
|
||||||
|
return micro_sigma*Population->get_density_m3(loc_m);
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
virtual double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
vec3 get_vOff_ms(const Particle &interPart, const double &minE_eV) { // Get energy after los
|
||||||
|
double m_eV = interPart.get_m_eV();
|
||||||
|
vec3 v1_ms = interPart.get_v_ms();
|
||||||
|
vec3 v2_ms = Population->roll_v_ms(interPart.get_x_m());
|
||||||
|
vec3 v1Lab_ms = v1_ms - v2_ms;
|
||||||
|
double T_eV = calc_E_eV_from_v_ms(v1Lab_ms, m_eV);
|
||||||
|
if (T_eV < minE_eV) {
|
||||||
|
T_eV = calc_E_eV_from_v_ms(v1_ms, m_eV);
|
||||||
|
if (T_eV < minE_eV) {
|
||||||
|
std::stringstream ss;
|
||||||
|
ss<<"Interaction_Base::get_vOff_ms: T_eV < minE_eV.\nT_eV= "<< T_eV<<"\t minE_eV= "<<minE_eV<<"\n";
|
||||||
|
throw MyException (ss.str());
|
||||||
|
}
|
||||||
|
return vec3(0,0,0);
|
||||||
|
}
|
||||||
|
return v2_ms;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class TI_thermal_Interaction_Base : public Interaction_Base { // Interactions of ions with thermal Populations
|
||||||
|
double v_thermal_ms;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TI_thermal_Interaction_Base(Population_Base *Population, UniRNG *rngUni) : Interaction_Base(Population, rngUni) {
|
||||||
|
Sum_bounds bounds = Population->get_sumation_bounds(vec3(0,0,0));
|
||||||
|
if (bounds.num_E_bins > 1) {
|
||||||
|
throw MyException("Population is not thermal, when expected thermal.");
|
||||||
|
}
|
||||||
|
v_thermal_ms = Population->get_thermal_v_ms(); // Typical Speed of "Thermal Blur"
|
||||||
|
}
|
||||||
|
|
||||||
|
double get_macroSigma_m(const Particle &interPart) {
|
||||||
|
// Calulate average interaction cross section by integration over theta
|
||||||
|
vec3 loc_m = interPart.get_x_m();
|
||||||
|
double m_eV = interPart.get_m_eV();
|
||||||
|
double v1_ms = calc_vec3_abs(interPart.get_v_ms() - Population->get_drift_v_ms(loc_m)); // Shift to "Labframe without thermal blur"
|
||||||
|
auto integrand = [&](double theta) {
|
||||||
|
double E_eV = m_eV/2 * (pow(v1_ms,2) + pow(v_thermal_ms,2) - 2*v1_ms*v_thermal_ms*cos(theta)) * pow(c_ms, -2);
|
||||||
|
return get_microSigma_m2(E_eV, loc_m);
|
||||||
|
};
|
||||||
|
double micro_sigma = integrate(integrand, 0., pi, 5, simpson());
|
||||||
|
|
||||||
|
return micro_sigma*Population->get_density_m3(loc_m);
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
virtual double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class TI_e_Interaction_Base : public Interaction_Base { // Interactions of ions with kinetic e Populations
|
||||||
|
int E_kin_bin;
|
||||||
|
double m_eV; // energy of kinetic particle for CS measurement : e-
|
||||||
|
|
||||||
|
public:
|
||||||
|
TI_e_Interaction_Base(Population_Base *Population, UniRNG *rngUni) : Interaction_Base(Population, rngUni) {
|
||||||
|
Sum_bounds bounds = Population->get_sumation_bounds(vec3(0,0,0));
|
||||||
|
if (bounds.num_E_bins <= 1) {
|
||||||
|
throw MyException("Population is not kinetic, when kinetic thermal.");
|
||||||
|
}
|
||||||
|
m_eV = Population->get_m_eV();
|
||||||
|
}
|
||||||
|
|
||||||
|
double get_macroSigma_m(const Particle &interPart) {
|
||||||
|
vec3 loc_m = interPart.get_x_m();
|
||||||
|
double v1_ms = interPart.get_vAbs_ms();
|
||||||
|
|
||||||
|
Content cont;
|
||||||
|
double macro_Sigma_m2 = 0;
|
||||||
|
double E_eV, v2_ms, micro_sigma;
|
||||||
|
Sum_bounds bounds = Population->get_sumation_bounds(interPart.get_x_m());
|
||||||
|
for (int E_bin = 0; E_bin<bounds.num_E_bins; E_bin++) {
|
||||||
|
cont = Population->get_density_m3(E_bin, bounds.loc_bins);
|
||||||
|
v2_ms = sqrt(2*cont.E_eV/m_eV)*c_ms;
|
||||||
|
if (v2_ms*0.005 > v1_ms) { // 0.005 represents 1% variation in energy
|
||||||
|
E_eV = m_eV/2 * pow(v2_ms/c_ms,2);
|
||||||
|
micro_sigma = get_microSigma_m2(E_eV, loc_m);
|
||||||
|
} else {
|
||||||
|
auto integrand = [&](double theta) {
|
||||||
|
double E_eV = m_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
||||||
|
return get_microSigma_m2(E_eV, loc_m);
|
||||||
|
};
|
||||||
|
micro_sigma = integrate(integrand, 0., pi, 5, simpson());
|
||||||
|
macro_Sigma_m2 += micro_sigma * cont.n_m3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return macro_Sigma_m2;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
virtual double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*class Interaction_Base {
|
||||||
protected:
|
protected:
|
||||||
Population_Base *Population;
|
Population_Base *Population;
|
||||||
UniRNG *rngUni;
|
UniRNG *rngUni;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Sub_Interaction_Base(Population_Base *Population, UniRNG *rngUni) {
|
Interaction_Base(Population_Base *Population, UniRNG *rngUni) {
|
||||||
this->Population = Population;
|
this->Population = Population;
|
||||||
this->rngUni = rngUni;
|
this->rngUni = rngUni;
|
||||||
};
|
};
|
||||||
@@ -66,7 +205,7 @@ protected:
|
|||||||
vec3 get_vOff_ms(const Particle &interPart, const double &minE_eV);
|
vec3 get_vOff_ms(const Particle &interPart, const double &minE_eV);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline double Sub_Interaction_Base::get_macroSigma_m(const Particle &interPart) {
|
inline double Interaction_Base::get_macroSigma_m(const Particle &interPart) {
|
||||||
Sum_bounds bounds = Population->get_sumation_bounds(interPart.get_x_m());
|
Sum_bounds bounds = Population->get_sumation_bounds(interPart.get_x_m());
|
||||||
if (bounds.num_E_bins <= 1) { //thermal
|
if (bounds.num_E_bins <= 1) { //thermal
|
||||||
return get_macroSigma_m_thermal(interPart);
|
return get_macroSigma_m_thermal(interPart);
|
||||||
@@ -75,7 +214,7 @@ inline double Sub_Interaction_Base::get_macroSigma_m(const Particle &interPart)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double Sub_Interaction_Base::get_macroSigma_m_thermal(const Particle &interPart) {
|
inline double Interaction_Base::get_macroSigma_m_thermal(const Particle &interPart) {
|
||||||
// Calulate average interaction cross section by integration over theta
|
// Calulate average interaction cross section by integration over theta
|
||||||
vec3 loc_m = interPart.get_x_m();
|
vec3 loc_m = interPart.get_x_m();
|
||||||
double m_eV = interPart.get_m_eV();
|
double m_eV = interPart.get_m_eV();
|
||||||
@@ -95,7 +234,7 @@ inline double Sub_Interaction_Base::get_macroSigma_m_thermal(const Particle &int
|
|||||||
return micro_sigma*Population->get_density_m3(loc_m);
|
return micro_sigma*Population->get_density_m3(loc_m);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double Sub_Interaction_Base::get_macroSigma_m_kinetic(const Particle &interPart, const Sum_bounds &bounds) {
|
inline double Interaction_Base::get_macroSigma_m_kinetic(const Particle &interPart, const Sum_bounds &bounds) {
|
||||||
vec3 loc_m = interPart.get_x_m();
|
vec3 loc_m = interPart.get_x_m();
|
||||||
double m_eV = Population->get_m_eV(); // Since CS is given in lab frame of "kinetic particle hitting fixed T" Fix this more elegant later.
|
double m_eV = Population->get_m_eV(); // Since CS is given in lab frame of "kinetic particle hitting fixed T" Fix this more elegant later.
|
||||||
double v1_ms = interPart.get_vAbs_ms();
|
double v1_ms = interPart.get_vAbs_ms();
|
||||||
@@ -122,7 +261,7 @@ inline double Sub_Interaction_Base::get_macroSigma_m_kinetic(const Particle &int
|
|||||||
return macro_Sigma_m2;
|
return macro_Sigma_m2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline vec3 Sub_Interaction_Base::get_vOff_ms(const Particle &interPart, const double &minE_eV) {
|
inline vec3 Interaction_Base::get_vOff_ms(const Particle &interPart, const double &minE_eV) {
|
||||||
double m_eV = interPart.get_m_eV();
|
double m_eV = interPart.get_m_eV();
|
||||||
vec3 v1_ms = interPart.get_v_ms();
|
vec3 v1_ms = interPart.get_v_ms();
|
||||||
vec3 v2_ms = Population->roll_v_ms(interPart.get_x_m());
|
vec3 v2_ms = Population->roll_v_ms(interPart.get_x_m());
|
||||||
@@ -132,11 +271,13 @@ inline vec3 Sub_Interaction_Base::get_vOff_ms(const Particle &interPart, const d
|
|||||||
T_eV = calc_E_eV_from_v_ms(v1_ms, m_eV);
|
T_eV = calc_E_eV_from_v_ms(v1_ms, m_eV);
|
||||||
if (T_eV < minE_eV) {
|
if (T_eV < minE_eV) {
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss<<"Sub_Interaction_Base::get_vOff_ms: T_eV < minE_eV.\nT_eV= "<< T_eV<<"\t minE_eV= "<<minE_eV<<"\n";
|
ss<<"Interaction_Base::get_vOff_ms: T_eV < minE_eV.\nT_eV= "<< T_eV<<"\t minE_eV= "<<minE_eV<<"\n";
|
||||||
throw MyException (ss.str());
|
throw MyException (ss.str());
|
||||||
}
|
}
|
||||||
return vec3(0,0,0);
|
return vec3(0,0,0);
|
||||||
}
|
}
|
||||||
return v2_ms;
|
return v2_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
#endif /* sub_interaction_base_h */
|
#endif /* sub_interaction_base_h */
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
|
|
||||||
vec3 roll_v_ms (const vec3 &loc_m) {return kinematics->get_v_ms(loc_m);}
|
vec3 roll_v_ms (const vec3 &loc_m) {return kinematics->get_v_ms(loc_m);}
|
||||||
vec3 get_drift_v_ms(const vec3 &loc_m) {return kinematics->get_v_offset_ms(loc_m);}
|
vec3 get_drift_v_ms(const vec3 &loc_m) {return kinematics->get_v_offset_ms(loc_m);}
|
||||||
double get_thermal_v_ms(const vec3 &loc_m) {return kinematics->get_thermal_v_ms(loc_m);}
|
double get_thermal_v_ms() {return kinematics->get_thermal_v_ms();}
|
||||||
|
|
||||||
Population_Container *access_container() {return &container;}
|
Population_Container *access_container() {return &container;}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
|
|
||||||
vec3 roll_v_ms (const vec3 &loc_m) {return kinematics->get_v_ms(loc_m);}
|
vec3 roll_v_ms (const vec3 &loc_m) {return kinematics->get_v_ms(loc_m);}
|
||||||
vec3 get_drift_v_ms(const vec3 &loc_m) {return kinematics->get_v_offset_ms(loc_m);}
|
vec3 get_drift_v_ms(const vec3 &loc_m) {return kinematics->get_v_offset_ms(loc_m);}
|
||||||
double get_thermal_v_ms(const vec3 &loc_m) {return kinematics->get_thermal_v_ms(loc_m);}
|
double get_thermal_v_ms() {return kinematics->get_thermal_v_ms();}
|
||||||
|
|
||||||
Population_Container *access_container() {return nullptr;};
|
Population_Container *access_container() {return nullptr;};
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
return roll_v_thermal_ms() + get_v_offset_ms(loc_m);
|
return roll_v_thermal_ms() + get_v_offset_ms(loc_m);
|
||||||
}
|
}
|
||||||
|
|
||||||
double get_thermal_v_ms(const vec3 & loc_m) {
|
double get_thermal_v_ms() {
|
||||||
return v_thermal;
|
return v_thermal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,6 +48,7 @@ class WGTS_Kinematics : public Base_Kinematics {
|
|||||||
Velocity_Container v_data;
|
Velocity_Container v_data;
|
||||||
public:
|
public:
|
||||||
WGTS_Kinematics(double m_eV, double wgtsTemp_K, UniRNG *rngUni, NormalRNG *rngNormal) : Base_Kinematics(m_eV, wgtsTemp_K, rngUni, rngNormal), v_data(get_data_path() + "velocity.dat") {}
|
WGTS_Kinematics(double m_eV, double wgtsTemp_K, UniRNG *rngUni, NormalRNG *rngNormal) : Base_Kinematics(m_eV, wgtsTemp_K, rngUni, rngNormal), v_data(get_data_path() + "velocity.dat") {}
|
||||||
|
|
||||||
vec3 get_v_offset_ms(const vec3 &loc_m) {
|
vec3 get_v_offset_ms(const vec3 &loc_m) {
|
||||||
if (calc_z_m(loc_m)<z_WGTS_start_m) {
|
if (calc_z_m(loc_m)<z_WGTS_start_m) {
|
||||||
return vec3(0,0,0);
|
return vec3(0,0,0);
|
||||||
|
|||||||
Reference in New Issue
Block a user