Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latticeIDs and associated grids can be inconsistent #1400

Open
keckler opened this issue Sep 5, 2023 · 0 comments · May be fixed by #2045
Open

latticeIDs and associated grids can be inconsistent #1400

keckler opened this issue Sep 5, 2023 · 0 comments · May be fixed by #2045
Labels
enhancement New feature or request

Comments

@keckler
Copy link
Member

keckler commented Sep 5, 2023

Though less often used, ARMI has the ability to define the radial location of pins within a block. An example of this is here: https://terrapower.github.io/armi/tutorials/walkthrough_lwr_inputs.html

It is possible for the grid defined for a block to have no overlap with the pins defined in that block, and ARMI will not complain. In such a case, the constructed model is very likely wrong. I'll explain...

Below is a working example based on a simplified version of the inputs from the link above.

custom isotopics:
    UO2:
        input format: number densities
        U235: 8.65e-4
        U238: 2.225E-2
        O: 4.622E-2
    moderator:
        input format: number densities
        H: 6.70e-2
        O: 3.35E-2
        B: 2.87E-5
    Zr clad:
        input format: number densities
        ZR: 4.30E-2
blocks:
    uo2: &block_uo2
        grid name: UO2 grid
        fuel:
            shape: Circle
            material: UO2
            isotopics: UO2
            Tinput: 25.0
            Thot: 25.0
            od: .8190
            latticeIDs: [U]
        gap 1: &fuel_gap_1
            shape: Circle
            material: Void
            Tinput: 25.0
            Thot: 25.0
            id: fuel.od
            od: zirconium clad.id
            latticeIDs: [U]
        zirconium clad: &clad_Zr
            shape: Circle
            material: Custom
            isotopics: Zr clad
            Tinput: 25.0
            Thot: 25.0
            id: .8360
            od: .9500
            latticeIDs: [U]
        moderator: &moderator
            shape: DerivedShape
            material: SaturatedWater
            isotopics: moderator
            Tinput: 450.0
            Thot: 450.0
        pitch: &pitch
        # dummy component for assembly sizing
            shape: Square
            material: Void
            Tinput: 25.0
            Thot: 25.0
            widthInner: 21.42
            widthOuter: 21.42
            mult: 1.0
            latticeIDs: [FC] 
assemblies:
    heights: &heights
        - 64.26
    axial mesh points: &mesh
        - 3

    UO2:
        flags: fuel
        specifier: UO2
        blocks:
            - *block_uo2
        height: *heights
        axial mesh points: *mesh
        xs types: [A]
systems:
    core:
      grid name: core

      origin:
          x: 0.0
          y: 0.0
          z: 0.0
grids:
    core:
        symmetry: quarter reflective
        geom: cartesian
        lattice pitch:
            x: 21.42
            y: 21.42
        lattice map: |
         UO2
    UO2 grid:
        symmetry: full
        geom: cartesian
        lattice pitch:
            x: 1.26
            y: 1.26
        lattice map: |
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
            U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U  U
nuclide flags:
    H: {burn: false, xs: true}
    O: 
        burn: false
        xs: true
        expandTo: ["O16", "O17"] # O18 is not in many nuclear data sets.
    B: {burn: false, xs: true}
    ZR: {burn: false, xs: true}
    U235: {burn: false, xs: true}
    U238: {burn: false, xs: true}

This runs with just the standalone framework.

You can see that there is a lattice map called "UO2 grid" which defines the positions of pins in the block. If you pull up the resulting database and query the fuel component for how many of them there are, the amount is consistent with the grid definition:

>> import armi; armi.configure()
>> from armi.bookkeeping.db import databaseFactory
>> db = databaseFactory("c5g7-settings.h5", "r")
>> with db:
>>      r = db.load(0,0)

>> r.core[0][0][0]
<Circle: fuel>

>> r.core[0][0][0].spatialLocator
<MultiIndexLocation with 289 locations>

>>  r.core[0][0][0].p.mult
289

Okay, now take the same input and replace the grid with this:

    UO2 grid:
        symmetry: full
        geom: cartesian
        lattice pitch:
            x: 1.26
            y: 1.26
        lattice map: |
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X
            X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X  X

Note that this new grid does not have any locations with a corresponding pin definition from the block.
Okay, now run it and again examine the database:

>> import armi; armi.configure()
>> from armi.bookkeeping.db import databaseFactory
>> db = databaseFactory("c5g7-settings.h5", "r")
>> with db:
>>      r = db.load(0,0)

>> r.core[0][0][0]
<Circle: fuel>

>> r.core[0][0][0].spatialLocator
<IndexLocation @ (0,0,0)>

>>  r.core[0][0][0].p.mult
1.0

There is now just 1 fuel component in the block. This is because that is the default mult value, and since we did not specify a mult on that component and it also isn't found in the grid, we get just 1 fuel pin which is floating (radially) in space. That is logically fine, but the problem is that ARMI apparently doesn't care at all that this grid makes no sense at all for this block. The grid says every position should be filled by a pin named "X", but that pin does not exist!

There is a check that if the user enters a non-unity mult for a component, it must show up the same amount of times in the associated grid. So that is good, but the user often doesn't enter the mult attribute if they also specify a grid (as in the case of the example in the docs).

I see that there are some difficulties with trying to fully verify the user input of a grid, based on the way that the grid system functions. But we should at least be catching the issue that I've described in this ticket. Otherwise a simple mistaken latticeID entered in the grid would be the difference between only 1 of those components versus whatever amount is intended by the user.

To do this, we should ensure that all IDs entered in a grid appear at least once in the associated block blueprint.

@keckler keckler added the enhancement New feature or request label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant