mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Merge remote-tracking branch 'upstream/develop' into python-api
This commit is contained in:
commit
8f63112b75
15 changed files with 144 additions and 2467 deletions
|
|
@ -23,7 +23,7 @@ sys.path.insert(0, os.path.abspath('../sphinxext'))
|
|||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['sphinx.ext.pngmath', 'sphinxcontrib.tikz']
|
||||
extensions = ['sphinx.ext.pngmath', 'sphinxcontrib.tikz', 'sphinx_numfig']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
|
@ -39,7 +39,7 @@ master_doc = 'index'
|
|||
|
||||
# General information about the project.
|
||||
project = u'OpenMC'
|
||||
copyright = u'2011-2014, Massachusetts Institute of Technology'
|
||||
copyright = u'2011-2015, Massachusetts Institute of Technology'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
|
|
@ -189,12 +189,19 @@ latex_documents = [
|
|||
]
|
||||
|
||||
latex_elements = {
|
||||
'preamble': '''
|
||||
'preamble': r"""
|
||||
\usepackage{enumitem}
|
||||
\usepackage{amsfonts}
|
||||
\usepackage{amsmath}
|
||||
\setlistdepth{9}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{shapes,snakes,shadows,arrows,calc,decorations.markings,patterns,fit,matrix,spy}
|
||||
'''
|
||||
\usepackage{fixltx2e}
|
||||
\hypersetup{bookmarksdepth=3}
|
||||
\setcounter{tocdepth}{2}
|
||||
\numberwithin{equation}{section}
|
||||
""",
|
||||
'printindex': r""
|
||||
}
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -8,7 +8,10 @@ In order to keep the OpenMC code base consistent in style, this guide specifies
|
|||
a number of rules which should be adhered to when modified existing code or
|
||||
adding new code in OpenMC.
|
||||
|
||||
-------------
|
||||
-------
|
||||
Fortran
|
||||
-------
|
||||
|
||||
General Rules
|
||||
-------------
|
||||
|
||||
|
|
@ -35,7 +38,6 @@ Don't use ``print *`` or ``write(*,*)``. If writing to a file, use a specific
|
|||
unit. Writing to standard output or standard error should be handled by the
|
||||
``write_message`` subroutine or functionality in the error module.
|
||||
|
||||
----------
|
||||
Procedures
|
||||
----------
|
||||
|
||||
|
|
@ -47,7 +49,6 @@ intent(in), intent(out), or intent(inout).
|
|||
|
||||
Include a comment describing what each argument to a procedure is.
|
||||
|
||||
---------
|
||||
Variables
|
||||
---------
|
||||
|
||||
|
|
@ -91,7 +92,7 @@ allocation instead. Use allocatable variables instead of pointer variables when
|
|||
possible.
|
||||
|
||||
Shared/Module Variables
|
||||
-----------------------
|
||||
+++++++++++++++++++++++
|
||||
|
||||
Always put shared variables in modules. Access module variables through a
|
||||
``use`` statement. Always use the ``only`` specifier on the ``use`` statement
|
||||
|
|
@ -99,14 +100,12 @@ except for variables from the global, constants, and various header modules.
|
|||
|
||||
Never use ``equivalence`` statements, ``common`` blocks, or ``data`` statements.
|
||||
|
||||
-------------------------
|
||||
Derived Types and Classes
|
||||
-------------------------
|
||||
|
||||
Derived types and classes should have CamelCase names with words not separated
|
||||
by underscores or hyphens.
|
||||
|
||||
-----------
|
||||
Indentation
|
||||
-----------
|
||||
|
||||
|
|
@ -129,11 +128,10 @@ f90-type-indent, f90-associate-indent, and f90-program indent to 2.
|
|||
Continuation lines should be indented by an extra 5 spaces. This is the default
|
||||
value of f90-continuation-indent in Emacs.
|
||||
|
||||
-------------------------
|
||||
Whitespace in Expressions
|
||||
-------------------------
|
||||
|
||||
Use a single space between arguments to procedures.
|
||||
Use a single space between arguments to procedures.
|
||||
|
||||
Avoid extraneous whitespace in the following situations:
|
||||
|
||||
|
|
@ -146,3 +144,23 @@ Avoid extraneous whitespace in the following situations:
|
|||
|
||||
Yes: if (variable == 2) then
|
||||
No: if ( variable==2 ) then
|
||||
|
||||
------
|
||||
Python
|
||||
------
|
||||
|
||||
Style for Python code should follow PEP8_.
|
||||
|
||||
Docstrings for functions and methods should follow numpydoc_ style.
|
||||
|
||||
Python code should work with both Python 2.7+ and Python 3.0+.
|
||||
|
||||
Use of third-party Python packages should be limited to numpy_, scipy_, and
|
||||
h5py_. Use of other third-party packages must be implemented as optional
|
||||
dependencies rather than required dependencies.
|
||||
|
||||
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
|
||||
.. _numpydoc: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
|
||||
.. _numpy: http://www.numpy.org/
|
||||
.. _scipy: http://www.scipy.org/
|
||||
.. _h5py: http://www.h5py.org/
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@
|
|||
Voxel Plot Binary File Specifications
|
||||
=====================================
|
||||
|
||||
----------
|
||||
Revision 1
|
||||
----------
|
||||
The current revision of the voxel plot binary file is 1.
|
||||
|
||||
**integer(4) n_voxels_x**
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Development Workflow
|
|||
Anyone wishing to make contributions to OpenMC should be fully acquianted and
|
||||
comfortable working with git_ and GitHub_. We assume here that you have git
|
||||
installed on your system, have a GitHub account, and have setup SSH keys to be
|
||||
able to create/push to repositories on GitHub.
|
||||
able to create/push to repositories on GitHub.
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
|
@ -71,7 +71,7 @@ features and bug fixes. The general steps for contributing are as follows:
|
|||
git checkout -b newbranch develop
|
||||
|
||||
3. Make your changes on the new branch that you intend to have included in
|
||||
*develop*. If you have made other changes that should not be merged back,
|
||||
*develop*. If you have made other changes that should not be merged back,
|
||||
ensure that those changes are made on a different branch.
|
||||
|
||||
4. Issue a pull request from GitHub and select the *develop* branch of
|
||||
|
|
@ -98,7 +98,7 @@ OpenMC Test Suite
|
|||
|
||||
The purpose of this test suite is to ensure that OpenMC compiles using various
|
||||
combinations of compiler flags and options, and that all user input options can
|
||||
be used successfully without breaking the code. The test suite is comprised of
|
||||
be used successfully without breaking the code. The test suite is comprised of
|
||||
regression tests where different types of input files are configured and the
|
||||
full OpenMC code is executed. Results from simulations are compared with
|
||||
expected results. The test suite is comprised of many build configurations
|
||||
|
|
@ -114,7 +114,7 @@ download these cross sections please do the following:
|
|||
.. code-block:: sh
|
||||
|
||||
cd ../data
|
||||
python get_nndc.py
|
||||
python get_nndc_data.py
|
||||
export CROSS_SECTIONS=<path_to_data_folder>/nndc/cross_sections.xml
|
||||
|
||||
The test suite can be run on an already existing build using:
|
||||
|
|
@ -143,19 +143,19 @@ variables should be set if the default paths are incorrect:
|
|||
|
||||
* **MPI_DIR** - The path to the MPI directory.
|
||||
|
||||
* Default - */opt/mpich/3.1-gnu*
|
||||
* Default - */opt/mpich/3.1.3-gnu*
|
||||
|
||||
* **HDF5_DIR** - The path to the HDF5 directory.
|
||||
|
||||
* Default - */opt/hdf5/1.8.12-gnu*
|
||||
* Default - */opt/hdf5/1.8.14-gnu*
|
||||
|
||||
* **PHDF5_DIR** - The path to the parallel HDF5 directory.
|
||||
|
||||
* Default - */opt/phdf5/1.8.12-gnu*
|
||||
* Default - */opt/phdf5/1.8.14-gnu*
|
||||
|
||||
* **PETSC_DIR** - The path to the PETSc directory.
|
||||
|
||||
* Default - */opt/petsc/3.4.4-gnu*
|
||||
* Default - */opt/petsc/3.5.2-gnu*
|
||||
|
||||
To run the full test suite, the following command can be executed in the
|
||||
tests directory:
|
||||
|
|
@ -192,7 +192,7 @@ Adding tests to test suite
|
|||
|
||||
To add a new test to the test suite, create a sub-directory in the tests
|
||||
directory that conforms to the regular expression *test_*. To configure
|
||||
a test you need to add the following files to your new test directory,
|
||||
a test you need to add the following files to your new test directory,
|
||||
*test_name* for example:
|
||||
|
||||
* OpenMC input XML files
|
||||
|
|
|
|||
|
|
@ -18,9 +18,11 @@ free to send a message to the User's Group `mailing list`_.
|
|||
.. _Massachusetts Institute of Technology: http://web.mit.edu
|
||||
.. _mailing list: https://groups.google.com/forum/?fromgroups=#!forum/openmc-users
|
||||
|
||||
--------
|
||||
Contents
|
||||
--------
|
||||
.. only:: html
|
||||
|
||||
--------
|
||||
Contents
|
||||
--------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ directions. An example of this is shown in the following expression:
|
|||
:label: not1
|
||||
|
||||
\sum\limits_{u\in(x,y,z)}\left\langle\overline{J}^{u,g}_{l+1/2,m,n}
|
||||
\Delta_m^v\Delta_n^w\right\rangle
|
||||
\Delta_m^v\Delta_n^w\right\rangle
|
||||
|
||||
Here, :math:`u` takes on each direction one at a time. The parameter :math:`J`
|
||||
is surface area-averaged over the transverse indices :math:`m` and :math:`n`
|
||||
|
|
@ -142,7 +142,7 @@ defined from MC tallies as follows:
|
|||
{\left\langle\overline{\overline\phi}_{l,m,n}^h
|
||||
\Delta_l^u\Delta_m^v\Delta_n^w\right\rangle}
|
||||
|
||||
and
|
||||
and
|
||||
|
||||
.. math::
|
||||
:label: xs3
|
||||
|
|
@ -303,13 +303,13 @@ interior cell,
|
|||
\sum_{u\in
|
||||
x,y,x}\frac{1}{\Delta_l^u}\left[\left(-\tilde{D}_{l-1/2,m,n}^{u,g} -
|
||||
\hat{D}_{l-1/2,m,n}^{u,g}\right)\overline{\overline{\phi}}_{l-1,m,n}^g\right.
|
||||
+ \left(\tilde{D}_{l-1/2,m,n}^{u,g} +
|
||||
\\ + \left(\tilde{D}_{l-1/2,m,n}^{u,g} +
|
||||
\tilde{D}_{l+1/2,m,n}^{u,g} - \hat{D}_{l-1/2,m,n}^{u,g} +
|
||||
\hat{D}_{l+1/2,m,n}^{u,g}\right)\overline{\overline{\phi}}_{l,m,n}^g
|
||||
\\ +
|
||||
\\ +
|
||||
\left. \left(-\tilde{D}_{l+1/2,m,n}^{u,g} +
|
||||
\hat{D}_{l+1/2,m,n}^{u,g}\right)\overline{\overline{\phi}}_{l+1,m,n}^g
|
||||
\right] +
|
||||
\right] \\ +
|
||||
\overline{\overline\Sigma}_{t_{l,m,n}}^g\overline{\overline{\phi}}_{l,m,n}^g
|
||||
- \sum\limits_{h=1}^G\overline{\overline{\nu_s\Sigma}}^{h\rightarrow
|
||||
g}_{s_{l,m,n}}\overline{\overline{\phi}}_{l,m,n}^h =
|
||||
|
|
@ -318,7 +318,7 @@ interior cell,
|
|||
|
||||
It should be noted that before substitution, eq. :eq:`eq_neut_bal` was divided
|
||||
by the volume of the cell, :math:`\Delta_l^u\Delta_m^v\Delta_n^w`. Equation
|
||||
:eq:`eq_cmfd_sys` can be represented in operator form as
|
||||
:eq:`eq_cmfd_sys` can be represented in operator form as
|
||||
|
||||
.. math::
|
||||
:label: eq_CMFDopers
|
||||
|
|
@ -349,7 +349,7 @@ and energy group. This is represented as
|
|||
p_{l,m,n}^g =
|
||||
\frac{\sum_{h=1}^{G}\overline{\overline{\nu_f\Sigma}}^{h\rightarrow
|
||||
g}_{f_{l,m,n}}\overline{\overline{\phi}}_{l,m,n}^h\Delta_l^u\Delta_m^v
|
||||
\Delta_n^w}{\sum_n\sum_m\sum_l\sum_{h=1}^{G}\overline{
|
||||
\Delta_n^w}{\sum_n\sum_m\sum_l\sum_{h=1}^{G}\overline{
|
||||
\overline{\nu_f\Sigma}}^{h\rightarrow
|
||||
g}_{f_{l,m,n}}\overline{\overline{\phi}}_{l,m,n}^h\Delta_l^u\Delta_m^v
|
||||
\Delta_n^w}.
|
||||
|
|
@ -439,7 +439,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 :ref:`fig_loss` and :ref:`fig_prod` [BEAVRS]_. These matrices represent
|
||||
figures :num:`fig-loss` and :num:`fig-prod` [BEAVRS]_. 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
|
||||
|
|
@ -473,19 +473,19 @@ no fission neutrons appear with energies in the thermal group.
|
|||
| \ :math:`\left\langle\overline{J}^{u,g}_{l\pm 1/2,m,n}\Delta_m^v\Delta_n^w\right\rangle` | current | mesh, energy |
|
||||
+--------------------------------------------------------------------------------------------+----------------+---------------------------+
|
||||
|
||||
.. _fig_loss:
|
||||
.. _fig-loss:
|
||||
|
||||
.. figure:: ../_images/loss.png
|
||||
:scale: 50
|
||||
|
||||
Sparsity of Neutron Loss Operator
|
||||
Sparsity of Neutron Loss Operator
|
||||
|
||||
.. _fig_prod:
|
||||
.. _fig-prod:
|
||||
|
||||
.. figure:: ../_images/prod.png
|
||||
:scale: 50
|
||||
|
||||
Sparsity of Neutron Production Operator
|
||||
Sparsity of Neutron Production Operator
|
||||
|
||||
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
|
||||
|
|
@ -511,7 +511,7 @@ implemented to obtain eigenvalue and multigroup fluxes as described in [Gill]_
|
|||
and [Knoll]_. This method is not the primary one used, but has gotten recent
|
||||
attention due to its coupling advantages to other physics such as thermal
|
||||
hydraulics. Once multigroup fluxes are obtained, a normalized fission source is
|
||||
calculated in the code using eq. :eq:`eq_cmfd_psrc` directly.
|
||||
calculated in the code using eq. :eq:`eq_cmfd_psrc` directly.
|
||||
|
||||
The next step in the process is to compute weight adjustment factors. These are
|
||||
calculated by taking the ratio of the expected number of neutrons from the CMFD
|
||||
|
|
@ -523,11 +523,11 @@ the current MC source, OpenMC sums the statistical
|
|||
weights of neutrons from the source bank on a given spatial and energy mesh.
|
||||
Once weight adjustment factors were calculated, each neutron's statistical
|
||||
weight in the source bank was modified according to its location and energy.
|
||||
Examples of CMFD simulations using OpenMC can be found in [Herman_Thesis]_.
|
||||
Examples of CMFD simulations using OpenMC can be found in [HermanThesis]_.
|
||||
|
||||
----------
|
||||
References
|
||||
----------
|
||||
.. only:: html
|
||||
|
||||
.. rubric:: References
|
||||
|
||||
.. [BEAVRS] Nick Horelik, Bryan Herman. *Benchmark for Evaluation And Verification of Reactor
|
||||
Simulations*. Massachusetts Institute of Technology, http://crpg.mit.edu/pub/beavrs
|
||||
|
|
@ -536,23 +536,23 @@ References
|
|||
.. [Gill] Daniel F. Gill. *Newton-Krylov methods for the solution of the k-eigenvalue problem in
|
||||
multigroup neutronics calculations*. Ph.D. thesis, Pennsylvania State University, 2010.
|
||||
|
||||
.. [Hebert] Alain Hebert. *Applied reactor physics*. Presses Internationales Polytechnique,
|
||||
.. [Hebert] Alain Hebert. *Applied reactor physics*. Presses Internationales Polytechnique,
|
||||
Montreal, 2009.
|
||||
|
||||
.. [Herman] Bryan R. Herman, Benoit Forget, Kord Smith, and Brian N. Aviles. Improved
|
||||
diffusion coefficients generated from Monte Carlo codes. In *Proceedings of M&C
|
||||
2013*, Sun Valley, ID, USA, May 5 - 9, 2013.
|
||||
|
||||
.. [Herman_Thesis] Bryan R. Herman. *Monte Carlo and Thermal Hydraulic Coupling using
|
||||
Low-Order Nonlinear Diffusion Acceleration*. Sc.D. thesis,
|
||||
Massachusetts Institute of Technology, 2014.
|
||||
.. [HermanThesis] Bryan R. Herman. *Monte Carlo and Thermal Hydraulic Coupling using
|
||||
Low-Order Nonlinear Diffusion Acceleration*. Sc.D. thesis,
|
||||
Massachusetts Institute of Technology, 2014.
|
||||
|
||||
.. [Knoll] D.A. Knoll, H. Park, and C. Newman. *Acceleration of k-eigenvalue/criticality
|
||||
calculations using the Jacobian-free Newton-Krylov method*. Nuclear Science and
|
||||
Engineering, 167:133–140, 2011.
|
||||
|
||||
.. [Park] H. Park, D.A. Knoll, and C.K. Newman. *Nonlinear acceleration of transport
|
||||
criticality problems*. Nuclear Science and Engineering, 172:52–65, 2012.
|
||||
criticality problems*. Nuclear Science and Engineering, 172:52–65, 2012.
|
||||
|
||||
.. [Rhodes] Joel Rhodes and Malte Edenius. *CASMO-4 --- A Fuel Assembly Burnup Program.
|
||||
User’s Manual*. Studsvik of America, ssp-09/443-u rev 0, proprietary edition, 2001.
|
||||
|
|
|
|||
|
|
@ -63,9 +63,9 @@ Other Methods
|
|||
A good survey of other energy grid techniques, including unionized energy grids,
|
||||
can be found in a paper by Leppanen_.
|
||||
|
||||
----------
|
||||
References
|
||||
----------
|
||||
.. only:: html
|
||||
|
||||
.. rubric:: References
|
||||
|
||||
.. [Brown] Forrest B. Brown, "New Hash-based Energy Lookup Algorithm for Monte
|
||||
Carlo codes," LA-UR-14-24530, Los Alamos National Laboratory (2014).
|
||||
|
|
|
|||
|
|
@ -42,9 +42,11 @@ One can confirm that any point inside this sphere will correspond to
|
|||
In OpenMC, every surface defined by the user is assigned an integer to uniquely
|
||||
identify it. We can then refer to either of the two half-spaces created by a
|
||||
surface by a combination of the unique ID of the surface and a positive/negative
|
||||
sign. The following illustration shows an example of an ellipse with unique ID 1
|
||||
sign. Figure :num:`fig-halfspace` shows an example of an ellipse with unique ID 1
|
||||
dividing space into two half-spaces.
|
||||
|
||||
.. _fig-halfspace:
|
||||
|
||||
.. figure:: ../_images/halfspace.*
|
||||
:align: center
|
||||
:figclass: align-center
|
||||
|
|
@ -57,9 +59,11 @@ to be defined by intersections, unions, and differences or half-spaces, OpenMC
|
|||
is currently limited to cells defined only as intersections of
|
||||
half-spaces. Thus, the specification of the cell must include a list of
|
||||
half-space references whose intersection defines the region. The region is then
|
||||
assigned a material defined elsewhere. The following illustration shows an
|
||||
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.
|
||||
|
||||
|
||||
.. _fig-union:
|
||||
|
||||
.. figure:: ../_images/union.*
|
||||
:align: center
|
||||
:figclass: align-center
|
||||
|
|
@ -399,10 +403,12 @@ Rectilinear Lattice Indexing
|
|||
----------------------------
|
||||
|
||||
Indices are assigned to tiles in a rectilinear lattice based on the tile's
|
||||
position along the :math:`x`, :math:`y`, and :math:`z` axes. The figure below
|
||||
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.
|
||||
position along the :math:`x`, :math:`y`, and :math:`z` axes. Figure
|
||||
:num:`fig-rect-lat` 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.
|
||||
|
||||
.. _fig-rect-lat:
|
||||
|
||||
.. figure:: ../_images/rect_lat.*
|
||||
:align: center
|
||||
|
|
@ -431,12 +437,15 @@ corner of the lattice, and :math:`p_0, p_1, p_2` are the pitches along the
|
|||
Hexagonal Lattice Indexing
|
||||
--------------------------
|
||||
|
||||
A skewed coordinate system is used for indexing hexagonal lattice tiles. Rather
|
||||
than a :math:`y`-axis, another axis is used that is rotated 30 degrees
|
||||
A skewed coordinate system is used for indexing hexagonal lattice tiles.
|
||||
Rather than a :math:`y`-axis, another axis is used that is rotated 30 degrees
|
||||
counter-clockwise from the :math:`y`-axis. This axis is referred to as the
|
||||
:math:`\alpha`-axis. The figure below shows how 2D hexagonal tiles are mapped
|
||||
with the :math:`(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.
|
||||
:math:`\alpha`-axis. Figure :num:`fig-hex-lat` shows how 2D hexagonal tiles
|
||||
are mapped with the :math:`(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.
|
||||
|
||||
.. _fig-hex-lat:
|
||||
|
||||
.. figure:: ../_images/hex_lat.*
|
||||
:align: center
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ one master process that controls the scheduling of work and the remaining
|
|||
processes wait to receive work from the master, process the work, and then send
|
||||
their results to the master at the end of the simulation (or a source iteration
|
||||
in the case of an eigenvalue calculation). This idea is illustrated in
|
||||
:ref:`Figure 1 <figure-master-slave>`.
|
||||
:ref:`figure-master-slave`.
|
||||
|
||||
.. _figure-master-slave:
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ in the case of an eigenvalue calculation). This idea is illustrated in
|
|||
:align: center
|
||||
:figclass: align-center
|
||||
|
||||
**Figure 1**: Communication pattern in master-slave algorithm.
|
||||
Communication pattern in master-slave algorithm.
|
||||
|
||||
Eigenvalue calculations are slightly more difficult to parallelize than fixed
|
||||
source calculations since it is necessary to converge on the fission source
|
||||
|
|
@ -117,8 +117,7 @@ Nearest Neighbors Algorithm
|
|||
To reduce the amount of communication required in a fission bank synchronization
|
||||
algorithm, it is desirable to move away from the typical master-slave algorithm
|
||||
to an algorithm whereby the compute nodes communicate with one another only as
|
||||
needed. This concept is illustrated in :ref:`Figure 2
|
||||
<figure-nearest-neighbor>`.
|
||||
needed. This concept is illustrated in :ref:`figure-nearest-neighbor`.
|
||||
|
||||
.. _figure-nearest-neighbor:
|
||||
|
||||
|
|
@ -126,7 +125,7 @@ needed. This concept is illustrated in :ref:`Figure 2
|
|||
:align: center
|
||||
:figclass: align-center
|
||||
|
||||
**Figure 2**: Communication pattern in nearest neighbor algorithm.
|
||||
Communication pattern in nearest neighbor algorithm.
|
||||
|
||||
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
|
||||
|
|
@ -196,8 +195,8 @@ and :math:`p_3` has 245. Note that the total number of sampled sites is 1000 as
|
|||
needed. For each node to have the same number of source sites, :math:`p_0` needs
|
||||
to send its right-most 10 sites to :math:`p_1`, and :math:`p_2` needs to send
|
||||
its left-most 25 sites to :math:`p_1` and its right-most 5 sites to
|
||||
:math:`p_3`. A schematic of this example is shown in :ref:`Figure 3
|
||||
<figure-neighbor-example>`. The data local to each node is given a different
|
||||
:math:`p_3`. A schematic of this example is shown in
|
||||
:ref:`figure-neighbor-example`. The data local to each node is given a different
|
||||
hatching, and the cross-hatched regions represent source sites that are
|
||||
communicated between adjacent nodes.
|
||||
|
||||
|
|
@ -207,7 +206,7 @@ communicated between adjacent nodes.
|
|||
:align: center
|
||||
:figclass: align-center
|
||||
|
||||
**Figure 3**: Example of nearest neighbor algorithm.
|
||||
Example of nearest neighbor algorithm.
|
||||
|
||||
.. _master-slave-cost:
|
||||
|
||||
|
|
@ -600,9 +599,9 @@ is actually independent of the number of nodes:
|
|||
E \left [ \Lambda_{j_{\text{max}}} \right ] = \sqrt{ \frac{N\sigma^2}{2\pi
|
||||
k^2}}.
|
||||
|
||||
----------
|
||||
References
|
||||
----------
|
||||
.. only:: html
|
||||
|
||||
.. rubric:: References
|
||||
|
||||
.. [Troubetzkoy] E. Troubetzkoy, H. Steinberg, and M. Kalos, "Monte Carlo
|
||||
Radiation Penetration Calculations on a Parallel Computer,"
|
||||
|
|
|
|||
|
|
@ -1552,9 +1552,9 @@ default, the cutoff weight in OpenMC is :math:`w_c = 0.25` and the survival
|
|||
weight is :math:`w_s = 1.0`. These parameters vary from one Monte Carlo code to
|
||||
another.
|
||||
|
||||
----------
|
||||
References
|
||||
----------
|
||||
.. only:: html
|
||||
|
||||
.. rubric:: References
|
||||
|
||||
.. [Doyas] Richard J. Doyas and Sterrett T. Perkins, "Interpolation of Tabular
|
||||
Secondary Neutron and Photon Energy Distributions," *Nucl. Sci. Eng.*,
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ Note that :eq:`lcg-skipahead` has the same general form as \eqref{eq:lcg}, so
|
|||
the idea is to determine the new multiplicative and additive constants in
|
||||
:math:`O(\log_2 N)` operations.
|
||||
|
||||
----------
|
||||
References
|
||||
----------
|
||||
.. only:: html
|
||||
|
||||
.. rubric:: References
|
||||
|
||||
.. [LEcuyer] P. L’Ecuyer, "Tables of Linear Congruential Generators of
|
||||
Different Sizes and Good Lattice Structures," *Math. Comput.*, **68**, 249
|
||||
|
|
|
|||
|
|
@ -475,9 +475,9 @@ normal distribution, we use an `unpublished rational approximation`_. After
|
|||
using the rational approximation, one iteration of Newton's method is applied to
|
||||
improve the estimate of the percentile.
|
||||
|
||||
----------
|
||||
References
|
||||
----------
|
||||
.. only:: html
|
||||
|
||||
.. rubric:: References
|
||||
|
||||
.. [George] E. E. Olusegun George and Meenakshi Sivaram, "A modification of the
|
||||
Fisher-Cornish approximation for the student t percentiles," Communication
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ Most of these are easily obtainable in Ubuntu through the package manager, or
|
|||
are easily installed with distutils.
|
||||
|
||||
.. [1] Required for tally data extraction from statepoints with statepoint.py
|
||||
.. [2] Required only if reading HDF5 statepoint files.
|
||||
.. [2] Required only if reading HDF5 statepoint files.
|
||||
.. [3] Optional for plotting utilities
|
||||
|
||||
----------------------
|
||||
|
|
@ -265,18 +265,18 @@ 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):
|
||||
|
|
@ -299,7 +299,7 @@ two heatmaps in the previous figure.
|
|||
[('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):
|
||||
|
|
@ -336,7 +336,7 @@ Plotting in 3D
|
|||
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,
|
||||
3D file with all mesh tallies and filter/score combinations,
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
|
@ -348,8 +348,8 @@ certain data arrays in order to keep file sizes down.
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
<openmc_root>/src/utils/statepoint_3d.py <statepoint_file> --tallies 2,4 --scores 4.1,4.3 -o output.silo
|
||||
<openmc_root>/src/utils/statepoint_3d.py <statepoint_file> --filters 2.energyin.1 --vtk -o output.vtm
|
||||
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
|
||||
|
||||
All available options for specifying a subset of tallies, scores, and filters
|
||||
can be listed with the ``--list`` or ``-l`` command line options.
|
||||
|
|
@ -358,7 +358,7 @@ can be listed with the ``--list`` or ``-l`` command line options.
|
|||
VTK needs to use a multi-block dataset, which stores each mesh piece
|
||||
in a different file in a subfolder. All meshes can be loaded at once
|
||||
with the main VTM file, or each VTI file in the subfolder can be
|
||||
loaded individually.
|
||||
loaded individually.
|
||||
|
||||
Alternatively, the user can write their own Python script to manipulate the data
|
||||
appropriately before insertion into a SILO or VTK file. For instance, if the
|
||||
|
|
@ -396,7 +396,7 @@ and the equivalent VTK file with:
|
|||
grid.SetOrigin(*mesh.lower_left)
|
||||
grid.SetSpacing(*mesh.width)
|
||||
|
||||
# vtk cell arrays have x on the inners, so we need to reorder the data
|
||||
# vtk cell arrays have x on the inners, so we need to reorder the data
|
||||
idata = {}
|
||||
for x in range(nx):
|
||||
for y in range(ny):
|
||||
|
|
@ -416,7 +416,7 @@ and the equivalent VTK file with:
|
|||
|
||||
grid.GetCellData().AddArray(vtkfastdata)
|
||||
grid.GetCellData().AddArray(vtkthermaldata)
|
||||
|
||||
|
||||
writer = vtk.vtkXMLImageDataWriter()
|
||||
writer.SetInput(grid)
|
||||
writer.SetFileName('tally.vti')
|
||||
|
|
@ -486,16 +486,16 @@ 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]:
|
||||
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>,
|
||||
|
|
@ -506,17 +506,17 @@ example of an interactive ipython session using the statepoint.py Python module:
|
|||
<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
|
||||
|
|
|
|||
|
|
@ -904,8 +904,8 @@ contains
|
|||
integer :: universe_num
|
||||
integer :: n_cells_in_univ
|
||||
integer :: coeffs_reqd
|
||||
integer :: temp_double_array3(3)
|
||||
integer, allocatable :: temp_int_array(:)
|
||||
real(8) :: temp_double_array3(3)
|
||||
real(8) :: phi, theta, psi
|
||||
logical :: file_exists
|
||||
logical :: boundary_exists
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue