Converting JEFF 3.1.2 Thermal Scattering Data to HDF5

Hello,

I am trying to convert the JEFF 3.1.2 library to HDF5 to do some plotting using material-based colors. I recently submitted a PR to fix a bug using this process with the --xsdata flag.

The fix works as intended. However, now I am running into some behavior that is not desirable.

1. The conversion script seems to be unhappy that there are a few ACE files that have negative cross sections.

/home/ooblack/projects/openmc/openmc/data/reaction.py:1067: UserWarning: Negative elastic scattering cross section found for 22046.09c. Setting to zero.
  warn("Negative elastic scattering cross section found for {}. "
Converting 22046.09c (ACE) to Ti46 (HDF5)
Converting 22047.09c (ACE) to Ti47 (HDF5)
Converting 22048.09c (ACE) to Ti48 (HDF5)
/home/ooblack/projects/openmc/openmc/data/reaction.py:1067: UserWarning: Negative elastic scattering cross section found for 22049.09c. Setting to zero.
  warn("Negative elastic scattering cross section found for {}. "
Converting 22049.09c (ACE) to Ti49 (HDF5)
/home/ooblack/projects/openmc/openmc/data/reaction.py:1067: UserWarning: Negative elastic scattering cross section found for 22050.09c. Setting to zero.
  warn("Negative elastic scattering cross section found for {}. "
Converting 22050.09c (ACE) to Ti50 (HDF5)
.
.
.
/home/ooblack/projects/openmc/openmc/data/reaction.py:1006: UserWarning: Negative cross sections found for MT=91 in 39089.09c. Setting to zero.
  warn("Negative cross sections found for MT={} in {}. Setting "
Converting 39089.09c (ACE) to Y89 (HDF5)

Intuitively, I agree with this, but one of my labmates pointed out the negative could indicate a unit (cm^-2 instead of barns or vice versa). I’m not sure if this is standard for ACE or not, and haven’t seen information regarding this in the ACE specification. It’s quite possible there are typos, however I’ve had trouble locating the corresponding entries in the raw ACE files.

In lieu of this, I’ve done some interactive debugging to look at the array that is throwing the warning.

Running

python -m pdb openmc-ace-to-hdf5 Ti46-900.ACE

and setting breakpoint at line 1067 in data/reactions.py, the last 100 values of the elastic_xs array are

(Pdb) p elastic_xs[-100:-1]
array([ 1.554604  ,  1.545361  ,  1.538748  ,  1.52847   ,  1.505908  ,
        1.500542  ,  1.48342   ,  1.470517  ,  1.467955  ,  1.435042  ,
        1.426148  ,  1.403177  ,  1.402935  ,  1.402933  ,  1.4011    ,
        1.364055  ,  1.359014  ,  1.343892  ,  1.326541  ,  1.319453  ,
        1.299376  ,  1.290615  ,  1.290605  ,  1.249322  ,  1.238016  ,
        1.230953  ,  1.197922  ,  1.197581  ,  1.187194  ,  1.162181  ,
        1.155405  ,  1.129351  ,  1.110301  ,  1.103147  ,  1.094089  ,
        1.089697  ,  1.06271   ,  1.060759  ,  1.060728  ,  1.06068   ,
        1.059303  ,  1.056319  ,  1.052954  ,  1.041672  ,  1.041217  ,
        1.037807  ,  1.034736  ,  1.034664  ,  1.020349  ,  1.008419  ,
        1.002923  ,  1.000747  ,  1.000565  ,  0.9846192 ,  0.9749692 ,
        0.9724682 ,  0.9652902 ,  0.9639826 ,  0.9451739 ,  0.9334773 ,
        0.9239847 ,  0.9239154 ,  0.9030608 ,  0.8953216 ,  0.8951517 ,
        0.8857216 ,  0.8626973 ,  0.8443104 ,  0.8392183 ,  0.8294004 ,
        0.7963578 ,  0.7908378 ,  0.7820405 ,  0.7330027 ,  0.7124816 ,
        0.7117751 ,  0.6983517 ,  0.642677  ,  0.6135431 ,  0.5569493 ,
        0.5131865 ,  0.4737279 ,  0.3462805 ,  0.337395  ,  0.2948647 ,
        0.2938723 ,  0.1445071 ,  0.09867013,  0.09658663, -0.05749052,
       -0.1055382 , -0.1066653 , -0.1720337 , -0.2751376 , -0.3283734 ,
       -0.4678881 , -0.5124639 , -0.5707234 , -0.7722881 ])

I did the same thing for Ti49-900.ACE:

(Pdb) p elastic_xs[-100:]
array([ 1.419534  ,  1.419528  ,  1.409091  ,  1.398653  ,  1.398653  ,
        1.393679  ,  1.385886  ,  1.378094  ,  1.370301  ,  1.362509  ,
        1.355441  ,  1.344595  ,  1.333749  ,  1.326005  ,  1.318262  ,
        1.310517  ,  1.302774  ,  1.301801  ,  1.294339  ,  1.29424   ,
        1.285812  ,  1.27745   ,  1.269089  ,  1.260729  ,  1.252368  ,
        1.243794  ,  1.235219  ,  1.226645  ,  1.218072  ,  1.210012  ,
        1.208729  ,  1.185257  ,  1.184904  ,  1.169671  ,  1.161588  ,
        1.123743  ,  1.108788  ,  1.108703  ,  1.103373  ,  1.090223  ,
        1.06186   ,  1.059282  ,  1.059201  ,  1.059182  ,  1.059119  ,
        1.059099  ,  1.051957  ,  1.038934  ,  1.033718  ,  1.020669  ,
        1.01284   ,  1.00201   ,  0.9911794 ,  0.9882206 ,  0.9793201 ,
        0.9704195 ,  0.9634839 ,  0.9525847 ,  0.9524114 ,  0.9509781 ,
        0.9411319 ,  0.9360392 ,  0.9302709 ,  0.9302706 ,  0.927644  ,
        0.921158  ,  0.914672  ,  0.9141033 ,  0.9141012 ,  0.914101  ,
        0.9140404 ,  0.9134836 ,  0.9134168 ,  0.9130011 ,  0.9128625 ,
        0.9123495 ,  0.9118365 ,  0.9114404 ,  0.9134398 ,  0.9137597 ,
        0.9153411 ,  0.9171484 ,  0.9191062 ,  0.921728  ,  0.9240878 ,
        0.9269839 ,  0.9298801 ,  0.9307382 ,  0.9343403 ,  0.93508   ,
        0.937342  ,  0.9396038 ,  0.9404354 ,  0.9469816 ,  0.9522808 ,
        0.9557809 ,  0.9559772 ,  0.9620999 ,  0.9712836 , -0.00958887])

and Ti50-900.ACE

(Pdb) p elastic_xs[-100:]
array([ 1.999462  ,  1.947533  ,  1.940192  ,  1.940146  ,  1.897453  ,
        1.875287  ,  1.873202  ,  1.864219  ,  1.859253  ,  1.83281   ,
        1.807565  ,  1.807481  ,  1.779629  ,  1.752661  ,  1.74866   ,
        1.739672  ,  1.726682  ,  1.701445  ,  1.67697   ,  1.656548  ,
        1.587739  ,  1.587512  ,  1.569022  ,  1.534175  ,  1.5006    ,
        1.475394  ,  1.448501  ,  1.438702  ,  1.422182  ,  1.420368  ,
        1.342376  ,  1.32016   ,  1.320001  ,  1.271843  ,  1.270325  ,
        1.208964  ,  1.208903  ,  1.199306  ,  1.197591  ,  1.198999  ,
        1.197625  ,  1.173507  ,  1.148625  ,  1.147098  ,  1.098015  ,
        1.043004  ,  1.042916  ,  1.042464  ,  1.042463  ,  1.030599  ,
        1.02802   ,  1.02802   ,  1.008362  ,  0.9932924 ,  0.9932913 ,
        0.9932908 ,  0.9820161 ,  0.9817717 ,  0.9817541 ,  0.9709829 ,
        0.9709824 ,  0.9576063 ,  0.9532546 ,  0.9406105 ,  0.9403794 ,
        0.9336802 ,  0.9233293 ,  0.9224133 ,  0.9144307 ,  0.9107605 ,
        0.9045576 ,  0.9045552 ,  0.9024504 ,  0.8917659 ,  0.8813774 ,
        0.8810806 ,  0.8788642 ,  0.8765769 ,  0.8747216 ,  0.8747792 ,
        0.8753788 ,  0.8755145 ,  0.8773727 ,  0.8789916 ,  0.8789991 ,
        0.8801144 ,  0.8819422 ,  0.8849622 ,  0.885669  ,  0.8865686 ,
        0.8878174 ,  0.8878678 ,  0.8884607 ,  0.8899151 ,  0.8935512 ,
        0.9019408 ,  0.9036042 ,  0.9104955 ,  0.9123779 , -0.00242931])

I ran a similar command for Y89-900.ACE, except this time set the breakpoint at line 1006 since the warning is for a different cross section.

(Pdb) p xs
array([ 0.000000e+00,  9.115938e-06,  1.204848e-05,  1.369913e-05,
        1.546772e-05,  1.734872e-05,  1.933538e-05,  2.354899e-05,
        2.812797e-05,  3.296033e-05,  4.307915e-05,  8.556188e-05,
        1.710668e-04,  3.421325e-04,  6.842637e-04,  1.368526e-03,
        2.737051e-03,  5.464035e-03,  4.798625e-03,  4.123150e-03,
        2.772200e-03,  1.421250e-03,  7.457751e-04,  4.080375e-04,
        2.391687e-04,  1.547073e-04,  1.125036e-04,  9.137471e-05,
        8.083730e-05,  7.555311e-05,  7.306083e-05,  7.125436e-05,
        7.034384e-05,  7.036605e-05,  7.043177e-05,  7.056353e-05,
        7.082673e-05,  7.135313e-05,  7.240625e-05,  7.451250e-05,
        7.872500e-05,  8.715000e-05,  9.557500e-05,  9.978750e-05,
        1.018938e-04,  1.029469e-04,  1.034736e-04,  1.037368e-04,
        1.038686e-04,  1.039343e-04,  1.046314e-04,  1.243773e-04,
        1.447544e-04,  1.855088e-04,  2.670175e-04,  4.300001e-04,
        7.560001e-04,  1.408000e-03,  2.712000e-03,  5.320000e-03,
        7.928000e-03,  9.232000e-03,  9.884000e-03,  1.021000e-02,
        1.056150e-02,  2.611061e-02,  4.163885e-02,  4.163899e-02,
        4.151817e-02,  4.135211e-02,  4.102095e-02,  4.035861e-02,
        3.903394e-02,  3.638459e-02,  3.108494e-02,  2.048660e-02,
        9.887287e-03,  4.587633e-03,  1.938288e-03,  1.275952e-03,
        6.136162e-04,  0.000000e+00,  0.000000e+00,  0.000000e+00,
        0.000000e+00,  0.000000e+00,  0.000000e+00,  0.000000e+00,
        0.000000e+00,  0.000000e+00,  0.000000e+00,  0.000000e+00,
        0.000000e+00,  0.000000e+00,  0.000000e+00,  0.000000e+00,
        0.000000e+00,  0.000000e+00,  0.000000e+00,  0.000000e+00,
        0.000000e+00,  0.000000e+00,  0.000000e+00,  0.000000e+00,
        0.000000e+00,  0.000000e+00,  0.000000e+00,  0.000000e+00,
        0.000000e+00,  0.000000e+00,  0.000000e+00, -2.527910e-01,
       -2.473974e-01, -2.298065e-01, -2.298070e-01, -2.568390e-01,
       -2.268702e-01, -2.268694e-01, -2.172159e-01, -2.172157e-01,
       -2.172148e-01, -2.026715e-01, -2.026713e-01, -2.026712e-01,
       -1.981397e-01, -1.883407e-01, -1.811007e-01, -1.805185e-01,
       -1.779896e-01, -1.663576e-01, -1.663579e-01, -1.678272e-01,
       -1.678279e-01, -1.678286e-01, -1.765479e-01, -1.765493e-01,
       -2.282748e-01, -2.175938e-01, -1.879899e-01, -1.879902e-01,
       -1.913324e-01, -1.913335e-01, -2.086664e-01, -2.086696e-01,
       -2.355770e-01, -2.355143e-01, -2.257808e-01, -2.257807e-01,
       -2.247319e-01, -2.229665e-01, -2.229665e-01, -2.229665e-01,
       -2.238096e-01, -2.242318e-01, -2.242327e-01, -2.265135e-01,
       -2.338753e-01, -2.338757e-01, -2.338775e-01, -2.379197e-01,
       -2.088434e-01, -2.029732e-01, -2.029728e-01, -2.029722e-01,
       -2.022961e-01, -1.912481e-01, -1.912481e-01, -1.912480e-01,
       -1.913103e-01, -1.913104e-01, -1.977303e-01, -1.977309e-01,
       -2.002777e-01, -2.006924e-01, -2.006927e-01, -2.006934e-01,
       -2.053977e-01, -2.106652e-01, -2.013413e-01, -1.779832e-01,
       -1.779824e-01, -1.645979e-01, -1.645976e-01, -1.620672e-01,
       -1.620664e-01, -1.620653e-01, -1.518994e-01, -1.357161e-01,
       -1.329360e-01, -1.329359e-01, -1.329358e-01, -1.301399e-01,
       -1.301398e-01, -1.323565e-01, -1.328377e-01, -1.328379e-01,
       -1.361509e-01, -1.389370e-01, -1.320483e-01, -1.171123e-01,
       -1.171114e-01, -1.033714e-01, -1.033706e-01, -1.033681e-01,
       -8.353687e-02, -8.353179e-02, -8.283478e-02, -7.711653e-02,
       -7.711580e-02, -1.951873e-02, -7.705664e-03,  4.990822e-03,
        1.389808e-02,  6.973633e-02,  8.111863e-02,  8.990907e-02,
        1.362779e-01,  1.622695e-01,  1.753530e-01,  1.901814e-01,
        1.932843e-01,  2.108725e-01,  2.314541e-01,  2.379666e-01,
        2.475794e-01,  2.535847e-01,  2.589065e-01,  2.589087e-01,
        7.981554e-01,  1.221206e+00,  1.432097e+00,  1.553025e+00,
        1.620094e+00,  1.631522e+00,  1.657880e+00,  1.680306e+00,
        1.681426e+00,  1.691661e+00,  1.694888e+00,  1.692033e+00,
        1.685082e+00,  1.668128e+00,  1.643995e+00,  1.612189e+00,
        1.588036e+00,  1.586047e+00,  1.586045e+00,  1.490439e+00,
        1.489110e+00,  1.366905e+00,  1.271664e+00,  1.048079e+00,
        8.560107e-01,  6.996135e-01,  6.724485e-01,  5.637885e-01,
        4.580743e-01,  3.779990e-01,  3.196506e-01,  2.776628e-01,
        2.445734e-01,  2.187781e-01,  1.969604e-01,  1.839498e-01,
        1.802930e-01,  1.660907e-01,  1.530276e-01,  1.424113e-01])

2. I’m running into errors when converting the thermal cross section data:

/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "be06" is not recognized. Assigning a name of c_Be.
  warn('Thermal scattering material "{}" is not recognized. '
Converting be06.32t (ACE) to c_Be (HDF5)
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "be07" is not recognized. Assigning a name of c_Be.
  warn('Thermal scattering material "{}" is not recognized. '
Converting be07.32t (ACE) to c_Be (HDF5)
Failed to convert be07.32t: Data provided for an incorrect material.
Converting be00.32t (ACE) to c_Be (HDF5)
Failed to convert be00.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "be01" is not recognized. Assigning a name of c_Be.
  warn('Thermal scattering material "{}" is not recognized. '
Converting be01.32t (ACE) to c_Be (HDF5)
Failed to convert be01.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "be02" is not recognized. Assigning a name of c_Be.
  warn('Thermal scattering material "{}" is not recognized. '
Converting be02.32t (ACE) to c_Be (HDF5)
Failed to convert be02.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "be03" is not recognized. Assigning a name of c_Be.
  warn('Thermal scattering material "{}" is not recognized. '
Converting be03.32t (ACE) to c_Be (HDF5)
Failed to convert be03.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "be04" is not recognized. Assigning a name of c_Be.
  warn('Thermal scattering material "{}" is not recognized. '
Converting be04.32t (ACE) to c_Be (HDF5)
Failed to convert be04.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "be05" is not recognized. Assigning a name of c_Be.
  warn('Thermal scattering material "{}" is not recognized. '
Converting be05.32t (ACE) to c_Be (HDF5)
Failed to convert be05.32t: Data provided for an incorrect material.
Converting pol00.32t (ACE) to c_H_in_CH2 (HDF5)
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "pol01" is not recognized. Assigning a name of c_H_in_CH2.
  warn('Thermal scattering material "{}" is not recognized. '
Converting pol01.32t (ACE) to c_H_in_CH2 (HDF5)
Failed to convert pol01.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hw00" is not recognized. Assigning a name of c_O_in_D2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hw00.32t (ACE) to c_O_in_D2O (HDF5)
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hw01" is not recognized. Assigning a name of c_O_in_D2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hw01.32t (ACE) to c_O_in_D2O (HDF5)
Failed to convert hw01.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hw02" is not recognized. Assigning a name of c_O_in_D2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hw02.32t (ACE) to c_O_in_D2O (HDF5)
Failed to convert hw02.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hw03" is not recognized. Assigning a name of c_O_in_D2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hw03.32t (ACE) to c_O_in_D2O (HDF5)
Failed to convert hw03.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hw04" is not recognized. Assigning a name of c_O_in_D2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hw04.32t (ACE) to c_O_in_D2O (HDF5)
Failed to convert hw04.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hw05" is not recognized. Assigning a name of c_O_in_D2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hw05.32t (ACE) to c_O_in_D2O (HDF5)
Failed to convert hw05.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hw06" is not recognized. Assigning a name of c_O_in_D2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hw06.32t (ACE) to c_O_in_D2O (HDF5)
Failed to convert hw06.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hw07" is not recognized. Assigning a name of c_O_in_D2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hw07.32t (ACE) to c_O_in_D2O (HDF5)
Failed to convert hw07.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr06" is not recognized. Assigning a name of c_Graphite.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr06.32t (ACE) to c_Graphite (HDF5)
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr07" is not recognized. Assigning a name of c_Graphite.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr07.32t (ACE) to c_Graphite (HDF5)
Failed to convert gr07.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr08" is not recognized. Assigning a name of c_Graphite.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr08.32t (ACE) to c_Graphite (HDF5)
Failed to convert gr08.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr09" is not recognized. Assigning a name of c_Graphite.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr09.32t (ACE) to c_Graphite (HDF5)
Failed to convert gr09.32t: Data provided for an incorrect material.
Converting gr00.32t (ACE) to c_Graphite (HDF5)
Failed to convert gr00.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr10" is not recognized. Assigning a name of c_Graphite_10p.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr10.32t (ACE) to c_Graphite_10p (HDF5)
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr01" is not recognized. Assigning a name of c_Graphite.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr01.32t (ACE) to c_Graphite (HDF5)
Failed to convert gr01.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr02" is not recognized. Assigning a name of c_Graphite.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr02.32t (ACE) to c_Graphite (HDF5)
Failed to convert gr02.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr03" is not recognized. Assigning a name of c_Graphite.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr03.32t (ACE) to c_Graphite (HDF5)
Failed to convert gr03.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr04" is not recognized. Assigning a name of c_Graphite.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr04.32t (ACE) to c_Graphite (HDF5)
Failed to convert gr04.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "gr05" is not recognized. Assigning a name of c_Graphite.
  warn('Thermal scattering material "{}" is not recognized. '
Converting gr05.32t (ACE) to c_Graphite (HDF5)
Failed to convert gr05.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw10" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw10.32t (ACE) to c_H_in_H2O (HDF5)
Converting lw00.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw00.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw01" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw01.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw01.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw02" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw02.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw02.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw03" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw03.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw03.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw04" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw04.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw04.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw05" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw05.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw05.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw06" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw06.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw06.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw07" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw07.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw07.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw08" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw08.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw08.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "lw09" is not recognized. Assigning a name of c_H_in_H2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting lw09.32t (ACE) to c_H_in_H2O (HDF5)
Failed to convert lw09.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hzr06" is not recognized. Assigning a name of c_H_in_ZrH.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hzr06.32t (ACE) to c_H_in_ZrH (HDF5)
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hzr07" is not recognized. Assigning a name of c_H_in_ZrH.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hzr07.32t (ACE) to c_H_in_ZrH (HDF5)
Failed to convert hzr07.32t: Data provided for an incorrect material.
Converting hzr00.32t (ACE) to c_H_in_ZrH (HDF5)
Failed to convert hzr00.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hzr01" is not recognized. Assigning a name of c_H_in_ZrH.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hzr01.32t (ACE) to c_H_in_ZrH (HDF5)
Failed to convert hzr01.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hzr02" is not recognized. Assigning a name of c_H_in_ZrH2.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hzr02.32t (ACE) to c_H_in_ZrH2 (HDF5)
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hzr03" is not recognized. Assigning a name of c_H_in_ZrH.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hzr03.32t (ACE) to c_H_in_ZrH (HDF5)
Failed to convert hzr03.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hzr04" is not recognized. Assigning a name of c_H_in_ZrH.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hzr04.32t (ACE) to c_H_in_ZrH (HDF5)
Failed to convert hzr04.32t: Data provided for an incorrect material.
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hzr05" is not recognized. Assigning a name of c_H_in_ZrH.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hzr05.32t (ACE) to c_H_in_ZrH (HDF5)
Failed to convert hzr05.32t: Data provided for an incorrect material.

There seem to be some conversions which pass successfully, but they assign the wrong name (e.g. hw00 being converted to c_O_in_D2O instead of c_D_in_D2O). I think this can be fixed by modifying the relevant method in thermal.py to read the second line of the ACE file which contains this extra information. Would love any input on this idea.

There are others that outright fail (“Data provided for an incorrect material”).
I used pdb to try to find out what was going on in these cases

Converting be07.32t (ACE) to c_Be (HDF5)
> /home/ooblack/projects/openmc/openmc/data/thermal.py(514)add_temperature_from_ace()
-> raise ValueError('Data provided for an incorrect material.')
(Pdb) p data.name
'nndc'
(Pdb) p self.name
'c_Be'
(Pdb) c
.
.
.
Converting hw01.32t (ACE) to c_O_in_D2O (HDF5)
> /home/ooblack/projects/openmc/openmc/data/thermal.py(514)add_temperature_from_ace()
-> raise ValueError('Data provided for an incorrect material.')
(Pdb) p data.name
'nndc'
(Pdb) p self.name
'c_O_in_D2O'

Interestingly, when I run the conversion script on a single thermal ACE file instead of using the --xsdata flag, the conversion passes without issue:

python openmc-ace-to-hdf5 Be-1200.ACE 
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "be07" is not recognized. Assigning a name of c_Be.
  warn('Thermal scattering material "{}" is not recognized. '
Converting be07.32t (ACE) to c_Be (HDF5)
python openmc-ace-to-hdf5 D2O-323.ACE 
/home/ooblack/projects/openmc/openmc/data/thermal.py:136: UserWarning: Thermal scattering material "hw01" is not recognized. Assigning a name of c_O_in_D2O.
  warn('Thermal scattering material "{}" is not recognized. '
Converting hw01.32t (ACE) to c_O_in_D2O (HDF5)

Hi @oyardas2. Regarding the issue 1, negative cross sections indeed should not appear in an evaluation for intuitively obvious reasons. The ACE format stores cross sections uniformly in barns, so the values you’re seeing there are negative barns. Unfortunately, many older data libraries have this problem of having evaluations that contain negative cross sections. We can’t deal with negative cross sections during transport, so our data converter sets any negative cross sections to zero. The warning is given to you as a user indicating that perhaps the data library you are using is not of the best quality.

Regarding issue 2, although ACE files use all sorts of different names for thermal scattering materials, we try to be uniform in OpenMC. Hydrogen in light water is always c_H_in_H2O. When thermal scattering tables are converted from ACE files, we have to guess what the material is based on the name given in the ACE file, and many times that works well but sometimes it doesn’t. In you case, I would recommend not using the openmc-ace-to-hdf5 script and instead write a small script yourself that does essentially the same thing but where you can manually assign a name. For example:

be = openmc.data.IncidentNeutron.from_ace('Be-293.ace', name='c_Be')
be.add_temperature_from_ace('Be-400.ace', name='c_Be')
be.add_temperature_from_ace('Be-500.ace', name='c_Be')
...
be.export_to_hdf5('c_Be.h5')

This will circumvent any problems due to the whole guessing of names. Once all the ACE files have been converted and written to HDF5, you’ll need to create a corresponding cross_sections.xml file:

lib = openmc.data.DataLibrary()
lib.register_file('c_Be.h5')
lib.register_file('c_D_in_D2O.h5')
...
lib.export_to_xml('cross_sections.xml')

Note that you’ll also need to include the normal incident neutron .h5 files in that library before exporting to XML.

Hi @paulromano, thanks for your response. That’s too bad to hear about the negative valued cross sections. I’ll look into alternatives.

As for the conversion script, I’ll give a shot implementing my own and post my results back here. I think I’ll use the openmc-ace-to-hdf5 script to create the normal incident neutron .h5 files from the nuclide ACE files, and then use my custom script to create the thermal scattering .h5 files from the corresponding thermal ACE files

1 Like