OSError: Error reading file '<openmc.deplete.chain.Chain object at 0x7eff6f2f8a10>': failed to load external entity "<openmc.deplete.chain.Chain object at 0x7eff6f2f8a10>"

Tried to run a simple depletion simulation on example of TRIGA reactor provided by OpenMC. Here is my code:

import openmc.deplete
chain_file = openmc.deplete.Chain.from_xml("chain_endfb80_pwr.xml")
model = openmc.Model(geometry=geometry, settings=settings_file)
operator = openmc.deplete.CoupledOperator(model, chain_file)

and the error:

OSError                                   Traceback (most recent call last)
Cell In[32], line 2
      1 model = openmc.Model(geometry=geometry, settings=settings_file)
----> 2 operator = openmc.deplete.CoupledOperator(model, chain_file)


File src/lxml/etree.pyx:3570, in lxml.etree.parse()

File src/lxml/parser.pxi:1952, in lxml.etree._parseDocument()

File src/lxml/parser.pxi:1978, in lxml.etree._parseDocumentFromURL()

File src/lxml/parser.pxi:1881, in lxml.etree._parseDocFromFile()

File src/lxml/parser.pxi:1200, in lxml.etree._BaseParser._parseDocFromFile()

File src/lxml/parser.pxi:633, in lxml.etree._ParserContext._handleParseResultDoc()

File src/lxml/parser.pxi:743, in lxml.etree._handleParseResult()

File src/lxml/parser.pxi:670, in lxml.etree._raiseParseError()

OSError: Error reading file '<openmc.deplete.chain.Chain object at 0x7eff6f2f8a10>': failed to load external entity "<openmc.deplete.chain.Chain object at 0x7eff6f2f8a10>"

please help me to solve this issue. also sorry for my bad english. thank you very much!

The chain_file argument to CoupledOperator should be the filename, not the Chain object itself. So, changing your code to:

chain_file = "chain_endfb80_pwr.xml"

should do the trick. That is a bit confusing and probably something that ought to be updated in OpenMC!

1 Like

solved. thank you very much!