OpenMC Monte Carlo Code
This release of OpenMC includes many bug fixes, performance improvements, and several notable new features. Some of the highlights include projection plots, pulse height tallies for photons, weight window generation, and an ability to specify continuous removal or feed of nuclides/elements during depletion. Additionally, one of the longstanding annoyances of depletion calculations, namely the need to include initial "dilute" nuclides, has been eliminated. There are also a wide array of general improvements in the Python API.
openmc.deplete.MicroXS
class has been completely redesigned and improved. See further comments below under "New Features". (#2572, #2579, #2595, #2700)rectangular_prism
function has been replaced by the openmc.model.RectangularPrism
class and the hexagonal_prism
function has been replaced by the openmc.model.HexagonalPrism
class. Note that whereas the rectangular_prism
and hexagonal_prism
functions returned a region representing the interior of the prism, the new openmc.model.RectangularPrism
and
openmc.model.HexagonalPrism
classes return composite surfaces, so you need to use the unary -
or +
operators to obtain a region that can be assigned to a cell. (#2739)Source
class has been refactored and split up into three separate classes: openmc.IndependentSource
, openmc.FileSource
, and openmc.CompiledSource
. (#2524)vertices
and centroids
attributes on mesh classes now always return Cartesian coordinates and the shape of the returned arrays has changed to allow ijk
indexing using a tuple (i.e., xyz = vertices[i, j, k]
). (#2711)openmc.Material.decay_photon_energy
attribute has been replaced by the openmc.Material.get_decay_photon_energy
method. (#2715)openmc.ProjectionPlot
class enables the generation of orthographic or perspective projection plots. (#1926)openmc.model.RightCircularCylinder
class now supports optional filleted edges. (#2309)openmc.deplete.abc.Integrator.add_transfer_rate
method. (#2358, #2564, #2626)openmc.model.CruciformPrism
class has been added that provides a generalized cruciform prism composite surface. (#2457)openmc.Plot.to_vtk
method. (#2464)openmc.mgxs.EnergyGroups
class now allows you to alternatively pass a string of the group structure name (e.g., "CCFE-709") instead of the energy group boundaries. (#2466)openmc.Universe.plot
method (addition of axis labels with units, ability to show legend and/or outlines, automatic determination of origin/width, ability to pass total number of pixels). (#2472 , #2482, #2483, #2492, #2513, #2575)openmc.BoundingBox
class. (#2475)openmc.plot_xs
function. (#2478)openmc
Python module has been improved by deferring the import of matplotlib. (#2488)bounding_box
property. (#2507, #2620, #2621)Source
class has been refactored and split up into three separate classes: openmc.IndependentSource
, openmc.FileSource
, and openmc.CompiledSource
. (#2524)openmc.Tally
class now has a openmc.Tally.multiply_density
attribute that indicates whether reaction rate tallies should include the number density of the nuclide of interest. (#2539)openmc.wwinp_to_wws
function now supports wwinp
files with cylindrical or spherical meshes. (#2556)openmc.deplete.Results
class now has openmc.deplete.Results.get_mass
(#2565), openmc.deplete.Results.get_activity
(#2617), and openmc.deplete.Results.get_decay_heat
(#2625) methods.openmc.deplete.StepResult.save
method now supports a path
argument. (#2567)openmc.deplete.MicroXS
has been completely redesigned and improved. First, it no longer relies on the openmc.mgxs
module, no longer subclasses pandas.DataFrame
, and doesn't require adding initial "dilute" nuclides into material compositions. It now enables users to specify an energy group structure to collect multigroup cross sections, specify nuclides/reactions, and works with mesh domains in addition to the existing domains. A new openmc.deplete.get_microxs_and_flux
function was added that improves the workflow for calculating microscopic cross sections along with fluxes. Altogether, these changes make it straightforward to switch between coupled and independent operators for depletion/activation calculations. (#2572, #2579 , #2595, #2700)openmc.Geometry
class now has merge_surfaces
and surface_precision
arguments. (#2602)openmc.CylindricalMesh
and openmc.SphericalMesh
classes can now be fully formed using the constructor. (#2619)openmc.Settings.cutoff
attribute. (#2631)openmc.Material.add_element
method now supports a cross_sections
argument that allows a cross section data source to be specified. (#2633 )openmc.Cell
class now has a plot
method. (#2648)openmc.Geometry
class now has a plot
method. (#2661)openmc.Settings.weight_window_checkpoints
attribute. (#2670)openmc.Settings
class now has a max_write_lost_particles
attribute that can limit the number of lost particle files written. (#2688)openmc.deplete.CoupledOperator
class now has a diff_volume_method
argument that specifies how the volume of new materials should be determined. (#2691)openmc.DAGMCUniverse.bounding_region
method now has a padding_distance
argument. (#2701)openmc.Material.get_decay_photon_energy
method replaces the decay_photon_energy
attribute and includes an ability to eliminate low-importance points. This is facilitated by a new openmc.stats.Discrete.clip
method. (#2715)openmc.model.Model.differentiate_depletable_mats
method allows depletable materials to be differentiated independent of the depletion calculation itself. (#2718)This release of OpenMC includes many bug fixes, performance improvements, and several notable new features. Some of the highlights include support for MCPL source files, NCrystal thermal scattering materials, and a new openmc.stats.MeshSpatial
class that allows a source distribution to be specified over a mesh. Additionally, OpenMC now allows you to export your model as a single XML file rather than separate XML files for geometry, materials, settings, and tallies.
openmc.data.atomic_mass
has been updated to AME 2020, which results in slightly different masses.openmc.CylindricalMesh
and openmc.SphericalMesh
classes now have an origin
attribute that changes the center of the mesh. (#2256)openmc.model.Polygon
class allows defining generalized 2D polygons. (#2266)openmc.data.decay_energy
function and openmc.Material.get_decay_heat
method enable determination of decay heat from a single nuclide or material. (#2287)openmc.stats.MeshSpatial
allows a spatial source distribution to be specified with source strengths for each mesh element. (#2334)openmc.Geometry.get_surfaces_by_name
method returns a list of matching surfaces in a geometry. (#2347)openmc.Settings.create_delayed_neutrons
attribute controls whether delayed neutrons are created during a simulation. (#2348)openmc.deplete.Results.export_to_materials
method now takes a path
argument. (#2364)openmc.EnergyFilter.get_tabular
method allows one to create a tabular distribution based on tally results using an energy filter. (#2371)openmc.Material
class that require a volume to be set (e.g., openmc.Material.get_mass
) now accept a volume
argument. (#2412)This release of OpenMC includes several bug fixes, performance improvements for complex geometries and depletion simulations, and other general enhancements. Notably, a capability has been added to compute the photon spectra from decay of unstable nuclides. Alongside that, a new openmc.config
configuration variable has been introduced that allows easier configuration of data sources. Additionally, users can now perform cell or material rejection when sampling external source distributions.
openmc.stats.Muir
class has been replaced by a openmc.stats.muir
function that returns an instance of openmc.stats.Normal
.openmc.Material.get_nuclide_atom_densities
method now takes an optional nuclide
argument.openmc.deplete
module now accept times in Julian years ('a'
).openmc.Universe.plot
method now allows a pre-existing axes object to be passed in.openmc.RegularMesh
class now has a from_domain
classmethod.openmc.CylindricalMesh
class now has a from_domain
classmethod.openmc.mgxs
module.openmc.config
configuration variable has been introduced that allows data sources to be specified at runtime or via environment variables.openmc.EnergyFunctionFilter
class now supports multiple interpolation schemes, not just linear-linear interpolation.openmc.DAGMCUniverse
class now has material_names
, n_cells
, and n_surfaces
attributes.openmc.data.decay_photon_energy
function has been added that returns the energy spectrum of photons emitted from the decay of an unstable nuclide.openmc.Material
class also has a new decay_photon_energy
attribute that gives the decay photon energy spectrum from the material based on its constituent nuclides.openmc.deplete.StepResult
now has a get_material
method.openmc.Source
class now takes a domains
argument that specifies a list of cells, materials, or universes that is used to reject source sites (i.e., if the sampled sites are not within the specified domain, they are rejected).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, 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 openmc.deplete.MicroXS
class for managing one-group cross sections. The track file generation capability has been significantly overhauled and a new 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.
The openmc.deplete.Operator
class has been renamed openmc.deplete.CoupledOperator
.
The openmc.deplete.ResultsList
class has been renamed to 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 openmc.StatePoint.keff
openmc.deplete.ResultsList.get_eigenvalue
is now openmc.deplete.Results.get_keff
The 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 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 variable.
Two new composite surfaces: openmc.model.IsogonalOctagon
and openmc.model.CylinderSector
.
The DAGMCUniverse
class now has a bounding_box
attribute and a bounding_region
method.
When translating a Region
using the translate
method, there is now an inplace
argument.
The Material
class has several new methods and attributes:
add_components
methods allows you to add multiple nuclides/elements to a material with a single call by passing a dictionary.get_activity
method returns the activity of a material in Bq, Bq/g, or Bq/cm³.remove_element
method removes an element from a materialget_nuclide_atoms
method gives the number of atoms of each nuclide in a materialAll 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 openmc.stats.Discrete.merge
method.
The openmc.stats.spherical_uniform
function creates a uniform distribution over a sphere using the SphericalIndependent
class.
Univariate distributions in the 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 openmc.lib.sample_external_source
.
The track file generation capability has been completely overhauled. Track files now include much more information, and a new openmc.Tracks
class allows access to track file information from the Python API and has a write_to_vtk
method for writing a VTK file. Multiple tracks are now written to a single file (one per MPI rank).
A new openmc.wwinp_to_wws
function that converts weight windows from a wwinp
file to a list of WeightWindows
objects.
The new openmc.EnergyFilter.from_group_structure
method provides a way of creating an energy filter with a group structure identified by name.
The openmc.data.Decay
class now has a sources
property that provides radioactive decay source distributions.
A 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.
This release of OpenMC includes several noteworthy and unique features. Most importantly, mesh-based weight windows have been added and work with all supported mesh types (regular, rectilinear, cylindrical, spherical, and unstructured). Other additions include torus surfaces, an ability to place CAD-based geometries in universes, a feature to export/import physical properties, and a filter for particle time.
There is one breaking changing in the Python API. The openmc.deplete.Operator
class used to accept Geometry
and Settings
objects as its first two arguments; users now need to pass a Model
class instead.
The minimum supported Python version is now 3.6.
WeightWindows
class.XTorus
, YTorus
, and ZTorus
classes.DAGMCUniverse
, allowing users to combine CSG and CAD-based geometry in a single model.openmc_properties_export
and openmc_properties_import
with corresponding Python API bindings, openmc.lib.export_properties
and openmc.lib.import_properties
. These functions allow physical properties (temperatures, densities, material compositions) to be written to an HDF5 file and re-used for subsequent simulations.openmc.stats.PowerLaw
univariate distributionModel
class have been substantially expanded (e.g., the Model.deplete
, Model.plot_geometry
, and Model.rotate_cells
methods).TimeFilter
class that allows tallies to be filtered by the particle's time, which is now tracked.Source
class now allows you to specify a time distribution.CylindricalMesh
and SphericalMesh
classes can be used for mesh tallies over cylidrical and spherical meshes, respectively.This release contains new contributions from the following people:
This release of OpenMC is primarily a hotfix release with numerous important bug fixes. Several tally-related enhancements have also been added.
Three tally-related enhancements were added to the code in this release:
CollisionFilter
class that allows tallies to be filtered by the number of collisions a particle has undergone.translation
attribute has been added to MeshFilter
that allows a mesh to be translated from its original position before location checks are performed.UnstructuredMesh
class now supports libMesh unstructured meshes to enable better ingration with MOOSE-based applications.This release contains new contributions from the following people:
This release of OpenMC includes an assortment of new features and many bug fixes. The openmc.deplete
module incorporates a number of improvements in usability, accuracy, and performance. Other enhancements include generalized rotational periodic boundary conditions, expanded source modeling capabilities, and a capability to generate windowed multipole library files from ENDF files.
Boundary conditions have been refactored and generalized. Rotational periodic boundary conditions can now be applied to any N-fold symmetric geometry.
External source distributions have been refactored and extended. Users writing their own C++ custom sources need to write a class that derives from openmc::Source
. These changes have enabled new functionality, such as:
New capability to read and write a source file based on particles that cross a surface (known as a "surface source").
Various improvements related to depletion:
reactions
argument to openmc.deplete.Chain.from_endf
.reaction_rate_mode
and reaction_rate_opts
to openmc.deplete.Operator
.openmc.Materials
object using the openmc.deplete.ResultsList.export_to_materials
method.Multigroup current and diffusion cross sections can be generated through the openmc.mgxs.Current
and openmc.mgxs.DiffusionCoefficient
classes.
Added openmc.data.isotopes
function that returns a list of naturally occurring isotopes for a given element.
Windowed multipole libraries can now be generated directly from the Python API using openmc.data.WindowedMultipole.from_endf
.
The new openmc.write_source_file
function allows source files to be generated programmatically.
RectangularParallelepiped.__pos__
This release contains new contributions from the following people:
This release of OpenMC includes an assortment of new features and many bug fixes. In particular, the openmc.deplete
module has been heavily tested which has resulted in a number of usability improvements, bug fixes, and other enhancements. Energy deposition calculations, particularly for coupled neutron-photon simulations, have been improved as well.
Improvements in modeling capabilities continue to be added to the code, including the ability to rotate surfaces in the Python API, several new "composite" surfaces, a variety of new methods on openmc.Material
, unstructured mesh tallies that leverage the existing DAGMC infrastructure, effective dose coefficients from ICRP-116, and a new cell instance tally filter.
All surfaces now have a rotate
method that allows them to be rotated.
Several "composite" surfaces, which are actually composed of multiple surfaces but can be treated as a normal surface through the -/+ unary operators, have been added. These include:
openmc.model.RightCircularCylinder
openmc.model.RectangularParallelepiped
openmc.model.XConeOneSided
(and equivalent versions for y- and z-axes)Various improvements related to depletion:
solver
argument on depletion integrator classes.openmc.deplete.Chain.reduce
method can automatically reduce the number of nuclides in a depletion chain.openmc.deplete.ResultsList.get_atoms
now allows a user to obtain depleted material compositions in atom/b-cm.Several new methods on openmc.Material
:
add_elements_from_formula
method allows a user to create a material based on a chemical formula.add_element
now supports the enrichment
argument for non-uranium elements when only two isotopes are naturally occurring.add_element
now supports adding elements by name rather than by symbol.get_elements
method returns a list of elements within a material.mix_materials
method allows multiple materials to be mixed together based on atom, weight, or volume fractions.The acceptable number of lost particles can now be configured through openmc.Settings.max_lost_particles
and openmc.Settings.rel_max_lost_particles
.
Delayed photons produced from fission are now accounted for by default by scaling the yield of prompt fission photons. This behavior can be modified through the openmc.Settings.delayed_photon_scaling
attribute.
A trigger can now be specified for a volume calculation via the openmc.VolumeCalculation.set_trigger
method.
The openmc.stats.SphericalIndependent
and openmc.stats.CylindricalIndependent
classes allow a user to specify source distributions based on spherical or cylindrical coordinates.
Custom external source distributions can be used via the openmc.Source.library
attribute.
Unstructured mesh class, openmc.UnstructuredMesh
, that can be used in tallies.
The openmc.CellInstanceFilter
class allows one or more instances of a repeated cell to be tallied. This is effectively a more flexible version of the existing openmc.DistribcellFilter
class.
The openmc.data.dose_coefficients
function provides effective dose coefficients from ICRP-116 and can be used in conjunction with openmc.EnergyFunctionFilter
in a tally.
__repr__
methods
This release contains new contributions from the following people:
This release of OpenMC adds several major new features: depletion, photon transport, and support for CAD geometries through DAGMC. In addition, the core codebase has been rewritten in C++14 (it was previously written in Fortran 2008). This makes compiling the code considerably simpler as no Fortran compiler is needed.
Functional expansion tallies are now supported through several new tally filters that can be arbitrarily combined:
openmc.LegendreFilter
openmc.SpatialLegendreFilter
openmc.SphericalHarmonicsFilter
openmc.ZernikeFilter
openmc.ZernikeRadialFilter
Note that these filters replace the use expansion scores like scatter-P1
. Instead, a normal scatter
score should be used along with a openmc.LegendreFilter
.
The interface for random sphere packing has been significantly improved. A new openmc.model.pack_spheres
function takes a region and generates a random, non-overlapping configuration of spheres within the region.
White boundary conditions can be applied to surfaces
Support for rectilinear meshes through openmc.RectilinearMesh
.
The Geometry
, Materials
, and Settings
classes now have a from_xml
method that will build an instance from an existing XML file.
Predefined energy group structures can be found in openmc.mgxs.GROUP_STRUCTURES
.
New tally scores: H1-production
, H2-production
, H3-production
, He3-production
, He4-production
, heating
, heating-local
, and damage-energy
.
Switched to cell-based neighor lists (PR 1140)
Two new probability distributions that can be used for source distributions: openmc.stats.Normal
and openmc.stats.Muir
The openmc.data
module now supports reading and sampling from ENDF File 32 resonance covariance data (PR 1024).
Several new convenience functions/methods have been added:
openmc.model.cylinder_from_points
function creates a cylinder given two points passing through its center and a radius.openmc.Plane.from_points
function creates a plane given three points that pass through it.openmc.model.pin
function creates a pin cell universe given a sequence of concentric cylinders and materials.All surface classes now have coefficient arguments given as lowercase names.
The order of arguments in surface classes has been changed so that coefficients are the first arguments (rather than the optional surface ID). This means you can now write::
x = openmc.XPlane(5.0, 'reflective')
zc = openmc.ZCylinder(0., 0., 10.)
The Mesh
class has been renamed openmc.RegularMesh
.
The get_rectangular_prism
function has been renamed openmc.model.rectangular_prism
.
The get_hexagonal_prism
function has been renamed openmc.model.hexagonal_prism
.
Python bindings to the C/C++ API have been move from openmc.capi
to openmc.lib
.
This release contains new contributions from the following people:
This release of OpenMC includes several new features, performance improvements, and bug fixes compared to version 0.9.0. Notably, a C API has been added that enables in-memory coupling of neutronics to other physics fields, e.g., burnup calculations and thermal-hydraulics. The C API is also backed by Python bindings in a new openmc.capi
package. Users should be forewarned that the C API is still in an experimental state and the interface is likely to undergo changes in future versions.
The Python API continues to improve over time; several backwards incompatible changes were made in the API which users of previous versions should take note of:
To indicate that nuclides in a material should be treated such that elastic scattering is isotropic in the laboratory system, there is a new Material.isotropic
property:
mat = openmc.Material()
mat.add_nuclide('H1', 1.0)
mat.isotropic = ['H1']
To treat all nuclides in a material this way, the Material.make_isotropic_in_lab
method can still be used.
The initializers for openmc.Intersection
and openmc.Union
now expect an iterable.
Auto-generated unique IDs for classes now start from 1 rather than 10000.
NOTE: This is the last release of OpenMC that will support Python 2.7. Future releases of OpenMC will require Python 3.4 or later.
This release contains new contributions from the following people: