Commit 0e8dfc0e authored by Kumar, Vineet's avatar Kumar, Vineet Committed by Salko Jr, Robert
Browse files

Resolve "Add ability to create parallel models with the deck builder input"

parent 27083f38
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
before_script:
  - pwd
  - git clone git@code-int.ornl.gov:ag6/MCFR.git

tests:
   type: test
+11 −5
Original line number Diff line number Diff line
@@ -101,6 +101,12 @@ class InpBuilder(object):
            chID = me.inp.getSolidChans(solidID)
            me.model.addSolidOuterChan(solidID=solidID, chID=chID, percent=percents)

        #Parallel models
        if me.inp.getParallelDomainIDs():
            for domainID in me.inp.getParallelDomainIDs():
                me.model.addRodsToDomain(domain=domainID, rods=me.inp.getParallelDomainSolids(domainID), owners=me.inp.getParallelDomainSolidOwners(domainID))
                me.model.addChannelsToDomain(domain=domainID, channels=me.inp.getParallelDomainChannels(domainID))

        me.model.setAveragePower(qprime = me.inp.getInitialQprime())
        me.model.generateModel()

+47 −4
Original line number Diff line number Diff line
@@ -141,6 +141,12 @@ class InpParse(object):
            for axial in me.inpDict['axialpow']:
                me.axialPowIDs.append(axial['id']['value'])

        # Gather parallel IDs in the model
        me.domainIDs = []
        if 'domain' in me.inpDict:
            for domain in me.inpDict['domain']:
                me.domainIDs.append(domain['id']['value'])

        # All IDs need to be sorted in ascending order because the "ID" passed to the deck builder
        # is not the ID that ends up in deck.inp.  They get re-indexed, which can lead to some unexpected
        # behavior.
@@ -149,6 +155,7 @@ class InpParse(object):
        me.gapIDs = list(sorted(me.gapIDs))
        me.geoIDs = list(sorted(me.geoIDs))
        me.timeGroups = list(sorted(me.timeGroups))
        me.domainIDs = list(sorted(me.domainIDs))
        for secID in me.chIDsInSec:
            me.chIDsInSec[secID] = list(sorted(me.chIDsInSec[secID]))
        if sum(np.diff(me.chIDs)==1) != len(me.chIDs)-1:
@@ -219,6 +226,13 @@ class InpParse(object):
               if axialpow['id']['value']==axialpowID:
                   return axialpow

    def _getParallelDomain(me, domainID):
        """ Takes the integer domain ID and retrieves the dictionary for that gap from inpDict"""
        if 'domain' in me.inpDict:
           for domain in me.inpDict['domain']:
               if domain['id']['value']==domainID:
                   return domain

    def _getTimegroup(me, timegroupID):
        """ Takes the timegroup index and retrieves the dictionary for that time group in the inpDict

@@ -655,3 +669,32 @@ class InpParse(object):
            return losses[0]
        else:
            return losses

    def getParallelDomainIDs(me):
        """ Return the domain IDs for a parallel simulation """
        return me.domainIDs

    def getParallelDomainSolids(me,domainID):
        """ Returns the list of solid rods associated with the passed domain ID """
        assert(domainID in me.getParallelDomainIDs())
        domain = me._getParallelDomain(domainID)
        if 'solids' in domain:
            return domain['solids']['value']
        else:
            return None

    def getParallelDomainSolidOwners(me,domainID):
        """ Returns the list of domain IDs associated with the solid rods defined for the passed domain ID """
        domain = me._getParallelDomain(domainID)
        if 'solid_owners' in domain:
            return domain['solid_owners']['value']
        else:
            return None

    def getParallelDomainChannels(me,domainID):
        """ Returns the list of channels associated with the passed domain ID """
        domain = me._getParallelDomain(domainID)
        if 'chans' in domain:
            return domain['chans']['value']
        else:
            return InputError("Domain->"+str(domainID)+"->ch not defined")
+50 −4
Original line number Diff line number Diff line
@@ -718,5 +718,51 @@ loss{
   }
}


domain{
   MinOccurs=0
   MaxOccurs=NoLimit
   ChildExactlyOne=["/domain/id/value"=1]
   id{
      MinOccurs=1
      MaxOccurs=1
      value{
         MinOccurs=1
         MaxOccurs=1
         ValType=Int
         ChildUniqueness="/domain/id/value"
         #IncreaseOver("../..")=Strict
      }
   }
   chans{
      MinOccurs=1
      MaxOccurs=1
      value{
         MinOccurs=1
         MaxOccurs=NoLimit
         ValType=Int
         ExistsIn="/ch/id/value"
      }
   }
   solids{
      MinOccurs=0
      MaxOccurs=1
      value{
         MinOccurs=1
         MaxOccurs=NoLimit
         ValType=Int
         ChildCountEqual(EvenNone)="../solid_owners"
         ExistsIn="/solid/id/value"
      }
   }
   solid_owners{
      MinOccurs=0
      MaxOccurs=1
      value{
         MinOccurs=1
         MaxOccurs=NoLimit
         ValType=Int
         ChildCountEqual(EvenNone)="../solids"
         ExistsIn="/domain/id/value"
      }
   }
}
+264 −0
Original line number Diff line number Diff line
# GE 3x3 rod bundle 2G1 validation test, rod centered (4 x 4 channels)

initial
   mdot 2.74309039965 # kg/s
   qprime 96.9670457859 # kW/m
   press 68.948 # bar
   temp 173.84 # C (739.3 KJ/kg enthalpy)

section id 1
   height 1.8288 # m
   num_levels 72

ch id 1
   area  0.50497e-4 # m**2
   pw    0.28346e-1
   x    -0.24079e-1
   y     0.24079e-1
   xdim  0.10668e-1
   ydim  0.10668e-1

ch id 2
   area  0.11766e-3
   pw    0.41487e-1
   mesh -0.93726e-2 0.24079e-1 0.18745e-1 0.10668e-1

ch id 3
   geo  0.11766e-3 0.41487e-1
   mesh 0.93726e-2 0.24079e-1 0.18745e-1 0.10668e-1

ch id 4
   geo  0.50497e-4 0.28346e-1
   mesh 0.24079e-1 0.24079e-1 0.10668e-1 0.10668e-1

ch id 5
   geo  0.11766e-3 0.41487e-1
   mesh -0.24079e-1 0.93726e-2 0.10668e-1 0.18745e-1

ch id 6
   geo  0.18675e-3 0.45484e-1
   mesh -0.93726e-2 0.93726e-2 0.18745e-1 0.18745e-1

ch id 7
   geo  0.18675e-3 0.45484e-1
   mesh 0.93726e-2 0.93726e-2 0.18745e-1 0.18745e-1

ch id 8
   geo  0.11766e-3 0.41487e-1
   mesh 0.24079e-1 0.93726e-2 0.10668e-1 0.18745e-1

ch id 9
   geo  0.11766e-3 0.41487e-1
   mesh -0.24079e-1 -0.93726e-2 0.10668e-1 0.18745e-1

ch id 10
   geo  0.18675e-3 0.45484e-1
   mesh -0.93726e-2 -0.93726e-2 0.18745e-1 0.18745e-1

ch id 11
   geo  0.18675e-3 0.45484e-1
   mesh 0.93726e-2 -0.93726e-2 0.18745e-1 0.18745e-1

ch id 12
   geo  0.11766e-3 0.41487e-1
   mesh 0.24079e-1 -0.93726e-2 0.10668e-1 0.18745e-1

ch id 13
   geo  0.50497e-4 0.28346e-1
   mesh -0.24079e-1 -0.24079e-1 0.10668e-1 0.10668e-1

ch id 14
   geo  0.11766e-3 0.41487e-1
   mesh -0.93726e-2 -0.24079e-1 0.18745e-1 0.10668e-1

ch id 15
   geo  0.11766e-3 0.41487e-1
   mesh 0.93726e-2 -0.24079e-1 0.18745e-1 0.10668e-1

ch id 16
   geo  0.50497e-4 0.28346e-1
   mesh 0.24079e-1 -0.24079e-1 0.10668e-1 0.10668e-1

#===================================================
# Gaps
#===================================================

gap id 1
   ch 1 2
   length 0.147e-1  # m
   width 0.343e-2 # m
gap id 2
   ch 1 5
   length 0.147e-1
   width 0.343e-2
gap id 3
   ch 2 3
   length 0.187e-1
   width 0.343e-2
gap id 4
   ch 2 6
   length 0.147e-1
   width 0.427e-2
gap id 5
   ch 3 4
   length 0.147e-1
   width 0.343e-2
gap id 6
   ch 3 7
   length 0.147e-1
   width 0.427e-2
gap id 7
   ch 4 8
   length 0.147e-1
   width 0.343e-2
gap id 8
   ch 5 6
   length 0.147e-1
   width 0.427e-2
gap id 9
   ch 5 9
   length 0.187e-1
   width 0.343e-2
gap id 10
   ch 6 7
   length 0.187e-1
   width 0.427e-2
gap id 11
   ch 6 10
   length 0.187e-1
   width 0.427e-2
gap id 12
   ch 7 8
   length 0.147e-1
   width 0.427e-2
gap id 13
   ch 7 11
   length 0.187e-1
   width 0.427e-2
gap id 14
   ch 8 12
   length 0.187e-1
   width 0.343e-2
gap id 15
   ch 9 10
   length 0.147e-1
   width 0.427e-2
gap id 16
   ch 9 13
   length 0.147e-1
   width 0.343e-2
gap id 17
   ch 10 11
   length 0.187e-1
   width 0.427e-2
gap id 18
   ch 10 14
   length 0.147e-1
   width 0.427e-2
gap id 19
   ch 11 12
   length 0.147e-1
   width 0.427e-2
gap id 20
   ch 11 15
   length 0.147e-1
   width 0.427e-2
gap id 21
   ch 12 16
   length 0.147e-1
   width 0.343e-2
gap id 22
   ch 13 14
   length 0.147e-1
   width 0.343e-2
gap id 23
   ch 14 15
   length 0.187e-1
   width 0.343e-2
gap id 24
   ch 15 16
   length 0.147e-1
   width 0.343e-2

#===================================================
# Solid geometries
#===================================================

solid_geo id 1
   type "tube"
   dout 14.478e-3
   din  12.478e-3

#===================================================
# Solid objects
#===================================================

solid id 1
   geo 1
   ch 1 2 5 6
   pct 0.25 0.25 0.25 0.25
solid id 2
   geo 1
   ch 2 3 6 7
   pct 0.25 0.25 0.25 0.25
solid id 3
   geo 1
   ch 3 4 7 8
   pct 0.25 0.25 0.25 0.25
solid id 4
   geo 1
   ch 5 6 9 10
   pct 0.25 0.25 0.25 0.25
solid id 5
   geo 1
   ch 6 7 10 11
   pct 0.25 0.25 0.25 0.25
solid id 6
   geo 1
   ch 7 8 11 12
   pct 0.25 0.25 0.25 0.25
solid id 7
   geo 1
   ch 9 10 13 14
   pct 0.25 0.25 0.25 0.25
solid id 8
   geo 1
   ch 10 11 14 15
   pct 0.25 0.25 0.25 0.25
solid id 9
   geo 1
   ch 11 12 15 16
   pct 0.25 0.25 0.25 0.25

#===================================================
# Form losses
#===================================================

loss
   ch 1 4 13 16
   levels 3 15 27 39 51 63
   k 0.336

loss
   ch 2 3 5 8 9 12 14 15
   levels 3 15 27 39 51 63
   k 0.1629

loss
   ch 6 7 10 11
   levels 3 15 27 39 51 63
   k 0.1504

#===================================================
# Parallel domains
#===================================================

domain id 1
   solids 1 2 3 4 5 6
   solid_owners 1 1 1 1 1 2
   chans 1 2 3 4 5 6 7 8

domain id 2
   solids 4 5 6 7 8 9
   solid_owners 1 1 2 2 2 2
   chans 9 10 11 12 13 14 15 16
Loading