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.Interface

A general abstract interface for global flux-calculating modules.

Should be subclassed by more specific implementations.

name: Optional[str] = 'GlobalFlux'

The name of the interface. This is undefined for the base class, and must be overridden by any concrete class that extends this one.

function = 'globalFlux'

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.

static getHistoryParams()[source]

Return parameters that will be added to assembly versus time history printouts.

interactBOC(cycle=None)[source]
interactEveryNode(cycle, node)[source]

Calculate flux, power, and keff for this cycle and node.

Flux, power, and keff are generally calculated at every timestep to ensure flux is up to date with the reactor state.

interactCoupled(iteration)[source]

Runs during a tightly-coupled physics iteration to updated the flux and power.

interactEOC(cycle=None)[source]
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

calculateKeff(label='keff')[source]

Runs neutronics tool and returns keff without applying it to the reactor.

Used for things like direct-eigenvalue reactivity coefficients and CR worth iterations. For anything more complicated than getting keff, clients should call getExecuter to build their case.

class armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxInterfaceUsingExecuters(r, cs)[source]

Bases: armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxInterface

A global flux interface that makes use of the ARMI Executer system to run.

Using Executers is optional but seems to allow easy interoperability between the myriad global flux solvers in the world.

If a new global flux solver does not fit easily into the Executer pattern, then it will be best to just start from the base GlobalFluxInterface rather than trying to adjust the Executer pattern to fit.

Notes

This points library users to the Executer object, which is intended to provide commonly-used structure useful for many global flux plugins.

interactEveryNode(cycle, node)[source]

Calculate flux, power, and keff for this cycle and node.

Flux, power, and keff are generally calculated at every timestep to ensure flux is up to date with the reactor state.

interactCoupled(iteration)[source]

Runs during a tightly-coupled physics iteration to updated the flux and power.

getTightCouplingValue()[source]

Return the parameter value.

static getOptionsCls()[source]

Get a blank options object.

Subclass this to allow generic updating of options.

static getExecuterCls()[source]
getExecuterOptions(label=None)[source]

Get an executer options object populated from current user settings and reactor.

If you want to set settings more deliberately (e.g. to specify a cross section library rather than use an auto-derived name), use getOptionsCls and build your own.

getExecuter(options=None, label=None)[source]

Get executer object for performing custom client calcs.

This allows plugins to update options in a somewhat generic way. For example, reactivity coefficients plugin may want to request adjoint flux.

calculateKeff(label='keff')[source]

Run global flux with current user options and just return keff without applying it.

Used for things like direct-eigenvalue reactivity coefficients and CR worth iterations.

static getLabel(caseTitle, cycle, node, iteration=None)[source]

Make a label (input/output file name) for the executer based on cycle, node, iteration.

Parameters
  • caseTitle (str, required) – The caseTitle for the ARMI run

  • cycle (int, required) – The cycle number

  • node (int, required) – The time node index

  • iteration (int, optional) – The coupled iteration index

class armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxOptions(label: Optional[str] = None)[source]

Bases: armi.physics.executers.ExecutionOptions

Data structure representing common options in Global Flux Solvers.

Variables
  • ~GlobalFluxOptions.adjoint (bool) – True if the CONF_NEUTRONICS_TYPE setting is set to adjoint or real.

  • ~GlobalFluxOptions.calcReactionRatesOnMeshConversion (bool) – This option is used to recalculate reaction rates after a mesh conversion and remapping of neutron flux. This can be disabled in certain global flux implementations if reaction rates are not required, but by default it is enabled.

  • ~GlobalFluxOptions.eigenvalueProblem (bool) – Whether this is a eigenvalue problem or a fixed source problem

  • ~GlobalFluxOptions.includeFixedSource (bool) – This can happen in eig if Fredholm Alternative satisfied.

  • ~GlobalFluxOptions.photons (bool) – Run the photon/gamma uniform mesh converter?

  • ~GlobalFluxOptions.real (bool) – True if CONF_NEUTRONICS_TYPE setting is set to real.

  • ~GlobalFluxOptions.aclpDoseLimit (float) – Dose limit in dpa used to position the above-core load pad (if one exists)

  • ~GlobalFluxOptions.boundaries (str) – External Neutronic Boundary Conditions. Reflective does not include axial.

  • ~GlobalFluxOptions.cs (Settings) – Settings for this run

  • ~GlobalFluxOptions.detailedAxialExpansion (bool) – Turn on detailed axial expansion? from settings

  • ~GlobalFluxOptions.dpaPerFluence (float) – A quick and dirty conversion that is used to get dpaPeak by multiplying the factor and fastFluencePeak

  • ~GlobalFluxOptions.energyDepoCalcMethodStep (str) – For gamma transport/normalization

  • ~GlobalFluxOptions.epsEigenvalue (float) – Convergence criteria for calculating the eigenvalue in the global flux solver

  • ~GlobalFluxOptions.epsFissionSourceAvg (float) – Convergence criteria for average fission source, from settings

  • ~GlobalFluxOptions.epsFissionSourcePoint (float) – Convergence criteria for point fission source, from settings

  • ~GlobalFluxOptions.geomType (geometry.GeomType) – Reactor Core geometry type (HEX, RZ, RZT, etc)

  • ~GlobalFluxOptions.hasNonUniformAssems (bool) – Has any non-uniform assembly flags, from settings

  • ~GlobalFluxOptions.isRestart (bool) – Restart global flux case using outputs from last time as a guess

  • ~GlobalFluxOptions.kernelName (str) – The neutronics / depletion solver for global flux solve.

  • ~GlobalFluxOptions.loadPadElevation (float) – The elevation of the bottom of the above-core load pad (ACLP) from the bottom of the upper grid plate (in cm).

  • ~GlobalFluxOptions.loadPadLength (float) – The length of the load pad. Used to compute average and peak dose.

  • ~GlobalFluxOptions.maxOuters (int) – XY and Axial partial current sweep max outer iterations.

  • ~GlobalFluxOptions.savePhysicsFilesList (bool) – Is this timestamp in the list of savePhysicsFiles in the settings?

  • ~GlobalFluxOptions.symmetry (str) – Reactor symmetry: full core, third-core, etc

  • ~GlobalFluxOptions.xsKernel (str) – Lattice Physics Kernel, from settings

fromUserSettings(cs: armi.settings.caseSettings.Settings)[source]

Map user input settings from cs to a set of specific global flux options.

This is not required; these options can alternatively be set programmatically.

fromReactor(reactor: armi.reactor.reactors.Reactor)[source]
class armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxExecuter(options: armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxOptions, reactor)[source]

Bases: armi.physics.executers.DefaultExecuter

A short-lived object that coordinates the prep, execution, and processing of a flux solve.

There are many forms of global flux solves:

  • Eigenvalue/Fixed source

  • Adjoint/real

  • Diffusion/PN/SN/MC

  • Finite difference/nodal

There are also many reasons someone might need a flux solve:

  • Update multigroup flux and power on reactor and compute keff

  • Just compute keff in a temporary perturbed state

  • Just compute flux and adjoint flux on a state to

There may also be some required transformations when a flux solve is done:

  • Add/remove edge assemblies

  • Apply a uniform axial mesh

There are also I/O performance complexities, including running on fast local paths and copying certain user-defined files back to the working directory on error or completion. Given all these options and possible needs for information from global flux, this class provides a unified interface to everything.

edgeAssembliesAreNeeded() bool[source]

True if edge assemblies are needed in this calculation.

We only need them in finite difference cases that are not full core.

class armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxResultMapper(r=None, externalCodeInterface=None, fName=None)[source]

Bases: armi.interfaces.OutputReader

A short-lived class that maps neutronics output data to a reactor mode.

Neutronics results can come from a file or a pipe or in memory. This is always subclassed for specific neutronics runs but contains some generic methods that are universally useful for any global flux calculation. These are mostly along the lines of information that can be derived from other information, like dpa rate coming from dpa deltas and cycle length.

getKeff()[source]
clearFlux()[source]

Delete flux on all blocks. Needed to prevent stale flux when partially reloading.

getDpaXs(b: armi.reactor.blocks.Block)[source]

Determine which cross sections should be used to compute dpa for a block.

Parameters

b (Block) – The block we want the cross sections for

Returns

list

Return type

cross section values

getBurnupPeakingFactor(b: armi.reactor.blocks.Block)[source]

Get the radial peaking factor to be applied to burnup and DPA for a Block.

This may be informed by previous runs which used detailed pin reconstruction and rotation. In that case, it should be set on the cs setting burnupPeakingFactor.

Otherwise, it just takes the current flux peaking, which is typically conservatively high.

Parameters

b (Block) – The block we want the peaking factor for

Returns

burnupPeakingFactor – The peak/avg factor for burnup and DPA.

Return type

float

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.

class armi.physics.neutronics.globalFlux.globalFluxInterface.DoseResultsMapper(depletionSeconds, options)[source]

Bases: armi.physics.neutronics.globalFlux.globalFluxInterface.GlobalFluxResultMapper

Updates fluence and dpa when time shifts.

Often called after a depletion step. It is invoked using apply().

Parameters
  • depletionSeconds (float, required) – Length of depletion step in units of seconds

  • options (GlobalFluxOptions, required) – Object describing options used by the global flux solver. A few attributes from this object are used to run the methods in DoseResultsMapper. An example attribute is aclpDoseLimit.

Notes

We attempted to make this a set of stateless functions but the requirement of various options made it more of a data passing task than we liked. So it’s just a lightweight and ephemeral results mapper.

apply(reactor, blockList=None)[source]

Invokes updateFluenceAndDpa() for a provided Reactor object.

Parameters
  • reactor (Reactor, required) – ARMI Reactor object

  • blockList (list, optional) – List of ARMI blocks to be processed by the class. If no blocks are provided, then blocks returned by getBlocks() are used.

Return type

None

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.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

\[\begin{split}\text{Displacement rate} &= \phi N_{\text{HT9}} \sigma \\ &= (\#/\text{cm}^2/s) \cdot (1/cm^3) \cdot (\text{barn})\\ &= (\#/\text{cm}^5/s) \cdot \text{(barn)} * 10^{-24} \text{cm}^2/\text{barn} \\ &= \#/\text{cm}^3/s\end{split}\]
DPA rate = displacement density rate / (number of atoms/cc)
         = dr [#/cm^3/s] / (nHT9)  [1/cm^3]
         = flux * barn * 1e-24
\[\frac{\text{dpa}}{s} = \frac{\phi N \sigma}{N} = \phi * \sigma\]

the Number density of the structural material cancels out. It’s in the macroscopic XS and in the original number of atoms.

Raises

RuntimeError – Negative dpa rate.

armi.physics.neutronics.globalFlux.globalFluxInterface.calcReactionRates(obj, keff, lib)[source]

Compute 1-group reaction rates for this object (usually a block).

Parameters
  • obj (Block) – The object to compute reaction rates on. Notionally this could be upgraded to be any kind of ArmiObject but with params defined as they are it currently is only implemented for a block.

  • keff (float) – The keff of the core. This is required to get the neutron production rate correct via the neutron balance statement (since nuSigF has a 1/keff term).

  • lib (XSLibrary) – Microscopic cross sections to use in computing the reaction rates.

Notes

Values include:

  • Fission

  • nufission

  • n2n

  • absorption

Scatter could be added as well. This function is quite slow so it is skipped for now as it is uncommonly needed.

Reaction rates are:

\[\Sigma \phi = \sum_{\text{nuclides}} \sum_{\text{energy}} \Sigma \phi\]

The units of \(N \sigma \phi\) are:

[#/bn-cm] * [bn] * [#/cm^2/s] = [#/cm^3/s]

The group-averaged microscopic cross section is:

\[\sigma_g = \frac{\int_{E g}^{E_{g+1}} \phi(E) \sigma(E) dE}{\int_{E_g}^{E_{g+1}} \phi(E) dE}\]