Documentation for version 0.7.1.

This commit is contained in:
Paul Romano 2015-12-29 22:36:45 -06:00
parent a86391163e
commit c7362c0984
143 changed files with 35050 additions and 3631 deletions

BIN
_images/cmfd_flow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

BIN
_images/meshfig.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,000 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

View file

@ -16,6 +16,4 @@ as debugging.
styleguide
workflow
xml-parsing
statepoint
voxel
docbuild

View file

@ -1,291 +0,0 @@
.. _devguide_statepoint:
======================================
State Point Binary File Specifications
======================================
The current revision of the statepoint binary file is 13.
**integer(4) FILETYPE_STATEPOINT**
Flags whether this file is a statepoint file or a particle restart file.
**integer(4) REVISION_STATEPOINT**
Revision of the binary state point file. Any time a change is made in the
format of the state-point file, this integer is incremented.
**integer(4) VERSION_MAJOR**
Major version number for OpenMC
**integer(4) VERSION_MINOR**
Minor version number for OpenMC
**integer(4) VERSION_RELEASE**
Release version number for OpenMC
**character(19) time_stamp**
Date and time the state point was written.
**character(255) path**
Absolute path to directory containing input files.
**integer(8) seed**
Pseudo-random number generator seed.
**integer(4) run_mode**
run mode used. The modes are described in constants.F90.
**integer(8) n_particles**
Number of particles used per generation.
**integer(4) current_batch**
The number of batches already simulated.
if (run_mode == MODE_EIGENVALUE)
**integer(4) n_inactive**
Number of inactive batches
**integer(4) gen_per_batch**
Number of generations per batch for criticality calculations
*do i = 1, current_batch \* gen_per_batch*
**real(8) k_generation(i)**
k-effective for the i-th total generation
*do i = 1, current_batch \* gen_per_batch*
**real(8) entropy(i)**
Shannon entropy for the i-th total generation
**real(8) k_col_abs**
Sum of product of collision/absorption estimates of k-effective
**real(8) k_col_tra**
Sum of product of collision/track-length estimates of k-effective
**real(8) k_abs_tra**
Sum of product of absorption/track-length estimates of k-effective
**real(8) k_combined(2)**
Mean and standard deviation of a combined estimate of k-effective
**integer(4) cmfd_on**
Flag that cmfd is on
if (cmfd_on)
**integer(4) cmfd % indices**
Indices for cmfd mesh (i,j,k,g)
**real(8) cmfd % k_cmfd(1:current_batch)**
CMFD eigenvalues
**real(8) cmfd % src(1:G,1:I,1:J,1:K)**
CMFD fission source
**real(8) cmfd % entropy(1:current_batch)**
CMFD estimate of Shannon entropy
**real(8) cmfd % balance(1:current_batch)**
RMS of the residual neutron balance equation on CMFD mesh
**real(8) cmfd % dom(1:current_batch)**
CMFD estimate of dominance ratio
**real(8) cmfd % scr_cmp(1:current_batch)**
RMS comparison of difference between OpenMC and CMFD fission source
**integer(4) n_meshes**
Number of meshes in tallies.xml file
*do i = 1, n_meshes*
**integer(4) meshes(i) % id**
Unique ID of mesh.
**integer(4) meshes(i) % type**
Type of mesh.
**integer(4) meshes(i) % n_dimension**
Number of dimensions for mesh (2 or 3).
**integer(4) meshes(i) % dimension(:)**
Number of mesh cells in each dimension.
**real(8) meshes(i) % lower_left(:)**
Coordinates of lower-left corner of mesh.
**real(8) meshes(i) % upper_right(:)**
Coordinates of upper-right corner of mesh.
**real(8) meshes(i) % width(:)**
Width of each mesh cell in each dimension.
**integer(4) n_tallies**
*do i = 1, n_tallies*
**integer(4) tallies(i) % id**
Unique ID of tally.
**integer(4) tallies(i) % n_realizations**
Number of realizations for the i-th tally.
**integer(4) size(tallies(i) % scores, 1)**
Total number of score bins for the i-th tally
**integer(4) size(tallies(i) % scores, 2)**
Total number of filter bins for the i-th tally
**integer(4) tallies(i) % n_filters**
*do j = 1, tallies(i) % n_filters*
**integer(4) tallies(i) % filter(j) % type**
Type of tally filter.
**integer(4) tallies(i) % filter(j) % n_bins**
Number of bins for filter.
**integer(4)/real(8) tallies(i) % filter(j) % bins(:)**
Value for each filter bin of this type.
**integer(4) tallies(i) % n_nuclide_bins**
Number of nuclide bins. If none are specified, this is just one.
*do j = 1, tallies(i) % n_nuclide_bins*
**integer(4) tallies(i) % nuclide_bins(j)**
Values of specified nuclide bins
**integer(4) tallies(i) % n_score_bins**
Number of scoring bins.
*do j = 1, tallies(i) % n_score_bins*
**integer(4) tallies(i) % score_bins(j)**
Values of specified scoring bins (e.g. SCORE_FLUX).
**integer(4) tallies(i) % n_score_bins**
Number of scoring bins without accounting for those added by
the scatter-pn command.
*do j = 1, tallies(i) % n_user_score_bins*
**character(8) tallies(i) % moment_order(j)**
Tallying moment order for Legendre and spherical
harmonic tally expansions (*e.g.*, 'P2', 'Y1,2', etc.).
**integer(4) source_present**
Flag indicated if source bank is present in the file
**integer(4) n_realizations**
Number of realizations for global tallies.
**integer(4) N_GLOBAL_TALLIES**
Number of global tally scores
*do i = 1, N_GLOBAL_TALLIES*
**real(8) global_tallies(i) % sum**
Accumulated sum for the i-th global tally
**real(8) global_tallies(i) % sum_sq**
Accumulated sum of squares for the i-th global tally
**integer(4) tallies_on**
Flag indicated if tallies are present in the file.
if (tallies_on > 0)
*do i = 1, n_tallies*
*do k = 1, size(tallies(i) % scores, 2)*
*do j = 1, size(tallies(i) % scores, 1)*
**real(8) tallies(i) % scores(j,k) % sum**
Accumulated sum for the j-th score and k-th filter of the
i-th tally
**real(8) tallies(i) % scores(j,k) % sum_sq**
Accumulated sum of squares for the j-th score and k-th
filter of the i-th tally
if (run_mode == MODE_EIGENVALUE and source_present)
*do i = 1, n_particles*
**real(8) source_bank(i) % wgt**
Weight of the i-th source particle
**real(8) source_bank(i) % xyz(1:3)**
Coordinates of the i-th source particle.
**real(8) source_bank(i) % uvw(1:3)**
Direction of the i-th source particle
**real(8) source_bank(i) % E**
Energy of the i-th source particle.

View file

@ -1,52 +0,0 @@
.. _devguide_voxel:
=====================================
Voxel Plot Binary File Specifications
=====================================
The current revision of the voxel plot binary file is 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

@ -142,7 +142,7 @@ than unity. By ensuring that the expected number of fission sites in each mesh
cell is constant, the collision density across all cells, and hence the variance
of tallies, is more uniform than it would be otherwise.
.. _Shannon entropy: https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-ur-06-3737_entropy.pdf
.. _Shannon entropy: https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-ur-06-3737.pdf
.. [Lieberoth] J. Lieberoth, "A Monte Carlo Technique to Solve the Static
Eigenvalue Problem of the Boltzmann Transport Equation," *Nukleonik*, **11**,

View file

@ -10,7 +10,7 @@ Constructive Solid Geometry
OpenMC uses a technique known as `constructive solid geometry`_ (CSG) to build
arbitrarily complex three-dimensional models in Euclidean space. In a CSG model,
every unique object is described as the union, intersection, or difference of
every unique object is described as the union and/or intersection of
*half-spaces* created by bounding `surfaces`_. Every surface divides all of
space into exactly two half-spaces. We can mathematically define a surface as a
collection of points that satisfy an equation of the form :math:`f(x,y,z) = 0`
@ -54,13 +54,12 @@ dividing space into two half-spaces.
Example of an ellipse and its associated half-spaces.
References to half-spaces created by surfaces are used to define regions of
space of uniform composition, known as *cells*. While some codes allow regions
to be defined by intersections, unions, and differences or half-spaces, OpenMC
is currently limited to cells defined only as intersections of
half-spaces. Thus, the specification of the cell must include a list of
half-space references whose intersection defines the region. The region is then
assigned a material defined elsewhere. Figure :num:`fig-union` shows an
example of a cell defined as the intersection of an ellipse and two planes.
space of uniform composition, which are then assigned to *cells*. OpenMC allows
regions to be defined using union, intersection, and complement operators. As in
MCNP_, the intersection operator is implicit as doesn't need to be written in a
region specification. A defined region is then associated with a material
composition in a cell. Figure :num:`fig-union` shows an example of a cell region
defined as the intersection of an ellipse and two planes.
.. _fig-union:
@ -117,6 +116,10 @@ to fully define the surface.
| Cone parallel to the | z-cone | :math:`(x-x_0)^2 + (y-y_0)^2 | :math:`x_0 \; y_0 \; |
| :math:`z`-axis | | = R^2(z-z_0)^2` | z_0 \; R^2` |
+----------------------+------------+------------------------------+-------------------------+
| General quadric | quadric | :math:`Ax^2 + By^2 + Cz^2 + | :math:`A \; B \; C \; D |
| surface | | Dxy + Eyz + Fxz + Gx + Hy + | \; E \; F \; G \; H \; |
| | | Jz + K` | J \; K` |
+----------------------+------------+------------------------------+-------------------------+
.. _universes:

View file

@ -187,11 +187,11 @@ secondary photons from nuclear de-excitation are tracked in OpenMC.
------------------------
These types of reactions are just treated as inelastic scattering and as such
are subject to the same procedure as described in
:ref:`inelastic-scatter`. Rather than tracking multiple secondary neutrons, the
weight of the outgoing neutron is multiplied by the number of secondary
neutrons, e.g. for :math:`(n,2n)`, only one outgoing neutron is tracked but its
weight is doubled.
are subject to the same procedure as described in :ref:`inelastic-scatter`. For
reactions with integral multiplicity, e.g., :math:`(n,2n)`, an appropriate
number of secondary neutrons are created. For reactions that have a multiplicity
given as a function of the incoming neutron energy (which occasionally occurs
for MT=5), the weight of the outgoing neutron is multiplied by the multiplcity.
.. _fission:
@ -1027,14 +1027,19 @@ probability distribution function can be found by integrating equation
Let us call the normalization factor in the denominator of equation
:eq:`target-pdf-1` :math:`C`.
It is normally assumed that :math:`\sigma (v_r)` is constant over the range of
Constant Cross Section Model
----------------------------
It is often assumed that :math:`\sigma (v_r)` is constant over the range of
relative velocities of interest. This is a good assumption for almost all cases
since the elastic scattering cross section varies slowly with velocity for light
nuclei, and for heavy nuclei where large variations can occur due to resonance
scattering, the moderating effect is rather small. Nonetheless, this assumption
may cause incorrect answers in systems with low-lying resonances that can cause
a significant amount of up-scatter that would be ignored by this assumption
(e.g. U-238 in commercial light-water reactors). Nevertheless, with this
(e.g. U-238 in commercial light-water reactors). We will revisit this assumption
later in :ref:`energy_dependent_xs_model`. For now, continuing with the
assumption, we write :math:`\sigma (v_r) = \sigma_s` which simplifies
:eq:`target-pdf-1` to
@ -1232,6 +1237,35 @@ If is not accepted, then we repeat the process and resample a target speed and
cosine until a combination is found that satisfies equation
:eq:`freegas-accept-2`.
.. _energy_dependent_xs_model:
Energy-Dependent Cross Section Model
------------------------------------
As was noted earlier, assuming that the elastic scattering cross section is
constant in :eq:`reaction-rate` is not strictly correct, especially when
low-lying resonances are present in the cross sections for heavy nuclides. To
correctly account for energy dependence of the scattering cross section entails
performing another rejection step. The most common method is to sample
:math:`\mu` and :math:`v_T` as in the constant cross section approximation and
then perform a rejection on the ratio of the 0 K elastic scattering cross
section at the relative velocity to the maximum 0 K elastic scattering cross
section over the range of velocities considered:
.. math::
:label: dbrc
p_{dbrc} = \frac{\sigma_s(v_r)}{\sigma_{s,max}}
where it should be noted that the maximum is taken over the range :math:`[v_n -
4/\beta, 4_n + 4\beta]`. This method is known as Doppler broadening rejection
correction (DBRC) and was first introduced by `Becker et al.`_. OpenMC has an
implementation of DBRC as well as an accelerated sampling method that are
described fully in `Walsh et al.`_
.. _Becker et al.: http://dx.doi.org/10.1016/j.anucene.2008.12.001
.. _Walsh et al.: http://dx.doi.org/10.1016/j.anucene.2014.01.017
.. _sab_tables:
------------

View file

@ -26,6 +26,10 @@ Overviews
Benchmarking
------------
- Khurrum S. Chaudri and Sikander M. Mirza, "Burnup dependent Monte Carlo
neutron physics calculations of IAEA MTR benchmark," *Prog. Nucl. Energy*,
**81**, 43-52 (2015). `<http://dx.doi.org/j.pnucene.2014.12.018>`_
- Daniel J. Kelly, Brian N. Aviles, Paul K. Romano, Bryan R. Herman,
Nicholas E. Horelik, and Benoit Forget, "Analysis of select BEAVRS PWR
benchmark cycle 1 results using MC21 and OpenMC," *Proc. PHYSOR*, Kyoto,
@ -57,13 +61,8 @@ Coupling and Multi-physics
- Bryan R. Herman, Benoit Forget, and Kord Smith, "Progress toward Monte
Carlo-thermal hydraulic coupling using low-order nonlinear diffusion
acceleration methods." In press, *Ann. Nucl. Energy*,
(2014). `<http://dx.doi.org/10.1016/j.anucene/2014.10.029>`_
- Adam G. Nelson and William R. Martin, "Improved Convergence of Monte Carlo
Generated Multi-Group Scattering Moments," *Proc. Int. Conf. Mathematics and
Computational Methods Applied to Nuclear Science and Engineering*, Sun Valley,
Idaho, May 5--9 (2013).
acceleration methods." *Ann. Nucl. Energy*, **84**, 63-72
(2015). `<http://dx.doi.org/10.1016/j.anucene.2014.10.029>`_
- Bryan R. Herman, Benoit Forget, and Kord Smith, "Utilizing CMFD in OpenMC to
Estimate Dominance Ratio and Adjoint," *Trans. Am. Nucl. Soc.*, **109**,
@ -81,19 +80,65 @@ Geometry
Miscellaneous
-------------
- William Boyd, Sterling Harper, and Paul K. Romano, "Equipping OpenMC for the
big data era," Accepted, *PHYSOR 2016*, Sun Valley, Idaho, May 1-5, 2016.
- Qicang Shen, William Boyd, Benoit Forget, and Kord Smith, "Tally precision
triggers for the OpenMC Monte Carlo code," *Trans. Am. Nucl. Soc.*, **112**,
637-640 (2015).
- Timothy P. Burke, Brian C. Kiedrowski, and William R. Martin, "Flux and
Reaction Rate Kernel Density Estimators in OpenMC," *Trans. Am. Nucl. Soc.*,
**109**, 683-686 (2013).
------------------------------------
Multi-group Cross Section Generation
------------------------------------
- Adam G. Nelson and William R. Martin, "Improved Monte Carlo tallying of
multi-group scattering moments using the NDPP code," *Trans. Am. Nucl. Soc.*,
**113**, 645-648 (2015)
- Adam G. Nelson and William R. Martin, "Improved Monte Carlo tallying of
multi-group scattering moment matrices," *Trans. Am. Nucl. Soc.*, **110**,
217-220 (2014).
- Adam G. Nelson and William R. Martin, "Improved Convergence of Monte Carlo
Generated Multi-Group Scattering Moments," *Proc. Int. Conf. Mathematics and
Computational Methods Applied to Nuclear Science and Engineering*, Sun Valley,
Idaho, May 5--9 (2013).
------------
Nuclear Data
------------
- Colin Josey, Pablo Ducru, Benoit Forget, and Kord Smith, "Windowed multipole
for cross section Doppler broadening," *J. Comput. Phys.*, In Press
(2016). `<http://dx.doi.org/10.1016/jcp.2015.08.013>`_
- Colin Josey, Benoit Forget, and Kord Smith, "Windowed multipole sensitivity to
target accuracy of the optimization procedure," *J. Nucl. Sci. Technol.*,
**52**, 987-992 (2015). `<http://dx.doi.org/10.1080/00223131.2015.1035353>`_
- Jonathan A. Walsh, Paul K. Romano, Benoit Forget, and Kord S. Smith,
"Optimizations of the energy grid search algorithm in continuous-energy Monte
Carlo particle transport codes", *Comput. Phys. Commun.*, **196**, 134-142
(2015). `<http://dx.doi.org/10.1016/j.cpc.2015.05.025>`_
- Jonathan A. Walsh, Benoit Forget, Kord S. Smith, Brian C. Kiedrowski, and
Forrest B. Brown, "Direct, on-the-fly calculation of unresolved resonance
region cross sections in Monte Carlo simulations," *Proc. Joint
Int. Conf. M&C+SNA+MC*, Nashville, Tennessee, Apr. 19--23 (2015).
- Amanda L. Lund, Andrew R. Siegel, Benoit Forget, Colin Josey, and
Paul K. Romano, "Using fractional cascading to accelerate cross section
lookups in Monte Carlo particle transport calculations," *Proc. Joint
Int. Conf. M&C+SNA+MC*, Nashville, Tennessee, Apr. 19--23 (2015).
- Ronald O. Rahaman, Andrew R. Siegel, and Paul K. Romano, "Monte Carlo
performance analysis for varying cross section parameter regimes,"
*Proc. Joint Int. Conf. M&C+SNA+MC*, Nashville, Tennessee, Apr. 19--23 (2015).
- Paul K. Romano and Timothy H. Trumbull, "Comparison of algorithms for Doppler
broadening pointwise tabulated cross sections," *Ann. Nucl. Energy*, **75**,
358--364 (2015). `<http://dx.doi.org/10.1016/j.anucene.2014.08.046>`_
@ -114,6 +159,10 @@ Nuclear Data
Parallelism
-----------
- Paul K. Romano, John R. Tramm, and Andrew R. Siegel, "Efficacy of hardware
threading for Monte Carlo particle transport calculations on multi- and
many-core systems," Accepted, *PHYSOR 2016*, Sun Valley, Idaho, May 1-5, 2016.
- David Ozog, Allen D. Malony, and Andrew R. Siegel, "A performance analysis of
SIMD algorithms for Monte Carlo simulations of nuclear reactor cores,"
*Proc. IEEE Int. Parallel and Distributed Processing Symposium*, Hyderabad,

View file

@ -0,0 +1,8 @@
.. _pythonapi_energy_groups:
=============
Energy Groups
=============
.. automodule:: openmc.mgxs.groups
:members:

View file

