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
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:
armi.interfaces.Interface
Class for interacting with lattice physics codes.
Construct an interface.
The
r
andcs
arguments are required, but may beNone
, where appropriate for the specificInterface
implementation.- Parameters
- Raises
RuntimeError – Interfaces derived from Interface must define their name
-
function
= 'latticePhysics'¶
-
interactBOC
(**kwargs)¶
-
updateXSLibrary
(cycle)[source]¶ Update the current XS library, either by creating or reloading one.
- Parameters
cycle (int) – The cycle that is being processed. Used to name the library.
See also
computeCrossSections()
run lattice physics on the current reactor state no matter weather needed or not.
-
_renameExistingLibrariesForCycle
(cycle)[source]¶ Copy the existing neutron and/or gamma libraries into cycle-dependent files.
-
interactCoupled
(iteration)[source]¶ Runs on secondary coupled iterations.
After a coupled iteration, the cross sections need to be regenerated. This will bring in the spectral effects of changes in densities, as well as changes in Doppler.
- 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
-
_generateXsLibrary
(baseList, forceSerial, xsLibrarySuffix, blockList, writers=None, purgeFP=True)[source]¶
-
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
See also
terrapower.physics.neutronics.mc2.mc2Writers.Mc2V2Writer.write()
,armi.physics.neutronics.latticePhysics.serpentWriters.SerpentWriter.write()
-
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
-
_newLibraryShouldBeCreated
(cycle, representativeBlockList, xsIDs)[source]¶ Determines whether the cross section generator should be executed at this cycle.
Criteria include:
genXS setting is turned on
We are beyond any requested skipCycles (restart cycles)
The blocks have changed burnup beyond the burnup threshold
Lattice physics kernel (e.g. MC2) hasn’t already been executed for this cycle (possible if it runs during fuel handling)
-
_checkBurnupThresholds
(blockList)[source]¶ Check to see if burnup has changed meaningfully.
If there are, then the xs sets should be regenerated. Otherwise then go ahead and skip xs generation.
This is motivated by the idea that during very long explicit equilibrium runs, it might save time to turn off xs generation at a certain point.
- Parameters
blockList (iterable) – List of all blocks to examine
- Returns
idsChangedBurnup – flag regarding whether or not burnup changed substantially
- Return type