mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Merge pull request #170 from mit-crpg/removeDiffusion
Removed Diffusion Tally from Code
This commit is contained in:
commit
7ba985812f
9 changed files with 30 additions and 58 deletions
|
|
@ -170,14 +170,9 @@ contains
|
|||
! get p1 scatter rr and convert to p1 scatter xs
|
||||
cmfd % p1scattxs(h,i,j,k) = t % results(3,score_index) % sum / flux
|
||||
|
||||
! extract diffusion coefficient tally
|
||||
cmfd % diffusion(h,i,j,k) = t % results(4,score_index) % sum / flux
|
||||
|
||||
! calculate diffusion coefficient
|
||||
! cmfd % diffcof(h,i,j,k) = ONE/(3.0_8*cmfd%totalxs(h,i,j,k))
|
||||
cmfd % diffcof(h,i,j,k) = ONE/(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
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ module cmfd_header
|
|||
|
||||
! diffusion coefficient
|
||||
real(8), allocatable :: diffcof(:,:,:,:)
|
||||
real(8), allocatable :: diffusion(:,:,:,:)
|
||||
|
||||
! current
|
||||
real(8), allocatable :: current(:,:,:,:,:)
|
||||
|
|
@ -102,7 +101,6 @@ 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))
|
||||
|
|
@ -129,7 +127,6 @@ contains
|
|||
this % scattxs = ZERO
|
||||
this % nfissxs = ZERO
|
||||
this % diffcof = ZERO
|
||||
this % diffusion = ZERO
|
||||
this % dtilde = ZERO
|
||||
this % dhat = ZERO
|
||||
this % hxyz = ZERO
|
||||
|
|
@ -155,7 +152,6 @@ 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)
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ contains
|
|||
if (i == 1) then
|
||||
|
||||
! set label
|
||||
t % label = "CMFD flux, total, scatter-1, diffusion"
|
||||
t % label = "CMFD flux, total, scatter-1"
|
||||
|
||||
! set tally estimator to analog
|
||||
t % estimator = ESTIMATOR_ANALOG
|
||||
|
|
@ -378,12 +378,12 @@ contains
|
|||
t % filters = filters(1:n_filters)
|
||||
|
||||
! allocate scoring bins
|
||||
allocate(t % score_bins(4))
|
||||
t % n_score_bins = 4
|
||||
t % n_user_score_bins = 4
|
||||
allocate(t % score_bins(3))
|
||||
t % n_score_bins = 3
|
||||
t % n_user_score_bins = 3
|
||||
|
||||
! allocate scattering order data
|
||||
allocate(t % scatt_order(4))
|
||||
allocate(t % scatt_order(3))
|
||||
t % scatt_order = 0
|
||||
|
||||
! set macro_bins
|
||||
|
|
@ -391,7 +391,6 @@ contains
|
|||
t % score_bins(2) = SCORE_TOTAL
|
||||
t % score_bins(3) = SCORE_SCATTER_N
|
||||
t % scatt_order(3) = 1
|
||||
t % score_bins(4) = SCORE_DIFFUSION
|
||||
|
||||
else if (i == 2) then
|
||||
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ module constants
|
|||
EVENT_FISSION = 3
|
||||
|
||||
! Tally score type
|
||||
integer, parameter :: N_SCORE_TYPES = 15
|
||||
integer, parameter :: N_SCORE_TYPES = 14
|
||||
integer, parameter :: &
|
||||
SCORE_FLUX = -1, & ! flux
|
||||
SCORE_TOTAL = -2, & ! total reaction rate
|
||||
|
|
@ -261,14 +261,13 @@ module constants
|
|||
SCORE_SCATTER_N = -5, & ! arbitrary scattering moment
|
||||
SCORE_SCATTER_PN = -6, & ! system for scoring 0th through nth moment
|
||||
SCORE_TRANSPORT = -7, & ! transport reaction rate
|
||||
SCORE_DIFFUSION = -8, & ! diffusion coefficient
|
||||
SCORE_N_1N = -9, & ! (n,1n) rate
|
||||
SCORE_ABSORPTION = -10, & ! absorption rate
|
||||
SCORE_FISSION = -11, & ! fission rate
|
||||
SCORE_NU_FISSION = -12, & ! neutron production rate
|
||||
SCORE_KAPPA_FISSION = -13, & ! fission energy production rate
|
||||
SCORE_CURRENT = -14, & ! partial current
|
||||
SCORE_EVENTS = -15 ! number of events
|
||||
SCORE_N_1N = -8, & ! (n,1n) rate
|
||||
SCORE_ABSORPTION = -9, & ! absorption rate
|
||||
SCORE_FISSION = -10, & ! fission rate
|
||||
SCORE_NU_FISSION = -11, & ! neutron production rate
|
||||
SCORE_KAPPA_FISSION = -12, & ! fission energy production rate
|
||||
SCORE_CURRENT = -13, & ! partial current
|
||||
SCORE_EVENTS = -14 ! number of events
|
||||
|
||||
! Maximum scattering order supported
|
||||
integer, parameter :: SCATT_ORDER_MAX = 10
|
||||
|
|
|
|||
|
|
@ -1114,7 +1114,7 @@ contains
|
|||
|
||||
! Check is calculated distance is new minimum
|
||||
if (d < dist) then
|
||||
if (abs(d - dist)/dist >= FP_PRECISION) then
|
||||
if (abs(d - dist)/dist >= FP_REL_PRECISION) then
|
||||
dist = d
|
||||
surface_crossed = -cl % surfaces(i)
|
||||
lattice_crossed = NONE
|
||||
|
|
@ -1156,7 +1156,8 @@ contains
|
|||
! point precision.
|
||||
|
||||
if (d < dist) then
|
||||
if (abs(d - dist)/dist >= FP_REL_PRECISION) then
|
||||
if (abs(d - dist)/dist >= FP_REL_PRECISION &
|
||||
.and. abs(d - dist) >= FP_PRECISION) then
|
||||
dist = d
|
||||
if (u > 0) then
|
||||
lattice_crossed = LATTICE_RIGHT
|
||||
|
|
@ -1177,7 +1178,8 @@ contains
|
|||
end if
|
||||
|
||||
if (d < dist) then
|
||||
if (abs(d - dist)/dist >= FP_REL_PRECISION) then
|
||||
if (abs(d - dist)/dist >= FP_REL_PRECISION &
|
||||
.and. abs(d - dist) >= FP_PRECISION) then
|
||||
dist = d
|
||||
if (v > 0) then
|
||||
lattice_crossed = LATTICE_FRONT
|
||||
|
|
@ -1201,7 +1203,8 @@ contains
|
|||
end if
|
||||
|
||||
if (d < dist) then
|
||||
if (abs(d - dist)/dist >= FP_REL_PRECISION) then
|
||||
if (abs(d - dist)/dist >= FP_REL_PRECISION &
|
||||
.and. abs(d - dist) >= FP_PRECISION) then
|
||||
dist = d
|
||||
if (w > 0) then
|
||||
lattice_crossed = LATTICE_TOP
|
||||
|
|
|
|||
|
|
@ -1964,10 +1964,9 @@ contains
|
|||
! Set tally estimator to analog
|
||||
t % estimator = ESTIMATOR_ANALOG
|
||||
case ('diffusion')
|
||||
t % score_bins(j) = SCORE_DIFFUSION
|
||||
|
||||
! Set tally estimator to analog
|
||||
t % estimator = ESTIMATOR_ANALOG
|
||||
message = "Diffusion score no longer supported for tallies, &
|
||||
please remove"
|
||||
call fatal_error()
|
||||
case ('n1n')
|
||||
t % score_bins(j) = SCORE_N_1N
|
||||
|
||||
|
|
|
|||
|
|
@ -823,8 +823,6 @@ contains
|
|||
j = j + n - 1
|
||||
case (SCORE_TRANSPORT)
|
||||
string = trim(string) // ' transport'
|
||||
case (SCORE_DIFFUSION)
|
||||
string = trim(string) // ' diffusion'
|
||||
case (SCORE_N_1N)
|
||||
string = trim(string) // ' n1n'
|
||||
case (SCORE_ABSORPTION)
|
||||
|
|
@ -1510,7 +1508,6 @@ contains
|
|||
score_names(abs(SCORE_SCATTER_N)) = ""
|
||||
score_names(abs(SCORE_SCATTER_PN)) = ""
|
||||
score_names(abs(SCORE_TRANSPORT)) = "Transport Rate"
|
||||
score_names(abs(SCORE_DIFFUSION)) = "Diffusion Coefficient"
|
||||
score_names(abs(SCORE_N_1N)) = "(n,1n) Rate"
|
||||
score_names(abs(SCORE_ABSORPTION)) = "Absorption Rate"
|
||||
score_names(abs(SCORE_FISSION)) = "Fission Rate"
|
||||
|
|
|
|||
|
|
@ -218,21 +218,6 @@ contains
|
|||
! total/scatter macro
|
||||
score = (macro_total - mu*macro_scatt)*(ONE/macro_scatt)
|
||||
|
||||
case (SCORE_DIFFUSION)
|
||||
! Skip any event where the particle didn't scatter
|
||||
if (p % event /= EVENT_SCATTER) cycle SCORE_LOOP
|
||||
|
||||
! Temporarily store the scattering cross section
|
||||
score = material_xs % total - material_xs % absorption
|
||||
|
||||
! Since this only gets tallied at every scattering event, the
|
||||
! flux estimator is 1/Sigma_s. Therefore, the diffusion
|
||||
! coefficient times flux is 1/(3*Sigma_s*(Sigma_t -
|
||||
! mu*Sigma_s)).
|
||||
|
||||
score = last_wgt / (3.0_8 * score * (material_xs % total - &
|
||||
mu * score))
|
||||
|
||||
case (SCORE_N_1N)
|
||||
! Skip any event where the particle didn't scatter
|
||||
if (p % event /= EVENT_SCATTER) cycle SCORE_LOOP
|
||||
|
|
|
|||
|
|
@ -17,14 +17,13 @@ score_types = {-1: 'flux',
|
|||
-5: 'scatter-n',
|
||||
-6: 'scatter-pn',
|
||||
-7: 'transport',
|
||||
-8: 'diffusion',
|
||||
-9: 'n1n',
|
||||
-10: 'absorption',
|
||||
-11: 'fission',
|
||||
-12: 'nu-fission',
|
||||
-13: 'kappa-fission',
|
||||
-14: 'current',
|
||||
-15: 'events',
|
||||
-8: 'n1n',
|
||||
-9: 'absorption',
|
||||
-10: 'fission',
|
||||
-11: 'nu-fission',
|
||||
-12: 'kappa-fission',
|
||||
-13: 'current',
|
||||
-14: 'events',
|
||||
1: '(n,total)',
|
||||
2: '(n,elastic)',
|
||||
4: '(n,level)',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue