Allen CDNE

Computational Design in Nuclear Engineering · Allen

Download the PDF

Computational Design in Nuclear Engineering, second edition, by Kenneth S. Allen, Ph.D., P.E.

Download the PDF

Chapter 5 · Introduction to MCNP 6.2

Running A Model in MCNP

On this page

Chapter 5 · 7 / 84 min readPDF page 162

Worked examples

Running the MCNP model is straightforward and the same as the plot command we just used without the ip. For our example problem, we would go to the MCNP command prompt and write:

Input
C:\ MCNPIO\> mcnp6  i=picalc o= picalc.out

Because we have set up the target destination in our prompt properties to the bin folder of the MCNP6 directory, we do not have to change directories to get there. The bin directory has the command executable mcnp6.exe. The input file should be saved in the same directory. If it is not, you will have to designate the location of the input file after the “i=” and before the filename. Similarly, you can do the same for the output if you want to save it to a different directory. It can become cumbersome to type in a long directory. Additionally, you should limit your filenames to simple designations with no spaces. MCNP was not written to accept filenames that are long and have spaces. Using good comments in the beginning of the input file will help you organize your files and know what they are designed to do when you access them later.

When we enter the command line to execute MCNP, we will get the following window:

Screenshot 1

Note that the warnings about the neutron tables have appeared as we mentioned. This is because we added the neutron libraries to the cross sections. MCNP will give warnings to help prompt the user to possible problems with the model. The user will have to know whether or not the warnings are important. If MCNP gives an error, the code will normally not run and they must be addressed to get results.

There are several control functions that are useful in case you want to stop a MCNP run that is operating:

  • [] <ctrl-c> k kills the job immediately

  • [] <ctrl-c> q stops the job normally after the current history

  • [] <ctrl-c> s give the status of the job

Video for this sectionRunning MCNP Input File

Reading the MCNP Output

We will discuss the error and statistical checks performed by MCNP in the output in the next chapter when we talk about variance reduction. For now, we will look at the output from our picalc model understanding that “the tally in the tally fluctuation chart bin did not pass 2 of the 10 statistical checks.” We can open the output file in TextPad® and we will see that there is a lot of information provided. It starts with a repeat of the input file with warnings inter-spaced for information about possible errors. The next sections of the output include information about the cells and materials. We should inspect the values and ensure that the values are consistent with what we wanted.

Because we used the command PRINT 110, we will get the first 50 particle source points in tabular form. We can inspect the information and see that all of the particles start at a value of y = 7 and a direction with a vector of 0 -1 0 which is directed towards our model.

Finally, we can see the output for the tallies:

Program output — Screenshot 2
1tally       11        nps =    10000000
+     Calculate Pi by taking the ratio of results of (2.2 / 1.3 ) x 4
           tally type 1    number of particles crossing a surface.
           particle(s): photons

 surface  1.3
                 6.14168E-01 0.0003

 surface  2.2
                 4.82256E-01 0.0003

The values for surfaces 1.3 and 2.2 are the values for the surface current in particles / cm2⋅^2\cdotsource particle. The values 0.0003 and 0.0003 to the right of the tally values represent the variance in the values. We can calculate π\pi using Equation 4.4 and we will get 3.140873507. If we propagate the uncertainty, we get the confidence interval 3.1409 ±\pm 0.0003 for 1.0x107{1.0 x 10^7} source particles. In Example 5.2, we will use our MCNP model picalc to repeat the analysis we did in Example 4.1 for an estimate of π\pi and its variance as a function of particles.

Example 5.2

Use the MCNP model created in Example problem 5.1 to estimate the value of π\pi. Vary the number of source particles from 1.0E4 to 1.0E8. Report the value and standard deviation for sample sizes from 1.0E4 to 1.0E8 and plot the results compared to the known value.

Solution: The only adjustment to the MNCP input file in Example 5.1 is to change the values for NPS. Run each model and record the results for the tallies and do the calculation for π\pi using Equation 4.4 and propagate the uncertainty to report the variance.

Example 5.2, listing 1

Note that we can get the computer time from the bottom of the input file. This is the time, in minutes, it took to do the calculation. Notice how much longer it took to solve the problem as we increased the number of source particles.

Example 5.2, listing 2

The results can be plotted with the variance as the error as we did in example 4.1. Some of the errors with the accuracy of the model come from the fact that the circle is not exactly tangent to the square. There is a very small gap between the two surfaces that contributes to the tally in the square so the result may be slightly lower than the actual. Also, we had a material of air for demonstration purposes. We could set all our materials to void to eliminate any scatters or absorption. We did not run the model out to 1E10 source histories just to save time as the result for 1.0E8 histories took about twelve times as long as 1.0E7 histories and we have a result that is both accurate and precise.

Computational Design in Nuclear Engineering, second edition, by Kenneth S. Allen, Ph.D., P.E. — the complete book as a 394-page PDF.

Download the PDF