Commit 553f36f0 authored by Salko Jr, Robert's avatar Salko Jr, Robert
Browse files

Fix getPinSection procedure for single section models

Always return section 1 for a single section model as a temporary
fix to #31 and #33.  Also found another issue where correct channel
level was not being returned for the next to last pin level.
Added some printout information for the DNB summary generator.
parent 81114925
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -876,6 +876,10 @@ class Hdf5Interface(object):
    def getChanLevelFromPinLevel(me, pin, level, chan):
        """ Takes the pin index and level and returns the scalar level index in the adjacent channel

        The returned channel level includes the ghost level below the channel.  A pin never connects
        to the ghost level, so the returned channel level will always be 1 or greater.

        Warning:
           This procedure needs work.  Need to add something to raise an exception if the rod does not
           connect to the channel.  Also if the channel does connect, but it is in a different section,
           this will return the closest level, which will still probably be far from the actual one and
@@ -892,7 +896,7 @@ class Hdf5Interface(object):
        if me.getNumSections()==1:
            if level==0 or level==1:
                return 1
            elif level==me.getPinNumLev(pin)-2:
            elif level==me.getPinNumLev(pin)-2 or level==me.getPinNumLev(pin)-1:
                return level-1
            else:
                return level
@@ -907,6 +911,10 @@ class Hdf5Interface(object):
    def getPinSection(me, pin, level):
        """ Returns the axial section (1-based) the pin level exists in

        Warning:
           This procedure has potential issues returning the correct section number for multi-section
           models when the user passes in the top two levels of the pin.  See https://code.ornl.gov/CTF/SubKit/issues/31.

        Args:
           pin (int) : Pin index (1-based)
           level (int) : Pin axial level (0-based)
@@ -914,6 +922,7 @@ class Hdf5Interface(object):
        """
        me._pinIndexValid(pin)
        me._pinLevelValid(pin, level)
        if me.getNumSections()==1: return 1
        z = me.getPinAxial(pin, level)
        for i in range(len(me.sectionBounds)-1):
            if z>=me.sectionBounds[i] and z<me.sectionBounds[i+1]:
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ class SummaryTools(object):
            f.write(unitsB)
        f.write("  |==================================|================================|==========================================================|=======|\n")
        for state in range(1, me.h5.getNumState()+1):
            print "Processing state {:8d}".format(state)
            minState, minPin, level, theta, minDNBR = me.h5.getPinWithMinDNBR(state)
            minDNBR = min(minDNBR, 100.0)
            hotChID = me.h5.getConnChan(minPin, level, theta)
+4 −1
Original line number Diff line number Diff line
f = open('../SubKit/build/workbench/input.sch')

# These are valid attributes in the input.sch file that are not used in auto-generating
# the documentation.  They will be read by this script, but skipped.  Anything not expected
# will cause an error.
attr = ["ChildExactlyOne",
        "ChildCountEqual",
        "ExistsIn", "ChildUniqueness", "ChildAtMostOne", "IncreaseOver",
        "ChildAtLeastOne"]
        "ChildAtLeastOne", "InputTmpl"]
names = []
group = []
descriptions = {}
+5 −0
Original line number Diff line number Diff line
@@ -337,6 +337,11 @@ class test_Hdf5Tools(unittest.TestCase):
       me.assertEqual(me.obj.getChanLevelFromPinLevel(2, 1, 8), 1)
       me.assertEqual(me.obj.getChanLevelFromPinLevel(2, 4, 10), 2)
       me.assertEqual(me.obj.getChanLevelFromPinLevel(2, 5, 10), 2)
       # Check top of pin 3 (which connects to top of channel 9).  Fixes defect #33
       me.assertEqual(me.obj.getChanLevelFromPinLevel(pin=3, level=0, chan=9), 1)
       me.assertEqual(me.obj.getChanLevelFromPinLevel(pin=3, level=1, chan=9), 1)
       me.assertEqual(me.obj.getChanLevelFromPinLevel(pin=3, level=2, chan=9), 2)
       me.assertEqual(me.obj.getChanLevelFromPinLevel(pin=3, level=3, chan=9), 2)

   def test_getPinAxialHeatFlux(me):
       axial, q = me.obj.getPinAxialHeatFlux(state=2, pin=2, sector=0)