Added data processing and visualization guidelines

This commit is contained in:
nhorelik 2013-04-18 17:34:55 -04:00
parent 847a542b48
commit 13422648f2
58 changed files with 10491 additions and 1630 deletions

BIN
_images/3dcore.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

BIN
_images/3dgeomplot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
_images/atr.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

BIN
_images/atr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

BIN
_images/fluxplot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
_images/plotmeshtally.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View file

@ -17,3 +17,4 @@ as debugging.
workflow
xml-fortran
statepoint
voxel

View file

@ -0,0 +1,54 @@
.. _devguide_voxel:
=====================================
Voxel Plot Binary File Specifications
=====================================
----------
Revision 1
----------
**integer(4) n_voxels_x**
Number of voxels in the x direction
**integer(4) n_voxels_y**
Number of voxels in the y direction
**integer(4) n_voxels_z**
Number of voxels in the z direction
**real(8) width_voxel_x**
Width of voxels in the x direction
**real(8) width_voxel_y**
Width of voxels in the y direction
**real(8) width_voxel_z**
Width of voxels in the z direction
**real(8) lower_left_x**
Lower left x point of the voxel grid
**real(8) lower_left_y**
Lower left y point of the voxel grid
**real(8) lower_left_z**
Lower left z point of the voxel grid
*do x = 1, n_voxels_x*
*do y = 1, n_voxels_y*
*do z = 1, n_voxels_z*
**integer(4) id**
Cell or material id number at this voxel center. Set to -1 when
cell not_found.

View file

@ -109,7 +109,9 @@ should be comfortable working in a command line environment. There are many
resources online for learning command line environments. If you are using Linux
or Mac OS X (also Unix-derived), `this tutorial
<http://www.ee.surrey.ac.uk/Teaching/Unix/>`_ will help you get acquainted with
commonly-used commands.
commonly-used commands. It is also helpful to be familiar with `Python
<http://www.python.org/>`_, as most of the post-processing utilities provided
with OpenMC rely on it for data manipulation and results visualization.
OpenMC uses a version control software called `git`_ to keep track of changes to
the code, document bugs and issues, and other development tasks. While you don't

View file

@ -14,4 +14,5 @@ essential aspects of using OpenMC to perform neutronic simulations.
beginners
install
input
processing
troubleshoot

View file

@ -941,19 +941,27 @@ tallies. This element should be followed by "true" or "false".
*Default*: false
.. _usersguide_plotting:
--------------------------------------------
Geometry Plotting Specification -- plots.xml
--------------------------------------------
A basic 2D plotting capability is available in OpenMC by creating a plots.xml
Basic plotting capabilities are available in OpenMC by creating a plots.xml
file and subsequently running with the command-line flag ``-plot``. The root
element of the plots.xml is simply ``<plots>`` and any number output figures can
be defined with ``<plot>`` sub-elements.
element of the plots.xml is simply ``<plots>`` and any number output plots can
be defined with ``<plot>`` sub-elements. Two plot types are currently
implemented in openMC:
* ``slice`` 2D pixel plot along one of the major axes. Produces a PPM image file.
* ``voxel`` 3D voxel data dump. Produces a binary file containing voxel xyz position and cell or material id.
``<plot>`` Element
------------------
Each plot must contain a combination of the following attributes or sub-elements:
Each plot must contain a combination of the following attributes or
sub-elements:
:id:
The unique ``id`` of the plot.
@ -967,7 +975,9 @@ Each plot must contain a combination of the following attributes or sub-elements
:color:
Keyword for plot coloring. This can only be either ``cell`` or ``mat``,
which colors regions by cells and materials, respectively.
which colors regions by cells and materials, respectively. For voxel plots,
this determines which id (cell or material) is associated with each
position.
*Default*: ``cell``
@ -985,60 +995,75 @@ Each plot must contain a combination of the following attributes or sub-elements
*Default*: None - Required entry
:type:
Keyword for type of plot to be produced. Currently only ``slice`` plots are
implemented, which create 2D pixel maps saved in the PPM file format. PPM
files can be displayed in most viewers (e.g. the default Gnome viewer,
IrfanView, etc.).
Keyword for type of plot to be produced. Currently only "slice" and
"voxel" plots are implemented. The "slice" plot type creates 2D pixel
maps saved in the PPM file format. PPM files can be displayed in most
viewers (e.g. the default Gnome viewer, IrfanView, etc.). The "voxel"
plot type produces a binary datafile containing voxel grid positioning and
the cell or material (specified by the ``color`` tag) at the center of each
voxel. These datafiles can be processed into 3D SILO files using the
``voxel.py`` utility provided with the OpenMC source, and subsequently
viewed with a 3D viewer such as VISIT or Paraview. See the
:ref:`devguide_voxel` for information about the datafile structure.
.. note:: Since the PPM format is saved without any kind of compression,
the resulting file sizes can be quite large. Saving the image in
the PNG format can often times reduce the file size by orders of
magnitude without any loss of image quality.
magnitude without any loss of image quality. Likewise,
high-resolution voxel files produced by OpenMC can be quite large,
but the equivalent SILO files will by significantly smaller.
*Default*: "slice"
``<plot>`` elements of ``type`` "slice" also contain the following attributes or
sub-elements:
``<plot>`` elements of ``type`` "slice" and "voxel" must contain the ``pixels``
attribute or sub-element:
:pixels:
Specifies the number of pixes or voxels to be used along each of the basis
directions for "slice" and "voxel" plots, respectively. Should be two or
three integers separated by spaces.
.. warning:: The ``pixels`` input determines the output file size. For the
PPM format, 10 million pixels will result in a file just under
30 MB in size. A 10 million voxel binary file will be around
40 MB.
.. warning:: If the aspect ratio defined in ``pixels`` does not match the
aspect ratio defined in ``width`` the plot may appear stretched
or squeezed.
.. warning:: Geometry features along a basis direction smaller than
``width``/``pixels`` along that basis direction may not appear
in the plot.
*Default*: None - Required entry for "slice" and "voxel" plots
``<plot>`` elements of ``type`` "slice" can also contain the following
attributes or sub-elements. These are not used in "voxel" plots:
:basis:
Keyword specifying the plane of the plot for ``slice`` type plots. Can be
Keyword specifying the plane of the plot for "slice" type plots. Can be
one of: "xy", "xz", "yz".
*Default*: "xy"
:pixels:
Specifies the number of pixes to be used along each of the basis directions
for "slice" plots. Should be two integers separated by spaces.
.. warning:: The ``pixels`` input determines the output file size. For the PPM
format, 10 million pixels will result in a file just under 30 MB in
size.
.. warning:: If the aspect ratio defined in ``pixels`` does not match the aspect
ratio defined in ``width`` the plot may appear stretched or squeezed.
.. warning:: Geometry features along a basis direction smaller than ``width``/``pixels``
along that basis direction may not appear in the plot.
*Default*: None - Required entry for "slice" plots
:background:
Specifies the RGB color of the regions where no OpenMC cell can be found. Should
be three integers separated by spaces.
Specifies the RGB color of the regions where no OpenMC cell can be found.
Should be three integers separated by spaces.
*Default*: 0 0 0 (white)
:col_spec:
Any number of this optional tag may be included in each ``<plot>`` element, which can
override the default random colors for cells or materials. Each ``col_spec``
element must contain ``id`` and ``rgb`` sub-elements.
Any number of this optional tag may be included in each ``<plot>`` element,
which can override the default random colors for cells or materials. Each
``col_spec`` element must contain ``id`` and ``rgb`` sub-elements.
:id:
Specifies the cell or material unique id for the color specification.
:rgb:
Specifies the custom color for the cell or material. Should be 3 integers separated
by spaces.
Specifies the custom color for the cell or material. Should be 3 integers
separated by spaces.
As an example, if your plot is colored by material and you want material 23
to be blue, the corresponding ``col_spec`` element would look like:
@ -1051,17 +1076,18 @@ sub-elements:
:mask:
The special ``mask`` sub-element allows for the selective plotting of *only*
user-specified cells or materials. Only one ``mask`` element is allowed per ``plot``
element, and it must contain as attributes or sub-elements a background masking color and
a list of cells or materials to plot:
user-specified cells or materials. Only one ``mask`` element is allowed per
``plot`` element, and it must contain as attributes or sub-elements a
background masking color and a list of cells or materials to plot:
:components:
List of unique ``id`` numbers of the cells or materials to plot. Should be any number
of integers separated by spaces.
List of unique ``id`` numbers of the cells or materials to plot. Should be
any number of integers separated by spaces.
:background:
Color to apply to all cells or materials not in the ``components`` list of cells or
materials to plot. This overrides any ``col_spec`` color specifications.
Color to apply to all cells or materials not in the ``components`` list of
cells or materials to plot. This overrides any ``col_spec`` color
specifications.
*Default*: None

View file

@ -0,0 +1,360 @@
.. _usersguide_processing:
=================================
Data Processing and Visualization
=================================
This section is intended to explain in detail the recommended procedures for
carrying out common tasks with OpenMC. While several utilities of varying
complexity are provided to help automate the process, in many cases it will be
extremely beneficial to do some coding in Python to quickly obtain results. In
these cases, and for many of the provided utilities, it is necessary for your
Python installation to contain:
* [1]_ `Numpy <http://www.numpy.org/>`_
* [1]_ `Scipy <http://www.scipy.org/>`_
* [2]_ `h5py <http://code.google.com/p/h5py/>`_
* [3]_ `Matplotlib <http://matplotlib.org/>`_
* [3]_ `Silomesh <https://github.com/nhorelik/silomesh>`_
* [3]_ `VTK <http://www.vtk.org/>`_
* [4]_ `PyQt <http://www.riverbankcomputing.com/software/pyqt>`_
Most of these are easily obtainable in Ubuntu through the package manager, or
are easily installed with setuptools.
.. [1] Required for tally data extraction from statepoints with statepoint.py
.. [2] Required only if reading HDF5 statepoint files.
.. [3] Optional for plotting utilities
.. [4] Optional for interactive GUIs
----------------------
Geometry Visualization
----------------------
Geometry plotting is carried out by creating a plots.xml, specifying plots, and
running OpenMC with the -plot or -p command-line option (See
:ref:`usersguide_plotting`).
Plotting in 2D
--------------
.. image:: ../../img/atr.png
:height: 200px
After running OpenMC to obtain PPM files, images should be saved to another
format before using them elsewhere. This cuts down the size of the file by
orders of magnitude. Most image viewers and editors that can view PPM images
can also save to other formats (e.g. `Gimp <http://www.gimp.org/>`_, `IrfanView
<http://www.irfanview.com/>`_, etc.). However, more likey the user will want to
convert to another format on the command line. This is easily accomplished with
the ``convert`` command available on most linux distributions as part of the
`ImageMagick <http://www.imagemagick.org/script/convert.php>`_ package. (On
Ubuntu: ``sudo apt-get install imagemagick``). Images are then converted like:
.. code-block:: sh
convert plot.ppm plot.png
Plotting in 3D
--------------
.. image:: ../../img/3dgeomplot.png
:height: 200px
The binary VOXEL files output by OpenMC can not be viewed directly by any
existing viewers. In order to view them, they must be converted into a standard
mesh format that can be viewed in ParaView, Visit, etc. The provided utility
voxel.py accomplishes this for SILO:
.. code-block:: sh
<openmc_root>/src/utils/voxel.py myplot.voxel -o output.silo
and VTK file formats:
.. code-block:: sh
<openmc_root>/src/utils/myplot.voxel --vtk -o output.vti
To use this utility you need either
* `Silomesh <https://github.com/nhorelik/silomesh>`_
or
* `VTK <http://www.vtk.org/>`_ with python bindings - On Ubuntu, these are easily obtained with ``sudo apt-get install python-vtk``
Users can process the binary into any other format if desired by following the
example of voxel.py. For the binary file structure, see :ref:`devguide_voxel`.
.. note:: 3D voxel plotting can be very computer intensive for the viewing
program (Visit, Paraview, etc.) if the number of voxels is large
(>10million or so). Thus if you want an accurate picture that
renders smoothly, consider using only one voxel in a certain
direction. For instance, the 3D pin lattice figure above was generated
with a 500x500x1 voxel mesh, which allows for resolution of the
cylinders without wasting too many voxels on the axial dimension.
-------------------
Tally Visualization
-------------------
Tally results are saved in both a text file (tallies.out) as well as a binary
statepoint file. While the tallies.out file may be fine for simple tallies, in
many cases the user requires more information about the tally or the run, or
has to deal with a large number of result values (e.g. for mesh tallies). In
these cases, extracting data from the statepoint file via Python scripting is
the preferred method of data analysis and visualization.
Data Extraction
---------------
A great deal of information is available in statepoint files (See
:ref:`devguide_statepoint`), most of which is easily extracted by the provided
utility statepoint.py. This utility provides a Python class to load statepoints
and extract data - it is used in many of the provided plotting utilities, and
can be used in user-created scripts to carry out manipulations of the data. To
read tallies using this utility, make sure statepoint.py is in your PYTHONPATH,
and then import the class, instantiate it, and call read_results:
.. code-block:: python
from statepoint import StatePoint
sp = StatePoint('statepoint.100.binary')
sp.read_results()
At this point the user can extract entire scores from tallies into a data
dictionary containing numpy arrays:
.. code-block:: python
tallyid = 1
score = 'flux'
data = sp.extract_results(tallyid, score)
means = data['means']
print data.keys()
The results from this function contain all filter bins (all mesh points, all
energy groups, etc.), which can be reshaped with the bin ordering also contained
in the output dictionary. This is the best choice of output for easily
integrating ranges of data.
Alternatively the user can extract specific values for a single score/filter
combination:
.. code-block:: python
tallyid = 1
score = 'flux'
filters = [('mesh', (1, 1, 5)), ('energyin', 0)]
value, error = sp.get_value(tallyid, filters, score)
In the future more documentaion may become available here for statepoint.py and
the data extraction functions of StatePoint objects. However, for now it is up
to the user to explore the classes in statepoint.py to discover what data is
available in StatePoint objects (we highly recommend interactively exploring
with `IPython <http://ipython.org/>`_). Many exmaples can be found by looking
through the other utilies that use statepoint.py, and a few common visualization
tasks will be described here in the following sections.
Plotting in 2D
--------------
.. image:: ../../img/plotmeshtally.png
:height: 200px
For simple viewing of 2D slices of a mesh plot, the utility plot_mesh_tally.py
is provided. This utility provides an interactive GUI to explore and plot
mesh tallies for any scores and filter bins. It requires statepoint.py, as well
as `PyQt <http://www.riverbankcomputing.com/software/pyqt>`_.
.. image:: ../../img/fluxplot.png
:height: 200px
Alternatively, the user can write their own Python script to manipulate the data
appropriately. Consider a run where the first tally contains a 105x105x1 mesh
over a small core, with a flux score and two energyin filter bins. To explicitly
extract the data and create a plot with gnuplot, the following script can be
used. The script operates in several steps for clarity, and is not necessarily
the most efficient way to extract data from large mesh tallies. This creates the
two heatmaps in the previous figure.
.. code-block:: python
#!/usr/bin/env python
import os
import statepoint
# load and parse the statepoint file
sp = statepoint.StatePoint('statepoint.300.binary')
sp.read_results()
tallyid = 0 # This is tally 1
score = 0 # This corresponds to flux (see tally.scores)
# get mesh dimensions
meshid = sp.tallies[tallyid].filters['mesh'].bins[0]
for i,m in enumerate(sp.meshes):
if m.id == meshid:
mesh = m
break
nx,ny,nz = mesh.dimension
# loop through mesh and extract values to python dictionaries
thermal = {}
fast = {}
for x in range(1,nx+1):
for y in range(1,ny+1):
for z in range(1,nz+1):
val,err = sp.get_value(tallyid,
[('mesh',(x,y,z)),('energyin',0)],
score)
thermal[(x,y,z)] = val
val,err = sp.get_value(tallyid,
[('mesh',(x,y,z)),('energyin',1)],
score)
fast[(x,y,z)] = val
# sum up the axial values and write datafile for gnuplot
with open('meshdata.dat','w') as fh:
for x in range(1,nx+1):
for y in range(1,ny+1):
thermalval = 0.
fastval = 0.
for z in range(1,nz+1):
thermalval += thermal[(x,y,z)]
fastval += fast[(x,y,z)]
fh.write("{} {} {} {}\n".format(x,y,thermalval,fastval))
# write gnuplot file
with open('tmp.gnuplot','w') as fh:
fh.write(r"""set terminal png size 1000 400
set output 'fluxplot.png'
set nokey
set autoscale fix
set multiplot layout 1,2 title "Pin Mesh Flux Tally"
set title "Thermal"
plot 'meshdata.dat' using 1:2:3 with image
set title "Fast"
plot 'meshdata.dat' using 1:2:4 with image
""")
# make plot
os.system("gnuplot < tmp.gnuplot")
Plotting in 3D
--------------
.. image:: ../../img/3dcore.png
:height: 200px
As with 3D plots of the geometry, meshtally data needs to be put into a standard
format for viewing. The utility statepoint_3d.py is provided to accomplish this
for both VTK and SILO. By default statepoint_3d.py processes a statepoint into a
3D file with all mesh tallies and filter/score combinations,
.. code-block:: sh
<openmc_root>/src/utils/statepoint_3d.py <statepoint_file> -o output.silo
<openmc_root>/src/utils/statepoint_3d.py <statepoint_file> --vtk -o output.vtm
but it also provides several command-line options to selectively process only
certain data arrays in order to keep file sizes down.
.. code-block:: sh
<openmc_root>/src/utils/statepoint_3d.py <statepoint_file> -tallies 2,4 --scores 4.1,4.3 -o output.silo
<openmc_root>/src/utils/statepoint_3d.py <statepoint_file> -filters 2.energyin.1 --vtk -o output.vtm
All available options for specifying a subset of tallies, scores, and filters
can be listed with the ``--list`` or ``-l`` command line options.
.. note:: Note that while SILO files can contain multiple meshes in one file,
VTK needs to use a multi-block dataset, which stores each mesh piece
in a different file in a subfolder. All meshes can be loaded at once
with the main VTM file, or each VTI file in the subfolder can be
loaded individually.
Alternatively, the user can write their own Python script to manipulate the data
appropriately before insertion into a SILO or VTK file. For instance, if the
data has been extracted as was done in the 2D plotting example script above, a
SILO file can be created with:
.. code-block:: python
import silomesh as sm
sm.init_silo("fluxtally.silo")
sm.init_mesh('tally_mesh',*mesh.dimension, *mesh.lower_left, *mesh.width)
sm.init_var('flux_tally_thermal')
for x in range(1,nx+1):
for y in range(1,ny+1):
for z in range(1,nz+1):
sm.set_value(float(thermal[(x,y,z)]),x,y,z)
sm.finalize_var()
sm.init_var('flux_tally_fast')
for x in range(1,nx+1):
for y in range(1,ny+1):
for z in range(1,nz+1):
sm.set_value(float(fast[(x,y,z)]),x,y,z)
sm.finalize_var()
sm.finalize_mesh()
sm.finalize_silo()
and the equivalent VTK file with:
.. code-block:: python
import vtk
grid = vtk.vtkImageData()
grid.SetDimensions(nx+1,ny+1,nz+1)
grid.SetOrigin(*mesh.lower_left)
grid.SetSpacing(*mesh.width)
# vtk cell arrays have x on the inners, so we need to reorder the data
idata = {}
for x in range(nx):
for y in range(ny):
for z in range(nz):
i = z*nx*ny + y*nx + x
idata[i] = (x,y,z)
vtkfastdata = vtk.vtkDoubleArray()
vtkfastdata.SetName("fast")
for i in range(nx*ny*nz):
vtkfastdata.InsertNextValue(fast[idata[i]])
vtkthermaldata = vtk.vtkDoubleArray()
vtkthermaldata.SetName("thermal")
for i in range(nx*ny*nz):
vtkthermaldata.InsertNextValue(thermal[idata[i]])
grid.GetCellData().AddArray(vtkfastdata)
grid.GetCellData().AddArray(vtkthermaldata)
writer = vtk.vtkXMLImageDataWriter()
writer.SetInput(grid)
writer.SetFileName('tally.vti')
writer.Write()
Getting Data into MATLAB
------------------------
There is currently no front-end utility to dump tally data to MATLAB files, but
the process is straightforward. First extract the data using a custom Python
script with statepoint.py, put the data into appropriately-shaped numpy arrays,
and then use the `Scipy MATLAB IO routines
<http://docs.scipy.org/doc/scipy/reference/tutorial/io.html>`_ to save to a MAT
file. Note that the data contained in the output from
``StatePoint.extract_result`` is already in a Numpy array that can be reshaped
and dumped to MATLAB in one step.

View file

@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -79,14 +79,6 @@ div.sphinxsidebar input {
font-size: 1em;
}
div.sphinxsidebar #searchbox input[type="text"] {
width: 170px;
}
div.sphinxsidebar #searchbox input[type="submit"] {
width: 30px;
}
img {
border: 0;
}
@ -221,29 +213,12 @@ p.rubric {
font-weight: bold;
}
img.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}
img.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left;
}
.align-center {
clear: both;
text-align: center;
}
@ -420,7 +395,7 @@ dl.glossary dt {
}
.footnote:target {
background-color: #ffa;
background-color: #ffa
}
.line-block {
@ -447,16 +422,10 @@ dl.glossary dt {
font-style: oblique;
}
abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
}
/* -- code displays --------------------------------------------------------- */
pre {
overflow: auto;
overflow-y: hidden; /* fixes display issues on Chrome browsers */
}
td.linenos pre {
@ -537,4 +506,4 @@ span.eqno {
#top-link {
display: none;
}
}
}

View file

@ -2,9 +2,9 @@
* doctools.js
* ~~~~~~~~~~~
*
* Sphinx JavaScript utilities for all documentation.
* Sphinx JavaScript utilties for all documentation.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -185,9 +185,9 @@ var Documentation = {
body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10);
$('<p class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
.appendTo($('#searchbox'));
$('<li class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></li>')
.appendTo($('.sidebar .this-page-menu'));
}
},
@ -213,7 +213,7 @@ var Documentation = {
* helper function to hide the search marks again
*/
hideSearchWords : function() {
$('#searchbox .highlight-link').fadeOut(300);
$('.sidebar .this-page-menu li.highlight-link').fadeOut(300);
$('span.highlighted').removeClass('highlighted');
},

View file

@ -16,7 +16,7 @@
* Braden Ewing <brewin@gmail.com>
* Humdinger <humdingerb@gmail.com>
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -292,7 +292,7 @@ li {
line-height: 1.3;
}
div.content ul > li {
div.content li {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;

8308
_static/jquery.js vendored

File diff suppressed because it is too large Load diff

View file

@ -1,70 +1,69 @@
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
.highlight .c { color: #8f5902; font-style: italic } /* Comment */
.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */
.highlight .g { color: #000000 } /* Generic */
.highlight .k { color: #204a87; font-weight: bold } /* Keyword */
.highlight .l { color: #000000 } /* Literal */
.highlight .n { color: #000000 } /* Name */
.highlight .o { color: #ce5c00; font-weight: bold } /* Operator */
.highlight .x { color: #000000 } /* Other */
.highlight .p { color: #000000; font-weight: bold } /* Punctuation */
.highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #8f5902; font-style: italic } /* Comment.Preproc */
.highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */
.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */
.highlight .gd { color: #a40000 } /* Generic.Deleted */
.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
.highlight .gr { color: #ef2929 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #000000; font-style: italic } /* Generic.Output */
.highlight .gp { color: #8f5902 } /* Generic.Prompt */
.highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */
.highlight .kc { color: #204a87; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #204a87; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #204a87; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #204a87; font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #204a87; font-weight: bold } /* Keyword.Type */
.highlight .ld { color: #000000 } /* Literal.Date */
.highlight .m { color: #0000cf; font-weight: bold } /* Literal.Number */
.highlight .s { color: #4e9a06 } /* Literal.String */
.highlight .na { color: #c4a000 } /* Name.Attribute */
.highlight .nb { color: #204a87 } /* Name.Builtin */
.highlight .nc { color: #000000 } /* Name.Class */
.highlight .no { color: #000000 } /* Name.Constant */
.highlight .nd { color: #5c35cc; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #ce5c00 } /* Name.Entity */
.highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #000000 } /* Name.Function */
.highlight .nl { color: #f57900 } /* Name.Label */
.highlight .nn { color: #000000 } /* Name.Namespace */
.highlight .nx { color: #000000 } /* Name.Other */
.highlight .py { color: #000000 } /* Name.Property */
.highlight .nt { color: #204a87; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #000000 } /* Name.Variable */
.highlight .ow { color: #204a87; font-weight: bold } /* Operator.Word */
.highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */
.highlight .mf { color: #0000cf; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000cf; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000cf; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000cf; font-weight: bold } /* Literal.Number.Oct */
.highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */
.highlight .sc { color: #4e9a06 } /* Literal.String.Char */
.highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4e9a06 } /* Literal.String.Double */
.highlight .se { color: #4e9a06 } /* Literal.String.Escape */
.highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */
.highlight .si { color: #4e9a06 } /* Literal.String.Interpol */
.highlight .sx { color: #4e9a06 } /* Literal.String.Other */
.highlight .sr { color: #4e9a06 } /* Literal.String.Regex */
.highlight .s1 { color: #4e9a06 } /* Literal.String.Single */
.highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */
.highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #000000 } /* Name.Variable.Class */
.highlight .vg { color: #000000 } /* Name.Variable.Global */
.highlight .vi { color: #000000 } /* Name.Variable.Instance */
.highlight .il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */
.hll { background-color: #ffffcc }
.c { color: #8f5902; font-style: italic } /* Comment */
.err { color: #a40000; border: 1px solid #ef2929 } /* Error */
.g { color: #000000 } /* Generic */
.k { color: #204a87; font-weight: bold } /* Keyword */
.l { color: #000000 } /* Literal */
.n { color: #000000 } /* Name */
.o { color: #ce5c00; font-weight: bold } /* Operator */
.x { color: #000000 } /* Other */
.p { color: #000000; font-weight: bold } /* Punctuation */
.cm { color: #8f5902; font-style: italic } /* Comment.Multiline */
.cp { color: #8f5902; font-style: italic } /* Comment.Preproc */
.c1 { color: #8f5902; font-style: italic } /* Comment.Single */
.cs { color: #8f5902; font-style: italic } /* Comment.Special */
.gd { color: #a40000 } /* Generic.Deleted */
.ge { color: #000000; font-style: italic } /* Generic.Emph */
.gr { color: #ef2929 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #00A000 } /* Generic.Inserted */
.go { color: #000000; font-style: italic } /* Generic.Output */
.gp { color: #8f5902 } /* Generic.Prompt */
.gs { color: #000000; font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #a40000; font-weight: bold } /* Generic.Traceback */
.kc { color: #204a87; font-weight: bold } /* Keyword.Constant */
.kd { color: #204a87; font-weight: bold } /* Keyword.Declaration */
.kn { color: #204a87; font-weight: bold } /* Keyword.Namespace */
.kp { color: #204a87; font-weight: bold } /* Keyword.Pseudo */
.kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */
.kt { color: #204a87; font-weight: bold } /* Keyword.Type */
.ld { color: #000000 } /* Literal.Date */
.m { color: #0000cf; font-weight: bold } /* Literal.Number */
.s { color: #4e9a06 } /* Literal.String */
.na { color: #c4a000 } /* Name.Attribute */
.nb { color: #204a87 } /* Name.Builtin */
.nc { color: #000000 } /* Name.Class */
.no { color: #000000 } /* Name.Constant */
.nd { color: #5c35cc; font-weight: bold } /* Name.Decorator */
.ni { color: #ce5c00 } /* Name.Entity */
.ne { color: #cc0000; font-weight: bold } /* Name.Exception */
.nf { color: #000000 } /* Name.Function */
.nl { color: #f57900 } /* Name.Label */
.nn { color: #000000 } /* Name.Namespace */
.nx { color: #000000 } /* Name.Other */
.py { color: #000000 } /* Name.Property */
.nt { color: #204a87; font-weight: bold } /* Name.Tag */
.nv { color: #000000 } /* Name.Variable */
.ow { color: #204a87; font-weight: bold } /* Operator.Word */
.w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */
.mf { color: #0000cf; font-weight: bold } /* Literal.Number.Float */
.mh { color: #0000cf; font-weight: bold } /* Literal.Number.Hex */
.mi { color: #0000cf; font-weight: bold } /* Literal.Number.Integer */
.mo { color: #0000cf; font-weight: bold } /* Literal.Number.Oct */
.sb { color: #4e9a06 } /* Literal.String.Backtick */
.sc { color: #4e9a06 } /* Literal.String.Char */
.sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */
.s2 { color: #4e9a06 } /* Literal.String.Double */
.se { color: #4e9a06 } /* Literal.String.Escape */
.sh { color: #4e9a06 } /* Literal.String.Heredoc */
.si { color: #4e9a06 } /* Literal.String.Interpol */
.sx { color: #4e9a06 } /* Literal.String.Other */
.sr { color: #4e9a06 } /* Literal.String.Regex */
.s1 { color: #4e9a06 } /* Literal.String.Single */
.ss { color: #4e9a06 } /* Literal.String.Symbol */
.bp { color: #3465a4 } /* Name.Builtin.Pseudo */
.vc { color: #000000 } /* Name.Variable.Class */
.vg { color: #000000 } /* Name.Variable.Global */
.vi { color: #000000 } /* Name.Variable.Instance */
.il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */

View file

@ -1,10 +1,10 @@
/*
* searchtools.js_t
* ~~~~~~~~~~~~~~~~
* searchtools.js
* ~~~~~~~~~~~~~~
*
* Sphinx JavaScript utilties for the full-text search.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -36,11 +36,10 @@ jQuery.makeSearchSummary = function(text, keywords, hlwords) {
return rv;
}
/**
* Porter Stemmer
*/
var Stemmer = function() {
var PorterStemmer = function() {
var step2list = {
ational: 'ate',
@ -301,20 +300,20 @@ var Search = {
},
query : function(query) {
var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"];
var stopwords = ['and', 'then', 'into', 'it', 'as', 'are', 'in',
'if', 'for', 'no', 'there', 'their', 'was', 'is',
'be', 'to', 'that', 'but', 'they', 'not', 'such',
'with', 'by', 'a', 'on', 'these', 'of', 'will',
'this', 'near', 'the', 'or', 'at'];
// Stem the searchterms and add them to the correct list
var stemmer = new Stemmer();
// stem the searchterms and add them to the correct list
var stemmer = new PorterStemmer();
var searchterms = [];
var excluded = [];
var hlterms = [];
var tmp = query.split(/\s+/);
var objectterms = [];
var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null;
for (var i = 0; i < tmp.length; i++) {
if (tmp[i] != "") {
objectterms.push(tmp[i].toLowerCase());
}
if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] == "") {
// skip this "word"
@ -345,6 +344,9 @@ var Search = {
var filenames = this._index.filenames;
var titles = this._index.titles;
var terms = this._index.terms;
var objects = this._index.objects;
var objtypes = this._index.objtypes;
var objnames = this._index.objnames;
var fileMap = {};
var files = null;
// different result priorities
@ -355,19 +357,40 @@ var Search = {
$('#search-progress').empty();
// lookup as object
for (var i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0,i),
objectterms.slice(i+1, objectterms.length))
var results = this.performObjectSearch(objectterms[i], others);
// Assume first word is most likely to be the object,
// other words more likely to be in description.
// Therefore put matches for earlier words first.
// (Results are eventually used in reverse order).
objectResults = results[0].concat(objectResults);
importantResults = results[1].concat(importantResults);
unimportantResults = results[2].concat(unimportantResults);
if (object != null) {
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
match = objects[prefix][name];
descr = objnames[match[1]] + _(', in ') + titles[match[0]];
// XXX the generated anchors are not generally correct
// XXX there may be custom prefixes
result = [filenames[match[0]], fullname, '#'+fullname, descr];
switch (match[2]) {
case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break;
case 2: unimportantResults.push(result); break;
}
}
}
}
}
// sort results descending
objectResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
importantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
unimportantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
// perform the search on the required terms
for (var i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
@ -466,7 +489,7 @@ var Search = {
listItem.slideDown(5, function() {
displayNextItem();
});
}, "text");
});
} else {
// no source available, just display title
Search.output.append(listItem);
@ -487,74 +510,9 @@ var Search = {
}
}
displayNextItem();
},
performObjectSearch : function(object, otherterms) {
var filenames = this._index.filenames;
var objects = this._index.objects;
var objnames = this._index.objnames;
var titles = this._index.titles;
var importantResults = [];
var objectResults = [];
var unimportantResults = [];
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
var match = objects[prefix][name];
var objname = objnames[match[1]][2];
var title = titles[match[0]];
// If more than one term searched for, we require other words to be
// found in the name/title/description
if (otherterms.length > 0) {
var haystack = (prefix + ' ' + name + ' ' +
objname + ' ' + title).toLowerCase();
var allfound = true;
for (var i = 0; i < otherterms.length; i++) {
if (haystack.indexOf(otherterms[i]) == -1) {
allfound = false;
break;
}
}
if (!allfound) {
continue;
}
}
var descr = objname + _(', in ') + title;
anchor = match[3];
if (anchor == '')
anchor = fullname;
else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname;
result = [filenames[match[0]], fullname, '#'+anchor, descr];
switch (match[2]) {
case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break;
case 2: unimportantResults.push(result); break;
}
}
}
}
// sort results descending
objectResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
importantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
unimportantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
return [importantResults, objectResults, unimportantResults]
}
}
$(document).ready(function() {
Search.init();
});
});

View file

@ -1,10 +1,3 @@
// Underscore.js 0.5.5
// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the terms of the MIT license.
// Portions of Underscore are inspired by or borrowed from Prototype.js,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore/
(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d,
a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c);
var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c,

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Development Team &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
@ -77,7 +74,7 @@
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Developers Guide &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -92,6 +89,10 @@ as debugging.</p>
<li class="toctree-l2"><a class="reference internal" href="statepoint.html#revision-1">5.8. Revision 1</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="voxel.html">6. Voxel Plot Binary File Specifications</a><ul>
<li class="toctree-l2"><a class="reference internal" href="voxel.html#revision-1">6.1. Revision 1</a></li>
</ul>
</li>
</ul>
</div>
</div>
@ -113,7 +114,7 @@ as debugging.</p>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

File diff suppressed because it is too large Load diff

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>1. Data Structures &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -189,7 +186,7 @@ module</a> is of type MaterialMacroXS.</p>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>2. Style Guide for OpenMC &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -176,7 +173,7 @@ No: if ( variable==2 ) then</pre>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

135
devguide/voxel.html Normal file
View file

@ -0,0 +1,135 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>6. Voxel Plot Binary File Specifications &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.5.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/theme_extras.js"></script>
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="up" title="Developers Guide" href="index.html" />
<link rel="next" title="Publications" href="../publications.html" />
<link rel="prev" title="5. State Point Binary File Specifications" href="statepoint.html" />
</head>
<body>
<div class="header">
<a href="../index.html">
<img class="logo" src="../_static/openmc.png" alt="Logo"/>
</a>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="statepoint.html">5. State Point Binary File Specifications</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="../publications.html">Publications</a>&#160;&#160;»
</p>
</div>
<div class="content">
<div class="section" id="voxel-plot-binary-file-specifications">
<span id="devguide-voxel"></span><h1>6. Voxel Plot Binary File Specifications<a class="headerlink" href="#voxel-plot-binary-file-specifications" title="Permalink to this headline"></a></h1>
<div class="section" id="revision-1">
<h2>6.1. Revision 1<a class="headerlink" href="#revision-1" title="Permalink to this headline"></a></h2>
<p><strong>integer(4) n_voxels_x</strong></p>
<blockquote>
Number of voxels in the x direction</blockquote>
<p><strong>integer(4) n_voxels_y</strong></p>
<blockquote>
Number of voxels in the y direction</blockquote>
<p><strong>integer(4) n_voxels_z</strong></p>
<blockquote>
Number of voxels in the z direction</blockquote>
<p><strong>real(8) width_voxel_x</strong></p>
<blockquote>
Width of voxels in the x direction</blockquote>
<p><strong>real(8) width_voxel_y</strong></p>
<blockquote>
Width of voxels in the y direction</blockquote>
<p><strong>real(8) width_voxel_z</strong></p>
<blockquote>
Width of voxels in the z direction</blockquote>
<p><strong>real(8) lower_left_x</strong></p>
<blockquote>
Lower left x point of the voxel grid</blockquote>
<p><strong>real(8) lower_left_y</strong></p>
<blockquote>
Lower left y point of the voxel grid</blockquote>
<p><strong>real(8) lower_left_z</strong></p>
<blockquote>
Lower left z point of the voxel grid</blockquote>
<dl class="docutils">
<dt><em>do x = 1, n_voxels_x</em></dt>
<dd><dl class="first last docutils">
<dt><em>do y = 1, n_voxels_y</em></dt>
<dd><p class="first"><em>do z = 1, n_voxels_z</em></p>
<blockquote class="last">
<p><strong>integer(4) id</strong></p>
<blockquote>
Cell or material id number at this voxel center. Set to -1 when
cell not_found.</blockquote>
</blockquote>
</dd>
</dl>
</dd>
</dl>
</div>
</div>
</div>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="statepoint.html">5. State Point Binary File Specifications</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="../publications.html">Publications</a>&#160;&#160;»
</p>
</div>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30411614-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>3. Development Workflow &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -102,7 +99,7 @@ of pulling a branch from your private repository into your public fork.</p>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>4. xml-fortran Input Parsing &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -97,7 +94,7 @@ run. You will need to be familiar with RELAX NG <a class="reference external" hr
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -1,21 +1,16 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
@ -48,53 +43,34 @@
<h1 id="index">Index</h1>
<h1 id="index">Index</h1>
<div class="genindex-jumpbox">
<a href="#C"><strong>C</strong></a>
| <a href="#E"><strong>E</strong></a>
| <a href="#P"><strong>P</strong></a>
</div>
<div class="genindex-jumpbox">
<a href="#C"><strong>C</strong></a> | <a href="#E"><strong>E</strong></a> | <a href="#P"><strong>P</strong></a>
</div>
<h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="usersguide/install.html#index-0">CROSS_SECTIONS</a>, <a href="usersguide/install.html#index-1">[1]</a>, <a href="usersguide/install.html#index-2">[2]</a>, <a href="usersguide/input.html#index-0">[3]</a>, <a href="usersguide/troubleshoot.html#index-2">[4]</a>, <a href="usersguide/troubleshoot.html#index-3">[5]</a>
</dt>
</dl></td>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="usersguide/install.html#index-0">CROSS_SECTIONS</a>, <a href="usersguide/install.html#index-1">[1]</a>, <a href="usersguide/install.html#index-2">[2]</a>, <a href="usersguide/input.html#index-0">[3]</a>, <a href="usersguide/troubleshoot.html#index-2">[4]</a>, <a href="usersguide/troubleshoot.html#index-3">[5]</a></dt>
</dl></td>
</tr></table>
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt>
environment variable
</dt>
<dd><dl>
<dt><a href="usersguide/install.html#index-0">CROSS_SECTIONS</a>, <a href="usersguide/install.html#index-1">[1]</a>, <a href="usersguide/install.html#index-2">[2]</a>, <a href="usersguide/input.html#index-0">[3]</a>, <a href="usersguide/troubleshoot.html#index-2">[4]</a>, <a href="usersguide/troubleshoot.html#index-3">[5]</a>
</dt>
<dt><a href="usersguide/troubleshoot.html#index-0">PATH</a>, <a href="usersguide/troubleshoot.html#index-1">[1]</a>
</dt>
</dl></dd>
</dl></td>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt>environment variable</dt>
<dd><dl>
<dt><a href="usersguide/install.html#index-0">CROSS_SECTIONS</a>, <a href="usersguide/install.html#index-1">[1]</a>, <a href="usersguide/install.html#index-2">[2]</a>, <a href="usersguide/input.html#index-0">[3]</a>, <a href="usersguide/troubleshoot.html#index-2">[4]</a>, <a href="usersguide/troubleshoot.html#index-3">[5]</a></dt>
<dt><a href="usersguide/troubleshoot.html#index-0">PATH</a>, <a href="usersguide/troubleshoot.html#index-1">[1]</a></dt>
</dl></dd>
</dl></td>
</tr></table>
<h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="usersguide/troubleshoot.html#index-0">PATH</a>, <a href="usersguide/troubleshoot.html#index-1">[1]</a>
</dt>
</dl></td>
<table width="100%" class="indextable genindextable"><tr>
<td width="33%" valign="top"><dl>
<dt><a href="usersguide/troubleshoot.html#index-0">PATH</a>, <a href="usersguide/troubleshoot.html#index-1">[1]</a></dt>
</dl></td>
</tr></table>
@ -111,7 +87,7 @@
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The OpenMC Monte Carlo Code &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
@ -92,7 +89,7 @@ free to send a message to the User&#8217;s Group <a class="reference external" h
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>License Agreement &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
@ -87,7 +84,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>3. Cross Section Representation &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -122,7 +119,8 @@ 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 <em>double
indexing</em> and is available as an option in Serpent (see paper by <a class="reference external" href="http://dx.doi.org/10.1016/j.anucene.2009.03.019">Leppanen</a>).</p>
<div class="align-center figure align-center">
<img src="../_images/uniongrid.svg" width="600px" /><p class="caption">Mapping of union energy grid to nuclide energy grid through pointers.</p>
<object data="../_images/uniongrid.svg" type="image/svg+xml" width="600px"><embed src="../_images/uniongrid.svg" type="image/svg+xml" width="600px" /></object>
<p class="caption">Mapping of union energy grid to nuclide energy grid through pointers.</p>
</div>
</div>
</div>
@ -145,7 +143,7 @@ indexing</em> and is available as an option in Serpent (see paper by <a class="r
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>7. Eigenvalue Calculations &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -122,10 +119,10 @@ geometry (containing at least all fissionable materials). Then, the fraction of
source sites that are present in each mesh element is counted:</p>
<div class="math" id="equation-fraction-source">
<p><span class="eqno">(1)</span><img src="../_images/math/3e3bda3f18b93acfcfbc4fee5bba064bbae2b0c4.png" alt="S_i = \frac{\text{Source sites in $i$-th mesh element}}{\text{Total number of
source sites}}"/></p>
source sites}}" /></p>
</div><p>The Shannon entropy is then computed as</p>
<div class="math" id="equation-shannon-entropy">
<p><span class="eqno">(2)</span><img src="../_images/math/7473e93f886ae7e01cd1bd9fd7d21e5d365e4b0e.png" alt="H = - \sum_{i=1}^N S_i \log_2 S_i"/></p>
<p><span class="eqno">(2)</span><img src="../_images/math/7473e93f886ae7e01cd1bd9fd7d21e5d365e4b0e.png" alt="H = - \sum_{i=1}^N S_i \log_2 S_i" /></p>
</div><p>where <img class="math" src="../_images/math/fc97ef67268cd4e91bacdf12b8901d7036c9a056.png" alt="N"/> is the number of mesh elements. With equation
<a href="#equation-shannon-entropy">(2)</a>, we now have a scalar metric that we can use to assess the
convergence of the source distribution by observing line plots of the Shannon
@ -180,7 +177,7 @@ Convergence,&#8221; <em>Trans. Am. Nucl. Soc.</em>, <strong>98</strong>, 512 (20
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>2. Geometry &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -69,11 +66,11 @@ as the positive half-space.</p>
<p>Let us take the example of a sphere centered at the point <img class="math" src="../_images/math/7245d49359f8c8c13b14f96061fac66b438cd96c.png" alt="(x_0,y_0,z_0)"/>
with radius <img class="math" src="../_images/math/eff43e84f8a3bcf7b6965f0a3248bc4d3a9d0cd4.png" alt="R"/>. One would normally write the equation of the sphere as</p>
<div class="math" id="equation-sphere-equation">
<p><span class="eqno">(1)</span><img src="../_images/math/6af9dc356b69290567be1ba77869f260e7878658.png" alt="(x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 = R^2"/></p>
<p><span class="eqno">(1)</span><img src="../_images/math/6af9dc356b69290567be1ba77869f260e7878658.png" alt="(x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 = R^2" /></p>
</div><p>By subtracting the right-hand term from both sides of equation
<a href="#equation-sphere-equation">(1)</a>, we can then write the surface equation for the sphere:</p>
<div class="math" id="equation-surface-equation-sphere">
<p><span class="eqno">(2)</span><img src="../_images/math/39665b0464c468ea0d6cd2a77305e14a67e08ab7.png" alt="f(x,y,z) = (x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 - R^2 = 0"/></p>
<p><span class="eqno">(2)</span><img src="../_images/math/39665b0464c468ea0d6cd2a77305e14a67e08ab7.png" alt="f(x,y,z) = (x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 - R^2 = 0" /></p>
</div><p>One can confirm that any point inside this sphere will correspond to
<img class="math" src="../_images/math/1604bf914aa13876506e25fccafd05ba52c235ff.png" alt="f(x,y,z) &lt; 0"/> and any point outside the sphere will correspond to
<img class="math" src="../_images/math/0432656583b9d022cbfc26ee144bc86dca260bbf.png" alt="f(x,y,z) &gt; 0"/>.</p>
@ -83,7 +80,8 @@ surface by a combination of the unique ID of the surface and a positive/negative
sign. The following illustration shows an example of an ellipse with unique ID 1
dividing space into two half-spaces.</p>
<div class="align-center figure align-center">
<img src="../_images/halfspace.svg" /><p class="caption">Example of an ellipse and its associated half-spaces.</p>
<object data="../_images/halfspace.svg" type="image/svg+xml"><embed src="../_images/halfspace.svg" type="image/svg+xml" /></object>
<p class="caption">Example of an ellipse and its associated half-spaces.</p>
</div>
<p>References to half-spaces created by surfaces are used to define regions of
space of uniform composition, known as <em>cells</em>. While some codes allow regions
@ -94,7 +92,8 @@ 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.</p>
<div class="align-center figure align-center">
<img src="../_images/union.svg" /><p class="caption">The shaded region represents a cell bounded by three surfaces.</p>
<object data="../_images/union.svg" type="image/svg+xml"><embed src="../_images/union.svg" type="image/svg+xml" /></object>
<p class="caption">The shaded region represents a cell bounded by three surfaces.</p>
</div>
<p>The ability to form regions based on bounding quadratic surfaces enables OpenMC
to model arbitrarily complex three-dimensional objects. In practice, one is
@ -111,37 +110,37 @@ to fully define the surface.</p>
<col width="28%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Surface</th>
<tr><th class="head">Surface</th>
<th class="head">Identifier</th>
<th class="head">Equation</th>
<th class="head">Parameters</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>Plane perpendicular
<tr><td>Plane perpendicular
to <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/>-axis</td>
<td>x-plane</td>
<td><img class="math" src="../_images/math/006d7ad8cb8d2c3b8ad5ec7b2542af99f91bb8c6.png" alt="x - x_0 = 0"/></td>
<td><img class="math" src="../_images/math/17f1249ad95b7682b8316ad21de8ce4ee9fdcf93.png" alt="x_0"/></td>
</tr>
<tr class="row-odd"><td>Plane perpendicular
<tr><td>Plane perpendicular
to <img class="math" src="../_images/math/092e364e1d9d19ad5fffb0b46ef4cc7f2da02c1c.png" alt="y"/>-axis</td>
<td>y-plane</td>
<td><img class="math" src="../_images/math/006d7ad8cb8d2c3b8ad5ec7b2542af99f91bb8c6.png" alt="x - x_0 = 0"/></td>
<td><img class="math" src="../_images/math/721e40b7e0ac4359611aebe48cfb63122a347798.png" alt="y_0"/></td>
</tr>
<tr class="row-even"><td>Plane perpendicular
<tr><td>Plane perpendicular
to <img class="math" src="../_images/math/b13f21416d84e13708696f34dea81026cda583c9.png" alt="z"/>-axis</td>
<td>z-plane</td>
<td><img class="math" src="../_images/math/006d7ad8cb8d2c3b8ad5ec7b2542af99f91bb8c6.png" alt="x - x_0 = 0"/></td>
<td><img class="math" src="../_images/math/bab9abe98679312d2a3308c76188cf2cbc492f68.png" alt="z_0"/></td>
</tr>
<tr class="row-odd"><td>Arbitrary plane</td>
<tr><td>Arbitrary plane</td>
<td>plane</td>
<td><img class="math" src="../_images/math/eb8661ea00d3e9e10ef23de03755960eec4b554f.png" alt="Ax + By + Cz = D"/></td>
<td><img class="math" src="../_images/math/a5dcd1621630cb79cbd9d098c352efd564692125.png" alt="A\;B\;C\;D"/></td>
</tr>
<tr class="row-even"><td>Infinite cylinder
<tr><td>Infinite cylinder
parallel to
<img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/>-axis</td>
<td>x-cylinder</td>
@ -149,7 +148,7 @@ parallel to
= R^2"/></td>
<td><img class="math" src="../_images/math/91564f3935a5e8dc746e34e3cc8ef0f53c31ea48.png" alt="y_0\;z_0\;R"/></td>
</tr>
<tr class="row-odd"><td>Infinite cylinder
<tr><td>Infinite cylinder
parallel to
<img class="math" src="../_images/math/092e364e1d9d19ad5fffb0b46ef4cc7f2da02c1c.png" alt="y"/>-axis</td>
<td>y-cylinder</td>
@ -157,7 +156,7 @@ parallel to
= R^2"/></td>
<td><img class="math" src="../_images/math/98c5e2bf6de276d2d6c6dcd521181005cf66bf70.png" alt="x_0\;z_0\;R"/></td>
</tr>
<tr class="row-even"><td>Infinite cylinder
<tr><td>Infinite cylinder
parallel to
<img class="math" src="../_images/math/b13f21416d84e13708696f34dea81026cda583c9.png" alt="z"/>-axis</td>
<td>z-cylinder</td>
@ -165,14 +164,14 @@ parallel to
= R^2"/></td>
<td><img class="math" src="../_images/math/26cd500e91d1291645c1f2deb55e03e532902802.png" alt="x_0\;y_0\;R"/></td>
</tr>
<tr class="row-odd"><td>Sphere</td>
<tr><td>Sphere</td>
<td>sphere</td>
<td><img class="math" src="../_images/math/55661164baa521f78c15a180cb3bc25c2ccea4ad.png" alt="(x-x_0)^2 + (y-y_0)^2
+ (z-z_0)^2 = R^2"/></td>
<td><img class="math" src="../_images/math/8edc991d37b3fa110b88c93a607969cfe30f6af8.png" alt="x_0 \; y_0 \;
z_0 \; R"/></td>
</tr>
<tr class="row-even"><td>Cone parallel to the
<tr><td>Cone parallel to the
<img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/>-axis</td>
<td>x-cone</td>
<td><img class="math" src="../_images/math/acc9948bd95c09c736c99d00ad637d74eabbb64c.png" alt="(y-y_0)^2 + (z-z_0)^2
@ -180,7 +179,7 @@ z_0 \; R"/></td>
<td><img class="math" src="../_images/math/f02389d958251c37b8f71f21654e1cb959da7f67.png" alt="x_0 \; y_0 \;
z_0 \; R^2"/></td>
</tr>
<tr class="row-odd"><td>Cone parallel to the
<tr><td>Cone parallel to the
<img class="math" src="../_images/math/092e364e1d9d19ad5fffb0b46ef4cc7f2da02c1c.png" alt="y"/>-axis</td>
<td>y-cone</td>
<td><img class="math" src="../_images/math/2c5415a924d36e2734a23f99e94257d5091db94d.png" alt="(x-x_0)^2 + (z-z_0)^2
@ -188,7 +187,7 @@ z_0 \; R^2"/></td>
<td><img class="math" src="../_images/math/f02389d958251c37b8f71f21654e1cb959da7f67.png" alt="x_0 \; y_0 \;
z_0 \; R^2"/></td>
</tr>
<tr class="row-even"><td>Cone parallel to the
<tr><td>Cone parallel to the
<img class="math" src="../_images/math/b13f21416d84e13708696f34dea81026cda583c9.png" alt="z"/>-axis</td>
<td>z-cone</td>
<td><img class="math" src="../_images/math/ede9bb1f4819f7c9658ac21ee97abfe983accc96.png" alt="(x-x_0)^2 + (y-y_0)^2
@ -258,7 +257,7 @@ surface. Suppose we have a particle at <img class="math" src="../_images/math/72
direction <img class="math" src="../_images/math/743d82e64ffa9e9d405065f74882a39a67c2a34a.png" alt="u_0,v_0,w_0"/>. To find the distance <img class="math" src="../_images/math/96ab646de7704969b91c76a214126b45f2b07b25.png" alt="d"/> to a surface
<img class="math" src="../_images/math/7a618bda1847d33ede0ff905641965782665226a.png" alt="f(x,y,z) = 0"/>, we need to solve the equation:</p>
<div class="math" id="equation-dist-to-boundary-1">
<p><span class="eqno">(3)</span><img src="../_images/math/fd02377eaf710d12e68cb7e0f4fc46f356fdefad.png" alt="f(x_0 + du_0, y_0 + dv_0, z_0 + dw_0) = 0"/></p>
<p><span class="eqno">(3)</span><img src="../_images/math/fd02377eaf710d12e68cb7e0f4fc46f356fdefad.png" alt="f(x_0 + du_0, y_0 + dv_0, z_0 + dw_0) = 0" /></p>
</div><p>If no solutions to equation <a href="#equation-dist-to-boundary-1">(3)</a> exist or the only solutions
are complex, then the particle&#8217;s direction of travel will not intersect the
surface. If the solution to equation <a href="#equation-dist-to-boundary-1">(3)</a> is negative, this
@ -282,7 +281,7 @@ to the use of floating-point arithmetic. Consequently, we should first check for
floating-point equality of the current distance calculated and the minimum found
thus far. This is done by checking if</p>
<div class="math" id="equation-fp-distance">
<p><span class="eqno">(4)</span><img src="../_images/math/805ab2394e98d49017a525d4de5f66d820de1914.png" alt="\frac{| d - d_{min} |}{d_{min}} &lt; \epsilon"/></p>
<p><span class="eqno">(4)</span><img src="../_images/math/805ab2394e98d49017a525d4de5f66d820de1914.png" alt="\frac{| d - d_{min} |}{d_{min}} &lt; \epsilon" /></p>
</div><p>where <img class="math" src="../_images/math/96ab646de7704969b91c76a214126b45f2b07b25.png" alt="d"/> is the distance to a surface just calculated, <img class="math" src="../_images/math/3bf67af3365f4a79643a8f83ccb546ab0465f8c6.png" alt="d_{min}"/> is
the minimum distance found thus far, and <img class="math" src="../_images/math/eaf4418fbe935c15a606516d8f55dc380cd8e822.png" alt="\epsilon"/> is a small number. In
OpenMC, this parameter is set to <img class="math" src="../_images/math/fe73ff328f5390abe4321dedca99491e5136e5c7.png" alt="\epsilon = 10^{-14}"/> since all floating
@ -293,7 +292,7 @@ calculations are done on 8-byte floating point numbers.</p>
<img class="math" src="../_images/math/006d7ad8cb8d2c3b8ad5ec7b2542af99f91bb8c6.png" alt="x - x_0 = 0"/>. As such, we need to solve <img class="math" src="../_images/math/bb3fffdb83748cc9f5ab0b8c7df6cee8dafd8f51.png" alt="x + du - x_0 = 0"/>. The
solution for the distance is</p>
<div class="math" id="equation-dist-xplane">
<p><span class="eqno">(5)</span><img src="../_images/math/c45ce0d87e6ca560da0708c3e321ad7c63bade68.png" alt="d = \frac{x_0 - x}{u}"/></p>
<p><span class="eqno">(5)</span><img src="../_images/math/c45ce0d87e6ca560da0708c3e321ad7c63bade68.png" alt="d = \frac{x_0 - x}{u}" /></p>
</div><p>Note that if the particle&#8217;s direction of flight is parallel to the x-axis,
i.e. <img class="math" src="../_images/math/7d43eae6892d884f8e8f4345b93c83fcf7db3481.png" alt="u = 0"/>, the distance to the surface will be infinity. While the
example here was for a plane perpendicular to the x-axis, the same formula can
@ -305,7 +304,7 @@ be applied for the surfaces <img class="math" src="../_images/math/386d08a29da93
solve the equation <img class="math" src="../_images/math/c6d0eaa4590b6b777c41f96430ba714713a71498.png" alt="A(x + du) + B(y + dv) + C(z + dw) = D"/>. The solution
to this equation for the distance is</p>
<div class="math" id="equation-dist-plane">
<p><span class="eqno">(6)</span><img src="../_images/math/065d9778ccf955e57611bb0d67e60512630aeb6e.png" alt="d = \frac{D - Ax - By - Cz}{Au + Bv + Cw}"/></p>
<p><span class="eqno">(6)</span><img src="../_images/math/065d9778ccf955e57611bb0d67e60512630aeb6e.png" alt="d = \frac{D - Ax - By - Cz}{Au + Bv + Cw}" /></p>
</div><p>Again, we need to check whether the denominator is zero. If so, this means that
the particle&#8217;s direction of flight is parallel to the plane and it will
therefore never hit the plane.</p>
@ -317,17 +316,17 @@ y_0)^2 + (z - z_0)^2 = R^2"/>. Thus, we need to solve <img class="math" src="../
(z + dw - z_0)^2 = R^2"/>. Let us define <img class="math" src="../_images/math/0a00d0284d1808a4f2b2e78591f2207e848b7231.png" alt="\bar{y} = y - y_0"/> and
<img class="math" src="../_images/math/72f232750ca08ddc2c2143c1e5de9d18ae93a35a.png" alt="\bar{z} = z - z_0"/>. We then have</p>
<div class="math" id="equation-dist-xcylinder-1">
<p><span class="eqno">(7)</span><img src="../_images/math/023e5f78508abf67433d9e0ff4b5d6f735638975.png" alt="(\bar{y} + dv)^2 + (\bar{z} + dw)^2 = R^2"/></p>
<p><span class="eqno">(7)</span><img src="../_images/math/023e5f78508abf67433d9e0ff4b5d6f735638975.png" alt="(\bar{y} + dv)^2 + (\bar{z} + dw)^2 = R^2" /></p>
</div><p>Expanding equation <a href="#equation-dist-xcylinder-1">(7)</a> and rearranging terms, we obtain</p>
<div class="math" id="equation-dist-xcylinder-2">
<p><span class="eqno">(8)</span><img src="../_images/math/2ddcddfefa7b01420efa31ea67ef8b5abf23eedd.png" alt="(v^2 + w^2) d^2 + 2 (\bar{y}v + \bar{z}w) d + (\bar{y}^2 + \bar{z}^2 - R^2)
= 0"/></p>
= 0" /></p>
</div><p>This is a quadratic equation for <img class="math" src="../_images/math/96ab646de7704969b91c76a214126b45f2b07b25.png" alt="d"/>. To simplify notation, let us define
<img class="math" src="../_images/math/552c7b5303abab999dc5733916f14a21cc0c12ab.png" alt="a = v^2 + w^2"/>, <img class="math" src="../_images/math/0b42151a7e81b90d33d9a8cd22aaf2b3433e8ecf.png" alt="k = \bar{y}v + \bar{z}w"/>, and <img class="math" src="../_images/math/3880717638f9e93894d243d195f073474aedd47e.png" alt="c =
\bar{y}^2 + \bar{z}^2 - R^2"/>. Thus, the distance is just the solution to
<img class="math" src="../_images/math/9b71db75317a4244ae00249612c4ae395798002c.png" alt="ad^2 + 2kd + c = 0"/>:</p>
<div class="math" id="equation-dist-xcylinder-3">
<p><span class="eqno">(9)</span><img src="../_images/math/4be78a435d229d2d0e048b4c14a2f53a6f186790.png" alt="d = \frac{-k \pm \sqrt{k^2 - ac}}{a}"/></p>
<p><span class="eqno">(9)</span><img src="../_images/math/4be78a435d229d2d0e048b4c14a2f53a6f186790.png" alt="d = \frac{-k \pm \sqrt{k^2 - ac}}{a}" /></p>
</div><p>A few conditions must be checked for. If <img class="math" src="../_images/math/b5969c2cfb1ffadf981fbbddcf796c8eb0037546.png" alt="a = 0"/>, this means the particle
is parallel to the cylinder and will thus never intersect it. Also, if
<img class="math" src="../_images/math/41c1468d83188091c8cc09cc72a6eba119946889.png" alt="k^2 - ac &lt; 0"/>, this means that both solutions to the quadratic are
@ -350,21 +349,21 @@ the y- or z-axis with appropriate substitution of constants.</p>
<p>The equation for a sphere is <img class="math" src="../_images/math/62a745995df775198e16354b6b1ed9887e88c8a2.png" alt="(x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 =
R^2"/>. Thus, we need to solve the equation</p>
<div class="math" id="equation-dist-sphere-1">
<p><span class="eqno">(10)</span><img src="../_images/math/0c0c7c7a36ede0ff443adf06fea0aac3b95d4574.png" alt="(x + du - x_0)^2 + (y + dv - y_0)^2 + (z + dw - z_0)^2 = R^2"/></p>
<p><span class="eqno">(10)</span><img src="../_images/math/0c0c7c7a36ede0ff443adf06fea0aac3b95d4574.png" alt="(x + du - x_0)^2 + (y + dv - y_0)^2 + (z + dw - z_0)^2 = R^2" /></p>
</div><p>Let us define <img class="math" src="../_images/math/5522c7baeeb345c4c79eeefd6f8c143569d7124e.png" alt="\bar{x} = x - x_0"/>, <img class="math" src="../_images/math/0a00d0284d1808a4f2b2e78591f2207e848b7231.png" alt="\bar{y} = y - y_0"/>, and
<img class="math" src="../_images/math/72f232750ca08ddc2c2143c1e5de9d18ae93a35a.png" alt="\bar{z} = z - z_0"/>. We then have</p>
<div class="math" id="equation-dist-sphere-2">
<p><span class="eqno">(11)</span><img src="../_images/math/f3f870e629b4f6f8cddd2f9c584d1d7b86b9a1d9.png" alt="(\bar{x} + du)^2 + (\bar{y} + dv)^2 + (\bar{z} - dw)^2 = R^2"/></p>
<p><span class="eqno">(11)</span><img src="../_images/math/f3f870e629b4f6f8cddd2f9c584d1d7b86b9a1d9.png" alt="(\bar{x} + du)^2 + (\bar{y} + dv)^2 + (\bar{z} - dw)^2 = R^2" /></p>
</div><p>Expanding equation <a href="#equation-dist-sphere-2">(11)</a> and rearranging terms, we obtain</p>
<div class="math" id="equation-dist-sphere-3">
<p><span class="eqno">(12)</span><img src="../_images/math/29839d6d8734f2b93d9830405ad0d0c17ebeb793.png" alt="d^2 + 2 (\bar{x}u + \bar{y}v + \bar{z}w) d + (\bar{x}^2 + \bar{y}^2 +
\bar{z}^2 - R^2) = 0"/></p>
\bar{z}^2 - R^2) = 0" /></p>
</div><p>This is a quadratic equation for <img class="math" src="../_images/math/96ab646de7704969b91c76a214126b45f2b07b25.png" alt="d"/>. To simplify notation, let us define
<img class="math" src="../_images/math/f967083137ca6bc489a7d760500f1626950348ec.png" alt="k = \bar{x}u + \bar{y}v + \bar{z}w"/> and <img class="math" src="../_images/math/e1c4f2d842a96c281126d6a9c96e6178c8cc2906.png" alt="c = \bar{x}^2 +
\bar{y}^2 + \bar{z}^2 - R^2"/>. Thus, the distance is just the solution to
<img class="math" src="../_images/math/ea7f4f738e809d175c21c4d61ff338d0a8cc22f2.png" alt="d^2 + 2kd + c = 0"/>:</p>
<div class="math" id="equation-dist-sphere-4">
<p><span class="eqno">(13)</span><img src="../_images/math/b41787afffa93c2dc63e78e824cf5a5f6380e57c.png" alt="d = -k \pm \sqrt{k^2 - c}"/></p>
<p><span class="eqno">(13)</span><img src="../_images/math/b41787afffa93c2dc63e78e824cf5a5f6380e57c.png" alt="d = -k \pm \sqrt{k^2 - c}" /></p>
</div><p>If the discriminant <img class="math" src="../_images/math/fc119d611e5569f18a2ee709788edbc042337dbb.png" alt="k^2 - c &lt; 0"/>, this means that both solutions to the
quadratic are complex. In physical terms, this means that the ray along which
the particle is traveling does not make any intersections with the sphere.</p>
@ -424,7 +423,7 @@ satisfy the following equations</p>
<div class="math" id="equation-cell-contains-example">
<p><span class="eqno">(14)</span><img src="../_images/math/62884471151b5b416440a48eebf15dabbcda3ee9.png" alt="x^2 + y^2 + z^2 - 10^2 &lt; 0 \\
x - (-3) &gt; 0 \\
x - 2 &lt; 0"/></p>
x - 2 &lt; 0" /></p>
</div><p>In order to determine if a point is inside the cell, we would substitute its
coordinates into equation <a href="#equation-cell-contains-example">(14)</a>. If the inequalities are
satisfied, than the point is indeed inside the cell.</p>
@ -468,7 +467,7 @@ the form <img class="math" src="../_images/math/7a618bda1847d33ede0ff90564196578
shown based on geometric arguments that the velocity vector will then become</p>
<div class="math" id="equation-reflection-v">
<p><span class="eqno">(15)</span><img src="../_images/math/ec1573ce905ac3e6758c191cd5c52441ed093cf8.png" alt="\mathbf{v'} = \mathbf{v} - 2 (\mathbf{v} \cdot \hat{\mathbf{n}})
\hat{\mathbf{n}}"/></p>
\hat{\mathbf{n}}" /></p>
</div><p>where <img class="math" src="../_images/math/c784dcc2598753df9d694c4439b2320311b94dca.png" alt="\hat{\mathbf{n}}"/> is a unit vector normal to the surface at the
point of the surface crossing. The rationale for this can be understood by
noting that <img class="math" src="../_images/math/6cc64cef9dd78d8ebeaac5be511a9c7a2e7c46c1.png" alt="(\mathbf{v} \cdot \hat{\mathbf{n}}) \hat{\mathbf{n}}"/> is the
@ -479,14 +478,14 @@ it undergoes reflection, we can work with the direction of the particle instead,
simplifying equation <a href="#equation-reflection-v">(15)</a> to</p>
<div class="math" id="equation-reflection-omega">
<p><span class="eqno">(16)</span><img src="../_images/math/c30255f7373ba4c0c669ac42c49de7a2aada0e78.png" alt="\mathbf{\Omega'} = \mathbf{\Omega} - 2 (\mathbf{\Omega} \cdot
\hat{\mathbf{n}}) \hat{\mathbf{n}}"/></p>
\hat{\mathbf{n}}) \hat{\mathbf{n}}" /></p>
</div><p>where <img class="math" src="../_images/math/8902a6b128ac408eb591049357b288ec9974597c.png" alt="\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. <img class="math" src="../_images/math/b6d0248415e45cef5618aa27e4eba785b557a247.png" alt="\mathbf{n} = \nabla f(x,y,z)"/>. Substituting this into equation
<a href="#equation-reflection-omega">(16)</a>, we get</p>
<div class="math" id="equation-reflection-omega-2">
<p><span class="eqno">(17)</span><img src="../_images/math/6691142bd6d03bb1d1d04127d50cb2d64c259351.png" alt="\mathbf{\Omega'} = \mathbf{\Omega} - \frac{2 ( \mathbf{\Omega} \cdot \nabla
f )}{|| \nabla f ||^2} \nabla f"/></p>
f )}{|| \nabla f ||^2} \nabla f" /></p>
</div><p>If we write the initial and final directions in terms of their vector
components, <img class="math" src="../_images/math/0a52937936569faf92ef9903c95786bb6dc7fe92.png" alt="\mathbf{\Omega} = (u,v,w)"/> and <img class="math" src="../_images/math/2b6b36e5469ce3bdaab26de02fd55dba0ed5c79c.png" alt="\mathbf{\Omega'} = (u',
v', w')"/>, this allows us to represent equation <a href="#equation-reflection-omega">(16)</a> as a
@ -499,7 +498,7 @@ v' = v - \frac{2 ( \mathbf{\Omega} \cdot \nabla f )}{|| \nabla f ||^2}
\frac{\partial f}{\partial y} \\
w' = w - \frac{2 ( \mathbf{\Omega} \cdot \nabla f )}{|| \nabla f ||^2}
\frac{\partial f}{\partial z}"/></p>
\frac{\partial f}{\partial z}" /></p>
</div><p>One can then use equation <a href="#equation-reflection-system">(18)</a> to develop equations for
transforming a particle&#8217;s direction given the equation of the surface.</p>
<div class="section" id="id2">
@ -513,7 +512,7 @@ i.e. <img class="math" src="../_images/math/932b703c250c884b7e59a99a749303b233c1
<a href="#equation-reflection-system">(18)</a> tell us that <img class="math" src="../_images/math/a9f23bf124b6b2b2a993eb313c72e678664ac74a.png" alt="v"/> and <img class="math" src="../_images/math/9ee4b825a2e36ae093ed7be5e4851ef453b34914.png" alt="w"/> do not change and
the first tell us that</p>
<div class="math" id="equation-reflection-xplane">
<p><span class="eqno">(19)</span><img src="../_images/math/c1f5bd38a6e006fbfddb9d99442aff7f79c231de.png" alt="u' = u - 2u = -u"/></p>
<p><span class="eqno">(19)</span><img src="../_images/math/c1f5bd38a6e006fbfddb9d99442aff7f79c231de.png" alt="u' = u - 2u = -u" /></p>
</div><p>We see that reflection for a plane perpendicular to an axis only entails
negating the directional cosine for that axis.</p>
</div>
@ -524,12 +523,12 @@ gradient to the surface is simply <img class="math" src="../_images/math/6e5e488
is <img class="math" src="../_images/math/b8314fe89d6a6080868132447c26fdf3a41466f2.png" alt="A^2 + B^2 + C^2"/>. This implies that</p>
<div class="math" id="equation-reflection-plane-constant">
<p><span class="eqno">(20)</span><img src="../_images/math/cd79c917ed9869131ec06e249294fedcf74422c3.png" alt="\frac{2 (\mathbf{\Omega} \cdot \nabla f)}{|| \nabla f ||^2} = \frac{2(Au +
Bv + Cw)}{A^2 + B^2 + C^2}"/></p>
Bv + Cw)}{A^2 + B^2 + C^2}" /></p>
</div><p>Substituting equation <a href="#equation-reflection-plane-constant">(20)</a> into equation
<a href="#equation-reflection-system">(18)</a> gives us the form of the solution. For example, the
x-component of the reflected direction will be</p>
<div class="math" id="equation-reflection-plane">
<p><span class="eqno">(21)</span><img src="../_images/math/823b09cef32bbcf3b6d605a8574ae69bddc480e6.png" alt="u' = u - \frac{2A(Au + Bv + Cw)}{A^2 + B^2 + C^2}"/></p>
<p><span class="eqno">(21)</span><img src="../_images/math/823b09cef32bbcf3b6d605a8574ae69bddc480e6.png" alt="u' = u - \frac{2A(Au + Bv + Cw)}{A^2 + B^2 + C^2}" /></p>
</div></div>
<div class="section" id="id4">
<h3>2.7.3. Cylinder Parallel to an Axis<a class="headerlink" href="#id4" title="Permalink to this headline"></a></h3>
@ -538,15 +537,15 @@ x-component of the reflected direction will be</p>
<div class="math" id="equation-reflection-cylinder-grad">
<p><span class="eqno">(22)</span><img src="../_images/math/55b4c1d4ebe989491368fc80ba15ac48821d33af.png" alt="\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}
\right )"/></p>
\right )" /></p>
</div><p>where we have introduced the constants <img class="math" src="../_images/math/e1d96428f0b377d49f1f2facce5de7e3eefd1e1d.png" alt="\bar{y}"/> and
<img class="math" src="../_images/math/e2af86094c2d1dd57039c8e83bcc4193cf421714.png" alt="\bar{z}"/>. Taking the square of the norm of the gradient, we find that</p>
<div class="math" id="equation-reflection-cylinder-norm">
<p><span class="eqno">(23)</span><img src="../_images/math/c0151caa65f844b855cf3fd07e211abf5a1e7a5f.png" alt="|| \nabla f ||^2 = 4 \bar{y}^2 + 4 \bar{z}^2 = 4 R^2"/></p>
<p><span class="eqno">(23)</span><img src="../_images/math/c0151caa65f844b855cf3fd07e211abf5a1e7a5f.png" alt="|| \nabla f ||^2 = 4 \bar{y}^2 + 4 \bar{z}^2 = 4 R^2" /></p>
</div><p>This implies that</p>
<div class="math" id="equation-reflection-cylinder-constant">
<p><span class="eqno">(24)</span><img src="../_images/math/18ef0d7a11968a68c1d350abe6cfc663b76a3658.png" alt="\frac{2 (\mathbf{\Omega} \cdot \nabla f)}{|| \nabla f ||^2} =
\frac{\bar{y}v + \bar{z}w}{R^2}"/></p>
\frac{\bar{y}v + \bar{z}w}{R^2}" /></p>
</div><p>Substituting equations <a href="#equation-reflection-cylinder-constant">(24)</a> and
<a href="#equation-reflection-cylinder-grad">(22)</a> into equation <a href="#equation-reflection-system">(18)</a> gives us
the form of the solution. In this case, the x-component will not change. The y-
@ -554,7 +553,7 @@ and z-components of the reflected direction will be</p>
<div class="math" id="equation-reflection-cylinder">
<p><span class="eqno">(25)</span><img src="../_images/math/f6a2bb6638cb922c39d5953cd537000b0630df92.png" alt="v' = v - \frac{2 ( \bar{y}v + \bar{z}w ) \bar{y}}{R^2} \\
w' = w - \frac{2 ( \bar{y}v + \bar{z}w ) \bar{z}}{R^2}"/></p>
w' = w - \frac{2 ( \bar{y}v + \bar{z}w ) \bar{z}}{R^2}" /></p>
</div></div>
<div class="section" id="id5">
<h3>2.7.4. Sphere<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h3>
@ -563,15 +562,15 @@ w' = w - \frac{2 ( \bar{y}v + \bar{z}w ) \bar{z}}{R^2}"/></p>
<div class="math" id="equation-reflection-sphere-grad">
<p><span class="eqno">(26)</span><img src="../_images/math/614be9af23eb04ebb0b8ca697165544ee84ad961.png" alt="\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} \\
\bar{z} \end{array} \right )"/></p>
\bar{z} \end{array} \right )" /></p>
</div><p>where we have introduced the constants <img class="math" src="../_images/math/374727b5a3db983a8bfd53606a5bcad52974fa0e.png" alt="\bar{x}, \bar{y}, \bar{z}"/>. Taking
the square of the norm of the gradient, we find that</p>
<div class="math" id="equation-reflection-sphere-norm">
<p><span class="eqno">(27)</span><img src="../_images/math/93b0d92e3acc21309711b805308919421fa3d156.png" alt="|| \nabla f ||^2 = 4 \bar{x}^2 + 4 \bar{y}^2 + 4 \bar{z}^2 = 4 R^2"/></p>
<p><span class="eqno">(27)</span><img src="../_images/math/93b0d92e3acc21309711b805308919421fa3d156.png" alt="|| \nabla f ||^2 = 4 \bar{x}^2 + 4 \bar{y}^2 + 4 \bar{z}^2 = 4 R^2" /></p>
</div><p>This implies that</p>
<div class="math" id="equation-reflection-sphere-constant">
<p><span class="eqno">(28)</span><img src="../_images/math/2323375a7b3e25e197da1c2ec06dfd9d9a2de68b.png" alt="\frac{2 (\mathbf{\Omega} \cdot \nabla f)}{|| \nabla f ||^2} =
\frac{\bar{x}u + \bar{y}v + \bar{z}w}{R^2}"/></p>
\frac{\bar{x}u + \bar{y}v + \bar{z}w}{R^2}" /></p>
</div><p>Substituting equations <a href="#equation-reflection-sphere-constant">(28)</a> and
<a href="#equation-reflection-sphere-grad">(26)</a> into equation <a href="#equation-reflection-system">(18)</a> gives us the
form of the solution:</p>
@ -580,7 +579,7 @@ form of the solution:</p>
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}"/></p>
w' = w - \frac{2 ( \bar{x}u + \bar{y}v + \bar{z}w ) \bar{z} }{R^2}" /></p>
</div></div>
<div class="section" id="cone-parallel-to-an-axis">
<h3>2.7.5. Cone Parallel to an Axis<a class="headerlink" href="#cone-parallel-to-an-axis" title="Permalink to this headline"></a></h3>
@ -589,16 +588,16 @@ x_0)^2 + (y - y_0)^2 - R^2(z - z_0)^2 = 0"/>. Thus, the gradient to the surface
<div class="math" id="equation-reflection-cone-grad">
<p><span class="eqno">(30)</span><img src="../_images/math/a1ef9d021f4c802bdae5f783eab9e51dcee72510.png" alt="\nabla f = 2 \left ( \begin{array}{c} x - x_0 \\ y - y_0 \\ -R^2(z - z_0)
\end{array} \right ) = 2 \left ( \begin{array}{c} \bar{x} \\ \bar{y} \\
-R^2\bar{z} \end{array} \right )"/></p>
-R^2\bar{z} \end{array} \right )" /></p>
</div><p>where we have introduced the constants <img class="math" src="../_images/math/f06e84fe84a6c63a9c2c392af11652f6e0d72cf4.png" alt="\bar{x}"/>, <img class="math" src="../_images/math/e1d96428f0b377d49f1f2facce5de7e3eefd1e1d.png" alt="\bar{y}"/>, and
<img class="math" src="../_images/math/e2af86094c2d1dd57039c8e83bcc4193cf421714.png" alt="\bar{z}"/>. Taking the square of the norm of the gradient, we find that</p>
<div class="math" id="equation-reflection-cone-norm">
<p><span class="eqno">(31)</span><img src="../_images/math/ca751f3a8d974a9e697e3eddbcc09585ac5df268.png" alt="|| \nabla f ||^2 = 4 \bar{x}^2 + \bar{y}^2 + 4 R^4 \bar{z}^2 \\ = 4 R^2
\bar{z}^2 + 4 R^4 \bar{z}^2 \\ = 4 R^2 (1 + R^2) \bar{z}^2"/></p>
\bar{z}^2 + 4 R^4 \bar{z}^2 \\ = 4 R^2 (1 + R^2) \bar{z}^2" /></p>
</div><p>This implies that</p>
<div class="math" id="equation-reflection-cone-constant">
<p><span class="eqno">(32)</span><img src="../_images/math/adadb93cd8f30555c42a551b1d1c7fa176ed763b.png" alt="\frac{2 (\mathbf{\Omega} \cdot \nabla f)}{|| \nabla f ||^2} =
\frac{\bar{x}u + \bar{y}v - R^2\bar{z}w}{R^2 (1 + R^2) \bar{z}^2}"/></p>
\frac{\bar{x}u + \bar{y}v - R^2\bar{z}w}{R^2 (1 + R^2) \bar{z}^2}" /></p>
</div><p>Substituting equations <a href="#equation-reflection-cone-constant">(32)</a> and
<a href="#equation-reflection-cone-grad">(30)</a> into equation <a href="#equation-reflection-system">(18)</a> gives us the
form of the solution:</p>
@ -609,7 +608,7 @@ form of the solution:</p>
v' = v - \frac{2 (\bar{x}u + \bar{y}v - R^2\bar{z}w) \bar{y}}{R^2 (1 + R^2)
\bar{z}^2}
w' = w + \frac{2 (\bar{x}u + \bar{y}v - R^2\bar{z}w)}{R^2 (1 + R^2) \bar{z}}"/></p>
w' = w + \frac{2 (\bar{x}u + \bar{y}v - R^2\bar{z}w)}{R^2 (1 + R^2) \bar{z}}" /></p>
</div></div>
</div>
</div>
@ -631,7 +630,7 @@ w' = w + \frac{2 (\bar{x}u + \bar{y}v - R^2\bar{z}w)}{R^2 (1 + R^2) \bar{z}}"/><
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Theory and Methodology &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -189,7 +186,7 @@
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>1. Introduction &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -73,7 +70,7 @@ physical parameter being estimated with Monte Carlo will be inversely
proportional to the number of realizations, i.e. the number of particles we
simulate:</p>
<div class="math">
<p><img src="../_images/math/5cdd0f764bde67cbb5088eb5c4d83e7f39042a6c.png" alt="\sigma^2 \propto \frac{1}{N}."/></p>
<p><img src="../_images/math/5cdd0f764bde67cbb5088eb5c4d83e7f39042a6c.png" alt="\sigma^2 \propto \frac{1}{N}." /></p>
</div><p>where <img class="math" src="../_images/math/741fb9098efcb98055f467f87630a5d0ca599b6b.png" alt="\sigma^2"/> is the variance of the sample mean and <img class="math" src="../_images/math/fc97ef67268cd4e91bacdf12b8901d7036c9a056.png" alt="N"/> is the
number of realizations.</p>
<div class="section" id="overview-of-program-flow">
@ -83,7 +80,7 @@ is more than one particle being tracked on a single program instance. Before any
particles are tracked, the problem must be initialized. This involves the
following steps:</p>
<blockquote>
<div><ul class="simple">
<ul class="simple">
<li>Read input files and building data structures for the geometry, materials,
tallies, and other associated variables.</li>
<li>Initialize the pseudorandom number generator.</li>
@ -95,11 +92,11 @@ 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.</li>
</ul>
</div></blockquote>
</blockquote>
<p>Once initialization is complete, the actual transport simulation can
proceed. The life of a single particle will proceed as follows:</p>
<blockquote>
<div><ol class="arabic">
<ol class="arabic">
<li><p class="first">The particle&#8217;s properties are initialized from a source site previously
sampled.</p>
</li>
@ -116,7 +113,7 @@ based on the bounding surfaces to the cell.</p>
<li><p class="first">The distance to the next collision is sampled. If the total material
cross section is <img class="math" src="../_images/math/b5e850feb16eb83bd01af5524126befff31f202b.png" alt="\Sigma_t"/>, this can be shown to be</p>
<div class="math">
<p><img src="../_images/math/f858ab9fda0fbd2bd776f6027772ff17a08151da.png" alt="d = -\frac{\ln \xi}{\Sigma_t}"/></p>
<p><img src="../_images/math/f858ab9fda0fbd2bd776f6027772ff17a08151da.png" alt="d = -\frac{\ln \xi}{\Sigma_t}" /></p>
</div><p>where <img class="math" src="../_images/math/ccfd1641d037d427d9dbf42cdd54b485a03eafe9.png" alt="\xi"/> is a <a class="reference external" href="http://en.wikipedia.org/wiki/Pseudorandom_number_generator">pseudorandom number</a> sampled from a uniform
distribution on <img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/>.</p>
</li>
@ -130,7 +127,7 @@ the nuclide with which the collision will happen is sampled based on the
total cross sections. If the total cross section of material <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/> is
<img class="math" src="../_images/math/9370fd1a9c12c92cee13fe4202567905e145ebbc.png" alt="\Sigma_{t,i}"/>, then the probability that any nuclide is sampled is</p>
<div class="math">
<p><img src="../_images/math/f7df9cfe77fcdfe0919a31faa002a24ee2f57d87.png" alt="P(i) = \frac{\Sigma_{t,i}}{\Sigma_t}."/></p>
<p><img src="../_images/math/f7df9cfe77fcdfe0919a31faa002a24ee2f57d87.png" alt="P(i) = \frac{\Sigma_{t,i}}{\Sigma_t}." /></p>
</div></li>
<li><p class="first">Once the specific nuclide is sampled, the random samples a reaction for
that nuclide based on the microscopic cross sections. If the microscopic
@ -138,7 +135,7 @@ cross section for some reaction <img class="math" src="../_images/math/26eeb5258
microscopic cross section for the nuclide is <img class="math" src="../_images/math/c7de8622e17cddfc652ab2dc62616c622ba3bcfb.png" alt="\sigma_t"/>, then the
probability that reaction <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/> will occur is</p>
<div class="math">
<p><img src="../_images/math/eb30a459c3289b2855c466485f76637bb58d1db4.png" alt="P(x) = \frac{\sigma_x}{\sigma_t}."/></p>
<p><img src="../_images/math/eb30a459c3289b2855c466485f76637bb58d1db4.png" alt="P(x) = \frac{\sigma_x}{\sigma_t}." /></p>
</div></li>
<li><p class="first">If the sampled reaction is elastic or inelastic scattering, the outgoing
energy and angle is sampled from the appropriate distribution. Reactions
@ -149,18 +146,18 @@ particle dies and if necessary, fission sites are created and stored in the
fission bank.</p>
</li>
</ol>
</div></blockquote>
</blockquote>
<p>After all particles have been simulated, there are a few final tasks that must
be performed before the run is finished. This include the following:</p>
<blockquote>
<div><ul class="simple">
<ul class="simple">
<li>With the accumulated sum and sum of squares for each tally, the sample mean
and its variance is calculated.</li>
<li>All tallies and other results are written to disk.</li>
<li>If requested, a source file is written to disk.</li>
<li>All allocatable arrays are deallocated.</li>
</ul>
</div></blockquote>
</blockquote>
</div>
</div>
@ -181,7 +178,7 @@ and its variance is calculated.</li>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>8. Parallelization &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -116,7 +113,7 @@ reproducible, one must guarantee that the process by which fission sites are
randomly sampled does not depend on the number of processors. What is typically
done is the following:</p>
<blockquote>
<div><ol class="arabic simple">
<ol class="arabic simple">
<li>Each compute node <a class="reference external" href="http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Send.html">sends</a> its fission bank sites to a master process;</li>
</ol>
<p>2. The master process sorts or orders the fission sites based on a unique
@ -125,7 +122,7 @@ identifier;</p>
of <img class="math" src="../_images/math/5d1e4485dc90c450e8c76826516c1b2ccb8fce16.png" alt="M"/> sites; and</p>
<p>4. The master process <a class="reference external" href="http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Bcast.html">broadcasts</a> all the fission sites to the compute
nodes.</p>
</div></blockquote>
</blockquote>
<p>The first and last steps of this process are the major sources of communication
overhead between cycles. Since the master process must receive <img class="math" src="../_images/math/5d1e4485dc90c450e8c76826516c1b2ccb8fce16.png" alt="M"/> fission
sites from the compute nodes, the first step is necessarily serial. This step
@ -163,7 +160,7 @@ keeping the fission sites local, having each compute node sample fission sites,
and sending sites between nodes only as needed, one can cut down on most of the
communication. One algorithm to achieve this is as follows:</p>
<blockquote>
<div><p>1. An exclusive scan is performed on the number of sites banked, and the
<p>1. An exclusive scan is performed on the number of sites banked, and the
total number of fission bank sites is broadcasted to all compute nodes. By
picturing the fission bank as one large array distributed across multiple
nodes, one can see that this step enables each compute node to determine the
@ -180,7 +177,7 @@ and sent to all other compute nodes. This can be done efficiently using the
<a class="reference external" href="http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Allgather.html">allgather</a> collective operation;</p>
<p>4. The extra sites are divided among those compute nodes that sampled fewer
than <img class="math" src="../_images/math/c395cd3824fd2b81862d12d44397aa041de3156a.png" alt="N/p"/> fission sites.</p>
</div></blockquote>
</blockquote>
<p>However, even this algorithm exhibits more communication than necessary since
the allgather will send fission bank sites to nodes that don&#8217;t necessarily
need any extra sites.</p>
@ -198,7 +195,7 @@ are simulating <img class="math" src="../_images/math/82b5e178d68dd7eb9f2394965b
example, it is instructive to look at the state of the fission bank and source
bank at several points in the algorithm:</p>
<blockquote>
<div><ol class="arabic simple">
<ol class="arabic simple">
<li>The beginning of a cycle where each node has <img class="math" src="../_images/math/c395cd3824fd2b81862d12d44397aa041de3156a.png" alt="N/p"/> source sites;</li>
<li>The end of a cycle where each node has accumulated fission sites;</li>
</ol>
@ -206,7 +203,7 @@ bank at several points in the algorithm:</p>
not equal to <img class="math" src="../_images/math/c395cd3824fd2b81862d12d44397aa041de3156a.png" alt="N/p"/>;</p>
<p>4. After redistribution, each node again has <img class="math" src="../_images/math/c395cd3824fd2b81862d12d44397aa041de3156a.png" alt="N/p"/> source sites for
the next cycle;</p>
</div></blockquote>
</blockquote>
<p>At the end of each cycle, each compute node needs 250 fission bank sites to
continue on the next cycle. Let us suppose that <img class="math" src="../_images/math/d4e8cf09c5ced63a38ed87c9a03dd9aacf7e490a.png" alt="p_0"/> produces 270 fission
banks sites, <img class="math" src="../_images/math/e01486dcc7cb25518b89692706b17389dc67c92b.png" alt="p_1"/> produces 230, <img class="math" src="../_images/math/a2e8bc2235f5b0094bc37f2ef74f7dc647f0a406.png" alt="p_2"/> produces 290, and <img class="math" src="../_images/math/d05d6a0d3fdb2123690c1b35c922d1e082e810f1.png" alt="p_3"/>
@ -245,7 +242,7 @@ fission site.</p>
master node, each of size <img class="math" src="../_images/math/fedbcdb9cda6169277d9b733d69494b45ceae1fc.png" alt="sN/p"/>. Thus, the total time to send these
messages is</p>
<div class="math" id="equation-t-send">
<p><span class="eqno">(1)</span><img src="../_images/math/9d7c8ec12f7a641022948e5850e3bab46f27356c.png" alt="t_{\text{send}} = p\alpha + sN\beta."/></p>
<p><span class="eqno">(1)</span><img src="../_images/math/9d7c8ec12f7a641022948e5850e3bab46f27356c.png" alt="t_{\text{send}} = p\alpha + sN\beta." /></p>
</div><p>Generally, the best parallel performance is achieved in a weak scaling scheme
where the total number of histories is proportional to the number of
processors. However, we see that when <img class="math" src="../_images/math/fc97ef67268cd4e91bacdf12b8901d7036c9a056.png" alt="N"/> is proportional to <img class="math" src="../_images/math/36f73fc1312ee0349b3f3a0f3bd9eb5504339011.png" alt="p"/>,
@ -263,7 +260,7 @@ and then in the subsequent, both the root and the other node can send the data
to other nodes. Thus, it takes a total of <img class="math" src="../_images/math/80b39ab3612493bf39ca358b1d1d8a7e48b93d9f.png" alt="\lceil \log_2 p \rceil"/> steps
to complete the communication. The time to complete the communication is</p>
<div class="math" id="equation-t-short">
<p><span class="eqno">(2)</span><img src="../_images/math/d877313c0f3481831adea680053c38e247995c6f.png" alt="t_{\text{short}} = \lceil \log_2 p \rceil \left ( \alpha + sN\beta \right )."/></p>
<p><span class="eqno">(2)</span><img src="../_images/math/d877313c0f3481831adea680053c38e247995c6f.png" alt="t_{\text{short}} = \lceil \log_2 p \rceil \left ( \alpha + sN\beta \right )." /></p>
</div><p>This algorithm works well for short messages since the latency term scales
logarithmically with the number of nodes. However, for long messages, an
algorithm that has lower bandwidth has been proposed by <a class="reference external" href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.51.7772">Barnett</a> and implemented
@ -274,14 +271,14 @@ is performed using a ring algorithm that completes in <img class="math" src="../
\frac{p-1}{p} N\beta"/>. Thus, together the time to complete the broadcast is</p>
<div class="math" id="equation-t-broadcast">
<p><span class="eqno">(3)</span><img src="../_images/math/4e33c067e2123099c4eef1b9974563cb21e6c796.png" alt="t_{\text{long}} = \left ( \log_2 p + p - 1 \right ) \alpha + 2 \frac{p-1}{p}
sN\beta."/></p>
sN\beta." /></p>
</div><p>The fission bank data will generally exceed the threshold for switching from
short to long messages (typically 8 kilobytes), and thus we will use the
equation for long messages. Adding equations <a href="#equation-t-send">(1)</a> and <a href="#equation-t-broadcast">(3)</a>,
the total cost of the series of sends and the broadcast is</p>
<div class="math" id="equation-t-old">
<p><span class="eqno">(4)</span><img src="../_images/math/67105d4b896a87e0d049f7fb875cd278e380e208.png" alt="t_{\text{old}} = \left ( \log_2 p + 2p - 1 \right ) \alpha + \frac{3p-2}{p}
sN\beta."/></p>
sN\beta." /></p>
</div></div>
<div class="section" id="cost-of-nearest-neighbor-algorithm">
<h3>8.1.4. Cost of Nearest Neighbor Algorithm<a class="headerlink" href="#cost-of-nearest-neighbor-algorithm" title="Permalink to this headline"></a></h3>
@ -299,7 +296,7 @@ fundamentals of the Monte Carlo process.</p>
written in the form of an eigenvalue problem,</p>
<div class="math" id="equation-NTE">
<p><span class="eqno">(5)</span><img src="../_images/math/c84a08f8b1fd5eed92413a7efe3ba31a2bd520fa.png" alt="S(\mathbf{r})= \frac{1}{k} \int F(\mathbf{r}' \rightarrow
\mathbf{r})S(\mathbf{r}')\: d\mathbf{r},"/></p>
\mathbf{r})S(\mathbf{r}')\: d\mathbf{r}," /></p>
</div><p>where <img class="math" src="../_images/math/523765e6f77d2ff678e47c2a1ff0a59ace2e8e36.png" alt="\mathbf{r}"/> is the spatial coordinates of the neutron,
<img class="math" src="../_images/math/940b2b7c298023ee872920b7135b20eef2bfc7cc.png" alt="S(\mathbf{r})"/> is the source distribution defined as the expected number
of neutrons born from fission per unit phase-space volume at <img class="math" src="../_images/math/523765e6f77d2ff678e47c2a1ff0a59ace2e8e36.png" alt="\mathbf{r}"/>,
@ -318,24 +315,24 @@ fundamental source distribution and the noise component as (see <a class="refere
Garlick</a>):</p>
<div class="math" id="equation-source">
<p><span class="eqno">(6)</span><img src="../_images/math/5687a35a0550bac9c6f55ccf67f18330a34542b8.png" alt="\hat{S}^{(m)}(\mathbf{r})= N S(\mathbf{r}) + \sqrt{N}
\hat{\epsilon}^{(m)}(\mathbf{r}),"/></p>
\hat{\epsilon}^{(m)}(\mathbf{r})," /></p>
</div><p>where <img class="math" src="../_images/math/fc97ef67268cd4e91bacdf12b8901d7036c9a056.png" alt="N"/> is the number of particle histories per cycle. Without loss of
generality, we shall drop the superscript notation indicating the cycle as it is
understood that the stochastic realization is at a particular cycle. The
expected value of the stochastic source distribution is simply</p>
<div class="math" id="equation-expected-value-source">
<p><span class="eqno">(7)</span><img src="../_images/math/3634a65aaf7d5325cf150034f0c759f41955be26.png" alt="E \left[ \hat{S}(\mathbf{r})\right] = N S (\mathbf{r})"/></p>
<p><span class="eqno">(7)</span><img src="../_images/math/3634a65aaf7d5325cf150034f0c759f41955be26.png" alt="E \left[ \hat{S}(\mathbf{r})\right] = N S (\mathbf{r})" /></p>
</div><p>since <img class="math" src="../_images/math/275dd79da679dacccf9f85d7ed5028e0c68735aa.png" alt="E \left[ \hat{\epsilon}(\mathbf{r})\right] = 0"/>. The noise in the
source distribution is due only to <img class="math" src="../_images/math/5cd8045db5708d33f68fbe6f31ea314e72c2224c.png" alt="\hat{\epsilon}(\mathbf{r})"/> and thus
the variance of the source distribution will be</p>
<div class="math" id="equation-var-source">
<p><span class="eqno">(8)</span><img src="../_images/math/148cb8c308703a08ca7c78e23fc0f8fecda1124e.png" alt="\text{Var} \left[ \hat{S}(\mathbf{r})\right] = N \text{Var} \left[
\hat{\epsilon}(\mathbf{r}) \right]."/></p>
\hat{\epsilon}(\mathbf{r}) \right]." /></p>
</div><p>Lastly, the stochastic and true eigenvalues can be written as integrals over all
phase space of the stochastic and true source distributions, respectively, as</p>
<div class="math" id="equation-k-to-source">
<p><span class="eqno">(9)</span><img src="../_images/math/c9755e08705fc40ca865b2d9ab5a6daef2277c02.png" alt="\hat{k} = \frac{1}{N} \int \hat{S}(\mathbf{r}) \: d\mathbf{r} \quad
\text{and} \quad k = \int S(\mathbf{r}) \: d\mathbf{r},"/></p>
\text{and} \quad k = \int S(\mathbf{r}) \: d\mathbf{r}," /></p>
</div><p>noting that <img class="math" src="../_images/math/940b2b7c298023ee872920b7135b20eef2bfc7cc.png" alt="S(\mathbf{r})"/> is <img class="math" src="../_images/math/62d0effd6477f4244d585fc25f46a645378a4ceb.png" alt="O(1)"/>. One should note that the
expected value <img class="math" src="../_images/math/8c325612684d41304b9751c175df7bcc0f61f64f.png" alt="k"/> calculated by Monte Carlo power iteration (i.e. the
method of successive generations) will be biased from the true fundamental
@ -346,7 +343,7 @@ per cycle is sufficiently large to neglect this bias.</p>
properties of the distribution of expected number of fission sites. The explicit
form of the source distribution can be written as</p>
<div class="math" id="equation-source-explicit">
<p><span class="eqno">(10)</span><img src="../_images/math/9fce3887457954b2e16b64c6fd5d9a65696c57eb.png" alt="\hat{S}(\mathbf{r}) = \sum_{i=1}^{M} w_i \delta( \mathbf{r} - \mathbf{r}_i )"/></p>
<p><span class="eqno">(10)</span><img src="../_images/math/9fce3887457954b2e16b64c6fd5d9a65696c57eb.png" alt="\hat{S}(\mathbf{r}) = \sum_{i=1}^{M} w_i \delta( \mathbf{r} - \mathbf{r}_i )" /></p>
</div><p>where <img class="math" src="../_images/math/1357a3ea7b3d5d938c7f9daf28e6055832f9835e.png" alt="\mathbf{r}_i"/> is the spatial location of the <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/>-th fission
site, <img class="math" src="../_images/math/535b2bfbb0a587e261a0d0af9b7b53e42629b14d.png" alt="w_i"/> is the statistical weight of the fission site at
<img class="math" src="../_images/math/1357a3ea7b3d5d938c7f9daf28e6055832f9835e.png" alt="\mathbf{r}_i"/>, and <img class="math" src="../_images/math/5d1e4485dc90c450e8c76826516c1b2ccb8fce16.png" alt="M"/> is the total number of fission sites. It is
@ -354,19 +351,19 @@ clear that the total weight of the fission sites is simply the integral of the
source distribution. Integrating equation <a href="#equation-source">(6)</a> over all space, we obtain</p>
<div class="math" id="equation-source-integrated">
<p><span class="eqno">(11)</span><img src="../_images/math/25da7598817e81288a2761daf533422333e7a18c.png" alt="\int \hat{S}(\mathbf{r}) \: d\mathbf{r} = N \int S(\mathbf{r}) \:
d\mathbf{r} + \sqrt{N} \int \hat{\epsilon}(\mathbf{r}) \: d\mathbf{r} ."/></p>
d\mathbf{r} + \sqrt{N} \int \hat{\epsilon}(\mathbf{r}) \: d\mathbf{r} ." /></p>
</div><p>Substituting the expressions for the stochastic and true eigenvalues from
equation <a href="#equation-k-to-source">(9)</a>, we can relate the stochastic eigenvalue to the
integral of the noise component of the source distribution as</p>
<div class="math" id="equation-noise-integeral">
<p><span class="eqno">(12)</span><img src="../_images/math/786d76bfb9d32746bd82be11ad6ef1eb87c24730.png" alt="N\hat{k} = Nk + \sqrt{N} \int \hat{\epsilon}(\mathbf{r}) \: d\mathbf{r}."/></p>
<p><span class="eqno">(12)</span><img src="../_images/math/786d76bfb9d32746bd82be11ad6ef1eb87c24730.png" alt="N\hat{k} = Nk + \sqrt{N} \int \hat{\epsilon}(\mathbf{r}) \: d\mathbf{r}." /></p>
</div><p>Since the expected value of <img class="math" src="../_images/math/9ada05558f1c9364ee3349687c0e7c6906b9adce.png" alt="\hat{\epsilon}"/> is zero, the expected value
of its integral will also be zero. We thus see that the variance of the integral
of the source distribution, i.e. the variance of the total weight of fission
sites produced, is directly proportional to the variance of the integral of the
noise component. Let us call this term <img class="math" src="../_images/math/741fb9098efcb98055f467f87630a5d0ca599b6b.png" alt="\sigma^2"/> for simplicity:</p>
<div class="math" id="equation-variance-sigma2">
<p><span class="eqno">(13)</span><img src="../_images/math/9c67861a3feee251052ccd0e8423cf6a7745831d.png" alt="\text{Var} \left[ \int \hat{S}(\mathbf{r}) \right ] = N \sigma^2."/></p>
<p><span class="eqno">(13)</span><img src="../_images/math/9c67861a3feee251052ccd0e8423cf6a7745831d.png" alt="\text{Var} \left[ \int \hat{S}(\mathbf{r}) \right ] = N \sigma^2." /></p>
</div><p>The actual value of <img class="math" src="../_images/math/741fb9098efcb98055f467f87630a5d0ca599b6b.png" alt="\sigma^2"/> will depend on the physical nature of the
problem, whether variance reduction techniques are employed, etc. For instance,
one could surmise that for a highly scattering problem, <img class="math" src="../_images/math/741fb9098efcb98055f467f87630a5d0ca599b6b.png" alt="\sigma^2"/> would
@ -378,16 +375,16 @@ evenly across <img class="math" src="../_images/math/36f73fc1312ee0349b3f3a0f3bd
histories, we can write the source distribution as</p>
<div class="math" id="equation-source-node">
<p><span class="eqno">(14)</span><img src="../_images/math/0f0dec55139688164cef0fc40331f0d9265804f4.png" alt="\hat{S}_i(\mathbf{r})= \frac{N}{p} S(\mathbf{r}) + \sqrt{\frac{N}{p}}
\hat{\epsilon}_i(\mathbf{r}) \quad \text{for} \quad i = 1, \dots, p"/></p>
\hat{\epsilon}_i(\mathbf{r}) \quad \text{for} \quad i = 1, \dots, p" /></p>
</div><p>Integrating over all space and simplifying, we can obtain an expression for the
eigenvalue on the <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/>-th node:</p>
<div class="math" id="equation-k-i-hat">
<p><span class="eqno">(15)</span><img src="../_images/math/9446ee59de9bf61f6fddbaca53ac555824f94d98.png" alt="\hat{k}_i = k + \sqrt{\frac{p}{N}} \int \hat{\epsilon}_i(\mathbf{r}) \:
d\mathbf{r}."/></p>
d\mathbf{r}." /></p>
</div><p>It is easy to show from this expression that the stochastic realization of the
global eigenvalue is merely the average of these local eigenvalues:</p>
<div class="math" id="equation-average-k-as-sum">
<p><span class="eqno">(16)</span><img src="../_images/math/4c27fcd8a73517681348759d61834aeeafa25c55.png" alt="\hat{k} = \frac{1}{p} \sum_{i=1}^p \hat{k}_i."/></p>
<p><span class="eqno">(16)</span><img src="../_images/math/4c27fcd8a73517681348759d61834aeeafa25c55.png" alt="\hat{k} = \frac{1}{p} \sum_{i=1}^p \hat{k}_i." /></p>
</div><p>As was mentioned earlier, at the end of each cycle one must sample <img class="math" src="../_images/math/fc97ef67268cd4e91bacdf12b8901d7036c9a056.png" alt="N"/>
sites from the <img class="math" src="../_images/math/5d1e4485dc90c450e8c76826516c1b2ccb8fce16.png" alt="M"/> sites that were created. Thus, the source for the next
cycle can be seen as the fission source from the current cycle divided by the
@ -396,7 +393,7 @@ stochastic realization of the eigenvalue since it is clear from equation
sampled on each compute node that will be used for the next cycle is</p>
<div class="math" id="equation-sites-per-node">
<p><span class="eqno">(17)</span><img src="../_images/math/b9075bdf821eb5e3ae3e404c2987ac541fa7bc4d.png" alt="M_i = \frac{1}{\hat{k}} \int \hat{S}_i(\mathbf{r}) \: d\mathbf{r} =
\frac{N}{p} \frac{\hat{k}_i}{\hat{k}}."/></p>
\frac{N}{p} \frac{\hat{k}_i}{\hat{k}}." /></p>
</div><p>While we know conceptually that each compute node will under normal
circumstances send two messages, many of these messages will overlap. Rather
than trying to determine the actual communication cost, we will instead attempt
@ -404,13 +401,13 @@ to determine the maximum amount of data being communicated from one node to
another. At any given cycle, the number of fission sites that the <img class="math" src="../_images/math/8122aa89ea6e80784c6513d22787ad86e36ad0cc.png" alt="j"/>-th
compute node will send or receive (<img class="math" src="../_images/math/42c33d53819106d9c16057774cddf57154b5f560.png" alt="\Lambda_j"/>) is</p>
<div class="math" id="equation-Lambda">
<p><span class="eqno">(18)</span><img src="../_images/math/5ccde15a303c67b4d8ad0925c870ec03f09320ba.png" alt="\Lambda_j = \left | \sum_{i=1}^j M_i - \frac{jN}{p} \right |."/></p>
<p><span class="eqno">(18)</span><img src="../_images/math/5ccde15a303c67b4d8ad0925c870ec03f09320ba.png" alt="\Lambda_j = \left | \sum_{i=1}^j M_i - \frac{jN}{p} \right |." /></p>
</div><p>Noting that <img class="math" src="../_images/math/c16f8d4a25c864ac30e71e5ac25eaea0a9b7408c.png" alt="jN/p"/> is the expected value of the summation, we can write
the expected value of <img class="math" src="../_images/math/42c33d53819106d9c16057774cddf57154b5f560.png" alt="\Lambda_j"/> as the mean absolute deviation of the
summation:</p>
<div class="math" id="equation-mean-dev-lambda">
<p><span class="eqno">(19)</span><img src="../_images/math/5919c9a67835f19eb6a5c8b3d47b9e035c052657.png" alt="E \left [ \Lambda_j \right ] = E \left [ \left | \sum_{i=1}^j M_i -
\frac{jN}{p} \right | \right ] = \text{MD} \left [ \sum_{i=1}^j M_i \right ]"/></p>
\frac{jN}{p} \right | \right ] = \text{MD} \left [ \sum_{i=1}^j M_i \right ]" /></p>
</div><p>where <img class="math" src="../_images/math/0415b987b655b923906c1471fc53dd6bbfe7a8c7.png" alt="\text{MD}"/> indicates the mean absolute deviation of a random
variable. The mean absolute deviation is an alternative measure of variability.</p>
<p>In order to ascertain any information about the mean deviation of <img class="math" src="../_images/math/50496bd204bbf34e209ecabe0729f4937fe69a1d.png" alt="M_i"/>,
@ -442,14 +439,14 @@ be normal.</p>
<div class="math" id="equation-mean-dev-to-stdev">
<p><span class="eqno">(20)</span><img src="../_images/math/b6a1df04bfb7521e5518b69f4112f889be0328c7.png" alt="\int_{-\infty}^{\infty} f(x) \left | x - \mu \right | \: dx =
\sqrt{\frac{2}{\pi} \int_{-\infty}^{\infty} f(x) \left ( x - \mu \right )^2
\: dx}"/></p>
\: dx}" /></p>
</div><p>and thus the mean absolute deviation is <img class="math" src="../_images/math/c9c55370f9cc4f17e6a6bd91c7651e8fbe2ff67d.png" alt="\sqrt{2/\pi}"/> times the standard
deviation. Therefore, to evaluate the mean absolute deviation of <img class="math" src="../_images/math/50496bd204bbf34e209ecabe0729f4937fe69a1d.png" alt="M_i"/>, we
need to first determine its variance. Substituting equation
<a href="#equation-average-k-as-sum">(16)</a> into equation <a href="#equation-sites-per-node">(17)</a>, we can rewrite
<img class="math" src="../_images/math/50496bd204bbf34e209ecabe0729f4937fe69a1d.png" alt="M_i"/> solely in terms of <img class="math" src="../_images/math/a4b36cc557943d410394cb213db426eee8a6b264.png" alt="\hat{k}_1, \dots, \hat{k}_p"/>:</p>
<div class="math" id="equation-M-i">
<p><span class="eqno">(21)</span><img src="../_images/math/3ee8a3b33422d3a20490f9bddf55898f62955679.png" alt="M_i = \frac{N \hat{k}_i}{\sum\limits_{j=1}^p \hat{k}_j}."/></p>
<p><span class="eqno">(21)</span><img src="../_images/math/3ee8a3b33422d3a20490f9bddf55898f62955679.png" alt="M_i = \frac{N \hat{k}_i}{\sum\limits_{j=1}^p \hat{k}_j}." /></p>
</div><p>Since we know the variance of <img class="math" src="../_images/math/860dfd42afb922c444933ea12f24ff0dbc967b46.png" alt="\hat{k}_i"/>, we can use the error
propagation law to determine the variance of <img class="math" src="../_images/math/50496bd204bbf34e209ecabe0729f4937fe69a1d.png" alt="M_i"/>:</p>
<div class="math" id="equation-M-variance">
@ -457,7 +454,7 @@ propagation law to determine the variance of <img class="math" src="../_images/m
M_i}{\partial \hat{k}_j} \right )^2 \text{Var} \left [ \hat{k}_j \right ] +
\sum\limits_{j \neq m} \sum\limits_{m=1}^p \left ( \frac{\partial
M_i}{\partial \hat{k}_j} \right ) \left ( \frac{\partial M_i}{\partial
\hat{k}_m} \right ) \text{Cov} \left [ \hat{k}_j, \hat{k}_m \right ]"/></p>
\hat{k}_m} \right ) \text{Cov} \left [ \hat{k}_j, \hat{k}_m \right ]" /></p>
</div><p>where the partial derivatives are evaluated at <img class="math" src="../_images/math/5389cb73491a3a8a8a87e7d1e080824bd1914029.png" alt="\hat{k}_j = k"/>. Since
<img class="math" src="../_images/math/6f04d7c4f50443227e141ab0c211f4e2192184fe.png" alt="\hat{k}_j"/> and <img class="math" src="../_images/math/af8a46c0896f861c8d3626760cbf00689aae35a4.png" alt="\hat{k}_m"/> are independent if <img class="math" src="../_images/math/f2b2af70bb3cac0095ccc02ca2fce935291a6f3e.png" alt="j \neq m"/>,
their covariance is zero and thus the second term cancels out. Evaluating the
@ -465,19 +462,19 @@ partial derivatives, we obtain</p>
<div class="math" id="equation-M-variance-2">
<p><span class="eqno">(23)</span><img src="../_images/math/d30ca4442445b11dccca4111e1e67b4e05c57d38.png" alt="\text{Var} \left [ M_i \right ] = \left ( \frac{N(p-1)}{kp^2} \right )^2
\frac{p\sigma^2}{N} + \sum_{j \neq i} \left ( \frac{-N}{kp^2} \right )^2
\frac{p\sigma^2}{N} = \frac{N(p-1)}{k^2p^2} \sigma^2."/></p>
\frac{p\sigma^2}{N} = \frac{N(p-1)}{k^2p^2} \sigma^2." /></p>
</div><p>Through a similar analysis, one can show that the variance of
<img class="math" src="../_images/math/4e7deed6cb4e8257b7a19106c6451f0a7b67a7d8.png" alt="\sum_{i=1}^j M_i"/> is</p>
<div class="math" id="equation-sum-M-variance">
<p><span class="eqno">(24)</span><img src="../_images/math/b7255d303286a1deba6950b2b3c866725c0ff688.png" alt="\text{Var} \left [ \sum_{i=1}^j M_i \right ] = \frac{Nj(p-j)}{k^2p^2}
\sigma^2"/></p>
\sigma^2" /></p>
</div><p>Thus, the expected amount of communication on node <img class="math" src="../_images/math/8122aa89ea6e80784c6513d22787ad86e36ad0cc.png" alt="j"/>, i.e. the mean
absolute deviation of <img class="math" src="../_images/math/4e7deed6cb4e8257b7a19106c6451f0a7b67a7d8.png" alt="\sum_{i=1}^j M_i"/> is proportional to</p>
<div class="math" id="equation-communication-cost">
<p><span class="eqno">(25)</span><img src="../_images/math/1271a5033ea53711c7b12c29f2412d03e4a5d7d2.png" alt="E \left [ \Lambda_j \right ] = \sqrt{\frac{2Nj(p-j)\sigma^2}{\pi k^2p^2}}."/></p>
<p><span class="eqno">(25)</span><img src="../_images/math/1271a5033ea53711c7b12c29f2412d03e4a5d7d2.png" alt="E \left [ \Lambda_j \right ] = \sqrt{\frac{2Nj(p-j)\sigma^2}{\pi k^2p^2}}." /></p>
</div><p>This formula has all the properties that one would expect based on intuition:</p>
<blockquote>
<div><p>1. As the number of histories increases, the communication cost on each node
<p>1. As the number of histories increases, the communication cost on each node
increases as well;</p>
<p>2. If <img class="math" src="../_images/math/9910fc8ed8a58c9874860c7482132fb871b8c502.png" alt="p=1"/>, i.e. if the problem is run on only one compute node, the
variance will be zero. This reflects the fact that exactly <img class="math" src="../_images/math/fc97ef67268cd4e91bacdf12b8901d7036c9a056.png" alt="N"/> sites
@ -485,7 +482,7 @@ will be sampled if there is only one node.</p>
<p>3. For <img class="math" src="../_images/math/0ba7b5d931c9548c6455cf3b379182f5a823bf22.png" alt="j=p"/>, the variance will be zero. Again, this says that when
you sum the number of sites from each node, you will get exactly <img class="math" src="../_images/math/fc97ef67268cd4e91bacdf12b8901d7036c9a056.png" alt="N"/>
sites.</p>
</div></blockquote>
</blockquote>
<p>We can determine the node that has the highest communication cost by
differentiating equation <a href="#equation-communication-cost">(25)</a> with respect to <img class="math" src="../_images/math/8122aa89ea6e80784c6513d22787ad86e36ad0cc.png" alt="j"/>,
setting it equal to zero, and solving for <img class="math" src="../_images/math/8122aa89ea6e80784c6513d22787ad86e36ad0cc.png" alt="j"/>. Doing so yields
@ -494,7 +491,7 @@ equation <a href="#equation-communication-cost">(25)</a> shows us that the maxim
is actually independent of the number of nodes:</p>
<div class="math" id="equation-maximum-communication">
<p><span class="eqno">(26)</span><img src="../_images/math/03f2199fb277a74a8f5f62b84516a2977ffca261.png" alt="E \left [ \Lambda_{j_{\text{max}}} \right ] = \sqrt{ \frac{N\sigma^2}{2\pi
k^2}}."/></p>
k^2}}." /></p>
</div></div>
</div>
<div class="section" id="references">
@ -527,7 +524,7 @@ Radiation Penetration Calculations on a Parallel Computer,&#8221;
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>5. Physics &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -59,7 +56,7 @@
<p>As a particle travels through a homogeneous material, the probability
distribution function for the distance to its next collision <img class="math" src="../_images/math/63c17c295325f731666c7d74952b563a01e00fcc.png" alt="\ell"/> is</p>
<div class="math" id="equation-distance-pdf">
<p><span class="eqno">(1)</span><img src="../_images/math/2f36ff5637283efad0c17a3a63f615ca5e6ecfa8.png" alt="p(\ell) d\ell = \Sigma_t e^{-\Sigma_t \ell} d\ell"/></p>
<p><span class="eqno">(1)</span><img src="../_images/math/2f36ff5637283efad0c17a3a63f615ca5e6ecfa8.png" alt="p(\ell) d\ell = \Sigma_t e^{-\Sigma_t \ell} d\ell" /></p>
</div><p>where <img class="math" src="../_images/math/b5e850feb16eb83bd01af5524126befff31f202b.png" alt="\Sigma_t"/> is the total macroscopic cross section of the
material. Equation <a href="#equation-distance-pdf">(1)</a> tells us that the further the distance is
to the next collision, the less likely the particle will travel that
@ -67,17 +64,17 @@ distance. In order to sample the probability distribution function, we first
need to convert it to a cumulative distribution function</p>
<div class="math" id="equation-distance-cdf">
<p><span class="eqno">(2)</span><img src="../_images/math/3bf9017f15e5261188982a68bf9aac7c4870d22b.png" alt="\int_0^{\ell} d\ell' p(\ell') = \int_0^{\ell} d\ell' \Sigma_t e^{-\Sigma_t
\ell'} = 1 - e^{-\Sigma_t \ell}."/></p>
\ell'} = 1 - e^{-\Sigma_t \ell}." /></p>
</div><p>By setting the cumulative distribution function equal to <img class="math" src="../_images/math/ccfd1641d037d427d9dbf42cdd54b485a03eafe9.png" alt="\xi"/>, a random
number on the unit interval, and solving for the distance <img class="math" src="../_images/math/63c17c295325f731666c7d74952b563a01e00fcc.png" alt="\ell"/>, we
obtain a formula for sampling the distance to next collision:</p>
<div class="math" id="equation-sample-distance-1">
<p><span class="eqno">(3)</span><img src="../_images/math/a8ccdabb54d53172e417848edff364cf77ffed3c.png" alt="\ell = -\frac{\ln (1 - \xi)}{\Sigma_t}."/></p>
<p><span class="eqno">(3)</span><img src="../_images/math/a8ccdabb54d53172e417848edff364cf77ffed3c.png" alt="\ell = -\frac{\ln (1 - \xi)}{\Sigma_t}." /></p>
</div><p>Since <img class="math" src="../_images/math/ccfd1641d037d427d9dbf42cdd54b485a03eafe9.png" alt="\xi"/> is uniformly distributed on <img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/>, this implies that
<img class="math" src="../_images/math/35091c06fbc56124201a93a953fd0bb0349e6943.png" alt="1 - \xi"/> is also uniformly distributed on <img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/> as well. Thus,
the formula usually used to calculate the distance to next collision is</p>
<div class="math" id="equation-sample-distance-2">
<p><span class="eqno">(4)</span><img src="../_images/math/3a9f818b22cf231e85672d4c829f1e70a9a2b92a.png" alt="\ell = -\frac{\ln \xi}{\Sigma_t}"/></p>
<p><span class="eqno">(4)</span><img src="../_images/math/3a9f818b22cf231e85672d4c829f1e70a9a2b92a.png" alt="\ell = -\frac{\ln \xi}{\Sigma_t}" /></p>
</div></div>
<div class="section" id="and-other-disappearance-reactions">
<h2>5.2. <img class="math" src="../_images/math/3b5fe4c3b6f25cd9becd9e7f729b4d28bbd77c88.png" alt="(n,\gamma)"/> and Other Disappearance Reactions<a class="headerlink" href="#and-other-disappearance-reactions" title="Permalink to this headline"></a></h2>
@ -91,7 +88,7 @@ whether a &#8220;disappearance&#8221; reaction occurs where no secondary neutron
produced. This is done by sampling a random number <img class="math" src="../_images/math/ccfd1641d037d427d9dbf42cdd54b485a03eafe9.png" alt="\xi"/> on the interval
<img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/> and checking whether</p>
<div class="math" id="equation-disappearance">
<p><span class="eqno">(5)</span><img src="../_images/math/5cc6086f308a306664010c4bf51d42e85f299f50.png" alt="\xi \sigma_t (E) &lt; \sigma_a (E) - \sigma_f (E)"/></p>
<p><span class="eqno">(5)</span><img src="../_images/math/5cc6086f308a306664010c4bf51d42e85f299f50.png" alt="\xi \sigma_t (E) &lt; \sigma_a (E) - \sigma_f (E)" /></p>
</div><p>where <img class="math" src="../_images/math/c7de8622e17cddfc652ab2dc62616c622ba3bcfb.png" alt="\sigma_t"/> is the total cross section, <img class="math" src="../_images/math/df95a258654726885e51e893d5979743a1ad5346.png" alt="\sigma_a"/> is the
absorption cross section (this includes fission), and <img class="math" src="../_images/math/9341254e820e687f8bb085610f0f89b0ec80a9cf.png" alt="\sigma_f"/> is the
total fission cross section. If this condition is met, then the neutron is
@ -119,18 +116,18 @@ velocity of the target nucleus are described later in section
target velocity <img class="math" src="../_images/math/f3af838d0b24bf7dde42dba97b2fd24f2747e646.png" alt="\mathbf{v}_t"/>. The velocity of the center-of-mass system
is calculated as</p>
<div class="math" id="equation-velocity-com">
<p><span class="eqno">(6)</span><img src="../_images/math/e6b6e9f4533e598bc834cb4317b5d3d143b67f88.png" alt="\mathbf{v}_{cm} = \frac{\mathbf{v}_n + A \mathbf{v}_t}{A + 1}"/></p>
<p><span class="eqno">(6)</span><img src="../_images/math/e6b6e9f4533e598bc834cb4317b5d3d143b67f88.png" alt="\mathbf{v}_{cm} = \frac{\mathbf{v}_n + A \mathbf{v}_t}{A + 1}" /></p>
</div><p>where <img class="math" src="../_images/math/e6c46c02a839a81ce8479f11f2da0a4523af2825.png" alt="\mathbf{v}_n"/> is the velocity of the neutron and <img class="math" src="../_images/math/019e9892786e493964e145e7c5cf7b700314e53b.png" alt="A"/> is the
atomic mass of the target nucleus measured in neutron masses (commonly referred
to as the <em>atomic weight ratio</em>). With the velocity of the center-of-mass
calculated, we can then determine the neutron&#8217;s velocity in the center-of-mass
system:</p>
<div class="math" id="equation-velocity-neutron-com">
<p><span class="eqno">(7)</span><img src="../_images/math/ae8065b62030273d96fc95357d956e5f151ad85a.png" alt="\mathbf{V}_n = \mathbf{v}_n - \mathbf{v}_{cm}"/></p>
<p><span class="eqno">(7)</span><img src="../_images/math/ae8065b62030273d96fc95357d956e5f151ad85a.png" alt="\mathbf{V}_n = \mathbf{v}_n - \mathbf{v}_{cm}" /></p>
</div><p>where we have used uppercase <img class="math" src="../_images/math/9d5b9321f67eecfa2013fa6f3891ba1f2e335946.png" alt="\mathbf{V}"/> to denote the center-of-mass
system. The direction of the neutron in the center-of-mass system is</p>
<div class="math" id="equation-angle-neutron-com">
<p><span class="eqno">(8)</span><img src="../_images/math/c7b0923a067ed9ba14e75a609d00553a6995a734.png" alt="\mathbf{\Omega}_n = \frac{\mathbf{V}_n}{|| \mathbf{V}_n ||}."/></p>
<p><span class="eqno">(8)</span><img src="../_images/math/c7b0923a067ed9ba14e75a609d00553a6995a734.png" alt="\mathbf{\Omega}_n = \frac{\mathbf{V}_n}{|| \mathbf{V}_n ||}." /></p>
</div><p>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
@ -144,11 +141,11 @@ procedure in <a class="reference internal" href="#transform-coordinates"><em>Tra
the speed of the neutron in the center-of-mass system to obtain the new velocity
vector in the center-of-mass:</p>
<div class="math" id="equation-velocity-neutron-com-2">
<p><span class="eqno">(9)</span><img src="../_images/math/3a4f8afd736eb1b37089e136ee70c074045e7165.png" alt="\mathbf{V}'_n = || \mathbf{V}_n || \mathbf{\Omega}'_n."/></p>
<p><span class="eqno">(9)</span><img src="../_images/math/3a4f8afd736eb1b37089e136ee70c074045e7165.png" alt="\mathbf{V}'_n = || \mathbf{V}_n || \mathbf{\Omega}'_n." /></p>
</div><p>Finally, we transform the velocity in the center-of-mass system back to lab
coordinates:</p>
<div class="math" id="equation-velocity-neutron-lab">
<p><span class="eqno">(10)</span><img src="../_images/math/65cebcb990b48a4b1756f390c3a9ecc188975326.png" alt="\mathbf{v}'_n = \mathbf{V}'_n + \mathbf{v}_{cm}"/></p>
<p><span class="eqno">(10)</span><img src="../_images/math/65cebcb990b48a4b1756f390c3a9ecc188975326.png" alt="\mathbf{v}'_n = \mathbf{V}'_n + \mathbf{v}_{cm}" /></p>
</div><p>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.</p>
@ -156,7 +153,7 @@ from the post-collision velocity of the neutron in the lab system.</p>
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</p>
<div class="math" id="equation-cosine-lab">
<p><span class="eqno">(11)</span><img src="../_images/math/d4cbd02ae63aa2a88363ec81e08e51d68e9120a6.png" alt="\mu_{lab} = \frac{1 + A\mu}{\sqrt{A^2 + 2A\mu + 1}}."/></p>
<p><span class="eqno">(11)</span><img src="../_images/math/d4cbd02ae63aa2a88363ec81e08e51d68e9120a6.png" alt="\mu_{lab} = \frac{1 + A\mu}{\sqrt{A^2 + 2A\mu + 1}}." /></p>
</div><p>However, equation <a href="#equation-cosine-lab">(11)</a> 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&#8217;s initial and
@ -210,7 +207,7 @@ representations exist for <img class="math" src="../_images/math/fc481e8632ac53b
<img class="math" src="../_images/math/fc97ef67268cd4e91bacdf12b8901d7036c9a056.png" alt="N"/> with coefficients <img class="math" src="../_images/math/f55ec799a437cc6b3b9b16101acca9e22cf51049.png" alt="c_0,c_1,\dots,c_N"/>. If <img class="math" src="../_images/math/fc481e8632ac53bd0572e5e95ba925274c27dc66.png" alt="\nu_t"/> has this
format, we can evaluate it at incoming energy <img class="math" src="../_images/math/fa2fa899f0afb05d6837885523503a2d4df434f9.png" alt="E"/> by using the equation</p>
<div class="math" id="equation-nu-polynomial">
<p><span class="eqno">(12)</span><img src="../_images/math/7d8f428010f544a68b10a29e9f56a82215d82c09.png" alt="\nu_t (E) = \sum_{i = 0}^N c_i E^i."/></p>
<p><span class="eqno">(12)</span><img src="../_images/math/7d8f428010f544a68b10a29e9f56a82215d82c09.png" alt="\nu_t (E) = \sum_{i = 0}^N c_i E^i." /></p>
</div><p>The other representation is just a tabulated function with a specified
interpolation law. The number of prompt neutrons released per fission event
<img class="math" src="../_images/math/cb182a99f817f3d85ce03b80f4758c118711e20f.png" alt="\nu_p"/> is also given as a function of incident energy and can be
@ -220,12 +217,12 @@ format. In practice, we only need to determine <img class="math" src="../_images
<img class="math" src="../_images/math/73584709a74afc4c13dadcfcc3afff5872bd8a79.png" alt="nu_d"/>. Once these have been determined, we can calculated the delayed
neutron fraction</p>
<div class="math" id="equation-beta">
<p><span class="eqno">(13)</span><img src="../_images/math/959259ea13017b50b3f238a75c59d4dec4ed989e.png" alt="\beta = \frac{\nu_d}{\nu_t}."/></p>
<p><span class="eqno">(13)</span><img src="../_images/math/959259ea13017b50b3f238a75c59d4dec4ed989e.png" alt="\beta = \frac{\nu_d}{\nu_t}." /></p>
</div><p>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</p>
<div class="math" id="equation-fission-neutrons">
<p><span class="eqno">(14)</span><img src="../_images/math/1bcbd9ac8b65ff93cab5b9145051caccb9df8a7b.png" alt="\nu = \frac{w \nu_t}{k_{eff}}"/></p>
<p><span class="eqno">(14)</span><img src="../_images/math/1bcbd9ac8b65ff93cab5b9145051caccb9df8a7b.png" alt="\nu = \frac{w \nu_t}{k_{eff}}" /></p>
</div><p>where <img class="math" src="../_images/math/9ee4b825a2e36ae093ed7be5e4851ef453b34914.png" alt="w"/> is the statistical weight and <img class="math" src="../_images/math/56a4ca4edce4a1ea8da11edbc5adc54ed45163b2.png" alt="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
@ -270,7 +267,7 @@ distribution is represented as either</p>
<p>In the first case, no data needs to be stored on the ACE table, and the cosine
of the scattering angle is simply calculated as</p>
<div class="math" id="equation-isotropic-angle">
<p><span class="eqno">(15)</span><img src="../_images/math/990c1db1616fc28b5dd37a3db9058e349878ac44.png" alt="\mu = 2\xi - 1"/></p>
<p><span class="eqno">(15)</span><img src="../_images/math/990c1db1616fc28b5dd37a3db9058e349878ac44.png" alt="\mu = 2\xi - 1" /></p>
</div><p>where <img class="math" src="../_images/math/2d8c833ed800824727cd7bd2fb9de1a12ad7e674.png" alt="\mu"/> is the cosine of the scattering angle and <img class="math" src="../_images/math/ccfd1641d037d427d9dbf42cdd54b485a03eafe9.png" alt="\xi"/> is a
random number sampled uniformly on <img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/>.</p>
</div>
@ -279,11 +276,11 @@ random number sampled uniformly on <img class="math" src="../_images/math/bc1a80
<p>For a 32 equiprobable bin distribution, we select a random number <img class="math" src="../_images/math/ccfd1641d037d427d9dbf42cdd54b485a03eafe9.png" alt="\xi"/> to
sample a cosine bin <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/> such that</p>
<div class="math" id="equation-equiprobable-bin">
<p><span class="eqno">(16)</span><img src="../_images/math/f2f37b880c28c0f79ccc57bc79ae3451936f2079.png" alt="i = 1 + \lfloor 32\xi \rfloor."/></p>
<p><span class="eqno">(16)</span><img src="../_images/math/f2f37b880c28c0f79ccc57bc79ae3451936f2079.png" alt="i = 1 + \lfloor 32\xi \rfloor." /></p>
</div><p>The same random number can then also be used to interpolate between neighboring
<img class="math" src="../_images/math/2d8c833ed800824727cd7bd2fb9de1a12ad7e674.png" alt="\mu"/> values to get the final scattering cosine:</p>
<div class="math" id="equation-equiprobable-cosine">
<p><span class="eqno">(17)</span><img src="../_images/math/bcc0cb7915a7562cbd510619ede1c85ec516ccdb.png" alt="\mu = \mu_i + (32\xi - i) (\mu_{i+1} - \mu_i)"/></p>
<p><span class="eqno">(17)</span><img src="../_images/math/bcc0cb7915a7562cbd510619ede1c85ec516ccdb.png" alt="\mu = \mu_i + (32\xi - i) (\mu_{i+1} - \mu_i)" /></p>
</div><p>where <img class="math" src="../_images/math/aa44daa8af479b4aeca327e7680b9b48fffd35f3.png" alt="\mu_i"/> is the <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/>-th scattering cosine.</p>
</div>
<div class="section" id="tabular-angular-distribution">
@ -299,7 +296,7 @@ probability distribution function and <img class="math" src="../_images/math/6a8
cumulative distribution function. We first find the interpolation factor on the
incoming energy grid:</p>
<div class="math" id="equation-interpolation-factor">
<p><span class="eqno">(18)</span><img src="../_images/math/aed572ca045db9c1fd114e5286c5144eff3fd1f0.png" alt="f = \frac{E - E_i}{E_{i+1} - E_i}"/></p>
<p><span class="eqno">(18)</span><img src="../_images/math/aed572ca045db9c1fd114e5286c5144eff3fd1f0.png" alt="f = \frac{E - E_i}{E_{i+1} - E_i}" /></p>
</div><p>where <img class="math" src="../_images/math/fa2fa899f0afb05d6837885523503a2d4df434f9.png" alt="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 <img class="math" src="../_images/math/f8f358aa01478e43f1a663db574b83f88d7be478.png" alt="E_i"/> and <img class="math" src="../_images/math/42661f5e25089e2cc0aaed8b3f89e6dfa123b4c8.png" alt="E_{i+1}"/>. Let
@ -308,59 +305,59 @@ functions corresponding to energy <img class="math" src="../_images/math/f8f358a
random number <img class="math" src="../_images/math/ccfd8fb41dea287e605b7582d709bd634d519a98.png" alt="\xi_2"/> is used to sample a scattering cosine bin <img class="math" src="../_images/math/8122aa89ea6e80784c6513d22787ad86e36ad0cc.png" alt="j"/>
using the cumulative distribution function:</p>
<div class="math" id="equation-sample-cdf">
<p><span class="eqno">(19)</span><img src="../_images/math/e244f963c6a9124b03b5f0a417ba6a825e7daf7e.png" alt="c_{\ell,j} &lt; \xi_2 &lt; c_{\ell,j+1}"/></p>
<p><span class="eqno">(19)</span><img src="../_images/math/e244f963c6a9124b03b5f0a417ba6a825e7daf7e.png" alt="c_{\ell,j} &lt; \xi_2 &lt; c_{\ell,j+1}" /></p>
</div><p>The final scattering cosine will depend on whether histogram or linear-linear
interpolation is used. In general, we can write the cumulative distribution
function as</p>
<div class="math" id="equation-cdf">
<p><span class="eqno">(20)</span><img src="../_images/math/2f0dcf73df17304bbf56e9a0187766e10e7b4268.png" alt="c(\mu) = \int_{-1}^\mu p(\mu') d\mu'"/></p>
<p><span class="eqno">(20)</span><img src="../_images/math/2f0dcf73df17304bbf56e9a0187766e10e7b4268.png" alt="c(\mu) = \int_{-1}^\mu p(\mu') d\mu'" /></p>
</div><p>where <img class="math" src="../_images/math/644aa8ef75aff456b85fc70cbe9ec5a42ccc3349.png" alt="c(\mu)"/> is the cumulative distribution function and <img class="math" src="../_images/math/ada5910ece0296142a8e8ddc34fd3506a4379300.png" alt="p(\mu)"/>
is the probability distribution function. Since we know that
<img class="math" src="../_images/math/6e453b5282f3232df567549d28b1429745d71d6f.png" alt="c(\mu_{\ell,j}) = c_{\ell,j}"/>, this implies that for <img class="math" src="../_images/math/0a539125812be8a1e708ccd0e7ac7c782e57100d.png" alt="\mu &gt;
\mu_{\ell,j}"/>,</p>
<div class="math" id="equation-cdf-2">
<p><span class="eqno">(21)</span><img src="../_images/math/38f8190a6739bed7bca072faa57fe929fc10cca6.png" alt="c(\mu) = c_{\ell,j} + \int_{\mu_{\ell,j}}^{\mu} p(\mu') d\mu'"/></p>
<p><span class="eqno">(21)</span><img src="../_images/math/38f8190a6739bed7bca072faa57fe929fc10cca6.png" alt="c(\mu) = c_{\ell,j} + \int_{\mu_{\ell,j}}^{\mu} p(\mu') d\mu'" /></p>
</div><p>For histogram interpolation, we have that <img class="math" src="../_images/math/51d762657c4c93c7496aba051e3df57ce3d9c73d.png" alt="p(\mu') = p_{\ell,j}"/> for
<img class="math" src="../_images/math/fbcf6d01088bea405efbc8b1cc72f1d04b1f53f5.png" alt="\mu_{\ell,j} \le \mu' &lt; \mu_{\ell,j+1}"/>. Thus, after integrating
<a href="#equation-cdf-2">(21)</a> we have that</p>
<div class="math" id="equation-cumulative-dist-histogram">
<p><span class="eqno">(22)</span><img src="../_images/math/0158b57a0a7ff49829bd762992dd29db49f83d6b.png" alt="c(\mu) = c_{\ell,j} + (\mu - \mu_{\ell,j}) p_{\ell,j} = \xi_2"/></p>
<p><span class="eqno">(22)</span><img src="../_images/math/0158b57a0a7ff49829bd762992dd29db49f83d6b.png" alt="c(\mu) = c_{\ell,j} + (\mu - \mu_{\ell,j}) p_{\ell,j} = \xi_2" /></p>
</div><p>Solving for the scattering cosine, we obtain the final form for histogram
interpolation:</p>
<div class="math" id="equation-cosine-histogram">
<p><span class="eqno">(23)</span><img src="../_images/math/23b02ce8fe228ede6ecddbbb62f2ed83a3a40609.png" alt="\mu = \mu_{\ell,j} + \frac{\xi_2 - c_{\ell,j}}{p_{\ell,j}}."/></p>
<p><span class="eqno">(23)</span><img src="../_images/math/23b02ce8fe228ede6ecddbbb62f2ed83a3a40609.png" alt="\mu = \mu_{\ell,j} + \frac{\xi_2 - c_{\ell,j}}{p_{\ell,j}}." /></p>
</div><p>For linear-linear interpolation, we represent the function <img class="math" src="../_images/math/ccbff05fd5bd1d83fe8234193b7479319b1a63fb.png" alt="p(\mu')"/> as a
first-order polynomial in <img class="math" src="../_images/math/d582ae2423a799c48a2f2ab2984df5cf9e105524.png" alt="\mu'"/>. If we interpolate between successive
values on the probability distribution function, we know that</p>
<div class="math" id="equation-pdf-interpolation">
<p><span class="eqno">(24)</span><img src="../_images/math/398c52007b5ebe653db7be2b35900ed768636dc3.png" alt="p(\mu') - p_{\ell,j} = \frac{p_{\ell,j+1} - p_{\ell,j}}{\mu_{\ell,j+1} -
\mu_{\ell,j}} (\mu' - \mu_{\ell,j})"/></p>
\mu_{\ell,j}} (\mu' - \mu_{\ell,j})" /></p>
</div><p>Solving for <img class="math" src="../_images/math/ccbff05fd5bd1d83fe8234193b7479319b1a63fb.png" alt="p(\mu')"/> in equation <a href="#equation-pdf-interpolation">(24)</a> and inserting it
into equation <a href="#equation-cdf-2">(21)</a>, we obtain</p>
<div class="math" id="equation-cdf-linlin">
<p><span class="eqno">(25)</span><img src="../_images/math/f9f272ef45c654fbb0b1475da1f2d24cb6e8c996.png" alt="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>
p_{\ell,j} \right ] d\mu'." /></p>
</div><p>Let us now make a change of variables using</p>
<div class="math" id="equation-introduce-eta">
<p><span class="eqno">(26)</span><img src="../_images/math/f006483391e5d25f86b5db41ebd1bc96aeabdb36.png" alt="\eta = \frac{p_{\ell,j+1} - p_{\ell,j}}{\mu_{\ell,j+1} - \mu_{\ell,j}}
(\mu' - \mu_{\ell,j}) + p_{\ell,j}."/></p>
(\mu' - \mu_{\ell,j}) + p_{\ell,j}." /></p>
</div><p>Equation <a href="#equation-cdf-linlin">(25)</a> then becomes</p>
<div class="math" id="equation-cdf-linlin-eta">
<p><span class="eqno">(27)</span><img src="../_images/math/7d55ef5a4507f06e38b7527e6cf1b1edf44d981d.png" alt="c(\mu) = c_{\ell,j} + \frac{1}{m} \int_{p_{\ell,j}}^{m(\mu - \mu_{\ell,j}) +
p_{\ell,j}} \eta \, d\eta"/></p>
p_{\ell,j}} \eta \, d\eta" /></p>
</div><p>where we have used</p>
<div class="math" id="equation-slope">
<p><span class="eqno">(28)</span><img src="../_images/math/22768d7bc95b2e83ea09efa9cfcab024c10fbb39.png" alt="m = \frac{p_{\ell,j+1} - p_{\ell,j}}{\mu_{\ell,j+1} - \mu_{\ell,j}}."/></p>
<p><span class="eqno">(28)</span><img src="../_images/math/22768d7bc95b2e83ea09efa9cfcab024c10fbb39.png" alt="m = \frac{p_{\ell,j+1} - p_{\ell,j}}{\mu_{\ell,j+1} - \mu_{\ell,j}}." /></p>
</div><p>Integrating equation <a href="#equation-cdf-linlin-eta">(27)</a>, we have</p>
<div class="math" id="equation-cdf-linlin-integrated">
<p><span class="eqno">(29)</span><img src="../_images/math/9e345d88295e077dc82d57cac28ceaee4bd5ed19.png" alt="c(\mu) = c_{\ell,j} + \frac{1}{2m} \left ( \left [ m (\mu - \mu_{\ell,j} ) +
p_{\ell,j} \right ]^2 - p_{\ell,j}^2 \right ) = \xi_2"/></p>
p_{\ell,j} \right ]^2 - p_{\ell,j}^2 \right ) = \xi_2" /></p>
</div><p>Solving for <img class="math" src="../_images/math/2d8c833ed800824727cd7bd2fb9de1a12ad7e674.png" alt="\mu"/>, we have the final form for the scattering cosine using
linear-linear interpolation:</p>
<div class="math" id="equation-cosine-linlin">
<p><span class="eqno">(30)</span><img src="../_images/math/d966bbc43aa03b9ee08168af32d8b87ba3477925.png" alt="\mu = \mu_{\ell,j} + \frac{1}{m} \left ( \sqrt{p_{\ell,j}^2 + 2 m (\xi_2 -
c_{\ell,j} )} - p_{\ell,j} \right )"/></p>
c_{\ell,j} )} - p_{\ell,j} \right )" /></p>
</div></div>
</div>
<div class="section" id="sampling-secondary-energy-and-correlated-angle-energy-distributions">
@ -404,7 +401,7 @@ maximum energies of the outgoing energy distributions corresponding to
<img class="math" src="../_images/math/f8f358aa01478e43f1a663db574b83f88d7be478.png" alt="E_i"/> and <img class="math" src="../_images/math/42661f5e25089e2cc0aaed8b3f89e6dfa123b4c8.png" alt="E_{i+1}"/>:</p>
<div class="math" id="equation-ace-law-1-minmax">
<p><span class="eqno">(31)</span><img src="../_images/math/356a8a771ee7021eea380b24c080cb14ba012e09.png" alt="E_{min} = E_{i,1} + f ( E_{i+1,1} - E_i ) \\
E_{max} = E_{i,M} + f ( E_{i+1,M} - E_M )"/></p>
E_{max} = E_{i,M} + f ( E_{i+1,M} - E_M )" /></p>
</div><p>where <img class="math" src="../_images/math/458929b9b9fffee2f898a9a187056798d43100f9.png" alt="E_{min}"/> and <img class="math" src="../_images/math/3274ee2e13ff12041dc700e702b83463dc5f07ec.png" alt="E_{max}"/> are the minimum and maximum outgoing
energies of a scaled distribution, <img class="math" src="../_images/math/4eea5332064acfb08980ab21e9b23f3aea41d75f.png" alt="E_{i,j}"/> is the j-th outgoing energy
corresponding to the incoming energy <img class="math" src="../_images/math/f8f358aa01478e43f1a663db574b83f88d7be478.png" alt="E_i"/>, and <img class="math" src="../_images/math/5d1e4485dc90c450e8c76826516c1b2ccb8fce16.png" alt="M"/> is the number of
@ -416,14 +413,14 @@ between using the outgoing energy distributions corresponding to energy
outgoing energy bin <img class="math" src="../_images/math/8122aa89ea6e80784c6513d22787ad86e36ad0cc.png" alt="j"/> and interpolate between successive values on the
outgoing energy distribution:</p>
<div class="math" id="equation-ace-law-1-intermediate">
<p><span class="eqno">(32)</span><img src="../_images/math/6f19355ee7869a0a53f90bc69b2f188a1e7214ce.png" alt="\hat{E} = E_{\ell,j} + \xi_2 (E_{\ell,j+1} - E_{\ell,j})"/></p>
<p><span class="eqno">(32)</span><img src="../_images/math/6f19355ee7869a0a53f90bc69b2f188a1e7214ce.png" alt="\hat{E} = E_{\ell,j} + \xi_2 (E_{\ell,j+1} - E_{\ell,j})" /></p>
</div><p>where <img class="math" src="../_images/math/ccfd8fb41dea287e605b7582d709bd634d519a98.png" alt="\xi_2"/> is a random number sampled uniformly on <img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/>. Since
this outgoing energy may violate reaction kinematics, we then scale it to the
minimum and maximum energies we calculated earlier to get the final outgoing
energy:</p>
<div class="math" id="equation-ace-law-1-energy">
<p><span class="eqno">(33)</span><img src="../_images/math/a68c10ca1d67afa8a834a4d1598b347cc9e2920c.png" alt="E' = E_{min} + \frac{\hat{E} - E_{\ell,1}}{E_{\ell,M} - E_{\ell,1}}
(E_{max} - E_{min})"/></p>
(E_{max} - E_{min})" /></p>
</div></div>
<div class="section" id="ace-law-3-inelastic-level-scattering">
<h4>5.7.2.2. ACE Law 3 - Inelastic Level Scattering<a class="headerlink" href="#ace-law-3-inelastic-level-scattering" title="Permalink to this headline"></a></h4>
@ -431,7 +428,7 @@ energy:</p>
energy of the neutron <img class="math" src="../_images/math/411ef29ce6c32ab71534dfd3319a6fe72af9c5ee.png" alt="E'"/> can be related to the Q-value of the reaction
and the incoming energy:</p>
<div class="math" id="equation-level-scattering">
<p><span class="eqno">(34)</span><img src="../_images/math/0bd24d816c2f1a08d00db1804de0feb34e69b57d.png" alt="E' = \left ( \frac{A}{A+1} \right )^2 \left ( E - \frac{A + 1}{A} Q \right )"/></p>
<p><span class="eqno">(34)</span><img src="../_images/math/0bd24d816c2f1a08d00db1804de0feb34e69b57d.png" alt="E' = \left ( \frac{A}{A+1} \right )^2 \left ( E - \frac{A + 1}{A} Q \right )" /></p>
</div><p>where <img class="math" src="../_images/math/019e9892786e493964e145e7c5cf7b700314e53b.png" alt="A"/> is the mass of the target nucleus measured in neutron masses.</p>
</div>
<div class="section" id="ace-law-4-continuous-tabular-distribution">
@ -453,7 +450,7 @@ choose between using the outgoing energy distributions corresponding to energy
<img class="math" src="../_images/math/afb50a86e371bb6a55232fc7188cadd13c3aa0cb.png" alt="\xi_1"/> is a random number. Then, we sample an outgoing energy bin
<img class="math" src="../_images/math/8122aa89ea6e80784c6513d22787ad86e36ad0cc.png" alt="j"/> using the cumulative distribution function:</p>
<div class="math" id="equation-ace-law-4-sample-cdf">
<p><span class="eqno">(35)</span><img src="../_images/math/e244f963c6a9124b03b5f0a417ba6a825e7daf7e.png" alt="c_{\ell,j} &lt; \xi_2 &lt; c_{\ell,j+1}"/></p>
<p><span class="eqno">(35)</span><img src="../_images/math/e244f963c6a9124b03b5f0a417ba6a825e7daf7e.png" alt="c_{\ell,j} &lt; \xi_2 &lt; c_{\ell,j+1}" /></p>
</div><p>where <img class="math" src="../_images/math/ccfd8fb41dea287e605b7582d709bd634d519a98.png" alt="\xi_2"/> is a random number sampled uniformly on <img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/>. At
this point, we need to interpolate between the successive values on the outgoing
energy distribution using either histogram or linear-linear interpolation. The
@ -461,20 +458,20 @@ formulas for these can be derived along the same lines as those found in
<a class="reference internal" href="#angle-tabular"><em>Tabular Angular Distribution</em></a>. For histogram interpolation, the interpolated outgoing
energy on the <img class="math" src="../_images/math/63c17c295325f731666c7d74952b563a01e00fcc.png" alt="\ell"/>-th distribution is</p>
<div class="math" id="equation-energy-histogram">
<p><span class="eqno">(36)</span><img src="../_images/math/334c44d5859497107d7935ccb7b3ebf945e77036.png" alt="\hat{E} = E_{\ell,j} + \frac{\xi_2 - c_{\ell,j}}{p_{\ell,j}}."/></p>
<p><span class="eqno">(36)</span><img src="../_images/math/334c44d5859497107d7935ccb7b3ebf945e77036.png" alt="\hat{E} = E_{\ell,j} + \frac{\xi_2 - c_{\ell,j}}{p_{\ell,j}}." /></p>
</div><p>If linear-linear interpolation is to be used, the outgoing energy on the
<img class="math" src="../_images/math/63c17c295325f731666c7d74952b563a01e00fcc.png" alt="\ell"/>-th distribution is</p>
<div class="math" id="equation-energy-linlin">
<p><span class="eqno">(37)</span><img src="../_images/math/09be6addfac54bc22fb15534a5ec5cbe763ae7a9.png" alt="\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 )."/></p>
\right )." /></p>
</div><p>Since this outgoing energy may violate reaction kinematics, we then scale it to
minimum and maximum energies interpolated between the neighboring outgoing
energy distributions to get the final outgoing energy:</p>
<div class="math" id="equation-ace-law-4-energy">
<p><span class="eqno">(38)</span><img src="../_images/math/a68c10ca1d67afa8a834a4d1598b347cc9e2920c.png" alt="E' = E_{min} + \frac{\hat{E} - E_{\ell,1}}{E_{\ell,M} - E_{\ell,1}}
(E_{max} - E_{min})"/></p>
(E_{max} - E_{min})" /></p>
</div><p>where <img class="math" src="../_images/math/458929b9b9fffee2f898a9a187056798d43100f9.png" alt="E_{min}"/> and <img class="math" src="../_images/math/3274ee2e13ff12041dc700e702b83463dc5f07ec.png" alt="E_{max}"/> are defined the same as in equation
<a href="#equation-ace-law-1-minmax">(31)</a>.</p>
</div>
@ -484,7 +481,7 @@ energy distributions to get the final outgoing energy:</p>
so-called Maxwell spectrum. A probability distribution for the Maxwell spectrum
can be written in the form</p>
<div class="math" id="equation-maxwell-spectrum">
<p><span class="eqno">(39)</span><img src="../_images/math/99e02d1000c175a104a3644ceb3bdca1f550b553.png" alt="p(E') dE' = c E'^{1/2} e^{-E'/T(E)} dE'"/></p>
<p><span class="eqno">(39)</span><img src="../_images/math/99e02d1000c175a104a3644ceb3bdca1f550b553.png" alt="p(E') dE' = c E'^{1/2} e^{-E'/T(E)} dE'" /></p>
</div><p>where <img class="math" src="../_images/math/fa2fa899f0afb05d6837885523503a2d4df434f9.png" alt="E"/> is the incoming energy of the neutron and <img class="math" src="../_images/math/2554b6496c3b678897e9b060ef00aa9f0a7d7ece.png" alt="T"/> is the
so-called nuclear temperature, which is a function of the incoming energy of the
neutron. The ACE format contains a list of nuclear temperatures versus incoming
@ -494,11 +491,11 @@ determined, we then calculate a candidate outgoing energy based on rule C64 in
the <a class="reference external" href="https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-9721_3rdmcsampler.pdf">Monte Carlo Sampler</a>:</p>
<div class="math" id="equation-maxwell-E-candidate">
<p><span class="eqno">(40)</span><img src="../_images/math/16489cbb9e0da59d1fc383f1642790d774881e79.png" alt="E' = -T \left [ \log (\xi_1) + \log (\xi_2) \cos^2 \left ( \frac{\pi
\xi_3}{2} \right ) \right ]"/></p>
\xi_3}{2} \right ) \right ]" /></p>
</div><p>where <img class="math" src="../_images/math/82ce305031369ffb53339db4174b989a8c5ba53c.png" alt="\xi_1, \xi_2, \xi_3"/> are random numbers sampled on the unit
interval. The outgoing energy is only accepted if</p>
<div class="math" id="equation-maxwell-restriction">
<p><span class="eqno">(41)</span><img src="../_images/math/01efda64a6477b840e25e65c0e15bce3ea6a2f91.png" alt="0 \le E' \le E - U"/></p>
<p><span class="eqno">(41)</span><img src="../_images/math/01efda64a6477b840e25e65c0e15bce3ea6a2f91.png" alt="0 \le E' \le E - U" /></p>
</div><p>where <img class="math" src="../_images/math/e2bbebb3bd73f1ae5c64098ab0244f739abf7ca4.png" alt="U"/> is called the restriction energy and is specified on the ACE
table. If the outgoing energy is rejected, it is resampled using equation
<a href="#equation-maxwell-E-candidate">(40)</a>.</p>
@ -510,7 +507,7 @@ secondary particle can &#8220;evaporate&#8221; from the compound nucleus if it h
sufficient energy. The probability distribution for an evaporation spectrum can
be written in the form</p>
<div class="math" id="equation-evaporation-spectrum">
<p><span class="eqno">(42)</span><img src="../_images/math/1d42f7beb1c846b91ba9d5e1662a5bbffab60cc8.png" alt="p(E') dE' = c E' e^{-E'/T(E)} dE'"/></p>
<p><span class="eqno">(42)</span><img src="../_images/math/1d42f7beb1c846b91ba9d5e1662a5bbffab60cc8.png" alt="p(E') dE' = c E' e^{-E'/T(E)} dE'" /></p>
</div><p>where <img class="math" src="../_images/math/fa2fa899f0afb05d6837885523503a2d4df434f9.png" alt="E"/> is the incoming energy of the neutron and <img class="math" src="../_images/math/2554b6496c3b678897e9b060ef00aa9f0a7d7ece.png" alt="T"/> is the
nuclear temperature, which is a function of the incoming energy of the
neutron. The ACE format contains a list of nuclear temperatures versus incoming
@ -519,7 +516,7 @@ energies using a specified interpolation law. Once the temperature <img class="m
determined, we then calculate a candidate outgoing energy based on rule C45 in
the <a class="reference external" href="https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-9721_3rdmcsampler.pdf">Monte Carlo Sampler</a>:</p>
<div class="math" id="equation-evaporation-E">
<p><span class="eqno">(43)</span><img src="../_images/math/8ea83fb164ef9bee83ec55c60d2f967cd54c4caa.png" alt="E' = -T \log (\xi_1 \xi_2)"/></p>
<p><span class="eqno">(43)</span><img src="../_images/math/8ea83fb164ef9bee83ec55c60d2f967cd54c4caa.png" alt="E' = -T \log (\xi_1 \xi_2)" /></p>
</div><p>where <img class="math" src="../_images/math/f33cea5b957cd9633db339d718c6795b3f2361db.png" alt="\xi_1, \xi_2"/> are random numbers sampled on the unit
interval. The outgoing energy is only accepted according to a specified
restriction energy as in equation <a href="#equation-maxwell-restriction">(41)</a>.</p>
@ -529,7 +526,7 @@ restriction energy as in equation <a href="#equation-maxwell-restriction">(41)</
<p>The probability distribution for a Watt fission spectrum can be written in the
form</p>
<div class="math" id="equation-watt-spectrum">
<p><span class="eqno">(44)</span><img src="../_images/math/4ffe1408a7aeb4dc09d288f40efd8c89afed5abd.png" alt="p(E') dE' = c e^{-E'/a(E)} \sinh \sqrt{b(E) \, E'} dE'"/></p>
<p><span class="eqno">(44)</span><img src="../_images/math/4ffe1408a7aeb4dc09d288f40efd8c89afed5abd.png" alt="p(E') dE' = c e^{-E'/a(E)} \sinh \sqrt{b(E) \, E'} dE'" /></p>
</div><p>where <img class="math" src="../_images/math/c7d457e388298246adb06c587bccd419ea67f7e8.png" alt="a"/> and <img class="math" src="../_images/math/8136a7ef6a03334a7246df9097e5bcc31ba33fd2.png" alt="b"/> are parameters for the distribution and are given
as tabulated functions of the incoming energy of the neutron. These two
parameters are interpolated on the incoming energy grid using a specified
@ -538,7 +535,7 @@ Maxwellian spectrum with nuclear temperature <img class="math" src="../_images/m
described in <a class="reference internal" href="#maxwell"><em>ACE Law 7 - Maxwell Fission Spectrum</em></a> to get an energy <img class="math" src="../_images/math/10cb764f88509fb1c8012366993fdbee98f31bc5.png" alt="W"/>. Then, the outgoing
energy is calculated as</p>
<div class="math" id="equation-watt-E">
<p><span class="eqno">(45)</span><img src="../_images/math/583ae3d2ac2b6b0d2b900ae88cb17430a03814eb.png" alt="E' = W + \frac{a^2 b}{4} + (2\xi - 1) \sqrt{a^2 b W}"/></p>
<p><span class="eqno">(45)</span><img src="../_images/math/583ae3d2ac2b6b0d2b900ae88cb17430a03814eb.png" alt="E' = W + \frac{a^2 b}{4} + (2\xi - 1) \sqrt{a^2 b W}" /></p>
</div><p>where <img class="math" src="../_images/math/ccfd1641d037d427d9dbf42cdd54b485a03eafe9.png" alt="\xi"/> is a random number sampled on the interval <img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/>. The
outgoing energy is only accepted according to a specified restriction energy
<img class="math" src="../_images/math/e2bbebb3bd73f1ae5c64098ab0244f739abf7ca4.png" alt="U"/> as defined in equation <a href="#equation-maxwell-restriction">(41)</a>.</p>
@ -565,29 +562,29 @@ themselves are subject to either histogram or linear-linear interpolation on the
outgoing energy grid. For histogram interpolation, the parameters are</p>
<div class="math" id="equation-KM-parameters-histogram">
<p><span class="eqno">(46)</span><img src="../_images/math/46ddd53cab945638b174fc5a86c2d3375afb285a.png" alt="R = R_{\ell,j} \\
A = A_{\ell,j}."/></p>
A = A_{\ell,j}." /></p>
</div><p>If linear-linear interpolation is specified, the parameters are</p>
<div class="math" id="equation-KM-parameters-linlin">
<p><span class="eqno">(47)</span><img src="../_images/math/9e46570a52d6442fd4dd58100a5ffcc9a74dd385.png" alt="R = R_{\ell,j} + \frac{\hat{E} - E_{\ell,j}}{E_{\ell,j+1} - E_{\ell,j}} (
R_{\ell,j+1} - R_{\ell,j} ) \\
A = A_{\ell,j} + \frac{\hat{E} - E_{\ell,j}}{E_{\ell,j+1} - E_{\ell,j}} (
A_{\ell,j+1} - A_{\ell,j} )"/></p>
A_{\ell,j+1} - A_{\ell,j} )" /></p>
</div><p>where <img class="math" src="../_images/math/9d25d0527b1f635705501f5ba8b3e7a7a65e25bd.png" alt="\hat{E}"/> is defined in equation <a href="#equation-energy-linlin">(37)</a>. With the
parameters determined, the probability distribution function for the cosine of
the scattering angle is</p>
<div class="math" id="equation-KM-pdf-angle">
<p><span class="eqno">(48)</span><img src="../_images/math/7d6d5c906bb30c00ba2b8a7925aebc1bf8e4d656.png" alt="p(\mu) d\mu = \frac{A}{2 \sinh (A)} \left [ \cosh (A\mu) + R \sinh (A\mu)
\right ] d\mu."/></p>
\right ] d\mu." /></p>
</div><p>The rules for sampling this probability distribution function can be derived
based on rules C39 and C40 in the <a class="reference external" href="https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-9721_3rdmcsampler.pdf">Monte Carlo Sampler</a>. First, we sample two
random numbers <img class="math" src="../_images/math/b620332c5e28b62bddd2a4b7c0f945e380d4f47d.png" alt="\xi_3, \xi_4"/> on the unit interval. If <img class="math" src="../_images/math/e4a6fac94cc25fef1f91b85ea915e676e1022dcb.png" alt="\xi_3 &gt; R"/>
then the outgoing angle is</p>
<div class="math" id="equation-KM-angle-1">
<p><span class="eqno">(49)</span><img src="../_images/math/b73f63825f26190ec9906bc5497a10b69292b4fc.png" alt="\mu = \frac{1}{A} \ln \left ( T + \sqrt{T^2 + 1} \right )"/></p>
<p><span class="eqno">(49)</span><img src="../_images/math/b73f63825f26190ec9906bc5497a10b69292b4fc.png" alt="\mu = \frac{1}{A} \ln \left ( T + \sqrt{T^2 + 1} \right )" /></p>
</div><p>where <img class="math" src="../_images/math/60304bcbedb3bacec86eb21075142ce712ae20e6.png" alt="T = (2 \xi_4 - 1) \sinh (A)"/>. If <img class="math" src="../_images/math/5ad2f76673b75bb8bbe7e328e723c7e4368e3d9c.png" alt="\xi_3 \le R"/>, then the
outgoing angle is</p>
<div class="math" id="equation-KM-angle-2">
<p><span class="eqno">(50)</span><img src="../_images/math/9375035003057c0d471bcf75f7ebc69ee5d489b0.png" alt="\mu = \frac{1}{A} \ln \left ( \xi_4 e^A + (1 - \xi_4) e^{-A} \right )."/></p>
<p><span class="eqno">(50)</span><img src="../_images/math/9375035003057c0d471bcf75f7ebc69ee5d489b0.png" alt="\mu = \frac{1}{A} \ln \left ( \xi_4 e^A + (1 - \xi_4) e^{-A} \right )." /></p>
</div></div>
<div class="section" id="ace-law-61-correlated-energy-and-angle-distribution">
<h4>5.7.2.8. ACE Law 61 - Correlated Energy and Angle Distribution<a class="headerlink" href="#ace-law-61-correlated-energy-and-angle-distribution" title="Permalink to this headline"></a></h4>
@ -619,7 +616,7 @@ sometimes best treated by using what&#8217;s known as an N-body phase
distribution. This distribution has the following probability density function
for outgoing energy of the <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/>-th particle in the center-of-mass system:</p>
<div class="math" id="equation-n-body-pdf">
<p><span class="eqno">(51)</span><img src="../_images/math/8361f02043d8580921b283a7c3af5fdd9730bc8d.png" alt="p_i(E') dE' = C_n \sqrt{E'} (E_i^{max} - E')^{(3n/2) - 4} dE'"/></p>
<p><span class="eqno">(51)</span><img src="../_images/math/8361f02043d8580921b283a7c3af5fdd9730bc8d.png" alt="p_i(E') dE' = C_n \sqrt{E'} (E_i^{max} - E')^{(3n/2) - 4} dE'" /></p>
</div><p>where <img class="math" src="../_images/math/174fadd07fd54c9afe288e96558c92e0c1da733a.png" alt="n"/> is the number of outgoing particles, <img class="math" src="../_images/math/4e173907ca992482385a50c6f62ede920362b1bf.png" alt="C_n"/> is a
normalization constant, <img class="math" src="../_images/math/38a43cb2662b8bd6f8ed234c24bf80ab6ad0d1b8.png" alt="E_i^{max}"/> is the maximum center-of-mass energy
for particle <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/>, and <img class="math" src="../_images/math/411ef29ce6c32ab71534dfd3319a6fe72af9c5ee.png" alt="E'"/> is the outgoing energy. The algorithm for
@ -627,7 +624,7 @@ sampling the outgoing energy is based on algorithms R28, C45, and C64 in the
<a class="reference external" href="https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-9721_3rdmcsampler.pdf">Monte Carlo Sampler</a>. First we calculate the maximum energy in the
center-of-mass using the following equation:</p>
<div class="math" id="equation-n-body-emax">
<p><span class="eqno">(52)</span><img src="../_images/math/db29247c6fb57f5e068902962f3e8928919c38cc.png" alt="E_i^{max} = \frac{A_p - 1}{A_p} \left ( \frac{A}{A+1} E + Q \right )"/></p>
<p><span class="eqno">(52)</span><img src="../_images/math/db29247c6fb57f5e068902962f3e8928919c38cc.png" alt="E_i^{max} = \frac{A_p - 1}{A_p} \left ( \frac{A}{A+1} E + Q \right )" /></p>
</div><p>where <img class="math" src="../_images/math/8f1ce1f31570f2bf5b2c7b64f0563eacc44af49e.png" alt="A_p"/> is the total mass of the outgoing particles in neutron masses,
<img class="math" src="../_images/math/019e9892786e493964e145e7c5cf7b700314e53b.png" alt="A"/> is the mass of the original target nucleus in neutron masses, and
<img class="math" src="../_images/math/9866e3a998d628ba0941eb4fea0666ac391d149a.png" alt="Q"/> is the Q-value of the reaction. Next we sample a value <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/> from
@ -637,16 +634,16 @@ will depend on how many outgoing particles there are. For <img class="math" src=
simply sample another Maxwell distribution with unity nuclear temperature. For
<img class="math" src="../_images/math/5218af40079081e694d8b82eeac2d368ef6ea76a.png" alt="n = 4"/>, we use the equation</p>
<div class="math" id="equation-n-body-y4">
<p><span class="eqno">(53)</span><img src="../_images/math/fbe4b9a11593ea831c507e990455d5ad0aed05bb.png" alt="y = -\ln ( \xi_1 \xi_2 \xi_3 )"/></p>
<p><span class="eqno">(53)</span><img src="../_images/math/fbe4b9a11593ea831c507e990455d5ad0aed05bb.png" alt="y = -\ln ( \xi_1 \xi_2 \xi_3 )" /></p>
</div><p>where <img class="math" src="../_images/math/9070bf732e751e191c407181d609d8a2b9f1178f.png" alt="\xi_i"/> are random numbers sampled on the interval
<img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/>. For <img class="math" src="../_images/math/ec37f4048b4f92c2227c9bfe79fcb7d52ab99c9c.png" alt="n = 5"/>, we use the equation</p>
<div class="math" id="equation-n-body-y5">
<p><span class="eqno">(54)</span><img src="../_images/math/c1d940304e6da1863e8361ccc851fe4beba0ddf9.png" alt="y = -\ln ( \xi_1 \xi_2 \xi_3 \xi_4 ) - \ln ( \xi_5 ) \cos^2 \left (
\frac{\pi}{2} \xi_6 \right )"/></p>
\frac{\pi}{2} \xi_6 \right )" /></p>
</div><p>After <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/> and <img class="math" src="../_images/math/092e364e1d9d19ad5fffb0b46ef4cc7f2da02c1c.png" alt="y"/> have been determined, the outgoing energy is then
calculated as</p>
<div class="math" id="equation-n-body-energy">
<p><span class="eqno">(55)</span><img src="../_images/math/03cae9ff7e0cfd41be2c0dcbc5d43f24ead7018b.png" alt="E' = \frac{x}{x + y} E_i^{max}"/></p>
<p><span class="eqno">(55)</span><img src="../_images/math/03cae9ff7e0cfd41be2c0dcbc5d43f24ead7018b.png" alt="E' = \frac{x}{x + y} E_i^{max}" /></p>
</div><p>There are two important notes to make regarding the N-body phase space
distribution. First, the documentation (and code) for MCNP5-1.60 has a mistake
in the algorithm for <img class="math" src="../_images/math/5218af40079081e694d8b82eeac2d368ef6ea76a.png" alt="n = 4"/>. That being said, there are no existing
@ -666,7 +663,7 @@ energy and scattering cosine were given in the center-of-mass system, then we
first need to transform these into the laboratory system. The relationship
between the outgoing energy in center-of-mass and laboratory is</p>
<div class="math" id="equation-energy-com-to-lab">
<p><span class="eqno">(56)</span><img src="../_images/math/291aba8c90b9e372d6ab2814799c45e83ff5bfca.png" alt="E' = E'_{cm} + \frac{E + 2\mu_{cm} (A + 1) \sqrt{EE'_{cm}}}{(A+1)^2}."/></p>
<p><span class="eqno">(56)</span><img src="../_images/math/291aba8c90b9e372d6ab2814799c45e83ff5bfca.png" alt="E' = E'_{cm} + \frac{E + 2\mu_{cm} (A + 1) \sqrt{EE'_{cm}}}{(A+1)^2}." /></p>
</div><p>where <img class="math" src="../_images/math/88d85f087ea838305796b908ab5df949115475d6.png" alt="E'_{cm}"/> is the outgoing energy in the center-of-mass system,
<img class="math" src="../_images/math/59c60c3e0367df9e51e38c92deb8a67e4e58cd80.png" alt="\mu_{cm}"/> is the scattering cosine in the center-of-mass system,
<img class="math" src="../_images/math/411ef29ce6c32ab71534dfd3319a6fe72af9c5ee.png" alt="E'"/> is the outgoing energy in the laboratory system, and <img class="math" src="../_images/math/fa2fa899f0afb05d6837885523503a2d4df434f9.png" alt="E"/> is the
@ -674,7 +671,7 @@ incident neutron energy. The relationship between the scattering cosine in
center-of-mass and laboratory is</p>
<div class="math" id="equation-angle-com-to-lab">
<p><span class="eqno">(57)</span><img src="../_images/math/3f0c77fec4c184bc5feb14825a638bbe6386b774.png" alt="\mu = \mu_{cm} \sqrt{\frac{E'_{cm}}{E'}} + \frac{1}{A + 1}
\sqrt{\frac{E}{E'}}"/></p>
\sqrt{\frac{E}{E'}}" /></p>
</div><p>where <img class="math" src="../_images/math/2d8c833ed800824727cd7bd2fb9de1a12ad7e674.png" alt="\mu"/> is the scattering cosine in the laboratory system. The
scattering cosine still only tells us the cosine of the angle between the
original direction of the particle and the new direction of the particle. If we
@ -691,7 +688,7 @@ w^2}} \\
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."/></p>
w' = \mu w - \sqrt{1 - \mu^2} \sqrt{1 - w^2} \cos\phi." /></p>
</div></div>
<div class="section" id="effect-of-thermal-motion-on-cross-sections">
<span id="freegas"></span><h2>5.9. Effect of Thermal Motion on Cross Sections<a class="headerlink" href="#effect-of-thermal-motion-on-cross-sections" title="Permalink to this headline"></a></h2>
@ -705,7 +702,7 @@ same as the velocity of the neutron entering the collision.</p>
as</p>
<div class="math" id="equation-doppler-broaden">
<p><span class="eqno">(59)</span><img src="../_images/math/2b8ef2c54e5b7a2e2f2e67fb37627b2ef5431c6e.png" alt="v_n \bar{\sigma} (v_n, T) = \int d\mathbf{v}_T v_r \sigma(v_r)
M (\mathbf{v}_T)"/></p>
M (\mathbf{v}_T)" /></p>
</div><p>where <img class="math" src="../_images/math/e967fada3170ecae135227d4b5d2703e0417349e.png" alt="v_n"/> is the magnitude of the velocity of the neutron,
<img class="math" src="../_images/math/7bf2d869913026061af921cefc72c9d0e29c3a3f.png" alt="\bar{\sigma}"/> is an effective cross section, <img class="math" src="../_images/math/2554b6496c3b678897e9b060ef00aa9f0a7d7ece.png" alt="T"/> is the temperature
of the target material, <img class="math" src="../_images/math/31d2508fcb80808436ea2daafa2426433c166cb7.png" alt="\mathbf{v}_T"/> is the velocity of the target
@ -751,7 +748,7 @@ derivation here largely follows that of Gelbard. Let us first write the reaction
rate as a function of the velocity of the target nucleus:</p>
<div class="math" id="equation-reaction-rate">
<p><span class="eqno">(60)</span><img src="../_images/math/7017856fbc59ca11babd4e8b9d12fd6e071a981f.png" alt="R(\mathbf{v}_T) = || \mathbf{v}_n - \mathbf{v}_T || \sigma ( ||
\mathbf{v}_n - \mathbf{v}_T || ) M ( \mathbf{v}_T )"/></p>
\mathbf{v}_n - \mathbf{v}_T || ) M ( \mathbf{v}_T )" /></p>
</div><p>where <img class="math" src="../_images/math/eff43e84f8a3bcf7b6965f0a3248bc4d3a9d0cd4.png" alt="R"/> is the reaction rate. Note that this is just the right-hand side
of equation <a href="#equation-doppler-broaden">(59)</a>. Based on the discussion above, we want to
construct a probability distribution function for sampling the target velocity
@ -761,7 +758,7 @@ probability distribution function can be found by integrating equation
<a href="#equation-reaction-rate">(60)</a> to obtain a normalization factor:</p>
<div class="math" id="equation-target-pdf-1">
<p><span class="eqno">(61)</span><img src="../_images/math/977e02c76f6ed51ef0be17655cd9861db4be28bb.png" alt="p( \mathbf{v}_T ) d\mathbf{v}_T = \frac{R(\mathbf{v}_T) d\mathbf{v}_T}{\int
d\mathbf{v}_T \, R(\mathbf{v}_T)}"/></p>
d\mathbf{v}_T \, R(\mathbf{v}_T)}" /></p>
</div><p>Let us call the normalization factor in the denominator of equation
<a href="#equation-target-pdf-1">(61)</a> <img class="math" src="../_images/math/c3355896da590fc491a10150a50416687626d7cc.png" alt="C"/>.</p>
<p>It is normally assumed that <img class="math" src="../_images/math/e4bec896f9c0545474c6baebb13ab1f3789ba370.png" alt="\sigma (v_r)"/> is constant over the range of
@ -776,36 +773,36 @@ assumption, we write <img class="math" src="../_images/math/66192477e53a9f48501a
<a href="#equation-target-pdf-1">(61)</a> to</p>
<div class="math" id="equation-target-pdf-2">
<p><span class="eqno">(62)</span><img src="../_images/math/a0c0fbe7cd5f56b1c03e2488e748b5ec0664a4a3.png" alt="p( \mathbf{v}_T ) d\mathbf{v}_T = \frac{\sigma_s}{C} || \mathbf{v}_n -
\mathbf{v}_T || M ( \mathbf{v}_T ) d\mathbf{v}_T"/></p>
\mathbf{v}_T || M ( \mathbf{v}_T ) d\mathbf{v}_T" /></p>
</div><p>The Maxwellian distribution in velocity is</p>
<div class="math" id="equation-maxwellian-velocity">
<p><span class="eqno">(63)</span><img src="../_images/math/eaa621ad0051ac97e109cb57942121640f0322cd.png" alt="M (\mathbf{v}_T) = \left ( \frac{m}{2\pi kT} \right )^{3/2} \exp \left (
\frac{-m || \mathbf{v}_T^2 ||}{2kT} \right )"/></p>
\frac{-m || \mathbf{v}_T^2 ||}{2kT} \right )" /></p>
</div><p>where <img class="math" src="../_images/math/f5047d1e0cbb50ec208923a22cd517c55100fa7b.png" alt="m"/> is the mass of the target nucleus and <img class="math" src="../_images/math/8c325612684d41304b9751c175df7bcc0f61f64f.png" alt="k"/> is Boltzmann&#8217;s
constant. Notice here that the term in the exponential is dependent only on the
speed of the target, not on the actual direction. Thus, we can change the
Maxwellian into a distribution for speed rather than velocity. The differential
element of velocity is</p>
<div class="math" id="equation-differential-velocity">
<p><span class="eqno">(64)</span><img src="../_images/math/a168a50ab28dc89cc70833293c81d4aaf46b99d4.png" alt="d\mathbf{v}_T = v_T^2 dv_T d\mu d\phi"/></p>
<p><span class="eqno">(64)</span><img src="../_images/math/a168a50ab28dc89cc70833293c81d4aaf46b99d4.png" alt="d\mathbf{v}_T = v_T^2 dv_T d\mu d\phi" /></p>
</div><p>Let us define the Maxwellian distribution in speed as</p>
<div class="math" id="equation-maxwellian-speed">
<p><span class="eqno">(65)</span><img src="../_images/math/a9fc70bf11f3bc30f46e03173dec44cbb02f9886.png" alt="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."/></p>
v_T^2 \exp \left ( \frac{-m v_T}{2kT} \right ) dv_T." /></p>
</div><p>To simplify things a bit, we&#8217;ll define a parameter</p>
<div class="math" id="equation-maxwellian-beta">
<p><span class="eqno">(66)</span><img src="../_images/math/274ff010ed5a97ccf9e5e270b37afdbc61478156.png" alt="\beta = \sqrt{\frac{m}{2kT}}."/></p>
<p><span class="eqno">(66)</span><img src="../_images/math/274ff010ed5a97ccf9e5e270b37afdbc61478156.png" alt="\beta = \sqrt{\frac{m}{2kT}}." /></p>
</div><p>Substituting equation <a href="#equation-maxwellian-beta">(66)</a> into equation
<a href="#equation-maxwellian-speed">(65)</a>, we obtain</p>
<div class="math" id="equation-maxwellian-speed2">
<p><span class="eqno">(67)</span><img src="../_images/math/ad50e80ff25a3c978e7280b826d0d76cb3cda5ac.png" alt="M (v_T) dv_T = \frac{4}{\sqrt{\pi}} \beta^3 v_T^2 \exp \left ( -\beta^2
v_T^2 \right ) dv_T."/></p>
v_T^2 \right ) dv_T." /></p>
</div><p>Now, changing variables in equation <a href="#equation-target-pdf-2">(62)</a> by using the result from
equation <a href="#equation-maxwellian-speed">(65)</a>, our new probability distribution function is</p>
<div class="math" id="equation-target-pdf-3">
<p><span class="eqno">(68)</span><img src="../_images/math/0ed24e4eff759c650505d682b9bd60fa7a5280d9.png" alt="p( v_T, \mu ) dv_T d\mu = \frac{4\sigma_s}{\sqrt{\pi}C'} || \mathbf{v}_n -
\mathbf{v}_T || \beta^3 v_T^2 \exp \left ( -\beta^2 v_T^2 \right ) dv_T d\mu"/></p>
\mathbf{v}_T || \beta^3 v_T^2 \exp \left ( -\beta^2 v_T^2 \right ) dv_T d\mu" /></p>
</div><p>Again, the Maxwellian distribution for the speed of the target nucleus has no
dependence on the angle between the neutron and target velocity vectors. Thus,
only the term <img class="math" src="../_images/math/0f26fe31ea24161ceb02b1d7ab5ad00ec85e8518.png" alt="|| \mathbf{v}_n - \mathbf{v}_T ||"/> imposes any constraint
@ -814,16 +811,16 @@ of magnitudes of the velocity vectors and the angle rather than the vectors
themselves. We can establish this relation based on the law of cosines which
tells us that</p>
<div class="math" id="equation-lawcosine">
<p><span class="eqno">(69)</span><img src="../_images/math/5855faa969d195745d46532d0e26ecff25af71a2.png" alt="2 v_n v_T \mu = v_n^2 + v_T^2 - v_r^2."/></p>
<p><span class="eqno">(69)</span><img src="../_images/math/5855faa969d195745d46532d0e26ecff25af71a2.png" alt="2 v_n v_T \mu = v_n^2 + v_T^2 - v_r^2." /></p>
</div><p>Thus, we can infer that</p>
<div class="math" id="equation-change-terms">
<p><span class="eqno">(70)</span><img src="../_images/math/5aeaebc1064e992b4ec80f9e0a877deba60205c9.png" alt="|| \mathbf{v}_n - \mathbf{v}_T || = || \mathbf{v}_r || = v_r = \sqrt{v_n^2 +
v_T^2 - 2v_n v_T \mu}."/></p>
v_T^2 - 2v_n v_T \mu}." /></p>
</div><p>Inserting equation <a href="#equation-change-terms">(70)</a> into <a href="#equation-target-pdf-3">(68)</a>, we obtain</p>
<div class="math" id="equation-target-pdf-4">
<p><span class="eqno">(71)</span><img src="../_images/math/6eb76ad5ca2b655a3481a0ec1187860ec77e55ad.png" alt="p( v_T, \mu ) dv_T d\mu = \frac{4\sigma_s}{\sqrt{\pi}C'} \sqrt{v_n^2 +
v_T^2 - 2v_n v_T \mu} \beta^3 v_T^2 \exp \left ( -\beta^2 v_T^2 \right )
dv_T d\mu"/></p>
dv_T d\mu" /></p>
</div><p>This expression is still quite formidable and does not lend itself to any
natural sampling scheme. We can divide this probability distribution into two
parts as such:</p>
@ -833,15 +830,15 @@ parts as such:</p>
f_1(v_T, \mu) &amp;= \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) &amp;= (v_n + v_T) \beta^3 v_T^2 \exp \left ( -\beta^2 v_T^2 \right )."/></p>
f_2(v_T) &amp;= (v_n + v_T) \beta^3 v_T^2 \exp \left ( -\beta^2 v_T^2 \right )." /></p>
</div><p>In general, any probability distribution function of the form <img class="math" src="../_images/math/18b2137a12545c12040053d62af1f6a009747f7b.png" alt="p(x) =
f_1(x) f_2(x)"/> with <img class="math" src="../_images/math/81060fd5c50bb0771dc33e40b10a02530402154a.png" alt="f_1(x)"/> bounded can be sampled by sampling
<img class="math" src="../_images/math/8a606841183a001b6a780a104a40bd9d8d8b4aee.png" alt="x'"/> from the distribution</p>
<div class="math" id="equation-freegas-f2">
<p><span class="eqno">(73)</span><img src="../_images/math/fa369e6ba066f19728b7b399c486ba4074af4eb0.png" alt="q(x) dx = \frac{f_2(x) dx}{\int f_2(x) dx}"/></p>
<p><span class="eqno">(73)</span><img src="../_images/math/fa369e6ba066f19728b7b399c486ba4074af4eb0.png" alt="q(x) dx = \frac{f_2(x) dx}{\int f_2(x) dx}" /></p>
</div><p>and accepting it with probability</p>
<div class="math" id="equation-freegas-accept">
<p><span class="eqno">(74)</span><img src="../_images/math/1b483168dab97633fa9067574a5a9d2dcc361b1e.png" alt="p_{accept} = \frac{f_1(x')}{\max f_1(x)}"/></p>
<p><span class="eqno">(74)</span><img src="../_images/math/1b483168dab97633fa9067574a5a9d2dcc361b1e.png" alt="p_{accept} = \frac{f_1(x')}{\max f_1(x)}" /></p>
</div><p>The reason for dividing and multiplying the terms by <img class="math" src="../_images/math/9538b05f2194763530b09845b7f682458e493564.png" alt="v_n + v_T"/> is to
ensure that the first term is bounded. In general, <img class="math" src="../_images/math/ad691e61afb1a005b5955aa954f1702fe59f2f46.png" alt="|| \mathbf{v}_n -
\mathbf{v}_T ||"/> can take on arbitrarily large values, but if we divide it by
@ -851,29 +848,29 @@ bounded. We now must come up with a sampling scheme for equation
in equation <a href="#equation-divide-pdf">(72)</a>. Doing so we find that</p>
<div class="math" id="equation-integrate-f2">
<p><span class="eqno">(75)</span><img src="../_images/math/be693703d3c0d2a954fa4dea34a5eb50e611e2a5.png" alt="\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 )."/></p>
\right ) = \frac{1}{4\beta} \left ( \sqrt{\pi} \beta v_n + 2 \right )." /></p>
</div><p>Thus, we need to sample the probability distribution function</p>
<div class="math" id="equation-freegas-f2-2">
<p><span class="eqno">(76)</span><img src="../_images/math/c1724bbfb4ca001be9002a1f15a1f58cc3eb3dbe.png" alt="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 )."/></p>
-\beta^2 v_T^2 \right )." /></p>
</div><p>Now, let us do a change of variables with the following definitions</p>
<div class="math" id="equation-beta-to-x">
<p><span class="eqno">(77)</span><img src="../_images/math/f2d74e032b1543ffed8297452aefec47a8add273.png" alt="x = \beta v_T \\
y = \beta v_n."/></p>
y = \beta v_n." /></p>
</div><p>Substituting equation <a href="#equation-beta-to-x">(77)</a> into equation <a href="#equation-freegas-f2-2">(76)</a> along
with <img class="math" src="../_images/math/a5c225ea183fc086f6379f84f4ab39d20a3d6e12.png" alt="dx = \beta dv_T"/> and doing some crafty rearranging of terms yields</p>
<div class="math" id="equation-freegas-f2-3">
<p><span class="eqno">(78)</span><img src="../_images/math/4f3913b278c1449f1820c28dffd2c40941bb4b84.png" alt="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."/></p>
\right ) 2x^3 e^{-x^2} \right ] dx." /></p>
</div><p>It&#8217;s important to make note of the following two facts. First, the terms outside
the parentheses are properly normalized probability distribution functions that
can be sampled directly. Secondly, the terms inside the parentheses are always
less than unity. Thus, the sampling scheme for <img class="math" src="../_images/math/25b5f855b56cd269cd617940805cef31bc41a95c.png" alt="q(x)"/> is as follows. We
sample a random number <img class="math" src="../_images/math/afb50a86e371bb6a55232fc7188cadd13c3aa0cb.png" alt="\xi_1"/> on the interval <img class="math" src="../_images/math/bc1a809324034256fb4541c3b1d336e005d488ef.png" alt="[0,1)"/> and if</p>
<div class="math" id="equation-freegas-alpha">
<p><span class="eqno">(79)</span><img src="../_images/math/bcdd05c4d063c0e9e24362e36c232166a69f0ead.png" alt="\xi_1 &lt; \frac{2}{\sqrt{\pi} y + 2}"/></p>
<p><span class="eqno">(79)</span><img src="../_images/math/bcdd05c4d063c0e9e24362e36c232166a69f0ead.png" alt="\xi_1 &lt; \frac{2}{\sqrt{\pi} y + 2}" /></p>
</div><p>then we sample the probability distribution <img class="math" src="../_images/math/2b04b9f241837205e8f5c8ad9358309a0054a58a.png" alt="2x^3 e^{-x^2}"/> for <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/>
using rule C49 in the <a class="reference external" href="https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-9721_3rdmcsampler.pdf">Monte Carlo Sampler</a> which we can then use to determine
the speed of the target nucleus <img class="math" src="../_images/math/867949f54a7d52f49a568a5bfcffb2b9464f96a7.png" alt="v_T"/> from equation
@ -887,7 +884,7 @@ on the unit interval. Since the maximum value of <img class="math" src="../_imag
<img class="math" src="../_images/math/6706acaae8684a413d58202f8c46c0cbeaae54f3.png" alt="4\sigma_s / \sqrt{\pi} C'"/>, we then sample another random number
<img class="math" src="../_images/math/78d5363240163b51e764d1532b814095a57d3ec7.png" alt="\xi_3"/> and accept the sampled target speed and cosine if</p>
<div class="math" id="equation-freegas-accept-2">
<p><span class="eqno">(80)</span><img src="../_images/math/d6e0193a4c5b00f81c510ae43fcccfb3da27018e.png" alt="\xi_3 &lt; \frac{\sqrt{v_n^2 + v_T^2 - 2 v_n v_T \mu}}{v_n + v_T}."/></p>
<p><span class="eqno">(80)</span><img src="../_images/math/d6e0193a4c5b00f81c510ae43fcccfb3da27018e.png" alt="\xi_3 &lt; \frac{\sqrt{v_n^2 + v_T^2 - 2 v_n v_T \mu}}{v_n + v_T}." /></p>
</div><p>If is not accepted, then we repeat the process and resample a target speed and
cosine until a combination is found that satisfies equation
<a href="#equation-freegas-accept-2">(80)</a>.</p>
@ -940,7 +937,7 @@ 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</p>
<div class="math" id="equation-coherent-elastic-xs">
<p><span class="eqno">(81)</span><img src="../_images/math/aa2d4ac30c971be67cf2655355d5d2c3b424c9af.png" alt="\sigma(E) = \frac{\sigma_c}{E} \sum_{E_i &lt; E} f_i e^{-4WE_i}"/></p>
<p><span class="eqno">(81)</span><img src="../_images/math/aa2d4ac30c971be67cf2655355d5d2c3b424c9af.png" alt="\sigma(E) = \frac{\sigma_c}{E} \sum_{E_i &lt; E} f_i e^{-4WE_i}" /></p>
</div><p>where <img class="math" src="../_images/math/a96b25b6ddab9332c0b16dccbfaf7dfe126801bb.png" alt="\sigma_c"/> is the effective bound coherent scattering cross section,
<img class="math" src="../_images/math/10cb764f88509fb1c8012366993fdbee98f31bc5.png" alt="W"/> is the effective Debye-Waller coefficient, <img class="math" src="../_images/math/f8f358aa01478e43f1a663db574b83f88d7be478.png" alt="E_i"/> are the
energies of the Bragg edges, and <img class="math" src="../_images/math/61c594c97b61f72af93af4e61894b3f16a3bbb30.png" alt="f_i"/> are related to crystallographic
@ -958,11 +955,11 @@ does change. For coherent elastic scattering, the angle will depend on which
Bragg edge scattered the neutron. The probability that edge <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/> will
scatter then neutron is given by</p>
<div class="math" id="equation-coherent-elastic-probability">
<p><span class="eqno">(82)</span><img src="../_images/math/58640e60dd88a212e6da856f0313c5a26fd3bbe4.png" alt="\frac{f_i e^{-4WE_i}}{\sum_j f_j e^{-4WE_j}}."/></p>
<p><span class="eqno">(82)</span><img src="../_images/math/58640e60dd88a212e6da856f0313c5a26fd3bbe4.png" alt="\frac{f_i e^{-4WE_i}}{\sum_j f_j e^{-4WE_j}}." /></p>
</div><p>After a Bragg edge has been sampled, the cosine of the angle of scattering is
given analytically by</p>
<div class="math" id="equation-coherent-elastic-angle">
<p><span class="eqno">(83)</span><img src="../_images/math/0a2c2c9cf6eb22e7f1445a3a8b2cf62701540b81.png" alt="\mu = 1 - \frac{E_i}{E}"/></p>
<p><span class="eqno">(83)</span><img src="../_images/math/0a2c2c9cf6eb22e7f1445a3a8b2cf62701540b81.png" alt="\mu = 1 - \frac{E_i}{E}" /></p>
</div><p>where <img class="math" src="../_images/math/f8f358aa01478e43f1a663db574b83f88d7be478.png" alt="E_i"/> is the energy of the Bragg edge that scattered the neutron.</p>
</div>
<div class="section" id="outgoing-angle-for-incoherent-elastic-scattering">
@ -974,10 +971,10 @@ elastic energy grid. First the outgoing angle bin <img class="math" src="../_ima
the incoming energy of the neutron satisfies <img class="math" src="../_images/math/e12f93f087b0231f50449edc28ed12050e5f68da.png" alt="E_i &lt; E &lt; E_{i+1}"/> the final
cosine is</p>
<div class="math" id="equation-incoherent-elastic-angle">
<p><span class="eqno">(84)</span><img src="../_images/math/8b4a5c2509a4863c148f378838fa6c9b81749921.png" alt="\mu = \mu_{i,j} + f (\mu_{i+1,j} - \mu_{i,j})"/></p>
<p><span class="eqno">(84)</span><img src="../_images/math/8b4a5c2509a4863c148f378838fa6c9b81749921.png" alt="\mu = \mu_{i,j} + f (\mu_{i+1,j} - \mu_{i,j})" /></p>
</div><p>where the interpolation factor is defined as</p>
<div class="math" id="equation-sab-interpolation-factor">
<p><span class="eqno">(85)</span><img src="../_images/math/fe55e554344d75d204e638a282e6acca6acebd08.png" alt="f = \frac{E - E_i}{E_{i+1} - E_i}."/></p>
<p><span class="eqno">(85)</span><img src="../_images/math/fe55e554344d75d204e638a282e6acca6acebd08.png" alt="f = \frac{E - E_i}{E_{i+1} - E_i}." /></p>
</div></div>
<div class="section" id="outgoing-energy-and-angle-for-inelastic-scattering">
<h3>5.10.4. Outgoing Energy and Angle for Inelastic Scattering<a class="headerlink" href="#outgoing-energy-and-angle-for-inelastic-scattering" title="Permalink to this headline"></a></h3>
@ -995,13 +992,13 @@ either from a uniform distribution or from the aforementioned skewed
distribution. The outgoing energy is then interpolated between values
corresponding to neighboring incoming energies:</p>
<div class="math" id="equation-inelastic-energy">
<p><span class="eqno">(86)</span><img src="../_images/math/3f8f6da4aab67655ddac5d3b3027e44a2c23436f.png" alt="E = E_{i,j} + f (E_{i+1,j} - E_{i,j})"/></p>
<p><span class="eqno">(86)</span><img src="../_images/math/3f8f6da4aab67655ddac5d3b3027e44a2c23436f.png" alt="E = E_{i,j} + f (E_{i+1,j} - E_{i,j})" /></p>
</div><p>where <img class="math" src="../_images/math/4eea5332064acfb08980ab21e9b23f3aea41d75f.png" alt="E_{i,j}"/> is the j-th outgoing energy corresponding to the i-th
incoming energy. For each combination of incoming and outgoing energies, there
is a series equiprobable outgoing cosines. An outgoing cosine bin is sampled
uniformly and then the final cosine is interpolated on the incoming energy grid:</p>
<div class="math" id="equation-inelastic-angle">
<p><span class="eqno">(87)</span><img src="../_images/math/76f3fc4985d28bccf0b89a0d5773aab1497bf9b6.png" alt="\mu = \mu_{i,j,k} + f (\mu_{i+1,j,k} - \mu_{i,j,k})"/></p>
<p><span class="eqno">(87)</span><img src="../_images/math/76f3fc4985d28bccf0b89a0d5773aab1497bf9b6.png" alt="\mu = \mu_{i,j,k} + f (\mu_{i+1,j,k} - \mu_{i,j,k})" /></p>
</div><p>where <img class="math" src="../_images/math/2d7f45fa99693dbe2948e840fb6aaf916beb0c27.png" alt="\mu_{i,j,k}"/> is the k-th outgoing cosine corresponding to the j-th
outgoing energy and the i-th incoming energy.</p>
</div>
@ -1044,17 +1041,17 @@ capture cross sections from the probability tables interpolating between
neighboring incoming energies. If interpolation is specified, then
the cross sections are calculated as</p>
<div class="math" id="equation-ptables-linlin">
<p><span class="eqno">(88)</span><img src="../_images/math/78f6fab5c8e96409b2f5b86a341a51d416cea8ba.png" alt="\sigma = \sigma_{i,j} + f (\sigma_{i+1,j} - \sigma{i,j})"/></p>
<p><span class="eqno">(88)</span><img src="../_images/math/78f6fab5c8e96409b2f5b86a341a51d416cea8ba.png" alt="\sigma = \sigma_{i,j} + f (\sigma_{i+1,j} - \sigma{i,j})" /></p>
</div><p>where <img class="math" src="../_images/math/708c2896dec2ac483dc4bcc92baca55b7cb19921.png" alt="\sigma_{i,j}"/> is the j-th band cross section corresponding to the
i-th incoming neutron energy and <img class="math" src="../_images/math/bb2c93730dbb48558bb3c4738c956c4e8f816437.png" alt="f"/> is the interpolation factor defined
in the same manner as <a href="#equation-sab-interpolation-factor">(85)</a>. If logarithmic
interpolation is specified, the cross sections are calculated as</p>
<div class="math" id="equation-ptables-loglog">
<p><span class="eqno">(89)</span><img src="../_images/math/8b359f9521a5ba3afb4800d705d667c88c41bd33.png" alt="\sigma = \exp \left ( \log \sigma_{i,j} + f \log
\frac{\sigma_{i+1,j}}{\sigma_{i,j}} \right )"/></p>
\frac{\sigma_{i+1,j}}{\sigma_{i,j}} \right )" /></p>
</div><p>where the interpolation factor is now defined as</p>
<div class="math" id="equation-log-interpolation-factor">
<p><span class="eqno">(90)</span><img src="../_images/math/aca45e27a2286d530c0d9d17fba88c3e35471698.png" alt="f = \frac{\log \frac{E}{E_i}}{\log \frac{E_{i+1}}{E_i}}."/></p>
<p><span class="eqno">(90)</span><img src="../_images/math/aca45e27a2286d530c0d9d17fba88c3e35471698.png" alt="f = \frac{\log \frac{E}{E_i}}{\log \frac{E_{i+1}}{E_i}}." /></p>
</div><p>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
@ -1077,7 +1074,7 @@ this is a misnomer) is commonly used.</p>
instead, at every collision, the weight of neutron is reduced by probability of
absorption occurring, i.e.</p>
<div class="math" id="equation-survival-biasing-weight">
<p><span class="eqno">(91)</span><img src="../_images/math/acd6282c9abf3632e40baee0c28c6232ec72c805.png" alt="w' = w \left ( 1 - \frac{\sigma_a (E)}{\sigma_t (E)} \right )"/></p>
<p><span class="eqno">(91)</span><img src="../_images/math/acd6282c9abf3632e40baee0c28c6232ec72c805.png" alt="w' = w \left ( 1 - \frac{\sigma_a (E)}{\sigma_t (E)} \right )" /></p>
</div><p>where <img class="math" src="../_images/math/11355298328f1cd40da4c649ccf7d3d07d88b84a.png" alt="w'"/> is the weight of the neutron after adjustment and <img class="math" src="../_images/math/9ee4b825a2e36ae093ed7be5e4851ef453b34914.png" alt="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
@ -1087,7 +1084,7 @@ successive generations. The algorithm for sampling fission sites is the same as
that described in <a class="reference internal" href="#fission"><em>Fission</em></a>. The only difference is in equation
<a href="#equation-fission-neutrons">(14)</a>. We now need to produce</p>
<div class="math" id="equation-fission-neutrons-survival">
<p><span class="eqno">(92)</span><img src="../_images/math/42ec6f31d15e2d1e3378bfa79c4cf43526c3bbde.png" alt="\nu = \frac{w}{k} \frac{\nu_t \sigma_f(E)}{\sigma_t (E)}"/></p>
<p><span class="eqno">(92)</span><img src="../_images/math/42ec6f31d15e2d1e3378bfa79c4cf43526c3bbde.png" alt="\nu = \frac{w}{k} \frac{\nu_t \sigma_f(E)}{\sigma_t (E)}" /></p>
</div><p>fission sites, where <img class="math" src="../_images/math/9ee4b825a2e36ae093ed7be5e4851ef453b34914.png" alt="w"/> is the weight of the neutron before being
adjusted. One should note this is just the expected number of neutrons produced
<em>per collision</em> rather than the expected number of neutrons produced given that
@ -1180,7 +1177,7 @@ book can be obtained for free from the <a class="reference external" href="http:
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>4. Random Number Generation &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -71,7 +68,7 @@ simplest and commonly used algorithms is called a <a class="reference external"
generator</a>. We start with a random number <em>seed</em> <img class="math" src="../_images/math/da04290a79211712a58bf7241c9fb64251e000c3.png" alt="\xi_0"/> and a sequence
of random numbers can then be generated using the following recurrence relation:</p>
<div class="math" id="equation-lcg">
<p><span class="eqno">(1)</span><img src="../_images/math/838ea831f2458960d581811d15ea37bae3f20014.png" alt="\xi_{i+1} = g \xi_i + c \mod M"/></p>
<p><span class="eqno">(1)</span><img src="../_images/math/838ea831f2458960d581811d15ea37bae3f20014.png" alt="\xi_{i+1} = g \xi_i + c \mod M" /></p>
</div><p>where <img class="math" src="../_images/math/311cabda3a9b09f0dde217303ca9d1cd9201dcf6.png" alt="g"/>, <img class="math" src="../_images/math/3372c1cb6d68cf97c2d231acc0b47b95a9ed04cc.png" alt="c"/>, and <img class="math" src="../_images/math/5d1e4485dc90c450e8c76826516c1b2ccb8fce16.png" alt="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
@ -94,7 +91,7 @@ ahead in <img class="math" src="../_images/math/b1f5ad51fbccc6f210d02d9c3eb8ea96
to do so is described in a paper by <a class="reference external" href="https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/anl_rn_arb-strides_1994.pdf">Brown</a>. This algorithm relies on the following
relationship:</p>
<div class="math" id="equation-lcg-skipahead">
<p><span class="eqno">(2)</span><img src="../_images/math/29e04a6d8160c6dd91ec828d9133bcdeff0f1fdc.png" alt="\xi_{i+k} = g^k \xi_i + c \frac{g^k - 1}{g - 1} \mod M"/></p>
<p><span class="eqno">(2)</span><img src="../_images/math/29e04a6d8160c6dd91ec828d9133bcdeff0f1fdc.png" alt="\xi_{i+k} = g^k \xi_i + c \frac{g^k - 1}{g - 1} \mod M" /></p>
</div><p>Note that <a href="#equation-lcg-skipahead">(2)</a> has the same general form as eqref{eq:lcg}, so
the idea is to determine the new multiplicative and additive constants in
<img class="math" src="../_images/math/b1f5ad51fbccc6f210d02d9c3eb8ea96fdd9f505.png" alt="O(\log_2 N)"/> operations.</p>
@ -130,7 +127,7 @@ Different Sizes and Good Lattice Structures,&#8221; <em>Math. Comput.</em>, <str
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>6. Tallies &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -63,7 +60,7 @@ be written in the following form:</p>
<div class="math" id="equation-tally-integral">
<p><span class="eqno">(1)</span><img src="../_images/math/6f7489fd2bc01b81438f2b62e88a6e3c39dde125.png" alt="X = \underbrace{\int d\mathbf{r} \int d\mathbf{\Omega} \int
dE}_{\text{filters}} \underbrace{f(\mathbf{r}, \mathbf{\Omega},
E)}_{\text{scores}} \psi (\mathbf{r}, \mathbf{\Omega}, E)"/></p>
E)}_{\text{scores}} \psi (\mathbf{r}, \mathbf{\Omega}, E)" /></p>
</div><p>A user can specify one or more filters which identify which regions of phase
space should score to a given tally (the limits of integration as shown in
equation <a href="#equation-tally-integral">(1)</a>) as well as the scoring function (<img class="math" src="../_images/math/bb2c93730dbb48558bb3c4738c956c4e8f816437.png" alt="f"/> in
@ -112,7 +109,7 @@ basic idea is that we simply count the number of actual reactions that take
place and use that as our estimate for the reaction rate. This can be written
mathematically as</p>
<div class="math" id="equation-analog-estimator">
<p><span class="eqno">(2)</span><img src="../_images/math/5075b2fe167d0329008574cdb1a9e6d8cfdb6034.png" alt="R_x = \frac{1}{W} \sum_{i \in A} w_i"/></p>
<p><span class="eqno">(2)</span><img src="../_images/math/5075b2fe167d0329008574cdb1a9e6d8cfdb6034.png" alt="R_x = \frac{1}{W} \sum_{i \in A} w_i" /></p>
</div><p>where <img class="math" src="../_images/math/e04fc1458c243800934b8d2d2419f4d38d7d2e50.png" alt="R_x"/> is the reaction rate for reaction <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/>, <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/> denotes
an index for each event, <img class="math" src="../_images/math/019e9892786e493964e145e7c5cf7b700314e53b.png" alt="A"/> is the set of all events resulting in
reaction <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/>, and <img class="math" src="../_images/math/10cb764f88509fb1c8012366993fdbee98f31bc5.png" alt="W"/> is the total starting weight of the particles,
@ -139,7 +136,7 @@ scalar flux, it stands to reason that we can estimate the flux by taking an
estimate of the total reaction rate and dividing it by the total macroscopic
cross section. This gives us the following formula:</p>
<div class="math" id="equation-collision-estimator-flux">
<p><span class="eqno">(3)</span><img src="../_images/math/99bb09b89d1018e8112899db4e6db62187f2b882.png" alt="\phi = \frac{1}{W} \sum_{i \in C} \frac{w_i}{\Sigma_t (E_i)}"/></p>
<p><span class="eqno">(3)</span><img src="../_images/math/99bb09b89d1018e8112899db4e6db62187f2b882.png" alt="\phi = \frac{1}{W} \sum_{i \in C} \frac{w_i}{\Sigma_t (E_i)}" /></p>
</div><p>where <img class="math" src="../_images/math/10cb764f88509fb1c8012366993fdbee98f31bc5.png" alt="W"/> is again the total starting weight of the particles, <img class="math" src="../_images/math/c3355896da590fc491a10150a50416687626d7cc.png" alt="C"/>
is the set of all events resulting in a collision with a nucleus, and
<img class="math" src="../_images/math/4123c4fb5bd5659657f63f0d4e59e06c6eaab8f7.png" alt="\Sigma_t (E)"/> is the total macroscopic cross section of the target
@ -148,7 +145,7 @@ material at the incoming energy of the particle <img class="math" src="../_image
macroscopic cross section for some reaction <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/>, then we get the collision
estimate for the reaction rate for that reaction:</p>
<div class="math" id="equation-collision-estimator">
<p><span class="eqno">(4)</span><img src="../_images/math/d8eef5a56ca8e57f1809928db6159a4d5bfee23e.png" alt="R_x = \frac{1}{W} \sum_{i \in C} \frac{w_i \Sigma_x (E_i)}{\Sigma_t (E_i)}"/></p>
<p><span class="eqno">(4)</span><img src="../_images/math/d8eef5a56ca8e57f1809928db6159a4d5bfee23e.png" alt="R_x = \frac{1}{W} \sum_{i \in C} \frac{w_i \Sigma_x (E_i)}{\Sigma_t (E_i)}" /></p>
</div><p>where <img class="math" src="../_images/math/c9dff1417dfadc1338c77d9000f382dc03e058b5.png" alt="\Sigma_x (E_i)"/> is the macroscopic cross section for reaction
<img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/> at the incoming energy of the particle <img class="math" src="../_images/math/f8f358aa01478e43f1a663db574b83f88d7be478.png" alt="E_i"/>. In comparison to
equation <a href="#equation-analog-estimator">(2)</a>, we see that the collision estimate will result
@ -164,7 +161,7 @@ track-length estimator, sometimes also called a path-length estimator. We first
start with an expression for the volume integrated flux, which can be written as</p>
<div class="math" id="equation-flux-integrated">
<p><span class="eqno">(5)</span><img src="../_images/math/50b6e2c62e6e64b4bb36cd69b67aa136c2544429.png" alt="V \phi = \int d\mathbf{r} \int dE \int d\mathbf{\Omega} \int dt \,
\psi(\mathbf{r}, \mathbf{\hat{\Omega}}, E, t)"/></p>
\psi(\mathbf{r}, \mathbf{\hat{\Omega}}, E, t)" /></p>
</div><p>where <img class="math" src="../_images/math/12d58aa29201da09d8e620f8698e3a37547f6b4a.png" alt="V"/> is the volume, <img class="math" src="../_images/math/8ada738001410f131563551fb68731e4f302048d.png" alt="\psi"/> is the angular flux,
<img class="math" src="../_images/math/523765e6f77d2ff678e47c2a1ff0a59ace2e8e36.png" alt="\mathbf{r}"/> is the position of the particle, <img class="math" src="../_images/math/24e80eca0896a9a27e062e99d624799f9d56e32e.png" alt="\mathbf{\hat{\Omega}}"/>
is the direction of the particle, <img class="math" src="../_images/math/fa2fa899f0afb05d6837885523503a2d4df434f9.png" alt="E"/> is the energy of the particle, and
@ -174,24 +171,24 @@ where <img class="math" src="../_images/math/174fadd07fd54c9afe288e96558c92e0c1d
<a href="#equation-flux-integrated">(5)</a> as</p>
<div class="math" id="equation-flux-integrated-2">
<p><span class="eqno">(6)</span><img src="../_images/math/5a6174258d5f693a187b1c384416e8c148a66065.png" alt="V \phi = \int d\mathbf{r} \int dE \int dt v \int d\mathbf{\Omega} \, n(\mathbf{r},
\mathbf{\hat{\Omega}}, E, t))."/></p>
\mathbf{\hat{\Omega}}, E, t))." /></p>
</div><p>Using the relations <img class="math" src="../_images/math/fbd773ff4c9cf09101895f518aed3096cf05ac27.png" alt="N(\mathbf{r}, E, t) = \int d\mathbf{\Omega}
n(\mathbf{r}, \mathbf{\hat{\Omega}}, E, t)"/> and <img class="math" src="../_images/math/1398cc90f5d6dc57f5585101970e32be7345d130.png" alt="d\ell = v \, dt"/> where
<img class="math" src="../_images/math/492e4dcffdca8aa5f0f342ec9309bc75ca90b7f1.png" alt="d\ell"/> is the differential unit of track length, we then obtain</p>
<div class="math" id="equation-track-length-integral">
<p><span class="eqno">(7)</span><img src="../_images/math/c2865559d669db2d2cf737e2d36d6070f12d2a52.png" alt="V \phi = \int d\mathbf{r} \int dE \int d\ell N(\mathbf{r}, E, t)."/></p>
<p><span class="eqno">(7)</span><img src="../_images/math/c2865559d669db2d2cf737e2d36d6070f12d2a52.png" alt="V \phi = \int d\mathbf{r} \int dE \int d\ell N(\mathbf{r}, E, t)." /></p>
</div><p>Equation <a href="#equation-track-length-integral">(7)</a> indicates that we can use the length of a
particle&#8217;s trajectory as an estimate for the flux, i.e. the track-length
estimator of the flux would be</p>
<div class="math" id="equation-track-length-flux">
<p><span class="eqno">(8)</span><img src="../_images/math/821c18828f9814f8f0d361cd228fafe06543c582.png" alt="\phi = \frac{1}{W} \sum_{i \in T} w_i \ell_i"/></p>
<p><span class="eqno">(8)</span><img src="../_images/math/821c18828f9814f8f0d361cd228fafe06543c582.png" alt="\phi = \frac{1}{W} \sum_{i \in T} w_i \ell_i" /></p>
</div><p>where <img class="math" src="../_images/math/2554b6496c3b678897e9b060ef00aa9f0a7d7ece.png" alt="T"/> is the set of all the particle&#8217;s trajectories within the desired
volume and <img class="math" src="../_images/math/cb2fdb61ac5f2b89ddc5b4207d7f3f1cb6a2c504.png" alt="\ell_i"/> is the length of the <img class="math" src="../_images/math/34857b3ba74ce5cd8607f3ebd23e9015908ada71.png" alt="i"/>-th trajectory. In the
same vein as equation <a href="#equation-collision-estimator">(4)</a>, the track-length estimate of a
reaction rate is found by multiplying equation <a href="#equation-track-length-flux">(8)</a> by a
macroscopic reaction cross section:</p>
<div class="math" id="equation-track-length-estimator">
<p><span class="eqno">(9)</span><img src="../_images/math/23dc55b9f305312b927279536a168654ce7f959f.png" alt="R_x = \frac{1}{W} \sum_{i \in T} w_i \ell_i \Sigma_x (E_i)."/></p>
<p><span class="eqno">(9)</span><img src="../_images/math/23dc55b9f305312b927279536a168654ce7f959f.png" alt="R_x = \frac{1}{W} \sum_{i \in T} w_i \ell_i \Sigma_x (E_i)." /></p>
</div><p>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
particle&#8217;s state following a collision because by definition, it will not have
@ -224,11 +221,11 @@ X_n}{n}"/> <a class="reference external" href="http://en.wikipedia.org/wiki/Conv
<img class="math" src="../_images/math/ce56cfc237a035a5b060ddc685c710b3fa4af2e8.png" alt="\epsilon &gt; 0"/></p>
<div class="math">
<p><img src="../_images/math/54b533b0558a6c319ad7d12a02144a6f255efef8.png" alt="\lim\limits_{n\rightarrow\infty} P \left ( \left | \bar{X}_n - \mu \right |
\ge \epsilon \right ) = 0."/></p>
\ge \epsilon \right ) = 0." /></p>
</div></div>
<div class="section" id="central-limit-theorem">
<span id="id1"></span><h3>6.4.2. Central Limit Theorem<a class="headerlink" href="#central-limit-theorem" title="Permalink to this headline"></a></h3>
<p>The <a class="reference internal" href="#id1">central limit theorem</a> (CLT) is perhaps the most well-known and ubiquitous
<p>The <a class="reference external" href="#id1">central limit theorem</a> (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
@ -244,7 +241,7 @@ normal, log-normal, Weibull, etc. The central limit theorem states that as
\mu)"/> <a class="reference external" href="http://en.wikipedia.org/wiki/Convergence_of_random_variables#Convergence_in_distribution">converges in distribution</a> to the standard normal distribution:</p>
<div class="math" id="equation-central-limit-theorem">
<p><span class="eqno">(10)</span><img src="../_images/math/2869a05d52d095973e44b463f47d55eafcc70fa7.png" alt="\sqrt{n} \left ( \frac{1}{n} \sum_{i=1}^n X_i - \mu \right ) \xrightarrow{d}
\mathcal{N} (0, \sigma^2)"/></p>
\mathcal{N} (0, \sigma^2)" /></p>
</div></div>
<div class="section" id="estimating-statistics-of-a-random-variable">
<h3>6.4.3. Estimating Statistics of a Random Variable<a class="headerlink" href="#estimating-statistics-of-a-random-variable" title="Permalink to this headline"></a></h3>
@ -257,7 +254,7 @@ tallied. If <img class="math" src="../_images/math/6a47ca0fe7cb276abc022af6ac88d
<img class="math" src="../_images/math/aa142101c9e55be687db5ed934821fd144de6ac4.png" alt="x_1, x_2, \dots, x_N"/>, then an unbiased estimator for the population mean
is the sample mean, defined as</p>
<div class="math" id="equation-sample-mean">
<p><span class="eqno">(11)</span><img src="../_images/math/a375bac6a25dbabfdda5b25012ebb0648f18fed8.png" alt="\bar{x} = \frac{1}{N} \sum_{i=1}^N x_i."/></p>
<p><span class="eqno">(11)</span><img src="../_images/math/a375bac6a25dbabfdda5b25012ebb0648f18fed8.png" alt="\bar{x} = \frac{1}{N} \sum_{i=1}^N x_i." /></p>
</div></div>
<div class="section" id="variance">
<h4>6.4.3.2. Variance<a class="headerlink" href="#variance" title="Permalink to this headline"></a></h4>
@ -269,17 +266,17 @@ population variance. One of these is the second central moment of the
distribution also known as the biased sample variance:</p>
<div class="math" id="equation-biased-variance">
<p><span class="eqno">(12)</span><img src="../_images/math/c4e66f263a29337cbd2e5eb6510b34456dc79f72.png" alt="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."/></p>
\frac{1}{N} \sum_{i=1}^N x_i^2 \right ) - \bar{x}^2." /></p>
</div><p>This estimator is biased because its expected value is actually not equal to the
population variance:</p>
<div class="math" id="equation-biased-variance-expectation">
<p><span class="eqno">(13)</span><img src="../_images/math/457ebbdd58a1797c6a781adc38ba91884c2f568b.png" alt="E[s_N^2] = \frac{N - 1}{N} \sigma^2"/></p>
<p><span class="eqno">(13)</span><img src="../_images/math/457ebbdd58a1797c6a781adc38ba91884c2f568b.png" alt="E[s_N^2] = \frac{N - 1}{N} \sigma^2" /></p>
</div><p>where <img class="math" src="../_images/math/741fb9098efcb98055f467f87630a5d0ca599b6b.png" alt="\sigma^2"/> is the actual population variance. As a result, this
estimator should not be used in practice. Instead, one can use <a class="reference external" href="http://en.wikipedia.org/wiki/Bessel's_correction">Bessel&#8217;s
correction</a> to come up with an unbiased sample variance estimator:</p>
<div class="math" id="equation-unbiased-variance">
<p><span class="eqno">(14)</span><img src="../_images/math/888d03a43b4a11529ee58d8f91c4285100073191.png" alt="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 )."/></p>
\frac{1}{N - 1} \left ( \sum_{i=1}^N x_i^2 - N\bar{x}^2 \right )." /></p>
</div><p>This is the estimator normally used to calculate sample variance. The final form
in equation <a href="#equation-unbiased-variance">(14)</a> is especially suitable for computation since
we do not need to store the values at every realization of the random variable
@ -301,7 +298,7 @@ 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:</p>
<div class="math" id="equation-bienayme-formula">
<p><span class="eqno">(15)</span><img src="../_images/math/f0291a889cbdc42198c8566b4c98813a9cc5edec.png" alt="\text{Var} \left ( \sum_{i=1}^N X_i \right ) = \sum_{i=1}^N \text{Var} \left
( X_i \right )"/></p>
( X_i \right )" /></p>
</div><p>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,
@ -310,12 +307,12 @@ independently-distributed samples, then we have that</p>
<p><span class="eqno">(16)</span><img src="../_images/math/e7cc6034d7dabf98113bd86b88588c54c9d48249.png" alt="\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}."/></p>
\frac{\sigma^2}{N}." /></p>
</div><p>We can combine this result with equation <a href="#equation-unbiased-variance">(14)</a> to come up with
an unbiased estimator for the variance of the sample mean:</p>
<div class="math" id="equation-sample-variance-mean-formula">
<p><span class="eqno">(17)</span><img src="../_images/math/f07519008c3f2c717af15cd95f7acf81ec574563.png" alt="s_{\bar{X}}^2 = \frac{1}{N - 1} \left ( \frac{1}{N} \sum_{i=1}^N x_i^2 -
\bar{x}^2 \right )."/></p>
\bar{x}^2 \right )." /></p>
</div><p>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
@ -341,7 +338,7 @@ intervals would encompass the true population parameter. Let <img class="math" s
variables each with population mean <img class="math" src="../_images/math/2d8c833ed800824727cd7bd2fb9de1a12ad7e674.png" alt="\mu"/> and variance
<img class="math" src="../_images/math/741fb9098efcb98055f467f87630a5d0ca599b6b.png" alt="\sigma^2"/>. The t-statistic is defined as</p>
<div class="math" id="equation-t-statistic">
<p><span class="eqno">(18)</span><img src="../_images/math/7a8fa6d18fdddd436cd3c52612a3372897f7c5c0.png" alt="t = \frac{\bar{x} - \mu}{s/\sqrt{N}}"/></p>
<p><span class="eqno">(18)</span><img src="../_images/math/7a8fa6d18fdddd436cd3c52612a3372897f7c5c0.png" alt="t = \frac{\bar{x} - \mu}{s/\sqrt{N}}" /></p>
</div><p>where <img class="math" src="../_images/math/f06e84fe84a6c63a9c2c392af11652f6e0d72cf4.png" alt="\bar{x}"/> is the sample mean from equation <a href="#equation-sample-mean">(11)</a> and
<img class="math" src="../_images/math/f37bba504894945c07a32f5496d74299a37aa51c.png" alt="s"/> is the standard deviation based on equation
<a href="#equation-unbiased-variance">(14)</a>. If the random variables <img class="math" src="../_images/math/5f8e5cbb6204882df1cf17cfe4b308d485af8056.png" alt="X_i"/> are
@ -349,12 +346,12 @@ normally-distributed, then the t-statistic has a <a class="reference external" h
with <img class="math" src="../_images/math/a256c70ad4c46ec1127c5be68f8bb3075e9ced31.png" alt="N-1"/> degrees of freedom. This implies that</p>
<div class="math" id="equation-t-probability">
<p><span class="eqno">(19)</span><img src="../_images/math/4a210f77a1c79011bdc5ac4f2cac91a4c5a08959.png" alt="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"/></p>
t_{1 - \alpha/2, N - 1} \right ) = 1 - \alpha" /></p>
</div><p>where <img class="math" src="../_images/math/1bc7ce223ddb22edcd126ed8d841b796f2f337d9.png" alt="t_{1-\alpha/2, N-1}"/> is the <img class="math" src="../_images/math/f3f0133f5afb7e759a00024c929a5f273f316403.png" alt="1 - \alpha/2"/> percentile of a
t-distribution with <img class="math" src="../_images/math/a256c70ad4c46ec1127c5be68f8bb3075e9ced31.png" alt="N-1"/> degrees of freedom. Thus, the <img class="math" src="../_images/math/e63009dbf6176a47dc83a6c06dd5ce224d6e57d4.png" alt="1 - \alpha"/>
two sided confidence interval for the sample mean is</p>
<div class="math" id="equation-two-sided-ci">
<p><span class="eqno">(20)</span><img src="../_images/math/80bc7504239295d322d8606b71adc1190e09a896.png" alt="\bar{x} \pm t_{1 - \alpha/2, N-1} \frac{s}{\sqrt{N}}."/></p>
<p><span class="eqno">(20)</span><img src="../_images/math/80bc7504239295d322d8606b71adc1190e09a896.png" alt="\bar{x} \pm t_{1 - \alpha/2, N-1} \frac{s}{\sqrt{N}}." /></p>
</div><p>One should be cautioned that equation <a href="#equation-two-sided-ci">(20)</a> only applies if the
<em>underlying random variables</em> are normally-distributed. In general, this may not
be true for a tally random variable &#8212; the central limit theorem guarantees
@ -367,18 +364,18 @@ 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
<a class="reference external" href="http://en.wikipedia.org/wiki/Cauchy_distribution">Cauchy distribution</a> whose cumulative distribution function is</p>
<div class="math" id="equation-cauchy-cdf">
<p><span class="eqno">(21)</span><img src="../_images/math/436e8db97463066d1a7386a95b10ac520bbe8b3a.png" alt="c(x) = \frac{1}{\pi} \arctan x + \frac{1}{2}."/></p>
<p><span class="eqno">(21)</span><img src="../_images/math/436e8db97463066d1a7386a95b10ac520bbe8b3a.png" alt="c(x) = \frac{1}{\pi} \arctan x + \frac{1}{2}." /></p>
</div><p>Thus, inverting the cumulative distribution function, we find the <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/>
percentile of the standard Cauchy distribution to be</p>
<div class="math" id="equation-percentile-1">
<p><span class="eqno">(22)</span><img src="../_images/math/fa2f03813f247d34e237d7d4f70aad833a23ac36.png" alt="t_{x,1} = \tan \left ( \pi \left ( x - \frac{1}{2} \right ) \right )."/></p>
<p><span class="eqno">(22)</span><img src="../_images/math/fa2f03813f247d34e237d7d4f70aad833a23ac36.png" alt="t_{x,1} = \tan \left ( \pi \left ( x - \frac{1}{2} \right ) \right )." /></p>
</div><p>For two degrees of freedom, the cumulative distribution function is the
second-degree polynomial</p>
<div class="math" id="equation-t-2-polynomial">
<p><span class="eqno">(23)</span><img src="../_images/math/6951671d483dd1a00fdbf1c2a63f822d8a5dfb0f.png" alt="c(x) = \frac{1}{2} + \frac{x}{2\sqrt{x^2 + 2}}"/></p>
<p><span class="eqno">(23)</span><img src="../_images/math/6951671d483dd1a00fdbf1c2a63f822d8a5dfb0f.png" alt="c(x) = \frac{1}{2} + \frac{x}{2\sqrt{x^2 + 2}}" /></p>
</div><p>Solving for <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/>, we find the <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/> percentile to be</p>
<div class="math" id="equation-percentile-2">
<p><span class="eqno">(24)</span><img src="../_images/math/9bc6d41e157898a5956cd9c4ccf338dea7050d12.png" alt="t_{x,2} = \frac{2\sqrt{2} (x - 1/2)}{\sqrt{1 - 4 (x - 1/2)^2}}"/></p>
<p><span class="eqno">(24)</span><img src="../_images/math/9bc6d41e157898a5956cd9c4ccf338dea7050d12.png" alt="t_{x,2} = \frac{2\sqrt{2} (x - 1/2)}{\sqrt{1 - 4 (x - 1/2)^2}}" /></p>
</div><p>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
@ -388,7 +385,7 @@ found with high levels of accuracy. OpenMC uses the approximation from
<div class="math" id="equation-percentile-n">
<p><span class="eqno">(25)</span><img src="../_images/math/5ba93ef9c5f2963c0b31e884c59317c780965345.png" alt="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 )"/></p>
\frac{1}{384} \frac{3z_x^7 - 81z_x^5 + 417z_x^3 - 315z_x}{(n-2)^3} \right )" /></p>
</div><p>where <img class="math" src="../_images/math/13ec3386d628b5ca8d96ff83af9b240831084348.png" alt="z_x"/> is the <img class="math" src="../_images/math/26eeb5258ca5099acf8fe96b2a1049c48c89a5e6.png" alt="x"/> percentile of the standard normal
distribution. In order to determine an arbitrary percentile of the standard
normal distribution, we use an <a class="reference external" href="http://home.online.no/~pjacklam/notes/invnorm/">unpublished rational approximation</a>. After
@ -427,7 +424,7 @@ in Statistics - Simulation and Computation, 16 (4), pp. 1123-1132 (1987).</td></
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

