From 6b1ff6128464ff7f0d9fad31bc4bbbf58cdf566c Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Mon, 24 Oct 2016 09:50:46 -0400 Subject: [PATCH] updated input files --- .../python/pincell_multigroup/build-xml.py | 2 +- examples/xml/pincell_multigroup/materials.xml | 3 ++ examples/xml/pincell_multigroup/settings.xml | 2 - openmc/element.py | 3 +- openmc/material.py | 40 ------------------- openmc/settings.py | 4 -- src/input_xml.F90 | 2 +- tests/test_element_wo/inputs_true.dat | 2 +- tests/test_enrichment/inputs_true.dat | 2 +- 9 files changed, 9 insertions(+), 51 deletions(-) diff --git a/examples/python/pincell_multigroup/build-xml.py b/examples/python/pincell_multigroup/build-xml.py index 216c56539..1dcfc896b 100644 --- a/examples/python/pincell_multigroup/build-xml.py +++ b/examples/python/pincell_multigroup/build-xml.py @@ -83,6 +83,7 @@ water.add_macroscopic(h2o_data) # Instantiate a Materials collection and export to XML materials_file = openmc.Materials([uo2, water]) +materials_file.cross_sections = "./mgxs.h5" materials_file.export_to_xml() @@ -132,7 +133,6 @@ geometry.export_to_xml() # Instantiate a Settings object, set all runtime parameters, and export to XML settings_file = openmc.Settings() settings_file.energy_mode = "multi-group" -settings_file.cross_sections = "./mgxs.h5" settings_file.batches = batches settings_file.inactive = inactive settings_file.particles = particles diff --git a/examples/xml/pincell_multigroup/materials.xml b/examples/xml/pincell_multigroup/materials.xml index f75d7ef6f..61a5cc697 100644 --- a/examples/xml/pincell_multigroup/materials.xml +++ b/examples/xml/pincell_multigroup/materials.xml @@ -1,5 +1,8 @@ + + ./mgxs.h5 + diff --git a/examples/xml/pincell_multigroup/settings.xml b/examples/xml/pincell_multigroup/settings.xml index ab716d9e4..9adc17c9d 100644 --- a/examples/xml/pincell_multigroup/settings.xml +++ b/examples/xml/pincell_multigroup/settings.xml @@ -34,6 +34,4 @@ false - ./mgxs.h5 - diff --git a/openmc/element.py b/openmc/element.py index d3d3ac95d..10dfa06bc 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -276,6 +276,7 @@ class Element(object): # Create a list of the isotopes in this element isotopes = [] for nuclide, abundance in zip(nuclides, abundances): - isotopes.append((nuclide, percent*abundance, percent_type)) + pct = float('{:2.8g}'.format(percent*abundance)) + isotopes.append((nuclide, pct, percent_type)) return isotopes diff --git a/openmc/material.py b/openmc/material.py index 7b63ec800..f203878c1 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -759,16 +759,6 @@ class Materials(cv.CheckedList): cross section library. If it is not set, the :envvar:`OPENMC_MULTIPOLE_LIBRARY` environment variable will be used. A multipole library is optional. - temperature : dict - Defines a default temperature and method for treating intermediate - temperatures at which nuclear data doesn't exist. Accepted keys are - 'default', 'method', 'tolerance', and 'multipole'. The value for - 'default' should be a float representing the default temperature in - Kelvin. The value for 'method' should be 'nearest' or 'interpolation'. - If the method is 'nearest', 'tolerance' indicates a range of temperature - within which cross sections may be used. 'multipole' is a boolean - indicating whether or not the windowed multipole method should be used - to evaluate resolved resonance cross sections. """ @@ -778,7 +768,6 @@ class Materials(cv.CheckedList): self._materials_file = ET.Element("materials") self._cross_sections = None self._multipole_library = None - self._temperature = {} if materials is not None: self += materials @@ -791,10 +780,6 @@ class Materials(cv.CheckedList): def multipole_library(self): return self._multipole_library - @property - def temperature(self): - return self._temperature - @cross_sections.setter def cross_sections(self, cross_sections): cv.check_type('cross sections', cross_sections, string_types) @@ -805,23 +790,6 @@ class Materials(cv.CheckedList): cv.check_type('cross sections', multipole_library, string_types) self._multipole_library = multipole_library - @temperature.setter - def temperature(self, temperature): - cv.check_type('temperature settings', temperature, Mapping) - for key, value in temperature.items(): - cv.check_value('temperature key', key, - ['default', 'method', 'tolerance', 'multipole']) - if key == 'default': - cv.check_type('default temperature', value, Real) - elif key == 'method': - cv.check_value('temperature method', value, - ['nearest', 'interpolation']) - elif key == 'tolerance': - cv.check_type('temperature tolerance', value, Real) - elif key == 'multipole': - cv.check_type('temperature multipole', value, bool) - self._temperature = temperature - def add_material(self, material): """Append material to collection @@ -917,13 +885,6 @@ class Materials(cv.CheckedList): element = ET.SubElement(self._materials_file, "multipole_library") element.text = str(self._multipole_library) - def _create_temperature_subelements(self): - if self.temperature: - for key, value in sorted(self.temperature.items()): - element = ET.SubElement(self._materials_file, - "temperature_{}".format(key)) - element.text = str(value) - def export_to_xml(self, path='materials.xml'): """Export material collection to an XML file. @@ -940,7 +901,6 @@ class Materials(cv.CheckedList): self._create_material_subelements() self._create_cross_sections_subelement() self._create_multipole_library_subelement() - self._create_temperature_subelements() # Clean the indentation in the file to be user-readable sort_xml_elements(self._materials_file) diff --git a/openmc/settings.py b/openmc/settings.py index 75878226e..683324fa2 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -721,10 +721,6 @@ class Settings(object): @temperature.setter def temperature(self, temperature): - warnings.warn('Settings.temperature has been deprecated and will ' - 'be removed in a future version. Materials.temperature ' - 'should defined instead.', DeprecationWarning) - cv.check_type('temperature settings', temperature, Mapping) for key, value in temperature.items(): cv.check_value('temperature key', key, diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 3eb2cf2d4..cb65a0d35 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2095,7 +2095,7 @@ contains &find MG cross section libraries. Please consult the user's & &guide at http://mit-crpg.github.io/openmc for information on & &how to set up MG cross section libraries.") - else + else if (len_trim(env_variable) /= 0) then path_cross_sections = trim(env_variable) end if end if diff --git a/tests/test_element_wo/inputs_true.dat b/tests/test_element_wo/inputs_true.dat index da97abc33..068fa25cd 100644 --- a/tests/test_element_wo/inputs_true.dat +++ b/tests/test_element_wo/inputs_true.dat @@ -1 +1 @@ -f270ae43a29c53065678b419629ad713f5a4cc23c75825fee4da049d4159756f463fec86263a8dea6ce10fff6d60b24ebf100e8f5cc80e6d4fc31297ae1709ed \ No newline at end of file +89207d3b5639e54be2d2a3e4f8ea38a3b7d438c3d3da9d80d76b9fed9f2d44168dfad0ea273891a817ea87ba144107fdd3b9e1b89a2c8c08880a53d645e4af9a \ No newline at end of file diff --git a/tests/test_enrichment/inputs_true.dat b/tests/test_enrichment/inputs_true.dat index 49acd2945..34f9afe7e 100644 --- a/tests/test_enrichment/inputs_true.dat +++ b/tests/test_enrichment/inputs_true.dat @@ -1 +1 @@ -835357f7b3c10f1153bb5842978075d9bb788d639759f143dfe58064865712fdf4e17ce50747949411e7c5215f33371e883e48b670509e222fa338bbfe613b80 \ No newline at end of file +87a238e2fef484680349715d37fcac80b10a8b503381923e1aa324c462156802dc01ce07a38ab5d00878dbe26cebede7879227c819334be071086c8b5cb3e5ee \ No newline at end of file