Dear Ville (and Jaakko),

I wanted to give you an update on our previous discussion for having Serpent tally delayed neutrons ONLY (as described in your answer to this post on April 11). This is the list of modifications I have added to the code:

I have added a new variable, called DATA_TALLY_DEL: if it is set to 0, nothing happens (default); if it's set to 1 the delayed neutrons tally only option is activated.

I have added the following line to

*locations.h*:

Code: Select all

```
/* Delayed-only tally option */
#define DATA_TALLY_DEL 1069
```

Initialization in file

*initdata.c*:

Code: Select all

```
/* Delayed-only tally flag */
WDB[DATA_TALLY_DEL] = 0.0;
```

And finally the following code block in

*readinput.c*:

Code: Select all

```
else if (!strcasecmp(params[j], "deltal"))
{
/***** Sample delayed neutrons *********************************/
/* Copy parameter name */
strcpy (pname, params[j]);
k = j + 1;
/* Mode */
if (k < np)
WDB[DATA_TALLY_DEL] =
TestParam(pname, fname, line, params[k++], PTYPE_LOGICAL);
/***************************************************************/
}
```

This new variable is used in

*interpolatenubar.c*. First of all, I am circumventing the "return" if-statements in the following way: the delayed neutron subtraction code block is executed if DATA_USE_DELNU = 0 or when DATA_TALLY_DEL = 1 (first if); if no data is found for delayed neutrons and DATA_TALLY_DEL =1, then values are = 0.0 (second if). Here is the code:

Code: Select all

```
/***** Subtract delayed nubar data *****************************************/
/* Check flag - NOTE (vm): if DATA_TALLY_DEL is equal to 1 it does not return, rather substitutes the values*/
if (((long)RDB[DATA_USE_DELNU] != NO) && ((long)RDB[DATA_TALLY_DEL] != YES))
return;
/* Get pointer to delayed nubar data */
if ((loc0 = (long)RDB[rea + REACTION_PTR_DNUBAR]) < VALID_PTR)
{
if ((long)RDB[DATA_TALLY_DEL] == 1) {
/* If no delayed nubar data is available when tallying delayed neutrons only, set to 0 */
for (n = 0; n < ne; n++) {
nubar [n] = 0;
}
}
return;
}
```

If data is present, Serpent checks whether the data file is given as polynomial or tabular. If the data is given as

**polynomial**, then the values are calculated as follows:

Code: Select all

```
if (((long)RDB[DATA_TALLY_DEL] == 0) || ((long)RDB[DATA_USE_DELNU] == 0))
{
/* Initial value */
nubar[n] = nubar[n] - RDB[ptr];
x = E[n];
/* Loop over coefficients */
for (m = 1; m < np; m++)
{
nubar[n] = nubar[n] - RDB[ptr + m]*x;
x = x*E[n];
}
/* Check value */
CheckValue(FUNCTION_NAME, "nubar", "", nubar[n], 1.5, 60.0);
}
else
{
/* THIS OPTION HAS BEEN ADDED TO ONLY TALLY DELAYED NEUTRONS (vm) */
/* Initial value */
nubar[n] = RDB[ptr];
x = E[n];
/* Loop over coefficients */
for (m = 1; m < np; m++)
{
nubar[n] = nubar[n] + RDB[ptr + m]*x;
x = x*E[n];
}
/* Check value */
CheckValue(FUNCTION_NAME, "nubar", "", nubar[n], 0.015, 0.6);
}
}
```

Otherwise, if they are

**tabular**:

Code: Select all

```
{
/* Check if only DELAYED neutrons have to be tallied (vm)*/
if (((long)RDB[DATA_TALLY_DEL] == 0) || ((long)RDB[DATA_USE_DELNU] == 0)) {
nubar[n] = nubar[n] - dnubar[n];
/* Check value */
CheckValue(FUNCTION_NAME, "nubar", "", nubar[n], 1.5, 60.0);
} else if ((long)RDB[DATA_TALLY_DEL] == 1) {
nubar[n] = dnubar[n];
/* Check value */
CheckValue(FUNCTION_NAME, "nubar", "", nubar[n], 0.015, 0.60);
}
}
```

To tally delayed neutrons with these modifications, I then use a dr -7 detector, as opposed to the dr -100 that I was using with the other approach that I tried.

I am currently testing this procedure. So far I run a k-calculation and got a total production of delayed neutrons compatible with the one dr -100 method. The two results weren't within statistical uncertainty, however for the detector function tallying approach I had used a different library. The two results were within 0.8% of each other while the statistical uncertainty of the value given by Serpent is 0.005%. I am tempted to think that the 0.8% comes from the different libraries employed.

I'd appreciate any feedback you can provide.

Thanks a lot for the help you have provided!