Skip to content

Commit

Permalink
Fix getMgFlux for component.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjarrett committed Feb 26, 2025
1 parent d20be5f commit 9010603
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions armi/reactor/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,46 @@ def adjustMassEnrichment(self, massFraction):
)
self.setMassFracs(adjustedMassFracs)

def getMgFlux(self, adjoint=False, average=False, volume=None, gamma=False):
"""
Return the multigroup neutron flux in [n/cm^2/s].
The first entry is the first energy group (fastest neutrons). Each additional
group is the next energy group, as set in the ISOTXS library.
On blocks, it is stored integrated over volume on <block>.p.mgFlux
Parameters
----------
adjoint : bool, optional
Return adjoint flux instead of real
average : bool, optional
If true, will return average flux between latest and previous. Doesn't work
for pin detailed yet
volume: float, optional
If average=True, the volume-integrated flux is divided by volume before
being returned. The user may specify a volume here, or the function will
obtain the block volume directly.
gamma : bool, optional
Whether to return the neutron flux or the gamma flux.
Returns
-------
flux : np.ndarray
multigroup neutron flux in [n/cm^2/s]
"""
if average:
raise NotImplementedError(
"{} class has no method for producing average MG flux -- try"
"using blocks".format(self.__class__)
)

volume = volume or self.getVolume() / self.parent.getSymmetryFactor()
return self.getIntegratedMgFlux(adjoint=adjoint, gamma=gamma) / volume

def getIntegratedMgFlux(self, adjoint=False, gamma=False):
"""
Return the multigroup neutron tracklength in [n-cm/s].
Expand Down

0 comments on commit 9010603

Please sign in to comment.