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

Small fixes in cones and trackingHT #148

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

valeriaRaffuzzi
Copy link
Member

Two small fixes:

  1. Cones throw a fatal error if the two bases (which define the orientation of the cone) have different signs. This was the case even when one the bases was zero. Now, one of the two is allowed to be zero.
  2. HT would throw a fatal error if the tracking method selection happened on a particle in void (because this means a material XS lookup in void was attempted). Now ST is chosen if the particle is in void.

sigmaT = ZERO
else
sigmaT = self % xsData % getTrackMatXS(p, p % matIdx())
end if
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm amazed we hadn't seen this before. I'm curious whether this is the best place to put it rather than in the database? Putting it in the database might make for a tidier transportOperator, but might have some code duplication across different databases.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not a common problem because it can only happen if particles are born in void, and ST and DT already had checks to make sure that this is ok.
I think adding the check to the tracking operator rather than the database is ok. In the database the only thing you could do is set all the xss to zero, but that might give you troubles somewhere else.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Surely in getTrackMatXS one can have a void check resulting in xs = 0 and an early return? I'm probably not thinking things through though.

Copy link
Member Author

Choose a reason for hiding this comment

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

That function is still called from multiple places.. It should never be called in void from anywhere else, but I think it's still neater to add the check in the transport Operator. Otherwise for consistency we should remove the void checks from DT and ST as well and add more checks in the DB, which would be messier.

@ChasingNeutrons ChasingNeutrons merged commit 0f4b453 into CambridgeNuclear:main Jan 25, 2025
5 checks passed
@valeriaRaffuzzi valeriaRaffuzzi deleted the cone_fix branch January 27, 2025 12:18
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