Merge remote-tracking branch 'upstream/develop' into trusty

This commit is contained in:
Adam Nelson 2016-10-10 08:45:39 -04:00
commit ea2ef69f5f
15 changed files with 72 additions and 63 deletions

View file

@ -292,8 +292,8 @@ 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:`OPENMC_MULTIPOLE_LIBRARY` environment variable will be used.
.. note:: The :ref:`temperature_method` must also be set to "multipole" for
windowed multipole functionality.
.. note:: The <temperature_multipole> element must also be set to "true" for
windowed multipole functionality.
``<max_order>`` Element
---------------------------
@ -725,19 +725,29 @@ a material default temperature.
``<temperature_method>`` Element
--------------------------------
The ``<temperature_method>`` element has an accepted value of "nearest",
"interpolation", or "multipole". A value of "nearest" indicates that for each
The ``<temperature_method>`` element has an accepted value of "nearest" or
"interpolation". A value of "nearest" indicates that for each
cell, the nearest temperature at which cross sections are given is to be
applied, within a given tolerance (see :ref:`temperature_tolerance`). A value of
"interpolation" indicates that cross sections are to be linear-linear
interpolated between temperatures at which nuclear data are present (see
:ref:`temperature_treatment`). A value of "multipole" indicates that the
windowed multipole method should be used to evaluate temperature-dependent cross
sections in the resolved resonance range (a :ref:`windowed multipole library
<multipole_library>` must also be available).
:ref:`temperature_treatment`).
*Default*: "nearest"
.. _temperature_multipole:
``<temperature_multipole>`` Element
-----------------------------------
The ``<temperature_multipole>`` 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. This override other
methods like "nearest" and "interpolation" in the resolved resonance range.
*Default*: False
.. _temperature_tolerance:
``<temperature_tolerance>`` Element
@ -850,17 +860,6 @@ problem. It has the following attributes/sub-elements:
*Default*: None
``<use_windowed_multipole>`` Element
------------------------------------
The ``<use_windowed_multipole>`` 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
``<verbosity>`` Element
-----------------------

View file

