Hello! I try to convert to hdf ACE and ENDF formats from this library:
But it doesn’t work. Maybe I do something wrong.
Hello! I try to convert to hdf ACE and ENDF formats from this library:
But it doesn’t work. Maybe I do something wrong.
@Ilyavitte When OpenMC does not recognize a specific thermal scattering material, you need to supply the table name, list of ZAIDs, and “nmix” parameter (see documentation for NJOY/ACER card 9). This can be done as:
openmc.data.ThermalScattering.from_njoy(
neutron_endf_file, thermal_endf_file,
table_name='c_H_in_MgH2',
zaids=[1001],
nmix=1
)
The above is just an example, and you should confirm the appropriate parameters for your case.
As for the error you’re seeing when you try from_ace
, I believe this is related to the fact that this is a new evaluation that uses mixed elastic scattering (incoherent+coherent). With the arguments above passed to from_njoy
, I actually get the same error too. I have a branch I’m working on to support mixed elastic scattering in OpenMC, so stay posted and hopefully I’ll have a fix soon!
Hello, Paul! I try to use it in my jupyter notebook, but it gives me the same mistake as when i’m calling command ‘from_ace’
Ah yes, I forgot that even trying to read the ACE file from the current version won’t work. I’ve recently implemented support for thermal scattering evaluations for mixed coherent/incoherent elastic, which you can find in this pull request. With that branch, you should be able to run either from_njoy
or from_ace
on these new evaluations.
Okay… I see, that in article: “ NJOY+NCrystal: An open-source tool for creating thermal neutron scattering
libraries with mixed elastic support” authors use OpenMC for their calculations. Maybe you know something about this and can give some examples, how they use specific data for their calculations?
I believe they may have had their own branch of OpenMC that implemented support for mixed elastic (separate from the one that I submitted a pull request).
UnicodeDecodeError Traceback (most recent call last)
Input In [1], in <cell line: 156>()
152 tallies.append(tally)
153 tallies.export_to_xml()
→ 156 openmc.run()
File ~/anaconda3/lib/python3.9/site-packages/openmc/executor.py:276, in run(particles, threads, geometry_debug, restart_file, tracks, output, cwd, openmc_exec, mpi_args, event_based)
232 “”“Run an OpenMC simulation.
233
234 Parameters
(…)
268
269 “””
271 args = _process_CLI_arguments(
272 volume=False, geometry_debug=geometry_debug, particles=particles,
273 restart_file=restart_file, threads=threads, tracks=tracks,
274 event_based=event_based, openmc_exec=openmc_exec, mpi_args=mpi_args)
→ 276 _run(args, output, cwd)
File ~/anaconda3/lib/python3.9/site-packages/openmc/executor.py:95, in _run(args, output, cwd)
92 lines =
93 while True:
94 # If OpenMC is finished, break loop
—> 95 line = p.stdout.readline()
96 if not line and p.poll() is not None:
97 break
File ~/anaconda3/lib/python3.9/codecs.py:322, in BufferedIncrementalDecoder.decode(self, input, final)
319 def decode(self, input, final=False):
320 # decode input (taking the buffer into account)
321 data = self.buffer + input
→ 322 (result, consumed) = self._buffer_decode(data, self.errors, final)
323 # keep undecoded input until the next call
324 self.buffer = data[consumed:]
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x80 in position 46: invalid start byte
I try to use my script on another computer and have the same problem, but DecodeError was with 0x84.
@Ilyavitte did you recompile the OpenMC executable before trying to run?
I make two environments. One of them with your’s pull request and one with stable version of openmc. I make cross section hdf5 in pull request and try to use this cross sections in both versions. But it doesn’t work with same error. I check version when i make calculation, they’re different