Commit graph

410 commits

Author SHA1 Message Date
Paul Romano
bc09d1ef55 adding back files to be reviewed 2019-10-28 11:55:45 -05:00
Paul Romano
ae28233110 deleting all files to prepare for review 2019-10-28 11:48:19 -05:00
Paul Romano
829f12b1b5 Move thermal scattering MAT number bug fixes into a dedicated function 2019-10-03 11:49:56 -05:00
Paul Romano
92d410ed77 Ensure all thermal scattering evals from ENDF/B-VIII.0 and JEFF 3.3 work 2019-10-02 21:35:51 -05:00
Paul Romano
e510064b9c Make sure heating is calculated correctly with threshold fission
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.
2019-10-02 21:35:51 -05:00
Paul Romano
60f17ea466 Make sure from_ace classmethods get correct type of ACE table 2019-09-25 12:36:47 -05:00
Paul Romano
dc3ab07ced Make sure no heating adjustments are made if HEATR is not run 2019-09-13 10:59:18 -05:00
Paul Romano
fe731b7f19 Fix bug with IncidentNeutron.temperatures for ENDF files 2019-09-13 09:31:12 -05:00
Paul Romano
d84c379007 Fix up heating tally scores 2019-09-13 09:31:08 -05:00
Paul Romano
fe7a968819 Run HEATR twice to get kermas including local photon energy deposition 2019-09-13 07:10:43 -05:00
Paul Romano
d630047f4c Allow IncidentNeutron.from_endf to work on heatr output files 2019-09-13 07:10:43 -05:00
Andrew Johnson
e0d4a80f9a
Use same energy grid for fission heating as total heating
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.
2019-09-10 12:00:11 -05:00
Andrew Johnson
71825fb35a
Mark fission heating as redundant cross section
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
2019-09-10 09:01:18 -05:00
Sterling Harper
35c9f406b4 Address #1333 comment 2019-09-06 09:52:49 -04:00
Andrew Johnson
76adfb231c
Combine acer, ace arguments to openmc.data.make_ace
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.
2019-09-05 10:57:02 -05:00
Andrew Johnson
05f33849f5
Remove breakpoints, interpolation for non-fission heating
NJOY handles linearization of the cross sections in RECONR:
Section 3.2 NJOY2016 Manual, LA-UR-17-20093
2019-09-05 08:35:52 -05:00
Andrew Johnson
c7a8b6606e
Better collection of fission heating at temperatures
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.
2019-09-04 14:46:32 -05:00
Andrew Johnson
6b23c21327
Pass output_dir to make_ace to collect files
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.
2019-09-04 14:31:06 -05:00
Andrew Johnson
a0bac56ebd
Add fission-heating and non-fission-heating to reactions
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
2019-09-04 14:29:24 -05:00
Andrew Johnson
2675ebc2c6
Compute fission heating and fission-less heating with njoy
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
2019-09-03 17:09:15 -05:00
Andrew Johnson
7badc48c22
Instruct njoy interface to retain heatr output
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
2019-09-03 16:16:13 -05:00
Andrew Johnson
81c6259289
Write neutron fission-less heating coefficient to HDF5
Mark reaction 999 as one to be kept during the export process
2019-08-23 11:52:25 -05:00
Andrew Johnson
d81aaeca98
Store fission heating IncidentNeutron.from_ace
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
2019-08-23 11:51:09 -05:00
Paul Romano
2616655325 Fix use of ENDF_FLOAT_RE in ace.py 2019-07-19 07:40:48 -05:00
Paul Romano
a47dfedcc2 Allow from_njoy calls to use ace/xsdir keyword arguments 2019-07-10 21:46:15 -05:00
Paul Romano
97ea3287c2 Only replace incoherent elastic in ThermalScattering.from_njoy with ENDF data 2019-06-25 09:47:26 -05:00
Paul Romano
c2e612a503 Update HDF5 data version to 3.0 2019-06-25 07:31:53 -05:00
Paul Romano
7a1afc5869 Store 0-based threshold indices in HDF5 files 2019-06-25 07:31:53 -05:00
Paul Romano
adce57093d Add ability to use ENDF incoherent elastic data, update unit tests 2019-06-25 07:31:53 -05:00
Paul Romano
c8bf27af42 Add more thermal scattering unit tests and clean up some HDF5-related methods 2019-06-25 07:31:53 -05:00
Paul Romano
707eefbf65 Allow iwt to be specified on ACER runs for thermal scattering 2019-06-25 07:31:53 -05:00
Paul Romano
c48d5f07c4 Change how incoherent elastic data is written to HDF5 2019-06-25 07:31:53 -05:00
Paul Romano
c851030511 Refactor ThermalScattering::calculate_xs and add energy_max to class 2019-06-25 07:31:53 -05:00
Paul Romano
fd1f01a911 Move thermal scattering reaction data into ThermalData::Reaction type 2019-06-25 07:31:53 -05:00
Paul Romano
3e4fe61673 Start adding thermal angle-energy classes on C++ side 2019-06-25 07:31:53 -05:00
Paul Romano
c65366d7a0 Add IncoherentInelasticAEContinuous class stub 2019-06-25 07:31:53 -05:00
Paul Romano
8ea8206193 Move thermal angle-energy distributions into separate file 2019-06-25 07:31:53 -05:00
Paul Romano
51c8c2e0bc Refactor classes in openmc.data.ThermalScattering 2019-06-25 07:31:53 -05:00
Paul Romano
4ad1aeac3a Fix potential bug in Decay class 2019-06-25 07:31:53 -05:00
Paul Romano
3e5741e1bb Fix CoherentElastic.__call__ 2019-06-25 07:31:53 -05:00
Paul Romano
fbacfa0e5c Add a from_endf method to ThermalScattering that returns a dict 2019-06-25 07:31:53 -05:00
Sterling Harper
1f44d74690
Merge pull request #1259 from paulromano/dev-version
Increment version to 0.11.0-dev and some documentation changes
2019-06-17 14:50:45 -04:00
Paul Romano
5f001ee6b5 Add a short user's guide section on depletion 2019-06-14 22:22:38 -05:00
Andrew Johnson
52ff408651
Better exporting/importing of depletion_chain in DataLibrary
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
2019-06-13 19:33:17 -04:00
Andrew Johnson
ac4056e96d
Support depletion_chain in DataLibrary to/from xml and register
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.
2019-06-11 12:23:38 -04:00
Andrew Johnson
3c223248a8
Support Path objects for DataLibrary.register_filename
HDF5 File object supports reading from file-like objects,
which includes pathlib.Path.
Retain the filename of the path in the libraries list
2019-06-11 11:51:34 -04:00
Paul Romano
7b6ec80acf
Merge pull request #1203 from liangjg/heat-photon
Photon heating tally
2019-04-23 07:40:44 -05:00
liangjg
4d77f6fc94 Added a function to do interpolation for scalar input 2019-04-19 14:00:47 -04:00
liangjg
f90e8dd3dc address @paulromano's comments 2019-04-17 14:11:55 -04:00
Paul Romano
435b21eecb Use fixed-tolerance Gaussian quadrature for integrals 2019-04-17 11:01:04 -05:00