diff --git a/saltproc/abc.py b/saltproc/abc.py index 57177c160..379b53f19 100644 --- a/saltproc/abc.py +++ b/saltproc/abc.py @@ -153,5 +153,23 @@ def update_depletable_materials(self, mats, dep_end_time): """ + def read_plaintext_file(self, file_path): + """Reads the content of a plaintext file for use by other methods. + + Parameters + ---------- + file_path : str + Path to file. + + Returns + ------- + file_lines : list of str + File lines. + + """ + file_lines = [] + with open(file_path, 'r') as file: + file_lines = file.readlines() + return file_lines diff --git a/saltproc/app.py b/saltproc/app.py index 231035043..184ea41c4 100644 --- a/saltproc/app.py +++ b/saltproc/app.py @@ -65,6 +65,28 @@ def run(): mats = depcode.read_depleted_materials(True) simulation.store_mat_data(mats, step_idx, False) simulation.store_run_step_info() + + # Preserve depletion and statepoint results files if using OpenMC + if depcode.codename == 'openmc': + depletion_results_path = \ + depcode.output_path / f'depletion_results_{step_idx}.h5' + (depcode.output_path / 'depletion_results.h5').rename(depletion_results_path) + + if step_idx != 0: + statepoint_fname = f'openmc_simulation_n0.h5' + statepoint_path = \ + depcode.output_path / f'openmc_simulation_n{step_idx}.h5' + # rename "base" to "0" + if step_idx == len(msr.depletion_timesteps) - 1: + statepoint_path = \ + depcode.output_path / f'openmc_simulation_n0.h5' + (depcode.output_path / 'openmc_simulation_base.h5').rename(statepoint_path) + + else: + statepoint_path = depletion_results_path = \ + depcode.output_path / f'openmc_simulation_base.h5' + (depcode.output_path / statepoint_fname).rename(statepoint_path) + # Reprocessing here print("\nMass and volume of fuel before reproc: %f g, %f cm3" % (mats['fuel'].mass, diff --git a/saltproc/openmc_depcode.py b/saltproc/openmc_depcode.py index 2aa8ae89f..a3b598a38 100644 --- a/saltproc/openmc_depcode.py +++ b/saltproc/openmc_depcode.py @@ -94,7 +94,7 @@ def __init__(self, 'settings': str((output_path / 'settings.xml').resolve())} self.runtime_matfile = str((output_path / 'materials.xml').resolve()) - self._check_for_material_names(self.runtime_matfile) + self._check_for_material_names(self.template_input_file_path['materials']) def _check_for_material_names(self, filename): """Checks that all materials in the material file @@ -186,6 +186,7 @@ def read_depleted_materials(self, read_at_end=False): else: burnup = 0 depleted_materials[name].burnup = burnup + del openmc_materials, depleted_openmc_materials, starting_openmc_materials return depleted_materials def _create_mass_percents_dictionary(self, mat): @@ -311,10 +312,11 @@ def write_runtime_input(self, reactor, depletion_step, restart): """ if depletion_step == 0 and not restart: + geo_file = self.geo_file_paths.pop(0) materials = openmc.Materials.from_xml( self.template_input_file_path['materials']) geometry = openmc.Geometry.from_xml( - self.geo_file_paths[0], materials=materials) + geo_file, materials=materials) settings = openmc.Settings.from_xml( self.template_input_file_path['settings']) self.npop = settings.particles @@ -393,6 +395,29 @@ def update_depletable_materials(self, mats, dep_end_time): Current time at the end of the depletion step (d). """ + runtime_materials = openmc.Materials.from_xml(self.runtime_matfile) + + for material in runtime_materials: + # depletable materials only + if material.name in mats.keys(): + components = {} + for nuc_code, mass_fraction in mats[material.name].comp.items(): + nuc_name = pyname.name(nuc_code) + # Convert nuclide names from PyNE format to OpenMC format + if nuc_name[-1] == 'M': + nuc_name = nuc_name[:-1] + '_m1' + components[nuc_name] = mass_fraction + + material.set_density(mats[material.name].density) + material.volume = mats[material.name].vol + for element in material.get_elements(): + material.remove_element(element) + material.add_components(components, percent_type='wo') + + runtime_materials.export_to_xml(path=self.runtime_materials) + del runtime_materials + del material + def write_saltproc_openmc_tallies(self, materials, geometry): """ diff --git a/saltproc/serpent_depcode.py b/saltproc/serpent_depcode.py index 1fd2b3ecd..bac5a4b67 100644 --- a/saltproc/serpent_depcode.py +++ b/saltproc/serpent_depcode.py @@ -395,25 +395,6 @@ def read_neutronics_parameters(self): self.neutronics_parameters['fission_mass_eds'] = \ res['TOT_FMASS'][1] - def read_plaintext_file(self, file_path): - """Reads the content of a plaintext file for use by other methods. - - Parameters - ---------- - file_path : str - Path to file. - - Returns - ------- - file_lines : list of str - File lines. - - """ - file_lines = [] - with open(file_path, 'r') as file: - file_lines = file.readlines() - return file_lines - def set_power_load(self, file_lines, reactor, diff --git a/tests/integration_tests/file_interface_openmc/test.py b/tests/integration_tests/file_interface_openmc/test.py index 05d253478..5d217db56 100644 --- a/tests/integration_tests/file_interface_openmc/test.py +++ b/tests/integration_tests/file_interface_openmc/test.py @@ -15,50 +15,62 @@ def geometry_switch(scope='module'): def test_write_runtime_input(openmc_depcode, openmc_reactor): - # OpenMC - input_materials = openmc.Materials.from_xml( - openmc_depcode.template_input_file_path['materials']) - input_geometry = openmc.Geometry.from_xml( - openmc_depcode.geo_file_paths[0], - materials=input_materials) + initial_geometry_file = openmc_depcode.geo_file_paths[0] + + # compare settings, geometry, and material files + settings_file = openmc_depcode.template_input_file_path['settings'] + geometry_file = openmc_depcode.geo_file_paths[0] + materials_file = openmc_depcode.template_input_file_path['materials'] + ref_files = (settings_file, geometry_file, materials_file) + + # write_runtime_input + openmc_depcode.write_runtime_input(openmc_reactor, + 0, + False) + + settings_file = openmc_depcode.runtime_inputfile['settings'] + geometry_file = openmc_depcode.runtime_inputfile['geometry'] + material_file = openmc_depcode.runtime_matfile + test_files = (settings_file, geometry_file, materials_file) + + for ref_file, test_file in zip(ref_files, test_files): + ref_filelines = openmc_depcode.read_plaintext_file(ref_file) + test_filelines = openmc_depcode.read_plaintext_file(test_file) + for i in range(len(ref_filelines)): + assert ref_filelines[i] == test_filelines[i] + + openmc_depcode.geo_file_paths *= 2 + openmc_depcode.geo_file_paths[0] = initial_geometry_file - input_cells = input_geometry.get_all_cells() - input_lattices = input_geometry.get_all_lattices() - input_surfaces = input_geometry.get_all_surfaces() - input_universes = input_geometry.get_all_universes() +def test_update_depletable_materials(openmc_depcode, openmc_reactor): + initial_geometry_file = openmc_depcode.geo_file_paths[0] + # write_runtime_input openmc_depcode.write_runtime_input(openmc_reactor, - 0, - False) - # Load in the runtime_ objects - runtime_materials = openmc.Materials.from_xml(openmc_depcode.runtime_matfile) - runtime_geometry = openmc.Geometry.from_xml( - openmc_depcode.runtime_inputfile['geometry'], - materials=runtime_materials) - runtime_settings = openmc.Settings.from_xml( - openmc_depcode.runtime_inputfile['settings']) + 0, + False) + # update_depletable_materials + old_output_path = openmc_depcode.output_path - runtime_cells = runtime_geometry.get_all_cells() - runtime_lattices = runtime_geometry.get_all_lattices() - runtime_surfaces = runtime_geometry.get_all_surfaces() - runtime_universes = runtime_geometry.get_all_universes() + # switch output_path to where read_depleted_materials will pick up the correct database + openmc_depcode.output_path = Path(openmc_depcode.runtime_matfile).parents[1] + ref_materials = openmc_depcode.read_depleted_materials(True) + openmc_depcode.output_path = old_output_path - # an easier approach may just be to compare the - # file contents themselves - assertion_dict = {'mat': (input_materials, runtime_materials), - 'cells': (input_cells, runtime_cells), - 'lattices': (input_lattices, runtime_lattices), - 'surfs': (input_surfaces, runtime_surfaces), - 'univs': (input_universes, runtime_universes)} + openmc_depcode.update_depletable_materials(ref_materials, 12.0) + test_mats = openmc.Materials.from_xml(openmc_depcode.runtime_matfile) - _check_openmc_iterables_equal(assertion_dict) - assert runtime_settings.inactive == openmc_depcode.inactive_cycles - assert runtime_settings.batches == openmc_depcode.active_cycles + \ - openmc_depcode.inactive_cycles - assert runtime_settings.particles == openmc_depcode.npop + # compare material objects + for material in test_mats: + if material.name in ref_mats.keys(): + ref_material = ref_mats[material.name] + test_material = openmc_depcode._create_mass_percents_dictionary(material) + for key in test_material.keys(): + np.testing.assert_almost_equal(ref_material[key], test_material[key], decimal=5) - del runtime_materials, runtime_geometry - del input_materials, input_geometry + remove(openmc_depcode.runtime_matfile) + openmc_depcode.geo_file_paths *= 2 + openmc_depcode.geo_file_paths[0] = initial_geometry_file def test_write_depletion_settings(openmc_depcode, openmc_reactor): @@ -118,199 +130,23 @@ def test_write_saltproc_openmc_tallies(openmc_depcode): assert tal4.scores[0] == 'heating' -def test_switch_to_next_geometry(openmc_depcode): - # OpenMC - mat = openmc.Materials.from_xml( - openmc_depcode.template_input_file_path['materials']) - expected_geometry = openmc.Geometry.from_xml( - openmc_depcode.geo_file_paths[0], mat) - expected_cells = expected_geometry.get_all_cells() - expected_lattices = expected_geometry.get_all_lattices() - expected_surfaces = expected_geometry.get_all_surfaces() - expected_universes = expected_geometry.get_all_universes() - del expected_geometry - - openmc_depcode.switch_to_next_geometry() - switched_geometry = openmc.Geometry.from_xml( - openmc_depcode.runtime_inputfile['geometry'], mat) - - switched_cells = switched_geometry.get_all_cells() - switched_lattices = switched_geometry.get_all_lattices() - switched_surfaces = switched_geometry.get_all_surfaces() - switched_universes = switched_geometry.get_all_universes() - del switched_geometry - - assertion_dict = {'cells': (expected_cells, switched_cells), - 'lattices': (expected_lattices, switched_lattices), - 'surfs': (expected_surfaces, switched_surfaces), - 'univs': (expected_universes, switched_universes)} - - _check_openmc_iterables_equal(assertion_dict) - - del mat - - -def _check_openmc_iterables_equal(iterable_dict): - """ - Helper function to check equality iterables contained in a dictionary. - - Parameters: - iterable_dict : dict of str to 2-tuple - Dictionary containing tuples of iterables to compare - """ - for object_type in iterable_dict: - object1_iterable, object2_iterable = iterable_dict[object_type] - assert len(object1_iterable) == len(object2_iterable) - iterable = _get_iterable_for_object(object1_iterable) - if issubclass(type(object1_iterable), np.ndarray): - object1_iterable = object1_iterable.flatten() - object2_iterable = object2_iterable.flatten() - for ref in iterable: - object1 = object2_iterable[ref] - object2 = object1_iterable[ref] - _check_openmc_objects_equal(object1, object2) - - -def _get_iterable_for_object(iterable_object): - # helper function to DRY - iterable_type = type(iterable_object) - if issubclass( - iterable_type, - list) or issubclass( - iterable_type, - tuple) or issubclass( - iterable_type, - np.ndarray): - if issubclass(iterable_type, np.ndarray): - iterable_object = iterable_object.flatten() - iterable = range(0, len(iterable_object)) - elif issubclass(iterable_type, dict): - iterable = iterable_object - else: - raise ValueError( - f"Iterable of type {type(iterable_object)} is unsupported") - return iterable - - -def _check_openmc_objects_equal(object1, object2): - """ - Helper function for the unit tests to determine equality of - various OpenMC objects - - Parameters - ---------- - object1 : openmc_depcode.Surface, \ - openmc_depcode.Universe, \ - openmc_depcode.Cell, \ - openmc_depcode.Material, \ - openmc_depcode.Lattice - First openmc object to compare - object2 : openmc_depcode.Surface, \ - openmc_depcode.Universe, \ - openmc_depcode.Cell, \ - openmc_depcode.Material, \ - openmc_depcode.Lattice - Second openmc object to compare - - """ - try: - object_type = type(object1) - assert isinstance(object2, object_type) - assert object1.id == object2.id - assert object1.name == object2.name - if object_type == openmc.Material: - assert object1.density == object2.density - assert object1.nuclides == object2.nuclides - assert object1.temperature == object2.temperature - assert object1.volume == object2.volume - assert object1._sab == object2._sab - - elif object_type == openmc.Cell: - assert object1.fill_type == object2.fill_type - _check_none_or_openmc_object_equal(object1.fill, object2.fill) - assert object1.region == object2.region - _check_none_or_iterable_of_ndarray_equal( - object1.rotation, object2.rotation) - _check_none_or_iterable_of_ndarray_equal( - object1.rotation_matrix, object2.rotation_matrix) - _check_none_or_iterable_of_ndarray_equal( - object1.translation, object2.translation) - assert object1.volume == object2.volume - # assert object1.atoms == object2.atoms - - elif issubclass(object_type, openmc.Lattice): - assert object1.shape == object2.shape - assert object1.lower_left == object2.lower_left - assert object1.pitch == object2.pitch - _check_none_or_openmc_object_equal(object1.outer, object2.outer) - _check_openmc_iterables_equal( - {'univ': (object1.universes, object2.universes)}) - - elif issubclass(object_type, openmc.Surface): - assert object1.boundary_type == object2.boundary_type - _check_none_or_iterable_of_ndarray_equal( - object1.coefficients, object2.coefficients) - assert object1.type == object2.type - - elif object_type == openmc.Universe: - _check_openmc_iterables_equal( - {'cells': (object1.cells, object2.cells)}) - assert object1.volume == object2.volume - _check_none_or_iterable_of_ndarray_equal( - object1.bounding_box, object2.bounding_box) - else: - raise ValueError( - f"Object of type {object_type} is not an openmc object.") - - except AssertionError: - raise AssertionError( - f"objects of type {object_type} with ids {object1.id} and \ - {object2.id} not equal") - - -def _check_none_or_openmc_object_equal(object1, object2): - if object1 is None: - assert object2 is None - else: - _check_openmc_objects_equal(object1, object2) - - -def _check_none_or_iterable_of_ndarray_equal(object1, object2): - # helper function to DRY - if issubclass(type(object1), np.ndarray): - assert (object1 == object2).all() - elif issubclass(type(object1), tuple) or issubclass(type(object1), list): - iterable = _get_iterable_for_object(object1) - for ref in iterable: - subobject1 = object1[ref] - subobject2 = object2[ref] - _check_none_or_iterable_of_ndarray_equal(subobject1, subobject2) - else: - assert object1 == object2 - -def test_write_runtime_files(openmc_depcode, openmc_reactor): - ref_mats = openmc_depcode.read_depleted_materials(True) - - # update_depletable_materials - openmc_depcode.update_depletable_materials(mats, 12.0) - file = openmc_depcode.runtime_matfile - test_mats = openmc.Materials.from_xml(openmc_depcode.runtime_matfile) - - # compare material objects - ... - - remove(openmc_depcode.runtime_matfile) +def test_switch_to_next_geometry(openmc_depcode, openmc_reactor): + initial_geometry_file = openmc_depcode.geo_file_paths[0] + ref_geometry_file = openmc_depcode.geo_file_paths[1] # write_runtime_input openmc_depcode.write_runtime_input(openmc_reactor, 0, False) - settings_file = openmc_depcode.runtime_inputfile['settings'] - geometry_file = openmc_depcode.runtime_inputfile['geometry'] + openmc_depcode.switch_to_next_geometry() + test_geometry_file = openmc_depcode.runtime_inputfile['geometry'] + + - # compare settings and geometry files - ... + ref_filelines = openmc_depcode.read_plaintext_file(ref_geometry_file) + test_filelines = openmc_depcode.read_plaintext_file(test_geometry_file) + for i in range(len(ref_filelines)): + assert ref_filelines[i] == test_filelines[i] - # switch_to_next_geometry - ... + openmc_depcode.geo_file_paths = [initial_geometry_file, ref_geometry_file] diff --git a/tests/openmc_data/saltproc_runtime_ref/geometry.xml b/tests/openmc_data/saltproc_runtime_ref/geometry.xml deleted file mode 100644 index 80875d081..000000000 --- a/tests/openmc_data/saltproc_runtime_ref/geometry.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3.0 3.0 - 5 5 - 7.5 4.6778257224916e-310 - -9 9 9 9 9 -9 8 9 8 9 -9 9 9 9 9 -9 8 9 8 9 -9 9 9 9 9 - - - 3.0 3.0 - 5 5 - 7.5 4.6778257224916e-310 - -9 9 9 9 9 -9 8 9 8 9 -9 9 9 9 9 -9 8 9 8 9 -19 9 9 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 9 9 9 -9 8 9 8 9 -9 9 9 9 9 -9 8 9 8 9 -22 9 9 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 8 9 8 9 -9 9 9 9 9 -9 8 9 8 9 -9 9 9 9 9 -9 8 9 8 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 8 9 9 -9 9 9 9 9 -8 9 8 9 8 -9 9 9 9 9 -9 9 8 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 8 9 9 -9 9 9 9 9 -8 9 8 9 8 -9 9 9 9 9 -17 9 8 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 8 9 9 -9 9 9 9 9 -8 9 8 9 8 -9 9 9 9 9 -18 9 8 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 8 9 9 -9 9 9 9 9 -8 9 8 9 8 -9 9 9 9 9 -20 9 8 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 8 9 9 -9 9 9 9 9 -8 9 8 9 8 -9 9 9 9 9 -21 9 8 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 9 9 9 -9 9 9 9 9 -9 8 9 8 9 -9 9 9 9 9 -9 9 9 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 9 9 9 -9 9 8 9 9 -9 9 9 9 9 -9 9 8 9 9 -9 9 9 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 9 9 9 -9 9 9 9 9 -9 9 9 9 9 -9 9 9 9 9 -9 9 9 9 9 - - - 3.0 3.0 - 5 5 - 7.5 0.0 - -9 9 9 9 9 -8 9 8 9 8 -9 9 9 9 9 -8 9 8 9 8 -9 9 9 9 9 - - - 15.0 15.0 - 10 10 - 75.0 0.0 - -58 58 58 58 58 58 58 58 58 58 -25 61 25 55 58 58 58 58 58 58 -34 37 34 37 52 58 58 58 58 58 -25 61 25 61 25 61 25 58 58 58 -34 37 34 37 34 37 34 58 58 58 -25 61 25 61 31 61 25 55 58 58 -34 46 34 49 34 37 34 37 52 58 -25 61 28 61 25 61 25 61 25 58 -34 40 34 43 34 37 34 37 34 58 -25 61 25 61 25 61 25 61 25 58 - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/openmc_data/saltproc_runtime_ref/materials.xml b/tests/openmc_data/saltproc_runtime_ref/materials.xml deleted file mode 100644 index a67866961..000000000 --- a/tests/openmc_data/saltproc_runtime_ref/materials.xml +++ /dev/null @@ -1,2683 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/openmc_data/saltproc_runtime_ref/settings.xml b/tests/openmc_data/saltproc_runtime_ref/settings.xml deleted file mode 100644 index eb9f8920c..000000000 --- a/tests/openmc_data/saltproc_runtime_ref/settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - eigenvalue - 50 - 40 - 20 - diff --git a/tests/openmc_data/tap_input.json b/tests/openmc_data/tap_input.json index 4f1274e40..d5255df9c 100644 --- a/tests/openmc_data/tap_input.json +++ b/tests/openmc_data/tap_input.json @@ -2,14 +2,13 @@ "proc_input_file": "../tap_processes.json", "dot_input_file": "../tap_paths.dot", "n_depletion_steps": 2, - "output_path": "saltproc_runtime_ref", "depcode": { "codename": "openmc", "template_input_file_path": { "materials": "tap_materials.xml", "settings": "tap_settings.xml" }, - "geo_file_paths": ["tap_geometry_base.xml"], + "geo_file_paths": ["tap_geometry_base.xml", "tap_geometry_switch.xml"], "chain_file_path": "test_chain.xml" }, "simulation": { diff --git a/tests/unit_tests/test_app.py b/tests/unit_tests/test_app.py index b50c37d07..74d8e57aa 100644 --- a/tests/unit_tests/test_app.py +++ b/tests/unit_tests/test_app.py @@ -45,7 +45,7 @@ def test_read_main_input(cwd, codename, ext): assert depcode_input['codename'] == codename assert depcode_input['geo_file_paths'][0] == \ str(data_path / ('tap_geometry_base' + ext)) - assert depcode_input['output_path'] == cwd / f'{codename}_data/saltproc_runtime' + assert depcode_input['output_path'] == cwd / (f'{codename}_data/saltproc_runtime') if codename == 'openmc': assert depcode_input['template_input_file_path'] == \ {'materials': str((input_path / 'tap_materials.xml').resolve()), diff --git a/tests/unit_tests/test_openmc_depcode.py b/tests/unit_tests/test_openmc_depcode.py index c88ccc6d4..ad8c05a00 100644 --- a/tests/unit_tests/test_openmc_depcode.py +++ b/tests/unit_tests/test_openmc_depcode.py @@ -50,7 +50,7 @@ def test_read_depleted_materials(openmc_depcode): def test_check_for_material_names(cwd, openmc_depcode): - matfile = openmc_depcode.runtime_matfile + matfile = openmc_depcode.template_input_file_path['materials'] nameless_matfile = str(cwd / 'openmc_data' / 'tap_materials_nameless.xml') # should pass openmc_depcode._check_for_material_names(matfile)