included atomic tritium as an implemented species

This commit is contained in:
2024-02-27 17:47:02 +01:00
parent 1bff4270e8
commit c1e7ed9285
3 changed files with 64 additions and 2 deletions
+61 -2
View File
@@ -31,6 +31,7 @@ void addInteractions(
json_t* array = parameter.jsonObjectFromBase(path_to_interactions);
json_object_foreach(array, key, value) {
std::string type = json_string(json_object_by_path(value, {"Type"}));
if (type == "ElasticScattering") {
DEBUG_LEVEL_2("Adding interactions: ElasticScattering");
std::function<double(double)> cross_section =
@@ -154,6 +155,30 @@ void addInteractions(
cross_section, target, electron, ion,
ionization_energy_distribution, scattering_angle_distribution,
ionization_energy_eV));
} else if (ionization_model == "JanevAtomic") {
std::function<double(double)> cross_section =
interaction::totalCrossSection::eT_ionization_from_ground_janev();
const double ionization_energy_eV =
ionization::ionization_energy_janev_atomic;
auto ionization_energy_distribution =
std::make_shared<interaction::IonizationEnergyDistribution>(
interaction::d2CrossSection::eT_ionization_bed(),
ionization_energy_eV);
auto scattering_angle_distribution = std::make_shared<
interaction::IonizationScatteringAngleDistribution>();
if (electron->type() != species::ImplementedSpecies::electron) {
ERROR("The JanevAtomic needs electron species as outgoing electrons.");
}
if (ion->type() != species::ImplementedSpecies::Tplus) {
ERROR("The JanevAtomic nees T+ species as outgoing ions.");
}
specie->addInteraction(
std::make_shared<interaction::ElectronIonization>(
cross_section, target, electron, ion,
ionization_energy_distribution, scattering_angle_distribution,
ionization_energy_eV));
} else {
ERROR("This ionization model is not implemented.");
}
@@ -254,6 +279,17 @@ std::function<double(double)> buildTotalCrossSection(json_t* object) {
return interaction::totalCrossSection::eT2p_recombination_janev();
} else if (function_name == "eT3p_recombination_janev") {
return interaction::totalCrossSection::eT3p_recombination_janev();
} else if (function_name == "eT_elastic_scattering") {
return interaction::totalCrossSection::eT_elastic_scattering();
} else if (function_name == "TpT_elastic_scattering_schultz") {
return interaction::totalCrossSection::TpT_elastic_scattering_schultz();
} else if (function_name == "eT_ionization_from_ground_janev") {
return interaction::totalCrossSection::eT_ionization_from_ground_janev();
} else if (function_name == "TpT_clustering_tertiary_janev") {
// needs to be changed to account for the temperature, probs smth like excitation
return interaction::totalCrossSection::TpT_clustering_tertiary_janev(80.);
} else if (function_name == "eTp_recombination_kotelnikov") {
return interaction::totalCrossSection::eTp_recombination_kotelnikov();
}
else {
@@ -311,10 +347,18 @@ double buildExcitationEnergy(std::string excitation_state) {
return 0.0439;
} else if (excitation_state == "england_rotational_j1_to_j3") {
return 0.0727;
} else if (excitation_state == "janev_atomic_n2") {
return 10.2;
} else if (excitation_state == "janev_atomic_n3") {
return 12.09;
} else if (excitation_state == "janev_atomic_n4") {
return 12.75;
} else if (excitation_state == "janev_atomic_n5") {
return 13.06;
} else {
ERROR(
"This type of cross section ExcitationState is not implemented in "
"buildExcitationEnergy.");
"This type of cross section ExcitationState: " + excitation_state +
" is not implemented in buildExcitationEnergy.");
return 0.;
}
}
@@ -382,6 +426,18 @@ std::function<double(double)> buildExcitationCrossSection(
} else if (excitation_state == "england_rotational_j1_to_j3") {
return interaction::totalCrossSection::
eT2_excitation_rotational_j1_to_j3_england();
} else if (excitation_state == "janev_atomic_n2") {
return interaction::totalCrossSection::
eT_excitation_electric_from_ground_janev("n2");
} else if (excitation_state == "janev_atomic_n3") {
return interaction::totalCrossSection::
eT_excitation_electric_from_ground_janev("n3");
} else if (excitation_state == "janev_atomic_n4") {
return interaction::totalCrossSection::
eT_excitation_electric_from_ground_janev("n4");
} else if (excitation_state == "janev_atomic_n5") {
return interaction::totalCrossSection::
eT_excitation_electric_from_ground_janev("n5");
} else {
ERROR(
"This type of cross section ExcitationState is not implemented in "
@@ -390,12 +446,15 @@ std::function<double(double)> buildExcitationCrossSection(
}
}
//exists why?
std::function<double(double, double)> build2DCrossSection(json_t* object) {
if (json_object_by_path(object, {"PredefinedFunction"})) {
std::string function_name =
json_string(json_object_by_path(object, {"PredefinedFunction"}));
if (function_name == "eT2_ionization_bed") {
return interaction::d2CrossSection::eT2_ionization_bed();
} else if (function_name == "eT_ionization_bed") {
return interaction::d2CrossSection::eT_ionization_bed();
} else {
ERROR("This predefined function does not exist");
return nullptr;