Skip to content

Commit

Permalink
changed p2 calc and verified it by maxwell boltzman distirbution
Browse files Browse the repository at this point in the history
  • Loading branch information
Itay-max committed Oct 25, 2022
1 parent 52d337e commit bff894c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,9 @@ void elastic_scatter(int i_nuclide, const Reaction& rx, double kT, Particle& p)
v_t = sample_target_velocity(*nuc, p.E(), p.u(), v_n,
p.neutron_xs(i_nuclide).elastic, kT, p.current_seed());
}
p.v_t() = C_LIGHT*std::sqrt(2/(awr*p.getMass()))*v_t;
//std::cout << "v_n = "<< p.speed() <<std::endl;
p.v_t() = C_LIGHT*std::sqrt(2/p.getMass())*v_t;

This comment has been minimized.

Copy link
@Itay-max

Itay-max Oct 26, 2022

Author

corrected a units mistake

std::cout << "v_t = "<< p.v_t().norm() <<std::endl;
// Velocity of center-of-mass
Direction v_cm = (v_n + awr * v_t) / (awr + 1.0);

Expand Down
7 changes: 3 additions & 4 deletions src/tallies/tally_scoring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2367,7 +2367,6 @@ void score_tracklength_tally(Particle& p, double distance)

void score_collision_tally(Particle& p)
{
fmt::print("collision tally called\n");
// Determine the collision estimate of the flux
double flux = 0.0;
if (p.type() == ParticleType::neutron || p.type() == ParticleType::photon) {
Expand Down Expand Up @@ -3088,9 +3087,9 @@ void getMu_COM(double x_det , double y_det , double z_det ,Particle p_col , doub
std::cout << "p1: "<< p1[0] <<" "<< p1[1]<<" " <<p1[2] <<std::endl;
std::cout << "p2: "<< (p_col.v_t() * m2 / C_LIGHT).x <<" " <<(p_col.v_t() * m2 / C_LIGHT).y << " "<<(p_col.v_t() * m2 / C_LIGHT).z <<std::endl;
//std::cout << (p.v_t() * m2 / C_LIGHT).x << (p.v_t() * m2 / C_LIGHT).y << (p.v_t() * m2 / C_LIGHT).z <<std::endl;
double p2_x = (p_col.v_t() * m2 / C_LIGHT).x;
double p2_y = (p_col.v_t() * m2 / C_LIGHT).y;
double p2_z = (p_col.v_t() * m2 / C_LIGHT).z;
double p2_x = (p_col.v_t() * m2 /C_LIGHT).x;
double p2_y = (p_col.v_t() * m2 /C_LIGHT).y;
double p2_z = (p_col.v_t() * m2 /C_LIGHT).z;
double p2[3]={p2_x, p2_y, p2_z}; //3 momentum of target in lab

// calculate
Expand Down

0 comments on commit bff894c

Please sign in to comment.