Octagon z-axis surface pierced through X and Y-cylinder horizontally.

Hello, Can anyone guide me on how the openMC handle?

  1. An octagon concrete shape surrounding a cylinder. The structure is Z-axis
  2. The Z-cylinder is pierced through X and Y-cylinder horizontally.

Any help is appreciated. Thanks.

Hi Sharif,

I’ve put together an example of how you can create an octogon shape:
https://gist.github.com/paulromano/f8ace5e079b61d55339d50d857e0acb3

Hope this helps!

Best,
Paul

Hello, Dr, thank you for the sample. I was able to follow it completely. This was quite interesting. I learn new thing about how OpenMC handles the plane surface. So, I tried around and create my own design of an octagon with 4 sides of the same length and 4 inclined sides with different length. Since I knew the coordinates and I put in the equation and crate the planes accordingly with A, B, and D values. Below is the code I tried,

pur=openmc.Plane(surface_id=1, A=-1,B=-1,D=-3)
pul=openmc.Plane(surface_id=2, A=1,B=-1,D=-3)
plr=openmc.Plane(surface_id=3, A=-1,B=-1,D=3)
pll=openmc.Plane(surface_id=4, A=1,B=-1,D=3)

xp1=openmc.XPlane(surface_id=5, x0=2)
xp2=openmc.XPlane(surface_id=6, x0=-2)
yp1=openmc.YPlane(surface_id=7, y0=2)
yp2=openmc.YPlane(surface_id=8, y0=-2)

region1 = openmc.Cell(cell_id=1, name=‘cell 1’)

region1.region=-xp1&+xp2&-yp1&+yp2&+pur&+pul&-plr&-pll

root = openmc.Universe(universe_id=0, name=‘root universe’)

region1.fill = SS304

root.add_cells([region1])

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

attached is the plot I was able to generate. Your sample code was really helpful. I learned new things. Thank you, Dr, for your support.

Regards,
Sharif Abu Darda

Screen Shot 2019-02-16 at 3.14.29 AM.png

Hello, Dr, using the example in there, with A=m, b=-1, and D=m*x1-y1. It not possible to make an octagon of the same sides. The inclined sides will be sqrt (a/2+a/2). Consider a square, which sides are 700cm. And the inclined planes are in (175,350), (350,175) and (-175,350), (-350,175) and (-175,-350), (-350,-175) and (175,-350), (350,-175). So the triangle created by the inclined surface will be sqrt (a/2+a/2). Here a is 350.

How do I create an octagon with equal sides? I can reduce the D value, to achieve that. But that means I have to change the A also, but the A does not change because any shift in (y2-y1)/(x2-x1), value is always the same. Ca you please guide.

Hi Sharif,

I’m not sure I understand your question. If you look again at the notebook I sent, you can see that the sides of the octagon created are indeed of equal length. If you want an octagon whose corners are at (175, 350), (350, 175), (350, -175), etc., then you would set w=350 and a=700 in the notebook. However, such an octagon does not have all sides of equal length.

Best regards,
Paul

Hello Dr, thank you for your reply. Actually, I was wondering if the S is given say S=700. How do you create a same side octagon? since I don’t have a defined a in this case. My issue is here. Right now I am calculating the plane D value by (1.5*S/2). Now, How do I find the a (each side of the octagon) with only the S given? I am stuck on that.

Another thing I am currently stuck on a geometry problem in the attached image. I was wondering if you could gime my some guide on how to design such a structure.

on the structure I have a z-cylinder of some radius, I am stuck on the blue structure design, This shape will have a z plane height, and two plane surface 1 and 2 and the x plane boundary on the right. and also the structure will be outside of the z cylinder. After the blue shape, there is another box of the same height (in z-axis), but the y-axis surfaces for that box will be the end point of the plane surfaces.

Can you please guide on how this can be designed in openmc?

Dr. Thank you for your support.

Hi Sharif,

You can relate the overall width of the square in which the octagon is inscribed to the length of one of the octagon’s sides through the equation:

S = a + 2*(a/sqrt(2)) = (1 + sqrt(2))a
–> a = S/(1 + sqrt(2)) = 700/(1 + sqrt(2))

As for creating the blue region shown in the figure you showed, my recommendation would be to use Plane.from_points, which will produce a plan for you given three points that are on it. If you have two points (x1, y1) and (x2, y2), you can use the three points:

(x1, y1, 0)
(x2, y2, 0)
(x2, y2, 1)

Best regards,
Paul

Hello Dr, Shouldn’t the link be a python script to get plane from points? It loads the openmc plane documentation link. Can you please give me the python script on this? Thank you.

Hello, Dr, I was able to do the above structure with the below code. I am putting this out in here for others. One question though, The print origin for “pur” and “pul” comes as -1.0 and 1.0 respectively. Now, in the region 2 cell perimeter, I have to use “pur” as “positive” and “pul” as “negative” to get it to work. Usually, I was using their origin value sign (- or +) as it is when defining a structure cell. Thanks. you.

pur=openmc.Plane(surface_id=1, A=1,B=-1,D=1)
pul=openmc.Plane(surface_id=2, A=-1,B=-1,D=-1)

xp1=openmc.XPlane(surface_id=5, x0=3)
xp2=openmc.XPlane(surface_id=6, x0=6)
yp1=openmc.YPlane(surface_id=7, y0=2)
yp2=openmc.YPlane(surface_id=8, y0=-2)
zp1=openmc.ZPlane(surface_id=9, z0=2)
zp2=openmc.ZPlane(surface_id=10, z0=-2)

zc1=openmc.ZCylinder(surface_id=12, R=2)

origin = (0., 0., 0.)
print('pur: ', pur.evaluate(origin))
print('pul: ', pul.evaluate(origin))

region1 = openmc.Cell(cell_id=1, name=‘cell 3’)
region2 = openmc.Cell(cell_id=2, name=‘cell 3’)
region3 = openmc.Cell(cell_id=3, name=‘cell 3’)

region1.region=-zc1&-zp1&+zp2
region2.region=+zc1&-xp1&+pur&-pul&-zp1&+zp2
region3.region=+xp1&-xp2&-yp1&+yp2&-zp1&+zp2

root = openmc.Universe(universe_id=0, name=‘root universe’)

region1.fill = SS304
region2.fill = water
region3.fill = graphite

root.add_cells([region1,region2,region3])

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

Screen Shot 2019-07-23 at 7.53.40 PM.png

Hi Sharif – the point that you are checking with the evaluate() method should be a point inside the cell, and if I understand correctly, for the cell you are checking (0,0,0) is not within the cell. I think the point (2.5, 0, 0) would be appropriate for the check.

Best,
Paul

Hello, Dr. Hope, you are well. In the example of the octagon, https://gist.github.com/paulromano/f8ace5e079b61d55339d50d857e0acb3 The S is measured as 7.242640687 when a=3. And if the sides S=7.242640687, means from the origin the distance for (left, right, up, down) four sides are 3.621320344. Now,

origin = (0., 0., 0.) print('ur: ', ur.evaluate(origin)) print('lr: ', lr.evaluate(origin)) print('ul: ', ul.evaluate(origin)) print('ll: ', ll.evaluate(origin))

ur: 5.121320343559642 lr: -5.121320343559642 ul: 5.121320343559642 ll: -5.121320343559642

This gives the hypotenuse length of the triangle which two sides are 3.621320344.

My question is, How do I measure the distance of the inclined planes(center) from the origin. the attached image shows the inquery. Thanks.

Regards,
Sharif Abu darda

Screen Shot 2019-08-24 at 7.50.28 PM.png

OOoo, My bad Dr. I see the distance of the inclined planes(center) from the origin is the same as the distance of each side 3.621320344. I solved it. Thanks.