Added Ionization Channels for e+T2 -> now 3 Processes from Janev are available:
eT2_T2I_Ionization_Janev_(label) 1. non dissoziative labeled as ndiss 2. dissoziative via X2 Sigma^+_g labeled as diss_g 3. dissoziative via B2 Sigma^+_u labeled as diss_u Added more Excitation Channels e + T2 from Janev
This commit is contained in:
@@ -39,19 +39,19 @@ Edge2D_FuncContainer calc_SDCS_Edge() {
|
||||
double xmin =EionT2_eV+1e-4;
|
||||
double ymin = (xmin-EionT2_eV)/2;
|
||||
BED_edge_SDCS.add_ankerpoint(xmin, ymin,BED_eT2_Ionization::calc_SDCS(xmin,ymin));
|
||||
return(BED_edge_SDCS);
|
||||
return BED_edge_SDCS;
|
||||
}
|
||||
|
||||
Average2D_FuncContainer calc_SDCS_Average() {
|
||||
Edge2D_FuncContainer BED_edge_SDCS = calc_SDCS_Edge();
|
||||
Average2D_FuncContainer BED_average_SDCS = Average2D_FuncContainer(BED_edge_SDCS);
|
||||
return(BED_average_SDCS);
|
||||
return BED_average_SDCS;
|
||||
}
|
||||
|
||||
Stacked2D_FuncContainer calc_SDCS_Stacked() {
|
||||
Average2D_FuncContainer BED_average_SDCS = calc_SDCS_Average();
|
||||
Stacked2D_FuncContainer BED_stacked_SDCS = Stacked2D_FuncContainer(BED_average_SDCS);
|
||||
return(BED_stacked_SDCS);
|
||||
return BED_stacked_SDCS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,13 +37,13 @@ Edge1D_FuncContainer BED_TCS_calculator::calc_TCS_Edge() {
|
||||
BED_edge_TCS.add_ankerpoint(EionT2_eV, BED_eT2_Ionization::calc_TCS(EionT2_eV));
|
||||
double offset = 1e-4;
|
||||
BED_edge_TCS.add_ankerpoint(EionT2_eV+offset, BED_eT2_Ionization::calc_TCS(EionT2_eV+offset));
|
||||
return (BED_edge_TCS);
|
||||
return BED_edge_TCS;
|
||||
}
|
||||
|
||||
Average1D_FuncContainer BED_TCS_calculator::calc_TCS_Average() {
|
||||
Edge1D_FuncContainer BED_edge_TCS = calc_TCS_Edge();
|
||||
Average1D_FuncContainer BED_average_TCS = Average1D_FuncContainer(BED_edge_TCS);
|
||||
return (BED_average_TCS);
|
||||
return BED_average_TCS;
|
||||
}
|
||||
|
||||
void BED_TCS_calculator::export_TCS_Edge (std::string export_path) {
|
||||
|
||||
@@ -32,13 +32,13 @@ double BED_eT2_Ionization::calc_TCS(const double &T_eV) {
|
||||
}
|
||||
|
||||
if (T_eV<=B_eV) {
|
||||
return (0);
|
||||
return 0;
|
||||
} else {
|
||||
double t = calc_t(T_eV);
|
||||
double fac = S_m2/(t+u+1);
|
||||
double sum1 = calc_Dt(t)*log(t);
|
||||
double sum2 = (2-Ni/N)*( (t-1)/t - log(t)/(t+1) );
|
||||
return(fac*(sum1 + sum2) );
|
||||
return fac*(sum1 + sum2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ double BED_eT2_Ionization::calc_SDCS (const double &T_eV, const double &W_eV) {
|
||||
}
|
||||
|
||||
if ( (T_eV<=B_eV) ||(W_eV >= (T_eV-B_eV) ) ) {
|
||||
return (0);
|
||||
return 0;
|
||||
} else {
|
||||
double t = calc_t(T_eV);
|
||||
double w = calc_w(W_eV);
|
||||
@@ -62,16 +62,16 @@ double BED_eT2_Ionization::calc_SDCS (const double &T_eV, const double &W_eV) {
|
||||
double sum1 = (Ni/N - 2)/(t+1) * (1/(w+1) + 1/(t-w));
|
||||
double sum2 = (2-Ni/N) * (pow(w+1,-2) + pow(t-w,-2));
|
||||
double sum3 = log(t)/(N*(w+1)) * calc_dfdw(w);
|
||||
return(fac*(sum1 + sum2 + sum3));
|
||||
return fac*(sum1 + sum2 + sum3);
|
||||
}
|
||||
}
|
||||
|
||||
double BED_eT2_Ionization::calc_t(const double &T_eV) {
|
||||
return(T_eV/B_eV);
|
||||
return T_eV/B_eV;
|
||||
}
|
||||
|
||||
double BED_eT2_Ionization::calc_w(const double &W_eV) {
|
||||
return(W_eV/B_eV);
|
||||
return W_eV/B_eV;
|
||||
}
|
||||
|
||||
double BED_eT2_Ionization::calc_dfdw(const double &w) {
|
||||
@@ -80,7 +80,7 @@ double BED_eT2_Ionization::calc_dfdw(const double &w) {
|
||||
for (int i=0;i<4;i++) {
|
||||
res += c[i]*pow(y,i+3);
|
||||
}
|
||||
return(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
double BED_eT2_Ionization::calc_Dt(const double &t) {
|
||||
@@ -90,6 +90,6 @@ double BED_eT2_Ionization::calc_Dt(const double &t) {
|
||||
res += c[i]/(i+3)*(1-pow(yh,i+3));
|
||||
}
|
||||
res = res/N;
|
||||
return(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ private:
|
||||
inline double TT2_Elastic::get_macroSigma_m2(const Particle &interPart) {
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
double n_m3 = (Population->get_density_m3(loc_m));
|
||||
return (HardSphere.get_TCS() * n_m3);
|
||||
return HardSphere.get_TCS() * n_m3;
|
||||
}
|
||||
|
||||
inline InteractionOut TT2_Elastic::do_Interaction (Particle *interPart) {
|
||||
@@ -39,14 +39,14 @@ inline InteractionOut TT2_Elastic::do_Interaction (Particle *interPart) {
|
||||
double thetaLab = HardSphere.roll_theta(rngUni);
|
||||
double phiLab = rngUni->random() * 2 * pi;
|
||||
interPart->set_Speed_ms( calc_vNew_ms(v_ms, vT2_ms, thetaLab, phiLab) );
|
||||
return (InteractionOut());
|
||||
return InteractionOut();
|
||||
}
|
||||
|
||||
inline vec3 TT2_Elastic::calc_vNew_ms(vec3 vOld_ms, vec3 vT2_ms, double thetaLab, double phiLab) {
|
||||
vec3 speedLab_ms = vOld_ms - vT2_ms;
|
||||
vec3 n0 = calc_newDirection(speedLab_ms, thetaLab, phiLab);
|
||||
vec3 vNew_ms = (mT2_eV*vec3Abs(speedLab_ms)*n0 + me_eV*speedLab_ms)/(me_eV+mT2_eV) + vT2_ms;
|
||||
return (vNew_ms);
|
||||
return vNew_ms;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ double Average_Container<T_Map>::get_value(std::deque <double> Point) {
|
||||
ss<<"EdgeBase_Container::interpolate: deque point dimension missmatch.\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return (Base_Container<T_Map>::get_value(Point, Lower_bound_Over));
|
||||
return Base_Container<T_Map>::get_value(Point, Lower_bound_Over);
|
||||
}
|
||||
|
||||
#endif /* average_container_h */
|
||||
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
protected:
|
||||
void checkEmpty() ;
|
||||
public:
|
||||
T_Map getMap() const {return (Map);}
|
||||
T_Map getMap() const {return Map;}
|
||||
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ double Base_Container<T_Map>::calc_Dim() {
|
||||
T dummyMap;
|
||||
int count = 0;
|
||||
inc_Count(&dummyMap, &count);
|
||||
return (count);
|
||||
return count;
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
@@ -217,7 +217,7 @@ std::string Base_Container<T_Map>::getExportFileHeader() {
|
||||
ss<<"# Automatically generated Data of Function2D_Container class by exportToFile().\n";
|
||||
ss<<"# Generated on "<<get_time_string()<<".\n";
|
||||
ss<<"#key1 (usually Energy)\tkey2 (angluar distribution or secondary energy)\tparameter (usually SDCS)\n";
|
||||
return(ss.str());
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
@@ -246,7 +246,7 @@ double Base_Container<T_Map>::get_value(std::deque<double> Points, searchStyle s
|
||||
Points.pop_back();
|
||||
dim1Map *subMap = getSubMap<dim1Map>(Points, searchMode);
|
||||
dim1Map::const_iterator Itr = searchItrByStyle(subMap, x, searchMode);
|
||||
return(Itr->second);
|
||||
return Itr->second;
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
@@ -261,7 +261,7 @@ T_target* Base_Container<T_Map>::getSubMap(std::deque<double> Points, searchStyl
|
||||
}
|
||||
T_target *targetMap;
|
||||
rec_getSubMap(&Map, &targetMap, Points, searchMode);
|
||||
return (targetMap);
|
||||
return targetMap;
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
@@ -303,7 +303,7 @@ typename T::iterator Base_Container<T_Map>::searchItrByStyle(T *subMap, double x
|
||||
ss<<"Base_Container::calcItr: Point is out of bound.\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return (Itr);
|
||||
return Itr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ DCS_Ionization_Container& DCS_Ionization_Container::operator=(const DCS_Ionizati
|
||||
std::swap(T_scale, tmp.T_scale);
|
||||
std::swap(W_scale, tmp.W_scale);
|
||||
std::swap(data, tmp.data);
|
||||
return (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void DCS_Ionization_Container::init_data() {
|
||||
@@ -92,7 +92,7 @@ double DCS_Ionization_Container::calc_bin_surface(int T_bin, int W_bin, Edge_Con
|
||||
double W_eV = W_scale[T_bin].get_bin_mid(W_bin);
|
||||
double width = T_scale.get_upper_bin_bound(T_bin) - T_scale.get_lower_bin_bound(T_bin);
|
||||
double height = E2D->interpolate(ddeque{T_eV, W_eV});
|
||||
return (width*height);
|
||||
return width*height;
|
||||
}
|
||||
|
||||
double DCS_Ionization_Container::roll_value(const double &T_eV, UniRNG *rngUni) {
|
||||
@@ -100,7 +100,7 @@ double DCS_Ionization_Container::roll_value(const double &T_eV, UniRNG *rngUni)
|
||||
double target = rngUni->random();
|
||||
for (int j=0; j<W_scale[T_bin].get_number_bins(); j++) {
|
||||
if (target < data[T_bin][j]) {
|
||||
return (roll_in_bin(T_bin, j, rngUni));
|
||||
return roll_in_bin(T_bin, j, rngUni);
|
||||
}
|
||||
}
|
||||
std::stringstream ss;
|
||||
|
||||
@@ -43,7 +43,7 @@ DCS_Theta_Container& DCS_Theta_Container::operator=(const DCS_Theta_Container& o
|
||||
std::swap(E_scale, tmp.E_scale);
|
||||
std::swap(theta_scale, tmp.theta_scale);
|
||||
std::swap(data, tmp.data);
|
||||
return (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ double DCS_Theta_Container::calc_bin_surface(int E_bin, int theta_bin, Edge_Cont
|
||||
double theta = theta_scale.get_bin_mid(theta_bin);
|
||||
double width = E_scale.get_upper_bin_bound(E_bin) - E_scale.get_lower_bin_bound(E_bin);
|
||||
double height = E2D->interpolate(ddeque{E_eV, theta});
|
||||
return (width*height);
|
||||
return width*height;
|
||||
}
|
||||
|
||||
double DCS_Theta_Container::roll_value(const double &E_eV, UniRNG *rngUni) {
|
||||
@@ -93,7 +93,7 @@ double DCS_Theta_Container::roll_value(const double &E_eV, UniRNG *rngUni) {
|
||||
double target = rngUni->random();
|
||||
for (int j=0; j<theta_scale.get_number_bins(); j++) {
|
||||
if (target < data[E_bin][j]) {
|
||||
return (roll_in_bin(j, rngUni));
|
||||
return roll_in_bin(j, rngUni);
|
||||
}
|
||||
}
|
||||
std::stringstream ss;
|
||||
|
||||
@@ -52,7 +52,7 @@ inline double Drift_Base::get_zNew_m(Particle *movePart, const double ¯oSigm
|
||||
double distance_m = 1/macroSigma_m2;
|
||||
znew_m = zold_m + zDir*vForwardAbs_ms/vTotAbs_ms * distance_m;
|
||||
}
|
||||
return (znew_m);
|
||||
return znew_m;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ inline double eT2I_Recombination::get_macroSigma_m2(const Particle &interPart) {
|
||||
double microSigma_m2 = Janev_eT2_Recombination::get_TCS(Ekin_eV);
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
double nT2I_m3 = Population->get_density_m3(loc_m);
|
||||
return (microSigma_m2*nT2I_m3);
|
||||
return microSigma_m2*nT2I_m3;
|
||||
}
|
||||
|
||||
inline InteractionOut eT2I_Recombination::do_Interaction (Particle *interPart) {
|
||||
@@ -35,6 +35,6 @@ inline InteractionOut eT2I_Recombination::do_Interaction (Particle *interPart) {
|
||||
res.set_delete_current(true);
|
||||
res.set_decrease(tritium2I, interPart->get_Location_m(), 0); // 0 is dummy parameter, since thermal population
|
||||
// Maybe add the 2 T atoms.
|
||||
return(res);
|
||||
return res;
|
||||
}
|
||||
#endif /* eT2I_recombination_h */
|
||||
|
||||
@@ -37,19 +37,19 @@ inline double eT2_Elastic::get_macroSigma_m2(const Particle &interPart) {
|
||||
double microSigma_m2 = tcs_data.get_value(Ekin_eV);
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
double nT2_m3 = Population->get_density_m3(loc_m);
|
||||
return (microSigma_m2*nT2_m3);
|
||||
return microSigma_m2*nT2_m3;
|
||||
}
|
||||
|
||||
inline InteractionOut eT2_Elastic::do_Interaction (Particle *interPart) {
|
||||
// Here theta and phi are COM-Angles.... prob not correct. For m1 << m2 COM - Angle ~ Lab Angle
|
||||
vec3 v_ms = interPart->get_Speed_ms();
|
||||
vec3 vT2_ms = Population->roll_speed_ms(interPart->get_Location_m());
|
||||
vec3 vLab_ms = v_ms - vT2_ms;
|
||||
vec3 v1_ms = interPart->get_Speed_ms();
|
||||
vec3 vOff_ms = Population->roll_speed_ms(interPart->get_Location_m());
|
||||
vec3 vLab_ms = v1_ms - vOff_ms;
|
||||
double T_eV = calc_Ekin_eV_from_speed(vLab_ms, me_eV);
|
||||
double theta_lab = dcs_data.roll_value(T_eV,rngUni);
|
||||
double phi_lab = rngUni->random() * 2 * pi;
|
||||
kinematics.doKinematics(interPart, vT2_ms, theta_lab, phi_lab);
|
||||
return (InteractionOut());
|
||||
kinematics.doKinematics(interPart, vOff_ms, theta_lab, phi_lab);
|
||||
return InteractionOut();
|
||||
}
|
||||
|
||||
|
||||
@@ -76,19 +76,19 @@ inline double eT2_Elastic_Analytic::get_macroSigma_m2(const Particle &interPart)
|
||||
double microSigma_m2 = Uehara_eT2_ElasticScattering::calc_TCS(Ekin_eV);
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
double nT2_m3 = Population->get_density_m3(loc_m);
|
||||
return (microSigma_m2*nT2_m3);
|
||||
return microSigma_m2*nT2_m3;
|
||||
}
|
||||
|
||||
inline InteractionOut eT2_Elastic_Analytic::do_Interaction (Particle *interPart) {
|
||||
// Here theta and phi are COM-Angles.... prob not correct. For m1 << m2 COM - Angle ~ Lab Angle
|
||||
vec3 v_ms = interPart->get_Speed_ms();
|
||||
vec3 vT2_ms = Population->roll_speed_ms(interPart->get_Location_m());
|
||||
vec3 vLab_ms = v_ms - vT2_ms;
|
||||
vec3 v1_ms = interPart->get_Speed_ms();
|
||||
vec3 vOff_ms = Population->roll_speed_ms(interPart->get_Location_m());
|
||||
vec3 vLab_ms = v1_ms - vOff_ms;
|
||||
double T_eV = calc_Ekin_eV_from_speed(vLab_ms, me_eV);
|
||||
double theta_lab = Uehara_eT2_ElasticScattering::roll_theta(T_eV, rngUni);
|
||||
double phi_lab = rngUni->random() * 2 * pi;
|
||||
kinematics.doKinematics(interPart, vT2_ms, theta_lab, phi_lab);
|
||||
return (InteractionOut());
|
||||
kinematics.doKinematics(interPart, vOff_ms, theta_lab, phi_lab);
|
||||
return InteractionOut();
|
||||
}
|
||||
|
||||
#endif /* eT2_elastic_h */
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// eT2_elexc_analytic.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 01.07.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef eT2_elexc_analytic_h
|
||||
#define eT2_elexc_analytic_h
|
||||
|
||||
#include "janev_eT2_elexc.h"
|
||||
|
||||
class eT2_ElExc_Nu_Analytic : public Excitation_Base {
|
||||
Janev_eT2_ElExc_Nu janev_Nu;
|
||||
public:
|
||||
eT2_ElExc_Nu_Analytic(Population_Base *T2Population, UniRNG *rngUni, Janev_eT2_ElExc_Nu janev_Nu_in) : Excitation_Base(T2Population, rngUni, janev_Nu_in.get_deltaE_eV()), janev_Nu(janev_Nu_in) {};
|
||||
|
||||
private:
|
||||
double get_microSigma_m2(const double &Ekin_eV) {
|
||||
return janev_Nu.get_TCS_m2(Ekin_eV);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class eT2_ElExc_Ng_Analytic : public Excitation_Base {
|
||||
Janev_eT2_ElExc_Ng janev_Ng;
|
||||
public:
|
||||
eT2_ElExc_Ng_Analytic(Population_Base *T2Population, UniRNG *rngUni, Janev_eT2_ElExc_Ng janev_Ng_in) : Excitation_Base(T2Population, rngUni, janev_Ng_in.get_deltaE_eV()), janev_Ng(janev_Ng_in) {};
|
||||
|
||||
private:
|
||||
double get_microSigma_m2(const double &Ekin_eV) {
|
||||
return janev_Ng.get_TCS_m2(Ekin_eV);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class eT2_ElExc_n_Analytic : public Excitation_Base {
|
||||
Janev_eT2_ElExc_n janev_n;
|
||||
public:
|
||||
eT2_ElExc_n_Analytic(Population_Base *T2Population, UniRNG *rngUni, Janev_eT2_ElExc_n janev_n_in) : Excitation_Base(T2Population, rngUni, janev_n_in.get_deltaE_eV()), janev_n(janev_n_in) {};
|
||||
|
||||
private:
|
||||
double get_microSigma_m2(const double &Ekin_eV) {
|
||||
return janev_n.get_TCS_m2(Ekin_eV);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif /* eT2_elexc_analytic_h */
|
||||
@@ -14,13 +14,17 @@
|
||||
#include "dcs_ionization_container.hpp"
|
||||
|
||||
#include "BED_eT2_ionization.hpp"
|
||||
#include "janev_eT2_ionization.h"
|
||||
/*
|
||||
Ionization:
|
||||
Using BED-Model Kim and Rudd 1994
|
||||
*/
|
||||
class eT2_T2I_Ionization_Base : public Sub_Interaction_Base {
|
||||
double deltaE_eV;
|
||||
public:
|
||||
eT2_T2I_Ionization_Base(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni){};
|
||||
eT2_T2I_Ionization_Base(Population_Base *T2Population, UniRNG *rngUni, double deltaE_eV) : Sub_Interaction_Base(T2Population, rngUni){
|
||||
this->deltaE_eV = deltaE_eV;
|
||||
};
|
||||
|
||||
double get_macroSigma_m2(const Particle &interPart);
|
||||
protected:
|
||||
@@ -30,29 +34,19 @@ public:
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
protected:
|
||||
vec3 roll_vLab_ms(const Particle &interPart);
|
||||
|
||||
virtual double roll_ionW_eV(const double &T_eV) = 0;
|
||||
double roll_theta1(double T_eV, double W_eV);
|
||||
double roll_theta2(double T_eV, double W_eV);
|
||||
|
||||
virtual double roll_ionW_eV(const double &T_eV) = 0;
|
||||
virtual void add_Tritiums(InteractionOut *InterOut, const Particle &interPart) = 0;
|
||||
};
|
||||
|
||||
inline double eT2_T2I_Ionization_Base::get_macroSigma_m2(const Particle &interPart) {
|
||||
double T_eV = interPart.get_EKin_eV();
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
|
||||
double microSigma_m2 = calc_microSigma(T_eV);
|
||||
double nT2_m3 = Population->get_density_m3(loc_m);
|
||||
return (microSigma_m2*nT2_m3);
|
||||
}
|
||||
|
||||
inline InteractionOut eT2_T2I_Ionization_Base::do_Interaction (Particle *interPart) {
|
||||
vec3 vLab_ms = roll_vLab_ms(*interPart);
|
||||
vec3 vOff_ms = vLab_ms - interPart->get_Speed_ms();
|
||||
|
||||
vec3 v1_ms = interPart->get_Speed_ms();
|
||||
vec3 vOff_ms = get_vOff_ms(*interPart, deltaE_eV);
|
||||
vec3 vLab_ms = v1_ms - vOff_ms;
|
||||
double T_eV = calc_Ekin_eV_from_speed(vLab_ms, me_eV);
|
||||
if (T_eV < EionT2_eV) {
|
||||
throw MyException("Electron::do_Ionization: Ekin_eV < EIonT2_eV.");
|
||||
}
|
||||
|
||||
double W_eV = roll_ionW_eV(T_eV);
|
||||
double E1_eV = T_eV-EionT2_eV - W_eV;
|
||||
E1_eV = (E1_eV < 0) ? 0 : E1_eV;
|
||||
@@ -77,12 +71,17 @@ inline InteractionOut eT2_T2I_Ionization_Base::do_Interaction (Particle *interPa
|
||||
Particle eNew = Particle_Builder::createElectron(loc_m, v2_new_ms, -1, interPart->get_Id());
|
||||
|
||||
InterOut.add_new_particle(eNew);
|
||||
add_Tritiums(&InterOut, *interPart);
|
||||
return InterOut;
|
||||
}
|
||||
|
||||
inline double eT2_T2I_Ionization_Base::get_macroSigma_m2(const Particle &interPart) {
|
||||
double T_eV = interPart.get_EKin_eV();
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
|
||||
vec3 vT_ms = Population->get_average_speed_ms(loc_m);
|
||||
Particle TNew = Particle_Builder::createTritium2I(loc_m, vT_ms, -1, interPart->get_Id());
|
||||
InterOut.add_new_particle(TNew);
|
||||
|
||||
return(InterOut);
|
||||
double microSigma_m2 = calc_microSigma(T_eV);
|
||||
double nT2_m3 = Population->get_density_m3(loc_m);
|
||||
return microSigma_m2*nT2_m3;
|
||||
}
|
||||
|
||||
inline vec3 eT2_T2I_Ionization_Base::roll_vLab_ms(const Particle &interPart) {
|
||||
@@ -91,9 +90,9 @@ inline vec3 eT2_T2I_Ionization_Base::roll_vLab_ms(const Particle &interPart) {
|
||||
vec3 vLab_ms = v_ms - vT2_ms;
|
||||
double T_eV = calc_Ekin_eV_from_speed(vLab_ms, me_eV);
|
||||
if (T_eV < EionT2_eV) { // Set Tritium Speed to 0 if unlucky roll
|
||||
return(v_ms);
|
||||
return v_ms;
|
||||
} else {
|
||||
return(vLab_ms);
|
||||
return vLab_ms;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +105,7 @@ inline double eT2_T2I_Ionization_Base::roll_theta1(double T_eV, double W_eV) {
|
||||
} else {
|
||||
theta1 = rngUni->random()*pi/4;
|
||||
}
|
||||
return (theta1);
|
||||
return theta1;
|
||||
}
|
||||
|
||||
inline double eT2_T2I_Ionization_Base::roll_theta2(double T_eV, double W_eV) {
|
||||
@@ -125,19 +124,34 @@ inline double eT2_T2I_Ionization_Base::roll_theta2(double T_eV, double W_eV) {
|
||||
} else {
|
||||
theta2 = rngUni->random() * pi;
|
||||
}
|
||||
return(theta2);
|
||||
return theta2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class eT2_T2I_Ionization_Analytic : public eT2_T2I_Ionization_Base {
|
||||
class eT2_T2I_Ionization_BED_Base : public eT2_T2I_Ionization_Base {
|
||||
public:
|
||||
eT2_T2I_Ionization_Analytic(Population_Base *T2Population, UniRNG *rngUni) : eT2_T2I_Ionization_Base(T2Population, rngUni) {};
|
||||
eT2_T2I_Ionization_BED_Base(Population_Base *T2Population, UniRNG *rngUni) : eT2_T2I_Ionization_Base(T2Population, rngUni, EionT2_eV){};
|
||||
|
||||
protected:
|
||||
virtual double calc_microSigma(const double &T_eV) = 0;
|
||||
|
||||
protected:
|
||||
void add_Tritiums(InteractionOut *InterOut, const Particle &interPart) {
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
vec3 vT_ms = Population->roll_speed_ms(loc_m);
|
||||
Particle T2I_new = Particle_Builder::createTritium2I(loc_m, vT_ms, -1, interPart.get_Id());
|
||||
InterOut->add_new_particle(T2I_new);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class eT2_T2I_Ionization_BED_Analytic : public eT2_T2I_Ionization_BED_Base {
|
||||
public:
|
||||
eT2_T2I_Ionization_BED_Analytic(Population_Base *T2Population, UniRNG *rngUni) : eT2_T2I_Ionization_BED_Base(T2Population, rngUni) {};
|
||||
|
||||
protected:
|
||||
double calc_microSigma(const double &T_eV) {
|
||||
return(BED_eT2_Ionization::calc_TCS(T_eV));
|
||||
return BED_eT2_Ionization::calc_TCS(T_eV);
|
||||
}
|
||||
double roll_ionW_eV(const double &T_eV) {
|
||||
double pmax, Wmin_eV, Wmax_eV, Wcan_eV,eta1,eta2;
|
||||
@@ -150,18 +164,18 @@ protected:
|
||||
Wcan_eV = Wmin_eV + eta1*(Wmax_eV - Wmin_eV);
|
||||
} while(eta2*pmax > BED_eT2_Ionization::calc_SDCS(T_eV, Wcan_eV));
|
||||
double W_eV = (Wcan_eV< (T_eV-EionT2_eV)/2 ) ? Wcan_eV : (T_eV-EionT2_eV) - Wcan_eV;
|
||||
return(W_eV);
|
||||
return W_eV;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class eT2_T2I_Ionization_Container : public eT2_T2I_Ionization_Base {
|
||||
class eT2_T2I_Ionization_BED_Container : public eT2_T2I_Ionization_BED_Base {
|
||||
TCS_Container tcs_data;
|
||||
DCS_Ionization_Container dcs_data;
|
||||
|
||||
public:
|
||||
eT2_T2I_Ionization_Container(Population_Base *T2Population, UniRNG *rngUni) :
|
||||
eT2_T2I_Ionization_Base(T2Population, rngUni),
|
||||
eT2_T2I_Ionization_BED_Container(Population_Base *T2Population, UniRNG *rngUni) :
|
||||
eT2_T2I_Ionization_BED_Base(T2Population, rngUni),
|
||||
tcs_data(scale_start, scale_end, 100, (get_data_path() + "eT2_ion_TCS.dat")),
|
||||
dcs_data(scale_start, scale_end, 100, 50, (get_data_path() + "eT2_ion_DCS.dat"))
|
||||
{};
|
||||
@@ -176,4 +190,85 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
// Not very fancy from here. Either one function for all 3 or base class with dcs_data, genereally only load the data once.
|
||||
class eT2_T2I_Ionization_Janev_ndiss : public eT2_T2I_Ionization_Base {
|
||||
DCS_Ionization_Container dcs_data;
|
||||
|
||||
public:
|
||||
eT2_T2I_Ionization_Janev_ndiss(Population_Base *T2Population, UniRNG *rngUni) : eT2_T2I_Ionization_Base(T2Population, rngUni, Janev_eT2_Ionization_ndiss::get_deltaE_eV()), dcs_data(scale_start, scale_end, 100, 50, (get_data_path() + "eT2_ion_DCS.dat")) {};
|
||||
|
||||
protected:
|
||||
double calc_microSigma(const double &T_eV) {
|
||||
return Janev_eT2_Ionization_ndiss::get_TCS_m2(T_eV);
|
||||
}
|
||||
|
||||
double roll_ionW_eV(const double &T_eV) {
|
||||
return dcs_data.roll_value(T_eV, rngUni);
|
||||
}
|
||||
|
||||
void add_Tritiums(InteractionOut *InterOut, const Particle &interPart) {
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
vec3 vT_ms = Population->get_average_speed_ms(loc_m);
|
||||
Particle T2I_new = Particle_Builder::createTritium2I(loc_m, vT_ms, -1, interPart.get_Id());
|
||||
InterOut->add_new_particle(T2I_new);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class eT2_T2I_Ionization_Janev_diss_g : public eT2_T2I_Ionization_Base {
|
||||
DCS_Ionization_Container dcs_data;
|
||||
|
||||
public:
|
||||
eT2_T2I_Ionization_Janev_diss_g(Population_Base *T2Population, UniRNG *rngUni) : eT2_T2I_Ionization_Base(T2Population, rngUni, Janev_eT2_Ionization_diss_g::get_deltaE_eV()), dcs_data(scale_start, scale_end, 100, 50, (get_data_path() + "eT2_ion_DCS.dat")) {};
|
||||
|
||||
protected:
|
||||
double calc_microSigma(const double &T_eV) {
|
||||
return Janev_eT2_Ionization_diss_g::get_TCS_m2(T_eV);
|
||||
}
|
||||
|
||||
double roll_ionW_eV(const double &T_eV) {
|
||||
return dcs_data.roll_value(T_eV, rngUni);
|
||||
}
|
||||
|
||||
void add_Tritiums(InteractionOut *InterOut, const Particle &interPart) {
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
|
||||
vec3 vT_ms = Population->roll_speed_ms(loc_m);
|
||||
Particle newPart = Particle_Builder::createTritium(loc_m, vT_ms, -1, interPart.get_Id());
|
||||
InterOut->add_new_particle(newPart);
|
||||
|
||||
vT_ms = Population->roll_speed_ms(loc_m);
|
||||
newPart = Particle_Builder::createTritiumI(loc_m, vT_ms, -1, interPart.get_Id());
|
||||
InterOut->add_new_particle(newPart);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class eT2_T2I_Ionization_Janev_diss_u : public eT2_T2I_Ionization_Base {
|
||||
DCS_Ionization_Container dcs_data;
|
||||
|
||||
public:
|
||||
eT2_T2I_Ionization_Janev_diss_u(Population_Base *T2Population, UniRNG *rngUni) : eT2_T2I_Ionization_Base(T2Population, rngUni, Janev_eT2_Ionization_diss_u::get_deltaE_eV()), dcs_data(scale_start, scale_end, 100, 50, (get_data_path() + "eT2_ion_DCS.dat")) {};
|
||||
|
||||
protected:
|
||||
double calc_microSigma(const double &T_eV) {
|
||||
return Janev_eT2_Ionization_diss_u::get_TCS_m2(T_eV);
|
||||
}
|
||||
|
||||
double roll_ionW_eV(const double &T_eV) {
|
||||
return dcs_data.roll_value(T_eV, rngUni);
|
||||
}
|
||||
|
||||
void add_Tritiums(InteractionOut *InterOut, const Particle &interPart) {
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
|
||||
vec3 vT_ms = Population->roll_speed_ms(loc_m);
|
||||
Particle newPart = Particle_Builder::createTritium(loc_m, vT_ms, -1, interPart.get_Id());
|
||||
InterOut->add_new_particle(newPart);
|
||||
|
||||
vT_ms = Population->roll_speed_ms(loc_m);
|
||||
newPart = Particle_Builder::createTritiumI(loc_m, vT_ms, -1, interPart.get_Id());
|
||||
InterOut->add_new_particle(newPart);
|
||||
}
|
||||
};
|
||||
#endif /* eT2_ionization_h */
|
||||
|
||||
@@ -38,7 +38,7 @@ double Edge_Container<T_Map>::interpolate(std::deque<double> point) {
|
||||
ss<<"EdgeBase_Container::interpolate: deque point dimension missmatch.\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return (rec_interpolate(Base_Container<T_Map>::Map, point) );
|
||||
return rec_interpolate(Base_Container<T_Map>::Map, point);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ double Edge_Container<T_Map>::rec_interpolate(const double &subMap, std::deque<d
|
||||
ss<<"sub_interpolate: deque subPoint dimension missmatch.\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return (subMap);
|
||||
return subMap;
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
@@ -61,12 +61,12 @@ double Edge_Container<T_Map>::rec_interpolate(const T &subMap, std::deque<double
|
||||
typename T::const_iterator upItr = subMap.lower_bound(x);
|
||||
|
||||
if (upItr == subMap.cbegin()) {
|
||||
return (rec_interpolate(upItr->second, subPoint));
|
||||
return rec_interpolate(upItr->second, subPoint);
|
||||
} else {
|
||||
typename T::const_iterator lowItr = upItr;
|
||||
--lowItr;
|
||||
if (upItr == subMap.cend()) {
|
||||
return (rec_interpolate(lowItr->second, subPoint));
|
||||
return rec_interpolate(lowItr->second, subPoint);
|
||||
} else {
|
||||
double low_x = lowItr->first;
|
||||
double low_f = rec_interpolate(lowItr->second, subPoint);
|
||||
@@ -74,7 +74,7 @@ double Edge_Container<T_Map>::rec_interpolate(const T &subMap, std::deque<double
|
||||
double up_f = rec_interpolate(upItr->second, subPoint);
|
||||
|
||||
double res = low_f + (x-low_x)/(up_x-low_x) * (up_f-low_f);
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ double E_Mover_Boris::doBoris_singleStep_m(Particle *movePart, const vec3 &E_Vm
|
||||
x_m += dt_s/2 * v_ms;
|
||||
distance_m += dt_s/2 * vec3Abs(v_ms);
|
||||
movePart->set_Location_m(x_m);
|
||||
return(distance_m);
|
||||
return distance_m;
|
||||
}
|
||||
|
||||
void E_Mover_Boris::doBoris_speedChange(Particle *movePart, const vec3 &E_Vm, const vec3 &B_T) {
|
||||
@@ -95,7 +95,7 @@ bool E_Mover_Boris::doBoris_WallInteraction(Particle *movePart) {
|
||||
vec3 newLoc_m = movePart->get_Location_m();
|
||||
newLoc_m[2] = 0;
|
||||
movePart->set_Location_m(newLoc_m);
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (r_m>=Katrin_Geo::get_radius_m()) { // WGTS Wall Termination
|
||||
vec3 newLoc_m = movePart->get_Location_m();
|
||||
@@ -103,12 +103,12 @@ bool E_Mover_Boris::doBoris_WallInteraction(Particle *movePart) {
|
||||
newLoc_m[2] = 0;
|
||||
newLoc_m = (Katrin_Geo::get_radius_m() * 1.01)/vec3Abs(newLoc_m) * newLoc_m; //1.01 to move Particle slightly out of WGTS
|
||||
newLoc_m[2] = z_m;
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (loc_m[2]>=Katrin_Geo::get_z_WGTSend_m()) { // Spectrometer Reflection
|
||||
movePart->set_Speed_ms( -1*(movePart->get_Speed_ms()) );
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
void E_Mover_Boris::doBoris_LogzDirChange(Particle *movePart, double *oldzDir, vec3 *oldLoc_m) {
|
||||
|
||||
@@ -25,15 +25,15 @@ private:
|
||||
|
||||
inline bool E_Terminator::checkTermination (const Particle &movePart) {
|
||||
if (check_Wall(movePart)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (check_Energy(movePart)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (check_MaxInteractions(movePart)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,12 +42,12 @@ inline bool E_Terminator::check_Wall(const Particle &movePart) {
|
||||
double z_m = loc_m[2];
|
||||
double r_m = sqrt( pow(loc_m[0],2) + pow(loc_m[1],2) );
|
||||
if (z_m <= Katrin_Geo::get_z_RW_m()) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (r_m >= Katrin_Geo::get_radius_m()) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ double EnergeticPop_Container::getDensity_m3(const vec3 &locXYZ_m, double physTi
|
||||
vec3 zrphiCords = transformTo_zrphiCords(locXYZ_m, xyz);
|
||||
double V_m3 = get_V_m3(zrphiCords[1]);
|
||||
double cumTime_s = get_cumulated_time_s(zrphiCords);
|
||||
return (cumTime_s/physTime_s/V_m3);
|
||||
return cumTime_s/physTime_s/V_m3;
|
||||
}
|
||||
|
||||
double EnergeticPop_Container::get_cumulated_time_s(vec3 zrphiCords) {
|
||||
@@ -40,7 +40,7 @@ double EnergeticPop_Container::get_cumulated_time_s(vec3 zrphiCords) {
|
||||
for (dim1Map::iterator Itr = EMap.begin(); Itr != EMap.end(); Itr++) {
|
||||
cumTime_s +=Itr->second;
|
||||
}
|
||||
return(cumTime_s);
|
||||
return cumTime_s;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,9 +87,9 @@ double EnergeticPop_Container::roll_Energy_eV(const vec3 &locXYZ_m, UniRNG *rngU
|
||||
Itr--;
|
||||
|
||||
if (Itr == EMap.begin() ) {
|
||||
return (Itr->first);
|
||||
return Itr->first;
|
||||
} else {
|
||||
double E_eV = ( (Itr->first) + ((--Itr)->first) )/2;
|
||||
return (E_eV);
|
||||
return E_eV;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ public:
|
||||
double get_macroSigma_m2(const Particle &interPart);
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
private:
|
||||
double calc_T_eV(Particle *interPart, vec3 *v2_ms);
|
||||
virtual double get_microSigma_m2(const double &Ekin_EV) = 0;
|
||||
};
|
||||
|
||||
@@ -32,31 +31,18 @@ inline double Excitation_Base::get_macroSigma_m2(const Particle &interPart) {
|
||||
double microSigma_m2 = get_microSigma_m2(Ekin_eV);
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
double n_m3 = Population->get_density_m3(loc_m);
|
||||
return (microSigma_m2*n_m3);
|
||||
return microSigma_m2*n_m3;
|
||||
}
|
||||
|
||||
inline InteractionOut Excitation_Base::do_Interaction (Particle *interPart) {
|
||||
double Tnew_eV = interPart->get_EKin_eV() - deltaE_eV;
|
||||
vec3 vnew_ms = roll_uniform_direction(rngUni) * calc_Speed_from_Ekin_eV(Tnew_eV, interPart->get_Mass_eV());
|
||||
vec3 vOff_ms = get_vOff_ms(*interPart, deltaE_eV);
|
||||
vec3 vLab_ms = interPart->get_Speed_ms() - vOff_ms;
|
||||
double EkinLab_eV = calc_Ekin_eV_from_speed(vLab_ms, me_eV);
|
||||
double EkinLabNew_eV = EkinLab_eV - deltaE_eV;
|
||||
vec3 vnew_ms = roll_uniform_direction(rngUni) * calc_Speed_from_Ekin_eV(EkinLabNew_eV, me_eV) + vOff_ms;
|
||||
interPart->set_Speed_ms(vnew_ms);
|
||||
|
||||
return (InteractionOut());
|
||||
}
|
||||
|
||||
inline double Excitation_Base::calc_T_eV(Particle *interPart, vec3 *v2_ms) {
|
||||
vec3 v_ms = interPart->get_Speed_ms();
|
||||
vec3 vLab_ms = v_ms - *v2_ms;
|
||||
double T_eV = calc_Ekin_eV_from_speed(vLab_ms, me_eV);
|
||||
if (T_eV < deltaE_eV) {
|
||||
*v2_ms = 0;
|
||||
T_eV = calc_Ekin_eV_from_speed(v_ms, me_eV);
|
||||
if (T_eV < deltaE_eV) {
|
||||
std::stringstream ss;
|
||||
ss<<"Excitation_Base::calc_T_eV: T_eV < deltaE_eV \n";
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
}
|
||||
return (T_eV);
|
||||
return InteractionOut();
|
||||
}
|
||||
|
||||
|
||||
@@ -75,4 +61,6 @@ private:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif /* exc_base_h */
|
||||
|
||||
@@ -34,6 +34,6 @@ std::string H5_File::get_file_name() {
|
||||
H5name.str(std::string());
|
||||
H5name << parname << "_" << get_time_string() << "_" << i++<<".h5";
|
||||
} while ( is_file(H5name.str()) );
|
||||
return (H5name.str());
|
||||
return H5name.str();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ class H5_File {
|
||||
|
||||
public:
|
||||
H5_File();
|
||||
H5_Particles *get_h5part() {return(&h5part);}
|
||||
H5_Populations *get_h5pop() {return(&h5pop);}
|
||||
H5_Particles *get_h5part() {return &h5part;}
|
||||
H5_Populations *get_h5pop() {return &h5pop;}
|
||||
private:
|
||||
void create();
|
||||
std::string get_file_name();
|
||||
|
||||
@@ -32,10 +32,10 @@ public:
|
||||
H5_Particles() {};
|
||||
H5_Particles(hid_t *h5_file);
|
||||
|
||||
int get_numberZBins() {return(numberZBins);}
|
||||
bool get_logging() {return(logging);}
|
||||
double *get_zValues() {return(zValues);}
|
||||
hid_t *get_h5g_z() {return(h5g_z);}
|
||||
int get_numberZBins() {return numberZBins;}
|
||||
bool get_logging() {return logging;}
|
||||
double *get_zValues() {return zValues;}
|
||||
hid_t *get_h5g_z() {return h5g_z;}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
H5_Populations() {};
|
||||
H5_Populations(hid_t *h5_file);
|
||||
|
||||
hid_t *get_h5g_pop() {return(h5g_populations);}
|
||||
hid_t *get_h5g_pop() {return h5g_populations;}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -71,5 +71,5 @@ loggerParticle H5TB_Particle_Interface::transform(const Particle &logPart) {
|
||||
res.vx_ms = logPart.get_Speed_ms()[0];
|
||||
res.vy_ms = logPart.get_Speed_ms()[1];
|
||||
res.vz_ms = logPart.get_Speed_ms()[2];
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ class Hardsphere_elasticScattering {
|
||||
public:
|
||||
Hardsphere_elasticScattering(double r_m) {this->r_m = r_m;}
|
||||
|
||||
double get_TCS() {return(4*pi*r_m*r_m);}
|
||||
double get_SDCS() {return(r_m*r_m);}
|
||||
double get_TCS() {return 4*pi*r_m*r_m;}
|
||||
double get_SDCS() {return r_m*r_m;}
|
||||
|
||||
double roll_theta(UniRNG *rngUni) {return (pi*rngUni->random());}
|
||||
double roll_theta(UniRNG *rngUni) {return pi*rngUni->random();}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Particle Injector::injectElectron (const int &newId) {
|
||||
break;
|
||||
}
|
||||
vec3 speed_ms = roll_uniform_direction(rngUni) * calc_Speed_from_Ekin_eV(Ekin_eV,me_eV);
|
||||
return ( PartFac.createElectron(loc_m, speed_ms,newId,newId) );
|
||||
return PartFac.createElectron(loc_m, speed_ms,newId,newId);
|
||||
}
|
||||
|
||||
double Injector::roll_FermiEnergy_eV() {
|
||||
@@ -55,15 +55,15 @@ double Injector::roll_FermiEnergy_eV() {
|
||||
eta2 = rngUni->random();
|
||||
Ecan_eV = E_min_eV + eta1*(E_max_eV - E_min_eV);
|
||||
} while(eta2*pmax > get_FermiDecaySpectrumDensity(Ecan_eV));
|
||||
return(Ecan_eV);
|
||||
return Ecan_eV;
|
||||
}
|
||||
|
||||
double Injector::get_FermiDecaySpectrumDensity(const double &Ekin_eV) {
|
||||
if (Ekin_eV>TritiumDecayEndpoint_eV) {
|
||||
return (0.);
|
||||
return 0;
|
||||
} else{
|
||||
double p_eV = sqrt(Ekin_eV*Ekin_eV + 2 * Ekin_eV * me_eV);
|
||||
return( BetaDecayConst * get_FermiFunction(2, Ekin_eV) * p_eV*(Ekin_eV+me_eV)*pow(TritiumDecayEndpoint_eV-Ekin_eV,2) );
|
||||
return BetaDecayConst*get_FermiFunction(2, Ekin_eV)*p_eV*(Ekin_eV+me_eV)*pow(TritiumDecayEndpoint_eV-Ekin_eV,2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,5 +71,5 @@ double Injector::get_FermiFunction(const double &Z, const double &Ekin_eV) {
|
||||
double gamma = 1+ Ekin_eV/me_eV;
|
||||
double beta = sqrt(1 - pow(gamma,-2));
|
||||
double eta =Z/beta/137.;
|
||||
return( 2*pi*eta/(1-exp(-2*pi*eta)) );
|
||||
return 2*pi*eta/(1-exp(-2*pi*eta));
|
||||
}
|
||||
|
||||
@@ -34,18 +34,15 @@ public:
|
||||
|
||||
};
|
||||
|
||||
|
||||
inline InteractionOut Interaction_Base::do_Interaction(Particle *interPart) {
|
||||
double macroSigma_m2 = get_macroSigma_m2(*interPart);
|
||||
|
||||
double currentStackedSigma = 0;
|
||||
double targetStackedSigma = rngUni->random() * macroSigma_m2;
|
||||
|
||||
|
||||
for (int i = 0; i < numSubInteractions; i++) {
|
||||
currentStackedSigma += SubInteractions[i]->get_macroSigma_m2(*interPart);
|
||||
if (currentStackedSigma >= targetStackedSigma) {
|
||||
return (SubInteractions[i]->do_Interaction(interPart));
|
||||
return SubInteractions[i]->do_Interaction(interPart);
|
||||
}
|
||||
}
|
||||
std::cout<<interPart->get_species()<<"\n";
|
||||
@@ -54,12 +51,13 @@ inline InteractionOut Interaction_Base::do_Interaction(Particle *interPart) {
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
|
||||
|
||||
inline double Interaction_Base::get_macroSigma_m2(const Particle &interPart) {
|
||||
double macroSigma_m2 = 0;
|
||||
for (int i = 0; i < numSubInteractions; i++) {
|
||||
macroSigma_m2 += SubInteractions[i]->get_macroSigma_m2(interPart);
|
||||
}
|
||||
return(macroSigma_m2);
|
||||
return macroSigma_m2;
|
||||
}
|
||||
|
||||
inline void Interaction_Base::add(Sub_Interaction_Base *addSubInteraction) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
//#include "eT2_vibexc0102.h"
|
||||
#include "exc_base.h"
|
||||
#include "eT2_elexc_analytic.h"
|
||||
|
||||
#include "TT2_elastic.h"
|
||||
|
||||
@@ -26,7 +27,7 @@ Interaction_Manager Interaction_Builder::build(Population_Manager *Populations,
|
||||
Interactions.add(build_electron(Populations, rngUni));
|
||||
Interactions.add(build_tritiumI(Populations, rngUni));
|
||||
Interactions.add(build_tritium2I(Populations, rngUni));
|
||||
return(Interactions);
|
||||
return Interactions;
|
||||
}
|
||||
|
||||
Interaction_Base* Interaction_Builder::build_electron(Population_Manager *Populations, UniRNG *rngUni) {
|
||||
@@ -38,24 +39,49 @@ Interaction_Base* Interaction_Builder::build_electron(Population_Manager *Popula
|
||||
eInteraction->add(new eT2_Elastic(T2Population, rngUni));
|
||||
}
|
||||
if (eT2ionization == 1) {
|
||||
eInteraction->add(new eT2_T2I_Ionization_Container(T2Population, rngUni));
|
||||
if (true) {
|
||||
eInteraction->add(new eT2_T2I_Ionization_BED_Container(T2Population, rngUni));
|
||||
} else {
|
||||
eInteraction->add(new eT2_T2I_Ionization_Janev_ndiss(T2Population, rngUni));
|
||||
eInteraction->add(new eT2_T2I_Ionization_Janev_diss_g(T2Population, rngUni));
|
||||
eInteraction->add(new eT2_T2I_Ionization_Janev_diss_u(T2Population, rngUni));
|
||||
}
|
||||
}
|
||||
eInteraction->add(new eT2I_Recombination(T2IPopulation, rngUni));
|
||||
|
||||
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 4.41e-4, "rot_exc_j02.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 0.516, "rot_exc_j02.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 8.48, "el_exc_b3sigpu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.18, "el_exc_B1sigpu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.76, "el_exc_c3piu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.79, "el_exc_a3sigpg.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 12.29, "el_exc_C1piu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 12.3, "el_exc_EF1sigpg.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 13.23, "el_exc_e3sigpu.dat"));
|
||||
|
||||
if (false) {
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 4.41e-4, "rot_exc_j02.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 0.516, "rot_exc_j02.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 8.48, "el_exc_b3sigpu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.18, "el_exc_B1sigpu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.76, "el_exc_c3piu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 11.79, "el_exc_a3sigpg.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 12.29, "el_exc_C1piu.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 12.3, "el_exc_EF1sigpg.dat"));
|
||||
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, 13.23, "el_exc_e3sigpu.dat"));
|
||||
} else {
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(B1Sigmau)));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Bp1Sigu)));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Bpp1Sigu)));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(C1Piu)));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(D1Piu)));
|
||||
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Dp1Piu)));
|
||||
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(EF1Sigpg)));
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(HHb1Sigpg)));
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(GK1Sigpg)));
|
||||
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(I1Pig)));
|
||||
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(a3Sigpg)));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(b3Sigpu)));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(c3Piu)));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(e3Sigpu)));
|
||||
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(d3Piu)));
|
||||
}
|
||||
|
||||
//eInteraction->add(new eT2_VibExc01(T2Population, rngUni));
|
||||
//eInteraction->add(new eT2_VibExc02(T2Population, rngUni));
|
||||
return(eInteraction);
|
||||
return eInteraction;
|
||||
}
|
||||
|
||||
Interaction_Base* Interaction_Builder::build_tritiumI(Population_Manager *Populations, UniRNG *rngUni) {
|
||||
@@ -64,10 +90,10 @@ Interaction_Base* Interaction_Builder::build_tritiumI(Population_Manager *Popula
|
||||
|
||||
//TI_Interaction->add(new TT2_Elastic(T2Population, rngUni));
|
||||
|
||||
return(TI_Interaction);
|
||||
return TI_Interaction;
|
||||
}
|
||||
|
||||
Interaction_Base* Interaction_Builder::build_tritium2I(Population_Manager *Populations, UniRNG *rngUni) {
|
||||
Interaction_Base *TI2_Interaction = new Interaction_Base(tritium2I, rngUni);
|
||||
return(TI2_Interaction);
|
||||
return TI2_Interaction ;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
static double get_TCS(const double &E_eV) {
|
||||
double const1 = pow( pow(E_eV,0.665) * ( 1 + 1.1*pow(E_eV,0.512) + 0.011*pow(E_eV,3.10) ) , - 1);
|
||||
double const2 = 0.133 * exp(-0.35*pow(E_eV-6.05,2));
|
||||
return (17.3e-20 * (const1+const2) );
|
||||
return 17.3e-20 * (const1+const2);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
//
|
||||
// janev_eT2_elexc.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 01.07.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef janev_eT2_elexc_h
|
||||
#define janev_eT2_elexc_h
|
||||
|
||||
|
||||
#include "error_types.h"
|
||||
|
||||
// See Janev p34. and table 15
|
||||
|
||||
enum states_Nu {B1Sigmau, Bp1Sigu, Bpp1Sigu, C1Piu, D1Piu, Dp1Piu};
|
||||
|
||||
class Janev_eT2_ElExc_Nu {
|
||||
states_Nu final_state;
|
||||
double deltaE_eV, alpha, A1, A2, A3, A4;
|
||||
public:
|
||||
Janev_eT2_ElExc_Nu(states_Nu final_state) {
|
||||
this->final_state = final_state;
|
||||
set_constants();
|
||||
}
|
||||
|
||||
double get_TCS_m2 (const double &E_eV) {
|
||||
if (E_eV < deltaE_eV) {
|
||||
return 0;
|
||||
}
|
||||
double x = E_eV/deltaE_eV;
|
||||
double fac1 = 5.984/deltaE_eV/x*pow(1-1/x,alpha);
|
||||
double fac2 = (A1 + A2/x + A3/x/x + A4*log(x));
|
||||
return fac1 * fac2 * pow(10,-20);
|
||||
}
|
||||
|
||||
double get_deltaE_eV () {return deltaE_eV;}
|
||||
|
||||
private:
|
||||
void set_constants() {
|
||||
switch(final_state) {
|
||||
case B1Sigmau:
|
||||
deltaE_eV = 12.754;
|
||||
alpha = 0.550;
|
||||
A1 = 3.651e-2;
|
||||
A2 = -0.8405;
|
||||
A3 = 1.2365;
|
||||
A4 = 2.5236;
|
||||
break;
|
||||
case Bp1Sigu:
|
||||
deltaE_eV = 14.85;
|
||||
alpha = 0.550;
|
||||
A1 = 6.827e-3;
|
||||
A2 = -0.1572;
|
||||
A3 = 0.23122;
|
||||
A4 = 0.47191;
|
||||
break;
|
||||
case Bpp1Sigu:
|
||||
deltaE_eV = 15.47;
|
||||
alpha = 0.550;
|
||||
A1 = 2.446e-3;
|
||||
A2 = -5.631e-2;
|
||||
A3 = 6.2846e-2;
|
||||
A4 = 0.16908;
|
||||
break;
|
||||
case C1Piu:
|
||||
deltaE_eV = 13.29;
|
||||
alpha = 0.552;
|
||||
A1 = 3.653e-2;
|
||||
A2 = -0.8398;
|
||||
A3 = 1.2368;
|
||||
A4 = 2.8740;
|
||||
break;
|
||||
case D1Piu:
|
||||
deltaE_eV = 14.996;
|
||||
alpha = 0.552;
|
||||
A1 = 8.913e-3;
|
||||
A2 = -0.2049;
|
||||
A3 = 0.30178;
|
||||
A4 = 0.70126;
|
||||
break;
|
||||
case Dp1Piu:
|
||||
deltaE_eV = 15.555;
|
||||
alpha = 0.552;
|
||||
A1 = 3.872e-3;
|
||||
A2 = -8.902e-2;
|
||||
A3 = 0.13110;
|
||||
A4 = 0.30464;
|
||||
break;
|
||||
default : //Optional
|
||||
std::stringstream ss;
|
||||
ss<<"Janev_eT2_ElExc_Nu:set_constants: finale_state unknown. \n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
enum states_Ng {EF1Sigpg, HHb1Sigpg, GK1Sigpg, I1Pig};
|
||||
|
||||
class Janev_eT2_ElExc_Ng {
|
||||
states_Ng final_state;
|
||||
double deltaE_eV, alpha, A1;
|
||||
public:
|
||||
Janev_eT2_ElExc_Ng(states_Ng final_state) {
|
||||
this->final_state = final_state;
|
||||
set_constants();
|
||||
}
|
||||
|
||||
double get_TCS_m2 (const double &E_eV) {
|
||||
if (E_eV < deltaE_eV) {
|
||||
return 0;
|
||||
}
|
||||
double x = E_eV/deltaE_eV;
|
||||
return 5.984*A1/deltaE_eV/x*pow(1-1/x,alpha) * pow(10,-20);
|
||||
}
|
||||
|
||||
double get_deltaE_eV () {return deltaE_eV;}
|
||||
private:
|
||||
void set_constants() {
|
||||
switch(final_state) {
|
||||
case EF1Sigpg:
|
||||
deltaE_eV = 13.13;
|
||||
alpha = 2.71;
|
||||
A1 = 0.8322;
|
||||
break;
|
||||
case HHb1Sigpg:
|
||||
deltaE_eV = 14.98;
|
||||
alpha = 2.71;
|
||||
A1 = 2.913e-2;
|
||||
break;
|
||||
case GK1Sigpg:
|
||||
deltaE_eV = 14.816;
|
||||
alpha = 2.75;
|
||||
A1 = 1.43e-2;
|
||||
break;
|
||||
case I1Pig:
|
||||
deltaE_eV = 14.824;
|
||||
alpha = 2.80;
|
||||
A1 = 5.409e-2;
|
||||
break;
|
||||
default : //Optional
|
||||
std::stringstream ss;
|
||||
ss<<"Janev_eT2_ElExc_Ng:set_constants: finale_state unknown. \n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
enum states_n {a3Sigpg, b3Sigpu, c3Piu, e3Sigpu, d3Piu};
|
||||
|
||||
class Janev_eT2_ElExc_n {
|
||||
states_n final_state;
|
||||
double deltaE_eV, beta, gamma, A;
|
||||
public:
|
||||
Janev_eT2_ElExc_n(states_n final_state) {
|
||||
this->final_state = final_state;
|
||||
set_constants();
|
||||
}
|
||||
|
||||
double get_TCS_m2 (const double &E_eV) {
|
||||
if (E_eV < deltaE_eV) {
|
||||
return 0;
|
||||
}
|
||||
double x = E_eV/deltaE_eV;
|
||||
return A*pow(x,3)*pow(1-pow(x,-beta),gamma) * pow(10,-20);
|
||||
}
|
||||
|
||||
double get_deltaE_eV () {return deltaE_eV;}
|
||||
private:
|
||||
void set_constants() {
|
||||
switch(final_state) {
|
||||
case a3Sigpg:
|
||||
deltaE_eV = 11.72;
|
||||
beta = 4.5;
|
||||
gamma = 1.55;
|
||||
A = 0.544;
|
||||
break;
|
||||
case b3Sigpu:
|
||||
deltaE_eV = 7.93;
|
||||
beta = 2.33;
|
||||
gamma = 3.78;
|
||||
A = 11.16;
|
||||
break;
|
||||
case c3Piu:
|
||||
deltaE_eV = 11.72;
|
||||
beta = 5.5;
|
||||
gamma = 1.65;
|
||||
A = 1.43;
|
||||
break;
|
||||
case e3Sigpu :
|
||||
deltaE_eV = 13.0;
|
||||
beta = 4.5;
|
||||
gamma = 1.60;
|
||||
A = 0.190;
|
||||
break;
|
||||
case d3Piu:
|
||||
deltaE_eV = 13.6;
|
||||
beta = 5.5;
|
||||
gamma = 1.75;
|
||||
A = 0.375;
|
||||
break;
|
||||
default : //Optional
|
||||
std::stringstream ss;
|
||||
ss<<"Janev_eT2_ElExc_n:set_constants: finale_state unknown. \n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
}
|
||||
};
|
||||
#endif /* janev_eT2_elexc_h */
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// janev_eT2_ionization.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 02.07.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef janev_eT2_ionization_h
|
||||
#define janev_eT2_ionization_h
|
||||
|
||||
|
||||
class Janev_eT2_Ionization_ndiss {
|
||||
constexpr static const double deltaE_eV = 15.42;
|
||||
|
||||
public:
|
||||
Janev_eT2_Ionization_ndiss() {}
|
||||
|
||||
static double get_TCS_m2(const double &E_eV) {
|
||||
if (E_eV<deltaE_eV) {
|
||||
return 0;
|
||||
} else {
|
||||
double x = E_eV/deltaE_eV;
|
||||
double C0 = 2.05*deltaE_eV;
|
||||
return 1.828/x*pow(1-pow(x,-0.92),2.19)*log(C0*x)*1e-20;
|
||||
}
|
||||
}
|
||||
|
||||
static double get_deltaE_eV() {return deltaE_eV;}
|
||||
};
|
||||
|
||||
|
||||
class Janev_eT2_Ionization_diss_g {
|
||||
constexpr static const double deltaE_eV = 18.15;
|
||||
public:
|
||||
Janev_eT2_Ionization_diss_g() {}
|
||||
|
||||
static double get_TCS_m2(const double &E_eV) {
|
||||
if (E_eV<deltaE_eV) {
|
||||
return 0;
|
||||
} else {
|
||||
double x = E_eV/deltaE_eV;
|
||||
return 0.02905*pow(x,-1.25)*pow(1-pow(x,-2.78),1.886)*1e-20;
|
||||
}
|
||||
}
|
||||
|
||||
static double get_deltaE_eV() {return deltaE_eV;}
|
||||
};
|
||||
|
||||
|
||||
class Janev_eT2_Ionization_diss_u {
|
||||
constexpr static const double deltaE_eV = 30.6;
|
||||
public:
|
||||
Janev_eT2_Ionization_diss_u() {}
|
||||
|
||||
static double get_TCS_m2(const double &E_eV) {
|
||||
if (E_eV<deltaE_eV) {
|
||||
return 0;
|
||||
} else {
|
||||
double x = E_eV/deltaE_eV;
|
||||
return 0.5927*pow(x,-1.2)*pow(1-pow(x,-1.22),3.375)*1e-20;
|
||||
}
|
||||
}
|
||||
|
||||
static double get_deltaE_eV() {return deltaE_eV;}
|
||||
};
|
||||
|
||||
|
||||
#endif /* janev_eT2_ionization_h */
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
|
||||
static double get_TCS(const double &E_eV, const int &finale_state) {
|
||||
if (E_eV<get_deltaE_eV(finale_state)) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
double xi = get_xi(finale_state);
|
||||
double deltaE_eV = get_deltaE_eV(finale_state);
|
||||
@@ -30,9 +30,9 @@ public:
|
||||
|
||||
static double get_deltaE_eV(const int &finale_state) {
|
||||
if (finale_state == 1) {
|
||||
return (0.516);
|
||||
return 0.516;
|
||||
} else if (finale_state == 2) {
|
||||
return (1.003);
|
||||
return 1.003;
|
||||
}
|
||||
std::stringstream ss;
|
||||
ss<<"Janev_eT2_Recombination:get_deltaE_eV: finale_state != 1,2 \n";
|
||||
@@ -42,9 +42,9 @@ public:
|
||||
private:
|
||||
static double get_xi(const int &finale_state) {
|
||||
if (finale_state == 1) {
|
||||
return (1);
|
||||
return 1;
|
||||
} else if (finale_state == 2) {
|
||||
return (0.628);
|
||||
return 0.628;
|
||||
}
|
||||
std::stringstream ss;
|
||||
ss<<"Janev_eT2_Recombination:get_xi: finale_state != 1,2 \n";
|
||||
|
||||
@@ -20,11 +20,11 @@ public:
|
||||
|
||||
static vec3 getMagField_T(vec3 loc_m) {
|
||||
Katrin_Geo::check_inKatrin(loc_m);
|
||||
return (vec3(0,0,wgtsMagField_T));
|
||||
return vec3(0,0,wgtsMagField_T);
|
||||
}
|
||||
static vec3 getElField_Vm(vec3 loc_m) {
|
||||
Katrin_Geo::check_inKatrin(loc_m);
|
||||
return (vec3(0,0,0));
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -41,13 +41,13 @@ bool Katrin_Geo::inWGTS(vec3 loc_m) {
|
||||
double z_m = loc_m[2];
|
||||
double r_m = sqrt(loc_m[0]*loc_m[0] + loc_m[1]*loc_m[1]);
|
||||
if (z_m < wgtsStartZ_m) {
|
||||
return (false);
|
||||
return false;
|
||||
} else if (z_m > wgtsEndZ_m) {
|
||||
return (false);
|
||||
return false;
|
||||
} else if (r_m > wgtsRadius_m) {
|
||||
return (false);
|
||||
return false;
|
||||
} else {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,12 +55,12 @@ bool Katrin_Geo::inKatrin(vec3 loc_m) {
|
||||
double z_m = loc_m[2];
|
||||
double r_m = sqrt(loc_m[0]*loc_m[0] + loc_m[1]*loc_m[1]);
|
||||
if (z_m < rearwallZ_m) {
|
||||
return (false);
|
||||
return false;
|
||||
} else if (z_m > wgtsEndZ_m) {
|
||||
return (false);
|
||||
return false;
|
||||
} else if (r_m > wgtsRadius_m) {
|
||||
return (false);
|
||||
return false;
|
||||
} else {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ class Katrin_Geo {
|
||||
public:
|
||||
Katrin_Geo() {};
|
||||
|
||||
static double get_z_RW_m() {return(rearwallZ_m);};
|
||||
static double get_z_WGTSstart_m() {return(wgtsStartZ_m);};
|
||||
static double get_z_WGTSend_m() {return(wgtsEndZ_m);};
|
||||
static double get_radius_m() {return(wgtsRadius_m);};
|
||||
static double get_z_RW_m() {return rearwallZ_m;};
|
||||
static double get_z_WGTSstart_m() {return wgtsStartZ_m;};
|
||||
static double get_z_WGTSend_m() {return wgtsEndZ_m;};
|
||||
static double get_radius_m() {return wgtsRadius_m;};
|
||||
|
||||
static void check_inWGTS(vec3 loc_m);
|
||||
static void check_inKatrin(vec3 loc_m);
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
static bool inWGTS(vec3 loc_m);
|
||||
static bool inKatrin(vec3 loc_m);
|
||||
|
||||
static double get_wgtsLength_m() {return (get_z_WGTSend_m() - get_z_WGTSstart_m());};
|
||||
static double get_wgtsLength_m() {return get_z_WGTSend_m() - get_z_WGTSstart_m();};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ typedef blitz::TinyVector<double,3> vec3;
|
||||
|
||||
|
||||
inline double vec3Abs(const vec3 &vec) {
|
||||
return( sqrt( pow(vec[0],2) + pow(vec[1],2) + pow(vec[2],2)) );
|
||||
return sqrt( pow(vec[0],2) + pow(vec[1],2) + pow(vec[2],2));
|
||||
}
|
||||
|
||||
inline double calc_gamma_from_beta(const double &beta) {
|
||||
@@ -34,7 +34,7 @@ inline double calc_gamma_from_beta(const double &beta) {
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
|
||||
return( pow(1 - pow(beta,2),-0.5) ) ;
|
||||
return pow(1 - pow(beta,2),-0.5);
|
||||
}
|
||||
|
||||
inline double calc_Ekin_eV_from_speed(const double &speed_ms, const double &mass_eV) {
|
||||
@@ -49,11 +49,11 @@ inline double calc_Ekin_eV_from_speed(const double &speed_ms, const double &mass
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
double gamma = calc_gamma_from_beta(beta);
|
||||
return ( (gamma-1) * mass_eV );
|
||||
return (gamma-1) * mass_eV;
|
||||
}
|
||||
|
||||
inline double calc_Ekin_eV_from_speed(const vec3 &speed_ms, const double &mass_eV) {
|
||||
return (calc_Ekin_eV_from_speed(vec3Abs(speed_ms), mass_eV));
|
||||
return calc_Ekin_eV_from_speed(vec3Abs(speed_ms), mass_eV);
|
||||
}
|
||||
|
||||
inline double calc_beta_from_gamma(const double &gamma) {
|
||||
@@ -62,7 +62,7 @@ inline double calc_beta_from_gamma(const double &gamma) {
|
||||
ss<<"calc_beta_from_gamma(): Input gamma ="<<gamma<<" smaller 1.";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return( sqrt(1 - pow(gamma,-2)) );
|
||||
return sqrt(1 - pow(gamma,-2));
|
||||
}
|
||||
|
||||
inline double calc_gamma_from_Ekin_eV(const double &Ekin_eV, const double &mass_eV) {
|
||||
@@ -71,11 +71,11 @@ inline double calc_gamma_from_Ekin_eV(const double &Ekin_eV, const double &mass_
|
||||
ss<<"calc_gamma_from_Ekin_eV(): Input Ekin_eV ="<<Ekin_eV<<" negative.";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return (1. + Ekin_eV/mass_eV);
|
||||
return 1 + Ekin_eV/mass_eV;
|
||||
}
|
||||
|
||||
inline double calc_beta_from_Ekin_eV(const double &Ekin_eV, const double &mass_eV) {
|
||||
return ( calc_beta_from_gamma(calc_gamma_from_Ekin_eV(Ekin_eV, mass_eV)) );
|
||||
return calc_beta_from_gamma(calc_gamma_from_Ekin_eV(Ekin_eV, mass_eV));
|
||||
}
|
||||
|
||||
inline double calc_Speed_from_Ekin_eV(const double &Ekin_eV, const double &mass_eV) {
|
||||
@@ -87,7 +87,7 @@ inline double calc_Speed_from_Ekin_eV(const double &Ekin_eV, const double &mass_
|
||||
|
||||
double gamma = calc_gamma_from_Ekin_eV(Ekin_eV, mass_eV);
|
||||
double beta = calc_beta_from_gamma(gamma);
|
||||
return(beta * c_ms);
|
||||
return beta*c_ms;
|
||||
}
|
||||
|
||||
inline vec3 calc_newDirection(const vec3 &direction_old, const double &theta_change, const double &phi_change) {
|
||||
@@ -107,22 +107,22 @@ inline vec3 calc_newDirection(const vec3 &direction_old, const double &theta_cha
|
||||
vNew = sin(theta_change)*sin(phi_change);
|
||||
wNew = cos(theta_change);
|
||||
}
|
||||
return(vec3(uNew, vNew, wNew));
|
||||
return vec3(uNew, vNew, wNew);
|
||||
}
|
||||
|
||||
inline double get_z_m(const vec3 &loc_m) {
|
||||
return (loc_m[2]);
|
||||
return loc_m[2];
|
||||
}
|
||||
|
||||
inline double get_r_m(const vec3 &loc_m) {
|
||||
return (sqrt(loc_m[0]*loc_m[0] + loc_m[1]*loc_m[1]));
|
||||
return sqrt(loc_m[0]*loc_m[0] + loc_m[1]*loc_m[1]);
|
||||
}
|
||||
|
||||
inline double get_phi(const vec3 &loc_m) {
|
||||
if (loc_m[1] >= 0) {
|
||||
return ( acos(loc_m[0]/get_r_m(loc_m)) );
|
||||
return acos(loc_m[0]/get_r_m(loc_m));
|
||||
} else {
|
||||
return ( 2*pi - acos(loc_m[0]/get_r_m(loc_m)) );
|
||||
return 2*pi - acos(loc_m[0]/get_r_m(loc_m));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,14 +62,16 @@ public:
|
||||
void doKinematics (Particle* P1, const vec3 &v2_lab_ms, const double &theta_lab, const double &phi_lab);
|
||||
|
||||
private:
|
||||
double ET_eV(const double &E1_eV) {return (E1_eV + Q_eV);}
|
||||
double A (const double &E1_eV) {return (a*E1_eV/(E1_eV-Q_eV));}
|
||||
double B (const double &E1_eV) {return (b*E1_eV/(E1_eV-Q_eV));}
|
||||
double temp_cd(const double &E1_eV) {return (1 + m1_eV*Q_eV/m2_eV/(E1_eV-Q_eV));}
|
||||
double C (const double &E1_eV) {return (c*temp_cd(E1_eV));}
|
||||
double D (const double &E1_eV) {return (d*temp_cd(E1_eV));}
|
||||
double ET_eV(const double &E1_eV) {return E1_eV + Q_eV;}
|
||||
double A (const double &E1_eV) {return a*E1_eV/(E1_eV-Q_eV);}
|
||||
double B (const double &E1_eV) {return b*E1_eV/(E1_eV-Q_eV);}
|
||||
double temp_cd(const double &E1_eV) {return 1 + m1_eV*Q_eV/m2_eV/(E1_eV-Q_eV);}
|
||||
double C (const double &E1_eV) {return c*temp_cd(E1_eV);}
|
||||
double D (const double &E1_eV) {return d*temp_cd(E1_eV);}
|
||||
};
|
||||
|
||||
|
||||
// For mass loss
|
||||
inline Inelastic_Kinematic_Base::Inelastic_Kinematic_Base(const double &Q_eV, const double &m1_eV, const double &m2_eV) {
|
||||
this->Q_eV = Q_eV;
|
||||
if (Q_eV<=0) {
|
||||
|
||||
@@ -90,7 +90,7 @@ inline double Kinetic_Population::get_density_m3(const vec3 &loc_m) {
|
||||
double bin_size_m3 = bin_sizes.get_cell_volume_m3(loc_m);
|
||||
double dens_m3 = total_cumulated_time_s/physical_time_s/bin_size_m3 - total_offset;
|
||||
dens_m3 = (dens_m3 < 0) ? 0 : dens_m3;
|
||||
return(dens_m3);
|
||||
return dens_m3;
|
||||
}
|
||||
|
||||
inline void Kinetic_Population::increase_density(const Particle &upPart, const vec3 &oldLoc_m) {
|
||||
@@ -105,7 +105,7 @@ inline void Kinetic_Population::decrease_denisty (const vec3 &loc_m, const doubl
|
||||
|
||||
|
||||
inline vec3 Kinetic_Population::get_average_speed_ms(const vec3 &loc_m) {
|
||||
return (vec3(0,0,0));
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
|
||||
inline vec3 Kinetic_Population::roll_speed_ms(const vec3 &loc_m) {
|
||||
@@ -167,7 +167,7 @@ inline meta_vec Kinetic_Population::get_bins_meta_info() {
|
||||
}
|
||||
temp_bin.z_min_m = temp_bin.z_max_m;
|
||||
}
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
inline bin_content_vec Kinetic_Population::get_bins_content() {
|
||||
@@ -194,7 +194,7 @@ inline bin_content_vec Kinetic_Population::get_bins_content() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
inline bin_count4 Kinetic_Population::get_bin_count4() {
|
||||
@@ -203,7 +203,7 @@ inline bin_count4 Kinetic_Population::get_bin_count4() {
|
||||
res[1] = get_r_scale().get_number_bins();
|
||||
res[2] = get_phi_scale().get_number_bins();
|
||||
res[3] = get_E_scale().get_number_bins();
|
||||
return(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
inline void Kinetic_Population::set_bins(bin_count4 bin_counts, bin_content_vec bin_contents) {
|
||||
@@ -232,22 +232,22 @@ inline void Kinetic_Population::set_bins(bin_count4 bin_counts, bin_content_vec
|
||||
}
|
||||
|
||||
inline Lin_Scale Kinetic_Population::get_z_scale() {
|
||||
return (cumulated_times_s.get_z_scale());
|
||||
return cumulated_times_s.get_z_scale();
|
||||
|
||||
}
|
||||
|
||||
inline Lin_Scale Kinetic_Population::get_r_scale() {
|
||||
return (cumulated_times_s.get_r_scale());
|
||||
return cumulated_times_s.get_r_scale();
|
||||
|
||||
}
|
||||
|
||||
inline Lin_Scale Kinetic_Population::get_phi_scale() {
|
||||
return (cumulated_times_s.get_phi_scale());
|
||||
return cumulated_times_s.get_phi_scale();
|
||||
|
||||
}
|
||||
|
||||
inline Log_Scale Kinetic_Population::get_E_scale() {
|
||||
return (cumulated_times_s.get_E_scale());
|
||||
return cumulated_times_s.get_E_scale();
|
||||
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -53,51 +53,51 @@ inline Lin_Scale::Lin_Scale(const double &min_x, const double &max_x, const int
|
||||
}
|
||||
|
||||
inline double Lin_Scale::get_lower_scale_end() {
|
||||
return(min_x);
|
||||
return min_x;
|
||||
}
|
||||
inline double Lin_Scale::get_upper_scale_end() {
|
||||
return(max_x);
|
||||
return max_x;
|
||||
}
|
||||
|
||||
inline int Lin_Scale::get_number_bins() {
|
||||
return(number_bins);
|
||||
return number_bins;
|
||||
}
|
||||
|
||||
inline int Lin_Scale::calc_index(const double &x) {
|
||||
if (x <= min_x) {
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
if (x >= max_x) {
|
||||
return (number_bins-1);
|
||||
return number_bins-1;
|
||||
}
|
||||
return (std::ceil((x-min_x)/delta_x) - 1);
|
||||
return std::ceil((x-min_x)/delta_x) - 1;
|
||||
}
|
||||
|
||||
inline double Lin_Scale::get_lower_bin_bound(const int &index) {
|
||||
return (min_x + double(index) * delta_x);
|
||||
return min_x + double(index) * delta_x;
|
||||
}
|
||||
|
||||
inline double Lin_Scale::get_bin_mid(const int &index) {
|
||||
return (min_x + double(index+0.5) * delta_x);
|
||||
return min_x + double(index+0.5) * delta_x;
|
||||
}
|
||||
|
||||
inline double Lin_Scale::get_upper_bin_bound(const int &index) {
|
||||
return (min_x + double(index + 1) * delta_x);
|
||||
return min_x + double(index + 1) * delta_x;
|
||||
}
|
||||
|
||||
inline bool Lin_Scale::is_valid_index (const int &index) {
|
||||
if (index < 0 || index > (number_bins-1) ) {
|
||||
return (false);
|
||||
return false;
|
||||
} else {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool operator==(const Lin_Scale &scale1, const Lin_Scale &scale2) {
|
||||
return (scale1.min_x== scale2.min_x &&
|
||||
return scale1.min_x== scale2.min_x &&
|
||||
scale1.max_x== scale2.max_x &&
|
||||
scale1.delta_x== scale2.delta_x &&
|
||||
scale1.number_bins== scale2.number_bins);
|
||||
scale1.number_bins== scale2.number_bins;
|
||||
}
|
||||
|
||||
#endif /* lin_scale_h */
|
||||
|
||||
@@ -37,43 +37,43 @@ public:
|
||||
|
||||
inline double Log_Scale::get_lower_scale_end() {
|
||||
double min_x = pow(10,lin_scale.get_lower_scale_end());
|
||||
return(min_x);
|
||||
return min_x;
|
||||
}
|
||||
inline double Log_Scale::get_upper_scale_end() {
|
||||
double max_x = pow(10,lin_scale.get_upper_scale_end());
|
||||
return(max_x);
|
||||
return max_x;
|
||||
}
|
||||
|
||||
inline int Log_Scale::get_number_bins() {
|
||||
return(lin_scale.get_number_bins());
|
||||
return lin_scale.get_number_bins();
|
||||
}
|
||||
|
||||
inline int Log_Scale::calc_index(const double &x) {
|
||||
double p = std::log10(x);
|
||||
return (lin_scale.calc_index(p));
|
||||
return lin_scale.calc_index(p);
|
||||
}
|
||||
|
||||
inline double Log_Scale::get_lower_bin_bound(const int &index) {
|
||||
double p = lin_scale.get_lower_bin_bound(index);
|
||||
return (pow(10,p));
|
||||
return pow(10,p);
|
||||
}
|
||||
|
||||
inline double Log_Scale::get_bin_mid(const int &index) {
|
||||
double p = lin_scale.get_bin_mid(index);
|
||||
return (pow(10,p));
|
||||
return pow(10,p);
|
||||
}
|
||||
|
||||
inline double Log_Scale::get_upper_bin_bound(const int &index) {
|
||||
double p = lin_scale.get_upper_bin_bound(index);
|
||||
return (pow(10,p));
|
||||
return pow(10,p);
|
||||
}
|
||||
|
||||
inline bool Log_Scale::is_valid_index (const int &index) {
|
||||
return (lin_scale.is_valid_index(index));
|
||||
return lin_scale.is_valid_index(index);
|
||||
}
|
||||
|
||||
inline bool operator==(const Log_Scale &scale1, const Log_Scale &scale2) {
|
||||
return (scale1.lin_scale == scale2.lin_scale);
|
||||
return scale1.lin_scale == scale2.lin_scale;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Particle_Logger_Manager Particle_Logger_Builder::build(H5_File *h5f) {
|
||||
ParticleLogger.add(build_eLogger(h5part));
|
||||
ParticleLogger.add(new Off_Particle_Logger(tritiumI));
|
||||
ParticleLogger.add(new Off_Particle_Logger(tritium2I));
|
||||
return (ParticleLogger);
|
||||
return ParticleLogger;
|
||||
}
|
||||
|
||||
Particle_Logger_Base *Particle_Logger_Builder::build_eLogger(H5_Particles *h5part) {
|
||||
@@ -34,7 +34,7 @@ Particle_Logger_Base *Particle_Logger_Builder::build_eLogger(H5_Particles *h5par
|
||||
} else {
|
||||
res = new MuliZ_Particle_Logger(electron, h5part->get_numberZBins(), h5part->get_zValues(), h5part->get_h5g_z());
|
||||
}
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
Population_Logger_Manager Population_Logger_Builder::build(H5_File *h5f, Population_Manager *populations, Timer *timer) {
|
||||
@@ -42,5 +42,5 @@ Population_Logger_Manager Population_Logger_Builder::build(H5_File *h5f, Populat
|
||||
hid_t *h5pop = h5f->get_h5pop()->get_h5g_pop();
|
||||
Population_Base *T2I_population = populations->find(tritium2I);
|
||||
Population_Loggers.add (new Population_Logger(T2I_population, timer, h5pop));
|
||||
return (Population_Loggers);
|
||||
return Population_Loggers;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "simulation.hpp"
|
||||
|
||||
#include "tcs_container.hpp"
|
||||
|
||||
#include "janev_eT2_ionization.h"
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
@@ -42,17 +42,17 @@ template <class T>
|
||||
inline bool Manager_Base<T>::exists(species this_species) {
|
||||
for (typename std::vector<T*>::iterator Itr = processes.begin(); Itr!=processes.end(); Itr++) {
|
||||
if ((*Itr)->get_species() == this_species) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T* Manager_Base<T>::find(species this_species) {
|
||||
for (typename std::vector<T*>::iterator Itr = processes.begin(); Itr!=processes.end(); Itr++) {
|
||||
if ((*Itr)->get_species() == this_species) {
|
||||
return (*Itr);
|
||||
return *Itr;
|
||||
}
|
||||
}
|
||||
std::stringstream ss;
|
||||
|
||||
@@ -24,7 +24,7 @@ Mover_Manager Mover_Builder::build(Particle_Logger_Manager *Loggers, Population_
|
||||
Movers.add(build_electron(Loggers, Populations));
|
||||
Movers.add(build_tritiumI(Loggers, Populations));
|
||||
Movers.add(build_tritium2I(Loggers, Populations));
|
||||
return (Movers);
|
||||
return Movers;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,17 +37,17 @@ Mover_Base *Mover_Builder::build_electron(Particle_Logger_Manager *Loggers, Popu
|
||||
} else {
|
||||
electron_Mover = new E_Mover_Boris(dt_s, Logger, Popultation);
|
||||
}
|
||||
return (electron_Mover);
|
||||
return electron_Mover;
|
||||
}
|
||||
|
||||
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 TI_Mover_Drift(Logger, Popultation));
|
||||
return new TI_Mover_Drift(Logger, Popultation);
|
||||
}
|
||||
|
||||
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 T2I_Mover_Drift(Logger, Popultation));
|
||||
return new T2I_Mover_Drift(Logger, Popultation);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,9 @@ std::string get_species_string(const species &spec) {
|
||||
case electron:
|
||||
res = "e-";
|
||||
break;
|
||||
case tritium:
|
||||
res = "T";
|
||||
break;
|
||||
case tritiumI:
|
||||
res = "T+";
|
||||
break;
|
||||
@@ -33,18 +36,19 @@ std::string get_species_string(const species &spec) {
|
||||
ss<<"get_species_string: Species not defined\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
species get_species_from_string(const std::string &species_string) {
|
||||
std::vector<species> all;
|
||||
all.push_back(electron);
|
||||
all.push_back(tritium);
|
||||
all.push_back(tritiumI);
|
||||
all.push_back(tritium2I);
|
||||
all.push_back(tritium2);
|
||||
for (std::vector<species>::iterator Itr = all.begin(); Itr!= all.end(); Itr++) {
|
||||
if (get_species_string(*Itr) == species_string) {
|
||||
return (*Itr);
|
||||
return *Itr;
|
||||
}
|
||||
}
|
||||
stringstream ss;
|
||||
@@ -58,6 +62,9 @@ double get_species_mass(const species &spec) {
|
||||
case electron:
|
||||
res = me_eV;
|
||||
break;
|
||||
case tritium:
|
||||
res = mT_eV;
|
||||
break;
|
||||
case tritiumI:
|
||||
res = mT_eV;
|
||||
break;
|
||||
@@ -72,13 +79,13 @@ double get_species_mass(const species &spec) {
|
||||
ss<<"get_species_mass: Species not defined\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
ostream& operator<<(ostream& os, const species& spec) {
|
||||
os<<get_species_string(spec);
|
||||
return (os);
|
||||
return os;
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& os, const Particle& partOut) {
|
||||
@@ -107,4 +114,3 @@ Particle::Particle(double mass_eV, double charge_e,vec3 loc_m, vec3 speed_ms, do
|
||||
s = spec;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
typedef blitz::TinyVector<double,3> vec3;
|
||||
|
||||
typedef enum species{electron, tritiumI, tritium2I, tritium2} species;
|
||||
enum species{electron, tritium, tritiumI, tritium2I, tritium2};
|
||||
|
||||
std::string get_species_string(const species &spec);
|
||||
species get_species_from_string(const std::string &species_string);
|
||||
@@ -43,17 +43,17 @@ protected:
|
||||
unsigned int parentId;
|
||||
|
||||
public:
|
||||
double get_Mass_eV() const {return(m_eV);}
|
||||
double get_Charge_nat() const {return(Z);}
|
||||
vec3 get_Location_m() const {return(x_m);}
|
||||
vec3 get_Speed_ms() const {return(v_ms);}
|
||||
species get_species() const {return(s);}
|
||||
double get_Id() const {return(Id);}
|
||||
double get_ParentId() const {return(parentId);}
|
||||
double get_Mass_eV() const {return m_eV;}
|
||||
double get_Charge_nat() const {return Z;}
|
||||
vec3 get_Location_m() const {return x_m;}
|
||||
vec3 get_Speed_ms() const {return v_ms;}
|
||||
species get_species() const {return s;}
|
||||
double get_Id() const {return Id;}
|
||||
double get_ParentId() const {return parentId;}
|
||||
|
||||
double get_Radius_m() const {return ( sqrt( pow(x_m[0],2) + pow(x_m[1],2) ) );}
|
||||
double get_SpeedAbs_ms() const {return ( vec3Abs(v_ms) ); } ;
|
||||
double get_EKin_eV() const {return ( calc_Ekin_eV_from_speed(v_ms, m_eV) );}
|
||||
double get_Radius_m() const {return sqrt( pow(x_m[0],2) + pow(x_m[1],2) );}
|
||||
double get_SpeedAbs_ms() const {return vec3Abs(v_ms); } ;
|
||||
double get_EKin_eV() const {return calc_Ekin_eV_from_speed(v_ms, m_eV);}
|
||||
|
||||
void set_Location_m(blitz::TinyVector<double, 3> xnew_m) {x_m = xnew_m;}
|
||||
void set_Speed_ms(blitz::TinyVector<double, 3> vnew_ms) {v_ms = vnew_ms;}
|
||||
@@ -67,15 +67,19 @@ public:
|
||||
Particle_Builder() {};
|
||||
|
||||
static Particle createElectron(vec3 loc_m, vec3 speed_ms, double idnum, double parentIdnum) {
|
||||
return ( Particle(me_eV, -1 , loc_m, speed_ms, idnum, parentIdnum, electron));
|
||||
return Particle(me_eV, -1 , loc_m, speed_ms, idnum, parentIdnum, electron);
|
||||
}
|
||||
|
||||
static Particle createTritium(vec3 loc_m, vec3 speed_ms, double idnum, double parentIdnum) {
|
||||
return Particle(mT_eV, 0 , loc_m, speed_ms, idnum, parentIdnum, tritium);
|
||||
}
|
||||
|
||||
static Particle createTritiumI(vec3 loc_m, vec3 speed_ms, double idnum, double parentIdnum) {
|
||||
return ( Particle(mT_eV, 1 , loc_m, speed_ms, idnum, parentIdnum, tritiumI));
|
||||
return Particle(mT_eV, 1 , loc_m, speed_ms, idnum, parentIdnum, tritiumI);
|
||||
}
|
||||
|
||||
static Particle createTritium2I(vec3 loc_m, vec3 speed_ms, double idnum, double parentIdnum) {
|
||||
return ( Particle(2*mT_eV, 1 , loc_m, speed_ms, idnum, parentIdnum, tritium2I));
|
||||
return Particle(2*mT_eV, 1 , loc_m, speed_ms, idnum, parentIdnum, tritium2I);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ Pop3_Container& Pop3_Container::operator=(const Pop3_Container& other) {
|
||||
swap(r_scale, tmp.r_scale);
|
||||
swap(phi_scale, tmp.phi_scale);
|
||||
swap(data, tmp.data);
|
||||
return (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,6 @@ double Pop3_Container::get_value (vec3 loc_m) {
|
||||
int zbin = z_scale.calc_index(get_z_m(loc_m));
|
||||
int rbin = r_scale.calc_index(get_r_m(loc_m));
|
||||
int phibin = phi_scale.calc_index(get_phi(loc_m));
|
||||
return (data[zbin][rbin][phibin]);
|
||||
return data[zbin][rbin][phibin];
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ public:
|
||||
double get_value (vec3 loc_m);
|
||||
|
||||
void set_value_by_bin(double value, int z_bin, int r_bin, int phi_bin) {data[z_bin][r_bin][phi_bin] = value;}
|
||||
double get_value_by_bin(int z_bin, int r_bin, int phi_bin) {return (data[z_bin][r_bin][phi_bin]);}
|
||||
double get_value_by_bin(int z_bin, int r_bin, int phi_bin) {return data[z_bin][r_bin][phi_bin];}
|
||||
|
||||
Lin_Scale get_z_scale(){return(z_scale);}
|
||||
Lin_Scale get_r_scale(){return(r_scale);}
|
||||
Lin_Scale get_phi_scale(){return(phi_scale);}
|
||||
Lin_Scale get_z_scale(){return z_scale;}
|
||||
Lin_Scale get_r_scale(){return r_scale;}
|
||||
Lin_Scale get_phi_scale(){return phi_scale;}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ Pop4_Container& Pop4_Container::operator=(const Pop4_Container& other) {
|
||||
swap(phi_scale, tmp.phi_scale);
|
||||
swap(E_scale, tmp.E_scale);
|
||||
swap(data, tmp.data);
|
||||
return (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Pop4_Container::increase_value(const double &value, const vec3 &loc_m, const double &E_eV) {
|
||||
@@ -118,7 +118,7 @@ double Pop4_Container::get_value(const vec3 &loc_m, const double &E_eV) {
|
||||
int rbin = r_scale.calc_index(get_r_m(loc_m));
|
||||
int phibin = phi_scale.calc_index(get_phi(loc_m));
|
||||
int E_bin = E_scale.calc_index(E_eV);
|
||||
return (data[zbin][rbin][phibin][E_bin]);
|
||||
return data[zbin][rbin][phibin][E_bin];
|
||||
}
|
||||
|
||||
double *Pop4_Container::get_E_bins (const vec3 &loc_m) {
|
||||
|
||||
@@ -34,17 +34,17 @@ public:
|
||||
double get_value(const vec3 &loc_m, const double &E_eV);
|
||||
|
||||
double *get_E_bins (const vec3 &loc_m);
|
||||
int get_num_E_bins(){return(E_scale.get_number_bins());}
|
||||
int get_num_E_bins(){return E_scale.get_number_bins();}
|
||||
double get_corresponding_E_lower_eV(int E_bin){return E_scale.get_lower_bin_bound(E_bin);}
|
||||
double get_corresponding_E_upper_eV(int E_bin){return E_scale.get_upper_bin_bound(E_bin);}
|
||||
|
||||
void set_value_by_bin(double value, int z_bin, int r_bin, int phi_bin, int E_bin) {data[z_bin][r_bin][phi_bin][E_bin] = value;}
|
||||
double get_value_by_bin(int z_bin, int r_bin, int phi_bin, int E_bin) {return (data[z_bin][r_bin][phi_bin][E_bin]);}
|
||||
double get_value_by_bin(int z_bin, int r_bin, int phi_bin, int E_bin) {return data[z_bin][r_bin][phi_bin][E_bin];}
|
||||
|
||||
Lin_Scale get_z_scale(){return(z_scale);}
|
||||
Lin_Scale get_r_scale(){return(r_scale);}
|
||||
Lin_Scale get_phi_scale(){return(phi_scale);}
|
||||
Log_Scale get_E_scale(){return(E_scale);}
|
||||
Lin_Scale get_z_scale(){return z_scale;}
|
||||
Lin_Scale get_r_scale(){return r_scale;}
|
||||
Lin_Scale get_phi_scale(){return phi_scale;}
|
||||
Log_Scale get_E_scale(){return E_scale;}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -22,10 +22,11 @@ Population_Manager Population_Builder::build(Timer *timer,UniRNG *rngUni, Normal
|
||||
int num_E_bins = 20;
|
||||
|
||||
Populations.add(new Kinetic_Population(electron, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins));
|
||||
Populations.add(new Thermal_Population(tritium, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||
Populations.add(new Thermal_Population(tritiumI, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||
Populations.add(new Thermal_Population(tritium2I, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||
Populations.add(new T2_Population(rngUni, rngNormal));
|
||||
|
||||
return (Populations);
|
||||
return Populations;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ string Population_Load_Saver::get_save_path() {
|
||||
string parameter_name = get_parameter_filename();
|
||||
stringstream save_path;
|
||||
save_path<<parameter_name<<"_save_populations.dat";
|
||||
return(save_path.str());
|
||||
return save_path.str();
|
||||
}
|
||||
|
||||
void Population_Load_Saver::write_overhead(ofstream *save_stream) {
|
||||
@@ -120,14 +120,14 @@ int Population_Load_Saver::get_num_populations_line(ifstream *load_stream) {
|
||||
ss<<"Population_Load_Saver::get_num_populations_line: num_populations < 1.\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
return (num_populations);
|
||||
return num_populations;
|
||||
}
|
||||
|
||||
double Population_Load_Saver::get_offset_time_line(std::ifstream *load_stream) {
|
||||
double offset_time_s;
|
||||
*load_stream>>offset_time_s;
|
||||
goto_nextline(load_stream);
|
||||
return (offset_time_s);
|
||||
return offset_time_s;
|
||||
}
|
||||
|
||||
void Population_Load_Saver::check_katrin_geo_line(std::ifstream *load_stream) {
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
this->this_species = this_species;
|
||||
}
|
||||
|
||||
species get_species() {return(this_species); }
|
||||
species get_species() {return this_species; }
|
||||
|
||||
void check(const species &check_species) {
|
||||
if (check_species != this_species) {
|
||||
|
||||
@@ -35,7 +35,7 @@ inline vec3 roll_uniform_direction(ranlib::Uniform<double> *rngUni) {
|
||||
double phi = 2*pi*rngUni->random();
|
||||
double theta = pi*rngUni->random();
|
||||
dir = sin(theta)*cos(phi) , sin(theta)*sin(phi) , cos(theta);
|
||||
return(dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
inline double roll_MBEnergy(const double &Temp_K, const double &mass_eV,ranlib::NormalUnit<double> *rngNormal) {
|
||||
@@ -48,7 +48,7 @@ inline double roll_MBEnergy(const double &Temp_K, const double &mass_eV,ranlib::
|
||||
}
|
||||
beta = sqrt(C*(sum));
|
||||
|
||||
return((calc_gamma_from_beta(beta)-1)*mass_eV);
|
||||
return (calc_gamma_from_beta(beta)-1)*mass_eV;
|
||||
}
|
||||
|
||||
inline double roll_Rejectionmethod(double (*pdf)(double), double xmin, double xmax, double pmax, ranlib::Uniform<double> *rngUni) {
|
||||
@@ -59,7 +59,7 @@ inline double roll_Rejectionmethod(double (*pdf)(double), double xmin, double xm
|
||||
eta2 = rngUni->random();
|
||||
xcan = xmin + eta1*(xmax - xmin);
|
||||
} while( eta2*pmax > pdf(xcan) );
|
||||
return(xcan);
|
||||
return xcan;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ inline double get_parameter_value(std::string csv_line) {
|
||||
ss_err<<"get_parameter_value: Could not read line.\n";
|
||||
throw MyException(ss_err.str());
|
||||
}
|
||||
return (parameter_value);
|
||||
return parameter_value;
|
||||
}
|
||||
|
||||
inline bool is_parameter_line(std::string csv_line, const std::string ¶meter_name) {
|
||||
@@ -42,9 +42,9 @@ inline bool is_parameter_line(std::string csv_line, const std::string ¶meter
|
||||
throw MyException(ss_err.str());
|
||||
}
|
||||
if (temp == parameter_name) {
|
||||
return (true);
|
||||
return true;
|
||||
} else {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ inline bool is_faulty(std::string csv_line) {
|
||||
std::string name_dummy;
|
||||
double value_dummy;
|
||||
if (ss>>name_dummy && ss>>value_dummy) {
|
||||
return (false);
|
||||
return false;
|
||||
} else {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,14 +99,14 @@ inline double find_parameter(std::ifstream *parameter_file_stream, const std::st
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (parameter_value);
|
||||
return parameter_value;
|
||||
}
|
||||
|
||||
inline std::string make_path (const std::string &path) { // append '/' if necessary to path.
|
||||
if (path.back() != '/') {
|
||||
return (path + '/');
|
||||
return path + '/';
|
||||
} else {
|
||||
return (path);
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ inline std::string get_parameter_file_path() {
|
||||
}
|
||||
|
||||
parameter_file_path = make_path(parameter_file_path);
|
||||
return (parameter_file_path + parameter_file_name);
|
||||
return parameter_file_path + parameter_file_name;
|
||||
}
|
||||
|
||||
inline double load_parameter(const std::string ¶meter_name) {
|
||||
@@ -144,7 +144,7 @@ inline double load_parameter(const std::string ¶meter_name) {
|
||||
ss<<"Parameter::getParameter: Parameter not found in file.\n parameter_name:\t"<<parameter_name<<"\n loadFilePath: \t"<<parameter_file_path;
|
||||
throw MyException(ss.str());
|
||||
} else {
|
||||
return (parameter_value);
|
||||
return parameter_value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,46 +156,46 @@ inline std::string get_time_string() {
|
||||
timeinfo = localtime(&rawtime);
|
||||
strftime(buffer,sizeof(buffer),"%Y%m%d",timeinfo);
|
||||
std::string str(buffer);
|
||||
return(str);
|
||||
return str;
|
||||
}
|
||||
|
||||
inline std::string get_homebase() {
|
||||
std::string Homebase = get_enviroment_variable("HOMEBASE");
|
||||
Homebase = make_path(Homebase);
|
||||
return (Homebase);
|
||||
std::string homebase = get_enviroment_variable("HOMEBASE");
|
||||
homebase = make_path(homebase);
|
||||
return homebase;
|
||||
}
|
||||
|
||||
inline std::string get_data_path() {
|
||||
return (get_homebase() + "src/mc_electron/data/");
|
||||
return get_homebase() + "src/mc_electron/data/";
|
||||
}
|
||||
|
||||
inline std::string remove_cat (std::string cat_string) {
|
||||
if ( cat_string.substr(cat_string.size()-4, 4) == ".cat" ){
|
||||
return (cat_string.substr(0, cat_string.size()-4) );
|
||||
return cat_string.substr(0, cat_string.size()-4);
|
||||
} else {
|
||||
return (cat_string);
|
||||
return cat_string;
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string get_parameter_filename() {
|
||||
std::string parameter_file_path = getenv("parpath");
|
||||
std::string parameter_file_name = remove_cat(getenv("parfile"));
|
||||
return (parameter_file_path + "/" + parameter_file_name);
|
||||
return parameter_file_path + "/" + parameter_file_name;
|
||||
}
|
||||
|
||||
inline bool is_file(std::string file_path) {
|
||||
struct stat buffer;
|
||||
return (stat (file_path.c_str(), &buffer) == 0);
|
||||
return stat (file_path.c_str(), &buffer) == 0;
|
||||
}
|
||||
|
||||
inline bool is_dir(std::string dir_path) {
|
||||
struct stat info;
|
||||
if( stat( dir_path.c_str(), &info ) != 0 )
|
||||
return (false);
|
||||
return false;
|
||||
else if( info.st_mode & S_IFDIR ) // S_ISDIR() doesn't exist on my windows
|
||||
return (true);
|
||||
return true;
|
||||
else
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -93,10 +93,7 @@ void Simulation::doit() {
|
||||
|
||||
void Simulation::do_statusUpdate() {
|
||||
if (numberDecays%updater_fraction == 0){
|
||||
if (updater_numberOfPrevious!=numberDecays) {
|
||||
cout<<numberDecays<<"/"<<numberTotalDecays<<endl;
|
||||
}
|
||||
updater_numberOfPrevious = numberDecays;
|
||||
cout<<numberDecays<<"/"<<numberTotalDecays<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ class Simulation {
|
||||
int numberTotalParticles = 0;
|
||||
int numberDecays = 0;
|
||||
|
||||
int updater_numberOfPrevious = 0;
|
||||
int updater_fraction;
|
||||
|
||||
public:
|
||||
|
||||
@@ -42,7 +42,7 @@ Size_Container& Size_Container::operator=(const Size_Container& other) {
|
||||
swap(r_scale, tmp.r_scale);
|
||||
swap(cell_length_m, tmp.cell_length_m);
|
||||
swap(data, tmp.data);
|
||||
return (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,20 +50,20 @@ double Size_Container::calc_disc_surface_m2 (const int &r_bin) {
|
||||
double previous_r_m = r_scale.get_lower_bin_bound(r_bin);
|
||||
double this_r_m = r_scale.get_upper_bin_bound(r_bin);
|
||||
double A_m2 = pi * (this_r_m * this_r_m - previous_r_m * previous_r_m);
|
||||
return(A_m2);
|
||||
return A_m2;
|
||||
}
|
||||
|
||||
double Size_Container::get_cell_volume_m3(const double &r_m) {
|
||||
int r_bin = r_scale.calc_index(r_m);
|
||||
return (data[r_bin]);
|
||||
return data[r_bin];
|
||||
}
|
||||
|
||||
double Size_Container::get_cell_volume_m3(const vec3 &loc_m) {
|
||||
double r_m = get_r_m(loc_m);
|
||||
return (get_cell_volume_m3(r_m));
|
||||
return get_cell_volume_m3(r_m);
|
||||
}
|
||||
|
||||
double Size_Container::get_cell_length_m() {
|
||||
return (cell_length_m);
|
||||
return cell_length_m;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ double Stacked_Container<T_Map>::calc_tot(const dim1Map &subMap) {
|
||||
heigth = curItr->second;
|
||||
tot += width*heigth;
|
||||
}
|
||||
return (tot);
|
||||
return tot;
|
||||
}
|
||||
|
||||
template <class T_Map>
|
||||
@@ -124,7 +124,7 @@ double Stacked_Container<T_Map>::sample(const std::deque<double> &Points, UniRNG
|
||||
}
|
||||
dim1Map *endMap = Base_Container<T_Map>::template getSubMap<dim1Map>(Points, Lower_bound_Over);
|
||||
|
||||
return (endMap->lower_bound(rngUni->random())->second);
|
||||
return endMap->lower_bound(rngUni->random())->second;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,14 +39,14 @@ public:
|
||||
}
|
||||
|
||||
void set_delete_current(const bool &delete_current) {this->delete_current = delete_current;}
|
||||
bool get_delete_current() {return (delete_current);}
|
||||
bool get_delete_current() {return delete_current;}
|
||||
|
||||
void add_new_particle(const Particle &newParticle) {
|
||||
new_particles[number_new_particles] = newParticle;
|
||||
number_new_particles++;
|
||||
}
|
||||
int get_number_new_particles() {return(number_new_particles);}
|
||||
Particle *get_new_particles() {return(new_particles);}
|
||||
int get_number_new_particles() {return number_new_particles;}
|
||||
Particle *get_new_particles() {return new_particles;}
|
||||
|
||||
void set_decrease (const species &decrease_species, const vec3 &decrease_location, const double &decrease_energy_eV) {
|
||||
this->decrease_population = true;
|
||||
@@ -54,13 +54,10 @@ public:
|
||||
this->decrease_location = decrease_location;
|
||||
this->decrease_energy_eV = decrease_energy_eV;
|
||||
}
|
||||
|
||||
|
||||
bool get_decrease_population() {return decrease_population;}
|
||||
species get_decrease_species() {return decrease_species;}
|
||||
vec3 get_decrease_location() {return decrease_location;}
|
||||
double get_decrease_energy_eV() {return decrease_energy_eV;}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -77,6 +74,25 @@ public:
|
||||
|
||||
virtual double get_macroSigma_m2(const Particle &interPart) = 0;
|
||||
virtual InteractionOut do_Interaction (Particle *interPart) = 0;
|
||||
|
||||
protected:
|
||||
vec3 get_vOff_ms(const Particle &interPart, const double &minE_eV) {
|
||||
double m_eV = interPart.get_Mass_eV();
|
||||
vec3 v1_ms = interPart.get_Speed_ms();
|
||||
vec3 v2_ms = Population->roll_speed_ms(interPart.get_Location_m());
|
||||
vec3 v1Lab_ms = v1_ms - v2_ms;
|
||||
double T_eV = calc_Ekin_eV_from_speed(v1Lab_ms, m_eV);
|
||||
if (T_eV < minE_eV) {
|
||||
T_eV = calc_Ekin_eV_from_speed(v1_ms, m_eV);
|
||||
if (T_eV < minE_eV) {
|
||||
std::stringstream ss;
|
||||
ss<<"Sub_Interaction_Base::get_vOff_ms: T_eV < minE_eV.\n";
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
return v2_ms;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@ TCS_Container& TCS_Container::operator=(const TCS_Container& other) {
|
||||
TCS_Container tmp(other);
|
||||
swap(E_scale, tmp.E_scale);
|
||||
swap(data, tmp.data);
|
||||
return (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
double TCS_Container::get_value(double E_eV) {
|
||||
int index = E_scale.calc_index(E_eV);
|
||||
return (data[index]);
|
||||
return data[index];
|
||||
}
|
||||
|
||||
void TCS_Container::calc_data(const std::string &load_path) {
|
||||
|
||||
@@ -39,9 +39,9 @@ protected:
|
||||
}
|
||||
interactionsCount +=1;
|
||||
if (interactionsCount >= maxInteractions) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -57,9 +57,9 @@ protected:
|
||||
bool check_Energy(const Particle &movePart) {
|
||||
double Ekin_eV = movePart.get_EKin_eV();
|
||||
if (Ekin_eV<=cutoffEnergy_eV) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@ Terminator_Manager Terminator_Builder::build() {
|
||||
Terminator.add(new E_Terminator(maxInteractions, cutoffEnergy_eV));
|
||||
Terminator.add(new TI_Terminator(maxInteractions, cutoffEnergy_eV));
|
||||
Terminator.add(new T2I_Terminator(maxInteractions, cutoffEnergy_eV));
|
||||
return (Terminator);
|
||||
return Terminator;
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ double ThermalPop_Container::getDensity_m3(const vec3 &locXYZ_m, double physTime
|
||||
vec3 zrphiCords = transformTo_zrphiCords(locXYZ_m, xyz);
|
||||
double V_m3 = get_V_m3(zrphiCords[1]);
|
||||
double cumTime_s = get_value(ddeque{zrphiCords[0], zrphiCords[1], zrphiCords[2]}, Lower_bound) ;
|
||||
return (cumTime_s/physTime_s/V_m3);
|
||||
return cumTime_s/physTime_s/V_m3;
|
||||
}
|
||||
|
||||
void ThermalPop_Container::upDensity (const Particle &upParticle, const vec3 &oldLocXYZ_m) {
|
||||
|
||||
@@ -88,7 +88,7 @@ inline double Thermal_Population::get_density_m3(const vec3 &loc_m) {
|
||||
double bin_size_m3 = bin_sizes.get_cell_volume_m3(loc_m);
|
||||
double dens_m3 = cumulated_time_s_s/physical_time_s/bin_size_m3 - offset;
|
||||
dens_m3 = (dens_m3 < 0) ? 0 : dens_m3;
|
||||
return(dens_m3);
|
||||
return dens_m3;
|
||||
}
|
||||
|
||||
inline void Thermal_Population::increase_density(const Particle &upPart, const vec3 &oldLoc_m) {
|
||||
@@ -106,22 +106,22 @@ inline vec3 Thermal_Population::get_average_speed_ms(const vec3 &loc_m) {
|
||||
double z_wgtsHalf_m = Katrin_Geo::get_z_WGTSstart_m() + (Katrin_Geo::get_z_WGTSend_m() - Katrin_Geo::get_z_WGTSstart_m())/2;
|
||||
double sign = (loc_m[2] < z_wgtsHalf_m) ? -1 : 1;
|
||||
double zSpeed_ms = sign*wgtsT2FlowSpeed_ms;
|
||||
return ( vec3(0,0,zSpeed_ms) );
|
||||
return vec3(0,0,zSpeed_ms);
|
||||
} else {
|
||||
return (vec3(0,0,0));
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
inline vec3 Thermal_Population::roll_speed_ms(const vec3 &loc_m) {
|
||||
Katrin_Geo::check_inKatrin(loc_m);
|
||||
return (get_average_speed_ms(loc_m) + roll_thermSpeed_ms(loc_m));
|
||||
return get_average_speed_ms(loc_m) + roll_thermSpeed_ms(loc_m);
|
||||
}
|
||||
|
||||
inline vec3 Thermal_Population::roll_thermSpeed_ms(const vec3 &loc_m) {
|
||||
double E_eV = roll_MBEnergy(wgtsTemp_K, m_eV, rngNormal);
|
||||
double abs_speed_ms = calc_Speed_from_Ekin_eV(E_eV, m_eV);
|
||||
vec3 speed_ms = roll_uniform_direction(rngUni)*abs_speed_ms;
|
||||
return(speed_ms);
|
||||
return speed_ms;
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ inline meta_vec Thermal_Population::get_bins_meta_info() {
|
||||
}
|
||||
temp_bin.z_min_m = temp_bin.z_max_m;
|
||||
}
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
inline bin_content_vec Thermal_Population::get_bins_content() {
|
||||
@@ -177,7 +177,7 @@ inline bin_content_vec Thermal_Population::get_bins_content() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
inline bin_count4 Thermal_Population::get_bin_count4() {
|
||||
@@ -186,7 +186,7 @@ inline bin_count4 Thermal_Population::get_bin_count4() {
|
||||
res[1] = get_r_scale().get_number_bins();
|
||||
res[2] = get_phi_scale().get_number_bins();
|
||||
res[3] = 0;
|
||||
return(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
inline void Thermal_Population::set_bins(bin_count4 bin_counts, bin_content_vec bin_contents) {
|
||||
@@ -217,7 +217,7 @@ inline void Thermal_Population::set_bins(bin_count4 bin_counts, bin_content_vec
|
||||
|
||||
inline Lin_Scale Thermal_Population::get_z_scale() {
|
||||
if (cumulated_times_s.get_z_scale() == number_annhilated.get_z_scale()) {
|
||||
return (cumulated_times_s.get_z_scale());
|
||||
return cumulated_times_s.get_z_scale();
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss<<"Thermal_Population::get_z_scale: Missmatch in scales.\n";
|
||||
@@ -227,7 +227,7 @@ inline Lin_Scale Thermal_Population::get_z_scale() {
|
||||
|
||||
inline Lin_Scale Thermal_Population::get_r_scale() {
|
||||
if (cumulated_times_s.get_r_scale() == number_annhilated.get_r_scale()) {
|
||||
return (cumulated_times_s.get_r_scale());
|
||||
return cumulated_times_s.get_r_scale();
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss<<"Thermal_Population::get_r_scale: Missmatch in scales.\n";
|
||||
@@ -237,7 +237,7 @@ inline Lin_Scale Thermal_Population::get_r_scale() {
|
||||
|
||||
inline Lin_Scale Thermal_Population::get_phi_scale() {
|
||||
if (cumulated_times_s.get_phi_scale() == number_annhilated.get_phi_scale()) {
|
||||
return (cumulated_times_s.get_phi_scale());
|
||||
return cumulated_times_s.get_phi_scale();
|
||||
} else {
|
||||
std::stringstream ss;
|
||||
ss<<"Thermal_Population::get_phi_scale: Missmatch in scales.\n";
|
||||
|
||||
@@ -23,15 +23,15 @@ private:
|
||||
|
||||
inline bool T2I_Terminator::checkTermination (const Particle &movePart) {
|
||||
if (check_Wall(movePart)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (check_Energy(movePart)) {
|
||||
//return (true);
|
||||
//return true;
|
||||
}
|
||||
if (check_MaxInteractions(movePart)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,15 +40,15 @@ inline bool T2I_Terminator::check_Wall(const Particle &movePart) {
|
||||
double z_m = loc_m[2];
|
||||
double r_m = sqrt( pow(loc_m[0],2) + pow(loc_m[1],2) );
|
||||
if (z_m <= Katrin_Geo::get_z_RW_m()) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (z_m >= Katrin_Geo::get_z_WGTSend_m()) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (r_m >= Katrin_Geo::get_radius_m()) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ inline double T2_Population::get_density_m3(const vec3 &loc_m) {
|
||||
if (!Katrin_Geo::inWGTS(loc_m)) {
|
||||
return 0; // Prob change to some realisitc value -> search for one
|
||||
} else {
|
||||
return (calc_DensityTriangle(loc_m[2]));
|
||||
return calc_DensityTriangle(loc_m[2]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,12 +59,12 @@ inline double T2_Population::calc_DensityTriangle(const double &z_m) {
|
||||
double wgtsHalfLength_m = wgtsLength_m/2;
|
||||
double zProjection_m = (z_wgts_m < wgtsHalfLength_m) ? z_wgts_m : wgtsLength_m - z_wgts_m;
|
||||
double reduction_Factor = zProjection_m/wgtsHalfLength_m; //Correction since reflection
|
||||
return(reduction_Factor * wgtsT2MaxDensity_m3);
|
||||
return reduction_Factor * wgtsT2MaxDensity_m3;
|
||||
}
|
||||
|
||||
inline vec3 T2_Population::roll_speed_ms(const vec3 &loc_m) {
|
||||
Katrin_Geo::check_inKatrin(loc_m);
|
||||
return (get_average_speed_ms(loc_m) + roll_thermSpeed_ms(loc_m));
|
||||
return get_average_speed_ms(loc_m) + roll_thermSpeed_ms(loc_m);
|
||||
}
|
||||
|
||||
inline meta_vec T2_Population::get_bins_meta_info() {
|
||||
@@ -90,9 +90,9 @@ inline vec3 T2_Population::get_average_speed_ms(const vec3 &loc_m) {
|
||||
double z_wgtsHalf_m = Katrin_Geo::get_z_WGTSstart_m() + (Katrin_Geo::get_z_WGTSend_m() - Katrin_Geo::get_z_WGTSstart_m())/2;
|
||||
double sign = (loc_m[2] < z_wgtsHalf_m) ? -1 : 1;
|
||||
double zSpeed_ms = sign*wgtsT2FlowSpeed_ms;
|
||||
return ( vec3(0,0,zSpeed_ms) );
|
||||
return vec3(0,0,zSpeed_ms);
|
||||
} else {
|
||||
return (vec3(0,0,0));
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ inline vec3 T2_Population::roll_thermSpeed_ms(const vec3 &loc_m) {
|
||||
double Ekin_eV = roll_MBEnergy(wgtsTemp_K,mT2_eV,rngNormal);
|
||||
double Speed_ms = calc_Speed_from_Ekin_eV(Ekin_eV, mT2_eV);
|
||||
vec3 speed_ms = roll_uniform_direction(rngUni)*Speed_ms;
|
||||
return(speed_ms);
|
||||
return speed_ms;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,15 +23,15 @@ private:
|
||||
|
||||
inline bool TI_Terminator::checkTermination (const Particle &movePart) {
|
||||
if (check_Wall(movePart)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (check_Energy(movePart)) {
|
||||
//return (true);
|
||||
//return true;
|
||||
}
|
||||
if (check_MaxInteractions(movePart)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,15 +40,15 @@ inline bool TI_Terminator::check_Wall(const Particle &movePart) {
|
||||
double z_m = loc_m[2];
|
||||
double r_m = sqrt( pow(loc_m[0],2) + pow(loc_m[1],2) );
|
||||
if (z_m <= Katrin_Geo::get_z_RW_m()) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (z_m >= Katrin_Geo::get_z_WGTSend_m()) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
if (r_m >= Katrin_Geo::get_radius_m()) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ double Uehara_eT2_ElasticScattering::calc_TCS(const double &T_eV) {
|
||||
double eta = calc_eta(T_eV);
|
||||
double numerator = pi*ZT2*(ZT2+1)*re_m*re_m * (1-pow(beta,2));
|
||||
double denominator = eta * (eta+1)*pow(beta,4);
|
||||
return (numerator/denominator);
|
||||
return numerator/denominator;
|
||||
}
|
||||
|
||||
double Uehara_eT2_ElasticScattering::calc_SDCS(const double &T_eV, const double &theta) {
|
||||
@@ -29,7 +29,7 @@ double Uehara_eT2_ElasticScattering::calc_SDCS(const double &T_eV, const double
|
||||
double eta = calc_eta(T_eV);
|
||||
double numerator = ZT2*(ZT2+1)*re_m*re_m * (1-pow(beta,2));
|
||||
double denominator = pow(beta,4)*pow(1-cos(theta)+2*eta, 2);
|
||||
return (numerator/denominator);
|
||||
return numerator/denominator;
|
||||
}
|
||||
|
||||
double Uehara_eT2_ElasticScattering::roll_theta(const double &T_eV, UniRNG *rngUni) {
|
||||
@@ -38,12 +38,12 @@ double Uehara_eT2_ElasticScattering::roll_theta(const double &T_eV, UniRNG *rngU
|
||||
double const1 = 2*pi/calc_TCS(T_eV)*ZT2*(ZT2+1)*re_m*re_m*(1- pow(beta,2) )* pow(beta,-4);
|
||||
double fac = pow( rngUni->random()/const1-pow(2*elaEta,-1) , -1 ) +1+2*elaEta;
|
||||
double theta = acos(fac);
|
||||
return(theta);
|
||||
return theta;
|
||||
}
|
||||
|
||||
double Uehara_eT2_ElasticScattering::calc_eta(const double &T_eV) {
|
||||
double beta = calc_beta_from_Ekin_eV(T_eV, me_eV);
|
||||
double etac = (T_eV < 50e3)? 1.198 : 1.13+3.76*pow(ZT2/(137*beta),2);
|
||||
double elaTau = T_eV/me_eV;
|
||||
return (etac * 1.7e-5 * pow(ZT2,2./3.) /(elaTau*(elaTau+2) ));
|
||||
return etac * 1.7e-5 * pow(ZT2,2./3.) / (elaTau*(elaTau+2));
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef zylindric_cords_h
|
||||
#define zylindric_cords_h
|
||||
|
||||
typedef enum cordStyle{xyz, zrphi} cordStyle;
|
||||
enum cordStyle{xyz, zrphi};
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
public:
|
||||
std::vector<vec3> get_bins() ;
|
||||
|
||||
double get_l_m () {return(l_m);}
|
||||
double get_l_m () {return l_m;}
|
||||
double get_V_m3(double r_m) ;
|
||||
|
||||
public:
|
||||
@@ -117,7 +117,7 @@ inline std::vector<vec3> Zylindric_Cords::get_bins() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return (res);
|
||||
return res;
|
||||
}
|
||||
|
||||
inline double Zylindric_Cords::get_V_m3(double r_m) {
|
||||
@@ -126,7 +126,7 @@ inline double Zylindric_Cords::get_V_m3(double r_m) {
|
||||
ss<<"Zylindric_Cords::get_V_m3: r_m not in Container.\n";
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
return(V_m3.lower_bound(r_m))->second;
|
||||
return V_m3.lower_bound(r_m)->second;
|
||||
|
||||
}
|
||||
|
||||
@@ -140,29 +140,29 @@ inline void Zylindric_Cords::check_In_Container(vec3 Cords, cordStyle cordStyleI
|
||||
|
||||
inline bool Zylindric_Cords::in_Container(vec3 Cords, cordStyle cordStyleIn) {
|
||||
Cords = transformTo_zrphiCords(Cords, cordStyleIn);
|
||||
return (in_zDimension(Cords[0]) && in_rDimension(Cords[1]));
|
||||
return in_zDimension(Cords[0]) && in_rDimension(Cords[1]);
|
||||
}
|
||||
|
||||
inline bool Zylindric_Cords::in_zDimension (double z_m) {
|
||||
if (z_m<z_min_m) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
if (z_m>z_max_m) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool Zylindric_Cords::in_rDimension (double r_m) {
|
||||
if (r_m>r_max_m) {
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
|
||||
inline vec3 Zylindric_Cords::transformTo_zrphiCords(vec3 Cords, cordStyle cordStyleIn) {
|
||||
if (cordStyleIn == zrphi) {
|
||||
return (Cords);
|
||||
return Cords;
|
||||
}
|
||||
double z = Cords[2];
|
||||
double r = sqrt(Cords[0]*Cords[0] + Cords[1]*Cords[1]);
|
||||
@@ -172,7 +172,7 @@ inline vec3 Zylindric_Cords::transformTo_zrphiCords(vec3 Cords, cordStyle cordSt
|
||||
} else {
|
||||
phi = 2*pi - acos(Cords[1]/r);
|
||||
}
|
||||
return (vec3(z,r,phi));
|
||||
return vec3(z,r,phi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user