diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 4c2497173e..62dde28ab2 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -34,7 +34,7 @@ class Library(object): Parameters ---------- openmc_geometry : openmc.Geometry - An geometry which has been initialized with a root universe + A geometry which has been initialized with a root universe by_nuclide : bool If true, computes cross sections for each nuclide in each domain mgxs_types : Iterable of str diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index b79780ffc2..829f881113 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -3680,7 +3680,7 @@ class MultiplicityMatrixXS(MatrixMGXS): groups=None, by_nuclide=False, name=''): super(MultiplicityMatrixXS, self).__init__(domain, domain_type, groups, by_nuclide, name) - self._rxn_type = 'multiplicity' + self._rxn_type = 'multiplicity matrix' @property def scores(self): diff --git a/src/mgxs_header.F90 b/src/mgxs_header.F90 index 88c1b23e25..750a8df983 100644 --- a/src/mgxs_header.F90 +++ b/src/mgxs_header.F90 @@ -1485,8 +1485,13 @@ module mgxs_header nuc % scatter % energy(gin) % data(gout) mult_num(gout, gin) = mult_num(gout, gin) + atom_density * & nuscatt - mult_denom(gout, gin) = mult_denom(gout,gin) + atom_density * & - nuscatt / nuc % scatter % mult(gin) % data(gout) + if (nuc % scatter % mult(gin) % data(gout) > ZERO) then + mult_denom(gout, gin) = mult_denom(gout,gin) + atom_density * & + nuscatt / nuc % scatter % mult(gin) % data(gout) + else + ! Avoid division by zero + mult_denom(gout, gin) = mult_denom(gout,gin) + atom_density + end if end do end do @@ -1722,10 +1727,16 @@ module mgxs_header nuc % scatter(iazi, ipol) % obj % energy(gin) % data(gout) mult_num(gout, gin, iazi, ipol) = mult_num(gout, gin, iazi, ipol) + & atom_density * nuscatt - mult_denom(gout, gin, iazi, ipol) = & - mult_denom(gout, gin, iazi, ipol) + & - atom_density * nuscatt / & - nuc % scatter(iazi, ipol) % obj % mult(gin) % data(gout) + if (nuc % scatter(iazi, ipol) % obj % mult(gin) % data(gout) > ZERO) then + mult_denom(gout, gin, iazi, ipol) = & + mult_denom(gout, gin, iazi, ipol) + & + atom_density * nuscatt / & + nuc % scatter(iazi, ipol) % obj % mult(gin) % data(gout) + else + ! Avoid division by zero + mult_denom(gout, gin, iazi, ipol) = & + mult_denom(gout,gin, iazi, ipol) + atom_density + end if end do end do end do diff --git a/tests/input_set.py b/tests/input_set.py index 2c6841e254..ae3ee23010 100644 --- a/tests/input_set.py +++ b/tests/input_set.py @@ -15,8 +15,10 @@ class InputSet(object): self.settings.export_to_xml() self.materials.export_to_xml() self.geometry.export_to_xml() - if self.tallies is not None: self.tallies.export_to_xml() - if self.plots is not None: self.plots.export_to_xml() + if self.tallies is not None: + self.tallies.export_to_xml() + if self.plots is not None: + self.plots.export_to_xml() def build_default_materials_and_geometry(self): # Define materials. @@ -82,7 +84,7 @@ class InputSet(object): hot_water.add_s_alpha_beta('HH2O', '71t') rpv_steel = openmc.Material(name='Reactor pressure vessel steel', - material_id=5) + material_id=5) rpv_steel.set_density('g/cm3', 7.9) rpv_steel.add_nuclide("Fe-54", 0.05437098, 'wo') rpv_steel.add_nuclide("Fe-56", 0.88500663, 'wo') @@ -113,7 +115,7 @@ class InputSet(object): rpv_steel.add_nuclide("Cu-65", 0.0006304, 'wo') lower_rad_ref = openmc.Material(name='Lower radial reflector', - material_id=6) + material_id=6) lower_rad_ref.set_density('g/cm3', 4.32) lower_rad_ref.add_nuclide("H-1", 0.0095661, 'wo') lower_rad_ref.add_nuclide("O-16", 0.0759107, 'wo') @@ -189,7 +191,8 @@ class InputSet(object): bot_plate.add_nuclide("Cr-54", 0.004612692337, 'wo') bot_plate.add_s_alpha_beta('HH2O', '71t') - bot_nozzle = openmc.Material(name='Bottom nozzle region', material_id=9) + bot_nozzle = openmc.Material(name='Bottom nozzle region', + material_id=9) bot_nozzle.set_density('g/cm3', 2.53) bot_nozzle.add_nuclide("H-1", 0.0245014, 'wo') bot_nozzle.add_nuclide("O-16", 0.1944274, 'wo') @@ -252,7 +255,8 @@ class InputSet(object): top_fa.add_nuclide("Zr-96", 0.02511169542, 'wo') top_fa.add_s_alpha_beta('HH2O', '71t') - bot_fa = openmc.Material(name='Bottom of fuel assemblies', material_id=12) + bot_fa = openmc.Material(name='Bottom of fuel assemblies', + material_id=12) bot_fa.set_density('g/cm3', 1.762) bot_fa.add_nuclide("H-1", 0.0292856, 'wo') bot_fa.add_nuclide("O-16", 0.2323919, 'wo') @@ -570,6 +574,109 @@ class InputSet(object): self.plots.add_plot(plot) + +class PinCellInputSet(object): + def __init__(self): + self.settings = openmc.Settings() + self.materials = openmc.Materials() + self.geometry = openmc.Geometry() + self.tallies = None + self.plots = None + + def export(self): + self.settings.export_to_xml() + self.materials.export_to_xml() + self.geometry.export_to_xml() + if self.tallies is not None: + self.tallies.export_to_xml() + if self.plots is not None: + self.plots.export_to_xml() + + def build_default_materials_and_geometry(self): + # Define materials. + fuel = openmc.Material(name='Fuel') + fuel.set_density('g/cm3', 10.29769) + fuel.add_nuclide("U-234", 4.4843e-6) + fuel.add_nuclide("U-235", 5.5815e-4) + fuel.add_nuclide("U-238", 2.2408e-2) + fuel.add_nuclide("O-16", 4.5829e-2) + + clad = openmc.Material(name='Cladding') + clad.set_density('g/cm3', 6.55) + clad.add_nuclide("Zr-90", 2.1827e-2) + clad.add_nuclide("Zr-91", 4.7600e-3) + clad.add_nuclide("Zr-92", 7.2758e-3) + clad.add_nuclide("Zr-94", 7.3734e-3) + clad.add_nuclide("Zr-96", 1.1879e-3) + + hot_water = openmc.Material(name='Hot borated water') + hot_water.set_density('g/cm3', 0.740582) + hot_water.add_nuclide("H-1", 4.9457e-2) + hot_water.add_nuclide("O-16", 2.4672e-2) + hot_water.add_nuclide("B-10", 8.0042e-6) + hot_water.add_nuclide("B-11", 3.2218e-5) + hot_water.add_s_alpha_beta('HH2O', '71t') + + # Define the materials file. + self.materials.default_xs = '71c' + self.materials += (fuel, clad, hot_water) + + # Instantiate ZCylinder surfaces + fuel_or = openmc.ZCylinder(x0=0, y0=0, R=0.39218, name='Fuel OR') + clad_or = openmc.ZCylinder(x0=0, y0=0, R=0.45720, name='Clad OR') + left = openmc.XPlane(x0=-0.63, name='left') + right = openmc.XPlane(x0=0.63, name='right') + bottom = openmc.YPlane(y0=-0.63, name='bottom') + top = openmc.YPlane(y0=0.63, name='top') + + left.boundary_type = 'reflective' + right.boundary_type = 'reflective' + top.boundary_type = 'reflective' + bottom.boundary_type = 'reflective' + + # Instantiate Cells + fuel_pin = openmc.Cell(name='cell 1') + cladding = openmc.Cell(name='cell 3') + water = openmc.Cell(name='cell 2') + + # Use surface half-spaces to define regions + fuel_pin.region = -fuel_or + cladding.region = +fuel_or & -clad_or + water.region = +clad_or & +left & -right & +bottom & -top + + # Register Materials with Cells + fuel_pin.fill = fuel + cladding.fill = clad + water.fill = hot_water + + # Instantiate Universe + root = openmc.Universe(universe_id=0, name='root universe') + + # Register Cells with Universe + root.add_cells([fuel_pin, cladding, water]) + + # Instantiate a Geometry, register the root Universe, and export to XML + self.geometry.root_universe = root + + def build_default_settings(self): + self.settings.batches = 10 + self.settings.inactive = 5 + self.settings.particles = 100 + self.settings.source = Source(space=Box([-0.63, -0.63, -1], + [0.63, 0.63, 1], + only_fissionable=True)) + + def build_defualt_plots(self): + plot = openmc.Plot() + plot.filename = 'mat' + plot.origin = (0.0, 0.0, 0) + plot.width = (1.26, 1.26) + plot.pixels = (300, 300) + plot.color = 'mat' + + self.plots.add_plot(plot) + + class MGInputSet(InputSet): def build_default_materials_and_geometry(self): # Define materials needed for 1D/1G slab problem @@ -595,21 +702,21 @@ class MGInputSet(InputSet): # Define surfaces. # Assembly/Problem Boundary - left = openmc.XPlane(x0=0.0, surface_id=200, - boundary_type='reflective') - right = openmc.XPlane(x0=10.0, surface_id=201, - boundary_type='reflective') + left = openmc.XPlane(x0=0.0, surface_id=200, + boundary_type='reflective') + right = openmc.XPlane(x0=10.0, surface_id=201, + boundary_type='reflective') bottom = openmc.YPlane(y0=0.0, surface_id=300, boundary_type='reflective') - top = openmc.YPlane(y0=10.0, surface_id=301, - boundary_type='reflective') + top = openmc.YPlane(y0=10.0, surface_id=301, + boundary_type='reflective') - down = openmc.ZPlane(z0=0.0, surface_id=0, - boundary_type='reflective') + down = openmc.ZPlane(z0=0.0, surface_id=0, + boundary_type='reflective') fuel_clad_intfc = openmc.ZPlane(z0=2.0, surface_id=1) clad_lwtr_intfc = openmc.ZPlane(z0=2.4, surface_id=2) - up = openmc.ZPlane(z0=5.0, surface_id=3, - boundary_type='reflective') + up = openmc.ZPlane(z0=5.0, surface_id=3, + boundary_type='reflective') # Define cells c1 = openmc.Cell(cell_id=1) @@ -625,7 +732,7 @@ class MGInputSet(InputSet): # Define root universe. root = openmc.Universe(universe_id=0, name='root universe') - root.add_cells((c1,c2,c3)) + root.add_cells((c1, c2, c3)) # Assign root universe to geometry self.geometry.root_universe = root diff --git a/tests/test_mgxs_library_ce_to_mg/inputs_true.dat b/tests/test_mgxs_library_ce_to_mg/inputs_true.dat new file mode 100644 index 0000000000..9633a46a80 --- /dev/null +++ b/tests/test_mgxs_library_ce_to_mg/inputs_true.dat @@ -0,0 +1 @@ +34d5891f6f17c2d4b686b814ba61ba0045bc4289e278b1c3c47dbba59b83837fcfe15f2b8d58e7a2b07627b73d51e40348d70e9ed36dbb7cc94468d61c068c4c \ No newline at end of file diff --git a/tests/test_mgxs_library_ce_to_mg/results_true.dat b/tests/test_mgxs_library_ce_to_mg/results_true.dat new file mode 100644 index 0000000000..16441af8c7 --- /dev/null +++ b/tests/test_mgxs_library_ce_to_mg/results_true.dat @@ -0,0 +1,2 @@ +k-combined: +1.094839E+00 1.203524E-02 diff --git a/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py b/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py new file mode 100644 index 0000000000..0f7cba4a87 --- /dev/null +++ b/tests/test_mgxs_library_ce_to_mg/test_mgxs_library_ce_to_mg.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python + +import os +import sys +import glob +import hashlib +sys.path.insert(0, os.pardir) +from testing_harness import PyAPITestHarness +from input_set import PinCellInputSet +import openmc +import openmc.mgxs + + +class MGXSTestHarness(PyAPITestHarness): + def _build_inputs(self): + # Set the input set to use the pincell model + self._input_set = PinCellInputSet() + + # Generate inputs using parent class routine + super(MGXSTestHarness, self)._build_inputs() + + # Initialize a two-group structure + energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, + 20.]) + + # Initialize MGXS Library for a few cross section types + self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry) + self.mgxs_lib.by_nuclide = False + self.mgxs_lib.mgxs_types = ['total', 'absorption', 'nu-fission matrix', + 'nu-scatter matrix', 'multiplicity matrix'] + self.mgxs_lib.energy_groups = energy_groups + self.mgxs_lib.correction = None + self.mgxs_lib.legendre_order = 3 + self.mgxs_lib.domain_type = 'material' + self.mgxs_lib.build_library() + + # Initialize a tallies file + self._input_set.tallies = openmc.Tallies() + self.mgxs_lib.add_to_tallies_file(self._input_set.tallies, merge=False) + self._input_set.tallies.export_to_xml() + + def _run_openmc(self): + # Initial run + if self._opts.mpi_exec is not None: + returncode = openmc.run(mpi_procs=self._opts.mpi_np, + openmc_exec=self._opts.exe, + mpi_exec=self._opts.mpi_exec) + + else: + returncode = openmc.run(openmc_exec=self._opts.exe) + + assert returncode == 0, 'CE OpenMC calculation did not exit' \ + 'successfully.' + + # Build MG Inputs + # Get data needed to execute Library calculations. + statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0] + sp = openmc.StatePoint(statepoint) + self.mgxs_lib.load_from_statepoint(sp) + self._input_set.mgxs_file, self._input_set.materials, \ + self._input_set.geometry = self.mgxs_lib.create_mg_mode() + + # Modify settings so we can run in MG mode + self._input_set.settings.cross_sections = './mgxs.xml' + self._input_set.settings.energy_mode = 'multi-group' + + # Write modified input files + self._input_set.settings.export_to_xml() + self._input_set.geometry.export_to_xml() + self._input_set.materials.export_to_xml() + self._input_set.mgxs_file.export_to_xml() + # Dont need tallies.xml, so remove the file + if os.path.exists('./tallies.xml'): + os.remove('./tallies.xml') + + # Re-run MG mode. + if self._opts.mpi_exec is not None: + returncode = openmc.run(mpi_procs=self._opts.mpi_np, + openmc_exec=self._opts.exe, + mpi_exec=self._opts.mpi_exec) + + else: + returncode = openmc.run(openmc_exec=self._opts.exe) + + def _cleanup(self): + super(MGXSTestHarness, self)._cleanup() + f = os.path.join(os.getcwd(), 'mgxs.xml') + if os.path.exists(f): + os.remove(f) + + +if __name__ == '__main__': + harness = MGXSTestHarness('statepoint.10.*', False) + harness.main() diff --git a/tests/test_mgxs_library_condense/inputs_true.dat b/tests/test_mgxs_library_condense/inputs_true.dat index 3643c9a2ef..79ca0ec660 100644 --- a/tests/test_mgxs_library_condense/inputs_true.dat +++ b/tests/test_mgxs_library_condense/inputs_true.dat @@ -1 +1 @@ -104e7fb527770ac5d3fc636da7716e8fb05d55761253d30516c899f466e6b38ffd881611a3d0cdf65c6af058c32f6f6758c68782be7a170d21024bdae751862f \ No newline at end of file +317a63a9dd3bfd84e969667b00f46018e56c04c356461a75103f63569e6b70c84d0da7f5e611faaf1b2631330b05ab4346223d3d843018ce0ce8876671a450c0 \ No newline at end of file diff --git a/tests/test_mgxs_library_condense/results_true.dat b/tests/test_mgxs_library_condense/results_true.dat index 184be68bfa..13c277b15f 100644 --- a/tests/test_mgxs_library_condense/results_true.dat +++ b/tests/test_mgxs_library_condense/results_true.dat @@ -1,85 +1,108 @@ material group in nuclide mean std. dev. -0 1 1 total 0.412084 0.02359 material group in nuclide mean std. dev. -0 1 1 total 0.076425 0.003691 material group in group out nuclide moment mean std. dev. -0 1 1 1 total P0 0.384780 0.022253 -1 1 1 1 total P1 0.039277 0.004308 -2 1 1 1 total P2 0.017574 0.002402 -3 1 1 1 total P3 0.012203 0.002164 material group out nuclide mean std. dev. -0 1 1 total 1.0 0.055333 material group in nuclide mean std. dev. -0 2 1 total 0.241262 0.00841 material group in nuclide mean std. dev. -0 2 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 2 1 1 total P0 0.272369 0.006872 -1 2 1 1 total P1 0.031107 0.005483 -2 2 1 1 total P2 0.025999 0.006151 -3 2 1 1 total P3 0.003219 0.003312 material group out nuclide mean std. dev. -0 2 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 3 1 total 0.400028 0.034667 material group in nuclide mean std. dev. -0 3 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 3 1 1 total P0 0.794999 0.036548 -1 3 1 1 total P1 0.401537 0.016175 -2 3 1 1 total P2 0.143623 0.008719 -3 3 1 1 total P3 0.001991 0.004433 material group out nuclide mean std. dev. -0 3 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 4 1 total 0.377402 0.072937 material group in nuclide mean std. dev. -0 4 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 4 1 1 total P0 0.727311 0.080096 -1 4 1 1 total P1 0.355839 0.037901 -2 4 1 1 total P2 0.124483 0.015823 -3 4 1 1 total P3 0.012168 0.006224 material group out nuclide mean std. dev. -0 4 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 5 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 5 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 5 1 1 total P0 0.0 0.0 -1 5 1 1 total P1 0.0 0.0 -2 5 1 1 total P2 0.0 0.0 -3 5 1 1 total P3 0.0 0.0 material group out nuclide mean std. dev. -0 5 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 6 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 6 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 6 1 1 total P0 0.0 0.0 -1 6 1 1 total P1 0.0 0.0 -2 6 1 1 total P2 0.0 0.0 -3 6 1 1 total P3 0.0 0.0 material group out nuclide mean std. dev. -0 6 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 7 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 7 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 7 1 1 total P0 0.0 0.0 -1 7 1 1 total P1 0.0 0.0 -2 7 1 1 total P2 0.0 0.0 -3 7 1 1 total P3 0.0 0.0 material group out nuclide mean std. dev. -0 7 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 8 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 8 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 8 1 1 total P0 0.0 0.0 -1 8 1 1 total P1 0.0 0.0 -2 8 1 1 total P2 0.0 0.0 -3 8 1 1 total P3 0.0 0.0 material group out nuclide mean std. dev. -0 8 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 9 1 total 0.600536 0.748875 material group in nuclide mean std. dev. -0 9 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 9 1 1 total P0 0.720380 0.771015 -1 9 1 1 total P1 0.119844 0.184691 -2 9 1 1 total P2 0.038522 0.064485 -3 9 1 1 total P3 0.056023 0.050595 material group out nuclide mean std. dev. -0 9 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 10 1 total 0.235515 0.613974 material group in nuclide mean std. dev. -0 10 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 10 1 1 total P0 0.501009 0.708534 -1 10 1 1 total P1 0.265494 0.375465 -2 10 1 1 total P2 0.141979 0.200788 -3 10 1 1 total P3 0.074258 0.105017 material group out nuclide mean std. dev. -0 10 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 11 1 total 0.510145 0.741941 material group in nuclide mean std. dev. -0 11 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 11 1 1 total P0 0.804661 0.817658 -1 11 1 1 total P1 0.312803 0.315315 -2 11 1 1 total P2 0.168113 0.172935 -3 11 1 1 total P3 0.003808 0.037911 material group out nuclide mean std. dev. -0 11 1 total 0.0 0.0 material group in nuclide mean std. dev. -0 12 1 total 0.73836 0.825631 material group in nuclide mean std. dev. -0 12 1 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -0 12 1 1 total P0 0.943429 0.856119 -1 12 1 1 total P1 0.220164 0.163180 -2 12 1 1 total P2 0.052884 0.042440 -3 12 1 1 total P3 0.039939 0.032867 material group out nuclide mean std. dev. -0 12 1 total 0.0 0.0 \ No newline at end of file +0 10000 1 total 0.453624 0.021053 + material group in nuclide mean std. dev. +0 10000 1 total 0.400852 0.022858 + material group in nuclide mean std. dev. +0 10000 1 total 0.400852 0.022858 + material group in nuclide mean std. dev. +0 10000 1 total 0.064903 0.004313 + material group in nuclide mean std. dev. +0 10000 1 total 0.028048 0.00458 + material group in nuclide mean std. dev. +0 10000 1 total 0.036855 0.002622 + material group in nuclide mean std. dev. +0 10000 1 total 0.090649 0.00641 + material group in nuclide mean std. dev. +0 10000 1 total 7.137955 0.507364 + material group in nuclide mean std. dev. +0 10000 1 total 0.388721 0.01783 + material group in nuclide mean std. dev. +0 10000 1 total 0.389304 0.023076 + material group in group out nuclide moment mean std. dev. +0 10000 1 1 total P0 0.389304 0.023146 +1 10000 1 1 total P1 0.046224 0.005907 +2 10000 1 1 total P2 0.017984 0.002883 +3 10000 1 1 total P3 0.006628 0.002457 + material group in group out nuclide moment mean std. dev. +0 10000 1 1 total P0 0.389304 0.023146 +1 10000 1 1 total P1 0.046224 0.005907 +2 10000 1 1 total P2 0.017984 0.002883 +3 10000 1 1 total P3 0.006628 0.002457 + material group in group out nuclide mean std. dev. +0 10000 1 1 total 1.0 0.066111 + material group in group out nuclide mean std. dev. +0 10000 1 1 total 0.085835 0.005592 + material group out nuclide mean std. dev. +0 10000 1 total 1.0 0.046071 + material group in nuclide mean std. dev. +0 10001 1 total 0.311594 0.013793 + material group in nuclide mean std. dev. +0 10001 1 total 0.279255 0.02919 + material group in nuclide mean std. dev. +0 10001 1 total 0.279255 0.02919 + material group in nuclide mean std. dev. +0 10001 1 total 0.00221 0.000286 + material group in nuclide mean std. dev. +0 10001 1 total 0.00221 0.000286 + material group in nuclide mean std. dev. +0 10001 1 total 0.0 0.0 + material group in nuclide mean std. dev. +0 10001 1 total 0.0 0.0 + material group in nuclide mean std. dev. +0 10001 1 total 0.0 0.0 + material group in nuclide mean std. dev. +0 10001 1 total 0.309384 0.013551 + material group in nuclide mean std. dev. +0 10001 1 total 0.307987 0.029308 + material group in group out nuclide moment mean std. dev. +0 10001 1 1 total P0 0.307987 0.029308 +1 10001 1 1 total P1 0.030617 0.007464 +2 10001 1 1 total P2 0.018911 0.004323 +3 10001 1 1 total P3 0.006235 0.003338 + material group in group out nuclide moment mean std. dev. +0 10001 1 1 total P0 0.307987 0.029308 +1 10001 1 1 total P1 0.030617 0.007464 +2 10001 1 1 total P2 0.018911 0.004323 +3 10001 1 1 total P3 0.006235 0.003338 + material group in group out nuclide mean std. dev. +0 10001 1 1 total 1.0 0.095039 + material group in group out nuclide mean std. dev. +0 10001 1 1 total 0.0 0.0 + material group out nuclide mean std. dev. +0 10001 1 total 0.0 0.0 + material group in nuclide mean std. dev. +0 10002 1 total 0.904999 0.043964 + material group in nuclide mean std. dev. +0 10002 1 total 0.499184 0.040914 + material group in nuclide mean std. dev. +0 10002 1 total 0.499184 0.040914 + material group in nuclide mean std. dev. +0 10002 1 total 0.00606 0.000555 + material group in nuclide mean std. dev. +0 10002 1 total 0.00606 0.000555 + material group in nuclide mean std. dev. +0 10002 1 total 0.0 0.0 + material group in nuclide mean std. dev. +0 10002 1 total 0.0 0.0 + material group in nuclide mean std. dev. +0 10002 1 total 0.0 0.0 + material group in nuclide mean std. dev. +0 10002 1 total 0.898938 0.043493 + material group in nuclide mean std. dev. +0 10002 1 total 0.903415 0.043959 + material group in group out nuclide moment mean std. dev. +0 10002 1 1 total P0 0.903415 0.043586 +1 10002 1 1 total P1 0.410417 0.015877 +2 10002 1 1 total P2 0.143301 0.007187 +3 10002 1 1 total P3 0.008739 0.003571 + material group in group out nuclide moment mean std. dev. +0 10002 1 1 total P0 0.903415 0.043586 +1 10002 1 1 total P1 0.410417 0.015877 +2 10002 1 1 total P2 0.143301 0.007187 +3 10002 1 1 total P3 0.008739 0.003571 + material group in group out nuclide mean std. dev. +0 10002 1 1 total 1.0 0.056867 + material group in group out nuclide mean std. dev. +0 10002 1 1 total 0.0 0.0 + material group out nuclide mean std. dev. +0 10002 1 total 0.0 0.0 diff --git a/tests/test_mgxs_library_condense/test_mgxs_library_condense.py b/tests/test_mgxs_library_condense/test_mgxs_library_condense.py index 561232b224..5571b59f2e 100644 --- a/tests/test_mgxs_library_condense/test_mgxs_library_condense.py +++ b/tests/test_mgxs_library_condense/test_mgxs_library_condense.py @@ -6,27 +6,28 @@ import glob import hashlib sys.path.insert(0, os.pardir) from testing_harness import PyAPITestHarness +from input_set import PinCellInputSet import openmc import openmc.mgxs class MGXSTestHarness(PyAPITestHarness): def _build_inputs(self): - - # The openmc.mgxs module needs a summary.h5 file - self._input_set.settings.output = {'summary': True} + # Set the input set to use the pincell model + self._input_set = PinCellInputSet() # Generate inputs using parent class routine super(MGXSTestHarness, self)._build_inputs() # Initialize a two-group structure - energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, 20.]) + energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, + 20.]) # Initialize MGXS Library for a few cross section types self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry) self.mgxs_lib.by_nuclide = False - self.mgxs_lib.mgxs_types = ['transport', 'nu-fission', - 'nu-scatter matrix', 'chi'] + # Test all MGXS types + self.mgxs_lib.mgxs_types = openmc.mgxs.MGXS_TYPES self.mgxs_lib.energy_groups = energy_groups self.mgxs_lib.legendre_order = 3 self.mgxs_lib.domain_type = 'material' @@ -57,7 +58,7 @@ class MGXSTestHarness(PyAPITestHarness): for mgxs_type in condense_lib.mgxs_types: mgxs = condense_lib.get_mgxs(domain, mgxs_type) df = mgxs.get_pandas_dataframe() - outstr += df.to_string() + outstr += df.to_string() + '\n' # Hash the results if necessary if hash_output: diff --git a/tests/test_mgxs_library_distribcell/inputs_true.dat b/tests/test_mgxs_library_distribcell/inputs_true.dat index 21927c8008..dc67b7c562 100644 --- a/tests/test_mgxs_library_distribcell/inputs_true.dat +++ b/tests/test_mgxs_library_distribcell/inputs_true.dat @@ -1 +1 @@ -018bbbc2099f7b94180b391e46e42fc9a82498c60b3f8f7f4c91480ea373427932d287fe571d53b2397f329e71485e7155d7644f0f995bbcb458ba3e872ab043 \ No newline at end of file +88849ac150f9c389e67de96356dfceb0bde08643f68ca25699e67d263995b95893d7340a2b08b2f0f5075fc5020f73553c5287ec6c56ace2f35ce0214961e123 \ No newline at end of file diff --git a/tests/test_mgxs_library_distribcell/results_true.dat b/tests/test_mgxs_library_distribcell/results_true.dat index fa55249d13..5000d60c3b 100644 --- a/tests/test_mgxs_library_distribcell/results_true.dat +++ b/tests/test_mgxs_library_distribcell/results_true.dat @@ -1,8 +1,36 @@ avg(distribcell) group in nuclide mean std. dev. -0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.718919 0.520644 avg(distribcell) group in nuclide mean std. dev. -0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.0 0.0 avg(distribcell) group in group out nuclide moment mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 1.145934 0.553822 + avg(distribcell) group in nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.718919 0.520644 + avg(distribcell) group in nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.718919 0.520644 + avg(distribcell) group in nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.019762 0.010629 + avg(distribcell) group in nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.019762 0.010629 + avg(distribcell) group in nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.0 0.0 + avg(distribcell) group in nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.0 0.0 + avg(distribcell) group in nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.0 0.0 + avg(distribcell) group in nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 1.126172 0.54344 + avg(distribcell) group in nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 1.142547 0.570131 + avg(distribcell) group in group out nuclide moment mean std. dev. 0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P0 1.142547 0.570131 1 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P1 0.447381 0.216322 2 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P2 0.141202 0.066504 -3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P3 0.039228 0.024621 avg(distribcell) group out nuclide mean std. dev. -0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.0 0.0 \ No newline at end of file +3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P3 0.039228 0.024621 + avg(distribcell) group in group out nuclide moment mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P0 1.142547 0.570131 +1 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P1 0.447381 0.216322 +2 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P2 0.141202 0.066504 +3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P3 0.039228 0.024621 + avg(distribcell) group in group out nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total 1.0 0.529717 + avg(distribcell) group in group out nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total 0.0 0.0 + avg(distribcell) group out nuclide mean std. dev. +0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.0 0.0 diff --git a/tests/test_mgxs_library_distribcell/test_mgxs_library_distribcell.py b/tests/test_mgxs_library_distribcell/test_mgxs_library_distribcell.py index 32f5ea1bd8..30593e54b5 100644 --- a/tests/test_mgxs_library_distribcell/test_mgxs_library_distribcell.py +++ b/tests/test_mgxs_library_distribcell/test_mgxs_library_distribcell.py @@ -12,10 +12,6 @@ import openmc.mgxs class MGXSTestHarness(PyAPITestHarness): def _build_inputs(self): - - # The openmc.mgxs module needs a summary.h5 file - self._input_set.settings.output = {'summary': True} - # Generate inputs using parent class routine super(MGXSTestHarness, self)._build_inputs() @@ -26,8 +22,8 @@ class MGXSTestHarness(PyAPITestHarness): # for one material-filled cell in the geometry self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry) self.mgxs_lib.by_nuclide = False - self.mgxs_lib.mgxs_types = ['transport', 'nu-fission', - 'nu-scatter matrix', 'chi'] + # Test all MGXS types + self.mgxs_lib.mgxs_types = openmc.mgxs.MGXS_TYPES self.mgxs_lib.energy_groups = energy_groups self.mgxs_lib.legendre_order = 3 self.mgxs_lib.domain_type = 'distribcell' @@ -59,7 +55,7 @@ class MGXSTestHarness(PyAPITestHarness): for mgxs_type in avg_lib.mgxs_types: mgxs = avg_lib.get_mgxs(domain, mgxs_type) df = mgxs.get_pandas_dataframe() - outstr += df.to_string() + outstr += df.to_string() + '\n' # Hash the results if necessary if hash_output: diff --git a/tests/test_mgxs_library_hdf5/inputs_true.dat b/tests/test_mgxs_library_hdf5/inputs_true.dat index 3643c9a2ef..79ca0ec660 100644 --- a/tests/test_mgxs_library_hdf5/inputs_true.dat +++ b/tests/test_mgxs_library_hdf5/inputs_true.dat @@ -1 +1 @@ -104e7fb527770ac5d3fc636da7716e8fb05d55761253d30516c899f466e6b38ffd881611a3d0cdf65c6af058c32f6f6758c68782be7a170d21024bdae751862f \ No newline at end of file +317a63a9dd3bfd84e969667b00f46018e56c04c356461a75103f63569e6b70c84d0da7f5e611faaf1b2631330b05ab4346223d3d843018ce0ce8876671a450c0 \ No newline at end of file diff --git a/tests/test_mgxs_library_hdf5/results_true.dat b/tests/test_mgxs_library_hdf5/results_true.dat index 3cae577471..7391b2e427 100644 --- a/tests/test_mgxs_library_hdf5/results_true.dat +++ b/tests/test_mgxs_library_hdf5/results_true.dat @@ -1,240 +1,195 @@ -domain=1 type=transport -[ 0.37274472 0.86160691] -[ 0.02426918 0.03234902] -domain=1 type=nu-fission -[ 0.02178897 0.71407658] -[ 0.00118187 0.04055185] -domain=1 type=nu-scatter matrix -[[[ 3.81546297e-01 4.43012537e-02 2.06462886e-02 1.36952959e-02] - [ 1.55945353e-03 -5.97269486e-04 -2.38789528e-04 1.75508083e-04]] +domain=10000 type=total +[ 0.41482549 0.66016992] +[ 0.02279291 0.04751893] +domain=10000 type=transport +[ 0.35685964 0.64764766] +[ 0.0254936 0.02370374] +domain=10000 type=nu-transport +[ 0.35685964 0.64764766] +[ 0.0254936 0.02370374] +domain=10000 type=absorption +[ 0.02740784 0.26451074] +[ 0.0026925 0.02336708] +domain=10000 type=capture +[ 0.01984455 0.07171935] +[ 0.0026433 0.02520786] +domain=10000 type=fission +[ 0.00756329 0.19279139] +[ 0.00050848 0.01710592] +domain=10000 type=nu-fission +[ 0.01943174 0.46977478] +[ 0.00132298 0.041682 ] +domain=10000 type=kappa-fission +[ 1.47456982 37.28689641] +[ 0.09923532 3.30837772] +domain=10000 type=scatter +[ 0.38741765 0.39565918] +[ 0.02062573 0.02512506] +domain=10000 type=nu-scatter +[ 0.38518839 0.4123894 ] +[ 0.02694562 0.01542528] +domain=10000 type=scatter matrix +[[[ 3.84199458e-01 5.18702843e-02 2.00688453e-02 9.47771571e-03] + [ 9.88930393e-04 -2.07234596e-04 -1.03366181e-04 2.34290623e-04]] - [[ 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00] - [ 4.03915981e-01 -1.13103276e-02 -1.48065932e-02 -6.85505346e-03]]] -[[[ 0.02403322 0.00472203 0.00253903 0.00222437] - [ 0.00051015 0.00022485 0.00022157 0.00020939]] + [[ 9.24639909e-04 -7.67704968e-04 4.93788872e-04 -1.71497229e-04] + [ 4.11464759e-01 1.64817280e-02 6.37149049e-03 -1.04991221e-02]]] +[[[ 0.02700101 0.00698255 0.0028465 0.00223352] + [ 0.00048242 0.00014901 0.00018432 0.00012817]] - [[ 0. 0. 0. 0. ] - [ 0.01896646 0.00783919 0.00862908 0.00904704]]] -domain=1 type=chi + [[ 0.00092488 0.00076791 0.00049392 0.00017154] + [ 0.01524494 0.00450173 0.01055075 0.01043819]]] +domain=10000 type=nu-scatter matrix +[[[ 3.84199458e-01 5.18702843e-02 2.00688453e-02 9.47771571e-03] + [ 9.88930393e-04 -2.07234596e-04 -1.03366181e-04 2.34290623e-04]] + + [[ 9.24639909e-04 -7.67704968e-04 4.93788872e-04 -1.71497229e-04] + [ 4.11464759e-01 1.64817280e-02 6.37149049e-03 -1.04991221e-02]]] +[[[ 0.02700101 0.00698255 0.0028465 0.00223352] + [ 0.00048242 0.00014901 0.00018432 0.00012817]] + + [[ 0.00092488 0.00076791 0.00049392 0.00017154] + [ 0.01524494 0.00450173 0.01055075 0.01043819]]] +domain=10000 type=multiplicity matrix +[[ 1. 1.] + [ 1. 1.]] +[[ 0.07851646 0.68718427] + [ 1.41421356 0.04113035]] +domain=10000 type=nu-fission matrix +[[ 0.02014243 0. ] + [ 0.45436647 0. ]] +[[ 0.00314909 0. ] + [ 0.02742551 0. ]] +domain=10000 type=chi [ 1. 0.] -[ 0.05533329 0. ] -domain=2 type=transport -[ 0.23725441 0.28593027] -[ 0.00818357 0.04879593] -domain=2 type=nu-fission +[ 0.04607052 0. ] +domain=10001 type=total +[ 0.31373767 0.3008214 ] +[ 0.0155819 0.02805245] +domain=10001 type=transport +[ 0.27322787 0.31237484] +[ 0.03311537 0.04960583] +domain=10001 type=nu-transport +[ 0.27322787 0.31237484] +[ 0.03311537 0.04960583] +domain=10001 type=absorption +[ 0.00157499 0.00540038] +[ 0.00032255 0.00061814] +domain=10001 type=capture +[ 0.00157499 0.00540038] +[ 0.00032255 0.00061814] +domain=10001 type=fission [ 0. 0.] [ 0. 0.] -domain=2 type=nu-scatter matrix -[[[ 0.27311543 0.03586102 0.02970389 0.00224892] +domain=10001 type=nu-fission +[ 0. 0.] +[ 0. 0.] +domain=10001 type=kappa-fission +[ 0. 0.] +[ 0. 0.] +domain=10001 type=scatter +[ 0.31216268 0.29542102] +[ 0.01532192 0.02744549] +domain=10001 type=nu-scatter +[ 0.31012074 0.29626427] +[ 0.03378811 0.04379223] +domain=10001 type=scatter matrix +[[[ 0.31012074 0.03822959 0.02074494 0.0079643 ] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.26405068 -0.02187959 -0.01529469 0.01403395]]] -[[[ 0.00625287 0.00587756 0.00664018 0.00337568] + [ 0.29626427 -0.01121364 0.00883657 -0.00327007]]] +[[[ 0.03378811 0.008484 0.00469561 0.00373162] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0.04539742 0.01221814 0.01027609 0.01431818]]] -domain=2 type=chi -[ 0. 0.] -[ 0. 0.] -domain=3 type=transport -[ 0.28690578 1.41815062] -[ 0.02740142 0.26530756] -domain=3 type=nu-fission -[ 0. 0.] -[ 0. 0.] -domain=3 type=nu-scatter matrix -[[[ 0.64334557 0.38340871 0.15218526 0.00303724] - [ 0.02618721 0.00736219 -0.00273849 -0.00271989]] - - [[ 0. 0. 0. 0. ] - [ 1.92421362 0.4984312 0.09120485 0.01705441]]] -[[[ 0.02837604 0.01644677 0.00957372 0.00464802] - [ 0.00166461 0.00093414 0.00075617 0.00055807]] - - [[ 0. 0. 0. 0. ] - [ 0.28406198 0.06342067 0.01372628 0.01391602]]] -domain=3 type=chi -[ 0. 0.] -[ 0. 0.] -domain=4 type=transport -[ 0.24244686 1.25395921] -[ 0.06103082 0.38836257] -domain=4 type=nu-fission -[ 0. 0.] -[ 0. 0.] -domain=4 type=nu-scatter matrix -[[[ 0.54394096 0.32601136 0.13113269 0.01210477] - [ 0.023662 0.00752551 -0.00272975 -0.0031405 ]] - - [[ 0. 0. 0. 0. ] - [ 1.76464845 0.50069481 0.09902596 0.03297543]]] -[[[ 0.06542705 0.03860196 0.0174751 0.00607268] - [ 0.00308328 0.00130111 0.00084112 0.00057761]] - - [[ 0. 0. 0. 0. ] - [ 0.41620952 0.12217802 0.03871874 0.02510259]]] -domain=4 type=chi -[ 0. 0.] -[ 0. 0.] -domain=5 type=transport -[ 0. 0.] -[ 0. 0.] -domain=5 type=nu-fission -[ 0. 0.] -[ 0. 0.] -domain=5 type=nu-scatter matrix -[[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] - - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]] -[[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] - - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]] -domain=5 type=chi -[ 0. 0.] -[ 0. 0.] -domain=6 type=transport -[ 0. 0.] -[ 0. 0.] -domain=6 type=nu-fission -[ 0. 0.] -[ 0. 0.] -domain=6 type=nu-scatter matrix -[[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] - - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]] -[[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] - - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]] -domain=6 type=chi -[ 0. 0.] -[ 0. 0.] -domain=7 type=transport -[ 0. 0.] -[ 0. 0.] -domain=7 type=nu-fission -[ 0. 0.] -[ 0. 0.] -domain=7 type=nu-scatter matrix -[[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] - - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]] -[[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] - - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]] -domain=7 type=chi -[ 0. 0.] -[ 0. 0.] -domain=8 type=transport -[ 0. 0.] -[ 0. 0.] -domain=8 type=nu-fission -[ 0. 0.] -[ 0. 0.] -domain=8 type=nu-scatter matrix -[[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] - - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]] -[[[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]] - - [[ 0. 0. 0. 0.] - [ 0. 0. 0. 0.]]] -domain=8 type=chi -[ 0. 0.] -[ 0. 0.] -domain=9 type=transport -[ 0.60053598 0. ] -[ 0.74887543 0. ] -domain=9 type=nu-fission -[ 0. 0.] -[ 0. 0.] -domain=9 type=nu-scatter matrix -[[[ 0.72037987 0.11984389 0.03852204 0.05602285] + [ 0.04379223 0.01618037 0.01150396 0.00732885]]] +domain=10001 type=nu-scatter matrix +[[[ 0.31012074 0.03822959 0.02074494 0.0079643 ] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0. 0. 0. 0. ]]] -[[[ 0.77101455 0.18469083 0.06448453 0.05059534] + [ 0.29626427 -0.01121364 0.00883657 -0.00327007]]] +[[[ 0.03378811 0.008484 0.00469561 0.00373162] [ 0. 0. 0. 0. ]] [[ 0. 0. 0. 0. ] - [ 0. 0. 0. 0. ]]] -domain=9 type=chi + [ 0.04379223 0.01618037 0.01150396 0.00732885]]] +domain=10001 type=multiplicity matrix +[[ 1. 0.] + [ 0. 1.]] +[[ 0.1087787 0. ] + [ 0. 0.14242717]] +domain=10001 type=nu-fission matrix +[[ 0. 0.] + [ 0. 0.]] +[[ 0. 0.] + [ 0. 0.]] +domain=10001 type=chi [ 0. 0.] [ 0. 0.] -domain=10 type=transport -[ 0.23551495 0. ] -[ 0.61397415 0. ] -domain=10 type=nu-fission +domain=10002 type=total +[ 0.66457226 2.05238401] +[ 0.03121475 0.22434291] +domain=10002 type=transport +[ 0.29056526 1.51643801] +[ 0.02385185 0.23519727] +domain=10002 type=nu-transport +[ 0.29056526 1.51643801] +[ 0.02385185 0.23519727] +domain=10002 type=absorption +[ 0.0006904 0.03168726] +[ 4.41475687e-05 3.74655858e-03] +domain=10002 type=capture +[ 0.0006904 0.03168726] +[ 4.41475687e-05 3.74655858e-03] +domain=10002 type=fission [ 0. 0.] [ 0. 0.] -domain=10 type=nu-scatter matrix -[[[ 0.50100891 0.26549396 0.14197875 0.07425836] - [ 0. 0. 0. 0. ]] +domain=10002 type=nu-fission +[ 0. 0.] +[ 0. 0.] +domain=10002 type=kappa-fission +[ 0. 0.] +[ 0. 0.] +domain=10002 type=scatter +[ 0.66388186 2.02069676] +[ 0.03117268 0.22060445] +domain=10002 type=nu-scatter +[ 0.6712692 2.03538833] +[ 0.02618637 0.25806033] +domain=10002 type=scatter matrix +[[[ 6.39901485e-01 3.81167449e-01 1.52391898e-01 9.14802229e-03] + [ 3.13677198e-02 8.75772321e-03 -2.56790106e-03 -3.78480288e-03]] - [[ 0. 0. 0. 0. ] - [ 0. 0. 0. 0. ]]] -[[[ 0.70853359 0.37546516 0.20078827 0.10501718] - [ 0. 0. 0. 0. ]] + [[ 4.43343134e-04 3.99960414e-04 3.19562707e-04 2.13846969e-04] + [ 2.03494499e+00 5.09940513e-01 1.11174609e-01 2.49884357e-02]]] +[[[ 2.47091228e-02 1.62432649e-02 8.15627770e-03 3.88856214e-03] + [ 1.72811290e-03 9.25670501e-04 1.01398475e-03 8.17075571e-04]] - [[ 0. 0. 0. 0. ] - [ 0. 0. 0. 0. ]]] -domain=10 type=chi -[ 0. 0.] -[ 0. 0.] -domain=11 type=transport -[ 0.18632392 0.94598628] -[ 0.63212919 1.59113341] -domain=11 type=nu-fission -[ 0. 0.] -[ 0. 0.] -domain=11 type=nu-scatter matrix -[[[ 0.47812753 0.32367878 0.14337507 0.05400336] - [ 0.03187517 0.00858456 -0.01246962 -0.01132019]] + [[ 4.44850393e-04 4.01320183e-04 3.20649143e-04 2.14573997e-04] + [ 2.57799889e-01 5.12359063e-02 1.30198170e-02 8.31235256e-03]]] +domain=10002 type=nu-scatter matrix +[[[ 6.39901485e-01 3.81167449e-01 1.52391898e-01 9.14802229e-03] + [ 3.13677198e-02 8.75772321e-03 -2.56790106e-03 -3.78480288e-03]] - [[ 0. 0. 0. 0. ] - [ 1.20124973 0.28661101 0.21819147 -0.04851424]]] -[[[ 0.67617444 0.45775092 0.20276296 0.07637229] - [ 0.0450783 0.0121404 0.01763471 0.01600917]] + [[ 4.43343134e-04 3.99960414e-04 3.19562707e-04 2.13846969e-04] + [ 2.03494499e+00 5.09940513e-01 1.11174609e-01 2.49884357e-02]]] +[[[ 2.47091228e-02 1.62432649e-02 8.15627770e-03 3.88856214e-03] + [ 1.72811290e-03 9.25670501e-04 1.01398475e-03 8.17075571e-04]] - [[ 0. 0. 0. 0. ] - [ 1.69882367 0.40532917 0.30856933 0.0686095 ]]] -domain=11 type=chi -[ 0. 0.] -[ 0. 0.] -domain=12 type=transport -[ 0.21329208 1.3909745 ] -[ 0.27144387 2.13734565] -domain=12 type=nu-fission -[ 0. 0.] -[ 0. 0.] -domain=12 type=nu-scatter matrix -[[[ 0.40859392 0.22254143 0.0909719 0.03100368] - [ 0.02723959 -0.01008785 -0.00694631 0.00969231]] - - [[ 0. 0. 0. 0. ] - [ 1.57432766 0.22974802 0.01417839 0.03899727]]] -[[[ 0.27812309 0.14577636 0.06962553 0.03598053] - [ 0.02955488 0.01094529 0.00753673 0.01051613]] - - [[ 0. 0. 0. 0. ] - [ 2.22643553 0.32491277 0.02005128 0.05515046]]] -domain=12 type=chi + [[ 4.44850393e-04 4.01320183e-04 3.20649143e-04 2.14573997e-04] + [ 2.57799889e-01 5.12359063e-02 1.30198170e-02 8.31235256e-03]]] +domain=10002 type=multiplicity matrix +[[ 1. 1.] + [ 1. 1.]] +[[ 0.03860919 0.06766735] + [ 1.41421356 0.13592921]] +domain=10002 type=nu-fission matrix +[[ 0. 0.] + [ 0. 0.]] +[[ 0. 0.] + [ 0. 0.]] +domain=10002 type=chi [ 0. 0.] [ 0. 0.] diff --git a/tests/test_mgxs_library_hdf5/test_mgxs_library_hdf5.py b/tests/test_mgxs_library_hdf5/test_mgxs_library_hdf5.py index 2d7ed2ef3d..000a1f8cb9 100644 --- a/tests/test_mgxs_library_hdf5/test_mgxs_library_hdf5.py +++ b/tests/test_mgxs_library_hdf5/test_mgxs_library_hdf5.py @@ -7,27 +7,28 @@ import hashlib import h5py sys.path.insert(0, os.pardir) from testing_harness import PyAPITestHarness +from input_set import PinCellInputSet import openmc import openmc.mgxs class MGXSTestHarness(PyAPITestHarness): def _build_inputs(self): - - # The openmc.mgxs module needs a summary.h5 file - self._input_set.settings.output = {'summary': True} + # Set the input set to use the pincell model + self._input_set = PinCellInputSet() # Generate inputs using parent class routine super(MGXSTestHarness, self)._build_inputs() # Initialize a two-group structure - energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, 20.]) + energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, + 20.]) # Initialize MGXS Library for a few cross section types self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry) self.mgxs_lib.by_nuclide = False - self.mgxs_lib.mgxs_types = ['transport', 'nu-fission', - 'nu-scatter matrix', 'chi'] + # Test all MGXS types + self.mgxs_lib.mgxs_types = openmc.mgxs.MGXS_TYPES self.mgxs_lib.energy_groups = energy_groups self.mgxs_lib.legendre_order = 3 self.mgxs_lib.domain_type = 'material' @@ -75,7 +76,6 @@ class MGXSTestHarness(PyAPITestHarness): return outstr - def _cleanup(self): super(MGXSTestHarness, self)._cleanup() f = os.path.join(os.getcwd(), 'tallies.xml') diff --git a/tests/test_mgxs_library_no_nuclides/inputs_true.dat b/tests/test_mgxs_library_no_nuclides/inputs_true.dat index 3643c9a2ef..79ca0ec660 100644 --- a/tests/test_mgxs_library_no_nuclides/inputs_true.dat +++ b/tests/test_mgxs_library_no_nuclides/inputs_true.dat @@ -1 +1 @@ -104e7fb527770ac5d3fc636da7716e8fb05d55761253d30516c899f466e6b38ffd881611a3d0cdf65c6af058c32f6f6758c68782be7a170d21024bdae751862f \ No newline at end of file +317a63a9dd3bfd84e969667b00f46018e56c04c356461a75103f63569e6b70c84d0da7f5e611faaf1b2631330b05ab4346223d3d843018ce0ce8876671a450c0 \ No newline at end of file diff --git a/tests/test_mgxs_library_no_nuclides/results_true.dat b/tests/test_mgxs_library_no_nuclides/results_true.dat index 94150a202a..599cee6c49 100644 --- a/tests/test_mgxs_library_no_nuclides/results_true.dat +++ b/tests/test_mgxs_library_no_nuclides/results_true.dat @@ -1,265 +1,231 @@ material group in nuclide mean std. dev. -1 1 1 total 0.372745 0.024269 -0 1 2 total 0.861607 0.032349 material group in nuclide mean std. dev. -1 1 1 total 0.021789 0.001182 -0 1 2 total 0.714077 0.040552 material group in group out nuclide moment mean std. dev. -12 1 1 1 total P0 0.381546 0.024033 -13 1 1 1 total P1 0.044301 0.004722 -14 1 1 1 total P2 0.020646 0.002539 -15 1 1 1 total P3 0.013695 0.002224 -8 1 1 2 total P0 0.001559 0.000510 -9 1 1 2 total P1 -0.000597 0.000225 -10 1 1 2 total P2 -0.000239 0.000222 -11 1 1 2 total P3 0.000176 0.000209 -4 1 2 1 total P0 0.000000 0.000000 -5 1 2 1 total P1 0.000000 0.000000 -6 1 2 1 total P2 0.000000 0.000000 -7 1 2 1 total P3 0.000000 0.000000 -0 1 2 2 total P0 0.403916 0.018966 -1 1 2 2 total P1 -0.011310 0.007839 -2 1 2 2 total P2 -0.014807 0.008629 -3 1 2 2 total P3 -0.006855 0.009047 material group out nuclide mean std. dev. -1 1 1 total 1.0 0.055333 -0 1 2 total 0.0 0.000000 material group in nuclide mean std. dev. -1 2 1 total 0.237254 0.008184 -0 2 2 total 0.285930 0.048796 material group in nuclide mean std. dev. -1 2 1 total 0.0 0.0 -0 2 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 2 1 1 total P0 0.273115 0.006253 -13 2 1 1 total P1 0.035861 0.005878 -14 2 1 1 total P2 0.029704 0.006640 -15 2 1 1 total P3 0.002249 0.003376 -8 2 1 2 total P0 0.000000 0.000000 -9 2 1 2 total P1 0.000000 0.000000 -10 2 1 2 total P2 0.000000 0.000000 -11 2 1 2 total P3 0.000000 0.000000 -4 2 2 1 total P0 0.000000 0.000000 -5 2 2 1 total P1 0.000000 0.000000 -6 2 2 1 total P2 0.000000 0.000000 -7 2 2 1 total P3 0.000000 0.000000 -0 2 2 2 total P0 0.264051 0.045397 -1 2 2 2 total P1 -0.021880 0.012218 -2 2 2 2 total P2 -0.015295 0.010276 -3 2 2 2 total P3 0.014034 0.014318 material group out nuclide mean std. dev. -1 2 1 total 0.0 0.0 -0 2 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 3 1 total 0.286906 0.027401 -0 3 2 total 1.418151 0.265308 material group in nuclide mean std. dev. -1 3 1 total 0.0 0.0 -0 3 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 3 1 1 total P0 0.643346 0.028376 -13 3 1 1 total P1 0.383409 0.016447 -14 3 1 1 total P2 0.152185 0.009574 -15 3 1 1 total P3 0.003037 0.004648 -8 3 1 2 total P0 0.026187 0.001665 -9 3 1 2 total P1 0.007362 0.000934 -10 3 1 2 total P2 -0.002738 0.000756 -11 3 1 2 total P3 -0.002720 0.000558 -4 3 2 1 total P0 0.000000 0.000000 -5 3 2 1 total P1 0.000000 0.000000 -6 3 2 1 total P2 0.000000 0.000000 -7 3 2 1 total P3 0.000000 0.000000 -0 3 2 2 total P0 1.924214 0.284062 -1 3 2 2 total P1 0.498431 0.063421 -2 3 2 2 total P2 0.091205 0.013726 -3 3 2 2 total P3 0.017054 0.013916 material group out nuclide mean std. dev. -1 3 1 total 0.0 0.0 -0 3 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 4 1 total 0.242447 0.061031 -0 4 2 total 1.253959 0.388363 material group in nuclide mean std. dev. -1 4 1 total 0.0 0.0 -0 4 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 4 1 1 total P0 0.543941 0.065427 -13 4 1 1 total P1 0.326011 0.038602 -14 4 1 1 total P2 0.131133 0.017475 -15 4 1 1 total P3 0.012105 0.006073 -8 4 1 2 total P0 0.023662 0.003083 -9 4 1 2 total P1 0.007526 0.001301 -10 4 1 2 total P2 -0.002730 0.000841 -11 4 1 2 total P3 -0.003140 0.000578 -4 4 2 1 total P0 0.000000 0.000000 -5 4 2 1 total P1 0.000000 0.000000 -6 4 2 1 total P2 0.000000 0.000000 -7 4 2 1 total P3 0.000000 0.000000 -0 4 2 2 total P0 1.764648 0.416210 -1 4 2 2 total P1 0.500695 0.122178 -2 4 2 2 total P2 0.099026 0.038719 -3 4 2 2 total P3 0.032975 0.025103 material group out nuclide mean std. dev. -1 4 1 total 0.0 0.0 -0 4 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 5 1 total 0.0 0.0 -0 5 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 5 1 total 0.0 0.0 -0 5 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 5 1 1 total P0 0.0 0.0 -13 5 1 1 total P1 0.0 0.0 -14 5 1 1 total P2 0.0 0.0 -15 5 1 1 total P3 0.0 0.0 -8 5 1 2 total P0 0.0 0.0 -9 5 1 2 total P1 0.0 0.0 -10 5 1 2 total P2 0.0 0.0 -11 5 1 2 total P3 0.0 0.0 -4 5 2 1 total P0 0.0 0.0 -5 5 2 1 total P1 0.0 0.0 -6 5 2 1 total P2 0.0 0.0 -7 5 2 1 total P3 0.0 0.0 -0 5 2 2 total P0 0.0 0.0 -1 5 2 2 total P1 0.0 0.0 -2 5 2 2 total P2 0.0 0.0 -3 5 2 2 total P3 0.0 0.0 material group out nuclide mean std. dev. -1 5 1 total 0.0 0.0 -0 5 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 6 1 total 0.0 0.0 -0 6 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 6 1 total 0.0 0.0 -0 6 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 6 1 1 total P0 0.0 0.0 -13 6 1 1 total P1 0.0 0.0 -14 6 1 1 total P2 0.0 0.0 -15 6 1 1 total P3 0.0 0.0 -8 6 1 2 total P0 0.0 0.0 -9 6 1 2 total P1 0.0 0.0 -10 6 1 2 total P2 0.0 0.0 -11 6 1 2 total P3 0.0 0.0 -4 6 2 1 total P0 0.0 0.0 -5 6 2 1 total P1 0.0 0.0 -6 6 2 1 total P2 0.0 0.0 -7 6 2 1 total P3 0.0 0.0 -0 6 2 2 total P0 0.0 0.0 -1 6 2 2 total P1 0.0 0.0 -2 6 2 2 total P2 0.0 0.0 -3 6 2 2 total P3 0.0 0.0 material group out nuclide mean std. dev. -1 6 1 total 0.0 0.0 -0 6 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 7 1 total 0.0 0.0 -0 7 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 7 1 total 0.0 0.0 -0 7 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 7 1 1 total P0 0.0 0.0 -13 7 1 1 total P1 0.0 0.0 -14 7 1 1 total P2 0.0 0.0 -15 7 1 1 total P3 0.0 0.0 -8 7 1 2 total P0 0.0 0.0 -9 7 1 2 total P1 0.0 0.0 -10 7 1 2 total P2 0.0 0.0 -11 7 1 2 total P3 0.0 0.0 -4 7 2 1 total P0 0.0 0.0 -5 7 2 1 total P1 0.0 0.0 -6 7 2 1 total P2 0.0 0.0 -7 7 2 1 total P3 0.0 0.0 -0 7 2 2 total P0 0.0 0.0 -1 7 2 2 total P1 0.0 0.0 -2 7 2 2 total P2 0.0 0.0 -3 7 2 2 total P3 0.0 0.0 material group out nuclide mean std. dev. -1 7 1 total 0.0 0.0 -0 7 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 8 1 total 0.0 0.0 -0 8 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 8 1 total 0.0 0.0 -0 8 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 8 1 1 total P0 0.0 0.0 -13 8 1 1 total P1 0.0 0.0 -14 8 1 1 total P2 0.0 0.0 -15 8 1 1 total P3 0.0 0.0 -8 8 1 2 total P0 0.0 0.0 -9 8 1 2 total P1 0.0 0.0 -10 8 1 2 total P2 0.0 0.0 -11 8 1 2 total P3 0.0 0.0 -4 8 2 1 total P0 0.0 0.0 -5 8 2 1 total P1 0.0 0.0 -6 8 2 1 total P2 0.0 0.0 -7 8 2 1 total P3 0.0 0.0 -0 8 2 2 total P0 0.0 0.0 -1 8 2 2 total P1 0.0 0.0 -2 8 2 2 total P2 0.0 0.0 -3 8 2 2 total P3 0.0 0.0 material group out nuclide mean std. dev. -1 8 1 total 0.0 0.0 -0 8 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 9 1 total 0.600536 0.748875 -0 9 2 total 0.000000 0.000000 material group in nuclide mean std. dev. -1 9 1 total 0.0 0.0 -0 9 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 9 1 1 total P0 0.720380 0.771015 -13 9 1 1 total P1 0.119844 0.184691 -14 9 1 1 total P2 0.038522 0.064485 -15 9 1 1 total P3 0.056023 0.050595 -8 9 1 2 total P0 0.000000 0.000000 -9 9 1 2 total P1 0.000000 0.000000 -10 9 1 2 total P2 0.000000 0.000000 -11 9 1 2 total P3 0.000000 0.000000 -4 9 2 1 total P0 0.000000 0.000000 -5 9 2 1 total P1 0.000000 0.000000 -6 9 2 1 total P2 0.000000 0.000000 -7 9 2 1 total P3 0.000000 0.000000 -0 9 2 2 total P0 0.000000 0.000000 -1 9 2 2 total P1 0.000000 0.000000 -2 9 2 2 total P2 0.000000 0.000000 -3 9 2 2 total P3 0.000000 0.000000 material group out nuclide mean std. dev. -1 9 1 total 0.0 0.0 -0 9 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 10 1 total 0.235515 0.613974 -0 10 2 total 0.000000 0.000000 material group in nuclide mean std. dev. -1 10 1 total 0.0 0.0 -0 10 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 10 1 1 total P0 0.501009 0.708534 -13 10 1 1 total P1 0.265494 0.375465 -14 10 1 1 total P2 0.141979 0.200788 -15 10 1 1 total P3 0.074258 0.105017 -8 10 1 2 total P0 0.000000 0.000000 -9 10 1 2 total P1 0.000000 0.000000 -10 10 1 2 total P2 0.000000 0.000000 -11 10 1 2 total P3 0.000000 0.000000 -4 10 2 1 total P0 0.000000 0.000000 -5 10 2 1 total P1 0.000000 0.000000 -6 10 2 1 total P2 0.000000 0.000000 -7 10 2 1 total P3 0.000000 0.000000 -0 10 2 2 total P0 0.000000 0.000000 -1 10 2 2 total P1 0.000000 0.000000 -2 10 2 2 total P2 0.000000 0.000000 -3 10 2 2 total P3 0.000000 0.000000 material group out nuclide mean std. dev. -1 10 1 total 0.0 0.0 -0 10 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 11 1 total 0.186324 0.632129 -0 11 2 total 0.945986 1.591133 material group in nuclide mean std. dev. -1 11 1 total 0.0 0.0 -0 11 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 11 1 1 total P0 0.478128 0.676174 -13 11 1 1 total P1 0.323679 0.457751 -14 11 1 1 total P2 0.143375 0.202763 -15 11 1 1 total P3 0.054003 0.076372 -8 11 1 2 total P0 0.031875 0.045078 -9 11 1 2 total P1 0.008585 0.012140 -10 11 1 2 total P2 -0.012470 0.017635 -11 11 1 2 total P3 -0.011320 0.016009 -4 11 2 1 total P0 0.000000 0.000000 -5 11 2 1 total P1 0.000000 0.000000 -6 11 2 1 total P2 0.000000 0.000000 -7 11 2 1 total P3 0.000000 0.000000 -0 11 2 2 total P0 1.201250 1.698824 -1 11 2 2 total P1 0.286611 0.405329 -2 11 2 2 total P2 0.218191 0.308569 -3 11 2 2 total P3 -0.048514 0.068609 material group out nuclide mean std. dev. -1 11 1 total 0.0 0.0 -0 11 2 total 0.0 0.0 material group in nuclide mean std. dev. -1 12 1 total 0.213292 0.271444 -0 12 2 total 1.390975 2.137346 material group in nuclide mean std. dev. -1 12 1 total 0.0 0.0 -0 12 2 total 0.0 0.0 material group in group out nuclide moment mean std. dev. -12 12 1 1 total P0 0.408594 0.278123 -13 12 1 1 total P1 0.222541 0.145776 -14 12 1 1 total P2 0.090972 0.069626 -15 12 1 1 total P3 0.031004 0.035981 -8 12 1 2 total P0 0.027240 0.029555 -9 12 1 2 total P1 -0.010088 0.010945 -10 12 1 2 total P2 -0.006946 0.007537 -11 12 1 2 total P3 0.009692 0.010516 -4 12 2 1 total P0 0.000000 0.000000 -5 12 2 1 total P1 0.000000 0.000000 -6 12 2 1 total P2 0.000000 0.000000 -7 12 2 1 total P3 0.000000 0.000000 -0 12 2 2 total P0 1.574328 2.226436 -1 12 2 2 total P1 0.229748 0.324913 -2 12 2 2 total P2 0.014178 0.020051 -3 12 2 2 total P3 0.038997 0.055150 material group out nuclide mean std. dev. -1 12 1 total 0.0 0.0 -0 12 2 total 0.0 0.0 \ No newline at end of file +1 10000 1 total 0.414825 0.022793 +0 10000 2 total 0.660170 0.047519 + material group in nuclide mean std. dev. +1 10000 1 total 0.356860 0.025494 +0 10000 2 total 0.647648 0.023704 + material group in nuclide mean std. dev. +1 10000 1 total 0.356860 0.025494 +0 10000 2 total 0.647648 0.023704 + material group in nuclide mean std. dev. +1 10000 1 total 0.027408 0.002692 +0 10000 2 total 0.264511 0.023367 + material group in nuclide mean std. dev. +1 10000 1 total 0.019845 0.002643 +0 10000 2 total 0.071719 0.025208 + material group in nuclide mean std. dev. +1 10000 1 total 0.007563 0.000508 +0 10000 2 total 0.192791 0.017106 + material group in nuclide mean std. dev. +1 10000 1 total 0.019432 0.001323 +0 10000 2 total 0.469775 0.041682 + material group in nuclide mean std. dev. +1 10000 1 total 1.474570 0.099235 +0 10000 2 total 37.286896 3.308378 + material group in nuclide mean std. dev. +1 10000 1 total 0.387418 0.020626 +0 10000 2 total 0.395659 0.025125 + material group in nuclide mean std. dev. +1 10000 1 total 0.385188 0.026946 +0 10000 2 total 0.412389 0.015425 + material group in group out nuclide moment mean std. dev. +12 10000 1 1 total P0 0.384199 0.027001 +13 10000 1 1 total P1 0.051870 0.006983 +14 10000 1 1 total P2 0.020069 0.002846 +15 10000 1 1 total P3 0.009478 0.002234 +8 10000 1 2 total P0 0.000989 0.000482 +9 10000 1 2 total P1 -0.000207 0.000149 +10 10000 1 2 total P2 -0.000103 0.000184 +11 10000 1 2 total P3 0.000234 0.000128 +4 10000 2 1 total P0 0.000925 0.000925 +5 10000 2 1 total P1 -0.000768 0.000768 +6 10000 2 1 total P2 0.000494 0.000494 +7 10000 2 1 total P3 -0.000171 0.000172 +0 10000 2 2 total P0 0.411465 0.015245 +1 10000 2 2 total P1 0.016482 0.004502 +2 10000 2 2 total P2 0.006371 0.010551 +3 10000 2 2 total P3 -0.010499 0.010438 + material group in group out nuclide moment mean std. dev. +12 10000 1 1 total P0 0.384199 0.027001 +13 10000 1 1 total P1 0.051870 0.006983 +14 10000 1 1 total P2 0.020069 0.002846 +15 10000 1 1 total P3 0.009478 0.002234 +8 10000 1 2 total P0 0.000989 0.000482 +9 10000 1 2 total P1 -0.000207 0.000149 +10 10000 1 2 total P2 -0.000103 0.000184 +11 10000 1 2 total P3 0.000234 0.000128 +4 10000 2 1 total P0 0.000925 0.000925 +5 10000 2 1 total P1 -0.000768 0.000768 +6 10000 2 1 total P2 0.000494 0.000494 +7 10000 2 1 total P3 -0.000171 0.000172 +0 10000 2 2 total P0 0.411465 0.015245 +1 10000 2 2 total P1 0.016482 0.004502 +2 10000 2 2 total P2 0.006371 0.010551 +3 10000 2 2 total P3 -0.010499 0.010438 + material group in group out nuclide mean std. dev. +3 10000 1 1 total 1.0 0.078516 +2 10000 1 2 total 1.0 0.687184 +1 10000 2 1 total 1.0 1.414214 +0 10000 2 2 total 1.0 0.041130 + material group in group out nuclide mean std. dev. +3 10000 1 1 total 0.020142 0.003149 +2 10000 1 2 total 0.000000 0.000000 +1 10000 2 1 total 0.454366 0.027426 +0 10000 2 2 total 0.000000 0.000000 + material group out nuclide mean std. dev. +1 10000 1 total 1.0 0.046071 +0 10000 2 total 0.0 0.000000 + material group in nuclide mean std. dev. +1 10001 1 total 0.313738 0.015582 +0 10001 2 total 0.300821 0.028052 + material group in nuclide mean std. dev. +1 10001 1 total 0.273228 0.033115 +0 10001 2 total 0.312375 0.049606 + material group in nuclide mean std. dev. +1 10001 1 total 0.273228 0.033115 +0 10001 2 total 0.312375 0.049606 + material group in nuclide mean std. dev. +1 10001 1 total 0.001575 0.000323 +0 10001 2 total 0.005400 0.000618 + material group in nuclide mean std. dev. +1 10001 1 total 0.001575 0.000323 +0 10001 2 total 0.005400 0.000618 + material group in nuclide mean std. dev. +1 10001 1 total 0.0 0.0 +0 10001 2 total 0.0 0.0 + material group in nuclide mean std. dev. +1 10001 1 total 0.0 0.0 +0 10001 2 total 0.0 0.0 + material group in nuclide mean std. dev. +1 10001 1 total 0.0 0.0 +0 10001 2 total 0.0 0.0 + material group in nuclide mean std. dev. +1 10001 1 total 0.312163 0.015322 +0 10001 2 total 0.295421 0.027445 + material group in nuclide mean std. dev. +1 10001 1 total 0.310121 0.033788 +0 10001 2 total 0.296264 0.043792 + material group in group out nuclide moment mean std. dev. +12 10001 1 1 total P0 0.310121 0.033788 +13 10001 1 1 total P1 0.038230 0.008484 +14 10001 1 1 total P2 0.020745 0.004696 +15 10001 1 1 total P3 0.007964 0.003732 +8 10001 1 2 total P0 0.000000 0.000000 +9 10001 1 2 total P1 0.000000 0.000000 +10 10001 1 2 total P2 0.000000 0.000000 +11 10001 1 2 total P3 0.000000 0.000000 +4 10001 2 1 total P0 0.000000 0.000000 +5 10001 2 1 total P1 0.000000 0.000000 +6 10001 2 1 total P2 0.000000 0.000000 +7 10001 2 1 total P3 0.000000 0.000000 +0 10001 2 2 total P0 0.296264 0.043792 +1 10001 2 2 total P1 -0.011214 0.016180 +2 10001 2 2 total P2 0.008837 0.011504 +3 10001 2 2 total P3 -0.003270 0.007329 + material group in group out nuclide moment mean std. dev. +12 10001 1 1 total P0 0.310121 0.033788 +13 10001 1 1 total P1 0.038230 0.008484 +14 10001 1 1 total P2 0.020745 0.004696 +15 10001 1 1 total P3 0.007964 0.003732 +8 10001 1 2 total P0 0.000000 0.000000 +9 10001 1 2 total P1 0.000000 0.000000 +10 10001 1 2 total P2 0.000000 0.000000 +11 10001 1 2 total P3 0.000000 0.000000 +4 10001 2 1 total P0 0.000000 0.000000 +5 10001 2 1 total P1 0.000000 0.000000 +6 10001 2 1 total P2 0.000000 0.000000 +7 10001 2 1 total P3 0.000000 0.000000 +0 10001 2 2 total P0 0.296264 0.043792 +1 10001 2 2 total P1 -0.011214 0.016180 +2 10001 2 2 total P2 0.008837 0.011504 +3 10001 2 2 total P3 -0.003270 0.007329 + material group in group out nuclide mean std. dev. +3 10001 1 1 total 1.0 0.108779 +2 10001 1 2 total 0.0 0.000000 +1 10001 2 1 total 0.0 0.000000 +0 10001 2 2 total 1.0 0.142427 + material group in group out nuclide mean std. dev. +3 10001 1 1 total 0.0 0.0 +2 10001 1 2 total 0.0 0.0 +1 10001 2 1 total 0.0 0.0 +0 10001 2 2 total 0.0 0.0 + material group out nuclide mean std. dev. +1 10001 1 total 0.0 0.0 +0 10001 2 total 0.0 0.0 + material group in nuclide mean std. dev. +1 10002 1 total 0.664572 0.031215 +0 10002 2 total 2.052384 0.224343 + material group in nuclide mean std. dev. +1 10002 1 total 0.290565 0.023852 +0 10002 2 total 1.516438 0.235197 + material group in nuclide mean std. dev. +1 10002 1 total 0.290565 0.023852 +0 10002 2 total 1.516438 0.235197 + material group in nuclide mean std. dev. +1 10002 1 total 0.000690 0.000044 +0 10002 2 total 0.031687 0.003747 + material group in nuclide mean std. dev. +1 10002 1 total 0.000690 0.000044 +0 10002 2 total 0.031687 0.003747 + material group in nuclide mean std. dev. +1 10002 1 total 0.0 0.0 +0 10002 2 total 0.0 0.0 + material group in nuclide mean std. dev. +1 10002 1 total 0.0 0.0 +0 10002 2 total 0.0 0.0 + material group in nuclide mean std. dev. +1 10002 1 total 0.0 0.0 +0 10002 2 total 0.0 0.0 + material group in nuclide mean std. dev. +1 10002 1 total 0.663882 0.031173 +0 10002 2 total 2.020697 0.220604 + material group in nuclide mean std. dev. +1 10002 1 total 0.671269 0.026186 +0 10002 2 total 2.035388 0.258060 + material group in group out nuclide moment mean std. dev. +12 10002 1 1 total P0 0.639901 0.024709 +13 10002 1 1 total P1 0.381167 0.016243 +14 10002 1 1 total P2 0.152392 0.008156 +15 10002 1 1 total P3 0.009148 0.003889 +8 10002 1 2 total P0 0.031368 0.001728 +9 10002 1 2 total P1 0.008758 0.000926 +10 10002 1 2 total P2 -0.002568 0.001014 +11 10002 1 2 total P3 -0.003785 0.000817 +4 10002 2 1 total P0 0.000443 0.000445 +5 10002 2 1 total P1 0.000400 0.000401 +6 10002 2 1 total P2 0.000320 0.000321 +7 10002 2 1 total P3 0.000214 0.000215 +0 10002 2 2 total P0 2.034945 0.257800 +1 10002 2 2 total P1 0.509941 0.051236 +2 10002 2 2 total P2 0.111175 0.013020 +3 10002 2 2 total P3 0.024988 0.008312 + material group in group out nuclide moment mean std. dev. +12 10002 1 1 total P0 0.639901 0.024709 +13 10002 1 1 total P1 0.381167 0.016243 +14 10002 1 1 total P2 0.152392 0.008156 +15 10002 1 1 total P3 0.009148 0.003889 +8 10002 1 2 total P0 0.031368 0.001728 +9 10002 1 2 total P1 0.008758 0.000926 +10 10002 1 2 total P2 -0.002568 0.001014 +11 10002 1 2 total P3 -0.003785 0.000817 +4 10002 2 1 total P0 0.000443 0.000445 +5 10002 2 1 total P1 0.000400 0.000401 +6 10002 2 1 total P2 0.000320 0.000321 +7 10002 2 1 total P3 0.000214 0.000215 +0 10002 2 2 total P0 2.034945 0.257800 +1 10002 2 2 total P1 0.509941 0.051236 +2 10002 2 2 total P2 0.111175 0.013020 +3 10002 2 2 total P3 0.024988 0.008312 + material group in group out nuclide mean std. dev. +3 10002 1 1 total 1.0 0.038609 +2 10002 1 2 total 1.0 0.067667 +1 10002 2 1 total 1.0 1.414214 +0 10002 2 2 total 1.0 0.135929 + material group in group out nuclide mean std. dev. +3 10002 1 1 total 0.0 0.0 +2 10002 1 2 total 0.0 0.0 +1 10002 2 1 total 0.0 0.0 +0 10002 2 2 total 0.0 0.0 + material group out nuclide mean std. dev. +1 10002 1 total 0.0 0.0 +0 10002 2 total 0.0 0.0 diff --git a/tests/test_mgxs_library_no_nuclides/test_mgxs_library_no_nuclides.py b/tests/test_mgxs_library_no_nuclides/test_mgxs_library_no_nuclides.py index 6ee8813d03..2c0a2e278c 100644 --- a/tests/test_mgxs_library_no_nuclides/test_mgxs_library_no_nuclides.py +++ b/tests/test_mgxs_library_no_nuclides/test_mgxs_library_no_nuclides.py @@ -6,27 +6,28 @@ import glob import hashlib sys.path.insert(0, os.pardir) from testing_harness import PyAPITestHarness +from input_set import PinCellInputSet import openmc import openmc.mgxs class MGXSTestHarness(PyAPITestHarness): def _build_inputs(self): - - # The openmc.mgxs module needs a summary.h5 file - self._input_set.settings.output = {'summary': True} + # Set the input set to use the pincell model + self._input_set = PinCellInputSet() # Generate inputs using parent class routine super(MGXSTestHarness, self)._build_inputs() # Initialize a two-group structure - energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, 20.]) + energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, + 20.]) # Initialize MGXS Library for a few cross section types self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry) self.mgxs_lib.by_nuclide = False - self.mgxs_lib.mgxs_types = ['transport', 'nu-fission', - 'nu-scatter matrix', 'chi'] + # Test all MGXS types + self.mgxs_lib.mgxs_types = openmc.mgxs.MGXS_TYPES self.mgxs_lib.energy_groups = energy_groups self.mgxs_lib.legendre_order = 3 self.mgxs_lib.domain_type = 'material' @@ -53,7 +54,7 @@ class MGXSTestHarness(PyAPITestHarness): for mgxs_type in self.mgxs_lib.mgxs_types: mgxs = self.mgxs_lib.get_mgxs(domain, mgxs_type) df = mgxs.get_pandas_dataframe() - outstr += df.to_string() + outstr += df.to_string() + '\n' # Hash the results if necessary if hash_output: diff --git a/tests/test_mgxs_library_nuclides/inputs_true.dat b/tests/test_mgxs_library_nuclides/inputs_true.dat index 9e25fe96a6..8dbb564c65 100644 --- a/tests/test_mgxs_library_nuclides/inputs_true.dat +++ b/tests/test_mgxs_library_nuclides/inputs_true.dat @@ -1 +1 @@ -791a2bd647b8bae03aafc39e29ff1ce1ffc44063b0d757ccba4e1eda6eb73b8a275020f4f5774b17dede49fbf15549787279c8b2fc45caba0097155b32e56fa8 \ No newline at end of file +eebb1469278f470b5859ed83e9b6526e7c4e3fed503bd22e414c6dc13b19b8e4cb6a44e3c14269e6e173f43056eda78268f455662ae119280bc18ea6a071dac7 \ No newline at end of file diff --git a/tests/test_mgxs_library_nuclides/results_true.dat b/tests/test_mgxs_library_nuclides/results_true.dat index 06f838206f..4f47bd417f 100644 --- a/tests/test_mgxs_library_nuclides/results_true.dat +++ b/tests/test_mgxs_library_nuclides/results_true.dat @@ -1 +1 @@ -1ee58383dc8ac46c5e0d72321cbc34b0dba531435d5e0e632cbbf9572eb7d669c8c8ad9f370345325afa0bdeb2f818b0f5204b7c4a7c4aaf58ded7acbd715ef8 \ No newline at end of file +a631b8a347f344d822e6300ed2576caa7c05a74daedeb4aaaabfb89570942cff1bbd47ad7f81306e668e12266404f7abdcf680fdfeb5a4835579892e32bf57e8 \ No newline at end of file diff --git a/tests/test_mgxs_library_nuclides/test_mgxs_library_nuclides.py b/tests/test_mgxs_library_nuclides/test_mgxs_library_nuclides.py index 47c1ec60ae..da613d78a1 100644 --- a/tests/test_mgxs_library_nuclides/test_mgxs_library_nuclides.py +++ b/tests/test_mgxs_library_nuclides/test_mgxs_library_nuclides.py @@ -6,27 +6,28 @@ import glob import hashlib sys.path.insert(0, os.pardir) from testing_harness import PyAPITestHarness +from input_set import PinCellInputSet import openmc import openmc.mgxs class MGXSTestHarness(PyAPITestHarness): def _build_inputs(self): - - # The openmc.mgxs module needs a summary.h5 file - self._input_set.settings.output = {'summary': True} + # Set the input set to use the pincell model + self._input_set = PinCellInputSet() # Generate inputs using parent class routine super(MGXSTestHarness, self)._build_inputs() # Initialize a two-group structure - energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, 20.]) + energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625e-6, + 20.]) # Initialize MGXS Library for a few cross section types self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry) self.mgxs_lib.by_nuclide = True - self.mgxs_lib.mgxs_types = ['transport', 'nu-fission', - 'nu-scatter matrix', 'chi'] + # Test all MGXS types + self.mgxs_lib.mgxs_types = openmc.mgxs.MGXS_TYPES self.mgxs_lib.energy_groups = energy_groups self.mgxs_lib.legendre_order = 3 self.mgxs_lib.domain_type = 'material' @@ -53,7 +54,7 @@ class MGXSTestHarness(PyAPITestHarness): for mgxs_type in self.mgxs_lib.mgxs_types: mgxs = self.mgxs_lib.get_mgxs(domain, mgxs_type) df = mgxs.get_pandas_dataframe() - outstr += df.to_string() + outstr += df.to_string() + '\n' # Hash the results if necessary if hash_output: diff --git a/tests/testing_harness.py b/tests/testing_harness.py index e659768856..d360184045 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -6,7 +6,6 @@ import hashlib from optparse import OptionParser import os import shutil -from subprocess import Popen, STDOUT, PIPE, call import sys import numpy as np @@ -18,6 +17,7 @@ import openmc class TestHarness(object): """General class for running OpenMC regression tests.""" + def __init__(self, statepoint_name, tallies_present=False): self._sp_name = statepoint_name self._tallies = tallies_present @@ -74,13 +74,13 @@ class TestHarness(object): def _test_output_created(self): """Make sure statepoint.* and tallies.out have been created.""" statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name)) - assert len(statepoint) == 1, 'Either multiple or no statepoint files ' \ - 'exist.' + assert len(statepoint) == 1, 'Either multiple or no statepoint files' \ + ' exist.' assert statepoint[0].endswith('h5'), \ - 'Statepoint file is not a HDF5 file.' + 'Statepoint file is not a HDF5 file.' if self._tallies: assert os.path.exists(os.path.join(os.getcwd(), 'tallies.out')), \ - 'Tally output file does not exist.' + 'Tally output file does not exist.' def _get_results(self, hash_output=False): """Digest info in the statepoint and return as a string.""" @@ -98,7 +98,7 @@ class TestHarness(object): tally_num = 1 for tally_ind in sp.tallies: tally = sp.tallies[tally_ind] - results = np.zeros((tally.sum.size*2, )) + results = np.zeros((tally.sum.size * 2, )) results[0::2] = tally.sum.ravel() results[1::2] = tally.sum_sq.ravel() results = ['{0:12.6E}'.format(x) for x in results] @@ -144,6 +144,7 @@ class TestHarness(object): class HashedTestHarness(TestHarness): """Specialized TestHarness that hashes the results.""" + def _get_results(self): """Digest info in the statepoint and return as a string.""" return super(HashedTestHarness, self)._get_results(True) @@ -151,6 +152,7 @@ class HashedTestHarness(TestHarness): class CMFDTestHarness(TestHarness): """Specialized TestHarness for running OpenMC CMFD tests.""" + def _get_results(self): """Digest info in the statepoint and return as a string.""" # Read the statepoint file. @@ -184,6 +186,7 @@ class CMFDTestHarness(TestHarness): class ParticleRestartTestHarness(TestHarness): """Specialized TestHarness for running OpenMC particle restart tests.""" + def _run_openmc(self): # Set arguments args = {'openmc_exec': self._opts.exe} @@ -204,9 +207,9 @@ class ParticleRestartTestHarness(TestHarness): """Make sure the restart file has been created.""" particle = glob.glob(os.path.join(os.getcwd(), self._sp_name)) assert len(particle) == 1, 'Either multiple or no particle restart ' \ - 'files exist.' + 'files exist.' assert particle[0].endswith('h5'), \ - 'Particle restart file is not a HDF5 file.' + 'Particle restart file is not a HDF5 file.' def _get_results(self): """Digest info in the statepoint and return as a string.""" @@ -229,10 +232,10 @@ class ParticleRestartTestHarness(TestHarness): outstr += 'particle energy:\n' outstr += "{0:12.6E}\n".format(p.energy) outstr += 'particle xyz:\n' - outstr += "{0:12.6E} {1:12.6E} {2:12.6E}\n".format(p.xyz[0],p.xyz[1], + outstr += "{0:12.6E} {1:12.6E} {2:12.6E}\n".format(p.xyz[0], p.xyz[1], p.xyz[2]) outstr += 'particle uvw:\n' - outstr += "{0:12.6E} {1:12.6E} {2:12.6E}\n".format(p.uvw[0],p.uvw[1], + outstr += "{0:12.6E} {1:12.6E} {2:12.6E}\n".format(p.uvw[0], p.uvw[1], p.uvw[2]) return outstr @@ -240,13 +243,15 @@ class ParticleRestartTestHarness(TestHarness): class PyAPITestHarness(TestHarness): def __init__(self, statepoint_name, tallies_present=False, mg=False): - super(PyAPITestHarness, self).__init__(statepoint_name, tallies_present) + super(PyAPITestHarness, self).__init__(statepoint_name, + tallies_present) self.parser.add_option('--build-inputs', dest='build_only', action='store_true', default=False) if mg: self._input_set = MGInputSet() else: self._input_set = InputSet() + def main(self): """Accept commandline arguments and either run or update tests.""" (self._opts, self._args) = self.parser.parse_args() @@ -321,7 +326,8 @@ class PyAPITestHarness(TestHarness): compare = filecmp.cmp('inputs_test.dat', 'inputs_true.dat') if not compare: f = open('inputs_test.dat') - for line in f.readlines(): print(line) + for line in f.readlines(): + print(line) f.close() os.rename('inputs_test.dat', 'inputs_error.dat') assert compare, 'Input files are broken.'