Changed distance drawing procedure;
Changed mover to work with times instead of distance; Changed how interactions are done (recombination still tbd)
This commit is contained in:
@@ -15,14 +15,14 @@ InteractionOutput ChargeExchange::performInteraction(
|
||||
RandomNumbers* generator) {
|
||||
DEBUG_LEVEL_3("Perform charge exchange.");
|
||||
|
||||
const auto x_impact = particle.position();
|
||||
const blitz::TinyVector<double, 3> v_target =
|
||||
target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||
target_->velocityDistibution()
|
||||
->rollVelocity(x_impact, generator->engine())
|
||||
.cartesianEntries();
|
||||
// const auto x_impact = particle.position();
|
||||
// const blitz::TinyVector<double, 3> v_target =
|
||||
// target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||
// target_->velocityDistribution()
|
||||
// ->rollVelocity(x_impact, generator->engine())
|
||||
// .cartesianEntries();
|
||||
|
||||
particle.velocity(CartesianVector(v_target));
|
||||
particle.velocity(CartesianVector(target_velocity_));
|
||||
return InteractionOutput();
|
||||
}
|
||||
};
|
||||
@@ -19,17 +19,17 @@ InteractionOutput ClusterFormation::performInteraction(
|
||||
RandomNumbers* generator) {
|
||||
DEBUG_LEVEL_3("Perform cluster formation.");
|
||||
const auto x_impact = particle.position();
|
||||
const blitz::TinyVector<double, 3> v_target =
|
||||
target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||
target_->velocityDistibution()
|
||||
->rollVelocity(x_impact, generator->engine())
|
||||
.cartesianEntries();
|
||||
// const blitz::TinyVector<double, 3> v_target =
|
||||
// target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||
// target_->velocityDistribution()
|
||||
// ->rollVelocity(x_impact, generator->engine())
|
||||
// .cartesianEntries();
|
||||
const double energy_eV =
|
||||
kinematic::kineticEnergy(v_target, target_->mass_kg()) *
|
||||
kinematic::kineticEnergy(target_velocity_.cartesianEntries(), target_->mass_kg()) *
|
||||
UnitConversion::JouleToeV;
|
||||
const blitz::TinyVector<double, 3> v_cluster =
|
||||
kinematic::velocity(energy_eV, product_->mass_kg()) *
|
||||
v_target / kinematic::norm(v_target);
|
||||
target_velocity_.cartesianEntries() / kinematic::norm(target_velocity_.cartesianEntries());
|
||||
// product inherits weight of the main particle (not the target, which is
|
||||
// assumed to be just a density, i.e. has no weight of its own)
|
||||
particle::Particle cluster(product_, x_impact, CartesianVector(v_cluster),
|
||||
|
||||
@@ -21,15 +21,16 @@ InteractionOutput ElasticScattering::performInteraction(
|
||||
DEBUG_LEVEL_3("Perform elastic scattering.");
|
||||
const blitz::TinyVector<double, 3> v_impact =
|
||||
particle.velocity().cartesianEntries();
|
||||
const auto x_impact = particle.position();
|
||||
const blitz::TinyVector<double, 3> v_target =
|
||||
target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||
target_->velocityDistibution()
|
||||
->rollVelocity(x_impact, generator->engine())
|
||||
.cartesianEntries();
|
||||
// const auto x_impact = particle.position();
|
||||
// const blitz::TinyVector<double, 3> v_target =
|
||||
// target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||
// target_->velocityDistribution()
|
||||
// ->rollVelocity(x_impact, generator->engine())
|
||||
// .cartesianEntries();
|
||||
|
||||
const blitz::TinyVector<double, 3> v_laboratory =
|
||||
kinematic::velocityTargetFixed(v_impact, v_target, particle.mass_kg(),
|
||||
kinematic::velocityTargetFixed(v_impact, target_velocity_.cartesianEntries(),
|
||||
particle.mass_kg(),
|
||||
target_->mass_kg());
|
||||
|
||||
const double E_kin =
|
||||
@@ -41,8 +42,8 @@ InteractionOutput ElasticScattering::performInteraction(
|
||||
|
||||
const blitz::TinyVector<double, 3> v_impact_new =
|
||||
kinematic::rotateVelocityInCenterOfMassFrame(
|
||||
v_impact, v_target, particle.mass_kg(), target_->mass_kg(), theta,
|
||||
phi);
|
||||
v_impact, target_velocity_.cartesianEntries(), particle.mass_kg(),
|
||||
target_->mass_kg(), theta, phi);
|
||||
|
||||
particle.velocity(CartesianVector(v_impact_new));
|
||||
// no Gyrocentrum movement because boris push is used;
|
||||
|
||||
@@ -23,4 +23,8 @@ double FreeMovement::macroscopicCrossSection(particle::Particle& particle) {
|
||||
// returns a very small number, so the interaction will only be
|
||||
return SimConstants::minimal_macroscopic_cross_section;
|
||||
}
|
||||
double FreeMovement::drawCollisionTime(particle::Particle& particle,
|
||||
RandomNumbers* generator) {
|
||||
return std::numeric_limits<double>::max();
|
||||
}
|
||||
}; // namespace interaction
|
||||
@@ -35,22 +35,26 @@ InteractionOutput ElectronIonization::performInteraction(
|
||||
particle.velocity().cartesianEntries();
|
||||
const auto x_impact = particle.position();
|
||||
|
||||
blitz::TinyVector<double, 3> v_target;
|
||||
blitz::TinyVector<double, 3> v_laboratory;
|
||||
double E_impact;
|
||||
do {
|
||||
v_target =
|
||||
target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||
target_->velocityDistibution()
|
||||
->rollVelocity(x_impact, generator->engine())
|
||||
.cartesianEntries();
|
||||
// blitz::TinyVector<double, 3> v_target;
|
||||
blitz::TinyVector<double, 3> v_laboratory = kinematic::velocityTargetFixed(
|
||||
v_impact, target_velocity_.cartesianEntries(), particle.mass_kg(), target_->mass_kg()
|
||||
);
|
||||
|
||||
v_laboratory = kinematic::velocityTargetFixed(
|
||||
v_impact, v_target, particle.mass_kg(), target_->mass_kg());
|
||||
double E_impact = kinematic::kineticEnergy(v_laboratory, particle.mass_kg()) *
|
||||
UnitConversion::JouleToeV;
|
||||
// do {
|
||||
// v_target =
|
||||
// target_->driftVelocity()->driftVelocity(x_impact).cartesianEntries() +
|
||||
// target_->velocityDistribution()
|
||||
// ->rollVelocity(x_impact, generator->engine())
|
||||
// .cartesianEntries();
|
||||
|
||||
E_impact = kinematic::kineticEnergy(v_laboratory, particle.mass_kg()) *
|
||||
UnitConversion::JouleToeV;
|
||||
} while (E_impact <= ionization_energy_eV_);
|
||||
// v_laboratory = kinematic::velocityTargetFixed(
|
||||
// v_impact, v_target, particle.mass_kg(), target_->mass_kg());
|
||||
|
||||
// E_impact = kinematic::kineticEnergy(v_laboratory, particle.mass_kg()) *
|
||||
// UnitConversion::JouleToeV;
|
||||
// } while (E_impact <= ionization_energy_eV_);
|
||||
|
||||
const double E_impact_new =
|
||||
energy_distribution_->rollImpactParticleEnergyAfterCollision(E_impact,
|
||||
@@ -83,13 +87,13 @@ InteractionOutput ElectronIonization::performInteraction(
|
||||
kinematic::rotateVector(v_lab_norm, azimuth_angle_impact_new,
|
||||
polar_angle_impact_new) *
|
||||
v_lab_impact_new +
|
||||
v_target;
|
||||
target_velocity_.cartesianEntries();
|
||||
|
||||
const blitz::TinyVector<double, 3> v_ejected =
|
||||
kinematic::rotateVector(v_lab_norm, azimuth_angle_ejected,
|
||||
polar_angle_ejected) *
|
||||
v_lab_ejected +
|
||||
v_target;
|
||||
target_velocity_.cartesianEntries();
|
||||
|
||||
particle.velocity(v_impact_new);
|
||||
|
||||
@@ -101,7 +105,7 @@ InteractionOutput ElectronIonization::performInteraction(
|
||||
output.add(
|
||||
particle::Particle(electron_, x_impact, CartesianVector(v_ejected),
|
||||
time_birth, weight_parent));
|
||||
output.add(particle::Particle(ion_, x_impact, CartesianVector(v_target),
|
||||
output.add(particle::Particle(ion_, x_impact, target_velocity_,
|
||||
time_birth, weight_parent));
|
||||
|
||||
return output;
|
||||
|
||||
Reference in New Issue
Block a user