Binary file not shown.

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Publications &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
@ -29,7 +26,7 @@
<script type="text/javascript" src="_static/theme_extras.js"></script>
<link rel="top" title="OpenMC Documentation" href="index.html" />
<link rel="next" title="License Agreement" href="license.html" />
<link rel="prev" title="5. State Point Binary File Specifications" href="devguide/statepoint.html" />
<link rel="prev" title="6. Voxel Plot Binary File Specifications" href="devguide/voxel.html" />
</head>
<body>
<div class="header">
@ -40,7 +37,7 @@
<div class="topnav">
<p>
«&#160;&#160;<a href="devguide/statepoint.html">5. State Point Binary File Specifications</a>
«&#160;&#160;<a href="devguide/voxel.html">6. Voxel Plot Binary File Specifications</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -75,7 +72,7 @@ Carlo Criticality Calculations,&#8221; <em>Nucl. Sci. Eng.</em>, <strong>170</st
<div class="bottomnav">
<p>
«&#160;&#160;<a href="devguide/statepoint.html">5. State Point Binary File Specifications</a>
«&#160;&#160;<a href="devguide/voxel.html">6. Voxel Plot Binary File Specifications</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -87,7 +84,7 @@ Carlo Criticality Calculations,&#8221; <em>Nucl. Sci. Eng.</em>, <strong>170</st
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Quick Install Guide &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
@ -103,7 +100,7 @@ sudo make install
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Release Notes &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -85,7 +82,7 @@ bugs fixed, and known issues for each successive release.</p>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Release Notes for OpenMC 0.4.0 &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -102,7 +99,7 @@ can now be successfully run in OpenMC.</li>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Release Notes for OpenMC 0.4.1 &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -114,7 +111,7 @@ the source bank to be of type Bank rather than of type Particle.</li>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Release Notes for OpenMC 0.4.2 &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -111,7 +108,7 @@ nuclide on the material.</li>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Release Notes for OpenMC 0.4.3 &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -108,7 +105,7 @@ the problem at hand (mostly on the number of nuclides in the problem).</p>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Release Notes for OpenMC 0.4.4 &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -105,7 +102,7 @@ to turn them on with &lt;output&gt; tag in settings.xml file.</li>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Release Notes for OpenMC 0.5.0 &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -108,7 +105,7 @@ tangent to a surface.</li>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Release Notes for OpenMC 0.5.1 &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -105,7 +102,7 @@ the problem at hand (mostly on the number of nuclides in the problem).</p>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
@ -87,7 +84,7 @@
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

