armi.reactor.blueprints.gridBlueprint module
Input definitions for Grids.
Grids are given names which can be referred to on other input structures (like core maps and pin maps).
These are in turn interpreted into concrete things at lower levels. For example:
Core map lattices get turned into
armi.reactor.grids
, which get set tocore.spatialGrid
.Block pin map lattices get applied to the components to provide some subassembly spatial details.
Lattice inputs here are floating in space. Specific dimensions and anchor points are handled by the lower-level objects definitions. This is intended to maximize lattice reusability.
See also
armi.utils.asciimaps
Description of the ascii maps and their formats.
Examples
grids:
control:
geom: hex
symmetry: full
lattice map: |
- - - - - - - - - 1 1 1 1 1 1 1 1 1 4
- - - - - - - - 1 1 1 1 1 1 1 1 1 1 1
- - - - - - - 1 8 1 1 1 1 1 1 1 1 1 1
- - - - - - 1 1 1 1 1 1 1 1 1 1 1 1 1
- - - - - 1 1 1 1 1 1 1 1 1 1 1 1 1 1
- - - - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
- - - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
- - 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
7 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 3 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1
1 6 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
sfp:
geom: cartesian
lattice pitch:
x: 25.0
y: 25.0
lattice map: |
2 2 2 2 2
2 1 1 1 2
2 1 3 1 2
2 3 1 1 2
2 2 2 2 2
core:
geom: hex
symmetry: third periodic
origin:
x: 0.0
y: 10.1
z: 1.1
lattice map: |
- SH SH SH
- SH SH SH SH
SH RR RR RR SH
RR RR RR RR SH
RR RR RR RR RR SH
RR OC OC RR RR SH
OC OC OC RR RR SH
OC OC OC OC RR RR
OC MC OC OC RR SH
MC MC PC OC RR SH
MC MC MC OC OC RR
MC MC MC OC RR SH
PC MC MC OC RR SH
MC MC MC MC OC RR
IC MC MC OC RR SH
IC US MC OC RR
IC IC MC OC RR SH
IC MC MC OC RR
IC IC MC PC RR SH
- class armi.reactor.blueprints.gridBlueprint.Triplet(*args, **kwargs)[source]
Bases:
Object
A x, y, z triplet for coordinates or lattice pitch.
- attributes = <yamlize.attribute_collection.AttributeCollection object>
- class armi.reactor.blueprints.gridBlueprint.GridBlueprint(*args, **kwargs)[source]
Bases:
Object
A grid input blueprint.
These directly build Grid objects and contain information about how to populate the Grid with child ArmiObjects for the Reactor Model.
The grids get origins either from a parent block (for pin lattices) or from a System (for Cores, SFPs, and other components).
- Variables:
name (str) – The grid name
geom (str) – The geometry of the grid (e.g. ‘cartesian’)
latticeMap (str) – An asciimap representation of the lattice contents
latticeDimensions (Triplet) – An x/y/z Triplet with grid dimensions in cm. This is used to specify a uniform grid, such as Cartesian or Hex. Mutually exclusive with gridBounds.
gridBounds (dict) – A dictionary containing explicit grid boundaries. Specific keys used will depend on the type of grid being defined. Mutually exclusive with latticeDimensions.
symmetry (str) – A string defining the symmetry mode of the grid
gridContents (dict) – A {(i,j): str} dictionary mapping spatialGrid indices in 2-D to string specifiers of what’s supposed to be in the grid.
A Grid blueprint.
Notes
yamlize does not call an
__init__
method, instead it uses__new__
and setattr this is only needed for when you want to make this object from a non-YAML source.Warning
This is a Yamlize object, so
__init__
never really gets called. Only__new__
does.- property readFromLatticeMap
This is implemented as a property, since as a Yamlize object,
__init__
is not always called and we have to lazily evaluate its default value.
- attributes = <yamlize.attribute_collection.AttributeCollection object>
- expandToFull()[source]
Unfold the blueprints to represent full symmetry.
Notes
This relatively rudimentary, and copies entries from the currently-represented domain to their corresponding locations in full symmetry. This may not produce the desired behavior for some scenarios, such as when expanding fuel shuffling paths or the like. Future work may make this more sophisticated.
- class armi.reactor.blueprints.gridBlueprint.Grids(*args, **kwargs)[source]
Bases:
KeyedList
Initialize a Map.
- Parameters:
*args – sequence of key/value pairs.
**kwargs – kwargs for input to OrderedDict.
- attributes = <yamlize.attribute_collection.KeyedListAttributeCollection object>
- item_type
alias of
GridBlueprint
- armi.reactor.blueprints.gridBlueprint.saveToStream(stream, bluep, full=False, tryMap=False)[source]
Save the blueprints to the passed stream.
This can save either the entire blueprints, or just the grids: section of the blueprints, based on the passed
full
argument. Saving just the grid blueprints can be useful when cobbling blueprints together with !include flags.- Parameters:
stream – file output stream of some kind
bluep (armi.reactor.blueprints.Blueprints, or Grids) –
full (bool) – Is this a full output file, or just a partial/grids?
tryMap (bool) – regardless of input form, attempt to output as a lattice map