Now we have fully defined the input file, we are ready to make our first model. For this model, we will be using MCNP to perform an estimate of the value of . Building on the concept presented in section 4.2 of this text, we can set up the same upper right quadrant of a unit circle in a square presented in Figure 4.4. We can bombard the model with a beam of parallel particles and then use a flux tally on the circle and square to estimate the areas of each. Using Equation 4.4, we can calculate the estimate of .
Example 5.1
Using the model presented in Figure 4.4 and the formula in Equation 4.4, create an MCNP input file that will calculate an estimate for the value of .
Solution: Open up TextPad® and create an input file. Start with materials. For this case, we do not want particles to be scattered back towards the source. We can use air as a material. We could have used a void but that would not allow us to demonstrate how to make a material. Because the Visual Editor and the MCNP plotter will plot different materials different colors, it is helpful if we name three identical materials. One material will be in the square outside of the circle, one will be in the circle and one will be outside the model but inside a large sphere that serves as the overall boundary to the model. As a matter of demonstration, we will specify the neutron library on the materials even though we will be using 1.0 MeV photons as our particles. The composition for air comes from Introduction to Radiological Physics and Radiation Dosimetry by Frank Attix. (Attix; 1986)
C MATERIAL DRY AIR AT STP (w/o TAKEN FROM ATTIX PG 532)M1 6000.70C -0.0124 7014.70C -75.5267 8016.70C -23.1781 GAS=1M2 6000.70C -0.0124 7014.70C -75.5267 8016.70C -23.1781 GAS=1M3 6000.70C -0.0124 7014.70C -75.5267 8016.70C -23.1781 GAS=1
Hover a line
Each line is read as a cell, a surface, or a data card. Tap a line on a small screen.
- ●Cell cards
- ●Surface cards
- ●Data cards
After the materials, we can specify the surfaces. We will use a rectangular parallelepiped for the square surface, a right circular cylinder for the circular surface, two planes to cut the problem into the positive quadrant and a large sphere to surround the entire problem. We have chosen to make the RPP 10 cm x 10 cm x 10 cm. The size is arbitrary because the calculation is based on a ratio of the areas for the square and the circle. We will set the importance to zero for particles as they cross boundary of the sphere to kill them off and allow the model to stop tracking them. This area will be known as the “graveyard”.
C *****************************SUFACE CARD BLOCK*********************C Square RPP - one side faces the beam and will be used for a tally1 RPP -5 5 -5 5 -5 5C Right cylinder just inside RPP 1 - end will be used for tally2 RCC 0 -4.999999 0 0 9.999998 0 4.999999C Plane normal to z axis to reduce the problem into 1/43 PZ 0C Plane normal to x axis to reduce the problem into 1/44 PX 0C Sphere outside of the problem for boundary to kill off particles999 so 100
Hover a line
Each line is read as a cell, a surface, or a data card. Tap a line on a small screen.
- ●Cell cards
- ●Surface cards
- ●Data cards
Now we can write the cell block using the density and material numbers for air and the surfaces we have just defined.
C ************************CELL CARD BLOCK****************************1 1 -0.001297 -1 2 (3 4) $Air in square outside circle2 2 -0.001297 -2 (3 4) $Air inside circle9 3 -0.001297 (1:-3:-4) -999 $Outside model air99 0 999 $Outside sphere void graveyard
Hover a line
Each line is read as a cell, a surface, or a data card. Tap a line on a small screen.
- ●Cell cards
- ●Surface cards
- ●Data cards
Note that we have not specified the volume or importance in the cell block. We will specify those in the data block in this example. In addition to those parameters, we will specify the mode, source, tallies, materials (previously done), number of histories and print options. The source has the same form as the disk source presented in Section 5.5 of this text. The following is the complete input file.
NE361 Demonstration of Calculation of pi with MCNPC -------------------------------------------------------------------C | This demo uses a disk beam source striking a circle inside a |C | square and uses the relationship between the tallies of |C | particles in the circle to the tallies of particles in the |C | square times 4 to estimate pi |C -------------------------------------------------------------------C ************************CELL CARD BLOCK****************************1 1 -0.001297 -1 2 (3 4) $Air in square outside circle2 2 -0.001297 -2 (3 4) $Air inside circle9 3 -0.001297 (1:-3:-4) -999 $Outside model air99 0 999 $Outside sphere void graveyardC *****************************SUFACE CARD BLOCK*********************C Square RPP - one side faces the beam and will be used for a tally1 RPP -5 5 -5 5 -5 5C Right cylinder just inside RPP 1 - end will be used for tally2 RCC 0 -4.999999 0 0 9.999998 0 4.999999C Plane normal to z axis to reduce the problem into 1/43 PZ 0C Plane normal to x axis to reduce the problem into 1/44 PX 0C Sphere outside of the problem for boundary to kill off particles999 so 100C *********************************DATA CARD BLOCK*******************MODE PIMP:P 1.0 1.0 1.0 0.0 $importance for cells 1 2 9 and 99VOL 214.6018366 785.3981634 124663.7061 $volumes cells 1 2 and 9C Disk source perpendicular to y-axis uniformly emittingC 1.0 MeV photons in a beam directed toward cube and cylinderSDEF POS=2.5 7 2.5 AXS=0 1 0 EXT=0 RAD=d1 PAR=2 ERG=1.0VEC=0 1 0 DIR=-1SI1 0 3.6 $Radius of disk that ensures source is larger than modelSP1 -21 1C Surface tally for the circle and square areas in upper quadrantF11:P 1.3 2.2 $surface tallies for the square and the circleFC11 Calculate Pi by taking the ratio of results of (2.2 / 1.3 ) x 4C MATERIAL DRY AIR AT STP (w/o TAKEN FROM ATTIX PG 532)M1 6000.70C -0.0124 7014.70C -75.5267 8016.70C -23.1781 GAS=1M2 6000.70C -0.0124 7014.70C -75.5267 8016.70C -23.1781 GAS=1M3 6000.70C -0.0124 7014.70C -75.5267 8016.70C -23.1781 GAS=1NPS 1E7PRINT 110
Hover a line
Each line is read as a cell, a surface, or a data card. Tap a line on a small screen.
- ●Cell cards
- ●Surface cards
- ●Data cards
Note that the tallies are on surfaces 1.3 and 2.2. Because we are using macrobodies for the model, each face is given a specific number where the digit before the decimal is the number ID of the macrobody and the number after the decimal is the face number assigned by MCNP. A RPP will have six faces and a RCC will have three. We will see how to determine the number assigned using the plotting features in MCNP in the next section. We will also demonstrate running this input problem and compare the results for the output to the example problem we did with our Julia Monte Carlo problem in Chapter 4.
Save the file using the Save As and Save as Type as *.* all files to select an option other than the default of *.txt.

As a convention, MCNP input files do not have a filename extension. However, the user can use a *.txt extension, it only requires the inclusion of the extension in the command line when the file is run. The destination can be in any folder on the computer where MCNP is run, the user will need to navigate to that specified folder from the MCNP Command prompt in order to execute. A suggested method is to create a folder within the user's documents folder on the PC named MCNPIO to keep MCNP input and output files. For this example the filename selected will be “picalc”. Including the quotation marks in the name. This will eliminate the filename extension from the input file. For example, without the quotes, the file will be called picalc.txt and with the quotes, the filename will be just picalc. As previously stated, either will work for execution.
This completes the creation of the input file. This input file will be used in the following sections as a demonstration for the plotting, running, and reading the output for an MCNP file.
References
Full bibliography- Attix, F. H. (1986). Introduction to Radiological physics and radiation Dosimetry, Wiley, New York. https://books.google.com/books?vid=ISBN0471011460
