mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Merge pull request #2174 from paulromano/prepare-0.13.1
Prepare for version 0.13.1
This commit is contained in:
commit
48fb58a05d
28 changed files with 296 additions and 50 deletions
|
|
@ -51,3 +51,10 @@ Spatial Distributions
|
|||
openmc.stats.SphericalIndependent
|
||||
openmc.stats.Box
|
||||
openmc.stats.Point
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
:nosignatures:
|
||||
:template: myfunction.rst
|
||||
|
||||
openmc.stats.spherical_uniform
|
||||
|
|
|
|||
182
docs/source/releasenotes/0.13.1.rst
Normal file
182
docs/source/releasenotes/0.13.1.rst
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
====================
|
||||
What's New in 0.13.1
|
||||
====================
|
||||
|
||||
.. currentmodule:: openmc
|
||||
|
||||
-------
|
||||
Summary
|
||||
-------
|
||||
|
||||
This release of OpenMC includes many bug fixes as well as improvements in
|
||||
geometry modeling, mesh functionality, source specification, depletion
|
||||
capabilities, and other general enhancements. The depletion module features a
|
||||
new transport operator, :class:`openmc.deplete.IndependentOperator`, that allows
|
||||
a depletion calculation to be performed using arbitrary one-group cross sections
|
||||
(e.g., generated by an external solver) along with a
|
||||
:class:`openmc.deplete.MicroXS` class for managing one-group cross sections. The
|
||||
track file generation capability has been significantly overhauled and a new
|
||||
:class:`openmc.Tracks` class was introduced to allow access to information in
|
||||
track files from the Python API. Support has been added for new ENDF thermal
|
||||
scattering evaluations that use mixed coherent/incoherent elastic scattering.
|
||||
|
||||
------------------------------------
|
||||
Compatibility Notes and Deprecations
|
||||
------------------------------------
|
||||
|
||||
- The ``openmc.deplete.Operator`` class has been renamed
|
||||
:class:`openmc.deplete.CoupledOperator`.
|
||||
- The ``openmc.deplete.ResultsList`` class has been renamed to
|
||||
:class:`openmc.deplete.Results` and no longer requires you to call the
|
||||
``from_hdf5()`` method in order to create it; instead, you can directly
|
||||
instantiate it.
|
||||
- A few methods that represent k-effective have been renamed for the sake of
|
||||
consistency:
|
||||
|
||||
- ``openmc.StatePoint.k_combined`` is now :attr:`openmc.StatePoint.keff`
|
||||
- ``openmc.deplete.ResultsList.get_eigenvalue`` is now
|
||||
:meth:`openmc.deplete.Results.get_keff`
|
||||
|
||||
- The :class:`openmc.stats.SphericalIndependent` class, which used to
|
||||
accept a distribution for ``theta`` now accepts a distribution for ``cos_theta``
|
||||
instead in order to more easily handle the common case of specifying a uniform
|
||||
spatial distribution over a sphere (also see the new
|
||||
:func:`openmc.stats.spherical_uniform` function).
|
||||
|
||||
- If you are building OpenMC from source, note that several of our CMake options
|
||||
have been changed:
|
||||
|
||||
========== ======================
|
||||
Old option New option
|
||||
========== ======================
|
||||
debug ---
|
||||
optimize ---
|
||||
profile OPENMC_ENABLE_PROFILE
|
||||
coverage OPENMC_ENABLE_COVERAGE
|
||||
openmp OPENMC_USE_OPENMP
|
||||
--- OPENMC_USE_MPI
|
||||
dagmc OPENMC_USE_DAGMC
|
||||
libmesh OPENMC_USE_LIBMESH
|
||||
========== ======================
|
||||
|
||||
The ``debug`` and ``optimize`` options have been removed; instead, use the
|
||||
standard `CMAKE_BUILD_TYPE
|
||||
<https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html>`_
|
||||
variable.
|
||||
|
||||
------------
|
||||
New Features
|
||||
------------
|
||||
|
||||
- Two new composite surfaces: :class:`openmc.model.IsogonalOctagon` and
|
||||
:class:`openmc.model.CylinderSector`.
|
||||
- The :class:`~openmc.DAGMCUniverse` class now has a
|
||||
:attr:`~openmc.DAGMCUniverse.bounding_box` attribute and a
|
||||
:meth:`~openmc.DAGMCUniverse.bounding_region` method.
|
||||
- When translating a :class:`~openmc.Region` using the
|
||||
:meth:`~openmc.Region.translate` method, there is now an ``inplace`` argument.
|
||||
- The :class:`~openmc.Material` class has several new methods and attributes:
|
||||
|
||||
- The :meth:`~openmc.Material.add_components` methods allows you to add
|
||||
multiple nuclides/elements to a material with a single call by passing a
|
||||
dictionary.
|
||||
- The :meth:`~openmc.Material.get_activity` method returns the activity of a
|
||||
material in Bq, Bq/g, or Bq/cm³.
|
||||
- The :meth:`~openmc.Material.remove_element` method removes an element from a
|
||||
material
|
||||
- The :meth:`~openmc.Material.get_nuclide_atoms` method gives the number of
|
||||
atoms of each nuclide in a material
|
||||
|
||||
- All mesh classes now have a ``volumes`` property that provides the volume of
|
||||
each mesh element as well as ``write_data_to_vtk`` methods.
|
||||
- Support for externally managed MOAB meshes or libMesh meshes.
|
||||
- Multiple discrete distributions can be merged with the new
|
||||
:meth:`~openmc.stats.Discrete.merge` method.
|
||||
- The :func:`openmc.stats.spherical_uniform` function creates a uniform
|
||||
distribution over a sphere using the
|
||||
:class:`~openmc.stats.SphericalIndependent` class.
|
||||
- Univariate distributions in the :mod:`openmc.stats` module now have
|
||||
``sample()`` methods.
|
||||
- An ``openmc_sample_external_source`` function has been added to the C API with
|
||||
a corresponding Python binding :func:`openmc.lib.sample_external_source`.
|
||||
- The track file generation capability has been completely overhauled. Track
|
||||
files now include much more information, and a new :class:`~openmc.Tracks`
|
||||
class allows access to track file information from the Python API and has a
|
||||
:meth:`~openmc.Tracks.write_to_vtk` method for writing a VTK file. Multiple
|
||||
tracks are now written to a single file (one per MPI rank).
|
||||
- A new :func:`openmc.wwinp_to_wws` function that converts weight windows from a
|
||||
``wwinp`` file to a list of :class:`~openmc.WeightWindows` objects.
|
||||
- The new :meth:`openmc.EnergyFilter.from_group_structure` method provides a
|
||||
way of creating an energy filter with a group structure identified by name.
|
||||
- The :class:`openmc.data.Decay` class now has a
|
||||
:attr:`~openmc.data.Decay.sources` property that provides radioactive decay
|
||||
source distributions.
|
||||
- A :class:`openmc.mgxs.ReducedAbsorptionXS` class produces a multigroup cross
|
||||
section representing "reduced" absorption (absorption less neutron production
|
||||
from (n,xn) reactions).
|
||||
- Added support in the Python API and HDF5 nuclear data format for new ENDF
|
||||
thermal neutron scattering evaluations with mixed coherent elastic and
|
||||
incoherent elastic.
|
||||
- CMake now relies on ``find_package(MPI)`` for a more standard means of
|
||||
identifying an MPI compiler configuration.
|
||||
|
||||
---------
|
||||
Bug Fixes
|
||||
---------
|
||||
|
||||
- `Fix bug when a rotation matrix is passed to Halfspace.rotate <https://github.com/openmc-dev/openmc/pull/1974>`_
|
||||
- `Fix bug for spherical mesh string repr <https://github.com/openmc-dev/openmc/pull/1983>`_
|
||||
- `Fix package_data specification to include pyx files <https://github.com/openmc-dev/openmc/pull/1989>`_
|
||||
- `Allow meshes with same ID to appear in multiple files <https://github.com/openmc-dev/openmc/pull/1990>`_
|
||||
- `Fix overwritten variable in get_libraries_from_xsdata <https://github.com/openmc-dev/openmc/pull/1994>`_
|
||||
- `Write output files to correct directory <https://github.com/openmc-dev/openmc/pull/1998>`_
|
||||
- `Allow CMake to properly find third-party packages <https://github.com/openmc-dev/openmc/pull/2006>`_
|
||||
- `Fix Region.from_expression when ")(" appears in specification <https://github.com/openmc-dev/openmc/pull/2012>`_
|
||||
- `Move lost particle reset from finalize() to reset() <https://github.com/openmc-dev/openmc/pull/2015>`_
|
||||
- `Minor typo fixes in test_lattice.py <https://github.com/openmc-dev/openmc/pull/2024>`_
|
||||
- `Fix color assignment in Universe.plot <https://github.com/openmc-dev/openmc/pull/2034>`_
|
||||
- `Several depletion-related fixes <https://github.com/openmc-dev/openmc/pull/2037>`_
|
||||
- `Allow control of C++ standard used by compiler <https://github.com/openmc-dev/openmc/pull/2040/files>`_
|
||||
- `Fix IO format documentation for surface source read/write <https://github.com/openmc-dev/openmc/pull/2048>`_
|
||||
- `Make sure basis gets set in Plot.from_geometry <https://github.com/openmc-dev/openmc/pull/2050>`_
|
||||
- `Improve robustness of torus distance calculation <https://github.com/openmc-dev/openmc/pull/2053>`_
|
||||
- `Allow use of redundant fission when adjusting KERMA in from_njoy <https://github.com/openmc-dev/openmc/pull/2055>`_
|
||||
- `Disable GNU extensions for CMake target <https://github.com/openmc-dev/openmc/pull/2072>`_
|
||||
- `Two from_xml fixes <https://github.com/openmc-dev/openmc/pull/2074>`_
|
||||
- `Fix for rare infinite loop when finding cell <https://github.com/openmc-dev/openmc/pull/2075>`_
|
||||
- `Allow photon heating to be tallied by nuclide <https://github.com/openmc-dev/openmc/pull/2076>`_
|
||||
- `Use UTF-8 encoding when reading dose coefficients <https://github.com/openmc-dev/openmc/pull/2078>`_
|
||||
- `Fix a corner case in Region.from_expression <https://github.com/openmc-dev/openmc/pull/2081>`_
|
||||
- `Fix bug in spherical and cylindrical meshes <https://github.com/openmc-dev/openmc/pull/2108>`_
|
||||
- `Ensure weight window bounds are flattened when writing to XML <https://github.com/openmc-dev/openmc/pull/2113>`_
|
||||
- `Fix for std::cout sync bug in output.cpp <https://github.com/openmc-dev/openmc/pull/2122>`_
|
||||
- `Allow compiling against fmt v9 <https://github.com/openmc-dev/openmc/pull/2136>`_
|
||||
- `Fix TimeFilter for small time intervals <https://github.com/openmc-dev/openmc/pull/2168>`_
|
||||
|
||||
------------
|
||||
Contributors
|
||||
------------
|
||||
|
||||
- `David Andrs <https://github.com/andrsd>`_
|
||||
- `Hunter Belanger <https://github.com/HunterBelanger>`_
|
||||
- `Helen Brooks <https://github.com/helen-brooks>`_
|
||||
- `Rémi Delaporte-Mathurin <https://github.com/RemDelaporteMathurin>`_
|
||||
- `Joffrey Dorville <https://github.com/JoffreyDorville>`_
|
||||
- `Christopher Fichtlscherer <https://github.com/cfichtlscherer>`_
|
||||
- `Lewis Gross <https://github.com/lewisgross1296>`_
|
||||
- `Andrew Johnson <https://github.com/drewejohnson>`_
|
||||
- `Kalin Kiesling <https://github.com/kkiesling>`_
|
||||
- `Amanda Lund <https://github.com/amandalund>`_
|
||||
- `Richard Morrison <https://github.com/richmorrison>`_
|
||||
- `Patrick Myers <https://github.com/myerspat>`_
|
||||
- `Adam Nelson <https://github.com/nelsonag>`_
|
||||
- `April Novak <https://github.com/aprilnovak>`_
|
||||
- `Ethan Peterson <https://github.com/eepeterson>`_
|
||||
- `Gavin Ridley <https://github.com/gridley>`_
|
||||
- `Paul Romano <https://github.com/paulromano>`_
|
||||
- `Jonathan Shimwell <https://github.com/Shimwell>`_
|
||||
- `Patrick Shriwise <https://github.com/pshriwise>`_
|
||||
- `Amelia Trainer <https://github.com/ameliojo>`_
|
||||
- `John Tramm <https://github.com/jtramm>`_
|
||||
- `Bob Urberger <https://github.com/burberger>`_
|
||||
- `Olek Yardas <https://github.com/yardasol>`_
|
||||
|
|
@ -7,6 +7,7 @@ Release Notes
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
0.13.1
|
||||
0.13.0
|
||||
0.12.2
|
||||
0.12.1
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ are requested.
|
|||
|
||||
The depletion module is designed such that the reaction rate solution (the
|
||||
transport "operator") is completely isolated from the solution of the
|
||||
transmutation equations and the method used for advancing time.
|
||||
transmutation equations and the method used for advancing time.
|
||||
|
||||
:mod:`openmc.deplete` supports multiple time-integration methods for determining
|
||||
material compositions over time. Each method appears as a different class.
|
||||
|
|
@ -40,7 +40,7 @@ time::
|
|||
Note that the coupling between the reaction rate solver and the transmutation
|
||||
solver happens in-memory rather than by reading/writing files on disk. OpenMC
|
||||
has two categories of transport operators for obtaining transmutation reaction
|
||||
rates.
|
||||
rates.
|
||||
|
||||
.. _coupled-depletion:
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ Any material that contains a fissionable nuclide is depleted by default, but
|
|||
this can behavior can be changed with the :attr:`Material.depletable` attribute.
|
||||
|
||||
.. important::
|
||||
|
||||
|
||||
The volume must be specified for each material that is depleted by setting
|
||||
the :attr:`Material.volume` attribute. This is necessary in order to
|
||||
calculate the proper normalization of tally results based on the source rate.
|
||||
|
|
@ -198,8 +198,8 @@ Transport-independent depletion
|
|||
===============================
|
||||
|
||||
.. warning::
|
||||
|
||||
This feature is still under heavy development and has yet to be rigorously
|
||||
|
||||
This feature is still under heavy development and has yet to be rigorously
|
||||
verified. API changes and feature additions are possible and likely in
|
||||
the near future.
|
||||
|
||||
|
|
@ -237,7 +237,7 @@ object::
|
|||
'U236': 4.57e18,
|
||||
'O16': 4.64e22,
|
||||
'O17': 1.76e19}
|
||||
volume = 0.5
|
||||
volume = 0.5
|
||||
op = openmc.deplete.IndependentOperator.from_nuclides(volume,
|
||||
nuclides,
|
||||
micro_xs,
|
||||
|
|
@ -250,8 +250,8 @@ transport-depletion calculation and follow the same steps from there.
|
|||
.. note::
|
||||
|
||||
Ideally, one-group cross section data should be available for every
|
||||
reaction in the depletion chain. If a nuclide that has a reaction
|
||||
associated with it in the depletion chain is present in the `nuclides`
|
||||
reaction in the depletion chain. If a nuclide that has a reaction
|
||||
associated with it in the depletion chain is present in the `nuclides`
|
||||
parameter but not the cross section data, that reaction will not be
|
||||
simulated.
|
||||
|
||||
|
|
@ -289,7 +289,7 @@ or from data arrays::
|
|||
.. important::
|
||||
|
||||
Both :meth:`~openmc.deplete.MicroXS.from_csv()` and
|
||||
:meth:`~openmc.deplete.MicroXS.from_array()` assume the cross section values
|
||||
:meth:`~openmc.deplete.MicroXS.from_array()` assume the cross section values
|
||||
provided are in barns by defualt, but have no way of verifying this. Make
|
||||
sure your cross sections are in the correct units before passing to a
|
||||
:class:`~openmc.deplete.IndependentOperator` object.
|
||||
|
|
@ -315,26 +315,28 @@ normalizing reaction rates:
|
|||
the cross-sections by the ``source-rate``.
|
||||
2. ``fission-q`` normalization, which uses the ``power`` or ``power_density``
|
||||
provided by the time integrator to obtain reaction rates by computing a value
|
||||
for the flux based on this power. The general equation for the flux is
|
||||
for the flux based on this power. The general equation for the flux is
|
||||
|
||||
.. math::
|
||||
|
||||
\phi = \frac{P}{V \cdot \sum_i (Q_i \cdot \sigma^f_i \cdot \n_i)}
|
||||
\phi = \frac{P}{\sum\limits_i (Q_i \sigma^f_i N_i)}
|
||||
|
||||
where :math:`\sum_i` is the sum over all nuclides :math:`i`. This equation
|
||||
makes the same assumptions and issues as discussed in
|
||||
:ref:`energy-deposition`. Unfortunately, the proposed solution in that
|
||||
where :math:`P` is the power, :math:`Q_i` is the fission Q value for nuclide
|
||||
:math:`i`, :math:`\sigma_i^f` is the microscopic fission cross section for
|
||||
nuclide :math:`i`, and :math:`N_i` is the number of atoms of nuclide
|
||||
:math:`i`. This equation makes the same assumptions and issues as discussed
|
||||
in :ref:`energy-deposition`. Unfortunately, the proposed solution in that
|
||||
section does not apply here since we are decoupled from transport code.
|
||||
However, there is a method to converge to a more accurate value for flux by
|
||||
using substeps during time integration.
|
||||
`This paper <https://doi.org/10.1016/j.anucene.2016.05.031>`_ provides a
|
||||
good discussion of this method.
|
||||
using substeps during time integration. `This paper
|
||||
<https://doi.org/10.1016/j.anucene.2016.05.031>`_ provides a good discussion
|
||||
of this method.
|
||||
|
||||
.. warning::
|
||||
|
||||
The accuracy of results when using ``fission-q`` is entirely dependent on
|
||||
your depletion chain. Make sure it has sufficient data to resolve the
|
||||
dynamics of your particular scenario.
|
||||
dynamics of your particular scenario.
|
||||
|
||||
Multiple Materials
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ model = openmc.Model(geometry=geometry, settings=settings)
|
|||
|
||||
# Create depletion "operator"
|
||||
chain_file = 'chain_simple.xml'
|
||||
op = openmc.deplete.Operator(model, chain_file, previous_results)
|
||||
op = openmc.deplete.CoupledOperator(model, chain_file, previous_results)
|
||||
|
||||
# Perform simulation using the predictor algorithm
|
||||
time_steps = [1.0, 1.0, 1.0, 1.0, 1.0] # days
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ model = openmc.Model(geometry=geometry, settings=settings)
|
|||
|
||||
# Create depletion "operator"
|
||||
chain_file = 'chain_simple.xml'
|
||||
op = openmc.deplete.Operator(model, chain_file)
|
||||
op = openmc.deplete.CoupledOperator(model, chain_file)
|
||||
|
||||
# Perform simulation using the predictor algorithm
|
||||
time_steps = [1.0, 1.0, 1.0, 1.0, 1.0] # days
|
||||
|
|
|
|||
|
|
@ -178,6 +178,8 @@ def kalbach_slope(energy_projectile, energy_emitted, za_projectile,
|
|||
energies are not calculated with the AWR number, but approximated with
|
||||
the number of mass instead.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
energy_projectile : float
|
||||
|
|
@ -593,6 +595,9 @@ class KalbachMann(AngleEnergy):
|
|||
If the projectile is a neutron, the slope is calculated when it is
|
||||
not given explicitly.
|
||||
|
||||
.. versionchanged:: 0.13.1
|
||||
Arguments changed to accommodate slope calculation
|
||||
|
||||
Parameters
|
||||
----------
|
||||
file_obj : file-like object
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ def _find_cross_sections(model):
|
|||
)
|
||||
return cross_sections
|
||||
|
||||
|
||||
def _get_nuclides_with_data(cross_sections):
|
||||
"""Loads cross_sections.xml file to find nuclides with neutron data
|
||||
|
||||
|
|
@ -81,6 +82,7 @@ def _get_nuclides_with_data(cross_sections):
|
|||
|
||||
return nuclides
|
||||
|
||||
|
||||
class CoupledOperator(OpenMCOperator):
|
||||
"""Transport-coupled transport operator.
|
||||
|
||||
|
|
@ -93,6 +95,9 @@ class CoupledOperator(OpenMCOperator):
|
|||
The geometry and settings parameters have been replaced with a
|
||||
model parameter that takes a :class:`~openmc.model.Model` object
|
||||
|
||||
.. versionchanged:: 0.13.1
|
||||
Name changed from ``Operator`` to ``CoupledOperator``
|
||||
|
||||
Parameters
|
||||
----------
|
||||
model : openmc.model.Model
|
||||
|
|
@ -534,6 +539,7 @@ class CoupledOperator(OpenMCOperator):
|
|||
if self.cleanup_when_done:
|
||||
openmc.lib.finalize()
|
||||
|
||||
|
||||
# Retain deprecated name for the time being
|
||||
def Operator(*args, **kwargs):
|
||||
# warn of name change
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ transport solver by using user-provided one-group cross sections.
|
|||
"""
|
||||
|
||||
import copy
|
||||
from collections import OrderedDict
|
||||
from warnings import warn
|
||||
from itertools import product
|
||||
|
||||
import numpy as np
|
||||
|
|
@ -22,6 +20,7 @@ from .microxs import MicroXS
|
|||
from .results import Results
|
||||
from .helpers import ChainFissionHelper, ConstantFissionYieldHelper, SourceRateHelper
|
||||
|
||||
|
||||
class IndependentOperator(OpenMCOperator):
|
||||
"""Transport-independent transport operator that uses one-group cross
|
||||
sections to calculate reaction rates.
|
||||
|
|
@ -32,6 +31,8 @@ class IndependentOperator(OpenMCOperator):
|
|||
passed to an integrator class, such as
|
||||
:class:`openmc.deplete.CECMIntegrator`.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
materials : openmc.Materials
|
||||
|
|
@ -271,15 +272,15 @@ class IndependentOperator(OpenMCOperator):
|
|||
|
||||
This class does not generate tallies, and instead stores cross sections
|
||||
for each nuclide and transmutation reaction relevant for a depletion
|
||||
calculation. The reaction rate is calculated by multiplying the flux by the
|
||||
cross sections.
|
||||
calculation. The reaction rate is calculated by multiplying the flux by
|
||||
the cross sections.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
op : openmc.deplete.IndependentOperator
|
||||
Reference to the object encapsulate _IndependentRateHelper.
|
||||
We pass this so we don't have to duplicate the :attr:`IndependentOperator.number` object.
|
||||
|
||||
We pass this so we don't have to duplicate the
|
||||
:attr:`IndependentOperator.number` object.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
|
|
@ -316,15 +317,14 @@ class IndependentOperator(OpenMCOperator):
|
|||
"""
|
||||
self._results_cache.fill(0.0)
|
||||
|
||||
volume = self._op.number.get_mat_volume(mat_id)
|
||||
for i_nuc, i_react in product(nuc_index, react_index):
|
||||
nuc = self.nuc_ind_map[i_nuc]
|
||||
rxn = self.rxn_ind_map[i_react]
|
||||
density = self._op.number.get_atom_density(mat_id, nuc)
|
||||
|
||||
# Sigma^j_i * V = sigma^j_i * rho * V
|
||||
# Sigma^j_i * V = sigma^j_i * n_i * V = sigma^j_i * N_i
|
||||
self._results_cache[i_nuc,i_react] = \
|
||||
self._op.cross_sections[rxn][nuc] * density * volume
|
||||
self._op.cross_sections[rxn][nuc] * \
|
||||
self._op.number[mat_id, nuc]
|
||||
|
||||
return self._results_cache
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,10 @@ _valid_rxns.append('fission')
|
|||
|
||||
|
||||
class MicroXS(DataFrame):
|
||||
"""Stores microscopic cross section data for use in
|
||||
transport-independent depletion.
|
||||
"""Microscopic cross section data for use in transport-independent depletion.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
|
|
@ -59,7 +61,7 @@ class MicroXS(DataFrame):
|
|||
energy_bound : 2-tuple of float, optional
|
||||
Bounds for the energy group.
|
||||
run_kwargs : dict, optional
|
||||
Keyword arguments for :meth:`openmc.model.Model.run()`
|
||||
Keyword arguments passed to :meth:`openmc.model.Model.run`
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ class Results(list):
|
|||
each depletion step and provides extra methods for interrogating these
|
||||
results.
|
||||
|
||||
.. versionchanged:: 0.13.1
|
||||
Name changed from ``ResultsList`` to ``Results``
|
||||
|
||||
Parameters
|
||||
----------
|
||||
filename : str
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ __all__ = ["StepResult"]
|
|||
class StepResult:
|
||||
"""Result of a single depletion timestep
|
||||
|
||||
.. versionchanged:: 0.13.1
|
||||
Name changed from ``Results`` to ``StepResult``
|
||||
|
||||
Attributes
|
||||
----------
|
||||
k : list of (float, float)
|
||||
|
|
|
|||
|
|
@ -1340,6 +1340,8 @@ class EnergyFilter(RealFilter):
|
|||
def from_group_structure(cls, group_structure):
|
||||
"""Construct an EnergyFilter instance from a standard group structure.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
group_structure : str
|
||||
|
|
|
|||
|
|
@ -463,6 +463,8 @@ class Material(IDManagerMixin):
|
|||
def remove_element(self, element):
|
||||
"""Remove an element from the material
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
element : str
|
||||
|
|
@ -918,7 +920,7 @@ class Material(IDManagerMixin):
|
|||
Returns
|
||||
-------
|
||||
Union[dict, float]
|
||||
If by_nuclide is True then a dictionary whose keys are nuclide
|
||||
If by_nuclide is True then a dictionary whose keys are nuclide
|
||||
names and values are activity is returned. Otherwise the activity
|
||||
of the material is returned as a float.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -3107,6 +3107,8 @@ class ReducedAbsorptionXS(MGXS):
|
|||
3\sigma_{n,4n}(r,E) \right) \psi (r, E, \Omega)}{\int_{r \in V} dr
|
||||
\int_{4\pi} d\Omega \int_{E_g}^{E_{g-1}} dE \; \psi (r, E, \Omega)}.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, domain=None, domain_type=None, energy_groups=None,
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ class Model:
|
|||
Indicate whether or not a transport solve should be run at the end
|
||||
of the last timestep. Defaults to running this transport solve.
|
||||
operator_kwargs : dict
|
||||
Keyword arguments passed to the depletion Operator initializer
|
||||
Keyword arguments passed to the depletion operator initializer
|
||||
(e.g., :func:`openmc.deplete.Operator`)
|
||||
directory : str, optional
|
||||
Directory to write XML files to. If it doesn't exist already, it
|
||||
|
|
@ -360,8 +360,8 @@ class Model:
|
|||
|
||||
with _change_directory(Path(directory)):
|
||||
with openmc.lib.quiet_dll(output):
|
||||
depletion_operator = \
|
||||
dep.Operator(self, **op_kwargs)
|
||||
# TODO: Support use of IndependentOperator too
|
||||
depletion_operator = dep.CoupledOperator(self, **op_kwargs)
|
||||
|
||||
# Tell depletion_operator.finalize NOT to clear C API memory when
|
||||
# it is done
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ class CylinderSector(CompositeSurface):
|
|||
operators applied to it will produce a half-space. The negative
|
||||
side is defined to be the region inside of the cylinder sector.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
r1 : float
|
||||
|
|
@ -225,6 +227,8 @@ class IsogonalOctagon(CompositeSurface):
|
|||
operators applied to it will produce a half-space. The negative side is
|
||||
defined to be the region inside of the octogonal prism.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
center : iterable of float
|
||||
|
|
|
|||
|
|
@ -269,6 +269,8 @@ class Region(ABC):
|
|||
inplace : bool
|
||||
Whether or not to return a region based on new surfaces or one based
|
||||
on the original surfaces that have been modified.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
memo : dict or None
|
||||
Dictionary used for memoization. This parameter is used internally
|
||||
and should not be specified by the user.
|
||||
|
|
|
|||
|
|
@ -377,7 +377,10 @@ class SphericalIndependent(Spatial):
|
|||
:math:`\theta`, and :math:`\phi` components are sampled independently
|
||||
from one another and centered on the coordinates (x0, y0, z0).
|
||||
|
||||
.. versionadded: 0.12
|
||||
.. versionadded:: 0.12
|
||||
|
||||
.. versionchanged:: 0.13.1
|
||||
Accepts ``cos_theta`` instead of ``theta``
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
|
@ -787,7 +790,7 @@ def spherical_uniform(r_outer, r_inner=0.0, thetas=(0., pi), phis=(0., 2*pi),
|
|||
shell between `r_inner` and `r_outer`. Optionally, the range of angles
|
||||
can be restricted by the `thetas` and `phis` arguments.
|
||||
|
||||
.. versionadded: 0.13.1
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
|
|
|||
|
|
@ -205,6 +205,8 @@ class Discrete(Univariate):
|
|||
def merge(cls, dists, probs):
|
||||
"""Merge multiple discrete distributions into a single distribution
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
dists : iterable of openmc.stats.Discrete
|
||||
|
|
@ -1057,7 +1059,7 @@ class Tabular(Univariate):
|
|||
def integral(self):
|
||||
"""Return integral of distribution
|
||||
|
||||
.. versionadded: 0.13.1
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ _VERSION_SUMMARY = 6
|
|||
class Summary:
|
||||
"""Summary of model used in a simulation.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
filename : str or path-like
|
||||
Path to file to load
|
||||
|
||||
Attributes
|
||||
----------
|
||||
date_and_time : str
|
||||
|
|
@ -33,8 +38,9 @@ class Summary:
|
|||
"""
|
||||
|
||||
def __init__(self, filename):
|
||||
filename = str(filename)
|
||||
if not filename.endswith(('.h5', '.hdf5')):
|
||||
msg = 'Unable to open "{0}" which is not an HDF5 summary file'
|
||||
msg = f'Unable to open "{filename}" which is not an HDF5 summary file'
|
||||
raise ValueError(msg)
|
||||
|
||||
self._f = h5py.File(filename, 'r')
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ class Track(Sequence):
|
|||
primary/secondary particle is stored in the :attr:`particle_tracks`
|
||||
attribute.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
dset : h5py.Dataset
|
||||
|
|
@ -201,6 +203,8 @@ class Tracks(list):
|
|||
This class behaves like a list and can be indexed using the normal subscript
|
||||
notation. Each element in the list is a :class:`openmc.Track` object.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
filepath : str or pathlib.Path
|
||||
|
|
@ -267,7 +271,7 @@ class Tracks(list):
|
|||
track.plot(ax)
|
||||
return ax
|
||||
|
||||
def write_tracks_to_vtk(self, filename=Path('tracks.vtp')):
|
||||
def write_to_vtk(self, filename=Path('tracks.vtp')):
|
||||
"""Creates a VTP file of the tracks
|
||||
|
||||
Parameters
|
||||
|
|
@ -286,7 +290,7 @@ class Tracks(list):
|
|||
# Initialize data arrays and offset.
|
||||
points = vtk.vtkPoints()
|
||||
cells = vtk.vtkCellArray()
|
||||
|
||||
|
||||
point_offset = 0
|
||||
for particle in self:
|
||||
for pt in particle.particle_tracks:
|
||||
|
|
|
|||
|
|
@ -644,6 +644,8 @@ class DAGMCUniverse(UniverseBase):
|
|||
bounding_box : 2-tuple of numpy.array
|
||||
Lower-left and upper-right coordinates of an axis-aligned bounding box
|
||||
of the universe.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
|
|
@ -726,6 +728,9 @@ class DAGMCUniverse(UniverseBase):
|
|||
def bounding_region(self, bounded_type='box', boundary_type='vacuum', starting_id=10000):
|
||||
"""Creates a either a spherical or box shaped bounding region around
|
||||
the DAGMC geometry.
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
bounded_type : str
|
||||
|
|
@ -740,6 +745,7 @@ class DAGMCUniverse(UniverseBase):
|
|||
Starting ID of the surface(s) used in the region. For bounded_type
|
||||
'box', the next 5 IDs will also be used. Defaults to 10000 to reduce
|
||||
the chance of an overlap of surface IDs with the DAGMC geometry.
|
||||
|
||||
Returns
|
||||
-------
|
||||
openmc.Region
|
||||
|
|
|
|||
|
|
@ -409,7 +409,9 @@ class WeightWindows(IDManagerMixin):
|
|||
|
||||
|
||||
def wwinp_to_wws(path):
|
||||
"""Creates WeightWindows classes from a wwinp file
|
||||
"""Create WeightWindows instances from a wwinp file
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ def main():
|
|||
|
||||
# Write coordinate values to points array.
|
||||
track_file = openmc.Tracks(args.input)
|
||||
track_file.write_tracks_to_vtk(args.out)
|
||||
track_file.write_to_vtk(args.out)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ def test_full(run_in_tmpdir, problem, multiproc):
|
|||
|
||||
# Create operator
|
||||
chain_file = Path(__file__).parents[2] / 'chain_simple.xml'
|
||||
op = openmc.deplete.Operator(model, chain_file)
|
||||
op = openmc.deplete.CoupledOperator(model, chain_file)
|
||||
op.round_number = True
|
||||
|
||||
# Power and timesteps
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ def test_activation(run_in_tmpdir, model, reaction_rate_mode, reaction_rate_opts
|
|||
chain.export_to_xml('test_chain.xml')
|
||||
|
||||
# Create transport operator
|
||||
op = openmc.deplete.Operator(
|
||||
op = openmc.deplete.CoupledOperator(
|
||||
model, 'test_chain.xml',
|
||||
normalization_mode="source-rate",
|
||||
reaction_rate_mode=reaction_rate_mode,
|
||||
|
|
@ -144,7 +144,7 @@ def test_decay(run_in_tmpdir):
|
|||
|
||||
model = openmc.Model(geometry=geometry, settings=settings)
|
||||
# Create transport operator
|
||||
op = openmc.deplete.Operator(
|
||||
op = openmc.deplete.CoupledOperator(
|
||||
model, 'test_chain.xml', normalization_mode="source-rate"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ def test_filter(sphere_model, run_in_tmpdir):
|
|||
assert matches == []
|
||||
|
||||
|
||||
def test_write_tracks_to_vtk(sphere_model):
|
||||
def test_write_to_vtk(sphere_model):
|
||||
vtk = pytest.importorskip('vtk')
|
||||
# Set maximum number of tracks per process to write
|
||||
sphere_model.settings.max_tracks = 25
|
||||
|
|
@ -153,7 +153,7 @@ def test_write_tracks_to_vtk(sphere_model):
|
|||
generate_track_file(sphere_model, tracks=True)
|
||||
|
||||
tracks = openmc.Tracks('tracks.h5')
|
||||
polydata = tracks.write_tracks_to_vtk('tracks.vtp')
|
||||
polydata = tracks.write_to_vtk('tracks.vtp')
|
||||
|
||||
assert isinstance(polydata, vtk.vtkPolyData)
|
||||
assert Path('tracks.vtp').is_file()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue