mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Fixed surface currents with multiple mesh bins.
This commit is contained in:
parent
4a3166e6b8
commit
7c3e2b9953
2 changed files with 13 additions and 7 deletions
|
|
@ -5,7 +5,7 @@ module constants
|
|||
! Versioning numbers
|
||||
integer, parameter :: VERSION_MAJOR = 0
|
||||
integer, parameter :: VERSION_MINOR = 3
|
||||
integer, parameter :: VERSION_RELEASE = 2
|
||||
integer, parameter :: VERSION_RELEASE = 3
|
||||
|
||||
! Physical constants
|
||||
real(8), parameter :: &
|
||||
|
|
@ -70,6 +70,9 @@ module constants
|
|||
& SENSE_POSITIVE = 1, &
|
||||
& SENSE_NEGATIVE = -1
|
||||
|
||||
! Used for surface current tallies
|
||||
real(8), parameter :: TINY_BIT = 1e-8
|
||||
|
||||
! Codes for read errors -- better hope these numbers are never used in an
|
||||
! input file!
|
||||
integer, parameter :: ERROR_INT = -huge(0)
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ contains
|
|||
! TODO: Find a better solution to score surface currents than physically
|
||||
! moving the particle forward slightly
|
||||
|
||||
p % xyz = p % xyz + 1e-6 * p % uvw
|
||||
p % xyz = p % xyz + TINY_BIT * p % uvw
|
||||
call score_surface_current(p)
|
||||
|
||||
! Display message
|
||||
|
|
@ -229,6 +229,13 @@ contains
|
|||
! =======================================================================
|
||||
! PARTICLE REFLECTS FROM SURFACE
|
||||
|
||||
! Score surface currents since reflection causes the direction of the
|
||||
! particle to change -- artificially move the particle slightly back in
|
||||
! case the surface crossing in coincident with a mesh boundary
|
||||
p % xyz = p % xyz - TINY_BIT * p % uvw
|
||||
call score_surface_current(p)
|
||||
p % xyz = p % xyz + TINY_BIT * p % uvw
|
||||
|
||||
! Copy particle's direction cosines
|
||||
u = p % uvw(1)
|
||||
v = p % uvw(2)
|
||||
|
|
@ -321,12 +328,8 @@ contains
|
|||
p % cell = last_cell
|
||||
p % surface = -p % surface
|
||||
|
||||
! Score surface currents since reflection causes the direction of the
|
||||
! particle to change
|
||||
call score_surface_current(p)
|
||||
|
||||
! Set previous coordinate going slightly past surface crossing
|
||||
p % last_xyz = p % xyz + 1e-6 * p % uvw
|
||||
p % last_xyz = p % xyz + TINY_BIT * p % uvw
|
||||
|
||||
! Diagnostic message
|
||||
if (verbosity >= 10) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue