diff --git a/Dockerfile b/Dockerfile index 6466c7685..478dfc495 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN git clone https://github.com/njoy/NJOY2016 /opt/NJOY2016 && \ # Clone and install OpenMC RUN git clone https://github.com/openmc-dev/openmc.git /opt/openmc && \ cd /opt/openmc && mkdir -p build && cd build && \ - cmake -Doptimize=on -DHDF5_PREFER_PARALLEL=on .. && \ + cmake -Doptimize=on -DHDF5_PREFER_PARALLEL=on .. && \ make && make install && \ cd .. && pip install -e .[test] diff --git a/openmc/_xml.py b/openmc/_xml.py index 9c6c219e2..7470b2c3b 100644 --- a/openmc/_xml.py +++ b/openmc/_xml.py @@ -1,6 +1,6 @@ def clean_indentation(element, level=0, spaces_per_level=2): """ - copy and paste from http://effbot.org/zone/elementent-lib.htm#prettyprint + copy and paste from http://effbot.org/zone/element-lib.htm#prettyprint it basically walks your tree and adds spaces and newlines so the tree is printed in a nice way """ diff --git a/openmc/cell.py b/openmc/cell.py index ee883c796..06a80e173 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -2,7 +2,7 @@ from collections import OrderedDict from collections.abc import Iterable from copy import deepcopy from math import cos, sin, pi -from numbers import Real, Integral +from numbers import Real from xml.etree import ElementTree as ET import sys import warnings @@ -442,7 +442,7 @@ class Cell(IDManagerMixin): if memo is None: memo = {} - # If no nemoize'd clone exists, instantiate one + # If no memoize'd clone exists, instantiate one if self not in memo: # Temporarily remove paths paths = self._paths diff --git a/openmc/checkvalue.py b/openmc/checkvalue.py index cbeac9c37..e19780a1c 100644 --- a/openmc/checkvalue.py +++ b/openmc/checkvalue.py @@ -90,7 +90,7 @@ def check_iterable_type(name, value, expected_type, min_depth=1, max_depth=1): # Get a string representation of the current index in case we raise an # exception. - form = '[' + '{:d}, '*(len(index)-1) + '{:d}]' + form = '[' + '{:d}, ' * (len(index)-1) + '{:d}]' ind_str = form.format(*index) # What is the current item we are looking at? @@ -109,7 +109,7 @@ def check_iterable_type(name, value, expected_type, min_depth=1, max_depth=1): index[-1] += 1 # If this item is not of the expected type, then it's either an error or - # another level of the tree that we need to pursue deeper. + # on a deeper level of the tree. else: if isinstance(current_item, Iterable): # The tree goes deeper here, let's explore it. diff --git a/openmc/cmfd.py b/openmc/cmfd.py index b215d2058..5f4f6e60e 100644 --- a/openmc/cmfd.py +++ b/openmc/cmfd.py @@ -64,7 +64,7 @@ class CMFDMesh(object): The lower-left corner of the structured mesh. If only two coordinates are given, it is assumed that the mesh is an x-y mesh. upper_right : Iterable of float - The upper-right corner of the structrued mesh. If only two coordinates + The upper-right corner of the structured mesh. If only two coordinates are given, it is assumed that the mesh is an x-y mesh. dimension : Iterable of int The number of mesh cells in each direction. @@ -220,7 +220,7 @@ class CMFDRun(object): Indicate whether an effective downscatter cross section should be used when using 2-group CMFD. feedback : bool - Indicate or not the CMFD diffusion result is used to adjust the weight + Indicate whether or not the CMFD diffusion result is used to adjust the weight of fission source neutrons on the next OpenMC batch. Defaults to False. cmfd_ktol : float Tolerance on the eigenvalue when performing CMFD power iteration @@ -694,7 +694,7 @@ class CMFDRun(object): def run(self, **kwargs): """Run OpenMC with coarse mesh finite difference acceleration - This method is called by user to run CMFD once instance variables of + This method is called by the user to run CMFD once instance variables of CMFDRun class are set Parameters diff --git a/openmc/data/grid.py b/openmc/data/grid.py index e63919ac2..6aec569dc 100644 --- a/openmc/data/grid.py +++ b/openmc/data/grid.py @@ -2,7 +2,7 @@ import numpy as np def linearize(x, f, tolerance=0.001): - """Return a tabulated representation of a function of one variable. + """Return a tabulated representation of a one-variable function Parameters ---------- diff --git a/openmc/data/laboratory.py b/openmc/data/laboratory.py index cfedb292b..10403655d 100644 --- a/openmc/data/laboratory.py +++ b/openmc/data/laboratory.py @@ -4,9 +4,8 @@ from numbers import Real, Integral import numpy as np import openmc.checkvalue as cv -from openmc.stats import Tabular, Univariate, Discrete, Mixture +from openmc.stats import Tabular, Univariate, Discrete from .angle_energy import AngleEnergy -from .function import INTERPOLATION_SCHEME from .endf import get_tab2_record, get_tab1_record @@ -122,7 +121,7 @@ class LaboratoryAngleEnergy(AngleEnergy): mu = [] energy_out = [] for i in range(ne): - params, tab2mu = get_tab2_record(file_obj) + params, _ = get_tab2_record(file_obj) energy[i] = params[1] n_mu = params[5] mu_i = np.zeros(n_mu) diff --git a/openmc/data/library.py b/openmc/data/library.py index d5f18aa17..2339ca1c9 100644 --- a/openmc/data/library.py +++ b/openmc/data/library.py @@ -6,7 +6,6 @@ import h5py from openmc.mixin import EqualityMixin from openmc._xml import clean_indentation -from openmc.checkvalue import check_type class DataLibrary(EqualityMixin): diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index 7420387da..06ba86f4d 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -85,7 +85,7 @@ class IncidentNeutron(EqualityMixin): resonance_covariance : openmc.data.ResonanceCovariance or None Covariance for resonance parameters temperatures : list of str - List of string representations the temperatures of the target nuclide + List of string representations of the temperatures of the target nuclide in the data set. The temperatures are strings of the temperature, rounded to the nearest integer; e.g., '294K' kTs : Iterable of float @@ -410,7 +410,7 @@ class IncidentNeutron(EqualityMixin): ---------- path : str Path to write HDF5 file to - mode : {'r', r+', 'w', 'x', 'a'} + mode : {'r', 'r+', 'w', 'x', 'a'} Mode that is used to open the HDF5 file. This is the second argument to the :class:`h5py.File` constructor. libver : {'earliest', 'latest'} diff --git a/openmc/data/photon.py b/openmc/data/photon.py index 31514639a..5a9883992 100644 --- a/openmc/data/photon.py +++ b/openmc/data/photon.py @@ -794,7 +794,7 @@ class IncidentPhoton(EqualityMixin): ---------- path : str Path to write HDF5 file to - mode : {'r', r+', 'w', 'x', 'a'} + mode : {'r', 'r+', 'w', 'x', 'a'} Mode that is used to open the HDF5 file. This is the second argument to the :class:`h5py.File` constructor. libver : {'earliest', 'latest'} diff --git a/openmc/data/product.py b/openmc/data/product.py index 5b8652d77..a6ea17bf9 100644 --- a/openmc/data/product.py +++ b/openmc/data/product.py @@ -17,7 +17,7 @@ class Product(EqualityMixin): Parameters ---------- particle : str, optional - What particle the reaction product is. Defaults to 'neutron'. + The particle type of the reaction product. Defaults to 'neutron'. Attributes ---------- diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index a2f7db818..662106a69 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -108,16 +108,37 @@ def replace_missing(product, decay_data): _SECONDARY_PARTICLES = { - "(n,p)": ["H1"], "(n,d)": ["H2"], "(n,t)": ["H3"], "(n,3He)": ["He3"], - "(n,a)": ["He4"], "(n,2nd)": ["H2"], "(n,na)": ["He4"], "(n,3na)": ["He4"], - "(n,n3a)": ["He4"] * 3, "(n,2na)": ["He4"], "(n,np)": ["H1"], - "(n,n2a)": ["He4"] * 2, "(n,2n2a)": ["He4"] * 2, "(n,nd)": ["H2"], - "(n,nt)": ["H3"], "(n,nHe-3)": ["He3"], "(n,nd2a)": ["H2", "He4"], - "(n,nt2a)": ["H3", "He4", "He4"], "(n,2np)": ["H1"], "(n,3np)": ["H1"], - "(n,n2p)": ["H1"] * 2, "(n,2a)": ["He4"] * 2, "(n,3a)": ["He4"] * 3, - "(n,2p)": ["H1"] * 2, "(n,pa)": ["H1", "He4"], - "(n,t2a)": ["H3", "He4", "He4"], "(n,d2a)": ["H2", "He4", "He4"], - "(n,pd)": ["H1", "H2"], "(n,pt)": ["H1", "H3"], "(n,da)": ["H2", "He4"]} + '(n,p)': ['H1'], + '(n,d)': ['H2'], + '(n,t)': ['H3'], + '(n,3He)': ['He3'], + '(n,a)': ['He4'], + '(n,2nd)': ['H2'], + '(n,na)': ['He4'], + '(n,3na)': ['He4'], + '(n,n3a)': ['He4'] * 3, + '(n,2na)': ['He4'], + '(n,np)': ['H1'], + '(n,n2a)': ['He4'] * 2, + '(n,2n2a)': ['He4'] * 2, + '(n,nd)': ['H2'], + '(n,nt)': ['H3'], + '(n,nHe-3)': ['He3'], + '(n,nd2a)': ['H2', 'He4'], + '(n,nt2a)': ['H3', 'He4', 'He4'], + '(n,2np)': ['H1'], + '(n,3np)': ['H1'], + '(n,n2p)': ['H1'] * 2, + '(n,2a)': ['He4'] * 2, + '(n,3a)': ['He4'] * 3, + '(n,2p)': ['H1'] * 2, + '(n,pa)': ['H1', 'He4'], + '(n,t2a)': ['H3', 'He4', 'He4'], + '(n,d2a)': ['H2', 'He4', 'He4'], + '(n,pd)': ['H1', 'H2'], + '(n,pt)': ['H1', 'H3'], + '(n,da)': ['H2', 'He4'] +} class Chain(object): diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index 85c8d8998..b1dc5b13f 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -26,7 +26,7 @@ class ReactionRates(np.ndarray): reactions : list of str Transmutation reactions being tracked from_results : boolean - If the reaction rates are loaded from results, indexing dictionnaries + If the reaction rates are loaded from results, indexing dictionaries need to be kept the same. Attributes @@ -66,7 +66,7 @@ class ReactionRates(np.ndarray): obj.index_rx = reactions # Else, assumes that reaction rates are ordered the same way as # the lists of local_mats, nuclides and reactions (or keys if these - # are dictionnaries) + # are dictionaries) else: obj.index_mat = {mat: i for i, mat in enumerate(local_mats)} obj.index_nuc = {nuc: i for i, nuc in enumerate(nuclides)} diff --git a/openmc/element.py b/openmc/element.py index 5b2a878a8..e36460334 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -3,7 +3,6 @@ import re import os from xml.etree import ElementTree as ET -import openmc import openmc.checkvalue as cv from openmc.data import NATURAL_ABUNDANCE, atomic_mass diff --git a/openmc/examples.py b/openmc/examples.py index 4e8c8cf92..3b73d043f 100644 --- a/openmc/examples.py +++ b/openmc/examples.py @@ -25,25 +25,25 @@ def pwr_pin_cell(): # Define materials. fuel = openmc.Material(name='UO2 (2.4%)') fuel.set_density('g/cm3', 10.29769) - fuel.add_nuclide("U234", 4.4843e-6) - fuel.add_nuclide("U235", 5.5815e-4) - fuel.add_nuclide("U238", 2.2408e-2) - fuel.add_nuclide("O16", 4.5829e-2) + fuel.add_nuclide('U234', 4.4843e-6) + fuel.add_nuclide('U235', 5.5815e-4) + fuel.add_nuclide('U238', 2.2408e-2) + fuel.add_nuclide('O16', 4.5829e-2) clad = openmc.Material(name='Zircaloy') clad.set_density('g/cm3', 6.55) - clad.add_nuclide("Zr90", 2.1827e-2) - clad.add_nuclide("Zr91", 4.7600e-3) - clad.add_nuclide("Zr92", 7.2758e-3) - clad.add_nuclide("Zr94", 7.3734e-3) - clad.add_nuclide("Zr96", 1.1879e-3) + clad.add_nuclide('Zr90', 2.1827e-2) + clad.add_nuclide('Zr91', 4.7600e-3) + clad.add_nuclide('Zr92', 7.2758e-3) + clad.add_nuclide('Zr94', 7.3734e-3) + clad.add_nuclide('Zr96', 1.1879e-3) hot_water = openmc.Material(name='Hot borated water') hot_water.set_density('g/cm3', 0.740582) - hot_water.add_nuclide("H1", 4.9457e-2) - hot_water.add_nuclide("O16", 2.4672e-2) - hot_water.add_nuclide("B10", 8.0042e-6) - hot_water.add_nuclide("B11", 3.2218e-5) + hot_water.add_nuclide('H1', 4.9457e-2) + hot_water.add_nuclide('O16', 2.4672e-2) + hot_water.add_nuclide('B10', 8.0042e-6) + hot_water.add_nuclide('B11', 3.2218e-5) hot_water.add_s_alpha_beta('c_H_in_H2O') # Define the materials file. @@ -106,148 +106,148 @@ def pwr_core(): # Define materials. fuel = openmc.Material(1, name='UOX fuel') fuel.set_density('g/cm3', 10.062) - fuel.add_nuclide("U234", 4.9476e-6) - fuel.add_nuclide("U235", 4.8218e-4) - fuel.add_nuclide("U238", 2.1504e-2) - fuel.add_nuclide("Xe135", 1.0801e-8) - fuel.add_nuclide("O16", 4.5737e-2) + fuel.add_nuclide('U234', 4.9476e-6) + fuel.add_nuclide('U235', 4.8218e-4) + fuel.add_nuclide('U238', 2.1504e-2) + fuel.add_nuclide('Xe135', 1.0801e-8) + fuel.add_nuclide('O16', 4.5737e-2) clad = openmc.Material(2, name='Zircaloy') clad.set_density('g/cm3', 5.77) - clad.add_nuclide("Zr90", 0.5145) - clad.add_nuclide("Zr91", 0.1122) - clad.add_nuclide("Zr92", 0.1715) - clad.add_nuclide("Zr94", 0.1738) - clad.add_nuclide("Zr96", 0.0280) + clad.add_nuclide('Zr90', 0.5145) + clad.add_nuclide('Zr91', 0.1122) + clad.add_nuclide('Zr92', 0.1715) + clad.add_nuclide('Zr94', 0.1738) + clad.add_nuclide('Zr96', 0.0280) cold_water = openmc.Material(3, name='Cold borated water') cold_water.set_density('atom/b-cm', 0.07416) - cold_water.add_nuclide("H1", 2.0) - cold_water.add_nuclide("O16", 1.0) - cold_water.add_nuclide("B10", 6.490e-4) - cold_water.add_nuclide("B11", 2.689e-3) + cold_water.add_nuclide('H1', 2.0) + cold_water.add_nuclide('O16', 1.0) + cold_water.add_nuclide('B10', 6.490e-4) + cold_water.add_nuclide('B11', 2.689e-3) cold_water.add_s_alpha_beta('c_H_in_H2O') hot_water = openmc.Material(4, name='Hot borated water') hot_water.set_density('atom/b-cm', 0.06614) - hot_water.add_nuclide("H1", 2.0) - hot_water.add_nuclide("O16", 1.0) - hot_water.add_nuclide("B10", 6.490e-4) - hot_water.add_nuclide("B11", 2.689e-3) + hot_water.add_nuclide('H1', 2.0) + hot_water.add_nuclide('O16', 1.0) + hot_water.add_nuclide('B10', 6.490e-4) + hot_water.add_nuclide('B11', 2.689e-3) hot_water.add_s_alpha_beta('c_H_in_H2O') rpv_steel = openmc.Material(5, name='Reactor pressure vessel steel') rpv_steel.set_density('g/cm3', 7.9) - rpv_steel.add_nuclide("Fe54", 0.05437098, 'wo') - rpv_steel.add_nuclide("Fe56", 0.88500663, 'wo') - rpv_steel.add_nuclide("Fe57", 0.0208008, 'wo') - rpv_steel.add_nuclide("Fe58", 0.00282159, 'wo') - rpv_steel.add_nuclide("Ni58", 0.0067198, 'wo') - rpv_steel.add_nuclide("Ni60", 0.0026776, 'wo') - rpv_steel.add_nuclide("Mn55", 0.01, 'wo') - rpv_steel.add_nuclide("Cr52", 0.002092475, 'wo') - rpv_steel.add_nuclide("C0", 0.0025, 'wo') - rpv_steel.add_nuclide("Cu63", 0.0013696, 'wo') + rpv_steel.add_nuclide('Fe54', 0.05437098, 'wo') + rpv_steel.add_nuclide('Fe56', 0.88500663, 'wo') + rpv_steel.add_nuclide('Fe57', 0.0208008, 'wo') + rpv_steel.add_nuclide('Fe58', 0.00282159, 'wo') + rpv_steel.add_nuclide('Ni58', 0.0067198, 'wo') + rpv_steel.add_nuclide('Ni60', 0.0026776, 'wo') + rpv_steel.add_nuclide('Mn55', 0.01, 'wo') + rpv_steel.add_nuclide('Cr52', 0.002092475, 'wo') + rpv_steel.add_nuclide('C0', 0.0025, 'wo') + rpv_steel.add_nuclide('Cu63', 0.0013696, 'wo') lower_rad_ref = openmc.Material(6, name='Lower radial reflector') lower_rad_ref.set_density('g/cm3', 4.32) - lower_rad_ref.add_nuclide("H1", 0.0095661, 'wo') - lower_rad_ref.add_nuclide("O16", 0.0759107, 'wo') - lower_rad_ref.add_nuclide("B10", 3.08409e-5, 'wo') - lower_rad_ref.add_nuclide("B11", 1.40499e-4, 'wo') - lower_rad_ref.add_nuclide("Fe54", 0.035620772088, 'wo') - lower_rad_ref.add_nuclide("Fe56", 0.579805982228, 'wo') - lower_rad_ref.add_nuclide("Fe57", 0.01362750048, 'wo') - lower_rad_ref.add_nuclide("Fe58", 0.001848545204, 'wo') - lower_rad_ref.add_nuclide("Ni58", 0.055298376566, 'wo') - lower_rad_ref.add_nuclide("Mn55", 0.0182870, 'wo') - lower_rad_ref.add_nuclide("Cr52", 0.145407678031, 'wo') + lower_rad_ref.add_nuclide('H1', 0.0095661, 'wo') + lower_rad_ref.add_nuclide('O16', 0.0759107, 'wo') + lower_rad_ref.add_nuclide('B10', 3.08409e-5, 'wo') + lower_rad_ref.add_nuclide('B11', 1.40499e-4, 'wo') + lower_rad_ref.add_nuclide('Fe54', 0.035620772088, 'wo') + lower_rad_ref.add_nuclide('Fe56', 0.579805982228, 'wo') + lower_rad_ref.add_nuclide('Fe57', 0.01362750048, 'wo') + lower_rad_ref.add_nuclide('Fe58', 0.001848545204, 'wo') + lower_rad_ref.add_nuclide('Ni58', 0.055298376566, 'wo') + lower_rad_ref.add_nuclide('Mn55', 0.0182870, 'wo') + lower_rad_ref.add_nuclide('Cr52', 0.145407678031, 'wo') lower_rad_ref.add_s_alpha_beta('c_H_in_H2O') upper_rad_ref = openmc.Material(7, name='Upper radial reflector / Top plate region') upper_rad_ref.set_density('g/cm3', 4.28) - upper_rad_ref.add_nuclide("H1", 0.0086117, 'wo') - upper_rad_ref.add_nuclide("O16", 0.0683369, 'wo') - upper_rad_ref.add_nuclide("B10", 2.77638e-5, 'wo') - upper_rad_ref.add_nuclide("B11", 1.26481e-4, 'wo') - upper_rad_ref.add_nuclide("Fe54", 0.035953677186, 'wo') - upper_rad_ref.add_nuclide("Fe56", 0.585224740891, 'wo') - upper_rad_ref.add_nuclide("Fe57", 0.01375486056, 'wo') - upper_rad_ref.add_nuclide("Fe58", 0.001865821363, 'wo') - upper_rad_ref.add_nuclide("Ni58", 0.055815129186, 'wo') - upper_rad_ref.add_nuclide("Mn55", 0.0184579, 'wo') - upper_rad_ref.add_nuclide("Cr52", 0.146766614995, 'wo') + upper_rad_ref.add_nuclide('H1', 0.0086117, 'wo') + upper_rad_ref.add_nuclide('O16', 0.0683369, 'wo') + upper_rad_ref.add_nuclide('B10', 2.77638e-5, 'wo') + upper_rad_ref.add_nuclide('B11', 1.26481e-4, 'wo') + upper_rad_ref.add_nuclide('Fe54', 0.035953677186, 'wo') + upper_rad_ref.add_nuclide('Fe56', 0.585224740891, 'wo') + upper_rad_ref.add_nuclide('Fe57', 0.01375486056, 'wo') + upper_rad_ref.add_nuclide('Fe58', 0.001865821363, 'wo') + upper_rad_ref.add_nuclide('Ni58', 0.055815129186, 'wo') + upper_rad_ref.add_nuclide('Mn55', 0.0184579, 'wo') + upper_rad_ref.add_nuclide('Cr52', 0.146766614995, 'wo') upper_rad_ref.add_s_alpha_beta('c_H_in_H2O') bot_plate = openmc.Material(8, name='Bottom plate region') bot_plate.set_density('g/cm3', 7.184) - bot_plate.add_nuclide("H1", 0.0011505, 'wo') - bot_plate.add_nuclide("O16", 0.0091296, 'wo') - bot_plate.add_nuclide("B10", 3.70915e-6, 'wo') - bot_plate.add_nuclide("B11", 1.68974e-5, 'wo') - bot_plate.add_nuclide("Fe54", 0.03855611055, 'wo') - bot_plate.add_nuclide("Fe56", 0.627585036425, 'wo') - bot_plate.add_nuclide("Fe57", 0.014750478, 'wo') - bot_plate.add_nuclide("Fe58", 0.002000875025, 'wo') - bot_plate.add_nuclide("Ni58", 0.059855207342, 'wo') - bot_plate.add_nuclide("Mn55", 0.0197940, 'wo') - bot_plate.add_nuclide("Cr52", 0.157390026871, 'wo') + bot_plate.add_nuclide('H1', 0.0011505, 'wo') + bot_plate.add_nuclide('O16', 0.0091296, 'wo') + bot_plate.add_nuclide('B10', 3.70915e-6, 'wo') + bot_plate.add_nuclide('B11', 1.68974e-5, 'wo') + bot_plate.add_nuclide('Fe54', 0.03855611055, 'wo') + bot_plate.add_nuclide('Fe56', 0.627585036425, 'wo') + bot_plate.add_nuclide('Fe57', 0.014750478, 'wo') + bot_plate.add_nuclide('Fe58', 0.002000875025, 'wo') + bot_plate.add_nuclide('Ni58', 0.059855207342, 'wo') + bot_plate.add_nuclide('Mn55', 0.0197940, 'wo') + bot_plate.add_nuclide('Cr52', 0.157390026871, 'wo') bot_plate.add_s_alpha_beta('c_H_in_H2O') bot_nozzle = openmc.Material(9, name='Bottom nozzle region') bot_nozzle.set_density('g/cm3', 2.53) - bot_nozzle.add_nuclide("H1", 0.0245014, 'wo') - bot_nozzle.add_nuclide("O16", 0.1944274, 'wo') - bot_nozzle.add_nuclide("B10", 7.89917e-5, 'wo') - bot_nozzle.add_nuclide("B11", 3.59854e-4, 'wo') - bot_nozzle.add_nuclide("Fe54", 0.030411411144, 'wo') - bot_nozzle.add_nuclide("Fe56", 0.495012237964, 'wo') - bot_nozzle.add_nuclide("Fe57", 0.01163454624, 'wo') - bot_nozzle.add_nuclide("Fe58", 0.001578204652, 'wo') - bot_nozzle.add_nuclide("Ni58", 0.047211231662, 'wo') - bot_nozzle.add_nuclide("Mn55", 0.0156126, 'wo') - bot_nozzle.add_nuclide("Cr52", 0.124142524198, 'wo') + bot_nozzle.add_nuclide('H1', 0.0245014, 'wo') + bot_nozzle.add_nuclide('O16', 0.1944274, 'wo') + bot_nozzle.add_nuclide('B10', 7.89917e-5, 'wo') + bot_nozzle.add_nuclide('B11', 3.59854e-4, 'wo') + bot_nozzle.add_nuclide('Fe54', 0.030411411144, 'wo') + bot_nozzle.add_nuclide('Fe56', 0.495012237964, 'wo') + bot_nozzle.add_nuclide('Fe57', 0.01163454624, 'wo') + bot_nozzle.add_nuclide('Fe58', 0.001578204652, 'wo') + bot_nozzle.add_nuclide('Ni58', 0.047211231662, 'wo') + bot_nozzle.add_nuclide('Mn55', 0.0156126, 'wo') + bot_nozzle.add_nuclide('Cr52', 0.124142524198, 'wo') bot_nozzle.add_s_alpha_beta('c_H_in_H2O') top_nozzle = openmc.Material(10, name='Top nozzle region') top_nozzle.set_density('g/cm3', 1.746) - top_nozzle.add_nuclide("H1", 0.0358870, 'wo') - top_nozzle.add_nuclide("O16", 0.2847761, 'wo') - top_nozzle.add_nuclide("B10", 1.15699e-4, 'wo') - top_nozzle.add_nuclide("B11", 5.27075e-4, 'wo') - top_nozzle.add_nuclide("Fe54", 0.02644016154, 'wo') - top_nozzle.add_nuclide("Fe56", 0.43037146399, 'wo') - top_nozzle.add_nuclide("Fe57", 0.0101152584, 'wo') - top_nozzle.add_nuclide("Fe58", 0.00137211607, 'wo') - top_nozzle.add_nuclide("Ni58", 0.04104621835, 'wo') - top_nozzle.add_nuclide("Mn55", 0.0135739, 'wo') - top_nozzle.add_nuclide("Cr52", 0.107931450781, 'wo') + top_nozzle.add_nuclide('H1', 0.0358870, 'wo') + top_nozzle.add_nuclide('O16', 0.2847761, 'wo') + top_nozzle.add_nuclide('B10', 1.15699e-4, 'wo') + top_nozzle.add_nuclide('B11', 5.27075e-4, 'wo') + top_nozzle.add_nuclide('Fe54', 0.02644016154, 'wo') + top_nozzle.add_nuclide('Fe56', 0.43037146399, 'wo') + top_nozzle.add_nuclide('Fe57', 0.0101152584, 'wo') + top_nozzle.add_nuclide('Fe58', 0.00137211607, 'wo') + top_nozzle.add_nuclide('Ni58', 0.04104621835, 'wo') + top_nozzle.add_nuclide('Mn55', 0.0135739, 'wo') + top_nozzle.add_nuclide('Cr52', 0.107931450781, 'wo') top_nozzle.add_s_alpha_beta('c_H_in_H2O') top_fa = openmc.Material(11, name='Top of fuel assemblies') top_fa.set_density('g/cm3', 3.044) - top_fa.add_nuclide("H1", 0.0162913, 'wo') - top_fa.add_nuclide("O16", 0.1292776, 'wo') - top_fa.add_nuclide("B10", 5.25228e-5, 'wo') - top_fa.add_nuclide("B11", 2.39272e-4, 'wo') - top_fa.add_nuclide("Zr90", 0.43313403903, 'wo') - top_fa.add_nuclide("Zr91", 0.09549277374, 'wo') - top_fa.add_nuclide("Zr92", 0.14759527104, 'wo') - top_fa.add_nuclide("Zr94", 0.15280552077, 'wo') - top_fa.add_nuclide("Zr96", 0.02511169542, 'wo') + top_fa.add_nuclide('H1', 0.0162913, 'wo') + top_fa.add_nuclide('O16', 0.1292776, 'wo') + top_fa.add_nuclide('B10', 5.25228e-5, 'wo') + top_fa.add_nuclide('B11', 2.39272e-4, 'wo') + top_fa.add_nuclide('Zr90', 0.43313403903, 'wo') + top_fa.add_nuclide('Zr91', 0.09549277374, 'wo') + top_fa.add_nuclide('Zr92', 0.14759527104, 'wo') + top_fa.add_nuclide('Zr94', 0.15280552077, 'wo') + top_fa.add_nuclide('Zr96', 0.02511169542, 'wo') top_fa.add_s_alpha_beta('c_H_in_H2O') bot_fa = openmc.Material(12, name='Bottom of fuel assemblies') bot_fa.set_density('g/cm3', 1.762) - bot_fa.add_nuclide("H1", 0.0292856, 'wo') - bot_fa.add_nuclide("O16", 0.2323919, 'wo') - bot_fa.add_nuclide("B10", 9.44159e-5, 'wo') - bot_fa.add_nuclide("B11", 4.30120e-4, 'wo') - bot_fa.add_nuclide("Zr90", 0.3741373658, 'wo') - bot_fa.add_nuclide("Zr91", 0.0824858164, 'wo') - bot_fa.add_nuclide("Zr92", 0.1274914944, 'wo') - bot_fa.add_nuclide("Zr94", 0.1319920622, 'wo') - bot_fa.add_nuclide("Zr96", 0.0216912612, 'wo') + bot_fa.add_nuclide('H1', 0.0292856, 'wo') + bot_fa.add_nuclide('O16', 0.2323919, 'wo') + bot_fa.add_nuclide('B10', 9.44159e-5, 'wo') + bot_fa.add_nuclide('B11', 4.30120e-4, 'wo') + bot_fa.add_nuclide('Zr90', 0.3741373658, 'wo') + bot_fa.add_nuclide('Zr91', 0.0824858164, 'wo') + bot_fa.add_nuclide('Zr92', 0.1274914944, 'wo') + bot_fa.add_nuclide('Zr94', 0.1319920622, 'wo') + bot_fa.add_nuclide('Zr96', 0.0216912612, 'wo') bot_fa.add_s_alpha_beta('c_H_in_H2O') # Define the materials file. @@ -448,25 +448,25 @@ def pwr_assembly(): # Define materials. fuel = openmc.Material(name='Fuel') fuel.set_density('g/cm3', 10.29769) - fuel.add_nuclide("U234", 4.4843e-6) - fuel.add_nuclide("U235", 5.5815e-4) - fuel.add_nuclide("U238", 2.2408e-2) - fuel.add_nuclide("O16", 4.5829e-2) + fuel.add_nuclide('U234', 4.4843e-6) + fuel.add_nuclide('U235', 5.5815e-4) + fuel.add_nuclide('U238', 2.2408e-2) + fuel.add_nuclide('O16', 4.5829e-2) clad = openmc.Material(name='Cladding') clad.set_density('g/cm3', 6.55) - clad.add_nuclide("Zr90", 2.1827e-2) - clad.add_nuclide("Zr91", 4.7600e-3) - clad.add_nuclide("Zr92", 7.2758e-3) - clad.add_nuclide("Zr94", 7.3734e-3) - clad.add_nuclide("Zr96", 1.1879e-3) + clad.add_nuclide('Zr90', 2.1827e-2) + clad.add_nuclide('Zr91', 4.7600e-3) + clad.add_nuclide('Zr92', 7.2758e-3) + clad.add_nuclide('Zr94', 7.3734e-3) + clad.add_nuclide('Zr96', 1.1879e-3) hot_water = openmc.Material(name='Hot borated water') hot_water.set_density('g/cm3', 0.740582) - hot_water.add_nuclide("H1", 4.9457e-2) - hot_water.add_nuclide("O16", 2.4672e-2) - hot_water.add_nuclide("B10", 8.0042e-6) - hot_water.add_nuclide("B11", 3.2218e-5) + hot_water.add_nuclide('H1', 4.9457e-2) + hot_water.add_nuclide('O16', 2.4672e-2) + hot_water.add_nuclide('B10', 8.0042e-6) + hot_water.add_nuclide('B11', 3.2218e-5) hot_water.add_s_alpha_beta('c_H_in_H2O') # Define the materials file. @@ -619,7 +619,7 @@ def slab_mg(num_regions=1, mat_names=None, mgxslib_name='2g.h5'): # # Make Settings # Instantiate a Settings object, set all runtime parameters settings_file = openmc.Settings() - settings_file.energy_mode = "multi-group" + settings_file.energy_mode = 'multi-group' settings_file.tabular_legendre = {'enable': False} settings_file.batches = 10 settings_file.inactive = 5 diff --git a/openmc/lattice.py b/openmc/lattice.py index 3377e709e..71176c8ba 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -3,7 +3,7 @@ from collections import OrderedDict from collections.abc import Iterable from copy import deepcopy from math import sqrt, floor -from numbers import Real, Integral +from numbers import Real from xml.etree import ElementTree as ET import numpy as np @@ -242,7 +242,7 @@ class Lattice(IDManagerMixin, metaclass=ABCMeta): for i in range(r): uarray[-1][-1].append(universe_ids[z, y, a]) a -= 1 - y +=1 + y += 1 # Climb up the top-left. for i in range(r): @@ -352,7 +352,7 @@ class Lattice(IDManagerMixin, metaclass=ABCMeta): unique_universes = self.get_unique_universes() - for universe_id, universe in unique_universes.items(): + for universe in unique_universes.values(): cells.update(universe.get_all_cells(memo)) return cells @@ -372,7 +372,7 @@ class Lattice(IDManagerMixin, metaclass=ABCMeta): # Append all Cells in each Cell in the Universe to the dictionary cells = self.get_all_cells(memo) - for cell_id, cell in cells.items(): + for cell in cells.values(): materials.update(cell.get_all_materials(memo)) return materials @@ -399,7 +399,7 @@ class Lattice(IDManagerMixin, metaclass=ABCMeta): all_universes.update(unique_universes) # Append all Universes containing each cell to the dictionary - for universe_id, universe in unique_universes.items(): + for universe in unique_universes.values(): all_universes.update(universe.get_all_universes()) return all_universes diff --git a/openmc/mgxs/mdgxs.py b/openmc/mgxs/mdgxs.py index 2d1e75e81..75a2e6791 100644 --- a/openmc/mgxs/mdgxs.py +++ b/openmc/mgxs/mdgxs.py @@ -984,7 +984,7 @@ class ChiDelayed(MDGXS): is None unless the multi-group cross section has been computed. num_subdomains : int The number of subdomains is unity for 'material', 'cell' and 'universe' - domain types. When the This is equal to the number of cell instances + domain types. This is equal to the number of cell instances for 'distribcell' domain types (it is equal to unity prior to loading tally data from a statepoint file). num_nuclides : int @@ -1496,7 +1496,7 @@ class DelayedNuFissionXS(MDGXS): is None unless the multi-group cross section has been computed. num_subdomains : int The number of subdomains is unity for 'material', 'cell' and 'universe' - domain types. When the This is equal to the number of cell instances + domain types. This is equal to the number of cell instances for 'distribcell' domain types (it is equal to unity prior to loading tally data from a statepoint file). num_nuclides : int @@ -1632,7 +1632,7 @@ class Beta(MDGXS): is None unless the multi-group cross section has been computed. num_subdomains : int The number of subdomains is unity for 'material', 'cell' and 'universe' - domain types. When the This is equal to the number of cell instances + domain types. This is equal to the number of cell instances for 'distribcell' domain types (it is equal to unity prior to loading tally data from a statepoint file). num_nuclides : int @@ -1817,7 +1817,7 @@ class DecayRate(MDGXS): is None unless the multi-group cross section has been computed. num_subdomains : int The number of subdomains is unity for 'material', 'cell' and 'universe' - domain types. When the This is equal to the number of cell instances + domain types. This is equal to the number of cell instances for 'distribcell' domain types (it is equal to unity prior to loading tally data from a statepoint file). num_nuclides : int @@ -2585,7 +2585,7 @@ class DelayedNuFissionMatrixXS(MatrixMDGXS): is None unless the multi-group cross section has been computed. num_subdomains : int The number of subdomains is unity for 'material', 'cell' and 'universe' - domain types. When the This is equal to the number of cell instances + domain types. This is equal to the number of cell instances for 'distribcell' domain types (it is equal to unity prior to loading tally data from a statepoint file). num_nuclides : int diff --git a/openmc/plots.py b/openmc/plots.py index 10d773868..51054549f 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -467,7 +467,7 @@ class Plot(IDManagerMixin): Parameters ---------- geometry : openmc.Geometry - The geometry the base the plot off of + The geometry to base the plot off of basis : {'xy', 'xz', 'yz'} The basis directions for the plot slice_coord : float diff --git a/openmc/plotter.py b/openmc/plotter.py index 597a87750..af317dfdf 100644 --- a/openmc/plotter.py +++ b/openmc/plotter.py @@ -12,7 +12,7 @@ PLOT_TYPES = ['total', 'scatter', 'elastic', 'inelastic', 'fission', 'absorption', 'capture', 'nu-fission', 'nu-scatter', 'unity', 'slowing-down power', 'damage'] -# Supported keywoards for multi-group cross section plotting +# Supported keywords for multi-group cross section plotting PLOT_TYPES_MGXS = ['total', 'absorption', 'scatter', 'fission', 'kappa-fission', 'nu-fission', 'prompt-nu-fission', 'deleyed-nu-fission', 'chi', 'chi-prompt', 'chi-delayed', @@ -245,7 +245,7 @@ def calculate_cexs(this, data_type, types, temperature=294., sab_name=None, ---------- this : {str, openmc.Nuclide, openmc.Element, openmc.Material} Object to source data from - data_type : {'nuclide', 'element', material'} + data_type : {'nuclide', 'element', 'material'} Type of object to plot types : Iterable of values of PLOT_TYPES The type of cross sections to calculate @@ -619,7 +619,7 @@ def calculate_mgxs(this, data_type, types, orders=None, temperature=294., ---------- this : str or openmc.Material Object to source data from - data_type : {'nuclide', 'element', material', 'macroscopic'} + data_type : {'nuclide', 'element', 'material', 'macroscopic'} Type of object to plot types : Iterable of values of PLOT_TYPES_MGXS The type of cross sections to calculate diff --git a/openmc/tallies.py b/openmc/tallies.py index 18c359c46..3c3877e61 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -674,7 +674,7 @@ class Tally(IDManagerMixin): if equal_filters and equal_nuclides and equal_scores: return True - # Variables to indicate matching filter bins, nuclides and scores + # Variables to indicate filter bins, nuclides, and scores that can be merged merge_filters = self._can_merge_filters(other) merge_nuclides = self._can_merge_nuclides(other) merge_scores = self._can_merge_scores(other) diff --git a/openmc/universe.py b/openmc/universe.py index cbcba72c4..b64a87785 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -363,8 +363,7 @@ class Universe(IDManagerMixin): raise TypeError(msg) # If the Cell is in the Universe's list of Cells, delete it - if cell.id in self._cells: - del self._cells[cell.id] + self._cells.pop(cell.id, None) def clear_cells(self): """Remove all cells from the universe.""" diff --git a/scripts/casl_chain.py b/scripts/casl_chain.py index 94fc9dd96..2edc1b6d9 100755 --- a/scripts/casl_chain.py +++ b/scripts/casl_chain.py @@ -3,10 +3,10 @@ # for the VERA Depletion Benchmark Suite", CASL-U-2015-1014-000, Rev. 0, # ORNL/TM-2016/53, 2016. # -# Note 32 of the 255 nuclides appeare twice as they are both activation +# Note 32 of the 255 nuclides appear twice as they are both activation # nuclides (category 1) and fission product nuclides (category 3). -# Te129 has been added due to it's link to I129 production. +# Te129 has been added due to its link to I129 production. CASL_CHAIN = { # Nuclide: (Stable, CAT, IFPY, Special yield treatment) diff --git a/scripts/openmc-ace-to-hdf5 b/scripts/openmc-ace-to-hdf5 index 1933a6e4a..9953efa8c 100755 --- a/scripts/openmc-ace-to-hdf5 +++ b/scripts/openmc-ace-to-hdf5 @@ -191,7 +191,7 @@ for filename in ace_libraries: thermal = openmc.data.ThermalScattering.from_hdf5( nuclides[name]) print('Converting {} (ACE) to {} (HDF5)' - .format(table.name,thermal.name)) + .format(table.name, thermal.name)) thermal.add_temperature_from_ace(table) thermal.export_to_hdf5(nuclides[name] + '_1', 'w', libver=args.libver) diff --git a/scripts/openmc-get-photon-data b/scripts/openmc-get-photon-data index 39e44b177..84660896e 100755 --- a/scripts/openmc-get-photon-data +++ b/scripts/openmc-get-photon-data @@ -29,7 +29,7 @@ parser.add_argument('-c', '--cross-sections', help='cross_sections.xml file to append libraries to') args = parser.parse_args() -base_url = 'http://www.nndc.bnl.gov/endf/b7.1/zips/' +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 @@ -63,7 +63,8 @@ for f in files: with open(f, 'wb') as fh: while True: chunk = req.read(block_size) - if not chunk: break + if not chunk: + break fh.write(chunk) downloaded += len(chunk) status = '{0:10} [{1:3.2f}%]'.format( diff --git a/scripts/openmc-make-compton b/scripts/openmc-make-compton index c4bd5b06b..e2344e5a3 100755 --- a/scripts/openmc-make-compton +++ b/scripts/openmc-make-compton @@ -40,7 +40,8 @@ if download: with open(filename, 'wb') as fh: while True: chunk = req.read(block_size) - if not chunk: break + if not chunk: + break fh.write(chunk) downloaded += len(chunk) status = '{0:10} [{1:3.2f}%]'.format( diff --git a/scripts/openmc-make-depletion-chain b/scripts/openmc-make-depletion-chain index 51092a722..01f009a2a 100755 --- a/scripts/openmc-make-depletion-chain +++ b/scripts/openmc-make-depletion-chain @@ -9,9 +9,9 @@ import openmc.deplete URLS = [ - 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-neutrons.zip', - 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-decay.zip', - 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-nfy.zip' + 'https://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-neutrons.zip', + 'https://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-decay.zip', + 'https://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-nfy.zip' ] def main(): diff --git a/scripts/openmc-make-depletion-chain-casl b/scripts/openmc-make-depletion-chain-casl index 7fdeed072..4236916f7 100755 --- a/scripts/openmc-make-depletion-chain-casl +++ b/scripts/openmc-make-depletion-chain-casl @@ -24,9 +24,9 @@ from openmc._utils import download from casl_chain import CASL_CHAIN URLS = [ - 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-neutrons.zip', - 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-decay.zip', - 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-nfy.zip' + 'https://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-neutrons.zip', + 'https://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-decay.zip', + 'https://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-nfy.zip' ] def main(): diff --git a/scripts/openmc-make-test-data b/scripts/openmc-make-test-data index a37a78fa9..1d376f817 100755 --- a/scripts/openmc-make-test-data +++ b/scripts/openmc-make-test-data @@ -18,8 +18,8 @@ import zipfile import openmc.data from openmc._utils import download -base_ace = 'http://www.nndc.bnl.gov/endf/b7.1/aceFiles/' -base_endf = 'http://www.nndc.bnl.gov/endf/b7.1/zips/' +base_ace = 'https://www.nndc.bnl.gov/endf/b7.1/aceFiles/' +base_endf = 'https://www.nndc.bnl.gov/endf/b7.1/zips/' base_wmp = 'https://github.com/mit-crpg/WMP_Library/releases/download/v1.1/' files = [ (base_ace, 'ENDF-B-VII.1-neutron-293.6K.tar.gz', '9729a17eb62b75f285d8a7628ace1449'), diff --git a/scripts/openmc-plot-mesh-tally b/scripts/openmc-plot-mesh-tally index b4ce92587..6fa3c84f7 100755 --- a/scripts/openmc-plot-mesh-tally +++ b/scripts/openmc-plot-mesh-tally @@ -26,10 +26,15 @@ class MeshPlotter(tk.Frame): def __init__(self, parent, filename): tk.Frame.__init__(self, parent) - self.labels = {'Cell': 'Cell:', 'Cellborn': 'Cell born:', - 'Surface': 'Surface:', 'Material': 'Material:', - 'Universe': 'Universe:', 'Energy': 'Energy in:', - 'Energyout': 'Energy out:'} + self.labels = { + 'Cell': 'Cell:', + 'Cellborn': 'Cell born:', + 'Surface': 'Surface:', + 'Material': 'Material:', + 'Universe': 'Universe:', + 'Energy': 'Energy in:', + 'Energyout': 'Energy out:' + } self.filterBoxes = {} diff --git a/scripts/openmc-update-inputs b/scripts/openmc-update-inputs index 3b4e9a359..c47f888c8 100755 --- a/scripts/openmc-update-inputs +++ b/scripts/openmc-update-inputs @@ -243,8 +243,7 @@ def update_materials(root): for material in root.findall('material'): for nuclide in material.findall('nuclide'): if 'name' in nuclide.attrib: - nucname = nuclide.attrib['name'] - nucname = nucname.replace('-', '') + nucname = nuclide.attrib['name'].replace('-', '') # If a nuclide name is in the ZAID notation (e.g., a number), # convert it to the proper nuclide name. if nucname.strip().isnumeric(): diff --git a/scripts/openmc-update-mgxs b/scripts/openmc-update-mgxs index 8559affb9..f78a5dc69 100755 --- a/scripts/openmc-update-mgxs +++ b/scripts/openmc-update-mgxs @@ -44,11 +44,10 @@ def get_data(element, entry): value = element.find(entry) if value is not None: value = value.text.strip() + elif entry in element.attrib: + value = element.attrib[entry].strip() else: - if entry in element.attrib: - value = element.attrib[entry].strip() - else: - value = None + value = None return value diff --git a/src/cross_sections.cpp b/src/cross_sections.cpp index 6245bca9f..dca57b451 100644 --- a/src/cross_sections.cpp +++ b/src/cross_sections.cpp @@ -131,7 +131,7 @@ void read_cross_sections_xml() "materials.xml or in the OPENMC_CROSS_SECTIONS" " environment variable. OpenMC needs such a file to identify " "where to find data libraries. Please consult the" - " user's guide at https://openmc.readthedocs.io for " + " user's guide at https://docs.openmc.org/ for " "information on how to set up data libraries."); } settings::path_cross_sections = envvar; diff --git a/src/distribution_energy.cpp b/src/distribution_energy.cpp index 82754faf8..5d08cc4d2 100644 --- a/src/distribution_energy.cpp +++ b/src/distribution_energy.cpp @@ -191,8 +191,8 @@ double ContinuousTabular::sample(double E, uint64_t* seed) const double E_i1_1 = distribution_[i+1].e_out[n_discrete]; double E_i1_K = distribution_[i+1].e_out[n_energy_out - 1]; - double E_1 = E_i_1 + r*(E_i1_1 - E_i_1); - double E_K = E_i_K + r*(E_i1_K - E_i_K); + double E_1 = E_i_1 + r * (E_i1_1 - E_i_1); + double E_K = E_i_K + r * (E_i1_K - E_i_K); // Determine outgoing energy bin n_energy_out = distribution_[l].e_out.size(); @@ -317,7 +317,7 @@ double Evaporation::sample(double E, uint64_t* seed) const if (x <= y) break; } - return x*theta; + return x * theta; } //============================================================================== diff --git a/src/geometry.cpp b/src/geometry.cpp index 556d10650..88b48c866 100644 --- a/src/geometry.cpp +++ b/src/geometry.cpp @@ -492,5 +492,4 @@ extern "C" int openmc_global_bounding_box(double* llc, double* urc) { return 0; } - } // namespace openmc diff --git a/src/output.cpp b/src/output.cpp index 899bce86e..a388b15d7 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -660,16 +660,16 @@ write_tallies() const auto& deriv {model::tally_derivs[tally.deriv_]}; switch (deriv.variable) { case DIFF_DENSITY: - tallies_out << " Density derivative Material " + tallies_out << " Density derivative Material " << std::to_string(deriv.diff_material) << "\n"; break; case DIFF_NUCLIDE_DENSITY: - tallies_out << " Nuclide density derivative Material " + tallies_out << " Nuclide density derivative Material " << std::to_string(deriv.diff_material) << " Nuclide " << data::nuclides[deriv.diff_nuclide]->name_ << "\n"; break; case DIFF_TEMPERATURE: - tallies_out << " Temperature derivative Material " + tallies_out << " Temperature derivative Material " << std::to_string(deriv.diff_material) << "\n"; break; default: diff --git a/src/particle.cpp b/src/particle.cpp index 5f6baaf57..25f595082 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -76,7 +76,7 @@ Particle::Particle() void Particle::clear() { - // reset any coordinate levels + // Reset any coordinate levels for (auto& level : coord_) level.reset(); n_coord_ = 1; } @@ -99,7 +99,7 @@ Particle::create_secondary(Direction u, double E, Type type) void Particle::from_source(const Bank* src) { - // reset some attributes + // Reset some attributes this->clear(); alive_ = true; surface_ = 0; @@ -108,7 +108,7 @@ Particle::from_source(const Bank* src) n_collision_ = 0; fission_ = false; - // copy attributes from source bank site + // Copy attributes from source bank site type_ = src->particle; wgt_ = src->wgt; wgt_last_ = src->wgt; @@ -183,7 +183,7 @@ Particle::transport() return; } - // set birth cell attribute + // Set birth cell attribute if (cell_born_ == C_NONE) cell_born_ = coord_[n_coord_ - 1].cell; } diff --git a/src/tallies/derivative.cpp b/src/tallies/derivative.cpp index 290d09384..f6f10cf7a 100644 --- a/src/tallies/derivative.cpp +++ b/src/tallies/derivative.cpp @@ -617,6 +617,7 @@ void score_collision_derivative(const Particle* p) { // A void material cannot be perturbed so it will not affect flux derivatives. if (p->material_ == MATERIAL_VOID) return; + const Material& material {*model::materials[p->material_]}; for (auto& deriv : model::tally_derivs) { diff --git a/src/tallies/filter_cell.cpp b/src/tallies/filter_cell.cpp index 7cc007756..9e08c0c21 100644 --- a/src/tallies/filter_cell.cpp +++ b/src/tallies/filter_cell.cpp @@ -12,7 +12,7 @@ namespace openmc { void CellFilter::from_xml(pugi::xml_node node) { - // Get cell IDs and convert into indices into the global cells vector + // Get cell IDs and convert to indices into the global cells vector auto cells = get_node_array(node, "bins"); for (auto& c : cells) { auto search = model::cell_map.find(c); diff --git a/src/tallies/tally_scoring.cpp b/src/tallies/tally_scoring.cpp index 7ca279966..51eae2620 100644 --- a/src/tallies/tally_scoring.cpp +++ b/src/tallies/tally_scoring.cpp @@ -248,12 +248,15 @@ double get_nuclide_neutron_heating(const Particle* p, const Nuclide& nuc, { size_t mt = nuc.reaction_index_[rxn_index]; if (mt == C_NONE) return 0.0; + auto i_temp = p->neutron_xs_[i_nuclide].index_temp; if (i_temp < 0) return 0.0; // Can be true due to multipole + const auto& rxn {*nuc.reactions_[mt]}; const auto& xs {rxn.xs_[i_temp]}; auto i_grid = p->neutron_xs_[i_nuclide].index_grid; if (i_grid < xs.threshold) return 0.0; + auto f = p->neutron_xs_[i_nuclide].interp_factor; return (1.0 - f) * xs.value[i_grid-xs.threshold] + f * xs.value[i_grid-xs.threshold+1]; @@ -1316,7 +1319,7 @@ score_general_ce(Particle* p, int i_tally, int start_index, } } - // Add derivative information on score for differnetial tallies. + // Add derivative information on score for differential tallies. if (tally.deriv_ != C_NONE) apply_derivative_to_score(p, i_tally, i_nuclide, atom_density, score_bin, score); diff --git a/tools/ci/travis-install.py b/tools/ci/travis-install.py index 9a9b06dae..a2b1b6175 100644 --- a/tools/ci/travis-install.py +++ b/tools/ci/travis-install.py @@ -63,7 +63,6 @@ def main(): omp = (os.environ.get('OMP') == 'y') mpi = (os.environ.get('MPI') == 'y') phdf5 = (os.environ.get('PHDF5') == 'y') - dagmc = (os.environ.get('DAGMC') == 'y') # Build and install