Files
katrin-plasma/src/mc_electron/exc_base.h
T
Christian 6f288bb0c1 Reworked Katrin Geometrics.
Added creation of T3+ clusters.
Added diss. recombination fo T3+ + e-
2019-07-12 15:15:23 +02:00

72 lines
2.0 KiB
C++

//
// exc_base.h
// mc_electron
//
// Created by Christian Reiling on 18.06.19.
// Copyright © 2019 Christian Reiling. All rights reserved.
//
#ifndef exc_base_h
#define exc_base_h
class Excitation_Base : public Sub_Interaction_Base {
DCS_Base *dcs_gen;
protected:
double deltaE_eV;
public:
Excitation_Base(Population_Base *Population, UniRNG *rngUni, double deltaE_eV, DCS_Base *dcs_gen) : Sub_Interaction_Base(Population, rngUni) {
this->deltaE_eV = deltaE_eV;
this->dcs_gen = dcs_gen;
}
double get_macroSigma_m2(const Particle &interPart);
InteractionOut do_Interaction (Particle *interPart);
private:
virtual double get_microSigma_m2(const double &Ekin_EV) = 0;
};
inline double Excitation_Base::get_macroSigma_m2(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 n_m3 = Population->get_density_m3(loc_m);
return microSigma_m2*n_m3;
}
inline InteractionOut Excitation_Base::do_Interaction (Particle *interPart) {
vec3 vOff_ms = get_vOff_ms(*interPart, deltaE_eV);
vec3 vLab_ms = interPart->get_v_ms() - vOff_ms;
double EkinLab_eV = calc_E_eV_from_v_ms(vLab_ms, me_eV);
double EkinLabNew_eV = EkinLab_eV - deltaE_eV;
double theta_lab = dcs_gen->get_theta(EkinLab_eV);
double phi_lab = rngUni->random() * 2 * pi;
vec3 n0 = calc_n_new(vLab_ms, theta_lab, phi_lab);
vec3 vnew_ms = n0 * calc_v_ms_from_E_eV(EkinLabNew_eV, me_eV) + vOff_ms;
interPart->set_v_ms(vnew_ms);
return InteractionOut();
}
class Exp_Excitation_Base : public Excitation_Base {
TCS_Container tcs_data;
public:
Exp_Excitation_Base(Population_Base *T2Population, UniRNG *rngUni, double deltaE_eV, DCS_Base *dcs_gen, std::string load_file_name) : Excitation_Base(T2Population, rngUni, deltaE_eV, dcs_gen),
tcs_data(scale_start, scale_end, 1e3, get_data_path() + load_file_name) {};
private:
double get_microSigma_m2(const double &E_eV) {
if (E_eV < deltaE_eV) {
return 0;
} else {
return tcs_data.get_value(E_eV);
}
}
};
#endif /* exc_base_h */