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 photonuclear cross section biasing when using cross section enhancement #958

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

ftessier
Copy link
Member

@ftessier ftessier commented Feb 6, 2023

Add ausgab calls before and after a photonuclear interactions, in order to handle cross section enhancement (xcse) correctly. Without these calls, there is no compensation for the enhanced cross section, hence the photonuclear cross section is effectively increased.

Also, update a couple loops that print out the ausgab flags (IAUSFL) values, to include the photonuclear attenuation input value, and fix a couple typos.

@ftessier ftessier requested a review from a team as a code owner February 6, 2023 22:47
@ftessier ftessier self-assigned this Feb 6, 2023
@ftessier ftessier added this to the Release 2023 milestone Feb 6, 2023
Copy link
Contributor

@mainegra mainegra left a comment

Choose a reason for hiding this comment

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

@ftessier this ended up being quite an undertaking!

@ftessier
Copy link
Member Author

ftessier commented Feb 7, 2023

Fixed the photonuclear xcse biasing across EGSnrc. There are other instances where photonuclear asugab should be called, notably when setting ZLAST, but I want to keep this commit about xcse. Also updated the calls within the Fano test, for consistency, but that is moot because the Fano test will fail anyways when photonuclear is turned on, since photon energy is lost, not deposited.

I have checked that all applications and BEAM_EX10MeVe compile as expected.

@nrc-cnrc/egsnrc please review as soon as possible so that we can include this fix in release 2023.

@ftessier
Copy link
Member Author

ftessier commented Feb 7, 2023

Note that there are other instances of photon interaction ausgab calls, without a corresponding photonuclear call. But the ones I reviewed seem fine, since they have to do with what happens with the photon afterwards, whereas in the photonuclear interaction the photon is simply discarded. The following egrep regexes prove useful, since Rayleigh interactions are a good way to catch instances where the photonuclear interaction should also be handled:

egrep -ilR 'iarg.*2[3,4]' HEN_HOUSE/                   ### catch Rayleigh iargs in mortran 
egrep -ilR 'ausfl.*2[3,4,5]' HEN_HOUSE/                ### catch Rayleigh branches in mortran
egrep -ilR 'if.*ausfl' HEN_HOUSE/                      ### catch all ausfl branches in mortran
egrep -ilR 'BeforeRayleigh|AfterRayleigh' HEN_HOUSE/   ### catch Rayleigh calls in c++ 

@mainegra you might want to double-check egs_cbct and egs_fac, especially the forced detection part, although of course there is no expected impact of photonuclear attenuation in these scenarios!

Copy link
Collaborator

@rtownson rtownson left a comment

Choose a reason for hiding this comment

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

All the changes here look correct. I'm still looking at egs_cbct and egs_fac but so far I don't think they need any changes.

Copy link
Contributor

@blakewalters blakewalters left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Add ausgab calls before and after a photonuclear interaction, in order
to handle cross section enhancement (xcse) correctly. Without these
calls, there is no compensation for the enhanced cross section, hence
the photonuclear cross section is effectively increased by the xcse
factor.

Also add the photonuclear event trapping in Fano calculations, for
consistency. However, the Fano calculation fails when photonuclear
attenuation is turned on anyway, because the photon is discarded
without depositing its energy.

Also update a couple loops that print out the ausgab flags (IAUSFL)
values, to include the photonuclear attenuation option value.
@ftessier
Copy link
Member Author

Squashed the commits.

@ftessier ftessier merged commit 8be7c57 into develop Feb 15, 2023
@ftessier ftessier deleted the fix-photonuclear-xcse branch February 15, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants