22.12.2012 Views

MCNPX Wilson

MCNPX Wilson

MCNPX Wilson

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

An introduction to MCNP/<strong>MCNPX</strong><br />

Adelaide<br />

20 June 2011<br />

Dr. Puthenparampil <strong>Wilson</strong><br />

Senior Medical Physicist (Royal Adelaide Hospital, Adelaide)<br />

Senior Lecturer (University of South Australia, Adelaide)<br />

Associate Fellow (PTCRi, Oxford)<br />

1


A. Overview of <strong>MCNPX</strong><br />

B. Input deck format<br />

Contents<br />

C. Installation and running the code<br />

D. Applications in particle therapy<br />

2


Overview and introduction<br />

3


<strong>MCNPX</strong>- Introduction<br />

� A General Monte Carlo N- Particle transport code<br />

� Capable of tracking photons, electrons , light ions and heavy ions<br />

� 3D tracking<br />

� Wide range of energies ( keV- GeV )<br />

� Written in FORTRAN 90<br />

� Platforms: Unix, Linux, WINDOWS, OS X<br />

4


<strong>MCNPX</strong>- Introduction<br />

� Capable of tracking 35 particle type<br />

� Including 4 light ions and heavy ions (He, B,C O etc..)<br />

� Wide energy range<br />

� Photons (keV- GeV)<br />

� Electron (keV- GeV)<br />

� Protons (MeV- GeV)<br />

5


� Applications of <strong>MCNPX</strong><br />

� Medical physics<br />

� Particle therapy<br />

� Nuclear Medicine<br />

<strong>MCNPX</strong>- Introduction<br />

� Radiation protection and dosimetry<br />

� Nuclear criticality studies<br />

� Accelerator target design<br />

� Fission and Fusion reactor design<br />

� Radiation shielding<br />

6


<strong>MCNPX</strong>- History<br />

� Started the development at Los Alamos National Laboratory more<br />

than 60 years ago<br />

� 1991- MCNP 4<br />

� 2003 - MCNP 5<br />

� 2011- <strong>MCNPX</strong> 2.7.0 (Monte Carlo N-Particle Transport Code eXtended)<br />

� <strong>MCNPX</strong> 2.7.0 is the current public release<br />

� MCNP6 beta version<br />

7


<strong>MCNPX</strong>- Where can you get it?<br />

� Distributed by Radiation Safety Information Computational Centre<br />

(RSICC), Oak Ridge, US<br />

� http://rsicc.ornl.gov/CustomerService.aspx<br />

� Executables, source code and data are available<br />

� Cost- Free?(https://laws.lanl.gov/vhosts/mcnp.lanl.gov/ )- check<br />

with RSICC<br />

� Distribution is restricted –subjected to export control<br />

8


<strong>MCNPX</strong>- Advantages<br />

� Well established Monte Carlo code<br />

� Accurate model of particle transport<br />

� Requires no programming knowledge ..!☺<br />

� Initial learning curve is not steep<br />

� Can be used for large range of energies<br />

� Single input data file<br />

9


<strong>MCNPX</strong>- Disadvantages<br />

� Interface may not be great, especially for complex problems<br />

� Geometry input is difficult by the requirement to refer to objects<br />

by number<br />

� Basic text output- input deck is very specific<br />

� Distribution of the code is restricted<br />

10


<strong>MCNPX</strong> input file deck<br />

11


<strong>MCNPX</strong>- Input file<br />

� User generated input file is read by <strong>MCNPX</strong><br />

� Single input file<br />

� Format of input file is very specific<br />

� File consists of information on:<br />

� Radiation sources<br />

� Material description<br />

� Geometry of the problem<br />

� Types of results (tallies) required from simulation etc.<br />

12


<strong>MCNPX</strong>- Input file<br />

� Basic units used in <strong>MCNPX</strong><br />

� Length-cm<br />

� Energy- MeV<br />

� Time- sec<br />

� Temperature- kT<br />

� Atomic density- atoms/barn-cm<br />

� Mass density- g/cm 3<br />

� Cross section- barns (10- 24 cm 2 )<br />

13


<strong>MCNPX</strong>- Input file<br />

� Input file consists of 3 major sections<br />

1. Cell cards- define the shape and material content of physical space of the problem<br />

2. Surface Cards –defines the boundaries in space used to create cells (cylinder, sphere etc.)<br />

3. Data cards – defines problem type, source specification, materials, tally specification etc.<br />

� “Card” describes single line of input that can consists of up to 80 character<br />

� A “sections” consists of one or more cards<br />

14


<strong>MCNPX</strong>- Input file<br />

General Format<br />

Message block<br />

Blank line Delimiter<br />

Title card<br />

Cell card block<br />

.<br />

.<br />

Blank line delimiter<br />

Surface Card block<br />

.<br />

.<br />

Bank Line Delimiter<br />

Data Card block<br />

.<br />

.<br />

optional<br />

� <strong>MCNPX</strong> interprets blank line as the end of preceding information block<br />

� $ sign terminate data entry, anything follows is interpreted as a comment<br />

� If the first five columns of a card are blank, the entries on the card are<br />

interpreted as a continuation of the data from he last named card<br />

15


<strong>MCNPX</strong>- Input file – Cell cards<br />

� Cells are basic geometry unit<br />

� Cartesian co-ordinate system<br />

� Cells are defined as volumes of space bounded by surfaces<br />

� Surfaces are used to define space by combining<br />

� Sign defines surface ‘sense’ (+/-)<br />

� Variable operators- Intersections (‘space’), Union (‘:’) or complement (‘#’)<br />

16


<strong>MCNPX</strong>- Input file- Cell Cards<br />

� Cell cards- define the shape and material content of physical space of the problem<br />

� The specific cell card format<br />

j m d geom params<br />

j -cell number, an integer from 1 to 999999<br />

m - material present in a particular cell, an integer from 1 to 99999 or 0 if the cell is a<br />

void<br />

d - cell material density, a positive entry is interpreted as atomic density in units of<br />

atoms/barn-cm, a negative entry is interpreted as the mass density in units of g/cm 3 .<br />

geom – specification of geometry of the cell. Boolean operators in conjunction with<br />

signed surface numbers to describe how the regions bounded by the surfaces<br />

are to be combined.<br />

params- optional importance card<br />

17


<strong>MCNPX</strong>- Input file- Cell Cards<br />

� Cell card format example<br />

2 1 -1 -1 imp:p=1<br />

2 ���� cell number<br />

1 ���� material number<br />

-1 ���� density (in g/cc)<br />

-1 ���� cell 2 is bounded only by surface 1. surface 1 will be defined in the<br />

surface card section. Negative sign indicates that cell 2 has a negative<br />

sense with respect to surface 1.<br />

imp:p=1 ���� importance card for protons. imp:p=0 will terminate particle, normally<br />

used outside simulation cell<br />

18


<strong>MCNPX</strong>- Input file- Cell Cards<br />

� Cell card format-description of cells -another example<br />

1 +1 -2 +3 -4<br />

2 #1<br />

#1 means that the description of the current cell is the complement of the description<br />

of cell 1.<br />

y<br />

surface 1<br />

X<br />

surface 4<br />

Cell I<br />

surface 3<br />

surface 2<br />

Cell II<br />

19


<strong>MCNPX</strong>- Input file- Surface cards<br />

� Surface card- defines the boundaries in space used to create cells<br />

� Surface card – general format<br />

j a list<br />

j ���� surface number (1-99999)<br />

a ����surface type (e.g. cz- infinite cylinder centred on z axis,)<br />

list ���� number that describe the surface (e.g. radius of a sphere)<br />

20


<strong>MCNPX</strong>- Input file- Surface cards<br />

� surface card format- example<br />

100 so 60<br />

100 ���� surface number<br />

so ���� sphere centred at origin<br />

60 ���� 60cm radius<br />

21


<strong>MCNPX</strong>- Input file- Surface cards<br />

22


<strong>MCNPX</strong>- Input file- Data cards<br />

� Data Cards- defines problem type, source specification, materials, tally specification etc.<br />

� Format is similar to cell card and surface card<br />

� Some important data cards relevant to medical physics include:<br />

• Material card<br />

• MODE card<br />

• Importance card<br />

• Source<br />

• Tallies<br />

• Cut-off’s etc.<br />

23


<strong>MCNPX</strong>- Input file- Data cards-Material card<br />

� Material Card format<br />

mn ZAID1 fraction1 ZAID2 fraction2<br />

mn ���� material card number (m) followed by the material number<br />

ZAID ���� element identifier, ZZZAAA where ZZZ- atomic number, AAA-mass number<br />

fraction ���� fraction of the material/nuclide. Positive value indicates atomic fraction,<br />

negative indicates weight fraction<br />

24


<strong>MCNPX</strong>- Input file- Data cards-Material card<br />

� Material Card example- water (H 2 O)<br />

m1 1001 2 8016 1<br />

m1 ���� material number<br />

1001 ���� Hydrogen<br />

2���� atomic fraction<br />

8016 ���� Oxygen<br />

1 ���� atomic fraction<br />

25


<strong>MCNPX</strong>-Input file- Data cards- Source definition<br />

� General format<br />

SDEF source variable=specification<br />

SDEF ���� most commonly used in medical physics calculations. Often<br />

we use other three cards with SDEF, Source Information (SI),<br />

Source probability (SP) and Source Bias (SB) cards.<br />

source variable���� commonly used variables- CEL(cell number),SUR (surface<br />

number), ERG(energy-MeV), POS(reference point ),PAR<br />

(particle type from source),X-x coordinate of position, AXS-<br />

(reference vector) etc..(TABLE 5.5.1 in manual)<br />

26


<strong>MCNPX</strong>-Input file- Data cards- Source definition<br />

� source definition card example- Isotropic disc source of radius 5 cm<br />

emitting 1.2MeV photons<br />

SDEF par=2 erg=1.2 sur=101 pos=0 0 0 rad=d1<br />

SI H 0 5<br />

SP1 -21 1<br />

par 2, erg=1.2 ����particle type photons, energy 1.2 MeV<br />

sur ���� surface number on which the source is placed<br />

pos ���� position of the centre of the disc<br />

rad=d1 ���� radius of the source is defined as a distribution<br />

SI H 0 5 ���� H indicates the source distribution is a histogram<br />

SP1 ����card distribute the source evenly across the disc surface using -21,which is a<br />

built in power law function<br />

27


<strong>MCNPX</strong>- Data cards- Source definition<br />

28


<strong>MCNPX</strong>- Input-Data cards- MODE card<br />

� MODE card specifies which particle should be created and tracked<br />

MODE p1 1 ,…p1 i<br />

P1����particle designator.<br />

e.g. MODE N H E will transport neutrons, protons and electrons<br />

29


<strong>MCNPX</strong>- Input-Data cards- PHYS card<br />

� PHYS- Particle physics options. Proton physics format<br />

PHYS:H emax ean tabl J istrg J recl J J J efac<br />

emax ���� maximum proton energy limit<br />

ean ���� analogue energy limit,<br />

tabl ���� table based physics cut-off,<br />

J����unused place holder<br />

istrg ���� controls charged particle straggling<br />

recl ���� light ion and heavy ion recoil control account for the ionisation potential<br />

efac ���� controls stopping power energy spacing<br />

e.g. PHYS:H 100 0 -1 J 0 J 0 3J 0.917<br />

30


<strong>MCNPX</strong>- Input- Data cards-Tally specification<br />

� Tally card- specify what type of information user wants to gain from the<br />

calculation . e.g. flux at a point, average energy deposition over a cell, etc.<br />

� General format<br />

Fn p1 s1,s2 …., T<br />

n���� tally number.<br />

p1���� particle designator- N,P, E<br />

s1 ���� problem number of surface or cell for tallying<br />

T ���� total over specified surface or cells for F1and F2 tallies<br />

31


<strong>MCNPX</strong>- Input- Data cards-Tally specification<br />

• Tally card- example<br />

F2:N 1 3 6 T<br />

• F2 is the flux averaged over a surface<br />

• Above card specifies four neutron flux tallies, one across each of the<br />

surfaces 1,3, 6 and one which is the average of the flux across all three of<br />

the surface, T<br />

32


<strong>MCNPX</strong>-Input- Data cards- Tally specification<br />

� TMESH- The Mesh Tally general format<br />

TMESH CORAn CORBn CORCn ERGSH MSGMF RMESH CMESH SMESH ENDMD<br />

• TMESH- Graphically displaying particle flux, dose or other quantity on a<br />

rectangular, cylindrical or spherical grid overlaid on top of the standard<br />

problem geometry<br />

• Mesh tally data are written to the MDATA file at the end of each run, which<br />

can be converted into a number of standard formats suitable for reading by<br />

various graphical analysis package<br />

• CORAn,CORBn and CORCn cards describe a mesh in three co-ordinate<br />

direction as defined by mesh type e.g. CORA3 0 10i 20 for a<br />

rectangular mesh, the values define planes perpendicular to the x-axis. i<br />

enables a large number of regularly spaced mesh points to be defined with<br />

minimum entries<br />

• ERGSHn e1 e2- lower and upper energy limits for information to be<br />

stored to mesh tally n. Default –all energies<br />

• RMESH- rectangular mesh, CMESH- cylindrical mesh, SMESH- Spherical<br />

mesh<br />

• ENDMD- terminate mesh tally<br />

33


<strong>MCNPX</strong>- Processing Mesh Tally Results<br />

� Mesh tallies may be plotted with <strong>MCNPX</strong> geometry plotter.<br />

• <strong>MCNPX</strong> Z<br />

• MCPLOT>RUNTPE=filename<br />

• MCPLOT<br />

• PLOT>py 4 ex 40 or 0 4 0 la 0 0 tall2 color on la 0 0 con 0 100%<br />

� Or use <strong>MCNPX</strong> tally plotter<br />

• <strong>MCNPX</strong> Z<br />

• MCPLOT>RMCTAL=filename<br />

• Tal 12 free ik<br />

� Or post process the MDATA (MCTAL) file with GRIDCONV and then use and external<br />

package. GRIDCONV converts the data arrays in MDATA to form compatible with<br />

various external graphics package e.g. IDL,GNUPLOT, PAW etc..<br />

A useful programme: A Matlab code to import the mesh tally information contained in an <strong>MCNPX</strong><br />

mdata file (http://www.ptcri.ox.ac.uk/people/DanielWarren/ReadMData.shtml )<br />

34


<strong>MCNPX</strong> installation<br />

35


<strong>MCNPX</strong>- installation and running the code<br />

� Installation is simple for executable files<br />

� For Windows, unzip the files, create folders, place the files in the right folders…<br />

(Manual Sec 3- for details and other platforms)<br />

� Download and install an X-Server or similar software for graphics<br />

� <strong>MCNPX</strong> Execution line;<br />

� <strong>MCNPX</strong> KEYWORD=value….KEYWORD=value execution_option<br />

other_options<br />

� KEYWORD- <strong>MCNPX</strong> default filename. User may assign a specific value (file name or<br />

path), execution_option is a character or string of character informs <strong>MCNPX</strong> which<br />

of five execution modules to run, other_ option provide the user with additional<br />

execution control<br />

More Info: User Manual or http://mcnpx.lanl.gov/opendocs/installation/README.w32<br />

36


<strong>MCNPX</strong>- Installation and running the code<br />

37


<strong>MCNPX</strong>- Related software<br />

� The Visual Editor for <strong>MCNPX</strong><br />

� (http://www.mcnpvised.com/mcnpx/mcnpx.html)<br />

� Included with <strong>MCNPX</strong> 2.6 or higher.<br />

� Can be used to display, surface creation/cell creation etc.<br />

� Some detailed examples can be found in<br />

http://www.mcnpvised.com/sample_exercises/exercises/create.pdf<br />

38


<strong>MCNPX</strong>- Related software<br />

� MORITZ(http://www.whiterockscience.com/moritz.html)<br />

� Interactive geometry editor/view for <strong>MCNPX</strong><br />

� Read output from <strong>MCNPX</strong> and can visualise geometry and particle tracks in<br />

2D and 3D,write input files<br />

� SABRINA (http://www.whiterockscience.com/sabrina/sabrina.html)<br />

� Scan2MCNP (http://www.whiterockscience.com/scan2mcnp/Scan2MCNP.html )<br />

converts CR,MRI and other scan data to an input file<br />

� Codes may not be free.<br />

39


MCNP/<strong>MCNPX</strong>- Some useful literature<br />

1. <strong>MCNPX</strong> user manual- http://mcnpx.lanl.gov/documents.html<br />

2. Medical Physics Calculations with MCNP: A primer, Masters Thesis by Alexis Reed<br />

(http://mcnp-green.lanl.gov/pdf_files/la-ur-07-4133_mp-primer.pdf )- dose from 99m Tc<br />

therapy, calculation of Medical Internal Radiation Dose (MIRD) specific absorbed fraction values using<br />

ORNL MIRD phantom, x-ray phototherapy effectiveness, prostrate life time dose calculations, and<br />

radiograph of the head using the ZUBAL head phantom<br />

3. An MCNP primer, J K Shultis et<br />

al.,(http://web.utk.edu/~rpevey/public/NE406/MCNP%20primer.pdf )<br />

4. Varian 2100C photon beam and dose delivery ,Masters thesis by Jared<br />

Hoover(http://smartech.gatech.edu/jspui/bitstream/1853/16245/1/hoover_jared_s_20070<br />

8_mast.pdf )<br />

5. Voxel phantom setup in <strong>MCNPX</strong> by V Taranenko, M Zankl, H Schlattl<br />

6. <strong>MCNPX</strong> network (http://mcnpx.net/ )<br />

40


<strong>MCNPX</strong> –Applications in particle therapy<br />

41


<strong>MCNPX</strong>- Applications in particle therapy<br />

� Large increase in particle therapy centres world wide<br />

� Particle therapy is still not completely optimised<br />

� Uncertainties in particle range, especially for tissue inhomogenity and interface<br />

� <strong>MCNPX</strong> has got wide applications in particle therapy<br />

� Can be used for dose deposition, accurate range estimation<br />

� Useful for Carbon ion therapy calculation also<br />

42


<strong>MCNPX</strong>- Proton pencil beam simulation<br />

A sample input deck- Proton pencil beam dose deposition in water<br />

1-<br />

2-<br />

3- Proton pencil beam simulation in water $optional title card<br />

4- C<br />

5- C ***********************************************************<br />

6- C CELL CARDS<br />

7- C ***********************************************************<br />

8- 1 1 -1 -1 IMP:P=1 $cell num, material num, density, surface no, relative cell importance<br />

9- 3 0 -99 1 IMP:P=1 $ $bounding box for problem - cell 3 - void<br />

10-<br />

11-<br />

99 0 99 IMP:P=0 $ void outside bounding box<br />

12- C ***********************************************************<br />

13- C SURFACE CARDS<br />

14- C ***********************************************************<br />

15- 1 RPP 0 30 -8 8 -8 8 $RPP-rectangular parallel piped, RPP Xmin Xmax Ymin Ymax Zmin Zmax<br />

16-<br />

17-<br />

99 RPP -15 45 -16 16 -16 16<br />

18- C **********************************************************<br />

19- C DATA CARDS<br />

20- C **********************************************************<br />

21- C ------ MATERIAL CARDS ------<br />

22- M1 1001 2 8016 1 $ 1001-hydrogen, 2 atomic fraction, 8016-oxygen<br />

23- C<br />

24- C<br />

25- C --------MODE CARD-----<br />

26- MODE H E P $ specifies what particles might be created and tracked<br />

27- CUT:H J 1 $ cut off value for proton<br />

28- CUT:E J 1 $ cut off value for electron<br />

29- CUT:P J 1 $ cut off value for photon<br />

30- PHYS:H 400 0 -1 J 0 J 0 $ proton physics format<br />

43


<strong>MCNPX</strong>- Proton pencil beam simulation<br />

A sample input deck<br />

31- C<br />

32- C ------- SOURCE DEFINITION------<br />

33- SDEF X=-5 AXS=1 0 0 EXT=0 Y=d1 Z=d2 DIR=1 VEC=1 0 0 PAR=H ERG=200 $SDEF source definition<br />

34- SP1 -41 1.1774 0 $distribution uses FWHM = 2root(2*ln2) of sigma.SP1-source probability,-41<br />

is for Gaussian. distribution uses 0.70645 width of FWHM, 0 is the mean,<br />

FWHM = 2root(2*ln2) of sigma, X-x coordinate of position, AXS-reference<br />

vector, refer Table 5.5.1 in manual<br />

35- SP2 -41 1.1774 0 $distribution uses FWHM = 2root(2*ln2) of sigma<br />

36- C<br />

37- C ------MESH TALLY CARDS-------<br />

38- TMESH $TMESH- Energy Deposition Mesh Tally<br />

39- RMESH3 $RMESH is a Rectangular mesh<br />

40- CORA3 0 80i 20 $planes perpendicular to the x-axis<br />

41- CORB3 -8 64i 8<br />

42- CORC3 -8 64i 8<br />

43- ENDMD $end mesh tally<br />

44- C<br />

45- C --------NUMBER OF PARTICLE HISTORIES TO RUN----<br />

46- NPS 1000000 $num of particle histories<br />

47- PRINT 10 110 170 $output print tables format PRINT x1,x2,..i.., xi-lists of table numbers<br />

to be included in the output file. 10-source co-efficient and<br />

distribution, 110-first 50 starting histories, 170-source distribution<br />

frequency table, surface source<br />

44


<strong>MCNPX</strong>- Proton pencil beam simulation<br />

Output plot using Matlab<br />

45


<strong>MCNPX</strong>- Treatment planning calculations for hadron<br />

therapy<br />

� <strong>MCNPX</strong> can be used to develop a treatment planning software<br />

� Steps involved:<br />

� From the CT image, estimate HU values for each voxel<br />

� Convert HU values to corresponding chemical composition using a<br />

standard calibration graph<br />

Schneider, U., E. Pedroni, and A. Lomax, 1996, “The calibration of CT Hounsfield units for radiotherapy<br />

treatment planning,” Phys. Med. Biol. 41, 111–124.<br />

46


<strong>MCNPX</strong>- Treatment planning calculations for hadron<br />

therapy<br />

� Steps involved:<br />

� Need some software to automatically create the <strong>MCNPX</strong> input file<br />

(Matlab, IDL etc..)<br />

� Run the simulation<br />

� Automatically read plot results and superimposed on CT image<br />

Useful software: CERR(http://www.cerr.info/about.php )- Freeware: written in Matlab to<br />

import and display treatment plans from wide variety of commercial or academic TPS<br />

including RTCOG and DICOM-RT format<br />

47


Happy particle crunching.......!!!!!<br />

Milton Woo<br />

Eva Bezak<br />

John Thomas<br />

Daniel Warren<br />

Thank You<br />

48

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!