mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Fixed p_valid sampling of energy distributions.
This commit is contained in:
parent
b34cfe7bac
commit
729a608e5e
1 changed files with 9 additions and 11 deletions
|
|
@ -1331,19 +1331,17 @@ contains
|
|||
! SAMPLE ENERGY DISTRIBUTION IF THERE ARE MULTIPLE
|
||||
|
||||
if (associated(edist % next)) then
|
||||
if (edist % p_valid % n_regions > 0) then
|
||||
p_valid = interpolate_tab1(edist % p_valid, E_in)
|
||||
p_valid = interpolate_tab1(edist % p_valid, E_in)
|
||||
|
||||
if (prn() > p_valid) then
|
||||
if (edist % law == 44 .or. edist % law == 61) then
|
||||
call sample_energy(edist%next, E_in, E_out, mu_out)
|
||||
elseif (edist % law == 66) then
|
||||
call sample_energy(edist%next, E_in, E_out, A=A, Q=Q)
|
||||
else
|
||||
call sample_energy(edist%next, E_in, E_out)
|
||||
end if
|
||||
return
|
||||
if (prn() > p_valid) then
|
||||
if (edist % law == 44 .or. edist % law == 61) then
|
||||
call sample_energy(edist%next, E_in, E_out, mu_out)
|
||||
elseif (edist % law == 66) then
|
||||
call sample_energy(edist%next, E_in, E_out, A=A, Q=Q)
|
||||
else
|
||||
call sample_energy(edist%next, E_in, E_out)
|
||||
end if
|
||||
return
|
||||
end if
|
||||
end if
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue