Hi All,
I’m modeling a pebble bed type reactor and for one part of the geometry I need to use the complement operator (~). But an invalid syntax error is shown for the operator. Am I using the incorrect symbol of the complement operator or has this operator been removed from the source?
Thank You in Advance
Regards
Shubham
Hi Shubham,
The complement operator is still present in OpenMC. Can you provide more detail on the particular example you are running?
Best,
Paul
Hi Paul,
So the image ‘1’ shows a part of the actual code I’m running and image ‘2’ is an example I tried doing for the operator but still faced the same problem. Please check and let me know if I’m doing something wrong.
Thanks
Shubham

Hello,
you are missing the operator of & or |, please fill it before the ~.
1 Like
Hi Tang,
I’m not able to understand you suggestion, could you please explain it a little because for my problem I need to subtract one region from another. As shown in image ‘2’ I need the region of space of ‘A’ after subtracting ‘B’ from it.
Thanks
Shubham
To clarify, ~ is a unary operator, so it only operates on whatever expression is to the right of it. To combine the complement of a region with another region, you need to use another operator like & or |. Thus, in your first case, you would need something like:
boro_bottom = openmc.Cell(region=(+r10 & -r9 & +p4 & -p5) & ~(cool_tube), …
Your second case looks like it has more than one problem. A and B are surfaces, not half-spaces, so to create a region you first need to say what halfspace you’re referring to, e.g. +B & -A would give the region between the two cylinders. It’s not clear to me why you need a complement if you are just working with two cylinders. If you want the region that is outside of R=2 and inside of R=1, you would use a union operator: -B | +A.
Best regards,
Paul
Thanks for the clarification. Firstly I would like to clarify that the second case was just an example problem I was running to understand the reason for syntax error and the first case with ‘boro_bottom’ is my actual problem statement. What I wanted to do was to obtain a region of annular cylinder such that the equally spaced solid cylinders in the annulus are subtracted from it.
I could do it by creating segments of the annular cylinder and then using simple logic to obtain region outside of solid cylinders but that requires me to create planes for every segment which then would define the intersections. This is a bit tedious so I wanted to see if openMC had a feature to directly ‘cut holes’ (speaking in terms of CAD). Anyways I guess I have to go with the tedious way but thanks a lot Paul and Tang for your help.
Regards
Shubham
Hello, Shubham,
I am very sorry ,because my English is not good enough to express your problem in fluent.If I use Chinese, I can express it very smoothly.
Best regard
Tang
在 2019年4月11日星期四 UTC+8下午8:17:37,Shubham Mandot写道: