saltproc.Depcode¶
- class saltproc.Depcode(codename, output_path, exec_path, template_input_file_path, geo_file_paths)[source]¶
Abstract interface for running depletion steps.
- 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.
- Variables
neutronics_parameters (dict of str to type) – Holds depletion step neutronics parameters. Parameter names are keys and parameter values are values.
step_metadata (dict of str to type) – Holds depletion code depletion step metadata. Metadata labels are keys and metadata values are values.
depcode_metadata (dict of str to type) – Holds depletion code simulation metadata. Metadata labels are keys and metadata values are values.
runtime_inputfile (str) – Path to input file used to run depletion step.
runtime_matfile (str) – Path to material file containing burnable materials used to run depletion step.
npop (int) – Size of neutron population per cycle
active_cycles (int) – Number of active cycles.
inactive_cycles (int) – Number of inactive cycles.
- abstract name_to_nuclide_code(nucname)[source]¶
Converts depcode nuclide name to ZA nuclide code
- Parameters
nucname (str) – Nuclide namce
- Returns
nuc_name – ZA nuclide code
- Return type
str
- abstract nuclide_code_to_name(nuc_code)[source]¶
Converts depcode nuclide code to symbolic nuclide name.
- Parameters
nuc_code (str) – Nuclide code
- Returns
nuc_name – Symbolic nuclide name (Am242m1).
- Return type
str
- preserve_simulation_files(step_idx)[source]¶
Move simulation input and output files to unique a directory
- Parameters
step_idx (int) –
- abstract read_depcode_metadata()[source]¶
Read depletion code metadata, and store it in the
Depcode
object’sdepcode_metadata
attribute
- 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’sneutronics_parameters
attribute.
- read_plaintext_file(file_path)[source]¶
Reads the content of a plaintext file for use by other methods.
- Parameters
file_path (str) – Path to file.
- Returns
file_lines – File lines.
- Return type
list of str
- abstract read_step_metadata()[source]¶
Reads depletion step metadata and stores it in the
Depcode
object’sstep_metadata
attribute.
- rebuild_simulation_files(step_idx)[source]¶
Move simulation input and output files from unique directory to runtime directory
- Parameters
step_idx (int) –
- run_depletion_step(mpi_args, args)[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.args (list of str) – Arguments for running depletion step.
- 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?