armi.reactor.flags module

Handles flags that trigger behaviors related to reactor parts.

Flags are used to trigger certain treatments by the various modules. For instance, if a module needs to separate reflector assemblies from fuel assemblies, it can use flags.

Flags are derived from the user-input name. If a valid flag name is included in a assembly/block/component name, then that flag will be applied. Words in names that are not valid flags are ignored from a flags perspective. Each flag in the name must be space-delimited to be parsed properly. If a name includes numbers, they are generally ignored to avoid defining hundreds of flags for assemblies with many pins in them (e.g. in pin-level depletion cases). Use FUEL A or FUEL B to distinguish if necessary.

Code modules that check the names of objects must use valid flags only.

Things that flags are used for include:

  • Fuel management: Different kinds of assemblies (LTAs, fuel, reflectors) have different shuffling operations and must be distinguished. Often names are good ways to pick assemblies but details may need a flag (e.g. STATIONARY for grid plate blocks, though keeping grid plates out of the Assemblies may be a better option in this case.)

  • Fuel performance: Knowing what’s fuel and what’s plenum is important to figure out what things to grow and where to move fission gas to.

  • Safety: Test assemblies like LTAs go in their own special channels and must be identified. Reflectors, control, shields go into bypass channels. Handling sockets, shield blocks, etc. go in their own axial nodes.

  • Fluid fuel reactors need to find all the fuel that ever circulates through the

reactor so it can be depleted with the average flux.

  • Mechanical often needs to know if an object is solid, fluid, or void (material

subclassing can handle this).

  • T/H needs to find the pin bundle in different kinds of assemblies (radial shield block in radial shield assemblies, fuel in fuel, etc.). Also needs to generate 3-layer pin models with pin (fuel/control/shield/slug), then gap (liners/gap/bond), then clad.

Also:

  • Object names should explicitly tied to their definition in the input

Notes

The flags used to be based only on the user-input name of the object but there was too much flexibility and inconsistencies arose.

Examples

>>> block.hasFlags(Flags.PRIMARY | Flags.TEST | Flags.FUEL)
True
>>> block.hasFlags([Flags.PRIMARY, Flags.TEST, Flags.FUEL])
True
>>> block.getComponent(Flags.INTERDUCTCOOLANT)
<component InterDuctCoolant>
>>> block.getComponents(Flags.FUEL)
[<component fuel1>, <component fuel2>, ...]
class armi.reactor.flags.Flags(init=0)[source]

Bases: armi.utils.flags.Flag

Defines the valid flags used in the framework.

PRIMARY = <Flags.PRIMARY: 1>
SECONDARY = <Flags.SECONDARY: 2>
TERTIARY = <Flags.TERTIARY: 4>
ANNULAR = <Flags.ANNULAR: 8>
A = <Flags.A: 16>
B = <Flags.B: 32>
C = <Flags.C: 64>
D = <Flags.D: 128>
E = <Flags.E: 256>
CORE = <Flags.CORE: 512>
REACTOR = <Flags.REACTOR: 1024>
MATERIAL = <Flags.MATERIAL: 2048>
FUEL = <Flags.FUEL: 4096>
TEST = <Flags.TEST: 8192>
CONTROL = <Flags.CONTROL: 16384>
ULTIMATE = <Flags.ULTIMATE: 32768>
SHUTDOWN = <Flags.SHUTDOWN: 65536>
SHIELD = <Flags.SHIELD: 131072>
SHIELD_BLOCK = <Flags.SHIELD_BLOCK: 262144>
SLUG = <Flags.SLUG: 524288>
REFLECTOR = <Flags.REFLECTOR: 1048576>
DRIVER = <Flags.DRIVER: 2097152>
IGNITER = <Flags.IGNITER: 4194304>
FEED = <Flags.FEED: 8388608>
STARTER = <Flags.STARTER: 16777216>
BLANKET = <Flags.BLANKET: 33554432>
BOOSTER = <Flags.BOOSTER: 67108864>
TARGET = <Flags.TARGET: 134217728>
INNER = <Flags.INNER: 268435456>
MIDDLE = <Flags.MIDDLE: 536870912>
OUTER = <Flags.OUTER: 1073741824>
RADIAL = <Flags.RADIAL: 2147483648>
AXIAL = <Flags.AXIAL: 4294967296>
UPPER = <Flags.UPPER: 8589934592>
LOWER = <Flags.LOWER: 17179869184>
DUCT = <Flags.DUCT: 34359738368>
GRID_PLATE = <Flags.GRID_PLATE: 68719476736>
HANDLING_SOCKET = <Flags.HANDLING_SOCKET: 137438953472>
INLET_NOZZLE = <Flags.INLET_NOZZLE: 274877906944>
PLENUM = <Flags.PLENUM: 549755813888>
BOND = <Flags.BOND: 1099511627776>
LINER = <Flags.LINER: 2199023255552>
CLAD = <Flags.CLAD: 4398046511104>
PIN = <Flags.PIN: 8796093022208>
GAP = <Flags.GAP: 17592186044416>
WIRE = <Flags.WIRE: 35184372088832>
COOLANT = <Flags.COOLANT: 70368744177664>
INTERCOOLANT = <Flags.INTERCOOLANT: 140737488355328>
ACLP = <Flags.ACLP: 281474976710656>
SKID = <Flags.SKID: 562949953421312>
VOID = <Flags.VOID: 1125899906842624>
INTERDUCTCOOLANT = <Flags.INTERDUCTCOOLANT: 2251799813685248>
DSPACERINSIDE = <Flags.DSPACERINSIDE: 4503599627370496>
CORE_BARREL = <Flags.CORE_BARREL: 9007199254740992>
DUMMY = <Flags.DUMMY: 18014398509481984>
BATCHMASSADDITION = <Flags.BATCHMASSADDITION: 36028797018963968>
POISON = <Flags.POISON: 72057594037927936>
STRUCTURE = <Flags.STRUCTURE: 144115188075855872>
DEPLETABLE = <Flags.DEPLETABLE: 288230376151711744>
classmethod fromStringIgnoreErrors(typeSpec)[source]
classmethod fromString(typeSpec)[source]
classmethod toString(typeSpec)[source]
exception armi.reactor.flags.InvalidFlagsError[source]

Bases: KeyError

Raised when code attempts to look for an undefined flag.

armi.reactor.flags.registerPluginFlags(pm)[source]

Apply flags specified in the passed PluginManager to the Flags class.