Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix R < r torus intersection bug #2589

Merged
merged 3 commits into from
Jul 14, 2023
Merged

Conversation

egor1abs
Copy link
Contributor

@egor1abs egor1abs commented Jul 5, 2023

Description

In the case when R < r the inner "imaginary" surfaces created an additional source of scattering close to the center of the torus. This error occurred due to the lack of a check in the solution of the torus equation. If we describe the equation in more detail, we obtain the following:
image
We see that the left part should obviously be greater than or equal to zero.
As a result of OpenMC with these geometry parameters (torus_test_xml.tar.gz), there is an anomaly in the form of surfaces inside, which in fact should not be:
bad_torus

This check was missing in the code of surface.cpp file and was added in lines 974-978. After fixing this error, the torus image looks correct:
torus_good

This is probably not a common problem, but I encountered it when calculating heat in one of the projects, where there was an anomalous surface where it should not be.
Fixes # (issue)

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

In the case when R < r the inner "imaginary" surfaces created an additional source of scattering close to the center of the torus. This error occurred due to the lack of a check in the solution of the torus equation. If we
describe the equation in more detail, we obtain the following: . We see that the left part should obviously be less than or equal to zero. This check was missing in the code of surface.cpp file and was added in lines 972-978.
@egor1abs egor1abs marked this pull request as ready for review July 5, 2023 13:44
@egor1abs egor1abs marked this pull request as draft July 10, 2023 07:52
@egor1abs egor1abs marked this pull request as ready for review July 10, 2023 07:58
Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @egor1abs! One small suggestion here:

src/surface.cpp Outdated Show resolved Hide resolved
Thanks! It is a better way to perform this check

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
src/surface.cpp Outdated Show resolved Hide resolved
@paulromano paulromano enabled auto-merge (squash) July 14, 2023 17:25
@paulromano paulromano merged commit 3f9cd0d into openmc-dev:develop Jul 14, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants