Skip to content

Commit

Permalink
Fix #956: add ausgab calls for photonuclear xcse
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ftessier committed Feb 6, 2023
1 parent d44892b commit f556f5f
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 14 deletions.
3 changes: 3 additions & 0 deletions HEN_HOUSE/omega/beamnrc/beamnrc.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -4279,10 +4279,13 @@ IF( use_cs_enhance ) [
IF( iausfl(21) = 0 ) cse_return(21) = .true.;
IF( iausfl(24) = 0 ) cse_return(24) = .true.;
IF( iausfl(25) = 0 ) cse_return(25) = .true.;
IF( iausfl(30) = 0 ) cse_return(30) = .true.;
IF( iausfl(31) = 0 ) cse_return(31) = .true.;
IAUSFL(16) = 1; IAUSFL(17) = 1; " before/after PAIR "
IAUSFL(18) = 1; IAUSFL(19) = 1; " before/after COMPTON "
IAUSFL(20) = 1; IAUSFL(21) = 1; " before/after PHOTO "
IAUSFL(24) = 1; IAUSFL(25) = 1; " before/after RAYLEIGH "
IAUSFL(30) = 1; IAUSFL(31) = 1; " before/after PHOTONUC "
]

"Ali:BCSE"
Expand Down
8 changes: 7 additions & 1 deletion HEN_HOUSE/user_codes/cavrznrc/cavrznrc.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -2406,6 +2406,8 @@ IF(ifano = 1)
iausfl(21) = 1; "After photoelectric"
iausfl(24) = 1; "Before Rayleigh"
iausfl(25) = 1; "After Rayleigh"
iausfl(30) = 1; "Before photonuclear"
iausfl(31) = 1; "After photonuclear"

"AUSGAB will be responsible for throwing away any photons resulting"
"from a primary electron. ie. True equilibtrium requires that all"
Expand All @@ -2426,6 +2428,8 @@ IF( n_split > 1 ) [
iausfl(20) = 0;
iausfl(24) = 0;
iausfl(25) = 0;
iausfl(30) = 0;
iausfl(31) = 0;

]

Expand All @@ -2447,14 +2451,16 @@ IF( use_enhance ) [
iausfl(21) = 1; "After photoelectric"
iausfl(24) = 1; "Before Rayleigh"
iausfl(25) = 1; "After Rayleigh"
iausfl(30) = 1; "Before photonuclear"
iausfl(31) = 1; "After photonuclear"
iausfl(8) = 1; "After bremsstrahlung"
iausfl(14) = 1; "A positron has annihilated in-flight"
iausfl(15) = 1; "A positron has annihilated at rest"
]

write(6,'(/a)')
'************************ IAUSFL ************************** ';
DO j=1,28 [
DO j=1,30 [
IF( iausfl(j).ne.0 ) write(6,'(i3,$)') j;
]
write(6,'(/a//)')
Expand Down
21 changes: 14 additions & 7 deletions HEN_HOUSE/user_codes/cavsphnrc/cavsphnrc.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,8 @@ IF(ifano = 1)
iausfl(21) = 1; "After photoelectric"
iausfl(24) = 1; "Before Rayleigh"
iausfl(25) = 1; "After Rayleigh"
iausfl(30) = 1; "Before photonuclear"
iausfl(31) = 1; "After photonuclear"

"AUSGAB will be responsible for throwing away any photons resulting"
"from a primary electron. ie. True equilibtrium requires that all"
Expand All @@ -1905,6 +1907,8 @@ IF( n_split > 1 ) [
iausfl(20) = 0;
iausfl(24) = 0;
iausfl(25) = 0;
iausfl(30) = 0;
iausfl(31) = 0;

]

Expand All @@ -1926,6 +1930,8 @@ IF( use_enhance ) [
iausfl(21) = 1; "After photoelectric"
iausfl(24) = 1; "Before Rayleigh"
iausfl(25) = 1; "After Rayleigh"
iausfl(30) = 1; "Before photonuclear"
iausfl(31) = 1; "After photonuclear"
iausfl(8) = 1; "After bremsstrahlung"
iausfl(14) = 1; "A positron has annihilated in-flight"
iausfl(15) = 1; "A positron has annihilated at rest"
Expand Down Expand Up @@ -3255,12 +3261,12 @@ IF( use_enhance | n_split > 1 ) [
IF( use_enhance ) [ "If we use cross section enhancement, all scoring "
" is done here and the rest of ausgab is ignored "

IF (iarg = 15 | iarg = 17 | iarg = 19 | iarg = 23)
IF (iarg = 15 | iarg = 17 | iarg = 19 | iarg = 23 | iarg = 29)
[
"A pair/Compton/photoelectric/Rayleigh event is about to take place"
"Before pair/Compton/photoelectric/Rayleigh/photonuclear event. "
"As we have increased the photon cross section by a factor of "
"cs_enhance, we must split the photon into a scattering portion "
"(1/cs_enhance) and a nor-scattering portion (1-1/cs_enhance) "
"(1/cs_enhance) and a non-scattering portion (1-1/cs_enhance) "
"Start with placing an identical photon on the stack "
np = np + 1;
IF(np + 1 > $MXSTACK) [
Expand Down Expand Up @@ -3298,8 +3304,8 @@ IF( use_enhance ) [ "If we use cross section enhancement, all scoring "
]


IF( iarg = 18 | iarg = 20 | iarg = 24 |
" A Compton/photo-absorption/Rayleigh event just occured"
IF( iarg = 18 | iarg = 20 | iarg = 24 | iarg = 30 |
" A Compton/photo-absorption/Rayleigh/photonuclear event just occured"
iarg = 7 | iarg = 13 | iarg = 14 ) [
" A bremas/annihilation event just occured"
" All scattered photons and photons originating in brems/annihilation"
Expand Down Expand Up @@ -3392,9 +3398,9 @@ IF(IWATCH.GT.0) [CALL WATCH(IARG,IWATCH); "SIGNAL WATCH ROUTINE IF ACTIVE"]

IF (ifano = 1)
[
IF (iarg = 15 | iarg = 17 | iarg = 19 | iarg = 23)
IF (iarg = 15 | iarg = 17 | iarg = 19 | iarg = 23 | iarg = 29)
[
"A pair/Compton/photoelectric/pair event is about to take place"
"Before pair/Compton/photoelectric/Rayleigh/photonuclear event"
np = np + 1; "Boost the stack"
IF(np + 1 > $MXSTACK)
[
Expand Down Expand Up @@ -3425,6 +3431,7 @@ IF (ifano = 1)
IF ( iarg = 18 " Compton has occured"
| iarg = 20 " After photo-absorption "
| iarg = 24 " After Rayleigh "
| iarg = 30 " After Photonuclear "
| iarg = 7 " After brems "
| iarg = 13 " After annihilation "
| iarg = 14) " After annihilation at rest "
Expand Down
8 changes: 5 additions & 3 deletions HEN_HOUSE/user_codes/dosrznrc/dosrznrc.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -2605,6 +2605,7 @@ write(6,*) 'flagged all photon intereaction types';
iausfl(21) = 1; "After photoelectric"
iausfl(24) = 1; "Before Rayleigh"
iausfl(25) = 1; "After Rayleigh"
iausfl(31) = 1; "After Photonuclear"
]
ELSE [ DO j=1,$MXREG [ iefl(j) = 0; ] ]

Expand Down Expand Up @@ -3634,8 +3635,8 @@ MXNP=MAX(MXNP,NP);"keep track of how deep stack is"

IF (ienhance = 1) [" Option to enhance photon cross section in some region"
"write(6,*) 'in ausgab to recreate photon';"
IF (iarg = 15 | iarg = 17 | iarg = 19 | iarg = 23) [
"A pair/Compton/photoelectric/pair event is about to take place"
IF (iarg = 15 | iarg = 17 | iarg = 19 | iarg = 23 | iarg = 29) [
"Before pair/Compton/photoelectric/Rayleigh/Photonuclear event"
np = np + 1; "Boost the stack"
IF(np > $MXSTACK) [
OUTPUT $MXSTACK; (
Expand Down Expand Up @@ -3667,7 +3668,8 @@ IF (ienhance = 1) [" Option to enhance photon cross section in some region"
" between NPold and NP for RR"
IF ( ( iarg = 18 " Compton has occured"
| iarg = 20 " After photo-absorption "
| iarg = 24) " After Rayleigh "
| iarg = 24 " After Rayleigh "
| iarg = 30) " After Photonuclear "
& ienhance = 1 )
[
ienhance=0;
Expand Down
6 changes: 4 additions & 2 deletions HEN_HOUSE/user_codes/egs_chamber/egs_chamber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1871,9 +1871,11 @@ int EGS_ChamberApplication::initScoring() {
setAusgabCall(BeforeCompton, true);
setAusgabCall(BeforePhoto, true);
setAusgabCall(BeforeRayleigh, true);
setAusgabCall(BeforePhotoNuc, true);
setAusgabCall(AfterCompton, true);
setAusgabCall(AfterPhoto, true);
setAusgabCall(AfterRayleigh, true);
setAusgabCall(AfterPhotoNuc, true);
setAusgabCall(AfterPair, true);
setAusgabCall(AfterTransport, true);
setAusgabCall(AfterBrems,true);
Expand Down Expand Up @@ -1944,7 +1946,7 @@ int EGS_ChamberApplication::ausgab(int iarg) {
if( cs_enhance[ig][ir] > 1 ){
// devide photon in interacting and non-interacting portions
if( iarg == BeforePair || iarg == BeforeCompton ||
iarg == BeforePhoto || iarg == BeforeRayleigh ) {
iarg == BeforePhoto || iarg == BeforeRayleigh || iarg == BeforePhotoNuc) {
// increase stack
++the_stack->np;
if (the_stack->np > MXSTACK)
Expand All @@ -1956,7 +1958,7 @@ int EGS_ChamberApplication::ausgab(int iarg) {
the_stack->wt[np+1] /= cs_enhance[ig][ir];
return 0;
}
if( iarg == AfterCompton || iarg == AfterPhoto || iarg == AfterRayleigh || iarg == AfterPair ) {
if( iarg == AfterCompton || iarg == AfterPhoto || iarg == AfterRayleigh || iarg == AfterPair || iarg == AfterPhotoNuc) {
if( rndm->getUniform()*cs_enhance[ig][ir] < 1 ){
// remove non-interacting portion
the_stack->wt[the_stack->npold-2] = 0;
Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/user_codes/flurznrc/flurznrc.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,7 @@ IF(IPRIM=3)["need to distinguish photon primaries from secondaries"

write(6,'(/a)')
'************************ IAUSFL values ************************** ';
DO j=1,28 [
DO j=1,30 [
IF( iausfl(j).ne.0 ) write(6,'(i3,$)') j;
]
write(6,'(/a//)')
Expand Down
2 changes: 2 additions & 0 deletions HEN_HOUSE/user_codes/sprrznrc/sprrznrc.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,8 @@ IF(ifano = 1) [
iausfl(21) = 1; "After photoelectric"
iausfl(24) = 1; "Before Rayleigh"
iausfl(25) = 1; "After Rayleigh"
iausfl(30) = 1; "Before photonuclear"
iausfl(31) = 1; "After photonuclear"

"AUSGAB will be responsible for throwing away any photons resulting"
"from a primary electron. ie. True equilibtrium requires that all"
Expand Down

0 comments on commit f556f5f

Please sign in to comment.