From 9c999dabbb2e486023b8103f6cc21a3e9fea4e3b Mon Sep 17 00:00:00 2001 From: csendlinger Date: Wed, 18 Dec 2024 15:18:18 +0100 Subject: [PATCH] Added class for tertiary association process, (i.e. class for density dependent cross section), corrected some comments --- include/generators/interaction_generator.h | 3 +++ include/interactions/cluster_formation.h | 20 ++++++++++++++++++-- include/interactions/cross_sections.h | 5 ++++- include/interactions/free_movement.h | 2 +- include/simulation/interaction.h | 4 +++- simulation_config/interactions_examples.json | 11 +++++++---- src/generators/interaction_generator.cpp | 19 +++++++++++++++++-- src/interactions/cluster_formation.cpp | 14 ++++++++++++++ src/interactions/free_movement.cpp | 3 ++- src/interactions/recombination.cpp | 8 ++++---- src/simulation/interaction.cpp | 7 +++++-- 11 files changed, 78 insertions(+), 18 deletions(-) diff --git a/include/generators/interaction_generator.h b/include/generators/interaction_generator.h index 49ce7e9..b9db588 100755 --- a/include/generators/interaction_generator.h +++ b/include/generators/interaction_generator.h @@ -55,6 +55,9 @@ namespace generator { // of either a TrackedSpecie or a BackgroundSpecie) // - a json-string "Product" (being a name of a tracked specie as defined in the json parameter file) // - a json-object "CrossSection" (as described in the "buildTotalCrossSection" function) +// - a json-string "ClusteringType" specifying if the clustering is either a tertiary or radiative process +// (if tertiary is chosen the specifed cross section function is only the rate coefficient diveded by the velocity (units: m^6/s / (m/s))) +// otherwise it is handled as a "normal" cross section (m^2) // // if the Type is "ChargeExchange" (right now only if the species for which it's defined is the target with a charge of +1): // - a json-string "Target", containing the interaction partner (has to be the name given in the json file diff --git a/include/interactions/cluster_formation.h b/include/interactions/cluster_formation.h index cc90da5..7b63b44 100755 --- a/include/interactions/cluster_formation.h +++ b/include/interactions/cluster_formation.h @@ -11,7 +11,7 @@ class Specie; namespace interaction { -// class for cluster formation interactions (A + B --> AB) +// class for cluster formation interactions (A + B --> AB) or (A + BC --> AB + C) class ClusterFormation : public Interaction { public: // Constructor: takes the function describing the cross section (dependent on the energy of the incident particle) @@ -24,10 +24,26 @@ class ClusterFormation : public Interaction { InteractionOutput performInteraction(particle::Particle& particle, RandomNumbers* generator); - private: + protected: std::shared_ptr product_; }; +// class for tertiary association (A + B + B --> AB + B) +class ClusterFormationTertiary : public ClusterFormation { + public: +// Constructor: takes the function describing the cross section (dependent on the energy of the incident particle) +// and a shared_ptr to the Species that is the target in the interaction +// and a shared_ptr to the TrackedSpecie that is the product of the interaction + ClusterFormationTertiary(std::function cross_section, + std::shared_ptr target, + std::shared_ptr product); + +// due to only the rate coefficients being available the cross section is +// approximated as sigma = rate_coefficient * density / velocity +// (units of the tertiary rate coefficient m^6/s) + double microscopicCrossSection(double energy_eV, const Coordinate& position); +}; + }; // namespace interaction #endif /* CLUSTER_FORMATION_H */ diff --git a/include/interactions/cross_sections.h b/include/interactions/cross_sections.h index 7f7007d..083a055 100755 --- a/include/interactions/cross_sections.h +++ b/include/interactions/cross_sections.h @@ -52,8 +52,11 @@ std::function eT2_ionization_janev_diss_first(); // return a function describing the cross section for radiative clustering of T⁺ and T₂: // T⁺ + T₂ --> T₃⁺ + h\nu std::function TpT2_clustering_radiative_ascendion_pasil(); -// return a function describing the cross section for tertiary clustering of T⁺ and T₂: +// return a function describing the cross section up to the density of the T₂ at +// the position of the interaction for tertiary clustering of T⁺ and T₂: // T⁺ + 2T₂ --> T₃⁺ + T₂ +// cross section = k_tertiary / velocity * density_target +// return only a function calculating k_tertiary / velocity (k_tertiary: tertiary rate coefficient) std::function TpT2_clustering_tertiary_ascendion_pasil(); // return a function describing the cross section for clustering of T₂⁺ and T₂: // T₂⁺ + T₂ --> T₃⁺ + T diff --git a/include/interactions/free_movement.h b/include/interactions/free_movement.h index 83261b8..acc499e 100755 --- a/include/interactions/free_movement.h +++ b/include/interactions/free_movement.h @@ -17,7 +17,7 @@ class FreeMovement : public Interaction { RandomNumbers* generator); // return the value of the cross section at the given energy (eV) (units: m^2) - double microscopicCrossSection(double energy_eV); + double microscopicCrossSection(double energy_eV, const Coordinate& position); // return the density scaled cross section value for the energy of the // Particle (units m^{-1}) double macroscopicCrossSection(particle::Particle& particle); diff --git a/include/simulation/interaction.h b/include/simulation/interaction.h index 006e8d3..0852e29 100755 --- a/include/simulation/interaction.h +++ b/include/simulation/interaction.h @@ -44,7 +44,9 @@ class Interaction { std::shared_ptr target); // return the value of the cross section at the energy (in eV) energy_eV in m^2 - virtual double microscopicCrossSection(double energy_eV); +// Coordinate position necessary for three body processes in which the +// cross section depends on the density at the position (see "interactions/cluster_formation.h") + virtual double microscopicCrossSection(double energy_eV, const Coordinate& position); // calculate the density scaled cross section for the Particle particle // interacting with the defined target Specie (returns cross section * target density) (units: m^-1) // assumes that v_particle >> v_target diff --git a/simulation_config/interactions_examples.json b/simulation_config/interactions_examples.json index dac7fb4..a3a9e25 100755 --- a/simulation_config/interactions_examples.json +++ b/simulation_config/interactions_examples.json @@ -1,5 +1,5 @@ { - "e- standart interactions": + "e- standard interactions": { "elastic_example1": { "Type": "ElasticScattering", @@ -145,7 +145,7 @@ "Type": "FreeMovement" } }, - "T+ standart interactions": { + "T+ standard interactions": { "elastic scattering": { "Type": "ElasticScattering", "Target": "T2", @@ -160,6 +160,7 @@ "Type": "Clustering", "Target": "T2", "Product": "T3+", + "ClusteringType": "radiative", "CrossSection": { "PredefinedFunction": "TpT2_clustering_radiative_ascendion_pasil" } @@ -168,6 +169,7 @@ "Type": "Clustering", "Target": "T2", "Product": "T3+", + "ClusteringType": "tertiary", "CrossSection": { "PredefinedFunction": "TpT2_clustering_tertiary_ascendion_pasil" } @@ -176,7 +178,7 @@ "Type": "FreeMovement" } }, - "T2+ standart interactions": { + "T2+ standard interactions": { "charge exchange": { "Type": "ChargeExchange", "Target": "T2", @@ -188,6 +190,7 @@ "Type": "Clustering", "Target": "T2", "Product": "T3+", + "ClusteringType": "radiative", "CrossSection": { "PredefinedFunction": "T2pT2_clustering_janev" } @@ -196,7 +199,7 @@ "Type": "FreeMovement" } }, - "T3+ standart interactions":{ + "T3+ standard interactions":{ "elastic scattering": { "Type": "ElasticScattering", "Target": "T2", diff --git a/src/generators/interaction_generator.cpp b/src/generators/interaction_generator.cpp index f4d68be..6b4335a 100755 --- a/src/generators/interaction_generator.cpp +++ b/src/generators/interaction_generator.cpp @@ -187,10 +187,25 @@ void addInteractions( std::shared_ptr product = findTracked(product_name, tracked_species); + std::string clustering_type = + json_string(json_object_by_path(value, {"ClusteringType"})); + std::function cross_section = buildTotalCrossSection(json_object_by_path(value, {"CrossSection"})); - specie->addInteraction(std::shared_ptr( - new interaction::ClusterFormation(cross_section, target, product))); + + if(clustering_type == "radiative") { + specie->addInteraction(std::shared_ptr( + new interaction::ClusterFormation(cross_section, target, product))); + } else if (clustering_type == "tertiary") { + SIM_INFO("Warning: tertiary clustering has been chosen. Be warned " + "that the cross section function is scaled by the density " + "of the target specie at the position of the interaction " + "(cross section function assumed to have the units m^5)"); + specie->addInteraction(std::shared_ptr( + new interaction::ClusterFormationTertiary(cross_section, target, product))); + } else { + ERROR(clustering_type + ": no known, choose either 'radiative' or 'tertiary'."); + } } else if (type == "ChargeExchange") { DEBUG_LEVEL_2("Adding interactions: ChargeExchange"); std::string target_name = diff --git a/src/interactions/cluster_formation.cpp b/src/interactions/cluster_formation.cpp index 4d47cec..c1b60a8 100755 --- a/src/interactions/cluster_formation.cpp +++ b/src/interactions/cluster_formation.cpp @@ -5,6 +5,7 @@ #include "simulation/logger.h" #include "simulation/velocity_distribution.h" #include "constants/physical_constants.h" +#include "simulation/density_field.h" namespace interaction { @@ -48,4 +49,17 @@ InteractionOutput ClusterFormation::performInteraction( return output; } +ClusterFormationTertiary::ClusterFormationTertiary( + std::function cross_section, + std::shared_ptr target, + std::shared_ptr product) : + ClusterFormation(cross_section, target, product) {} + +double ClusterFormationTertiary::microscopicCrossSection(double energy_eV, + const Coordinate& position) { + const double rate_over_velocity = cross_section_(energy_eV); + auto density = target_->densityField()->density(position); + return rate_over_velocity * density; +} + } // namespace interaction diff --git a/src/interactions/free_movement.cpp b/src/interactions/free_movement.cpp index aecc4f5..4176b3b 100755 --- a/src/interactions/free_movement.cpp +++ b/src/interactions/free_movement.cpp @@ -15,7 +15,8 @@ InteractionOutput FreeMovement::performInteraction(particle::Particle& particle, return InteractionOutput(); } -double FreeMovement::microscopicCrossSection(double energy_eV) { +double FreeMovement::microscopicCrossSection(double energy_eV, + const Coordinate& position) { // returns very small number return SimConstants::minimal_cross_section; } diff --git a/src/interactions/recombination.cpp b/src/interactions/recombination.cpp index fc7fb4a..4553e16 100755 --- a/src/interactions/recombination.cpp +++ b/src/interactions/recombination.cpp @@ -61,7 +61,7 @@ InteractionOutput Recombination::performInteraction( for (int bin = 0; bin < number_energy_bins - 1; ++bin) { energy_eV_bin_center = (energyBinBorders[bin] + energyBinBorders[bin+1])/2.; macroscopic_bin_cross_sections_m.push_back( - microscopicCrossSection(kinetic_energy_eV) * + microscopicCrossSection(kinetic_energy_eV, particle.position()) * recombination_target_->dynamicDensityField() ->density(particle.position(), energy_eV_bin_center)); } @@ -139,9 +139,9 @@ double Recombination::macroscopicCrossSection(const Coordinate& position, //Simpson's rule const double integrated_microscopic_cross_section = (upper_bound - lower_bound)/6. * - (microscopicCrossSection(upper_bound) + - 4*microscopicCrossSection(intermediate_value) + - microscopicCrossSection(lower_bound)); + (microscopicCrossSection(upper_bound, position) + + 4*microscopicCrossSection(intermediate_value, position) + + microscopicCrossSection(lower_bound, position)); // assumption, that the differential density is constant within a cell return differential_density_value * integrated_microscopic_cross_section; } diff --git a/src/simulation/interaction.cpp b/src/simulation/interaction.cpp index 220d5ab..db05c8d 100755 --- a/src/simulation/interaction.cpp +++ b/src/simulation/interaction.cpp @@ -51,12 +51,15 @@ double Interaction::macroscopicCrossSection(particle::Particle& particle) { UnitConversion::JouleToeV; const double density = target_->densityField()->density(x_particle); - const double cross_section = microscopicCrossSection(kinetic_energy_eV); + + const double cross_section = microscopicCrossSection(kinetic_energy_eV, + x_particle); return cross_section * density; }; -double Interaction::microscopicCrossSection(double energy_eV) { +double Interaction::microscopicCrossSection(double energy_eV, + const Coordinate& position) { return cross_section_(energy_eV); }