diff --git a/src/generators/interaction_generator.cpp b/src/generators/interaction_generator.cpp index 76f1e71..89aef88 100755 --- a/src/generators/interaction_generator.cpp +++ b/src/generators/interaction_generator.cpp @@ -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 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 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::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( + 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 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 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 buildExcitationCrossSection( } } +//exists why? std::function 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; diff --git a/src/generators/mass_generator.cpp b/src/generators/mass_generator.cpp index 0f17186..2bac8db 100755 --- a/src/generators/mass_generator.cpp +++ b/src/generators/mass_generator.cpp @@ -10,6 +10,7 @@ namespace generator { std::map SpeciesMasses::mass_ = { {species::ImplementedSpecies::electron, SI::me}, + {species::ImplementedSpecies::T, 3 * SI::mp + SI::me}, {species::ImplementedSpecies::T2, 6 * SI::mp + 2 * SI::me}, {species::ImplementedSpecies::Tplus, 3 * SI::mp}, {species::ImplementedSpecies::T2plus, 6 * SI::mp + SI::me}, diff --git a/src/generators/species_generator.cpp b/src/generators/species_generator.cpp index ff4a4e7..f392a8f 100755 --- a/src/generators/species_generator.cpp +++ b/src/generators/species_generator.cpp @@ -22,6 +22,7 @@ std::map {"T2+", species::ImplementedSpecies::T2plus}, {"T3+", species::ImplementedSpecies::T3plus}, {"T+", species::ImplementedSpecies::Tplus}, + {"T", species::ImplementedSpecies::T}, {"T2", species::ImplementedSpecies::T2}}; species::ImplementedSpecies SpeciesAlias::alias(const std::string& name) { @@ -48,6 +49,7 @@ bool SpeciesAlias::isAlias(const std::string& name) { std::map SpeciesCharges::charge_ = { {species::ImplementedSpecies::electron, -SI::e}, + {species::ImplementedSpecies::T, 0.}, {species::ImplementedSpecies::T2, 0.}, {species::ImplementedSpecies::Tplus, SI::e}, {species::ImplementedSpecies::T2plus, SI::e},