@ -0,0 +1,910 @@
This IPython Notebook introduces the use of the ``openmc.mgxs`` module
to calculate multi-group cross sections for an infinite homogeneous
medium. In particular, this Notebook introduces the the following
features:
- **General equations** for scalar-flux averaged multi-group cross
sections
- Creation of multi-group cross sections for an **infinite homogeneous
medium**
- Use of **tally arithmetic** to manipulate multi-group cross sections
**Note:** This Notebook illustrates the use of
`Pandas <http://pandas.pydata.org/>`__ ``DataFrames`` to containerize
multi-group cross section data. We recommend using
`Pandas <http://pandas.pydata.org/>`__ >v0.15.0 or later since OpenMC's
Python API leverages the multi-indexing feature included in the most
recent releases of `Pandas <http://pandas.pydata.org/>`__.
Introduction to Multi-Group Cross Sections (MGXS)
-------------------------------------------------
Many Monte Carlo particle transport codes, including OpenMC, use
continuous-energy nuclear cross section data. However, most
deterministic neutron transport codes use *multi-group cross sections*
defined over discretized energy bins or *energy groups*. An example of
U-235's continuous-energy fission cross section along with a 16-group
cross section computed for a light water reactor spectrum is displayed
below.
.. code:: python
from IPython.display import Image
Image(filename='images/mgxs.png', width=350)
.. image:: mgxs-part-i-content_files/mgxs-part-i-content_3_0.png
A variety of tools employing different methodologies have been developed
over the years to compute multi-group cross sections for certain
applications, including NJOY (LANL), MC\ :math:`^2`-3 (ANL), and Serpent
(VTT). The ``openmc.mgxs`` Python module is designed to leverage
OpenMC's tally system to calculate multi-group cross sections with
arbitrary energy discretizations for fine-mesh heterogeneous
deterministic neutron transport applications.
Before proceeding to illustrate how one may use the ``openmc.mgxs``
module, it is worthwhile to define the general equations used to
calculate multi-group cross sections. This is only intended as a brief
overview of the methodology used by ``openmc.mgxs`` - we refer the
interested reader to the large body of literature on the subject for a
more comprehensive understanding of this complex topic.
Introductory Notation
~~~~~~~~~~~~~~~~~~~~~
The continuous real-valued microscopic cross section may be denoted
:math:`\sigma_{n,x}(\mathbf{r}, E)` for position vector
:math:`\mathbf{r}`, energy :math:`E`, nuclide :math:`n` and interaction
type :math:`x`. Similarly, the scalar neutron flux may be denoted by
:math:`\Phi(\mathbf{r},E)` for position :math:`\mathbf{r}` and energy
:math:`E`. **Note**: Although nuclear cross sections are dependent on
the temperature :math:`T` of the interacting medium, the temperature
variable is neglected here for brevity.
Spatial and Energy Discretization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The energy domain for critical systems such as thermal reactors spans
more than 10 orders of magnitude of neutron energies from
10\ :math:`^{-5}` - 10\ :math:`^7` eV. The multi-group approximation
discretization divides this energy range into one or more energy groups.
In particular, for :math:`G` total groups, we denote an energy group
index :math:`g` such that :math:`g \in \{1, 2, ..., G\}`. The energy
group indices are defined such that the smaller group the higher the
energy, and vice versa. The integration over neutron energies across a
discrete energy group is commonly referred to as **energy
condensation**.
Multi-group cross sections are computed for discretized spatial zones in
the geometry of interest. The spatial zones may be defined on a
structured and regular fuel assembly or pin cell mesh, an arbitrary
unstructured mesh or the constructive solid geometry used by OpenMC. For
a geometry with :math:`K` distinct spatial zones, we designate each
spatial zone an index :math:`k` such that
:math:`k \in \{1, 2, ..., K\}`. The volume of each spatial zone is
denoted by :math:`V_{k}`. The integration over discrete spatial zones is
commonly referred to as **spatial homogenization**.
General Scalar-Flux Weighted MGXS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The multi-group cross sections computed by ``openmc.mgxs`` are defined
as a *scalar flux-weighted average* of the microscopic cross sections
across each discrete energy group. This formulation is employed in order
to preserve the reaction rates within each energy group and spatial
zone. In particular, spatial homogenization and energy condensation are
used to compute the general multi-group cross section
:math:`\sigma_{n,x,k,g}` as follows:
.. math:: \sigma_{n,x,k,g} = \frac{\int_{E_{g}}^{E_{g-1}}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\sigma_{n,x}(\mathbf{r},E')\Phi(\mathbf{r},E')}{\int_{E_{g}}^{E_{g-1}}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\Phi(\mathbf{r},E')}
This scalar flux-weighted average microscopic cross section is computed
by ``openmc.mgxs`` for most multi-group cross sections, including total,
absorption, and fission reaction types. These double integrals are
stochastically computed with OpenMC's tally system - in particular,
`filters <https://mit-crpg.github.io/openmc/pythonapi/filter.html>`__ on
the energy range and spatial zone (material, cell or universe) define
the bounds of integration for both numerator and denominator.
Multi-Group Scattering Matrices
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The general multi-group cross section :math:`\sigma_{n,x,k,g}` is a
vector of :math:`G` values for each energy group :math:`g`. The equation
presented above only discretizes the energy of the incoming neutron and
neglects the outgoing energy of the neutron (if any). Hence, this
formulation must be extended to account for the outgoing energy of
neutrons in the discretized scattering matrix cross section used by
deterministic neutron transport codes.
We denote the incoming and outgoing neutron energy groups as :math:`g`
and :math:`g'` for the microscopic scattering matrix cross section
:math:`\sigma_{n,s}(\mathbf{r},E)`. As before, spatial homogenization
and energy condensation are used to find the multi-group scattering
matrix cross section :math:`\sigma_{n,s,k,g \to g'}` as follows:
.. math:: \sigma_{n,s,k,g\rightarrow g'} = \frac{\int_{E_{g'}}^{E_{g'-1}}\mathrm{d}E''\int_{E_{g}}^{E_{g-1}}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\sigma_{n,s}(\mathbf{r},E'\rightarrow E'')\Phi(\mathbf{r},E')}{\int_{E_{g}}^{E_{g-1}}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\Phi(\mathbf{r},E')}
This scalar flux-weighted multi-group microscopic scattering matrix is
computed using OpenMC tallies with both energy in and energy out
filters.
Multi-Group Fission Spectrum
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The energy spectrum of neutrons emitted from fission is denoted by
:math:`\chi_{n}(\mathbf{r},E' \rightarrow E'')` for incoming and
outgoing energies :math:`E'` and :math:`E''`, respectively. Unlike the
multi-group cross sections :math:`\sigma_{n,x,k,g}` considered up to
this point, the fission spectrum is a probability distribution and must
sum to unity. The outgoing energy is typically much less dependent on
the incoming energy for fission than for scattering interactions. As a
result, it is common practice to integrate over the incoming neutron
energy when computing the multi-group fission spectrum. The fission
spectrum may be simplified as :math:`\chi_{n}(\mathbf{r},E)` with
outgoing energy :math:`E`.
Unlike the multi-group cross sections defined up to this point, the
multi-group fission spectrum is weighted by the fission production rate
rather than the scalar flux. This formulation is intended to preserve
the total fission production rate in the multi-group deterministic
calculation. In order to mathematically define the multi-group fission
spectrum, we denote the microscopic fission cross section as
:math:`\sigma_{n,f}(\mathbf{r},E)` and the average number of neutrons
emitted from fission interactions with nuclide :math:`n` as
:math:`\nu_{n}(\mathbf{r},E)`. The multi-group fission spectrum
:math:`\chi_{n,k,g}` is then the probability of fission neutrons emitted
into energy group :math:`g`.
Similar to before, spatial homogenization and energy condensation are
used to find the multi-group fission spectrum :math:`\chi_{n,k,g}` as
follows:
.. math:: \chi_{n,k,g'} = \frac{\int_{E_{g'}}^{E_{g'-1}}\mathrm{d}E''\int_{0}^{\infty}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\chi_{n}(\mathbf{r},E'\rightarrow E'')\nu_{n}(\mathbf{r},E')\sigma_{n,f}(\mathbf{r},E')\Phi(\mathbf{r},E')}{\int_{0}^{\infty}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\nu_{n}(\mathbf{r},E')\sigma_{n,f}(\mathbf{r},E')\Phi(\mathbf{r},E')}
The fission production-weighted multi-group fission spectrum is computed
using OpenMC tallies with both energy in and energy out filters.
This concludes our brief overview on the methodology to compute
multi-group cross sections. The following sections detail more
concretely how users may employ the ``openmc.mgxs`` module to power
simulation workflows requiring multi-group cross sections for downstream
deterministic calculations.
Generate Input Files
--------------------
.. code:: python
import numpy as np
import matplotlib.pyplot as plt
import openmc
import openmc.mgxs as mgxs
%matplotlib inline
First we need to define materials that will be used in the problem.
Before defining a material, we must create nuclides that are used in the
material.
.. code:: python
# Instantiate some Nuclides
h1 = openmc.Nuclide('H-1')
o16 = openmc.Nuclide('O-16')
u235 = openmc.Nuclide('U-235')
u238 = openmc.Nuclide('U-238')
zr90 = openmc.Nuclide('Zr-90')
With the nuclides we defined, we will now create a material for the
homogeneous medium.
.. code:: python
# Instantiate a Material and register the Nuclides
inf_medium = openmc.Material(name='moderator')
inf_medium.set_density('g/cc', 5.)
inf_medium.add_nuclide(h1, 0.028999667)
inf_medium.add_nuclide(o16, 0.01450188)
inf_medium.add_nuclide(u235, 0.000114142)
inf_medium.add_nuclide(u238, 0.006886019)
inf_medium.add_nuclide(zr90, 0.002116053)
With our material, we can now create a ``MaterialsFile`` object that can
be exported to an actual XML file.
.. code:: python
# Instantiate a MaterialsFile, register all Materials, and export to XML
materials_file = openmc.MaterialsFile()
materials_file.default_xs = '71c'
materials_file.add_material(inf_medium)
materials_file.export_to_xml()
Now let's move on to the geometry. This problem will be a simple square
cell with reflective boundary conditions to simulate an infinite
homogeneous medium. The first step is to create the outer bounding
surfaces of the problem.
.. code:: python
# Instantiate boundary Planes
min_x = openmc.XPlane(boundary_type='reflective', x0=-0.63)
max_x = openmc.XPlane(boundary_type='reflective', x0=0.63)
min_y = openmc.YPlane(boundary_type='reflective', y0=-0.63)
max_y = openmc.YPlane(boundary_type='reflective', y0=0.63)
With the surfaces defined, we can now create a cell that is defined by
intersections of half-spaces created by the surfaces.
.. code:: python
# Instantiate a Cell
cell = openmc.Cell(cell_id=1, name='cell')
# Register bounding Surfaces with the Cell
cell.region = +min_x & -max_x & +min_y & -max_y
# Fill the Cell with the Material
cell.fill = inf_medium
OpenMC requires that there is a "root" universe. Let us create a root
universe and add our square cell to it.
.. code:: python
# Instantiate Universe
root_universe = openmc.Universe(universe_id=0, name='root universe')
root_universe.add_cell(cell)
We now must create a geometry that is assigned a root universe, put the
geometry into a ``GeometryFile`` object, and export it to XML.
.. code:: python
# Create Geometry and set root Universe
openmc_geometry = openmc.Geometry()
openmc_geometry.root_universe = root_universe
# Instantiate a GeometryFile
geometry_file = openmc.GeometryFile()
geometry_file.geometry = openmc_geometry
# Export to "geometry.xml"
geometry_file.export_to_xml()
Next, we must define simulation parameters. In this case, we will use 10
inactive batches and 40 active batches each with 2500 particles.
.. code:: python
# OpenMC simulation parameters
batches = 50
inactive = 10
particles = 2500
# Instantiate a SettingsFile
settings_file = openmc.SettingsFile()
settings_file.batches = batches
settings_file.inactive = inactive
settings_file.particles = particles
settings_file.output = {'tallies': True, 'summary': True}
bounds = [-0.63, -0.63, -0.63, 0.63, 0.63, 0.63]
settings_file.set_source_space('fission', bounds)
# Export to "settings.xml"
settings_file.export_to_xml()
Now we are ready to generate multi-group cross sections! First, let's
define a 2-group structure using the built-in ``EnergyGroups`` class.
.. code:: python
# Instantiate a 2-group EnergyGroups object
groups = mgxs.EnergyGroups()
groups.group_edges = np.array([0., 0.625e-6, 20.])
We can now use the ``EnergyGroups`` object, along with our previously
created materials and geometry, to instantiate some ``MGXS`` objects
from the ``openmc.mgxs`` module. In particular, the following are
subclasses of the generic and abstract ``MGXS`` class:
- ``TotalXS``
- ``TransportXS``
- ``AbsorptionXS``
- ``CaptureXS``
- ``FissionXS``
- ``NuFissionXS``
- ``ScatterXS``
- ``NuScatterXS``
- ``ScatterMatrixXS``
- ``NuScatterMatrixXS``
- ``Chi``
These classes provide us with an interface to generate the tally inputs
as well as perform post-processing of OpenMC's tally data to compute the
respective multi-group cross sections. In this case, let's create the
multi-group total, absorption and scattering cross sections with our
2-group structure.
.. code:: python
# Instantiate a few different sections
total = mgxs.TotalXS(domain=cell, domain_type='cell', groups=groups)
absorption = mgxs.AbsorptionXS(domain=cell, domain_type='cell', groups=groups)
scattering = mgxs.ScatterXS(domain=cell, domain_type='cell', groups=groups)
Each multi-group cross section object stores its tallies in a Python
dictionary called ``tallies``. We can inspect the tallies in the
dictionary for our ``Absorption`` object as follows.
.. code:: python
absorption.tallies
.. parsed-literal::
OrderedDict([('flux', Tally
ID = 10000
Name =
Filters =
cell [1]
energy [ 0.00000000e+00 6.25000000e-07 2.00000000e+01]
Nuclides = total
Scores = ['flux']
Estimator = tracklength
), ('absorption', Tally
ID = 10001
Name =
Filters =
cell [1]
energy [ 0.00000000e+00 6.25000000e-07 2.00000000e+01]
Nuclides = total
Scores = ['absorption']
Estimator = tracklength
)])
The ``Absorption`` object includes tracklength tallies for the
'absorption' and 'flux' scores in the 2-group structure in cell 1. Now
that each ``MGXS`` object contains the tallies that it needs, we must
add these tallies to a ``TalliesFile`` object to generate the
"tallies.xml" input file for OpenMC.
.. code:: python
# Instantiate an empty TalliesFile
tallies_file = openmc.TalliesFile()
# Add total tallies to the tallies file
for tally in total.tallies.values():
tallies_file.add_tally(tally)
# Add absorption tallies to the tallies file
for tally in absorption.tallies.values():
tallies_file.add_tally(tally)
# Add scattering tallies to the tallies file
for tally in scattering.tallies.values():
tallies_file.add_tally(tally)
# Export to "tallies.xml"
tallies_file.export_to_xml()
Now we a have a complete set of inputs, so we can go ahead and run our
simulation.
.. code:: python
# Run OpenMC
executor = openmc.Executor()
executor.run_simulation()
.. parsed-literal::
.d88888b. 888b d888 .d8888b.
d88P" "Y88b 8888b d8888 d88P Y88b
888 888 88888b.d88888 888 888
888 888 88888b. .d88b. 88888b. 888Y88888P888 888
888 888 888 "88b d8P Y8b 888 "88b 888 Y888P 888 888
888 888 888 888 88888888 888 888 888 Y8P 888 888 888
Y88b. .d88P 888 d88P Y8b. 888 888 888 " 888 Y88b d88P
"Y88888P" 88888P" "Y8888 888 888 888 888 "Y8888P"
__________________888______________________________________________________
888
888
Copyright: 2011-2015 Massachusetts Institute of Technology
License: http://mit-crpg.github.io/openmc/license.html
Version: 0.7.0
Git SHA1: c4b14a5ef87f004528d35cbf33fef3ed15a386ca
Date/Time: 2015-12-02 09:11:05
MPI Processes: 1
===========================================================================
========================> INITIALIZATION <=========================
===========================================================================
Reading settings XML file...
Reading cross sections XML file...
Reading geometry XML file...
Reading materials XML file...
Reading tallies XML file...
Building neighboring cells lists for each surface...
Loading ACE cross section table: 1001.71c
Loading ACE cross section table: 8016.71c
Loading ACE cross section table: 92235.71c
Loading ACE cross section table: 92238.71c
Loading ACE cross section table: 40090.71c
Maximum neutron transport energy: 20.0000 MeV for 1001.71c
Initializing source particles...
===========================================================================
====================> K EIGENVALUE SIMULATION <====================
===========================================================================
Bat./Gen. k Average k
========= ======== ====================
1/1 1.19804
2/1 1.12945
3/1 1.15573
4/1 1.13929
5/1 1.16300
6/1 1.22117
7/1 1.19012
8/1 1.11299
9/1 1.16066
10/1 1.12566
11/1 1.20854
12/1 1.14691 1.17773 +/- 0.03082
13/1 1.17204 1.17583 +/- 0.01789
14/1 1.14148 1.16724 +/- 0.01529
15/1 1.17272 1.16834 +/- 0.01189
16/1 1.18575 1.17124 +/- 0.01014
17/1 1.20498 1.17606 +/- 0.00983
18/1 1.14754 1.17249 +/- 0.00923
19/1 1.18141 1.17348 +/- 0.00820
20/1 1.15074 1.17121 +/- 0.00768
21/1 1.15914 1.17011 +/- 0.00703
22/1 1.14586 1.16809 +/- 0.00673
23/1 1.18999 1.16978 +/- 0.00642
24/1 1.15101 1.16844 +/- 0.00609
25/1 1.13791 1.16640 +/- 0.00602
26/1 1.19791 1.16837 +/- 0.00597
27/1 1.19818 1.17012 +/- 0.00587
28/1 1.14160 1.16854 +/- 0.00576
29/1 1.11487 1.16571 +/- 0.00614
30/1 1.17538 1.16620 +/- 0.00584
31/1 1.20210 1.16791 +/- 0.00581
32/1 1.20078 1.16940 +/- 0.00574
33/1 1.14624 1.16839 +/- 0.00558
34/1 1.14618 1.16747 +/- 0.00542
35/1 1.16866 1.16752 +/- 0.00520
36/1 1.18565 1.16821 +/- 0.00504
37/1 1.16824 1.16821 +/- 0.00485
38/1 1.18299 1.16874 +/- 0.00471
39/1 1.21418 1.17031 +/- 0.00480
40/1 1.11167 1.16835 +/- 0.00504
41/1 1.11545 1.16665 +/- 0.00516
42/1 1.11114 1.16491 +/- 0.00529
43/1 1.14227 1.16423 +/- 0.00517
44/1 1.14104 1.16355 +/- 0.00506
45/1 1.16756 1.16366 +/- 0.00492
46/1 1.13065 1.16274 +/- 0.00487
47/1 1.11251 1.16139 +/- 0.00492
48/1 1.14731 1.16101 +/- 0.00481
49/1 1.16691 1.16117 +/- 0.00469
50/1 1.19679 1.16206 +/- 0.00465
Creating state point statepoint.50.h5...
===========================================================================
======================> SIMULATION FINISHED <======================
===========================================================================
=======================> TIMING STATISTICS <=======================
Total time for initialization = 4.1700E-01 seconds
Reading cross sections = 8.9000E-02 seconds
Total time in simulation = 1.4728E+01 seconds
Time in transport only = 1.4712E+01 seconds
Time in inactive batches = 1.7890E+00 seconds
Time in active batches = 1.2939E+01 seconds
Time synchronizing fission bank = 5.0000E-03 seconds
Sampling source sites = 3.0000E-03 seconds
SEND/RECV source sites = 2.0000E-03 seconds
Time accumulating tallies = 1.0000E-03 seconds
Total time for finalization = 1.0000E-03 seconds
Total time elapsed = 1.5155E+01 seconds
Calculation Rate (inactive) = 13974.3 neutrons/second
Calculation Rate (active) = 7728.57 neutrons/second
============================> RESULTS <============================
k-effective (Collision) = 1.16131 +/- 0.00453
k-effective (Track-length) = 1.16206 +/- 0.00465
k-effective (Absorption) = 1.16096 +/- 0.00364
Combined k-effective = 1.16120 +/- 0.00325
Leakage Fraction = 0.00000 +/- 0.00000
.. parsed-literal::
0
Tally Data Processing
---------------------
Our simulation ran successfully and created statepoint and summary
output files. We begin our analysis by instantiating a ``StatePoint``
object.
.. code:: python
# Load the last statepoint file
sp = openmc.StatePoint('statepoint.50.h5')
In addition to the statepoint file, our simulation also created a
summary file which encapsulates information about the materials and
geometry. This is necessary for the ``openmc.mgxs`` module to properly
process the tally data. We first create a ``Summary`` object and link it
with the statepoint.
.. code:: python
# Load the summary file and link it with the statepoint
su = openmc.Summary('summary.h5')
sp.link_with_summary(su)
The statepoint is now ready to be analyzed by our multi-group cross
sections. We simply have to load the tallies from the ``StatePoint``
into each object as follows and our ``MGXS`` objects will compute the
cross sections for us under-the-hood.
.. code:: python
# Load the tallies from the statepoint into each MGXS object
total.load_from_statepoint(sp)
absorption.load_from_statepoint(sp)
scattering.load_from_statepoint(sp)
Voila! Our multi-group cross sections are now ready to rock 'n roll!
Extracting and Storing MGXS Data
--------------------------------
Let's first inspect our total cross section by printing it to the
screen.
.. code:: python
total.print_xs()
.. parsed-literal::
Multi-Group XS
Reaction Type = total
Domain Type = cell
Domain ID = 1
Cross Sections [cm^-1]:
Group 1 [6.25e-07 - 20.0 MeV]: 6.81e-01 +/- 1.88e-01%
Group 2 [0.0 - 6.25e-07 MeV]: 1.40e+00 +/- 5.91e-01%
Since the ``openmc.mgxs`` module uses `tally
arithmetic <https://mit-crpg.github.io/openmc/pythonapi/examples/tally-arithmetic.html>`__
under-the-hood, the cross section is stored as a "derived" ``Tally``
object. This means that it can be queried and manipulated using all of
the same methods supported for the ``Tally`` class in the OpenMC Python
API. For example, we can construct a
`Pandas <http://pandas.pydata.org/>`__ ``DataFrame`` of the multi-group
cross section data.
.. code:: python
df = scattering.get_pandas_dataframe()
df.head(10)
.. raw:: html
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>group in</th>
<th>nuclide</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td>1</td>
<td>1</td>
<td>total</td>
<td>0.668323</td>
<td>0.001264</td>
</tr>
<tr>
<th>0</th>
<td>1</td>
<td>2</td>
<td>total</td>
<td>1.293258</td>
<td>0.007624</td>
</tr>
</tbody>
</table>
</div>
Each multi-group cross section object can be easily exported to a
variety of file formats, including CSV, Excel, and LaTeX for storage or
data processing.
.. code:: python
absorption.export_xs_data(filename='absorption-xs', format='excel')
The following code snippet shows how to export all three ``MGXS`` to the
same HDF5 binary data store.
.. code:: python
total.build_hdf5_store(filename='mgxs', append=True)
absorption.build_hdf5_store(filename='mgxs', append=True)
scattering.build_hdf5_store(filename='mgxs', append=True)
Comparing MGXS with Tally Arithmetic
------------------------------------
Finally, we illustrate how one can leverage OpenMC's `tally
arithmetic <https://mit-crpg.github.io/openmc/pythonapi/examples/tally-arithmetic.html>`__
data processing feature with ``MGXS`` objects. The ``openmc.mgxs``
module uses tally arithmetic to compute multi-group cross sections with
automated uncertainty propagation. Each ``MGXS`` object includes an
``xs_tally`` attribute which is a "derived" ``Tally`` based on the
tallies needed to compute the cross section type of interest. These
derived tallies can be used in subsequent tally arithmetic operations.
For example, we can use tally artithmetic to confirm that the
``TotalXS`` is equal to the sum of the ``AbsorptionXS`` and
``ScatterXS`` objects.
.. code:: python
# Use tally arithmetic to compute the difference between the total, absorption and scattering
difference = total.xs_tally - absorption.xs_tally - scattering.xs_tally
# The difference is a derived tally which can generate Pandas DataFrames for inspection
difference.get_pandas_dataframe()
.. raw:: html
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>energy [MeV]</th>
<th>nuclide</th>
<th>score</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1</td>
<td>(0.0e+00 - 6.3e-07)</td>
<td>total</td>
<td>(((total / flux) - (absorption / flux)) - (sca...</td>
<td>4.884981e-15</td>
<td>0.011274</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>(6.3e-07 - 2.0e+01)</td>
<td>total</td>
<td>(((total / flux) - (absorption / flux)) - (sca...</td>
<td>1.221245e-15</td>
<td>0.001802</td>
</tr>
</tbody>
</table>
</div>
Similarly, we can use tally arithmetic to compute the ratio of
``AbsorptionXS`` and ``ScatterXS`` to the ``TotalXS``.
.. code:: python
# Use tally arithmetic to compute the absorption-to-total MGXS ratio
absorption_to_total = absorption.xs_tally / total.xs_tally
# The absorption-to-total ratio is a derived tally which can generate Pandas DataFrames for inspection
absorption_to_total.get_pandas_dataframe()
.. raw:: html
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>energy [MeV]</th>
<th>nuclide</th>
<th>score</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1</td>
<td>(0.0e+00 - 6.3e-07)</td>
<td>total</td>
<td>((absorption / flux) / (total / flux))</td>
<td>0.076219</td>
<td>0.000651</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>(6.3e-07 - 2.0e+01)</td>
<td>total</td>
<td>((absorption / flux) / (total / flux))</td>
<td>0.019319</td>
<td>0.000086</td>
</tr>
</tbody>
</table>
</div>
.. code:: python
# Use tally arithmetic to compute the scattering-to-total MGXS ratio
scattering_to_total = scattering.xs_tally / total.xs_tally
# The scattering-to-total ratio is a derived tally which can generate Pandas DataFrames for inspection
scattering_to_total.get_pandas_dataframe()
.. raw:: html
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>energy [MeV]</th>
<th>nuclide</th>
<th>score</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1</td>
<td>(0.0e+00 - 6.3e-07)</td>
<td>total</td>
<td>((scatter / flux) / (total / flux))</td>
<td>0.923781</td>
<td>0.007714</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>(6.3e-07 - 2.0e+01)</td>
<td>total</td>
<td>((scatter / flux) / (total / flux))</td>
<td>0.980681</td>
<td>0.002617</td>
</tr>
</tbody>
</table>
</div>
Lastly, we sum the derived scatter-to-total and absorption-to-total
ratios to confirm that they sum to unity.
.. code:: python
# Use tally arithmetic to ensure that the absorption- and scattering-to-total MGXS ratios sum to unity
sum_ratio = absorption_to_total + scattering_to_total
# The scattering-to-total ratio is a derived tally which can generate Pandas DataFrames for inspection
sum_ratio.get_pandas_dataframe()
.. raw:: html
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>energy [MeV]</th>
<th>nuclide</th>
<th>score</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1</td>
<td>(0.0e+00 - 6.3e-07)</td>
<td>total</td>
<td>(((absorption / flux) / (total / flux)) + ((sc...</td>
<td>1</td>
<td>0.007741</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>(6.3e-07 - 2.0e+01)</td>
<td>total</td>
<td>(((absorption / flux) / (total / flux)) + ((sc...</td>
<td>1</td>
<td>0.002619</td>
</tr>
</tbody>
</table>
</div>

View file

@ -0,0 +1,13 @@
.. _notebook_mgxs_part_i:
=========================
MGXS Part I: Introduction
=========================
.. only:: html
.. notebook:: mgxs-part-i.ipynb
.. only:: latex
IPython notebooks must be viewed in the online HTML documentation.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
.. _notebook_mgxs_part_ii:
===============================
MGXS Part II: Advanced Features
===============================
.. only:: html
.. notebook:: mgxs-part-ii.ipynb
.. only:: latex
IPython notebooks must be viewed in the online HTML documentation.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
.. _notebook_mgxs_part_iii:
========================
MGXS Part III: Libraries
========================
.. only:: html
.. notebook:: mgxs-part-iii.ipynb
.. only:: latex
IPython notebooks must be viewed in the online HTML documentation.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,767 @@
This notebook demonstrates some basic post-processing tasks that can be
performed with the Python API, such as plotting a 2D mesh tally and
plotting neutron source sites from an eigenvalue calculation. The
problem we will use is a simple reflected pin-cell.
.. code:: python
from IPython.display import Image
import numpy as np
import matplotlib.pyplot as plt
import openmc
from openmc.statepoint import StatePoint
%matplotlib inline
Generate Input Files
--------------------
First we need to define materials that will be used in the problem.
Before defining a material, we must create nuclides that are used in the
material.
.. code:: python
# Instantiate some Nuclides
h1 = openmc.Nuclide('H-1')
b10 = openmc.Nuclide('B-10')
o16 = openmc.Nuclide('O-16')
u235 = openmc.Nuclide('U-235')
u238 = openmc.Nuclide('U-238')
zr90 = openmc.Nuclide('Zr-90')
With the nuclides we defined, we will now create three materials for the
fuel, water, and cladding of the fuel pin.
.. code:: python
# 1.6 enriched fuel
fuel = openmc.Material(name='1.6% Fuel')
fuel.set_density('g/cm3', 10.31341)
fuel.add_nuclide(u235, 3.7503e-4)
fuel.add_nuclide(u238, 2.2625e-2)
fuel.add_nuclide(o16, 4.6007e-2)
# borated water
water = openmc.Material(name='Borated Water')
water.set_density('g/cm3', 0.740582)
water.add_nuclide(h1, 4.9457e-2)
water.add_nuclide(o16, 2.4732e-2)
water.add_nuclide(b10, 8.0042e-6)
# zircaloy
zircaloy = openmc.Material(name='Zircaloy')
zircaloy.set_density('g/cm3', 6.55)
zircaloy.add_nuclide(zr90, 7.2758e-3)
With our three materials, we can now create a materials file object that
can be exported to an actual XML file.
.. code:: python
# Instantiate a MaterialsFile, add Materials
materials_file = openmc.MaterialsFile()
materials_file.add_material(fuel)
materials_file.add_material(water)
materials_file.add_material(zircaloy)
materials_file.default_xs = '71c'
# Export to "materials.xml"
materials_file.export_to_xml()
Now let's move on to the geometry. Our problem will have three regions
for the fuel, the clad, and the surrounding coolant. The first step is
to create the bounding surfaces -- in this case two cylinders and six
reflective planes.
.. code:: python
# Create cylinders for the fuel and clad
fuel_outer_radius = openmc.ZCylinder(x0=0.0, y0=0.0, R=0.39218)
clad_outer_radius = openmc.ZCylinder(x0=0.0, y0=0.0, R=0.45720)
# Create boundary planes to surround the geometry
# Use both reflective and vacuum boundaries to make life interesting
min_x = openmc.XPlane(x0=-0.63, boundary_type='reflective')
max_x = openmc.XPlane(x0=+0.63, boundary_type='reflective')
min_y = openmc.YPlane(y0=-0.63, boundary_type='reflective')
max_y = openmc.YPlane(y0=+0.63, boundary_type='reflective')
min_z = openmc.ZPlane(z0=-0.63, boundary_type='reflective')
max_z = openmc.ZPlane(z0=+0.63, boundary_type='reflective')
With the surfaces defined, we can now create cells that are defined by
intersections of half-spaces created by the surfaces.
.. code:: python
# Create a Universe to encapsulate a fuel pin
pin_cell_universe = openmc.Universe(name='1.6% Fuel Pin')
# Create fuel Cell
fuel_cell = openmc.Cell(name='1.6% Fuel')
fuel_cell.fill = fuel
fuel_cell.region = -fuel_outer_radius
pin_cell_universe.add_cell(fuel_cell)
# Create a clad Cell
clad_cell = openmc.Cell(name='1.6% Clad')
clad_cell.fill = zircaloy
clad_cell.region = +fuel_outer_radius & -clad_outer_radius
pin_cell_universe.add_cell(clad_cell)
# Create a moderator Cell
moderator_cell = openmc.Cell(name='1.6% Moderator')
moderator_cell.fill = water
moderator_cell.region = +clad_outer_radius
pin_cell_universe.add_cell(moderator_cell)
OpenMC requires that there is a "root" universe. Let us create a root
cell that is filled by the pin cell universe and then assign it to the
root universe.
.. code:: python
# Create root Cell
root_cell = openmc.Cell(name='root cell')
root_cell.fill = pin_cell_universe
# Add boundary planes
root_cell.region = +min_x & -max_x & +min_y & -max_y & +min_z & -max_z
# Create root Universe
root_universe = openmc.Universe(universe_id=0, name='root universe')
root_universe.add_cell(root_cell)
We now must create a geometry that is assigned a root universe, put the
geometry into a geometry file, and export it to XML.
.. code:: python
# Create Geometry and set root Universe
geometry = openmc.Geometry()
geometry.root_universe = root_universe
.. code:: python
# Instantiate a GeometryFile
geometry_file = openmc.GeometryFile()
geometry_file.geometry = geometry
# Export to "geometry.xml"
geometry_file.export_to_xml()
With the geometry and materials finished, we now just need to define
simulation parameters. In this case, we will use 10 inactive batches and
90 active batches each with 5000 particles.
.. code:: python
# OpenMC simulation parameters
batches = 100
inactive = 10
particles = 5000
# Instantiate a SettingsFile
settings_file = openmc.SettingsFile()
settings_file.batches = batches
settings_file.inactive = inactive
settings_file.particles = particles
source_bounds = [-0.63, -0.63, -0.63, 0.63, 0.63, 0.63]
settings_file.set_source_space('box', source_bounds)
# Export to "settings.xml"
settings_file.export_to_xml()
Let us also create a plot file that we can use to verify that our pin
cell geometry was created successfully.
.. code:: python
# Instantiate a Plot
plot = openmc.Plot(plot_id=1)
plot.filename = 'materials-xy'
plot.origin = [0, 0, 0]
plot.width = [1.26, 1.26]
plot.pixels = [250, 250]
plot.color = 'mat'
# Instantiate a PlotsFile, add Plot, and export to "plots.xml"
plot_file = openmc.PlotsFile()
plot_file.add_plot(plot)
plot_file.export_to_xml()
With the plots.xml file, we can now generate and view the plot. OpenMC
outputs plots in .ppm format, which can be converted into a compressed
format like .png with the convert utility.
.. code:: python
# Run openmc in plotting mode
executor = openmc.Executor()
executor.plot_geometry(output=False)
.. parsed-literal::
0
.. code:: python
# Convert OpenMC's funky ppm to png
!convert materials-xy.ppm materials-xy.png
# Display the materials plot inline
Image(filename='materials-xy.png')
.. image:: post-processing-content_files/post-processing-content_24_0.png
As we can see from the plot, we have a nice pin cell with fuel,
cladding, and water! Before we run our simulation, we need to tell the
code what we want to tally. The following code shows how to create a 2D
mesh tally.
.. code:: python
# Instantiate an empty TalliesFile
tallies_file = openmc.TalliesFile()
.. code:: python
# Create mesh which will be used for tally
mesh = openmc.Mesh()
mesh.dimension = [100, 100]
mesh.lower_left = [-0.63, -0.63]
mesh.upper_right = [0.63, 0.63]
tallies_file.add_mesh(mesh)
# Create mesh filter for tally
mesh_filter = openmc.Filter(type='mesh', bins=[1])
mesh_filter.mesh = mesh
# Create mesh tally to score flux and fission rate
tally = openmc.Tally(name='flux')
tally.add_filter(mesh_filter)
tally.add_score('flux')
tally.add_score('fission')
tallies_file.add_tally(tally)
.. code:: python
# Export to "tallies.xml"
tallies_file.export_to_xml()
Now we a have a complete set of inputs, so we can go ahead and run our
simulation.
.. code:: python
# Run OpenMC!
executor.run_simulation()
.. parsed-literal::
.d88888b. 888b d888 .d8888b.
d88P" "Y88b 8888b d8888 d88P Y88b
888 888 88888b.d88888 888 888
888 888 88888b. .d88b. 88888b. 888Y88888P888 888
888 888 888 "88b d8P Y8b 888 "88b 888 Y888P 888 888
888 888 888 888 88888888 888 888 888 Y8P 888 888 888
Y88b. .d88P 888 d88P Y8b. 888 888 888 " 888 Y88b d88P
"Y88888P" 88888P" "Y8888 888 888 888 888 "Y8888P"
__________________888______________________________________________________
888
888
Copyright: 2011-2015 Massachusetts Institute of Technology
License: http://mit-crpg.github.io/openmc/license.html
Version: 0.7.0
Git SHA1: c4b14a5ef87f004528d35cbf33fef3ed15a386ca
Date/Time: 2015-11-29 16:46:53
MPI Processes: 1
===========================================================================
========================> INITIALIZATION <=========================
===========================================================================
Reading settings XML file...
Reading cross sections XML file...
Reading geometry XML file...
Reading materials XML file...
Reading tallies XML file...
Building neighboring cells lists for each surface...
Loading ACE cross section table: 92235.71c
Loading ACE cross section table: 92238.71c
Loading ACE cross section table: 8016.71c
Loading ACE cross section table: 1001.71c
Loading ACE cross section table: 5010.71c
Loading ACE cross section table: 40090.71c
Maximum neutron transport energy: 20.0000 MeV for 92235.71c
Initializing source particles...
===========================================================================
====================> K EIGENVALUE SIMULATION <====================
===========================================================================
Bat./Gen. k Average k
========= ======== ====================
1/1 1.04894
2/1 1.01711
3/1 1.05357
4/1 1.03052
5/1 1.06523
6/1 1.06806
7/1 1.05161
8/1 1.04199
9/1 1.05010
10/1 1.04617
11/1 1.04894
12/1 1.06806 1.05850 +/- 0.00956
13/1 1.05002 1.05567 +/- 0.00620
14/1 1.03471 1.05043 +/- 0.00683
15/1 1.01803 1.04395 +/- 0.00837
16/1 1.05588 1.04594 +/- 0.00712
17/1 1.07503 1.05010 +/- 0.00731
18/1 1.02786 1.04732 +/- 0.00691
19/1 1.00071 1.04214 +/- 0.00800
20/1 1.05587 1.04351 +/- 0.00729
21/1 1.03886 1.04309 +/- 0.00660
22/1 1.04335 1.04311 +/- 0.00603
23/1 1.04057 1.04292 +/- 0.00555
24/1 1.01976 1.04126 +/- 0.00540
25/1 1.05811 1.04238 +/- 0.00515
26/1 1.02351 1.04120 +/- 0.00496
27/1 1.05261 1.04188 +/- 0.00471
28/1 1.03355 1.04141 +/- 0.00446
29/1 1.02797 1.04071 +/- 0.00428
30/1 1.03758 1.04055 +/- 0.00406
31/1 1.04883 1.04094 +/- 0.00388
32/1 1.03557 1.04070 +/- 0.00371
33/1 1.02947 1.04021 +/- 0.00358
34/1 1.03651 1.04006 +/- 0.00343
35/1 1.03331 1.03979 +/- 0.00330
36/1 1.05947 1.04054 +/- 0.00326
37/1 1.05093 1.04093 +/- 0.00316
38/1 1.06787 1.04189 +/- 0.00319
39/1 1.01451 1.04095 +/- 0.00322
40/1 1.02351 1.04037 +/- 0.00317
41/1 1.04826 1.04062 +/- 0.00307
42/1 1.04228 1.04067 +/- 0.00298
43/1 1.03214 1.04041 +/- 0.00290
44/1 1.04950 1.04068 +/- 0.00282
45/1 1.06616 1.04141 +/- 0.00284
46/1 1.07039 1.04221 +/- 0.00287
47/1 1.00292 1.04115 +/- 0.00299
48/1 1.04477 1.04125 +/- 0.00291
49/1 1.03360 1.04105 +/- 0.00284
50/1 1.04783 1.04122 +/- 0.00277
51/1 1.03985 1.04119 +/- 0.00271
52/1 1.02507 1.04080 +/- 0.00267
53/1 1.03477 1.04066 +/- 0.00261
54/1 1.00412 1.03983 +/- 0.00268
55/1 1.02239 1.03945 +/- 0.00265
56/1 1.04308 1.03952 +/- 0.00259
57/1 1.05534 1.03986 +/- 0.00256
58/1 1.06667 1.04042 +/- 0.00257
59/1 1.06458 1.04091 +/- 0.00256
60/1 1.00304 1.04015 +/- 0.00262
61/1 1.05038 1.04036 +/- 0.00258
62/1 1.02904 1.04014 +/- 0.00254
63/1 1.00249 1.03943 +/- 0.00259
64/1 1.01779 1.03903 +/- 0.00257
65/1 1.05335 1.03929 +/- 0.00254
66/1 1.06231 1.03970 +/- 0.00253
67/1 1.02382 1.03942 +/- 0.00250
68/1 1.03796 1.03939 +/- 0.00245
69/1 1.03672 1.03935 +/- 0.00241
70/1 1.02926 1.03918 +/- 0.00238
71/1 1.05834 1.03950 +/- 0.00236
72/1 1.04332 1.03956 +/- 0.00232
73/1 1.05613 1.03982 +/- 0.00230
74/1 1.01963 1.03950 +/- 0.00228
75/1 1.02228 1.03924 +/- 0.00226
76/1 1.04842 1.03938 +/- 0.00223
77/1 1.02157 1.03911 +/- 0.00222
78/1 1.02810 1.03895 +/- 0.00219
79/1 1.05030 1.03912 +/- 0.00216
80/1 1.02391 1.03890 +/- 0.00214
81/1 1.02488 1.03870 +/- 0.00212
82/1 1.04957 1.03885 +/- 0.00210
83/1 1.03499 1.03880 +/- 0.00207
84/1 1.05922 1.03907 +/- 0.00206
85/1 1.05898 1.03934 +/- 0.00205
86/1 1.02242 1.03912 +/- 0.00204
87/1 1.03278 1.03904 +/- 0.00201
88/1 1.06134 1.03932 +/- 0.00201
89/1 1.04521 1.03940 +/- 0.00198
90/1 1.04277 1.03944 +/- 0.00196
91/1 1.04214 1.03947 +/- 0.00193
92/1 1.05610 1.03967 +/- 0.00192
93/1 1.04531 1.03974 +/- 0.00190
94/1 1.01534 1.03945 +/- 0.00190
95/1 1.03971 1.03945 +/- 0.00187
96/1 1.07183 1.03983 +/- 0.00189
97/1 1.07214 1.04020 +/- 0.00191
98/1 1.03710 1.04017 +/- 0.00188
99/1 1.02532 1.04000 +/- 0.00187
100/1 1.03965 1.04000 +/- 0.00185
Creating state point statepoint.100.h5...
===========================================================================
======================> SIMULATION FINISHED <======================
===========================================================================
=======================> TIMING STATISTICS <=======================
Total time for initialization = 3.7900E-01 seconds
Reading cross sections = 8.7000E-02 seconds
Total time in simulation = 2.2064E+02 seconds
Time in transport only = 2.2060E+02 seconds
Time in inactive batches = 8.7100E+00 seconds
Time in active batches = 2.1193E+02 seconds
Time synchronizing fission bank = 1.4000E-02 seconds
Sampling source sites = 8.0000E-03 seconds
SEND/RECV source sites = 2.0000E-03 seconds
Time accumulating tallies = 1.3000E-02 seconds
Total time for finalization = 1.6600E-01 seconds
Total time elapsed = 2.2120E+02 seconds
Calculation Rate (inactive) = 5740.53 neutrons/second
Calculation Rate (active) = 2123.37 neutrons/second
============================> RESULTS <============================
k-effective (Collision) = 1.03912 +/- 0.00160
k-effective (Track-length) = 1.04000 +/- 0.00185
k-effective (Absorption) = 1.04240 +/- 0.00156
Combined k-effective = 1.04078 +/- 0.00127
Leakage Fraction = 0.00000 +/- 0.00000
.. parsed-literal::
0
Tally Data Processing
---------------------
Our simulation ran successfully and created a statepoint file with all
the tally data in it. We begin our analysis here loading the statepoint
file and 'reading' the results. By default, data from the statepoint
file is only read into memory when it is requested. This helps keep the
memory use to a minimum even when a statepoint file may be huge.
.. code:: python
# Load the statepoint file
sp = StatePoint('statepoint.100.h5')
Next we need to get the tally, which can be done with the
``StatePoint.get_tally(...)`` method.
.. code:: python
tally = sp.get_tally(scores=['flux'])
print(tally)
.. parsed-literal::
Tally
ID = 10000
Name =
Filters =
mesh [10000]
Nuclides = total
Scores = [u'flux', u'fission']
Estimator = tracklength
The statepoint file actually stores the sum and sum-of-squares for each
tally bin from which the mean and variance can be calculated as
described
`here <http://mit-crpg.github.io/openmc/methods/tallies.html#variance>`__.
The sum and sum-of-squares can be accessed using the ``sum`` and
``sum_sq`` properties:
.. code:: python
tally.sum
.. parsed-literal::
array([[[ 0.4107676 , 0. ]],
[[ 0.40849402, 0. ]],
[[ 0.41014343, 0. ]],
...,
[[ 0.41049467, 0. ]],
[[ 0.40982242, 0. ]],
[[ 0.40996987, 0. ]]])
However, the mean and standard deviation of the mean are usually what
you are more interested in. The Tally class also has properties ``mean``
and ``std_dev`` which automatically calculate these statistics
on-the-fly.
.. code:: python
print(tally.mean.shape)
(tally.mean, tally.std_dev)
.. parsed-literal::
(10000, 1, 2)
.. parsed-literal::
(array([[[ 0.00456408, 0. ]],
[[ 0.00453882, 0. ]],
[[ 0.00455715, 0. ]],
...,
[[ 0.00456105, 0. ]],
[[ 0.00455358, 0. ]],
[[ 0.00455522, 0. ]]]),
array([[[ 1.95085625e-05, 0.00000000e+00]],
[[ 1.78129859e-05, 0.00000000e+00]],
[[ 1.89709648e-05, 0.00000000e+00]],
...,
[[ 1.56286612e-05, 0.00000000e+00]],
[[ 1.65813279e-05, 0.00000000e+00]],
[[ 1.67530331e-05, 0.00000000e+00]]]))
The tally data has three dimensions: one for filter combinations, one
for nuclides, and one for scores. We see that there are 10000 filter
combinations (corresponding to the 100 x 100 mesh bins), a single
nuclide (since none was specified), and two scores. If we only want to
look at a single score, we can use the ``get_slice(...)`` method as
follows.
.. code:: python
flux = tally.get_slice(scores=['flux'])
fission = tally.get_slice(scores=['fission'])
print(flux)
.. parsed-literal::
Tally
ID = 10000
Name =
Filters =
mesh [10000]
Nuclides = total
Scores = [u'flux']
Estimator = tracklength
To get the bins into a form that we can plot, we can simply change the
shape of the array since it is a numpy array.
.. code:: python
flux.std_dev.shape = (100, 100)
flux.mean.shape = (100, 100)
fission.std_dev.shape = (100, 100)
fission.mean.shape = (100, 100)
.. code:: python
fig = plt.subplot(121)
fig.imshow(flux.mean)
fig2 = plt.subplot(122)
fig2.imshow(fission.mean)
.. parsed-literal::
<matplotlib.image.AxesImage at 0x7fe38b3027d0>
.. image:: post-processing-content_files/post-processing-content_44_1.png
Now let's say we want to look at the distribution of relative errors of
our tally bins for flux. First we create a new variable called
``relative_error`` and set it to the ratio of the standard deviation and
the mean, being careful not to divide by zero in case some bins were
never scored to.
.. code:: python
# Determine relative error
relative_error = np.zeros_like(flux.std_dev)
nonzero = flux.mean > 0
relative_error[nonzero] = flux.std_dev[nonzero] / flux.mean[nonzero]
# distribution of relative errors
ret = plt.hist(relative_error[nonzero], bins=50)
.. image:: post-processing-content_files/post-processing-content_46_0.png
Source Sites
------------
Source sites can be accessed from the ``source`` property. As shown
below, the source sites are represented as a numpy array with a
structured datatype.
.. code:: python
sp.source
.. parsed-literal::
array([ (1.0, [0.2712169917165897, -0.04844236597355761, -0.1887902218343974], [0.3889598463000694, 0.8470657529949065, 0.36220139158953857], 2.2746035619924734, 0),
(1.0, [0.080729018085932, 0.19838688738571317, -0.38053428394017363], [-0.6604834049157511, -0.6893239101986768, 0.2976478097673534], 0.7833467555325838, 0),
(1.0, [0.019430574216787868, 0.06594180627832635, 0.23329810254580194], [-0.7472138923667574, 0.13227244377548197, -0.651287493870243], 1.1632342240714935, 0),
...,
(1.0, [0.18544614514351207, -0.0113070561851496, 0.5468392238881264], [-0.8006491411918817, 0.43855795172388223, -0.4082007786475368], 1.4358240241589555, 0),
(1.0, [0.18544614514351207, -0.0113070561851496, 0.5468392238881264], [-0.5150076397044656, -0.34922134026850293, 0.7828228321575105], 1.5771133724329802, 0),
(1.0, [-0.2722999793764598, 0.22680062445008103, 0.2987060438567475], [0.9207818175032396, -0.2884020326181676, 0.26265017063984586], 2.932342523379745, 0)],
dtype=[('wgt', '<f8'), ('xyz', '<f8', (3,)), ('uvw', '<f8', (3,)), ('E', '<f8'), ('delayed_group', '<i4')])
If we want, say, only the energies from the source sites, we can simply
index the source array with the name of the field:
.. code:: python
sp.source['E']
.. parsed-literal::
array([ 2.27460356, 0.78334676, 1.16323422, ..., 1.43582402,
1.57711337, 2.93234252])
Now, we can look at things like the energy distribution of source sites.
Note that we don't directly use the ``matplotlib.pyplot.hist`` method
since our binning is logarithmic.
.. code:: python
# Create log-spaced energy bins from 1 keV to 100 MeV
energy_bins = np.logspace(-3,1)
# Calculate pdf for source energies
probability, bin_edges = np.histogram(sp.source['E'], energy_bins, density=True)
# Make sure integrating the PDF gives us unity
print(sum(probability*np.diff(energy_bins)))
# Plot source energy PDF
plt.semilogx(energy_bins[:-1], probability*np.diff(energy_bins), linestyle='steps')
plt.xlabel('Energy (MeV)')
plt.ylabel('Probability/MeV')
.. parsed-literal::
1.0
.. parsed-literal::
<matplotlib.text.Text at 0x7fe3652fd810>
.. image:: post-processing-content_files/post-processing-content_53_2.png
Let's also look at the spatial distribution of the sites. To make the
plot a little more interesting, we can also include the direction of the
particle emitted from the source and color each source by the logarithm
of its energy.
.. code:: python
plt.quiver(sp.source['xyz'][:,0], sp.source['xyz'][:,1],
sp.source['uvw'][:,0], sp.source['uvw'][:,1],
np.log(sp.source['E']), cmap='jet', scale=20.0)
plt.colorbar()
plt.xlim((-0.5,0.5))
plt.ylim((-0.5,0.5))
.. parsed-literal::
(-0.5, 0.5)
.. parsed-literal::
/usr/lib/pymodules/python2.7/matplotlib/collections.py:548: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if self._edgecolors == 'face':
.. image:: post-processing-content_files/post-processing-content_55_2.png

View file

@ -0,0 +1,13 @@
.. _notebook_post_processing:
===============
Post Processing
===============
.. only:: html
.. notebook:: post-processing.ipynb
.. only:: latex
IPython notebooks must be viewed in the online HTML documentation.

File diff suppressed because it is too large Load diff

View file

@ -57,13 +57,26 @@ on a given module or class.
summary
tallies
**Multi-Group Cross Section Generation**
.. toctree::
:maxdepth: 1
mgxs
energy_groups
mgxs_library
**Example Jupyter Notebooks:**
.. toctree::
:maxdepth: 1
examples/post-processing
examples/pandas-dataframes
examples/tally-arithmetic
examples/mgxs-part-i
examples/mgxs-part-ii
examples/mgxs-part-iii
.. _Jupyter: https://jupyter.org/
.. _NumPy: http://www.numpy.org/

View file

@ -0,0 +1,66 @@
.. _pythonapi_mgxs:
==========================
Multi-Group Cross Sections
==========================
.. currentmodule:: openmc.mgxs.mgxs
----------------------------
Summary of Available Classes
----------------------------
.. autosummary::
MGXS
AbsorptionXS
CaptureXS
Chi
FissionXS
NuFissionXS
NuScatterXS
NuScatterMatrixXS
ScatterXS
ScatterMatrixXS
TotalXS
TransportXS
-------------------
Class Documentation
-------------------
.. autoclass:: MGXS
:members:
.. autoclass:: AbsorptionXS
:members:
.. autoclass:: CaptureXS
:members:
.. autoclass:: Chi
:members:
.. autoclass:: FissionXS
:members:
.. autoclass:: NuFissionXS
:members:
.. autoclass:: NuScatterXS
:members:
.. autoclass:: NuScatterMatrixXS
:members:
.. autoclass:: ScatterXS
:members:
.. autoclass:: ScatterMatrixXS
:members:
.. autoclass:: TotalXS
:members:
.. autoclass:: TransportXS
:members:

View file

@ -0,0 +1,8 @@
.. _pythonapi_mgxs_library:
============
MGXS Library
============
.. automodule:: openmc.mgxs.library
:members:

View file

@ -35,8 +35,8 @@ Installing from Source on Linux or Mac OS X
-------------------------------------------
All OpenMC source code is hosted on GitHub_. If you have git_, the gfortran_
compiler, and CMake_ installed, you can download and install OpenMC be entering
the following commands in a terminal:
compiler, CMake_, and HDF5_ installed, you can download and install OpenMC be
entering the following commands in a terminal:
.. code-block:: sh

View file

@ -1,9 +1,30 @@
.. _releasenotes:
==============================
Release Notes for OpenMC 0.7.0
Release Notes for OpenMC 0.7.1
==============================
This release of OpenMC provides some substantial improvements over version
0.7.0. Non-simple cell regions can now be defined through the ``|`` (union) and
``~`` (complement) operators. Similar changes in the Python API also allow
complex cell regions to be defined. A true secondary particle bank now exists;
this is crucial for photon transport (to be added in the next minor release). A
rich API for multi-group cross section generation has been added via the
``openmc.mgxs`` Python module.
Various improvements to tallies have also been made. It is now possible to
explicitly specify that a collision estimator be used in a tally. A new
``delayedgroup`` filter and ``delayed-nu-fission`` score allow a user to obtain
delayed fission neutron production rates filtered by delayed group. Finally, the
new ``inverse-velocity`` score may be useful for calculating kinetics
parameters.
.. caution:: In previous versions, depending on how OpenMC was compiled binary
output was either given in HDF5 or a flat binary format. With this
version, all binary output is now HDF5 which means you **must**
have HDF5 in order to install OpenMC. Please consult the user's
guide for instructions on how to compile with HDF5.
-------------------
System Requirements
-------------------
@ -17,36 +38,41 @@ the problem at hand (mostly on the number of nuclides in the problem).
New Features
------------
- Complete Python API
- Python 3 compatability for all scripts
- All scripts consistently named openmc-* and installed together
- New 'distribcell' tally filter for repeated cells
- Ability to specify outer lattice universe
- XML input validation utility (openmc-validate-xml)
- Support for hexagonal lattices
- Material union energy grid method
- Tally triggers
- Remove dependence on PETSc
- Significant OpenMP performance improvements
- Support for Fortran 2008 MPI interface
- Use of Travis CI for continuous integration
- Simplifications and improvements to test suite
- Support for complex cell regions (union and complement operators)
- Generic quadric surface type
- Improved handling of secondary particles
- Binary output is now solely HDF5
- ``openmc.mgxs`` Python module enabling multi-group cross section generation
- Collision estimator for tallies
- Delayed fission neutron production tallies with ability to filter by delayed
group
- Inverse velocity tally score
- Performance improvements for binary search
- Performance improvements for reaction rate tallies
---------
Bug Fixes
---------
- b5f712_: Fix bug in spherical harmonics tallies
- e6675b_: Ensure all constants are double precision
- 04e2c1_: Fix potential bug in sample_nuclide routine
- 6121d9_: Fix bugs related to particle track files
- 2f0e89_: Fixes for nuclide specification in tallies
- 299322_: Bug with material filter when void material present
- d74840_: Fix triggers on tallies with multiple filters
- c29a81_: Correctly handle maximum transport energy
- 3edc23_: Fixes in the nu-scatter score
- 629e3b_: Assume unspecified surface coefficients are zero in Python API
- 5dbe8b_: Fix energy filters for openmc-plot-mesh-tally
- ff66f4_: Fixes in the openmc-plot-mesh-tally script
- 441fd4_: Fix bug in kappa-fission score
- 7e5974_: Allow fixed source simulations from Python API
.. _b5f712: https://github.com/mit-crpg/openmc/commit/b5f712
.. _e6675b: https://github.com/mit-crpg/openmc/commit/e6675b
.. _04e2c1: https://github.com/mit-crpg/openmc/commit/04e2c1
.. _6121d9: https://github.com/mit-crpg/openmc/commit/6121d9
.. _2f0e89: https://github.com/mit-crpg/openmc/commit/2f0e89
.. _299322: https://github.com/mit-crpg/openmc/commit/299322
.. _d74840: https://github.com/mit-crpg/openmc/commit/d74840
.. _c29a81: https://github.com/mit-crpg/openmc/commit/c29a81
.. _3edc23: https://github.com/mit-crpg/openmc/commit/3edc23
.. _629e3b: https://github.com/mit-crpg/openmc/commit/629e3b
.. _5dbe8b: https://github.com/mit-crpg/openmc/commit/5dbe8b
.. _ff66f4: https://github.com/mit-crpg/openmc/commit/ff66f4
.. _441fd4: https://github.com/mit-crpg/openmc/commit/441fd4
.. _7e5974: https://github.com/mit-crpg/openmc/commit/7e5974
------------
Contributors
@ -55,13 +81,11 @@ Contributors
This release contains new contributions from the following people:
- `Will Boyd <wbinventor@gmail.com>`_
- `Matt Ellis <mellis13@mit.edu>`_
- `Sterling Harper <sterlingmharper@mit.edu>`_
- `Bryan Herman <bherman@mit.edu>`_
- `Nicholas Horelik <nicholas.horelik@gmail.com>`_
- `Bryan Herman <hermab53@gmail.com>`_
- `Colin Josey <cjosey@mit.edu>`_
- `William Lyu <PaleNeutron@users.noreply.github.com>`_
- `Adam Nelson <nelsonag@umich.edu>`_
- `Paul Romano <paul.k.romano@gmail.com>`_
- `Anthony Scopatz <scopatz@gmail.com>`_
- `Kelly Rowland <kellylynnerowland@gmail.com>`_
- `Sam Shaner <samuelshaner@gmail.com>`_
- `Jon Walsh <walshjon@mit.edu>`_

View file

@ -5,7 +5,7 @@ User's Guide
============
Welcome to the OpenMC User's Guide! This tutorial will guide you through the
essential aspects of using OpenMC to perform neutronic simulations.
essential aspects of using OpenMC to perform simulations.
.. toctree::
:numbered:
@ -14,5 +14,6 @@ essential aspects of using OpenMC to perform neutronic simulations.
beginners
install
input
output/index
processing
troubleshoot

View file

@ -79,14 +79,13 @@ Message Description
[VALID] XML file matches RelaxNG.
======================== ===================================
As an example, if OpenMC is installed in the directory
``/opt/openmc/0.6.2`` and the current working directory is where
OpenMC XML input files are located, they can be validated using
the following command:
As an example, if OpenMC is installed in the directory ``/opt/openmc/`` and the
current working directory is where OpenMC XML input files are located, they can
be validated using the following command:
.. code-block:: bash
/opt/openmc/0.6.2/bin/xml_validate
/opt/openmc/bin/openmc-validate-xml
--------------------------------------
Settings Specification -- settings.xml
@ -721,9 +720,8 @@ Geometry Specification -- geometry.xml
The geometry in OpenMC is described using `constructive solid geometry`_ (CSG),
also sometimes referred to as combinatorial geometry. CSG allows a user to
create complex objects using Boolean operators on a set of simpler surfaces. In
the geometry model, each unique closed volume in defined by its bounding
surfaces. In OpenMC, most `quadratic surfaces`_ can be modeled and used as
bounding surfaces.
the geometry model, each unique volume is defined by its bounding surfaces. In
OpenMC, most `quadratic surfaces`_ can be modeled and used as bounding surfaces.
Every geometry.xml must have an XML declaration at the beginning of the file and
a root element named geometry. Within the root element the user can define any
@ -746,7 +744,7 @@ number of cells, surfaces, and lattices. Let us look at the following example:
<id>1</id>
<universe>0</universe>
<material>1</material>
<surfaces>-1</surfaces>
<region>-1</region>
</cell>
</geometry>
@ -764,7 +762,7 @@ could be written as:
<!-- This is a comment -->
<surface id="1" type="sphere" coeffs="0.0 0.0 0.0 5.0" boundary="vacuum" />
<cell id="1" universe="0" material="1" surfaces="-1" />
<cell id="1" universe="0" material="1" region="-1" />
</geometry>
@ -788,7 +786,8 @@ Each ``<surface>`` element can have the following attributes or sub-elements:
:type:
The type of the surfaces. This can be "x-plane", "y-plane", "z-plane",
"plane", "x-cylinder", "y-cylinder", "z-cylinder", or "sphere".
"plane", "x-cylinder", "y-cylinder", "z-cylinder", "sphere", "x-cone",
"y-cone", "z-cone", or "quadric".
*Default*: None
@ -856,6 +855,12 @@ The following quadratic surfaces can be modeled:
R^2 (z - z_0)^2`. The coefficients specified are ":math:`x_0 \: y_0 \: z_0
\: R^2`".
:quadric:
A general quadric surface of the form :math:`Ax^2 + By^2 + Cz^2 + Dxy +
Eyz + Fxz + Gx + Hy + Jz + K = 0` The coefficients specified are ":math:`A
\: B \: C \: D \: E \: F \: G \: H \: J \: K`".
``<cell>`` Element
------------------
@ -892,15 +897,29 @@ Each ``<cell>`` element can have the following attributes or sub-elements:
*Default*: None
:surfaces:
A list of the ``ids`` for surfaces that bound this cell, e.g. if the cell
is on the negative side of surface 3 and the positive side of surface 5, the
bounding surfaces would be given as "-3 5".
:region:
A Boolean expression of half-spaces that defines the spatial region which
the cell occupies. Each half-space is identified by the unique ID of the
surface prefixed by `-` or `+` to indicate that it is the negative or
positive half-space, respectively. The `+` sign for a positive half-space
can be omitted. Valid Boolean operators are parentheses, union `|`,
complement `~`, and intersection. Intersection is implicit and indicated by
the presence of whitespace. The order of operator precedence is parentheses,
complement, intersection, and then union.
.. note:: The surface attribute/element can be omitted to make a cell fill
its entire universe.
As an example, the following code gives a cell that is the union of the
negative half-space of surface 3 and the complement of the intersection of
the positive half-space of surface 5 and the negative half-space of surface
2:
*Default*: No surfaces
.. code-block:: xml
<cell id="1" material="1" region="-3 | ~(5 -2)" />
.. note:: The ``region`` attribute/element can be omitted to make a cell
fill its entire universe.
*Default*: A region filling all space.
:rotation:
If the cell is filled with a universe, this element specifies the angles in
@ -1095,8 +1114,10 @@ Each ``material`` element can have the following attributes or sub-elements:
An element with attributes/sub-elements called ``value`` and ``units``. The
``value`` attribute is the numeric value of the density while the ``units``
can be "g/cm3", "kg/m3", "atom/b-cm", "atom/cm3", or "sum". The "sum" unit
indicates that the density should be calculated as the sum of the atom
fractions for each nuclide in the material. This should not be used in
indicates that values appearing in ``ao`` attributes for ``<nuclide>`` and
``<element>`` sub-elements are to be interpreted as nuclide/element
densities in atom/b-cm, and the total density of the material is taken as
the sum of all nuclides/elements. The "sum" option cannot be used in
conjunction with weight percents.
*Default*: None
@ -1117,6 +1138,15 @@ Each ``material`` element can have the following attributes or sub-elements:
.. note:: If one nuclide is specified in atom percent, all others must also
be given in atom percent. The same applies for weight percentages.
An optional attribute/sub-element for each nuclide is ``scattering``. This
attribute may be set to "data" to use the scattering laws specified by the
cross section library (default). Alternatively, when set to "iso-in-lab",
the scattering laws are used to sample the outgoing energy but an
isotropic-in-lab distribution is used to sample the outgoing angle at each
scattering interaction. The ``scattering`` attribute may be most useful
when using OpenMC to compute multi-group cross-sections for deterministic
transport codes and to quantify the effects of anisotropic scattering.
*Default*: None
:element:
@ -1143,6 +1173,16 @@ Each ``material`` element can have the following attributes or sub-elements:
*Default*: None
An optional attribute/sub-element for each element is ``scattering``. This
attribute may be set to "data" to use the scattering laws specified by the
cross section library (default). Alternatively, when set to "iso-in-lab",
the scattering laws are used to sample the outgoing energy but an
isotropic-in-lab distribution is used to sample the outgoing angle at each
scattering interaction. The ``scattering`` attribute may be most useful
when using OpenMC to compute multi-group cross-sections for deterministic
transport codes and to quantify the effects of anisotropic scattering.
*Default*: None
:sab:
Associates an S(a,b) table with the material. This element has
@ -1214,8 +1254,8 @@ The ``<tally>`` element accepts the following sub-elements:
:type:
The type of the filter. Accepted options are "cell", "cellborn",
"material", "universe", "energy", "energyout", "mesh", and
"distribcell".
"material", "universe", "energy", "energyout", "mesh", "distribcell",
and "delayedgroup".
:bins:
For each filter type, the corresponding ``bins`` entry is given as
@ -1240,17 +1280,87 @@ The ``<tally>`` element accepts the following sub-elements:
:energy:
A monotonically increasing list of bounding **pre-collision** energies
for a number of groups. For example, if this filter is specified as
``<filter type="energy" bins="0.0 1.0 20.0" />``, then two energy bins
will be created, one with energies between 0 and 1 MeV and the other
with energies between 1 and 20 MeV.
.. code-block:: xml
<filter type="energy" bins="0.0 1.0 20.0" />
then two energy bins will be created, one with energies between 0 and
1 MeV and the other with energies between 1 and 20 MeV.
:energyout:
A monotonically increasing list of bounding **post-collision**
energies for a number of groups. For example, if this filter is
specified as ``<filter type="energyout" bins="0.0 1.0 20.0" />``, then
two post-collision energy bins will be created, one with energies
specified as
.. code-block:: xml
<filter type="energyout" bins="0.0 1.0 20.0" />
then two post-collision energy bins will be created, one with energies
between 0 and 1 MeV and the other with energies between 1 and 20 MeV.
:mu:
A monotonically increasing list of bounding **post-collision** cosines
of the change in a particle's angle (i.e., :math:`\mu = \hat{\Omega}
\cdot \hat{\Omega}'`), which represents a portion of the possible
values of :math:`[-1,1]`. For example, spanning all of :math:`[-1,1]`
with five equi-width bins can be specified as:
.. code-block:: xml
<filter type="mu" bins="-1.0 -0.6 -0.2 0.2 0.6 1.0" />
Alternatively, if only one value is provided as a bin, OpenMC will
interpret this to mean the complete range of :math:`[-1,1]` should
be automatically subdivided in to the provided value for the bin.
That is, the above example of five equi-width bins spanning
:math:`[-1,1]` can be instead written as:
.. code-block:: xml
<filter type="mu" bins="5" />
:polar:
A monotonically increasing list of bounding particle polar angles
which represents a portion of the possible values of :math:`[0,\pi]`.
For example, spanning all of :math:`[0,\pi]` with five equi-width
bins can be specified as:
.. code-block:: xml
<filter type="polar" bins="0.0 0.6283 1.2566 1.8850 2.5132 3.1416"/>
Alternatively, if only one value is provided as a bin, OpenMC will
interpret this to mean the complete range of :math:`[0,\pi]` should
be automatically subdivided in to the provided value for the bin.
That is, the above example of five equi-width bins spanning
:math:`[0,\pi]` can be instead written as:
.. code-block:: xml
<filter type="polar" bins="5" />
:azimuthal:
A monotonically increasing list of bounding particle azimuthal angles
which represents a portion of the possible values of :math:`[-\pi,\pi)`.
For example, spanning all of :math:`[-\pi,\pi)` with two equi-width
bins can be specified as:
.. code-block:: xml
<filter type="azimuthal" bins="0.0 3.1416 6.2832" />
Alternatively, if only one value is provided as a bin, OpenMC will
interpret this to mean the complete range of :math:`[-\pi,\pi)` should
be automatically subdivided in to the provided value for the bin.
That is, the above example of five equi-width bins spanning
:math:`[-\pi,\pi)` can be instead written as:
.. code-block:: xml
<filter type="azimuthal" bins="2" />
:mesh:
The ``id`` of a structured mesh to be tallied over.
@ -1263,6 +1373,15 @@ The ``<tally>`` element accepts the following sub-elements:
not accept more than one cell ID. It is not recommended to combine
this filter with a cell or mesh filter.
:delayedgroup:
A list of delayed neutron precursor groups for which the tally should
be accumulated. For instance, to tally to all 6 delayed groups in the
ENDF/B-VII.1 library the filter is specified as:
.. code-block:: xml
<filter type="delayedgroup" bins="1 2 3 4 5 6" />
:nuclides:
If specified, the scores listed will be for particular nuclides, not the
summation of reactions from all nuclides. The format for nuclides should be
@ -1278,26 +1397,32 @@ The ``<tally>`` element accepts the following sub-elements:
*Default*: total
:estimator:
The estimator element is used to force the use of either ``analog`` or
``tracklength`` tally estimation. ''analog'' is generally less efficient
though it can be used with every score type. ''tracklength'' is generally
the most efficient, though its usage is restricted to tallies that do not
score particle information which requires a collision to have occured, such
as a scattering tally which utilizes outgoing energy filters.
The estimator element is used to force the use of either ``analog``,
``collision``, or ``tracklength`` tally estimation. ``analog`` is generally
the least efficient though it can be used with every score type.
``tracklength`` is generally the most efficient, but neither ``tracklength``
nor ``collision`` can be used to score a tally that requires post-collision
information. For example, a scattering tally with outgoing energy filters
cannot be used with ``tracklength`` or ``collision`` because the code will
not know the outgoing energy distribution.
*Default*: ``tracklength`` but will revert to analog if necessary.
*Default*: ``tracklength`` but will revert to ``analog`` if necessary.
:scores:
A space-separated list of the desired responses to be accumulated. Accepted
options are "flux", "total", "scatter", "absorption", "fission",
"nu-fission", "kappa-fission", "nu-scatter", "scatter-N", "scatter-PN",
"scatter-YN", "nu-scatter-N", "nu-scatter-PN", "nu-scatter-YN", "flux-YN",
"total-YN", "current", and "events". These corresponding to the following
physical quantities:
"nu-fission", "delayed-nu-fission", "kappa-fission", "nu-scatter",
"scatter-N", "scatter-PN", "scatter-YN", "nu-scatter-N", "nu-scatter-PN",
"nu-scatter-YN", "flux-YN", "total-YN", "current", "inverse-velocity" and
"events". These correspond to the following physical quantities:
:flux:
Total flux in particle-cm per source particle.
.. note::
The ``analog`` estimator is actually identical to the ``collision``
estimator for the flux score.
:total:
Total reaction rate in reactions per source particle.
@ -1316,6 +1441,10 @@ The ``<tally>`` element accepts the following sub-elements:
Total production of neutrons due to fission. Units are neutrons produced
per source neutron.
:delayed-nu-fission:
Total production of delayed neutrons due to fission. Units are neutrons produced
per source neutron.
:kappa-fission:
The recoverable energy production rate due to fission. The recoverable
energy is defined as the fission product kinetic energy, prompt and
@ -1378,6 +1507,14 @@ The ``<tally>`` element accepts the following sub-elements:
specified. Furthermore, it may not be used in conjunction with any
other score.
:inverse-velocity:
The flux-weighted inverse velocity where the velocity is in units of
centimeters per second.
.. note::
The ``analog`` estimator is actually identical to the ``collision``
estimator for the inverse-velocity score.
:events:
Number of scoring events. Units are events per source particle.
@ -1423,8 +1560,7 @@ a separate element with the tag name ``<mesh>``. This element has the following
attributes/sub-elements:
:type:
The type of structured mesh. Valid options include "rectangular" and
"hexagonal".
The type of structured mesh. The only valid option is "regular".
:dimension:
The number of mesh cells in each direction.
@ -1526,16 +1662,16 @@ sub-elements:
*Default*: None - Required entry
:type:
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.
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
``openmc-voxel-to-silovtk`` utility provided with the OpenMC source, and
subsequently viewed with a 3D viewer such as VISIT or Paraview. See the
:ref:`usersguide_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

View file

@ -8,7 +8,7 @@ Installation and Configuration
Installing on Ubuntu with PPA
-----------------------------
For users with Ubuntu 11.10 or later, a binary package for OpenMC is available
For users with Ubuntu 15.04 or later, a binary package for OpenMC is available
through a Personal Package Archive (PPA) and can be installed through the APT
package manager. First, add the following PPA to the repository sources:
@ -28,6 +28,9 @@ Now OpenMC should be recognized within the repository and can be installed:
sudo apt-get install openmc
Binary packages from this PPA may exist for earlier versions of Ubuntu, but they
are no longer supported.
--------------------
Building from Source
--------------------
@ -59,6 +62,37 @@ Prerequisites
sudo apt-get install cmake
* HDF5_ Library for portable binary output format
OpenMC uses HDF5 for binary output files. As such, you will need to have
HDF5 installed on your computer. The installed version will need to have
been compiled with the same compiler you intend to compile OpenMC with. If
you are using HDF5 in conjunction with MPI, we recommend that your HDF5
installation be built with parallel I/O features. An example of
configuring HDF5_ is listed below::
FC=/opt/mpich/3.1/bin/mpif90 CC=/opt/mpich/3.1/bin/mpicc \
./configure --prefix=/opt/hdf5/1.8.12 --enable-fortran \
--enable-fortran2003 --enable-parallel
You may omit ``--enable-parallel`` if you want to compile HDF5_ in serial.
.. important::
OpenMC uses various parts of the HDF5 Fortran 2003 API; as such you
must include ``--enable-fortran2003`` or else OpenMC will not be able
to compile.
On Debian derivatives, HDF5 and/or parallel HDF5 can be installed through
the APT package manager:
.. code-block:: sh
sudo apt-get install libhdf5-8 libhdf5-dev hdf5-helpers
Note that the exact package names may vary depending on your particular
distribution and version.
.. admonition:: Optional
* An MPI implementation for distributed-memory parallel runs
@ -72,20 +106,6 @@ Prerequisites
sudo apt-get install mpich libmpich-dev
sudo apt-get install openmpi-bin libopenmpi1.6 libopenmpi-dev
* HDF5_ Library for portable binary output format
To compile with support for HDF5_ output (highly recommended), you will
need to have HDF5 installed on your computer. The installed version will
need to have been compiled with the same compiler you intend to compile
OpenMC with. HDF5_ must be built with parallel I/O features if you intend
to use HDF5_ with MPI. An example of configuring HDF5_ is listed below::
FC=/opt/mpich/3.1/bin/mpif90 CC=/opt/mpich/3.1/bin/mpicc \
./configure --prefix=/opt/hdf5/1.8.12 --enable-fortran \
--enable-fortran2003 --enable-parallel
You may omit ``--enable-parallel`` if you want to compile HDF5_ in serial.
* git_ version control software for obtaining source code
.. _gfortran: http://gcc.gnu.org/wiki/GFortran
@ -194,27 +214,26 @@ command, i.e.
FC=mpif90 cmake /path/to/openmc
Compiling with HDF5
+++++++++++++++++++
To compile with MPI, set the :envvar:`FC` environment variable to the path to
the HDF5 Fortran wrapper. For example, in a bash shell:
Selecting HDF5 Installation
+++++++++++++++++++++++++++
CMakeLists.txt searches for the ``h5fc`` or ``h5pfc`` HDF5 Fortran wrapper on
your PATH environment variable and subsequently uses it to determine library
locations and compile flags. If you have multiple installations of HDF5 or one
that does not appear on your PATH, you can set the HDF5_ROOT environment
variable to the root directory of the HDF5 installation, e.g.
.. code-block:: sh
export FC=h5fc
export HDF5_ROOT=/opt/hdf5/1.8.15
cmake /path/to/openmc
As noted above, an environment variable can typically be set for a single
command, i.e.
This will cause CMake to search first in /opt/hdf5/1.8.15/bin for ``h5fc`` /
``h5pfc`` before it searches elsewhere. As noted above, an environment variable
can typically be set for a single command, i.e.
.. code-block:: sh
FC=h5fc cmake /path/to/openmc
To compile with support for both MPI and HDF5, use the parallel HDF5 wrapper
``h5pfc`` instead. Note that this requires that your HDF5 installation be
compiled with ``--enable-parallel``.
HDF5_ROOT=/opt/hdf5/1.8.15 cmake /path/to/openmc
Compiling on Linux and Mac OS X
-------------------------------
@ -308,6 +327,25 @@ This will build an executable named ``openmc``.
.. _MinGW: http://www.mingw.org
.. _SourceForge: http://sourceforge.net/projects/mingw
Compiling for the Intel Xeon Phi
--------------------------------
In order to build OpenMC for the Intel Xeon Phi using the Intel Fortran
compiler, it is necessary to specify that all objects be compiled with the
``-mmic`` flag as follows:
.. code-block:: sh
mkdir build && cd build
FC=ifort FFLAGS=-mmic cmake -Dopenmp=on ..
make
Note that unless an HDF5 build for the Intel Xeon Phi is already on your target
machine, you will need to cross-compile HDF5 for the Xeon Phi. An `example
script`_ to build zlib and HDF5 provides several necessary workarounds.
.. _example script: https://github.com/paulromano/install-scripts/blob/master/install-hdf5-mic
Testing Build
-------------

View file

@ -0,0 +1,16 @@
.. _usersguide_output:
===================
Output File Formats
===================
.. toctree::
:numbered:
:maxdepth: 3
statepoint
source
summary
particle_restart
track
voxel

View file

@ -0,0 +1,57 @@
.. _usersguide_particle_restart:
============================
Particle Restart File Format
============================
The current revision of the particle restart file format is 1.
**/filetype** (*char[]*)
String indicating the type of file.
**/revision** (*int*)
Revision of the particle restart file format. Any time a change is made in
the format, this integer is incremented.
**/current_batch** (*int*)
The number of batches already simulated.
**/gen_per_batch** (*int*)
Number of generations per batch.
**/current_gen** (*int*)
The number of generations already simulated.
**/n_particles** (*int8_t*)
Number of particles used per generation.
**/run_mode** (*int*)
Run mode used. A value of 1 indicates a fixed-source run and a value of 2
indicates an eigenvalue run.
**/id** (*int8_t*)
Unique identifier of the particle.
**/weight** (*double*)
Weight of the particle.
**/energy** (*double*)
Energy of the particle in MeV.
**/xyz** (*double[3]*)
Position of the particle.
**/uvw** (*double[3]*)
Direction of the particle.

View file

@ -0,0 +1,19 @@
.. _usersguide_source:
==================
Source File Format
==================
Normally, source data is stored in a state point file. However, it is possible
to request that the source be written separately, in which case the format used
is that documented here.
**/filetype** (*char[]*)
String indicating the type of file.
**/source_bank** (Compound type)
Source bank information for each particle. The compound type has fields
``wgt``, ``xyz``, ``uvw``, and ``E`` which represent the weight, position,
direction, and energy of the source particle, respectively.

View file

@ -0,0 +1,259 @@
.. _usersguide_statepoint:
=======================
State Point File Format
=======================
The current revision of the statepoint file format is 14.
**/filetype** (*char[]*)
String indicating the type of file.
**/revision** (*int*)
Revision of the state point file format. Any time a change is made in the
format, this integer is incremented.
**/version_major** (*int*)
Major version number for OpenMC
**/version_minor** (*int*)
Minor version number for OpenMC
**/version_release** (*int*)
Release version number for OpenMC
**/date_and_time** (*char[]*)
Date and time the state point was written.
**/path** (*char[]*)
Absolute path to directory containing input files.
**/seed** (*int8_t*)
Pseudo-random number generator seed.
**/run_mode** (*char[]*)
Run mode used. A value of 1 indicates a fixed-source run and a value of 2
indicates an eigenvalue run.
**/n_particles** (*int8_t*)
Number of particles used per generation.
**/n_batches** (*int*)
Number of batches to simulate.
**/current_batch** (*int*)
The number of batches already simulated.
if run_mode == 'k-eigenvalue':
**/n_inactive** (*int*)
Number of inactive batches.
**/gen_per_batch** (*int*)
Number of generations per batch.
**/k_generation** (*double[]*)
k-effective for each generation simulated.
**/entropy** (*double[]*)
Shannon entropy for each generation simulated
**/k_col_abs** (*double*)
Sum of product of collision/absorption estimates of k-effective
**/k_col_tra** (*double*)
Sum of product of collision/track-length estimates of k-effective
**/k_abs_tra** (*double*)
Sum of product of absorption/track-length estimates of k-effective
**/k_combined** (*double[2]*)
Mean and standard deviation of a combined estimate of k-effective
**/cmfd_on** (*int*)
Flag indicating whether CMFD is on (1) or off (0).
if (cmfd_on)
**/cmfd/indices** (*int[4]*)
Indices for cmfd mesh (i,j,k,g)
**/cmfd/k_cmfd** (*double[]*)
CMFD eigenvalues
**/cmfd/cmfd_src** (*double[][][][]*)
CMFD fission source
**/cmfd/cmfd_entropy** (*double[]*)
CMFD estimate of Shannon entropy
**/cmfd/cmfd_balance** (*double[]*)
RMS of the residual neutron balance equation on CMFD mesh
**/cmfd/cmfd_dominance** (*double[]*)
CMFD estimate of dominance ratio
**/cmfd/cmfd_srccmp** (*double[]*)
RMS comparison of difference between OpenMC and CMFD fission source
**/tallies/n_meshes** (*int*)
Number of meshes in tallies.xml file
**/tally/meshes/ids** (*int[]*)
Internal unique ID of each mesh.
**/tally/meshes/keys** (*int[]*)
User-identified unique ID of each mesh.
**/tallies/meshes/mesh <uid>/type** (*char[]*)
Type of mesh.
**/tallies/meshes/mesh <uid>/dimension** (*int*)
Number of mesh cells in each dimension.
**/tallies/meshes/mesh <uid>/lower_left** (*double[]*)
Coordinates of lower-left corner of mesh.
**/tallies/meshes/mesh <uid>/upper_right** (*double[]*)
Coordinates of upper-right corner of mesh.
**/tallies/meshes/mesh <uid>/width** (*double[]*)
Width of each mesh cell in each dimension.
**/tallies/n_tallies** (*int*)
Number of user-defined tallies.
**/tallies/ids** (*int[]*)
Internal unique ID of each tally.
**/tallies/keys** (*int[]*)
User-identified unique ID of each tally.
**/tallies/tally <uid>/estimator** (*char[]*)
Type of tally estimator, either 'analog', 'tracklength', or 'collision'.
**/tallies/tally <uid>/n_realizations** (*int*)
Number of realizations.
**/tallies/tally <uid>/n_filters** (*int*)
Number of filters used.
**/tallies/tally <uid>/filter <j>/type** (*char[]*)
Type of the j-th filter. Can be 'universe', 'material', 'cell', 'cellborn',
'surface', 'mesh', 'energy', 'energyout', or 'distribcell'.
**/tallies/tally <uid>/filter <j>/offset** (*int*)
Filter offset (used for distribcell filter).
**/tallies/tally <uid>/filter <j>/n_bins** (*int*)
Number of bins for the j-th filter.
**/tallies/tally <uid>/filter <j>/bins** (*int[]* or *double[]*)
Value for each filter bin of this type.
**/tallies/tally <uid>/nuclides** (*char[][]*)
Array of nuclides to tally. Note that if no nuclide is specified in the user
input, a single 'total' nuclide appears here.
**/tallies/tally <uid>/n_score_bins** (*int*)
Number of scoring bins for a single nuclide. In general, this can be greater
than the number of user-specified scores since each score might have
multiple scoring bins, e.g., scatter-PN.
**/tallies/tally <uid>/score_bins** (*char[][]*)
Values of specified scores.
**/tallies/tally <uid>/n_user_scores** (*int*)
Number of scores without accounting for those added by expansions,
e.g. scatter-PN.
**/tallies/tally <uid>/moment_orders** (*char[][]*)
Tallying moment orders for Legendre and spherical harmonic tally expansions
(*e.g.*, 'P2', 'Y1,2', etc.).
**/tallies/tally <uid>/results** (Compound type)
Accumulated sum and sum-of-squares for each bin of the i-th tally. This is a
two-dimensional array, the first dimension of which represents combinations
of filter bins and the second dimensions of which represents scoring
bins. Each element of the array has fields 'sum' and 'sum_sq'.
**/source_present** (*int*)
Flag indicated if source bank is present in the file
**/n_realizations** (*int*)
Number of realizations for global tallies.
**/n_global_tallies** (*int*)
Number of global tally scores.
**/global_tallies** (Compound type)
Accumulated sum and sum-of-squares for each global tally. The compound type
has fields named ``sum`` and ``sum_sq``.
**tallies_present** (*int*)
Flag indicated if tallies are present in the file.
if (run_mode == 'k-eigenvalue' and source_present > 0)
**/source_bank** (Compound type)
Source bank information for each particle. The compound type has fields
``wgt``, ``xyz``, ``uvw``, and ``E`` which represent the weight,
position, direction, and energy of the source particle, respectively.

View file

@ -0,0 +1,311 @@
.. _usersguide_summary:
===================
Summary File Format
===================
The current revision of the summary file format is 1.
**/filetype** (*char[]*)
String indicating the type of file.
**/revision** (*int*)
Revision of the summary file format. Any time a change is made in the
format, this integer is incremented.
**/version_major** (*int*)
Major version number for OpenMC
**/version_minor** (*int*)
Minor version number for OpenMC
**/version_release** (*int*)
Release version number for OpenMC
**/date_and_time** (*char[]*)
Date and time the summary was written.
**/n_procs** (*int*)
Number of MPI processes used.
**/n_particles** (*int8_t*)
Number of particles used per generation.
**/n_batches** (*int*)
Number of batches to simulate.
**/n_inactive** (*int*)
Number of inactive batches. Only present if /run_mode is set to
'k-eigenvalue'.
**/n_active** (*int*)
Number of active batches. Only present if /run_mode is set to
'k-eigenvalue'.
**/gen_per_batch** (*int*)
Number of generations per batch. Only present if /run_mode is set to
'k-eigenvalue'.
**/geometry/n_cells** (*int*)
Number of cells in the problem.
**/geometry/n_surfaces** (*int*)
Number of surfaces in the problem.
**/geometry/n_universes** (*int*)
Number of unique universes in the problem.
**/geometry/n_lattices** (*int*)
Number of lattices in the problem.
**/geometry/cells/cell <uid>/index** (*int*)
Index in cells array used internally in OpenMC.
**/geometry/cells/cell <uid>/name** (*char[]*)
Name of the cell.
**/geometry/cells/cell <uid>/universe** (*int*)
Universe assigned to the cell. If none is specified, the default
universe (0) is assigned.
**/geometry/cells/cell <uid>/fill_type** (*char[]*)
Type of fill for the cell. Can be 'normal', 'universe', or 'lattice'.
**/geometry/cells/cell <uid>/material** (*int*)
Unique ID of the material assigned to the cell. This dataset is present only
if fill_type is set to 'normal'.
**/geometry/cells/cell <uid>/offset** (*int[]*)
Offsets used for distribcell tally filter. This dataset is present only if
fill_type is set to 'universe'.
**/geometry/cells/cell <uid>/translation** (*double[3]*)
Translation applied to the fill universe. This dataset is present only if
fill_type is set to 'universe'.
**/geometry/cells/cell <uid>/rotation** (*double[3]*)
Angles in degrees about the x-, y-, and z-axes for which the fill universe
should be rotated. This dataset is present only if fill_type is set to
'universe'.
**/geometry/cells/cell <uid>/lattice** (*int*)
Unique ID of the lattice which fills the cell. Only present if fill_type is
set to 'lattice'.
**/geometry/cells/cell <uid>/region** (*char[]*)
Region specification for the cell.
**/geometry/surfaces/surface <uid>/index** (*int*)
Index in surfaces array used internally in OpenMC.
**/geometry/surfaces/surface <uid>/name** (*char[]*)
Name of the surface.
**/geometry/surfaces/surface <uid>/type** (*char[]*)
Type of the surface. Can be 'x-plane', 'y-plane', 'z-plane', 'plane',
'x-cylinder', 'y-cylinder', 'sphere', 'x-cone', 'y-cone', 'z-cone', or
'quadric'.
**/geometry/surfaces/surface <uid>/coefficients** (*double[]*)
Array of coefficients that define the surface. See :ref:`surface_element`
for what coefficients are defined for each surface type.
**/geometry/surfaces/surface <uid>/boundary_condition** (*char[]*)
Boundary condition applied to the surface. Can be 'transmission', 'vacuum',
'reflective', or 'periodic'.
**/geometry/universes/universe <uid>/index** (*int*)
Index in the universes array used internally in OpenMC.
**/geometry/universes/universe <uid>/cells** (*int[]*)
Array of unique IDs of cells that appear in the universe.
**/geometry/lattices/lattice <uid>/index** (*int*)
Index in the lattices array used internally in OpenMC.
**/geometry/lattices/lattice <uid>/name** (*char[]*)
Name of the lattice.
**/geometry/lattices/lattice <uid>/type** (*char[]*)
Type of the lattice, either 'rectangular' or 'hexagonal'.
**/geometry/lattices/lattice <uid>/pitch** (*double[]*)
Pitch of the lattice.
**/geometry/lattices/lattice <uid>/outer** (*int*)
Outer universe assigned to lattice cells outside the defined range.
**/geometry/lattices/lattice <uid>/offsets** (*int[]*)
Offsets used for distribcell tally filter.
**/geometry/lattices/lattice <uid>/universes** (*int[]*)
Three-dimensional array of universes assigned to each cell of the lattice.
**/geometry/lattices/lattice <uid>/dimension** (*int[]*)
The number of lattice cells in each direction. This dataset is present only
when the 'type' dataset is set to 'rectangular'.
**/geometry/lattices/lattice <uid>/lower_left** (*double[]*)
The coordinates of the lower-left corner of the lattice. This dataset is
present only when the 'type' dataset is set to 'rectangular'.
**/geometry/lattices/lattice <uid>/n_rings** (*int*)
Number of radial ring positions in the xy-plane. This dataset is present
only when the 'type' dataset is set to 'hexagonal'.
**/geometry/lattices/lattice <uid>/n_axial** (*int*)
Number of lattice positions along the z-axis. This dataset is present only
when the 'type' dataset is set to 'hexagonal'.
**/geometry/lattices/lattice <uid>/center** (*double[]*)
Coordinates of the center of the lattice. This dataset is present only when
the 'type' dataset is set to 'hexagonal'.
**/n_materials** (*int*)
Number of materials in the problem.
**/materials/material <uid>/index** (*int*)
Index in materials array used internally in OpenMC.
**/materials/material <uid>/name** (*char[]*)
Name of the material.
**/materials/material <uid>/atom_density** (*double[]*)
Total atom density of the material in atom/b-cm.
**/materials/material <uid>/nuclides** (*char[][]*)
Array of nuclides present in the material, e.g., 'U-235.71c'.
**/materials/material <uid>/nuclide_densities** (*double[]*)
Atom density of each nuclide.
**/materials/material <uid>/sab_names** (*char[][]*)
Names of S(:math:`\alpha`,:math:`\beta`) tables assigned to the material.
**/tallies/n_tallies** (*int*)
Number of tallies in the problem.
**/tallies/n_meshes** (*int*)
Number of meshes in the problem.
**/tallies/mesh <uid>/index** (*int*)
Index in the meshes array used internally in OpenMC.
**/tallies/mesh <uid>/type** (*char[]*)
Type of the mesh. The only valid option is currently 'regular'.
**/tallies/mesh <uid>/dimension** (*int[]*)
Number of mesh cells in each direction.
**/tallies/mesh <uid>/lower_left** (*double[]*)
Coordinates of the lower-left corner of the mesh.
**/tallies/mesh <uid>/upper_right** (*double[]*)
Coordinates of the upper-right corner of the mesh.
**/tallies/mesh <uid>/width** (*double[]*)
Width of a single mesh cell in each direction.
**/tallies/tally <uid>/index** (*int*)
Index in tallies array used internally in OpenMC.
**/tallies/tally <uid>/name** (*char[]*)
Name of the tally.
**/tallies/tally <uid>/n_filters** (*int*)
Number of filters applied to the tally.
**/tallies/tally <uid>/filter <j>/type** (*char[]*)
Type of the j-th filter. Can be 'universe', 'material', 'cell', 'cellborn',
'surface', 'mesh', 'energy', 'energyout', or 'distribcell'.
**/tallies/tally <uid>/filter <j>/offset** (*int*)
Filter offset (used for distribcell filter).
**/tallies/tally <uid>/filter <j>/n_bins** (*int*)
Number of bins for the j-th filter.
**/tallies/tally <uid>/filter <j>/bins** (*int[]* or *double[]*)
Value for each filter bin of this type.
**/tallies/tally <uid>/nuclides** (*char[][]*)
Array of nuclides to tally. Note that if no nuclide is specified in the user
input, a single 'total' nuclide appears here.
**/tallies/tally <uid>/n_score_bins** (*int*)
Number of scoring bins for a single nuclide. In general, this can be greater
than the number of user-specified scores since each score might have
multiple scoring bins, e.g., scatter-PN.
**/tallies/tally <uid>/score_bins** (*char[][]*)
Scoring bins for the tally.

View file

@ -0,0 +1,30 @@
.. _usersguide_track:
=================
Track File Format
=================
The current revision of the particle track file format is 1.
**/filetype** (*char[]*)
String indicating the type of file.
**/revision** (*int*)
Revision of the track file format. Any time a change is made in the format,
this integer is incremented.
**/n_particles** (*int*)
Number of particles for which tracks are recorded.
**/n_coords** (*int[]*)
Number of coordinates for each particle.
*do i = 1, n_particles*
**/coordinates_i** (*double[][3]*)
(x,y,z) coordinates for the *i*-th particle.

View file

@ -0,0 +1,25 @@
.. _usersguide_voxel:
======================
Voxel Plot File Format
======================
**/filetype** (*char[]*)
String indicating the type of file.
**/num_voxels** (*int[3]*)
Number of voxels in the x-, y-, and z- directions.
**/voxel_width** (*double[3]*)
Width of a voxel in centimeters.
**/lower_left** (*double[3]*)
Cartesian coordinates of the lower-left corner of the plot.
**/data** (*int[][][]*)
Data for each voxel that represents a material or cell ID.

View file

@ -6,31 +6,34 @@ Data Processing and Visualization
This section is intended to explain in detail the recommended procedures for
carrying out common post-processing 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:
of varying complexity are provided to help automate the process, the most
powerful capabilities for post-processing derive from use of the :ref:`Python
API <pythonapi>`. Both the provided scripts and the Python API rely on a number
third-party Python packages, including:
* [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/>`_
* [1]_ `NumPy <http://www.numpy.org/>`_
* [2]_ `h5py <http://www.h5py.org>`_
* [3]_ `pandas <http://pandas.pydata.org>`_
* [4]_ `matplotlib <http://matplotlib.org/>`_
* [4]_ `Silomesh <https://github.com/nhorelik/silomesh>`_
* [4]_ `VTK <http://www.vtk.org/>`_
* [4]_ `lxml <http://lxml.de>`_
Most of these are easily obtainable in Ubuntu through the package manager, or
are easily installed with distutils.
Most of these are can easily be installed with `pip <https://pip.pypa.io>`_
or alternatively obtaining through a package manager.
.. [1] Required for tally data extraction from statepoints with statepoint.py
.. [2] Required only if reading HDF5 statepoint files.
.. [3] Optional for plotting utilities
.. [1] Required for most post-processing tasks
.. [2] Required for reading HDF5 output files
.. [3] Optional dependency for advanced features in Python API
.. [4] Not used directly by the Python API, but are optional dependencies for a
number of scripts.
----------------------
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
running OpenMC with the --plot or -p command-line option (See
:ref:`usersguide_plotting`).
Plotting in 2D
@ -128,27 +131,26 @@ capabilities of 3D voxel plots.
Voxel plots are built the same way 2D slice plots are, by determining the cell
or material id of a particle at the center of each voxel. In this example, the
space covered is the cube between the points (-5,-5,-5) and (5,5,5), with voxel
centers 10/500 = 0.02 cm apart. The binary VOXEL files that are produced do not
centers 10/500 = 0.02 cm apart. The HDF5 voxel files that are produced do not
specify any color - instead containing only material or cell ids (material id
in this example) - and thus the ``background``, ``col_spec``, and ``mask``
elements are not used. If no cell is found at a voxel center, an id of -1 is
stored.
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. This typically will
compress the size of the file significantly. The provided utility voxel.py
accomplishes this for SILO:
The voxel plot data is written to an HDF5 file. The voxel file can subsequently
be converted into a standard mesh format that can be viewed in ParaView, Visit,
etc. This typically will compress the size of the file significantly. The
provided utility openmc-voxel-to-silovtk accomplishes this for SILO:
.. code-block:: sh
<openmc_root>/src/utils/voxel.py myplot.voxel -o output.silo
openmc-voxel-to-silovtk myplot.voxel -o output.silo
and VTK file formats:
.. code-block:: sh
<openmc_root>/src/utils/voxel.py myplot.voxel --vtk -o output.vti
openmc-voxel-to-silovtk myplot.voxel --vtk -o output.vti
To use this utility you need either
@ -156,11 +158,10 @@ To use this utility you need either
or
* `VTK <http://www.vtk.org/>`_ with python bindings - On Ubuntu, these are
easily obtained with ``sudo apt-get install python-vtk``
* `VTK <http://www.vtk.org/>`_ with python bindings. On debian derivatives,
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`.
For the HDF5 file structure, see :ref:`usersguide_voxel`.
Once processed into a standard 3D file format, colors and masks can be defined
using the stored id numbers to better explore the geometry. The process for
@ -183,150 +184,38 @@ doing this will depend on the 3D viewer, but should be straightforward.
Tally Visualization
-------------------
Tally results are saved in both a text file (tallies.out) as well as a binary
Tally results are saved in both a text file (tallies.out) as well as an HDF5
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.
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 the :ref:`pythonapi` 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:
:ref:`usersguide_statepoint`), all of which is accessible through the Python
API. The ``openmc.statepoint`` module (see :ref:`pythonapi_statepoint`) provides
a class to load statepoints and access data as requested; it is used in many of
the provided plotting utilities, OpenMC's regression test suite, and can be used
in user-created scripts to carry out manipulations of the data.
.. 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 documentation 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 examples can be found by looking
through the other utilities that use statepoint.py, and a few common
visualization tasks will be described here in the following sections.
An :ref:`example IPython notebook <notebook_post_processing>` demonstrates how
to extract data from a statepoint using the Python API.
Plotting in 2D
--------------
The :ref:`IPython notebook example <notebook_post_processing>` also demonstrates
how to plot a mesh tally in two dimensions using the Python API. Note, however,
that there is also a script distributed with OpenMC, ``openmc-plot-mesh-tally``,
that provides an interactive GUI to explore and plot mesh tallies for any scores
and filter bins.
.. image:: ../_images/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.
.. image:: ../_images/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 105x105x20 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
--------------
@ -334,22 +223,23 @@ Plotting in 3D
: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,
format for viewing. The utility ``openmc-statepoint-3d`` is provided to
accomplish this for both VTK and SILO. By default ``openmc-statepoint-3d``
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
openmc-statepoint-3d <statepoint_file> -o output.silo
openmc-statepoint-3d <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
statepoint_3d.py <statepoint_file> --tallies 2,4 --scores 4.1,4.3 -o output.silo
statepoint_3d.py <statepoint_file> --filters 2.energyin.1 --vtk -o output.vtm
openmc-statepoint-3d <statepoint_file> --tallies 2,4 --scores 4.1,4.3 -o output.silo
openmc-statepoint-3d <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.
@ -426,13 +316,11 @@ 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
the process is straightforward. First extract the data using the Python API via
``openmc.statepoint`` 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.
file. Note that all arrays that are accessible in a statepoint are already in
NumPy arrays that can be reshaped and dumped to MATLAB in one step.
----------------------------
Particle Track Visualization
@ -463,15 +351,15 @@ particle numbers, respectively. For example, to output the tracks for particles
</track>
After running OpenMC, the directory should contain a file of the form
"track_(batch #)_(generation #)_(particle #).(binary or h5)" for each particle
tracked. These track files can be converted into VTK poly data files with the
"track.py" utility. The usage of track.py is of the form "track.py [-o OUT] IN"
where OUT is the optional output filename and IN is one or more filenames
describing track files. The default output name is "track.pvtp". A common
usage of track.py is "track.py track*.binary" which will use the data from all
binary track files in the directory to write a "track.pvtp" VTK output file.
The .pvtp file can then be read and plotted by 3d visualization programs such as
ParaView.
"track_(batch #)_(generation #)_(particle #).h5" for each particle tracked.
These track files can be converted into VTK poly data files with the
``openmc-track-to-vtk`` utility. The usage of ``openmc-track-to-vtk`` is of the
form "openmc-track-to-vtk [-o OUT] IN" where OUT is the optional output filename
and IN is one or more filenames describing track files. The default output name
is "track.pvtp". A common usage of track.py is "openmc-track-to-vtk track*.h5"
which will use the data from all binary track files in the directory to write a
"track.pvtp" VTK output file. The .pvtp file can then be read and plotted by 3d
visualization programs such as ParaView.
----------------------
Source Site Processing
@ -480,43 +368,6 @@ Source Site Processing
For eigenvalue problems, OpenMC will store information on the fission source
sites in the statepoint file by default. For each source site, the weight,
position, sampled direction, and sampled energy are stored. To extract this data
from a statepoint file, the statepoint.py Python module can be used. Below is an
example of an interactive ipython session using the statepoint.py Python module:
.. code-block:: python
In [1]: import statepoint
In [2]: sp = statepoint.StatePoint('statepoint.100.h5')
In [3]: sp.read_source()
In [4]: len(sp.source)
Out[4]: 1000
In [5]: sp.source[0:10]
Out[5]:
[<SourceSite: xyz=[ 2.21980946 -8.92686048 87.93720485] at E=0.932923263566>,
<SourceSite: xyz=[ 2.21980946 -8.92686048 87.93720485] at E=0.349240220512>,
<SourceSite: xyz=[-31.21542213 -30.26762771 72.10845757] at E=3.75843584486>,
<SourceSite: xyz=[-31.21542213 -30.26762771 72.10845757] at E=0.80550137267>,
<SourceSite: xyz=[ 0.18805099 -69.13376508 103.67726838] at E=1.67922461097>,
<SourceSite: xyz=[ 0.18805099 -69.13376508 103.67726838] at E=1.16304110199>,
<SourceSite: xyz=[ -50.42189115 -9.96571672 123.34077905] at E=0.710937974074>,
<SourceSite: xyz=[ -32.80427668 -15.49316628 125.26301151] at E=1.61907104162>,
<SourceSite: xyz=[ 53.20376026 -15.38643708 120.58071044] at E=3.33962024907>,
<SourceSite: xyz=[ 53.20376026 -15.38643708 120.58071044] at E=1.90185680329>]
In [6]: site = sp.source[0]
In [7]: site.weight
Out[7]: 1.0
In [8]: site.xyz
Out[8]: array([ 2.21980946, -8.92686048, 87.93720485])
In [9]: site.uvw
Out[9]: array([ 0.06740523, 0.50612814, 0.85982024])
In [10]: site.E
Out[10]: 0.93292326356564159
from a statepoint file, the ``openmc.statepoint`` module can be used. An
:ref:`example IPython notebook <notebook_post_processing>` demontrates how to
analyze and plot source information.

View file

@ -31,21 +31,6 @@ f951: error: unrecognized command line option "-fbacktrace"
You are probably using a version of the gfortran compiler that is too
old. Download and install the latest version of gfortran_.
make[1]: ifort: Command not found
*********************************
You tried compiling with the Intel Fortran compiler and it was not found on your
:envvar:`PATH`. If you have the Intel compiler installed, make sure the shell
can locate it (this can be tested with :program:`which ifort`).
make[1]: pgf90: Command not found
*********************************
You tried compiling with the PGI Fortran compiler and it was not found on your
:envvar:`PATH`. If you have the PGI compiler installed, make sure the shell can
locate it (this can be tested with :program:`which pgf90`).
-------------------------
Problems with Simulations
-------------------------
@ -56,13 +41,13 @@ Segmentation Fault
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
on. First go to your ``openmc/src`` directory where OpenMC was compiled and type
the following commands:
on. Create a new build directory and type the following commands:
.. code-block:: sh
make distclean
make DEBUG=yes
mkdir build-debug && cd build-debug
cmake -Ddebug=on /path/to/openmc
make
Now when you re-run your problem, it should report exactly where the program
failed. If after reading the debug output, you are still unsure why the program

View file

@ -10,6 +10,7 @@
*/
/* Non-minified version JS is _stemmer.js if file is provided */
/**
* Porter Stemmer
*/
@ -373,8 +374,7 @@ var Search = {
}
// lookup as search terms in fulltext
results = results.concat(this.performTermsSearch(searchterms, excluded, terms, Scorer.term))
.concat(this.performTermsSearch(searchterms, excluded, titleterms, Scorer.title));
results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
// let the scorer override scores with a custom scoring function
if (Scorer.score) {
@ -538,23 +538,47 @@ var Search = {
/**
* search for full-text terms in the index
*/
performTermsSearch : function(searchterms, excluded, terms, score) {
performTermsSearch : function(searchterms, excluded, terms, titleterms) {
var filenames = this._index.filenames;
var titles = this._index.titles;
var i, j, file, files;
var i, j, file;
var fileMap = {};
var scoreMap = {};
var results = [];
// perform the search on the required terms
for (i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
var files = [];
var _o = [
{files: terms[word], score: Scorer.term},
{files: titleterms[word], score: Scorer.title}
];
// no match but word was a required one
if ((files = terms[word]) === undefined)
if ($u.every(_o, function(o){return o.files === undefined;})) {
break;
if (files.length === undefined) {
files = [files];
}
// found search word in contents
$u.each(_o, function(o) {
var _files = o.files;
if (_files === undefined)
return
if (_files.length === undefined)
_files = [_files];
files = files.concat(_files);
// set score for the word in each file to Scorer.term
for (j = 0; j < _files.length; j++) {
file = _files[j];
if (!(file in scoreMap))
scoreMap[file] = {}
scoreMap[file][word] = o.score;
}
});
// create the mapping
for (j = 0; j < files.length; j++) {
file = files[j];
@ -576,7 +600,9 @@ var Search = {
// ensure that none of the excluded terms is in the search result
for (i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
$u.contains(terms[excluded[i]] || [], file)) {
titleterms[excluded[i]] == file ||
$u.contains(terms[excluded[i]] || [], file) ||
$u.contains(titleterms[excluded[i]] || [], file)) {
valid = false;
break;
}
@ -584,6 +610,9 @@ var Search = {
// if we have still a valid result we can add it to the result list
if (valid) {
// select one (max) score for the file.
// for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
results.push([filenames[file], titles[file], '', null, score]);
}
}

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -76,7 +76,7 @@
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>7. Building Sphinx Documentation &mdash; OpenMC Documentation</title>
<title>5. Building Sphinx Documentation &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -26,7 +26,7 @@
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="up" title="Developers Guide" href="index.html" />
<link rel="next" title="Python API" href="../pythonapi/index.html" />
<link rel="prev" title="6. Voxel Plot Binary File Specifications" href="voxel.html" />
<link rel="prev" title="4. XML Input Parsing" href="xml-parsing.html" />
</head>
<body role="document">
<div class="header" role="banner">
@ -37,7 +37,7 @@
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«&#160;&#160;<a href="voxel.html">6. Voxel Plot Binary File Specifications</a>
«&#160;&#160;<a href="xml-parsing.html">4. XML Input Parsing</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -49,7 +49,7 @@
<div class="section" id="building-sphinx-documentation">
<span id="devguide-docbuild"></span><h1>7. Building Sphinx Documentation<a class="headerlink" href="#building-sphinx-documentation" title="Permalink to this headline"></a></h1>
<span id="devguide-docbuild"></span><h1>5. Building Sphinx Documentation<a class="headerlink" href="#building-sphinx-documentation" title="Permalink to this headline"></a></h1>
<p>In order to build the documentation in the <code class="docutils literal"><span class="pre">docs</span></code> directory, you will need to
have the <a class="reference external" href="http://sphinx-doc.org">Sphinx</a> third-party Python package. The easiest way to install Sphinx
is via pip:</p>
@ -67,7 +67,7 @@ from the git repository as such:</p>
</pre></div>
</div>
<div class="section" id="building-documentation-as-a-webpage">
<h2>7.1. Building Documentation as a Webpage<a class="headerlink" href="#building-documentation-as-a-webpage" title="Permalink to this headline"></a></h2>
<h2>5.1. Building Documentation as a Webpage<a class="headerlink" href="#building-documentation-as-a-webpage" title="Permalink to this headline"></a></h2>
<p>To build the documentation as a webpage (what appears at
<a class="reference external" href="http://mit-crpg.github.io/openmc">http://mit-crpg.github.io/openmc</a>), simply go to the <code class="docutils literal"><span class="pre">docs</span></code> directory and run:</p>
<div class="highlight-sh"><div class="highlight"><pre>make html
@ -75,7 +75,7 @@ from the git repository as such:</p>
</div>
</div>
<div class="section" id="building-documentation-as-a-pdf">
<h2>7.2. Building Documentation as a PDF<a class="headerlink" href="#building-documentation-as-a-pdf" title="Permalink to this headline"></a></h2>
<h2>5.2. Building Documentation as a PDF<a class="headerlink" href="#building-documentation-as-a-pdf" title="Permalink to this headline"></a></h2>
<p>To build PDF documentation, you will need to have a LaTeX distribution installed
on your computer as well as <a class="reference external" href="https://inkscape.org">Inkscape</a>, which is used to convert .svg files to
.pdf files. Inkscape can be installed in a Debian-derivative with:</p>
@ -95,7 +95,7 @@ run:</p>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«&#160;&#160;<a href="voxel.html">6. Voxel Plot Binary File Specifications</a>
«&#160;&#160;<a href="xml-parsing.html">4. XML Input Parsing</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -107,7 +107,7 @@ run:</p>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="next" title="1. Data Structures" href="structures.html" />
<link rel="prev" title="5. Troubleshooting" href="../usersguide/troubleshoot.html" />
<link rel="prev" title="6. Troubleshooting" href="../usersguide/troubleshoot.html" />
</head>
<body role="document">
<div class="header" role="banner">
@ -36,7 +36,7 @@
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«&#160;&#160;<a href="../usersguide/troubleshoot.html">5. Troubleshooting</a>
«&#160;&#160;<a href="../usersguide/troubleshoot.html">6. Troubleshooting</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -95,11 +95,9 @@ as debugging.</p>
<li class="toctree-l2"><a class="reference internal" href="xml-parsing.html#editing-fox-on-personal-fork">4.2. Editing FoX on Personal Fork</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="statepoint.html">5. State Point Binary File Specifications</a></li>
<li class="toctree-l1"><a class="reference internal" href="voxel.html">6. Voxel Plot Binary File Specifications</a></li>
<li class="toctree-l1"><a class="reference internal" href="docbuild.html">7. Building Sphinx Documentation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="docbuild.html#building-documentation-as-a-webpage">7.1. Building Documentation as a Webpage</a></li>
<li class="toctree-l2"><a class="reference internal" href="docbuild.html#building-documentation-as-a-pdf">7.2. Building Documentation as a PDF</a></li>
<li class="toctree-l1"><a class="reference internal" href="docbuild.html">5. Building Sphinx Documentation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="docbuild.html#building-documentation-as-a-webpage">5.1. Building Documentation as a Webpage</a></li>
<li class="toctree-l2"><a class="reference internal" href="docbuild.html#building-documentation-as-a-pdf">5.2. Building Documentation as a PDF</a></li>
</ul>
</li>
</ul>
@ -111,7 +109,7 @@ as debugging.</p>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«&#160;&#160;<a href="../usersguide/troubleshoot.html">5. Troubleshooting</a>
«&#160;&#160;<a href="../usersguide/troubleshoot.html">6. Troubleshooting</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -123,7 +121,7 @@ as debugging.</p>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -1,328 +0,0 @@
<!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. State Point 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" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
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>
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="up" title="Developers Guide" href="index.html" />
<link rel="next" title="6. Voxel Plot Binary File Specifications" href="voxel.html" />
<link rel="prev" title="4. XML Input Parsing" href="xml-parsing.html" />
</head>
<body role="document">
<div class="header" role="banner">
<a href="../index.html">
<img class="logo" src="../_static/openmc.png" alt="Logo"/>
</a>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«&#160;&#160;<a href="xml-parsing.html">4. XML Input Parsing</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="voxel.html">6. Voxel Plot Binary File Specifications</a>&#160;&#160;»
</p>
</div>
<div class="content">
<div class="section" id="state-point-binary-file-specifications">
<span id="devguide-statepoint"></span><h1>5. State Point Binary File Specifications<a class="headerlink" href="#state-point-binary-file-specifications" title="Permalink to this headline"></a></h1>
<p>The current revision of the statepoint binary file is 13.</p>
<p><strong>integer(4) FILETYPE_STATEPOINT</strong></p>
<blockquote>
<div>Flags whether this file is a statepoint file or a particle restart file.</div></blockquote>
<p><strong>integer(4) REVISION_STATEPOINT</strong></p>
<blockquote>
<div>Revision of the binary state point file. Any time a change is made in the
format of the state-point file, this integer is incremented.</div></blockquote>
<p><strong>integer(4) VERSION_MAJOR</strong></p>
<blockquote>
<div>Major version number for OpenMC</div></blockquote>
<p><strong>integer(4) VERSION_MINOR</strong></p>
<blockquote>
<div>Minor version number for OpenMC</div></blockquote>
<p><strong>integer(4) VERSION_RELEASE</strong></p>
<blockquote>
<div>Release version number for OpenMC</div></blockquote>
<p><strong>character(19) time_stamp</strong></p>
<blockquote>
<div>Date and time the state point was written.</div></blockquote>
<p><strong>character(255) path</strong></p>
<blockquote>
<div>Absolute path to directory containing input files.</div></blockquote>
<p><strong>integer(8) seed</strong></p>
<blockquote>
<div>Pseudo-random number generator seed.</div></blockquote>
<p><strong>integer(4) run_mode</strong></p>
<blockquote>
<div>run mode used. The modes are described in constants.F90.</div></blockquote>
<p><strong>integer(8) n_particles</strong></p>
<blockquote>
<div>Number of particles used per generation.</div></blockquote>
<p><strong>integer(4) current_batch</strong></p>
<blockquote>
<div>The number of batches already simulated.</div></blockquote>
<p>if (run_mode == MODE_EIGENVALUE)</p>
<blockquote>
<div><p><strong>integer(4) n_inactive</strong></p>
<blockquote>
<div>Number of inactive batches</div></blockquote>
<p><strong>integer(4) gen_per_batch</strong></p>
<blockquote>
<div>Number of generations per batch for criticality calculations</div></blockquote>
<p><em>do i = 1, current_batch * gen_per_batch</em></p>
<blockquote>
<div><p><strong>real(8) k_generation(i)</strong></p>
<blockquote>
<div>k-effective for the i-th total generation</div></blockquote>
</div></blockquote>
<p><em>do i = 1, current_batch * gen_per_batch</em></p>
<blockquote>
<div><p><strong>real(8) entropy(i)</strong></p>
<blockquote>
<div>Shannon entropy for the i-th total generation</div></blockquote>
</div></blockquote>
<p><strong>real(8) k_col_abs</strong></p>
<blockquote>
<div>Sum of product of collision/absorption estimates of k-effective</div></blockquote>
<p><strong>real(8) k_col_tra</strong></p>
<blockquote>
<div>Sum of product of collision/track-length estimates of k-effective</div></blockquote>
<p><strong>real(8) k_abs_tra</strong></p>
<blockquote>
<div>Sum of product of absorption/track-length estimates of k-effective</div></blockquote>
<p><strong>real(8) k_combined(2)</strong></p>
<blockquote>
<div>Mean and standard deviation of a combined estimate of k-effective</div></blockquote>
<p><strong>integer(4) cmfd_on</strong></p>
<blockquote>
<div>Flag that cmfd is on</div></blockquote>
<p>if (cmfd_on)</p>
<blockquote>
<div><p><strong>integer(4) cmfd % indices</strong></p>
<blockquote>
<div>Indices for cmfd mesh (i,j,k,g)</div></blockquote>
<p><strong>real(8) cmfd % k_cmfd(1:current_batch)</strong></p>
<blockquote>
<div>CMFD eigenvalues</div></blockquote>
<p><strong>real(8) cmfd % src(1:G,1:I,1:J,1:K)</strong></p>
<blockquote>
<div>CMFD fission source</div></blockquote>
<p><strong>real(8) cmfd % entropy(1:current_batch)</strong></p>
<blockquote>
<div>CMFD estimate of Shannon entropy</div></blockquote>
<p><strong>real(8) cmfd % balance(1:current_batch)</strong></p>
<blockquote>
<div>RMS of the residual neutron balance equation on CMFD mesh</div></blockquote>
<p><strong>real(8) cmfd % dom(1:current_batch)</strong></p>
<blockquote>
<div>CMFD estimate of dominance ratio</div></blockquote>
<p><strong>real(8) cmfd % scr_cmp(1:current_batch)</strong></p>
<blockquote>
<div>RMS comparison of difference between OpenMC and CMFD fission source</div></blockquote>
</div></blockquote>
</div></blockquote>
<p><strong>integer(4) n_meshes</strong></p>
<blockquote>
<div>Number of meshes in tallies.xml file</div></blockquote>
<p><em>do i = 1, n_meshes</em></p>
<blockquote>
<div><p><strong>integer(4) meshes(i) % id</strong></p>
<blockquote>
<div>Unique ID of mesh.</div></blockquote>
<p><strong>integer(4) meshes(i) % type</strong></p>
<blockquote>
<div>Type of mesh.</div></blockquote>
<p><strong>integer(4) meshes(i) % n_dimension</strong></p>
<blockquote>
<div>Number of dimensions for mesh (2 or 3).</div></blockquote>
<p><strong>integer(4) meshes(i) % dimension(:)</strong></p>
<blockquote>
<div>Number of mesh cells in each dimension.</div></blockquote>
<p><strong>real(8) meshes(i) % lower_left(:)</strong></p>
<blockquote>
<div>Coordinates of lower-left corner of mesh.</div></blockquote>
<p><strong>real(8) meshes(i) % upper_right(:)</strong></p>
<blockquote>
<div>Coordinates of upper-right corner of mesh.</div></blockquote>
<p><strong>real(8) meshes(i) % width(:)</strong></p>
<blockquote>
<div>Width of each mesh cell in each dimension.</div></blockquote>
</div></blockquote>
<p><strong>integer(4) n_tallies</strong></p>
<p><em>do i = 1, n_tallies</em></p>
<blockquote>
<div><p><strong>integer(4) tallies(i) % id</strong></p>
<blockquote>
<div>Unique ID of tally.</div></blockquote>
<p><strong>integer(4) tallies(i) % n_realizations</strong></p>
<blockquote>
<div>Number of realizations for the i-th tally.</div></blockquote>
<p><strong>integer(4) size(tallies(i) % scores, 1)</strong></p>
<blockquote>
<div>Total number of score bins for the i-th tally</div></blockquote>
<p><strong>integer(4) size(tallies(i) % scores, 2)</strong></p>
<blockquote>
<div>Total number of filter bins for the i-th tally</div></blockquote>
<p><strong>integer(4) tallies(i) % n_filters</strong></p>
<p><em>do j = 1, tallies(i) % n_filters</em></p>
<blockquote>
<div><p><strong>integer(4) tallies(i) % filter(j) % type</strong></p>
<blockquote>
<div>Type of tally filter.</div></blockquote>
<p><strong>integer(4) tallies(i) % filter(j) % n_bins</strong></p>
<blockquote>
<div>Number of bins for filter.</div></blockquote>
<p><strong>integer(4)/real(8) tallies(i) % filter(j) % bins(:)</strong></p>
<blockquote>
<div>Value for each filter bin of this type.</div></blockquote>
</div></blockquote>
<p><strong>integer(4) tallies(i) % n_nuclide_bins</strong></p>
<blockquote>
<div>Number of nuclide bins. If none are specified, this is just one.</div></blockquote>
<p><em>do j = 1, tallies(i) % n_nuclide_bins</em></p>
<blockquote>
<div><p><strong>integer(4) tallies(i) % nuclide_bins(j)</strong></p>
<blockquote>
<div>Values of specified nuclide bins</div></blockquote>
</div></blockquote>
<p><strong>integer(4) tallies(i) % n_score_bins</strong></p>
<blockquote>
<div>Number of scoring bins.</div></blockquote>
<p><em>do j = 1, tallies(i) % n_score_bins</em></p>
<blockquote>
<div><p><strong>integer(4) tallies(i) % score_bins(j)</strong></p>
<blockquote>
<div>Values of specified scoring bins (e.g. SCORE_FLUX).</div></blockquote>
</div></blockquote>
<p><strong>integer(4) tallies(i) % n_score_bins</strong></p>
<blockquote>
<div>Number of scoring bins without accounting for those added by
the scatter-pn command.</div></blockquote>
<p><em>do j = 1, tallies(i) % n_user_score_bins</em></p>
<blockquote>
<div><p><strong>character(8) tallies(i) % moment_order(j)</strong></p>
<blockquote>
<div>Tallying moment order for Legendre and spherical
harmonic tally expansions (<em>e.g.</em>, &#8216;P2&#8217;, &#8216;Y1,2&#8217;, etc.).</div></blockquote>
</div></blockquote>
</div></blockquote>
<p><strong>integer(4) source_present</strong></p>
<blockquote>
<div>Flag indicated if source bank is present in the file</div></blockquote>
<p><strong>integer(4) n_realizations</strong></p>
<blockquote>
<div>Number of realizations for global tallies.</div></blockquote>
<p><strong>integer(4) N_GLOBAL_TALLIES</strong></p>
<blockquote>
<div>Number of global tally scores</div></blockquote>
<p><em>do i = 1, N_GLOBAL_TALLIES</em></p>
<blockquote>
<div><p><strong>real(8) global_tallies(i) % sum</strong></p>
<blockquote>
<div>Accumulated sum for the i-th global tally</div></blockquote>
<p><strong>real(8) global_tallies(i) % sum_sq</strong></p>
<blockquote>
<div>Accumulated sum of squares for the i-th global tally</div></blockquote>
</div></blockquote>
<p><strong>integer(4) tallies_on</strong></p>
<blockquote>
<div>Flag indicated if tallies are present in the file.</div></blockquote>
<p>if (tallies_on &gt; 0)</p>
<blockquote>
<div><p><em>do i = 1, n_tallies</em></p>
<blockquote>
<div><p><em>do k = 1, size(tallies(i) % scores, 2)</em></p>
<blockquote>
<div><p><em>do j = 1, size(tallies(i) % scores, 1)</em></p>
<blockquote>
<div><p><strong>real(8) tallies(i) % scores(j,k) % sum</strong></p>
<blockquote>
<div>Accumulated sum for the j-th score and k-th filter of the
i-th tally</div></blockquote>
<p><strong>real(8) tallies(i) % scores(j,k) % sum_sq</strong></p>
<blockquote>
<div>Accumulated sum of squares for the j-th score and k-th
filter of the i-th tally</div></blockquote>
</div></blockquote>
</div></blockquote>
</div></blockquote>
</div></blockquote>
<p>if (run_mode == MODE_EIGENVALUE and source_present)</p>
<blockquote>
<div><p><em>do i = 1, n_particles</em></p>
<blockquote>
<div><p><strong>real(8) source_bank(i) % wgt</strong></p>
<blockquote>
<div>Weight of the i-th source particle</div></blockquote>
<p><strong>real(8) source_bank(i) % xyz(1:3)</strong></p>
<blockquote>
<div>Coordinates of the i-th source particle.</div></blockquote>
<p><strong>real(8) source_bank(i) % uvw(1:3)</strong></p>
<blockquote>
<div>Direction of the i-th source particle</div></blockquote>
<p><strong>real(8) source_bank(i) % E</strong></p>
<blockquote>
<div>Energy of the i-th source particle.</div></blockquote>
</div></blockquote>
</div></blockquote>
</div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«&#160;&#160;<a href="xml-parsing.html">4. XML Input Parsing</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="voxel.html">6. Voxel Plot Binary File Specifications</a>&#160;&#160;»
</p>
</div>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.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

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -185,7 +185,7 @@ module</a> is of type MaterialMacroXS.</p>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -196,7 +196,7 @@ dependencies rather than required dependencies.</p>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -1,132 +0,0 @@
<!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" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
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>
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="up" title="Developers Guide" href="index.html" />
<link rel="next" title="7. Building Sphinx Documentation" href="docbuild.html" />
<link rel="prev" title="5. State Point Binary File Specifications" href="statepoint.html" />
</head>
<body role="document">
<div class="header" role="banner">
<a href="../index.html">
<img class="logo" src="../_static/openmc.png" alt="Logo"/>
</a>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<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="docbuild.html">7. Building Sphinx Documentation</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>
<p>The current revision of the voxel plot binary file is 1.</p>
<p><strong>integer(4) n_voxels_x</strong></p>
<blockquote>
<div>Number of voxels in the x direction</div></blockquote>
<p><strong>integer(4) n_voxels_y</strong></p>
<blockquote>
<div>Number of voxels in the y direction</div></blockquote>
<p><strong>integer(4) n_voxels_z</strong></p>
<blockquote>
<div>Number of voxels in the z direction</div></blockquote>
<p><strong>real(8) width_voxel_x</strong></p>
<blockquote>
<div>Width of voxels in the x direction</div></blockquote>
<p><strong>real(8) width_voxel_y</strong></p>
<blockquote>
<div>Width of voxels in the y direction</div></blockquote>
<p><strong>real(8) width_voxel_z</strong></p>
<blockquote>
<div>Width of voxels in the z direction</div></blockquote>
<p><strong>real(8) lower_left_x</strong></p>
<blockquote>
<div>Lower left x point of the voxel grid</div></blockquote>
<p><strong>real(8) lower_left_y</strong></p>
<blockquote>
<div>Lower left y point of the voxel grid</div></blockquote>
<p><strong>real(8) lower_left_z</strong></p>
<blockquote>
<div>Lower left z point of the voxel grid</div></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">
<div><p><strong>integer(4) id</strong></p>
<blockquote>
<div>Cell or material id number at this voxel center. Set to -1 when
cell not_found.</div></blockquote>
</div></blockquote>
</dd>
</dl>
</dd>
</dl>
</div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<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="docbuild.html">7. Building Sphinx Documentation</a>&#160;&#160;»
</p>
</div>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.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

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -284,7 +284,7 @@ from your private repository into a public fork.</p>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="up" title="Developers Guide" href="index.html" />
<link rel="next" title="5. State Point Binary File Specifications" href="statepoint.html" />
<link rel="next" title="5. Building Sphinx Documentation" href="docbuild.html" />
<link rel="prev" title="3. Development Workflow" href="workflow.html" />
</head>
<body role="document">
@ -41,7 +41,7 @@
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="statepoint.html">5. State Point Binary File Specifications</a>&#160;&#160;»
<a href="docbuild.html">5. Building Sphinx Documentation</a>&#160;&#160;»
</p>
</div>
@ -155,7 +155,7 @@ were not committed.</p>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="statepoint.html">5. State Point Binary File Specifications</a>&#160;&#160;»
<a href="docbuild.html">5. Building Sphinx Documentation</a>&#160;&#160;»
</p>
</div>
@ -163,7 +163,7 @@ were not committed.</p>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -62,7 +62,7 @@ free to send a message to the User&#8217;s Group <a class="reference external" h
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="quickinstall.html">Quick Install Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="releasenotes.html">Release Notes for OpenMC 0.7.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="releasenotes.html">Release Notes for OpenMC 0.7.1</a></li>
<li class="toctree-l1"><a class="reference internal" href="methods/index.html">Theory and Methodology</a></li>
<li class="toctree-l1"><a class="reference internal" href="usersguide/index.html">User&#8217;s Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="devguide/index.html">Developer&#8217;s Guide</a></li>
@ -89,7 +89,7 @@ free to send a message to the User&#8217;s Group <a class="reference external" h
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -83,7 +83,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -1043,7 +1043,7 @@ by the user. Once all diffusion parameters are calculated, CMFD matrices are
formed where energy groups are the inner most iteration index. In OpenMC,
compressed row storage sparse matrices are used due to the sparsity of CMFD
operators. An example of this sparsity is shown for the 3-D BEAVRS model in
figures <a href="#fig-loss">1</a> and <a href="#fig-prod">2</a> <a class="reference internal" href="#beavrs" id="id3">[BEAVRS]</a>. These matrices represent
figures <a href="#fig-loss">12</a> and <a href="#fig-prod">13</a> <a class="reference internal" href="#beavrs" id="id3">[BEAVRS]</a>. These matrices represent
an assembly radial mesh, 24 cell mesh in the axial direction and two energy
groups. The loss matrix is 99.92% sparse and the production matrix is 99.99%
sparse. Although the loss matrix looks like it is tridiagonal, it is really a
@ -1101,11 +1101,11 @@ no fission neutrons appear with energies in the thermal group.</p>
</table>
<div class="figure" id="id12">
<span id="fig-loss"></span><a class="reference internal image-reference" href="../_images/loss.png"><img alt="../_images/loss.png" src="../_images/loss.png" style="width: 500.0px; height: 500.0px;" /></a>
<p class="caption"><span class="caption-text">Figure 1: Sparsity of Neutron Loss Operator</span></p>
<p class="caption"><span class="caption-text">Figure 12: Sparsity of Neutron Loss Operator</span></p>
</div>
<div class="figure" id="id13">
<span id="fig-prod"></span><a class="reference internal image-reference" href="../_images/prod.png"><img alt="../_images/prod.png" src="../_images/prod.png" style="width: 500.0px; height: 500.0px;" /></a>
<p class="caption"><span class="caption-text">Figure 2: Sparsity of Neutron Production Operator</span></p>
<p class="caption"><span class="caption-text">Figure 13: Sparsity of Neutron Production Operator</span></p>
</div>
<p>To solve the eigenvalue problem with these matrices, different source iteration
and linear solvers can be used. The most common source iteration solver used is
@ -1230,7 +1230,7 @@ CASMO-4E</em>. In Proceedings of PHYSOR 2002, Seoul, Korea, October 7 - 10, 2002
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -129,7 +129,7 @@ Carlo codes,&#8221; LA-UR-14-24530, Los Alamos National Laboratory (2014).</td><
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -109,7 +109,7 @@ convergence, we would either need to use a method for assessing convergence of
an N-dimensional quantity or transform our set of coordinates into a scalar
metric. The latter approach has been developed considerably over the last decade
and a method now commonly used in Monte Carlo eigenvalue calculations is to use
a metric called the <a class="reference external" href="https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-ur-06-3737_entropy.pdf">Shannon entropy</a>, a concept borrowed from information
a metric called the <a class="reference external" href="https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-ur-06-3737.pdf">Shannon entropy</a>, a concept borrowed from information
theory.</p>
<p>To compute the Shannon entropy of the source distribution, we first need to
discretize the source distribution rather than having a set of coordinates in
@ -210,7 +210,7 @@ Convergence,&#8221; <em>Trans. Am. Nucl. Soc.</em>, <strong>98</strong>, 512 (20
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -54,7 +54,7 @@
<h2>2.1. Constructive Solid Geometry<a class="headerlink" href="#constructive-solid-geometry" title="Permalink to this headline"></a></h2>
<p>OpenMC uses a technique known as <a class="reference external" href="http://en.wikipedia.org/wiki/Constructive_solid_geometry">constructive solid geometry</a> (CSG) to build
arbitrarily complex three-dimensional models in Euclidean space. In a CSG model,
every unique object is described as the union, intersection, or difference of
every unique object is described as the union and/or intersection of
<em>half-spaces</em> created by bounding <a class="reference external" href="http://en.wikipedia.org/wiki/Surface">surfaces</a>. Every surface divides all of
space into exactly two half-spaces. We can mathematically define a surface as a
collection of points that satisfy an equation of the form <img class="math" src="../_images/math/a196569f2f3e96bf3fd428db69ffaa94df4d6e75.png" alt="f(x,y,z) = 0"/>
@ -76,21 +76,20 @@ with radius <img class="math" src="../_images/math/9d86170e7de539c0ff999de09621e
<p>In OpenMC, every surface defined by the user is assigned an integer to uniquely
identify it. We can then refer to either of the two half-spaces created by a
surface by a combination of the unique ID of the surface and a positive/negative
sign. Figure <a href="#fig-halfspace">3</a> shows an example of an ellipse with unique ID 1
sign. Figure <a href="#fig-halfspace">14</a> shows an example of an ellipse with unique ID 1
dividing space into two half-spaces.</p>
<div class="align-center figure" id="id7">
<span id="fig-halfspace"></span><img src="../_images/halfspace.svg" /><p class="caption"><span class="caption-text">Figure 3: Example of an ellipse and its associated half-spaces.</span></p>
<span id="fig-halfspace"></span><img src="../_images/halfspace.svg" /><p class="caption"><span class="caption-text">Figure 14: Example of an ellipse and its associated half-spaces.</span></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
to be defined by intersections, unions, and differences or half-spaces, OpenMC
is currently limited to cells defined only as intersections of
half-spaces. Thus, the specification of the cell must include a list of
half-space references whose intersection defines the region. The region is then
assigned a material defined elsewhere. Figure <a href="#fig-union">4</a> shows an
example of a cell defined as the intersection of an ellipse and two planes.</p>
space of uniform composition, which are then assigned to <em>cells</em>. OpenMC allows
regions to be defined using union, intersection, and complement operators. As in
<a class="reference external" href="http://mcnp.lanl.gov">MCNP</a>, the intersection operator is implicit as doesn&#8217;t need to be written in a
region specification. A defined region is then associated with a material
composition in a cell. Figure <a href="#fig-union">15</a> shows an example of a cell region
defined as the intersection of an ellipse and two planes.</p>
<div class="align-center figure" id="id8">
<span id="fig-union"></span><img src="../_images/union.svg" /><p class="caption"><span class="caption-text">Figure 4: The shaded region represents a cell bounded by three surfaces.</span></p>
<span id="fig-union"></span><img src="../_images/union.svg" /><p class="caption"><span class="caption-text">Figure 15: The shaded region represents a cell bounded by three surfaces.</span></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
@ -192,6 +191,16 @@ z_0 \; R^2"/></td>
<td><img class="math" src="../_images/math/399b4f4cbcdbbe1bed6094340454ce80a0e2429d.png" alt="x_0 \; y_0 \;
z_0 \; R^2"/></td>
</tr>
<tr class="row-odd"><td>General quadric
surface</td>
<td>quadric</td>
<td><img class="math" src="../_images/math/2542fd9fe743f3d9862754ecf1a9647846ca5b61.png" alt="Ax^2 + By^2 + Cz^2 +
Dxy + Eyz + Fxz + Gx + Hy +
Jz + K"/></td>
<td><img class="math" src="../_images/math/d44aec50d29458b96c09e92c97104e670710c0f8.png" alt="A \; B \; C \; D
\; E \; F \; G \; H \;
J \; K"/></td>
</tr>
</tbody>
</table>
<div class="section" id="universes">
@ -403,12 +412,12 @@ the particle is referred to as &#8220;indexing&#8221;.</p>
<h3>2.4.1. Rectilinear Lattice Indexing<a class="headerlink" href="#rectilinear-lattice-indexing" title="Permalink to this headline"></a></h3>
<p>Indices are assigned to tiles in a rectilinear lattice based on the tile&#8217;s
position along the <img class="math" src="../_images/math/188c175aac0a8a9c22499336711b5d7256407254.png" alt="x"/>, <img class="math" src="../_images/math/b124ff74afb0914bb434e8fb849eb56d734412f8.png" alt="y"/>, and <img class="math" src="../_images/math/84d7271dd9e78c1e05d6c3c6ecb60309ef7dfc73.png" alt="z"/> axes. Figure
<a href="#fig-rect-lat">5</a> maps the indices for a 2D lattice. The indices, (1, 1),
<a href="#fig-rect-lat">16</a> maps the indices for a 2D lattice. The indices, (1, 1),
map to the lower-left tile. (5, 1) and (5, 5) map to the lower-right and
upper-right tiles, respectively.</p>
<div class="align-center figure" id="id10">
<span id="fig-rect-lat"></span><a class="reference internal image-reference" href="../_images/rect_lat.svg"><img src="../_images/rect_lat.svg" width="400px" /></a>
<p class="caption"><span class="caption-text">Figure 5: Rectilinear lattice tile indices.</span></p>
<p class="caption"><span class="caption-text">Figure 16: Rectilinear lattice tile indices.</span></p>
</div>
<p>In general, a lattice tile is specified by the three indices,
<img class="math" src="../_images/math/5594347865c09b52b42e6af2c5881703ed18887e.png" alt="(i_x, i_y, i_z)"/>. If a particle&#8217;s current coordinates are
@ -428,13 +437,13 @@ corner of the lattice, and <img class="math" src="../_images/math/0007256293ab5c
<p>A skewed coordinate system is used for indexing hexagonal lattice tiles.
Rather than a <img class="math" src="../_images/math/b124ff74afb0914bb434e8fb849eb56d734412f8.png" alt="y"/>-axis, another axis is used that is rotated 30 degrees
counter-clockwise from the <img class="math" src="../_images/math/b124ff74afb0914bb434e8fb849eb56d734412f8.png" alt="y"/>-axis. This axis is referred to as the
<img class="math" src="../_images/math/ad59b6e24a4a00ac621801f8d7513d68be654ab5.png" alt="\alpha"/>-axis. Figure <a href="#fig-hex-lat">6</a> shows how 2D hexagonal tiles
<img class="math" src="../_images/math/ad59b6e24a4a00ac621801f8d7513d68be654ab5.png" alt="\alpha"/>-axis. Figure <a href="#fig-hex-lat">17</a> shows how 2D hexagonal tiles
are mapped with the <img class="math" src="../_images/math/ef86b8c9ffd4486aedde641af8c4579872ff85e8.png" alt="(x, \alpha)"/> basis. In this system, (0, 0) maps to
the center tile, (0, 2) to the top tile, and (2, -1) to the middle tile on the
right side.</p>
<div class="align-center figure" id="id11">
<span id="fig-hex-lat"></span><a class="reference internal image-reference" href="../_images/hex_lat.svg"><img src="../_images/hex_lat.svg" width="400px" /></a>
<p class="caption"><span class="caption-text">Figure 6: Hexagonal lattice tile indices.</span></p>
<p class="caption"><span class="caption-text">Figure 17: Hexagonal lattice tile indices.</span></p>
</div>
<p>Unfortunately, the indices cannot be determined with one simple formula as
before. Indexing requires a two-step process, a coarse step which determines a
@ -697,7 +706,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" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="next" title="1. Introduction" href="introduction.html" />
<link rel="prev" title="Release Notes for OpenMC 0.7.0" href="../releasenotes.html" />
<link rel="prev" title="Release Notes for OpenMC 0.7.1" href="../releasenotes.html" />
</head>
<body role="document">
<div class="header" role="banner">
@ -36,7 +36,7 @@
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«&#160;&#160;<a href="../releasenotes.html">Release Notes for OpenMC 0.7.0</a>
«&#160;&#160;<a href="../releasenotes.html">Release Notes for OpenMC 0.7.1</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -115,7 +115,11 @@
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="physics.html#transforming-a-particle-s-coordinates">5.8. Transforming a Particle&#8217;s Coordinates</a></li>
<li class="toctree-l2"><a class="reference internal" href="physics.html#effect-of-thermal-motion-on-cross-sections">5.9. Effect of Thermal Motion on Cross Sections</a></li>
<li class="toctree-l2"><a class="reference internal" href="physics.html#effect-of-thermal-motion-on-cross-sections">5.9. Effect of Thermal Motion on Cross Sections</a><ul>
<li class="toctree-l3"><a class="reference internal" href="physics.html#constant-cross-section-model">5.9.1. Constant Cross Section Model</a></li>
<li class="toctree-l3"><a class="reference internal" href="physics.html#energy-dependent-cross-section-model">5.9.2. Energy-Dependent Cross Section Model</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="physics.html#sab-tables">5.10. S(<img class="math" src="../_images/math/35e1676e6106b7f88449b57d632777294e05c3a6.png" alt="\alpha,\beta,T"/>) Tables</a><ul>
<li class="toctree-l3"><a class="reference internal" href="physics.html#calculating-integrated-cross-sections">5.10.1. Calculating Integrated Cross Sections</a></li>
<li class="toctree-l3"><a class="reference internal" href="physics.html#outgoing-angle-for-coherent-elastic-scattering">5.10.2. Outgoing Angle for Coherent Elastic Scattering</a></li>
@ -186,7 +190,7 @@
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«&#160;&#160;<a href="../releasenotes.html">Release Notes for OpenMC 0.7.0</a>
«&#160;&#160;<a href="../releasenotes.html">Release Notes for OpenMC 0.7.1</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -198,7 +202,7 @@
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -177,7 +177,7 @@ and its variance is calculated.</li>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -102,7 +102,7 @@ in the case of an eigenvalue calculation). This idea is illustrated in
<a class="reference internal" href="#figure-master-slave"><span>Communication pattern in master-slave algorithm.</span></a>.</p>
<div class="align-center figure" id="id4">
<span id="figure-master-slave"></span><img alt="../_images/master-slave.png" src="../_images/master-slave.png" />
<p class="caption"><span class="caption-text">Figure 7: Communication pattern in master-slave algorithm.</span></p>
<p class="caption"><span class="caption-text">Figure 18: Communication pattern in master-slave algorithm.</span></p>
</div>
<p>Eigenvalue calculations are slightly more difficult to parallelize than fixed
source calculations since it is necessary to converge on the fission source
@ -148,7 +148,7 @@ to an algorithm whereby the compute nodes communicate with one another only as
needed. This concept is illustrated in <a class="reference internal" href="#figure-nearest-neighbor"><span>Communication pattern in nearest neighbor algorithm.</span></a>.</p>
<div class="align-center figure" id="id5">
<span id="figure-nearest-neighbor"></span><img alt="../_images/nearest-neighbor.png" src="../_images/nearest-neighbor.png" />
<p class="caption"><span class="caption-text">Figure 8: Communication pattern in nearest neighbor algorithm.</span></p>
<p class="caption"><span class="caption-text">Figure 19: Communication pattern in nearest neighbor algorithm.</span></p>
</div>
<p>Since the source sites for each cycle are sampled from the fission sites banked
from the previous cycle, it is a common occurrence for a fission site to be
@ -218,7 +218,7 @@ hatching, and the cross-hatched regions represent source sites that are
communicated between adjacent nodes.</p>
<div class="align-center figure" id="id6">
<span id="figure-neighbor-example"></span><img alt="../_images/nearest-neighbor-example.png" src="../_images/nearest-neighbor-example.png" />
<p class="caption"><span class="caption-text">Figure 9: Example of nearest neighbor algorithm.</span></p>
<p class="caption"><span class="caption-text">Figure 20: Example of nearest neighbor algorithm.</span></p>
</div>
</div>
<div class="section" id="cost-of-master-slave-algorithm">
@ -522,7 +522,7 @@ Radiation Penetration Calculations on a Parallel Computer,&#8221;
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -174,11 +174,11 @@ secondary photons from nuclear de-excitation are tracked in OpenMC.</p>
<div class="section" id="reactions">
<h2>5.5. <img class="math" src="../_images/math/86812743fd2241a6d3211913c9f5c801e4abde62.png" alt="(n,xn)"/> Reactions<a class="headerlink" href="#reactions" title="Permalink to this headline"></a></h2>
<p>These types of reactions are just treated as inelastic scattering and as such
are subject to the same procedure as described in
<a class="reference internal" href="#inelastic-scatter"><span>Inelastic Scattering</span></a>. Rather than tracking multiple secondary neutrons, the
weight of the outgoing neutron is multiplied by the number of secondary
neutrons, e.g. for <img class="math" src="../_images/math/b51c1d14d772823c103e00abf9e448770f391c44.png" alt="(n,2n)"/>, only one outgoing neutron is tracked but its
weight is doubled.</p>
are subject to the same procedure as described in <a class="reference internal" href="#inelastic-scatter"><span>Inelastic Scattering</span></a>. For
reactions with integral multiplicity, e.g., <img class="math" src="../_images/math/b51c1d14d772823c103e00abf9e448770f391c44.png" alt="(n,2n)"/>, an appropriate
number of secondary neutrons are created. For reactions that have a multiplicity
given as a function of the incoming neutron energy (which occasionally occurs
for MT=5), the weight of the outgoing neutron is multiplied by the multiplcity.</p>
</div>
<div class="section" id="fission">
<span id="id1"></span><h2>5.6. Fission<a class="headerlink" href="#fission" title="Permalink to this headline"></a></h2>
@ -763,14 +763,17 @@ probability distribution function can be found by integrating equation
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/2bcc65482aa8e15cd4c9e9f2542451fb4e971a91.png" alt="C"/>.</p>
<p>It is normally assumed that <img class="math" src="../_images/math/15c26742484427f2a5cca0695fb67068ccc7437d.png" alt="\sigma (v_r)"/> is constant over the range of
<div class="section" id="constant-cross-section-model">
<h3>5.9.1. Constant Cross Section Model<a class="headerlink" href="#constant-cross-section-model" title="Permalink to this headline"></a></h3>
<p>It is often assumed that <img class="math" src="../_images/math/15c26742484427f2a5cca0695fb67068ccc7437d.png" alt="\sigma (v_r)"/> is constant over the range of
relative velocities of interest. This is a good assumption for almost all cases
since the elastic scattering cross section varies slowly with velocity for light
nuclei, and for heavy nuclei where large variations can occur due to resonance
scattering, the moderating effect is rather small. Nonetheless, this assumption
may cause incorrect answers in systems with low-lying resonances that can cause
a significant amount of up-scatter that would be ignored by this assumption
(e.g. U-238 in commercial light-water reactors). Nevertheless, with this
(e.g. U-238 in commercial light-water reactors). We will revisit this assumption
later in <a class="reference internal" href="#energy-dependent-xs-model"><span>Energy-Dependent Cross Section Model</span></a>. For now, continuing with the
assumption, we write <img class="math" src="../_images/math/10031c0879c1d72e62b6e4be71acdb3bb845af55.png" alt="\sigma (v_r) = \sigma_s"/> which simplifies
<a href="#equation-target-pdf-1">(61)</a> to</p>
<div class="math" id="equation-target-pdf-2">
@ -891,6 +894,26 @@ on the unit interval. Since the maximum value of <img class="math" src="../_imag
cosine until a combination is found that satisfies equation
<a href="#equation-freegas-accept-2">(80)</a>.</p>
</div>
<div class="section" id="energy-dependent-cross-section-model">
<span id="energy-dependent-xs-model"></span><h3>5.9.2. Energy-Dependent Cross Section Model<a class="headerlink" href="#energy-dependent-cross-section-model" title="Permalink to this headline"></a></h3>
<p>As was noted earlier, assuming that the elastic scattering cross section is
constant in <a href="#equation-reaction-rate">(60)</a> is not strictly correct, especially when
low-lying resonances are present in the cross sections for heavy nuclides. To
correctly account for energy dependence of the scattering cross section entails
performing another rejection step. The most common method is to sample
<img class="math" src="../_images/math/126e84ba38f7dece5f0ad64e929b9588b20f6440.png" alt="\mu"/> and <img class="math" src="../_images/math/576d4929ebf1fbb6d919095c4e9d38a115c5d23a.png" alt="v_T"/> as in the constant cross section approximation and
then perform a rejection on the ratio of the 0 K elastic scattering cross
section at the relative velocity to the maximum 0 K elastic scattering cross
section over the range of velocities considered:</p>
<div class="math" id="equation-dbrc">
<p><span class="eqno">(81)</span><img src="../_images/math/6069c1d194d08831dac6d14c6c98a4ff476dca4a.png" alt="p_{dbrc} = \frac{\sigma_s(v_r)}{\sigma_{s,max}}"/></p>
</div><p>where it should be noted that the maximum is taken over the range <img class="math" src="../_images/math/5c4fc0ac8edd6ce5b9093890970e60ae4d760c73.png" alt="[v_n -
4/\beta, 4_n + 4\beta]"/>. This method is known as Doppler broadening rejection
correction (DBRC) and was first introduced by <a class="reference external" href="http://dx.doi.org/10.1016/j.anucene.2008.12.001">Becker et al.</a>. OpenMC has an
implementation of DBRC as well as an accelerated sampling method that are
described fully in <a class="reference external" href="http://dx.doi.org/10.1016/j.anucene.2014.01.017">Walsh et al.</a></p>
</div>
</div>
<div class="section" id="sab-tables">
<span id="id6"></span><h2>5.10. S(<img class="math" src="../_images/math/35e1676e6106b7f88449b57d632777294e05c3a6.png" alt="\alpha,\beta,T"/>) Tables<a class="headerlink" href="#sab-tables" title="Permalink to this headline"></a></h2>
<p>For neutrons with thermal energies, generally less than 4 eV, the kinematics of
@ -939,14 +962,14 @@ 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/69b9fd7e970f8fe8b5426d25c6e19496d623eb9c.png" alt="\sigma(E) = \frac{\sigma_c}{E} \sum_{E_i &lt; E} f_i e^{-4WE_i}"/></p>
<p><span class="eqno">(82)</span><img src="../_images/math/69b9fd7e970f8fe8b5426d25c6e19496d623eb9c.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/58798ce83b38f451070ce0e5345d8913710b83fb.png" alt="\sigma_c"/> is the effective bound coherent scattering cross section,
<img class="math" src="../_images/math/fa34489cf430b7630b30f28b2eb050e2489e3523.png" alt="W"/> is the effective Debye-Waller coefficient, <img class="math" src="../_images/math/b027139ad09fca3ca4adfe7d1149b9b2a69dbe3a.png" alt="E_i"/> are the
energies of the Bragg edges, and <img class="math" src="../_images/math/f3e8f82a52bdd47c816d880bdbe685ecfc88160b.png" alt="f_i"/> are related to crystallographic
structure factors. Since the functional form of the cross section is just 1/E
and the proportionality constant changes only at Bragg edges, the
proportionality constants are stored and then the cross section can be
calculated analytically based on equation <a href="#equation-coherent-elastic-xs">(81)</a>.</p>
calculated analytically based on equation <a href="#equation-coherent-elastic-xs">(82)</a>.</p>
</div>
<div class="section" id="outgoing-angle-for-coherent-elastic-scattering">
<h3>5.10.2. Outgoing Angle for Coherent Elastic Scattering<a class="headerlink" href="#outgoing-angle-for-coherent-elastic-scattering" title="Permalink to this headline"></a></h3>
@ -957,11 +980,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/a581f053bbfa5115f42c13094857cdd12a37ec49.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/7f5e985e66252bad6ff62ab015cbbc5a15e60018.png" alt="\frac{f_i e^{-4WE_i}}{\sum_j f_j e^{-4WE_j}}."/></p>
<p><span class="eqno">(83)</span><img src="../_images/math/7f5e985e66252bad6ff62ab015cbbc5a15e60018.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/3946360f436553e959b22b8ad46e35c7367f8fa9.png" alt="\mu = 1 - \frac{E_i}{E}"/></p>
<p><span class="eqno">(84)</span><img src="../_images/math/3946360f436553e959b22b8ad46e35c7367f8fa9.png" alt="\mu = 1 - \frac{E_i}{E}"/></p>
</div><p>where <img class="math" src="../_images/math/b027139ad09fca3ca4adfe7d1149b9b2a69dbe3a.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">
@ -973,10 +996,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/11bed1d62b2f553c6bba9255ade361778cb870ea.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/69363585db6d8c715083681d2511f1ffcefadf04.png" alt="\mu = \mu_{i,j} + f (\mu_{i+1,j} - \mu_{i,j})"/></p>
<p><span class="eqno">(85)</span><img src="../_images/math/69363585db6d8c715083681d2511f1ffcefadf04.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/3fbc578039b24cebbb2f87a16a6cc65b0d3f50a2.png" alt="f = \frac{E - E_i}{E_{i+1} - E_i}."/></p>
<p><span class="eqno">(86)</span><img src="../_images/math/3fbc578039b24cebbb2f87a16a6cc65b0d3f50a2.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>
@ -994,17 +1017,17 @@ discrete equiprobable outgoing cosines.</p>
outgoing energy spectra is represented in the ACE data as a set of discrete and
equiprobable outgoing energies. The procedure to determine the outgoing energy
and angle is as such. First, the interpolation factor is determined from
equation <a href="#equation-sab-interpolation-factor">(85)</a>. Then, an outgoing energy bin is
equation <a href="#equation-sab-interpolation-factor">(86)</a>. Then, an outgoing energy bin is
sampled from a uniform distribution and 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/7321eed5feceac9bc2a006d3372a7504afec4e7f.png" alt="E = E_{i,j} + f (E_{i+1,j} - E_{i,j})"/></p>
<p><span class="eqno">(87)</span><img src="../_images/math/7321eed5feceac9bc2a006d3372a7504afec4e7f.png" alt="E = E_{i,j} + f (E_{i+1,j} - E_{i,j})"/></p>
</div><p>where <img class="math" src="../_images/math/2222b995c2353461d6e0ac399df3bf276b9c7304.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/81c9ecfb768181e525934dce274b01155d16656a.png" alt="\mu = \mu_{i,j,k} + f (\mu_{i+1,j,k} - \mu_{i,j,k})"/></p>
<p><span class="eqno">(88)</span><img src="../_images/math/81c9ecfb768181e525934dce274b01155d16656a.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/42f768e135c2ac3dc468b2985fbdfc750dc5f0c2.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>
@ -1035,7 +1058,7 @@ which angular distribution data to use. Like the linear-linear interpolation
case in Law 61, the angular distribution closest to the sampled value of the
cumulative distribution function for the outgoing energy is utilized. The
actual algorithm utilized to sample the outgoing angle is shown in equation
<a href="#equation-inelastic-angle">(87)</a>.</p>
<a href="#equation-inelastic-angle">(88)</a>.</p>
</div>
</div>
</div>
@ -1077,17 +1100,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/ea9369891f1ff8938ae390bdb648678e78c3003a.png" alt="\sigma = \sigma_{i,j} + f (\sigma_{i+1,j} - \sigma{i,j})"/></p>
<p><span class="eqno">(89)</span><img src="../_images/math/ea9369891f1ff8938ae390bdb648678e78c3003a.png" alt="\sigma = \sigma_{i,j} + f (\sigma_{i+1,j} - \sigma{i,j})"/></p>
</div><p>where <img class="math" src="../_images/math/fbbd7cbe39753a1f3c7fd7d850bb95bd97781a6c.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/0001d02b63ede2fe3219e05a7cd09c82ae6298b6.png" alt="f"/> is the interpolation factor defined
in the same manner as <a href="#equation-sab-interpolation-factor">(85)</a>. If logarithmic
in the same manner as <a href="#equation-sab-interpolation-factor">(86)</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/0af49ad5ceac407e47acc6bc425307523ccb028f.png" alt="\sigma = \exp \left ( \log \sigma_{i,j} + f \log
<p><span class="eqno">(90)</span><img src="../_images/math/0af49ad5ceac407e47acc6bc425307523ccb028f.png" alt="\sigma = \exp \left ( \log \sigma_{i,j} + f \log
\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/acb86d5cd33acbbd379014727295964c15cef03a.png" alt="f = \frac{\log \frac{E}{E_i}}{\log \frac{E_{i+1}}{E_i}}."/></p>
<p><span class="eqno">(91)</span><img src="../_images/math/acb86d5cd33acbbd379014727295964c15cef03a.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
@ -1110,7 +1133,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/7309379b4001d8097c2b5bc82a4145d140ca0404.png" alt="w' = w \left ( 1 - \frac{\sigma_a (E)}{\sigma_t (E)} \right )"/></p>
<p><span class="eqno">(92)</span><img src="../_images/math/7309379b4001d8097c2b5bc82a4145d140ca0404.png" alt="w' = w \left ( 1 - \frac{\sigma_a (E)}{\sigma_t (E)} \right )"/></p>
</div><p>where <img class="math" src="../_images/math/d0f641ddabfc77111d0823470829ca6d9ca59ad1.png" alt="w'"/> is the weight of the neutron after adjustment and <img class="math" src="../_images/math/8659700e6646cd91bc02c32affaa5ec046ee9935.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
@ -1120,7 +1143,7 @@ successive generations. The algorithm for sampling fission sites is the same as
that described in <a class="reference internal" href="#fission"><span>Fission</span></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/23e01bdec04e2cbbc81a53da4451026f6a4c6287.png" alt="\nu = \frac{w}{k} \frac{\nu_t \sigma_f(E)}{\sigma_t (E)}"/></p>
<p><span class="eqno">(93)</span><img src="../_images/math/23e01bdec04e2cbbc81a53da4451026f6a4c6287.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/8659700e6646cd91bc02c32affaa5ec046ee9935.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
@ -1211,7 +1234,7 @@ book can be obtained for free from the <a class="reference external" href="http:
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -124,7 +124,7 @@ Different Sizes and Good Lattice Structures,&#8221; <em>Math. Comput.</em>, <str
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -421,7 +421,7 @@ in Statistics - Simulation and Computation, 16 (4), pp. 1123-1132 (1987).</td></
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

Binary file not shown.

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="OpenMC Documentation" href="index.html" />
<link rel="next" title="License Agreement" href="license.html" />
<link rel="prev" title="Tally Arithmetic" href="pythonapi/examples/tally-arithmetic.html" />
<link rel="prev" title="MGXS Part III: Libraries" href="pythonapi/examples/mgxs-part-iii.html" />
</head>
<body role="document">
<div class="header" role="banner">
@ -36,7 +36,7 @@
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«&#160;&#160;<a href="pythonapi/examples/tally-arithmetic.html">Tally Arithmetic</a>
«&#160;&#160;<a href="pythonapi/examples/mgxs-part-iii.html">MGXS Part III: Libraries</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -68,6 +68,9 @@ Code,&#8221; <em>Ann. Nucl. Energy</em>, <strong>51</strong>, 274&#8211;281
<div class="section" id="benchmarking">
<h2>Benchmarking<a class="headerlink" href="#benchmarking" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>Khurrum S. Chaudri and Sikander M. Mirza, &#8220;Burnup dependent Monte Carlo
neutron physics calculations of IAEA MTR benchmark,&#8221; <em>Prog. Nucl. Energy</em>,
<strong>81</strong>, 43-52 (2015). <a class="reference external" href="http://dx.doi.org/j.pnucene.2014.12.018">http://dx.doi.org/j.pnucene.2014.12.018</a></li>
<li>Daniel J. Kelly, Brian N. Aviles, Paul K. Romano, Bryan R. Herman,
Nicholas E. Horelik, and Benoit Forget, &#8220;Analysis of select BEAVRS PWR
benchmark cycle 1 results using MC21 and OpenMC,&#8221; <em>Proc. PHYSOR</em>, Kyoto,
@ -95,12 +98,8 @@ simulations,&#8221; <em>Proc. Joint Int. Conf. M&amp;C+SNA+MC</em>, Nashville, T
Apr. 19&#8211;23 (2015).</li>
<li>Bryan R. Herman, Benoit Forget, and Kord Smith, &#8220;Progress toward Monte
Carlo-thermal hydraulic coupling using low-order nonlinear diffusion
acceleration methods.&#8221; In press, <em>Ann. Nucl. Energy</em>,
(2014). <a class="reference external" href="http://dx.doi.org/10.1016/j.anucene/2014.10.029">http://dx.doi.org/10.1016/j.anucene/2014.10.029</a></li>
<li>Adam G. Nelson and William R. Martin, &#8220;Improved Convergence of Monte Carlo
Generated Multi-Group Scattering Moments,&#8221; <em>Proc. Int. Conf. Mathematics and
Computational Methods Applied to Nuclear Science and Engineering</em>, Sun Valley,
Idaho, May 5&#8211;9 (2013).</li>
acceleration methods.&#8221; <em>Ann. Nucl. Energy</em>, <strong>84</strong>, 63-72
(2015). <a class="reference external" href="http://dx.doi.org/10.1016/j.anucene.2014.10.029">http://dx.doi.org/10.1016/j.anucene.2014.10.029</a></li>
<li>Bryan R. Herman, Benoit Forget, and Kord Smith, &#8220;Utilizing CMFD in OpenMC to
Estimate Dominance Ratio and Adjoint,&#8221; <em>Trans. Am. Nucl. Soc.</em>, <strong>109</strong>,
1389-1392 (2013).</li>
@ -117,18 +116,55 @@ solid geometries,&#8221; <em>Proc. PHYSOR</em>, Kyoto, Japan, Sep. 28&#8211;Oct.
<div class="section" id="miscellaneous">
<h2>Miscellaneous<a class="headerlink" href="#miscellaneous" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>William Boyd, Sterling Harper, and Paul K. Romano, &#8220;Equipping OpenMC for the
big data era,&#8221; Accepted, <em>PHYSOR 2016</em>, Sun Valley, Idaho, May 1-5, 2016.</li>
<li>Qicang Shen, William Boyd, Benoit Forget, and Kord Smith, &#8220;Tally precision
triggers for the OpenMC Monte Carlo code,&#8221; <em>Trans. Am. Nucl. Soc.</em>, <strong>112</strong>,
637-640 (2015).</li>
<li>Timothy P. Burke, Brian C. Kiedrowski, and William R. Martin, &#8220;Flux and
Reaction Rate Kernel Density Estimators in OpenMC,&#8221; <em>Trans. Am. Nucl. Soc.</em>,
<strong>109</strong>, 683-686 (2013).</li>
</ul>
</div>
<div class="section" id="multi-group-cross-section-generation">
<h2>Multi-group Cross Section Generation<a class="headerlink" href="#multi-group-cross-section-generation" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>Adam G. Nelson and William R. Martin, &#8220;Improved Monte Carlo tallying of
multi-group scattering moments using the NDPP code,&#8221; <em>Trans. Am. Nucl. Soc.</em>,
<strong>113</strong>, 645-648 (2015)</li>
<li>Adam G. Nelson and William R. Martin, &#8220;Improved Monte Carlo tallying of
multi-group scattering moment matrices,&#8221; <em>Trans. Am. Nucl. Soc.</em>, <strong>110</strong>,
217-220 (2014).</li>
<li>Adam G. Nelson and William R. Martin, &#8220;Improved Convergence of Monte Carlo
Generated Multi-Group Scattering Moments,&#8221; <em>Proc. Int. Conf. Mathematics and
Computational Methods Applied to Nuclear Science and Engineering</em>, Sun Valley,
Idaho, May 5&#8211;9 (2013).</li>
</ul>
</div>
<div class="section" id="nuclear-data">
<h2>Nuclear Data<a class="headerlink" href="#nuclear-data" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>Colin Josey, Pablo Ducru, Benoit Forget, and Kord Smith, &#8220;Windowed multipole
for cross section Doppler broadening,&#8221; <em>J. Comput. Phys.</em>, In Press
(2016). <a class="reference external" href="http://dx.doi.org/10.1016/jcp.2015.08.013">http://dx.doi.org/10.1016/jcp.2015.08.013</a></li>
<li>Colin Josey, Benoit Forget, and Kord Smith, &#8220;Windowed multipole sensitivity to
target accuracy of the optimization procedure,&#8221; <em>J. Nucl. Sci. Technol.</em>,
<strong>52</strong>, 987-992 (2015). <a class="reference external" href="http://dx.doi.org/10.1080/00223131.2015.1035353">http://dx.doi.org/10.1080/00223131.2015.1035353</a></li>
<li>Jonathan A. Walsh, Paul K. Romano, Benoit Forget, and Kord S. Smith,
&#8220;Optimizations of the energy grid search algorithm in continuous-energy Monte
Carlo particle transport codes&#8221;, <em>Comput. Phys. Commun.</em>, <strong>196</strong>, 134-142
(2015). <a class="reference external" href="http://dx.doi.org/10.1016/j.cpc.2015.05.025">http://dx.doi.org/10.1016/j.cpc.2015.05.025</a></li>
<li>Jonathan A. Walsh, Benoit Forget, Kord S. Smith, Brian C. Kiedrowski, and
Forrest B. Brown, &#8220;Direct, on-the-fly calculation of unresolved resonance
region cross sections in Monte Carlo simulations,&#8221; <em>Proc. Joint
Int. Conf. M&amp;C+SNA+MC</em>, Nashville, Tennessee, Apr. 19&#8211;23 (2015).</li>
<li>Amanda L. Lund, Andrew R. Siegel, Benoit Forget, Colin Josey, and
Paul K. Romano, &#8220;Using fractional cascading to accelerate cross section
lookups in Monte Carlo particle transport calculations,&#8221; <em>Proc. Joint
Int. Conf. M&amp;C+SNA+MC</em>, Nashville, Tennessee, Apr. 19&#8211;23 (2015).</li>
<li>Ronald O. Rahaman, Andrew R. Siegel, and Paul K. Romano, &#8220;Monte Carlo
performance analysis for varying cross section parameter regimes,&#8221;
<em>Proc. Joint Int. Conf. M&amp;C+SNA+MC</em>, Nashville, Tennessee, Apr. 19&#8211;23 (2015).</li>
<li>Paul K. Romano and Timothy H. Trumbull, &#8220;Comparison of algorithms for Doppler
broadening pointwise tabulated cross sections,&#8221; <em>Ann. Nucl. Energy</em>, <strong>75</strong>,
358&#8211;364 (2015). <a class="reference external" href="http://dx.doi.org/10.1016/j.anucene.2014.08.046">http://dx.doi.org/10.1016/j.anucene.2014.08.046</a></li>
@ -146,6 +182,9 @@ Carlo simulations using the multipole representation,&#8221; <em>Ann. Nucl. Ener
<div class="section" id="parallelism">
<h2>Parallelism<a class="headerlink" href="#parallelism" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>Paul K. Romano, John R. Tramm, and Andrew R. Siegel, &#8220;Efficacy of hardware
threading for Monte Carlo particle transport calculations on multi- and
many-core systems,&#8221; Accepted, <em>PHYSOR 2016</em>, Sun Valley, Idaho, May 1-5, 2016.</li>
<li>David Ozog, Allen D. Malony, and Andrew R. Siegel, &#8220;A performance analysis of
SIMD algorithms for Monte Carlo simulations of nuclear reactor cores,&#8221;
<em>Proc. IEEE Int. Parallel and Distributed Processing Symposium</em>, Hyderabad,
@ -207,7 +246,7 @@ Carlo Criticality Calculations,&#8221; <em>Nucl. Sci. Eng.</em>, <strong>170</st
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«&#160;&#160;<a href="pythonapi/examples/tally-arithmetic.html">Tally Arithmetic</a>
«&#160;&#160;<a href="pythonapi/examples/mgxs-part-iii.html">MGXS Part III: Libraries</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
@ -219,7 +258,7 @@ Carlo Criticality Calculations,&#8221; <em>Nucl. Sci. Eng.</em>, <strong>170</st
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -101,6 +101,16 @@
<td>&nbsp;&nbsp;&nbsp;
<a href="pythonapi/mesh.html#module-openmc.mesh"><code class="xref">openmc.mesh</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&nbsp;&nbsp;&nbsp;
<a href="pythonapi/energy_groups.html#module-openmc.mgxs.groups"><code class="xref">openmc.mgxs.groups</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&nbsp;&nbsp;&nbsp;
<a href="pythonapi/mgxs_library.html#module-openmc.mgxs.library"><code class="xref">openmc.mgxs.library</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&nbsp;&nbsp;&nbsp;
@ -171,7 +181,7 @@
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -87,7 +87,7 @@
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -308,7 +308,7 @@ must be used to identify any fission source region.</p>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.0',
VERSION: '0.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -82,6 +82,13 @@ abundances.</p>
<p>Cross section identifier, e.g. 71c</p>
</dd></dl>
<dl class="attribute">
<dt id="openmc.element.Element.scattering">
<code class="descname">scattering</code><a class="headerlink" href="#openmc.element.Element.scattering" title="Permalink to this definition"></a></dt>
<dd><p><em>&#8216;data&#8217; or &#8216;iso-in-lab&#8217; or None</em></p>
<p>The type of angular scattering distribution to use</p>
</dd></dl>
</dd></dl>
</div>
@ -103,7 +110,7 @@ abundances.</p>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
<script type="text/javascript">

View file

@ -0,0 +1,211 @@
<!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>Energy Groups &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.7.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>
<link rel="top" title="OpenMC Documentation" href="../index.html" />
<link rel="up" title="Python API" href="index.html" />
<link rel="next" title="MGXS Library" href="mgxs_library.html" />
<link rel="prev" title="Multi-Group Cross Sections" href="mgxs.html" />
</head>
<body role="document">
<div class="header" role="banner">
<a href="../index.html">
<img class="logo" src="../_static/openmc.png" alt="Logo"/>
</a>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«&#160;&#160;<a href="mgxs.html">Multi-Group Cross Sections</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="mgxs_library.html">MGXS Library</a>&#160;&#160;»
</p>
</div>
<div class="content">
<div class="section" id="module-openmc.mgxs.groups">
<span id="energy-groups"></span><span id="pythonapi-energy-groups"></span><h1>Energy Groups<a class="headerlink" href="#module-openmc.mgxs.groups" title="Permalink to this headline"></a></h1>
<dl class="class">
<dt id="openmc.mgxs.groups.EnergyGroups">
<em class="property">class </em><code class="descclassname">openmc.mgxs.groups.</code><code class="descname">EnergyGroups</code><span class="sig-paren">(</span><em>group_edges=None</em><span class="sig-paren">)</span><a class="headerlink" href="#openmc.mgxs.groups.EnergyGroups" title="Permalink to this definition"></a></dt>
<dd><p>An energy groups structure used for multi-group cross-sections.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>group_edges</strong> (<em>Iterable of Real</em>) &#8211; The energy group boundaries [MeV]</td>
</tr>
</tbody>
</table>
<dl class="attribute">
<dt id="openmc.mgxs.groups.EnergyGroups.group_edges">
<code class="descname">group_edges</code><a class="headerlink" href="#openmc.mgxs.groups.EnergyGroups.group_edges" title="Permalink to this definition"></a></dt>
<dd><p><em>Iterable of Real</em></p>
<p>The energy group boundaries [MeV]</p>
</dd></dl>
<dl class="attribute">
<dt id="openmc.mgxs.groups.EnergyGroups.num_group">
<code class="descname">num_group</code><a class="headerlink" href="#openmc.mgxs.groups.EnergyGroups.num_group" title="Permalink to this definition"></a></dt>
<dd><p><em>Integral</em></p>
<p>The number of energy groups</p>
</dd></dl>
<dl class="method">
<dt id="openmc.mgxs.groups.EnergyGroups.get_condensed_groups">
<code class="descname">get_condensed_groups</code><span class="sig-paren">(</span><em>coarse_groups</em><span class="sig-paren">)</span><a class="headerlink" href="#openmc.mgxs.groups.EnergyGroups.get_condensed_groups" title="Permalink to this definition"></a></dt>
<dd><p>Return a coarsened version of this EnergyGroups object.</p>
<p>This method merges together energy groups in this object into wider
energy groups as defined by the list of groups specified by the user,
and returns a new, coarse EnergyGroups object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>coarse_groups</strong> (<em>Iterable of 2-tuple</em>) &#8211; The energy groups of interest - a list of 2-tuples, each directly
corresponding to one of the new coarse groups. The values in the
2-tuples are upper/lower energy groups used to construct a new
coarse group. For example, if [(1,2), (3,4)] was used as the coarse
groups, fine groups 1 and 2 would be merged into coarse group 1
while fine groups 3 and 4 would be merged into coarse group 2.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A coarsened version of this EnergyGroups object.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#openmc.mgxs.groups.EnergyGroups" title="openmc.mgxs.groups.EnergyGroups">EnergyGroups</a></td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal"><span class="pre">ValueError</span></code> &#8211;
If the group edges have not yet been set.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openmc.mgxs.groups.EnergyGroups.get_group">
<code class="descname">get_group</code><span class="sig-paren">(</span><em>energy</em><span class="sig-paren">)</span><a class="headerlink" href="#openmc.mgxs.groups.EnergyGroups.get_group" title="Permalink to this definition"></a></dt>
<dd><p>Returns the energy group in which the given energy resides.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>energy</strong> (<em>Real</em>) &#8211; The energy of interest in MeV</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The energy group index, starting at 1 for the highest energies</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Integral</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal"><span class="pre">ValueError</span></code> &#8211;
If the group edges have not yet been set.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openmc.mgxs.groups.EnergyGroups.get_group_bounds">
<code class="descname">get_group_bounds</code><span class="sig-paren">(</span><em>group</em><span class="sig-paren">)</span><a class="headerlink" href="#openmc.mgxs.groups.EnergyGroups.get_group_bounds" title="Permalink to this definition"></a></dt>
<dd><p>Returns the energy boundaries for the energy group of interest.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>group</strong> (<em>Integral</em>) &#8211; The energy group index, starting at 1 for the highest energies</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The low and high energy bounds for the group in MeV</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">2-tuple</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal"><span class="pre">ValueError</span></code> &#8211;
If the group edges have not yet been set.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="openmc.mgxs.groups.EnergyGroups.get_group_indices">
<code class="descname">get_group_indices</code><span class="sig-paren">(</span><em>groups='all'</em><span class="sig-paren">)</span><a class="headerlink" href="#openmc.mgxs.groups.EnergyGroups.get_group_indices" title="Permalink to this definition"></a></dt>
<dd><p>Returns the array indices for one or more energy groups.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>groups</strong> (<em>str, tuple</em>) &#8211; The energy groups of interest - a tuple of the energy group indices,
starting at 1 for the highest energies (default is &#8216;all&#8217;)</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The ndarray array indices for each energy group of interest</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">ndarray</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal"><span class="pre">ValueError</span></code> &#8211;
If the group edges have not yet been set, or if a group is requested
that is outside the bounds of the number of energy groups.</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«&#160;&#160;<a href="mgxs.html">Multi-Group Cross Sections</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="../index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="mgxs_library.html">MGXS Library</a>&#160;&#160;»
</p>
</div>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</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

@ -0,0 +1,846 @@
<!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>Introduction to Multi-Group Cross Sections (MGXS) &mdash; OpenMC Documentation</title>
<link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: '0.7.0',
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="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="OpenMC Documentation" href="../../index.html" />
</head>
<body role="document">
<div class="header" role="banner">
<a href="../../index.html">
<img class="logo" src="../../_static/openmc.png" alt="Logo"/>
</a>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
<a class="uplink" href="../../index.html">Contents</a>
</p>
</div>
<div class="content">
<p>This IPython Notebook introduces the use of the <code class="docutils literal"><span class="pre">openmc.mgxs</span></code> module
to calculate multi-group cross sections for an infinite homogeneous
medium. In particular, this Notebook introduces the the following
features:</p>
<ul class="simple">
<li><strong>General equations</strong> for scalar-flux averaged multi-group cross
sections</li>
<li>Creation of multi-group cross sections for an <strong>infinite homogeneous
medium</strong></li>
<li>Use of <strong>tally arithmetic</strong> to manipulate multi-group cross sections</li>
</ul>
<p><strong>Note:</strong> This Notebook illustrates the use of
<a class="reference external" href="http://pandas.pydata.org/">Pandas</a> <code class="docutils literal"><span class="pre">DataFrames</span></code> to containerize
multi-group cross section data. We recommend using
<a class="reference external" href="http://pandas.pydata.org/">Pandas</a> &gt;v0.15.0 or later since OpenMC&#8217;s
Python API leverages the multi-indexing feature included in the most
recent releases of <a class="reference external" href="http://pandas.pydata.org/">Pandas</a>.</p>
<div class="section" id="introduction-to-multi-group-cross-sections-mgxs">
<h1>Introduction to Multi-Group Cross Sections (MGXS)<a class="headerlink" href="#introduction-to-multi-group-cross-sections-mgxs" title="Permalink to this headline"></a></h1>
<p>Many Monte Carlo particle transport codes, including OpenMC, use
continuous-energy nuclear cross section data. However, most
deterministic neutron transport codes use <em>multi-group cross sections</em>
defined over discretized energy bins or <em>energy groups</em>. An example of
U-235&#8217;s continuous-energy fission cross section along with a 16-group
cross section computed for a light water reactor spectrum is displayed
below.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">IPython.display</span> <span class="kn">import</span> <span class="n">Image</span>
<span class="n">Image</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="s">&#39;images/mgxs.png&#39;</span><span class="p">,</span> <span class="n">width</span><span class="o">=</span><span class="mi">350</span><span class="p">)</span>
</pre></div>
</div>
<img alt="../../_images/mgxs-part-i-content_3_0.png" src="../../_images/mgxs-part-i-content_3_0.png" />
<p>A variety of tools employing different methodologies have been developed
over the years to compute multi-group cross sections for certain
applications, including NJOY (LANL), MC<span class="math">\(^2\)</span>-3 (ANL), and Serpent
(VTT). The <code class="docutils literal"><span class="pre">openmc.mgxs</span></code> Python module is designed to leverage
OpenMC&#8217;s tally system to calculate multi-group cross sections with
arbitrary energy discretizations for fine-mesh heterogeneous
deterministic neutron transport applications.</p>
<p>Before proceeding to illustrate how one may use the <code class="docutils literal"><span class="pre">openmc.mgxs</span></code>
module, it is worthwhile to define the general equations used to
calculate multi-group cross sections. This is only intended as a brief
overview of the methodology used by <code class="docutils literal"><span class="pre">openmc.mgxs</span></code> - we refer the
interested reader to the large body of literature on the subject for a
more comprehensive understanding of this complex topic.</p>
<div class="section" id="introductory-notation">
<h2>Introductory Notation<a class="headerlink" href="#introductory-notation" title="Permalink to this headline"></a></h2>
<p>The continuous real-valued microscopic cross section may be denoted
<span class="math">\(\sigma_{n,x}(\mathbf{r}, E)\)</span> for position vector
<span class="math">\(\mathbf{r}\)</span>, energy <span class="math">\(E\)</span>, nuclide <span class="math">\(n\)</span> and interaction
type <span class="math">\(x\)</span>. Similarly, the scalar neutron flux may be denoted by
<span class="math">\(\Phi(\mathbf{r},E)\)</span> for position <span class="math">\(\mathbf{r}\)</span> and energy
<span class="math">\(E\)</span>. <strong>Note</strong>: Although nuclear cross sections are dependent on
the temperature <span class="math">\(T\)</span> of the interacting medium, the temperature
variable is neglected here for brevity.</p>
</div>
<div class="section" id="spatial-and-energy-discretization">
<h2>Spatial and Energy Discretization<a class="headerlink" href="#spatial-and-energy-discretization" title="Permalink to this headline"></a></h2>
<p>The energy domain for critical systems such as thermal reactors spans
more than 10 orders of magnitude of neutron energies from
10<span class="math">\(^{-5}\)</span> - 10<span class="math">\(^7\)</span> eV. The multi-group approximation
discretization divides this energy range into one or more energy groups.
In particular, for <span class="math">\(G\)</span> total groups, we denote an energy group
index <span class="math">\(g\)</span> such that <span class="math">\(g \in \{1, 2, ..., G\}\)</span>. The energy
group indices are defined such that the smaller group the higher the
energy, and vice versa. The integration over neutron energies across a
discrete energy group is commonly referred to as <strong>energy
condensation</strong>.</p>
<p>Multi-group cross sections are computed for discretized spatial zones in
the geometry of interest. The spatial zones may be defined on a
structured and regular fuel assembly or pin cell mesh, an arbitrary
unstructured mesh or the constructive solid geometry used by OpenMC. For
a geometry with <span class="math">\(K\)</span> distinct spatial zones, we designate each
spatial zone an index <span class="math">\(k\)</span> such that
<span class="math">\(k \in \{1, 2, ..., K\}\)</span>. The volume of each spatial zone is
denoted by <span class="math">\(V_{k}\)</span>. The integration over discrete spatial zones is
commonly referred to as <strong>spatial homogenization</strong>.</p>
</div>
<div class="section" id="general-scalar-flux-weighted-mgxs">
<h2>General Scalar-Flux Weighted MGXS<a class="headerlink" href="#general-scalar-flux-weighted-mgxs" title="Permalink to this headline"></a></h2>
<p>The multi-group cross sections computed by <code class="docutils literal"><span class="pre">openmc.mgxs</span></code> are defined
as a <em>scalar flux-weighted average</em> of the microscopic cross sections
across each discrete energy group. This formulation is employed in order
to preserve the reaction rates within each energy group and spatial
zone. In particular, spatial homogenization and energy condensation are
used to compute the general multi-group cross section
<span class="math">\(\sigma_{n,x,k,g}\)</span> as follows:</p>
<div class="math">
\[\sigma_{n,x,k,g} = \frac{\int_{E_{g}}^{E_{g-1}}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\sigma_{n,x}(\mathbf{r},E')\Phi(\mathbf{r},E')}{\int_{E_{g}}^{E_{g-1}}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\Phi(\mathbf{r},E')}\]</div>
<p>This scalar flux-weighted average microscopic cross section is computed
by <code class="docutils literal"><span class="pre">openmc.mgxs</span></code> for most multi-group cross sections, including total,
absorption, and fission reaction types. These double integrals are
stochastically computed with OpenMC&#8217;s tally system - in particular,
<a class="reference external" href="https://mit-crpg.github.io/openmc/pythonapi/filter.html">filters</a> on
the energy range and spatial zone (material, cell or universe) define
the bounds of integration for both numerator and denominator.</p>
</div>
<div class="section" id="multi-group-scattering-matrices">
<h2>Multi-Group Scattering Matrices<a class="headerlink" href="#multi-group-scattering-matrices" title="Permalink to this headline"></a></h2>
<p>The general multi-group cross section <span class="math">\(\sigma_{n,x,k,g}\)</span> is a
vector of <span class="math">\(G\)</span> values for each energy group <span class="math">\(g\)</span>. The equation
presented above only discretizes the energy of the incoming neutron and
neglects the outgoing energy of the neutron (if any). Hence, this
formulation must be extended to account for the outgoing energy of
neutrons in the discretized scattering matrix cross section used by
deterministic neutron transport codes.</p>
<p>We denote the incoming and outgoing neutron energy groups as <span class="math">\(g\)</span>
and <span class="math">\(g'\)</span> for the microscopic scattering matrix cross section
<span class="math">\(\sigma_{n,s}(\mathbf{r},E)\)</span>. As before, spatial homogenization
and energy condensation are used to find the multi-group scattering
matrix cross section <span class="math">\(\sigma_{n,s,k,g \to g'}\)</span> as follows:</p>
<div class="math">
\[\sigma_{n,s,k,g\rightarrow g'} = \frac{\int_{E_{g'}}^{E_{g'-1}}\mathrm{d}E''\int_{E_{g}}^{E_{g-1}}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\sigma_{n,s}(\mathbf{r},E'\rightarrow E'')\Phi(\mathbf{r},E')}{\int_{E_{g}}^{E_{g-1}}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\Phi(\mathbf{r},E')}\]</div>
<p>This scalar flux-weighted multi-group microscopic scattering matrix is
computed using OpenMC tallies with both energy in and energy out
filters.</p>
</div>
<div class="section" id="multi-group-fission-spectrum">
<h2>Multi-Group Fission Spectrum<a class="headerlink" href="#multi-group-fission-spectrum" title="Permalink to this headline"></a></h2>
<p>The energy spectrum of neutrons emitted from fission is denoted by
<span class="math">\(\chi_{n}(\mathbf{r},E' \rightarrow E'')\)</span> for incoming and
outgoing energies <span class="math">\(E'\)</span> and <span class="math">\(E''\)</span>, respectively. Unlike the
multi-group cross sections <span class="math">\(\sigma_{n,x,k,g}\)</span> considered up to
this point, the fission spectrum is a probability distribution and must
sum to unity. The outgoing energy is typically much less dependent on
the incoming energy for fission than for scattering interactions. As a
result, it is common practice to integrate over the incoming neutron
energy when computing the multi-group fission spectrum. The fission
spectrum may be simplified as <span class="math">\(\chi_{n}(\mathbf{r},E)\)</span> with
outgoing energy <span class="math">\(E\)</span>.</p>
<p>Unlike the multi-group cross sections defined up to this point, the
multi-group fission spectrum is weighted by the fission production rate
rather than the scalar flux. This formulation is intended to preserve
the total fission production rate in the multi-group deterministic
calculation. In order to mathematically define the multi-group fission
spectrum, we denote the microscopic fission cross section as
<span class="math">\(\sigma_{n,f}(\mathbf{r},E)\)</span> and the average number of neutrons
emitted from fission interactions with nuclide <span class="math">\(n\)</span> as
<span class="math">\(\nu_{n}(\mathbf{r},E)\)</span>. The multi-group fission spectrum
<span class="math">\(\chi_{n,k,g}\)</span> is then the probability of fission neutrons emitted
into energy group <span class="math">\(g\)</span>.</p>
<p>Similar to before, spatial homogenization and energy condensation are
used to find the multi-group fission spectrum <span class="math">\(\chi_{n,k,g}\)</span> as
follows:</p>
<div class="math">
\[\chi_{n,k,g'} = \frac{\int_{E_{g'}}^{E_{g'-1}}\mathrm{d}E''\int_{0}^{\infty}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\chi_{n}(\mathbf{r},E'\rightarrow E'')\nu_{n}(\mathbf{r},E')\sigma_{n,f}(\mathbf{r},E')\Phi(\mathbf{r},E')}{\int_{0}^{\infty}\mathrm{d}E'\int_{\mathbf{r} \in V_{k}}\mathrm{d}\mathbf{r}\nu_{n}(\mathbf{r},E')\sigma_{n,f}(\mathbf{r},E')\Phi(\mathbf{r},E')}\]</div>
<p>The fission production-weighted multi-group fission spectrum is computed
using OpenMC tallies with both energy in and energy out filters.</p>
<p>This concludes our brief overview on the methodology to compute
multi-group cross sections. The following sections detail more
concretely how users may employ the <code class="docutils literal"><span class="pre">openmc.mgxs</span></code> module to power
simulation workflows requiring multi-group cross sections for downstream
deterministic calculations.</p>
</div>
</div>
<div class="section" id="generate-input-files">
<h1>Generate Input Files<a class="headerlink" href="#generate-input-files" title="Permalink to this headline"></a></h1>
<div class="code python highlight-python"><div class="highlight"><pre>import numpy as np
import matplotlib.pyplot as plt
import openmc
import openmc.mgxs as mgxs
%matplotlib inline
</pre></div>
</div>
<p>First we need to define materials that will be used in the problem.
Before defining a material, we must create nuclides that are used in the
material.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Instantiate some Nuclides</span>
<span class="n">h1</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Nuclide</span><span class="p">(</span><span class="s">&#39;H-1&#39;</span><span class="p">)</span>
<span class="n">o16</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Nuclide</span><span class="p">(</span><span class="s">&#39;O-16&#39;</span><span class="p">)</span>
<span class="n">u235</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Nuclide</span><span class="p">(</span><span class="s">&#39;U-235&#39;</span><span class="p">)</span>
<span class="n">u238</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Nuclide</span><span class="p">(</span><span class="s">&#39;U-238&#39;</span><span class="p">)</span>
<span class="n">zr90</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Nuclide</span><span class="p">(</span><span class="s">&#39;Zr-90&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>With the nuclides we defined, we will now create a material for the
homogeneous medium.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Instantiate a Material and register the Nuclides</span>
<span class="n">inf_medium</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Material</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;moderator&#39;</span><span class="p">)</span>
<span class="n">inf_medium</span><span class="o">.</span><span class="n">set_density</span><span class="p">(</span><span class="s">&#39;g/cc&#39;</span><span class="p">,</span> <span class="mf">5.</span><span class="p">)</span>
<span class="n">inf_medium</span><span class="o">.</span><span class="n">add_nuclide</span><span class="p">(</span><span class="n">h1</span><span class="p">,</span> <span class="mf">0.028999667</span><span class="p">)</span>
<span class="n">inf_medium</span><span class="o">.</span><span class="n">add_nuclide</span><span class="p">(</span><span class="n">o16</span><span class="p">,</span> <span class="mf">0.01450188</span><span class="p">)</span>
<span class="n">inf_medium</span><span class="o">.</span><span class="n">add_nuclide</span><span class="p">(</span><span class="n">u235</span><span class="p">,</span> <span class="mf">0.000114142</span><span class="p">)</span>
<span class="n">inf_medium</span><span class="o">.</span><span class="n">add_nuclide</span><span class="p">(</span><span class="n">u238</span><span class="p">,</span> <span class="mf">0.006886019</span><span class="p">)</span>
<span class="n">inf_medium</span><span class="o">.</span><span class="n">add_nuclide</span><span class="p">(</span><span class="n">zr90</span><span class="p">,</span> <span class="mf">0.002116053</span><span class="p">)</span>
</pre></div>
</div>
<p>With our material, we can now create a <code class="docutils literal"><span class="pre">MaterialsFile</span></code> object that can
be exported to an actual XML file.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Instantiate a MaterialsFile, register all Materials, and export to XML</span>
<span class="n">materials_file</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">MaterialsFile</span><span class="p">()</span>
<span class="n">materials_file</span><span class="o">.</span><span class="n">default_xs</span> <span class="o">=</span> <span class="s">&#39;71c&#39;</span>
<span class="n">materials_file</span><span class="o">.</span><span class="n">add_material</span><span class="p">(</span><span class="n">inf_medium</span><span class="p">)</span>
<span class="n">materials_file</span><span class="o">.</span><span class="n">export_to_xml</span><span class="p">()</span>
</pre></div>
</div>
<p>Now let&#8217;s move on to the geometry. This problem will be a simple square
cell with reflective boundary conditions to simulate an infinite
homogeneous medium. The first step is to create the outer bounding
surfaces of the problem.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Instantiate boundary Planes</span>
<span class="n">min_x</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">XPlane</span><span class="p">(</span><span class="n">boundary_type</span><span class="o">=</span><span class="s">&#39;reflective&#39;</span><span class="p">,</span> <span class="n">x0</span><span class="o">=-</span><span class="mf">0.63</span><span class="p">)</span>
<span class="n">max_x</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">XPlane</span><span class="p">(</span><span class="n">boundary_type</span><span class="o">=</span><span class="s">&#39;reflective&#39;</span><span class="p">,</span> <span class="n">x0</span><span class="o">=</span><span class="mf">0.63</span><span class="p">)</span>
<span class="n">min_y</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">YPlane</span><span class="p">(</span><span class="n">boundary_type</span><span class="o">=</span><span class="s">&#39;reflective&#39;</span><span class="p">,</span> <span class="n">y0</span><span class="o">=-</span><span class="mf">0.63</span><span class="p">)</span>
<span class="n">max_y</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">YPlane</span><span class="p">(</span><span class="n">boundary_type</span><span class="o">=</span><span class="s">&#39;reflective&#39;</span><span class="p">,</span> <span class="n">y0</span><span class="o">=</span><span class="mf">0.63</span><span class="p">)</span>
</pre></div>
</div>
<p>With the surfaces defined, we can now create a cell that is defined by
intersections of half-spaces created by the surfaces.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Instantiate a Cell</span>
<span class="n">cell</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Cell</span><span class="p">(</span><span class="n">cell_id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s">&#39;cell&#39;</span><span class="p">)</span>
<span class="c"># Register bounding Surfaces with the Cell</span>
<span class="n">cell</span><span class="o">.</span><span class="n">region</span> <span class="o">=</span> <span class="o">+</span><span class="n">min_x</span> <span class="o">&amp;</span> <span class="o">-</span><span class="n">max_x</span> <span class="o">&amp;</span> <span class="o">+</span><span class="n">min_y</span> <span class="o">&amp;</span> <span class="o">-</span><span class="n">max_y</span>
<span class="c"># Fill the Cell with the Material</span>
<span class="n">cell</span><span class="o">.</span><span class="n">fill</span> <span class="o">=</span> <span class="n">inf_medium</span>
</pre></div>
</div>
<p>OpenMC requires that there is a &#8220;root&#8221; universe. Let us create a root
universe and add our square cell to it.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Instantiate Universe</span>
<span class="n">root_universe</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Universe</span><span class="p">(</span><span class="n">universe_id</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s">&#39;root universe&#39;</span><span class="p">)</span>
<span class="n">root_universe</span><span class="o">.</span><span class="n">add_cell</span><span class="p">(</span><span class="n">cell</span><span class="p">)</span>
</pre></div>
</div>
<p>We now must create a geometry that is assigned a root universe, put the
geometry into a <code class="docutils literal"><span class="pre">GeometryFile</span></code> object, and export it to XML.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Create Geometry and set root Universe</span>
<span class="n">openmc_geometry</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Geometry</span><span class="p">()</span>
<span class="n">openmc_geometry</span><span class="o">.</span><span class="n">root_universe</span> <span class="o">=</span> <span class="n">root_universe</span>
<span class="c"># Instantiate a GeometryFile</span>
<span class="n">geometry_file</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">GeometryFile</span><span class="p">()</span>
<span class="n">geometry_file</span><span class="o">.</span><span class="n">geometry</span> <span class="o">=</span> <span class="n">openmc_geometry</span>
<span class="c"># Export to &quot;geometry.xml&quot;</span>
<span class="n">geometry_file</span><span class="o">.</span><span class="n">export_to_xml</span><span class="p">()</span>
</pre></div>
</div>
<p>Next, we must define simulation parameters. In this case, we will use 10
inactive batches and 40 active batches each with 2500 particles.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># OpenMC simulation parameters</span>
<span class="n">batches</span> <span class="o">=</span> <span class="mi">50</span>
<span class="n">inactive</span> <span class="o">=</span> <span class="mi">10</span>
<span class="n">particles</span> <span class="o">=</span> <span class="mi">2500</span>
<span class="c"># Instantiate a SettingsFile</span>
<span class="n">settings_file</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">SettingsFile</span><span class="p">()</span>
<span class="n">settings_file</span><span class="o">.</span><span class="n">batches</span> <span class="o">=</span> <span class="n">batches</span>
<span class="n">settings_file</span><span class="o">.</span><span class="n">inactive</span> <span class="o">=</span> <span class="n">inactive</span>
<span class="n">settings_file</span><span class="o">.</span><span class="n">particles</span> <span class="o">=</span> <span class="n">particles</span>
<span class="n">settings_file</span><span class="o">.</span><span class="n">output</span> <span class="o">=</span> <span class="p">{</span><span class="s">&#39;tallies&#39;</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span> <span class="s">&#39;summary&#39;</span><span class="p">:</span> <span class="bp">True</span><span class="p">}</span>
<span class="n">bounds</span> <span class="o">=</span> <span class="p">[</span><span class="o">-</span><span class="mf">0.63</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.63</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.63</span><span class="p">,</span> <span class="mf">0.63</span><span class="p">,</span> <span class="mf">0.63</span><span class="p">,</span> <span class="mf">0.63</span><span class="p">]</span>
<span class="n">settings_file</span><span class="o">.</span><span class="n">set_source_space</span><span class="p">(</span><span class="s">&#39;fission&#39;</span><span class="p">,</span> <span class="n">bounds</span><span class="p">)</span>
<span class="c"># Export to &quot;settings.xml&quot;</span>
<span class="n">settings_file</span><span class="o">.</span><span class="n">export_to_xml</span><span class="p">()</span>
</pre></div>
</div>
<p>Now we are ready to generate multi-group cross sections! First, let&#8217;s
define a 2-group structure using the built-in <code class="docutils literal"><span class="pre">EnergyGroups</span></code> class.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Instantiate a 2-group EnergyGroups object</span>
<span class="n">groups</span> <span class="o">=</span> <span class="n">mgxs</span><span class="o">.</span><span class="n">EnergyGroups</span><span class="p">()</span>
<span class="n">groups</span><span class="o">.</span><span class="n">group_edges</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">0.</span><span class="p">,</span> <span class="mf">0.625e-6</span><span class="p">,</span> <span class="mf">20.</span><span class="p">])</span>
</pre></div>
</div>
<p>We can now use the <code class="docutils literal"><span class="pre">EnergyGroups</span></code> object, along with our previously
created materials and geometry, to instantiate some <code class="docutils literal"><span class="pre">MGXS</span></code> objects
from the <code class="docutils literal"><span class="pre">openmc.mgxs</span></code> module. In particular, the following are
subclasses of the generic and abstract <code class="docutils literal"><span class="pre">MGXS</span></code> class:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">TotalXS</span></code></li>
<li><code class="docutils literal"><span class="pre">TransportXS</span></code></li>
<li><code class="docutils literal"><span class="pre">AbsorptionXS</span></code></li>
<li><code class="docutils literal"><span class="pre">CaptureXS</span></code></li>
<li><code class="docutils literal"><span class="pre">FissionXS</span></code></li>
<li><code class="docutils literal"><span class="pre">NuFissionXS</span></code></li>
<li><code class="docutils literal"><span class="pre">ScatterXS</span></code></li>
<li><code class="docutils literal"><span class="pre">NuScatterXS</span></code></li>
<li><code class="docutils literal"><span class="pre">ScatterMatrixXS</span></code></li>
<li><code class="docutils literal"><span class="pre">NuScatterMatrixXS</span></code></li>
<li><code class="docutils literal"><span class="pre">Chi</span></code></li>
</ul>
<p>These classes provide us with an interface to generate the tally inputs
as well as perform post-processing of OpenMC&#8217;s tally data to compute the
respective multi-group cross sections. In this case, let&#8217;s create the
multi-group total, absorption and scattering cross sections with our
2-group structure.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Instantiate a few different sections</span>
<span class="n">total</span> <span class="o">=</span> <span class="n">mgxs</span><span class="o">.</span><span class="n">TotalXS</span><span class="p">(</span><span class="n">domain</span><span class="o">=</span><span class="n">cell</span><span class="p">,</span> <span class="n">domain_type</span><span class="o">=</span><span class="s">&#39;cell&#39;</span><span class="p">,</span> <span class="n">groups</span><span class="o">=</span><span class="n">groups</span><span class="p">)</span>
<span class="n">absorption</span> <span class="o">=</span> <span class="n">mgxs</span><span class="o">.</span><span class="n">AbsorptionXS</span><span class="p">(</span><span class="n">domain</span><span class="o">=</span><span class="n">cell</span><span class="p">,</span> <span class="n">domain_type</span><span class="o">=</span><span class="s">&#39;cell&#39;</span><span class="p">,</span> <span class="n">groups</span><span class="o">=</span><span class="n">groups</span><span class="p">)</span>
<span class="n">scattering</span> <span class="o">=</span> <span class="n">mgxs</span><span class="o">.</span><span class="n">ScatterXS</span><span class="p">(</span><span class="n">domain</span><span class="o">=</span><span class="n">cell</span><span class="p">,</span> <span class="n">domain_type</span><span class="o">=</span><span class="s">&#39;cell&#39;</span><span class="p">,</span> <span class="n">groups</span><span class="o">=</span><span class="n">groups</span><span class="p">)</span>
</pre></div>
</div>
<p>Each multi-group cross section object stores its tallies in a Python
dictionary called <code class="docutils literal"><span class="pre">tallies</span></code>. We can inspect the tallies in the
dictionary for our <code class="docutils literal"><span class="pre">Absorption</span></code> object as follows.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="n">absorption</span><span class="o">.</span><span class="n">tallies</span>
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>OrderedDict([(&#39;flux&#39;, Tally
ID = 10000
Name =
Filters =
cell [1]
energy [ 0.00000000e+00 6.25000000e-07 2.00000000e+01]
Nuclides = total
Scores = [&#39;flux&#39;]
Estimator = tracklength
), (&#39;absorption&#39;, Tally
ID = 10001
Name =
Filters =
cell [1]
energy [ 0.00000000e+00 6.25000000e-07 2.00000000e+01]
Nuclides = total
Scores = [&#39;absorption&#39;]
Estimator = tracklength
)])
</pre></div>
</div>
<p>The <code class="docutils literal"><span class="pre">Absorption</span></code> object includes tracklength tallies for the
&#8216;absorption&#8217; and &#8216;flux&#8217; scores in the 2-group structure in cell 1. Now
that each <code class="docutils literal"><span class="pre">MGXS</span></code> object contains the tallies that it needs, we must
add these tallies to a <code class="docutils literal"><span class="pre">TalliesFile</span></code> object to generate the
&#8220;tallies.xml&#8221; input file for OpenMC.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Instantiate an empty TalliesFile</span>
<span class="n">tallies_file</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">TalliesFile</span><span class="p">()</span>
<span class="c"># Add total tallies to the tallies file</span>
<span class="k">for</span> <span class="n">tally</span> <span class="ow">in</span> <span class="n">total</span><span class="o">.</span><span class="n">tallies</span><span class="o">.</span><span class="n">values</span><span class="p">():</span>
<span class="n">tallies_file</span><span class="o">.</span><span class="n">add_tally</span><span class="p">(</span><span class="n">tally</span><span class="p">)</span>
<span class="c"># Add absorption tallies to the tallies file</span>
<span class="k">for</span> <span class="n">tally</span> <span class="ow">in</span> <span class="n">absorption</span><span class="o">.</span><span class="n">tallies</span><span class="o">.</span><span class="n">values</span><span class="p">():</span>
<span class="n">tallies_file</span><span class="o">.</span><span class="n">add_tally</span><span class="p">(</span><span class="n">tally</span><span class="p">)</span>
<span class="c"># Add scattering tallies to the tallies file</span>
<span class="k">for</span> <span class="n">tally</span> <span class="ow">in</span> <span class="n">scattering</span><span class="o">.</span><span class="n">tallies</span><span class="o">.</span><span class="n">values</span><span class="p">():</span>
<span class="n">tallies_file</span><span class="o">.</span><span class="n">add_tally</span><span class="p">(</span><span class="n">tally</span><span class="p">)</span>
<span class="c"># Export to &quot;tallies.xml&quot;</span>
<span class="n">tallies_file</span><span class="o">.</span><span class="n">export_to_xml</span><span class="p">()</span>
</pre></div>
</div>
<p>Now we a have a complete set of inputs, so we can go ahead and run our
simulation.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Run OpenMC</span>
<span class="n">executor</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Executor</span><span class="p">()</span>
<span class="n">executor</span><span class="o">.</span><span class="n">run_simulation</span><span class="p">()</span>
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre> .d88888b. 888b d888 .d8888b.
d88P&quot; &quot;Y88b 8888b d8888 d88P Y88b
888 888 88888b.d88888 888 888
888 888 88888b. .d88b. 88888b. 888Y88888P888 888
888 888 888 &quot;88b d8P Y8b 888 &quot;88b 888 Y888P 888 888
888 888 888 888 88888888 888 888 888 Y8P 888 888 888
Y88b. .d88P 888 d88P Y8b. 888 888 888 &quot; 888 Y88b d88P
&quot;Y88888P&quot; 88888P&quot; &quot;Y8888 888 888 888 888 &quot;Y8888P&quot;
__________________888______________________________________________________
888
888
Copyright: 2011-2015 Massachusetts Institute of Technology
License: http://mit-crpg.github.io/openmc/license.html
Version: 0.7.0
Git SHA1: c4b14a5ef87f004528d35cbf33fef3ed15a386ca
Date/Time: 2015-12-02 09:11:05
MPI Processes: 1
===========================================================================
========================&gt; INITIALIZATION &lt;=========================
===========================================================================
Reading settings XML file...
Reading cross sections XML file...
Reading geometry XML file...
Reading materials XML file...
Reading tallies XML file...
Building neighboring cells lists for each surface...
Loading ACE cross section table: 1001.71c
Loading ACE cross section table: 8016.71c
Loading ACE cross section table: 92235.71c
Loading ACE cross section table: 92238.71c
Loading ACE cross section table: 40090.71c
Maximum neutron transport energy: 20.0000 MeV for 1001.71c
Initializing source particles...
===========================================================================
====================&gt; K EIGENVALUE SIMULATION &lt;====================
===========================================================================
Bat./Gen. k Average k
========= ======== ====================
1/1 1.19804
2/1 1.12945
3/1 1.15573
4/1 1.13929
5/1 1.16300
6/1 1.22117
7/1 1.19012
8/1 1.11299
9/1 1.16066
10/1 1.12566
11/1 1.20854
12/1 1.14691 1.17773 +/- 0.03082
13/1 1.17204 1.17583 +/- 0.01789
14/1 1.14148 1.16724 +/- 0.01529
15/1 1.17272 1.16834 +/- 0.01189
16/1 1.18575 1.17124 +/- 0.01014
17/1 1.20498 1.17606 +/- 0.00983
18/1 1.14754 1.17249 +/- 0.00923
19/1 1.18141 1.17348 +/- 0.00820
20/1 1.15074 1.17121 +/- 0.00768
21/1 1.15914 1.17011 +/- 0.00703
22/1 1.14586 1.16809 +/- 0.00673
23/1 1.18999 1.16978 +/- 0.00642
24/1 1.15101 1.16844 +/- 0.00609
25/1 1.13791 1.16640 +/- 0.00602
26/1 1.19791 1.16837 +/- 0.00597
27/1 1.19818 1.17012 +/- 0.00587
28/1 1.14160 1.16854 +/- 0.00576
29/1 1.11487 1.16571 +/- 0.00614
30/1 1.17538 1.16620 +/- 0.00584
31/1 1.20210 1.16791 +/- 0.00581
32/1 1.20078 1.16940 +/- 0.00574
33/1 1.14624 1.16839 +/- 0.00558
34/1 1.14618 1.16747 +/- 0.00542
35/1 1.16866 1.16752 +/- 0.00520
36/1 1.18565 1.16821 +/- 0.00504
37/1 1.16824 1.16821 +/- 0.00485
38/1 1.18299 1.16874 +/- 0.00471
39/1 1.21418 1.17031 +/- 0.00480
40/1 1.11167 1.16835 +/- 0.00504
41/1 1.11545 1.16665 +/- 0.00516
42/1 1.11114 1.16491 +/- 0.00529
43/1 1.14227 1.16423 +/- 0.00517
44/1 1.14104 1.16355 +/- 0.00506
45/1 1.16756 1.16366 +/- 0.00492
46/1 1.13065 1.16274 +/- 0.00487
47/1 1.11251 1.16139 +/- 0.00492
48/1 1.14731 1.16101 +/- 0.00481
49/1 1.16691 1.16117 +/- 0.00469
50/1 1.19679 1.16206 +/- 0.00465
Creating state point statepoint.50.h5...
===========================================================================
======================&gt; SIMULATION FINISHED &lt;======================
===========================================================================
=======================&gt; TIMING STATISTICS &lt;=======================
Total time for initialization = 4.1700E-01 seconds
Reading cross sections = 8.9000E-02 seconds
Total time in simulation = 1.4728E+01 seconds
Time in transport only = 1.4712E+01 seconds
Time in inactive batches = 1.7890E+00 seconds
Time in active batches = 1.2939E+01 seconds
Time synchronizing fission bank = 5.0000E-03 seconds
Sampling source sites = 3.0000E-03 seconds
SEND/RECV source sites = 2.0000E-03 seconds
Time accumulating tallies = 1.0000E-03 seconds
Total time for finalization = 1.0000E-03 seconds
Total time elapsed = 1.5155E+01 seconds
Calculation Rate (inactive) = 13974.3 neutrons/second
Calculation Rate (active) = 7728.57 neutrons/second
============================&gt; RESULTS &lt;============================
k-effective (Collision) = 1.16131 +/- 0.00453
k-effective (Track-length) = 1.16206 +/- 0.00465
k-effective (Absorption) = 1.16096 +/- 0.00364
Combined k-effective = 1.16120 +/- 0.00325
Leakage Fraction = 0.00000 +/- 0.00000
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre><span class="mi">0</span>
</pre></div>
</div>
</div>
<div class="section" id="tally-data-processing">
<h1>Tally Data Processing<a class="headerlink" href="#tally-data-processing" title="Permalink to this headline"></a></h1>
<p>Our simulation ran successfully and created statepoint and summary
output files. We begin our analysis by instantiating a <code class="docutils literal"><span class="pre">StatePoint</span></code>
object.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Load the last statepoint file</span>
<span class="n">sp</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">StatePoint</span><span class="p">(</span><span class="s">&#39;statepoint.50.h5&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>In addition to the statepoint file, our simulation also created a
summary file which encapsulates information about the materials and
geometry. This is necessary for the <code class="docutils literal"><span class="pre">openmc.mgxs</span></code> module to properly
process the tally data. We first create a <code class="docutils literal"><span class="pre">Summary</span></code> object and link it
with the statepoint.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Load the summary file and link it with the statepoint</span>
<span class="n">su</span> <span class="o">=</span> <span class="n">openmc</span><span class="o">.</span><span class="n">Summary</span><span class="p">(</span><span class="s">&#39;summary.h5&#39;</span><span class="p">)</span>
<span class="n">sp</span><span class="o">.</span><span class="n">link_with_summary</span><span class="p">(</span><span class="n">su</span><span class="p">)</span>
</pre></div>
</div>
<p>The statepoint is now ready to be analyzed by our multi-group cross
sections. We simply have to load the tallies from the <code class="docutils literal"><span class="pre">StatePoint</span></code>
into each object as follows and our <code class="docutils literal"><span class="pre">MGXS</span></code> objects will compute the
cross sections for us under-the-hood.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Load the tallies from the statepoint into each MGXS object</span>
<span class="n">total</span><span class="o">.</span><span class="n">load_from_statepoint</span><span class="p">(</span><span class="n">sp</span><span class="p">)</span>
<span class="n">absorption</span><span class="o">.</span><span class="n">load_from_statepoint</span><span class="p">(</span><span class="n">sp</span><span class="p">)</span>
<span class="n">scattering</span><span class="o">.</span><span class="n">load_from_statepoint</span><span class="p">(</span><span class="n">sp</span><span class="p">)</span>
</pre></div>
</div>
<p>Voila! Our multi-group cross sections are now ready to rock &#8216;n roll!</p>
</div>
<div class="section" id="extracting-and-storing-mgxs-data">
<h1>Extracting and Storing MGXS Data<a class="headerlink" href="#extracting-and-storing-mgxs-data" title="Permalink to this headline"></a></h1>
<p>Let&#8217;s first inspect our total cross section by printing it to the
screen.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="n">total</span><span class="o">.</span><span class="n">print_xs</span><span class="p">()</span>
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>Multi-Group XS
Reaction Type = total
Domain Type = cell
Domain ID = 1
Cross Sections [cm^-1]:
Group 1 [6.25e-07 - 20.0 MeV]: 6.81e-01 +/- 1.88e-01%
Group 2 [0.0 - 6.25e-07 MeV]: 1.40e+00 +/- 5.91e-01%
</pre></div>
</div>
<p>Since the <code class="docutils literal"><span class="pre">openmc.mgxs</span></code> module uses <a class="reference external" href="https://mit-crpg.github.io/openmc/pythonapi/examples/tally-arithmetic.html">tally
arithmetic</a>
under-the-hood, the cross section is stored as a &#8220;derived&#8221; <code class="docutils literal"><span class="pre">Tally</span></code>
object. This means that it can be queried and manipulated using all of
the same methods supported for the <code class="docutils literal"><span class="pre">Tally</span></code> class in the OpenMC Python
API. For example, we can construct a
<a class="reference external" href="http://pandas.pydata.org/">Pandas</a> <code class="docutils literal"><span class="pre">DataFrame</span></code> of the multi-group
cross section data.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="n">df</span> <span class="o">=</span> <span class="n">scattering</span><span class="o">.</span><span class="n">get_pandas_dataframe</span><span class="p">()</span>
<span class="n">df</span><span class="o">.</span><span class="n">head</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
</pre></div>
</div>
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>group in</th>
<th>nuclide</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td>1</td>
<td>1</td>
<td>total</td>
<td>0.668323</td>
<td>0.001264</td>
</tr>
<tr>
<th>0</th>
<td>1</td>
<td>2</td>
<td>total</td>
<td>1.293258</td>
<td>0.007624</td>
</tr>
</tbody>
</table>
</div><p>Each multi-group cross section object can be easily exported to a
variety of file formats, including CSV, Excel, and LaTeX for storage or
data processing.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="n">absorption</span><span class="o">.</span><span class="n">export_xs_data</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="s">&#39;absorption-xs&#39;</span><span class="p">,</span> <span class="n">format</span><span class="o">=</span><span class="s">&#39;excel&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>The following code snippet shows how to export all three <code class="docutils literal"><span class="pre">MGXS</span></code> to the
same HDF5 binary data store.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="n">total</span><span class="o">.</span><span class="n">build_hdf5_store</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="s">&#39;mgxs&#39;</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
<span class="n">absorption</span><span class="o">.</span><span class="n">build_hdf5_store</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="s">&#39;mgxs&#39;</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
<span class="n">scattering</span><span class="o">.</span><span class="n">build_hdf5_store</span><span class="p">(</span><span class="n">filename</span><span class="o">=</span><span class="s">&#39;mgxs&#39;</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="comparing-mgxs-with-tally-arithmetic">
<h1>Comparing MGXS with Tally Arithmetic<a class="headerlink" href="#comparing-mgxs-with-tally-arithmetic" title="Permalink to this headline"></a></h1>
<p>Finally, we illustrate how one can leverage OpenMC&#8217;s <a class="reference external" href="https://mit-crpg.github.io/openmc/pythonapi/examples/tally-arithmetic.html">tally
arithmetic</a>
data processing feature with <code class="docutils literal"><span class="pre">MGXS</span></code> objects. The <code class="docutils literal"><span class="pre">openmc.mgxs</span></code>
module uses tally arithmetic to compute multi-group cross sections with
automated uncertainty propagation. Each <code class="docutils literal"><span class="pre">MGXS</span></code> object includes an
<code class="docutils literal"><span class="pre">xs_tally</span></code> attribute which is a &#8220;derived&#8221; <code class="docutils literal"><span class="pre">Tally</span></code> based on the
tallies needed to compute the cross section type of interest. These
derived tallies can be used in subsequent tally arithmetic operations.
For example, we can use tally artithmetic to confirm that the
<code class="docutils literal"><span class="pre">TotalXS</span></code> is equal to the sum of the <code class="docutils literal"><span class="pre">AbsorptionXS</span></code> and
<code class="docutils literal"><span class="pre">ScatterXS</span></code> objects.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Use tally arithmetic to compute the difference between the total, absorption and scattering</span>
<span class="n">difference</span> <span class="o">=</span> <span class="n">total</span><span class="o">.</span><span class="n">xs_tally</span> <span class="o">-</span> <span class="n">absorption</span><span class="o">.</span><span class="n">xs_tally</span> <span class="o">-</span> <span class="n">scattering</span><span class="o">.</span><span class="n">xs_tally</span>
<span class="c"># The difference is a derived tally which can generate Pandas DataFrames for inspection</span>
<span class="n">difference</span><span class="o">.</span><span class="n">get_pandas_dataframe</span><span class="p">()</span>
</pre></div>
</div>
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>energy [MeV]</th>
<th>nuclide</th>
<th>score</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1</td>
<td>(0.0e+00 - 6.3e-07)</td>
<td>total</td>
<td>(((total / flux) - (absorption / flux)) - (sca...</td>
<td>4.884981e-15</td>
<td>0.011274</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>(6.3e-07 - 2.0e+01)</td>
<td>total</td>
<td>(((total / flux) - (absorption / flux)) - (sca...</td>
<td>1.221245e-15</td>
<td>0.001802</td>
</tr>
</tbody>
</table>
</div><p>Similarly, we can use tally arithmetic to compute the ratio of
<code class="docutils literal"><span class="pre">AbsorptionXS</span></code> and <code class="docutils literal"><span class="pre">ScatterXS</span></code> to the <code class="docutils literal"><span class="pre">TotalXS</span></code>.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Use tally arithmetic to compute the absorption-to-total MGXS ratio</span>
<span class="n">absorption_to_total</span> <span class="o">=</span> <span class="n">absorption</span><span class="o">.</span><span class="n">xs_tally</span> <span class="o">/</span> <span class="n">total</span><span class="o">.</span><span class="n">xs_tally</span>
<span class="c"># The absorption-to-total ratio is a derived tally which can generate Pandas DataFrames for inspection</span>
<span class="n">absorption_to_total</span><span class="o">.</span><span class="n">get_pandas_dataframe</span><span class="p">()</span>
</pre></div>
</div>
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>energy [MeV]</th>
<th>nuclide</th>
<th>score</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1</td>
<td>(0.0e+00 - 6.3e-07)</td>
<td>total</td>
<td>((absorption / flux) / (total / flux))</td>
<td>0.076219</td>
<td>0.000651</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>(6.3e-07 - 2.0e+01)</td>
<td>total</td>
<td>((absorption / flux) / (total / flux))</td>
<td>0.019319</td>
<td>0.000086</td>
</tr>
</tbody>
</table>
</div><div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Use tally arithmetic to compute the scattering-to-total MGXS ratio</span>
<span class="n">scattering_to_total</span> <span class="o">=</span> <span class="n">scattering</span><span class="o">.</span><span class="n">xs_tally</span> <span class="o">/</span> <span class="n">total</span><span class="o">.</span><span class="n">xs_tally</span>
<span class="c"># The scattering-to-total ratio is a derived tally which can generate Pandas DataFrames for inspection</span>
<span class="n">scattering_to_total</span><span class="o">.</span><span class="n">get_pandas_dataframe</span><span class="p">()</span>
</pre></div>
</div>
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>energy [MeV]</th>
<th>nuclide</th>
<th>score</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1</td>
<td>(0.0e+00 - 6.3e-07)</td>
<td>total</td>
<td>((scatter / flux) / (total / flux))</td>
<td>0.923781</td>
<td>0.007714</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>(6.3e-07 - 2.0e+01)</td>
<td>total</td>
<td>((scatter / flux) / (total / flux))</td>
<td>0.980681</td>
<td>0.002617</td>
</tr>
</tbody>
</table>
</div><p>Lastly, we sum the derived scatter-to-total and absorption-to-total
ratios to confirm that they sum to unity.</p>
<div class="code python highlight-python"><div class="highlight"><pre><span class="c"># Use tally arithmetic to ensure that the absorption- and scattering-to-total MGXS ratios sum to unity</span>
<span class="n">sum_ratio</span> <span class="o">=</span> <span class="n">absorption_to_total</span> <span class="o">+</span> <span class="n">scattering_to_total</span>
<span class="c"># The scattering-to-total ratio is a derived tally which can generate Pandas DataFrames for inspection</span>
<span class="n">sum_ratio</span><span class="o">.</span><span class="n">get_pandas_dataframe</span><span class="p">()</span>
</pre></div>
</div>
<div>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>cell</th>
<th>energy [MeV]</th>
<th>nuclide</th>
<th>score</th>
<th>mean</th>
<th>std. dev.</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>1</td>
<td>(0.0e+00 - 6.3e-07)</td>
<td>total</td>
<td>(((absorption / flux) / (total / flux)) + ((sc...</td>
<td>1</td>
<td>0.007741</td>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>(6.3e-07 - 2.0e+01)</td>
<td>total</td>
<td>(((absorption / flux) / (total / flux)) + ((sc...</td>
<td>1</td>
<td>0.002619</td>
</tr>
</tbody>
</table>
</div></div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
<a class="uplink" href="../../index.html">Contents</a>
</p>
</div>
<div class="footer" role="contentinfo">
&copy; Copyright 2011-2015, Massachusetts Institute of Technology.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</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>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more