mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
restrucuted the reading of cmfd input
This commit is contained in:
parent
5000a899f4
commit
0e886bbf76
4 changed files with 49 additions and 26 deletions
|
|
@ -49,9 +49,6 @@ module cmfd_header
|
|||
! core map for xs association
|
||||
integer, allocatable :: coremap(:,:,:)
|
||||
|
||||
! we may need to add the mesh object
|
||||
! add accumulation of important parameters
|
||||
|
||||
end type cmfd_obj
|
||||
|
||||
end module cmfd_header
|
||||
|
|
|
|||
|
|
@ -17,9 +17,49 @@ contains
|
|||
! READ_INPUT reads the CMFD input file and organizes it into a data structure
|
||||
!===============================================================================
|
||||
|
||||
subroutine read_input()
|
||||
subroutine read_cmfd_xml()
|
||||
|
||||
end subroutine read_input
|
||||
use xml_data_cmfd_t
|
||||
|
||||
integer :: ng=1 ! number of energy groups (default 1)
|
||||
integer :: n_words ! number of words read
|
||||
logical :: file_exists ! does cmfd.xml exist?
|
||||
character(MAX_LINE_LEN) :: filename
|
||||
character(MAX_WORD_LEN) :: words(MAX_WORDS)
|
||||
|
||||
! read cmfd infput file
|
||||
filename = trim(path_input) // "cmfd.xml"
|
||||
inquire(FILE=filename, EXIST=file_exists)
|
||||
if (.not. file_exists) then
|
||||
write(*,*) "Cannot perform CMFD"
|
||||
STOP
|
||||
end if
|
||||
|
||||
! parse cmfd.xml file
|
||||
call read_xml_file_cmfd_t(filename)
|
||||
|
||||
! set spatial dimensions in cmfd object
|
||||
cmfd % indices(1:3) = mesh_ % dimension(1:3) ! sets spatial dimensions
|
||||
|
||||
! get number of energy groups
|
||||
if (len_trim(mesh_ % energy) > 0) then
|
||||
call split_string(mesh_ % energy, words, n_words)
|
||||
ng = n_words
|
||||
end if
|
||||
cmfd % indices(4) = ng ! sets energy group dimension
|
||||
|
||||
! set global albedo
|
||||
cmfd % albedo = mesh_ % albedo
|
||||
|
||||
! get acceleration map
|
||||
allocate(cmfd % coremap(cmfd % indices(1), cmfd % indices(2), &
|
||||
& cmfd % indices(3)))
|
||||
cmfd % coremap = reshape(mesh_ % map,(cmfd % indices(1:3)))
|
||||
|
||||
! create tally objects
|
||||
call create_cmfd_tally()
|
||||
|
||||
end subroutine read_cmfd_xml
|
||||
|
||||
!===============================================================================
|
||||
! GET_MATRIX_IDX takes (x,y,z,g) indices and computes location in matrix
|
||||
|
|
@ -106,7 +146,7 @@ contains
|
|||
|
||||
subroutine create_cmfd_tally()
|
||||
|
||||
use xml_data_cmfd_t
|
||||
use xml_data_cmfd_t
|
||||
|
||||
integer :: i ! loop counter
|
||||
integer :: j ! loop counter
|
||||
|
|
@ -115,22 +155,14 @@ contains
|
|||
integer :: n ! size of arrays in mesh specification
|
||||
integer :: ng=1 ! number of energy groups (default 1)
|
||||
integer :: n_words ! number of words read
|
||||
logical :: file_exists ! does cmfd.xml file exist?
|
||||
character(MAX_LINE_LEN) :: filename
|
||||
character(MAX_WORD_LEN) :: words(MAX_WORDS)
|
||||
type(TallyObject), pointer :: t => null()
|
||||
type(StructuredMesh), pointer :: m => null()
|
||||
|
||||
! check if cmfd.xml exists
|
||||
filename = trim(path_input) // "cmfd.xml"
|
||||
inquire(FILE=filename, EXIST=file_exists)
|
||||
if (.not. file_exists) then
|
||||
write(*,*) "Cannot perform CMFD"
|
||||
STOP
|
||||
end if
|
||||
|
||||
! parse cmfd.xml file
|
||||
call read_xml_file_cmfd_t(filename)
|
||||
filename = trim(path_input) // "cmfd.xml"
|
||||
call read_xml_file_cmfd_t(filename)
|
||||
|
||||
! allocate mesh
|
||||
n_meshes = 1
|
||||
|
|
@ -282,13 +314,6 @@ contains
|
|||
|
||||
end do
|
||||
|
||||
! set dimensions in cmfd object
|
||||
cmfd % indices(1:3) = m % dimension(1:3) ! sets spatial dimensions
|
||||
cmfd % indices(4) = ng ! sets energy group dimension
|
||||
|
||||
! set global albedo
|
||||
cmfd % albedo = mesh_ % albedo
|
||||
|
||||
end subroutine create_cmfd_tally
|
||||
|
||||
end module cmfd_utils
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
module input_xml
|
||||
|
||||
use cmfd_utils, only: create_cmfd_tally
|
||||
use cmfd_utils, only: read_cmfd_xml
|
||||
use constants
|
||||
use datatypes, only: dict_create, dict_add_key, dict_has_key, &
|
||||
dict_get_key
|
||||
|
|
@ -31,7 +31,7 @@ contains
|
|||
call read_geometry_xml()
|
||||
call read_materials_xml()
|
||||
call read_tallies_xml()
|
||||
call create_cmfd_tally()
|
||||
call read_cmfd_xml()
|
||||
if (plotting) call read_plot_xml()
|
||||
|
||||
end subroutine read_input_xml
|
||||
|
|
|
|||
|
|
@ -8,9 +8,10 @@
|
|||
<component name="origin" type="double-array" />
|
||||
<component name="width" type="double-array" />
|
||||
<component name="albedo" type="double-array" />
|
||||
<component name="map" type="integer-array" />
|
||||
<component name="energy" type="word" length="250" default="''" />
|
||||
</typedef>
|
||||
|
||||
<variable name="mesh_" tag="mesh" type="mesh_xml" />
|
||||
<variable name="energy_" tag="energy" type="word" length="250" default="''" />
|
||||
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue