mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
03c7f8b4b4
14 changed files with 161 additions and 105 deletions
|
|
@ -116,9 +116,9 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
|
|||
endif()
|
||||
|
||||
# GCC compiler options
|
||||
list(APPEND f90flags -cpp -std=f2008ts -fbacktrace -O2)
|
||||
list(APPEND f90flags -cpp -std=f2008ts -fbacktrace -O2 -fstack-arrays)
|
||||
if(debug)
|
||||
list(REMOVE_ITEM f90flags -O2)
|
||||
list(REMOVE_ITEM f90flags -O2 -fstack-arrays)
|
||||
list(APPEND f90flags -g -Wall -Wno-unused-dummy-argument -pedantic
|
||||
-fbounds-check -ffpe-trap=invalid,overflow,underflow)
|
||||
list(APPEND ldflags -g)
|
||||
|
|
|
|||
|
|
@ -15,18 +15,22 @@ def _run(args, output, cwd):
|
|||
stderr=subprocess.STDOUT, universal_newlines=True)
|
||||
|
||||
# Capture and re-print OpenMC output in real-time
|
||||
lines = []
|
||||
while True:
|
||||
# If OpenMC is finished, break loop
|
||||
line = p.stdout.readline()
|
||||
if not line and p.poll() is not None:
|
||||
break
|
||||
|
||||
lines.append(line)
|
||||
if output:
|
||||
# If user requested output, print to screen
|
||||
print(line, end='')
|
||||
|
||||
# Return the returncode (integer, zero if no problems encountered)
|
||||
return p.returncode
|
||||
# Raise an exception if return status is non-zero
|
||||
if p.returncode != 0:
|
||||
raise subprocess.CalledProcessError(p.returncode, ' '.join(args),
|
||||
''.join(lines))
|
||||
|
||||
|
||||
def plot_geometry(output=True, openmc_exec='openmc', cwd='.'):
|
||||
|
|
@ -41,8 +45,13 @@ def plot_geometry(output=True, openmc_exec='openmc', cwd='.'):
|
|||
cwd : str, optional
|
||||
Path to working directory to run in
|
||||
|
||||
Raises
|
||||
------
|
||||
subprocess.CalledProcessError
|
||||
If the `openmc` executable returns a non-zero status
|
||||
|
||||
"""
|
||||
return _run([openmc_exec, '-p'], output, cwd)
|
||||
_run([openmc_exec, '-p'], output, cwd)
|
||||
|
||||
|
||||
def plot_inline(plots, openmc_exec='openmc', cwd='.', convert_exec='convert'):
|
||||
|
|
@ -63,6 +72,11 @@ def plot_inline(plots, openmc_exec='openmc', cwd='.', convert_exec='convert'):
|
|||
convert_exec : str, optional
|
||||
Command that can convert PPM files into PNG files
|
||||
|
||||
Raises
|
||||
------
|
||||
subprocess.CalledProcessError
|
||||
If the `openmc` executable returns a non-zero status
|
||||
|
||||
"""
|
||||
from IPython.display import Image, display
|
||||
|
||||
|
|
@ -121,6 +135,11 @@ def calculate_volumes(threads=None, output=True, cwd='.',
|
|||
Path to working directory to run in. Defaults to the current working
|
||||
directory.
|
||||
|
||||
Raises
|
||||
------
|
||||
subprocess.CalledProcessError
|
||||
If the `openmc` executable returns a non-zero status
|
||||
|
||||
See Also
|
||||
--------
|
||||
openmc.VolumeCalculation
|
||||
|
|
@ -133,7 +152,7 @@ def calculate_volumes(threads=None, output=True, cwd='.',
|
|||
if mpi_args is not None:
|
||||
args = mpi_args + args
|
||||
|
||||
return _run(args, output, cwd)
|
||||
_run(args, output, cwd)
|
||||
|
||||
|
||||
def run(particles=None, threads=None, geometry_debug=False,
|
||||
|
|
@ -167,8 +186,12 @@ def run(particles=None, threads=None, geometry_debug=False,
|
|||
MPI execute command and any additional MPI arguments to pass,
|
||||
e.g. ['mpiexec', '-n', '8'].
|
||||
|
||||
"""
|
||||
Raises
|
||||
------
|
||||
subprocess.CalledProcessError
|
||||
If the `openmc` executable returns a non-zero status
|
||||
|
||||
"""
|
||||
args = [openmc_exec]
|
||||
|
||||
if isinstance(particles, Integral) and particles > 0:
|
||||
|
|
@ -189,4 +212,4 @@ def run(particles=None, threads=None, geometry_debug=False,
|
|||
if mpi_args is not None:
|
||||
args = mpi_args + args
|
||||
|
||||
return _run(args, output, cwd)
|
||||
_run(args, output, cwd)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ contains
|
|||
|
||||
! Set all material macroscopic cross sections to zero
|
||||
material_xs % total = ZERO
|
||||
material_xs % elastic = ZERO
|
||||
material_xs % absorption = ZERO
|
||||
material_xs % fission = ZERO
|
||||
material_xs % nu_fission = ZERO
|
||||
|
|
@ -115,10 +114,6 @@ contains
|
|||
material_xs % total = material_xs % total + &
|
||||
atom_density * micro_xs(i_nuclide) % total
|
||||
|
||||
! Add contributions to material macroscopic scattering cross section
|
||||
material_xs % elastic = material_xs % elastic + &
|
||||
atom_density * micro_xs(i_nuclide) % elastic
|
||||
|
||||
! Add contributions to material macroscopic absorption cross section
|
||||
material_xs % absorption = material_xs % absorption + &
|
||||
atom_density * micro_xs(i_nuclide) % absorption
|
||||
|
|
@ -162,6 +157,7 @@ contains
|
|||
real(8) :: sig_t, sig_a, sig_f ! Intermediate multipole variables
|
||||
|
||||
! Initialize cached cross sections to zero
|
||||
micro_xs(i_nuclide) % elastic = CACHE_INVALID
|
||||
micro_xs(i_nuclide) % thermal = ZERO
|
||||
micro_xs(i_nuclide) % thermal_elastic = ZERO
|
||||
|
||||
|
|
@ -182,13 +178,11 @@ contains
|
|||
|
||||
micro_xs(i_nuclide) % total = sig_t
|
||||
micro_xs(i_nuclide) % absorption = sig_a
|
||||
micro_xs(i_nuclide) % elastic = sig_t - sig_a
|
||||
micro_xs(i_nuclide) % fission = sig_f
|
||||
|
||||
if (nuc % fissionable) then
|
||||
micro_xs(i_nuclide) % fission = sig_f
|
||||
micro_xs(i_nuclide) % nu_fission = sig_f * nuc % nu(E, EMISSION_TOTAL)
|
||||
else
|
||||
micro_xs(i_nuclide) % fission = ZERO
|
||||
micro_xs(i_nuclide) % nu_fission = ZERO
|
||||
end if
|
||||
|
||||
|
|
@ -233,7 +227,7 @@ contains
|
|||
if (f > prn()) i_temp = i_temp + 1
|
||||
end select
|
||||
|
||||
associate (grid => nuc % grid(i_temp), xs => nuc % sum_xs(i_temp))
|
||||
associate (grid => nuc % grid(i_temp), xs => nuc % xs(i_temp))
|
||||
! Determine the energy grid index using a logarithmic mapping to
|
||||
! reduce the energy range over which a binary search needs to be
|
||||
! performed
|
||||
|
|
@ -266,25 +260,21 @@ contains
|
|||
micro_xs(i_nuclide) % interp_factor = f
|
||||
|
||||
! Calculate microscopic nuclide total cross section
|
||||
micro_xs(i_nuclide) % total = (ONE - f) * xs % total(i_grid) &
|
||||
+ f * xs % total(i_grid + 1)
|
||||
|
||||
! Calculate microscopic nuclide elastic cross section
|
||||
micro_xs(i_nuclide) % elastic = (ONE - f) * xs % elastic(i_grid) &
|
||||
+ f * xs % elastic(i_grid + 1)
|
||||
micro_xs(i_nuclide) % total = (ONE - f) * xs % value(XS_TOTAL,i_grid) &
|
||||
+ f * xs % value(XS_TOTAL,i_grid + 1)
|
||||
|
||||
! Calculate microscopic nuclide absorption cross section
|
||||
micro_xs(i_nuclide) % absorption = (ONE - f) * xs % absorption( &
|
||||
i_grid) + f * xs % absorption(i_grid + 1)
|
||||
micro_xs(i_nuclide) % absorption = (ONE - f) * xs % value(XS_ABSORPTION, &
|
||||
i_grid) + f * xs % value(XS_ABSORPTION,i_grid + 1)
|
||||
|
||||
if (nuc % fissionable) then
|
||||
! Calculate microscopic nuclide total cross section
|
||||
micro_xs(i_nuclide) % fission = (ONE - f) * xs % fission(i_grid) &
|
||||
+ f * xs % fission(i_grid + 1)
|
||||
micro_xs(i_nuclide) % fission = (ONE - f) * xs % value(XS_FISSION,i_grid) &
|
||||
+ f * xs % value(XS_FISSION,i_grid + 1)
|
||||
|
||||
! Calculate microscopic nuclide nu-fission cross section
|
||||
micro_xs(i_nuclide) % nu_fission = (ONE - f) * xs % nu_fission( &
|
||||
i_grid) + f * xs % nu_fission(i_grid + 1)
|
||||
micro_xs(i_nuclide) % nu_fission = (ONE - f) * xs % value(XS_NU_FISSION, &
|
||||
i_grid) + f * xs % value(XS_NU_FISSION,i_grid + 1)
|
||||
else
|
||||
micro_xs(i_nuclide) % fission = ZERO
|
||||
micro_xs(i_nuclide) % nu_fission = ZERO
|
||||
|
|
@ -451,6 +441,9 @@ contains
|
|||
micro_xs(i_nuclide) % thermal = sab_frac * (elastic + inelastic)
|
||||
micro_xs(i_nuclide) % thermal_elastic = sab_frac * elastic
|
||||
|
||||
! Calculate free atom elastic cross section
|
||||
call calculate_elastic_xs(i_nuclide)
|
||||
|
||||
! Correct total and elastic cross sections
|
||||
micro_xs(i_nuclide) % total = micro_xs(i_nuclide) % total &
|
||||
+ micro_xs(i_nuclide) % thermal &
|
||||
|
|
@ -579,6 +572,7 @@ contains
|
|||
|
||||
! Multiply by smooth cross-section if needed
|
||||
if (urr % multiply_smooth) then
|
||||
call calculate_elastic_xs(i_nuclide)
|
||||
elastic = elastic * micro_xs(i_nuclide) % elastic
|
||||
capture = capture * (micro_xs(i_nuclide) % absorption - &
|
||||
micro_xs(i_nuclide) % fission)
|
||||
|
|
@ -607,6 +601,36 @@ contains
|
|||
|
||||
end subroutine calculate_urr_xs
|
||||
|
||||
!===============================================================================
|
||||
! CALCULATE_ELASTIC_XS precalculates the free atom elastic scattering cross
|
||||
! section. Normally it is not needed until a collision actually occurs in a
|
||||
! material. However, in the thermal and unresolved resonance regions, we have to
|
||||
! calculate it early to adjust the total cross section correctly.
|
||||
!===============================================================================
|
||||
|
||||
subroutine calculate_elastic_xs(i_nuclide)
|
||||
integer, intent(in) :: i_nuclide
|
||||
|
||||
integer :: i_temp
|
||||
integer :: i_grid
|
||||
real(8) :: f
|
||||
|
||||
! Get temperature index, grid index, and interpolation factor
|
||||
i_temp = micro_xs(i_nuclide) % index_temp
|
||||
i_grid = micro_xs(i_nuclide) % index_grid
|
||||
f = micro_xs(i_nuclide) % interp_factor
|
||||
|
||||
if (i_temp > 0) then
|
||||
associate (xs => nuclides(i_nuclide) % reactions(1) % xs(i_temp) % value)
|
||||
micro_xs(i_nuclide) % elastic = (ONE - f)*xs(i_grid) + f*xs(i_grid + 1)
|
||||
end associate
|
||||
else
|
||||
! For multipole, elastic is total - absorption
|
||||
micro_xs(i_nuclide) % elastic = micro_xs(i_nuclide) % total - &
|
||||
micro_xs(i_nuclide) % absorption
|
||||
end if
|
||||
end subroutine calculate_elastic_xs
|
||||
|
||||
!===============================================================================
|
||||
! MULTIPOLE_EVAL evaluates the windowed multipole equations for cross
|
||||
! sections in the resolved resonance regions
|
||||
|
|
|
|||
|
|
@ -36,13 +36,18 @@ module nuclide_header
|
|||
real(8), allocatable :: energy(:) ! energy values corresponding to xs
|
||||
end type EnergyGrid
|
||||
|
||||
! Positions for first dimension of Nuclide % xs
|
||||
integer, parameter :: &
|
||||
XS_TOTAL = 1, &
|
||||
XS_ABSORPTION = 2, &
|
||||
XS_FISSION = 3, &
|
||||
XS_NU_FISSION = 4
|
||||
|
||||
! The array within SumXS is of shape (4, n_energy) where the first dimension
|
||||
! corresponds to the following values: 1) total, 2) absorption (MT > 100), 3)
|
||||
! fission, 4) neutron production
|
||||
type SumXS
|
||||
real(8), allocatable :: total(:) ! total cross section
|
||||
real(8), allocatable :: elastic(:) ! elastic scattering
|
||||
real(8), allocatable :: fission(:) ! fission
|
||||
real(8), allocatable :: nu_fission(:) ! neutron production
|
||||
real(8), allocatable :: absorption(:) ! absorption (MT > 100)
|
||||
real(8), allocatable :: heating(:) ! heating
|
||||
real(8), allocatable :: value(:,:)
|
||||
end type SumXS
|
||||
|
||||
type :: Nuclide
|
||||
|
|
@ -61,7 +66,7 @@ module nuclide_header
|
|||
type(EnergyGrid), allocatable :: grid(:)
|
||||
|
||||
! Microscopic cross sections
|
||||
type(SumXS), allocatable :: sum_xs(:)
|
||||
type(SumXS), allocatable :: xs(:)
|
||||
|
||||
! Resonance scattering info
|
||||
logical :: resonant = .false. ! resonant scatterer?
|
||||
|
|
@ -110,14 +115,19 @@ module nuclide_header
|
|||
! nuclide at the current energy
|
||||
!===============================================================================
|
||||
|
||||
! Arbitrary value to indicate invalid cache state for elastic scattering
|
||||
! (NuclideMicroXS % elastic)
|
||||
real(8), parameter :: CACHE_INVALID = dble(Z"FFE0000000000000")
|
||||
|
||||
type NuclideMicroXS
|
||||
! Microscopic cross sections in barns
|
||||
real(8) :: total
|
||||
real(8) :: elastic ! If sab_frac is not 1 or 0, then this value is
|
||||
! averaged over bound and non-bound nuclei
|
||||
real(8) :: absorption ! absorption (disappearance)
|
||||
real(8) :: fission ! fission
|
||||
real(8) :: nu_fission ! neutron production from fission
|
||||
|
||||
real(8) :: elastic ! If sab_frac is not 1 or 0, then this value is
|
||||
! averaged over bound and non-bound nuclei
|
||||
real(8) :: thermal ! Bound thermal elastic & inelastic scattering
|
||||
real(8) :: thermal_elastic ! Bound thermal elastic scattering
|
||||
|
||||
|
|
@ -148,7 +158,6 @@ module nuclide_header
|
|||
|
||||
type MaterialMacroXS
|
||||
real(8) :: total ! macroscopic total xs
|
||||
real(8) :: elastic ! macroscopic elastic scattering xs
|
||||
real(8) :: absorption ! macroscopic absorption xs
|
||||
real(8) :: fission ! macroscopic fission xs
|
||||
real(8) :: nu_fission ! macroscopic production xs
|
||||
|
|
@ -566,21 +575,13 @@ contains
|
|||
type(VectorInt) :: MTs
|
||||
|
||||
n_temperature = size(this % kTs)
|
||||
allocate(this % sum_xs(n_temperature))
|
||||
allocate(this % xs(n_temperature))
|
||||
this % reaction_index(:) = 0
|
||||
do i = 1, n_temperature
|
||||
! Allocate and initialize derived cross sections
|
||||
n_grid = size(this % grid(i) % energy)
|
||||
allocate(this % sum_xs(i) % total(n_grid))
|
||||
allocate(this % sum_xs(i) % elastic(n_grid))
|
||||
allocate(this % sum_xs(i) % fission(n_grid))
|
||||
allocate(this % sum_xs(i) % nu_fission(n_grid))
|
||||
allocate(this % sum_xs(i) % absorption(n_grid))
|
||||
this % sum_xs(i) % total(:) = ZERO
|
||||
this % sum_xs(i) % elastic(:) = ZERO
|
||||
this % sum_xs(i) % fission(:) = ZERO
|
||||
this % sum_xs(i) % nu_fission(:) = ZERO
|
||||
this % sum_xs(i) % absorption(:) = ZERO
|
||||
allocate(this % xs(i) % value(4,n_grid))
|
||||
this % xs(i) % value(:,:) = ZERO
|
||||
end do
|
||||
|
||||
i_fission = 0
|
||||
|
|
@ -607,17 +608,14 @@ contains
|
|||
j = rx % xs(t) % threshold
|
||||
n = size(rx % xs(t) % value)
|
||||
|
||||
! Copy elastic
|
||||
if (rx % MT == ELASTIC) this % sum_xs(t) % elastic(:) = rx % xs(t) % value
|
||||
|
||||
! Add contribution to total cross section
|
||||
this % sum_xs(t) % total(j:j+n-1) = this % sum_xs(t) % total(j:j+n-1) + &
|
||||
rx % xs(t) % value
|
||||
this % xs(t) % value(XS_TOTAL,j:j+n-1) = this % xs(t) % &
|
||||
value(XS_TOTAL,j:j+n-1) + rx % xs(t) % value
|
||||
|
||||
! Add contribution to absorption cross section
|
||||
if (is_disappearance(rx % MT)) then
|
||||
this % sum_xs(t) % absorption(j:j+n-1) = this % sum_xs(t) % &
|
||||
absorption(j:j+n-1) + rx % xs(t) % value
|
||||
this % xs(t) % value(XS_ABSORPTION,j:j+n-1) = this % xs(t) % &
|
||||
value(XS_ABSORPTION,j:j+n-1) + rx % xs(t) % value
|
||||
end if
|
||||
|
||||
! Information about fission reactions
|
||||
|
|
@ -633,12 +631,12 @@ contains
|
|||
! Add contribution to fission cross section
|
||||
if (is_fission(rx % MT)) then
|
||||
this % fissionable = .true.
|
||||
this % sum_xs(t) % fission(j:j+n-1) = this % sum_xs(t) % &
|
||||
fission(j:j+n-1) + rx % xs(t) % value
|
||||
this % xs(t) % value(XS_FISSION,j:j+n-1) = this % xs(t) % &
|
||||
value(XS_FISSION,j:j+n-1) + rx % xs(t) % value
|
||||
|
||||
! Also need to add fission cross sections to absorption
|
||||
this % sum_xs(t) % absorption(j:j+n-1) = this % sum_xs(t) % &
|
||||
absorption(j:j+n-1) + rx % xs(t) % value
|
||||
this % xs(t) % value(XS_ABSORPTION,j:j+n-1) = this % xs(t) % &
|
||||
value(XS_ABSORPTION,j:j+n-1) + rx % xs(t) % value
|
||||
|
||||
! If total fission reaction is present, there's no need to store the
|
||||
! reaction cross-section since it was copied to this % fission
|
||||
|
|
@ -689,12 +687,11 @@ contains
|
|||
! Calculate nu-fission cross section
|
||||
do t = 1, n_temperature
|
||||
if (this % fissionable) then
|
||||
do i = 1, size(this % sum_xs(t) % fission)
|
||||
this % sum_xs(t) % nu_fission(i) = this % nu(this % grid(t) % energy(i), &
|
||||
EMISSION_TOTAL) * this % sum_xs(t) % fission(i)
|
||||
do i = 1, n_grid
|
||||
this % xs(t) % value(XS_NU_FISSION,i) = &
|
||||
this % nu(this % grid(t) % energy(i), EMISSION_TOTAL) * &
|
||||
this % xs(t) % value(XS_FISSION,i)
|
||||
end do
|
||||
else
|
||||
this % sum_xs(t) % nu_fission(:) = ZERO
|
||||
end if
|
||||
end do
|
||||
end subroutine nuclide_create_derived
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ module physics
|
|||
|
||||
use algorithm, only: binary_search
|
||||
use constants
|
||||
use cross_section, only: elastic_xs_0K
|
||||
use cross_section, only: elastic_xs_0K, calculate_elastic_xs
|
||||
use endf, only: reaction_name
|
||||
use error, only: fatal_error, warning, write_message
|
||||
use material_header, only: Material, materials
|
||||
|
|
@ -338,6 +338,11 @@ contains
|
|||
micro_xs(i_nuclide) % absorption)
|
||||
sampled = .false.
|
||||
|
||||
! Calculate elastic cross section if it wasn't precalculated
|
||||
if (micro_xs(i_nuclide) % elastic == CACHE_INVALID) then
|
||||
call calculate_elastic_xs(i_nuclide)
|
||||
end if
|
||||
|
||||
prob = micro_xs(i_nuclide) % elastic - micro_xs(i_nuclide) % thermal
|
||||
if (prob > cutoff) then
|
||||
! =======================================================================
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ element settings {
|
|||
|
||||
element confidence_intervals { xsd:boolean }? &
|
||||
|
||||
element create_fission_neutrons { xsd:boolean }? &
|
||||
|
||||
element cutoff {
|
||||
(element weight { xsd:double } | attribute weight { xsd:double })? &
|
||||
(element weight_avg { xsd:double } | attribute weight_avg { xsd:double })?
|
||||
|
|
|
|||
|
|
@ -11,6 +11,11 @@
|
|||
<data type="boolean"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="create_fission_neutrons">
|
||||
<data type="boolean"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="cutoff">
|
||||
<interleave>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module tally
|
|||
|
||||
use algorithm, only: binary_search
|
||||
use constants
|
||||
use cross_section, only: multipole_deriv_eval
|
||||
use cross_section, only: multipole_deriv_eval, calculate_elastic_xs
|
||||
use dict_header, only: EMPTY
|
||||
use error, only: fatal_error
|
||||
use geometry_header
|
||||
|
|
@ -1017,9 +1017,26 @@ contains
|
|||
|
||||
else
|
||||
if (i_nuclide > 0) then
|
||||
if (micro_xs(i_nuclide) % elastic == CACHE_INVALID) then
|
||||
call calculate_elastic_xs(i_nuclide)
|
||||
end if
|
||||
score = micro_xs(i_nuclide) % elastic * atom_density * flux
|
||||
else
|
||||
score = material_xs % elastic * flux
|
||||
score = ZERO
|
||||
if (p % material /= MATERIAL_VOID) then
|
||||
do l = 1, materials(p % material) % n_nuclides
|
||||
! Get atom density
|
||||
atom_density_ = materials(p % material) % atom_density(l)
|
||||
|
||||
! Get index in nuclides array
|
||||
i_nuc = materials(p % material) % nuclide(l)
|
||||
if (micro_xs(i_nuc) % elastic == CACHE_INVALID) then
|
||||
call calculate_elastic_xs(i_nuc)
|
||||
end if
|
||||
|
||||
score = score + micro_xs(i_nuc) % elastic * atom_density_ * flux
|
||||
end do
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ module tracking
|
|||
|
||||
use constants
|
||||
use cross_section, only: calculate_xs
|
||||
use error, only: fatal_error, warning, write_message
|
||||
use error, only: warning, write_message
|
||||
use geometry_header, only: cells
|
||||
use geometry, only: find_cell, distance_to_boundary, cross_lattice, &
|
||||
check_cell_overlap
|
||||
|
|
@ -85,7 +85,9 @@ contains
|
|||
if (p % coord(p % n_coord) % cell == NONE) then
|
||||
call find_cell(p, found_cell)
|
||||
if (.not. found_cell) then
|
||||
call fatal_error("Could not locate particle " // trim(to_str(p % id)))
|
||||
call p % mark_as_lost("Could not find the cell containing" &
|
||||
// " particle " // trim(to_str(p %id)))
|
||||
return
|
||||
end if
|
||||
|
||||
! set birth cell attribute
|
||||
|
|
|
|||
|
|
@ -139,13 +139,10 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
|
||||
if self._opts.mpi_exec is not None:
|
||||
mpi_args = [self._opts.mpi_exec, '-n', self._opts.mpi_np]
|
||||
returncode = openmc.run(openmc_exec=self._opts.exe,
|
||||
mpi_args=mpi_args)
|
||||
openmc.run(openmc_exec=self._opts.exe, mpi_args=mpi_args)
|
||||
|
||||
else:
|
||||
returncode = openmc.run(openmc_exec=self._opts.exe)
|
||||
|
||||
assert returncode == 0, 'OpenMC did not exit successfully.'
|
||||
openmc.run(openmc_exec=self._opts.exe)
|
||||
|
||||
sp = openmc.StatePoint('statepoint.' + str(batches) + '.h5')
|
||||
|
||||
|
|
|
|||
|
|
@ -36,13 +36,9 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
# Initial run
|
||||
if self._opts.mpi_exec is not None:
|
||||
mpi_args = [self._opts.mpi_exec, '-n', self._opts.mpi_np]
|
||||
returncode = openmc.run(openmc_exec=self._opts.exe,
|
||||
mpi_args=mpi_args)
|
||||
openmc.run(openmc_exec=self._opts.exe, mpi_args=mpi_args)
|
||||
else:
|
||||
returncode = openmc.run(openmc_exec=self._opts.exe)
|
||||
|
||||
assert returncode == 0, 'CE OpenMC calculation did not exit' \
|
||||
'successfully.'
|
||||
openmc.run(openmc_exec=self._opts.exe)
|
||||
|
||||
# Build MG Inputs
|
||||
# Get data needed to execute Library calculations.
|
||||
|
|
@ -73,10 +69,9 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
# Re-run MG mode.
|
||||
if self._opts.mpi_exec is not None:
|
||||
mpi_args = [self._opts.mpi_exec, '-n', self._opts.mpi_np]
|
||||
returncode = openmc.run(openmc_exec=self._opts.exe,
|
||||
mpi_args=mpi_args)
|
||||
openmc.run(openmc_exec=self._opts.exe, mpi_args=mpi_args)
|
||||
else:
|
||||
returncode = openmc.run(openmc_exec=self._opts.exe)
|
||||
openmc.run(openmc_exec=self._opts.exe)
|
||||
|
||||
def _cleanup(self):
|
||||
super(MGXSTestHarness, self)._cleanup()
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ class PlotTestHarness(TestHarness):
|
|||
self._plot_names = plot_names
|
||||
|
||||
def _run_openmc(self):
|
||||
returncode = openmc.plot_geometry(openmc_exec=self._opts.exe)
|
||||
assert returncode == 0, 'OpenMC did not exit successfully.'
|
||||
openmc.plot_geometry(openmc_exec=self._opts.exe)
|
||||
|
||||
def _test_output_created(self):
|
||||
"""Make sure *.ppm has been created."""
|
||||
|
|
|
|||
|
|
@ -50,14 +50,10 @@ class StatepointRestartTestHarness(TestHarness):
|
|||
# Run OpenMC
|
||||
if self._opts.mpi_exec is not None:
|
||||
mpi_args = [self._opts.mpi_exec, '-n', self._opts.mpi_np]
|
||||
returncode = openmc.run(restart_file=statepoint,
|
||||
openmc_exec=self._opts.exe,
|
||||
mpi_args=mpi_args)
|
||||
openmc.run(restart_file=statepoint, openmc_exec=self._opts.exe,
|
||||
mpi_args=mpi_args)
|
||||
else:
|
||||
returncode = openmc.run(openmc_exec=self._opts.exe,
|
||||
restart_file=statepoint)
|
||||
|
||||
assert returncode == 0, 'OpenMC did not exit successfully.'
|
||||
openmc.run(openmc_exec=self._opts.exe, restart_file=statepoint)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
|
|
@ -62,14 +62,10 @@ class TestHarness(object):
|
|||
|
||||
def _run_openmc(self):
|
||||
if self._opts.mpi_exec is not None:
|
||||
returncode = openmc.run(
|
||||
openmc_exec=self._opts.exe,
|
||||
mpi_args=[self._opts.mpi_exec, '-n', self._opts.mpi_np])
|
||||
|
||||
openmc.run(openmc_exec=self._opts.exe,
|
||||
mpi_args=[self._opts.mpi_exec, '-n', self._opts.mpi_np])
|
||||
else:
|
||||
returncode = openmc.run(openmc_exec=self._opts.exe)
|
||||
|
||||
assert returncode == 0, 'OpenMC did not exit successfully.'
|
||||
openmc.run(openmc_exec=self._opts.exe)
|
||||
|
||||
def _test_output_created(self):
|
||||
"""Make sure statepoint.* and tallies.out have been created."""
|
||||
|
|
@ -189,13 +185,11 @@ class ParticleRestartTestHarness(TestHarness):
|
|||
args['mpi_args'] = [self._opts.mpi_exec, '-n', self._opts.mpi_np]
|
||||
|
||||
# Initial run
|
||||
returncode = openmc.run(**args)
|
||||
assert returncode == 0, 'OpenMC did not exit successfully.'
|
||||
openmc.run(**args)
|
||||
|
||||
# Run particle restart
|
||||
args.update({'restart_file': self._sp_name})
|
||||
returncode = openmc.run(**args)
|
||||
assert returncode == 0, 'OpenMC did not exit successfully.'
|
||||
openmc.run(**args)
|
||||
|
||||
def _test_output_created(self):
|
||||
"""Make sure the restart file has been created."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue