Commit 1b060f09 authored by Salko Jr, Robert's avatar Salko Jr, Robert
Browse files

Modify the process subpackage to work with new HDF5 format

The new HDF5 format is not as nicely organized, but it leads to
much smaller file sizes and much faster I/O.  These changes get
all tools working with the new format and add more support for
multi-section models.  A new test was also added to skb, which
has rods starting in different axial sections and spanning multiple
sections.  This was used to generate a very small HDF5 file that
has a lot of features useful for unit testing.  It also uncovered
some issues in skbuild that were fixed and additional error checks
were added.
parent 2103086f
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -367,6 +367,7 @@ class Model:
      A solid object can connect to channels in multiple sections.
      A solid object must connect to at least one channel or disperse heat to the ambient or else the
      CTF solution will fail.
      If the solid connects to multiple sections, call this procedure once for each section.

      Args:
         solidID (choice): The ID that was assigned to the solid in :meth:`addSolid`
@@ -377,6 +378,9 @@ class Model:
            was a scalar).

      """
      psum = np.sum(np.array(percent))
      if not np.isclose(psum, 1.0):
          raise RuntimeError("Passed percentages for Solid: "+str(solidID)+" do not add up to 1.0.  Sum is: "+str(psum))
      if solidID not in me.channelsOuter:
         me.channelsOuter[solidID] = []
         me.percentsOuter[solidID] = []
@@ -407,11 +411,15 @@ class Model:

       """
       sections = []
<<<<<<< 2103086f4add09796c08778958726e11fa8d5714
       outer = me.channelsOuter[solidID]
       inner = me.channelsInner[solidID]
       assert(not (outer and inner)) # cannot have both
       allch = outer+inner
       for ch in allch:
=======
       for ch in me.channelsOuter[solidID]:
>>>>>>> Modify the process subpackage to work with new HDF5 format
           chSec = me.getSectionOfChannel(ch)
           if chSec not in sections:
               sections.append(chSec)
@@ -1207,7 +1215,6 @@ class Model:




   def _rodsInValidSections(me):
       """ Ensure rods are in continuous sections"""

@@ -1334,6 +1341,7 @@ class Model:
                   elif isinstance(bc, BoundaryCondition.MassTemperature) and (chan.bcLevels[i]!=1 and chan.bcLevels[i]!=topMom):
                       raise RuntimeError("Set MassEnthalpy BC in Chan: "+str(chanID)+" Level: "+str(chan.bcLevels[i])+" but level must be 1 or "+str(topMom))

<<<<<<< 2103086f4add09796c08778958726e11fa8d5714
   def _rodConnectionsValid(me):
       """ Ensure rods are 100% connected to surrounding channels in each axial section"""
       for solidID in me.solidObjects:
@@ -1358,6 +1366,8 @@ class Model:
                       totPercent = totPercent+allPercent[i]
               if not np.isclose(totPercent, 1.0):
                   raise RuntimeError("For solidID: "+str(solidID)+" in Section: "+str(u)+" percentages of connected channels add up to "+str(totPercent)+" instead of 1.0")
=======
>>>>>>> Modify the process subpackage to work with new HDF5 format

class Gap(object):
   """ Defines a gap (a lateral connection between two channels in the same axial section)