Bug fix: Forgot factor c_ms**-2

This commit is contained in:
Christian
2019-11-13 14:07:36 +01:00
parent f772977def
commit 7fca174042
2 changed files with 17 additions and 5 deletions
+4 -4
View File
@@ -87,8 +87,8 @@ inline double Sub_Interaction_Base::get_macroSigma_m_thermal(const Particle &int
double m_eV = interPart.get_m_eV();
double v1_ms = calc_vec3_abs(interPart.get_v_ms() - Population->get_drift_v_ms(loc_m)); // Shift to "Labframe without thermal blur"
double v2_ms = Population->get_thermal_v_ms(loc_m); // Typical Speed of "Thermal Blur"
double E_min_eV = m_eV/2*pow(v1_ms - v2_ms,2);
double E_max_eV = m_eV/2*pow(v1_ms + v2_ms,2);
double E_min_eV = m_eV/2*pow(v1_ms - v2_ms,2)/c_ms/c_ms;
double E_max_eV = m_eV/2*pow(v1_ms + v2_ms,2)/c_ms/c_ms;
return (get_microSigma_m2(E_min_eV, loc_m) + get_microSigma_m2(E_max_eV, loc_m))/2*Population->get_density_m3(loc_m);
}
@@ -113,8 +113,8 @@ inline double Sub_Interaction_Base::get_macroSigma_m_kinetic(const Particle &int
for (int E_bin = 0; E_bin<bounds.num_E_bins; E_bin++) {
cont = Population->get_density_m3(E_bin, bounds.loc_bins);
v2_ms = sqrt(2*cont.E_eV/m_eV);
E_min_eV = m_eV/2*pow(v1_ms - v2_ms,2);
E_max_eV = m_eV/2*pow(v1_ms + v2_ms,2);
E_min_eV = m_eV/2*pow(v1_ms - v2_ms,2)/c_ms/c_ms;
E_max_eV = m_eV/2*pow(v1_ms + v2_ms,2)/c_ms/c_ms;
macro_Sigma_m2 += (get_microSigma_m2(E_min_eV, loc_m)+get_microSigma_m2(E_max_eV, loc_m))/2 * cont.n_m3;
}
return macro_Sigma_m2;
+13 -1
View File
@@ -22,6 +22,16 @@ struct Termination_Stats {
int n_energy = 0;
int n_reaction = 0;
void reset () {
n_total = 0;
n_rw = 0;
n_dipole = 0;
n_radial = 0;
n_max = 0;
n_energy = 0;
n_reaction = 0;
}
void to_array(int *array) { // Ugly workarounds maybe move to casting with reinterpret cast
array [0] = n_total;
array [1] = n_rw;
@@ -65,7 +75,9 @@ public:
Termination_Stats get_stats() {
return stats;
}
void reset_stats() {
stats.reset();
}
void increase_n_reaction() {
stats.n_reaction += 1;
}