Skip to content

Template file tutorial

Jake Mikouchi edited this page Aug 6, 2026 · 7 revisions

Template files allow the user to provide MIDAS with a template input for the code interface to use when
conducting code executions and evaluating chromosome performances. optimization types and associated
code interfaces that support template files are shown below

Calculation Type Code Type
single_cycle parcs343
eq_cycle parcs343
axial_zones parcs343_axial

This functionality enhances user flexibility by giving users the ability to run the optimizations they
wish even if MIDAS is unable to handle the specific requirements of the code executions. An example
use case is maximizing shutdown margins. Currently, MIDAS is unable to construct PARCS input files to
compute shutdown margins, but a template file can be provided instead allowing the user to conduct an
optimization not natively available in MIDAS.

During the optimization, minimal edits are made to the template files and only required changes are made
which is usually limited to inserting the chromosomes into the into the template. For PARCS inputs, the
th_fdbk option in the template can be updated in addition to inserting the chromosome. To do this, the
th_fdbk option should be provided in the YAML file. Some information is used when printing the chromosome
to the template file including number of assemblies, core width, and core type, but, in most cases,
information provided in the options_block is ignored when using template files. IT IS UP TO THE USER TO
ENSURE THAT THE TEMPLATE HAS BEEN SET UP WITHOUT ERRORS. The cross-section pointers in PARCS
template files are not updated by MIDAS and should be set with this in mind.

single_cycle

To set up the template file for a single_cycle optimization the core map which is usually provided under
the 'RAD_CONF' flag in PARCS should be left blank. At least one line should be left between the 'RAD_CONF'
flag and the next flag in the input. An example is shown below:

"""
GEOM
...
  RAD_CONF

...
"""

eq_cycle

Setting up the template file for eq_cycle optimizations is similar to single_cycle templates with a few
additions. To set up the template file the core map which is provided under the 'RAD_CONF' flag in PARCS
should be left blank. At least one line should be left between the 'RAD_CONF' flag and the next flag in
the input. Similarly, the 'LOCATION' and 'SHUF_MAP' flags should be left blank with at least one line
between it and the next flag. Both the 'LOCATION' and 'SHUF_MAP' flags require additional settings by
parcs, these can be left in the template and will not be written in by MIDAS. An example is shown below:

"""
GEOM
...
  RAD_CONF

...

MCYCLE
...
  LOCATION 0

  SHUF_MAP 1 1

...

"""

axial_zones

PARCS template files for axial zone optimizations is slightly different to LP based optimizations. For
these templates, it is assumed that the initial LP as well as the location map and shuffling maps do not
change during the optimization and already exist in the template. To set up the template file the axial
assembly definitions must be removed except for assembly 10 which is assumed to be the radial reflector
assembly. MIDAS uses assembly 10 as a flag to know where to print the generated assembly definitions.
MIDAS will automatically insert the generated number of assembly definitions and only requires that a
space be left after assembly 10. The user must check that the cross-section designations in the template
file and the YAML file are consistent to ensure a successful optimization

When defining assembly types, MIDAS starts at designation of 100 and for each new assembly the designation
increases by 10. If two assemblies are being optimized then the two assemblies will be designated as 100
and 110 in the parcs input files. If a single assembly definition is intended to be used in multiple
locations in the LP, then the LP in the template file must reflect this. MIDAS will not change the LPs in
the input file for this optimization type.

"""
GEOM
...
  assy_type 10 1 2 3 4 5 REFL

...

"""

Clone this wiki locally