How to model a truncated cone with hollow inside.

58 views
Skip to first unread message

Sharif Abu Darda

unread,
Dec 10, 2019, 3:04:39 AM12/10/19
to OpenMC Users Group
Hello, I was looking for an example of how OpenMC handles this attached model structure? It's a truncated cone with a hollow inside. Having two outer radii and two inner radii. Please share a sample code example of how this is handled in OpenMC. Thank you.
s-l300.jpg

Sterling Harper

unread,
Dec 10, 2019, 11:45:16 AM12/10/19
to Sharif Abu Darda, OpenMC Users Group
Here's an example for a cone with a hollow cylindrical inside. A model with two concentric cones would be similar except you'd have to repeat the process of finding the z0 and r^2 parameters for the inner cone.

# Define parameters for the annular cone.
inner_radius = 0.5
outer_radius = 1.0
height = 1.5
z_top = 0.0

# Compute the cone's r parameter. It is determined by how quickly the radius
# changes as a function of height.
cone_r = (outer_radius - inner_radius) / height

# Find the z0 parameter that places the top of the cell at z_top.
cone_z0 = z_top + inner_radius / cone_r

# Define the surfaces for the annular cone.
cone = openmc.ZCone(z0=cone_z0, r2=cone_r**2)
inner_cyl = openmc.ZCylinder(r=inner_radius)
plane1 = openmc.ZPlane(z0=z_top-height)
plane2 = openmc.ZPlane(z0=z_top)

# Define the annular cone cell
cell = openmc.Cell()
cell.region = -cone & +inner_cyl & +plane1 & -plane2


On Tue, Dec 10, 2019 at 3:04 AM Sharif Abu Darda <shabu...@gmail.com> wrote:
Hello, I was looking for an example of how OpenMC handles this attached model structure? It's a truncated cone with a hollow inside. Having two outer radii and two inner radii. Please share a sample code example of how this is handled in OpenMC. Thank you.

--
You received this message because you are subscribed to the Google Groups "OpenMC Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openmc-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openmc-users/db7b62cf-ff95-4285-9205-f97e30f94f33%40googlegroups.com.

Sharif Abu Darda

unread,
Dec 10, 2019, 4:47:54 PM12/10/19
to OpenMC Users Group
Hello Dr. Sterling Harper. Thank you for your example. I was able to follow it completely. Also, I designed the two concentric cones to follow your sample. Here is the code for others if needed. This will generate a cone with a hollow inside. 

inner_radius_in = 0.5
inner_radius_out = 0.7
outer_radius_in = 1.0
outer_radius_out = 1.2
height = 1.5
z_top = 0.0

cone_r_in = (outer_radius_in - inner_radius_in) / height
cone_z0_in = z_top + inner_radius_in / cone_r_in

cone_r_out = (outer_radius_out - inner_radius_out) / height
cone_z0_out = z_top + inner_radius_out / cone_r_out

cone1 = openmc.ZCone(z0=cone_z0_in, R2=cone_r_in**2)
cone2 = openmc.ZCone(z0=cone_z0_out, R2=cone_r_out**2)
plane1 = openmc.ZPlane(z0=z_top-height)
plane2 = openmc.ZPlane(z0=z_top)

cell = openmc.Cell()
cell.region = -cone2 & +cone1 & +plane1 & -plane2
cell.fill=st_fuel

root = openmc.Universe(universe_id=0, name='root universe')
root.add_cells([cell])

geometry = openmc.Geometry(root)
geometry.export_to_xml()


Still, one thing I am having trouble is generating as the larger radius side up and smaller radius side down. The above code does create a smaller radius side up and a large radius side down. I believe there is an easy solution to this. But I am having trouble. I will update here if I figured out. Thank you for the guide. 

Regards,
Sharif Abu Darda



On Tuesday, December 10, 2019 at 7:45:16 PM UTC+3, Sterling Harper wrote:
Here's an example for a cone with a hollow cylindrical inside. A model with two concentric cones would be similar except you'd have to repeat the process of finding the z0 and r^2 parameters for the inner cone.

# Define parameters for the annular cone.
inner_radius = 0.5
outer_radius = 1.0
height = 1.5
z_top = 0.0

# Compute the cone's r parameter. It is determined by how quickly the radius
# changes as a function of height.
cone_r = (outer_radius - inner_radius) / height

# Find the z0 parameter that places the top of the cell at z_top.
cone_z0 = z_top + inner_radius / cone_r

# Define the surfaces for the annular cone.
cone = openmc.ZCone(z0=cone_z0, r2=cone_r**2)
inner_cyl = openmc.ZCylinder(r=inner_radius)
plane1 = openmc.ZPlane(z0=z_top-height)
plane2 = openmc.ZPlane(z0=z_top)

# Define the annular cone cell
cell = openmc.Cell()
cell.region = -cone & +inner_cyl & +plane1 & -plane2


On Tue, Dec 10, 2019 at 3:04 AM Sharif Abu Darda <shabu...@gmail.com> wrote:
Hello, I was looking for an example of how OpenMC handles this attached model structure? It's a truncated cone with a hollow inside. Having two outer radii and two inner radii. Please share a sample code example of how this is handled in OpenMC. Thank you.

--
You received this message because you are subscribed to the Google Groups "OpenMC Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openmc...@googlegroups.com.

Sharif Abu Darda

unread,
Dec 10, 2019, 5:14:49 PM12/10/19
to OpenMC Users Group
Hello Dr. Sterling Harper. I figured it out how to do the larger radius side up and smaller radius side down. It's was easy. Below is the code. Thank you for your guidance. 

inner_radius_in = 0.5
inner_radius_out = 0.7
outer_radius_in = 1.0
outer_radius_out = 1.2
height = 1.5
z_top = 0.0

cone_r_in = (inner_radius_in - outer_radius_in) / height
cone_z0_in = z_top + outer_radius_in / cone_r_in

cone_r_out = (inner_radius_out - outer_radius_out) / height
cone_z0_out = z_top + outer_radius_out / cone_r_out

cone1 = openmc.ZCone(z0=cone_z0_in, R2=cone_r_in**2)
cone2 = openmc.ZCone(z0=cone_z0_out, R2=cone_r_out**2)
plane1 = openmc.ZPlane(z0=z_top-height)
plane2 = openmc.ZPlane(z0=z_top)

cell = openmc.Cell()
cell.region = -cone2 & +cone1 & +plane1 & -plane2
cell.fill=st_fuel

Reply all
Reply to author
Forward
0 new messages