diff --git a/openmc/cmfd.py b/openmc/cmfd.py index 85550c4951..d45396f141 100644 --- a/openmc/cmfd.py +++ b/openmc/cmfd.py @@ -1074,13 +1074,12 @@ class CMFDRun: # Get acceleration map, otherwise set all regions to be accelerated if self._mesh.map is not None: check_length('CMFD coremap', self._mesh.map, - np.product(self._indices[0:3])) + np.prod(self._indices[:3])) if openmc.lib.master(): self._coremap = np.array(self._mesh.map) else: if openmc.lib.master(): - self._coremap = np.ones((np.product(self._indices[0:3])), - dtype=int) + self._coremap = np.ones(np.prod(self._indices[:3]), dtype=int) # Check CMFD tallies accummulated before feedback turned on if self._feedback and self._solver_begin < self._tally_begin: @@ -1434,7 +1433,7 @@ class CMFDRun: # nfissxs # Calculate volume - vol = np.product(self._hxyz, axis=3) + vol = np.prod(self._hxyz, axis=3) # Reshape phi by number of groups phi = self._phi.reshape((n, ng)) diff --git a/openmc/model/model.py b/openmc/model/model.py index db0b05e15d..2b5681d811 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -263,10 +263,10 @@ class Model: model.materials = openmc.Materials.from_xml_element(root.find('materials')) model.geometry = openmc.Geometry.from_xml_element(root.find('geometry'), model.materials) - if root.find('tallies'): + if root.find('tallies') is not None: model.tallies = openmc.Tallies.from_xml_element(root.find('tallies'), meshes) - if root.find('plots'): + if root.find('plots') is not None: model.plots = openmc.Plots.from_xml_element(root.find('plots')) return model @@ -575,10 +575,15 @@ class Model: cell_id = int(name.split()[1]) cell = cells[cell_id] if cell.fill_type in ('material', 'distribmat'): - cell.temperature = group['temperature'][()] + temperature = group['temperature'][()] + cell.temperature = temperature if self.is_initialized: lib_cell = openmc.lib.cells[cell_id] - lib_cell.set_temperature(group['temperature'][()]) + if temperature.size > 1: + for i, T in enumerate(temperature): + lib_cell.set_temperature(T, i) + else: + lib_cell.set_temperature(temperature[0]) # Make sure number of materials matches mats_group = fh['materials'] diff --git a/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_feed.h5 b/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_feed.h5 index ae1c7e4230..4f270afab0 100644 Binary files a/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_feed.h5 and b/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_feed.h5 differ diff --git a/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_removal.h5 b/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_removal.h5 index 8b60044ad4..5ee1d696d3 100644 Binary files a/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_removal.h5 and b/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_removal.h5 differ diff --git a/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_transfer.h5 b/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_transfer.h5 index 11092aca6e..791447253c 100644 Binary files a/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_transfer.h5 and b/tests/regression_tests/deplete_with_transfer_rates/ref_depletion_with_transfer.h5 differ diff --git a/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_only_feed.h5 b/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_only_feed.h5 index 7194ca78a2..e7ea655543 100644 Binary files a/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_only_feed.h5 and b/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_only_feed.h5 differ diff --git a/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_only_removal.h5 b/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_only_removal.h5 index 535f5d1438..7a3b95c812 100644 Binary files a/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_only_removal.h5 and b/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_only_removal.h5 differ diff --git a/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_with_transfer.h5 b/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_with_transfer.h5 index 73f290aab6..7d68d1d5f8 100644 Binary files a/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_with_transfer.h5 and b/tests/regression_tests/deplete_with_transfer_rates/ref_no_depletion_with_transfer.h5 differ diff --git a/tests/regression_tests/deplete_with_transfer_rates/test.py b/tests/regression_tests/deplete_with_transfer_rates/test.py index 99f35a95bd..d6d58bbc03 100644 --- a/tests/regression_tests/deplete_with_transfer_rates/test.py +++ b/tests/regression_tests/deplete_with_transfer_rates/test.py @@ -2,6 +2,7 @@ from pathlib import Path import shutil +import sys import numpy as np import pytest @@ -45,6 +46,7 @@ def model(): return openmc.Model(geometry, materials, settings) +@pytest.mark.skipif(sys.version_info < (3, 9), reason="Requires Python 3.9+") @pytest.mark.parametrize("rate, dest_mat, power, ref_result", [ (1e-5, None, 0.0, 'no_depletion_only_removal'), (-1e-5, None, 0.0, 'no_depletion_only_feed'), diff --git a/tests/testing_harness.py b/tests/testing_harness.py index f0edf4ea44..40c9d37d80 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -181,7 +181,7 @@ class CMFDTestHarness(TestHarness): outstr += '\ncmfd openmc source comparison\n' outstr += '\n'.join(['{:.6E}'.format(x) for x in cmfd_run.src_cmp]) outstr += '\ncmfd source\n' - cmfdsrc = np.reshape(cmfd_run.cmfd_src, np.product(cmfd_run.indices), + cmfdsrc = np.reshape(cmfd_run.cmfd_src, np.prod(cmfd_run.indices), order='F') outstr += '\n'.join(['{:.6E}'.format(x) for x in cmfdsrc]) outstr += '\n'