mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
added tally for diffusion coefficient in cmfd, now there are 3 options hardcoded for diffusion coef
This commit is contained in:
parent
34a15017c5
commit
75f1b03346
3 changed files with 15 additions and 6 deletions
|
|
@ -12,7 +12,7 @@ contains
|
|||
|
||||
subroutine set_up_cmfd()
|
||||
|
||||
use global, only: cmfd,cmfd_coremap,current_cycle,n_inactive,time_cmfd
|
||||
use global, only: cmfd,cmfd_coremap,current_batch,n_inactive,time_cmfd
|
||||
use cmfd_header, only: allocate_cmfd
|
||||
use cmfd_output, only: neutron_balance,write_cmfd_hdf5
|
||||
use timing
|
||||
|
|
@ -21,7 +21,7 @@ contains
|
|||
call allocate_cmfd(cmfd)
|
||||
|
||||
! check for core map
|
||||
if ((cmfd_coremap) .and. (current_cycle == n_inactive+1)) then
|
||||
if ((cmfd_coremap) .and. (current_batch == n_inactive+1)) then
|
||||
call set_coremap()
|
||||
end if
|
||||
|
||||
|
|
@ -151,9 +151,14 @@ contains
|
|||
! get p1 scatter rr and convert to p1 scatter xs
|
||||
cmfd % p1scattxs(h,i,j,k) = t % scores(score_index,3) % sum / flux
|
||||
|
||||
! extract diffusion coefficient tally
|
||||
cmfd % diffusion(h,i,j,k) = t % scores(score_index,4) % sum / flux
|
||||
|
||||
! calculate diffusion coefficient
|
||||
cmfd % diffcof(h,i,j,k) = 1.0_8/(3.0_8*(cmfd % totalxs(h,i,j,k) -&
|
||||
& cmfd % p1scattxs(h,i,j,k)))
|
||||
cmfd % diffcof(h,i,j,k) = 1.0_8/(3.0_8*cmfd%totalxs(h,i,j,k))
|
||||
! cmfd % diffcof(h,i,j,k) = 1.0_8/(3.0_8*(cmfd % totalxs(h,i,j,k) -&
|
||||
! & cmfd % p1scattxs(h,i,j,k)))
|
||||
! cmfd % diffcof(h,i,j,k) = cmfd % diffusion(h,i,j,k)
|
||||
|
||||
else if (ital == 2) then
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ module cmfd_header
|
|||
|
||||
! diffusion coefficient
|
||||
real(8), allocatable :: diffcof(:,:,:,:)
|
||||
real(8), allocatable :: diffusion(:,:,:,:)
|
||||
|
||||
! current
|
||||
real(8), allocatable :: current(:,:,:,:,:)
|
||||
|
|
@ -99,6 +100,7 @@ contains
|
|||
if (.not. allocated(this % scattxs)) allocate(this % scattxs(ng,ng,nx,ny,nz))
|
||||
if (.not. allocated(this % nfissxs)) allocate(this % nfissxs(ng,ng,nx,ny,nz))
|
||||
if (.not. allocated(this % diffcof)) allocate(this % diffcof(ng,nx,ny,nz))
|
||||
if (.not. allocated(this % diffusion)) allocate(this%diffusion(ng,nx,ny,nz))
|
||||
|
||||
! allocate dtilde and dhat
|
||||
if (.not. allocated(this % dtilde)) allocate(this % dtilde(6,ng,nx,ny,nz))
|
||||
|
|
@ -132,6 +134,7 @@ contains
|
|||
if (allocated(this % scattxs)) deallocate(this % scattxs)
|
||||
if (allocated(this % nfissxs)) deallocate(this % nfissxs)
|
||||
if (allocated(this % diffcof)) deallocate(this % diffcof)
|
||||
if (allocated(this % diffusion)) deallocate(this % diffusion)
|
||||
if (allocated(this % current)) deallocate(this % current)
|
||||
if (allocated(this % flux)) deallocate(this % flux)
|
||||
if (allocated(this % dtilde)) deallocate(this % dtilde)
|
||||
|
|
|
|||
|
|
@ -237,13 +237,14 @@ contains
|
|||
t % filters = filters(1:n_filters)
|
||||
|
||||
! allocate macro reactions
|
||||
allocate(t % score_bins(3))
|
||||
t % n_score_bins = 3
|
||||
allocate(t % score_bins(4))
|
||||
t % n_score_bins = 4
|
||||
|
||||
! set macro_bins
|
||||
t % score_bins(1) % scalar = SCORE_FLUX
|
||||
t % score_bins(2) % scalar = SCORE_TOTAL
|
||||
t % score_bins(3) % scalar = SCORE_SCATTER_1
|
||||
t % score_bins(4) % scalar = SCORE_DIFFUSION
|
||||
|
||||
! Increment the appropriate index and set pointer
|
||||
analog_tallies(1) = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue