Skip to content

Commit

Permalink
update ImpactIonization.H for energy splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
k-wolfinger committed Sep 12, 2024
1 parent fd62c4e commit d83ee5c
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ BackgroundMCCCollision::BackgroundMCCCollision (std::string const& collision_nam
// create a vector of ScatteringProcess objects from each scattering
// process name
for (const auto& scattering_process : scattering_process_names) {
// std::cout << scattering_process << std::endl;

const std::string kw_cross_section = scattering_process + "_cross_section";
std::string cross_section_file;
pp_collision_name.query(kw_cross_section.c_str(), cross_section_file);
Expand All @@ -109,7 +109,6 @@ BackgroundMCCCollision::BackgroundMCCCollision (std::string const& collision_nam
const std::string kw_energy = scattering_process + "_energy";
utils::parser::getWithParser(
pp_collision_name, kw_energy.c_str(), energy);
// std::cout << scattering_process << std::endl;
}

ScatteringProcess process(scattering_process, cross_section_file, energy);
Expand Down Expand Up @@ -372,8 +371,6 @@ void BackgroundMCCCollision::doBackgroundCollisionsWithinTile
amrex::ParallelForRNG(np,
[=] AMREX_GPU_HOST_DEVICE (long ip, amrex::RandomEngine const& engine)
{
// std::string s1 = std::to_string(total_collision_prob);
// std::cout << s1 << std::endl;

// determine if this particle should collide
if (amrex::Random(engine) > total_collision_prob) { return; }
Expand Down Expand Up @@ -421,14 +418,8 @@ void BackgroundMCCCollision::doBackgroundCollisionsWithinTile
// calculate normalized collision frequency
nu_i += n_a * sigma_E * v_coll / nu_max;

// std::cout << "looping" << std::endl;
// std::string s2 = std::to_string(nu_i);
// std::cout << s2 << std::endl;

// check if this collision should be performed
if (col_select > nu_i) { continue; }

// std::cout << "COLL" << std::endl;

// charge exchange is implemented as a simple swap of the projectile
// and target velocities which doesn't require any of the Lorentz
Expand Down Expand Up @@ -463,13 +454,11 @@ void BackgroundMCCCollision::doBackgroundCollisionsWithinTile
// transform to COM frame
ParticleUtils::doLorentzTransform(vx, vy, vz, uCOM_x, uCOM_y, uCOM_z);

// std::cout << (scattering_process.m_type == ScatteringProcessType::ELASTIC) << std::endl;
if ((scattering_process.m_type == ScatteringProcessType::ELASTIC)
|| (scattering_process.m_type == ScatteringProcessType::EXCITATION)) {
ParticleUtils::RandomizeVelocity(
vx, vy, vz, sqrt(vx*vx + vy*vy + vz*vz), engine
);
// std::cout << "elastic coll occurred" << std::endl;
}
else if (scattering_process.m_type == ScatteringProcessType::BACK) {
// elastic scattering with cos(chi) = -1 (i.e. 180 degrees)
Expand Down

0 comments on commit d83ee5c

Please sign in to comment.