ThermalScattering.from_njoy error help

Hi all,

I’m experimenting with converting ENDF formatted files into .h5 and have had success with using openmc.data.IncidentNeutron.from_njoy for regular neutron sub-libraries but I’m running into an error with openmc.data.ThermalScattering.from_njoy when trying to convert CH2/polyethylene data:

running the following code:

url = ‘https://t2.lanl.gov/nis/data/data/ENDFB-VII-thermal/HinCH2

filename, headers = urllib.request.urlretrieve(url, ‘poly.endf’)

poly = openmc.data.ThermalScattering.from_njoy(‘h1.endf’,‘poly.endf’, temperatures=[300.], stdout=True)

poly.export_to_hdf5(‘poly.h5’, ‘w’)

this results in the following output:

error in calcem desired temperature not found.

STOP 77
Traceback (most recent call last):
File “/home/llm/openMCtest/DataConverter.py”, line 32, in
poly = openmc.data.ThermalScattering.from_njoy(‘h1.endf’,‘poly.endf’, temperatures=[300.], stdout=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/llm/miniconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/data/thermal.py”, line 916, in from_njoy
make_ace_thermal(filename, filename_thermal, temperatures, **kwargs)
File “/home/llm/miniconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/data/njoy.py”, line 657, in make_ace_thermal
run(commands, tapein, tapeout, **kwargs)
File “/home/llm/miniconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/data/njoy.py”, line 281, in run
raise CalledProcessError(njoy.returncode, njoy_exec,
subprocess.CalledProcessError: Command ‘njoy’ returned non-zero exit status 77.

I suspect I’m doing something wrong with the “filename” argument for from_njoy as I’m not really sure what file I’m supposed to be inputting there.

any assistance would be greatly appreciated.

-Lewis

The tape you are trying to process contains thermal scattering laws at 294K and 350K, your processing fails due to asking for a temperature of 300K.

It runs to completion on my end albeit with some warnings:

 njoy 2016.76  03Jul24                                       08/02/25 17:18:49
 *****************************************************************************

 reconr...                                                                0.0s

 broadr...                                                                0.0s
      296.0 deg                                                           0.0s
      350.0 deg                                                           0.0s

 thermr...                                                                0.1s

 wrote thermal data for temp = 2.9600E+02                                 1.6s

 wrote thermal data for temp = 3.5000E+02                                 3.0s

 thermr...                                                                3.0s

 ***warning***maximum value of beta limits the allowed energy transfer
 the sct approx. will be used for transfers larger than  1.507 ev.

 wrote thermal data for temp = 2.9600E+02                                 6.3s

 ***warning***maximum value of beta limits the allowed energy transfer
 the sct approx. will be used for transfers larger than  1.507 ev.

 wrote thermal data for temp = 3.5000E+02                                 9.5s

 acer...                                                                  9.5s

 acer...                                                                 10.3s
                                                                         11.2s
 *****************************************************************************
/home/nlinden/workspace/endfb6/.venv/lib/python3.12/site-packages/openmc/data/thermal.py:1067: UserWarning: Thermal scattering evaluation follows NJOY definition of bound cross section but divide_incoherent_elastic=False.
  warn(msg)

Nicolas

1 Like

Thanks very much Nicolas, you’ve been a great help.