removed fission source extraction

This commit is contained in:
Bryan Herman 2012-04-24 06:46:28 -07:00
parent 87ec22d8b0
commit 5dd67df8aa
3 changed files with 61 additions and 82 deletions

View file

@ -81,7 +81,6 @@ contains
! set flux object and source distribution to all zeros
cmfd % flux = 0.0_8
cmfd % openmc_cycle_src = 0.0_8
cmfd % openmc_src = 0.0_8
! associate tallies and mesh
@ -94,8 +93,7 @@ contains
cmfd % hxyz(3,:,:,:) = m % width(3) ! set z width
! begin loop around tallies
! TAL: do ital = n_user_tallies + 1,n_tallies
TAL: do ital = 1,n_tallies
TAL: do ital = n_user_tallies + 1,n_tallies
! associate tallies and mesh
t => tallies(ital)
@ -108,12 +106,6 @@ contains
XLOOP: do i = 1,nx
! extract accumulated fission source
if (ital == 1) then
call extract_accum_fsrc(i,j,k)
cycle
end if
! check for active mesh cell
if (allocated(cmfd%coremap)) then
if (cmfd%coremap(i,j,k) == 99999) then
@ -199,7 +191,7 @@ contains
& cmfd % flux(h,i,j,k)
! bank source
cmfd % openmc_cycle_src(g,i,j,k) = cmfd % openmc_cycle_src(g,i,j,k) + &
cmfd % openmc_src(g,i,j,k) = cmfd % openmc_src(g,i,j,k) + &
& t % scores(score_index,2) % sum
end do INGROUP
@ -278,7 +270,6 @@ contains
! normalize openmc source distribution
cmfd % openmc_src = cmfd % openmc_src/sum(cmfd % openmc_src)*cmfd%norm
cmfd % openmc_cycle_src = cmfd % openmc_cycle_src/sum(cmfd % openmc_cycle_src)*cmfd%norm
end subroutine compute_xs
@ -714,52 +705,52 @@ contains
!==============================================================================
! EXTRACT_ACCUM_FSRC
!==============================================================================
subroutine extract_accum_fsrc(i,j,k)
use global
use mesh, only: mesh_indices_to_bin
use mesh_header, only: StructuredMesh
use tally_header, only: TallyObject, TallyScore
integer :: nx ! number of mesh cells in x direction
integer :: ny ! number of mesh cells in y direction
integer :: nz ! number of mesh cells in z direction
integer :: ng ! number of energy groups
integer :: i ! iteration counter for x
integer :: j ! iteration counter for y
integer :: k ! iteration counter for z
integer :: g ! iteration counter for g
integer :: h ! iteration counter for outgoing groups
integer :: ital ! tally object index
integer :: ijk(3) ! indices for mesh cell
integer :: score_index ! index to pull from tally object
integer :: bins(N_FILTER_TYPES) ! bins for filters
real(8) :: flux ! temp variable for flux
type(TallyObject), pointer :: t ! pointer for tally object
type(StructuredMesh), pointer :: m ! pointer for mesh object
! associate tallies and mesh
t => tallies(1)
m => meshes(t % mesh)
! reset all bins to 1
bins = 1
! set ijk as mesh indices
ijk = (/ i, j, k /)
! get bin number for mesh indices
bins(FILTER_MESH) = mesh_indices_to_bin(m,ijk)
! calculate score index from bins
score_index = sum((bins - 1) * t%stride) + 1
! bank source
cmfd % openmc_src(i,j,k) = t % scores(score_index,1) % sum
end subroutine extract_accum_fsrc
!
! subroutine extract_accum_fsrc(i,j,k)
!
! use global
! use mesh, only: mesh_indices_to_bin
! use mesh_header, only: StructuredMesh
! use tally_header, only: TallyObject, TallyScore
!
! integer :: nx ! number of mesh cells in x direction
! integer :: ny ! number of mesh cells in y direction
! integer :: nz ! number of mesh cells in z direction
! integer :: ng ! number of energy groups
! integer :: i ! iteration counter for x
! integer :: j ! iteration counter for y
! integer :: k ! iteration counter for z
! integer :: g ! iteration counter for g
! integer :: h ! iteration counter for outgoing groups
! integer :: ital ! tally object index
! integer :: ijk(3) ! indices for mesh cell
! integer :: score_index ! index to pull from tally object
! integer :: bins(N_FILTER_TYPES) ! bins for filters
!
! real(8) :: flux ! temp variable for flux
!
! type(TallyObject), pointer :: t ! pointer for tally object
! type(StructuredMesh), pointer :: m ! pointer for mesh object
!
! ! associate tallies and mesh
! t => tallies(1)
! m => meshes(t % mesh)
!
! ! reset all bins to 1
! bins = 1
!
! ! set ijk as mesh indices
! ijk = (/ i, j, k /)
!
! ! get bin number for mesh indices
! bins(FILTER_MESH) = mesh_indices_to_bin(m,ijk)
!
! ! calculate score index from bins
! score_index = sum((bins - 1) * t%stride) + 1
!
! ! bank source
! cmfd % openmc_accum_src(i,j,k) = t % scores(score_index,1) % sum
!
! end subroutine extract_accum_fsrc
end module cmfd_data

