Version 2, position dependent E/B, kinetic ions, boris mover, terminator
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#include "interactions/charge_exchange.h"
|
||||
|
||||
#include "constants/physical_constants.h"
|
||||
#include "simulation/drift_velocity.h"
|
||||
#include "simulation/velocity_distribution.h"
|
||||
|
||||
namespace interaction {
|
||||
|
||||
ChargeExchange::ChargeExchange(std::function<double(double)> cross_section,
|
||||
std::shared_ptr<species::Specie> target)
|
||||
: Interaction(cross_section, target) {}
|
||||
|
||||
InteractionOutput ChargeExchange::performInteraction(
|
||||
particle::Particle& particle,
|
||||
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();
|
||||
|
||||
particle.velocity(CartesianVector(v_target));
|
||||
return InteractionOutput();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user