File diff suppressed because one or more lines are too long

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>1. A Beginners Guide to OpenMC &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -142,7 +139,8 @@ familiar with. Whether you plan on working in Linux, Mac OS X, or Windows, you
should be comfortable working in a command line environment. There are many
resources online for learning command line environments. If you are using Linux
or Mac OS X (also Unix-derived), <a class="reference external" href="http://www.ee.surrey.ac.uk/Teaching/Unix/">this tutorial</a> will help you get acquainted with
commonly-used commands.</p>
commonly-used commands. It is also helpful to be familiar with <a class="reference external" href="http://www.python.org/">Python</a>, as most of the post-processing utilities provided
with OpenMC rely on it for data manipulation and results visualization.</p>
<p>OpenMC uses a version control software called <a class="reference external" href="http://git-scm.com/">git</a> to keep track of changes to
the code, document bugs and issues, and other development tasks. While you don&#8217;t
necessarily have to have git installed in order to download and run OpenMC, it
@ -186,7 +184,7 @@ and <a class="reference external" href="http://www.hss.doe.gov/nuclearsafety/tec
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Users Guide &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -145,21 +142,36 @@ essential aspects of using OpenMC to perform neutronic simulations.</p>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="troubleshoot.html">4. Troubleshooting</a><ul>
<li class="toctree-l2"><a class="reference internal" href="troubleshoot.html#problems-with-compilation">4.1. Problems with Compilation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#undefined-reference-to-vtab">4.1.1. undefined reference to `_vtab$...</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#fatal-error-wrong-module-version-4-expected-9-for-file-xml-data-cmfd-t-mod-opened-at-1">4.1.2. Fatal Error: Wrong module version &#8216;4&#8217; (expected &#8216;9&#8217;) for file &#8216;xml_data_cmfd_t.mod&#8217; opened at (1)</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#fatal-error-file-xml-data-cmfd-t-mod-opened-at-1-is-not-a-gfortran-module-file">4.1.3. Fatal Error: File &#8216;xml_data_cmfd_t.mod&#8217; opened at (1) is not a GFORTRAN module file</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#gfortran-unrecognized-option-cpp">4.1.4. gfortran: unrecognized option &#8216;-cpp&#8217;</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#f951-error-unrecognized-command-line-option-fbacktrace">4.1.5. f951: error: unrecognized command line option &#8220;-fbacktrace&#8221;</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#make-1-ifort-command-not-found">4.1.6. make[1]: ifort: Command not found</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#make-1-pgf90-command-not-found">4.1.7. make[1]: pgf90: Command not found</a></li>
<li class="toctree-l1"><a class="reference internal" href="processing.html">4. Data Processing and Visualization</a><ul>
<li class="toctree-l2"><a class="reference internal" href="processing.html#geometry-visualization">4.1. Geometry Visualization</a><ul>
<li class="toctree-l3"><a class="reference internal" href="processing.html#plotting-in-2d">4.1.1. Plotting in 2D</a></li>
<li class="toctree-l3"><a class="reference internal" href="processing.html#plotting-in-3d">4.1.2. Plotting in 3D</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="troubleshoot.html#problems-with-simulations">4.2. Problems with Simulations</a><ul>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#segmentation-fault">4.2.1. Segmentation Fault</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#error-no-cross-sections-xml-file-was-specified-in-settings-xml-or-in-the-cross-sections-environment-variable">4.2.2. ERROR: No cross_sections.xml file was specified in settings.xml or in the CROSS_SECTIONS environment variable.</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#error-after-particle-crossed-surface-it-could-not-be-located-in-any-cell-and-it-did-not-leak">4.2.3. ERROR: After particle __ crossed surface __ it could not be located in any cell and it did not leak.</a></li>
<li class="toctree-l2"><a class="reference internal" href="processing.html#tally-visualization">4.2. Tally Visualization</a><ul>
<li class="toctree-l3"><a class="reference internal" href="processing.html#data-extraction">4.2.1. Data Extraction</a></li>
<li class="toctree-l3"><a class="reference internal" href="processing.html#id14">4.2.2. Plotting in 2D</a></li>
<li class="toctree-l3"><a class="reference internal" href="processing.html#id16">4.2.3. Plotting in 3D</a></li>
<li class="toctree-l3"><a class="reference internal" href="processing.html#getting-data-into-matlab">4.2.4. Getting Data into MATLAB</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="troubleshoot.html">5. Troubleshooting</a><ul>
<li class="toctree-l2"><a class="reference internal" href="troubleshoot.html#problems-with-compilation">5.1. Problems with Compilation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#undefined-reference-to-vtab">5.1.1. undefined reference to `_vtab$...</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#fatal-error-wrong-module-version-4-expected-9-for-file-xml-data-cmfd-t-mod-opened-at-1">5.1.2. Fatal Error: Wrong module version &#8216;4&#8217; (expected &#8216;9&#8217;) for file &#8216;xml_data_cmfd_t.mod&#8217; opened at (1)</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#fatal-error-file-xml-data-cmfd-t-mod-opened-at-1-is-not-a-gfortran-module-file">5.1.3. Fatal Error: File &#8216;xml_data_cmfd_t.mod&#8217; opened at (1) is not a GFORTRAN module file</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#gfortran-unrecognized-option-cpp">5.1.4. gfortran: unrecognized option &#8216;-cpp&#8217;</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#f951-error-unrecognized-command-line-option-fbacktrace">5.1.5. f951: error: unrecognized command line option &#8220;-fbacktrace&#8221;</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#make-1-ifort-command-not-found">5.1.6. make[1]: ifort: Command not found</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#make-1-pgf90-command-not-found">5.1.7. make[1]: pgf90: Command not found</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="troubleshoot.html#problems-with-simulations">5.2. Problems with Simulations</a><ul>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#segmentation-fault">5.2.1. Segmentation Fault</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#error-no-cross-sections-xml-file-was-specified-in-settings-xml-or-in-the-cross-sections-environment-variable">5.2.2. ERROR: No cross_sections.xml file was specified in settings.xml or in the CROSS_SECTIONS environment variable.</a></li>
<li class="toctree-l3"><a class="reference internal" href="troubleshoot.html#error-after-particle-crossed-surface-it-could-not-be-located-in-any-cell-and-it-did-not-leak">5.2.3. ERROR: After particle __ crossed surface __ it could not be located in any cell and it did not leak.</a></li>
</ul>
</li>
</ul>
@ -185,7 +197,7 @@ essential aspects of using OpenMC to perform neutronic simulations.</p>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

