Med Phys 774 Monte Carlo Method for Medical & Health Physics Chapter 5. MCNP Monte Carlo Code 1
MCNP stands for: A general-purpose M C N-P code Particles that can be transported??? See the references: Fermi Invention Rediscovered at LASL, The Atom, Los Alamos Scientific Laboratory (October 1966). Robert R. Johnston, A General Monte Carlo Neutronics Code, LAMS 2856 (March 1963). E. D. Cashwell, J. R. Neergaard, W. M. Taylor, and G. D. Turner, MCN: A Neutron Monte Carlo Code,, LA-4751 (January 1972). MCNP manual of your version. 2
Before World War II: Fermi invented a form of the Monte Carlo method when he was studying the moderation of neutrons in Rome. Amazed his colleagues with his predictions of experimental results! During World War II: At Los Alamos, Fermi & many scientists worked on developing the first atomic bomb. Stan Ulam realized that statistical sampling techniques were considered could become practical with the development of computers. discussed his ideas with John von Neumann and Nicholas Metropolis. Nicholas Metropolis named the mathematical method Monte Carlo. Inspired by: Stan Ulam s uncle borrowed money from relatives to go to!!! 3
During World War II: Pennsylvania: John Mauchly and others were working to develop the first electronic computer. Led to the world s first computer: ENIAC (Electronic Numerical Integrator and Computer) 18,000 double triode vacuum tubes in a system with 500,000 solder joints!!! In 1947, John von Neumann proposed use of the statistical method to solve neutron diffusion and multiplication problems in fission devices. The first Monte Carlo code developed at Los Alamos! A simple 19-step computing sheet!!! MCS: The first Los Alamos general-purpose particle transport Monte Carlo code (1963) Followed by MCN (1965) MCN was merged with MCG (a Monte Carlo gamma code) (1973): Lead to MCNG (a coupled neutron-gamma code) 4
MCNG was merged with MCP (1977): Has been known as MCNP ever since. Note, denoted: Monte Carlo Neutron Photon!!! *MCP: Monte Carlo Photon code with detailed physics treatment down to 1 kev MCNP3 (1983): entirely rewritten in Fortran 77 1 st MCNP version internationally distributed! MCNP4 (1990): added electron transport (by adopting the Integrated TIGER Series electron physics). MCNP5 (2003): rewritten in Fortran 90... MCNP transport modes: neutron only, photon only, electron only, neutron/photon coupled transport, neutron/photon/electron coupled transport, photon/electron coupled transport, electron/photon coupled transport Energy ranges of particles that can be covered: Neutron: 0.01 mev to 20 MeV for all isotopes Photon: 1 kev to 100 GeV Electron: 1 KeV to 1 GeV 5
To run MCNP, you must create an input file to define:. The units used in MCNP: 1. lengths in centimeters, 2. energies in MeV, 3. times in shakes (10-8 sec), 4. temperatures in MeV (kt), 5. atomic densities in units of atoms/barn-cm, 6. mass densities in g/cm 3, 7. cross sections in barns, 8. heating numbers in MeV/collision 6
Your MCNP installation all done??? Now you are ready to write input files!!! Section 1. Sample Problem of Manual Vol. II, Fig. 1-1 7
Section 1. Sample Problem of Manual Vol. II, Fig. 1-1 Cell : Inside sphere 7 / oxygen Cell : Inside sphere 8 / iron Cell : Inside the cube & Outside the spheres 7, 8 / carbon Cell : Outside the cube / vacuum Surface 1:? Surface 2:? Surface 8:? A Sample Problem (Manual Vol. II, Fig. 1-1) Suppose a 14 MeV isotropic point neutron source located in the cell : You want to compute neutron spectra: 0 to 14 MeV, 1 MeV bin width i. on the surface of the iron sphere ii. averaged in the iron sphere volume 8
Go to the section Sample Problem Summary Copy the contents of the input file. Open the software Notepad or any editor and paste the contents. A Sample Problem (Manual Vol. II, Fig. 1-1) A Sample Problem (Manual Vol. II, Fig. 1-1) Delete the lines [blank line delimiter] and keep each one blank. Save the file with a simple name like sample1. *Note, the file name must NOT have any extension like.txt! Copy the file onto the folder C:\MCNP\MCNP5\bin Version # of yours mcnp5.exe for running MCNP!!! 9
Let s run the input file sample1 and see what happens!!! i. Open the program Command Prompt : Find cmd.exe from your computer and run it. In the folder C:\Windows\System32\?? A Sample Problem (Manual Vol. II, Fig. 1-1) ii. Using the command cd, go to the folder C:\MCNP\MCNP5\bin A Sample Problem (Manual Vol. II, Fig. 1-1) Ensure to have the file sample1 in the folder bin!! Type mcnp5 n=sample1 and push enter key Can you see something happening like this: 10
A Sample Problem (Manual Vol. II, Fig. 1-1) Push enter key a few times to check simulation is done!!! Check the bin folder Any new files? Which one is the output?? A Sample Problem (Manual Vol. II, Fig. 1-1) Open the file sample1o using Notepad or any other editor: 11
A Sample Problem (Manual Vol. II, Fig. 1-1) Now you know how to run MCNP using any input file you want, as long as no errors in input!!! A few more things to remember: i. Whenever a simulation is done, renaming the output file is better for your data management! ii. Run MCNP for the input file sample1 again What happens? Why? A Sample Problem (Manual Vol. II, Fig. 1-1) Now let s go through the input file sample1 step by step to find out how you can make it!!! 12
A Sample Problem (Manual Vol. II, Fig. 1-1) Geometry Input: Cell Card & Surface Card 3-D Geometry Review In 3-D, how can you mathematically describe: Plane: How many parameters? Eq.? Sphere:?? Cylinder:?? Cone:?? Ellipsoid:?? Torus:?? 13
MCNP Surface Cards Surface Card Figure out the surface card of sample1 : 14
How to Define a Volume (Region or Cell) To define a volume (region or cell), General purpose Monte Carlo codes employ: Algebra Example) How can you define these two cases?? Cell Card Let s figure out the cell card of sample1!!! 15
Visual Editor: MCNP Geometry Software Go to the folder C:\MCNP\MCNP5, find vised.exe and run it: Visual Editor: MCNP Geometry Software Open sample1 16
Guess what the remaining cards of sample1 are doing?? Source Card The source card must specify: Is this sufficient??? The other parameters coming soon! 17
Tallies F2:n 8 means?? F4:n 2?? E0 1 12I 14?? F2 tally: Tallies ( r, E,, ) :? :? N s : number of the source particles, L i : number of the surface crossings by i th particle F4 tally: 1 s dt de ds d ~ ( r, E,, t) Another name for F4??? The other tallies coming soon!!! N s L i W S N ss i 1 j 1 n ~ t 1 ~ ( V n dt de d r d r, E,, t) N V i j 3 1 1 N s L i V s 1 1 Ws j i j s i :? 18
Material Card M1 8016 1 means??? M2 26000 1 M3 6000 1 What about compounds and mixtures??? Coming soon! Output File Contents 19
Output File Contents Open sample1o with Notepad or another editor. Go to the line 30: What is this part?? Output File Contents Go to the line 65: What is this part?? 20
Output File Contents Go to the line 157: What is this part?? Output File Contents Go to the line 247: What is this part?? 21