Address @pshriwise comments on #1733

This commit is contained in:
Paul Romano 2020-12-22 15:04:51 -06:00
parent c55c8dd258
commit 4b1cd83a54
2 changed files with 9 additions and 12 deletions

View file

@ -31,7 +31,7 @@ Environment Variables
When :ref:`scripts_openmc` is run, it will look for several environment
variables that indicate where cross sections can be found. While the location of
cross sections can also be indicated through the
:attr:`openmc.Materials.cross_section` attribute (or in the :ref:`materials.xml
:attr:`openmc.Materials.cross_sections` attribute (or in the :ref:`materials.xml
<io_materials>` file), if you always use the same set of cross section data, it
is often easier to just set an environment variable that will be picked up by
default every time OpenMC is run. The following environment variables are used:
@ -76,11 +76,11 @@ Manually Creating a Library from ACE files
.. currentmodule:: openmc.data
The :mod:`openmc.data` module in the Python API enables users to directly
convert ACE data and create a :ref:`cross_sections.xml <io_cross_sections>`
file. For those who prefer to use the API directly, the
:class:`openmc.data.IncidentNeutron` and :class:`openmc.data.ThermalScattering`
classes can be used to read ACE data and convert it to HDF5. For
continuous-energy incident neutron data, use the
convert ACE data to OpenMC's HDF5 format and create a corresponding
:ref:`cross_sections.xml <io_cross_sections>` file. For those who prefer to use
the API directly, the :class:`openmc.data.IncidentNeutron` and
:class:`openmc.data.ThermalScattering` classes can be used to read ACE data and
convert it to HDF5. For continuous-energy incident neutron data, use the
:meth:`IncidentNeutron.from_ace` class method to read in an existing ACE file
and the :meth:`IncidentNeutron.export_to_hdf5` method to write the data to an
HDF5 file.

View file

@ -153,13 +153,10 @@ ThermalScattering::calculate_xs(double E, double sqrtkT, int* i_temp,
double kT = sqrtkT*sqrtkT;
int i = 0;
if (kTs_.size() > 1) {
auto n = kTs_.size();
if (n > 1) {
// Find temperatures that bound the actual temperature
for (i = 0; i < kTs_.size() - 1; ++i) {
if (kTs_[i] <= kT && kT < kTs_[i+1]) {
break;
}
}
while (kTs_[i+1] < kT && i + 1 < n - 1) ++i;
if (settings::temperature_method == TemperatureMethod::NEAREST) {
// Pick closer of two bounding temperatures