mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
replaced physics_mg.F90:scatter with the c++ version
This commit is contained in:
parent
cd493057bf
commit
f3fb3d1979
3 changed files with 11 additions and 21 deletions
|
|
@ -424,6 +424,7 @@ add_library(libopenmc SHARED
|
|||
src/output.cpp
|
||||
src/particle.cpp
|
||||
src/physics_common.cpp
|
||||
src/physics_mg.cpp
|
||||
src/plot.cpp
|
||||
src/position.cpp
|
||||
src/pugixml/pugixml_c.cpp
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ module mgxs_interface
|
|||
real(8), allocatable :: energy_bins(:)
|
||||
|
||||
! Midpoint of the energy group structure
|
||||
real(8), allocatable :: energy_bin_avg(:)
|
||||
real(C_DOUBLE), allocatable :: energy_bin_avg(:)
|
||||
|
||||
! Energy group structure with increasing energy
|
||||
real(C_DOUBLE), allocatable, target :: rev_energy_bins(:)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,14 @@ module physics_mg
|
|||
|
||||
implicit none
|
||||
|
||||
interface
|
||||
subroutine scatter(p, energy_bin_avg) bind(C)
|
||||
import Particle, C_DOUBLE
|
||||
type(Particle), intent(inout) :: p
|
||||
real(C_DOUBLE), intent(in) :: energy_bin_avg(*)
|
||||
end subroutine scatter
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
!===============================================================================
|
||||
|
|
@ -85,7 +93,7 @@ contains
|
|||
|
||||
! Sample a scattering reaction and determine the secondary energy of the
|
||||
! exiting neutron
|
||||
call scatter(p)
|
||||
call scatter(p, energy_bin_avg)
|
||||
|
||||
! Play russian roulette if survival biasing is turned on
|
||||
if (survival_biasing) then
|
||||
|
|
@ -133,25 +141,6 @@ contains
|
|||
|
||||
end subroutine absorption
|
||||
|
||||
!===============================================================================
|
||||
! SCATTER
|
||||
!===============================================================================
|
||||
|
||||
subroutine scatter(p)
|
||||
|
||||
type(Particle), intent(inout) :: p
|
||||
|
||||
call sample_scatter_c(p % material, p % last_g, p % g, p % mu, &
|
||||
p % wgt, p % coord(1) % uvw)
|
||||
|
||||
! Update energy value for downstream compatability (in tallying)
|
||||
p % E = energy_bin_avg(p % g)
|
||||
|
||||
! Set event component
|
||||
p % event = EVENT_SCATTER
|
||||
|
||||
end subroutine scatter
|
||||
|
||||
!===============================================================================
|
||||
! CREATE_FISSION_SITES determines the average total, prompt, and delayed
|
||||
! neutrons produced from fission and creates appropriate bank sites.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue