How would i go about making a hexagonal unit cell?

I basically want a hexagonal unit cell with sodium as the coolant, ht9 steel as cladding and the fuel in center.


import openmc
import openmc.model as m

fuel = openmc.Material(material_id=1, name = 'fuel_mat')
....

clad = openmc.Material(name='steel')
....

coolant = openmc.Material(name='sodium')
....

mat = openmc.Materials([fuel, clad, coolant])
mat.export_to_xml()

fuel_or = openmc.ZCylinder(x0=0.0, y0=0.0, r=0.386)
clad_ir = openmc.ZCylinder(x0=0.0, y0=0.0, r=0.45)


u_fuel = openmc.model.pin([fuel_or, clad_ir], [fuel, clad, coolant])


root_cell = openmc.Cell(name='root cell')
root_cell.fill = u_fuel

hexa = m.hexagonal_prism(edge_length=0.6375, orientation='y', origin=(0.0, 0.0), boundary_type='reflective', corner_radius=0.)
root_cell.region =  hexa

# Create root Universe

root_universe = openmc.Universe(universe_id=0, name='root universe')
root_universe.add_cell(root_cell)

# Create Geometry and set root Universe

geometry = openmc.Geometry(root_universe)

geometry.export_to_xml()

Check out modelling hexagonal lattice notebook.

Hope this will help.

2 Likes

thank you very much. that worked brilliantly. could you possibly comment on the edge length of the prism? The picture below shows my intent but i can’t find anywhere the dimension of how much coolant would go into it.

Again thank you, i understood your code well.
image

@hhhnain

Nope. What’s the pitch of this unit cell? It’s supposed to be in the docs.

im using an abr as a reference and the pitch is 16.2471cm

This is actually sub-assembly pitch.

For unit cell, edge length = 0.7764 cm

Best
pranto

1 Like

thank you very much. This is the final result.

Hi, do you know how to calculate the volume?

its pi r^2 of the fuel radius. maybe confirm with @paulromano

If phi r^2 it’s just for fuel right?

What problem are you having? Is it defining or the numeric? Be carefull to say fuel.volume if you named your main fuel as fuel

Of if you names your main fuel as Indah then it
would be indah.volume = math.pi * r ** 2

You have to import math aswell btw