armi.physics.neutronics.globalFlux.globalFluxInterface module¶
The Global flux interface provide a base class for all neutronics tools that compute the neutron and/or photon flux.
-
class
armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxInterface(r, cs)[source]¶ Bases:
armi.interfaces.InterfaceA general abstract interface for global flux calculating modules.
Should be subclassed
Construct an interface.
The
randcsarguments are required, but may beNone, where appropriate for the specificInterfaceimplementation.- Parameters
- Raises
RuntimeError – Interfaces derived from Interface must define their name
-
name= None¶
-
function= 'globalFlux'¶
-
getHistoryParams()[source]¶ Return parameters that will be added to assembly versus time history printouts.
-
getIOFileNames(cycle, node, coupledIter=None, additionalLabel='')[source]¶ Return the input and output file names for this run.
- Parameters
cycle (int) – The cycle number
node (int) – The burn node number (e.g. 0 for BOC, 1 for MOC, etc.)
coupledIter (int, optional) – Coupled iteration number (for tightly-coupled cases)
additionalLabel (str, optional) – An optional tag to the file names to differentiate them from another case.
- Returns
inName (str) – Input file name
outName (str) – Output file name
stdName (str) – Standard output file name
-
retrieveOutputFiles(**kwargs)¶
-
addNewOutputFileToRetrieve(sourceName, destinationName=None)[source]¶ Add a new file to the list of files that will be copied to the shared drive after a run.
These should be names only, not paths.
- Parameters
sourceName (str) – The name of the file in the source location, e.g. FT06
destinationName (str or None) – The name of the file in the destination location, e.g. caseName.dif3d.out
See also
armi.utils.directoryChangers.DirectoryChanger.retrieveFiles()should be used instead of this.
-
specifyOutputFilesToRetrieve(inName, outName)[source]¶ determines which output files will be retrieved from the run directory
Notes
This just resets the list at every run. The real work is done in the subclass methods.
See also
terrapower.physics.neutronics.dif3d.dif3dInterface.Dif3dInterface.specifyOutputFilesToRetrieve()
-
calculateKeff(inf, outf, genXS='', baseList=None, forceSerial=False, xsLibrarySuffix='', updateArmi=False, outputsToCopyBack='')[source]¶ Run neutronics calculation and return keff
Handles some XS generation stuff as well, optionally. Usefull when you just need to know keff of the current state (like in rx coeffs, CR worth)
- Parameters
inf (str) – input file name
outf (str) – a dif3d/rebus output file name that will be generated
genXS (str) – type of particle you want MC**2 to regenerate cross sections for allowed values of genXS setting.
baseList (list) – MC**2 bases to generate (QA, QAF) if you want a partial MC**2 run
forceSerial (bool) – forces the MC**2 runs to run on a single processor
xsLibrarySuffix (str) – will get appended to the library name ISOTXS.
updateArmi (bool, optional) – If true, will update the ARMI state (reactor, assems, blocks) with the results of the neutronics run. Defaults to False so flux distributions used in weighting blocks for XS don’t get mixed up.
outputsToCopyBack (str, optional) – Copy a subset of files back to the main path in fastPath cases. Takes time but good for debugging/restarts.
- Returns
rebOut
- Return type
a Rebus_Output class containing neutronics output information
See also
calculateFlux()does this but handles lots of other bookkeeping stuff that is important during a main operator loop.
-
run(inName, outName, path=None, branchNum=None, libNames=None, outputsToCopyBack='', updateArmi=False)[source]¶
-
edgeAssembliesAreNeeded()[source]¶ True if edge assemblies are needed in this calculation
We only need them in finite difference cases that are not full core.
-
clearFlux()[source]¶ Delete flux on all blocks. Needed to prevent stale flux when partially reloading.
-
buildBlockMeshLookup(useWholeHexNodalOrdering=False, plotMesh=False)[source]¶ Build a lookup table between finite difference mesh points and blocks.
Notes
This method builds a dictionary. blockLookup[(i,j,k)] = block that’s in i,j,k. They start at 1, following loc.containsWhichFDMEshPointsThird
WARNING: When useWholeHexNodalOrdering = True, this function will give wrong neighbors when the 120-degree symmetry line “edge assemblies” are present. Be careful!
These mesh indices should start at 1, just like DIF3D. DIFNT switches to 0 based indexing though.
- Parameters
useWholeHexNodalOrdering (bool, optional) –
- If True, ijList will contain the (i,j) = (ring,pos) indices of hex assemblies.
Thus, the axial block locations will be looked up based on which assembly contains them. This is used by fluxRecon.computePinMGFluxAndPower to map nodal surface data from NHFLUX to ARMI blocks (in terms of axial divisions).
- If False, ijList will contain the triangular FD mesh indices from loc.containsWhichFDMeshPoints,
which do NOT correspond to whole hex assemblies. This was how buildBlockMeshLookup always worked before the useWholeHexNodalOrdering option was added.
plotMesh (bool, optional) – If true, will print a pdf of the mesh.
- Returns
meshLookup (3-D array of block objects) –
- b = meshLookup[i,j,k] is the ARMI block object that contains the finite difference mesh node indexed
by i, j, and k. Here (i,j) is the index pair in ijList and k is the axial index.
(iMax,jMax,kMax) (tuple) –
- These are the maximum values of the finite difference mesh indices i, j, and k. Here k is the axial index,
while i and j can be different hex/triangular indexing systems.
See also
fluxRecon.computePinMGFluxAndPower(),HexLocation.containsWhichFDMeshPoints()- Raises
ValueError – When blocks are not found.
RuntimeError – When not all blocks are looped over.
-
updateDpaRate(blockList=None)[source]¶ Update state parameters that can be known right after the flux is computed
See also
updateFluenceAndDpa()uses values computed here to update cumulative dpa
-
updateMaxDpaParams()[source]¶ Update params that track the peak dpa.
Only consider fuel because CRs, etc. aren’t always reset.
-
updateFluenceAndDpa(stepTimeInSeconds, blockList=None)[source]¶ updates the fast fluence and the DPA of the blocklist
The dpa rate from the previous timestep is used to compute the dpa here.
- There are several items of interest computed here, including:
detailedDpa: The average DPA of a block
- detailedDpaPeak: The peak dpa of a block, considering axial and radial peaking
The peaking is based either on a user-provided peaking factor (computed in a pin reconstructed rotation study) or the nodal flux peaking factors
dpaPeakFromFluence: fast fluence * fluence conversion factor (old and inaccurate). Used to be dpaPeak
- Parameters
stepTimeInSeconds (float) – Time in seconds that the cycle ran at the current mgFlux
blockList (list, optional) – blocks to be updated. Defaults to all blocks in core
See also
updateDpaRate()updates the DPA rate used here to compute actual dpa
-
updateCycleDoseParams()[source]¶ Updates reactor params based on the amount of dose (detailedDpa) accrued this cycle Params updated include:
maxDetailedDpaThisCycle dpaFullWidthHalfMax elevationOfACLP3Cycles elevationOfACLP7Cycles
These parameters are left as zeroes at BOC because no dose has been accumulated yet.
-
updateLoadpadDose()[source]¶ Summarize the dose in DPA of the above-core load pad.
This sets the following reactor params:
loadPadDpaPeak : the peak dpa in any load pad
loadPadDpaAvg : the highest average dpa in any load pad
Warning
This only makes sense for cores with load pads on their assemblies.
See also
_calcLoadPadDose()computes the load pad dose
-
armi.physics.neutronics.globalFlux.globalFluxInterface.plotMeshLookup(meshLookup, myK=2, fName='meshPlot.pdf')[source]¶ Plots the mesh lookup in one slab.
-
armi.physics.neutronics.globalFlux.globalFluxInterface.getXY120(i, j)[source]¶ Get xy coords for i,j indices in fig 2.4 DIF3D manual.
Assumes triangleside length 1.0
-
armi.physics.neutronics.globalFlux.globalFluxInterface.computeDpaRate(mgFlux, dpaXs)[source]¶ Compute the DPA rate incurred by exposure of a certain flux spectrum
- Parameters
mgFlux (list) – multigroup neutron flux in #/cm^2/s
dpaXs (list) – DPA cross section in barns to convolute with flux to determine DPA rate
- Returns
dpaPerSecond – The dpa/s in this material due to this flux
- Return type
float
Notes
Displacements calculated by displacement XS Displacement rate = flux * nHT9 * barn [in #/cm^3/s]
= [#/cm^2/s] * [1/cm^3] * [barn] = [#/cm^5/s] * [barn] * 1e-24 [cm^2/barn] = [#/cm^3/s]
- DPA rate = displacement density rate / (number of atoms/cc)
= dr [#/cm^3/s] / (nHT9) [1/cm^3] = flux * barn * 1e-24
flux * N * xs
- DPA / s= —————– = flux * xs
N
nHT9 cancels out. It’s in the macroscopic XS and in the original number of atoms.
- Raises
RuntimeError – Negative dpa rate.