mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Added first stub for fixed source calculation.
This commit is contained in:
parent
85a60e2390
commit
7b367dd858
5 changed files with 99 additions and 7 deletions
|
|
@ -61,6 +61,15 @@ fission.o: global.o
|
|||
fission.o: interpolation.o
|
||||
fission.o: search.o
|
||||
|
||||
fixed_source.o: constants.o
|
||||
fixed_source.o: global.o
|
||||
fixed_source.o: output.o
|
||||
fixed_source.o: physics.o
|
||||
fixed_source.o: source.o
|
||||
fixed_source.o: string.o
|
||||
fixed_source.o: tally.o
|
||||
fixed_source.o: timing.o
|
||||
|
||||
geometry.o: constants.o
|
||||
geometry.o: datatypes.o
|
||||
geometry.o: error.o
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ energy_grid.o \
|
|||
error.o \
|
||||
finalize.o \
|
||||
fission.o \
|
||||
fixed_source.o \
|
||||
geometry.o \
|
||||
geometry_header.o \
|
||||
global.o \
|
||||
|
|
|
|||
79
src/fixed_source.F90
Normal file
79
src/fixed_source.F90
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
module fixed_source
|
||||
|
||||
use constants, only: ZERO
|
||||
use global
|
||||
use output, only: write_message, header
|
||||
use physics, only: transport
|
||||
use source, only: get_source_particle
|
||||
use string, only: to_str
|
||||
use tally, only: synchronize_tallies
|
||||
use timing, only: timer_start, timer_stop
|
||||
|
||||
contains
|
||||
|
||||
subroutine run_fixedsource()
|
||||
|
||||
integer(8) :: i ! index over histories in single cycle
|
||||
|
||||
if (master) call header("BEGIN SIMULATION", level=1)
|
||||
|
||||
tallies_on = .true.
|
||||
call timer_start(time_inactive)
|
||||
|
||||
! Allocate particle
|
||||
allocate(p)
|
||||
|
||||
! ==========================================================================
|
||||
! LOOP OVER BATCHES
|
||||
BATCH_LOOP: do current_batch = 1, n_batches
|
||||
|
||||
call initialize_batch()
|
||||
|
||||
! Start timer for transport
|
||||
call timer_start(time_transport)
|
||||
|
||||
! =======================================================================
|
||||
! LOOP OVER PARTICLES
|
||||
PARTICLE_LOOP: do i = 1, work
|
||||
|
||||
! grab source particle from bank
|
||||
call get_source_particle(i)
|
||||
|
||||
! transport particle
|
||||
call transport()
|
||||
|
||||
end do PARTICLE_LOOP
|
||||
|
||||
! Accumulate time for transport
|
||||
call timer_stop(time_transport)
|
||||
|
||||
call timer_start(time_ic_tallies)
|
||||
call synchronize_tallies()
|
||||
call timer_stop(time_ic_tallies)
|
||||
|
||||
end do BATCH_LOOP
|
||||
|
||||
call timer_stop(time_active)
|
||||
|
||||
! ==========================================================================
|
||||
! END OF RUN WRAPUP
|
||||
|
||||
if (master) call header("SIMULATION FINISHED", level=1)
|
||||
|
||||
end subroutine run_fixedsource
|
||||
|
||||
!===============================================================================
|
||||
! INITIALIZE_BATCH
|
||||
!===============================================================================
|
||||
|
||||
subroutine initialize_batch()
|
||||
|
||||
message = "Simulating batch " // trim(to_str(current_batch)) // "..."
|
||||
call write_message()
|
||||
|
||||
! Reset total starting particle weight used for normalizing tallies
|
||||
total_weight = ZERO
|
||||
|
||||
end subroutine initialize_batch
|
||||
|
||||
end module fixed_source
|
||||
|
|
@ -116,7 +116,7 @@ contains
|
|||
call create_tally_map()
|
||||
|
||||
! allocate banks and create source particles
|
||||
call allocate_banks()
|
||||
if (run_mode == MODE_CRITICALITY) call allocate_banks()
|
||||
call initialize_source()
|
||||
end if
|
||||
|
||||
|
|
|
|||
15
src/main.F90
15
src/main.F90
|
|
@ -1,11 +1,12 @@
|
|||
program main
|
||||
|
||||
use constants, only: MODE_CRITICALITY, MODE_PLOTTING
|
||||
use criticality, only: run_criticality
|
||||
use finalize, only: finalize_run
|
||||
use global, only: run_mode
|
||||
use initialize, only: initialize_run
|
||||
use plotter, only: run_plot
|
||||
use constants, only: MODE_CRITICALITY, MODE_PLOTTING, MODE_FIXEDSOURCE
|
||||
use criticality, only: run_criticality
|
||||
use finalize, only: finalize_run
|
||||
use fixed_source, only: run_fixedsource
|
||||
use global, only: run_mode
|
||||
use initialize, only: initialize_run
|
||||
use plotter, only: run_plot
|
||||
|
||||
implicit none
|
||||
|
||||
|
|
@ -14,6 +15,8 @@ program main
|
|||
|
||||
! start problem based on mode
|
||||
select case (run_mode)
|
||||
case (MODE_FIXEDSOURCE)
|
||||
call run_fixedsource()
|
||||
case (MODE_CRITICALITY)
|
||||
call run_criticality()
|
||||
case (MODE_PLOTTING)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue