Files
katrin-plasma/src/mc_electron/interaction_builder.cpp
T
Christian 608b870b65 no integration
no integration
2019-12-01 16:21:31 +01:00

227 lines
9.8 KiB
C++

//
// interaction_builder.cpp
// mc_electron
//
// Created by Christian Reiling on 29.04.19.
// Copyright © 2019 Christian Reiling. All rights reserved.
//
#include "interaction_builder.hpp"
#include "exc_base.h"
// e impact
#include "eT2_elastic.h"
#include "eT2_ionization.h"
#include "eT2_vibexc0102.h"
#include "eT2_elexc_analytic.h"
#include "eT2I_recombination.h"
#include "eT2I_disexc.h"
#include "eT3I_recombination.h"
#include "eT3I_disexc.h"
#include "eT5I_recombination.h"
// TI impact
#include "TIT2_elastic.h"
#include "TIT2_radasc.h"
#include "TIT2_terasc.h"
// T2I impact
#include "T2Ie_disexc.h"
#include "T2Ie_recombination.h"
#include "T2IT2_cluster.h"
#include "T2IT2_cx.h"
// T3I impact
#include "T3IT2_elastic.h"
#include "T3IT2_radasc.h"
#include "T3IT2_terasc.h"
#include "T3Ie_recombination.h"
#include "T3Ie_disexc.h"
// T5I impact
#include "T5IT2_elastic.h"
#include "T5Ie_recombination.h"
Interaction_Manager Interaction_Builder::build(Population_Manager *Populations, UniRNG *rngUni) {
Interaction_Manager Interactions;
Interactions.add(build_electron(Populations, rngUni));
//Interactions.add(build_tritium(Populations, rngUni));
Interactions.add(build_tritiumI(Populations, rngUni));
Interactions.add(build_tritium2I(Populations, rngUni));
Interactions.add(build_tritium3I(Populations, rngUni));
Interactions.add(build_tritium5I(Populations, rngUni));
return Interactions;
}
Interaction_Channel_Base* Interaction_Builder::build_electron(Population_Manager *Populations, UniRNG *rngUni) {
Interaction_Channel_Base *eInteraction = new Interaction_Channel_Base(electron, rngUni);
Population_Base *T2Population = Populations->find(tritium2);
Population_Base *T2IPopulation = Populations->find(tritium2I);
Population_Base *T3IPopulation = Populations->find(tritium3I);
Population_Base *T5IPopulation = Populations->find(tritium5I);
DCS_Base *exc_dcs = new ZeroPi_DCS(rngUni);
if (load_parameter("eT2_ELA") == 1) {
DCS_Base *ela_dcs;
if (load_parameter("INT_ELA_DIR") == 0) {
ela_dcs = new Elastic_DCS(rngUni);
} else if (load_parameter("INT_ELA_DIR") == 1) {
ela_dcs = new FourPi_DCS(rngUni);
} else if (load_parameter("INT_ELA_DIR") == 2) {
ela_dcs = new ZeroPi_DCS(rngUni);
} else {
throw MyException ("eT2_ELA_DIR invalid.");
}
eInteraction->add(new eT2_Elastic(T2Population, rngUni, ela_dcs));
} else if (load_parameter("eT2_ELA") != 0) {
throw MyException ("eT2_ELA invalid.");
}
if (load_parameter("eT2_ION") == 1) {
eInteraction->add(new eT2_Ionization_Janev_ndiss(T2Population, rngUni));
eInteraction->add(new eT2_Ionization_Janev_diss_g(T2Population, rngUni));
eInteraction->add(new eT2_Ionization_Janev_diss_u(T2Population, rngUni));
} else if (load_parameter("eT2_ION") == 2){
eInteraction->add(new eT2_Ionization_BED_Analytic(T2Population, rngUni));
} else if(load_parameter("eT2_ION") != 0) {
throw MyException ("eT2_ION invalid.");
}
if (load_parameter("eT2_ROT") == 2) {
eInteraction->add(new Exp_Excitation_Precomputed_Base(T2Population, rngUni, me_eV, 4.41e-2, exc_dcs, "rot_exc_j02.dat"));
} else if (load_parameter("eT2_ROT") != 0) {
throw MyException ("eT2_ROT invalid.");
}
if (load_parameter("eT2_VIB") == 1) {
eInteraction->add(new eT2_VibExc01(T2Population, rngUni, exc_dcs));
eInteraction->add(new eT2_VibExc02(T2Population, rngUni, exc_dcs));
} else if (load_parameter("eT2_VIB") == 2) {
eInteraction->add(new Exp_Excitation_Precomputed_Base(T2Population, rngUni, me_eV, 0.516, exc_dcs, "vib_exc_v01.dat"));
} else if (load_parameter("eT2_VIB") != 0) {
throw MyException ("eT2_VIB invalid.");
}
if (load_parameter("eT2_EL") == 1) {
build_e_el_janev(eInteraction, rngUni, T2Population, exc_dcs);
} else if (load_parameter("eT2_EL") == 2) {
build_e_el_exp(eInteraction, rngUni, T2Population, exc_dcs);
} else if (load_parameter("eT2_EL") != 0) {
throw MyException ("eT2_EL invalid.");
}
if (load_parameter("e_REC") == 1) {
eInteraction->add(new eT2I_Recombination(T2IPopulation, rngUni));
eInteraction->add(new eT3I_Recombination(T3IPopulation, rngUni));
eInteraction->add(new eT5I_Recombination(T5IPopulation, rngUni));
} else if (load_parameter("e_REC") != 0) {
throw MyException ("e_REC invalid.");
}
//eInteraction->add(new eT2I_DissExc(T2IPopulation, rngUni, exc_dcs));
//eInteraction->add(new eT3I_DissExc(T3IPopulation, rngUni, exc_dcs));
return eInteraction;
}
void Interaction_Builder::build_e_el_janev(Interaction_Channel_Base* eInteraction, UniRNG *rngUni, Population_Base *T2Population, DCS_Base *exc_dcs) {
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(B1Sigmau), exc_dcs));
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Bp1Sigu), exc_dcs));
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Bpp1Sigu), exc_dcs));
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(C1Piu), exc_dcs));
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(D1Piu), exc_dcs));
eInteraction->add(new eT2_ElExc_Nu_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Nu(Dp1Piu), exc_dcs));
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(EF1Sigpg), exc_dcs));
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(HHb1Sigpg), exc_dcs));
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(GK1Sigpg), exc_dcs));
eInteraction->add(new eT2_ElExc_Ng_Analytic(T2Population, rngUni, Janev_eT2_ElExc_Ng(I1Pig), exc_dcs));
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(a3Sigpg), exc_dcs));
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(b3Sigpu), exc_dcs));
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(c3Piu), exc_dcs));
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(e3Sigpu), exc_dcs));
eInteraction->add(new eT2_ElExc_n_Analytic(T2Population, rngUni, Janev_eT2_ElExc_n(d3Piu), exc_dcs));
}
void Interaction_Builder::build_e_el_exp(Interaction_Channel_Base* eInteraction, UniRNG *rngUni, Population_Base *T2Population, DCS_Base *exc_dcs) {
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, me_eV, 8.48, exc_dcs, "el_exc_b3sigpu.dat"));
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, me_eV, 11.18, exc_dcs, "el_exc_B1sigpu.dat"));
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, me_eV, 11.76, exc_dcs, "el_exc_c3piu.dat"));
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, me_eV, 11.79, exc_dcs, "el_exc_a3sigpg.dat"));
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, me_eV, 12.29, exc_dcs, "el_exc_C1piu.dat"));
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, me_eV, 12.3, exc_dcs, "el_exc_EF1sigpg.dat"));
eInteraction->add(new Exp_Excitation_Base(T2Population, rngUni, me_eV, 13.23, exc_dcs, "el_exc_e3sigpu.dat"));
}
Interaction_Channel_Base* Interaction_Builder::build_tritium(Population_Manager *Populations, UniRNG *rngUni) {
Interaction_Channel_Base *T_Interaction = new Interaction_Channel_Base(tritium, rngUni);
return T_Interaction;
}
Interaction_Channel_Base* Interaction_Builder::build_tritiumI(Population_Manager *Populations, UniRNG *rngUni) {
Interaction_Channel_Base *TI_Interaction = new Interaction_Channel_Base(tritiumI, rngUni);
Population_Base *T2Population = Populations->find(tritium2);
TI_Interaction->add(new TIT2_Elastic(T2Population, rngUni));
TI_Interaction->add (new TIT2_RadAsc(T2Population, rngUni));
TI_Interaction->add (new TIT2_TerAsc(T2Population, rngUni));
return TI_Interaction;
}
Interaction_Channel_Base* Interaction_Builder::build_tritium2I(Population_Manager *Populations, UniRNG *rngUni) {
Interaction_Channel_Base *T2I_Interaction = new Interaction_Channel_Base(tritium2I, rngUni);
Population_Base *T2Population = Populations->find(tritium2);
Population_Base *ePopulation = Populations->find(electron);
if (load_parameter("e_REC") == 1) {
T2I_Interaction->add(new T2Ie_Recombination(ePopulation, rngUni));
} else if (load_parameter("e_REC") != 0) {
throw MyException ("e_REC invalid.");
}
//T2I_Interaction->add(new T2Ie_DissExc(ePopulation, rngUni));
T2I_Interaction->add(new T2IT2_Cluster(T2Population, rngUni));
T2I_Interaction->add(new T2IT2_CX(T2Population, rngUni));
return T2I_Interaction ;
}
Interaction_Channel_Base* Interaction_Builder::build_tritium3I(Population_Manager *Populations, UniRNG *rngUni) {
Interaction_Channel_Base *T3I_Interaction = new Interaction_Channel_Base(tritium3I, rngUni);
Population_Base *T2Population = Populations->find(tritium2);
Population_Base *ePopulation = Populations->find(electron);
T3I_Interaction->add(new T3IT2_Elastic(T2Population, rngUni));
T3I_Interaction->add(new T3IT2_RadAsc(T2Population, rngUni));
T3I_Interaction->add(new T3IT2_TerAsc(T2Population, rngUni));
if (load_parameter("e_REC") == 1) {
T3I_Interaction->add(new T3Ie_Recombination(ePopulation, rngUni));
} else if (load_parameter("e_REC") != 0) {
throw MyException ("e_REC invalid.");
}
//T3I_Interaction->add(new T3Ie_DissExc(ePopulation, rngUni));
return T3I_Interaction ;
}
Interaction_Channel_Base* Interaction_Builder::build_tritium5I(Population_Manager *Populations, UniRNG *rngUni) {
Interaction_Channel_Base *T5I_Interaction = new Interaction_Channel_Base(tritium5I, rngUni);
Population_Base *T2Population = Populations->find(tritium2);
Population_Base *ePopulation = Populations->find(electron);
T5I_Interaction->add(new T5IT2_Elastic(T2Population, rngUni));
if (load_parameter("e_REC") == 1) {
T5I_Interaction->add(new T5Ie_Recombination(ePopulation, rngUni));
} else if (load_parameter("e_REC") != 0) {
throw MyException ("e_REC invalid.");
}
return T5I_Interaction;
}