mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Merge branch 'develop' into photon-alund
This commit is contained in:
commit
460452d4f7
746 changed files with 17707 additions and 10855 deletions
|
|
@ -151,8 +151,8 @@ and `Volume II`_. You may also find it helpful to review the following terms:
|
|||
.. _git: http://git-scm.com/
|
||||
.. _git tutorials: http://git-scm.com/documentation
|
||||
.. _Reactor Concepts Manual: http://www.tayloredge.com/periodic/trivia/ReactorConcepts.pdf
|
||||
.. _Volume I: http://energy.gov/sites/prod/files/2013/06/f2/h1019v1.pdf
|
||||
.. _Volume II: http://energy.gov/sites/prod/files/2013/06/f2/h1019v2.pdf
|
||||
.. _Volume I: https://www.standards.doe.gov/standards-documents/1000/1019-bhdbk-1993-v1
|
||||
.. _Volume II: https://www.standards.doe.gov/standards-documents/1000/1019-bhdbk-1993-v2
|
||||
.. _OpenMC source code: https://github.com/mit-crpg/openmc
|
||||
.. _GitHub: https://github.com/
|
||||
.. _bug reports: https://github.com/mit-crpg/openmc/issues
|
||||
|
|
|
|||
|
|
@ -222,6 +222,13 @@ named ``njoy`` available on your path. If you want to explicitly name the
|
|||
executable, the ``njoy_exec`` optional argument can be used. Additionally, the
|
||||
``stdout`` argument can be used to show the progress of the NJOY run.
|
||||
|
||||
To generate a thermal scattering file, you need to specify both an ENDF incident
|
||||
neutron sub-library file as well as a thermal neutron scattering sub-library
|
||||
file; for example::
|
||||
|
||||
light_water = openmc.data.ThermalScattering.from_njoy(
|
||||
'neutrons/n-001_H_001.endf', 'thermal_scatt/tsl-HinH2O.endf')
|
||||
|
||||
Once you have instances of :class:`IncidentNeutron` and
|
||||
:class:`ThermalScattering`, a library can be created by using the
|
||||
``export_to_hdf5()`` methods and the :class:`DataLibrary` class as described in
|
||||
|
|
|
|||
|
|
@ -6,17 +6,18 @@ Installation and Configuration
|
|||
|
||||
.. currentmodule:: openmc
|
||||
|
||||
.. _install_conda:
|
||||
|
||||
----------------------------------------
|
||||
Installing on Linux/Mac with conda-forge
|
||||
----------------------------------------
|
||||
|
||||
`Conda <http://conda.pydata.org/docs/>`_ is an open source package management
|
||||
system and environment management system for installing multiple versions of
|
||||
software packages and their dependencies and switching easily between
|
||||
them. `conda-forge <https://conda-forge.github.io/>`_ is a community-led conda
|
||||
channel of installable packages. For instructions on installing conda, please
|
||||
consult their `documentation
|
||||
<http://conda.pydata.org/docs/install/quick.html>`_.
|
||||
Conda_ is an open source package management system and environment management
|
||||
system for installing multiple versions of software packages and their
|
||||
dependencies and switching easily between them. `conda-forge
|
||||
<https://conda-forge.github.io/>`_ is a community-led conda channel of
|
||||
installable packages. For instructions on installing conda, please consult their
|
||||
`documentation <http://conda.pydata.org/docs/install/quick.html>`_.
|
||||
|
||||
Once you have `conda` installed on your system, add the `conda-forge` channel to
|
||||
your configuration with:
|
||||
|
|
@ -38,6 +39,8 @@ It is possible to list all of the versions of OpenMC available on your platform
|
|||
|
||||
conda search openmc --channel conda-forge
|
||||
|
||||
.. _install_ppa:
|
||||
|
||||
-----------------------------
|
||||
Installing on Ubuntu with PPA
|
||||
-----------------------------
|
||||
|
|
@ -68,9 +71,11 @@ are no longer supported.
|
|||
.. _Personal Package Archive: https://launchpad.net/~paulromano/+archive/staging
|
||||
.. _APT package manager: https://help.ubuntu.com/community/AptGet/Howto
|
||||
|
||||
--------------------
|
||||
Building from Source
|
||||
--------------------
|
||||
.. _install_source:
|
||||
|
||||
----------------------
|
||||
Installing from Source
|
||||
----------------------
|
||||
|
||||
.. _prerequisites:
|
||||
|
||||
|
|
@ -95,10 +100,10 @@ Prerequisites
|
|||
|
||||
* A C/C++ compiler such as gcc_
|
||||
|
||||
OpenMC includes two libraries written in C and C++, respectively. These
|
||||
libraries have been tested to work with a wide variety of compilers. If
|
||||
you are using a Debian-based distribution, you can install the g++
|
||||
compiler using the following command::
|
||||
OpenMC includes various source files written in C and C++,
|
||||
respectively. These source files have been tested to work with a wide
|
||||
variety of compilers. If you are using a Debian-based distribution, you
|
||||
can install the g++ compiler using the following command::
|
||||
|
||||
sudo apt install g++
|
||||
|
||||
|
|
@ -113,34 +118,38 @@ Prerequisites
|
|||
|
||||
* 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::
|
||||
OpenMC uses HDF5 for many input/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 compiling with gcc from the APT repositories, users of Debian
|
||||
derivatives can install HDF5 and/or parallel HDF5 through the package
|
||||
manager::
|
||||
|
||||
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
|
||||
sudo apt install libhdf5-dev
|
||||
|
||||
Parallel versions of the HDF5 library called `libhdf5-mpich-dev` and
|
||||
`libhdf5-openmpi-dev` exist which are built against MPICH and OpenMPI,
|
||||
respectively. To link against a parallel HDF5 library, make sure to set
|
||||
the HDF5_PREFER_PARALLEL CMake option, e.g.::
|
||||
|
||||
FC=mpifort.mpich cmake -DHDF5_PREFER_PARALLEL=on ..
|
||||
|
||||
Note that the exact package names may vary depending on your particular
|
||||
distribution and version.
|
||||
|
||||
If you are using building HDF5 from source 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=mpifort ./configure --enable-fortran --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 install libhdf5-dev hdf5-helpers
|
||||
|
||||
Note that the exact package names may vary depending on your particular
|
||||
distribution and version.
|
||||
If you are building HDF5 version 1.8.x or earlier, you must include
|
||||
``--enable-fortran2003`` when configuring HDF5 or else OpenMC will not
|
||||
be able to compile.
|
||||
|
||||
.. admonition:: Optional
|
||||
:class: note
|
||||
|
|
@ -163,7 +172,7 @@ Prerequisites
|
|||
.. _CMake: http://www.cmake.org
|
||||
.. _OpenMPI: http://www.open-mpi.org
|
||||
.. _MPICH: http://www.mpich.org
|
||||
.. _HDF5: http://www.hdfgroup.org/HDF5/
|
||||
.. _HDF5: https://www.hdfgroup.org/solutions/hdf5/
|
||||
|
||||
Obtaining the Source
|
||||
--------------------
|
||||
|
|
@ -187,8 +196,8 @@ switch to the source of the latest stable release, run the following commands::
|
|||
git checkout master
|
||||
|
||||
.. _GitHub: https://github.com/mit-crpg/openmc
|
||||
.. _git: http://git-scm.com
|
||||
.. _ssh: http://en.wikipedia.org/wiki/Secure_Shell
|
||||
.. _git: https://git-scm.com
|
||||
.. _ssh: https://en.wikipedia.org/wiki/Secure_Shell
|
||||
|
||||
.. _usersguide_build:
|
||||
|
||||
|
|
@ -254,14 +263,15 @@ should be used:
|
|||
Compiling with MPI
|
||||
++++++++++++++++++
|
||||
|
||||
To compile with MPI, set the :envvar:`FC` and :envvar:`CC` environment variables
|
||||
to the path to the MPI Fortran and C wrappers, respectively. For example, in a
|
||||
bash shell:
|
||||
To compile with MPI, set the :envvar:`FC`, :envvar:`CC`, and :envvar:`CXX`
|
||||
environment variables to the path to the MPI Fortran, C, and C++ wrappers,
|
||||
respectively. For example, in a bash shell:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
export FC=mpif90
|
||||
export FC=mpifort
|
||||
export CC=mpicc
|
||||
export CXX=mpicxx
|
||||
cmake /path/to/openmc
|
||||
|
||||
Note that in many shells, environment variables can be set for a single command,
|
||||
|
|
@ -269,7 +279,7 @@ i.e.
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
FC=mpif90 CC=mpicc cmake /path/to/openmc
|
||||
FC=mpifort CC=mpicc CXX=mpicxx cmake /path/to/openmc
|
||||
|
||||
Selecting HDF5 Installation
|
||||
+++++++++++++++++++++++++++
|
||||
|
|
@ -345,7 +355,7 @@ follows:
|
|||
.. code-block:: sh
|
||||
|
||||
mkdir build && cd build
|
||||
FC=ifort CC=icc FFLAGS=-mmic cmake -Dopenmp=on ..
|
||||
FC=ifort CC=icc CXX=icpc FFLAGS=-mmic cmake -Dopenmp=on ..
|
||||
make
|
||||
|
||||
Note that unless an HDF5 build for the Intel Xeon Phi (Knights Corner) is
|
||||
|
|
@ -358,45 +368,59 @@ workarounds.
|
|||
Testing Build
|
||||
-------------
|
||||
|
||||
If you have ENDF/B-VII.1 cross sections from NNDC_ you can test your build.
|
||||
Make sure the **OPENMC_CROSS_SECTIONS** environmental variable is set to the
|
||||
*cross_sections.xml* file in the *data/nndc* directory.
|
||||
There are two ways to run tests. The first is to use the Makefile present in
|
||||
the source directory and run the following:
|
||||
To run the test suite, you will first need to download a pre-generated cross
|
||||
section library along with windowed multipole data. Please refer to our
|
||||
:ref:`devguide_tests` documentation for further details.
|
||||
|
||||
---------------------
|
||||
Installing Python API
|
||||
---------------------
|
||||
|
||||
If you installed OpenMC using :ref:`Conda <install_conda>` or :ref:`PPA
|
||||
<install_ppa>`, no further steps are necessary in order to use OpenMC's
|
||||
:ref:`Python API <pythonapi>`. However, if you are :ref:`installing from source
|
||||
<install_source>`, the Python API is not installed by default when ``make
|
||||
install`` is run because in many situations it doesn't make sense to install a
|
||||
Python package in the same location as the ``openmc`` executable (for example,
|
||||
if you are installing the package into a `virtual environment
|
||||
<https://docs.python.org/3/tutorial/venv.html>`_). The easiest way to install
|
||||
the :mod:`openmc` Python package is to use pip_, which is included by default in
|
||||
Python 3.4+. From the root directory of the OpenMC distribution/repository, run:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
make test
|
||||
pip install .
|
||||
|
||||
If you want more options for testing you can use ctest_ command. For example,
|
||||
if we wanted to run only the plot tests with 4 processors, we run:
|
||||
pip will first check that all :ref:`required third-party packages
|
||||
<usersguide_python_prereqs>` have been installed, and if they are not present,
|
||||
they will be installed by downloading the appropriate packages from the Python
|
||||
Package Index (`PyPI <https://pypi.org/>`_). However, do note that since pip
|
||||
runs the ``setup.py`` script which requires NumPy, you will have to first
|
||||
install NumPy:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
cd build
|
||||
ctest -j 4 -R plot
|
||||
pip install numpy
|
||||
|
||||
If you want to run the full test suite with different build options please
|
||||
refer to our :ref:`test suite` documentation.
|
||||
Installing in "Development" Mode
|
||||
--------------------------------
|
||||
|
||||
--------------------
|
||||
Python Prerequisites
|
||||
--------------------
|
||||
If you are primarily doing development with OpenMC, it is strongly recommended
|
||||
to install the Python package in :ref:`"editable" mode <devguide_editable>`.
|
||||
|
||||
OpenMC's :ref:`Python API <pythonapi>` works with either Python 2.7 or Python
|
||||
3.2+. In addition to Python itself, the API relies on a number of third-party
|
||||
packages. All prerequisites can be installed using `conda
|
||||
<http://conda.pydata.org/docs/>`_ (recommended), `pip
|
||||
<https://pip.pypa.io/en/stable/>`_, or through the package manager in most Linux
|
||||
.. _usersguide_python_prereqs:
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
The Python API works with Python 3.4+. In addition to Python itself, the API
|
||||
relies on a number of third-party packages. All prerequisites can be installed
|
||||
using Conda_ (recommended), pip_, or through the package manager in most Linux
|
||||
distributions.
|
||||
|
||||
.. admonition:: Required
|
||||
:class: error
|
||||
|
||||
`six <https://pythonhosted.org/six/>`_
|
||||
The Python API works with both Python 2.7+ and 3.2+. To do so, the six
|
||||
compatibility library is used.
|
||||
|
||||
`NumPy <http://www.numpy.org/>`_
|
||||
NumPy is used extensively within the Python API for its powerful
|
||||
N-dimensional array.
|
||||
|
|
@ -428,6 +452,11 @@ distributions.
|
|||
.. admonition:: Optional
|
||||
:class: note
|
||||
|
||||
`mpi4py <http://mpi4py.scipy.org/>`_
|
||||
mpi4py provides Python bindings to MPI for running distributed-memory
|
||||
parallel runs. This package is needed if you plan on running depletion
|
||||
simulations in parallel using MPI.
|
||||
|
||||
`Cython <http://cython.org/>`_
|
||||
Cython is used for resonance reconstruction for ENDF data converted to
|
||||
:class:`openmc.data.IncidentNeutron`.
|
||||
|
|
@ -470,3 +499,5 @@ schemas.xml file in your own OpenMC source directory.
|
|||
.. _RELAX NG: http://relaxng.org/
|
||||
.. _NNDC: http://www.nndc.bnl.gov/endf/b7.1/acefiles.html
|
||||
.. _ctest: http://www.cmake.org/cmake/help/v2.8.12/ctest.html
|
||||
.. _Conda: https://conda.io/docs/
|
||||
.. _pip: https://pip.pypa.io/en/stable/
|
||||
|
|
|
|||
|
|
@ -168,8 +168,8 @@ ENDF/B-VII.1. It has the following optional arguments:
|
|||
|
||||
This script downloads `ENDF/B-VII.1 ACE data
|
||||
<http://www.nndc.bnl.gov/endf/b7.1/acefiles.html>`_ from NNDC and converts it to
|
||||
an HDF5 library for use with OpenMC. This data is used for OpenMC's regression
|
||||
test suite. This script has the following optional arguments:
|
||||
an HDF5 library for use with OpenMC. This script has the following optional
|
||||
arguments:
|
||||
|
||||
-b, --batch Suppress standard in
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ be specified:
|
|||
'plot'
|
||||
Generates slice or voxel plots (see :ref:`usersguide_plots`).
|
||||
|
||||
'particle_restart'
|
||||
'particle restart'
|
||||
Simulate a single source particle using a particle restart file.
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue