Torus surface definition

Hello all!

Torus equation.PNG

I’d like to model a torus with centerline aligned with the z-axis in OpenMC. Because it requires a 4th order equation to describe in cartesian coordinates (see equation), I cannot derive a quadric equation for it. For now, I am going to approximate it using a ring with a square cross section, but I am fairly confident that this will not be sufficiently accurate. I haven’t used DAGMC before, but it is possible to mix mesh from DAGMC with traditional CSG? Any suggestions will be greatly appreciated!

  • Mason Yu

Hi Mason,

Andy Davis (CCed) has a developmental branch with a torus surface 95% implemented, but it hasn’t made it to the finish line yet. I was going to adopt the branch from him and try to finish it and get it merged into our main branch but haven’t gotten around to it. If you’re interested in contributing, we might be able to use some help here. That aside, it’s not currently possible to mix a DAGMC mesh with traditional CSG, although I know that there is some interest in going in that direction. I’ve also CCed Patrick Shriwise who is the expert on DAGMC in OpenMC in case he has further comments.

Best,
Paul

Torus equation.PNG

Hi Paul,

Thanks for pointing me in the direction of Andy’s development branch. I’d appreciate it if access can be provided if it is not a part of public Github repository. To solve my needs right now, I’d prefer to continue to work with the stable branch for now. If the square ring is not good enough, I’ll see if I can apply more manual corrections specific to this case I am simulating.

My efforts in translating some fairly complex geometries into CSG in OpenMC has lead me to use the general quadric surface quite often. Right now, I know general macrobodies (like those in MCNP) are difficult to implement (or impossible). But, I also appreciate the convenience from some simple buit-in macrobody region generation function. Examples include right circular cylinder capped on both ends, right rectangular parallelepiped, wedge and ellipsoids (most commonly oblate spheroids), all with their principle axes along the cartesian axes. I know a user can implement simple functions in Python when the need arises, but the frequency with which I have to use these functions have lead me to believe they may be useful enough to be included in the official distribution.

Are there any plans for implementing macrobodies already in the works?

  • Mason Yu

Hi Mason,

Sorry to give you the same answer yet again – I started a branch with what we call “composite surfaces” that are equivalent to what MCNP calls “macrobodies”. It is pretty much complete but is just lacking tests. I’ll look into finishing it off and submitting a pull request in the near future. In the meantime, feel free to copy/paste the classes that you need. Also take a look through what’s there already and if you see something missing that you’d really like to have, let me know so that I can add it in. As you’ll see in the implementation, they are not terribly complicated.

Best,
Paul

Hi Paul,

It’s great to know that these composite surfaces are in a branch already! I’d be more than happy to test them out right now :slight_smile:

Besides the ones you already implemented, I’ve also got my version of the wedge and ellipsoid that’s perhaps a bit more complicated. I’d need to do more testing and debugging on my end here to make sure they can be as general as possible. The wedge is tricky due to the various cases of doing boolean operation on halfspaces. The ellipsoid is actually simpler, since we only need to rearrange its equation and solve for the coefficients to the quadric equation. I’d be more than happy to contribute once I get the stuff I need to do now finished!

  • Mason