Professional Documents
Culture Documents
1
Contents
Ex- cathedra approach
◦ Brief introduction
◦ How can I build an MCNP input?
◦ Geometry definition.
◦ Source definition.
◦ Material definition.
◦ Tallies description.
◦ (Variance reduction).
◦ Applications.
◦ Used of Vised2
Personal work.
2
Introduction
Can we calculate this
area??
3
Introduction
MCNP = Monte Carlo N-Particle Transport Code System
MCNP was developed by Group X-5 at the Los Alamos National Lab.
The latest version of MCNP is MCNP6 (combining version 5 and X).
Parallelized versions of MCNP are MCNP PVM & MCNP MPI.
MCNP4C was written in FORTRAN77 while MCNP5 was rewritten in
FORTRAN90.
MCNP can model arbitrary 3D model.
MCNP uses continuous-energy nuclear and atomic data libraries
from ENDF (currently ENDF/B-VI).
Neutron, photon, electron, coupled neutron-photon and coupled
photon-electron problem can be solved.
MCNP has a wide variety of source conditions.
4
Introduction
MCNP can be run in 2 modes
◦ Initiate-run (normal run)
◦ Continue-run (restart run) is used to continue running histories in a problem that
was terminated earlier.
5
Introduction
oCross section directory is determined by “DATAPTH”
MCNP determines where to find data tables for each ZAID (isotope ID)
based on information contained in a system-dependent directory file
“XSDIR”
> 173 isotope cross section libraries are available from MCNP
ZAID ends with ‘c’ = continuous cross section
‘d’ = discrete cross section
‘m’ = multigroup cross section
‘t’ = thermal scattering s(alpha,beta) table
‘p’ = photon cross section
‘e’ = electron cross section
‘y’ = dosimetry cross section
6
Starting to building up MCNP input
1. The geometry specification.
2. The description of materials and selection of cross-section evaluations.
3. The location and characteristics of the neutron, photon, or electron
source.
4. The type of answers or tallies desired.
5. Any variance reduction techniques used to improve efficiency.
◦ lengths in centimeters,
◦ energies in MeV,
◦ times in shakes (10-8 sec),
◦ temperatures in MeV (kT),
◦ atomic densities in units of atoms/barn-cm,
◦ mass densities in g/cm3 ,
◦ cross sections in barns (10-24 cm2 ),
◦ heating numbers in MeV/collision, and
◦ atomic weight ratio based on a neutron mass of 1.008664967 amu.
◦ In these units, Avogadro’s number is 0.59703109 x 10+24 .
7
Introduction: MCNP input structure
An input file has the following form:
Optional Message Block
Blank Line Delimiter
One-line Problem Title Card
Cell Cards
•
•
Blank Line Delimiter
Surface Cards
•
•
Blank Line Delimiter
Data Cards
•
•
Blank Line Terminator (optional)
8
MCNP input sample
Sample Problem Input Deck
c cell cards for sample problem
1 1 -0.0014 -7
2 2 -7.86 -8
3 3 -1.60 1 -2 -3 4 -5 6 7 8
4 0 -1:2:3:-4:5:-6
c end of cell cards for sample problem
BLANK LINE DELIMITER
GEOMETRY DEFINITION C Beginning of surfaces for cube
(cells & surfaces) 1 PZ -5
2 PZ 5
3 PY 5
4 PY -5
5 PX 5
6 PX -5
C End of cube surfaces
7 S 0 -4 -2.5 .5 $ oxygen sphere
8 S 0 4 4.5 .5 $ iron sphere
BLANK LINE DELIMITER
SOURCE DEFINITION IMP:N 1 1 1 0
(energy, geometry, particle, …) SDEF POS=0 -4 -2.5
F2:N 8 $ flux across surface 8
TALLY CARDS
F4:N 2 $ track length in cell 2
(tally type and options)
M1 8016 1 $ oxygen 16
MATERIAL CARDS M2 26000 1 $ natural iron
(composition) M3 6000 1 $ carbon
NPS 100000
9
MCNP Geometry definition
The cells are defined by the
• intersections,
MCNP • unions,
Geometry • complements
of the regions bounded by the surfaces.
10
MCNP Geometry definition
z • MCNP treats geometric cells in a
Cartesian coordinate system.
11
MCNP Geometry definition
Example:
1
2
12
MCNP Geometry definition
Example:
13
14
MCNP Geometry definition
The surfaces are designated by mnemonics such as:
P Plane (General)
PX Plane (normal to the x-axis)
S Sphere (General)
SO Sphere (centered at origin)
C/Y Cylinder (parallel to the y-axis)
CZ Cylinder (axis on the z-axis)
Detailed information: MCNP5 User manual, Chapter 3
Examples
A sphere of radius 3.62 cm with the center located at the point (x,y,z) = (4,1,–3)
j S xyz R
j S 4 1 –3 3.62
A plane normal to the y–axis at y =3
j PY y
j PY 3
Cylinder whose axis on the x-axis and with a radius of 0.215 cm.
j CX R
j CX 0.215
15
MCNP Geometry definition
16
MCNP Geometry definition
Cells are defined on cell cards
17
MCNP Geometry definition
3
3
4 P3
2
P1
5 1
2 6 z
P2
1 y
18
MCNP Geometry definition
A B A B
C C
A:B (A B) = A B = C
union of A and B Intersection of A and B
19
MCNP Geometry definition
20
MCNP Geometry definition
21
MCNP Geometry definition
2
4 Cell 1 1 0 1 2 -3 -4
3 Cell 2 2 0 -1 : -2 : 3 : 4
1
1 or
2
Cell 2 2 0 #1
22
MCNP Geometry definition
2
1
Cell 4: 4 0 #3 #2 #1
4 Cell Number
23
C Beginning of surfaces for cube
Exercise 1 1 PZ -5
2 PZ 5
3 PY 5
4 PY -5
Sample 1: 5 PX 5
6 PX -5
•Copy this input in a text file
C End of cube surfaces
•Use Vised to visualize the geometry
•Explain the geometry 7 S 0 -4 -2.5 .5 $ oxygen sphere
8 S 0 4 4.5 .5 $ iron sphere
Sample Problem Input Deck
c cell cards for sample problem IMP:N 1 1 1 0
1 1 -0.0014 -7 SDEF POS=0 -4 -2.5
2 2 -7.86 -8 F2:N 8 $ flux across surface 8
3 3 -1.60 1 -2 -3 4 -5 6 7 8 F4:N 2 $ track length in cell 2
4 0 -1:2:3:-4:5:-6 E0 1 12I 14
M1 8016 1 $ oxygen 16
c end of cell cards for sample problem
M2 26000 1 $ natural iron
M3 6000 1 $ carbon
NPS 100000
24
Vised view of the geometry
Example
XY view
25
MCNP Geometry definition: macrobodies
Macrobodies
BOX Arbitrarily oriented orthogonal box
RPP Rectangular Parallelepiped
SPH Sphere
RCC Right Circular Cylinder
RHP or HEX Right Hexagonal Prism
REC Right Elliptical Cylinder
TRC Truncated Right-angle Cone
ELL Ellipsoid
WED Wedge
ARB Arbitrary polyhedron
26
MCNP Geometry definition: macrobodies
27
MCNP Geometry definition: macrobodies
28
MCNP Geometry definition: macrobodies
29
MCNP Geometry definition: macrobodies
30
MCNP Geometry definition: macrobodies
REC: Right Elliptical Cylinder
REC Vx Vy Vz Hx Hy Hz V1z V1y V1z V2x V2y V2z
where
Vx Vy Vz = x,y,z coordinates of bottom cylinder
Hx Hy Hz = cylinder axis height vector
V1x V1y V1z = 2 ellipse major axis vector (normal to Hx Hy Hz)
V2x V2y V2z = ellipse minor axis vector (orthogonal to H and V1)
Example: REC 0 -5 0 0 10 0 4 0 0 0 0 2
A 10-cm high elliptical cylinder about the y-axis with the center of the base at x,y,z = 0,-
5,0 and with major radius 4 in the x-direction and minor radius 2 in the z-direction.
31
MCNP Geometry definition: macrobodies
33
MCNP Geometry definition: macrobodies
WED: Wedge
WED Vx Vy Vz V1x V1y V1z V2x V2y V2z V3x V3y V3z
where
Vx Vy Vz = vertex
V1x V1y V1z = vector of first side of triangular base
V2x V2y V2z = vector of second side of triangular base
V3x V3y V3z = height vector
A right-angle wedge has a right triangle for a base defined by V1 and V2 and a height of
V3. The vectors V1, V2, and V3 are orthogonal to each other.
Example: WED 0 0 -6 4 0 0 0 3 0 0 0 12
A 12-cm high wedge with vertex at x,y,z = 0,0,-6. The triangular base and top are a right triangle with
sides of length 4 (x-direction) and 3 (y-direction) and hypotenuse of length 5.
34
MCNP Geometry definition: macrobodies
Use of wedge in radiotherapy
Wedges:
◦ System used in radiotherapy to
modify the profiles and the depth
dose of a beam
◦ Made in brass, lead, tungsten
35
MCNP Geometry definition: macrobodies
Geometry definition using both macrobodies and “normal” structure
36
MCNP Geometry definition: macrobodies
37
Exercise 2
Sample 2:
38
Vised view of the geometry
Example
XY view
Rem: Each created surface can be used as a normal one to define other cel
39
MCNP Geometry definition: Repeated structures
Repeated Structures
40
MCNP Geometry definition: Repeated structures
Repeated Structures
Cards:
The universe card, the U card, is used to specify to what universe
the cell belongs.
The fill card is used to specify with which universe a cell is to be
filled.
The lattice card, the LAT card, is used to define an infinite array of
hexahedra or hexagonal prisms. The order of specification of the
surfaces of a lattice cell identifies which lattice element lies
beyond each surface.
The “LIKE m BUT” feature is a shorthand making it possible to make
one cell equivalent to another except for assorted attributes that
can be specified with keyword=value entries.
The TRCL card makes it possible to define only once the surfaces
that bound several cells identical in size and shape but located at
different places in the geometry. It follows the transformation
rules established for the TR card.
41
MCNP Geometry definition: Repeated structures
42
MCNP Geometry definition: Repeated structures
43
MCNP Geometry definition: Repeated structures
44
MCNP Source definition
MCNP’s generalized user-input source capability allows the user to specify a
wide variety of source conditions without having to make a code
modification.
Independent probability distributions may be specified for the source
variables of energy, time, position, and direction, and for other parameters
such as starting cell(s) or surface(s).
Source variables may depend on other source variables (for example, energy
as a function of angle) thus extending the built-in source capabilities of the
code.
Certain built-in functions are available.
45
MCNP Source definition
46
MCNP Source definition
ERG the energy of the particle (MeV). See .below
TME the time when the particle started (shakes)
UUU, VVV, WWW the direction of the flight of the particle
XXX, YYY, ZZZ the position of the particle
IPT the type of the particle
WGT the statistical weight of the particle
ICL the cell where the particle started
JSU the surface where the particle started, or zero if the starting
point is
not on any surface
Additional variables may have to be defined if there are point detectors or DXTRAN
spheres in the problem.
Use: Required for problems using the general source and optional for problems
using the criticality source.
47
MCNP Source definition
Variable Meaning Default
CEL Cell Determined from XXX, YYY, ZZZ
and possibly UUU, VVV, WWW
SUR Surface Zero (means cell source)
ERG Energy (MeV) 14 MeV
TME Time (shakes) 0
Volume case: m is sampled uniformly in
DIR m, the cosine of the angle -1 to 1 (isotropic)
between VEC and
UUU, VVV, WWW Surface case: p(m) = 2m in 0 to 1
(cosine distribution)
Volume case: required unless isotropic
VEC Reference vector for DIR Surface case: vector normal to the
surface with sign determined by NRM
POS Reference point for 0, 0, 0
position sampling
WGT Particle weight 1
48
MCNP Source definition
c Source definition card
SDEF ERG=0.661 POS= 0 0 0 VEC=0 0 1 PAR=2 Dir=D2
SI2 0.98 1
SP2 D 0 1 PAR identifies the type of particle:
MODE P
PAR = 1→ neutrons
c End Source definition card PAR = 2 → photons
c PAR = 3 → electrons
c Tallies
c
F8:P 1004
E8 0 0.0001 0.001 700I 0.7
c End Tallies
49
MCNP Source definition
8
10
y
y 40
x
z
SDEF ERG=1.0 PAR=2 POS=0 0 0 AXS=0 0 1 RAD=d1 SDEF ERG=1.0 PAR=2 POS=0 0 0 AXS=0 0
EXT=d2 1 RAD=d1
SI1 0.2 1 SI1 0 0.8
SI2 -2 2 SP1 -21 4
Cylindrical-volume source:
PAR=2 → photons Spherical-volume source:
POS= 0 0 0 → Reference point inside the cylinder PAR=2 → photons
AXS= 0 0 1 → Direction of cylinder axis. POS= 0 0 0 → Reference point inside the sphere
RAD= d1 → An uniform radial distribution between AXS= 0 0 1 → reference direction for particle
radius=0.2 and radius=1.0 cm (referred to POS). Information on RAD= d1 → An uniform radial on all the
EXT=d2 → An uniform axial distribution between -2 and sphere
+2 cm (referred to POS). Probability on RAD=d1 → power law distribution.
50
MCNP Source definition
c Source definition card
DIR means the cosine between
SDEF ERG=0.661 POS= 0 0 0 VEC=0 0 1 PAR=2 Dir=D2 direction of flight of particles
and a reference direction (VEC).
SI2 0.98 1
SP2 0 1
If DIR is defined as a distribution,
MODE P particles are generated inside a
solid angle defined by cos α.
c End Source definition card
c
c Tallies
c
F8:P 1004 Cos α = DIR
c End Tallies
c
51
MCNP Source definition
SIn: Source Information Card
▪omitted, or
▪H: bin boundaries for a histogram distribution, for scalar variables only. This is
the default.
▪L: discrete source variable values
▪A: points where a probability density distribution is defined
▪D: distribution numbers
Default: SIn H I1 … Ik
52
MCNP Source definition
SPn: Source Probability card
53
MCNP Source definition: Special functions
54
MCNP Tally
55
MCNP Tally
The tallies are identified by tally type and particle type as follows.
Tallies are given the numbers 1, 2, 4, 5, 6, 7, 8, or increments of 10 thereof, and
are given the particle designator :N, :P, or :E (or :N,P only in the case of tally type
6 or :P,E only in the case of tally type 8).
56
MCNP Tally: example
c Source definition card
Tally
SDEF ERG=0.661 POS= 0 0 0 VEC=0 0 1 PAR=2 Card
Dir=D2
SI2 0.98 1 ▪ Tally F8: Pulse Height Distribution
SP2 D 0 1 (useful for simulating detector
responses)
MODE P ▪ E8 is an energy discretization:
c End Source definition card
▪ 0 0.0001 0.001 700I 0.7
c
c Tallies
c 1 energy bin 700 energy bins of 1 keV
F8:P 1004 up to 700 keV
E8 0 0.0001 0.001 700I 0.7
c End Tallies
c
57
Tallies used for dose evaluation
1
V
Or: V = dE dt dsN (r , E , t )
Tl
Using MCNP5: F 4 = W
V
men
Evaluation du Kerma using DE DF cards; v E
K =
E E
58
Tallies used for dose evaluation (2)
F8 : pulse height
F6 : Energy deposit within a distribution
cell along a track
Energy deposition par mass distribution of pulses
unit (Ht en MeV/g) created in a volume (a cell)
considered as a detector
a ˆ , E, t )
Ht =
m dE dt dV d ( E ) H ( E ) (r ,
t
*F8 evaluate the total
energy deposit by
In MCNP5 multiplying each energy bin
by the corresponding
H ( E ) = E − pi ( E ) Ei ,out ( E )
i weight (in MeV)
*F8: P,E
Rem: only F6: P
59
MCNP Tally
MESH TALLY F4 Just in MCNP5 or 6!
Superimposed a grid on the geometry in a given space. F4 is
calculated in each voxel created
Allow to make a surface distribution of flux, dose…
Example:
FMESH4:P GEOM=XYZ ORIGIN= -4.0 +3.25 -3.3 iMESH +4.0
IINTS 80 JMESH +3.75 JINTS 5 KMESH 4.7 KINTS 80 OUT= IK
Means
• Create a grid in volume (x from –4cm to +4 cm, y from
+3.25cm to +3.75 cm, z from -3.3cm to +4.7 cm)
• 80 intervals in x, 5 interval in y , 80 intervals in z
• Output: table of 80*80 (x, z) result for the 5 y-layer defined
60
MCNP Tally: example of output for FMESH4
t
61
Mode cards: IMP cards
MODE
x i =N for neutron transport
P for photon transport
E for electron transport
Default: If the MODE card is omitted, MODE N is
assumed.
Use: A MODE card is required unless MODE N. The
entries are space delineated.
x1 …xi
63
Mode cards: VOL cards
VOL Cell Volume Card
Form: VOL x1 x2 xi
or: VOL NO x1 x2 xI
xi = volume of cell i where i 1, 2, ... number of cells in the
problem.
NO = no volumes or areas are calculated.
Default: MCNP attempts to calculate the volume of all cells
unless “NO” appears on the VOL card. If no value is entered
for a cell on the VOL card, the calculated volume is used.
With the VOL card, if the number of entries does not equal
the number of cells in the problem, it is a FATAL error. Use
the nJ feature to skip over cells for which you do not want to
enter values.
The entry NO on the VOL card will bypass the volume
calculation.
64
Mode cards: AREA cards
65
MCNP material: example
c
c Material cards
m1 82000 -11.4 $ Lead
m2 13000 -2.702 $ Aluminium
m3 6000 -0.000125 7000 -0.755267 8000 -0.231781 18000 -0.012827 $ Air
m4 32000 -5.323 $ Germanium Mn Material Card
m5 1000 -0.08 6000 -0.60 8000 -0.32 $ pmma
This is usually specified as an integer value
ZZZAAA where ZZZ is the atomic number and
m6 4000 -1.848 $ Berillium AAA is the atomic mass number or zero for a
c End Material cards natural element.
NPS 30000000
▪ Form: Mn ZAID1 fraction1 ZAID2 fraction2
67
Outpout file
Contains different information’s:
◦ Information’s given in the input file
◦ Summary of the cell definition
◦ Information’s about the random number
generator
◦ Cross section tables used for the different
materials
◦ Summary of the code’s run
◦ Particles balance and interactions
68
Outpout file (continue)
◦ Results, defined by the tally (tallies) choice
◦ Information about the particle populations in
each cell
◦ Information’s about statistical check test
69
MCNP personal exercise
We want to simulate with MCNP the use of a HP Germanium detector for measurements.
Dimensions are defined in the figure. Two different cases are considered:
◦ A point source of Co-60 centered on the detector axis, at 10 cm distance from the window
Or
◦ A volume source (a bottle of 7.2 cm diameter and 12 cm height) fill with water containing KCl
placed on the window of the detector and centered on the detector axis
Consider 4096 bins of energy on 2,5 MeV for the Co-60 and for the K-40; first bin of 0.1 keV
Plastic composition: 86% weight C and 14% weight H. Density: 0.92 g/cc
Cu: density 8.96 g/cc
Ge: density 5.32 g/cc
You can create the file with the help of Vised and I will execute your
code.
MCNP cannot be installed on your computer, Vised is installed on the
computer of the lab but will be removed after
70
MCNP simulation of Ge detector
measurement
Distance active face-entrance window: 0.5 cm
Detector: Entrance:
•Pure Ge •0.1 cm plastic cap
•Radius: 3.005 cm •End cap diam: 6.5
•Length: 6.1cm
•Death layer
•Active face: 0.005 cm
•Side face: 0.05 cm
Inner contact:
•In copper
•Radius: 0.4 cm
•Length: 4 cm
71
Things to remember for building an MCNP input
72
Structure of the final report
Introduction on MCNP
◦ Some reminders about the interest of MC Code (and
specially MCNP) in this kind of problem
◦ Explanation of the two input files (for point source and
for volume source)
◦ how do you built it? How do you choose surfaces and volumes.
What Tally fit your problem
Interpretation of the results obtained by the run:
◦ what kind of output?
◦ Use a graph to show the results
◦ Are these results coherent with the knowledge you have
on this kind of source?
◦ Are the results “trustable” in a statistic point of view?
Conclusion
73
MCNP: other cards
SSW cards
SSW S1 S2(C1 Ck) S3 Sn keyword=values
Si = problem surface number, with the appropriate sense of inward or outward particle direction, for
which particle-crossing information is to be written to the surface source file WSSA. Macrobody
surfaces are not allowed.
Ci = problem cell number.
A positive entry denotes an other-side cell.
A negative entry specifies a just-left cell.
SYM m symmetry option flag
m = 0, no symmetry assumed.
m = 1, spherical symmetry assumed. The list of problem surface numbers must contain only
one surface and it must be a sphere.
m = 2, write particles to a surface bi-directionally. Otherwise, only particles going out of a
positive surface and into a negative surface are recorded.
PTY n1 n2 ... tracks to record, blank delimited (absent = record all tracks. This is the default).
ni = N, record neutron tracks
P, record photon tracks
E, record electron tracks
CEL C1 C2 Cn
list of names of all the cells from which KCODE fission source neutrons are to be
written, active cycles only.
Default: SYM=0PTY absent=record all particle types
Use: Optional, as needed.
During execution, surface source information is written to the scratch file WXXA.
Upon normal completion, WXXA becomes WSSA.
If the run terminates abnormally, the WXXA file will appear instead of WSSA and must be saved along
with the RUNTPE file.
The job must be continued for at least one more history. At the subsequent normal termination,
WXXA disappears and the correct surface source file WSSA is properly written.
74
MCNP: other cards
SSR (Surface Source Read) Card
OLD S1 S2 ... Sn
list of problem surface numbers, a subset of the surfaces on the SSW card that created the file WSSA, now called RSSA.
CEL C1 C2 ... Cn
like OLD but for cells in which KCODE fission neutrons or photons were written
NEW S11 S12 ... S1n S21 S22 ... S2n ... Sm1 Sm2 ... Smn
List of problem surface numbers upon which the surface source is to start particles in this run.
For m=1, each particle written from surface Si in the OLD list will start on surface S1i.
For m>1, each particle written on surface Si in the OLD list will start on one of the surfaces Sji , j=1, ... ,m,
where j represents one of the m transformations determined by TR = Dn described below.
PTY n1 n2 ... tracks to read, blank delimited
absent = read all tracks for the particle types in the problem. This is the default.
ni = N, read neutron tracks
P, read photon tracks
E, read electron tracks
COL m collision option flag
m = -1, start from the surface source file only those particles that came directly from the source without a collision
m = 1, start from the surface source file only those particles that had collisions before crossing the recording surface
m = 0, start particles without regard to collisions
WGT x Each particle weight is multiplied by the constant x as it is accepted for transport.
TR n Transformation number.
Track positions and velocities are transformed from the auxiliary coordinate system (the coordinate system of the
problem that wrote the surface source file) into the coordinate system of the current problem, using the
transformation on the TRn card, which must be present in the INP file of the current problem. For each surface Si in the
OLD list, a corresponding surface S1i must appear in the NEW list such that TRn transforms the coordinates of a
particle written from Si to be on surface S1i in the current problem. However, if the surfaces S1i are “dummy” surfaces
not used in constructing the real geometry, then the transformed source will effectively be treated as a volume source
not specifically defined to be on any surface.
75