When trying to process Pa233 from ENDF/B-VIII.0, which has a threshold fission
reaction, I discovered that calculating heating numbers crashed because we were
trying to do arithmetic on arrays of different sizes. Re-evaluting the fission
cross section on the proper energy grid does the trick here.
The fission heating data generated with IncidentNeutron.from_njoy
does not have the same energy grid as other reactions. Previously,
the energy grid was maintained and the non-fission heating was generated
by evaluating total heating at each point in the fission heating grid
and taking total_xs(fission_h.x) - fission_h.y
This led to the crash in #1340 where openmc expected cross
sections to use the same grid, or at least same number of grid
points when computing the total cross section. While fission heating
is not included in the total cross section [since 71825fb35],
a consistent energy grid is helpful.
Both fission heating and non-fission heating now use the energy
grid from the total heating.
Fission heating should not contribute to total cross section,
and marking the reaction as redundant ensures this. MT=318 for
fission heating is already included in the redundant reactions
to keep when exported to HDF5
Related to #1340
Passing ace to make_ace is not supported. Use acer instead.
The acer argument now signals if the acer njoy module should
be run and where to save the output file. xsdir defaults to
None now, rather than "xsdir". This change allows the xsdir
file to be written to the same directory as acer, or a user
supplied location potentially separate from ace file.
Use openmc.data.endf.get_evaluations to read in potentially
many 318 evaluations from the heatr file. The evaluated
temperatures are pulled using the target attribute, rounded
to the nearest integer for consistency, e.g. 293.6K -> 294K.
The user can now pass a single argument indicating where output
tapes for each njoy module should be written. The default argument
is the current working directory, useful for removing any temporary
files created during testing.
The pendf, broadr, heatr, gaspr, and purr arguments can either
be booleans or strings. A boolean value indicates the module output
should be written into a file named after the module, e.g. heatr output
written to <output_dir>/heatr.
ace and xsdir can be None or strings. A value of None means the
final ace and xsdir files will be written to
<output_dir>/ace and <output_dir>/xsdir, respectively. The temporary
temperature-dependent ace and xsdir files are now always named
"ace_<temp>" and "xsdir_<temp>", as the ace and xsdir arguments can
be more than "ace" and "xsdir".
openmc.data.IncidentNeutron.from_njoy knows to use this output_dir
argument to ensure all created tape files are written into the
temporary directory or the user requested directory, if applicable.
This commit was written because simply writing the broadr, gaspr,
and purr output files to "broadr", "gaspr", and "purr" resulted
in left over files after running tests.
MT318 and MT999 for fission heating and non-fission heating
have been added to the reactions supported in
openmc/data/reaction.py and src/reaction.cpp
Changed internal language from fission-less heating to
non-fission heating
This reverts d81aaeca9 and 81c625928 in the following ways.
Fission heating data, MT318, is pulled from the heatr file
produced when running NJOY. Reaction data that is potentially
temperature dependent is set onto the IncidentNeutron object
by scaling MT318 by the ratio of the fission cross section
used in HEATR and other fission cross sections stored on the
object. This produces potentially many MT318 fission heating
KERMA coefficients on the nuclide.
The fission-less heating coefficient, MT999, if computed by
subtracting MT318 from MT301, total heating coefficients. This
reaction is marked as redundant, as it can easily be reconstructed.
MT318 is allowed to be written to the HDF5 file, while 999 is not.
When reading back in the library, MT999 is rebuilt in exactly
the same manner.
The test_heating test in tests/unit_tests/test_data_neutron.py
has been updated given the changes in this commit.
It is worth noting that the heating coefficients computed in
NJOY only contain prompt neutrons, as
k_{i,j}(E) = sigma_{i,j}(E) * (E + Q - \bar{E})
where k_{i,j} is the kerma coefficient for reaction j of material
i, sigma_{i,j} is the corresponding reaction cross section, E
is the energy of incident particle, Q is the mass-difference
Q value, and \bar{E} is the average energy of secondary particles.
Source: NJOY16 Manual on HEATR
HEATR contains the 318 fission heating data needed to
construct the energy deposition tally. Until now, the output
tape was left in the njoy temporary directory with the other
output tapes. This commit instructs openmc.data.njoy to move
the heatr output from the running directory used in njoy.run
to the working directory used in njoy.make_ace
Removed unused imports argparse and sys
IncidentNeutron.from_ace now computes the fission heating
and a fission-less heating coefficient. The fission heating
is the product of the heating number and the fission cross
section, and stored as MT318.
The fission-less heating is the heating from all reactions
except fission, computed as heating_number * (total_xs - fission_xs).
The MT number for this is taken to be 999 as a temporary value.
A test is added for Am244 in test_data_neutron.py to examine the
new heating values
Use str(path) in the path attribute when registering.
This preserves the full path, not just the basename.
Give special depletion_chain tag when exporting a library
of type depletion_chain, rather than using previous library tag
DataLibrary.from_xml looks for depletion_chain node in the
cross sections xml file. If found the path to this file is added
to the list of libraries. An empty list of materials is used
for consistency with other libraries. Type and path attributes
are consistent.
DataLibrary.export_to_xml does not write the materials
attribute if the value stored in that library evaluates to False,
e.g. for the empty list stored in the depletion chain.
DataLibrary.register_file has a conditional wherein a passed xml
file is treated as the depletion_chain and hdf5 files are
treated as material/isotopic cross section files.