diff --git a/docs/img/uniongrid.svg b/docs/img/uniongrid.svg
new file mode 100644
index 0000000000..27c3922fdf
--- /dev/null
+++ b/docs/img/uniongrid.svg
@@ -0,0 +1,792 @@
+
+
+
+
diff --git a/docs/source/methods/cross_sections.rst b/docs/source/methods/cross_sections.rst
new file mode 100644
index 0000000000..c564896c79
--- /dev/null
+++ b/docs/source/methods/cross_sections.rst
@@ -0,0 +1,94 @@
+.. _methods_cross_sections:
+
+============================
+Cross Section Representation
+============================
+
+The data governing the interaction of neutrons with various nuclei are
+represented using the ACE format which is used by MCNP_ and Serpent_. ACE-format
+data can be generated with the NJOY_ nuclear data processing system which
+converts raw `ENDF/B data`_ into linearly-interpolable data as required by most
+Monte Carlo codes. The use of a standard cross section format allows for a
+direct comparison of OpenMC with other codes since the same cross section
+libraries can be used.
+
+The ACE format contains continuous-energy cross sections for the following types
+of reactions: elastic scattering, fission (or first-chance fission,
+second-chance fission, etc.), inelastic scattering, :math:`(n,xn)`,
+:math:`(n,\gamma)`, and various other absorption reactions. For those reactions
+with one or more neutrons in the exit channel, secondary angle and energy
+distributions may be provided. In addition, fissionable nuclides have total,
+prompt, and/or delayed :math:`\nu` as a function of energy and neutron precursor
+distributions. Many nuclides also have probability tables to be used for
+accurate treatment of self-shielding in the unresolved resonance range. For
+bound scatterers, separate tables with :math:`S(\alpha,\beta,T)` scattering law
+data can be used.
+
+-------------------
+Energy Grid Methods
+-------------------
+
+The method by which continuous energy cross sections for each nuclide in a
+problem are stored as a function of energy can have a substantial effect on the
+performance of a Monte Carlo simulation. Since the ACE format is based on
+linearly-interpolable cross sections, each nuclide has cross sections tabulated
+over a wide range of energies. Some nuclides may only have a few points
+tabulated (e.g. H-1) whereas other nuclides may have hundreds or thousands of
+points tabulated (e.g. U-238).
+
+At each collision, it is necessary to sample the probability of having a
+particular type of interaction whether it be elastic scattering, :math:`(n,2n)`,
+level inelastic scattering, etc. This requires looking up the microscopic cross
+sections for these reactions for each nuclide within the target material. Since
+each nuclide has a unique energy grid, it would be necessary to search for the
+appropriate index for each nuclide at every collision. This can become a very
+time-consuming process, especially if there are many nuclides in a problem as
+there would be for burnup calculations. Thus, there is a strong motive to
+implement a method of reducing the number of energy grid searches in order to
+speed up the calculation.
+
+Unionized Energy Grid
+---------------------
+
+The most naïve method to reduce the number of energy grid searches is to
+construct a new energy grid that consists of the union of the energy points of
+each nuclide and use this energy grid for all nuclides. This method is
+computationally very efficient as it only requires one energy grid search at
+each collision as well as one interpolation between cross section values since
+the interpolation factor can be used for all nuclides. However, it requires
+redundant storage of cross section values at points which were added to each
+nuclide grid. This additional burden on memory storage can become quite
+prohibitive. To lessen that burden, the unionized energy grid can be thinned
+with cross sections reconstructed on the thinned energy grid. This method is
+currently used by default in the Serpent Monte Carlo code.
+
+Unionized Energy Grid with Nuclide Pointers
+-------------------------------------------
+
+While having a unionized grid that is used for all nuclides allows for very fast
+lookup of cross sections, the burden on memory is in many circumstances
+unacceptable. The OpenMC Monte Carlo code utilizes a method that allows for a
+single energy grid search to be performed at every collision while avoiding the
+redundant storage of cross section values. Instead of using the unionized grid
+for every nuclide, the original energy grid of each nuclide is kept and a list
+of pointers (of the same length as the unionized energy grid) is constructed for
+each nuclide that gives the corresponding grid index on the nuclide grid for a
+given grid index on the unionized grid. One must still interpolate on cross
+section values for each nuclide since the interpolation factors will generally
+be different. The figure below illustrates this method. All values within the
+dashed box would need to be stored on a per-nuclide basis, and the union grid
+would need to be stored once. This method is also referred to as *double
+indexing* and is available as an option in Serpent (see paper by Leppanen_).
+
+.. figure:: ../../img/uniongrid.svg
+ :width: 600px
+ :align: center
+ :figclass: align-center
+
+ Mapping of union energy grid to nuclide energy grid through pointers.
+
+.. _MCNP: http://mcnp.lanl.gov
+.. _Serpent: http://montecarlo.vtt.fi
+.. _NJOY: http://t2.lanl.gov/codes.shtml
+.. _ENDF/B data: http://www.nndc.bnl.gov/endf
+.. _Leppanen: http://dx.doi.org/10.1016/j.anucene.2009.03.019
diff --git a/docs/source/methods/criticality.rst b/docs/source/methods/eigenvalue.rst
similarity index 84%
rename from docs/source/methods/criticality.rst
rename to docs/source/methods/eigenvalue.rst
index 7959a58841..a5ba0bf459 100644
--- a/docs/source/methods/criticality.rst
+++ b/docs/source/methods/eigenvalue.rst
@@ -1,20 +1,20 @@
-.. _methods_criticality:
+.. _methods_eigenvalue:
-========================
-Criticality Calculations
-========================
+=======================
+Eigenvalue Calculations
+=======================
-A criticality calculation is a transport simulation wherein the source of
-neutrons includes a fissionable material. Some common criticality calculations
-include the simulation of nuclear reactors, spent fuel pools, nuclear weapons,
-and other fissile systems. The term criticality calculation is also synonymous
-with the term eigenvalue calculation. The reason for this is that the transport
-equation becomes an eigenvalue equation if a fissionable source is present since
-then the source of neutrons will depend on the flux of neutrons
-itself. Criticality simulations using Monte Carlo methods are becoming
-increasingly common with the advent of high-performance computing.
+An eigenvalue calculation, also referred to as a criticality calculation, is a
+transport simulation wherein the source of neutrons includes a fissionable
+material. Some common eigenvalue calculations include the simulation of nuclear
+reactors, spent fuel pools, nuclear weapons, and other fissile systems. The
+reason they are called *eigenvalue* calculations is that the transport equation
+becomes an eigenvalue equation if a fissionable source is present since then the
+source of neutrons will depend on the flux of neutrons itself. Eigenvalue
+simulations using Monte Carlo methods are becoming increasingly common with the
+advent of high-performance computing.
-This section will explore the theory behind and implementation of criticality
+This section will explore the theory behind and implementation of eigenvalue
calculations in a Monte Carlo code.
.. _method-successive-generations:
@@ -23,7 +23,7 @@ calculations in a Monte Carlo code.
Method of Successive Generations
--------------------------------
-The method used to converge on the fission source distribution in a criticality
+The method used to converge on the fission source distribution in an eigenvalue
calculation, known as the method of successive generations, was first introduced
by [Lieberoth]_. In this method, a finite number of neutron histories,
:math:`N`, are tracked through their lifetime iteratively. If fission occurs,
@@ -48,7 +48,7 @@ source distribution converges, tallies should not be scored to since they will
otherwise include contributions from an unconverged source distribution.
The method by which the fission source iterations are parallelized can have a
-large impact on the achiable parallel scaling. This topic is discussed at length
+large impact on the achievable parallel scaling. This topic is discussed at length
in :ref:`fission-bank-algorithms`.
-------------------------
@@ -74,7 +74,7 @@ finite set of coordinates in Euclidean space. In order to analyze the
convergence, we would either need to use a method for assessing convergence of
an N-dimensional quantity or transform our set of coordinates into a scalar
metric. The latter approach has been developed considerably over the last decade
-and a method now commonly used in Monte Carlo criticality calculations is to use
+and a method now commonly used in Monte Carlo eigenvalue calculations is to use
a metric called the `Shannon entropy`_, a concept borrowed from information
theory.
diff --git a/docs/source/methods/geometry.rst b/docs/source/methods/geometry.rst
index 7b70c1d305..e9f1e09547 100644
--- a/docs/source/methods/geometry.rst
+++ b/docs/source/methods/geometry.rst
@@ -11,12 +11,13 @@ Constructive Solid Geometry
OpenMC uses a technique known as `constructive solid geometry`_ (CSG) to build
arbitrarily complex three-dimensional models in Euclidean space. In a CSG model,
every unique object is described as the union, intersection, or difference of
-half-spaces created by bounding `surfaces`_. Every surface divides all of space
-into exactly two half-spaces. We can mathematically define a surface as a
+*half-spaces* created by bounding `surfaces`_. Every surface divides all of
+space into exactly two half-spaces. We can mathematically define a surface as a
collection of points that satisfy an equation of the form :math:`f(x,y,z) = 0`
-where :math:`f(x,y,z)` is a given function. The region for which :math:`f(x,y,z)
-< 0` can be called the negative half-space (or simply the "negative side") and
-the region for which :math:`f(x,y,z) > 0` can be called the positive half-space.
+where :math:`f(x,y,z)` is a given function. All coordinates for which
+:math:`f(x,y,z) < 0` are referred to as the negative half-space (or simply the
+*negative side*) and coordinates for which :math:`f(x,y,z) > 0` are referred to
+as the positive half-space.
Let us take the example of a sphere centered at the point :math:`(x_0,y_0,z_0)`
with radius :math:`R`. One would normally write the equation of the sphere as
@@ -41,28 +42,77 @@ One can confirm that any point inside this sphere will correspond to
In OpenMC, every surface defined by the user is assigned an integer to uniquely
identify it. We can then refer to either of the two half-spaces created by a
surface by a combination of the unique ID of the surface and a positive/negative
-sign. For example, to refer to the negative half-space of a sphere (the volume
-inside the sphere) with unique ID 35, the reference would be -35. These
-references to half-spaces are used in created regions in space of homogeneous
-material, known as "cells".
-
+sign. The following illustration shows an example of an ellipse with unique ID 1
+dividing space into two half-spaces.
.. figure:: ../../img/halfspace.svg
:align: center
:figclass: align-center
+
+ Example of an ellipse and its associated half-spaces.
+
+References to half-spaces created by surfaces are used to define regions of
+space of uniform composition, known as *cells*. While some codes allow regions
+to be defined by intersections, unions, and differences or half-spaces, OpenMC
+is currently limited to cells defined only as intersections of
+half-spaces. Thus, the specification of the cell must include a list of
+half-space references whose intersection defines the region. The region is then
+assigned a material defined elsewhere. The following illustration shows an
+example of a cell defined as the intersection of an ellipse and two planes.
.. figure:: ../../img/union.svg
:align: center
:figclass: align-center
-In OpenMC, any second-order surface of the form
+ The shaded region represents a cell bounded by three surfaces.
-.. math::
+The ability to form regions based on bounding quadratic surfaces enables OpenMC
+to model arbitrarily complex three-dimensional objects. In practice, one is
+limited only by the different surface types available in OpenMC. The following
+table lists the available surface types, the identifier used to specify them in
+input files, the corresponding surface equation, and the input parameters needed
+to fully define the surface.
- f(x,y,z) = Ax^2 + By^2 + Cz^2 + Dxy + Eyz + Fxz + Gx + Hy + Jz + K = 0
+.. table:: Surface types available in OpenMC.
-can be modeled in OpenMC. For example, the equation for a sphere centered at
-:math:`(\bar{x},\bar{y},\bar{z})` and of radius :math:`R` can be written as
+ +----------------------+------------+------------------------------+-------------------------+
+ | Surface | Identifier | Equation | Parameters |
+ +======================+============+==============================+=========================+
+ | Plane perpendicular | x-plane | :math:`x - x_0 = 0` | :math:`x_0` |
+ | to :math:`x`-axis | | | |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Plane perpendicular | y-plane | :math:`x - x_0 = 0` | :math:`y_0` |
+ | to :math:`y`-axis | | | |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Plane perpendicular | z-plane | :math:`x - x_0 = 0` | :math:`z_0` |
+ | to :math:`z`-axis | | | |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Arbitrary plane | plane | :math:`Ax + By + Cz = D` | :math:`A\;B\;C\;D` |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Infinite cylinder | x-cylinder | :math:`(y-y_0)^2 + (z-z_0)^2 | :math:`y_0\;z_0\;R` |
+ | parallel to | | = R^2` | |
+ | :math:`x`-axis | | | |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Infinite cylinder | y-cylinder | :math:`(x-x_0)^2 + (z-z_0)^2 | :math:`x_0\;z_0\;R` |
+ | parallel to | | = R^2` | |
+ | :math:`y`-axis | | | |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Infinite cylinder | z-cylinder | :math:`(x-x_0)^2 + (y-y_0)^2 | :math:`x_0\;y_0\;R` |
+ | parallel to | | = R^2` | |
+ | :math:`z`-axis | | | |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Sphere | sphere | :math:`(x-x_0)^2 + (y-y_0)^2 | :math:`x_0 \; y_0 \; |
+ | | | + (z-z_0)^2 = R^2` | z_0 \; R` |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Cone parallel to the | x-cone | :math:`(y-y_0)^2 + (z-z_0)^2 | :math:`x_0 \; y_0 \; |
+ | :math:`x`-axis | | = R^2(x-x_0)^2` | z_0 \; R^2` |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Cone parallel to the | y-cone | :math:`(x-x_0)^2 + (z-z_0)^2 | :math:`x_0 \; y_0 \; |
+ | :math:`y`-axis | | = R^2(y-y_0)^2` | z_0 \; R^2` |
+ +----------------------+------------+------------------------------+-------------------------+
+ | Cone parallel to the | z-cone | :math:`(x-x_0)^2 + (y-y_0)^2 | :math:`x_0 \; y_0 \; |
+ | :math:`z`-axis | | = R^2(z-z_0)^2` | z_0 \; R^2` |
+ +----------------------+------------+------------------------------+-------------------------+
.. _universes:
@@ -75,13 +125,12 @@ structures once and then fill them in various spots in the geometry. A
prototypical example of a repeated structure would be a fuel pin within a fuel
assembly or a fuel assembly within a core.
-Each closed volume, or cell, in OpenMC can either be filled with a normal
-material or with a universe. If the cell is filled with a univese, only the
-region of the universe that is within the defined boundaries of the parent cell
-will be present in the geometry. That is to say, even though a collection of
-cells in a universe may extend to infinity, not all of the universe will be
-"visible" in the geometry since it will be truncated by the boundaries of the
-cell that contains it.
+Each cell in OpenMC can either be filled with a normal material or with a
+universe. If the cell is filled with a universe, only the region of the universe
+that is within the defined boundaries of the parent cell will be present in the
+geometry. That is to say, even though a collection of cells in a universe may
+extend to infinity, not all of the universe will be "visible" in the geometry
+since it will be truncated by the boundaries of the cell that contains it.
When a cell is filled with a universe, it is possible to specify that the
universe filling the cell should be rotated and translated. This is done through
@@ -91,7 +140,7 @@ a material).
It is not necessary to use or assign universes in a geometry if there are no
repeated structures. Any cell in the geometry that is not assigned to a
-specified universe is automatically part of the "base" universe whose
+specified universe is automatically part of the *base universe* whose
coordinates are just the normal coordinates in Euclidean space.
Lattices
@@ -103,7 +152,7 @@ for a user to have to define the boundaries of each of the cells to be filled
with a universe. Thus, OpenMC provides a lattice capability similar to that used
in MCNP_ and Serpent_.
-The implementation of lattices is similar in principle to universes -- instead
+The implementation of lattices is similar in principle to universes --- instead
of a cell being filled with a universe, the user can specify that it is filled
with a finite lattice. The lattice is then defined by a two-dimensional array of
universes that are to fill each position in the lattice. A good example of the
@@ -127,17 +176,19 @@ necessary to check the distance to the surfaces bounding the cell in each
level. This should be done starting the highest (most global) level going down
to the lowest (most local) level. That ensures that if two surfaces on different
levels are coincident, by default the one on the higher level will be selected
-as the nearest surface.
+as the nearest surface. Although they are not explicitly defined, it is also
+necessary to check the distance to surfaces representing lattice boundaries if a
+lattice exists on a given level.
The following procedure is used to calculate the distance to each bounding
-surface. Suppose we have a particle at :math:`(x,y,z)` traveling in the
-direction :math:`u,v,w`. To find the distance :math:`d` to a surface
+surface. Suppose we have a particle at :math:`(x_0,y_0,z_0)` traveling in the
+direction :math:`u_0,v_0,w_0`. To find the distance :math:`d` to a surface
:math:`f(x,y,z) = 0`, we need to solve the equation:
.. math::
:label: dist-to-boundary-1
- f(x + du, y + dv, z + dw) = 0
+ f(x_0 + du_0, y_0 + dv_0, z_0 + dw_0) = 0
If no solutions to equation :eq:`dist-to-boundary-1` exist or the only solutions
are complex, then the particle's direction of travel will not intersect the
@@ -147,6 +198,15 @@ traveling in its current direction, it will not hit the surface. The complete
derivation for different types of surfaces used in OpenMC will be presented in
the following sections.
+Since :math:f(x,y,z)` in general is quadratic in :math:`x`, :math:`y`, and
+:math:`z`, this implies that :math:`f(x_0 + du_0, y + dv_0, z + dw_0)` is
+quadratic in :math:`d`. Thus we expect at most two real solutions to
+:eq:`dist-to-boundary-1`. If no solutions to :eq:`dist-to-boundary-1` exist or
+the only solutions are complex, then the particle's direction of travel will not
+intersect the surface. If the solution to :eq:`dist-to-boundary-1` is negative,
+this means that the surface is "behind" the particle, i.e. if the particle
+continues traveling in its current direction, it will not hit the surface.
+
Once a distance has been computed to a surface, we need to check if it is closer
than previously-computed distances to surfaces. Unfortunately, we cannot just
use the minimum function because some of the calculated distances, which should
@@ -165,10 +225,6 @@ the minimum distance found thus far, and :math:`\epsilon` is a small number. In
OpenMC, this parameter is set to :math:`\epsilon = 10^{-14}` since all floating
calculations are done on 8-byte floating point numbers.
-Although they are not explicitly defined, it is also necessary to check the
-distance to surfaces representing lattice boundaries if a lattice exists on a
-given level.
-
Plane Perpendicular to an Axis
------------------------------
@@ -303,6 +359,8 @@ will then be either both positive or both negative. If they are both positive,
the smaller (closer) one will be the solution with a negative sign on the square
root of the discriminant.
+.. TODO: Need to add derivation for x-cone, y-cone, and z-cone.
+
.. _find-cell:
----------------------------
@@ -314,7 +372,7 @@ global coordinate system, i.e. if the particle's position is :math:`(x,y,z)`,
what cell is it currently in. This is done in the following manner in
OpenMC. With the possibility of multiple levels of coordinates, we must perform
a recursive search for the cell. First, we start in the highest (most global)
-universe which we call the base universe and do a loop over each cell within
+universe, which we call the base universe, and loop over each cell within
that universe. For each cell, we check whether the specified point is inside the
cell using the algorithm described in :ref:`cell-contains`. If the cell is
filled with a normal material, the search is done and we have identified the
@@ -331,30 +389,27 @@ is found that contains the specified point.
Determining if a Coordinate is in a Cell
----------------------------------------
-One aspect of being able to determine what cell a particle is in is determining
-if a particle's coordinates lie within a given cell. The current geometry
-implementation in OpenMC limits all cells to being simple cells, i.e. they are
-defined only with intersection of half-spaces and not unions, differences,
-etc. This makes the job of determining if a point is in a cell quite simple.
-
-The algorithm for determining if a cell contains a point is as follows. For each
-surface that bounds a cell, we determine the particle's sense with respect to
-the surface. As explained earlier, if we have a point :math:`(x_0,y_0,z_0)` and
-a surface :math:`f(x,y,z) = 0`, the point is said to have negative sense if
+To determine which cell a particle is in given its coordinates, we need to be
+able to check whether a given cell contains a point. The algorithm for
+determining if a cell contains a point is as follows. For each surface that
+bounds a cell, we determine the particle's sense with respect to the surface. As
+explained earlier, if we have a point :math:`(x_0,y_0,z_0)` and a surface
+:math:`f(x,y,z) = 0`, the point is said to have negative sense if
:math:`f(x_0,y_0,z_0) < 0` and positive sense if :math:`f(x_0,y_0,z_0) > 0`. If
for all surfaces, the sense of the particle with respect to the surface matches
the specified sense that defines the half-space within the cell, then the point
-is inside the cell.
+is inside the cell. Note that this algorithm works only for *simple cells*
+defined as intersections of half-spaces.
-Let us illustrate this idea with a concept. Let's say we have a cell defined as
+It may help to illustrate this algorithm using a simple example. Let's say we
+have a cell defined as
.. code-block:: xml
-
-
+
This means that the cell is defined as the intersection of the negative half
space of a sphere, the positive half-space of an x-plane, and the negative
@@ -368,9 +423,9 @@ satisfy the following equations
x - (-3) > 0 \\
x - 2 < 0
-So in order to determine if a point is inside the cell, we would plug its
-coordinates into equation :eq:`cell-contains-example` and if the inequalities
-are satisfied, than the point is indeed inside the cell.
+In order to determine if a point is inside the cell, we would substitute its
+coordinates into equation :eq:`cell-contains-example`. If the inequalities are
+satisfied, than the point is indeed inside the cell.
--------------------------
Handling Surface Crossings
@@ -390,9 +445,9 @@ travel of the particle so that we can evaluate cross sections based on its
material properties. At initialization, a list of neighboring cells is created
for each surface in the problem as described in :ref:`neighbor-lists`. The
algorithm outlined in :ref:`find-cell` is used to find a cell containing the
-particle except rather than searching all cells in the base universe, only the
-list of neighboring cells is searched. If this search is unsuccessful, then a
-search is done over every cell in the base universe.
+particle with one minor modification; rather than searching all cells in the
+base universe, only the list of neighboring cells is searched. If this search is
+unsuccessful, then a search is done over every cell in the base universe.
.. _neighbor-lists:
@@ -401,15 +456,15 @@ Building Neighbor Lists
-----------------------
After the geometry has been loaded and stored in memory from an input file,
-OpenMC builds a list for each surface containing any cells that contain the
-surface in their specification in order to speed up processing of surface
-crossings. The algorithm to build these lists is as follows. First, we loop over
-all cells in the geometry and count up how many times each surface appears in a
-specification as bounding a negative half-space and bounding a positive
-half-space. Two arrays are then allocated for each surface, one that lists each
-cell that contains the negative half-space of the surface and one that lists
-each cell that contains the positive half-space of the surface. Another loop is
-performed over all cells and the neighbor lists are populated for each surface.
+OpenMC builds a list for each surface containing any cells that are bounded by
+that surface in order to speed up processing of surface crossings. The algorithm
+to build these lists is as follows. First, we loop over all cells in the
+geometry and count up how many times each surface appears in a specification as
+bounding a negative half-space and bounding a positive half-space. Two arrays
+are then allocated for each surface, one that lists each cell that contains the
+negative half-space of the surface and one that lists each cell that contains
+the positive half-space of the surface. Another loop is performed over all cells
+and the neighbor lists are populated for each surface.
.. _reflection:
@@ -432,9 +487,9 @@ point of the surface crossing. The rationale for this can be understood by
noting that :math:`(\mathbf{v} \cdot \hat{\mathbf{n}}) \hat{\mathbf{n}}` is the
projection of the velocity vector onto the normal vector. By subtracting two
times this projection, the velocity is reflected with respect to the surface
-normal. Since the velocity of the particle will not change as it undergoes
-reflection, we can work with the direction of the particle instead, simplifying
-equation :eq:`reflection-v` to
+normal. Since the magnitude of the velocity of the particle will not change as
+it undergoes reflection, we can work with the direction of the particle instead,
+simplifying equation :eq:`reflection-v` to
.. math::
:label: reflection-omega
@@ -442,10 +497,10 @@ equation :eq:`reflection-v` to
\mathbf{\Omega'} = \mathbf{\Omega} - 2 (\mathbf{\Omega} \cdot
\hat{\mathbf{n}}) \hat{\mathbf{n}}
-
-The direction of the surface normal will be the gradient to the surface at the
-point of crossing, i.e. :math:`\mathbf{n} = \nabla f(x,y,z)`. Substituting this
-into equation :eq:`reflection-omega`, we get
+where :math:`\mathbf{v} = || \mathbf{v} || \mathbf{\Omega}`. The direction of
+the surface normal will be the gradient of the surface at the point of crossing,
+i.e. :math:`\mathbf{n} = \nabla f(x,y,z)`. Substituting this into equation
+:eq:`reflection-omega`, we get
.. math::
:label: reflection-omega-2
@@ -471,8 +526,8 @@ series of equations:
w' = w - \frac{2 ( \mathbf{\Omega} \cdot \nabla f )}{|| \nabla f ||^2}
\frac{\partial f}{\partial z}
-We can now use this form to develop rules for how to transform a particle's
-direction for different types of surfaces.
+One can then use equation :eq:`reflection-system` to develop equations for
+transforming a particle's direction given the equation of the surface.
Plane Perpendicular to an Axis
------------------------------
@@ -523,7 +578,8 @@ Cylinder Parallel to an Axis
A cylinder parallel to, for example, the x-axis has the form :math:`f(x,y,z) =
(y - y_0)^2 + (z - z_0)^2 - R^2 = 0`. Thus, the gradient to the surface is
-.. math:: :label: reflection-cylinder-grad
+.. math::
+ :label: reflection-cylinder-grad
\nabla f = 2 \left ( \begin{array}{c} 0 \\ y - y_0 \\ z - z_0 \end{array}
\right ) = 2 \left ( \begin{array}{c} 0 \\ \bar{y} \\ \bar{z} \end{array}
@@ -532,13 +588,15 @@ A cylinder parallel to, for example, the x-axis has the form :math:`f(x,y,z) =
where we have introduced the constants :math:`\bar{y}` and
:math:`\bar{z}`. Taking the square of the norm of the gradient, we find that
-.. math:: :label: reflection-cylinder-norm
+.. math::
+ :label: reflection-cylinder-norm
|| \nabla f ||^2 = 4 \bar{y}^2 + 4 \bar{z}^2 = 4 R^2
This implies that
-.. math:: :label: reflection-cylinder-constant
+.. math::
+ :label: reflection-cylinder-constant
\frac{2 (\mathbf{\Omega} \cdot \nabla f)}{|| \nabla f ||^2} =
\frac{\bar{y}v + \bar{z}w}{R^2}
@@ -548,7 +606,8 @@ Substituting equations :eq:`reflection-cylinder-constant` and
the form of the solution. In this case, the x-component will not change. The y-
and z-components of the reflected direction will be
-.. math:: :label: reflection-cylinder
+.. math::
+ :label: reflection-cylinder
v' = v - \frac{2 ( \bar{y}v + \bar{z}w ) \bar{y}}{R^2} \\
@@ -561,7 +620,8 @@ Sphere
The surface equation for a sphere has the form :math:`f(x,y,z) = (x - x_0)^2 +
(y - y_0)^2 + (z - z_0)^2 - R^2 = 0`. Thus, the gradient to the surface is
-.. math:: :label: reflection-sphere-grad
+.. math::
+ :label: reflection-sphere-grad
\nabla f = 2 \left ( \begin{array}{c} x - x_0 \\ y - y_0 \\ z - z_0
\end{array} \right ) = 2 \left ( \begin{array}{c} \bar{x} \\ \bar{y} \\
@@ -570,13 +630,15 @@ The surface equation for a sphere has the form :math:`f(x,y,z) = (x - x_0)^2 +
where we have introduced the constants :math:`\bar{x}, \bar{y}, \bar{z}`. Taking
the square of the norm of the gradient, we find that
-.. math:: :label: reflection-sphere-norm
+.. math::
+ :label: reflection-sphere-norm
|| \nabla f ||^2 = 4 \bar{x}^2 + 4 \bar{y}^2 + 4 \bar{z}^2 = 4 R^2
This implies that
-.. math:: :label: reflection-sphere-constant
+.. math::
+ :label: reflection-sphere-constant
\frac{2 (\mathbf{\Omega} \cdot \nabla f)}{|| \nabla f ||^2} =
\frac{\bar{x}u + \bar{y}v + \bar{z}w}{R^2}
@@ -585,14 +647,16 @@ Substituting equations :eq:`reflection-sphere-constant` and
:eq:`reflection-sphere-grad` into equation :eq:`reflection-system` gives us the
form of the solution:
-.. math:: :label: reflection-sphere
+.. math::
+ :label: reflection-sphere
u' = u - \frac{2 ( \bar{x}u + \bar{y}v + \bar{z}w ) \bar{x} }{R^2} \\
v' = v - \frac{2 ( \bar{x}u + \bar{y}v + \bar{z}w ) \bar{y} }{R^2} \\
- w' = w - \frac{2 ( \bar{x}u + \bar{y}v + \bar{z}w ) \bar{z} }{R^2} \\
+ w' = w - \frac{2 ( \bar{x}u + \bar{y}v + \bar{z}w ) \bar{z} }{R^2}
+.. TODO: Add in derivation for cone surfaces.
.. _constructive solid geometry: http://en.wikipedia.org/wiki/Constructive_solid_geometry
.. _surfaces: http://en.wikipedia.org/wiki/Surface
diff --git a/docs/source/methods/index.rst b/docs/source/methods/index.rst
index 56de78a169..0ff4fb1988 100644
--- a/docs/source/methods/index.rst
+++ b/docs/source/methods/index.rst
@@ -9,9 +9,10 @@ Theory and Methodology
:maxdepth: 3
introduction
- criticality
- statistics
geometry
+ cross_sections
+ random_numbers
physics
tallies
+ eigenvalue
parallelization
diff --git a/docs/source/methods/introduction.rst b/docs/source/methods/introduction.rst
index 806ed9b371..508ac99193 100644
--- a/docs/source/methods/introduction.rst
+++ b/docs/source/methods/introduction.rst
@@ -45,13 +45,13 @@ following steps:
- Initialize the pseudorandom number generator.
- - Read ACE format cross-sections specified in the problem.
+ - Read ACE format cross sections specified in the problem.
- If using a special energy grid treatment such as a union energy grid or
lethargy bins, that must be initialized as well.
- In a fixed source problem, source sites are sampled from the specified
- source. In a criticality problem, source sites are sampled from some initial
+ source. In an eigenvalue problem, source sites are sampled from some initial
source distribution or from a source file. The source sites consist of
coordinates, a direction, and an energy.
@@ -64,15 +64,15 @@ proceed. The life of a single particle will proceed as follows:
2. Based on the particle's coordinates, the current cell in which the particle
resides is determined.
- 3. The energy-dependent cross-sections for the material that the particle is
+ 3. The energy-dependent cross sections for the material that the particle is
currently in are determined. Note that this includes the total
- cross-section, which is not pre-calculated.
+ cross section, which is not pre-calculated.
4. The distance to the nearest boundary of the particle's cell is determined
based on the bounding surfaces to the cell.
5. The distance to the next collision is sampled. If the total material
- cross-section is :math:`\Sigma_t`, this can be shown to be
+ cross section is :math:`\Sigma_t`, this can be shown to be
.. math::
@@ -88,7 +88,7 @@ proceed. The life of a single particle will proceed as follows:
7. The material at the collision site may consist of multiple nuclides. First,
the nuclide with which the collision will happen is sampled based on the
- total cross-sections. If the total cross section of material :math:`i` is
+ total cross sections. If the total cross section of material :math:`i` is
:math:`\Sigma_{t,i}`, then the probability that any nuclide is sampled is
.. math::
@@ -97,7 +97,7 @@ proceed. The life of a single particle will proceed as follows:
8. Once the specific nuclide is sampled, the random samples a reaction for
that nuclide based on the microscopic cross sections. If the microscopic
- cross-section for some reaction :math:`x` is :math:`\sigma_x` and the total
+ cross section for some reaction :math:`x` is :math:`\sigma_x` and the total
microscopic cross section for the nuclide is :math:`\sigma_t`, then the
probability that reaction :math:`x` will occur is
@@ -106,8 +106,8 @@ proceed. The life of a single particle will proceed as follows:
P(x) = \frac{\sigma_x}{\sigma_t}.
9. If the sampled reaction is elastic or inelastic scattering, the outgoing
- energy and angle is sampled from the appropriate distribution. If the
- reaction is (n,xn), it's also treated as scattering and the weight of the
+ energy and angle is sampled from the appropriate distribution. Reactions
+ of type :math:`(n,xn)` are treated as scattering and the weight of the
particle is increased by the multiplicity of the reaction. The particle
then continues from step 3. If the reaction is absorption or fission, the
particle dies and if necessary, fission sites are created and stored in the
@@ -121,7 +121,7 @@ be performed before the run is finished. This include the following:
- All tallies and other results are written to disk.
- - If requested, a source file is written to disk
+ - If requested, a source file is written to disk.
- All allocatable arrays are deallocated.
diff --git a/docs/source/methods/physics.rst b/docs/source/methods/physics.rst
index 0ed40130dd..c79144dfe3 100644
--- a/docs/source/methods/physics.rst
+++ b/docs/source/methods/physics.rst
@@ -18,16 +18,15 @@ distribution function for the distance to its next collision :math:`\ell` is
where :math:`\Sigma_t` is the total macroscopic cross section of the
material. Equation :eq:`distance-pdf` tells us that the further the distance is
-to the next collision, the less likely the particle will travel that distance,
-which should agree with your intuition. In order to sample the probability
-distribution function, we first need to convert it to a cumulative distribution
-function
+to the next collision, the less likely the particle will travel that
+distance. In order to sample the probability distribution function, we first
+need to convert it to a cumulative distribution function
.. math::
:label: distance-cdf
\int_0^{\ell} d\ell' p(\ell') = \int_0^{\ell} d\ell' \Sigma_t e^{-\Sigma_t
- \ell'} = 1 - e^{-\Sigma_t \ell}
+ \ell'} = 1 - e^{-\Sigma_t \ell}.
By setting the cumulative distribution function equal to :math:`\xi`, a random
number on the unit interval, and solving for the distance :math:`\ell`, we
@@ -36,7 +35,7 @@ obtain a formula for sampling the distance to next collision:
.. math::
:label: sample-distance-1
- \ell = -\frac{\ln (1 - \xi)}{\Sigma_t}
+ \ell = -\frac{\ln (1 - \xi)}{\Sigma_t}.
Since :math:`\xi` is uniformly distributed on :math:`[0,1)`, this implies that
:math:`1 - \xi` is also uniformly distributed on :math:`[0,1)` as well. Thus,
@@ -47,17 +46,242 @@ the formula usually used to calculate the distance to next collision is
\ell = -\frac{\ln \xi}{\Sigma_t}
+----------------------------------------------------
+:math:`(n,\gamma)` and Other Disappearance Reactions
+----------------------------------------------------
+
+All absorption reactions other than fission do not produce any secondary
+neutrons. As a result, these are the easiest type of reactions to handle. When a
+collision occurs, the first step is to sample a nuclide within a material. Once
+the nuclide has been sampled, then a specific reaction for that nuclide is
+sampled. Since the total absorption cross section is pre-calculated at the
+beginning of a simulation, the first step in sampling a reaction is to determine
+whether a "disappearance" reaction occurs where no secondary neutrons are
+produced. This is done by sampling a random number :math:`\xi` on the interval
+:math:`[0,1)` and checking whether
+
+.. math::
+ :label: disappearance
+
+ \xi \sigma_t (E) < \sigma_a (E) - \sigma_f (E)
+
+where :math:`\sigma_t` is the total cross section, :math:`\sigma_a` is the
+absorption cross section (this includes fission), and :math:`\sigma_f` is the
+total fission cross section. If this condition is met, then the neutron is
+killed and we proceed to simulate the next neutron from the source bank.
+
+No secondary particles from disappearance reactions such as photons or
+alpha-particles are produced or tracked. To truly capture the affects of gamma
+heating in a problem, it would be necessary to explicitly track photons
+originating from :math:`(n,\gamma)` and other reactions.
+
+------------------
+Elastic Scattering
+------------------
+
+Elastic scattering refers to the process by which a neutron scatters off a
+nucleus and does not leave it in an excited. It is referred to as "elastic"
+because in the center-of-mass system, the neutron does not actually lose
+energy. However, in lab coordinates, the neutron does indeed lose
+energy. Elastic scattering can be treated exactly in a Monte Carlo code thanks
+to its simplicity.
+
+Let us discuss how OpenMC handles two-body elastic scattering kinematics. The
+first step is to determine whether the target nucleus has any associated
+motion. Above a certain energy threshold (400 kT by default), all scattering is
+assumed to take place with the target at rest. Below this threshold though, we
+must account for the thermal motion of the target nucleus. Methods to sample the
+velocity of the target nucleus are described later in section
+:ref:`freegas`. For the time being, let us assume that we have sampled the
+target velocity :math:`\mathbf{v}_t`. The velocity of the center-of-mass system
+is calculated as
+
+.. math::
+ :label: velocity-com
+
+ \mathbf{v}_{cm} = \frac{\mathbf{v}_n + A \mathbf{v}_t}{A + 1}
+
+where :math:`\mathbf{v}_n` is the velocity of the neutron and :math:`A` is the
+atomic mass of the target nucleus measured in neutron masses (commonly referred
+to as the *atomic weight ratio*). With the velocity of the center-of-mass
+calculated, we can then determine the neutron's velocity in the center-of-mass
+system:
+
+.. math::
+ :label: velocity-neutron-com
+
+ \mathbf{V}_n = \mathbf{v}_n - \mathbf{v}_{cm}
+
+where we have used uppercase :math:`\mathbf{V}` to denote the center-of-mass
+system. The direction of the neutron in the center-of-mass system is
+
+.. math::
+ :label: angle-neutron-com
+
+ \mathbf{\Omega}_n = \frac{\mathbf{V}_n}{|| \mathbf{V}_n ||}.
+
+At low energies, elastic scattering will be isotropic in the center-of-mass
+system, but for higher energies, there may be p-wave and higher order scattering
+that leads to anisotropic scattering. Thus, in general, we need to sample a
+cosine of the scattering angle which we will refer to as :math:`\mu`. For
+elastic scattering, the secondary angle distribution is always given in the
+center-of-mass system and is sampled according to the procedure outlined in
+:ref:`sample-angle`. After the cosine of the angle of scattering has been
+sampled, we need to determine the neutron's new direction
+:math:`\mathbf{\Omega}'_n` in the center-of-mass system. This is done with the
+procedure in :ref:`transform-coordinates`. The new direction is multiplied by
+the speed of the neutron in the center-of-mass system to obtain the new velocity
+vector in the center-of-mass:
+
+.. math::
+ :label: velocity-neutron-com-2
+
+ \mathbf{V}'_n = || \mathbf{V}_n || \mathbf{\Omega}'_n.
+
+Finally, we transform the velocity in the center-of-mass system back to lab
+coordinates:
+
+.. math::
+ :label: velocity-neutron-lab
+
+ \mathbf{v}'_n = \mathbf{V}'_n + \mathbf{v}_{cm}
+
+In OpenMC, the angle and energy of the neutron are stored rather than the
+velocity vector itself, so the post-collision angle and energy can be inferred
+from the post-collision velocity of the neutron in the lab system.
+
+For tallies that require the scattering cosine, it is important to store the
+scattering cosine in the lab system. If we know the scattering cosine in the
+center-of-mass, the scattering cosine in the lab system can be calculated as
+
+.. math::
+ :label: cosine-lab
+
+ \mu_{lab} = \frac{1 + A\mu}{\sqrt{A^2 + 2A\mu + 1}}.
+
+However, equation :eq:`cosine-lab` is only valid if the target was at rest. When
+the target nucleus does have thermal motion, the cosine of the scattering angle
+can be determined by simply taking the dot product of the neutron's initial and
+final direction in the lab system.
+
+.. _inelastic-scatter:
+
+--------------------
+Inelastic Scattering
+--------------------
+
+The major algorithms for inelastic scattering were described in previous
+sections. First, a scattering cosine is sampled using the algorithms in
+:ref:`sample-angle`. Then an outgoing energy is sampled using the algorithms in
+:ref:`sample-energy`. If the outgoing energy and scattering cosine were given in
+the center-of-mass system, they are transformed to laboratory coordinates using
+the algorithm described in :ref:`transform-coordinates`. Finally, the direction
+of the particle is changed also using the procedure in
+:ref:`transform-coordinates`.
+
+Although inelastic scattering leaves the target nucleus in an excited state, no
+secondary photons from nuclear de-excitation are tracked in OpenMC.
+
+------------------------
+:math:`(n,xn)` Reactions
+------------------------
+
+These types of reactions are just treated as inelastic scattering and as such
+are subject to the same procedure as described in
+:ref:`inelastic-scatter`. Rather than tracking multiple secondary neutrons, the
+weight of the outgoing neutron is multiplied by the number of secondary
+neutrons, e.g. for :math:`(n,2n)`, only one outgoing neutron is tracked but its
+weight is doubled.
+
+.. _fission:
+
+-------
+Fission
+-------
+
+While fission is normally considered an absorption reaction, as far as it
+concerns a Monte Carlo simulation it actually bears more similarities to
+inelastic scattering since fission results in secondary neutrons in the exit
+channel. Other absorption reactions like :math:`(n,\gamma)` or
+:math:`(n,\alpha)`, on the contrary, produce no neutrons. There are a few other
+idiosyncrasies in treating fission. In an eigenvalue calculation, secondary
+neutrons from fission are only "banked" for use in the next generation rather
+than being tracked as secondary neutrons from elastic and inelastic scattering
+would be. On top of this, fission is sometimes broken into first-chance fission,
+second-chance fission, etc. An ACE table either lists the partial fission
+reactions with secondary energy distributions for each one, or a total fission
+reaction with a single secondary energy distribution.
+
+When a fission reaction is sampled in OpenMC (either total fission or, if data
+exists, first- or second-chance fission), the following algorithm is used to
+create and store fission sites for the following generation. First, the average
+number of prompt and delayed neutrons must be determined to decide whether the
+secondary neutrons will be prompt or delayed. This is important because delayed
+neutrons have a markedly different spectrum from prompt neutrons, one that has a
+lower average energy of emission. The total number of neutrons emitted
+:math:`\nu_t` is given as a function of incident energy in the ACE format. Two
+representations exist for :math:`\nu_t`. The first is a polynomial of order
+:math:`N` with coefficients :math:`c_0,c_1,\dots,c_N`. If :math:`\nu_t` has this
+format, we can evaluate it at incoming energy :math:`E` by using the equation
+
+.. math::
+ :label: nu-polynomial
+
+ \nu_t (E) = \sum_{i = 0}^N c_i E^i.
+
+The other representation is just a tabulated function with a specified
+interpolation law. The number of prompt neutrons released per fission event
+:math:`\nu_p` is also given as a function of incident energy and can be
+specified in a polynomial or tabular format. The number of delayed neutrons
+released per fission event :math:`\nu_d` can only be specified in a tabular
+format. In practice, we only need to determine :math:`nu_t` and
+:math:`nu_d`. Once these have been determined, we can calculated the delayed
+neutron fraction
+
+.. math::
+ :label: beta
+
+ \beta = \frac{\nu_d}{\nu_t}.
+
+We then need to determine how many total neutrons should be emitted from
+fission. If no survival biasing is being used, then the number of neutrons
+emitted is
+
+.. math::
+ :label: fission-neutrons
+
+ \nu = \frac{w \nu_t}{k_{eff}}
+
+where :math:`w` is the statistical weight and :math:`k_{eff}` is the effective
+multiplication factor from the previous generation. The number of neutrons
+produced is biased in this manner so that the expected number of fission
+neutrons produced is the number of source particles that we started with in the
+generation. Since :math:`\nu` is not an integer, we use the following procedure
+to obtain an integral number of fission neutrons to produce. If :math:`\xi >
+\nu - \lfloor \nu \rfloor`, then we produce :math:`\lfloor \nu \rfloor`
+neutrons. Otherwise, we produce :math:`\lfloor \nu \rfloor + 1` neutrons. Then,
+for each fission site produced, we sample the outgoing angle and energy
+according to the algorithms given in :ref:`sample-angle` and
+:ref:`sample-energy` respectively. If the neutron is to be born delayed, then
+there is an extra step of sampling a delayed neutron precursor group since they
+each have an associated secondary energy distribution.
+
+The sampled outgoing angle and energy of fission neutrons along with the
+position of the collision site are stored in an array called the fission
+bank. In a subsequent generation, these fission bank sites are used as starting
+source sites.
+
-----------------------------------------
Secondary Angles and Energy Distributions
-----------------------------------------
For any reactions with secondary neutrons, it is necessary to sample secondary
angle and energy distributions. This includes elastic and inelastic scattering,
-fission, and (n,xn) reactions. In some cases, the distributions may be specified
-separately, and in other cases, they may be specified as a correlated
-angle-energy distribution. In this section, we will outline the methods used to
-sample secondary distributions as well as how they are used to modify the state
-of a particle.
+fission, and :math:`(n,xn)` reactions. In some cases, the angle and energy
+distributions may be specified separately, and in other cases, they may be
+specified as a correlated angle-energy distribution. In the following sections,
+we will outline the methods used to sample secondary distributions as well as
+how they are used to modify the state of a particle.
.. _sample-angle:
@@ -85,19 +309,19 @@ of the scattering angle is simply calculated as
\mu = 2\xi - 1
-where :math:`\xi` is a random number sampled uniformly on :math:`[0,1)`.
+where :math:`\mu` is the cosine of the scattering angle and :math:`\xi` is a
+random number sampled uniformly on :math:`[0,1)`.
Equiprobable Angle Bin Distribution
+++++++++++++++++++++++++++++++++++
-For a 32 equiprobable bin distribution, the procedure to determine the
-scattering cosine is as follows. First, we select a random number :math:`\xi` to
+For a 32 equiprobable bin distribution, we select a random number :math:`\xi` to
sample a cosine bin :math:`i` such that
.. math::
:label: equiprobable-bin
- i = 1 + \lfloor 32\xi \rfloor
+ i = 1 + \lfloor 32\xi \rfloor.
The same random number can then also be used to interpolate between neighboring
:math:`\mu` values to get the final scattering cosine:
@@ -107,17 +331,19 @@ The same random number can then also be used to interpolate between neighboring
\mu = \mu_i + (32\xi - i) (\mu_{i+1} - \mu_i)
+where :math:`\mu_i` is the :math:`i`-th scattering cosine.
+
.. _angle-tabular:
Tabular Angular Distribution
++++++++++++++++++++++++++++
-As the MCNP Manual points out, using an equiprobable bin distribution works well
-for high-probability regions of the scattering cosine probability, but for
-low-probability regions it is not very accurate. Thus, a more typical treatment
-is to represent the scattering cosine with a tabular distribution. In this case,
-we have a table of cosines and their corresponding values for a probability
-distributions function and cumulative distribution function. For each incoming
+As the `MCNP Manual`_ points out, using an equiprobable bin distribution works
+well for high-probability regions of the scattering cosine probability, but for
+low-probability regions it is not very accurate. Thus, a more accurate method is
+to represent the scattering cosine with a tabular distribution. In this case, we
+have a table of cosines and their corresponding values for a probability
+distribution function and cumulative distribution function. For each incoming
neutron energy :math:`E_i`, let us call :math:`p_{i,j}` the j-th value in the
probability distribution function and :math:`c_{i,j}` the j-th value in the
cumulative distribution function. We first find the interpolation factor on the
@@ -132,7 +358,7 @@ where :math:`E` is the incoming energy of the particle. Then, statistical
interpolation is performed to choose between using the cosines and distribution
functions corresponding to energy :math:`E_i` and :math:`E_{i+1}`. Let
:math:`\ell` be the chosen table where :math:`\ell = i` if :math:`\xi_1 > f` and
-:math:`\ell = i + 1` otherwise where :math:`\xi_1` is a random number. Another
+:math:`\ell = i + 1` otherwise, where :math:`\xi_1` is a random number. Another
random number :math:`\xi_2` is used to sample a scattering cosine bin :math:`j`
using the cumulative distribution function:
@@ -160,8 +386,9 @@ is the probability distribution function. Since we know that
c(\mu) = c_{\ell,j} + \int_{\mu_{\ell,j}}^{\mu} p(\mu') d\mu'
-For histogram interpolation, we have that :math:`p(\mu') = p_{\ell,j}`. Thus,
-after integration we have that
+For histogram interpolation, we have that :math:`p(\mu') = p_{\ell,j}` for
+:math:`\mu_{\ell,j} \le \mu' < \mu_{\ell,j+1}`. Thus, after integrating
+:eq:`cdf-2` we have that
.. math::
:label: cumulative-dist-histogram
@@ -174,7 +401,7 @@ interpolation:
.. math::
:label: cosine-histogram
- \mu = \mu_{\ell,j} + \frac{\xi_2 - c_{\ell,j}}{p_{\ell,j}}
+ \mu = \mu_{\ell,j} + \frac{\xi_2 - c_{\ell,j}}{p_{\ell,j}}.
For linear-linear interpolation, we represent the function :math:`p(\mu')` as a
first-order polynomial in :math:`\mu'`. If we interpolate between successive
@@ -194,7 +421,7 @@ into equation :eq:`cdf-2`, we obtain
c(\mu) = c_{\ell,j} + \int_{\mu_{\ell,j}}^{\mu} \left [ \frac{p_{\ell,j+1} -
p_{\ell,j}}{\mu_{\ell,j+1} - \mu_{\ell,j}} (\mu' - \mu_{\ell,j}) +
- p_{\ell,j} \right ] d\mu'
+ p_{\ell,j} \right ] d\mu'.
Let us now make a change of variables using
@@ -202,7 +429,7 @@ Let us now make a change of variables using
:label: introduce-eta
\eta = \frac{p_{\ell,j+1} - p_{\ell,j}}{\mu_{\ell,j+1} - \mu_{\ell,j}}
- (\mu' - \mu_{\ell,j}) + p_{\ell,j}
+ (\mu' - \mu_{\ell,j}) + p_{\ell,j}.
Equation :eq:`cdf-linlin` then becomes
@@ -217,7 +444,7 @@ where we have used
.. math::
:label: slope
- m = \frac{p_{\ell,j+1} - p_{\ell,j}}{\mu_{\ell,j+1} - \mu_{\ell,j}}
+ m = \frac{p_{\ell,j+1} - p_{\ell,j}}{\mu_{\ell,j+1} - \mu_{\ell,j}}.
Integrating equation :eq:`cdf-linlin-eta`, we have
@@ -242,9 +469,9 @@ Sampling Secondary Energy and Correlated Angle/Energy Distributions
-------------------------------------------------------------------
For a reaction with secondary neutrons, it is necessary to determine the
-outgoing energy of the neutrons. For anything other than elastic scattering, the
-outgoing energy must be determined based on tabulated or parameterized data. The
-`ENDF-6 Format`_ specifies a variety of ways that the secondary energy
+outgoing energy of the neutrons. For any reaction other than elastic scattering,
+the outgoing energy must be determined based on tabulated or parameterized
+data. The `ENDF-6 Format`_ specifies a variety of ways that the secondary energy
distribution can be represented. ENDF File 5 contains uncorrelated energy
distribution where ENDF File 6 contains correlated energy-angle
distributions. The ACE format specifies its own representations based loosely on
@@ -253,12 +480,12 @@ energy of secondary particles is determined based on each ACE law.
One of the subtleties in the ACE format is the fact that a single reaction can
have multiple secondary energy distributions. This is mainly useful for
-reactions with multiple neutrons in the exit channel such as (n,2n) or
-(n,3n). In these types of reactions, each neutron is emitted corresponding to a
-different excitation level of the compound nucleus, and thus in general the
-neutrons will originate from different energy distributions. The first step in
-sampling a secondary energy is to sample between multiple energy distributions
-if more than one is present.
+reactions with multiple neutrons in the exit channel such as :math:`(n,2n)` or
+:math:`(n,3n)`. In these types of reactions, each neutron is emitted
+corresponding to a different excitation level of the compound nucleus, and thus
+in general the neutrons will originate from different energy distributions. If
+multiple energy distributions are present, they are assigned probabilities that
+can then be used to randomly select one.
Once a secondary energy distribution has been sampled, the procedure for
determining the outgoing energy will depend on which ACE law has been specified
@@ -272,11 +499,11 @@ ACE Law 1 - Tabular Equiprobable Energy Bins
In the tabular equiprobable bin representation, an array of equiprobable
outgoing energy bins is given for a number of incident energies. While the
representation itself is simple, the complexity lies in how one interpolates
-between incident as well as outgoing energies on such a table. If one does
+between incident as well as outgoing energies on such a table. If one performs
simple interpolation between tables for neighboring incident energies, it is
-possible for the resulting energies to violate laws governing the kinematics,
-i.e. the outgoing energy may be outside the range of available energy in the
-reaction.
+possible that the resulting energies would violate laws governing the
+kinematics, i.e. the outgoing energy may be outside the range of available
+energy in the reaction.
To avoid this situation, the accepted practice is to use a process known as
scaled interpolation [Doyas]_. First, we find the tabulated incident energies
@@ -298,7 +525,7 @@ corresponding to the incoming energy :math:`E_i`, and :math:`M` is the number of
outgoing energy bins. Next, statistical interpolation is performed to choose
between using the outgoing energy distributions corresponding to energy
:math:`E_i` and :math:`E_{i+1}`. Let :math:`\ell` be the chosen table where
-:math:`\ell = i` if :math:`\xi_1 > f` and :math:`\ell = i + 1` otherwise where
+:math:`\ell = i` if :math:`\xi_1 > f` and :math:`\ell = i + 1` otherwise, and
:math:`\xi_1` is a random number. Now, we randomly sample an equiprobable
outgoing energy bin :math:`j` and interpolate between successive values on the
outgoing energy distribution:
@@ -322,7 +549,7 @@ energy:
ACE Law 3 - Inelastic Level Scattering
++++++++++++++++++++++++++++++++++++++
-It can be shown [Foderaro]_ that in inelastic level scattering, the outgoing
+It can be shown (see Foderaro_) that in inelastic level scattering, the outgoing
energy of the neutron :math:`E'` can be related to the Q-value of the reaction
and the incoming energy:
@@ -352,7 +579,7 @@ calculating an interpolation factor :math:`f` with equation
:eq:`interpolation-factor`. Next, statistical interpolation is performed to
choose between using the outgoing energy distributions corresponding to energy
:math:`E_i` and :math:`E_{i+1}`. Let :math:`\ell` be the chosen table where
-:math:`\ell = i` if :math:`\xi_1 > f` and :math:`\ell = i + 1` otherwise where
+:math:`\ell = i` if :math:`\xi_1 > f` and :math:`\ell = i + 1` otherwise, and
:math:`\xi_1` is a random number. Then, we sample an outgoing energy bin
:math:`j` using the cumulative distribution function:
@@ -371,7 +598,7 @@ energy on the :math:`\ell`-th distribution is
.. math::
:label: energy-histogram
- \hat{E} = E_{\ell,j} + \frac{\xi_2 - c_{\ell,j}}{p_{\ell,j}}
+ \hat{E} = E_{\ell,j} + \frac{\xi_2 - c_{\ell,j}}{p_{\ell,j}}.
If linear-linear interpolation is to be used, the outgoing energy on the
:math:`\ell`-th distribution is
@@ -382,7 +609,7 @@ If linear-linear interpolation is to be used, the outgoing energy on the
\hat{E} = E_{\ell,j} + \frac{E_{\ell,j+1} - E_{\ell,j}}{p_{\ell,j+1} -
p_{\ell,j}} \left ( \sqrt{p_{\ell,j}^2 + 2 \frac{p_{\ell,j+1} -
p_{\ell,j}}{E_{\ell,j+1} - E_{\ell,j}} ( \xi_2 - c_{\ell,j} )} - p_{\ell,j}
- \right )
+ \right ).
Since this outgoing energy may violate reaction kinematics, we then scale it to
minimum and maximum energies interpolated between the neighboring outgoing
@@ -479,12 +706,12 @@ form
p(E') dE' = c e^{-E'/a(E)} \sinh \sqrt{b(E) \, E'} dE'
where :math:`a` and :math:`b` are parameters for the distribution and are given
-as tabulated functions of the incoming energy of the neutron in the ACE
-format. These two parameters are interpolated on the incoming energy grid using
-a specified interpolation law. Once the parameters have been determined, we
-sample a Maxwellian spectrum with nuclear temperature :math:`a` using the
-algorithm described in :ref:`maxwell` to get an energy :math:`W`. Then, the
-outgoing energy is calculated as
+as tabulated functions of the incoming energy of the neutron. These two
+parameters are interpolated on the incoming energy grid using a specified
+interpolation law. Once the parameters have been determined, we sample a
+Maxwellian spectrum with nuclear temperature :math:`a` using the algorithm
+described in :ref:`maxwell` to get an energy :math:`W`. Then, the outgoing
+energy is calculated as
.. math::
:label: watt-E
@@ -523,7 +750,7 @@ outgoing energy grid. For histogram interpolation, the parameters are
:label: KM-parameters-histogram
R = R_{\ell,j} \\
- A = A_{\ell,j}
+ A = A_{\ell,j}.
If linear-linear interpolation is specified, the parameters are
@@ -543,7 +770,7 @@ the scattering angle is
:label: KM-pdf-angle
p(\mu) d\mu = \frac{A}{2 \sinh (A)} \left [ \cosh (A\mu) + R \sinh (A\mu)
- \right ] d\mu
+ \right ] d\mu.
The rules for sampling this probability distribution function can be derived
based on rules C39 and C40 in the `Monte Carlo Sampler`_. First, we sample two
@@ -561,7 +788,7 @@ outgoing angle is
.. math::
:label: KM-angle-2
- \mu = \frac{1}{A} \ln \left ( \xi_4 e^A + (1 - \xi_4) e^{-A} \right )
+ \mu = \frac{1}{A} \ln \left ( \xi_4 e^A + (1 - \xi_4) e^{-A} \right ).
ACE Law 61 - Correlated Energy and Angle Distribution
@@ -646,15 +873,16 @@ calculated as
E' = \frac{x}{x + y} E_i^{max}
There are two important notes to make regarding the N-body phase space
-distribution. First, the documentation (and code) for MCNP5 has a mistake in the
-algorithm for :math:`n = 4`. That being said, there are no existing nuclear data
-evaluations which use an N-body phase space distribution with :math:`n = 4`, so
-the error would not affect any calculations. In the ENDF/B-VII.0 nuclear data
-evaluation, only one reaction uses an N-body phase space distribution at all,
-the (n,2n) reaction with H-2.
+distribution. First, the documentation (and code) for MCNP5-1.60 has a mistake
+in the algorithm for :math:`n = 4`. That being said, there are no existing
+nuclear data evaluations which use an N-body phase space distribution with
+:math:`n = 4`, so the error would not affect any calculations. In the
+ENDF/B-VII.0 nuclear data evaluation, only one reaction uses an N-body phase
+space distribution at all, the :math:`(n,2n)` reaction with H-2.
.. _transform-coordinates:
+-------------------------------------
Transforming a Particle's Coordinates
-------------------------------------
@@ -680,7 +908,7 @@ center-of-mass and laboratory is
:label: angle-com-to-lab
\mu = \mu_{cm} \sqrt{\frac{E'_{cm}}{E'}} + \frac{1}{A + 1}
- \sqrt{\frac{E}{E'}}.
+ \sqrt{\frac{E}{E'}}
where :math:`\mu` is the scattering cosine in the laboratory system. The
scattering cosine still only tells us the cosine of the angle between the
@@ -701,292 +929,18 @@ the post-collision direction is calculated as
v' = \mu v + \frac{\sqrt{1 - \mu^2} ( vw \cos\phi + u \sin\phi )}{\sqrt{1 -
w^2}} \\
- w' = \mu w - \sqrt{1 - \mu^2} \sqrt{1 - w^2} \cos\phi
-
-------------------
-Elastic Scattering
-------------------
-
-Elastic scattering refers to the process by which a neutron scatters off a
-nucleus and does not leave it in an excited. It is referred to as "elastic"
-because in the center-of-mass system, the neutron does not actually lose
-energy. However, in lab coordinates, the neutron does indeed lose
-energy. Elastic scattering can be treated exactly in a Monte Carlo code thanks
-to its simplicity.
-
-Let us discuss how OpenMC handles two-body elastic scattering kinematics. The
-first step is to determine whether the target nucleus has any associated
-motion. Above a certain energy threshold (400 kT by default), all scattering is
-assumed to take place with the target at rest. Below this threshold though, we
-must account for the thermal motion of the target nucleus. Methods to sample the
-velocity of the target nucleus are described later in section
-:ref:`freegas`. For the time being, let us assume that we have sampled the
-target velocity :math:`v_t`. The velocity of the center-of-mass system is
-calculated as
-
-.. math::
- :label: velocity-com
-
- \mathbf{v}_{cm} = \frac{\mathbf{v}_n + A \mathbf{v}_t}{A + 1}
-
-where :math:`\mathbf{v}_n` is the velocity of the neutron and :math:`A` is the
-atomic mass of the target nucleus measured in neutron masses (commonly referred
-to as the atomic weight ratio). With the velocity of the center-of-mass
-calculated, we can then determine the neutron's velocity in the center-of-mass
-system:
-
-.. math::
- :label: velocity-neutron-com
-
- \mathbf{V}_n = \mathbf{v}_n - \mathbf{v}_{cm}
-
-where we have used uppercase :math:`\mathbf{V}` to denote the center-of-mass
-system. The direction of the neutron in the center-of-mass system is
-
-.. math::
- :label: angle-neutron-com
-
- \mathbf{\Omega}_n = \frac{\mathbf{V}_n}{|| \mathbf{V}_n ||}
-
-At low energies, elastic scattering will be isotropic in the center-of-mass
-system, but for higher energies, there may be p-wave and higher order scattering
-that leads to anisotropic scattering. Thus, in general, we need to sample a
-cosine of the scattering angle which we will refer to as :math:`\mu`. For
-elastic scattering, the secondary angle distribution is always given in the
-center-of-mass system and is sampled according to the procedure outlined in
-:ref:`sample-angle`. After the cosine of the angle of scattering has been
-sampled, we need to determine the neutron's new direction
-:math:`\mathbf{\Omega}'_n` in the center-of-mass system. This is done with the
-procedure in :ref:`transform-coordinates`. The new direction is multiplied by
-the speed of the neutron in the center-of-mass system to obtain the new velocity
-vector in the center-of-mass:
-
-.. math::
- :label: velocity-neutron-com-2
-
- \mathbf{V}'_n = || \mathbf{V}_n || \mathbf{\Omega}'_n.
-
-Finally, we transform the velocity in the center-of-mass system back to lab
-coordinates:
-
-.. math::
- :label: velocity-neutron-lab
-
- \mathbf{v}'_n = \mathbf{V}'_n + \mathbf{v}_{cm}
-
-In OpenMC, the angle and energy of the neutron are stored rather than the
-velocity vector itself, so the post-collision angle and energy can be inferred
-from the post-collision velocity of the neutron in the lab system.
-
-For tally purposes, it is also important to keep track of the scattering cosine
-in the lab system. If we know the scattering cosine in the center-of-mass, the
-scattering cosine in the lab system can be calculated as
-
-.. math::
- :label: cosine-lab
-
- \mu_{lab} = \frac{1 + A\mu}{\sqrt{A^2 + 2A\mu + 1}}.
-
-However, this formula is only valid if the target was at rest. When the target
-nucleus does have thermal motion, the cosine of the scattering angle can be
-determined by simply taking the dot product of the neutron's initial and final
-direction in the lab system.
-
-.. _inelastic-scatter:
-
---------------------
-Inelastic Scattering
---------------------
-
-The major algorithms for inelastic scattering were described in previous
-sections. First, a scattering cosine is sampled using the algorithms in
-:ref:`sample-angle`. Then an outgoing energy is sampled using the algorithms in
-:ref:`sample-energy`. If the outgoing energy and scattering cosine were given in
-the center-of-mass system, they are transformed to laboratory coordinates using
-the algorithm described in :ref:`transform-coordinates`. Finally, the direction
-of the particle is changed also using the procedure in
-:ref:`transform-coordinates`.
-
-Although inelastic scattering leaves the target nucleus in an excited state, no
-secondary photons from nuclear de-excitation are tracked in OpenMC.
-
-------------------------
-:math:`(n,xn)` Reactions
-------------------------
-
-These types of reactions are just treated as inelastic scattering and as such
-are subject to the same procedure as described in
-:ref:`inelastic-scatter`. Rather than tracking multiple secondary neutrons, the
-weight of the outgoing neutron is multiplied by the number of secondary
-neutrons, e.g. for (n,2n), only one outgoing neutron is tracked but its weight
-is doubled.
-
-.. _fission:
-
--------
-Fission
--------
-
-While fission is normally considered an absorption reaction, as far as it
-concerns a Monte Carlo simulation it actually bears more similarities to
-inelastic scattering since fission results in secondary neutrons in the exit
-channel. Other absorption reactions like :math:`(n,\gamma)` or
-:math:`(n,\alpha)`, on the contrary, produce no neutrons. There are a few other
-idiosyncrasies in treating fission. In a criticality calculation, secondary
-neutrons from fission are only "banked" for use in the next generation rather
-than being tracked as secondary neutrons from elastic and inelastic scattering
-would be. On top of this, fission is sometimes broken into first-chance fission,
-second-chance fission, etc. An ACE table either lists the partial fission
-reactions with secondary energy distributions for each one, or a total fission
-reaction with a single secondary energy distribution.
-
-When a fission reaction is sampled in OpenMC (either total fission or, if data
-exists, first- or second-chance fission), the following algorithm is used to
-create and store fission sites for the following generation. First, the average
-number of prompt and delayed neutrons must be determined to decide whether the
-secondary neutrons will be prompt or delayed. This is important because delayed
-neutrons have a markedly different spectrum from prompt neutrons, one that has a
-lower average energy of emission. The total number of neutrons emitted
-:math:`\nu_t` is given as a function of incident energy in the ACE format. Two
-representations exist for :math:`\nu_t`. The first is a polynomial of arbitrary
-order with coefficients :math:`c_0,c_1,\dots`. If :math:`\nu_t` has this format,
-we can evaluate it at incoming energy :math:`E` by using the equation
-
-.. math::
- :label: nu-polynomial
-
- \nu_t (E) = \sum_{i = 0}^N c_i E^i
-
-where :math:`N` is the order of the polynomial. The other representation is just
-a tabulated function with a specified interpolation law. The number of prompt
-neutrons released per fission event :math:`\nu_p` is also given as a function of
-incident energy and can be specified in a polynomial or tabular format. The
-number of delayed neutrons released per fission event :math:`\nu_d` can only be
-specified in a tabular format. In practice, we only need to determine
-:math:`nu_t` and :math:`nu_d`. Once these have been determined, we can
-calculated the delayed neutron fraction
-
-.. math::
- :label: beta
-
- \beta = \frac{\nu_d}{\nu_t}
-
-We then need to determine how many total neutrons should be emitted from
-fission. If no survival biasing is being used, then the number of neutrons
-emitted is
-
-.. math::
- :label: fission-neutrons
-
- \nu = \frac{w \nu_t}{k_{eff}}
-
-where :math:`w` is the statistical weight and :math:`k_{eff}` is the effective
-multiplication factor from the previous generation. The number of neutrons
-produced is biased in this manner so that the expected number of fission
-neutrons produced is the number of source particles that we started with in the
-generation. Since :math:`\nu` is not an integer, we use the following procedure
-to obtain an integral number of fission neutrons to produce. If :math:`\xi >
-\nu - \lfloor \nu \rfloor`, then we produce :math:`\lfloor \nu \rfloor`
-neutrons. Otherwise, we produce :math:`\lfloor \nu \rfloor + 1` neutrons. Then,
-for each fission site produced, we sample the outgoing angle and energy
-according to the algorithms given in :ref:`sample-angle` and
-:ref:`sample-energy` respectively. If the neutron is to be born delayed, then
-there is an extra step of sampling a delayed neutron precursor group since they
-each have an associated secondary energy distribution.
-
-The sampled outgoing angle and energy of fission neutrons along with the
-position of the collision site are stored in an array called the fission
-bank. In a subsequent generation, these fission bank sites are used as starting
-source sites.
-
-----------------------------------------------------
-:math:`(n,\gamma)` and Other Disappearance Reactions
-----------------------------------------------------
-
-All absorption reactions other than fission do not produce any secondary
-neutrons. As a result, these are the easiest type of reactions to handle. When a
-collision occurs, the first step is to sample a nuclide within a material. Once
-the nuclide has been sampled, then a specific reaction for that nuclide is
-sampled. Since the total absorption cross section is pre-calculated at the
-beginning of a simulation, the first step in sampling a reaction is to determine
-whether a "disappearance" reaction occurs where no secondary neutrons are
-produced. This is done by sampling a random number :math:`\xi` on the interval
-:math:`[0,1)` and checking whether
-
-.. math::
- :label: disappearance
-
- \xi \sigma_t (E) < \sigma_a (E) - \sigma_f (E)
-
-where :math:`\sigma_t` is the total cross section, :math:`\sigma_a` is the
-absorption cross section (this includes fission), and :math:`\sigma_f` is the
-total fission cross section. If this condition is met, then the neutron is
-killed and we proceed to simulate the next neutron from the source bank.
-
-No secondary particles from disappearance reactions such as photons or
-alpha-particles are produced or tracked. To truly capture the affects of gamma
-heating in a problem, it would be necessary to explicitly track photons
-originating from :math:`(n,\gamma)` and other reactions.
-
-----------------
-Survival Biasing
-----------------
-
-In problems with highly absorbing materials, a large fraction of neutrons may be
-killed through absorption reactions thus leading to tallies with very few events
-scoring in them. To remedy this situation, an algorithm known as survival
-biasing or implicit absorption (or sometimes implicit capture, even though this
-is a misnomer) is commonly used.
-
-In survival biasing, rather than ever sample absorption reactions, at every
-collision, the weight of neutron is reduced by probability of absorption
-occurring, i.e.
-
-.. math::
- :label: survival-biasing-weight
-
- w' = w \left ( 1 - \frac{\sigma_a (E)}{\sigma_t (E)} \right )
-
-where :math:`w'` is the weight of the neutron after adjustment and :math:`w` is
-the weight of the neutron before adjustment. A few other things need to be
-handled differently if survival biasing is turned on. Although fission reactions
-never actually occur with survival biasing, we still need to create fission
-sites to preserve the basic criticality algorithm. The algorithm for sampling
-fission sites is the same as that described in :ref:`fission`. The only
-difference is in equation :eq:`fission-neutrons`. We now need to produce
-
-.. math::
- :label: fission-neutrons-survival
-
- \nu = \frac{w}{k} \frac{\nu_t \sigma_f(E)}{\sigma_t (E)}
-
-fission sites, where :math:`w` is the weight of the neutron before being
-adjusted. One should note this is just the expected number of neutrons produced
-*per collision* rather than the expected number of neutrons produced given that
-fission has already occurred.
-
-Additionally, since survival biasing can reduce the weight of the neutron to
-very low values, it is always used in conjunction with a weight cutoff and
-Russian rouletting. Two user adjustable parameters :math:`w_c` and :math:`w_s`
-are given which are the weight below which neutrons should undergo Russian
-roulette and the weight should they survive Russian roulette. The algorithm for
-Russian rouletting is as follows. After a collision if :math:`w < w_c`, then the
-neutron is killed with probability :math:`1 - w/w_s`. If it survives, the weight
-is set equal to :math:`w_s`. One can confirm that the average weight following
-Russian roulette is simply :math:`w`, so the game can be considered "fair". By
-default, the cutoff weight in OpenMC is :math:`w_c = 0.25` and the survival
-weight is :math:`w_s = 1.0`. These parameters vary from one Monte Carlo code to
-another.
+ w' = \mu w - \sqrt{1 - \mu^2} \sqrt{1 - w^2} \cos\phi.
.. _freegas:
------------------------------------------
-Effect of Thermal Motion on Cross-Sections
+Effect of Thermal Motion on Cross Sections
------------------------------------------
-When a neutron scatters off of a nucleus, many times it is assumed that the
-target nucleus is at rest. However, if the material is at a temperature greater
-than 0 K, it will have motion associated with the thermal vibration. Thus, the
+When a neutron scatters off of a nucleus, it may often be assumed that the
+target nucleus is at rest. However, the target nucleus will have motion
+associated with its thermal vibration, even at absolute zero (This is due to the
+zero-point energy arising from quantum mechanical considerations). Thus, the
velocity of the neutron relative to the target nucleus is in general not the
same as the velocity of the neutron entering the collision.
@@ -1006,9 +960,9 @@ nucleus, :math:`v_r = || \mathbf{v}_n - \mathbf{v}_T ||` is the magnitude of the
relative velocity, :math:`\sigma` is the cross section at 0 K, and :math:`M
(\mathbf{v}_T)` is the probability distribution for the target nucleus velocity
at temperature :math:`T` (a Maxwellian). In a Monte Carlo code, one must account
-for the effect of the thermal motion on both the integrated cross-section as
-well as secondary angle and energy distributions. For integrated cross-sections,
-it is possible to calculate thermally-averaged cross-sections by applying a
+for the effect of the thermal motion on both the integrated cross section as
+well as secondary angle and energy distributions. For integrated cross sections,
+it is possible to calculate thermally-averaged cross sections by applying a
kernel Doppler broadening algorithm to data at 0 K (or some temperature lower
than the desired temperature). The most ubiquitous algorithm for this purpose is
the [SIGMA1]_ method developed by Red Cullen and subsequently refined by
@@ -1034,7 +988,7 @@ tells us that target velocities that produce relative velocities which
correspond to high cross sections will have a greater contribution to the
effective reaction rate. This is most important when the velocity of the
incoming neutron is close to a resonance. For example, if the neutron's velocity
-corresponds to a trough in a resonance elastic scattering cross-section, a very
+corresponds to a trough in a resonance elastic scattering cross section, a very
small target velocity can cause the relative velocity to correspond to the peak
of the resonance, thus making a disproportionate contribution to the reaction
rate. The conclusion is that if we are to sample a target velocity in the Monte
@@ -1074,10 +1028,11 @@ relative velocities of interest. This is a good assumption for almost all cases
since the elastic scattering cross section varies slowly with velocity for light
nuclei, and for heavy nuclei where large variations can occur due to resonance
scattering, the moderating effect is rather small. Nonetheless, this assumption
-may cause incorrect answers in systems with U-238 where the low-lying resonances
-can cause a significant amount of up-scatter that would be ignored by this
-assumption. Nevertheless, with this assumption, we write :math:`\sigma (v_r) =
-\sigma_s` which simplifies :eq:`target-pdf-1` to
+may cause incorrect answers in systems with low-lying resonances that can cause
+a significant amount of up-scatter that would be ignored by this assumption
+(e.g. U-238 in commercial light-water reactors). Nevertheless, with this
+assumption, we write :math:`\sigma (v_r) = \sigma_s` which simplifies
+:eq:`target-pdf-1` to
.. math::
:label: target-pdf-2
@@ -1111,22 +1066,23 @@ Let us define the Maxwellian distribution in speed as
M (v_T) dv_T = \int_{-1}^1 d\mu \int_{0}^{2\pi} d\phi \, dv_T \, v_T^2
M(\mathbf{v}_T) = \sqrt{ \frac{2}{\pi} \left ( \frac{m}{kT} \right )^3}
- v_T^2 \exp \left ( \frac{-m v_T}{2kT} \right ) dv_T
+ v_T^2 \exp \left ( \frac{-m v_T}{2kT} \right ) dv_T.
To simplify things a bit, we'll define a parameter
.. math::
:label: maxwellian-beta
- \beta = \sqrt{\frac{m}{2kT}}
+ \beta = \sqrt{\frac{m}{2kT}}.
-Substituting this into equation :eq:`maxwellian-speed`, we get
+Substituting equation :eq:`maxwellian-beta` into equation
+:eq:`maxwellian-speed`, we obtain
.. math::
:label: maxwellian-speed2
M (v_T) dv_T = \frac{4}{\sqrt{\pi}} \beta^3 v_T^2 \exp \left ( -\beta^2
- v_T^2 \right ) dv_T
+ v_T^2 \right ) dv_T.
Now, changing variables in equation :eq:`target-pdf-2` by using the result from
equation :eq:`maxwellian-speed`, our new probability distribution function is
@@ -1148,7 +1104,7 @@ tells us that
.. math::
:label: lawcosine
- 2 v_n v_T \mu = v_n^2 + v_T^2 - v_r^2
+ 2 v_n v_T \mu = v_n^2 + v_T^2 - v_r^2.
Thus, we can infer that
@@ -1156,7 +1112,7 @@ Thus, we can infer that
:label: change-terms
|| \mathbf{v}_n - \mathbf{v}_T || = || \mathbf{v}_r || = v_r = \sqrt{v_n^2 +
- v_T^2 - 2v_n v_T \mu}
+ v_T^2 - 2v_n v_T \mu}.
Inserting equation :eq:`change-terms` into :eq:`target-pdf-3`, we obtain
@@ -1179,7 +1135,7 @@ parts as such:
f_1(v_T, \mu) &= \frac{4\sigma_s}{\sqrt{\pi} C'} \frac{ \sqrt{v_n^2 +
v_T^2 - 2v_n v_T \mu}}{v_n + v_T} \\
- f_2(v_T) &= (v_n + v_T) \beta^3 v_T^2 \exp \left ( -\beta^2 v_T^2 \right )
+ f_2(v_T) &= (v_n + v_T) \beta^3 v_T^2 \exp \left ( -\beta^2 v_T^2 \right ).
In general, any probability distribution function of the form :math:`p(x) =
f_1(x) f_2(x)` with :math:`f_1(x)` bounded can be sampled by sampling
@@ -1209,7 +1165,7 @@ in equation :eq:`divide-pdf`. Doing so we find that
:label: integrate-f2
\int_0^{\infty} dv_T (v_n + v_T) \beta^3 v_T^2 \exp \left ( -\beta^2 v_T^2
- \right ) = \frac{1}{4\beta} \left ( \sqrt{\pi} \beta v_n + 2 \right )
+ \right ) = \frac{1}{4\beta} \left ( \sqrt{\pi} \beta v_n + 2 \right ).
Thus, we need to sample the probability distribution function
@@ -1218,7 +1174,7 @@ Thus, we need to sample the probability distribution function
q(v_T) dv_T = \left ( \frac{4\beta^2 v_n v_T^2}{\sqrt{\pi} \beta v_n + 2} +
\frac{4\beta^4 v_T^3}{\sqrt{\pi} \beta v_n + 2} \right ) exp \left (
- -\beta^2 v_T^2 \right )
+ -\beta^2 v_T^2 \right ).
Now, let us do a change of variables with the following definitions
@@ -1236,7 +1192,7 @@ with :math:`dx = \beta dv_T` and doing some crafty rearranging of terms yields
q(x) dx = \left [ \left ( \frac{\sqrt{\pi} y}{\sqrt{\pi} y + 2} \right )
\frac{4}{\sqrt{\pi}} x^2 e^{-x^2} + \left ( \frac{2}{\sqrt{\pi} y + 2}
- \right ) 2x^3 e^{-x^2} \right ] dx
+ \right ) 2x^3 e^{-x^2} \right ] dx.
It's important to make note of the following two facts. First, the terms outside
the parentheses are properly normalized probability distribution functions that
@@ -1266,7 +1222,7 @@ on the unit interval. Since the maximum value of :math:`f_1(v_T, \mu)` is
.. math::
:label: freegas-accept-2
- \xi_3 < \frac{\sqrt{v_n^2 + v_T^2 - 2 v_n v_T \mu}}{v_n + v_T}
+ \xi_3 < \frac{\sqrt{v_n^2 + v_T^2 - 2 v_n v_T \mu}}{v_n + v_T}.
If is not accepted, then we repeat the process and resample a target speed and
cosine until a combination is found that satisfies equation
@@ -1284,9 +1240,10 @@ target molecule. If these effects are not accounted for in a simulation, the
reported results may be highly inaccurate. There is no general analytic
treatment for the scattering kinematics at low energies, and thus when nuclear
data is processed for use in a Monte Carlo code, special tables are created that
-give altered cross-sections and secondary angle/energy distributions for thermal
-scattering. These tables are mainly used for moderating materials such as light
-or heavy water, graphite, hydrogen in ZrH, beryllium, etc.
+give cross sections and secondary angle/energy distributions for thermal
+scattering that account for thermal binding effects. These tables are mainly
+used for moderating materials such as light or heavy water, graphite, hydrogen
+in ZrH, beryllium, etc.
The theory behind |sab| is rooted in quantum mechanics and is quite
complex. Those interested in first principles derivations for formulae relating
@@ -1296,23 +1253,23 @@ processed data as it appears in the ACE format.
Each |sab| table can contain the following:
-- Thermal inelastic scattering cross section
-- Thermal elastic scattering cross section
+- Thermal inelastic scattering cross section;
+- Thermal elastic scattering cross section;
- Correlated energy-angle distributions for thermal inelastic and elastic
- scattering
+ scattering.
Note that when we refer to "inelastic" and "elastic" scattering now, we are
actually using these terms with respect to the *scattering system*. Thermal
inelastic scattering means that the scattering system is left in an excited
-state, not any particular nucleus as is the case in inelastic level
-scattering. In a crystalline material, the excitation could be the production of
-phonons. In a molecule, it could be the excitation of rotational or vibrational
-modes.
+state; no particular nucleus is left in an excited state as would be the case
+for inelastic level scattering. In a crystalline material, the excitation of the
+scattering could correspond to the production of phonons. In a molecule, it
+could correspond to the excitation of rotational or vibrational modes.
Both thermal elastic and thermal inelastic scattering are generally divided into
incoherent and coherent parts. Coherent elastic scattering refers to scattering
-in crystalline solids like graphite or beryllium. These cross-sections are
-characterized by the presence of "Bragg edges" that relate to the crystal
+in crystalline solids like graphite or beryllium. These cross sections are
+characterized by the presence of *Bragg edges* that relate to the crystal
structure of the scattering material. Incoherent elastic scattering refers to
scattering in hydrogenous solids such as polyethylene. As it occurs in ACE data,
thermal inelastic scattering includes both coherent and incoherent effects and
@@ -1321,30 +1278,30 @@ is dominant for most other materials including hydrogen in water.
Calculating Integrated Cross Sections
-------------------------------------
-The first aspect of using |sab| tables is calculating cross-sections to replace
+The first aspect of using |sab| tables is calculating cross sections to replace
the data that would normally appear on the incident neutron data, which do not
account for thermal binding effects. For incoherent elastic and inelastic
-scattering, the cross-sections are stored as linearly interpolable functions on
+scattering, the cross sections are stored as linearly interpolable functions on
a specified energy grid. For coherent elastic data, the cross section can be
expressed as
.. math::
:label: coherent-elastic-xs
- \sigma(E) = \frac{\sigma_c}{E} \sum_{E_i < E} f_i e^{-4WE_i}.
+ \sigma(E) = \frac{\sigma_c}{E} \sum_{E_i < E} f_i e^{-4WE_i}
where :math:`\sigma_c` is the effective bound coherent scattering cross section,
:math:`W` is the effective Debye-Waller coefficient, :math:`E_i` are the
energies of the Bragg edges, and :math:`f_i` are related to crystallographic
-structure factors. Since the functional form of the cross-section is just 1/E
+structure factors. Since the functional form of the cross section is just 1/E
and the proportionality constant changes only at Bragg edges, the
-proportionality constants are stored and then the cross-section can be
+proportionality constants are stored and then the cross section can be
calculated analytically based on equation :eq:`coherent-elastic-xs`.
Outgoing Angle for Coherent Elastic Scattering
----------------------------------------------
-The other aspect of using |sab| tables is determining the outgoing energy and
+Another aspect of using |sab| tables is determining the outgoing energy and
angle of the neutron after scattering. For incoherent and coherent elastic
scattering, the energy of the neutron does not actually change, but the angle
does change. For coherent elastic scattering, the angle will depend on which
@@ -1401,9 +1358,9 @@ second to last energies have a relative probability of 4, and all other energies
have a relative probability of 10. The procedure to determine the outgoing
energy and angle is as such. First, the interpolation factor is determined from
equation :eq:`sab-interpolation-factor`. Then, an outgoing energy bin is sampled
-either from a uniform distribution or from a skewed distribution as
-discussed. The outgoing energy is then interpolated between values corresponding
-to neighboring incoming energies:
+either from a uniform distribution or from the aforementioned skewed
+distribution. The outgoing energy is then interpolated between values
+corresponding to neighboring incoming energies:
.. math::
:label: inelastic-energy
@@ -1447,12 +1404,12 @@ appears in the ACE format.
Each probability table for a nuclide contains the following information at a
number of incoming energies within the unresolved resonance range:
-- Cumulative probabilities for cross section bands
-- Total cross section (or factor) in each band
-- Elastic scattering cross section (or factor) in each band
-- Fission cross section (or factor) in each band
-- :math:`(n,\gamma)` cross section (or factor) in each band
-- Neutron heating number (or factor) in each band
+- Cumulative probabilities for cross section bands;
+- Total cross section (or factor) in each band;
+- Elastic scattering cross section (or factor) in each band;
+- Fission cross section (or factor) in each band;
+- :math:`(n,\gamma)` cross section (or factor) in each band; and
+- Neutron heating number (or factor) in each band.
It should be noted that unresolved resonance probability tables affect only
integrated cross sections and no extra data need be given for secondary
@@ -1464,7 +1421,7 @@ probability tables is as follows. First, the bounding incoming energies are
determined, i.e. find :math:`i` such that :math:`E_i < E < E_{i+1}`. We then
sample a cross section band :math:`j` using the cumulative probabilities for
table :math:`i`. This allows us to then calculate the elastic, fission, and
-capture cross-sections from the probability tables interpolating between
+capture cross sections from the probability tables interpolating between
neighboring incoming energies. If interpolation is specified, then
the cross sections are calculated as
@@ -1473,9 +1430,10 @@ the cross sections are calculated as
\sigma = \sigma_{i,j} + f (\sigma_{i+1,j} - \sigma{i,j})
-where :math:`f` is the interpolation factor defined in the same manner as
-:eq:`sab-interpolation-factor`. If logarithmic interpolation is specified, the
-cross sections are calculated as
+where :math:`\sigma_{i,j}` is the j-th band cross section corresponding to the
+i-th incoming neutron energy and :math:`f` is the interpolation factor defined
+in the same manner as :eq:`sab-interpolation-factor`. If logarithmic
+interpolation is specified, the cross sections are calculated as
.. math::
:label: ptables-loglog
@@ -1488,17 +1446,71 @@ where the interpolation factor is now defined as
.. math::
:label: log-interpolation-factor
- f = \frac{\log \frac{E}{E_i}}{\log \frac{E_{i+1}}{E_i}}
+ f = \frac{\log \frac{E}{E_i}}{\log \frac{E_{i+1}}{E_i}}.
A flag is also present in the probability table that specifies whether an
inelastic cross section should be calculated. If so, this is done from a normal
reaction cross section (either MT=51 or a special MT). Finally, if the
-cross-sections defined are above are specified to be factors and not true
-cross-sections, they are multiplied by the underlying smooth cross section in
+cross sections defined are above are specified to be factors and not true
+cross sections, they are multiplied by the underlying smooth cross section in
the unresolved range to get the actual cross sections. Lastly, the total cross
section is calculated as the sum of the elastic, fission, capture, and inelastic
cross sections.
+-----------------------------
+Variance Reduction Techniques
+-----------------------------
+
+Survival Biasing
+----------------
+
+In problems with highly absorbing materials, a large fraction of neutrons may be
+killed through absorption reactions, thus leading to tallies with very few
+scoring events. To remedy this situation, an algorithm known as *survival
+biasing* or *implicit absorption* (or sometimes *implicit capture*, even though
+this is a misnomer) is commonly used.
+
+In survival biasing, absorption reactions are prohibited from occurring and
+instead, at every collision, the weight of neutron is reduced by probability of
+absorption occurring, i.e.
+
+.. math::
+ :label: survival-biasing-weight
+
+ w' = w \left ( 1 - \frac{\sigma_a (E)}{\sigma_t (E)} \right )
+
+where :math:`w'` is the weight of the neutron after adjustment and :math:`w` is
+the weight of the neutron before adjustment. A few other things need to be
+handled differently if survival biasing is turned on. Although fission reactions
+never actually occur with survival biasing, we still need to create fission
+sites to serve as source sites for the next generation in the method of
+successive generations. The algorithm for sampling fission sites is the same as
+that described in :ref:`fission`. The only difference is in equation
+:eq:`fission-neutrons`. We now need to produce
+
+.. math::
+ :label: fission-neutrons-survival
+
+ \nu = \frac{w}{k} \frac{\nu_t \sigma_f(E)}{\sigma_t (E)}
+
+fission sites, where :math:`w` is the weight of the neutron before being
+adjusted. One should note this is just the expected number of neutrons produced
+*per collision* rather than the expected number of neutrons produced given that
+fission has already occurred.
+
+Additionally, since survival biasing can reduce the weight of the neutron to
+very low values, it is always used in conjunction with a weight cutoff and
+Russian rouletting. Two user adjustable parameters :math:`w_c` and :math:`w_s`
+are given which are the weight below which neutrons should undergo Russian
+roulette and the weight should they survive Russian roulette. The algorithm for
+Russian rouletting is as follows. After a collision if :math:`w < w_c`, then the
+neutron is killed with probability :math:`1 - w/w_s`. If it survives, the weight
+is set equal to :math:`w_s`. One can confirm that the average weight following
+Russian roulette is simply :math:`w`, so the game can be considered "fair". By
+default, the cutoff weight in OpenMC is :math:`w_c = 0.25` and the survival
+weight is :math:`w_s = 1.0`. These parameters vary from one Monte Carlo code to
+another.
+
----------
References
----------
@@ -1507,11 +1519,6 @@ References
Secondary Neutron and Photon Energy Distributions," *Nucl. Sci. Eng.*,
**50**, 390-392 (1972).
-.. [Foderaro] Anthony Foderaro, *The Elements of Neutron Interaction Theory*,
- MIT Press, Cambridge, Massachusetts (1971). **Note:** Students, faculty, and
- staff at MIT can obtain a PDF copy of this book for free from the `MIT
- Press`_.
-
.. [Gelbard] Ely M. Gelbard, "Epithermal Scattering in VIM," FRA-TM-123, Argonne
National Laboratory (1979).
@@ -1532,7 +1539,9 @@ References
Neutrons*, North-Holland Publishing Co., Amsterdam (1966). **Note:** This
book can be obtained for free from the OECD_.
-.. |sab| replace:: S(:math:`\alpha,\beta`)
+.. |sab| replace:: S(:math:`\alpha,\beta,T`)
+
+.. _Foderaro: http://hdl.handle.net/1721.1/1716
.. _OECD: http://www.oecd-nea.org/dbprog/MMRW-BOOKS.html
@@ -1548,6 +1557,6 @@ References
.. _Sutton and Brown: http://www.osti.gov/bridge/product.biblio.jsp?osti_id=307911
-.. _MIT Press: http://hdl.handle.net/1721.1/1716
-
.. _lectures: https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-ur-05-4983.pdf
+
+.. _MCNP Manual: https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/MCNP5_Manual_Volume_I_LA-UR-03-1987.pdf
diff --git a/docs/source/methods/random_numbers.rst b/docs/source/methods/random_numbers.rst
new file mode 100644
index 0000000000..88c4d65d52
--- /dev/null
+++ b/docs/source/methods/random_numbers.rst
@@ -0,0 +1,74 @@
+.. _methods_random_numbers:
+
+========================
+Random Number Generation
+========================
+
+In order to sample probability distributions, one must be able to produce random
+numbers. The standard technique to do this is to generate numbers on the
+interval :math:`[0,1)` from a deterministic sequence that has properties that
+make it appear to be random, e.g. being uniformly distributed and not exhibiting
+correlation between successive terms. Since the numbers produced this way are
+not truly "random" in a strict sense, they are typically referred to as
+pseudorandom numbers, and the techniques used to generate them are pseudorandom
+number generators (PRNGs). Numbers sampled on the unit interval can then be
+transformed for the purpose of sampling other continuous or discrete probability
+distributions.
+
+------------------------------
+Linear Congruential Generators
+------------------------------
+
+There are a great number of algorithms for generating random numbers. One of the
+simplest and commonly used algorithms is called a `linear congruential
+generator`_. We start with a random number *seed* :math:`\xi_0` and a sequence
+of random numbers can then be generated using the following recurrence relation:
+
+.. math::
+ :label: lcg
+
+ \xi_{i+1} = g \xi_i + c \mod M
+
+where :math:`g`, :math:`c`, and :math:`M` are constants. The choice of these
+constants will have a profound effect on the quality and performance of the
+generator, so they should not be chosen arbitrarily. As Donald Knuth stated in
+his seminal work *The Art of Computer Programming*, "random numbers should not
+be generated with a method chosen at random. Some theory should be used."
+Typically, :math:`M` is chosen to be a power of two as this enables :math:`x
+\mod M` to be performed using the bitwise AND operator with a bit mask. The
+constants for the linear congruential generator used by default in OpenMC are
+:math:`g = 2806196910506780709`, :math:`c = 1`, and :math:`M = 2^{63}` (see
+[LEcuyer]_).
+
+Skip-ahead Capability
+---------------------
+
+One of the important capabilities for a random number generator is to be able to
+skip ahead in the sequence of random numbers. Without this capability, it would
+be very difficult to maintain reproducibility in a parallel calculation. If we
+want to skip ahead :math:`N` random numbers and :math:`N` is large, the cost of
+sampling :math:`N` random numbers to get to that position may be prohibitively
+expensive. Fortunately, algorithms have been developed that allow us to skip
+ahead in :math:`O(\log_2 N)` operations instead of :math:`O(N)`. One algorithm
+to do so is described in a paper by Brown_. This algorithm relies on the following
+relationship:
+
+.. math::
+ :label: lcg-skipahead
+
+ \xi_{i+k} = g^k \xi_i + c \frac{g^k - 1}{g - 1} \mod M
+
+Note that :eq:`lcg-skipahead` has the same general form as \eqref{eq:lcg}, so
+the idea is to determine the new multiplicative and additive constants in
+:math:`O(\log_2 N)` operations.
+
+----------
+References
+----------
+
+.. [LEcuyer] P. L’Ecuyer, "Tables of Linear Congruential Generators of
+ Different Sizes and Good Lattice Structures," *Math. Comput.*, **68**, 249
+ (1999).
+
+.. _Brown: https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/anl_rn_arb-strides_1994.pdf
+.. _linear congruential generator: http://en.wikipedia.org/wiki/Linear_congruential_generator
diff --git a/docs/source/methods/statistics.rst b/docs/source/methods/statistics.rst
deleted file mode 100644
index 946da066ba..0000000000
--- a/docs/source/methods/statistics.rst
+++ /dev/null
@@ -1,369 +0,0 @@
-.. _methods_statistics:
-
-==========
-Statistics
-==========
-
-As was discussed briefly in :ref:`methods_introduction`, any given result from a
-Monte Carlo calculation, colloquially known as a "tally", represents an estimate
-of the mean of some `random variable`_ of interest. This random variable
-typically corresponds to some physical quantity like a reaction rate, a net
-current across some surface, or the neutron flux in a region. Given that all
-tallies are produced by a `stochastic process`_, there is an associated
-uncertainty with each value reported. It is important to understand how the
-uncertainty is calculated and what it tells us about our results. To that end,
-we will introduce a number of theorems and results from statistics that should
-shed some light on the interpretation of uncertainties.
-
---------------------
-Law of Large Numbers
---------------------
-
-The `law of large numbers`_ is an important statistical result that tells us
-that the average value of the result a large number of repeated experiments
-should be close to the `expected value`_. Let :math:`X_1, X_2, \dots, X_n` be an
-infinite sequence of `independent, identically-distributed random variables`_
-with expected values :math:`E(X_1) = E(X_2) = \mu`. One form of the law of large
-numbers states that the sample mean :math:`\bar{X_n} = \frac{X_1 + \dots +
-X_n}{n}` `converges in probability`_ to the true mean, i.e. for all
-:math:`\epsilon > 0`
-
-.. math::
-
- \lim\limits_{n\rightarrow\infty} P \left ( \left | \bar{X}_n - \mu \right |
- \ge \epsilon \right ) = 0.
-
-.. _central-limit-theorem:
-
----------------------
-Central Limit Theorem
----------------------
-
-The `central limit theorem`_ (CLT) is perhaps the most well-known and ubiquitous
-statistical theorem that has far-reaching implications across many
-disciplines. The CLT is similar to the law of large numbers in that it tells us
-the limiting behavior of the sample mean. Whereas the law of large numbers tells
-us only that the value of the sample mean will converge to the expected value of
-the distribution, the CLT says that the distribution of the sample mean will
-converge to a `normal distribution`_. As we defined before, let :math:`X_1, X_2,
-\dots, X_n` be an infinite sequence of independent, identically-distributed
-random variables with expected values :math:`E(X_i) = \mu` and variances
-:math:`\text{Var} (X_i) = \sigma^2 < \infty`. Note that we don't require that
-these random variables take on any particular distribution -- they can be
-normal, log-normal, Weibull, etc. The central limit theorem states that as
-:math:`n \rightarrow \infty`, the random variable :math:`\sqrt{n} (\bar{X}_n -
-\mu)` `converges in distribution`_ to the standard normal distribution:
-
-.. math::
- :label: central-limit-theorem
-
- \sqrt{n} \left ( \frac{1}{n} \sum_{i=1}^n X_i - \mu \right ) \xrightarrow{d}
- \mathcal{N} (0, \sigma^2)
-
-------------------------------------------
-Estimating Statistics of a Random Variable
-------------------------------------------
-
-Mean
-----
-
-Given independent samples drawn from a random variable, the sample mean is
-simply an estimate of the average value of the random variable. In a Monte Carlo
-simulation, the random variable represents physical quantities that we want
-tallied. If :math:`X` is the random variable with :math:`N` observations
-:math:`x_1, x_2, \dots, x_N`, then an unbiased estimator for the population mean
-is the sample mean, defined as
-
-.. math::
- :label: sample-mean
-
- \bar{x} = \frac{1}{N} \sum_{i=1}^N x_i.
-
-Variance
---------
-
-The variance of a population indicates how spread out different members of the
-population are. For a Monte Carlo simulation, the variance of a tally is a
-measure of how precisely we know the tally value, with a lower variance
-indicating a higher precision. There are a few different estimators for the
-population variance. One of these is the second central moment of the
-distribution also known as the biased sample variance:
-
-.. math::
- :label: biased-variance
-
- s_N^2 = \frac{1}{N} \sum_{i=1}^N \left ( x_i - \bar{x} \right )^2 = \left (
- \frac{1}{N} \sum_{i=1}^N x_i^2 \right ) - \bar{x}^2.
-
-This estimator is biased because its expected value is actually not equal to the
-population variance:
-
-.. math::
- :label: biased-variance-expectation
-
- E[s_N^2] = \frac{N - 1}{N} \sigma^2
-
-where :math:`\sigma^2` is the actual population variance. As a result, this
-estimator should not be used in practice. Instead, one can use `Bessel's
-correction`_ to come up with an unbiased sample variance estimator:
-
-.. math::
- :label: unbiased-variance
-
- s^2 = \frac{1}{N - 1} \sum_{i=1}^N \left ( x_i - \bar{x} \right )^2 =
- \frac{1}{N - 1} \left ( \sum_{i=1}^N x_i^2 - N\bar{x}^2 \right ).
-
-This is the estimator normally used to calculate sample variance. The final form
-in equation :eq:`unbiased-variance` is especially suitable for computation since
-we do not need to store the values at every realization of the random variable
-as the simulation proceeds. Instead, we can simply keep a running sum and sum of
-squares of the values at each realization of the random variable and use that to
-calculate the variance.
-
-Variance of the Mean
---------------------
-
-The previous sections discussed how to estimate the mean and variance of a
-random variable using statistics on a finite sample. However, we are generally
-not interested in the *variance of the random variable* itself; we are more
-interested in the *variance of the estimated mean*. The sample mean is the
-result of our simulation, and the variance of the sample mean will tell us how
-confident we should be in our answers.
-
-Fortunately, it is quite easy to estimate the variance of the mean if we are
-able to estimate the variance of the random variable. We start with the
-observation that if we have a series of uncorrelated random variables, we can
-write the variance of their sum as the sum of their variances:
-
-.. math::
- :label: bienayme-formula
-
- \text{Var} \left ( \sum_{i=1}^N X_i \right ) = \sum_{i=1}^N \text{Var} \left
- ( X_i \right )
-
-This result is known as the Bienaymé formula. We can use this result to
-determine a formula for the variance of the sample mean. Assuming that the
-realizations of our random variable are again identical,
-independently-distributed samples, then we have that
-
-.. math::
- :label: sample-variance-mean
-
- \text{Var} \left ( \bar{X} \right ) = \text{Var} \left ( \frac{1}{N}
- \sum_{i=1}^N X_i \right ) = \frac{1}{N^2} \sum_{i=1}^N \text{Var} \left (
- X_i \right ) = \frac{1}{N^2} \left ( N\sigma^2 \right ) =
- \frac{\sigma^2}{N}.
-
-We can combine this result with equation :eq:`unbiased-variance` to come up with
-an unbiased estimator for the variance of the sample mean:
-
-.. math::
- :label: sample-variance-mean-formula
-
- s_{\bar{X}}^2 = \frac{1}{N - 1} \left ( \frac{1}{N} \sum_{i=1}^N x_i^2 -
- \bar{x}^2 \right ).
-
-At this point, an important distinction should be made between the estimator for
-the variance of the population and the estimator for the variance of the
-mean. As the number of realizations increases, the estimated variance of the
-population based on equation :eq:`unbiased-variance` will tend to the true
-population variance. On the other hand, the estimated variance of the mean will
-tend to zero as the number of realizations increases. A practical interpretation
-of this is that the longer you run a simulation, the better you know your
-results. Therefore, by running a simulation long enough, it is possible to
-reduce the stochastic uncertainty to arbitrarily low levels.
-
-Confidence Intervals
---------------------
-
-While the sample variance and standard deviation gives us some idea about the
-variability of the estimate of the mean of whatever quantities we've tallied, it
-does not help us interpret how confidence we should be in the results. To
-quantity the reliability of our estimates, we can use `confidence intervals`_
-based on the calculated sample variance.
-
-A :math:`1-\alpha` confidence interval for a population parameter is defined as
-such: if we repeat the same experiment many times and calculate the confidence
-interval for each experiment, then :math:`1 - \alpha` percent of the calculated
-intervals would encompass the true population parameter. Let :math:`x_1, x_2,
-\dots, x_N` be samples from a set of independent, identically-distributed random
-variables each with population mean :math:`\mu` and variance
-:math:`\sigma^2`. The t-statistic is defined as
-
-.. math::
- :label: t-statistic
-
- t = \frac{\bar{x} - \mu}{s/\sqrt{N}}
-
-where :math:`\bar{x}` is the sample mean from equation :eq:`sample-mean` and
-:math:`s` is the standard deviation based on equation
-:eq:`unbiased-variance`. If the random variables :math:`X_i` are
-normally-distributed, then the t-statistic has a `Student's t-distribution`_
-with :math:`N-1` degrees of freedom. This implies that
-
-.. math::
- :label: t-probability
-
- Pr \left ( -t_{1 - \alpha/2, N - 1} \le \frac{\bar{x} - \mu}{s/\sqrt{N}} \le
- t_{1 - \alpha/2, N - 1} \right ) = 1 - \alpha
-
-where :math:`t_{1-\alpha/2, N-1}` is the :math:`1 - \alpha/2` percentile of a
-t-distribution with :math:`N-1` degrees of freedom. Thus, the :math:`1 - \alpha`
-two sided confidence interval for the sample mean is
-
-.. math::
- :label: two-sided-ci
-
- \bar{x} \pm t_{1 - \alpha/2, N-1} \frac{s}{\sqrt{N}}.
-
-One should be cautioned that equation :eq:`two-sided-ci` **only applies if the
-underlying random variables are normally-distributed!** In general, this may not
-be true for a tally random variable -- the central limit theorem guarantees only
-that the sample mean is normally distributed, not the underlying random
-variable. If batching is used, then the underlying random variable, which would
-then be the averages from each batch, will be normally distributed as long as
-the conditions of the central limit theorem are met.
-
-Let us now outline the method used to calculate the percentile of the Student's
-t-distribution. For one or two degrees of freedom, the percentile can be written
-analytically. For one degree of freedom, the t-distribution becomes a standard
-`Cauchy distribution`_ whose cumulative distribution function is
-
-.. math::
- :label: cauchy-cdf
-
- c(x) = \frac{1}{\pi} \arctan x + \frac{1}{2}.
-
-Thus, inverting the cumulative distribution function, we find the :math:`x`
-percentile of the standard Cauchy distribution to be
-
-.. math::
- :label: percentile-1
-
- t_{x,1} = \tan \left ( \pi \left ( x - \frac{1}{2} \right ) \right ).
-
-For two degrees of freedom, the cumulative distribution function is the
-second-degree polynomial
-
-.. math::
- :label: t-2-polynomial
-
- c(x) = \frac{1}{2} + \frac{x}{2\sqrt{x^2 + 2}}
-
-Solving for :math:`x`, we find the :math:`x` percentile to be
-
-.. math::
- :label: percentile-2
-
- t_{x,2} = \frac{2\sqrt{2} (x - 1/2)}{\sqrt{1 - 4 (x - 1/2)^2}}
-
-For degrees of freedom greater than two, it is not possible to obtain an
-analytical formula for the inverse of the cumulative distribution function. We
-must resort to either numerically solving for the inverse or to an
-approximation. Approximations for percentiles of the t-distribution have been
-found with high levels of accuracy. OpenMC uses the approximation from
-[George]_:
-
-.. math::
- :label: percentile-n
-
- t_{x,n} = \sqrt{\frac{n}{n-2}} \left ( z_x + \frac{1}{4} \frac{z_x^3 -
- 3z_x}{n-2} + \frac{1}{96} \frac{5z_x^5 - 56z_x^3 + 75z_x}{(n-2)^2} +
- \frac{1}{384} \frac{3z_x^7 - 81z_x^5 + 417z_x^3 - 315z_x}{(n-2)^3} \right )
-
-where :math:`z_x` is the :math:`x` percentile of the standard normal
-distribution. In order to determine an arbitrary percentile of the standard
-normal distribution, we use an `unpublished rational approximation`_. After
-using the rational approximation, one iteration of Newton's method is applied to
-improve the estimate of the percentile.
-
-------------------------
-Random Number Generation
-------------------------
-
-In order to sample probability distributions, one must be able to produce random
-numbers. The standard technique to do this is to generate numbers on the
-interval :math:`[0,1)` from a deterministic sequence that has a properties that
-make it appear to be random, e.g. being uniformly distributed and not exhibiting
-correlation between successive terms. Since the numbers are not truly "random"
-in the strict sense, they are typically referred to as pseudo-random numbers,
-and the techniques used to generate them are pseudo-random number generators
-(PRNGs). Numbers sampled on the unit interval can then be used transformed for
-the purpose of sampling other continuous or discrete probability distributions.
-
-There are a great number of algorithms for generating random numbers. One of the
-simplest and commonly used algorithms is called a `linear congruential
-generator`_. We start with some random number seed :math:`\xi_0` and a sequence
-of random numbers is generated using the following recurrence relation:
-
-.. math::
- :label: lcg
-
- \xi_{i+1} = g \xi_i + c \mod M
-
-where :math:`g`, :math:`c`, and :math:`M` are constants. The choice of these
-constants will have a profound effect on the quality and performance of the
-generator, so they should not be chosen arbitrarily. As Donald Knuth said in his
-seminal work *The Art of Computer Programming*, "random numbers should not be
-generated with a method chosen at random. Some theory should be used."
-Typically, :math:`M` is chosen to be a power of two as this enables :math:`x
-\mod M` to be performed using the binary AND operator with a bit mask. The
-constants for the linear congruential generator used by default in OpenMC are
-:math:`g = 2806196910506780709`, :math:`c = 1`, and :math:`M = 2^{63}`.
-
-One of the important capabilities for a random number generator is to be able to
-skip ahead in the sequence of random numbers. Without this capability, it would
-be very difficult to maintain reproducibility in a parallel calculation. If we
-want to skip ahead :math:`N` random numbers and :math:`N` is large, the cost of
-just sampling :math:`N` random numbers to get to that position may be
-prohibitively expensive. Fortunately, algorithms have been developed that allow
-us to skip ahead in :math:`O(\log N)` operations instead of :math:`O(N)`. One
-algorithm to do so is described in a paper by Brown_. This algorithm relies on
-the following relationship:
-
-.. math::
- :label: lcg-skipahead
-
- \xi_{i+k} = g^k \xi_i + c \frac{g^k - 1}{g - 1} \mod M
-
-Note that equation :eq:`lcg-skipahead` has the same form as equation :eq:`lcg`
-so the idea is to determine the new multiplicative and additive constants in
-:math:`O(\log N)` operations.
-
-----------
-References
-----------
-
-.. [George] E. E. Olusegun George and Meenakshi Sivaram, "A modification of the
- Fisher-Cornish approximation for the student t percentiles," Communication
- in Statistics - Simulation and Computation, 16 (4), pp. 1123-1132 (1987).
-
-.. _linear congruential generator: http://en.wikipedia.org/wiki/Linear_congruential_generator
-
-.. _Brown: https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/anl_rn_arb-strides_1994.pdf
-
-.. _Bessel's correction: http://en.wikipedia.org/wiki/Bessel's_correction
-
-.. _random variable: http://en.wikipedia.org/wiki/Random_variable
-
-.. _stochastic process: http://en.wikipedia.org/wiki/Stochastic_process
-
-.. _independent, identically-distributed random variables: http://en.wikipedia.org/wiki/Independent_and_identically_distributed_random_variables
-
-.. _law of large numbers: http://en.wikipedia.org/wiki/Law_of_large_numbers
-
-.. _expected value: http://en.wikipedia.org/wiki/Expected_value
-
-.. _converges in probability: http://en.wikipedia.org/wiki/Convergence_of_random_variables#Convergence_in_probability
-
-.. _normal distribution: http://en.wikipedia.org/wiki/Normal_distribution
-
-.. _converges in distribution: http://en.wikipedia.org/wiki/Convergence_of_random_variables#Convergence_in_distribution
-
-.. _confidence intervals: http://en.wikipedia.org/wiki/Confidence_interval
-
-.. _Student's t-distribution: http://en.wikipedia.org/wiki/Student%27s_t-distribution
-
-.. _Cauchy distribution: http://en.wikipedia.org/wiki/Cauchy_distribution
-
-.. _unpublished rational approximation: http://home.online.no/~pjacklam/notes/invnorm/
diff --git a/docs/source/methods/tallies.rst b/docs/source/methods/tallies.rst
index 4e38477a6a..6c16f08136 100644
--- a/docs/source/methods/tallies.rst
+++ b/docs/source/methods/tallies.rst
@@ -29,16 +29,16 @@ equation :eq:`tally-integral`). For example, if the desired tally was the
cell which contains the fuel pin and the scoring function would be the radiative
capture macroscopic cross section. The following quantities can be scored in
OpenMC: flux, total reaction rate, scattering reaction rate, neutron production
-from scattering, higher scattering moments, (n,xn) reaction rates, absorption
-reaction rate, fission reaction rate, neutron production rate from fission, and
-surface currents. The following variables can be used as filters: universe,
-material, cell, birth cell, surface, mesh, pre-collision energy, and
+from scattering, higher scattering moments, :math:`(n,xn)` reaction rates,
+absorption reaction rate, fission reaction rate, neutron production rate from
+fission, and surface currents. The following variables can be used as filters:
+universe, material, cell, birth cell, surface, mesh, pre-collision energy, and
post-collision energy.
With filters for pre- and post-collision energy and scoring functions for
scattering and fission production, it is possible to use OpenMC to generate
cross sections with user-defined group structures. These multigroup cross
-sections can subsequently be used in deterministic solvers such as coarse-mesh
+sections can subsequently be used in deterministic solvers such as coarse mesh
finite difference (CMFD) diffusion.
------------------------------
@@ -87,7 +87,9 @@ reaction :math:`x`, and :math:`W` is the total starting weight of the particles,
and :math:`w_i` is the pre-collision weight of the particle as it enters event
:math:`i`. One should note that equation :eq:`analog-estimator` is
volume-integrated so if we want a volume-averaged quantity, we need to divided
-by the volume of the region of integration.
+by the volume of the region of integration. If survival biasing is employed, the
+analog estimator cannot be used for any reactions with zero neutrons in the exit
+channel.
Collision Estimator
-------------------
@@ -145,7 +147,7 @@ start with an expression for the volume integrated flux, which can be written as
:label: flux-integrated
V \phi = \int d\mathbf{r} \int dE \int d\mathbf{\Omega} \int dt \,
- \psi(\mathbf{r}, \mathbf{\hat{\Omega}}, E, t).
+ \psi(\mathbf{r}, \mathbf{\hat{\Omega}}, E, t)
where :math:`V` is the volume, :math:`\psi` is the angular flux,
:math:`\mathbf{r}` is the position of the particle, :math:`\mathbf{\hat{\Omega}}`
@@ -159,7 +161,7 @@ where :math:`n` is the angular neutron density, we can rewrite equation
:label: flux-integrated-2
V \phi = \int d\mathbf{r} \int dE \int dt v \int d\mathbf{\Omega} \, n(\mathbf{r},
- \mathbf{\hat{\Omega}}, E, t))
+ \mathbf{\hat{\Omega}}, E, t)).
Using the relations :math:`N(\mathbf{r}, E, t) = \int d\mathbf{\Omega}
n(\mathbf{r}, \mathbf{\hat{\Omega}}, E, t)` and :math:`d\ell = v \, dt` where
@@ -168,7 +170,7 @@ n(\mathbf{r}, \mathbf{\hat{\Omega}}, E, t)` and :math:`d\ell = v \, dt` where
.. math::
:label: track-length-integral
- V \phi = \int d\mathbf{r} \int dE \int d\ell N(\mathbf{r}, E, t)
+ V \phi = \int d\mathbf{r} \int dE \int d\ell N(\mathbf{r}, E, t).
Equation :eq:`track-length-integral` indicates that we can use the length of a
particle's trajectory as an estimate for the flux, i.e. the track-length
@@ -188,7 +190,7 @@ macroscopic reaction cross section:
.. math::
:label: track-length-estimator
- R_x = \frac{1}{W} \sum_{i \in T} w_i \ell_i \Sigma_x (E_i)
+ R_x = \frac{1}{W} \sum_{i \in T} w_i \ell_i \Sigma_x (E_i).
One important fact to take into consideration is that the use of a track-length
estimator precludes us from using any filter that requires knowledge of the
@@ -197,8 +199,314 @@ had a collision at every event. Thus, for tallies with outgoing-energy filters
(which require the post-collision energy) or for tallies of scattering moments
(which require the scattering cosine), we must use an analog estimator.
----------------
-Surface Current
----------------
+.. TODO: Add description of surface current tallies
+
+----------
+Statistics
+----------
+
+As was discussed briefly in :ref:`methods_introduction`, any given result from a
+Monte Carlo calculation, colloquially known as a "tally", represents an estimate
+of the mean of some `random variable`_ of interest. This random variable
+typically corresponds to some physical quantity like a reaction rate, a net
+current across some surface, or the neutron flux in a region. Given that all
+tallies are produced by a `stochastic process`_, there is an associated
+uncertainty with each value reported. It is important to understand how the
+uncertainty is calculated and what it tells us about our results. To that end,
+we will introduce a number of theorems and results from statistics that should
+shed some light on the interpretation of uncertainties.
+
+Law of Large Numbers
+--------------------
+
+The `law of large numbers`_ is an important statistical result that tells us
+that the average value of the result a large number of repeated experiments
+should be close to the `expected value`_. Let :math:`X_1, X_2, \dots, X_n` be an
+infinite sequence of `independent, identically-distributed random variables`_
+with expected values :math:`E(X_1) = E(X_2) = \mu`. One form of the law of large
+numbers states that the sample mean :math:`\bar{X_n} = \frac{X_1 + \dots +
+X_n}{n}` `converges in probability`_ to the true mean, i.e. for all
+:math:`\epsilon > 0`
+
+.. math::
+
+ \lim\limits_{n\rightarrow\infty} P \left ( \left | \bar{X}_n - \mu \right |
+ \ge \epsilon \right ) = 0.
+
+.. _central-limit-theorem:
+
+Central Limit Theorem
+---------------------
+
+The `central limit theorem`_ (CLT) is perhaps the most well-known and ubiquitous
+statistical theorem that has far-reaching implications across many
+disciplines. The CLT is similar to the law of large numbers in that it tells us
+the limiting behavior of the sample mean. Whereas the law of large numbers tells
+us only that the value of the sample mean will converge to the expected value of
+the distribution, the CLT says that the distribution of the sample mean will
+converge to a `normal distribution`_. As we defined before, let :math:`X_1, X_2,
+\dots, X_n` be an infinite sequence of independent, identically-distributed
+random variables with expected values :math:`E(X_i) = \mu` and variances
+:math:`\text{Var} (X_i) = \sigma^2 < \infty`. Note that we don't require that
+these random variables take on any particular distribution -- they can be
+normal, log-normal, Weibull, etc. The central limit theorem states that as
+:math:`n \rightarrow \infty`, the random variable :math:`\sqrt{n} (\bar{X}_n -
+\mu)` `converges in distribution`_ to the standard normal distribution:
+
+.. math::
+ :label: central-limit-theorem
+
+ \sqrt{n} \left ( \frac{1}{n} \sum_{i=1}^n X_i - \mu \right ) \xrightarrow{d}
+ \mathcal{N} (0, \sigma^2)
+
+Estimating Statistics of a Random Variable
+------------------------------------------
+
+Mean
+++++
+
+Given independent samples drawn from a random variable, the sample mean is
+simply an estimate of the average value of the random variable. In a Monte Carlo
+simulation, the random variable represents physical quantities that we want
+tallied. If :math:`X` is the random variable with :math:`N` observations
+:math:`x_1, x_2, \dots, x_N`, then an unbiased estimator for the population mean
+is the sample mean, defined as
+
+.. math::
+ :label: sample-mean
+
+ \bar{x} = \frac{1}{N} \sum_{i=1}^N x_i.
+
+Variance
+++++++++
+
+The variance of a population indicates how spread out different members of the
+population are. For a Monte Carlo simulation, the variance of a tally is a
+measure of how precisely we know the tally value, with a lower variance
+indicating a higher precision. There are a few different estimators for the
+population variance. One of these is the second central moment of the
+distribution also known as the biased sample variance:
+
+.. math::
+ :label: biased-variance
+
+ s_N^2 = \frac{1}{N} \sum_{i=1}^N \left ( x_i - \bar{x} \right )^2 = \left (
+ \frac{1}{N} \sum_{i=1}^N x_i^2 \right ) - \bar{x}^2.
+
+This estimator is biased because its expected value is actually not equal to the
+population variance:
+
+.. math::
+ :label: biased-variance-expectation
+
+ E[s_N^2] = \frac{N - 1}{N} \sigma^2
+
+where :math:`\sigma^2` is the actual population variance. As a result, this
+estimator should not be used in practice. Instead, one can use `Bessel's
+correction`_ to come up with an unbiased sample variance estimator:
+
+.. math::
+ :label: unbiased-variance
+
+ s^2 = \frac{1}{N - 1} \sum_{i=1}^N \left ( x_i - \bar{x} \right )^2 =
+ \frac{1}{N - 1} \left ( \sum_{i=1}^N x_i^2 - N\bar{x}^2 \right ).
+
+This is the estimator normally used to calculate sample variance. The final form
+in equation :eq:`unbiased-variance` is especially suitable for computation since
+we do not need to store the values at every realization of the random variable
+as the simulation proceeds. Instead, we can simply keep a running sum and sum of
+squares of the values at each realization of the random variable and use that to
+calculate the variance.
+
+Variance of the Mean
+++++++++++++++++++++
+
+The previous sections discussed how to estimate the mean and variance of a
+random variable using statistics on a finite sample. However, we are generally
+not interested in the *variance of the random variable* itself; we are more
+interested in the *variance of the estimated mean*. The sample mean is the
+result of our simulation, and the variance of the sample mean will tell us how
+confident we should be in our answers.
+
+Fortunately, it is quite easy to estimate the variance of the mean if we are
+able to estimate the variance of the random variable. We start with the
+observation that if we have a series of uncorrelated random variables, we can
+write the variance of their sum as the sum of their variances:
+
+.. math::
+ :label: bienayme-formula
+
+ \text{Var} \left ( \sum_{i=1}^N X_i \right ) = \sum_{i=1}^N \text{Var} \left
+ ( X_i \right )
+
+This result is known as the Bienaymé formula. We can use this result to
+determine a formula for the variance of the sample mean. Assuming that the
+realizations of our random variable are again identical,
+independently-distributed samples, then we have that
+
+.. math::
+ :label: sample-variance-mean
+
+ \text{Var} \left ( \bar{X} \right ) = \text{Var} \left ( \frac{1}{N}
+ \sum_{i=1}^N X_i \right ) = \frac{1}{N^2} \sum_{i=1}^N \text{Var} \left (
+ X_i \right ) = \frac{1}{N^2} \left ( N\sigma^2 \right ) =
+ \frac{\sigma^2}{N}.
+
+We can combine this result with equation :eq:`unbiased-variance` to come up with
+an unbiased estimator for the variance of the sample mean:
+
+.. math::
+ :label: sample-variance-mean-formula
+
+ s_{\bar{X}}^2 = \frac{1}{N - 1} \left ( \frac{1}{N} \sum_{i=1}^N x_i^2 -
+ \bar{x}^2 \right ).
+
+At this point, an important distinction should be made between the estimator for
+the variance of the population and the estimator for the variance of the
+mean. As the number of realizations increases, the estimated variance of the
+population based on equation :eq:`unbiased-variance` will tend to the true
+population variance. On the other hand, the estimated variance of the mean will
+tend to zero as the number of realizations increases. A practical interpretation
+of this is that the longer you run a simulation, the better you know your
+results. Therefore, by running a simulation long enough, it is possible to
+reduce the stochastic uncertainty to arbitrarily low levels.
+
+Confidence Intervals
+++++++++++++++++++++
+
+While the sample variance and standard deviation gives us some idea about the
+variability of the estimate of the mean of whatever quantities we've tallied, it
+does not help us interpret how confidence we should be in the results. To
+quantity the reliability of our estimates, we can use `confidence intervals`_
+based on the calculated sample variance.
+
+A :math:`1-\alpha` confidence interval for a population parameter is defined as
+such: if we repeat the same experiment many times and calculate the confidence
+interval for each experiment, then :math:`1 - \alpha` percent of the calculated
+intervals would encompass the true population parameter. Let :math:`x_1, x_2,
+\dots, x_N` be samples from a set of independent, identically-distributed random
+variables each with population mean :math:`\mu` and variance
+:math:`\sigma^2`. The t-statistic is defined as
+
+.. math::
+ :label: t-statistic
+
+ t = \frac{\bar{x} - \mu}{s/\sqrt{N}}
+
+where :math:`\bar{x}` is the sample mean from equation :eq:`sample-mean` and
+:math:`s` is the standard deviation based on equation
+:eq:`unbiased-variance`. If the random variables :math:`X_i` are
+normally-distributed, then the t-statistic has a `Student's t-distribution`_
+with :math:`N-1` degrees of freedom. This implies that
+
+.. math::
+ :label: t-probability
+
+ Pr \left ( -t_{1 - \alpha/2, N - 1} \le \frac{\bar{x} - \mu}{s/\sqrt{N}} \le
+ t_{1 - \alpha/2, N - 1} \right ) = 1 - \alpha
+
+where :math:`t_{1-\alpha/2, N-1}` is the :math:`1 - \alpha/2` percentile of a
+t-distribution with :math:`N-1` degrees of freedom. Thus, the :math:`1 - \alpha`
+two sided confidence interval for the sample mean is
+
+.. math::
+ :label: two-sided-ci
+
+ \bar{x} \pm t_{1 - \alpha/2, N-1} \frac{s}{\sqrt{N}}.
+
+One should be cautioned that equation :eq:`two-sided-ci` only applies if the
+*underlying random variables* are normally-distributed. In general, this may not
+be true for a tally random variable --- the central limit theorem guarantees
+only that the sample mean is normally distributed, not the underlying random
+variable. If batching is used, then the underlying random variable, which would
+then be the averages from each batch, will be normally distributed as long as
+the conditions of the central limit theorem are met.
+
+Let us now outline the method used to calculate the percentile of the Student's
+t-distribution. For one or two degrees of freedom, the percentile can be written
+analytically. For one degree of freedom, the t-distribution becomes a standard
+`Cauchy distribution`_ whose cumulative distribution function is
+
+.. math::
+ :label: cauchy-cdf
+
+ c(x) = \frac{1}{\pi} \arctan x + \frac{1}{2}.
+
+Thus, inverting the cumulative distribution function, we find the :math:`x`
+percentile of the standard Cauchy distribution to be
+
+.. math::
+ :label: percentile-1
+
+ t_{x,1} = \tan \left ( \pi \left ( x - \frac{1}{2} \right ) \right ).
+
+For two degrees of freedom, the cumulative distribution function is the
+second-degree polynomial
+
+.. math::
+ :label: t-2-polynomial
+
+ c(x) = \frac{1}{2} + \frac{x}{2\sqrt{x^2 + 2}}
+
+Solving for :math:`x`, we find the :math:`x` percentile to be
+
+.. math::
+ :label: percentile-2
+
+ t_{x,2} = \frac{2\sqrt{2} (x - 1/2)}{\sqrt{1 - 4 (x - 1/2)^2}}
+
+For degrees of freedom greater than two, it is not possible to obtain an
+analytical formula for the inverse of the cumulative distribution function. We
+must resort to either numerically solving for the inverse or to an
+approximation. Approximations for percentiles of the t-distribution have been
+found with high levels of accuracy. OpenMC uses the approximation from
+[George]_:
+
+.. math::
+ :label: percentile-n
+
+ t_{x,n} = \sqrt{\frac{n}{n-2}} \left ( z_x + \frac{1}{4} \frac{z_x^3 -
+ 3z_x}{n-2} + \frac{1}{96} \frac{5z_x^5 - 56z_x^3 + 75z_x}{(n-2)^2} +
+ \frac{1}{384} \frac{3z_x^7 - 81z_x^5 + 417z_x^3 - 315z_x}{(n-2)^3} \right )
+
+where :math:`z_x` is the :math:`x` percentile of the standard normal
+distribution. In order to determine an arbitrary percentile of the standard
+normal distribution, we use an `unpublished rational approximation`_. After
+using the rational approximation, one iteration of Newton's method is applied to
+improve the estimate of the percentile.
+
+----------
+References
+----------
+
+.. [George] E. E. Olusegun George and Meenakshi Sivaram, "A modification of the
+ Fisher-Cornish approximation for the student t percentiles," Communication
+ in Statistics - Simulation and Computation, 16 (4), pp. 1123-1132 (1987).
+
+.. _Bessel's correction: http://en.wikipedia.org/wiki/Bessel's_correction
+
+.. _random variable: http://en.wikipedia.org/wiki/Random_variable
+
+.. _stochastic process: http://en.wikipedia.org/wiki/Stochastic_process
+
+.. _independent, identically-distributed random variables: http://en.wikipedia.org/wiki/Independent_and_identically_distributed_random_variables
+
+.. _law of large numbers: http://en.wikipedia.org/wiki/Law_of_large_numbers
+
+.. _expected value: http://en.wikipedia.org/wiki/Expected_value
+
+.. _converges in probability: http://en.wikipedia.org/wiki/Convergence_of_random_variables#Convergence_in_probability
+
+.. _normal distribution: http://en.wikipedia.org/wiki/Normal_distribution
+
+.. _converges in distribution: http://en.wikipedia.org/wiki/Convergence_of_random_variables#Convergence_in_distribution
+
+.. _confidence intervals: http://en.wikipedia.org/wiki/Confidence_interval
+
+.. _Student's t-distribution: http://en.wikipedia.org/wiki/Student%27s_t-distribution
+
+.. _Cauchy distribution: http://en.wikipedia.org/wiki/Cauchy_distribution
+
+.. _unpublished rational approximation: http://home.online.no/~pjacklam/notes/invnorm/
.. _MC21: http://www.osti.gov/bridge/servlets/purl/903083-HT5p1o/903083.pdf