# Asking for help to fix

**URL:** <https://openmc.discourse.group/t/asking-for-help-to-fix/4728>\
**Category:** User Support\
**Created:** [August 25, 2024, 5:26pm UTC](https://openmc.discourse.group/t/asking-for-help-to-fix/4728 "2024-08-25T17:26:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![noor\_al\_din](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@noor\_al\_din](https://openmc.discourse.group/u/noor_al_din)\
**Post date:** [August 25, 2024, 5:26pm UTC](https://openmc.discourse.group/t/asking-for-help-to-fix/4728/1 "2024-08-25T17:26:29Z")

</div>

Hello. I am new to openmc. I am trying to simulate burnup analysis with onix-openmc coupling.  
my code is

import openmc  
import onix  
import openmc.mgxs as mgxs  
from onix.cell import Cell  
from onix.system import System  
from onix import salameche

from onix import utils  
import matplotlib  
from matplotlib import pyplot  
import numpy as np  
import math  
import matplotlib\_inline

#defining material  
uo2\_35 = openmc.Material()  
uo2\_35.add\_element(‘U’, 1, enrichment=1.8)  
uo2\_35.add\_nuclide(‘O16’, 2, ‘ao’)  
uo2\_35.set\_density(“g/cm3”, 10.77)  
uo2\_35.volume = 63.51  
#gadolinium  
#gd2o3 = openmc.Material()  
#gd2o3.add\_element(‘Gd’,2)  
#gd2o3.add\_nuclide(‘O16’,3)  
#gd2o3.set\_density(‘g/cm3’,7.41)  
#mixing fuel elements  
#mixer = openmc.Material.mix\_materials([uo2\_35,gd2o3],[0.6,0.4])  
#moderator and coolant material  
h2o = openmc.Material()  
h2o.add\_nuclide(‘H1’, 2, ‘ao’)  
h2o.add\_nuclide(‘O16’, 1, ‘ao’)  
h2o.set\_density(‘g/cm3’, 1)  
h2o.add\_s\_alpha\_beta(‘c\_H\_in\_H2O’)  
#zircalloy  
zr\_alloy = openmc.Material()  
zr\_alloy.set\_density(‘g/cm3’, 6.56)  
zr\_alloy.add\_nuclide(‘O16’, 0.001196, ‘wo’)  
zr\_alloy.add\_element(‘Cr’, 0.000997, ‘wo’)  
zr\_alloy.add\_element(‘Fe’, 0.001994, ‘wo’)  
zr\_alloy.add\_element(‘Sn’, 0.013955, ‘wo’)  
zr\_alloy.add\_element(‘Zr’, 0.981855, ‘wo’)  
#hellium  
#he = openmc.Material(5,‘gap\_material’)  
#he.add\_element(‘He’,1,‘ao’)  
materials = openmc.Materials([uo2\_35, h2o, zr\_alloy])  
materials.cross\_sections = ‘///home/noor-al-din/Downloads/endfb-vii.1-hdf5/cross\_sections.xml’  
materials.export\_to\_xml()  
#defining geometry  
fuel\_or = openmc.ZCylinder(r=0.38)  
clad\_ir = openmc.ZCylinder(r=0.41)  
clad\_or = openmc.ZCylinder(r=0.86)  
hexa\_prism = openmc.model.HexagonalPrism(edge\_length=1.38, boundary\_type=‘reflective’)

up = openmc.ZPlane(z0=+70, boundary\_type=‘vacuum’)  
down = openmc.ZPlane(z0=-70, boundary\_type=‘vacuum’)  
right = openmc.XPlane(x0=0.97, boundary\_type=‘vacuum’)  
left = openmc.XPlane(x0=-0.97, boundary\_type=‘vacuum’)  
p\_width = openmc.YPlane(y0=1.19, boundary\_type=‘vacuum’)  
n\_width = openmc.YPlane(y0=-1.19, boundary\_type=‘vacuum’)  
#defining region  
fuel\_reg = -fuel\_or & -up & +down  
gap\_reg = -clad\_ir & +fuel\_or & -up & +down  
clad\_reg = -clad\_or & +clad\_ir & -up & +down  
mod\_reg = +clad\_or & -hexa\_prism & -up & +down  
com\_reg = -hexa\_prism  
#defining region  
‘’‘fuel\_reg = -fuel\_or & -up & +down  
gap\_reg = -clad\_ir & +fuel\_or & -up & +down  
clad\_reg = -clad\_or & +clad\_ir & -up & +down  
mod\_reg = +clad\_or & -hexa\_prism & -up & +down’‘’  
#fuel cell  
fuel\_cell1 = openmc.Cell()  
fuel\_cell1.fill = uo2\_35  
fuel\_cell1.region = fuel\_reg  
fuel\_cell1.volume= 63.51  
#moderator cell  
mod\_cell = openmc.Cell()  
mod\_cell.fill = h2o  
mod\_cell.region = mod\_reg  
#gap cell  
gap\_cell = openmc.Cell()  
gap\_cell.fill = None  
gap\_cell.region = gap\_reg  
#cladding cell  
clad\_cell = openmc.Cell()  
clad\_cell.fill = zr\_alloy  
clad\_cell.region = clad\_reg

‘’'com\_cell = openmc.Cell()

com\_cell.region = fuel\_reg | gap\_reg | clad\_reg | mod\_reg & -up & +down  
vol\_clc = openmc.VolumeCalculation([com\_cell], 10000000, [-0.97, -1.19, -70], [0.97, 1.19, 70])‘’’

#universe  
root = openmc.Universe(cells=(fuel\_cell1, gap\_cell, clad\_cell, mod\_cell))  
root\_cell = openmc.Cell()  
root\_cell.fill = root  
root\_cell.region = fuel\_reg & gap\_reg & clad\_reg | mod\_reg  
root\_univ = openmc.Universe()  
root\_univ.add\_cell = root\_cell

geom = openmc.Geometry(root\_univ)

#root\_2 = openmc.Universe(cells=(mod\_cell))

geom.export\_to\_xml()  
‘’'p = openmc.Plot()  
p.filename = ‘hexacaremplot’  
p.width= (3.0,3.0)  
p.pixels = (2500,2500)

openmc.plot\_inline(p)‘’’  
sets = openmc.Settings()  
sets.batches = 200  
sets.inactive = 50  
sets.particles = 1000  
sets.export\_to\_xml()  
#openmc.run()  
macrostep\_vector = [0.1, 0.5, 2.5, 7.5, 15, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360, 390, 420]  
macrostep\_unit = ‘d’  
norma\_vector = [550] \* len(macrostep\_vector)  
norma\_unit = ‘power’  
microstep\_vector = [3] \* len(macrostep\_vector)  
microstep\_vector = [3] \* len(macrostep\_vector)  
sequence1 = onix.Sequence(1)  
sequence1.set\_macrostep(macrostep\_vector, macrostep\_unit)  
sequence1.set\_norma(norma\_vector, norma\_unit)  
sequence1.microstep\_vector = microstep\_vector  
sequence1.flux\_approximation = ‘iv’  
bu\_cell = onix.cell.Cell(1, ‘burn\_cell’)

bu\_cell.set\_default\_decay\_lib()  
#bu\_cell = root\_cell  
couple = onix.couple.Couple\_openmc()

couple.set\_bounding\_box([-0.97, -1.19, -70], [0.97, 1.19, 70])

#couple.openmc\_bin\_path = ‘/home/noor-al-din/anaconda3/envs/openmc-env/bin’  
couple.select\_bucells([fuel\_cell1])  
#couple.root\_cell(com\_cell)  
couple.import\_openmc(root\_cell)  
couple.set\_decay\_lib(‘///home/noor-al-din/Downloads/chain\_endfb80\_pwr.xml’)  
couple.set\_user\_fy\_lib(‘///home/noor-al-din/Downloads/chain\_endfb80\_pwr.xml’, complete=True)  
vol = {‘fuel\_cell’: 63.51}  
couple.set\_vol(vol)  
couple.set\_sequence(sequence1)  
couple.burn()  
but it is showing  
{}  
=== OpenMC pre-run ===

Traceback (most recent call last):  
File “/home/noor-al-din/PycharmProjects/pythonProject/project carem/onix3.py”, line 144, in   
couple.import\_openmc(root\_cell)  
File “/home/noor-al-din/anaconda3/envs/openmc-env/lib/python3.12/site-packages/onix/couple/couple\_openmc.py”, line 312, in import\_openmc  
self.\_pre\_run(root\_cell)  
File “/home/noor-al-din/anaconda3/envs/openmc-env/lib/python3.12/site-packages/onix/couple/couple\_openmc.py”, line 458, in \_pre\_run  
openmc.calculate\_volumes(cwd = pre\_run\_path)  
File “/home/noor-al-din/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/executor.py”, line 254, in calculate\_volumes  
\_run(args, output, cwd)  
File “/home/noor-al-din/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/executor.py”, line 125, in \_run  
raise RuntimeError(error\_msg)  
RuntimeError: No cells were found in the geometry.xml file -------------------------------------------------------------------------- MPI\_ABORT was invoked on rank 0 in communicator MPI\_COMM\_WORLD Proc: [[47750,0],0] Errorcode: -1 NOTE: invoking MPI\_ABORT causes Open MPI to kill all MPI processes. You may or may not see output from other processes, depending on exactly when Open MPI kills them. --------------------------------------------------------------------------  
%%%%%%%%%%%%%%%  
%%%%%%%%%%%%%%%%%%%%%%%%  
please help me to fix this

---

<div class="post-metadata">

**Author:** ![wahidluthfi](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/wahidluthfi/32/3375_2.png) [@wahidluthfi](https://openmc.discourse.group/u/wahidluthfi)\
**Post date:** [August 26, 2024, 3:15am UTC](https://openmc.discourse.group/t/asking-for-help-to-fix/4728/2 "2024-08-26T03:15:54Z")

</div>

Hi Noor Al Din, welcome to the openmc community.  
the problem you encounter is  
`RuntimeError: No cells were found in the geometry.xml file `  
which came from this line input `root_univ.add_cell = root_cell`, which makes the material.xml file empty. It should be `root_univ.add_cell(root_cell)` so the root\_cell will be added as root universe for your openmc model.  
also, this part of region definitions `root_cell.region = fuel_reg & gap_reg & clad_reg | mod_reg` can’t work since the fuel region will not intersect (&) to gap regions and so on.  
try to use a simpler method, such as the root cell covering the area of 1 fuel pin with coolant which is then filled with fuel pin universe.

also, there are several other things that you should pay attention to when using Onix, i.e. Onix can’t handle add\_element if you use that when defining depletable material, so you need to use add\_nuclide. also, problems might arise in the Onix routine when you use void material in root cells, and don’t forget to add total volume in your Onix openmc volume definition. With many Onix examples from their documentation, I think it would be good practice to give names to all your cells.

your model has a low heavy metal loading (low k-inf value) for 420 days of operation in 550 watts/cc. You might want to check your input. Here is the notebook for your case  
[nooronix.ipynb](https://openmc.discourse.group/uploads/short-url/quDOubXfDmIr7ClesFzGEntvPEt.ipynb) (1.5 MB)

---

<div class="post-metadata">

**Author:** ![noor\_al\_din](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@noor\_al\_din](https://openmc.discourse.group/u/noor_al_din)\
**Post date:** [August 26, 2024, 6:59am UTC](https://openmc.discourse.group/t/asking-for-help-to-fix/4728/3 "2024-08-26T06:59:36Z")

</div>

Thank you very much for your help.  
but in my jupyter note book  
File [~/anaconda3/envs/openmc-env/lib/python3.12/site-packages/numpy/linalg/\_linalg.py:162](http://localhost:8891/lab/tree/anaconda3/envs/openmc-env/lib/python3.12/site-packages/numpy/linalg/_linalg.py#line=161), in \_commonType(\*arrays) 159 result\_type = double 160 elif rt is None: 161 # unsupported inexact scalar → 162 raise TypeError(“array type %s is unsupported in linalg” % 163 (a.dtype.name,)) 164 else: 165 result\_type = double TypeError: array type complex256 is unsupported in linalg  
have you faced this issue before?

---

<div class="post-metadata">

**Author:** ![wahidluthfi](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/wahidluthfi/32/3375_2.png) [@wahidluthfi](https://openmc.discourse.group/u/wahidluthfi)\
**Post date:** [August 26, 2024, 9:11am UTC](https://openmc.discourse.group/t/asking-for-help-to-fix/4728/4 "2024-08-26T09:11:26Z")

</div>

Hi Noor,  
Sorry, I didn’t get any error when running your case, you can check the notebook file I attached. Have you tried to run the openmc-onix notebook example to make sure that you have a proper configuration?  
You can also try to localize the problem in your model, i.e. try to run the openmc part of your input and then run the coupled openmc-onix.
