openmc.deplete.StepResult

class openmc.deplete.StepResult[source]

Result of a single depletion timestep

Changed in version 0.13.1: Name changed from Results to StepResult

Variables:
  • k (tuple of (float, float)) – Eigenvalue and uncertainty at end of step.

  • time (list of float) – Time at beginning, end of step, in seconds.

  • source_rate (float) – Source rate during timestep in [W] or [neutron/sec]

  • n_mat (int) – Number of mats.

  • n_nuc (int) – Number of nuclides.

  • rates (ReactionRates) – The reaction rates at end of step.

  • volume (dict of str to float) – Dictionary mapping mat id to volume.

  • index_mat (dict of str to int) – A dictionary mapping mat ID as string to index.

  • index_nuc (dict of str to int) – A dictionary mapping nuclide name as string to index.

  • mat_to_hdf5_ind (dict of str to int) – A dictionary mapping mat ID as string to global index.

  • n_hdf5_mats (int) – Number of materials in entire geometry.

  • data (numpy.ndarray) – Atom quantity, stored by mat, then by nuclide.

  • proc_time (int) – Average time spent depleting a material across all materials and processes

  • keff_search_root (float) – The root returned by the keff search control.

allocate(volume, nuc_list, burn_list, full_burn_list, name_list=None)[source]

Allocate memory for depletion step data

Parameters:
  • volume (dict of str float) – Volumes corresponding to materials in full_burn_dict

  • nuc_list (list of str) – A list of all nuclide names. Used for sorting the simulation.

  • burn_list (list of int) – A list of all mat IDs to be burned. Used for sorting the simulation.

  • full_burn_list (list of str) – List of all burnable material IDs

  • name_list (list of str, optional) – Material names corresponding to materials in full_burn_list

distribute(local_materials, ranges)[source]

Create a new object containing data for distributed materials

Parameters:
  • local_materials (iterable of str) – Materials for this process

  • ranges (iterable of int) – Slice-like object indicating indicies of local_materials in the material dimension of data and each element in rates

Returns:

New results object

Return type:

StepResult

export_to_hdf5(filename, step, write_rates: bool = False)[source]

Export results to an HDF5 file

Parameters:
  • filename (str) – The filename to write to

  • step (int) – What step is this?

  • write_rates (bool, optional) – Whether to include reaction rate datasets in the results file.

classmethod from_hdf5(handle, step)[source]

Loads results object from HDF5.

Parameters:
  • handle (h5py.File or h5py.Group) – An HDF5 file or group type to load from.

  • step (int) – Index for depletion step

get_material(mat_id: str | int) Material[source]

Return material object for given depleted composition

Added in version 0.13.2.

Parameters:

mat_id (str or int) – Material ID as a string or integer

Returns:

Equivalent material

Return type:

openmc.Material

Raises:

KeyError – If specified material ID is not found in the StepResult

static save(op, x, op_results, t, source_rate, step_ind, proc_time=None, write_rates: bool = False, keff_search_root=None, path: str | PathLike = 'depletion_results.h5')[source]

Creates and writes depletion results to disk

Parameters:
  • op (openmc.deplete.abc.TransportOperator) – The operator used to generate these results.

  • x (numpy.array) – End-of-step concentrations for each material

  • op_results (openmc.deplete.OperatorResult) – Result of applying transport operator at end of step

  • t (list of float) – Time indices.

  • source_rate (float) – Source rate during time step in [W] or [neutron/sec]

  • step_ind (int) – Step index.

  • proc_time (float or None) – Total process time spent depleting materials. This may be process-dependent and will be reduced across MPI processes.

  • write_rates (bool, optional) – Whether reaction rates should be written to the results file.

  • keff_search_root (float) – The root returned by the keff search control.

  • path (PathLike) –

    Path to file to write. Defaults to ‘depletion_results.h5’.

    Added in version 0.14.0.

transfer_volumes(model)[source]

Transfers volumes from depletion results to geometry

Parameters:

model (OpenMC model to be used in a depletion restart) – calculation