mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Changed criticality to eigenvalue (modules, input, etc).
This commit is contained in:
parent
7a7d83e4e2
commit
3f61c736b4
17 changed files with 114 additions and 102 deletions
|
|
@ -69,37 +69,6 @@ deviation.
|
|||
|
||||
*Default*: off
|
||||
|
||||
``<criticality>`` Element
|
||||
-------------------------
|
||||
|
||||
The ``<criticality>`` element indicates that a criticality calculation should be
|
||||
performed. It has the following attributes/sub-elements:
|
||||
|
||||
:batches:
|
||||
The total number of batches, where each batch corresponds to multiple
|
||||
fission source iterations. Batching is done to eliminate correlation between
|
||||
realizations of random variables.
|
||||
|
||||
*Default*: None
|
||||
|
||||
:generations_per_batch:
|
||||
The number of total fission source iterations per batch.
|
||||
|
||||
*Default*: 1
|
||||
|
||||
:inactive:
|
||||
The number of inactive batches. In general, the starting cycles in a
|
||||
criticality calculation can not be used to contribute to tallies since the
|
||||
fission source distribution and eigenvalue are generally not converged
|
||||
immediately.
|
||||
|
||||
*Default*: None
|
||||
|
||||
:particles:
|
||||
The number of neutrons to simulate per fission source iteration.
|
||||
|
||||
*Default*: None
|
||||
|
||||
.. _cross_sections:
|
||||
|
||||
``<cross_sections>`` Element
|
||||
|
|
@ -130,6 +99,37 @@ default. This element has the following attributes/sub-elements:
|
|||
|
||||
*Default*: 1.0
|
||||
|
||||
``<eigenvalue>`` Element
|
||||
------------------------
|
||||
|
||||
The ``<eigenvalue>`` element indicates that a :math:`k`-eigenvalue calculation
|
||||
should be performed. It has the following attributes/sub-elements:
|
||||
|
||||
:batches:
|
||||
The total number of batches, where each batch corresponds to multiple
|
||||
fission source iterations. Batching is done to eliminate correlation between
|
||||
realizations of random variables.
|
||||
|
||||
*Default*: None
|
||||
|
||||
:generations_per_batch:
|
||||
The number of total fission source iterations per batch.
|
||||
|
||||
*Default*: 1
|
||||
|
||||
:inactive:
|
||||
The number of inactive batches. In general, the starting cycles in a
|
||||
criticality calculation can not be used to contribute to tallies since the
|
||||
fission source distribution and eigenvalue are generally not converged
|
||||
immediately.
|
||||
|
||||
*Default*: None
|
||||
|
||||
:particles:
|
||||
The number of neutrons to simulate per fission source iteration.
|
||||
|
||||
*Default*: None
|
||||
|
||||
``<energy_grid>`` Element
|
||||
-------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -90,23 +90,23 @@ cmfd_snes_solver.o: constants.o
|
|||
cmfd_snes_solver.o: global.o
|
||||
cmfd_snes_solver.o: string.o
|
||||
|
||||
criticality.o: cmfd_execute.o
|
||||
criticality.o: constants.o
|
||||
criticality.o: error.o
|
||||
criticality.o: global.o
|
||||
criticality.o: hdf5_interface.o
|
||||
criticality.o: math.o
|
||||
criticality.o: mesh.o
|
||||
criticality.o: mesh_header.o
|
||||
criticality.o: output.o
|
||||
criticality.o: physics.o
|
||||
criticality.o: random_lcg.o
|
||||
criticality.o: search.o
|
||||
criticality.o: source.o
|
||||
criticality.o: state_point.o
|
||||
criticality.o: string.o
|
||||
criticality.o: tally.o
|
||||
criticality.o: timing.o
|
||||
eigenvalue.o: cmfd_execute.o
|
||||
eigenvalue.o: constants.o
|
||||
eigenvalue.o: error.o
|
||||
eigenvalue.o: global.o
|
||||
eigenvalue.o: hdf5_interface.o
|
||||
eigenvalue.o: math.o
|
||||
eigenvalue.o: mesh.o
|
||||
eigenvalue.o: mesh_header.o
|
||||
eigenvalue.o: output.o
|
||||
eigenvalue.o: physics.o
|
||||
eigenvalue.o: random_lcg.o
|
||||
eigenvalue.o: search.o
|
||||
eigenvalue.o: source.o
|
||||
eigenvalue.o: state_point.o
|
||||
eigenvalue.o: string.o
|
||||
eigenvalue.o: tally.o
|
||||
eigenvalue.o: timing.o
|
||||
|
||||
cross_section.o: ace_header.o
|
||||
cross_section.o: constants.o
|
||||
|
|
@ -243,7 +243,7 @@ interpolation.o: search.o
|
|||
interpolation.o: string.o
|
||||
|
||||
main.o: constants.o
|
||||
main.o: criticality.o
|
||||
main.o: eigenvalue.o
|
||||
main.o: finalize.o
|
||||
main.o: fixed_source.o
|
||||
main.o: global.o
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ cmfd_power_solver.o \
|
|||
cmfd_prod_operator.o \
|
||||
cmfd_snes_solver.o \
|
||||
cross_section.o \
|
||||
criticality.o \
|
||||
datatypes.o \
|
||||
datatypes_header.o \
|
||||
doppler.o \
|
||||
eigenvalue.o \
|
||||
endf.o \
|
||||
endf_header.o \
|
||||
energy_grid.o \
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ module bank_header
|
|||
implicit none
|
||||
|
||||
!===============================================================================
|
||||
! BANK is used for storing fission sites in criticality calculations. Since all
|
||||
! BANK is used for storing fission sites in eigenvalue calculations. Since all
|
||||
! the state information of a neutron is not needed, this type allows sites to be
|
||||
! stored with less memory
|
||||
!===============================================================================
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ module constants
|
|||
! Running modes
|
||||
integer, parameter :: &
|
||||
MODE_FIXEDSOURCE = 1, & ! Fixed source mode
|
||||
MODE_CRITICALITY = 2, & ! Criticality mode
|
||||
MODE_EIGENVALUE = 2, & ! K eigenvalue mode
|
||||
MODE_PLOTTING = 3, & ! Plotting mode
|
||||
MODE_TALLIES = 4 ! Tally results mode
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
module criticality
|
||||
module eigenvalue
|
||||
|
||||
#ifdef MPI
|
||||
use mpi
|
||||
|
|
@ -29,15 +29,15 @@ module criticality
|
|||
contains
|
||||
|
||||
!===============================================================================
|
||||
! RUN_CRITICALITY encompasses all the main logic where iterations are performed
|
||||
! over the batches, generations, and histories.
|
||||
! RUN_EIGENVALUE encompasses all the main logic where iterations are performed
|
||||
! over the batches, generations, and histories in a k-eigenvalue calculation.
|
||||
!===============================================================================
|
||||
|
||||
subroutine run_criticality()
|
||||
subroutine run_eigenvalue()
|
||||
|
||||
integer(8) :: i ! index over individual particles
|
||||
|
||||
if (master) call header("CRITICALITY TRANSPORT SIMULATION", level=1)
|
||||
if (master) call header("K EIGENVALUE SIMULATION", level=1)
|
||||
|
||||
! Allocate particle
|
||||
allocate(p)
|
||||
|
|
@ -99,7 +99,7 @@ contains
|
|||
|
||||
if (master) call header("SIMULATION FINISHED", level=1)
|
||||
|
||||
end subroutine run_criticality
|
||||
end subroutine run_eigenvalue
|
||||
|
||||
!===============================================================================
|
||||
! INITIALIZE_BATCH
|
||||
|
|
@ -692,4 +692,4 @@ contains
|
|||
|
||||
end subroutine count_source_for_ufs
|
||||
|
||||
end module criticality
|
||||
end module eigenvalue
|
||||
|
|
@ -154,7 +154,7 @@ module global
|
|||
type(ListInt), pointer :: active_tallies => null()
|
||||
|
||||
! ============================================================================
|
||||
! CRITICALITY SIMULATION VARIABLES
|
||||
! EIGENVALUE SIMULATION VARIABLES
|
||||
|
||||
integer(8) :: n_particles = 0 ! # of particles per generation
|
||||
integer :: n_batches ! # of batches
|
||||
|
|
@ -250,7 +250,7 @@ module global
|
|||
! ============================================================================
|
||||
! MISCELLANEOUS VARIABLES
|
||||
|
||||
! Mode to run in (fixed source, criticality, plotting, etc)
|
||||
! Mode to run in (fixed source, eigenvalue, plotting, etc)
|
||||
integer :: run_mode = NONE
|
||||
|
||||
! Restart run
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ contains
|
|||
! Write header information
|
||||
call hdf5_write_header()
|
||||
|
||||
! Write criticality information
|
||||
if (run_mode == MODE_CRITICALITY) then
|
||||
! Write eigenvalue information
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
! Need to write integer(8)'s using double instead since there is no H5LT
|
||||
! call for making a dataset of type long
|
||||
call hdf5_write_double(hdf5_output_file, "n_particles", real(n_particles,8))
|
||||
|
|
@ -865,8 +865,8 @@ contains
|
|||
! Write out current batch number
|
||||
call hdf5_write_integer(hdf5_state_point, "current_batch", current_batch)
|
||||
|
||||
! Write out information for criticality run
|
||||
if (run_mode == MODE_CRITICALITY) then
|
||||
! Write out information for eigenvalue run
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
call hdf5_write_integer(hdf5_state_point, "n_inactive", n_inactive)
|
||||
call hdf5_write_integer(hdf5_state_point, "gen_per_batch", gen_per_batch)
|
||||
|
||||
|
|
@ -1132,8 +1132,8 @@ contains
|
|||
! Read batch number to restart at
|
||||
call hdf5_read_integer(hdf5_state_point, "current_batch", restart_batch)
|
||||
|
||||
! Read information specific to criticality run
|
||||
if (mode == MODE_CRITICALITY) then
|
||||
! Read information specific to eigenvalue run
|
||||
if (mode == MODE_EIGENVALUE) then
|
||||
call hdf5_read_integer(hdf5_state_point, "n_inactive", n_inactive)
|
||||
call hdf5_read_integer(hdf5_state_point, "gen_per_batch", gen_per_batch)
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ contains
|
|||
! Allocate banks and create source particles -- for a fixed source
|
||||
! calculation, the external source distribution is sampled during the
|
||||
! run, not at initialization
|
||||
if (run_mode == MODE_CRITICALITY) then
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
call allocate_banks()
|
||||
if (.not. restart_run) call initialize_source()
|
||||
end if
|
||||
|
|
|
|||
|
|
@ -102,32 +102,41 @@ contains
|
|||
end if
|
||||
|
||||
! Make sure that either criticality or fixed source was specified
|
||||
if (criticality_ % batches == 0 .and. fixed_source_ % batches == 0) then
|
||||
message = "Number of batches on <criticality> or <fixed_source> " &
|
||||
// "tag was zero."
|
||||
if (eigenvalue_ % batches == 0 .and. fixed_source_ % batches == 0 &
|
||||
.and. criticality_ % batches == 0) then
|
||||
message = "Number of batches on <eigenvalue> or <fixed_source> &
|
||||
&tag was zero."
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
! Criticality information
|
||||
! Check for old <criticality> tag
|
||||
if (criticality_ % batches > 0) then
|
||||
eigenvalue_ = criticality_
|
||||
message = "The <criticality> element has been deprecated and &
|
||||
&replaced by <eigenvalue>."
|
||||
call warning()
|
||||
end if
|
||||
|
||||
! Eigenvalue information
|
||||
if (eigenvalue_ % batches > 0) then
|
||||
! Set run mode
|
||||
if (run_mode == NONE) run_mode = MODE_CRITICALITY
|
||||
if (run_mode == NONE) run_mode = MODE_EIGENVALUE
|
||||
|
||||
! Check number of particles
|
||||
if (len_trim(criticality_ % particles) == 0) then
|
||||
if (len_trim(eigenvalue_ % particles) == 0) then
|
||||
message = "Need to specify number of particles per cycles."
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
! If the number of particles was specified as a command-line argument, we
|
||||
! don't set it here
|
||||
if (n_particles == 0) n_particles = str_to_int(criticality_ % particles)
|
||||
if (n_particles == 0) n_particles = str_to_int(eigenvalue_ % particles)
|
||||
|
||||
! Copy batch and generation information
|
||||
n_batches = criticality_ % batches
|
||||
n_inactive = criticality_ % inactive
|
||||
n_batches = eigenvalue_ % batches
|
||||
n_inactive = eigenvalue_ % inactive
|
||||
n_active = n_batches - n_inactive
|
||||
gen_per_batch = criticality_ % generations_per_batch
|
||||
gen_per_batch = eigenvalue_ % generations_per_batch
|
||||
|
||||
! Allocate array for batch keff and entropy
|
||||
allocate(k_batch(n_batches))
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
program main
|
||||
|
||||
use constants
|
||||
use criticality, only: run_criticality
|
||||
use eigenvalue, only: run_eigenvalue
|
||||
use finalize, only: finalize_run
|
||||
use fixed_source, only: run_fixedsource
|
||||
use global
|
||||
|
|
@ -17,8 +17,8 @@ program main
|
|||
select case (run_mode)
|
||||
case (MODE_FIXEDSOURCE)
|
||||
call run_fixedsource()
|
||||
case (MODE_CRITICALITY)
|
||||
call run_criticality()
|
||||
case (MODE_EIGENVALUE)
|
||||
call run_eigenvalue()
|
||||
case (MODE_PLOTTING)
|
||||
call run_plot()
|
||||
case (MODE_TALLIES)
|
||||
|
|
|
|||
|
|
@ -1078,13 +1078,13 @@ contains
|
|||
! Display problem summary
|
||||
call header("PROBLEM SUMMARY", unit=UNIT_SUMMARY)
|
||||
select case(run_mode)
|
||||
case (MODE_CRITICALITY)
|
||||
write(UNIT_SUMMARY,100) 'Problem type:', 'Criticality'
|
||||
case (MODE_EIGENVALUE)
|
||||
write(UNIT_SUMMARY,100) 'Problem type:', 'k eigenvalue'
|
||||
write(UNIT_SUMMARY,101) 'Number of Batches:', n_batches
|
||||
write(UNIT_SUMMARY,101) 'Number of Inactive Batches:', n_inactive
|
||||
write(UNIT_SUMMARY,101) 'Generations per Batch:', gen_per_batch
|
||||
case (MODE_FIXEDSOURCE)
|
||||
write(UNIT_SUMMARY,100) 'Problem type:', 'External Source'
|
||||
write(UNIT_SUMMARY,100) 'Problem type:', 'fixed source'
|
||||
end select
|
||||
write(UNIT_SUMMARY,101) 'Number of Particles:', n_particles
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module source_header
|
|||
|
||||
!===============================================================================
|
||||
! EXTSOURCE describes an external source of neutrons for a fixed-source problem
|
||||
! or for the starting source in a criticality problem
|
||||
! or for the starting source in a k eigenvalue problem
|
||||
!===============================================================================
|
||||
|
||||
type ExtSource
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ contains
|
|||
! ==========================================================================
|
||||
! SOURCE BANK
|
||||
|
||||
if (run_mode == MODE_CRITICALITY) then
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
if (source_separate) then
|
||||
! If the user has specified that the source sites should be written in
|
||||
! a separate file, we make a call to the appropriate subroutine to
|
||||
|
|
@ -179,8 +179,8 @@ contains
|
|||
! Write out current batch number
|
||||
write(UNIT_STATE) current_batch
|
||||
|
||||
! Write out information for criticality run
|
||||
if (run_mode == MODE_CRITICALITY) then
|
||||
! Write out information for eigenvalue run
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
write(UNIT_STATE) n_inactive, gen_per_batch
|
||||
write(UNIT_STATE) k_batch(1:current_batch)
|
||||
write(UNIT_STATE) entropy(1:current_batch)
|
||||
|
|
@ -281,7 +281,7 @@ contains
|
|||
end if
|
||||
|
||||
! Write out source bank
|
||||
if (run_mode == MODE_CRITICALITY) then
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
if (source_separate) then
|
||||
! If the user has specified that the source sites should be written in
|
||||
! a separate file, we make a call to the appropriate subroutine to
|
||||
|
|
@ -349,8 +349,8 @@ contains
|
|||
call MPI_FILE_WRITE(fh, current_batch, 1, MPI_INTEGER, &
|
||||
MPI_STATUS_IGNORE, mpi_err)
|
||||
|
||||
! Write out information for criticality run
|
||||
if (run_mode == MODE_CRITICALITY) then
|
||||
! Write out information for eigenvalue run
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
call MPI_FILE_WRITE(fh, n_inactive, 1, MPI_INTEGER, &
|
||||
MPI_STATUS_IGNORE, mpi_err)
|
||||
call MPI_FILE_WRITE(fh, gen_per_batch, 1, MPI_INTEGER, &
|
||||
|
|
@ -644,8 +644,8 @@ contains
|
|||
call MPI_FILE_READ_ALL(fh, restart_batch, 1, MPI_INTEGER, &
|
||||
MPI_STATUS_IGNORE, mpi_err)
|
||||
|
||||
! Read information specific to criticality run
|
||||
if (mode == MODE_CRITICALITY) then
|
||||
! Read information specific to eigenvalue run
|
||||
if (mode == MODE_EIGENVALUE) then
|
||||
call MPI_FILE_READ_ALL(fh, n_inactive, 1, MPI_INTEGER, &
|
||||
MPI_STATUS_IGNORE, mpi_err)
|
||||
call MPI_FILE_READ_ALL(fh, gen_per_batch, 1, MPI_INTEGER, &
|
||||
|
|
@ -781,7 +781,7 @@ contains
|
|||
! ==========================================================================
|
||||
! SOURCE BANK
|
||||
|
||||
if (run_mode == MODE_CRITICALITY) then
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
! Get current offset for master
|
||||
if (master) call MPI_FILE_GET_POSITION(fh, offset, mpi_err)
|
||||
|
||||
|
|
@ -841,8 +841,8 @@ contains
|
|||
! Read batch number to restart at
|
||||
read(UNIT_STATE) restart_batch
|
||||
|
||||
! Read information specific to criticality run
|
||||
if (mode == MODE_CRITICALITY) then
|
||||
! Read information specific to eigenvalue run
|
||||
if (mode == MODE_EIGENVALUE) then
|
||||
read(UNIT_STATE) n_inactive, gen_per_batch
|
||||
read(UNIT_STATE) k_batch(1:restart_batch)
|
||||
read(UNIT_STATE) entropy(1:restart_batch)
|
||||
|
|
@ -966,8 +966,8 @@ contains
|
|||
end if
|
||||
end if
|
||||
|
||||
! Read source bank for criticality run
|
||||
if (mode == MODE_CRITICALITY .and. run_mode /= MODE_TALLIES) then
|
||||
! Read source bank for eigenvalue run
|
||||
if (mode == MODE_EIGENVALUE .and. run_mode /= MODE_TALLIES) then
|
||||
read(UNIT_STATE) source_bank
|
||||
end if
|
||||
|
||||
|
|
@ -995,7 +995,7 @@ contains
|
|||
call write_message(1)
|
||||
end if
|
||||
|
||||
! For criticality calculations, turn on tallies if we've reached active
|
||||
! For eigenvalue calculations, turn on tallies if we've reached active
|
||||
! batches
|
||||
if (current_batch == n_inactive) then
|
||||
tallies_on = .true.
|
||||
|
|
|
|||
|
|
@ -1506,7 +1506,7 @@ contains
|
|||
curr_ptr => curr_ptr % next
|
||||
end do
|
||||
|
||||
if (run_mode == MODE_CRITICALITY) then
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
! Before accumulating scores for global_tallies, we need to get the
|
||||
! current batch estimate of k_analog for displaying to output
|
||||
if (active_batches) k_batch(current_batch) = global_tallies(K_ANALOG) % value
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ element settings {
|
|||
element confidence_intervals { ( "on" | "off" ) }? &
|
||||
|
||||
(
|
||||
element criticality {
|
||||
element eigenvalue {
|
||||
(element batches { xsd:positiveInteger } |
|
||||
attribute batches { xsd:positiveInteger }) &
|
||||
(element inactive { xsd:nonNegativeInteger } |
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@
|
|||
</typedef>
|
||||
|
||||
<variable name="confidence_intervals_" tag="confidence_intervals" type="word" length="3" />
|
||||
<variable name="criticality_" tag="criticality" type="run_parameters_xml" />
|
||||
<variable name="cross_sections_" tag="cross_sections" type="word" length="255" />
|
||||
<variable name="cutoff_" tag="cutoff" type="cutoff_xml" dimension="1" />
|
||||
<variable name="eigenvalue_" tag="eigenvalue" type="run_parameters_xml" />
|
||||
<variable name="energy_grid_" tag="energy_grid" type="word" length="7" />
|
||||
<variable name="entropy_" tag="entropy" type="mesh_xml" dimension="1" />
|
||||
<variable name="fixed_source_" tag="fixed_source" type="run_parameters_xml" />
|
||||
|
|
@ -60,4 +60,7 @@
|
|||
<variable name="uniform_fs_" tag="uniform_fs" type="mesh_xml" dimension="1" />
|
||||
<variable name="verbosity_" tag="verbosity" type="integer" />
|
||||
|
||||
<!-- Check for old criticality tag -->
|
||||
<variable name="criticality_" tag="criticality" type="run_parameters_xml" />
|
||||
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue