armi.reactor.zones module¶
A Zone object is a collection of locations in the Core. A Zones object is a collection of Zone objects. Together, they are used to conceptually divide the Core for analysis.
- class armi.reactor.zones.Zone(name: str, locations: typing.Optional[typing.List] = None, zoneType: type = <class 'armi.reactor.assemblies.Assembly'>)[source]¶
Bases:
object
A group of locations in the Core, used to divide it up for analysis. Each location represents an Assembly or a Block.
- VALID_TYPES = (<class 'armi.reactor.assemblies.Assembly'>, <class 'armi.reactor.blocks.Block'>)¶
- addLoc(loc: str) None [source]¶
Adds the location to this Zone.
- Parameters
loc (str) – Location within the Core.
Notes
This method does not validate that the location given is somehow “valid”. We are not doing any reverse lookups in the Reactor to prove that the type or location is valid. Because this would require heavier computation, and would add some chicken-and-the-egg problems into instantiating a new Reactor.
- Return type
None
- removeLoc(loc: str) None [source]¶
Removes the location from this Zone.
- Parameters
loc (str) – Location within the Core.
Notes
This method does not validate that the location given is somehow “valid”. We are not doing any reverse lookups in the Reactor to prove that the type or location is valid. Because this would require heavier computation, and would add some chicken-and-the-egg problems into instantiating a new Reactor.
- Return type
None
- addLocs(locs: List) None [source]¶
Adds the locations to this Zone.
- Parameters
items (list) – List of str objects
- removeLocs(locs: List) None [source]¶
Removes the locations from this Zone.
- Parameters
items (list) – List of str objects
- addItem(item: Union[armi.reactor.assemblies.Assembly, armi.reactor.blocks.Block]) None [source]¶
Adds the location of an Assembly or Block to a zone
- Parameters
item (Assembly or Block) – A single item with Core location (Assembly or Block)
- removeItem(item: Union[armi.reactor.assemblies.Assembly, armi.reactor.blocks.Block]) None [source]¶
Removes the location of an Assembly or Block from a zone
- Parameters
item (Assembly or Block) – A single item with Core location (Assembly or Block)
- class armi.reactor.zones.Zones[source]¶
Bases:
object
Collection of Zone objects.
Build a Zones object.
- property names: List¶
Ordered names of contained zones.
- Returns
Alphabetical collection of Zone names
- Return type
- addZone(zone: armi.reactor.zones.Zone) None [source]¶
Add a zone to the collection.
- Parameters
zone (Zone) – A new Zone to add to this collection.
- Return type
None
- addZones(zones: List) None [source]¶
Add multiple zones to the collection, then validate that this Zones collection still make sense.
- Parameters
zones (List (or Zones)) – A multiple new Zone objects to add to this collection.
- Return type
None
- removeZone(name: str) None [source]¶
Delete a zone by name
- Parameters
name (str) – Name of zone to remove
- Return type
None
- removeZones(names: List) None [source]¶
Delete multiple zones by name
- Parameters
names (List (or names)) – Multiple Zone names to remove from this collection.
- Return type
None
- checkDuplicates() None [source]¶
Validate that the the zones are mutually exclusive.
That is, make sure that no item appears in more than one Zone.
- Return type
None
- getZoneLocations(zoneNames: List) Set [source]¶
Get the location labels of a particular (or a few) zone(s).
- getAllLocations() Set [source]¶
Return all locations across every Zone in this Zones object
- Returns
A combination set of all locations, from every Zone
- Return type
- findZoneItIsIn(a: Union[armi.reactor.assemblies.Assembly, armi.reactor.blocks.Block]) Optional[armi.reactor.zones.Zone] [source]¶
Return the zone object that this Assembly/Block is in.
- Parameters
a (Assembly or Block) – The item to locate
- Returns
zone
- Return type
Zone object that the input item resides in.
- sortZones(reverse=False) None [source]¶
Sorts the Zone objects alphabetically.
- Parameters
reverse (bool, optional) – Whether to sort in reverse order, by default False
- summary() None [source]¶
Summarize the zone defintions clearly, and in a way that can be copy/pasted back into a settings file under “zoneDefinitions”, if the user wants to manually re-use these zones later.
Examples
zoneDefinitions: - ring-1: 001-001 - ring-2: 002-001, 002-002 - ring-3: 003-001, 003-002, 003-003