Difference between revisions of "Pitfalls and troubleshooting"

From Serpent Wiki
Jump to: navigation, search
(Mass vs. atomic densities)
(Root universe)
 
(58 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
The first class of errors are (ideally) related to a problem in the input file. It should be noted, however, that the parameter name and line number may not reflect the original cause of the error, but rather the point where things started going wrong. Incorrectly typed input card names, for example, cause the parser to ignore the card altogether, and the following values are interpreted as entries belonging to the previous card.
 
The first class of errors are (ideally) related to a problem in the input file. It should be noted, however, that the parameter name and line number may not reflect the original cause of the error, but rather the point where things started going wrong. Incorrectly typed input card names, for example, cause the parser to ignore the card altogether, and the following values are interpreted as entries belonging to the previous card.
  
Run-time errors should not occur, and they should always be reported to the developer team. This is also the case if the calculation crashes (segmentation fault or similar). In such case repeating the calculation in [[debug mode]] may reveal some additional information on what went wrong.
+
Run-time errors should not occur, and they should always be reported to the developer team. This is also the case if the calculation crashes (segmentation fault or similar). In such case repeating the calculation in [[Installing_and_running_Serpent#Debug_mode|debug mode]] may reveal some additional information on what went wrong.
  
 
Serpent also produces a number of warning messages that may or may not be important. The code is pretty meticulous about errors, so problems let off with a warning are usually not too severe.
 
Serpent also produces a number of warning messages that may or may not be important. The code is pretty meticulous about errors, so problems let off with a warning are usually not too severe.
 
  
 
== Things to check in case of suspicious results ==
 
== Things to check in case of suspicious results ==
Line 15: Line 14:
 
=== Material volumes ===
 
=== Material volumes ===
  
Material volumes are not necessarily needed for most transport simulations, but they do affect the results of burnup calculation. Serpent prints an error message if the volume of an irradiated material is not available. The most typical error related to volumes is that the code attempts to calculate the volumes of two-dimensional pin-structures automatically, but for some reason this calculation produces incorrect results. This happens, for example, when:
+
Material volumes are not necessarily needed for most transport simulations, but they do affect the results of burnup calculation. Serpent prints an error message if the volume of an irradiated material is not available.
 +
 
 +
It is important to note, however, that these problems may also occur even if an error message is not printed. The most typical case is that the code attempts to calculate the volumes of two-dimensional pin-structures automatically, but for some reason this calculation produces incorrect results. This happens, for example, when:
 
*The geometry has axial dimension (3D geometry is assumed to be 2D)
 
*The geometry has axial dimension (3D geometry is assumed to be 2D)
 
*Some parts of the fuel pins are located outside the geometry (pins are clipped by cell, universe or geometry boundary)
 
*Some parts of the fuel pins are located outside the geometry (pins are clipped by cell, universe or geometry boundary)
Line 21: Line 22:
 
Serpent cannot identify these problems, so no error message is printed.
 
Serpent cannot identify these problems, so no error message is printed.
  
Material volumes should always be checked using the [[Monte Carlo based volume checker routine]] before running the calculation. If the values are incorrect, or the calculation produces an error message on missing values, the volumes must be set [[Defining material volumes|manually]].
+
Material volumes should always be checked using the [[Installing and running Serpent#Monte Carlo volume calculation routine|Monte Carlo based volume checker routine]] before running the calculation. If the values are incorrect, or the calculation produces an error message on missing values, the volumes must be set [[Defining material volumes|manually]].
  
 
=== Unresolved resonance probability table sampling ===
 
=== Unresolved resonance probability table sampling ===
  
Unresolved resonance probability table sampling is not used by default. This method is needed to account for self-shielding effects in the unresolved resonance region. The effect is usually not significant in thermal systems, but can lead to noticeable discrepancies in fast-spectrum systems.  
+
Unresolved resonance probability table sampling ([[Input syntax manual#set ures|set ures]] option) is not used by default. This method is needed to account for self-shielding effects in the unresolved resonance region. The effect is usually not significant in thermal systems, but can lead to noticeable discrepancies in fast-spectrum systems. Leaving this option out of the calculation may explain differences between [[Input_syntax_manual#set_gcu|group constants]] calculated with other programs.  
 
+
Probability table sampling is switched on using the [[Input syntax manual#set ures|set ures]] option.
+
  
 
The methodology for probability table sampling is not complete (as of version 2.1.25), and some nuclides contain data that cannot be processed by Serpent. In such case, a warning message is printed and smooth infinite-dilute cross sections are used instead. This is typical for natural elements, and may cause small discrepancies in results, e.g. when compared to MCNP.
 
The methodology for probability table sampling is not complete (as of version 2.1.25), and some nuclides contain data that cannot be processed by Serpent. In such case, a warning message is printed and smooth infinite-dilute cross sections are used instead. This is typical for natural elements, and may cause small discrepancies in results, e.g. when compared to MCNP.
Line 37: Line 36:
 
In particular, using incorrect units for isotopes in water causes a major distortion in the flux spectrum in LWR calculations. In burnup calculation this results in completely unexpected depletion rate of <sup>235</sup>U and build-up rate of <sup>239</sup>Pu.
 
In particular, using incorrect units for isotopes in water causes a major distortion in the flux spectrum in LWR calculations. In burnup calculation this results in completely unexpected depletion rate of <sup>235</sup>U and build-up rate of <sup>239</sup>Pu.
  
The material and nuclide densities used in the calculation can be checked from the [[Description of output files#Nuclide and material data|nuclide and material output file]] ([input].out).
+
The material and nuclide densities used in the calculation can be checked from the [[Description of output files#Nuclide and material data|nuclide and material output file]] (<tt>[input].out</tt>).
  
 
=== MPI parallelization without MPI mode ===
 
=== MPI parallelization without MPI mode ===
  
MPI scripts such as mpirun allow running Serpent even if the source code was not [[complied in MPI mode]]. Instead of starting a single parallel simulation, the result is multiple independent simulations that read and write the same input and output files. If two or more writing operations happen to overlap, identical sections are repeated in the output files. If the tasks are sufficiently off-sync, the writing operations do not overlap, and it may actually seem like everything is OK - the correct number of CPU's are working and the results look reasonable. The only thing that seems to be wrong is that the running time does not reflect the speed-up expected from the parallelization.
+
MPI scripts such as mpirun allow running Serpent even if the source code was not [[Installing_and_running_Serpent#Parallel_calculation_using_MPI|compiled in MPI mode]]. Instead of starting a single parallel simulation, the result is multiple independent simulations that read and write the same input and output files. If two or more writing operations happen to overlap, identical sections are repeated in the output files. If the tasks are sufficiently off-sync, the writing operations do not overlap, and it may actually seem like everything is OK - the correct number of CPU's are working and the results look reasonable. The only thing that seems to be wrong is that the running time does not reflect the speed-up expected from the parallelization.
  
When MPI parallelization is executed correctly, the run-time output shows the number of mpi tasks, for example (MPI=10). The number of tasks is also printed in variable <nowiki>MPI_TASKS</nowiki> in the [[main output file]].
+
When MPI parallelization is executed correctly, the run-time output shows the number of mpi tasks, for example (MPI=10). The number of tasks is also printed in variable <nowiki>MPI_TASKS</nowiki> in the [[Description of output files#default output files|main output file]] (<tt>[input]_res.m</tt>).
 
Whether the source code was compiled in MPI mode or not can be checked with <nowiki>sss2 -version</nowiki>.
 
Whether the source code was compiled in MPI mode or not can be checked with <nowiki>sss2 -version</nowiki>.
  
 
=== Unable to start or maintain criticality source simulation ===
 
=== Unable to start or maintain criticality source simulation ===
  
Criticality source simulation requires an initial guess for the fission source distribution. If no [[Input syntax manual#src (source definition)|source definition]] is provided, Serpent samples source points uniformly throughout all fissile materials, i.e. materials with fissile isotopes. This creates two potential problems:
+
Criticality source simulation requires an initial guess for the fission source distribution. If no [[Input syntax manual#src (source definition)|source definition]] is provided, Serpent samples source points uniformly throughout all fissile materials, i.e. materials with fissile isotopes. This creates a few potential problems:
# If the fissile material covers only a small volume of the total geometry, the sampling of the initial source may fail completely.
+
# If the fissile zone covers only a small volume of the total geometry, the efficiency of the source sampling routine becomes extremely poor. If the population size is large, the code may be stuck in the source sampling routine for a very long time, or the sampling of the initial source may fail completely.
# If the geometry contains both active and inactive fissile zones (e.g. seed and blanket), the calculation may fail after the first generation because the majority of source points are placed in the inactive zone.
+
# If the geometry contains both very active and inactive fissile zones (e.g. seed and blanket), the calculation may fail after the first generation because the majority of source points are placed in the inactive zone.
  
The solution to both problems is to use explicit source definition that puts sufficient number of points in the active parts of the fuel. It should be noted that the use of an explicit source definition does not affect the results of the simulations, provided that the fission source is allowed to converge by skipping a sufficient number of inactive neutron generations.
+
The solution to both problems is to use an explicit source definition that puts a sufficient number of points in the active parts of the fuel. This is most conveniently done using the [[Input syntax manual#src_sx|sx, sy, and sz]] or the [[Input syntax manual#src_srad|srad and sz]] parameters of the source card. It should be noted that the use of an explicit source definition does not affect the results of the simulations, provided that the fission source is allowed to converge by skipping a sufficient number of inactive neutron generations.
  
 
=== Low production rate of higher actinides in burnup calculation ===
 
=== Low production rate of higher actinides in burnup calculation ===
Line 58: Line 57:
 
Serpent forms the transmutation paths for burnup calculation automatically, starting from the initial composition defined in the material input. To avoid including everything available, the procedure applies a cut-off that after a certain chain length discards all neutron reactions. The result is that some higher actinides, in particular berkelium and californium isotopes, are not produced through all possible chains, and some isotopes may not be included in the calculation at all.
 
Serpent forms the transmutation paths for burnup calculation automatically, starting from the initial composition defined in the material input. To avoid including everything available, the procedure applies a cut-off that after a certain chain length discards all neutron reactions. The result is that some higher actinides, in particular berkelium and californium isotopes, are not produced through all possible chains, and some isotopes may not be included in the calculation at all.
  
Discarding these higher actinides should have a negligible effect on the results of the calculation, but in some cases their concentrations are of particular interest. The transmutation chains can be extended further by adding nuclides at zero concentration in the material compositions. Including isotopes <sup>240</sup>Cm to <sup>250</sup>Cm, <sup>247</sup>Bk to <sup>250</sup>Bk and <sup>249</sup>Cf to <sup>254</sup>Cf Should force Serpent to include the necessary data for the high end of the actinide transmutation chains.
+
Discarding these higher actinides should have a negligible effect on the results of the calculation, but in some cases their concentrations are of particular interest. The transmutation chains can be extended further by adding nuclides at zero concentration in the material compositions. Including isotopes <sup>240</sup>Cm to <sup>250</sup>Cm, <sup>247</sup>Bk to <sup>250</sup>Bk and <sup>249</sup>Cf to <sup>254</sup>Cf should force Serpent to include the necessary data for the high end of the actinide transmutation chains.
 +
 
 +
=== Isomeric branching ratios ===
 +
 
 +
The production of metastable nuclides in burnup calculation requires isomeric branching ratio data. This data is one of the major sources of uncertainty as well as differences between burnup calculation codes. Serpent uses [[Default isomeric branching ratios|default constant values]] and provides options to apply [[Input syntax manual#set isobra|user-defined constant values]] as well as [[Input syntax manual#set bralib|energy-dependent ratios]] read from ENDF format data files.
 +
 
 +
=== Boundary conditions ===
 +
 
 +
Serpent handles reflective and periodic boundary conditions different from other Monte Carlo codes. Instead of stopping the particle at the boundary surface, reflections and translations are handled by coordinate transformations. This poses some limitations to how repeated boundary conditions can be used. For more information, see detailed description on [[Boundary conditions]].
 +
 
 +
In case using vacuum (black) boundary conditions, it is necessary for the outer surface defining an outside cell to be non-re-entrant (convex) due to the use of delta-tracking. Delta-tracking might miss the boundary conditions in case of a re-entrant (concave) outer surface. See also [[Input_syntax_manual#cell_.28cell_definition.29|cell definition]].
 +
 
 +
=== Replicating zero importance regions ===
 +
 
 +
MCNP and other Monte Carlo codes have the option to define cells with zero importance, which means that all particles entering the zone are immediately killed. This is basically equivalent with the "outside" type cells in Serpent. Because of [[delta- and surface-tracking|delta-tracking]], however, the particle has some probability to pass through such zone without encountering any virtual collisions, which means that the particle history is not killed either. For this reason the geometry should always be defined in such way that the boundary with outside cells is non-re-entrant. This also means that outside cells should not be used inside the geometry. In case this cannot be avoided, the use of delta-tracking should be switched off ([[input syntax manual#set dt|set dt]] 0).
 +
 
 +
=== Photon production in coupled neutron/photon transport calculations ===
 +
 
 +
Coupled neutron/photon transport mode is still a relatively new feature in Serpent 2 (implemented in version 2.1.29). Based on some preliminary test calculations it seems that the production rate of secondary photons varies significantly depending on which neutron transport cross sections are used in the calculation. The differences in photon reaction rates may consequently increase to tens of percent. Serpent prints out the nuclides for which secondary photon production cross sections are available. It should be noted that if the data is missing for some significant isotopes, the results will be correspondingly under-estimated.
 +
 
 +
Photon production was not considered when the current cross section libraries were prepared for Serpent. Therefore it may be necessary to use some other data source (e.g. MCNP libraries) to obtain accurate results for coupled neutron/photon transport calculations.
 +
 
 +
=== Detector volumes ===
 +
 
 +
All cell detectors are integrated over volume, and surface detectors over surface area. The results are divided by volume/area, but the divisor is by default set to 1.0. This can be changed using the [[Input_syntax_manual#det_dv|dv]] entry of the detector card if (bin-)detector volume is constant. Some other codes, in particular MCNP, calculate this volume automatically, or if not possible, require the user to enter a value.
 +
 
 +
=== Normalization with variance reduction ===
 +
 
 +
By default, in neutron transport calculations, Serpent normalizes all reaction rates to unit total loss rate (absorption + leak). This loss rate may not be preserved when weight-window based variance reduction is use, which means that tally results will not match a calculation run without weight windows. It is therefore important to fix the normalization to source, [[Input syntax manual#set srcrate|set srcrate]] option, instead of loss rate when using weight windows.
 +
 
 +
=== Discontinuity factor calculation with universe symmetries ===
 +
 
 +
If a discontinuity factor calculation surface is in the same position as a reflective universe symmetry boundary with actual symmetry transformations, the heterogeneous surface fluxes and incoming and outgoing partial currents will be erroneously zero.
 +
 
 +
=== Geometry boundaries ===
 +
 
 +
The geometry is not checked for overlaps. If [[Input_syntax_manual#plot|geomety plotter]] is used, the overlaps are checked for the plotted area. However, if for example the geometry is bounded by outside region coincident with the plotter area, overlaps with the outside area are not checked. In this case, for example if the outermost part of the actual geometry is by mistake infinite, or does not have a boundary coincident with the outside area, the [[Input_syntax_manual#set_bc|boundary conditions]] may not be correctly used. This may for example cause zero leakage in the results even if black boundary conditions are used. Overlaps in the outside regions may be checked by including geometry plots with minimum and maximum coordinates extending in the outside region instead of using the default limits.
 +
 
 +
=== Doppler broadening rejection correction ===
 +
 
 +
Serpent does not apply Doppler broadening rejection correction (DBRC) ([[Input_syntax_manual#set_dbrc|set dbrc]] input card) by default. Leaving this option out of the calculation may explain differences between [[Input_syntax_manual#set_gcu|group constants]] calculated with other programs.
 +
 
 +
=== Thermal scattering data ===
 +
 
 +
Serpent does not use S(&alpha; &beta;) data  ([[Input_syntax_manual#therm_and_thermstoch_.28thermal_scattering.29|therm]] input card) by default. Leaving this option out of the calculation may explain differences between [[Input_syntax_manual#set_gcu|group constants]] calculated with other programs.
 +
 
 +
=== Super-imposed group constant universes ===
 +
 
 +
Super-imposed [[input syntax manual#set gcu|group constant generation universes]] (i.e. not part of the geometry definition) should not be used so that they cover (partly or totally) the same geometry region as some other group constant generation universe (super-imposed or part of the geometry definition), if group constants are generated only on a single geometry level. This will lead to the group constants being scored on only one of the universes.
 +
 
 +
=== Material definitions in light water reactor pin geometries ===
 +
 
 +
Fuel pins in light water reactors generally contain helium (possibly modeled with void) inside fuel cladding, i.e. between the fuel cladding and fuel pellet and inside a possible center hole.
 +
 
 +
Empty control rod guide tubes in light water reactors generally contain water, and not void.
 +
 
 +
=== Root universe ===
 +
 
 +
Serpent geometry constructor is built on a universe-based formulation (see a detailed description of the [[universe-based geometry type in Serpent]]). The root universe is the universe at the lowest level of the geometry hierarchy.
 +
Whether using the default descriptor "0" or a user-defined one via the [[Input syntax manual#set root|set root]] input option, the root universe always has to be defined, embedding the whole geometry.
 +
A mischaracterization of the root universe might lead to an incorrect geometry definition.
  
 
== Debugging the input model ==
 
== Debugging the input model ==
 +
 +
=== Error and warning messages ===
 +
 +
Serpent prints out two types of error and two types of warning messages. Input errors, such as:
 +
 +
<nowiki>
 +
***** Thu Feb 25 14:53:56 2016
 +
 +
Input error in parameter "cell" on line 8 in file "geometry.inp":
 +
 +
Surface s1 is not defined</nowiki>
 +
indicate that there is some identified problem in the input model, and it is up to the user to fix it. The message is often (but not always) accompanied by the name of an input parameter, and the file name and line number where this parameter was defined. Potential problems that do not require immediate termination of the calculation are notified with a warning message, such as:
 +
 +
<nowiki>
 +
***** Warning: Nest FUE1 is not used in geometry</nowiki>
 +
 +
These warnings may or may not be related to actual problems, and they can often be ignored.
 +
 +
Fatal errors in the calculation routines produce messages of type:
 +
 +
<nowiki>
 +
***** Thu Feb 25 15:05:16 2016:
 +
 +
- MPI task        = 0
 +
- OpenMP thread    = 0
 +
- RNG parent seed  = 1456405516
 +
 +
Fatal error in function LevelScattering:
 +
 +
Now, I am become Death, the destroyer of worlds!
 +
 +
Simulation aborted.</nowiki>
 +
 +
In addition to an ominous (and often unintelligible) error message, the code prints the name of a subroutine and some additional debug information. These errors should not occur at all, and it is important that they are reported to the Serpent developer team (preferably by writing to the [//ttuki.vtt.fi/serpent Serpent discussion forum]). There are also warning messages that include the name of a subroutine, such as:
 +
<nowiki>
 +
***** Mon Feb 22 19:34:30 2016 (seed = 1456162439)
 +
Warning message from function CheckNuclideData:
 +
 +
Stable nuclide 40096.09c has 1 decay modes</nowiki>
 +
These messages are related to suspicious values or other problems in the input data or calculation routines, that may affect the outcome of the simulation, but do not require immediate termination. It is not uncommon that the code prints several warning messages, especially in burnup calculation, and usually they can be ignored. Serpent is still a developing code, and several potential problems, that may not turn out to be problems after all, are checked. This is especially the case when the code is run in the DEBUG mode.
 +
 +
=== Running the calculation in DEBUG mode ===
 +
 +
When the calculation crashes or produces completely unrealistic results despite no evident problems in the input, it is advised to repeat the calculation in the [[Installing and running Serpent#Compiler options|DEBUG mode]]. Since this requires recompiling the source code, it is good practice to keep two separate executables available at all times.
 +
 +
The DEBUG mode switches on several pointer and value checks, which are likely to catch the root cause of the error early on. Performing this check before reporting the error helps tracking down the problem. It should be noted, however, that the calculation runs significantly slower when compiled in the DEBUG mode (by a factor of two or more). When compiled in this mode the code prints text "DBG" in the run-time output log.
 +
 +
== Performance ==
 +
 +
This section contains miscellaneous tips for improving Serpent calculation times. Some of these tips are more focused on improving parallel scalability, and some on preventing unnecessary computation.
 +
 +
*Disable calculation of [[Input syntax manual#set gcu|group constants]] if not needed.
 +
*Disable calculation of [[Input syntax manual#set cmm|cumulative migration method]] diffusion coefficients if not needed.
 +
*Use [[Input syntax manual#set shbuf|private result array]] if there is enough memory.
 +
*Disable [[Input syntax manual#set repro|OpenMP result reproducibility]] if not needed.
 +
*Use [[Input syntax manual#lat|lattice geometries]] if possible.
 +
*Use fewer [[Input syntax manual#set micro|micro energy groups]] if no [[Input syntax manual#set fum|critical spectrum calculations]] or [[Output parameters#Diffusion parameters|out-scattering diffusion coefficients]] are needed. This option should be explored together with the private result array option, as with the shared result array this might lead to longer calculation times.
 +
*Remove unnecessary [[Input syntax manual#mesh|mesh plots]] if not needed during production calculations.
 +
*Remove unnecessary [[Input syntax manual#det|detectors]] if not needed during production calculations.
 +
*Tune the ratio of [[Input_syntax_manual#set_pop|neutrons per generation and number of cycles]] or [[Input_syntax_manual#set_nps|number of batches]]. Running many cycles with relatively small populations is generally slower than running fewer cycles with greater populations. However, this may also change the accumulation of statistics, equilibrium xenon iteration etc.
 +
*Utilize [[Input syntax manual#set usym|universe symmetries]] to
 +
:*reduce number of burnable materials for example in the case of single assembly burnup calculations with a symmetric fuel assembly.
 +
:*reduce number of surfaces during the transport calculation for example in the case of a BWR fuel assembly with water regions.
 +
*Depending on the application
 +
:*leave out [[Input syntax manual#set dbrc|doppler-broadening rejection correction]] (DBRC). This will affect the results by not simulating all available physics.
 +
:*use a coarser [[Input syntax manual#set egrid|cross section energy grid]]. This will affect the results by not simulating all available physics.
 +
 +
== Memory consumption ==
 +
 +
This section contains miscellaneous tips for reducing Serpent memory consumption.
 +
 +
*If running a high number of [[Input syntax manual#set pop|neutrons per generation]], the default value of [[Input syntax manual#set nbuf|neutron buffer]] factor will lead to unnecessarily high memory consumption. Reducing the factor to a low number will reduce the memory consumption. However, if the value is too small for a given calculation case, the program will terminate itself (with an error message).
 +
 +
[[Category:Tutorials]]

Latest revision as of 18:07, 19 August 2022

Serpent produces two types of error messages:

  1. Input errors, identified by text "Input error", followed by the error message. If the error can be related to a specific input parameter, then also the name of the parameter and the line number in the input file are printed.
  2. Run-time errors, in which case the name of the associated subroutine is printed, along with some additional information.

The first class of errors are (ideally) related to a problem in the input file. It should be noted, however, that the parameter name and line number may not reflect the original cause of the error, but rather the point where things started going wrong. Incorrectly typed input card names, for example, cause the parser to ignore the card altogether, and the following values are interpreted as entries belonging to the previous card.

Run-time errors should not occur, and they should always be reported to the developer team. This is also the case if the calculation crashes (segmentation fault or similar). In such case repeating the calculation in debug mode may reveal some additional information on what went wrong.

Serpent also produces a number of warning messages that may or may not be important. The code is pretty meticulous about errors, so problems let off with a warning are usually not too severe.

Things to check in case of suspicious results

Material volumes

Material volumes are not necessarily needed for most transport simulations, but they do affect the results of burnup calculation. Serpent prints an error message if the volume of an irradiated material is not available.

It is important to note, however, that these problems may also occur even if an error message is not printed. The most typical case is that the code attempts to calculate the volumes of two-dimensional pin-structures automatically, but for some reason this calculation produces incorrect results. This happens, for example, when:

  • The geometry has axial dimension (3D geometry is assumed to be 2D)
  • Some parts of the fuel pins are located outside the geometry (pins are clipped by cell, universe or geometry boundary)
  • When universe symmetries are used (unable to account for pins in symmetry positions)

Serpent cannot identify these problems, so no error message is printed.

Material volumes should always be checked using the Monte Carlo based volume checker routine before running the calculation. If the values are incorrect, or the calculation produces an error message on missing values, the volumes must be set manually.

Unresolved resonance probability table sampling

Unresolved resonance probability table sampling (set ures option) is not used by default. This method is needed to account for self-shielding effects in the unresolved resonance region. The effect is usually not significant in thermal systems, but can lead to noticeable discrepancies in fast-spectrum systems. Leaving this option out of the calculation may explain differences between group constants calculated with other programs.

The methodology for probability table sampling is not complete (as of version 2.1.25), and some nuclides contain data that cannot be processed by Serpent. In such case, a warning message is printed and smooth infinite-dilute cross sections are used instead. This is typical for natural elements, and may cause small discrepancies in results, e.g. when compared to MCNP.

Mass vs. atomic densities

The densities and compositions of materials can be entered in atomic or mass units (see the input syntax of the material card), and using incorrect units may lead to unexpected results. The difference may not be clearly noticeable if the material consists nuclides with similar atomic weight, but if there are both light and heavy nuclides the results can be off by tens of percent.

In particular, using incorrect units for isotopes in water causes a major distortion in the flux spectrum in LWR calculations. In burnup calculation this results in completely unexpected depletion rate of 235U and build-up rate of 239Pu.

The material and nuclide densities used in the calculation can be checked from the nuclide and material output file ([input].out).

MPI parallelization without MPI mode

MPI scripts such as mpirun allow running Serpent even if the source code was not compiled in MPI mode. Instead of starting a single parallel simulation, the result is multiple independent simulations that read and write the same input and output files. If two or more writing operations happen to overlap, identical sections are repeated in the output files. If the tasks are sufficiently off-sync, the writing operations do not overlap, and it may actually seem like everything is OK - the correct number of CPU's are working and the results look reasonable. The only thing that seems to be wrong is that the running time does not reflect the speed-up expected from the parallelization.

When MPI parallelization is executed correctly, the run-time output shows the number of mpi tasks, for example (MPI=10). The number of tasks is also printed in variable MPI_TASKS in the main output file ([input]_res.m). Whether the source code was compiled in MPI mode or not can be checked with sss2 -version.

Unable to start or maintain criticality source simulation

Criticality source simulation requires an initial guess for the fission source distribution. If no source definition is provided, Serpent samples source points uniformly throughout all fissile materials, i.e. materials with fissile isotopes. This creates a few potential problems:

  1. If the fissile zone covers only a small volume of the total geometry, the efficiency of the source sampling routine becomes extremely poor. If the population size is large, the code may be stuck in the source sampling routine for a very long time, or the sampling of the initial source may fail completely.
  2. If the geometry contains both very active and inactive fissile zones (e.g. seed and blanket), the calculation may fail after the first generation because the majority of source points are placed in the inactive zone.

The solution to both problems is to use an explicit source definition that puts a sufficient number of points in the active parts of the fuel. This is most conveniently done using the sx, sy, and sz or the srad and sz parameters of the source card. It should be noted that the use of an explicit source definition does not affect the results of the simulations, provided that the fission source is allowed to converge by skipping a sufficient number of inactive neutron generations.

Low production rate of higher actinides in burnup calculation

Serpent forms the transmutation paths for burnup calculation automatically, starting from the initial composition defined in the material input. To avoid including everything available, the procedure applies a cut-off that after a certain chain length discards all neutron reactions. The result is that some higher actinides, in particular berkelium and californium isotopes, are not produced through all possible chains, and some isotopes may not be included in the calculation at all.

Discarding these higher actinides should have a negligible effect on the results of the calculation, but in some cases their concentrations are of particular interest. The transmutation chains can be extended further by adding nuclides at zero concentration in the material compositions. Including isotopes 240Cm to 250Cm, 247Bk to 250Bk and 249Cf to 254Cf should force Serpent to include the necessary data for the high end of the actinide transmutation chains.

Isomeric branching ratios

The production of metastable nuclides in burnup calculation requires isomeric branching ratio data. This data is one of the major sources of uncertainty as well as differences between burnup calculation codes. Serpent uses default constant values and provides options to apply user-defined constant values as well as energy-dependent ratios read from ENDF format data files.

Boundary conditions

Serpent handles reflective and periodic boundary conditions different from other Monte Carlo codes. Instead of stopping the particle at the boundary surface, reflections and translations are handled by coordinate transformations. This poses some limitations to how repeated boundary conditions can be used. For more information, see detailed description on Boundary conditions.

In case using vacuum (black) boundary conditions, it is necessary for the outer surface defining an outside cell to be non-re-entrant (convex) due to the use of delta-tracking. Delta-tracking might miss the boundary conditions in case of a re-entrant (concave) outer surface. See also cell definition.

Replicating zero importance regions

MCNP and other Monte Carlo codes have the option to define cells with zero importance, which means that all particles entering the zone are immediately killed. This is basically equivalent with the "outside" type cells in Serpent. Because of delta-tracking, however, the particle has some probability to pass through such zone without encountering any virtual collisions, which means that the particle history is not killed either. For this reason the geometry should always be defined in such way that the boundary with outside cells is non-re-entrant. This also means that outside cells should not be used inside the geometry. In case this cannot be avoided, the use of delta-tracking should be switched off (set dt 0).

Photon production in coupled neutron/photon transport calculations

Coupled neutron/photon transport mode is still a relatively new feature in Serpent 2 (implemented in version 2.1.29). Based on some preliminary test calculations it seems that the production rate of secondary photons varies significantly depending on which neutron transport cross sections are used in the calculation. The differences in photon reaction rates may consequently increase to tens of percent. Serpent prints out the nuclides for which secondary photon production cross sections are available. It should be noted that if the data is missing for some significant isotopes, the results will be correspondingly under-estimated.

Photon production was not considered when the current cross section libraries were prepared for Serpent. Therefore it may be necessary to use some other data source (e.g. MCNP libraries) to obtain accurate results for coupled neutron/photon transport calculations.

Detector volumes

All cell detectors are integrated over volume, and surface detectors over surface area. The results are divided by volume/area, but the divisor is by default set to 1.0. This can be changed using the dv entry of the detector card if (bin-)detector volume is constant. Some other codes, in particular MCNP, calculate this volume automatically, or if not possible, require the user to enter a value.

Normalization with variance reduction

By default, in neutron transport calculations, Serpent normalizes all reaction rates to unit total loss rate (absorption + leak). This loss rate may not be preserved when weight-window based variance reduction is use, which means that tally results will not match a calculation run without weight windows. It is therefore important to fix the normalization to source, set srcrate option, instead of loss rate when using weight windows.

Discontinuity factor calculation with universe symmetries

If a discontinuity factor calculation surface is in the same position as a reflective universe symmetry boundary with actual symmetry transformations, the heterogeneous surface fluxes and incoming and outgoing partial currents will be erroneously zero.

Geometry boundaries

The geometry is not checked for overlaps. If geomety plotter is used, the overlaps are checked for the plotted area. However, if for example the geometry is bounded by outside region coincident with the plotter area, overlaps with the outside area are not checked. In this case, for example if the outermost part of the actual geometry is by mistake infinite, or does not have a boundary coincident with the outside area, the boundary conditions may not be correctly used. This may for example cause zero leakage in the results even if black boundary conditions are used. Overlaps in the outside regions may be checked by including geometry plots with minimum and maximum coordinates extending in the outside region instead of using the default limits.

Doppler broadening rejection correction

Serpent does not apply Doppler broadening rejection correction (DBRC) (set dbrc input card) by default. Leaving this option out of the calculation may explain differences between group constants calculated with other programs.

Thermal scattering data

Serpent does not use S(α β) data (therm input card) by default. Leaving this option out of the calculation may explain differences between group constants calculated with other programs.

Super-imposed group constant universes

Super-imposed group constant generation universes (i.e. not part of the geometry definition) should not be used so that they cover (partly or totally) the same geometry region as some other group constant generation universe (super-imposed or part of the geometry definition), if group constants are generated only on a single geometry level. This will lead to the group constants being scored on only one of the universes.

Material definitions in light water reactor pin geometries

Fuel pins in light water reactors generally contain helium (possibly modeled with void) inside fuel cladding, i.e. between the fuel cladding and fuel pellet and inside a possible center hole.

Empty control rod guide tubes in light water reactors generally contain water, and not void.

Root universe

Serpent geometry constructor is built on a universe-based formulation (see a detailed description of the universe-based geometry type in Serpent). The root universe is the universe at the lowest level of the geometry hierarchy. Whether using the default descriptor "0" or a user-defined one via the set root input option, the root universe always has to be defined, embedding the whole geometry. A mischaracterization of the root universe might lead to an incorrect geometry definition.

Debugging the input model

Error and warning messages

Serpent prints out two types of error and two types of warning messages. Input errors, such as:

***** Thu Feb 25 14:53:56 2016

Input error in parameter "cell" on line 8 in file "geometry.inp":

Surface s1 is not defined

indicate that there is some identified problem in the input model, and it is up to the user to fix it. The message is often (but not always) accompanied by the name of an input parameter, and the file name and line number where this parameter was defined. Potential problems that do not require immediate termination of the calculation are notified with a warning message, such as:

 ***** Warning: Nest FUE1 is not used in geometry

These warnings may or may not be related to actual problems, and they can often be ignored.

Fatal errors in the calculation routines produce messages of type:

***** Thu Feb 25 15:05:16 2016:

 - MPI task         = 0
 - OpenMP thread    = 0
 - RNG parent seed  = 1456405516

Fatal error in function LevelScattering:

Now, I am become Death, the destroyer of worlds!

Simulation aborted.

In addition to an ominous (and often unintelligible) error message, the code prints the name of a subroutine and some additional debug information. These errors should not occur at all, and it is important that they are reported to the Serpent developer team (preferably by writing to the Serpent discussion forum). There are also warning messages that include the name of a subroutine, such as:

***** Mon Feb 22 19:34:30 2016 (seed = 1456162439)
Warning message from function CheckNuclideData:

Stable nuclide 40096.09c has 1 decay modes

These messages are related to suspicious values or other problems in the input data or calculation routines, that may affect the outcome of the simulation, but do not require immediate termination. It is not uncommon that the code prints several warning messages, especially in burnup calculation, and usually they can be ignored. Serpent is still a developing code, and several potential problems, that may not turn out to be problems after all, are checked. This is especially the case when the code is run in the DEBUG mode.

Running the calculation in DEBUG mode

When the calculation crashes or produces completely unrealistic results despite no evident problems in the input, it is advised to repeat the calculation in the DEBUG mode. Since this requires recompiling the source code, it is good practice to keep two separate executables available at all times.

The DEBUG mode switches on several pointer and value checks, which are likely to catch the root cause of the error early on. Performing this check before reporting the error helps tracking down the problem. It should be noted, however, that the calculation runs significantly slower when compiled in the DEBUG mode (by a factor of two or more). When compiled in this mode the code prints text "DBG" in the run-time output log.

Performance

This section contains miscellaneous tips for improving Serpent calculation times. Some of these tips are more focused on improving parallel scalability, and some on preventing unnecessary computation.

  • reduce number of burnable materials for example in the case of single assembly burnup calculations with a symmetric fuel assembly.
  • reduce number of surfaces during the transport calculation for example in the case of a BWR fuel assembly with water regions.
  • Depending on the application

Memory consumption

This section contains miscellaneous tips for reducing Serpent memory consumption.

  • If running a high number of neutrons per generation, the default value of neutron buffer factor will lead to unnecessarily high memory consumption. Reducing the factor to a low number will reduce the memory consumption. However, if the value is too small for a given calculation case, the program will terminate itself (with an error message).