Changed Population Container -> more precice calculation of time in cells.

This commit is contained in:
Christian
2019-08-05 17:51:32 +02:00
parent 34a569552a
commit 0d38ed659a
36 changed files with 655 additions and 1204 deletions
+11 -15
View File
@@ -58,7 +58,7 @@ public:
private:
virtual double get_microSigma_m2(const double &E_eV) = 0;
double get_macroSigma_m2_thermal(const Particle &interPart);
double get_macroSigma_m2_kinetic(const Particle &interPart);
double get_macroSigma_m2_kinetic(const Particle &interPart, const Sum_bounds &bounds);
public:
virtual InteractionOut do_Interaction (Particle *interPart) = 0;
@@ -69,11 +69,11 @@ protected:
};
inline double Sub_Interaction_Base::get_macroSigma_m2(const Particle &interPart) {
int number_E_bins = Population->get_number_E_bins();
if (number_E_bins == 0) {
Sum_bounds bounds = Population->get_sumation_bounds(interPart.get_x_m());
if (bounds.num_E_bins <= 1) { //thermal
return get_macroSigma_m2_thermal(interPart);
} else {
return get_macroSigma_m2_kinetic(interPart);
} else { //kinetic
return get_macroSigma_m2_kinetic(interPart, bounds);
}
}
@@ -85,17 +85,13 @@ inline double Sub_Interaction_Base::get_macroSigma_m2_thermal(const Particle &in
return microSigma_m2*nT2_m3;
}
inline double Sub_Interaction_Base::get_macroSigma_m2_kinetic(const Particle &interPart) {
// integrate over all energy bins, consider T3+ fixed and e- energetic.
int num_E_bins = Population->get_number_E_bins();
vec3 loc_m = interPart.get_x_m();
inline double Sub_Interaction_Base::get_macroSigma_m2_kinetic(const Particle &interPart, const Sum_bounds &bounds) {
// integrate over all energy bins, consider interPart.E_eV << E_eV.
Content cont;
double macro_Sigma_m2 = 0;
double E_eV, micro_Sigma_m2, ne_m3;
for (int E_bin = 0; E_bin< num_E_bins; E_bin++) {
E_eV = Population->get_E_eV(E_bin);
micro_Sigma_m2 = get_microSigma_m2(E_eV);
ne_m3 = Population->get_density_m3(loc_m, E_bin);
macro_Sigma_m2 += micro_Sigma_m2*ne_m3;
for (int E_bin = 0; E_bin< bounds.num_E_bins; E_bin++) {
cont = Population->get_density_m3(E_bin, bounds.loc_bins);
macro_Sigma_m2 += get_microSigma_m2(cont.E_eV) * cont.n_m3;
}
return macro_Sigma_m2;
}