mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
added user-defined fission source normalization constant
This commit is contained in:
parent
935c3bffa4
commit
73fd4449df
5 changed files with 17 additions and 5 deletions
|
|
@ -266,7 +266,7 @@ contains
|
|||
end do TAL
|
||||
|
||||
! normalize openmc source distribution
|
||||
cmfd % openmc_src = cmfd % openmc_src/sum(cmfd % openmc_src)
|
||||
cmfd % openmc_src = cmfd % openmc_src/sum(cmfd % openmc_src)*cmfd%norm
|
||||
|
||||
end subroutine compute_xs
|
||||
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ contains
|
|||
integer :: idx ! index in vector
|
||||
real(8) :: hxyz(3) ! cell dimensions of current ijk cell
|
||||
real(8) :: vol ! volume of cell
|
||||
real(8) :: norm ! normalization factor for entropy
|
||||
real(8),allocatable :: source(:,:,:,:) ! tmp source array for entropy
|
||||
|
||||
! get maximum of spatial and group indices
|
||||
|
|
@ -235,12 +236,15 @@ contains
|
|||
|
||||
end do ZLOOP
|
||||
|
||||
! normalize source such that it sums to 1.0
|
||||
cmfd%source = cmfd%source/sum(cmfd%source)
|
||||
! normalize source such that it sums to 1.0 (1 group for now)
|
||||
cmfd%source = cmfd%source/sum(cmfd%source)*cmfd%norm
|
||||
|
||||
! compute entropy
|
||||
if (entropy_on) then
|
||||
|
||||
! compute normalization factor
|
||||
norm = sum(cmfd%source)
|
||||
|
||||
! allocate tmp array
|
||||
if (.not.allocated(source)) allocate(source(ng,nx,ny,nz))
|
||||
|
||||
|
|
@ -249,7 +253,7 @@ contains
|
|||
|
||||
! compute log
|
||||
where (cmfd%source > 0.0_8)
|
||||
source = cmfd%source*log(cmfd%source)/log(2.0)
|
||||
source = cmfd%source/norm*log(cmfd%source/norm)/log(2.0)
|
||||
end where
|
||||
|
||||
! sum that source
|
||||
|
|
|
|||
|
|
@ -66,6 +66,9 @@ module cmfd_header
|
|||
! openmc source
|
||||
real(8), allocatable :: openmc_src(:,:,:,:)
|
||||
|
||||
! openmc source normalization factor
|
||||
real(8) :: norm = 1.0_8
|
||||
|
||||
end type cmfd_obj
|
||||
|
||||
contains
|
||||
|
|
|
|||
|
|
@ -69,9 +69,13 @@ contains
|
|||
end if
|
||||
|
||||
! check for core map activation by printing note
|
||||
|
||||
if (cmfd_coremap .and. master) write(*,*)"Core Map Overlay Activated"
|
||||
|
||||
! check for normalization constant
|
||||
if (norm_ > 0.0_8) then
|
||||
cmfd % norm = norm_
|
||||
end if
|
||||
|
||||
! create tally objects
|
||||
call create_cmfd_tally()
|
||||
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@
|
|||
</typedef>
|
||||
|
||||
<variable name="mesh_" tag="mesh" type="mesh_xml" />
|
||||
<variable name="norm_" tag="norm" type="double" />
|
||||
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue