armi.physics.neutronics.latticePhysics.latticePhysicsWriter module

Lattice Physics Writer

Parent class for lattice physics writers.

Seeks to provide access to common methods used by general lattice physics codes.

class armi.physics.neutronics.latticePhysics.latticePhysicsWriter.LatticePhysicsWriter(representativeBlock, r=None, externalCodeInterface=None, xsLibrarySuffix='', generateExclusiveGammaXS=False)[source]

Bases: armi.interfaces.InputWriter

Parent class for creating the inputs for lattice physics codes.

Contains methods for extracting all nuclides for a given problem.

_SPACE = ' '
_SEPARATOR = ' | '
UNUSED_CATEGORY = 'Unused '
FUEL_CATEGORY = 'Fuel '
STRUCTURE_CATEGORY = 'Structure'
COOLANT_CATEGORY = 'Coolant '
FISSION_PRODUCT_CATEGORY = 'Fission Product'
DEPLETABLE = 'Depletable '
UNDEPLETABLE = 'Non-Depletable'
REPRESENTED = 'Represented '
UNREPRESENTED = 'Unrepresented'
_writeTitle(fileObj)[source]
write()[source]

Write the input file.

property _isSourceDriven
property _isGammaXSGenerationEnabled

Gamma transport is not available generically across all lattice physic solvers.

_getAllNuclidesByTemperatureInC(component=None)[source]

Returns a dictionary where all nuclides in the block are grouped by temperature.

Some lattice physics codes, like SERPENT create mixtures of nuclides at similar temperatures to construct a problem. The dictionary returned is of the form

{temp1: {n1: (d1, temp1, category1),
         n2: (d2, temp1, category2)}
 temp2: {n3: (d3, temp2, category3),
         n4: (d4, temp2, category4)}
 ...
 }
_getAllNuclideObjects(component=None)[source]

Returns a single dictionary of all nuclides in the component.

Calls _getAllNuclidesByCategory(), which returns two dictionaries: one with just fission products and another with the remaining nuclides. This method just updates self._allNuclideObjects to contain the fission products as well.

The dictionaries are structured with armi.nucDirectory.nuclideBases.NuclideBase objects, with (density, temperatureInC, and category)` tuples for that nuclide object.

_getAllNuclidesByCategory(component=None)[source]

Determine number densities and temperatures for each nuclide.

Temperatures are a bit complex due to some special cases:

Nuclides that build up like Pu239 have zero density at BOL but need cross sections. Nuclides like Mo99 are sometimes in structure and sometimes in lumped fission products. What temp to use? Nuclides like B-10 are in control blocks but these aren’t candidates for XS creation. What temperature?

To deal with this, we compute (flux-weighted) average temperatures of each nuclide based on its current component temperatures.

_getAvgNuclideTemperatureInC(nucName)[source]

Return the block fuel temperature and the nuclides average temperature in C.

_getFuelTemperature()[source]
_getDetailedFissionProducts(dfpDensities)[source]

Return a dictionary of fission products not provided in the reactor blueprint nuclides

Notes

Assumes that all fission products are at the same temperature of the lumped fission product of U238 within the block.

_getDetailedFPDensities()[source]

Expands the nuclides in the LFP based on their yields.

Returns

dfpDensities – Detailed Fission Product Densities. keys are FP names, values are block number densities in atoms/bn-cm.

Return type

dict

Raises

IndexError – The lumped fission products were not initialized on the blocks.

_writeNuclide(fileObj, nuclide, density, nucTemperatureInC, category, xsIdSpecified=None)[source]
property _isCriticalBucklingSearchActive
_writeComment(fileObj, msg)[source]
_writeGroupStructure(fileObj)[source]
_adjustPuFissileDensity(nucDensities)[source]

Checks if the minimum fissile composition is lower than the allowed minimum fissile fraction and adds additional Pu-239.

Notes

We’re going to increase the Pu-239 density to make the ratio of fissile mass to heavy metal mass equal to the target minimumFissileFraction:

minFrac = (fiss - old + new) / (hm - old + new)
minFrac * (hm - old + new) = fiss - old + new
minFrac * (hm - old) + old - fiss = new * (1 - minFrac)
new = (minFrac * (hm - old) + old - fiss) / (1 - minFrac)

where:

minFrac = ``minimumFissileFraction`` setting
fiss = fissile mass of block
hm = heavy metal mass of block
old = number density of Pu-239 before adjustment
new = number density of Pu-239 after adjustment
_getDriverBlock()[source]

Return the block that is driving the representative block for this writer.

armi.physics.neutronics.latticePhysics.latticePhysicsWriter._groupNuclidesByTemperature(nuclides)[source]

Creates a dictionary of temperatures and nuclides at those temperatures.

Nuclides is a dictionary with NuclideBase objects as keys, and the density, temperature, and category of those nuclides as values.

Notes

The temperature will be rounded to a number of digits according to _NUM_DIGITS_ROUND_TEMPERATURE, because the average temperature for each nuclide can vary down to numerical precision, i.e. 873.15 and 873.15000000001