mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
added routine to compute albedos next to reflector
This commit is contained in:
parent
2b7d2d3908
commit
0dae02afe4
2 changed files with 72 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
|||
module cmfd_execute
|
||||
|
||||
use cmfd_utils, only: get_matrix_idx,neutron_balance
|
||||
use cmfd_utils, only: get_matrix_idx,neutron_balance,set_coremap, &
|
||||
& get_reflector_albedo
|
||||
use global
|
||||
use mesh, only: mesh_indices_to_bin
|
||||
use mesh_header, only: StructuredMesh
|
||||
|
|
@ -34,6 +35,13 @@ contains
|
|||
! write out neutron balance
|
||||
call neutron_balance()
|
||||
|
||||
! check for core map
|
||||
if (allocated(cmfd % coremap)) then
|
||||
call set_coremap()
|
||||
print *, cmfd % coremap
|
||||
STOP
|
||||
end if
|
||||
|
||||
! compute dtilde terms
|
||||
call compute_diffcoef()
|
||||
|
||||
|
|
@ -288,6 +296,7 @@ contains
|
|||
real(8) :: neig_dc ! diffusion coefficient of neighbor cell
|
||||
real(8) :: neig_hxyz(3) ! cell dimensions of neighbor cell
|
||||
real(8) :: dtilde ! finite difference coupling parameter
|
||||
real(8) :: ref_albedo ! albedo to reflector
|
||||
|
||||
! get maximum of spatial and group indices
|
||||
nx = cmfd%indices(1)
|
||||
|
|
@ -345,9 +354,34 @@ contains
|
|||
neig_dc = cmfd%diffcof(g,neig_idx(1),neig_idx(2),neig_idx(3))
|
||||
neig_hxyz = cmfd%hxyz(:,neig_idx(1),neig_idx(2),neig_idx(3))
|
||||
|
||||
! compute dtilde
|
||||
dtilde = (2*cell_dc*neig_dc)/(neig_hxyz(xyz_idx)*cell_dc + &
|
||||
& cell_hxyz(xyz_idx)*neig_dc)
|
||||
! check for next to reflector
|
||||
if (allocated(cmfd % coremap)) then
|
||||
|
||||
if (cmfd % coremap(neig_idx(1),neig_idx(2),neig_idx(3)) == &
|
||||
& 99999) then
|
||||
|
||||
! get albedo
|
||||
ref_albedo = get_reflector_albedo(l,g,i,j,k)
|
||||
|
||||
! compute dtilde
|
||||
dtilde = (2*cell_dc*(1-ref_albedo))/(4*cell_dc*(1+ &
|
||||
& ref_albedo)+(1-ref_albedo)*cell_hxyz(xyz_idx))
|
||||
|
||||
else ! not next to a reflector or no core map
|
||||
|
||||
! compute dtilde
|
||||
dtilde = (2*cell_dc*neig_dc)/(neig_hxyz(xyz_idx)*cell_dc + &
|
||||
& cell_hxyz(xyz_idx)*neig_dc)
|
||||
|
||||
end if
|
||||
|
||||
else ! no core map
|
||||
|
||||
! compute dtilde
|
||||
dtilde = (2*cell_dc*neig_dc)/(neig_hxyz(xyz_idx)*cell_dc + &
|
||||
& cell_hxyz(xyz_idx)*neig_dc)
|
||||
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ contains
|
|||
! SET_COREMAP is a routine that sets the core mapping information
|
||||
!===============================================================================
|
||||
|
||||
subroutine set_coremap
|
||||
subroutine set_coremap()
|
||||
|
||||
integer :: kount=1 ! counter for unique fuel assemblies
|
||||
integer :: nx ! number of mesh cells in x direction
|
||||
|
|
@ -463,4 +463,37 @@ contains
|
|||
|
||||
end subroutine set_coremap
|
||||
|
||||
!===============================================================================
|
||||
! GET_REFLECTOR_ALBEDO is a function that calculates the albedo to the reflector
|
||||
!===============================================================================
|
||||
|
||||
function get_reflector_albedo(l,g,i,j,k)
|
||||
|
||||
! function variable
|
||||
real(8) :: get_reflector_albedo ! reflector albedo
|
||||
|
||||
! local variable
|
||||
integer :: i ! iteration counter for x
|
||||
integer :: j ! iteration counter for y
|
||||
integer :: k ! iteration counter for z
|
||||
integer :: g ! iteration counter for groups
|
||||
integer :: l ! iteration counter for leakages
|
||||
integer :: shift_idx ! parameter to shift index by +1 or -1
|
||||
real(8) :: current(12) ! partial currents for all faces of mesh cell
|
||||
real(8) :: albedo ! the albedo
|
||||
|
||||
! get partial currents from object
|
||||
current = cmfd%current(:,g,i,j,k)
|
||||
|
||||
! define xyz and +/- indices
|
||||
shift_idx = -2*mod(l,2) + 1 ! shift neig by -1 or +1
|
||||
|
||||
! calculate albedo
|
||||
albedo = (current(2*l-1)/current(l))**(shift_idx)
|
||||
|
||||
! assign to function variable
|
||||
get_reflector_albedo = albedo
|
||||
|
||||
end function get_reflector_albedo
|
||||
|
||||
end module cmfd_utils
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue