armi.reactor.batch module

class armi.reactor.batch.Batch(name='Batch', cs=None)[source]

Bases: armi.reactor.blocks.Block

Batch represents a 0-D mass of nuclides to be depleted it keeps track of nuclides and integral flux. It does not keep track of volume.

Everything in a batch should have one lumped fission product collection and one lumped fission product collection or not use lumped fission products.

Builds a new ARMI batch

Parameters

name (str, optional) – The name of this batch

pDefs = <armi.reactor.parameters.parameterDefinitions.ParameterDefinitionCollection object>
add(c)[source]

Add a new child.

Children in batch objects have different parents.

Parameters

obj (armiObject) –

getMgFlux()[source]

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

It is stored integrated over volume on self.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

Return type

multigroup neutron flux in [n/cm^2/s]

getIntegratedMgFlux(adjoint=False, gamma=False)[source]

Return the volume integrated multigroup neutron tracklength in [n-cm/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.

Parameters
  • adjoint (bool, optional) – Return adjoint flux instead of real

  • gamma (bool, optional) – Whether to return the neutron flux or the gamma flux.

Returns

integratedFlux – multigroup neutron tracklength in [n-cm/s]

Return type

numpy.array

addMass(nucName, mass, density=None, lumpedFissionProducts=None)[source]

Adds mass to batch.

Parameters
  • nucName (str) – nuclide name – e.g. ‘U235’

  • mass (float) – mass in grams of the nuclide to be added

  • density (float) – density in grams per cc of the nuclide

  • lumpedFissionProducts (LumpedFissionProductCollection) – the LumpedFissionProductCollection

addMasses(masses, density=None, lumpedFissionProducts=None)[source]

Adds a vector of masses to batch

Parameters

masses (Dict) – a dictionary of masses (g) indexed by nucNames (string)

setTargetDensity(density)[source]
Parameters

density (float) – target density of the mass addition components

updateMassAdditionComponents(density)[source]
Parameters

density (float) – target density of the mass addition components

getMassAdditionComponents()[source]
setNumberDensity(*args, **kwargs)[source]

Raises not implemented error because setNumberDensity does not really apply for batch objects – its an over constrained problem.

setMasses(masses, density=None, lumpedFissionProducts=None)[source]

Set multiple masses at once

Parameters
  • masses (dict) – dictionary of masses in grams indexed by their nucNames

  • density (float) – target density in g/cc

  • lumpedFissionProducts (lumpedFissionProductCollection) –

setMass(nucName, mass, density=None, lumpedFissionProducts=None)[source]

Set the mass of a defined nuclide to the defined mass

Parameters
  • nucName (string) – armi nuclide name (e.g. U235)

  • mass (float) – this is a dictionary of masses in grams

getVolume(excludeMassAdditionComponents=False)[source]

Returns volume in cm^3.

setIntegratedMgFlux(integratedMgFlux)[source]

Sets the integrated flux to the provided vector.

Parameters

integratedMgFlux (numpy array) – array of integrated flux in different energy bins (n-cm/s)

addIntegratedMgFlux(mgFlux)[source]
copy(newBatchName=None)[source]

This method returns a batch that will return the same values of mass, mgFlux. The mgFlux are held on the block level, this block is composed of a single component with the and mass as self.

Parameters

newBatchName (str) –

Returns

newBatch

Return type

Batch

__deepcopy__(memo)[source]

Set custom deep-copy behavior.

We detach the recursive links to the parent and the reactor to prevent blocks carrying large independent copies of stale reactors in memory. If you make a new block, you must add it to an assembly and a reactor.

getEnrichment()[source]

Return the uranium enrichment of this batch.

getReactionRates(nucName)[source]

get reaction rates for (n,gamma), (n,fission), (n,2n), (n,alpha), (n,proton) reactions

Parameters

nucName (str) – nuclide name – e.g. ‘U235’

Returns

rxnRates – dictionary of reaction rates (rxn/s) for nG, nF, n2n, nA and nP

Return type

dict

paramCollectionType

alias of armi.reactor.parameters.parameterCollections.BatchParameterCollection

armi.reactor.batch.makeMgFluxBlock(mgFlux)[source]
Parameters

mgFlux (numpy array) – volume integrated neutron flux n-cm/s in each energy group

Returns

b – a block with and integrated flux equal to the defined mgFlux vector

Return type

block

armi.reactor.batch.makeMassAdditionComponent(nucName, mass, density)[source]
Parameters
  • nucName (string) – armi nuclide name (e.g. U235)

  • mass (float) – this is a dictionary of masses in grams

  • density (float) – this is the target density of this component

Returns

c – a component with a mass equal to mass of the nuclide, nucName, with the density equal to the defined density

Return type

component

armi.reactor.batch.makeEmptyBatch(name, cs=None)[source]
Parameters
  • name (str) –

  • cs (settings) –

Returns

aB – a batch that is pretty much empty, but will not crash methods that are assumed to be populated

Return type

batch

armi.reactor.batch.moveMassFromFirstBatchToSecondBatch(donorBatch, receiverBatch)[source]

Moves mass from one batch to another.

Parameters
  • donorBatch (batch) – this batch donates its mass

  • receiverBatch (batch) – this batch receives the donorBatch’s mass

Returns

  • donorBatch (batch) – this should be essentially empty

  • receiverBatch (batch) – this now has the mass from the donor batch

armi.reactor.batch.calculateBatchAverageDensity(aB, excludeMassAdditionComponent=False)[source]
Parameters
  • aB (batch object) –

  • excludeMassAdditionComponent (bool) – if this is True, exclude mass addition components for the density calculation

Returns

density – density in grams / centimeters cubed

Return type

float