Skip to content

Commit

Permalink
added arik function but only took one solution for mu com
Browse files Browse the repository at this point in the history
  • Loading branch information
Itay-max committed Oct 25, 2022
1 parent c2dfc90 commit 23a7d14
Show file tree
Hide file tree
Showing 7 changed files with 334 additions and 15 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ list(APPEND libopenmc_SOURCES
src/string_utils.cpp
src/summary.cpp
src/surface.cpp
src/tallies/MyCalcs.cpp
src/tallies/derivative.cpp
src/tallies/filter.cpp
src/tallies/filter_azimuthal.cpp
Expand Down
4 changes: 4 additions & 0 deletions include/openmc/particle.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ class Particle : public ParticleData {

//! create a secondary particle
//
//
double getMass() const;
//
//
//! stores the current phase space attributes of the particle in the
//! secondary bank and increments the number of sites in the secondary bank.
//! \param wgt Weight of the secondary particle
Expand Down
8 changes: 8 additions & 0 deletions include/openmc/tallies/tally_scoring.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ void score_point_tally(Particle& p);

//! Score tallies based on a simple count of events (for continuous energy).
//
void boostf( double A[4], double B[4], double X[4]);
double Vdot(double A[4],double B[4]);
void Vcros(double A[4],double B[4],double C[4]);
void Vunit(double A[4] ,double B[4]);


void getMu_COM(double x_det , double y_det , double z_det ,Particle p_col , double awr , double incoming_mass, double ReturnArray[],int diff_mode,double dl );

//! Analog tallies are triggered at every collision, not every event.
//
//! \param p The particle being tracked
Expand Down
4 changes: 2 additions & 2 deletions src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ void title()
" #################### aight%%%%%%%%%%%%%%%%%%\n"
" ##################### its working%%%%%%%%%%\n"
" ###################### %%%%%%%%%%%%%%%%%%%%\n"
" ####################### %%%%%%%%%%%%%%%%%%\n"
" ####################### %%%%%%%%%%%%%%%%%\n"
" ########itay########### %%%%%%%%%%%%%%%%%%\n"
" ######is loser######### %%%%%%%%%%%%%%%%%\n"
" ###################### %%%%%%%%%%%%%%%%%\n"
" #################### %%%%%%%%%%%%%%%%%\n"
" ################# %%%%%%%%%%%%%%%%%\n"
Expand Down
20 changes: 20 additions & 0 deletions src/particle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,26 @@ double Particle::speed() const
// Calculate speed via v = c * sqrt(1 - γ^-2)
return C_LIGHT * std::sqrt(1 - inv_gamma * inv_gamma);
}
double Particle::getMass() const
{
// Determine mass in eV/c^2
double mass;
switch (this->type()) {
case ParticleType::neutron:
mass = MASS_NEUTRON_EV;
break;
case ParticleType::photon:
mass = 0.0;
break;
case ParticleType::electron:
case ParticleType::positron:
mass = MASS_ELECTRON_EV;
break;
}

return mass;
}


void Particle::initilze_ghost_particle(Particle& p,Direction u_new, double E_new)
{
Expand Down
14 changes: 13 additions & 1 deletion src/tallies/MyCalcs.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
#include <iostream>
#include <cmath>
#include "/home/open_mc/openmc/include/openmc/position.h"
#include "openmc/boundary_condition.h"

#include <exception>

#include <fmt/core.h>

#include "openmc/constants.h"
#include "openmc/error.h"
#include "openmc/surface.h"
using namespace std;


void boostf( double A[4], double B[4], double X[4]);
double Vdot(double A[4],double B[4]);
void Vcros(double A[4],double B[4],double C[4]);
void Vunit(double A[4] ,double B[4]);

int getMu_lab(double x_det , double y_det , double z_det ,Position p_col , double awr , double incoming_mass )


int getMu_lab(double x_det , double y_det , double z_det ,openmc::Position p_col , double awr , double incoming_mass )
{
cout<<" p col "<<p_col<<endl;
double r1[4]= {0, x_det, y_det, z_det}; // detector position lab {ignor, x, y, z}
Expand Down
Loading

0 comments on commit 23a7d14

Please sign in to comment.