geogunow / MultiGroupMC

Tutorial to build a multi-group Monte Carlo solver
1 stars 1 forks source link

Assignment 3 #2

Closed ljeure closed 8 years ago

ljeure commented 9 years ago

I added a check for reflective and transparent boundary conditions. If the neutron hits a reflective boundary, it is reflected: the component of its path in that direction is given a change of sign. If the neutron hits a transparent boundary, it is considered a leaked electron. I added functions to the Coords class to make checking for boundary conditions and changing neutron positions easier.

I created tally.py which holds the Tally class. Tallies are kept for neutron leakage, fission events, neutron absorptions, and crow flight values. I adjusted the mean_crow_distance calculation to make use of the Tally class.

I created fission.py which holds the Fission class. This class keeps track of every location at which a fission event occurs.

In monte_carlo.py I added a loop that causes the program to run through simulations of several batches of neutrons. The starting locations of the neutrons in the first batch are randomly sampled. For every batch after that, the starting points of the neutrons are taken from the fission locations given by the previous batch. After all the batches have run, the value for the eigenvalue k is calculated.

geogunow commented 9 years ago

It looks like you're making some good progress. Right now the code doesn't run due to a typo. Make sure you can run the code using a script that imports the correct files and make sure that A) the code runs without getting caught in an infinite loop, B) the code produces the expected behavior (reflective, etc), and C) it converges to the correct solution if the number of histories and batches are high enough. The correct solution for k when reflective boundaries are applied is

nu*sigma_f / sigma_a

of the associated material.