View file

@ -68,8 +68,7 @@ module cmfd_header
real(8) :: entropy = 0.0_8
! openmc source
real(8), allocatable :: openmc_src(:,:,:)
real(8), allocatable :: openmc_cycle_src(:,:,:,:)
real(8), allocatable :: openmc_src(:,:,:,:)
! openmc source normalization factor
real(8) :: norm = 1.0_8
@ -120,8 +119,7 @@ contains
if (.not. allocated(this % current)) allocate(this % current(12,ng,nx,ny,nz))
! allocate openmc source distribution
if (.not. allocated(this % openmc_src)) allocate(this % openmc_src(nx,ny,nz))
if (.not. allocated(this % openmc_cycle_src)) allocate(this % openmc_cycle_src(ng,nx,ny,nz))
if (.not. allocated(this % openmc_src)) allocate(this % openmc_src(ng,nx,ny,nz))
end subroutine allocate_cmfd
@ -153,7 +151,6 @@ contains
if (allocated(this % sourcecounts)) deallocate(this % sourcecounts)
if (allocated(this % weightfactors)) deallocate(this % weightfactors)
if (allocated(this % openmc_src)) deallocate(this % openmc_src)
if (allocated(this % openmc_cycle_src)) deallocate(this % openmc_cycle_src)
end subroutine deallocate_cmfd

View file

@ -88,13 +88,13 @@ contains
! compute residual
res = leakage + interactions - scattering - (ONE/keff)*fission
write(670,*) 'Group:',g
write(670,*) 'Leakage:',leakage
write(670,*) 'Interactions:',interactions
write(670,*) 'Scattering:',scattering
write(670,*) 'Fission:',fission
write(670,*) 'k-eff:',keff
write(670,*) 'Balance:',res
! write(670,*) 'Group:',g
! write(670,*) 'Leakage:',leakage
! write(670,*) 'Interactions:',interactions
! write(670,*) 'Scattering:',scattering
! write(670,*) 'Fission:',fission
! write(670,*) 'k-eff:',keff
! write(670,*) 'Balance:',res
! normalize by flux
res = res/cmfd%flux(g,i,j,k)
@ -348,26 +348,17 @@ contains
! write out cmfd eigenvector
dim4 = (/ng,nx,ny,nz/)
call h5screate_simple_f(4,dim4,dataspace_id,hdf5_err)
call h5dcreate_f(hdf5_output_file,trim(cycname)//"/cmfd_source", &
call h5dcreate_f(hdf5_output_file,trim(cycname)//"/cmfd_source", &
& H5T_NATIVE_DOUBLE,dataspace_id,dataset_id,hdf5_err)
call h5dwrite_f(dataset_id,H5T_NATIVE_DOUBLE,cmfd%source,dim4,hdf5_err)
call h5dclose_f(dataset_id,hdf5_err)
! write out openmc source vector
dim3 = (/nx,ny,nz/)
call h5screate_simple_f(3,dim4,dataspace_id,hdf5_err)
call h5dcreate_f(hdf5_output_file,trim(cycname)//"/openmc_src", &
& H5T_NATIVE_DOUBLE,dataspace_id,dataset_id,hdf5_err)
call h5dwrite_f(dataset_id,H5T_NATIVE_DOUBLE,cmfd%openmc_src,dim3,hdf5_err)
call h5sclose_f(dataspace_id,hdf5_err)
call h5dclose_f(dataset_id,hdf5_err)
! write out openmc source vector
dim4 = (/ng,nx,ny,nz/)
call h5screate_simple_f(4,dim4,dataspace_id,hdf5_err)
call h5dcreate_f(hdf5_output_file,trim(cycname)//"/openmc_cycle_src", &
call h5dcreate_f(hdf5_output_file,trim(cycname)//"/openmc_src", &
& H5T_NATIVE_DOUBLE,dataspace_id,dataset_id,hdf5_err)
call h5dwrite_f(dataset_id,H5T_NATIVE_DOUBLE,cmfd%openmc_cycle_src,dim4,hdf5_err)
call h5dwrite_f(dataset_id,H5T_NATIVE_DOUBLE,cmfd%openmc_src,dim4,hdf5_err)
call h5sclose_f(dataspace_id,hdf5_err)
call h5dclose_f(dataset_id,hdf5_err)