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 6 · Advanced MCNP Topics

Variance Reduction Techniques

On this page

Chapter 6 · 1 / 616 min readPDF page 171

Worked examples

When we created our first MCNP model, the estimate of π\pi using MCNP, we did not closely examine the output from MCNP beyond getting the result from the tally and its associated variance. As we increased the number of source histories, the variance went down, and the computation time increased, which is what we would expect. When we look closer at the output, we notice that there is a warning that the tally did not pass one of the ten statistical checks performed by MCNP. This may or may not be a serious problem with the results of our model. MCNP performs 10 statistical checks on any tally. The 10 checks and the desired behavior are listed in Table 6.1. The first statistical check that we should be concerned with is the relative error, RR, which is the fractional 1-sigma estimated uncertainty in the tally mean. Expect for point/ring detectors, RR < 0.1 is considered acceptable. For values of RR of 0.2 to 0.5 the value of the mean is within a factor of a few and may be useful for scoping calculations. If RR > 0.5, the reported value should be considered meaningless. In our first MCNP case, the statistical check that fails is the FOM is decreasing as the NPS increases versus remaining constant. If we look closely at the Tally Fluctuation Chart in the output, we will see that the FOM is very large for this model (on the order of 1E7) and the variance of the variance is zero. The FOM is large because we have a small variance and computer time due to the simple nature of the problem and the fact that there are nearly zero interactions of the 1.0 MeV photons in the air before they cross the surfaces for the tally. Nearly every source particle is counted in the tally. Because the FOM is so large and remains constant for the last half of the problem, we should not be concerned with the fluctuations presented early and we can be satisfied that our model is statistically sound.

Table 6.1. Name, Description and Desired Behavior of Statistical Checks on MCNP Tallies.

NameDescriptionDesired Behavior
MeanAverage value of tallyRandom
Relative Error ValueRatio of the standard deviation of the tally to the mean.<0.1*
Relative Error DecreaseThe trend for the R as the number of histories (NPS) increasesDecreases as NPS increases
Relative Error Decrease RateThe function of how the relative error decreasesDecrease as a function of 1⁄NPS1 ⁄\sqrt{NPS}
Variance of Variance ValueEstimate of the accuracy of R< 0.1 is reliable for all tallies
Variance of the Variance TrendTrend as NPS increasesDecreases as NPS increases
Variance of the Variance Decrease RateThe function of how the variance of the variance decreasesDecreases as a function of 1/NPS1/NPS
Figure of Merit (FOM) ValueFOM is defined as FOM≡1(R2T)FOM \equiv \frac{1}{(R^2 T)} where T is the simulation timeShould remain relatively constant except near beginning of simulation
Figure of Merit BehaviorHow the FOM varies throughout the problemRandom
Probability Density Function (PDF) SlopeThe constructed PDF for the tally to assess the quality of the confidence interval for the meanSlope of PDF >3.00
*Except for point/ ring detectors where R should be <0.05

Say, for instance, we had a different arrangement for our sample MCNP problem where we did not have as many source particles being detected. This case could occur if we had a source that was well-shielded, and we were examining the flux on the far side of the shield (e.g. the lead pig and detector arrangement presented in Figure 6.1.) To reduce the variance, we could just simply throw more particles at the problem until we passed the statistical checks. This will, of course, cost more computer time and is inefficient. There are other ways to manipulate the problem to get good statistics without increasing the number of source particles. These variance reduction techniques essentially cause the problem to be focused and make the most use of each particle history. Variance reduction techniques should be used with caution as they can create errors in the result if used improperly.

Figure 6.1. An example of a model of a thick lead shield coated in copper, a “pig” some distance from a detector. Depending on the strength of the source, variance reduction may be necessary to get reasonable results in MCNP.
Figure 6.1. An example of a model of a thick lead shield coated in copper, a “pig” some distance from a detector. Depending on the strength of the source, variance reduction may be necessary to get reasonable results in MCNP.

