mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
successfully printed out total cross section from tally object
This commit is contained in:
parent
1fee45a858
commit
6c85dc3a25
2 changed files with 33 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
cmfd_utils.o: global.o
|
||||
cmfd_utils.o: mesh.o
|
||||
|
||||
cross_section.o: constants.o
|
||||
cross_section.o: cross_section_header.o
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
module cmfd_utils
|
||||
|
||||
use global
|
||||
use mesh, only: mesh_indices_to_bin
|
||||
use tally_header, only: TallyObject, TallyScore
|
||||
|
||||
implicit none
|
||||
|
||||
|
|
@ -47,7 +49,36 @@ contains
|
|||
|
||||
subroutine print_cmfd()
|
||||
|
||||
write(7,*) 'hello world'
|
||||
integer :: bins(TALLY_TYPES) ! bin for tally_types, for filters
|
||||
integer :: ijk(3) ! indices for mesh cell where tally is
|
||||
integer :: score_index ! index in tally score to get value
|
||||
|
||||
real(8) :: tally_val ! value of tally being extracted
|
||||
|
||||
type(TallyObject), pointer :: t ! pointer for a tally object
|
||||
type(StructuredMesh), pointer :: m ! pointer for mesh object
|
||||
|
||||
! associate pointers with objects
|
||||
t => tallies(1)
|
||||
m => meshes(t % mesh)
|
||||
|
||||
! set all bins to 1
|
||||
bins = 1
|
||||
|
||||
! get mesh indices, first we will first force to 1,1,1
|
||||
ijk = (/ 1, 1, 1 /)
|
||||
|
||||
! apply filters, here we will just try a mesh filter first
|
||||
bins(T_MESH) = mesh_indices_to_bin(m,ijk)
|
||||
|
||||
! calculate score index from bins
|
||||
score_index = sum((bins - 1) * t%stride) + 1
|
||||
|
||||
! get value from tally object
|
||||
tally_val = t%scores(score_index,1)%val
|
||||
|
||||
! write value to file
|
||||
write(7,*) "Tally value is:",tally_val
|
||||
|
||||
end subroutine print_cmfd
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue