pillager.pillager.Pillager

class pillager.pillager.Pillager

Bases: object

Class for conducting coupled criticality search-burnup calculations in the Serpent 2 radiation transport code.

Individual functions can also be used to conduct variable search using secant, regressive secant, or generalized regressive secant methods.

__init__()

Initializes default required Serpent input and search values.

output_dir

Path to directory where base files are located and outputs are generated. Default: ‘./’

Type:

str

input_base

Name of base Serpent input file, cannot be ‘serpent.i’. Default: ‘serpent_base.i’

Type:

str

control_base

Name of input file containing control surface lines. Default: ‘control.i’

Type:

str

particles

Number of particles per generation. Default 1e5

Type:

int

generations

Number of active generations. Default: 160

Type:

int

skipped_gens

Number of skipped generations. Default: 40

Type:

int

target

Target value for criticality search. Default: 1

Type:

float or int

retained_values

Number of values to use in the search function. Default: 2

Type:

int

err_tol

Absolute error tolerance to use for search convergence. Default: 1e-5

Type:

float or int

var_tol

Change in variable tolerance to use for search convergence. Default: 1

Type:

float or int

burnup_steps

List of burnup steps. Default: [0.1, 0.5, 1]

Type:

list of floats or ints

burnup_type

Serpent burnup calculation method (only daytot supported currently).

Type:

str

xbounds

Lower and upper bounds of the search domain. Default: [0,180]

Type:

list of floats or ints

Determines the type of search method to use. Default: True

Type:

bool

nOMP

Number of processors to use during Serpent runs. Default: 48

Type:

int

file_blacklist

List of files which will not be moved when invoking move_files(). Default: [self.input_base,self.control_base,’serpent.i.wrk’,’outputs.csv’]

Type:

list of strings

Methods

__init__()

Initializes default required Serpent input and search values.

blacklist_dir_files()

Designates current directory files as blacklisted from movement.

generalized_regressive_secant(xs, fs, sigs)

Conducts a generalized regressive secant evaluation to find next search value.

get_detector_values(file_name)

Gets detector values from Serpent simulation detector output file.

get_eigenvalue()

Gets implicit eigenvalue and uncertainty from Serpent results output file (serpent.i.res).

move_files([step])

Moves generated input and output files for a given timestep.

pillage()

Conducts a full coupled criticality search-burnup calculation over the designated burnup steps.

regressive_secant(xs, fs)

Conducts a regressive secant evaluation to find next search value.

run_search(config[, function])

Conducts criticality search by default.

run_serpent()

Runs the generated serpent input file.

write_serpent(x, particles, config[, step])

Writes serpent input files.

blacklist_dir_files()

Designates current directory files as blacklisted from movement.

generalized_regressive_secant(xs, fs, sigs)

Conducts a generalized regressive secant evaluation to find next search value.

Parameters:
  • xs (float, list of floats) – Initial and/or previous input values to be used in the search. Requires at least two starting values.

  • fs (float, list of floats) – Function values corresponding to the xs values provided.

  • sigs (float, list of floats) – Statistical uncertainties corresponding to the function values provided.

Return type:

float

get_detector_values(file_name)

Gets detector values from Serpent simulation detector output file.

Parameters:

file_name (str) – Name of the Serpent results file (.det file).

Return type:

Pandas Dataframe

get_eigenvalue()

Gets implicit eigenvalue and uncertainty from Serpent results output file (serpent.i.res).

Returns:

Tuple containing the implicit k-eigenvalue and its statistical uncertainty.

Return type:

tuple

move_files(step=0)

Moves generated input and output files for a given timestep.

Parameters:

step (int or float) – Burnup step associated with files. Unblacklisted files in directory will be moved to this burnup step folder. Defaults to zero.

pillage()

Conducts a full coupled criticality search-burnup calculation over the designated burnup steps.

regressive_secant(xs, fs)

Conducts a regressive secant evaluation to find next search value.

Parameters:
  • xs (float, list of floats) – Initial and/or previous input values to be used in the search. Requires at least two starting values.

  • fs (float, list of floats) – Function values corresponding to the xs values provided.

Return type:

float

Conducts criticality search by default. If a function is provided, a generic search will be conducted.

Parameters:
  • config (str) – Determines the format of the input file used in the search. Can be ‘initial’ or ‘’.

  • function (function object)

Returns:

Contains maximum, minimum, and critical k-eigenvalues and the associated critical search value, respectively. If a generic search, the list contains search values with the last element being the final value.

Return type:

list

run_serpent()

Runs the generated serpent input file.

write_serpent(x, particles, config, step=0)

Writes serpent input files.

Parameters:
  • x (float) – The value used for determining control surface positioning in the control_base.i file.

  • particles (int) – The number of particles per generation to use in the Serpent simulation.

  • config (str) – Determines the format of the input file. Can be ‘initial’, ‘initialBurn’, ‘burn’, or ‘’.

  • step (int or float) – Burnup step to use for burnup calculation. Defaults to zero.

Returns:

Generates serpent.i file.

Return type:

file