Version 2, position dependent E/B, kinetic ions, boris mover, terminator
This commit is contained in:
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#include "interactions/excitation.h"
|
||||
|
||||
#include "constants/physical_constants.h"
|
||||
#include "simulation/errors.h"
|
||||
#include "simulation/kinematic.h"
|
||||
#include "simulation/species.h"
|
||||
|
||||
namespace interaction {
|
||||
|
||||
Excitation::Excitation(std::function<double(double)> cross_section,
|
||||
std::shared_ptr<species::Specie> target,
|
||||
double excitation_energy_eV)
|
||||
: Interaction(cross_section, target),
|
||||
excitation_energy_eV_(excitation_energy_eV) {
|
||||
ASSERT_POSITIVE(&excitation_energy_eV_,
|
||||
"The exitationenergy must be positive.");
|
||||
}
|
||||
|
||||
InteractionOutput Excitation::performInteraction(particle::Particle& particle,
|
||||
RandomNumbers* generator) {
|
||||
DEBUG_LEVEL_3("Perform excitation.");
|
||||
const blitz::TinyVector<double, 3> v_impact =
|
||||
particle.velocity().cartesianEntries();
|
||||
const blitz::TinyVector<double, 3> n_impact =
|
||||
v_impact / kinematic::norm(v_impact);
|
||||
|
||||
const double E_kin = kinematic::kineticEnergy(v_impact, particle.mass_kg()) *
|
||||
UnitConversion::JouleToeV;
|
||||
const double E_kin_new = E_kin - excitation_energy_eV_;
|
||||
|
||||
const blitz::TinyVector<double, 3> v_impact_new =
|
||||
kinematic::velocityVector(E_kin_new, n_impact, particle.mass_kg());
|
||||
particle.velocity(CartesianVector(v_impact_new));
|
||||
return InteractionOutput();
|
||||
}
|
||||
|
||||
}; // namespace interaction
|
||||
Reference in New Issue
Block a user