# Modeling Fuel pin cell error: CalledProcessError: Command 'openmc' died with \<Signals.SIGSEGV: 11\>

**URL:** <https://openmc.discourse.group/t/modeling-fuel-pin-cell-error-calledprocesserror-command-openmc-died-with-signals-sigsegv-11/1103>\
**Category:** User Support\
**Created:** [March 31, 2021, 8:22am UTC](https://openmc.discourse.group/t/modeling-fuel-pin-cell-error-calledprocesserror-command-openmc-died-with-signals-sigsegv-11/1103 "2021-03-31T08:22:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jon808](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@jon808](https://openmc.discourse.group/u/jon808)\
**Post date:** [March 31, 2021, 8:22am UTC](https://openmc.discourse.group/t/modeling-fuel-pin-cell-error-calledprocesserror-command-openmc-died-with-signals-sigsegv-11/1103/1 "2021-03-31T08:22:08Z")

</div>

Hi openMC group!

I am new to openMc and currently going through the modeling fuel pin example. All seemed to working well until the “openmc.run()” command and I get the openmc’ died with \<Signals.SIGSEGV: 11\> error and can’t run the k eigenvalue simulation. Here is what I had In my code:

%matplotlib inline  
import openmc

u02 = openmc.Material(1, “u02”) # defining a material. Within parenthesis, (material ID number, name)  
print(u02)

help(u02.add\_nuclide) # This shows you the parameters you need to add to define material

#So lets add the info(nuclides) to u02. Starting off with ATOM FRACTION  
u02.add\_nuclide(‘U235’, 0.03)  
u02.add\_nuclide(‘U238’, 0.97)  
u02.add\_nuclide(‘O16’, 2.0)

u02.set\_density(‘g/cm3’, 10.0)

zirconium = openmc.Material(2, “zirconium”)  
zirconium.add\_element(‘Zr’, 1.0)  
zirconium.set\_density(‘g/cm3’, 6.6)

#Coolant  
water = openmc.Material(3, “h2o”)  
water.add\_nuclide(‘H1’, 2.0)  
water.add\_nuclide(‘O16’, 1.0)  
water.set\_density(‘g/cm3’, 1.0)

#Make sure that the bound atom cross sections is used at thermal energies  
water.add\_s\_alpha\_beta(‘c\_H\_in\_H2O’)

#instantiate a materials collection to export to XML  
mats = openmc.Materials([u02, zirconium, water])

mats = openmc.Materials()  
mats.append(u02)  
mats += [zirconium, water]  
isinstance(mats, list)

#Creates the XML file  
mats.cross\_sections = r"/Users/jomnganal/Desktop/OpenMC Fusion Project/mcnp\_endfb70/cross\_sections.xml"  
mats.export\_to\_xml()  
!cat materials.xml

#ENRICHMENT  
#lets make 3% enriched u02  
u02\_three = openmc.Material()  
u02\_three.add\_element(‘U’, 1.0, enrichment=3.0)  
u02\_three.add\_element(‘O’, 2.0)  
u02\_three.set\_density(‘g/cc’, 10.0)

#MIXTURES  
#Can define materials by mixing existing materials  
#Example if want to mix U02(97%) and Pu02(3%)  
pu02 = openmc.Material()  
pu02.add\_nuclide(‘Pu239’, 0.94)  
pu02.add\_nuclide(‘Pu240’, 0.06)  
pu02.add\_nuclide(‘O16’, 2.0)  
pu02.set\_density(‘g/cm3’, 11.5)

#Create Mixture  
mox = openmc.Material.mix\_materials([u02, pu02], [0.97, 0.03], ‘wo’) #wo specifies they are weight fractions

#DEFINING GEOMETRY

#Start off with a sphere  
sph = openmc.Sphere(r=1.0)

#Lets define our sphere spacially, creating half spaces  
inside\_sphere = -sph  
outside\_sphere = +sph

#Now to check  
print((0,0,0) in inside\_sphere, (0,0,2) in inside\_sphere)  
print((0,0,0) in outside\_sphere, (0,0,2) in outside\_sphere)

#Now we can make more complex volumes by combining half spaces and boolean operators  
z\_plane = openmc.ZPlane(z0=0) # We create a plane directly in the middle of our sphere  
northern\_hemisphere = -sph & +z\_plane # define the top part of the sphere and plane is northern hemisphere

northern\_hemisphere.bounding\_box

cell = openmc.Cell()  
cell.region = northern\_hemisphere

cell.fill = water

universe = openmc.Universe()  
universe.add\_cell(cell)

#to show universe on plot  
universe.plot(width=(2.0, 2.0))

#The plot shows on an x-y plane on default. We can change with a basis argument:  
universe.plot(width=(2.0, 2.0), basis=‘xz’)

universe.plot(width=(2.0, 2.0), basis=‘xz’, colors={cell: ‘pink’})

fuel\_or = openmc.ZCylinder(r=0.39)  
clad\_ir = openmc.ZCylinder(r=0.40)  
clad\_or = openmc.ZCylinder(r=0.46)

fuel\_region = -fuel\_or # boundary of fuel is everything less than fuel outer radius  
gap\_region = +fuel\_or & -clad\_ir # boundary of gap is outside fuel but inside clad inner radius  
clad\_region = +clad\_ir & -clad\_or

#Now we can assign materials to those regions  
fuel = openmc.Cell(1, ‘fuel’)  
fuel.fill = u02  
fuel.region = fuel\_region

gap = openmc.Cell(2, ‘air gap’)  
gap\_region = gap\_region

clad = openmc.Cell(3, ‘clad’)  
clad.fill = zirconium  
clad\_region = clad\_region

pitch = 1.26  
left = openmc.XPlane(x0=-pitch/2, boundary\_type=‘reflective’)  
right = openmc.XPlane(x0=-pitch/2, boundary\_type=‘reflective’)  
bottom = openmc.YPlane(y0=-pitch/2, boundary\_type=‘reflective’)  
top = openmc.YPlane(y0=-pitch/2, boundary\_type=‘reflective’)

water\_region = +left & -right & +bottom & -top & +clad\_or

moderator = openmc.Cell(4, ‘moderator’)  
moderator.fill = water  
moderator.region = water\_region

box = openmc.rectangular\_prism(width=pitch, height=pitch,  
boundary\_type=‘reflective’)  
type(box)

water\_region = box & +clad\_or

root = openmc.Universe(cells=(fuel, gap, clad, moderator))

geom = openmc.Geometry()  
geom.root\_universe = root

#or  
geom = openmc.Geometry(root)  
geom.export\_to\_xml()  
!cat geometry.xml

#STARTING SOURCE AND SETTINGS  
point = openmc.stats.Point((0,0,0))  
src = openmc.Source(space=point)

#Now to add the settings to how many batches and particles we want  
settings = openmc.Settings()  
settings.source = src  
settings.batches = 100  
settings.inactive = 10  
settings.particles = 100

settings.export\_to\_xml()  
!cat settings.xml

#USER DEFINED TALLIES  
#tally the total, fission, absorbption, and neutron/gamma reaction rates in the cell containing the fuel

#Create a tally specifying the fuel cell  
cell\_filter = openmc.CellFilter(fuel)

t = openmc.Tally(1)  
t.filters = [cell\_filter]

#We can use nuclide attribute to name specific nuclides we are interested in  
t.nuclides = [‘U235’]  
t.scores = [‘total’, ‘fission’, ‘absorption’, ‘(n,gamma)’]

#similar to others, we need tallies collection and export to xml  
tallies = openmc.Tallies([t])  
tallies.export\_to\_xml()  
!cat tallies.xml

openmc.run()

After running, this is the error I get:

* * *

CalledProcessError Traceback (most recent call last)  
 in   
1 #RUNNING OPENMC  
2  
----\> 3 openmc.run()

~/opt/anaconda3/envs/openmc-env/lib/python3.9/site-packages/openmc/executor.py in run(particles, threads, geometry\_debug, restart\_file, tracks, output, cwd, openmc\_exec, mpi\_args, event\_based)  
216 args = mpi\_args + args  
217  
 → 218 \_run(args, output, cwd)

~/opt/anaconda3/envs/openmc-env/lib/python3.9/site-packages/openmc/executor.py in \_run(args, output, cwd)  
26 # Raise an exception if return status is non-zero  
27 if p.returncode != 0:  
—\> 28 raise subprocess.CalledProcessError(p.returncode, ’ '.join(args),  
29 ‘’.join(lines))  
30

CalledProcessError: Command ‘openmc’ died with \<Signals.SIGSEGV: 11\>.

Would love help debugging!

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [March 31, 2021, 9:30am UTC](https://openmc.discourse.group/t/modeling-fuel-pin-cell-error-calledprocesserror-command-openmc-died-with-signals-sigsegv-11/1103/2 "2021-03-31T09:30:11Z")

</div>

@jon808 Welcome to the forum.

> [@jon808](#):
>
> gap = openmc.Cell(2, ‘air gap’)  
> gap\_region = gap\_region
> 
> clad = openmc.Cell(3, ‘clad’)  
> clad.fill = zirconium  
> clad\_region = clad\_region

Correct way to do this

```python
gap = openmc.Cell(2, ‘air gap’)
gap.region = gap_region

clad = openmc.Cell(3, ‘clad’)
clad.fill = zirconium
clad.region = clad_region

```

And the second one

> [@jon808](#):
>
> pitch = 1.26  
> left = openmc.XPlane(x0=-pitch/2, boundary\_type=‘reflective’)  
> right = openmc.XPlane(x0=-pitch/2, boundary\_type=‘reflective’) ### (+)  
> bottom = openmc.YPlane(y0=-pitch/2, boundary\_type=‘reflective’)  
> top = openmc.YPlane(y0=-pitch/2, boundary\_type=‘reflective’) ### (+)

```python
pitch = 1.26
left = openmc.XPlane(x0=-pitch/2, boundary_type='reflective')
right = openmc.XPlane(x0=pitch/2, boundary_type='reflective')
bottom = openmc.YPlane(y0=-pitch/2, boundary_type='reflective')
top = openmc.YPlane(y0=pitch/2, boundary_type='reflective')

```

Best regards  
pranto

---

<div class="post-metadata">

**Author:** ![jon808](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@jon808](https://openmc.discourse.group/u/jon808)\
**Post date:** [April 1, 2021, 7:12am UTC](https://openmc.discourse.group/t/modeling-fuel-pin-cell-error-calledprocesserror-command-openmc-died-with-signals-sigsegv-11/1103/3 "2021-04-01T07:12:57Z")

</div>

Thank you so much Pranto! It is working now and I am getting values. I greatly appreciate it!

Cheers,  
Jon
