mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Added user input for fixed source calculation.
This commit is contained in:
parent
b6bee4cc7a
commit
3d2283d6df
2 changed files with 40 additions and 14 deletions
|
|
@ -97,33 +97,58 @@ contains
|
|||
path_cross_sections = trim(cross_sections_)
|
||||
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."
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
! Criticality information
|
||||
if (criticality % batches > 0) then
|
||||
if (criticality_ % batches > 0) then
|
||||
! Set run mode
|
||||
if (run_mode /= MODE_PLOTTING) run_mode = MODE_CRITICALITY
|
||||
|
||||
! Check number of particles
|
||||
if (len_trim(criticality % particles) == 0) then
|
||||
if (len_trim(criticality_ % 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(criticality_ % particles)
|
||||
|
||||
! Copy cycle information
|
||||
n_batches = criticality % batches
|
||||
n_inactive = criticality % inactive
|
||||
! Copy batch and generation information
|
||||
n_batches = criticality_ % batches
|
||||
n_inactive = criticality_ % inactive
|
||||
n_active = n_batches - n_inactive
|
||||
gen_per_batch = criticality % generations_per_batch
|
||||
gen_per_batch = criticality_ % generations_per_batch
|
||||
end if
|
||||
|
||||
! Check number of active batches
|
||||
if (n_active <= 0) then
|
||||
message = "Number of active batches must be greater than 0."
|
||||
! Fixed source calculation information
|
||||
if (fixed_source_ % batches > 0) then
|
||||
! Set run mode
|
||||
if (run_mode /= MODE_PLOTTING) run_mode = MODE_FIXEDSOURCE
|
||||
|
||||
! Check number of particles
|
||||
if (len_trim(fixed_source_ % particles) == 0) then
|
||||
message = "Need to specify number of particles per cycles."
|
||||
call fatal_error()
|
||||
end if
|
||||
else
|
||||
message = "Need to specify number of batches with <batches> tag."
|
||||
|
||||
! 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(fixed_source_ % particles)
|
||||
|
||||
! Copy batch information
|
||||
n_batches = fixed_source_ % batches
|
||||
n_active = fixed_source_ % batches
|
||||
end if
|
||||
|
||||
! Check number of active batches
|
||||
if (n_active <= 0) then
|
||||
message = "Number of active batches must be greater than 0."
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<options rootname="settings" />
|
||||
|
||||
<typedef name="criticality_xml">
|
||||
<typedef name="run_parameters_xml">
|
||||
<component name="batches" type="integer" default="0" />
|
||||
<component name="inactive" type="integer" />
|
||||
<component name="particles" type="word" length="25" default="''" />
|
||||
|
|
@ -35,11 +35,12 @@
|
|||
<component name="upper_right" type="double-array" />
|
||||
</typedef>
|
||||
|
||||
<variable name="criticality" type="criticality_xml" />
|
||||
<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="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" />
|
||||
<variable name="no_reduce_" tag="no_reduce" type="word" length="3" />
|
||||
<variable name="ptables_" tag="ptables" type="word" length="3" />
|
||||
<variable name="seed_" tag="seed" type="integer" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue