Documente Academic
Documente Profesional
Documente Cultură
notation............................................................................................................................ 1
Chapter 1 - MCNP Quickstart .............................................................2
1.1 What You Will Be Able to Do:........................................................................... 2
1.2 MCNP Input File................................................................................................. 2
1.2.A Rules about Input Files ................................................................................... 3
1.3.A Title ................................................................................................................. 3
1.3.B Cell Commands............................................................................................... 4
1.3.C Surface Commands ......................................................................................... 5
1.3.D Data Commands .............................................................................................. 5
SDEF Command ......................................................................................................... 6
Material Command ..................................................................................................... 6
Mode Command .......................................................................................................... 8
Fn (tally) Command .................................................................................................... 8
Print Command ........................................................................................................... 8
Cutoff Commands....................................................................................................... 9
1.4 Example 1 – Photon Point Source -Cobalt-60 .................................................... 9
Title ........................................................................................................................... 10
Cells .......................................................................................................................... 10
Surfaces ..................................................................................................................... 12
Data ........................................................................................................................... 13
1.5 Running Example 1........................................................................................... 16
Installation................................................................................................................. 16
Running MCNP ........................................................................................................ 17
Did it Run? ................................................................................................................ 17
Examining the Output ............................................................................................... 18
1.6 Summary........................................................................................................... 19
notation
courier type literally as shown
italics don’t take literally it stands for something else
underlined hit the key on the keyboard like enter or delete
An MCNP input file has four major sections : title, cell, surface, and data. A one-
line title precedes the cell section. A section consists of one or more commands. A
command has one or more cards. The word “card” is used throughout this document and
in the MCNP manual to describe a single line of input of up to 80 characters. Figure 1–1
shows the input file structure.
Title
Cell Commands
..........
..........
Blank-Line-Delimiter
Surface Commands
..........
..........
Blank-Line-Delimiter
Data Commands
..........
..........
Blank-Line-Terminator (optional)
Figure l–l. MCNP input file structure.
1
The present chapter is a copied from Chapter 1 in “Criticality Calculations with MCNP: A
Primer,” (LANL Report LA -12827.) It has been re-written here for transport problems (as oposed to the
oriiginal criticality problems.) - LATER – permission from LANL
1.3.A Title
The title is the first card in an MCNP input file and can be 80 characters long. It
often contains information about the problem being modeled. This titIe is echoed in
various places throughout the MCNP output. It also serves as a label to distinguish
among input files.
n
be
lea
um
oo
r
be
ln
/b
um
l
ria
na
ce
ity
ll n
rfa
tio
ate
ns
op
de
su
m
ce
j m d geom params
Figure l–3. Cell Command.
The cell number, j, is an integer from 1 to 99999. The material number, m,is also
an integer from 1 to 99999 that determines what material is present in the cell. The
composition of a specific material is defined later in the data card section. A positive
entry for the cell material density, d,indicates an atomic density in atoms per barn-
centimeter. A negative entry indicates a mass density in grams per cubic centimeter. The
geometry specification, geom, consists of signed surface numbers combined with
Boolean operators to describe how regions of space are bounded by those surfaces.
Surfaces are the geometric shapes used to form the boundaries of the problem being
modeled. The optional params feature allows cell parameters to be specified on the cell
card line instead of in the data card section. For example, the importance card (imp:n)
specifies the relative cell importance for neutrons, one entry for each cell of the problem.
The imp:n card can go in the data card section or it can be placed on the cell card line at
the end of the list of surfaces.
C Cell Card
4 1 1.234e-3 -2 imp:n=l
ns
nu
ic
sio
on
ce
en
rfa
ne
dim
su
j a list
Figure l–5. Surface Command
d.
an
dn
m
an
om
m
yc
m
sb
co
fer
ta
da
dif
name entries
Figure l–7. Data Command.
Data commands must begin in columns 1-5. At least one blank must separate the
name and the entries. We will discuss the data commands that will be used in our first
examples. (Chapter 3 of the MCNP manual goes into greater depth.)
SDEF Command
Material Command
Use the material command to put materials in your model. For example, make air
out of oxygen, nitrogen, argon etc. Each element and fraction is added to the mix in
succession. The format is:
as ber
on
as ber
on
ing u a
cti
d m um
cti
dm m
ak o
fra
ra
m rial y
an d nu
s
s
an e n
etc
df
de
d
on
on
ate
ird
cli
cli
sec
sec
nu
nu
m
th
mn zaid1 fraction1 zaid2 fraction2 ....
Figure l–9. Material Command.
mn = Starts with an "m" followed by a number, such as m1 or m15.
zaid = Atomic number and mass, such as 06012 for carbon.
fraction = (-) weight fraction, or (+) atom fraction - don't mix types!
I gave Air the name m1 in this model. Note the four elements, carbon, nitrogen,
oxygen, and argon. I gave the Z (atomic number) values but not the atomic masses (they
were all left as zeros.) This causes MCNP to use the default nuclide mixes (in its
libraries.) The output will give you the mix. The fractions are negative, therefore MCNP
thinks they are weight fractions. The command takes two lines. there are two ways to
do this, either make sure the data begins after the fifth column of the next line, or end the
previous line with an ampersand (&). Both are shown in the Figure.
For Water positive fractions (i.e. atom fractions) are entered. The first zaid is
1001 and the second is 8016. This specifies the nuclides H-1 and O-16. This will cause
the following nuclides that are present naturally to be left out, H-2, (0.015% of all
hydrogen) O-17 and O-18. The fractions are entered as positive numbers, so MCNP
Mode tells MCNP what particles to track. In the first example below the code
looks only at photons; all neutrons and electrons are discarded. In the second example
only neutrons are tracked. The last tracks neutrons, photons, and electrons – which, by
the way, adds significantly to run-time.
mode p
mode n
mode n p e $ neutrons photons and electrons tracked
Figure l–11. Example Mode Commands.
Fn (tally) Command
The Fn, or tally, command tells MCNP what type of answer to give and in which
cells the particles get counted. The tally command usually goes with a multiplier, i.e.
FMn command, which gives a multiplier, i.e. it allows the answers to be normalized. In
the examples below, F6 2 followed by FM6 1.39 tells MCNP to calculate MeV/g
in cell 2 and to multiply the answer by 1.39. The second example tells MCNP to
calculate flux in cells 3 and 5 and to multiply the result by 2.
F6 2
FM6 1.39
F94 3 5
FM94 2.
Figure l–12. Example Tally Commands.
Print Command
The print command tells MCNP to print the results into a file called outp. If
you forget the print command, the code will give a summary printout.
print
Figure l–13. Example Print Command.
Cutoff commands, like nps and ctme tell MCNP when to stop. Nps is “number
of particles started, in the Figure 14 example 10,000 particles will be started and then
MCNP will print the result. Ctme 3 tells it to run 3 minutes and then print.
nps 10000
ctme 3
Figure l–14. Example Cutoff Commands.
2
DOE/TIC-11026, “Radioactive Decay Data Tables,” David C. Kocher, 1981.
3
Radiological Health Handbook, LATER.
Title
The title is the first line in the file. Type it followed by enter:
à Dose 1m from 1 Curie Cobalt 60 point source
The most difficult part of building the geometry of the model is that you must
think of cells and surfaces simultaneously. Also I chose this problem because the model
can be simplified as follows :
• the detector geometry can be a sphere surrounding the point source
• the detector volume can go between 95 and 105 cm, i.e. centering on 1m
• photons that pass through the detector do not scatter back significantly
• there is no significant absorption within the first meter of air.
• only track photons
Start with a drawing. Note that the cells and surfaces and source are shown.
The first number is the cell number. So you have just enetered the description of
cell 1. The second is the material number. The inputs for material 1 will be typed in the
Data Section below. The –0.0012 is the density. It is negative, so it has units of g/cc.
This is the density of air at sea level at 20 degrees C. There is only one surface / boolean
entry, -1. The “- “ sign indicates that the cell includes all space with negative sense with
respect to (i.e. inside the sphere.) The only optional parameter is the photon importance
of the cell, which is set to 1 which is standard for a simple problem. The following
shows the relation between what you’ve typed and the MCNP variables.
n
r
be
lea
um
oo
r
be
/b
ln
um
l
ria
na
ce
ity
rfa
ll n
ate
tio
ns
op
de
su
m
ce
j m d geom params
1 1 -0.0012 -1 imp:p 1
Now enter the next two cell commands. These are for cells 2 and 3. Look back
on the figure. Cell 2 is the detector region. Later on you will tell MCNP to “tally” all
energy deposited in cell 2, i.e. dose. Note that the average distance between the source
and cell 2 is 1 meter. Cell 2 falls between sphere 1 and sphere 2. The surface / Boolean
description is –2 +1, which means outside sphere 1 and inside surface 2. Everything else
is the same as cell 1.
mc1 Dose at 1 meter from a 1 Curie Cobalt 60 point source
C CELL COMMANDS
1 1 -0.0012 -1 imp:p 1
à 2 1 -0.0012 -2 +1 imp:p 1
à 3 0 2 imp:p 0
à enter
Take a deep breath, look at the geometry figure (Figure 1.4-1 above) and think
about the surfaces that your cells need to “talk” to. Cell 1 needs surface 1, cell 2 needs
surfaces 1 and 2, and Cell 3 needs surface 2. Start by typing the comment command that
starts the Surface Section , then the two surfaces, and the blank line that ends the Surface
Section as shown.
mc1 Dose at 1 meter from a 1 Curie Cobalt 60 point source
C CELL COMMANDS
1 1 -0.0012 -1 imp:p 1
2 1 -0.0012 -2 +1 imp:p 1
99 0 2 imp:p 0
à C SURFACE COMMANDS
à 1 so 95
à 2 so 105
à enter
Now that you have typed the Surface section, lets look at surface 1. The first
number is the surface number. You actually have a choice of surface numbers between 1
and 99999. The surfaces do not need to be typed in any particular order. For example we
could have called our surfaces 736 and 45 (and edited the cell section too.) If you don’t
keep the surfaces in some kind of order you will be asking for another MCNP out of body
experience.
Figure l.4-2. Example 1 Cells and Surface (rendered with Visual Editor.)
Data
First type the comment card to begin the data section. Because you are only
interested in photons you will need a MODE p command. Enter it as shown. MCNP4C2
handles neutrons and electrons too, but to keep it simple and because we can solve this
problem without tracking neutrons and electrons, we will track photons only.
MCNP handles two types of problems, transport and criticality. Because this is a
transport problem you will need an SDEF command. (For criticality problems you would
use kcode (see Chapter LATER.) Type the SDEF command as shown. The first entry
is POS = 0 0 0 which tells MCNP to start all source photons at the origin. Then the
ERG=D1 entry tells MCNP to take the particle energies from distribution 1.
You will define distribution 1 with the SI and SP commands. On the source
information command the first entry, L, indicates that individual energies will follow, in
this case the two photon energies in MeV of the Cobalt emission. The source probability
command, SP, tells MCNP to release the first energy 50% and the second energy (i.e.
1.332) 50% of the time. The nps command tells MCNP how many particles to start.
C DATA COMMANDS
mode p
SDEF POS = 0 0 0 ERG = D1
à SI1 L 1.173 1.332
à SP1 D 0.5 0.5
à nps 10000
The Fn is the tally command. It tells MCNP what to calculate. MCNP reads
F6:P 2 as follows: “Do a tally type 6 (i.e. MeV/g averaged over a cell) for photons that
pass through4 cell number 2.” Go back and read that again then type in the F6 command
as shown.
C DATA COMMANDS
mode p
SDEF POS = 0 0 0 ERG = D1
SI1 L 1.173 1.332
SP1 0.5 0.5
nps 10000
à F6:P 2
à FM6 4.268E6
4
LATER FOR AUTHOR – be crisp about which are tallied – those that pass through or those that
interact in the cell?
The constant in the FM6 command multiplies the tally by a scalar. Here’s the
Constant to convert of MeV/g history to rad/hr for Cobalt-60:
Constant = 1 Ci ⋅ 2 histories / decay ⋅ 3.7E10 decays / Ci s ⋅ 3600 s / hr ⋅1.602E − 6 erg / MeV / 100 erg / gRad
FM6
Now its time to enter the materials and their compositions. The cell cards above
require materials. In our problem there is only material 1 (one,) it is air. Type the four
lines of the material command as shown:
C DATA COMMANDS
mode p
SDEF POS = 0 0 0 ERG = D1
SI1 L 1.173 1.332
SP1 0.5 0.5
nps 10000
F6:P 2
FM6 4.268E6
à m1 6000 -0.00014 7000 -0.75519
à 8000 -0.23179 18000 -0.01288
MCNP reads the m1 command as follows: “the m1 means that the definition for
material number 1 ( needed for one of more cells) will be defined next. The first entry is
a ZAID. The second entry is the it’s density. The units are g/cc because of the minus
sign.” The ZAID=6000 means the naturally occuring nuclides of Carbon (Z=6.) If you
want Carbon-12 alo ne, the ZAID is 6012. If you wanted cross-section library 66c, then it
would be 6012.66c. Using 6000 you get the default Carbon with the default cross-
I assume that MCNP is installed on your machine. When looking at the directory
(on PC in windows explorer) the MCNP directory should look something like this:
There is the mcnp.exe code, the cross-section directory library (xsdir,) and the
input file, mc1. To run your example type mcnp inp=mc1. The code should run almost
instantly. The terminal session should look something like this.
DOS terminal session in windows. What you type is underlined.
C:\MCNP>mcnp i=mc1
mcnp ver=4c ld=01/20/00 10/12/03 13:48:22
imcn is done
dump 1 on file runtpe nps = 0 coll = 0
ctm = 0.00 nrn = 0
xact is done
dynamic storage = 185014 words, 740056 bytes. cp0 = 0.01
run terminated when 10000 particle histories were done.
dump 2 on file runtpe nps = 10000 coll = 73
ctm = 0.00 nrn = 56384
mcrun is done
C:\MCNP>
And the directory of files something like this:
Notice the two new files, outp (the output file) and runtpe (the restart file.) Each
time you run a problem the output file names will advance, from outp, to outq, to outr,
Likewise runtpe to runtpf, to runtpg etc. After two runs your directory will look like:
How do you know it ran at all? First the DOS window says how many particles
were run. In our case it should be 10,000. Second, there should be not fatal error
messages in the DOS window. Third, there should be an outp file.
Look at the output file, outp, assuming it ran. In Windows, open Notepad and
drag outp to it, or print it out. You will need to accommodate 132 character-wide page.
The most important results is in the tally fluctuation chart, (tfc) which appears at the end
of the printout:
1tally fluctuation charts
tally 6
nps mean error vov slope fom
1000 1.1272E+00 0.0020 0.0273 10.0 0.0E+00
2000 1.1279E+00 0.0014 0.0175 10.0 1.5E+09
3000 1.1283E+00 0.0011 0.0132 10.0 1.5E+09
4000 1.1275E+00 0.0009 0.0088 10.0 1.3E+09
5000 1.1276E+00 0.0008 0.0069 7.2 1.7E+09
6000 1.1275E+00 0.0008 0.0059 7.2 1.7E+09
7000 1.1273E+00 0.0007 0.0047 7.2 1.5E+09
8000 1.1271E+00 0.0007 0.0048 7.2 1.3E+09
9000 1.1271E+00 0.0006 0.0045 7.2 1.3E+09
10000 1.1274E+00 0.0006 0.0038 7.2 1.3E+09
The TFC prints the answers for increasing values of nps (number of particles
started) to give a sense if the mean is not converging. The mean is the answer. Here we
calculated 1.1274 Rad/hr. This is pretty close to the known value of 1.128. The 1 sigma
standard error is +/- 0.06 %. Usually 10% is acceptable. But then this is a very simple,
very efficient model. The last three columns have to do with convergence and will be
discussed in Chapter LATER.
The second most important output is the “10 Statistical Checks.” There is a
summary table (which appears below.) This is a check designed to detect is the tally is
not converging. If the “passed?” row has ten “yes” that guarantees that MCNP did not
uncover any hints of non-convergence. It does not guarantee that this run of the model
has converged. More on convergence in Chapter LATER.
results of 10 statistical checks for the estimated answer for the tally fluctuation chart
(tfc) bin of tally 6
tfc bin --mean-- -------relative error------- --variance of the variance-- -figure of merit-- -pdf-
behavior behavior value decrease decrease rate value decrease decrease rate value behavior slope
desired random <0.10 yes 1/sqrt(nps) <0.10 yes 1/nps constant random >3.00
observed random 0.00 yes yes 0.00 yes yes constant decrease 7.20
passed? yes yes yes yes yes yes yes yes no yes
=====================================================================================================
The output contains lots of detail. Much of which is needed only when you
realize you need it. (Yes I actually mean that!) The output has lots of good stuff
designed to save you time and prevent you from making stupid mistakes. Here’s a short
list:
Code identification Cross-section tables
Input Echo Problem Summary
Description of source parameters Photon activity by cell
Description of tally parameters Photon weight balances
Material composition Photon activity by nuclide
Cell volumes and masses 10 Statistical Checks
Surface Areas Tally Fluctuation Chart
Physical constants
Take five minutes now and look at each table. We will get more familiar with
output in later chapters.
1.6 Summary
The purpose of this Chapter was to help you:
• Interpret an MCNP input file.
• Setup and run a point source model.
• Interpret dose information from MCNP output.
You have successfully built an input file, run the model, and reviewed the output.
The problem, dose from a photon point source, is very easy to solve in other ways
(measurement, theory, simpler codes etc.) Now that you have run MCNP once
successfully, we will move up a level in subsequent chapters to more complex options in
MCNP, and to describe and model problems that are successively more complex, until
we can begin to handle problems that cannot be solved in any other way.