Added recombination on T3+ side.
Reworked minor changes in structure and integration over energetic population container.
This commit is contained in:
@@ -54,28 +54,67 @@ public:
|
||||
this->rngUni = rngUni;
|
||||
};
|
||||
|
||||
virtual double get_macroSigma_m2(const Particle &interPart) = 0;
|
||||
double get_macroSigma_m2(const Particle &interPart);
|
||||
private:
|
||||
virtual double get_microSigma_m2(const double &E_eV) = 0;
|
||||
double get_macroSigma_m2_thermal(const Particle &interPart);
|
||||
double get_macroSigma_m2_kinetic(const Particle &interPart);
|
||||
|
||||
public:
|
||||
virtual InteractionOut do_Interaction (Particle *interPart) = 0;
|
||||
|
||||
|
||||
protected:
|
||||
vec3 get_vOff_ms(const Particle &interPart, const double &minE_eV) {
|
||||
double m_eV = interPart.get_m_eV();
|
||||
vec3 v1_ms = interPart.get_v_ms();
|
||||
vec3 v2_ms = Population->roll_v_ms(interPart.get_x_m());
|
||||
vec3 v1Lab_ms = v1_ms - v2_ms;
|
||||
double T_eV = calc_E_eV_from_v_ms(v1Lab_ms, m_eV);
|
||||
if (T_eV < minE_eV) {
|
||||
T_eV = calc_E_eV_from_v_ms(v1_ms, m_eV);
|
||||
if (T_eV < minE_eV) {
|
||||
std::stringstream ss;
|
||||
ss<<"Sub_Interaction_Base::get_vOff_ms: T_eV < minE_eV.\nT_eV= "<< T_eV<<"\t minE_eV= "<<minE_eV<<"\n";
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
return v2_ms;
|
||||
}
|
||||
vec3 get_vOff_ms(const Particle &interPart, const double &minE_eV);
|
||||
};
|
||||
|
||||
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) {
|
||||
return get_macroSigma_m2_thermal(interPart);
|
||||
} else {
|
||||
return get_macroSigma_m2_kinetic(interPart);
|
||||
}
|
||||
}
|
||||
|
||||
inline double Sub_Interaction_Base::get_macroSigma_m2_thermal(const Particle &interPart) {
|
||||
double E_eV = interPart.get_E_eV();
|
||||
double microSigma_m2 = get_microSigma_m2(E_eV);
|
||||
vec3 loc_m = interPart.get_x_m();
|
||||
double nT2_m3 = Population->get_density_m3(loc_m);
|
||||
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();
|
||||
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;
|
||||
}
|
||||
return macro_Sigma_m2;
|
||||
}
|
||||
|
||||
inline vec3 Sub_Interaction_Base::get_vOff_ms(const Particle &interPart, const double &minE_eV) {
|
||||
double m_eV = interPart.get_m_eV();
|
||||
vec3 v1_ms = interPart.get_v_ms();
|
||||
vec3 v2_ms = Population->roll_v_ms(interPart.get_x_m());
|
||||
vec3 v1Lab_ms = v1_ms - v2_ms;
|
||||
double T_eV = calc_E_eV_from_v_ms(v1Lab_ms, m_eV);
|
||||
if (T_eV < minE_eV) {
|
||||
T_eV = calc_E_eV_from_v_ms(v1_ms, m_eV);
|
||||
if (T_eV < minE_eV) {
|
||||
std::stringstream ss;
|
||||
ss<<"Sub_Interaction_Base::get_vOff_ms: T_eV < minE_eV.\nT_eV= "<< T_eV<<"\t minE_eV= "<<minE_eV<<"\n";
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
return v2_ms;
|
||||
}
|
||||
#endif /* sub_interaction_base_h */
|
||||
|
||||
Reference in New Issue
Block a user