saltproc.Simulation

class saltproc.Simulation(sim_name='default', sim_depcode='depcode', db_path='db_saltproc.h5', restart_flag=True, adjust_geo=False, compression_params=Filters(complevel=9, complib='blosc', shuffle=True, bitshuffle=False, fletcher32=True, least_significant_digit=None))[source]

Class for handling simulation information. Contains information for running simulation wiht parallelism. Also contains the simulation name, a Depcode object, and the filename for the simulation database. Contains methods to store simulation metadata and depletion results in a database, predict reactor criticality at next depletion step, and switch simulation geometry.

Parameters
  • sim_name (str) – Name to identify the simulation. May contain information such as the number of a reference case, a paper name, or some other specific information identify the simulation.

  • sim_depcode (Depcode object) – An instance of one of the Depcode child classes

  • db_path (str) – Path of HDF5 database that stores simulation information and data.

  • restart_flag (bool) – This value determines our initial condition. If True, then then we run the simulation starting from the inital material composition in the material input file inside our depcode object. If False, then we runthe simulation starting from the final material composition resulting within the .h5 database.

  • adjust_geo (bool) – This value determines if we switch reactor geometry when keff drops below 1.0

  • compression_params (Pytables filter object) – Compression parameters for HDF5 database.

check_restart()[source]

If the user set restart_flag for False clean out iteration files and database from previous run.

Parameters

restart_flag (bool) – Is the current simulation restarted?

Returns

failed_step – The depletion step that the simulation failed on.

Return type

int

check_switch_geo_trigger(current_time, switch_time)[source]

Compares the current timestep with the user defined times at which to switch reactor geometry, and returns True if there is a match.

Parameters
  • current_timestep (int) – Current time after depletion started.

  • switch_time (list) – List containing moments in time when geometry have to be switched.

Returns

is the next geometry must be used at the next step?

Return type

bool

read_k_eds_delta(current_timestep)[source]

Reads from database delta between previous and current keff at the end of depletion step and returns True if predicted keff at the next depletion step drops below 1.

Parameters

current_timestep (int) – Number of current depletion time step.

Returns

Is the reactor will become subcritical at the next step?

Return type

bool

store_after_repr(after_mats, waste_dict, dep_step)[source]

Add data for waste streams [grams per depletion step] of each process to the HDF5 database after reprocessing.

Parameters
  • after_mats (Materialflow) – Materialflow object representing a material stream after performing reprocessing.

  • waste_dict (dict of str to Materialflow) –

    Dictionary that maps Process objects to waste Materialflow objects.

    key

    Process name (str)

    value

    Materialflow object containing waste streams data.

  • dep_step (int) – Current depletion time step.

store_depcode_metadata()[source]

Adds the following depletion code and SaltProc simulation parameters to the database: neutron population, active cycles, inactive cycles, depletion code version simulation title, depetion code input file path, depletion code working directory, cross section data path, # of OMP threads, # of MPI tasks, memory optimization mode (Serpent), depletion timestep size.

store_mat_data(mats, dep_step, store_at_end=False)[source]

Initialize the HDF5/Pytables database (if it doesn’t exist) or append the following data at the current depletion step to the database: burnable material composition, mass, density, volume, burnup, mass_flowrate, void_fraction.

Parameters
  • mats (dict of str to Materialflow) –

    Dictionary that contains Materialflow objects.

    key

    Name of burnable material.

    value

    Materialflow object holding composition and properties.

  • dep_step (int) – Current depletion step.

  • store_at_end (bool, optional) – Controls at which moment in the depletion step to store data from. If True, the function stores data from the end of the depletion step. Otherwise, the function stores data from the beginning of the depletion step.

store_step_metadata()[source]

Adds the following depletion code and SaltProc simulation parameters to the database: neutron population, active cycles, inactive cycles, # of OMP threads, # of MPI tasks, memory optimization mode (Serpent), depletion timestep size.

store_step_neutronics_parameters()[source]

Adds the following depletion code and SaltProc simulation data at the current depletion step to the database: execution time, memory usage, multiplication factor, breeding ratio, delayed neutron precursor data, fission mass, cumulative depletion time, power level.