mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Fixed merge conflicts with develop
This commit is contained in:
commit
b59eacedeb
135 changed files with 10223 additions and 10609 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -1287,14 +1286,16 @@ 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
|
||||
|
|
@ -1305,7 +1306,9 @@ The ``<tally>`` element accepts the following sub-elements:
|
|||
physical quantities:
|
||||
|
||||
:flux:
|
||||
Total flux in particle-cm per source particle.
|
||||
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.
|
||||
|
|
@ -1432,8 +1435,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.
|
||||
|
|
@ -1535,16 +1537,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
|
||||
|
|
|
|||
|
|
@ -59,6 +59,31 @@ 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.
|
||||
|
||||
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 +97,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 +205,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 +318,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
|
||||
-------------
|
||||
|
||||
|
|
|
|||
16
docs/source/usersguide/output/index.rst
Normal file
16
docs/source/usersguide/output/index.rst
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
.. _usersguide_output:
|
||||
|
||||
===================
|
||||
Output File Formats
|
||||
===================
|
||||
|
||||
.. toctree::
|
||||
:numbered:
|
||||
:maxdepth: 3
|
||||
|
||||
statepoint
|
||||
source
|
||||
summary
|
||||
particle_restart
|
||||
track
|
||||
voxel
|
||||
57
docs/source/usersguide/output/particle_restart.rst
Normal file
57
docs/source/usersguide/output/particle_restart.rst
Normal 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.
|
||||
19
docs/source/usersguide/output/source.rst
Normal file
19
docs/source/usersguide/output/source.rst
Normal 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.
|
||||
259
docs/source/usersguide/output/statepoint.rst
Normal file
259
docs/source/usersguide/output/statepoint.rst
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
.. _usersguide_statepoint:
|
||||
|
||||
=======================
|
||||
State Point File Format
|
||||
=======================
|
||||
|
||||
The current revision of the statepoint file format is 13.
|
||||
|
||||
**/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.
|
||||
310
docs/source/usersguide/output/summary.rst
Normal file
310
docs/source/usersguide/output/summary.rst
Normal file
|
|
@ -0,0 +1,310 @@
|
|||
.. _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>/surfaces** (*int[]*)
|
||||
|
||||
Surface 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', or 'z-cone'.
|
||||
|
||||
**/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.
|
||||
30
docs/source/usersguide/output/track.rst
Normal file
30
docs/source/usersguide/output/track.rst
Normal 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.
|
||||
25
docs/source/usersguide/output/voxel.rst
Normal file
25
docs/source/usersguide/output/voxel.rst
Normal 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.
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue