Added new deletion logger type to count elastic
scattering events that upscatter the neutral particle by an energy of 5mK*k_B (for now hard-coded); Type is only used if DeletionLogger is se=pecified as "all" in the parameter file
This commit is contained in:
@@ -273,6 +273,8 @@ void SimulationOutput::writeNumDeletions(DeletionLogger* logger,
|
||||
for (auto& pair : physDeletions) {
|
||||
if (pair.first == PhysicalDeletionType::wall) {
|
||||
writer.write(pair.second, path_to_deletions + "/Wall(physical)");
|
||||
} else if (pair.first == PhysicalDeletionType::large_energy_transfer) {
|
||||
writer.write(pair.second, path_to_deletions + "/LargeEnergyTransfer");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ std::shared_ptr<DeletionLogger> buildDeletionLogger(json_t* object) {
|
||||
used_types.push_back(DeletionType::max_time_alive);
|
||||
used_types.push_back(DeletionType::cluster_formation);
|
||||
used_phys_types.push_back(PhysicalDeletionType::wall);
|
||||
used_phys_types.push_back(PhysicalDeletionType::large_energy_transfer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "simulation/velocity_distribution.h"
|
||||
#include "constants/sim_constants.h"
|
||||
#include "simulation/density_field.h"
|
||||
#include "simulation/logger.h"
|
||||
namespace interaction {
|
||||
|
||||
ElasticScattering::ElasticScattering(
|
||||
@@ -24,6 +25,8 @@ InteractionOutput ElasticScattering::performInteraction(
|
||||
#endif
|
||||
const blitz::TinyVector<double, 3> v_impact =
|
||||
particle.velocity().cartesianEntries();
|
||||
|
||||
double E_i = kinematic::kineticEnergy(v_impact, particle.mass_kg());
|
||||
// const auto x_impact = particle.position();
|
||||
// const blitz::TinyVector<double, 3> v_target =
|
||||
// target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||
@@ -48,6 +51,13 @@ InteractionOutput ElasticScattering::performInteraction(
|
||||
v_impact, target_velocity_.cartesianEntries(), particle.mass_kg(),
|
||||
target_->mass_kg(), theta, phi);
|
||||
|
||||
double E_iprime = kinematic::kineticEnergy(v_impact_new, particle.mass_kg());
|
||||
|
||||
// energy conservation: Ei + Et = Ei' + Et' <==> Et' - Et = Ei - Ei' (lab frame)
|
||||
if(E_i - E_iprime >= threshold_increase_J) {
|
||||
particle.specie()->deletionLogger()->logDeletion(particle, PhysicalDeletionType::large_energy_transfer);
|
||||
}
|
||||
|
||||
particle.velocity(CartesianVector(v_impact_new));
|
||||
|
||||
return InteractionOutput();
|
||||
|
||||
Reference in New Issue
Block a user