Sensitivity calculations
Serpent relies on the collision history based first order GPT equivalent implementation^{[1]} ^{[2]} to calculate sensitivities of various responses to various perturbations. As a simple example, the sensitivity of the effective multiplication factor to the different nuclear cross sections can be calculated. In the future these capabilities may be used for uncertainty propagation to Serpent results ^{[3]}.
Contents
Input
Adding a response
Basic responses
Basic responses can be set up with the syntax
sens resp NAME FLAG
Where the different response names and flags are as follows
NAME | explanation of NAME | FLAG | explanation of FLAG |
keff | sensitivity of effective multiplication factor to perturbation | 0/1 | OFF/ON |
beff | sensitivity of effective delayed neutron fraction to perturbation | 0/1 | OFF/ON |
leff | sensitivity of effective prompt generation time to perturbation | 0/1 | OFF/ON |
Omitting (or forgetting) the flag from the definition, will turn the response on by default.
Reaction rate ratios
Sensitivities of reaction rate ratios to perturbations can be set up to be calculated with
sens resp detratio NAME DET1 DET2
Where the parameters are:
NAME | : the name of the response. Will be used in output. |
DET1 | : Name of the numerator detector, i.e. the one whose reaction rate is being divided. |
DET2 | : Name of the denominator detector, i.e. the one whose reaction rate is the dividing value. |
The two detectors have to be set up separately in normal Serpent fashion.
Notes:
- Currently, each detector can have only one bin.
- Currently, only the indirect effect of the perturbation is calculated and the direct effect must be calculated separately and added to the result.
Void reactivity coefficient sensitivity
The sensitivity of the void reactivity coefficient to perturbations can be set up to be calculated with
sens resp void MATERIAL
Where the parameters are:
MATERIAL | : the name of the material corresponding to the void coefficient. |
Adding a perturbation
sens pert NAME FLAG
Where the different perturbation names and flags are as follows
NAME | explanation of NAME | FLAG | explanation of FLAG |
xs | perturbation of basic cross sections | 0/all/allmt | OFF/sum reaction modes/partial (MT) reaction modes |
chi | perturbation of fission spectrum | 0/1 | OFF/ON |
nubar | perturbation of fission nubar | 0/1 | OFF/ON |
eleg | perturbation of Legendre moments of elastic scattering angular distribution |
0/1/2/3/4/5/6/7 | Number of Legendre moments to perturb. |
Omitting (or forgetting) the flag from the definition will turn the perturbation on by default. The default number of Legendre moments to include is 3.
Choosing nuclides to perturb
The perturbed nuclides can be specified by giving a list of the ZAI-numbers to include
sens pert zailist ZAI_{1} ZAI_{2} ...
for example
sens pert zailist 922350 922380
for perturbations affecting ^{235}U and ^{238}U. By giving the control words total and/or sum in the list of ZAI-numbers, the total sensitivity over all ZAIs present in the calculation and the sum sensitivity of the listed ZAIs will be calculated, respectively.
All nuclides present in the calculation can be included with
sens pert zailist all
this will automatically include the calculation of the total sensitivity.
Choosing materials to perturb
The materials, where the perturbations are applied can similarly be specified by giving a list of the material names
sens pert matlist MAT_{1} MAT_{2} ...
for example
sens pert matlist fuel coolant
for perturbations affecting interactions in materials fuel and coolant. By giving the control words total and/or sum in the list of material names, the total sensitivity over all materials present in the calculation and the sum sensitivity of the listed materials will be calculated, respectively.
All materials present in the calculation can be included with
sens pert matlist all
this will automatically include the calculation of the total sensitivity.
Custom perturbations (xGPT)
Instead of adding or subtracting 1 in each accepted or rejected event, there is the possibility to, instead, add or subtract a user defined energy dependent value. This allows applying continuous energy perturbations such as the ones used in ^{[4]}.
The syntax for adding custom perturbations is
sens pert custom NAME [efunc FILE] [zailist ZAI_{1} ZAI_{2} ...] [matlist MAT_{1} MAT_{2} ...] [mtlist MT_{1} MT_{2} ...] [realist REA_{1} REA_{2} ...]
where NAME is simply a user-given name used for identification of the custom perturbation. By default, the value added or subtracted for the perturbation is 1, but an energy dependent function can be given with the efunc command, where FILE is the name of the file containing the energy dependent function in the following format:
INTERP_MODE N_{pts} E_{1} VAL_{1} E_{2} VAL_{2} ... E_{Npts} VAL_{Npts}
Accepted interpolation modes are lin-lin, lin-log, log-lin and log-log.
If the perturbation is only applied to certain nuclides (ZAIs) or materials, they can be given using the zailist and matlist options respectively. By default the perturbation is applied at each collision with the target nuclide(s). If the perturbation only affects certain reaction MT numbers, they can be given using the mtlist option. Certain sum-reactions can be flagged for the perturbation using the realist option, where the different sum reaction names are as follows:
ela | : Elastic scattering. |
inl | : Inelastic scattering. |
sab | : Thermal S(α,β) scattering. |
capt | : Neutron capture (reaction neutron yield is zero). |
fiss | : Fission. |
nxn | : Neutron multiplying (n, xn) reactions. |
Notes:
- The custom perturbations will only produce the total effect of the perturbation over all materials, nuclides and reaction modes that have not been excluded from the custom perturbation.
- The output for the custom perturbations can be obtained from the energy integrated (_E_INT) arrays printed to [input]_sens.m. The only nonzero value for the custom perturbations will be that with the lowest material and ZAI index.
Additional options
The options for sensitivity calculations can be set using the
sens opt ...
syntax.
Energy grid for scoring
The energy grid used for scoring the sensitivities can be set using
sens opt egrid ENAME
where ENAME is a name of an energy grid definition.
Number of latent generations
The number of latent generations used for k-effective sensitivity calculations can be set with
sens opt latgen NGEN
where NGEN is the number of generations to use. The number of summation generations for reaction rate ratios and bilinear-ratios will be NGEN+1
Effect of number of latent generations
Setting
sens opt history yes/1
will calculate and output the sensitivities with every number of latent generations up to the one indicated with sens opt latgen. This option can be used to estimate the required number of latent generations.
Direct scoring instead of event based scoring
There are two ways to go about calculating the net number of accepted collisions in the collision history of a particle.
- The default way used by Serpent is to create so-called event-objects during each accepted or rejected event of interest (e.g. collision, sampled fission neutron energy or sampled scattering angle). Then, when the net number of accepted collisions is needed, this list of events is traversed and the net number is calculated. The memory requirement of this method is dependent on the number of interesting events in N_{gen} generations of particle history, where N_{gen} is the total number of generations stored for the collision history. In order to save memory, the events are shared by each particle that has the event in their collision history. Traversing through the event tree in order to calculate the net number of a certain event in the collision history can be costly.
- There is the option to update the net number of a certain event on-the-fly, every time that event is sampled. Event objects are no longer stored. Instead the net number of accepted collisions is either incremented (accepted collision) or decremented (rejected collision) directly. This way each generation in the collision history is associated with a score matrix representing the net number of scores for each of the different events of interest. Again, to save memory each generational score matrix is shared by all neutrons that have that neutron history in their collision history. Looping over this score matrix can also be costly.
Generally, direct scoring is the better option if the length of the collision history is large and the number of perturbations (number of materials X number of nuclides X number of reactions X number of energy groups) is small.
Conversely in systems with a short collision history length (fast systems) and a large number of total perturbations, the default event based scoring should fare better.
It is usually beneficial to test both methods in order to find the faster (or more memory efficient) one for the specific application.
In order to use the direct scoring (option 2), the input is
sens opt direct F
where F indicates the number of score matrices to be allocated per source particle per generation. If the score matrices would not be shared across multiple source particles F would need to be set to 1.0. However, in reality fewer score matrices are needed and the F can be set to be smaller than unity (e.g. 0.2-0.5).
The score matrices require some additional processing after each cycle, which means that it is a good idea to try and make the F parameter as small as possible in order to avoid having to process an excess number of score matrices. If Serpent notices that the allocated score matrices are running out, it will automatically try and allocate more score matrices:
***** Warning: Adjusting event score matrix bank size for thread 5...
Even so, the score matrices can sometimes run out by surprise leading to an error:
Fatal error in function EBlockFromBank: Event score matrix bank is empty. Increase the bank size with "sens opt direct <sz>". Simulation aborted.
Event bank size
In a similar manner to the score matrices described in the previous section, Serpent also preallocates memory for the event objects used to store information about the accepted and rejected collisions. The event objects are also processed after each cycle, which means that setting a too large value for the event bank size will waste processing time.
The event bank size can be set using
set nbuf NBUF EBANK
where NBUF is the neutron buffer size (default is 5) and EBANK is the event bank size (default is 100). The event bank size is given by source particle, which means that if the events would not be shared between multiple particles, a reasonable value for the event bank size would be N_{event} x N_{gen}, where N_{event} is the mean number of events of interest in each generation and N_{gen} is the number of generations stored for the collision history. Due to the sharing of the events across multiple particles, much smaller values can typically be used (e.g. size of 20 for light water system with 16 stored generations with cross section and nubar perturbations for coolant and fuel nuclides).
If Serpent notices that the allocated score matrices are running out, it will automatically try and allocate more score matrices:
***** Warning: Adjusting event bank size for thread 2...
If the event banks run out completely the following error is given:
Fatal error in function EventFromBank: Event bank is empty Simulation aborted.
Output
The output of the sensitivity calculations is written into a MATLAB/OCTAVE readable file [input]_sens.m
General parameters
Parameter | Size | Description |
---|---|---|
SENS_N_MAT | 1 | Number of perturbed materials. |
SENS_N_ZAI | 1 | Number of perturbed nuclides (ZAIs). |
SENS_N_PERT | 1 | Number of different perturbation types (cross sections, fission spectra etc.). |
SENS_N_ENE | 1 | Number of energy bins used for tallying the sensitivities. |
SENS_MAT_LIST | SENS_N_MAT strings | Array of names for the perturbed materials. |
SENS_ZAI_LIST | SENS_N_ZAI | Array of ZAI numbers for the perturbed nuclides. |
SENS_PERT_LIST | SENS_N_PERT strings | Array of names for the perturbation types. |
SENS_E | SENS_N_ENE + 1 | Grid points for the energy grid used for tallying the sensitivities. |
SENS_LETHARGY_WIDTHS | SENS_N_ENE | Lethargy widths of the energy bins. Lethargy at the maximum energy bin boundary is 0. |
Calculated sensitivities
The calculated sensitivities are printed out both in an energy dependent format (integrated to the energy grid defined by sens opt egrid) and an energy integrated format (integrated over all energies).
The standard sensitivity responses include:
Parameter | Size | Description |
---|---|---|
ADJ_PERT_KEFF_SENS | SENS_N_MAT SENS_N_ZAI SENS_N_PERT SENS_N_ENE 2 | The energy dependent sensitivity of the multiplication factor and the associated statistical error. |
ADJ_PERT_KEFF_SENS_E_INT | SENS_N_MAT SENS_N_ZAI SENS_N_PERT 2 | The energy integrated sensitivity of the multiplication factor and the associated statistical error. |
ADJ_PERT_BEFF_SENS | SENS_N_MAT SENS_N_ZAI SENS_N_PERT SENS_N_ENE 2 | The energy dependent sensitivity of the delayed neutron fraction and the associated statistical error. |
ADJ_PERT_BEFF_SENS_E_INT | SENS_N_MAT SENS_N_ZAI SENS_N_PERT 2 | The energy integrated sensitivity of the delayed neutron fraction and the associated statistical error. |
ADJ_PERT_LEFF_SENS | SENS_N_MAT SENS_N_ZAI SENS_N_PERT SENS_N_ENE 2 | The energy dependent sensitivity of the prompt neutron generation time and the associated statistical error. |
ADJ_PERT_LEFF_SENS_E_INT | SENS_N_MAT SENS_N_ZAI SENS_N_PERT 2 | The energy integrated sensitivity of the prompt neutron generation time and the associated statistical error. |
ADJ_PERT_VOID_SENS | SENS_N_MAT SENS_N_ZAI SENS_N_PERT SENS_N_ENE 2 | The energy dependent sensitivity of the void reactivity coefficient and the associated statistical error. |
ADJ_PERT_VOID_SENS_E_INT | SENS_N_MAT SENS_N_ZAI SENS_N_PERT 2 | The energy integrated sensitivity of the void reactivity coefficient and the associated statistical error. |
The reaction rate sensitivities defined using sens resp detratio are output as:
Parameter | Size | Description |
---|---|---|
ADJ_PERT_NAME_SENS | SENS_N_MAT SENS_N_ZAI SENS_N_PERT SENS_N_ENE 2 | The energy dependent sensitivity of the reaction rate ratio NAME and the associated statistical error. |
ADJ_PERT_NAME_SENS_E_INT | SENS_N_MAT SENS_N_ZAI SENS_N_PERT 2 | The energy integrated sensitivity of the reaction rate ratio NAME and the associated statistical error. |
Helpful indices
The indices for different materials, ZAIs and perturbations are also included as separate variables of the following format
Parameter | Size | Description |
---|---|---|
iSENS_MAT_NAME | 1 | Index corresponding to material NAME. |
iSENS_ZAI_NUMBER | 1 | Index corresponding to the nuclide with ZAI NUMBER. |
iSENS_PERT_NAME | 1 | Index corresponding to the perturbation NAME. |
These indices can be used to refer to the different materials, nuclides and perturbations in data processing without the need to manually figure out the indices. For example,
ADJ_PERT_KEFF_SENS(iSENS_MAT_fuel, iSENS_ZAI_922380, iSENS_PERT_CAPT_XS, :, 1)
will refer to the energy dependent sensitivity of the multiplication factor to the perturbation of the capture cross section of uranium 238 in the material fuel.
It should be noted that the indices for certain materials, ZAIs and perturbations only exist if they have been included in the sensitivity calculation using sens pert.
Notes
- The energy dependent sensitivities are integrated over the energy bins and not divided by the bin energy- or lethargy-width.
- The sensitivity output is mostly written as 1D arrays and reshaped and permuted using the appropriate MATLAB/OCTAVE commands (included in the .m file).
- Perturbations of the scattering cosine are not yet calculated, although perturbations of Legendre moments of the elastic scattering distribution are.
Examples
References
- ^ Aufiero, M. et al. "A collision history-based approach to sensitivity/perturbation calculations in the continuous energy Monte Carlo code SERPENT", Ann. Nucl. Energy, 152 (2015) 245-258.
- ^ Valtavirta, V., Aufiero, M. and Leppänen, J. "Collision-history based sensitivity/perturbation calculation capabilities in Serpent 2.1.30", In Proc. BEPU 2018, Lucca, Italy, May 13-19, 2018.
- ^ Valtavirta, V. "Nuclear data uncertainty propagation to Serpent generated group and time constants", Research report VTT-R-04681-18 (link to report) (2018).
- ^ Aufiero, M., Martin, M. and Fratoni, M. "XGPT: Extending Monte Carlo Generalized Perturbation Theory capabilities to continuous-energy sensitivity functions." Ann. Nucl. Energy, 96 (2016) 295-306.