armi.physics.neutronics.latticePhysics.latticePhysicsInterface module
” Lattice Physics Interface.
Parent classes for codes responsible for generating broad-group cross sections
- armi.physics.neutronics.latticePhysics.latticePhysicsInterface.setBlockNeutronVelocities(r, neutronVelocities)[source]
Set the
mgNeutronVelocity
parameter for each block using theneutronVelocities
dictionary data.- Parameters:
r (Reactor) – A Reactor object, that we want to modify.
neutronVelocities (dict) – Dictionary that is keyed with the
representativeBlock
XS IDs with values of multigroup neutron velocity data computed by MC2.
- Raises:
ValueError – Multi-group neutron velocities was not computed during the cross section calculation.
- class armi.physics.neutronics.latticePhysics.latticePhysicsInterface.LatticePhysicsInterface(r, cs)[source]
Bases:
Interface
Class for interacting with lattice physics codes.
- function = 'latticePhysics'
The function performed by an Interface. This is not required be be defined by implementations of Interface, but is used to form categories of interfaces.
- interactBOL(cycle=0)[source]
Run the lattice physics code if
genXS
is set and update burnup groups.Generate new cross sections based off the case settings and the current state of the reactor if the lattice physics frequency is BOL.
- interactBOC(cycle=0)[source]
Run the lattice physics code if
genXS
is set and update burnup groups.Generate new cross sections based off the case settings and the current state of the reactor if the lattice physics frequency is BOC.
Notes
armi.physics.fuelCycle.fuelHandlerInterface.FuelHandlerInterface.interactBOC()
also calls this if therunLatticePhysicsBeforeShuffling
setting is True. This happens because branch searches may need XS.
- updateXSLibrary(cycle, node=None)[source]
Update the current XS library, either by creating or reloading one.
- Parameters:
See also
computeCrossSections
run lattice physics on the current reactor state no matter weather needed or not.
- interactEveryNode(cycle=None, node=None)[source]
Run the lattice physics code if
genXS
is set and update burnup groups.Generate new cross sections based off the case settings and the current state of the reactor if the lattice physics frequency is at least everyNode.
If this is not a coupled calculation, or if cross sections are only being generated at everyNode, then we want to regenerate all cross sections here. If it _is_ a coupled calculation, and we are generating cross sections at coupled iterations, then keep the existing XS lib for now, adding any XS groups as necessary to ensure that all XS groups are covered.
- interactCoupled(iteration)[source]
Runs on coupled iterations to generate cross sections that are updated with the temperature state.
Notes
This accounts for changes in cross section data due to temperature changes, which are important for cross section resonance effects and accurately characterizing Doppler constant and coefficient evaluations. For Standard and Equilibrium run types, this coupling iteration is limited to when the time node is equal to zero. The validity of this assumption lies in the expectation that these runs have consistent power, flow, and temperature conditions at all time nodes. For Snapshot run types, this assumption, in general, is invalidated as the requested reactor state may sufficiently differ from what exists on the database and where tight coupling is needed to capture temperature effects.
Warning
For Standard and Equilibrium run types, if the reactor power, flow, and/or temperature state is expected to vary over the lifetime of the simulation, as could be the case with detailed cycle histories, a custom subclass should be considered.
- Parameters:
iteration (int) – This is unused since cross sections are generated on a per-cycle basis.
- interactEOC(cycle=None)[source]
Interact at the end of a cycle.
Force updating cross sections at the start of the next cycle.
- computeCrossSections(baseList=None, forceSerial=False, xsLibrarySuffix='', blockList=None)[source]
Prepare a batch of inputs, execute them, and store results on reactor library.
- Parameters:
baseList (list) – a user-specified set of bases that will be run instead of calculating all of them
forceSerial (bool, optional) – Will run on 1 processor in sequence instead of on many in parallel Useful for optimization/batch runs where every processor is on a different branch
xsLibrarySuffix (str, optional) – A book-keeping suffix used in Doppler calculations
blockList (list, optional) – List of blocks for which to generate cross sections. If None, representative blocks will be determined
- generateLatticePhysicsInputs(baseList, xsLibrarySuffix, blockList, xsWriters=None)[source]
Write input files for the generation of cross section libraries.
- Parameters:
baseList (list) – A list of cross-section id strings (e.g. AA, BC) that will be generated. Default: all in reactor
xsLibrarySuffix (str) – A suffix added to the end of the XS file names such as ‘voided’ for voided XS. Default: Empty
blockList (list) – The blocks to write inputs for.
xsWriters (list, optional) – The specified writers to write the input files
- Returns:
returnedFromWriters – A list of what this specific writer instance returns for each representative block. It is the responsibility of the subclassed interface to implement. In many cases, it is the executing agent.
- Return type:
- getWriters(representativeBlock, xsLibrarySuffix, writers=None)[source]
Return valid lattice physics writer subclass(es).
- Parameters:
representativeBlock (Block) – A representative block object that can be created from a block collection.
xsLibrarySuffix (str) – A suffix added to the end of the XS file names such as ‘voided’ for voided XS. Default: Empty
writers (list of lattice physics writer objects, optional) – If the writers are known, they can be provided and constructed.
- Returns:
writers – A list of writers for the provided representative block.
- Return type: