mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Reduced redundant calls to calculate_nuclide_xs.
This commit is contained in:
parent
992abf62b8
commit
66ca324828
2 changed files with 7 additions and 3 deletions
|
|
@ -176,8 +176,7 @@ module cross_section_header
|
|||
type NuclideMicroXS
|
||||
integer :: index_grid ! index on nuclide energy grid
|
||||
integer :: index_temp ! temperature index for nuclide
|
||||
integer :: last_index_grid ! previous index on nuclide energy grid
|
||||
integer :: last_index_temp ! previous temperature index for nuclide
|
||||
real(8) :: last_E = 0.0 ! last evaluated energy
|
||||
real(8) :: interp_factor ! interpolation factor on nuc. energy grid
|
||||
real(8) :: total ! microscropic total xs
|
||||
real(8) :: elastic ! microscopic elastic scattering xs
|
||||
|
|
|
|||
|
|
@ -182,7 +182,9 @@ contains
|
|||
end if
|
||||
|
||||
! Calculate microscopic cross section for this nuclide
|
||||
call calculate_nuclide_xs(p, index_nuclide, index_sab)
|
||||
if (p % E /= micro_xs(index_nuclide) % last_E) then
|
||||
call calculate_nuclide_xs(p, index_nuclide, index_sab)
|
||||
end if
|
||||
|
||||
! Copy atom density of nuclide in material
|
||||
atom_density = mat % atom_density(i)
|
||||
|
|
@ -351,6 +353,9 @@ contains
|
|||
micro_xs(i) % elastic_sab = elastic
|
||||
end if
|
||||
|
||||
! Set last evaluated energy
|
||||
micro_xs(i) % last_E = p % E
|
||||
|
||||
end subroutine calculate_nuclide_xs
|
||||
|
||||
!===============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue