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:
@@ -46,6 +46,8 @@ class Interaction {
|
|||||||
std::function<double(double)> cross_section_;
|
std::function<double(double)> cross_section_;
|
||||||
std::shared_ptr<species::Specie> target_;
|
std::shared_ptr<species::Specie> target_;
|
||||||
CartesianVector target_velocity_;
|
CartesianVector target_velocity_;
|
||||||
|
|
||||||
|
double threshold_increase_J = 6.9032515e-26; // J (5 mK)
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace interaction
|
}; // namespace interaction
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ enum class DeletionType {
|
|||||||
|
|
||||||
// to count physical particle deletion
|
// to count physical particle deletion
|
||||||
enum class PhysicalDeletionType {
|
enum class PhysicalDeletionType {
|
||||||
wall
|
wall,
|
||||||
|
large_energy_transfer
|
||||||
};
|
};
|
||||||
|
|
||||||
class Coordinate;
|
class Coordinate;
|
||||||
|
|
||||||
class DeletionLogger {
|
class DeletionLogger {
|
||||||
|
|||||||
@@ -273,6 +273,8 @@ void SimulationOutput::writeNumDeletions(DeletionLogger* logger,
|
|||||||
for (auto& pair : physDeletions) {
|
for (auto& pair : physDeletions) {
|
||||||
if (pair.first == PhysicalDeletionType::wall) {
|
if (pair.first == PhysicalDeletionType::wall) {
|
||||||
writer.write(pair.second, path_to_deletions + "/Wall(physical)");
|
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::max_time_alive);
|
||||||
used_types.push_back(DeletionType::cluster_formation);
|
used_types.push_back(DeletionType::cluster_formation);
|
||||||
used_phys_types.push_back(PhysicalDeletionType::wall);
|
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 "simulation/velocity_distribution.h"
|
||||||
#include "constants/sim_constants.h"
|
#include "constants/sim_constants.h"
|
||||||
#include "simulation/density_field.h"
|
#include "simulation/density_field.h"
|
||||||
|
#include "simulation/logger.h"
|
||||||
namespace interaction {
|
namespace interaction {
|
||||||
|
|
||||||
ElasticScattering::ElasticScattering(
|
ElasticScattering::ElasticScattering(
|
||||||
@@ -24,6 +25,8 @@ InteractionOutput ElasticScattering::performInteraction(
|
|||||||
#endif
|
#endif
|
||||||
const blitz::TinyVector<double, 3> v_impact =
|
const blitz::TinyVector<double, 3> v_impact =
|
||||||
particle.velocity().cartesianEntries();
|
particle.velocity().cartesianEntries();
|
||||||
|
|
||||||
|
double E_i = kinematic::kineticEnergy(v_impact, particle.mass_kg());
|
||||||
// const auto x_impact = particle.position();
|
// const auto x_impact = particle.position();
|
||||||
// const blitz::TinyVector<double, 3> v_target =
|
// const blitz::TinyVector<double, 3> v_target =
|
||||||
// target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
// target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||||
@@ -48,6 +51,13 @@ InteractionOutput ElasticScattering::performInteraction(
|
|||||||
v_impact, target_velocity_.cartesianEntries(), particle.mass_kg(),
|
v_impact, target_velocity_.cartesianEntries(), particle.mass_kg(),
|
||||||
target_->mass_kg(), theta, phi);
|
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));
|
particle.velocity(CartesianVector(v_impact_new));
|
||||||
|
|
||||||
return InteractionOutput();
|
return InteractionOutput();
|
||||||
|
|||||||
Reference in New Issue
Block a user