File diff suppressed because it is too large Load diff

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>2. Installation and Configuration &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -75,7 +72,7 @@ package manager. First, add the following PPA to the repository sources:</p>
<h2>2.2. Building from Source<a class="headerlink" href="#building-from-source" title="Permalink to this headline"></a></h2>
<div class="section" id="prerequisites">
<h3>2.2.1. Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline"></a></h3>
<div class="admonition-required admonition">
<div class="admonition-required admonition ">
<p class="first admonition-title">Required</p>
<ul class="last">
<li><p class="first">A Fortran compiler such as <a class="reference external" href="http://gcc.gnu.org/wiki/GFortran">gfortran</a></p>
@ -91,7 +88,7 @@ install the gfortran compiler using the following command:</p>
</li>
</ul>
</div>
<div class="admonition-optional admonition">
<div class="admonition-optional admonition ">
<p class="first admonition-title">Optional</p>
<ul class="last">
<li><p class="first">An MPI implementation for distributed-memory parallel runs</p>
@ -349,7 +346,7 @@ schemas.xml file in your own OpenMC source directory.</p>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">

413
usersguide/processing.html Normal file
View file

@ -0,0 +1,413 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>4. Data Processing and Visualization &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.5.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/theme_extras.js"></script>
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="up" title="Users Guide" href="index.html" />
<link rel="next" title="5. Troubleshooting" href="troubleshoot.html" />
<link rel="prev" title="3. Writing XML Input Files" href="input.html" />
</head>
<body>
<div class="header">
<a href="../index.html">
<img class="logo" src="../_static/openmc.png" alt="Logo"/>
</a>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="input.html">3. Writing XML Input Files</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="troubleshoot.html">5. Troubleshooting</a>&#160;&#160;»
</p>
</div>
<div class="content">
<div class="section" id="data-processing-and-visualization">
<span id="usersguide-processing"></span><h1>4. Data Processing and Visualization<a class="headerlink" href="#data-processing-and-visualization" title="Permalink to this headline"></a></h1>
<p>This section is intended to explain in detail the recommended procedures for
carrying out common tasks with OpenMC. While several utilities of varying
complexity are provided to help automate the process, in many cases it will be
extremely beneficial to do some coding in Python to quickly obtain results. In
these cases, and for many of the provided utilities, it is necessary for your
Python installation to contain:</p>
<ul class="simple">
<li><a class="footnote-reference" href="#id8" id="id1">[1]</a> <a class="reference external" href="http://www.numpy.org/">Numpy</a></li>
<li><a class="footnote-reference" href="#id8" id="id2">[1]</a> <a class="reference external" href="http://www.scipy.org/">Scipy</a></li>
<li><a class="footnote-reference" href="#id9" id="id3">[2]</a> <a class="reference external" href="http://code.google.com/p/h5py/">h5py</a></li>
<li><a class="footnote-reference" href="#id10" id="id4">[3]</a> <a class="reference external" href="http://matplotlib.org/">Matplotlib</a></li>
<li><a class="footnote-reference" href="#id10" id="id5">[3]</a> <a class="reference external" href="https://github.com/nhorelik/silomesh">Silomesh</a></li>
<li><a class="footnote-reference" href="#id10" id="id6">[3]</a> <a class="reference external" href="http://www.vtk.org/">VTK</a></li>
<li><a class="footnote-reference" href="#id11" id="id7">[4]</a> <a class="reference external" href="http://www.riverbankcomputing.com/software/pyqt">PyQt</a></li>
</ul>
<p>Most of these are easily obtainable in Ubuntu through the package manager, or
are easily installed with setuptools.</p>
<table class="docutils footnote" frame="void" id="id8" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id2">2</a>)</em> Required for tally data extraction from statepoints with statepoint.py</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id9" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id3">[2]</a></td><td>Required only if reading HDF5 statepoint files.</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id10" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[3]</td><td><em>(<a class="fn-backref" href="#id4">1</a>, <a class="fn-backref" href="#id5">2</a>, <a class="fn-backref" href="#id6">3</a>)</em> Optional for plotting utilities</td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id11" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id7">[4]</a></td><td>Optional for interactive GUIs</td></tr>
</tbody>
</table>
<div class="section" id="geometry-visualization">
<h2>4.1. Geometry Visualization<a class="headerlink" href="#geometry-visualization" title="Permalink to this headline"></a></h2>
<p>Geometry plotting is carried out by creating a plots.xml, specifying plots, and
running OpenMC with the -plot or -p command-line option (See
<a class="reference internal" href="input.html#usersguide-plotting"><em>Geometry Plotting Specification &#8211; plots.xml</em></a>).</p>
<div class="section" id="plotting-in-2d">
<h3>4.1.1. Plotting in 2D<a class="headerlink" href="#plotting-in-2d" title="Permalink to this headline"></a></h3>
<img alt="../_images/atr.png" src="../_images/atr.png" style="height: 200px;" />
<p>After running OpenMC to obtain PPM files, images should be saved to another
format before using them elsewhere. This cuts down the size of the file by
orders of magnitude. Most image viewers and editors that can view PPM images
can also save to other formats (e.g. <a class="reference external" href="http://www.gimp.org/">Gimp</a>, <a class="reference external" href="http://www.irfanview.com/">IrfanView</a>, etc.). However, more likey the user will want to
convert to another format on the command line. This is easily accomplished with
the <tt class="docutils literal"><span class="pre">convert</span></tt> command available on most linux distributions as part of the
<a class="reference external" href="http://www.imagemagick.org/script/convert.php">ImageMagick</a> package. (On
Ubuntu: <tt class="docutils literal"><span class="pre">sudo</span> <span class="pre">apt-get</span> <span class="pre">install</span> <span class="pre">imagemagick</span></tt>). Images are then converted like:</p>
<div class="highlight-sh"><div class="highlight"><pre>convert plot.ppm plot.png
</pre></div>
</div>
</div>
<div class="section" id="plotting-in-3d">
<h3>4.1.2. Plotting in 3D<a class="headerlink" href="#plotting-in-3d" title="Permalink to this headline"></a></h3>
<img alt="../_images/3dgeomplot.png" src="../_images/3dgeomplot.png" style="height: 200px;" />
<p>The binary VOXEL files output by OpenMC can not be viewed directly by any
existing viewers. In order to view them, they must be converted into a standard
mesh format that can be viewed in ParaView, Visit, etc. The provided utility
voxel.py accomplishes this for SILO:</p>
<div class="highlight-sh"><div class="highlight"><pre>&lt;openmc_root&gt;/src/utils/voxel.py myplot.voxel -o output.silo
</pre></div>
</div>
<p>and VTK file formats:</p>
<div class="highlight-sh"><div class="highlight"><pre>&lt;openmc_root&gt;/src/utils/myplot.voxel --vtk -o output.vti
</pre></div>
</div>
<p>To use this utility you need either</p>
<ul class="simple">
<li><a class="reference external" href="https://github.com/nhorelik/silomesh">Silomesh</a></li>
</ul>
<p>or</p>
<ul class="simple">
<li><a class="reference external" href="http://www.vtk.org/">VTK</a> with python bindings - On Ubuntu, these are easily obtained with <tt class="docutils literal"><span class="pre">sudo</span> <span class="pre">apt-get</span> <span class="pre">install</span> <span class="pre">python-vtk</span></tt></li>
</ul>
<p>Users can process the binary into any other format if desired by following the
example of voxel.py. For the binary file structure, see <a class="reference internal" href="../devguide/voxel.html#devguide-voxel"><em>Voxel Plot Binary File Specifications</em></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">3D voxel plotting can be very computer intensive for the viewing
program (Visit, Paraview, etc.) if the number of voxels is large
(&gt;10million or so). Thus if you want an accurate picture that
renders smoothly, consider using only one voxel in a certain
direction. For instance, the 3D pin lattice figure above was generated
with a 500x500x1 voxel mesh, which allows for resolution of the
cylinders without wasting too many voxels on the axial dimension.</p>
</div>
</div>
</div>
<div class="section" id="tally-visualization">
<h2>4.2. Tally Visualization<a class="headerlink" href="#tally-visualization" title="Permalink to this headline"></a></h2>
<p>Tally results are saved in both a text file (tallies.out) as well as a binary
statepoint file. While the tallies.out file may be fine for simple tallies, in
many cases the user requires more information about the tally or the run, or
has to deal with a large number of result values (e.g. for mesh tallies). In
these cases, extracting data from the statepoint file via Python scripting is
the preferred method of data analysis and visualization.</p>
<div class="section" id="data-extraction">
<h3>4.2.1. Data Extraction<a class="headerlink" href="#data-extraction" title="Permalink to this headline"></a></h3>
<p>A great deal of information is available in statepoint files (See
<a class="reference internal" href="../devguide/statepoint.html#devguide-statepoint"><em>State Point Binary File Specifications</em></a>), most of which is easily extracted by the provided
utility statepoint.py. This utility provides a Python class to load statepoints
and extract data - it is used in many of the provided plotting utilities, and
can be used in user-created scripts to carry out manipulations of the data. To
read tallies using this utility, make sure statepoint.py is in your PYTHONPATH,
and then import the class, instantiate it, and call read_results:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">statepoint</span> <span class="kn">import</span> <span class="n">StatePoint</span>
<span class="n">sp</span> <span class="o">=</span> <span class="n">StatePoint</span><span class="p">(</span><span class="s">&#39;statepoint.100.binary&#39;</span><span class="p">)</span>
<span class="n">sp</span><span class="o">.</span><span class="n">read_results</span><span class="p">()</span>
</pre></div>
</div>
<p>At this point the user can extract entire scores from tallies into a data
dictionary containing numpy arrays:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">tallyid</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">score</span> <span class="o">=</span> <span class="s">&#39;flux&#39;</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">sp</span><span class="o">.</span><span class="n">extract_results</span><span class="p">(</span><span class="n">tallyid</span><span class="p">,</span> <span class="n">score</span><span class="p">)</span>
<span class="n">means</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="s">&#39;means&#39;</span><span class="p">]</span>
<span class="k">print</span> <span class="n">data</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
</pre></div>
</div>
<p>The results from this function contain all filter bins (all mesh points, all
energy groups, etc.), which can be reshaped with the bin ordering also contained
in the output dictionary. This is the best choice of output for easily
integrating ranges of data.</p>
<p>Alternatively the user can extract specific values for a single score/filter
combination:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">tallyid</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">score</span> <span class="o">=</span> <span class="s">&#39;flux&#39;</span>
<span class="n">filters</span> <span class="o">=</span> <span class="p">[(</span><span class="s">&#39;mesh&#39;</span><span class="p">,</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">)),</span> <span class="p">(</span><span class="s">&#39;energyin&#39;</span><span class="p">,</span> <span class="mi">0</span><span class="p">)]</span>
<span class="n">value</span><span class="p">,</span> <span class="n">error</span> <span class="o">=</span> <span class="n">sp</span><span class="o">.</span><span class="n">get_value</span><span class="p">(</span><span class="n">tallyid</span><span class="p">,</span> <span class="n">filters</span><span class="p">,</span> <span class="n">score</span><span class="p">)</span>
</pre></div>
</div>
<p>In the future more documentaion may become available here for statepoint.py and
the data extraction functions of StatePoint objects. However, for now it is up
to the user to explore the classes in statepoint.py to discover what data is
available in StatePoint objects (we highly recommend interactively exploring
with <a class="reference external" href="http://ipython.org/">IPython</a>). Many exmaples can be found by looking
through the other utilies that use statepoint.py, and a few common visualization
tasks will be described here in the following sections.</p>
</div>
<div class="section" id="id14">
<h3>4.2.2. Plotting in 2D<a class="headerlink" href="#id14" title="Permalink to this headline"></a></h3>
<img alt="../_images/plotmeshtally.png" src="../_images/plotmeshtally.png" style="height: 200px;" />
<p>For simple viewing of 2D slices of a mesh plot, the utility plot_mesh_tally.py
is provided. This utility provides an interactive GUI to explore and plot
mesh tallies for any scores and filter bins. It requires statepoint.py, as well
as <a class="reference external" href="http://www.riverbankcomputing.com/software/pyqt">PyQt</a>.</p>
<img alt="../_images/fluxplot.png" src="../_images/fluxplot.png" style="height: 200px;" />
<p>Alternatively, the user can write their own Python script to manipulate the data
appropriately. Consider a run where the first tally contains a 105x105x1 mesh
over a small core, with a flux score and two energyin filter bins. To explicitly
extract the data and create a plot with gnuplot, the following script can be
used. The script operates in several steps for clarity, and is not necessarily
the most efficient way to extract data from large mesh tallies. This creates the
two heatmaps in the previous figure.</p>
<div class="highlight-python"><pre> #!/usr/bin/env python
import os
import statepoint
# load and parse the statepoint file
sp = statepoint.StatePoint('statepoint.300.binary')
sp.read_results()
tallyid = 0 # This is tally 1
score = 0 # This corresponds to flux (see tally.scores)
# get mesh dimensions
meshid = sp.tallies[tallyid].filters['mesh'].bins[0]
for i,m in enumerate(sp.meshes):
if m.id == meshid:
mesh = m
break
nx,ny,nz = mesh.dimension
# loop through mesh and extract values to python dictionaries
thermal = {}
fast = {}
for x in range(1,nx+1):
for y in range(1,ny+1):
for z in range(1,nz+1):
val,err = sp.get_value(tallyid,
[('mesh',(x,y,z)),('energyin',0)],
score)
thermal[(x,y,z)] = val
val,err = sp.get_value(tallyid,
[('mesh',(x,y,z)),('energyin',1)],
score)
fast[(x,y,z)] = val
# sum up the axial values and write datafile for gnuplot
with open('meshdata.dat','w') as fh:
for x in range(1,nx+1):
for y in range(1,ny+1):
thermalval = 0.
fastval = 0.
for z in range(1,nz+1):
thermalval += thermal[(x,y,z)]
fastval += fast[(x,y,z)]
fh.write("{} {} {} {}\n".format(x,y,thermalval,fastval))
# write gnuplot file
with open('tmp.gnuplot','w') as fh:
fh.write(r"""set terminal png size 1000 400
set output 'fluxplot.png'
set nokey
set autoscale fix
set multiplot layout 1,2 title "Pin Mesh Flux Tally"
set title "Thermal"
plot 'meshdata.dat' using 1:2:3 with image
set title "Fast"
plot 'meshdata.dat' using 1:2:4 with image
""")
# make plot
os.system("gnuplot &lt; tmp.gnuplot")</pre>
</div>
</div>
<div class="section" id="id16">
<h3>4.2.3. Plotting in 3D<a class="headerlink" href="#id16" title="Permalink to this headline"></a></h3>
<img alt="../_images/3dcore.png" src="../_images/3dcore.png" style="height: 200px;" />
<p>As with 3D plots of the geometry, meshtally data needs to be put into a standard
format for viewing. The utility statepoint_3d.py is provided to accomplish this
for both VTK and SILO. By default statepoint_3d.py processes a statepoint into a
3D file with all mesh tallies and filter/score combinations,</p>
<div class="highlight-sh"><div class="highlight"><pre>&lt;openmc_root&gt;/src/utils/statepoint_3d.py &lt;statepoint_file&gt; -o output.silo
&lt;openmc_root&gt;/src/utils/statepoint_3d.py &lt;statepoint_file&gt; --vtk -o output.vtm
</pre></div>
</div>
<p>but it also provides several command-line options to selectively process only
certain data arrays in order to keep file sizes down.</p>
<div class="highlight-sh"><div class="highlight"><pre>&lt;openmc_root&gt;/src/utils/statepoint_3d.py &lt;statepoint_file&gt; -tallies 2,4 --scores 4.1,4.3 -o output.silo
&lt;openmc_root&gt;/src/utils/statepoint_3d.py &lt;statepoint_file&gt; -filters 2.energyin.1 --vtk -o output.vtm
</pre></div>
</div>
<p>All available options for specifying a subset of tallies, scores, and filters
can be listed with the <tt class="docutils literal"><span class="pre">--list</span></tt> or <tt class="docutils literal"><span class="pre">-l</span></tt> command line options.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Note that while SILO files can contain multiple meshes in one file,
VTK needs to use a multi-block dataset, which stores each mesh piece
in a different file in a subfolder. All meshes can be loaded at once
with the main VTM file, or each VTI file in the subfolder can be
loaded individually.</p>
</div>
<p>Alternatively, the user can write their own Python script to manipulate the data
appropriately before insertion into a SILO or VTK file. For instance, if the
data has been extracted as was done in the 2D plotting example script above, a
SILO file can be created with:</p>
<div class="highlight-python"><pre>import silomesh as sm
sm.init_silo("fluxtally.silo")
sm.init_mesh('tally_mesh',*mesh.dimension, *mesh.lower_left, *mesh.width)
sm.init_var('flux_tally_thermal')
for x in range(1,nx+1):
for y in range(1,ny+1):
for z in range(1,nz+1):
sm.set_value(float(thermal[(x,y,z)]),x,y,z)
sm.finalize_var()
sm.init_var('flux_tally_fast')
for x in range(1,nx+1):
for y in range(1,ny+1):
for z in range(1,nz+1):
sm.set_value(float(fast[(x,y,z)]),x,y,z)
sm.finalize_var()
sm.finalize_mesh()
sm.finalize_silo()</pre>
</div>
<p>and the equivalent VTK file with:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">vtk</span>
<span class="n">grid</span> <span class="o">=</span> <span class="n">vtk</span><span class="o">.</span><span class="n">vtkImageData</span><span class="p">()</span>
<span class="n">grid</span><span class="o">.</span><span class="n">SetDimensions</span><span class="p">(</span><span class="n">nx</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span><span class="n">ny</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span><span class="n">nz</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
<span class="n">grid</span><span class="o">.</span><span class="n">SetOrigin</span><span class="p">(</span><span class="o">*</span><span class="n">mesh</span><span class="o">.</span><span class="n">lower_left</span><span class="p">)</span>
<span class="n">grid</span><span class="o">.</span><span class="n">SetSpacing</span><span class="p">(</span><span class="o">*</span><span class="n">mesh</span><span class="o">.</span><span class="n">width</span><span class="p">)</span>
<span class="c"># vtk cell arrays have x on the inners, so we need to reorder the data</span>
<span class="n">idata</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nx</span><span class="p">):</span>
<span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">ny</span><span class="p">):</span>
<span class="k">for</span> <span class="n">z</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nz</span><span class="p">):</span>
<span class="n">i</span> <span class="o">=</span> <span class="n">z</span><span class="o">*</span><span class="n">nx</span><span class="o">*</span><span class="n">ny</span> <span class="o">+</span> <span class="n">y</span><span class="o">*</span><span class="n">nx</span> <span class="o">+</span> <span class="n">x</span>
<span class="n">idata</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="p">,</span><span class="n">z</span><span class="p">)</span>
<span class="n">vtkfastdata</span> <span class="o">=</span> <span class="n">vtk</span><span class="o">.</span><span class="n">vtkDoubleArray</span><span class="p">()</span>
<span class="n">vtkfastdata</span><span class="o">.</span><span class="n">SetName</span><span class="p">(</span><span class="s">&quot;fast&quot;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nx</span><span class="o">*</span><span class="n">ny</span><span class="o">*</span><span class="n">nz</span><span class="p">):</span>
<span class="n">vtkfastdata</span><span class="o">.</span><span class="n">InsertNextValue</span><span class="p">(</span><span class="n">fast</span><span class="p">[</span><span class="n">idata</span><span class="p">[</span><span class="n">i</span><span class="p">]])</span>
<span class="n">vtkthermaldata</span> <span class="o">=</span> <span class="n">vtk</span><span class="o">.</span><span class="n">vtkDoubleArray</span><span class="p">()</span>
<span class="n">vtkthermaldata</span><span class="o">.</span><span class="n">SetName</span><span class="p">(</span><span class="s">&quot;thermal&quot;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nx</span><span class="o">*</span><span class="n">ny</span><span class="o">*</span><span class="n">nz</span><span class="p">):</span>
<span class="n">vtkthermaldata</span><span class="o">.</span><span class="n">InsertNextValue</span><span class="p">(</span><span class="n">thermal</span><span class="p">[</span><span class="n">idata</span><span class="p">[</span><span class="n">i</span><span class="p">]])</span>
<span class="n">grid</span><span class="o">.</span><span class="n">GetCellData</span><span class="p">()</span><span class="o">.</span><span class="n">AddArray</span><span class="p">(</span><span class="n">vtkfastdata</span><span class="p">)</span>
<span class="n">grid</span><span class="o">.</span><span class="n">GetCellData</span><span class="p">()</span><span class="o">.</span><span class="n">AddArray</span><span class="p">(</span><span class="n">vtkthermaldata</span><span class="p">)</span>
<span class="n">writer</span> <span class="o">=</span> <span class="n">vtk</span><span class="o">.</span><span class="n">vtkXMLImageDataWriter</span><span class="p">()</span>
<span class="n">writer</span><span class="o">.</span><span class="n">SetInput</span><span class="p">(</span><span class="n">grid</span><span class="p">)</span>
<span class="n">writer</span><span class="o">.</span><span class="n">SetFileName</span><span class="p">(</span><span class="s">&#39;tally.vti&#39;</span><span class="p">)</span>
<span class="n">writer</span><span class="o">.</span><span class="n">Write</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="section" id="getting-data-into-matlab">
<h3>4.2.4. Getting Data into MATLAB<a class="headerlink" href="#getting-data-into-matlab" title="Permalink to this headline"></a></h3>
<p>There is currently no front-end utility to dump tally data to MATLAB files, but
the process is straightforward. First extract the data using a custom Python
script with statepoint.py, put the data into appropriately-shaped numpy arrays,
and then use the <a class="reference external" href="http://docs.scipy.org/doc/scipy/reference/tutorial/io.html">Scipy MATLAB IO routines</a> to save to a MAT
file. Note that the data contained in the output from
<tt class="docutils literal"><span class="pre">StatePoint.extract_result</span></tt> is already in a Numpy array that can be reshaped
and dumped to MATLAB in one step.</p>
</div>
</div>
</div>
</div>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="input.html">3. Writing XML Input Files</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="troubleshoot.html">5. Troubleshooting</a>&#160;&#160;»
</p>
</div>
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30411614-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>

View file

@ -3,17 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>4. Troubleshooting &mdash; OpenMC Documentation</title>
<title>5. Troubleshooting &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/print.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
@ -30,7 +27,7 @@
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="up" title="Users Guide" href="index.html" />
<link rel="next" title="Developers Guide" href="../devguide/index.html" />
<link rel="prev" title="3. Writing XML Input Files" href="input.html" />
<link rel="prev" title="4. Data Processing and Visualization" href="processing.html" />
</head>
<body>
<div class="header">
@ -41,7 +38,7 @@
<div class="topnav">
<p>
«&#160;&#160;<a href="input.html">3. Writing XML Input Files</a>
«&#160;&#160;<a href="processing.html">4. Data Processing and Visualization</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -53,20 +50,20 @@
<div class="section" id="troubleshooting">
<span id="usersguide-troubleshoot"></span><h1>4. Troubleshooting<a class="headerlink" href="#troubleshooting" title="Permalink to this headline"></a></h1>
<span id="usersguide-troubleshoot"></span><h1>5. Troubleshooting<a class="headerlink" href="#troubleshooting" title="Permalink to this headline"></a></h1>
<div class="section" id="problems-with-compilation">
<h2>4.1. Problems with Compilation<a class="headerlink" href="#problems-with-compilation" title="Permalink to this headline"></a></h2>
<h2>5.1. Problems with Compilation<a class="headerlink" href="#problems-with-compilation" title="Permalink to this headline"></a></h2>
<p>If you are experiencing problems trying to compile OpenMC, first check if the
error you are receiving is among the following options.</p>
<div class="section" id="undefined-reference-to-vtab">
<h3>4.1.1. undefined reference to `_vtab$...<a class="headerlink" href="#undefined-reference-to-vtab" title="Permalink to this headline"></a></h3>
<h3>5.1.1. undefined reference to `_vtab$...<a class="headerlink" href="#undefined-reference-to-vtab" title="Permalink to this headline"></a></h3>
<p>If you see this message when trying to compile, the most likely cause is that
you are using a compiler that does not support type-bound procedures from
Fortran 2003. This affects any version of gfortran prior to 4.6. Downloading and
installing the latest <a class="reference external" href="http://gcc.gnu.org/wiki/GFortran">gfortran</a> compiler should resolve this problem.</p>
</div>
<div class="section" id="fatal-error-wrong-module-version-4-expected-9-for-file-xml-data-cmfd-t-mod-opened-at-1">
<h3>4.1.2. Fatal Error: Wrong module version &#8216;4&#8217; (expected &#8216;9&#8217;) for file &#8216;xml_data_cmfd_t.mod&#8217; opened at (1)<a class="headerlink" href="#fatal-error-wrong-module-version-4-expected-9-for-file-xml-data-cmfd-t-mod-opened-at-1" title="Permalink to this headline"></a></h3>
<h3>5.1.2. Fatal Error: Wrong module version &#8216;4&#8217; (expected &#8216;9&#8217;) for file &#8216;xml_data_cmfd_t.mod&#8217; opened at (1)<a class="headerlink" href="#fatal-error-wrong-module-version-4-expected-9-for-file-xml-data-cmfd-t-mod-opened-at-1" title="Permalink to this headline"></a></h3>
<p>The <cite>.mod</cite> modules files that are created by gfortran are versioned and
sometimes are usually not backwards compatible. If gfortran is upgraded and the
modules files for xml-fortran source files are not deleted, this error may
@ -74,7 +71,7 @@ occur. To fix this, clear out all module and object files with <strong class="pr
distclean</strong> and then recompiling.</p>
</div>
<div class="section" id="fatal-error-file-xml-data-cmfd-t-mod-opened-at-1-is-not-a-gfortran-module-file">
<h3>4.1.3. Fatal Error: File &#8216;xml_data_cmfd_t.mod&#8217; opened at (1) is not a GFORTRAN module file<a class="headerlink" href="#fatal-error-file-xml-data-cmfd-t-mod-opened-at-1-is-not-a-gfortran-module-file" title="Permalink to this headline"></a></h3>
<h3>5.1.3. Fatal Error: File &#8216;xml_data_cmfd_t.mod&#8217; opened at (1) is not a GFORTRAN module file<a class="headerlink" href="#fatal-error-file-xml-data-cmfd-t-mod-opened-at-1-is-not-a-gfortran-module-file" title="Permalink to this headline"></a></h3>
<p>When OpenMC compiles, the first thing it needs to do is compile source in the
xml-fortran subdirectory. If you compiled everything with a compiler other than
gfortran, performed a <strong class="program">make clean</strong>, and then tried to <strong class="program">make</strong>
@ -83,32 +80,32 @@ compiler. To fix this, try clearing out all module and object files with
<strong class="program">make distclean</strong> and then recompiling.</p>
</div>
<div class="section" id="gfortran-unrecognized-option-cpp">
<h3>4.1.4. gfortran: unrecognized option &#8216;-cpp&#8217;<a class="headerlink" href="#gfortran-unrecognized-option-cpp" title="Permalink to this headline"></a></h3>
<h3>5.1.4. gfortran: unrecognized option &#8216;-cpp&#8217;<a class="headerlink" href="#gfortran-unrecognized-option-cpp" title="Permalink to this headline"></a></h3>
<p>You are probably using a version of the gfortran compiler that is too
old. Download and install the latest version of <a class="reference external" href="http://gcc.gnu.org/wiki/GFortran">gfortran</a>.</p>
</div>
<div class="section" id="f951-error-unrecognized-command-line-option-fbacktrace">
<h3>4.1.5. f951: error: unrecognized command line option &#8220;-fbacktrace&#8221;<a class="headerlink" href="#f951-error-unrecognized-command-line-option-fbacktrace" title="Permalink to this headline"></a></h3>
<h3>5.1.5. f951: error: unrecognized command line option &#8220;-fbacktrace&#8221;<a class="headerlink" href="#f951-error-unrecognized-command-line-option-fbacktrace" title="Permalink to this headline"></a></h3>
<p>You are probably using a version of the gfortran compiler that is too
old. Download and install the latest version of <a class="reference external" href="http://gcc.gnu.org/wiki/GFortran">gfortran</a>.</p>
</div>
<div class="section" id="make-1-ifort-command-not-found">
<h3>4.1.6. make[1]: ifort: Command not found<a class="headerlink" href="#make-1-ifort-command-not-found" title="Permalink to this headline"></a></h3>
<h3>5.1.6. make[1]: ifort: Command not found<a class="headerlink" href="#make-1-ifort-command-not-found" title="Permalink to this headline"></a></h3>
<p>You tried compiling with the Intel Fortran compiler and it was not found on your
<span class="target" id="index-0"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>. If you have the Intel compiler installed, make sure the shell
can locate it (this can be tested with <strong class="program">which ifort</strong>).</p>
</div>
<div class="section" id="make-1-pgf90-command-not-found">
<h3>4.1.7. make[1]: pgf90: Command not found<a class="headerlink" href="#make-1-pgf90-command-not-found" title="Permalink to this headline"></a></h3>
<h3>5.1.7. make[1]: pgf90: Command not found<a class="headerlink" href="#make-1-pgf90-command-not-found" title="Permalink to this headline"></a></h3>
<p>You tried compiling with the PGI Fortran compiler and it was not found on your
<span class="target" id="index-1"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>. If you have the PGI compiler installed, make sure the shell can
locate it (this can be tested with <strong class="program">which pgf90</strong>).</p>
</div>
</div>
<div class="section" id="problems-with-simulations">
<h2>4.2. Problems with Simulations<a class="headerlink" href="#problems-with-simulations" title="Permalink to this headline"></a></h2>
<h2>5.2. Problems with Simulations<a class="headerlink" href="#problems-with-simulations" title="Permalink to this headline"></a></h2>
<div class="section" id="segmentation-fault">
<h3>4.2.1. Segmentation Fault<a class="headerlink" href="#segmentation-fault" title="Permalink to this headline"></a></h3>
<h3>5.2.1. Segmentation Fault<a class="headerlink" href="#segmentation-fault" title="Permalink to this headline"></a></h3>
<p>A segmentation fault occurs when the program tries to access a variable in
memory that was outside the memory allocated for the program. The best way to
debug a segmentation fault is to re-compile OpenMC with debug options turned
@ -123,7 +120,7 @@ failed. If after reading the debug output, you are still unsure why the program
failed, send an email to the OpenMC User&#8217;s Group <a class="reference external" href="https://groups.google.com/forum/?fromgroups=#!forum/openmc-users">mailing list</a>.</p>
</div>
<div class="section" id="error-no-cross-sections-xml-file-was-specified-in-settings-xml-or-in-the-cross-sections-environment-variable">
<h3>4.2.2. ERROR: No cross_sections.xml file was specified in settings.xml or in the CROSS_SECTIONS environment variable.<a class="headerlink" href="#error-no-cross-sections-xml-file-was-specified-in-settings-xml-or-in-the-cross-sections-environment-variable" title="Permalink to this headline"></a></h3>
<h3>5.2.2. ERROR: No cross_sections.xml file was specified in settings.xml or in the CROSS_SECTIONS environment variable.<a class="headerlink" href="#error-no-cross-sections-xml-file-was-specified-in-settings-xml-or-in-the-cross-sections-environment-variable" title="Permalink to this headline"></a></h3>
<p>OpenMC needs to know where to find cross section data for each
nuclide. Information on what data is available and in what files is summarized
in a cross_sections.xml file. You need to tell OpenMC where to find the
@ -133,7 +130,7 @@ a line in your <tt class="docutils literal"><span class="pre">.profile</span></t
<span class="target" id="index-3"></span><tt class="xref std std-envvar docutils literal"><span class="pre">CROSS_SECTIONS</span></tt> environment variable.</p>
</div>
<div class="section" id="error-after-particle-crossed-surface-it-could-not-be-located-in-any-cell-and-it-did-not-leak">
<h3>4.2.3. ERROR: After particle __ crossed surface __ it could not be located in any cell and it did not leak.<a class="headerlink" href="#error-after-particle-crossed-surface-it-could-not-be-located-in-any-cell-and-it-did-not-leak" title="Permalink to this headline"></a></h3>
<h3>5.2.3. ERROR: After particle __ crossed surface __ it could not be located in any cell and it did not leak.<a class="headerlink" href="#error-after-particle-crossed-surface-it-could-not-be-located-in-any-cell-and-it-did-not-leak" title="Permalink to this headline"></a></h3>
<p>This error can arise either if a problem is specified with no boundary
conditions or if there is an error in the geometry itself. First check to ensure
that all of the outer surfaces of your geometry have been given vacuum or
@ -159,7 +156,7 @@ has a collision. For example, if you received this error at cycle 5, generation
<div class="bottomnav">
<p>
«&#160;&#160;<a href="input.html">3. Writing XML Input Files</a>
«&#160;&#160;<a href="processing.html">4. Data Processing and Visualization</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -171,7 +168,7 @@ has a collision. For example, if you received this error at cycle 5, generation
<div class="footer">
&copy; Copyright 2011-2013, Massachusetts Institute of Technology.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
<script type="text/javascript">