diff --git a/MANIFEST.in b/MANIFEST.in index 5715bfb4445..795bfcf2367 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,15 +1,17 @@ include CMakeLists.txt include LICENSE include CODE_OF_CONDUCT.md +include CODEOWNERS include CONTRIBUTING.md +include Dockerfile include schemas.xml include pyproject.toml include pytest.ini -include openmc/data/reconstruct.pyx include docs/source/_templates/layout.html include docs/sphinxext/LICENSE -recursive-include . *.rst -recursive-include cmake *.cmake +global-include *.cmake +global-include *.cmake.in +global-include *.rst recursive-include docs *.css recursive-include docs *.dia recursive-include docs *.png @@ -23,8 +25,10 @@ recursive-include examples *.ipynb recursive-include examples *.png recursive-include examples *.py recursive-include examples *.xml +recursive-include include *.h recursive-include man *.1 -recursive-include src *.F90 +recursive-inlcude openmc *.pyx +recursive-include openmc *.c recursive-include src *.c recursive-include src *.cc recursive-include src *.cpp @@ -34,13 +38,17 @@ recursive-include src *.rnc recursive-include src *.rng recursive-include tests *.dat recursive-include tests *.h5 +recursive-inlcude tests *.h5m recursive-include tests *.py recursive-include tests *.xml recursive-include vendor CMakeLists.txt -recursive-include vendor *.cmake.in recursive-include vendor *.cc recursive-include vendor *.cpp +recursive-include vendor *.h recursive-include vendor *.hh recursive-include vendor *.hpp +recursive-include vendor *.pc.in +recursive-include vendor *.natvis +include vendor/gsl-lite/include/gsl/gsl prune docs/build prune docs/source/pythonapi/generated/ diff --git a/docs/source/releasenotes/0.12.0.rst b/docs/source/releasenotes/0.12.0.rst new file mode 100644 index 00000000000..53f4dfaef4a --- /dev/null +++ b/docs/source/releasenotes/0.12.0.rst @@ -0,0 +1,149 @@ +==================== +What's New in 0.12.0 +==================== + +.. currentmodule:: openmc + +------- +Summary +------- + +This release of OpenMC includes an assortment of new features and many bug fixes. +In particular, the :mod:`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 :class:`openmc.Material`, +unstructured mesh tallies that leverage the existing DAGMC infrastructure, +effective dose coefficients from ICRP-116, and a new cell instance tally +filter. + +------------ +New Features +------------ + +- 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: + + - :class:`openmc.model.RightCircularCylinder` + - :class:`openmc.model.RectangularParallelepiped` + - :class:`openmc.model.XConeOneSided` (and equivalent versions for y- and z-axes) + +- Various improvements related to depletion: + + - The matrix exponential solver can now be configured through the `solver` + argument on depletion integrator classes. + - The :meth:`openmc.deplete.Chain.reduce` method can automatically reduce the + number of nuclides in a depletion chain. + - Depletion integrator classes now allow a user to specify timesteps in several + units (s, min, h, d, MWd/kg). + - :meth:`openmc.deplete.ResultsList.get_atoms` now allows a user to obtain + depleted material compositions in atom/b-cm. + +- Several new methods on :class:`openmc.Material`: + + - The :meth:`openmc.Material.add_elements_from_formula` method allows a user + to create a material based on a chemical formula. + - :meth:`openmc.Material.add_element` now supports the `enrichment` argument for + non-uranium elements when only two isotopes are naturally occurring. + - :meth:`openmc.Material.add_element` now supports adding elements by name + rather than by symbol. + - The :meth:`openmc.Material.get_elements` method returns a list of elements + within a material. + - The :meth:`openmc.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 + :attr:`openmc.Settings.max_lost_particles` and + :attr:`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 :attr:`openmc.Settings.delayed_photon_scaling` attribute. +- A trigger can now be specified for a volume calculation via the + :meth:`openmc.VolumeCalculation.set_trigger` method. +- The :class:`openmc.stats.SphericalIndependent` and + :class:`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 + :attr:`openmc.Source.library` attribute. +- Unstructured mesh class, :class:`openmc.UnstructuredMesh`, that can be used in + tallies. +- The :class:`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 :class:`openmc.DistribcellFilter` class. +- The :func:`openmc.data.dose_coefficients` function provides effective dose + coefficients from ICRP-116 and can be used in conjunction with + :class:`openmc.EnergyFunctionFilter` in a tally. + +--------- +Bug Fixes +--------- + +- `Keep user-supplied prev_results on operator `_ +- `Fix bug when S(a,b) tables appear in depletable material `_ +- `DAGMC fix for implicit complement material assignment `_ +- `Bug fix for tallying reaction rates in coupled n-p runs `_ +- `Corrected issue with multiplicity matrix `_ +- `Fix depletion with photon transport `_ +- `Fix secondary photon creation `_ +- `Bug fix for total xs plotting `_ +- `Account for light nuclide production in depletion `_ +- `Reset timer in depletion calculations `_ +- `Fix for Model.run `_ +- `Ensure NJOY output goes to specified directory `_ +- `Fix bug preventing creating photon data `_ +- `Fix bug when surface ID > 999999 `_ +- `Fix bug for reading output settings in Settings.from_xml `_ +- `Fix improve energy deposition for coupled neutron-photon `_ +- `Use number of particles for tally normalization `_ +- `Fix a number of problems related to photoatomic data `_ +- `Fix cosine smearing for S(a,b) `_ +- `Use relative distances for coincidence test in hex lattice `_ +- `Fix RPATH for non-Debian linux systems `_ +- `Fix mesh plotter energy filter bins `_ +- `Fix memory leak `_ +- `Fix volume allocation related to burnable materials `_ +- `Fix tally mesh bug for short tracks `_ +- `DAGMC void material assignment fix `_ +- `Fix for Mesh __repr__ methods `_ + +------------ +Contributors +------------ + +This release contains new contributions from the following people: + +- `Paul Cosgrove `_ +- `Steven Dargaville `_ +- `Andrew Davis `_ +- `Iurii Drobyshev `_ +- `Guillaume Giudicelli `_ +- `Alec Golas `_ +- `Avery Grieve `_ +- `Sterling Harper `_ +- `Yuan Hu `_ +- `Yue Jin `_ +- `Andrew Johnson `_ +- `Mikolaj Kowalski `_ +- `Shikhar Kumar `_ +- `Jingang Liang `_ +- `David Long `_ +- `Amanda Lund `_ +- `Alex Lyons `_ +- `Adam Nelson `_ +- `Ethan Peterson `_ +- `Sam Powell-Gill `_ +- `Ariful Islam Pranto `_ +- `Simon Richards `_ +- `Gavin Ridley `_ +- `Paul Romano `_ +- `Jonathan Shimwell `_ +- `Patrick Shriwise `_ +- `John Tramm `_ +- `Paul P.H. Wilson `_ +- `Jiankai Yu `_ diff --git a/docs/source/releasenotes/index.rst b/docs/source/releasenotes/index.rst index 320ea9ca050..e562ecb525a 100644 --- a/docs/source/releasenotes/index.rst +++ b/docs/source/releasenotes/index.rst @@ -7,6 +7,7 @@ Release Notes .. toctree:: :maxdepth: 1 + 0.12.0 0.11.0 0.10.0 0.9.0 diff --git a/scripts/openmc-get-photon-data b/scripts/openmc-get-photon-data deleted file mode 100755 index 2d010b02ec6..00000000000 --- a/scripts/openmc-get-photon-data +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python3 - -""" -Download ENDF/B-VII.1 ENDF data from NNDC for photo-atomic and atomic -relaxation data and convert it to an HDF5 library for use with OpenMC. -This data is used for photon transport in OpenMC. -""" - -import argparse -import os -from pathlib import Path -import zipfile - -import openmc.data -from openmc._utils import download - - -class CustomFormatter(argparse.ArgumentDefaultsHelpFormatter, - argparse.RawDescriptionHelpFormatter): - pass - - -parser = argparse.ArgumentParser( - description=__doc__, - formatter_class=CustomFormatter -) -parser.add_argument('-c', '--cross-sections', - help='cross_sections.xml file to append libraries to') -args = parser.parse_args() - -base_url = 'https://www.nndc.bnl.gov/endf/b7.1/zips/' -files = ['ENDF-B-VII.1-photoat.zip', 'ENDF-B-VII.1-atomic_relax.zip'] -block_size = 16384 - -# ============================================================================== -# DOWNLOAD FILES FROM NNDC SITE - -output = Path('photon_hdf5') -output.mkdir(exist_ok=True) - -for f in files: - download(base_url + f) - -# ============================================================================== -# EXTRACT FILES - -for f in files: - print('Extracting {}...'.format(f)) - zipfile.ZipFile(f).extractall() - -# ============================================================================== -# GENERATE HDF5 DATA LIBRARY - -# If previous cross_sections.xml was specified, load it in -if args.cross_sections is not None: - lib_path = args.cross_sections - library = openmc.data.DataLibrary.from_xml(lib_path) -else: - lib_path = output / 'cross_sections.xml' - library = openmc.data.DataLibrary() - -# Iterate over each natural element from Z=1 to Z=100 -for z in range(1, 101): - element = openmc.data.ATOMIC_SYMBOL[z] - print('Generating HDF5 file for Z={} ({})...'.format(z, element)) - - # Generate instance of IncidentPhoton - photo_file = os.path.join('photoat', 'photoat-{:03}_{}_000.endf'.format(z, element)) - atom_file = os.path.join('atomic_relax', 'atom-{:03}_{}_000.endf'.format(z, element)) - data = openmc.data.IncidentPhoton.from_endf(photo_file, atom_file) - - # Write HDF5 file and register it - hdf5_file = output / (element + '.h5') - data.export_to_hdf5(hdf5_file, 'w') - library.register_file(hdf5_file) - -library.export_to_xml(lib_path) diff --git a/scripts/openmc-make-compton b/scripts/openmc-make-compton deleted file mode 100755 index 8d0962efc69..00000000000 --- a/scripts/openmc-make-compton +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python - -import os -import tarfile - -import numpy as np -import h5py - -from openmc._utils import download - - -base_url = 'http://geant4.cern.ch/support/source/' -filename = 'G4EMLOW.6.48.tar.gz' - -# ============================================================================== -# DOWNLOAD FILES FROM GEANT4 SITE - -download(base_url + filename) - -# ============================================================================== -# EXTRACT FILES FROM TGZ - -if not os.path.isdir('G4EMLOW6.48'): - with tarfile.open(filename, 'r') as tgz: - print('Extracting {}...'.format(filename)) - tgz.extractall() - -# ============================================================================== -# GENERATE COMPTON PROFILE HDF5 FILE - -print('Generating compton_profiles.h5...') - -shell_file = os.path.join('G4EMLOW6.48', 'doppler', 'shell-doppler.dat') - -with open(shell_file, 'r') as shell, h5py.File('compton_profiles.h5', 'w') as f: - # Read/write electron momentum values - pz = np.loadtxt(os.path.join('G4EMLOW6.48', 'doppler', 'p-biggs.dat')) - f.create_dataset('pz', data=pz) - - for z in range(1, 101): - # Create group for this element - group = f.create_group('{:03}'.format(z)) - - # Read data into one long array - path = os.path.join('G4EMLOW6.48', 'doppler', 'profile-{}.dat'.format(z)) - with open(path, 'r') as profile: - j = np.fromstring(profile.read(), sep=' ') - - # Determine number of electron shells and reshape. Profiles are - # tabulated against a grid of 31 momentum values. - n_shells = j.size // 31 - j.shape = (n_shells, 31) - - # Write Compton profile for this Z - group.create_dataset('J', data=j) - - # Determine binding energies and number of electrons for each shell - num_electrons = [] - binding_energy = [] - while True: - words = shell.readline().split() - if words[0] == '-1': - break - num_electrons.append(float(words[0])) - binding_energy.append(float(words[1])) - - # Write binding energies and number of electrons - group.create_dataset('num_electrons', data=num_electrons) - group.create_dataset('binding_energy', data=binding_energy) diff --git a/scripts/openmc-make-stopping-powers b/scripts/openmc-make-stopping-powers deleted file mode 100755 index 3357f2fe52c..00000000000 --- a/scripts/openmc-make-stopping-powers +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python - -from urllib.parse import urlencode -from urllib.request import urlopen -from lxml import html - -import numpy as np -import h5py -from openmc.data import ATOMIC_SYMBOL - - -base_url = 'https://physics.nist.gov/cgi-bin/Star/e_table-t.pl' -energies = np.logspace(-3, 3, 200) -data = {'matno': '', 'Energies': '\n'.join(str(x) for x in energies)} -columns = {1: 's_collision', 2: 's_radiative'} - -# ============================================================================== -# SCRAPE DATA FROM ESTAR SITE AND GENERATE STOPPING POWER HDF5 FILE - -print('Generating stopping_powers.h5...') - -with h5py.File('stopping_powers.h5', 'w') as f: - - # Write energies - f.create_dataset('energy', data=energies) - - # Look over atomic number; ESTAR only goes up to Z=98 (Californium) - for Z in range(1, 99): - print('Processing {} data...'.format(ATOMIC_SYMBOL[Z])) - - # Update form-encoded data to send in POST request for this element - data['matno'] = '{:03}'.format(Z) - payload = urlencode(data).encode("utf-8") - - # Retrieve data from ESTAR site - with urlopen(url=base_url, data=payload) as response: - r = response.read() - - # Remove text and reformat data -- omit first 12 and last 5 lines to get - # only data in table - r = html.fromstring(r).xpath('//pre//text()') - values = np.fromstring(' '.join(r[12:-5]), sep=' ').reshape((-1, 5)).T - - # Create group for this element - group = f.create_group('{:03}'.format(Z)) - - # Write the mean excitation energy - attributes = np.fromstring(r[3], sep=' ') - group.attrs['I'] = attributes[2] - - # Write collision and radiative stopping powers - for i in columns: - group.create_dataset(columns[i], data=values[i])