openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
724 stars 461 forks source link

openmc-ace-to-hdf5: Thermal scattering materials for Serpent cross sections #743

Closed tjlaboss closed 1 month ago

tjlaboss commented 7 years ago

The script openmc-ace-to-hdf5 doesn't seem to be handling the different thermal scattering libraries properly.

Serpent's data includes JEF-2.2, JEFF3.1, ENDF/B-VI.8, and ENDF/B_VII, denoted by j2, j3, e6, and e7, respectively. As an arbitrary example, ENDF/B-VI.8 thermal scattering data for light water might be called something like lwe6.02t.

The script prints the warning message UserWarning: Thermal scattering material "lwe6.02t" is not recognized. Assigning a name of c_H_in_H2O. I see the same warning for the other data libraries (lwe7, lwj2, lwj3). If I'm not mistaken, it looks like it's using the same name for each of the 4 libraries, so that you end up lwj3/hwj3/grj3 for all of them since j3 is the last alphabetically.

If that is indeed the case, the script should ask the user which of the four data evaluations to use.

Here is the full list of warnings, displayed after the final successful conversion: openmc_ace-to-hdf5_xsdata.txt

paulromano commented 7 years ago

I think in this case your best option is to do things manually. It would be hard to have the script handle every conceivable case, and the way things are designed right now, it's difficult to have the same material from different evaluations within the same cross_sections.xml. If you want to do it manually, you'll need to:

  1. Convert from ACE -> Python (ThermalScattering.from_ace)
  2. Convert from Python -> HDF5 (ThermalScattering.export_to_hdf5)
  3. Create a data library (DataLibrary)

With a little globing, you can create a library exactly as you want.

If you really want to have a single library with multiple water evaluations, you can manually change the name, e.g.

water1 = openmc.data.ThermalScattering.from_ace('file1')
water2 = openmc.data.ThermalScattering.from_ace('file2')
water2.name = 'c_H_in_H2O_jeff'
tjlaboss commented 1 month ago

Now https://openmc.org/data-libraries/ exists