diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index b54b255c6..1937bc109 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -267,12 +267,14 @@ based on the recommended value in LA-UR-14-24530_. ```` Element ------------------------------- -The ```` element has no attributes and indicates the -directory containing a windowed multipole library. If a windowed multipole -library is available, OpenMC can use it for on-the-fly Doppler-broadening of -resolved resonance range cross sections. If this element is absent from the -settings.xml file, the :envvar:`MULTIPOLE_LIBRARY` environment variable will be -used. +The ```` element indicates the directory containing a +windowed multipole library. If a windowed multipole library is available, +OpenMC can use it for on-the-fly Doppler-broadening of resolved resonance range +cross sections. If this element is absent from the settings.xml file, the +:envvar:`MULTIPOLE_LIBRARY` environment variable will be used. + + .. note:: The element must also be set to "True" + for windowed multipole functionality. .. _natural_elements: @@ -775,6 +777,17 @@ problem. It has the following attributes/sub-elements: *Default*: None + +```` Element +------------------------------------ + +The ```` element toggles the windowed multipole +capability on or off. If this element is set to "True" and the relevant data is +available, OpenMC will use the windowed multipole method to evaluate and Doppler +broaden cross sections in the resolved resonance range. + + *Default*: False + ```` Element ----------------------- diff --git a/openmc/settings.py b/openmc/settings.py index 71e5ebbc3..ec386c2f8 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -125,6 +125,9 @@ class SettingsFile(object): Coordinates of the lower-left point of the UFS mesh ufs_upper_right : tuple or list Coordinates of the upper-right point of the UFS mesh + use_windowed_multipole : bool + Whether or not windowed multipole can be used to evaluate resolved + resonance cross sections. """ @@ -201,6 +204,7 @@ class SettingsFile(object): self._settings_file = ET.Element("settings") self._run_mode_subelement = None self._source_element = None + self._multipole_active = None @property def run_mode(self): @@ -386,6 +390,10 @@ class SettingsFile(object): def dd_count_interactions(self): return self._dd_count_interactions + @property + def use_windowed_multipole(self): + return self._multipole_active + @run_mode.setter def run_mode(self, run_mode): if 'run_mode' not in ['eigenvalue', 'fixed source']: @@ -750,6 +758,11 @@ class SettingsFile(object): self._dd_count_interactions = interactions + @use_windowed_multipole.setter + def use_windowed_multipole(self, active): + check_type('use_windowed_multipole', active, bool) + self._multipole_active = active + def _create_run_mode_subelement(self): if self.run_mode == 'eigenvalue': @@ -1024,6 +1037,12 @@ class SettingsFile(object): subelement = ET.SubElement(element, "count_interactions") subelement.text = str(self._dd_count_interactions).lower() + def _create_use_multipole_subelement(self): + if self._multipole_active is not None: + element = ET.SubElement(self._settings_file, + "use_windowed_multipole") + element.text = str(self._multipole_active) + def export_to_xml(self): """Create a settings.xml file that can be used for a simulation. @@ -1059,6 +1078,7 @@ class SettingsFile(object): self._create_track_subelement() self._create_ufs_subelement() self._create_dd_subelement() + self._create_use_multipole_subelement() # Clean the indentation in the file to be user-readable clean_xml_indentation(self._settings_file) diff --git a/src/ace.F90 b/src/ace.F90 index 4ef77229e..f84b82030 100644 --- a/src/ace.F90 +++ b/src/ace.F90 @@ -114,7 +114,7 @@ contains end if ! Read multipole file into the appropriate entry on the nuclides array - call read_multipole_data(i_nuclide) + if (multipole_active) call read_multipole_data(i_nuclide) ! Add name and alias to dictionary call already_read % add(name) diff --git a/src/ace_header.F90 b/src/ace_header.F90 index 2d1ca9475..9decc49e7 100644 --- a/src/ace_header.F90 +++ b/src/ace_header.F90 @@ -112,7 +112,7 @@ module ace_header type(UrrData), pointer :: urr_data => null() ! Multipole data - logical :: mp_present + logical :: mp_present = .false. type(MultipoleArray), allocatable :: multipole ! Reactions diff --git a/src/global.F90 b/src/global.F90 index 15a88d205..81d634c77 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -91,6 +91,9 @@ module global ! What to assume for expanding natural elements integer :: default_expand = ENDF_BVII1 + ! Whether or not windowed multipole cross sections should be used. + logical :: multipole_active = .false. + ! ============================================================================ ! TALLY-RELATED VARIABLES diff --git a/src/input_xml.F90 b/src/input_xml.F90 index dc67d4b1f..c3e180257 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -1054,6 +1054,20 @@ contains end select end if + ! Check to see if windowed multipole functionality is requested + if (check_for_node(doc, "use_windowed_multipole")) then + call get_node_value(doc, "use_windowed_multipole", temp_str) + select case (to_lower(temp_str)) + case ('true', 't', '1', 'y') + multipole_active = .true. + case ('false', 'f', '0', 'n') + multipole_active = .false. + case default + call fatal_error("Unrecognized value for in & + &settings.xml") + end select + end if + ! Close settings XML file call close_xmldoc(doc) diff --git a/src/relaxng/settings.rnc b/src/relaxng/settings.rnc index 34886c650..c4fc79ad2 100644 --- a/src/relaxng/settings.rnc +++ b/src/relaxng/settings.rnc @@ -162,5 +162,7 @@ element settings { (element E_max { xsd:double } | attribute E_max { xsd:double })? }* - }? + }? & + + element use_windowed_multipole { xsd:boolean }? } diff --git a/src/relaxng/settings.rng b/src/relaxng/settings.rng index 1880153e2..15c37cc6e 100644 --- a/src/relaxng/settings.rng +++ b/src/relaxng/settings.rng @@ -738,5 +738,10 @@ + + + + + diff --git a/tests/test_multipole/inputs_true.dat b/tests/test_multipole/inputs_true.dat index a429c9b8d..04fc11746 100644 --- a/tests/test_multipole/inputs_true.dat +++ b/tests/test_multipole/inputs_true.dat @@ -1 +1 @@ -5c1cec635da5c4c869bdf58f62924a4cb1648e4ddecf0ce71b823cf45178767ba7f2e089b76d36e8616b1b21ffa43b32ab1b17d20bb74120f900b9e3e9ab9bcc \ No newline at end of file +7658bebe2b6f93feae06417a05bfd4bbbfca668eebd100d976543326439b82d16ea23752ac0537284e1839d9681714df116828daf30857bc83e86cc67e4550d7 \ No newline at end of file diff --git a/tests/test_multipole/test_multipole.py b/tests/test_multipole/test_multipole.py index a5437e433..ea3108557 100644 --- a/tests/test_multipole/test_multipole.py +++ b/tests/test_multipole/test_multipole.py @@ -86,6 +86,7 @@ class DistribmatTestHarness(PyAPITestHarness): sets_file.particles = 1000 sets_file.source = Source(space=Box([-1, -1, -1], [1, 1, 1])) sets_file.output = {'summary': True} + sets_file.use_windowed_multipole=True sets_file.export_to_xml()