saltproc.openmc_depcode module

class saltproc.openmc_depcode.OpenMCDepcode(output_path, exec_path, template_input_file_path, geo_file_paths, depletion_settings, chain_file_path)[source]

Bases: Depcode

Interface for running depletion steps in OpenMC, as well as obtaining depletion step results.

neutronics_parameters

Holds OpenMC depletion step neutronics parameters. Parameter names are keys and parameter values are values.

Type

dict of str to type

step_metadata

Holds OpenMC depletion step metadata. Metadata labels are keys and metadata values are values.

Type

dict of str to type

runtime_inputfile

Paths to OpenMC input files used to run depletion step. Contains neutron settings and geometry.

Type

dict of str to str

runtime_matfile

Path to OpenMC material file containing materials used to run depletion step, and modified after fuel reprocessing.

Type

str

npop

Size of neutron population per cycle

Type

int

active_cycles

Number of active cycles.

Type

int

inactive_cycles

Number of inactive cycles.

Type

int

__init__(output_path, exec_path, template_input_file_path, geo_file_paths, depletion_settings, chain_file_path)[source]

Initialize a OpenMCDepcode object.

Parameters
  • output_path (str) – Path to results storage directory.

  • exec_path (str) – Path to OpenMC depletion script.

  • template_input_file_path (dict of str to str) – Path to user input files (.xml file for geometry, material, and settings) for OpenMC. File type as strings are keys (e.g. ‘geometry’, ‘settings’, ‘material’), and file path as strings are values.

  • geo_file_paths (str or list, optional) –

    Path to file that contains the reactor geometry.

    List of str if reactivity control by switching geometry is On or just str otherwise.

    depletion_settingsdict

    Keyword arguments to pass to openmc.model.deplete().

    chain_file_pathstr

    Path to depletion chain file

read_depleted_materials(read_at_end=False)[source]

Reads depleted materials from OpenMC’s depletion_results.h5 file and returns a dictionary with a Materialflow object for each depleted material.

Parameters

read_at_end (bool, optional) – If True, the function reads data at the end of the depletion step. Otherwise, the function reads data at the beginning of the depletion step.

Returns

depleted_materials – Dictionary containing depleted materials.

key

Name of burnable material.

value

Materialflow object holding composition and properties.

Return type

dict of str to Materialflow

read_neutronics_parameters()[source]

Reads OpenMC depletion step neutronics parameters and stores them in OpenMCDepcode object’s neutronics_parameters attribute.

read_step_metadata()[source]

Reads OpenMC’s depletion step metadata and stores it in the OpenMCDepcode object’s step_metadata attribute.

run_depletion_step(mpi_args=None, threads=None)[source]

Runs a depletion step in OpenMC as a subprocess

mpi_argslist of str

Arguments for running simulations on supercomputers using mpiexec or similar programs.

threadsint

Threads to use for shared-memory parallelism

switch_to_next_geometry()[source]

Switches the geometry file for the OpenMC depletion simulation to the next geometry file in geo_file_paths.

update_depletable_materials(mats, dep_end_time)[source]

Updates material file with reprocessed material compositions.

Parameters
  • mats (dict of str to Materialflow) –

    Dictionary containing reprocessed material compositions

    key

    Name of burnable material.

    value

    Materialflow object holding composition and properties.

  • dep_end_time (float) – Current time at the end of the depletion step (d).

write_depletion_settings(reactor, step_idx)[source]

Write the depeletion settings for the openmc.deplete module.

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

  • step_idx (int) – Current depletion step.

write_runtime_input(reactor, depletion_step, restart)[source]

Write OpenMC runtime input files for running depletion step.

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

  • depletion_step (int) – Current depletion time step.

  • restart (bool) – Is the current simulation restarted?

write_saltproc_openmc_tallies(materials, geometry)[source]

Write tallies for calculating burnup and delayed neutron parameters.

Parameters
  • materials (openmc.Materials object) – The materials for the depletion simulation

  • geometry (openmc.Geometry object) – The geometry for the depletion simulation