saltproc.simulation module

class saltproc.simulation.Simulation(sim_name='default', sim_depcode='SERPENT', core_number=1, node_number=1, h5_file='db_saltproc.h5', compression=Filters(complevel=9, complib='blosc', shuffle=True, bitshuffle=False, fletcher32=True, least_significant_digit=None), iter_matfile='./saltproc_mat')[source]

Bases: object

Class sets up parameters for simulation, runs Serpent, parses output, creates input.

__init__(sim_name='default', sim_depcode='SERPENT', core_number=1, node_number=1, h5_file='db_saltproc.h5', compression=Filters(complevel=9, complib='blosc', shuffle=True, bitshuffle=False, fletcher32=True, least_significant_digit=None), iter_matfile='./saltproc_mat')[source]

Initializes the Simulation object.

Parameters
  • sim_name (str) – Name of simulation may contain number of reference case, paper name or other specific information to identify simulation.

  • sim_depcode (obj) – Depcode object initiated using Depcode class.

  • cores (int) – Number of cores to use for Serpent run (-omp flag in Serpent).

  • nodes (int) – Number of nodes to use for Serpent run (-mpi flag in Serpent).

  • h5_file (str) – Name of HDF5 database.

  • compression (Pytables filter object) – HDF5 database compression parameters.

  • iter_matfile (str) – Name of file containing burnable materials composition used in Serpent runs and update after each depletion step.

check_switch_geo_trigger(current_time, switch_time)[source]

Compares current timestep with user defined time to switch geometry. Returns True if its time.

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, restart)[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.

  • restart (bool) – Was this simulation restarted?

Returns

Is the reactor will become subcritical at the next step?

Return type

bool

runsim_no_reproc(reactor, nsteps)[source]

Run simulation sequence for integral test. No reprocessing involved, just re-running Serpent for comparision with model output.

Parameters
  • reactor (Reactor) – Contains information about power load curve and cumulative depletion time for the integration test.

  • nsteps (int) – Number of depletion time steps in integration test run.

store_after_repr(after_mats, waste_dict, step)[source]

Adds to HDF5 database waste streams data for each process after reprocessing was performed (grams per depletion step).

Parameters
  • after_mats (Materialflow) – Burnable material stream object 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.

  • step (int) – Current depletion step.

store_mat_data(mats, d_step, moment)[source]

Initializes HDF5/Pytables database (if not exist) or append burnable material composition, mass, density, volume, temperature, burnup, mass_flowrate, void_fraction, at the current depletion step to it.

Parameters
  • mats (dict of str to Materialflow) –

    Dictionary that contains Materialflow objects.

    key

    Name of burnable material.

    value

    Materialflow object holding composition and properties.

  • d_step (int) – Current depletion step.

  • moment (int) – Indicates at which moment in the depletion step store the data. 0 refers the beginning, 1 refers the end of depletion step.

store_run_init_info()[source]

Adds to database Serpent and Saltproc simulation parameters before starting depletion sequence.

store_run_step_info()[source]

Adds to database Serpent and Saltproc simulation parameters (execution time, memory usage), multiplication factor, breeding ratio, delayed neutron precursor data, fission mass, cumulative depletion time, power level for the current time step.

switch_to_next_geometry()[source]

Inserts line with path to next Serpent geometry file at the beginning of the Serpent iteration input file.