# Depletion failure

**URL:** <https://openmc.discourse.group/t/depletion-failure/2614>\
**Category:** User Support\
**Created:** [January 12, 2023, 8:59pm UTC](https://openmc.discourse.group/t/depletion-failure/2614 "2023-01-12T20:59:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian729](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Brian729](https://openmc.discourse.group/u/Brian729)\
**Post date:** [January 12, 2023, 8:59pm UTC](https://openmc.discourse.group/t/depletion-failure/2614/1 "2023-01-12T20:59:41Z")

</div>

I am running a U233/Th232 molten salt reactor simulation. I am using the following depletion code: Power is 3 Gigawatts

time\_steps\_day=[24_60_60]\*10  
model = openmc.Model(geometry=geometry,materials=materials, settings=settings)  
operator = openmc.deplete.CoupledOperator(model,chainfile)  
integrator = openmc.deplete.PredictorIntegrator(operator, time\_steps\_day, power)  
integrator.integrate()  
results = openmc.deplete.ResultsList.from\_hdf5(“./depletion\_results.h5”)

I get the following warning after 6 depletion iterations:  
Creating state point openmc\_simulation\_n6.h5…

/home/brian/.local/lib/python3.10/site-packages/openmc/deplete/helpers.py:427: RuntimeWarning: overflow encountered in scalar divide  
return source\_rate / energy  
/home/brian/.local/lib/python3.10/site-packages/openmc/deplete/openmc\_operator.py:548: RuntimeWarning: invalid value encountered in multiply  
rates \*= self.\_normalization\_helper.factor(source\_rate)  
/home/brian/.local/lib/python3.10/site-packages/scipy/sparse/linalg/\_dsolve/linsolve.py:276: MatrixRankWarning: Matrix is exactly singular  
warn(“Matrix is exactly singular”, MatrixRankWarning)  
/home/brian/.local/lib/python3.10/site-packages/scipy/sparse/linalg/\_dsolve/linsolve.py:276: MatrixRankWarning: Matrix is exactly singular  
warn(“Matrix is exactly singular”, MatrixRankWarning)

And the following failure report:  
AllocationError Traceback (most recent call last)  
Cell In[16], line 5  
3 operator = openmc.deplete.CoupledOperator(model,chainfile)  
4 integrator = openmc.deplete.PredictorIntegrator(operator, time\_steps\_day, power)  
----\> 5 integrator.integrate()  
6 results = openmc.deplete.ResultsList.from\_hdf5(“./depletion\_results.h5”)

File ~/.local/lib/python3.10/site-packages/openmc/deplete/abc.py:806, in Integrator.integrate(self, final\_step, output)  
804 # Solve transport equation (or obtain result from restart)  
805 if i \> 0 or self.operator.prev\_res is None:  
 → 806 conc, res = self.\_get\_bos\_data\_from\_operator(i, source\_rate, conc)  
807 else:  
808 conc, res = self.\_get\_bos\_data\_from\_restart(i, source\_rate, conc)

File ~/.local/lib/python3.10/site-packages/openmc/deplete/abc.py:759, in Integrator.\_get\_bos\_data\_from\_operator(self, step\_index, source\_rate, bos\_conc)  
756 “”“Get beginning of step concentrations, reaction rates from Operator  
757 “””  
758 x = deepcopy(bos\_conc)  
 → 759 res = self.operator(x, source\_rate)  
760 self.operator.write\_bos\_data(step\_index + self.\_i\_res)  
761 return x, res

File ~/.local/lib/python3.10/site-packages/openmc/deplete/coupled\_operator.py:465, in CoupledOperator. **call** (self, vec, source\_rate)  
462 openmc.lib.run()  
464 # Extract results  
 → 465 rates = self.\_calculate\_reaction\_rates(source\_rate)  
467 # Get k and uncertainty  
468 keff = ufloat(\*openmc.lib.keff())

File ~/.local/lib/python3.10/site-packages/openmc/deplete/openmc\_operator.py:533, in OpenMCOperator.\_calculate\_reaction\_rates(self, source\_rate)  
530 for nuc, i\_nuc\_results in zip(rxn\_nuclides, nuc\_ind):  
531 number[i\_nuc\_results] = self.number[mat, nuc]  
 → 533 tally\_rates = self.\_rate\_helper.get\_material\_rates(  
534 mat\_index, nuc\_ind, react\_ind)  
536 # Compute fission yields for this material  
537 fission\_yields.append(self.\_yield\_helper.weighted\_yields(i))

File ~/.local/lib/python3.10/site-packages/openmc/deplete/helpers.py:217, in DirectReactionRateHelper.get\_material\_rates(self, mat\_id, nuc\_index, react\_index)  
198 “”“Return an array of reaction rates for a material  
199  
200 Parameters  
(…)  
214 reaction rates in this material  
215 “””  
216 self.\_results\_cache.fill(0.0)  
 → 217 full\_tally\_res = self.rate\_tally\_means[mat\_id]  
218 for i\_tally, (i\_nuc, i\_react) in enumerate(  
219 product(nuc\_index, react\_index)):  
220 self.\_results\_cache[i\_nuc, i\_react] = full\_tally\_res[i\_tally]

File ~/.local/lib/python3.10/site-packages/openmc/deplete/helpers.py:186, in DirectReactionRateHelper.rate\_tally\_means(self)  
184 # If the mean cache is empty, fill it once with this transport cycle’s results  
185 if self.\_rate\_tally\_means\_cache is None:  
 → 186 self.\_rate\_tally\_means\_cache = self.\_rate\_tally.mean  
187 return self.\_rate\_tally\_means\_cache

File ~/.local/lib/python3.10/site-packages/openmc/lib/tally.py:276, in Tally.mean(self)  
273 @property  
274 def mean(self):  
275 n = self.num\_realizations  
 → 276 sum\_ = self.results[:, :, 1]  
277 if n \> 0:  
278 return sum\_ / n

File ~/.local/lib/python3.10/site-packages/openmc/lib/tally.py:306, in Tally.results(self)  
304 data = POINTER(c\_double)()  
305 shape = (c\_size\_t\*3)()  
 → 306 \_dll.openmc\_tally\_results(self.\_index, data, shape)  
307 return as\_array(data, tuple(shape))

File ~/.local/lib/python3.10/site-packages/openmc/lib/error.py:21, in \_error\_handler(err, func, args)  
19 # Raise exception type corresponding to error code  
20 if err == errcode(‘OPENMC\_E\_ALLOCATE’):  
—\> 21 raise exc.AllocationError(msg)  
22 elif err == errcode(‘OPENMC\_E\_OUT\_OF\_BOUNDS’):  
23 raise exc.OutOfBoundsError(msg)

AllocationError: Tally results have not been allocated yet.

I have tried varying source particle settings, varying the duration of the time steps, neither of which made any difference except when I changed the time step duration to a week, it failed one second iteration. Keff is well over 1.0 (1.03) when the failure occurs. Any suggestions?

---

<div class="post-metadata">

**Author:** ![KUNG](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/kung/32/3725_2.png) [@KUNG](https://openmc.discourse.group/u/KUNG)\
**Post date:** [October 28, 2024, 5:01pm UTC](https://openmc.discourse.group/t/depletion-failure/2614/2 "2024-10-28T17:01:25Z")

</div>

_Have you figured out what caused your “AllocationError: Tally results have not been allocated yet.”?_

This error appeared for me when I tried to run a pincell depletion example with an erroneous chain file (jeff33 chain file I generated myself with missing fission reactions and yields)…  
Without fission reactions/yields in the chain file I guess it is not surprising that it will fail after the the first transport step. With the corrected chain file the depletion example runs.

**Error in pincell depletion example with erroneous jeff33 chain:**  
Traceback (most recent call last):  
File “~/openmc/calculations/AP1/pincell\_depletion\_07/pincell\_depletion.py”, line 360, in   
integrator.integrate()  
File “~/openmc/venv-openmc/lib/python3.10/site-packages/openmc/deplete/abc.py”, line 801, in integrate  
n, res = self.\_get\_bos\_data\_from\_operator(i, source\_rate, n)  
File “~/openmc/venv-openmc/lib/python3.10/site-packages/openmc/deplete/abc.py”, line 745, in \_get\_bos\_data\_from\_operator  
res = self.operator(x, source\_rate)  
File “~/openmc/venv-openmc/lib/python3.10/site-packages/openmc/deplete/coupled\_operator.py”, line 456, in **call**  
rates = self.\_calculate\_reaction\_rates(source\_rate)  
File “~/openmc/venv-openmc/lib/python3.10/site-packages/openmc/deplete/openmc\_operator.py”, line 527, in \_calculate\_reaction\_rates  
tally\_rates = self.\_rate\_helper.get\_material\_rates(  
File “~/openmc/venv-openmc/lib/python3.10/site-packages/openmc/deplete/helpers.py”, line 219, in get\_material\_rates  
full\_tally\_res = self.rate\_tally\_means[mat\_index]  
File “~/openmc/venv-openmc/lib/python3.10/site-packages/openmc/deplete/helpers.py”, line 188, in rate\_tally\_means  
self.\_rate\_tally\_means\_cache = self._rate\_tally.mean  
File “~/openmc/venv-openmc/lib/python3.10/site-packages/openmc/lib/tally.py”, line 310, in mean  
sum_ = self.results[:, :, 1]  
File “~/openmc/venv-openmc/lib/python3.10/site-packages/openmc/lib/tally.py”, line 340, in results  
\_dll.openmc\_tally\_results(self.\_index, data, shape)  
File “~/openmc/venv-openmc/lib/python3.10/site-packages/openmc/lib/error.py”, line 21, in \_error\_handler  
raise exc.AllocationError(msg)  
openmc.exceptions.AllocationError: Tally results have not been allocated yet.

**The script I used to generate the jeff33 chain file is an adapted one of this one here:** [data/depletion/generate\_tendl\_chain.py at master · openmc-dev/data · GitHub](https://github.com/openmc-dev/data/blob/master/depletion/generate_tendl_chain.py)

**Update:** My jeff33 chain file was erroneous (fission product yield and fission reactions were missing since I pointed incorrectly to the fpy\_files).

**The warnings/messages from _openmc.deplete.Chain.from\_endf_ for jeff33 were:**  
[…]  
[Various warnings from decay.py about continuous spectra with log-linear interpolations e.g. for Th230, Th232, … Es 253]  
[…]  
Decay mode [‘beta-’] of parent In123\_m1 has a zero branching ratio.  
[…]  
The following fissionable nuclides have no fission product yields:  
Ra223, replaced with U235  
Ra226, replaced with U235  
Ac225, replaced with U235  
[…]  
Fm255, replaced with U235
