mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Merge pull request #1690 from paulromano/nbsphinx
Use nbsphinx for rendering Jupyter notebooks in documentation
This commit is contained in:
commit
cf324e2434
75 changed files with 124 additions and 568 deletions
|
|
@ -2,3 +2,4 @@ sphinx-numfig
|
|||
jupyter
|
||||
sphinxcontrib-katex
|
||||
sphinxcontrib-svg2pdfconverter
|
||||
nbsphinx
|
||||
|
|
|
|||
|
|
@ -20,13 +20,12 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
|||
# ImportErrors when building documentation
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
|
||||
MOCK_MODULES = [
|
||||
'numpy', 'numpy.polynomial', 'numpy.polynomial.polynomial',
|
||||
'numpy.ctypeslib', 'scipy', 'scipy.sparse', 'scipy.sparse.linalg',
|
||||
'scipy.interpolate', 'scipy.integrate', 'scipy.optimize', 'scipy.special',
|
||||
'scipy.stats', 'scipy.spatial', 'h5py', 'pandas', 'uncertainties',
|
||||
'matplotlib', 'matplotlib.pyplot', 'openmoc',
|
||||
'scipy.interpolate', 'scipy.integrate', 'scipy.optimize', 'scipy.signal',
|
||||
'scipy.special', 'scipy.stats', 'scipy.spatial', 'h5py', 'pandas',
|
||||
'uncertainties', 'matplotlib', 'matplotlib.pyplot', 'openmoc',
|
||||
'openmc.data.reconstruct', 'openmc.checkvalue'
|
||||
]
|
||||
sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)
|
||||
|
|
@ -39,7 +38,6 @@ np.polynomial.Polynomial = MagicMock
|
|||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.insert(0, os.path.abspath('../sphinxext'))
|
||||
sys.path.insert(0, os.path.abspath('../..'))
|
||||
|
||||
|
||||
|
|
@ -47,14 +45,16 @@ sys.path.insert(0, os.path.abspath('../..'))
|
|||
|
||||
# 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.autodoc',
|
||||
'sphinx.ext.napoleon',
|
||||
'sphinx.ext.autosummary',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinxcontrib.katex',
|
||||
'sphinx_numfig',
|
||||
'notebook_sphinxext']
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.napoleon',
|
||||
'sphinx.ext.autosummary',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinxcontrib.katex',
|
||||
'sphinx_numfig',
|
||||
'nbsphinx'
|
||||
]
|
||||
if not on_rtd:
|
||||
extensions.append('sphinxcontrib.rsvgconverter')
|
||||
|
||||
|
|
|
|||
1
docs/source/examples/cad-based-geometry.ipynb
Symbolic link
1
docs/source/examples/cad-based-geometry.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/cad-based-geometry.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_cad-geom:
|
||||
|
||||
==========================
|
||||
Using CAD-Based Geometries
|
||||
==========================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/cad-based-geometry.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/candu.ipynb
Symbolic link
1
docs/source/examples/candu.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/candu.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_candu:
|
||||
|
||||
=======================
|
||||
Modeling a CANDU Bundle
|
||||
=======================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/candu.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/expansion-filters.ipynb
Symbolic link
1
docs/source/examples/expansion-filters.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/expansion-filters.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_expansion:
|
||||
|
||||
=====================
|
||||
Functional Expansions
|
||||
=====================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/expansion-filters.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/hexagonal-lattice.ipynb
Symbolic link
1
docs/source/examples/hexagonal-lattice.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/hexagonal-lattice.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_hexagonal:
|
||||
|
||||
===========================
|
||||
Modeling Hexagonal Lattices
|
||||
===========================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/hexagonal-lattice.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
|
|
@ -23,7 +23,7 @@ General Usage
|
|||
search
|
||||
nuclear-data
|
||||
nuclear-data-resonance-covariance
|
||||
pincell-depletion
|
||||
pincell_depletion
|
||||
|
||||
--------
|
||||
Geometry
|
||||
|
|
@ -32,14 +32,14 @@ Geometry
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
hexagonal
|
||||
hexagonal-lattice
|
||||
triso
|
||||
candu
|
||||
cad-geom
|
||||
cad-based-geometry
|
||||
|
||||
------------------------------------
|
||||
Multi-Group Cross Section Generation
|
||||
------------------------------------
|
||||
-----------------------------------
|
||||
Multigroup Cross Section Generation
|
||||
-----------------------------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
|
@ -50,9 +50,9 @@ Multi-Group Cross Section Generation
|
|||
mdgxs-part-i
|
||||
mdgxs-part-ii
|
||||
|
||||
----------------
|
||||
Multi-Group Mode
|
||||
----------------
|
||||
---------------
|
||||
Multigroup Mode
|
||||
---------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
|
|
|||
1
docs/source/examples/mdgxs-part-i.ipynb
Symbolic link
1
docs/source/examples/mdgxs-part-i.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/mdgxs-part-i.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_mdgxs_part_i:
|
||||
|
||||
===================================================================
|
||||
Multi-Group (Delayed) Cross Section Generation Part I: Introduction
|
||||
===================================================================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/mdgxs-part-i.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/mdgxs-part-ii.ipynb
Symbolic link
1
docs/source/examples/mdgxs-part-ii.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/mdgxs-part-ii.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_mdgxs_part_ii:
|
||||
|
||||
=========================================================================
|
||||
Multi-Group (Delayed) Cross Section Generation Part II: Advanced Features
|
||||
=========================================================================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/mdgxs-part-ii.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/mg-mode-part-i.ipynb
Symbolic link
1
docs/source/examples/mg-mode-part-i.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/mg-mode-part-i.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_mg_mode_part_i:
|
||||
|
||||
=====================================
|
||||
Multi-Group Mode Part I: Introduction
|
||||
=====================================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/mg-mode-part-i.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/mg-mode-part-ii.ipynb
Symbolic link
1
docs/source/examples/mg-mode-part-ii.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/mg-mode-part-ii.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_mg_mode_part_ii:
|
||||
|
||||
=============================================================
|
||||
Multi-Group Mode Part II: MGXS Library Generation With OpenMC
|
||||
=============================================================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/mg-mode-part-ii.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/mg-mode-part-iii.ipynb
Symbolic link
1
docs/source/examples/mg-mode-part-iii.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/mg-mode-part-iii.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_mg_mode_part_iii:
|
||||
|
||||
====================================================
|
||||
Multi-Group Mode Part III: Advanced Feature Showcase
|
||||
====================================================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/mg-mode-part-iii.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/mgxs-part-i.ipynb
Symbolic link
1
docs/source/examples/mgxs-part-i.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/mgxs-part-i.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_mgxs_part_i:
|
||||
|
||||
=========================
|
||||
MGXS Part I: Introduction
|
||||
=========================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/mgxs-part-i.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/mgxs-part-ii.ipynb
Symbolic link
1
docs/source/examples/mgxs-part-ii.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/mgxs-part-ii.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_mgxs_part_ii:
|
||||
|
||||
===============================
|
||||
MGXS Part II: Advanced Features
|
||||
===============================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/mgxs-part-ii.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/mgxs-part-iii.ipynb
Symbolic link
1
docs/source/examples/mgxs-part-iii.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/mgxs-part-iii.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_mgxs_part_iii:
|
||||
|
||||
========================
|
||||
MGXS Part III: Libraries
|
||||
========================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/mgxs-part-iii.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/nuclear-data-resonance-covariance.ipynb
Symbolic link
1
docs/source/examples/nuclear-data-resonance-covariance.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/nuclear-data-resonance-covariance.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_nuclear_data_resonance_covariance:
|
||||
|
||||
==================================
|
||||
Nuclear Data: Resonance Covariance
|
||||
==================================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/nuclear-data-resonance-covariance.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/nuclear-data.ipynb
Symbolic link
1
docs/source/examples/nuclear-data.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/nuclear-data.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_nuclear_data:
|
||||
|
||||
============
|
||||
Nuclear Data
|
||||
============
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/nuclear-data.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/pandas-dataframes.ipynb
Symbolic link
1
docs/source/examples/pandas-dataframes.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/pandas-dataframes.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _examples_pandas:
|
||||
|
||||
=================
|
||||
Pandas Dataframes
|
||||
=================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/pandas-dataframes.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
.. _notebook_depletion:
|
||||
|
||||
=================
|
||||
Pincell Depletion
|
||||
=================
|
||||
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/pincell_depletion.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/pincell.ipynb
Symbolic link
1
docs/source/examples/pincell.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/pincell.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_pincell:
|
||||
|
||||
===================
|
||||
Modeling a Pin-Cell
|
||||
===================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/pincell.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/pincell_depletion.ipynb
Symbolic link
1
docs/source/examples/pincell_depletion.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/pincell_depletion.ipynb
|
||||
1
docs/source/examples/post-processing.ipynb
Symbolic link
1
docs/source/examples/post-processing.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/post-processing.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_post_processing:
|
||||
|
||||
===============
|
||||
Post Processing
|
||||
===============
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/post-processing.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/search.ipynb
Symbolic link
1
docs/source/examples/search.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/search.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_search:
|
||||
|
||||
==================
|
||||
Criticality Search
|
||||
==================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/search.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/tally-arithmetic.ipynb
Symbolic link
1
docs/source/examples/tally-arithmetic.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/tally-arithmetic.ipynb
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
================
|
||||
Tally Arithmetic
|
||||
================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/tally-arithmetic.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/triso.ipynb
Symbolic link
1
docs/source/examples/triso.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/triso.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_triso:
|
||||
|
||||
========================
|
||||
Modeling TRISO Particles
|
||||
========================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/triso.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/unstructured-mesh-part-i.ipynb
Symbolic link
1
docs/source/examples/unstructured-mesh-part-i.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/unstructured-mesh-part-i.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_unstructured_mesh_part_i:
|
||||
|
||||
===============================
|
||||
Unstructured Mesh: Introduction
|
||||
===============================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/unstructured-mesh-part-i.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
1
docs/source/examples/unstructured-mesh-part-ii.ipynb
Symbolic link
1
docs/source/examples/unstructured-mesh-part-ii.ipynb
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../examples/jupyter/unstructured-mesh-part-ii.ipynb
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
.. _notebook_unstructured_mesh_part_ii:
|
||||
|
||||
===================================================================================
|
||||
Unstructured Mesh: Unstructured Mesh Tallies with CAD and Point Cloud Visualization
|
||||
===================================================================================
|
||||
|
||||
.. only:: html
|
||||
|
||||
.. notebook:: ../../../examples/jupyter/unstructured-mesh-part-ii.ipynb
|
||||
|
||||
.. only:: latex
|
||||
|
||||
IPython notebooks must be viewed in the online HTML documentation.
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
The file notebook_sphinxext.py was derived from code in PyNE and yt.
|
||||
|
||||
PyNE has the following license:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright 2011-2015, the PyNE Development Team. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are
|
||||
permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
of conditions and the following disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE PYNE DEVELOPMENT TEAM ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those of the
|
||||
authors and should not be interpreted as representing official policies, either expressed
|
||||
or implied, of the stakeholders of the PyNE project or the employers of PyNE developers.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
yt has the following license:
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
yt is licensed under the terms of the Modified BSD License (also known as New
|
||||
or Revised BSD), as follows:
|
||||
|
||||
Copyright (c) 2013-, yt Development Team
|
||||
Copyright (c) 2006-2013, Matthew Turk <matthewturk@gmail.com>
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
|
||||
Neither the name of the yt Development Team nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
import sys
|
||||
import os.path
|
||||
import re
|
||||
import time
|
||||
from docutils import io, nodes, statemachine, utils
|
||||
try:
|
||||
from docutils.utils.error_reporting import ErrorString # the new way
|
||||
except ImportError:
|
||||
from docutils.error_reporting import ErrorString # the old way
|
||||
from docutils.parsers.rst import Directive, convert_directive_function
|
||||
from docutils.parsers.rst import directives, roles, states
|
||||
from docutils.parsers.rst.roles import set_classes
|
||||
from docutils.transforms import misc
|
||||
|
||||
from nbconvert import html
|
||||
|
||||
|
||||
class Notebook(Directive):
|
||||
"""Use nbconvert to insert a notebook into the environment.
|
||||
This is based on the Raw directive in docutils
|
||||
"""
|
||||
required_arguments = 1
|
||||
optional_arguments = 0
|
||||
final_argument_whitespace = True
|
||||
option_spec = {}
|
||||
has_content = False
|
||||
|
||||
def run(self):
|
||||
# check if raw html is supported
|
||||
if not self.state.document.settings.raw_enabled:
|
||||
raise self.warning('"%s" directive disabled.' % self.name)
|
||||
|
||||
# set up encoding
|
||||
attributes = {'format': 'html'}
|
||||
encoding = self.options.get(
|
||||
'encoding', self.state.document.settings.input_encoding)
|
||||
e_handler = self.state.document.settings.input_encoding_error_handler
|
||||
|
||||
# get path to notebook
|
||||
source_dir = os.path.dirname(
|
||||
os.path.abspath(self.state.document.current_source))
|
||||
nb_path = os.path.normpath(os.path.join(source_dir,
|
||||
self.arguments[0]))
|
||||
nb_path = utils.relative_path(None, nb_path)
|
||||
|
||||
# convert notebook to html
|
||||
exporter = html.HTMLExporter(template_file='full')
|
||||
output, resources = exporter.from_filename(nb_path)
|
||||
header = output.split('<head>', 1)[1].split('</head>',1)[0]
|
||||
body = output.split('<body>', 1)[1].split('</body>',1)[0]
|
||||
|
||||
# add HTML5 scoped attribute to header style tags
|
||||
header = header.replace('<style', '<style scoped="scoped"')
|
||||
header = header.replace('body {\n overflow: visible;\n padding: 8px;\n}\n',
|
||||
'')
|
||||
header = header.replace("code,pre{", "code{")
|
||||
|
||||
# Filter out styles that conflict with the sphinx theme.
|
||||
filter_strings = [
|
||||
'navbar',
|
||||
'body{',
|
||||
'alert{',
|
||||
'uneditable-input{',
|
||||
'collapse{',
|
||||
]
|
||||
|
||||
filter_strings.extend(['h%s{' % (i+1) for i in range(6)])
|
||||
|
||||
line_begin = [
|
||||
'pre{',
|
||||
'p{margin'
|
||||
]
|
||||
|
||||
filterfunc = lambda x: not any([s in x for s in filter_strings])
|
||||
header_lines = filter(filterfunc, header.split('\n'))
|
||||
|
||||
filterfunc = lambda x: not any([x.startswith(s) for s in line_begin])
|
||||
header_lines = filter(filterfunc, header_lines)
|
||||
|
||||
header = '\n'.join(header_lines)
|
||||
|
||||
# concatenate raw html lines
|
||||
lines = ['<div class="ipynotebook">']
|
||||
lines.append(header)
|
||||
lines.append(body)
|
||||
lines.append('</div>')
|
||||
text = '\n'.join(lines)
|
||||
|
||||
# add dependency
|
||||
self.state.document.settings.record_dependencies.add(nb_path)
|
||||
attributes['source'] = nb_path
|
||||
|
||||
# create notebook node
|
||||
nb_node = notebook('', text, **attributes)
|
||||
(nb_node.source, nb_node.line) = \
|
||||
self.state_machine.get_source_and_line(self.lineno)
|
||||
|
||||
return [nb_node]
|
||||
|
||||
|
||||
class notebook(nodes.raw):
|
||||
pass
|
||||
|
||||
|
||||
def visit_notebook_node(self, node):
|
||||
self.visit_raw(node)
|
||||
|
||||
|
||||
def depart_notebook_node(self, node):
|
||||
self.depart_raw(node)
|
||||
|
||||
|
||||
def setup(app):
|
||||
app.add_node(notebook,
|
||||
html=(visit_notebook_node, depart_notebook_node))
|
||||
|
||||
app.add_directive('notebook', Notebook)
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Using CAD-Based Geometries\n",
|
||||
"In this notebook we'll be exploring how to use CAD-based geometries in OpenMC via the [DagMC](https://svalinn.github.io/DAGMC/index.html) toolkit. The models we'll be using in this notebook have already been created using [Trelis](https://www.csimsoft.com/trelis) and faceted into a surface mesh represented as `.h5m` files in the [Mesh Oriented DatABase](https://press3.mcs.anl.gov/sigma/moab-library/) format. We'll be retrieving these files using the function below.\n",
|
||||
"\n"
|
||||
]
|
||||
|
|
@ -40,13 +41,6 @@
|
|||
"This notebook is intended to demonstrate how DagMC problems are run in OpenMC. For more information on how DagMC models are created, please refer to the [DagMC User's Guide](https://svalinn.github.io/DAGMC/usersguide/index.html).\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# CAD-Based Geometry in OpenMC using [DagMC](https://svalinn.github.io/DAGMC/)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
|
|
@ -756,7 +750,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.6"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Modeling a CANDU Bundle\n",
|
||||
"In this example, we will create a typical CANDU bundle with rings of fuel pins. At present, OpenMC does not have a specialized lattice for this type of fuel arrangement, so we must resort to manual creation of the array of fuel pins."
|
||||
]
|
||||
},
|
||||
|
|
@ -1107,7 +1108,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.5"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Functional Expansions\n",
|
||||
"OpenMC's general tally system accommodates a wide range of tally *filters*. While most filters are meant to identify regions of phase space that contribute to a tally, there are a special set of functional expansion filters that will multiply the tally by a set of orthogonal functions, e.g. Legendre polynomials, so that continuous functions of space or angle can be reconstructed from the tallied moments.\n",
|
||||
"\n",
|
||||
"In this example, we will determine the spatial dependence of the flux along the $z$ axis by making a Legendre polynomial expansion. Let us represent the flux along the z axis, $\\phi(z)$, by the function\n",
|
||||
|
|
@ -1539,7 +1540,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.4"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Modeling Hexagonal Lattices\n",
|
||||
"In this example, we will create a hexagonal lattice and show how the orientation can be changed via the cell rotation property. Let's first just set up some materials and universes that we will use to fill the lattice."
|
||||
]
|
||||
},
|
||||
|
|
@ -402,7 +403,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.5"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Multigroup (Delayed) Cross Section Generation Part I: Introduction\n",
|
||||
"This IPython Notebook introduces the use of the `openmc.mgxs` module to calculate multi-energy-group and multi-delayed-group cross sections for an infinite homogeneous medium. In particular, this Notebook introduces the the following features:\n",
|
||||
"\n",
|
||||
"* Creation of multi-delayed-group cross sections for an **infinite homogeneous medium**\n",
|
||||
|
|
@ -1486,7 +1487,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.0"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Multigroup (Delayed) Cross Section Generation Part II: Advanced Features\n",
|
||||
"This IPython Notebook illustrates the use of the **`openmc.mgxs.Library`** class. The `Library` class is designed to automate the calculation of multi-group cross sections for use cases with one or more domains, cross section types, and/or nuclides. In particular, this Notebook illustrates the following features:\n",
|
||||
"\n",
|
||||
"* Calculation of multi-energy-group and multi-delayed-group cross sections for a **fuel assembly**\n",
|
||||
|
|
@ -644,7 +645,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Using Tally Arithmetic to Compute the Delayed Neutron Precursor Concentrations"
|
||||
"## Using Tally Arithmetic to Compute the Delayed Neutron Precursor Concentrations"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -1170,7 +1171,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.0"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Multigroup Mode Part I: Introduction\n",
|
||||
"This Notebook illustrates the usage of OpenMC's multi-group calculational mode with the Python API. This example notebook creates and executes the 2-D [C5G7](https://www.oecd-nea.org/science/docs/2003/nsc-doc2003-16.pdf) benchmark model using the `openmc.MGXSLibrary` class to create the supporting data library on the fly."
|
||||
]
|
||||
},
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Generate MGXS Library"
|
||||
"## Generate MGXS Library"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -137,7 +138,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Generate 2-D C5G7 Problem Input Files"
|
||||
"## Generate 2-D C5G7 Problem Input Files"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -622,7 +623,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Results Visualization\n",
|
||||
"## Results Visualization\n",
|
||||
"\n",
|
||||
"Now that we have run the simulation, let's look at the fission rate and flux tallies that we tallied."
|
||||
]
|
||||
|
|
@ -693,7 +694,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.7"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Multigroup Mode Part II: MGXS Library Generation with OpenMC\n",
|
||||
"The previous Notebook in this series used multi-group mode to perform a calculation with previously defined cross sections. However, in many circumstances the multi-group data is not given and one must instead generate the cross sections for the specific application (or at least verify the use of cross sections from another application). \n",
|
||||
"\n",
|
||||
"This Notebook illustrates the use of the openmc.mgxs.Library class specifically for the calculation of MGXS to be used in OpenMC's multi-group mode. This example notebook is therefore very similar to the MGXS Part III notebook, except OpenMC is used as the multi-group solver instead of OpenMOC.\n",
|
||||
|
|
@ -20,7 +21,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Generate Input Files"
|
||||
"## Generate Input Files"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -361,7 +362,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Create an MGXS Library\n",
|
||||
"## Create an MGXS Library\n",
|
||||
"\n",
|
||||
"Now we are ready to generate multi-group cross sections! First, let's define a 2-group structure using the built-in EnergyGroups class."
|
||||
]
|
||||
|
|
@ -680,7 +681,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Tally Data Processing\n",
|
||||
"## Tally Data Processing\n",
|
||||
"\n",
|
||||
"Our simulation ran successfully and created statepoint and summary output files. Let's begin by loading the StatePoint file."
|
||||
]
|
||||
|
|
@ -727,7 +728,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Multi-Group OpenMC Calculation"
|
||||
"## Multi-Group OpenMC Calculation"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -1005,7 +1006,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Results Comparison\n",
|
||||
"## Results Comparison\n",
|
||||
"Now we can compare the multi-group and continuous-energy results.\n",
|
||||
"\n",
|
||||
"We will begin by loading the multi-group statepoint file we just finished writing and extracting the calculated keff."
|
||||
|
|
@ -1092,7 +1093,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Pin Power Visualizations"
|
||||
"## Pin Power Visualizations"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -1208,7 +1209,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Scattering Anisotropy Treatments\n",
|
||||
"## Scattering Anisotropy Treatments\n",
|
||||
"\n",
|
||||
"We will next show how we can work with the scattering angular distributions. OpenMC's MG solver has the capability to use group-to-group angular distributions which are represented as any of the following: a truncated Legendre series of up to the 10th order, a histogram distribution, and a tabular distribution. Any combination of these representations can be used by OpenMC during the transport process, so long as all constituents of a given material use the same representation. This means it is possible to have water represented by a tabular distribution and fuel represented by a Legendre if so desired.\n",
|
||||
"\n",
|
||||
|
|
@ -1224,7 +1225,7 @@
|
|||
"metadata": {},
|
||||
"source": [
|
||||
"\n",
|
||||
"## Global P0 Scattering\n",
|
||||
"### Global P0 Scattering\n",
|
||||
"First we begin by re-running with P0 scattering (i.e., isotropic) everywhere. If a global maximum order is requested, the most effective way to do this is to use the `max_order` attribute of our `openmc.Settings` object."
|
||||
]
|
||||
},
|
||||
|
|
@ -1355,7 +1356,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Mixed Scattering Representations\n",
|
||||
"### Mixed Scattering Representations\n",
|
||||
"OpenMC's Multi-Group mode also includes a feature where not every data in the library is required to have the same scattering treatment. For example, we could represent the water with P3 scattering, and the fuel and cladding with P0 scattering. This series will show how this can be done.\n",
|
||||
"\n",
|
||||
"First we will convert the data to P0 scattering, unless its water, then we will leave that as P3 data."
|
||||
|
|
@ -1531,7 +1532,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.7"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Multigroup Mode Part III: Advanced Feature Showcase\n",
|
||||
"This Notebook illustrates the use of the the more advanced features of OpenMC's multi-group mode and the openmc.mgxs.Library class. During this process, this notebook will illustrate the following features:\n",
|
||||
"\n",
|
||||
" - Calculation of multi-group cross sections for a simplified BWR 8x8 assembly with isotropic and angle-dependent MGXS.\n",
|
||||
|
|
@ -17,7 +18,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Generate Input Files"
|
||||
"## Generate Input Files"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -456,7 +457,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Create an MGXS Library\n",
|
||||
"## Create an MGXS Library\n",
|
||||
"\n",
|
||||
"Now we are ready to generate multi-group cross sections! First, let's define a 2-group structure using the built-in EnergyGroups class."
|
||||
]
|
||||
|
|
@ -817,7 +818,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Tally Data Processing\n",
|
||||
"## Tally Data Processing\n",
|
||||
"\n",
|
||||
"Our simulation ran successfully and created statepoint and summary output files. Let's begin by loading the StatePoint file, but not automatically linking the summary file."
|
||||
]
|
||||
|
|
@ -878,7 +879,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Isotropic Multi-Group OpenMC Calculation"
|
||||
"## Isotropic Multi-Group OpenMC Calculation"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -1100,7 +1101,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Angle-Dependent Multi-Group OpenMC Calculation\n",
|
||||
"## Angle-Dependent Multi-Group OpenMC Calculation\n",
|
||||
"\n",
|
||||
"Let's now run the calculation with the angle-dependent multi-group cross sections. This process will be the exact same as above, except this time we will use the angle-dependent Library as our starting point.\n",
|
||||
"\n",
|
||||
|
|
@ -1200,7 +1201,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Results Comparison\n",
|
||||
"## Results Comparison\n",
|
||||
"In this section we will compare the eigenvalues and fission rate distributions of the continuous-energy, isotropic multi-group and angle-dependent multi-group cases.\n",
|
||||
"\n",
|
||||
"We will begin by loading the multi-group statepoint files, first the isotropic, then angle-dependent. The angle-dependent was not renamed, so we can autolink its summary."
|
||||
|
|
@ -1225,7 +1226,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Eigenvalue Comparison\n",
|
||||
"### Eigenvalue Comparison\n",
|
||||
"Next, we can load the eigenvalues for comparison and do that comparison"
|
||||
]
|
||||
},
|
||||
|
|
@ -1280,7 +1281,7 @@
|
|||
"\n",
|
||||
"It is important to note that both eigenvalues can be improved by the application of finer geometric or energetic discretizations, but this shows that the angle discretization may be a factor for consideration.\n",
|
||||
"\n",
|
||||
"## Fission Rate Distribution Comparison\n",
|
||||
"### Fission Rate Distribution Comparison\n",
|
||||
"Next we will visualize the mesh tally results obtained from our three cases.\n",
|
||||
"\n",
|
||||
"This will be performed by first obtaining the one-group fission rate tally information from our state point files. After we have this information we will re-shape the data to match the original mesh laydown. We will then normalize, and finally create side-by-side plots of all."
|
||||
|
|
@ -1417,7 +1418,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.0"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Multigroup Cross Section Generation Part I: Introduction\n",
|
||||
"This IPython Notebook introduces the use of the `openmc.mgxs` module to calculate multi-group cross sections for an infinite homogeneous medium. In particular, this Notebook introduces the the following features:\n",
|
||||
"\n",
|
||||
"* **General equations** for scalar-flux averaged multi-group cross sections\n",
|
||||
|
|
@ -1130,7 +1131,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.0"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Multigroup Cross Section Generation Part II: Advanced Features\n",
|
||||
"This IPython Notebook illustrates the use of the `openmc.mgxs` module to calculate multi-group cross sections for a heterogeneous fuel pin cell geometry. In particular, this Notebook illustrates the following features:\n",
|
||||
"\n",
|
||||
"* Creation of multi-group cross sections on a **heterogeneous geometry**\n",
|
||||
|
|
@ -2736,7 +2737,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.0"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Multigroup Cross Section Generation Part III: Libraries\n",
|
||||
"This IPython Notebook illustrates the use of the **`openmc.mgxs.Library`** class. The `Library` class is designed to automate the calculation of multi-group cross sections for use cases with one or more domains, cross section types, and/or nuclides. In particular, this Notebook illustrates the following features:\n",
|
||||
"\n",
|
||||
"* Calculation of multi-group cross sections for a **fuel assembly**\n",
|
||||
|
|
@ -1659,7 +1660,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.0"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Nuclear Data: Resonance Covariance\n",
|
||||
"In this notebook we will explore features of the Python API that allow us to import and manipulate resonance covariance data. A full description of the ENDF-VI and ENDF-VII formats can be found in the [ENDF102 manual](https://www.oecd-nea.org/dbdata/data/manual-endf/endf102.pdf)."
|
||||
]
|
||||
},
|
||||
|
|
@ -954,7 +955,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.0"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Nuclear Data\n",
|
||||
"In this notebook, we will go through the salient features of the `openmc.data` package in the Python API. This package enables inspection, analysis, and conversion of nuclear data from ACE files. Most importantly, the package provides a mean to generate HDF5 nuclear data libraries that are used by the transport solver."
|
||||
]
|
||||
},
|
||||
|
|
@ -1495,7 +1496,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.0"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Pandas Dataframes\n",
|
||||
"This notebook demonstrates how systematic analysis of tally scores is possible using Pandas dataframes. A dataframe can be automatically generated using the `Tally.get_pandas_dataframe(...)` method. Furthermore, by linking the tally data in a statepoint file with geometry and material information from a summary file, the dataframe can be shown with user-supplied labels."
|
||||
]
|
||||
},
|
||||
|
|
@ -2687,7 +2688,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.5"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Modeling a Pin-Cell\n",
|
||||
"This notebook is intended to demonstrate the basic features of the Python API for constructing input files and running OpenMC. In it, we will show how to create a basic reflective pin-cell model that is equivalent to modeling an infinite array of fuel pins. If you have never used OpenMC, this can serve as a good starting point to learn the Python API. We highly recommend having a copy of the [Python API reference documentation](https://docs.openmc.org/en/stable/pythonapi/index.html) open in another browser tab that you can refer to."
|
||||
]
|
||||
},
|
||||
|
|
@ -1574,7 +1575,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.5"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Pincell Depletion\n",
|
||||
"This notebook is intended to introduce the reader to the depletion interface contained in OpenMC. It is recommended that you are moderately familiar with building models using the OpenMC Python API. The earlier examples are excellent starting points, as this notebook will not focus heavily on model building.\n",
|
||||
"\n",
|
||||
"If you have a real power reactor, the fuel composition is constantly changing as fission events produce energy, remove some fissile isotopes, and produce fission products. Other reactions, like $(n, \\alpha)$ and $(n, \\gamma)$ will alter the composition as well. Furthermore, some nuclides undergo spontaneous decay with widely ranging frequencies. Depletion is the process of modeling this behavior.\n",
|
||||
|
|
@ -26,7 +27,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Build the Geometry\n",
|
||||
"## Build the Geometry\n",
|
||||
"\n",
|
||||
"Much of this section is borrowed from the \"Modeling a Pin-Cell\" example. If you find yourself not understanding some aspects of this section, feel free to refer to that example, as some details may be glossed over for brevity.\n",
|
||||
"\n",
|
||||
|
|
@ -309,7 +310,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Setting up for depletion\n",
|
||||
"## Setting up for depletion\n",
|
||||
"\n",
|
||||
"The OpenMC depletion interface can be accessed from the `openmc.deplete` module, and has a variety of classes that will help us."
|
||||
]
|
||||
|
|
@ -475,7 +476,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Processing the outputs\n",
|
||||
"## Processing the outputs\n",
|
||||
"\n",
|
||||
"The depletion simulation produces a few output files. First, the statepoint files from each individual transport simulation are written to `openmc_simulation_n<N>.h5`, where `<N>` indicates the current depletion step. Any tallies that we defined in `tallies.xml` will be included in these files across our simulations. We have 7 such files, one for each our of 6 depletion steps and the initial state."
|
||||
]
|
||||
|
|
@ -708,7 +709,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Helpful tips\n",
|
||||
"## Helpful tips\n",
|
||||
"\n",
|
||||
"Depletion is a tricky task to get correct. Use too short of time steps and you may never get your results due to running many transport simulations. Use long of time steps and you may get incorrect answers. Consider the xenon plot from above. Xenon-135 is a fission product with a thermal absorption cross section on the order of millions of barns, but has a half life of ~9 hours. Taking smaller time steps at the beginning of your simulation to build up some equilibrium in your fission products is highly recommended.\n",
|
||||
"\n",
|
||||
|
|
@ -770,7 +771,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Register depletion chain\n",
|
||||
"## Register depletion chain\n",
|
||||
"\n",
|
||||
"The depletion chain we created can be registered into the OpenMC `cross_sections.xml` file, so we don't have to always pass the `chain_file` argument to the `Operator`. To do this, we create a `DataLibrary` using `openmc.data`. Without any arguments, the `from_xml` method will look for the file located at `OPENMC_CROSS_SECTIONS`. For this example, we will just create a bare library."
|
||||
]
|
||||
|
|
@ -911,7 +912,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Choice of depletion step size\n",
|
||||
"## Choice of depletion step size\n",
|
||||
"\n",
|
||||
"A general rule of thumb is to use depletion step sizes around 2 MWd/kgHM, where kgHM is really the initial heavy metal mass in kg. If your problem includes integral burnable absorbers, these typically require shorter time steps at or below 1 MWd/kgHM. These are typically valid for the predictor scheme, as the point of recent schemes is to extend this step size. A good convergence study, where the step size is decreased until some convergence metric is satisfied, is a beneficial exercise.\n",
|
||||
"\n",
|
||||
|
|
@ -988,7 +989,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.4"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Post Processing\n",
|
||||
"This notebook demonstrates some basic post-processing tasks that can be performed with the Python API, such as plotting a 2D mesh tally and plotting neutron source sites from an eigenvalue calculation. The problem we will use is a simple reflected pin-cell."
|
||||
]
|
||||
},
|
||||
|
|
@ -971,7 +972,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.5"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"This Notebook illustrates the usage of the OpenMC Python API's generic eigenvalue search capability. In this Notebook, we will do a critical boron concentration search of a typical PWR pin cell.\n",
|
||||
"# Criticality Search\n",
|
||||
"This notebook illustrates the usage of the OpenMC Python API's generic eigenvalue search capability. In this Notebook, we will do a critical boron concentration search of a typical PWR pin cell.\n",
|
||||
"\n",
|
||||
"To use the search functionality, we must create a function which creates our model according to the input parameter we wish to search for (in this case, the boron concentration). \n",
|
||||
"\n",
|
||||
|
|
@ -31,7 +32,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Create Parametrized Model\n",
|
||||
"## Create Parametrized Model\n",
|
||||
"\n",
|
||||
"To perform the search we will use the `openmc.search_for_keff` function. This function requires a different function be defined which creates an parametrized model to analyze. This model is required to be stored in an `openmc.model.Model` object. The first parameter of this function will be modified during the search process for our critical eigenvalue.\n",
|
||||
"\n",
|
||||
|
|
@ -127,7 +128,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Search for the Critical Boron Concentration\n",
|
||||
"## Search for the Critical Boron Concentration\n",
|
||||
"\n",
|
||||
"To perform the search we imply call the `openmc.search_for_keff` function and pass in the relvant arguments. For our purposes we will be passing in the model building function (`build_model` defined above), a bracketed range for the expected critical Boron concentration (1,000 to 2,500 ppm), the tolerance, and the method we wish to use. \n",
|
||||
"\n",
|
||||
|
|
@ -225,7 +226,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.5"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Tally Arithmetic\n",
|
||||
"This notebook shows the how tallies can be combined (added, subtracted, multiplied, etc.) using the Python API in order to create derived tallies. Since no covariance information is obtained, it is assumed that tallies are completely independent of one another when propagating uncertainties. The target problem is a simple pin cell."
|
||||
]
|
||||
},
|
||||
|
|
@ -1745,7 +1746,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.0"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Modeling TRISO Particles\n",
|
||||
"OpenMC includes a few convenience functions for generationing TRISO particle locations and placing them in a lattice. To be clear, this capability is not a stochastic geometry capability like that included in MCNP. It's also important to note that OpenMC does not use delta tracking, which would normally speed up calculations in geometries with tons of surfaces and cells. However, the computational burden can be eased by placing TRISO particles in a lattice."
|
||||
]
|
||||
},
|
||||
|
|
@ -357,7 +358,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.5"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Unstructured Mesh Tallies in OpenMC\n",
|
||||
"# Unstructured Mesh: Introduction\n",
|
||||
"\n",
|
||||
"In this example we'll look at how to setup and use unstructured mesh tallies in OpenMC. Unstructured meshes are able to provide results over spatial regions of a problem while conforming to a specific geometric features -- something that is often difficult to do using the regular and rectilinear meshes in OpenMC.\n",
|
||||
"\n",
|
||||
|
|
@ -696,7 +696,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.3"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Unstructured Mesh Tallies with CAD Geometry in OpenMC\n",
|
||||
"# Unstructured Mesh: Tallies with CAD and Point Cloud Visualization\n",
|
||||
"\n",
|
||||
"In the first notebook on this topic, we looked at how to set up a tally using an unstructured mesh in OpenMC.\n",
|
||||
"In this notebook, we will explore using unstructured mesh in conjunction with CAD-based geometry to perform detailed geometry analysis on complex geomerty.\n",
|
||||
|
|
@ -647,7 +647,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.3"
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
3
setup.py
3
setup.py
|
|
@ -72,7 +72,8 @@ kwargs = {
|
|||
'extras_require': {
|
||||
'depletion-mpi': ['mpi4py'],
|
||||
'docs': ['sphinx', 'sphinxcontrib-katex', 'sphinx-numfig', 'jupyter',
|
||||
'sphinxcontrib-svg2pdfconverter', 'sphinx-rtd-theme'],
|
||||
'sphinxcontrib-svg2pdfconverter', 'sphinx-rtd-theme',
|
||||
'nbsphinx'],
|
||||
'test': ['pytest', 'pytest-cov', 'colorama'],
|
||||
'vtk': ['vtk'],
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue