saltproc.abc module

class saltproc.abc.Depcode(codename, output_path, exec_path, template_input_file_path, geo_file_paths)[source]

Bases: ABC

Abstract interface for running depletion steps.

neutronics_parameters

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

Type

dict of str to type

step_metadata

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

Type

dict of str to type

runtime_inputfile

Path to input file used to run depletion step.

Type

str

runtime_matfile

Path to material file containing burnable materials used to run depletion step.

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__(codename, output_path, exec_path, template_input_file_path, geo_file_paths)[source]

Initialize a Depcode object.

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

  • codename (str) – Name of depletion code.

  • exec_path (str) – Path to depletion code executable.

  • template_input_file_path (str or dict of str to str) – Path(s) to depletion code input file(s), or a dictionary where the input type (e.g. material, geometry, settings, etc.) as a string are keys, and the path to the input file are values. Type depends on depletion code in use.

  • 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.

abstract read_depleted_materials(read_at_end=False)[source]

Reads depleted materials from the depletion step results and returns a dictionary containing them.

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 material composition and properties.

Return type

dict of str to Materialflow

abstract read_neutronics_parameters()[source]

Reads depletion code’s depletion step neutronics parameters and stores them in Depcode object’s neutronics_parameters attribute.

abstract read_step_metadata()[source]

Reads depletion code’s depletion step metadata and stores it in the Depcode object’s step_metadata attribute.

abstract run_depletion_step(mpi_args, threads)[source]

Runs a depletion step as a subprocess with the given parameters.

Parameters
  • mpi_args (list of str) – Arguments for running simulations on supercomputers using mpiexec or similar programs.

  • threads (int) – Threads to use for shared-memory parallelism

abstract switch_to_next_geometry()[source]

Changes the geometry used in the depletion code simulation to the next geometry file in geo_file_paths

abstract update_depletable_materials(mats, dep_end_time)[source]

Update 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).

abstract write_runtime_input(reactor, dep_step, restart)[source]

Write input file(s) for running depletion step

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

  • dep_step (int) – Current depletion time step.

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