armi: r.core.growToFullCore() error when loading from database

Discussed with @jakehader. When loading a reactor using a case settings file, mechanical team is able to grow to full core. When loading a reactor object from a database, a runtime error is thrown when growing to full core. It appears that with the latter method, the global assembly number is set incorrectly.

Works:

import armi
o = armi.init(fName='myCaseSettings.yaml')
o.r.core.growToFullCore(cs)

Throws RuntimeError:

from armi.bookkeeping.db import databaseFactory
db = databaseFactory('myDatabaseName.h5','r')
with db:
    r = db.load(5,2)
r.core.growToFullCore(cs)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

@jasonbmeng It would really help me fix this bug if you could copy/paste the actual error / stack trace below. Thanks!

@jakehader Are you saying this is a known bug, because this line is called when loading a reactor from DB, not when normally initializing a reactor?

https://github.com/terrapower/armi/blob/a3f23ed01538aaaeb1dc58b5bf158def918901ef/armi/bookkeeping/db/database3.py#L144-L147

I am saying that I worked with Jason when he was having this issue and the load function on the database3 appears to not call that update assembly numbers (if I remember correctly now).

Sure thing, @john-science. Here’s the stack trace when running r.core.growToFullCore(cs):

In [9]: r.core.growToFullCore(cs)
[xtra] No edge assemblies to remove
[info] Expanding to full core geometry
[err ] The assembly <radial shield outer Assembly A0155 at 013-016> in the reactor already has the name A0155.
       Cannot add <radial shield outer Assembly A0155 at 013-019>. Current assemNum is 156
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-9-0b3aa91bbdb3> in <module>
----> 1 r.core.growToFullCore(cs)

~\codes\nala\framework\armi\reactor\reactors.py in growToFullCore(self, cs)
   2138
   2139         converter = gc.ThirdCoreHexToFullCoreChanger(cs)
-> 2140         converter.convert(self.r)
   2141
   2142         return converter

~\codes\nala\framework\armi\reactor\converters\geometryConverters.py in convert(self, r)
   1345                 newAssem = copy.deepcopy(a)
   1346                 newAssem.makeUnique()
-> 1347                 r.core.add(newAssem, r.core.spatialGrid[i, j, 0])
   1348                 self._newAssembliesAdded.append(newAssem)
   1349

~\codes\nala\framework\armi\reactor\reactors.py in add(self, a, spatialLocator)
    536                 )
    537             )
--> 538             raise RuntimeError("Core already contains an assembly with the same name.")
    539         self.assembliesByName[aName] = a
    540         for b in a:

RuntimeError: Core already contains an assembly with the same name.