@ -103,11 +103,13 @@ class Settings(object):
temperature : dict
Defines a default temperature and method for treating intermediate
temperatures at which nuclear data doesn't exist. Accepted keys are
'default', 'method', and 'tolerance'. The value for 'default' should be
a float representing the default temperature in Kelvin. The value for
'method' should be 'nearest' or 'multipole'. If the method is
'nearest', 'tolerance' indicates a range of temperature within which
cross sections may be used.
'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.
trigger_active : bool
Indicate whether tally triggers are used
trigger_max_batches : int
@ -671,14 +673,16 @@ class Settings(object):
cv.check_type('temperature settings', temperature, Mapping)
for key, value in temperature.items():
cv.check_value('temperature key', key,
['default', 'method', 'tolerance'])
['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', 'multipole'])
['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
@threads.setter
@ -1049,7 +1053,7 @@ class Settings(object):
def _create_temperature_subelements(self):
if self.temperature:
for key, value in self.temperature.items():
for key, value in sorted(self.temperature.items()):
element = ET.SubElement(self._settings_file,
"temperature_{}".format(key))
element.text = str(value)

View file

@ -271,8 +271,7 @@ module constants
! Temperature treatment method
integer, parameter :: &
TEMPERATURE_NEAREST = 1, &
TEMPERATURE_INTERPOLATION = 2, &
TEMPERATURE_MULTIPOLE = 3
TEMPERATURE_INTERPOLATION = 2
! ============================================================================
! TALLY-RELATED CONSTANTS

View file

@ -185,8 +185,6 @@ contains
f = (kT - nuc % kTs(i_temp)) / &
(nuc % kTs(i_temp + 1) - nuc % kTs(i_temp))
if (f > prn()) i_temp = i_temp + 1
case (TEMPERATURE_MULTIPOLE)
i_temp = minloc(abs(nuclides(i_nuclide) % kTs - kT), dim=1)
end select
end if

View file

@ -101,6 +101,7 @@ module global
! Default temperature and method for choosing temperatures
integer :: temperature_method = TEMPERATURE_NEAREST
logical :: temperature_multipole = .false.
real(8) :: temperature_tolerance = 10.0_8
real(8) :: temperature_default = 293.6_8

View file

@ -1082,8 +1082,6 @@ contains
temperature_method = TEMPERATURE_NEAREST
case ('interpolation')
temperature_method = TEMPERATURE_INTERPOLATION
case ('multipole')
temperature_method = TEMPERATURE_MULTIPOLE
case default
call fatal_error("Unknown temperature method: " // trim(temp_str))
end select
@ -1091,6 +1089,18 @@ contains
if (check_for_node(doc, "temperature_tolerance")) then
call get_node_value(doc, "temperature_tolerance", temperature_tolerance)
end if
if (check_for_node(doc, "temperature_multipole")) then
call get_node_value(doc, "temperature_multipole", temp_str)
select case (to_lower(temp_str))
case ('true', '1')
temperature_multipole = .true.
case ('false', '0')
temperature_multipole = .false.
case default
call fatal_error("Unrecognized value for <use_windowed_multipole> in &
&settings.xml")
end select
end if
! Close settings XML file
call close_xmldoc(doc)
@ -5786,8 +5796,7 @@ contains
call already_read % add(name)
! Read multipole file into the appropriate entry on the nuclides array
if (temperature_method == TEMPERATURE_MULTIPOLE) &
call read_multipole_data(i_nuclide)
if (temperature_multipole) call read_multipole_data(i_nuclide)
end if
! Check if material is fissionable
@ -5841,7 +5850,7 @@ contains
end do
! If the user wants multipole, make sure we found a multipole library.
if (temperature_method == TEMPERATURE_MULTIPOLE) then
if (temperature_multipole) then
mp_found = .false.
do i = 1, size(nuclides)
if (nuclides(i) % mp_present) then

View file

@ -302,10 +302,6 @@ module nuclide_header
trim(to_str(nint(temp_desired))) // " K.")
end do TEMP_LOOP
case (TEMPERATURE_MULTIPOLE)
! Add first available temperature
call temps_to_read % push_back(nint(temps_available(1)))
end select
! Sort temperatures to read

View file

@ -334,7 +334,7 @@ contains
else
! Determine temperature
if (temperature_method == TEMPERATURE_MULTIPOLE) then
if (nuc % mp_present) then
kT = p % sqrtkT**2
else
kT = nuc % kTs(micro_xs(i_nuclide) % index_temp)

View file

@ -132,6 +132,8 @@ element settings {
element temperature_method { xsd:string }? &
element temperature_multipole { xsd:boolean }? &
element temperature_tolerance { xsd:double }? &
element threads { xsd:positiveInteger }? &
@ -182,6 +184,4 @@ element settings {
attribute E_max { xsd:double })?
}*
}? &
element use_windowed_multipole { xsd:boolean }?
}

View file

@ -575,6 +575,11 @@
<data type="string"/>
</element>
</optional>
<optional>
<element name="temperature_multipole">
<data type="boolean"/>
</element>
</optional>
<optional>
<element name="temperature_tolerance">
<data type="double"/>
@ -816,10 +821,5 @@
</zeroOrMore>
</element>
</optional>
<optional>
<element name="use_windowed_multipole">
<data type="boolean"/>
</element>
</optional>
</interleave>
</element>

View file

@ -187,10 +187,6 @@ contains
trim(to_str(nint(temp_desired))) // " K.")
end do TEMP_LOOP
case (TEMPERATURE_MULTIPOLE)
! Add first available temperature
call temps_to_read % push_back(nint(temps_available(1)))
end select
! Sort temperatures to read

View file

@ -149,7 +149,7 @@ contains
if (survival_biasing) then
! We need to account for the fact that some weight was already
! absorbed
score = p % last_wgt + p % absorb_wgt * flux
score = (p % last_wgt + p % absorb_wgt) * flux
else
score = p % last_wgt * flux
end if
@ -417,6 +417,13 @@ contains
case (SCORE_PROMPT_NU_FISSION)
! make sure the correct energy is used
if (t % estimator == ESTIMATOR_TRACKLENGTH) then
E = p % E
else
E = p % last_E
end if
if (t % estimator == ESTIMATOR_ANALOG) then
if (survival_biasing .or. p % fission) then
if (t % find_filter(FILTER_ENERGYOUT) > 0) then
@ -453,13 +460,6 @@ contains
end if
else
! make sure the correct energy is used
if (t % estimator == ESTIMATOR_TRACKLENGTH) then
E = p % E
else
E = p % last_E
end if
if (i_nuclide > 0) then
score = micro_xs(i_nuclide) % fission * nuclides(i_nuclide) % &
nu(E, EMISSION_PROMPT) * atom_density * flux
@ -675,6 +675,12 @@ contains
case (SCORE_DECAY_RATE)
! make sure the correct energy is used
if (t % estimator == ESTIMATOR_TRACKLENGTH) then
E = p % E
else
E = p % last_E
end if
! Set the delayedgroup filter index
dg_filter = t % find_filter(FILTER_DELAYEDGROUP)

View file

@ -1 +1 @@
8462e17d102259b3a48a7e908bc75038a28a19d4a5e8bd38f26579e5baf3998bc2d05d1d3055ac1ed478d0c01bd64868d654919c2e6ca3fea86d79f03eda25ef
2be927608035759f52a2ac88b2c84e28c06e0f7905187bfd4695fecd80f417e727d8879c52fe03253938f7aa0301061f72dce9b5ae46b8675049b5bc4d9525a0

View file

@ -1,5 +1,5 @@
k-combined:
1.425673E+00 1.779969E-02
1.363786E+00 1.103929E-02
Cell
ID = 11
Name =

View file

@ -17,6 +17,7 @@ class MultipoleTestHarness(PyAPITestHarness):
moderator.set_density('g/cc', 1.0)
moderator.add_nuclide('H1', 2.0)
moderator.add_nuclide('O16', 1.0)
moderator.add_s_alpha_beta('c_H_in_H2O')
dense_fuel = openmc.Material(material_id=2)
dense_fuel.set_density('g/cc', 4.5)
@ -67,7 +68,7 @@ class MultipoleTestHarness(PyAPITestHarness):
sets_file.particles = 1000
sets_file.source = Source(space=Box([-1, -1, -1], [1, 1, 1]))
sets_file.output = {'summary': True}
sets_file.temperature = {'method': 'multipole'}
sets_file.temperature = {'tolerance': 1000, 'multipole': True}
sets_file.export_to_xml()
####################