There are two main approaches to variance reduction. The first is to simplify the model, also known as truncation. MCNP will, by default, track every particle and interaction at all energies and regions within our model down to the preset cutoff values in the program, which can cost a lot of computing time. We can simplify the model by using truncation techniques that kill off particles that are outside regions of interest or are not in the energy ranges of interest. In addition, we can simplify the physics calculations to ignore some secondary effects (like coherent scatter or Bremsstrahlung if these effects do not contribute to the information we are trying to gain from the problem. The two examples of model simplification we will discuss are Cutoffs and Physics Simplifications. On their own, they will not reduce the variance in the problem, however they will allow the user to increase the number of particles that are run without increasing computer time which will reduce variance. Remember that variance will always be reduced when we increase the number of particles.

Say we had the problem presented in Figure 6.1 and we were modeling it as a point source of 137^{137}Cs. If the lead shield was sufficiently thick, the number of counts on the detector face would be so small that the statistics would be meaningless. We could apply some simplifications to our model to truncate the problem and get better results. One of these is the CUT command. It is used to specify a minimum energy, time, or particle weight below which the particle is killed. This command applies to the entire model. For example:

Input
CUT:p j 0.075  $kills photons with E < 75 keV

The CUT command has five parameters. They are time limit per history, energy cutoff, and parameters 3 to 5 are limits on the weights of particles. The j in the input line says to jump over the default first value for time and specify the 2nd value which is an energy cutoff.

The ELPT command is like the CUT command but cuts off particles at specified energies for each cell. They are listed in the order that the cells appear just like the VOL and IMP parameters in our example problem. The ELPT command can help in this problem because we may not be interested in particles below a particular energy in our detector if we are only looking for a specific energy. If the low energy particles are killed off, the computer time will be shortened.

In addition to the CUT command, we can use the PHYS command to truncate our problem. The PHYS command for photons has the form:

Input
PHYS:P EMCPF  IDES  NOCHOL  PNINT  NODOP

The EMCPF parameter is the energy in MeV above which simple physics is to be used. In simple physics, no fluorescence from photoelectric interactions is produced, no binding effects are used in photon scattering, and no coherent scattering is included. IDES=0/1 indicates that Bremsstrahlung is included/ignored for MODE P. NOCOH=0/1 species that coherent scattering is included/ignored. PNINT= -1/0/1 photonuclear interactions are used in an analog manner / not used/ used with a bias. If PNINT ≠\neq 0 there must be a MPNn card following the material Mn card. NODOP=0/1 turns Doppler broadening (from the speed of bound electrons) on/off. The default is (Shultis; 2011):

Input
PHYS:P 100 0 0 0 0 $100 MeV, brems, coh scat, no PN, Doppler

Depending on the problem, changing the physics options can greatly affect the overall computer time. For our first example, MCNP estimate of π\pi, there is no noticeable speed-up or change because most of the particles do not interact before they reach the boundary of the problem where they are killed off. Later in this chapter, we will model the pig and detector in Figure 6.1 and see if changing the physics models for this problem affects the results.

Figure 6.2. Simple example of geometry splitting. The weight for the green particle doubles when it goes from Cell 1 to Cell 2 and the weight for the red particles are reduced in half when they travel from Cell 2 to Cell 1.
Figure 6.2. Simple example of geometry splitting. The weight for the green particle doubles when it goes from Cell 1 to Cell 2 and the weight for the red particles are reduced in half when they travel from Cell 2 to Cell 1.

The second primary method to reduce variance is to use non-analog simulations. What this means is that we can bias or focus the problem into our specific region of interest by a variety of methods. These methods include adjusting the particle’s worth, or weight, as it goes from regions of low importance to regions of high importance, biasing the source towards the area of interest or killing off particles that are in areas of low or no importance and adding their weights to regions of high importance. For the purposes of this text, we will limit our non-analog simulation to the simple case of geometry splitting and source biasing. Further descriptions of all of the various variance reduction techniques and examples can be found in the User’s Manual and An MCNP Primer. (Shultis; 2011)

As presented in Figure 6.2, geometry splitting allows us to change the importance for particles from one cell to another. In general, to use this approach, we give a greater importance to cells closer to the tally region than those farther away. The weight of a particle moving from the region of importance 1 to importance 2 is given the ratio of I2/I1 . What this means is that if cell 1 has an importance of 1 and cell 2 has an importance of 2, when a particle goes from cell 1 to 2 it will have a new weight of 2/1 or 2. Conversely, when a particle goes from cell 2 to cell 1, it will have a new weight of 1/2.

For our pig and detector model, we can divide up the cylindrical pig shield into multiple cells throughout the thickness of the shield and assign importance values that increase from the inside to the outside of the shield. A method for increasing the importance it to use the multiply shortcut “m”. For example:

Input
IMP 1 2m 2m 2m 2m 2m 0

This line says that the first cell has an importance of 1 and the following are 2, 4, 8, 16, 32, 0.

In addition to geometry splitting, there are other non-analog approaches to reducing the variance we can try. For the pig and detector model we could also work with the source in the problem. We know that our detector is in a particular solid angle from the detector. Instead of modeling the source as an isotropic point source with equal weight in 4π\pi steradians, we could consider modeling it as a cone source pointed at the detector or as a point source with a bias that applies greater weight to the particles traveling towards the detector. In Example 6.1, we will model the pig and detector and use various variance reduction techniques and analyze the effects.

Example 6.1

A small spherical 0.1 curie 137^{137}Cs source is in the container in Figure 6.1. The container is constructed of a cylinder with a radius of 5.2 cm and 20 cm high. The wall has a thickness of 4 cm of lead and 0.2 cm of copper. The detector is located along the centerline of the source at 1 m. Use MCNP to tally the uncollided flux and total gamma flux at the detector.

Solution: We will start by making a strict analog model without variance reduction. Use an isotropic point source of 0.662 MeV photons located at the origin for the source and a point detector (F5) tally at 100 cm. Apply a tally multiplier to convert the number of particle histories to actual flux. This is done by multiplying the tally by the source strength in decays/sec = 0.1 Ci = 3.7×1093.7 \times 10^9 decays/sec. Bin the tally into three bins – E < 0.662 Mev (collided flux), E ≥\geq 0.662 MeV (uncollided flux) and the sum (total flux). Use the nominal density and isotopic composition of natural lead and copper from the NIST website and the composition of air from Example 5.1 for the materials. Ignore the shielding on the top and bottom of the container because the detector is located along the center of the side and we will assume that scatters from particles streaming from the top and bottom are negligible. Once we set up the model, we can plot it from the top and side and see how the model looks from a plane through the middle horizontally and vertically.

Example 6.1, listing 1

In this case, blue is air, green is lead and red is copper. The source is in the center of the shield at the origin. Again, note that the pig is open on the top and the bottom as we are only concerned with shielding through the sides for this example. The complete input file is shown below:

MCNP input — Example 6.1, listing 2 — mcnp, hover a line
NE361 Pig - Detector Model - No Variance Reduction
C -------------------------------------------------------------------
C | This is a model of a shielded container, a "pig" with a Cs-137 |
C | point source located inside. The container is a cylinder |
C | 20 cm high and has an overall radius of 5.2 cm. The wall is |
C | 4 cm thick lead with 0.2 cm copper. The detector is 100 cm away.|
C -------------------------------------------------------------------
C ************************CELL CARD BLOCK****************************
1 1 -0.001297 -1 $air in middle of container
2 2 -1.135E+01 1 -2 $Lead inner cylinder
3 3 -1.135E+01 2 -3 $Copper outside lead
4 1 -0.001297 3 -999 $air outside the copper
99 0 999 $Outside sphere void graveyard
 
C *****************************SUFACE CARD BLOCK*********************
C Right cylinder on origin filled with air
1 RCC 0 -10 0 0 20 0 1
C Right cylinder on origin filled with lead
2 RCC 0 -10 0 0 20 0 5
C Right cylinder on origin filled with copper
3 RCC 0 -10 0 0 20 0 5.2
C Sphere outside of the problem for boundary to kill off particles
999 so 105
 
C ****************************DATA CARD BLOCK************************
MODE P
IMP:P 1.0 1.0 1.0 1.0 0.0 $importance for cells 1 2 3 4 and 99
VOL 62.83185307 1507.964474 128.1769803 4847349.288
c volumes cells 1 2 3 and 4
C point source at the origin uniformly emitting
C 0.662 MeV photons isotopically
SDEF POS=0 0 0 PAR=2 ERG=0.662
C Point Tally at 100 cm along the x axis
F5:P 100 0 0 2 $a point tally with a 2 cm radius exclusion zone
Fm5 3.7E9 $Multiply tally by 0.1 Cu in decays/sec to get real flux
E5 0.661 10 T $3 energy bins – collided, uncollided, and total
C Material Dry Air at STP (w/o Taken from Attix PG 532)
M1 6000 -0.0124 7014 -75.5267 8016 -23.1781 GAS=1
C Lead at nominal density from NIST at 1.135E+01 gm/cm^3
C Use the stable isotopes and abundances for natural lead from
C The Chart of the Nuclides online
M2 82204 -0.014 82206 -0.241 82207 -0.221 82208 -0.524
C Copper at nominal density from NIST at 8.960E+00 gm/cm^3
C Use the stable isotopes and abundances for natural copper from
C The Chart of the Nuclides online
M3 29063 -0.6915 29065 -0.3085
NPS 1E7
PRINT

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

When we run the problem, it takes 6.50 mins (on the example computer) we get the tally table below:

Program output — Example 6.1, listing 3
1tally        5        nps =    10000000
           tally type 5    particle flux at a point detector.
           particle(s): photons

           this tally is all multiplied by  3.70000E+09

 detector located at x,y,z = 1.00000E+02 0.00000E+00 0.00000E+00
      energy
    6.6100E-01   2.26835E+02 0.0079
    1.0000E+01   2.15495E+02 0.0205
      total      4.42330E+02 0.0108

We can see that the flux values are very small with the total flux being less than 500 photons/cm2⋅^2\cdots. Also, the variances are fairly large and the output indicates that the results failed 2 of the 10 statistical checks – the variance of the variance was > 0.1 and the slope for the PDF was < 3.0.

We will now apply some variance reduction techniques and see what happens. First, let’s apply a CUT parameter to kill off all low-energy particles.

Input
CUT:p   j  0.075  $kills photons with E < 75 keV

By cutting off the low-energy photons, the simulation took less time to run – now 4.02 mins. However, the statistics are worse as it now fails 3 statistical checks. This makes sense because we now have less histories reaching the detector. We can now choose to increase our NPS value to attempt to get better statistics in the same time it took to do the original run of about 6 min.

As another test, we will remove the CUT command and apply a PHYS card that will change the treatment of the problem to simple physics and turn off Bremsstrahlung, coherent scatter, photonuclear effects and Doppler broadening.

Input
PHYS:p   0 1 1 0 1

Using the simple physics treatment, the model took 3.13 minutes to run and we get results that now only fail one statistical check – the slope of the PDF. It may be possible to use a simple physics model and increase the number of particles to get good statistics, however, we may be sacrificing some valuable information using the simple model.

Return to the default physics model by removing the PHYS:p card and we will now focus on non-analog approaches to variance reduction. The first will be to change the source from a point source to a cone pointed at our detector. This will limit our source particles to those that have a reasonable chance of interacting with our detector. We will make a point source collimated into a cone. We will use the same example presented for the cone in Chapter 5. The tally will be automatically normalized per source particle in 4π\pi steradians so it should give us the same numerical count at our detector that we would get from an isotropic point source at the same location. The new SDEF is:

MCNP input — Example 6.1, listing 4 — mcnp, hover a line
SDEF POS=0 0 0 ERG=0.662 PAR=2 VEC=1 0 0 DIR=d1
SI1 -1 0.9 1 $ histogram for cosine bin limits
SP1 0 0.95 0.05 $ frac. Solid angle for each bin
SB1 0. 0. 1. $ source bias for each bin

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

The non-analog conical source took 5.57 mins to complete, and it now passed all of the 10 statistical checks. The results from the conical source:

Program output — Example 6.1, listing 5
1tally        5        nps =    10000000
           tally type 5    particle flux at a point detector.
           particle(s): photons

           this tally is all multiplied by  3.70000E+09

 detector located at x,y,z = 1.00000E+02 0.00000E+00 0.00000E+00
      energy
    6.6100E-01   1.10887E+02 0.0045
    1.0000E+01   2.16168E+02 0.0039
      total      3.27055E+02 0.0030

Note that the total of 327 photons/cm2⋅^2\cdots from our conical source is significantly less than the value of around 440 photons/cm2⋅^2\cdots we were getting with our previous models. This may be an indication that the cone is too narrow, and we are not correctly modeling the source. We can broaden the cone by increasing the half-angle from 25.8 degrees to 36.9 degrees and change the SDEF to the following:

MCNP input — Example 6.1, listing 6 — mcnp, hover a line
SDEF POS=0 0 0 ERG=0.662 PAR=2 VEC=1 0 0 DIR=d1
SI1 -1 0.8 1 $ histogram for cosine bin limits
SP1 0 0.90 0.10 $ frac. Solid angle for each bin
SB1 0. 0. 1. $ source bias for each bin

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

The broader conical source took 6.27 mins to complete and failed 1 of the 10 statistical checks. The results from the model are:

Program output — Example 6.1, listing 7
1tally        5        nps =    10000000
           tally type 5    particle flux at a point detector.
           particle(s): photons

           this tally is all multiplied by  3.70000E+09

 detector located at x,y,z = 1.00000E+02 0.00000E+00 0.00000E+00
      energy
    6.6100E-01   1.68015E+02 0.0061
    1.0000E+01   2.15446E+02 0.0053
      total      3.83461E+02 0.0040

There is a lower variance from the point source and a higher number of counts than the narrow cone, but we may still be missing some values. Because we failed one of the statistical checks, broadening the cone more is unlikely to be successful.

We have one other non-analog method for variance reduction we will try with our model. For this case, we will divide the lead shield into two 2.0 cm thick cells radially. We will then increase the importance for particles from the source through the cells of the lead.

This model will allow us to multiply the weight of particles directed outward from the source and reduce any particles that are scattered inward. It will effectively multiply our source particles and should result in a higher FOM.

We will run the problem twice, once with two intermediate cells and once with three cells. The cell and surface definition blocks for the new input file are as follows:

MCNP input — Example 6.1, listing 8 — mcnp, hover a line
C ************************CELL CARD BLOCK****************************
1 1 -0.001297 -1 $air in middle of container
2 2 -1.135E+01 1 -22 $Lead inner cylinder
22 2 -1.135E+01 22 -23 $Lead layer 2
3 3 -1.135E+01 23 -3 $Copper outside lead
4 1 -0.001297 3 -999 $air outside the copper
99 0 999 $Outside sphere void graveyard
 
C *****************************SUFACE CARD BLOCK*********************
C Right cylinder on origin filled with air
1 RCC 0 -10 0 0 20 0 1
C Right cylinder on origin filled with lead (layer 1)
22 RCC 0 -10 0 0 20 0 3
C Right cylinder on origin filled with lead (layer 2)
23 RCC 0 -10 0 0 20 0 5
C Right cylinder on origin filled with copper
3 RCC 0 -10 0 0 20 0 5.2
C Sphere outside of the problem for boundary to kill off particles
999 so 105

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

We also must change the VOL cards to reflect the new cells. We will apply a non-analog variance reduction by modifying the importance of each cell. The new importance card looks like:

Input
C  importance for cells 1 2 22 3 4 and 99
 IMP:P   1.0 2m 2m 1.0 1.0 0.0

The new plot of the model without color shows the cells:

Example 6.1, listing 9

The computation time for the geometry splitting model was 10.72 min or about twice as long as the analog solution. The final FOM for the tally is 3027 which is 2.3 times greater than the analog solution. To get the same FOM, the analog model would have to run 2.32^2 or 5.28 times longer. Also, the model now passes 9 of the 10 statistical checks as opposed to 8. The results from the tally table are:

Program output — Example 6.1, listing 10
1tally        5        nps =    10000000
           tally type 5    particle flux at a point detector.
           particle(s): photons

           this tally is all multiplied by  3.70000E+09

 detector located at x,y,z = 1.00000E+02 0.00000E+00 0.00000E+00
      energy
    6.6100E-01   2.30749E+02 0.0075
    1.0000E+01   2.15479E+02 0.0081
      total      4.46229E+02 0.0056

To try and get better results, we will spit the model into three cells increasing the importance by 2m and run it again. By increasing the number of cells to three the computer time increases to 12.94 mins. The model now passes all 10 statistical checks, and the results are below:

Program output — Example 6.1, listing 11
1tally        5        nps =    10000000
           tally type 5    particle flux at a point detector.
           particle(s): photons

           this tally is all multiplied by  3.70000E+09

 detector located at x,y,z = 1.00000E+02 0.00000E+00 0.00000E+00
      energy
    6.6100E-01   2.31576E+02 0.0063
    1.0000E+01   2.18714E+02 0.0099
      total      4.50290E+02 0.0058

We can now be confident in the results for the model:
Uncollided Flux: 2.1871×102±0.00992.1871 \times 10^2 \pm 0.0099 photons/cm2⋅^2\cdots
Total Flux: 4.5029×102±0.00584.5029 \times 10^2 \pm 0.0058 photons/cm2⋅^2\cdots

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