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

Fix for dnb for transients

Make it consistent with how it works in CTF and update the nodal
tests.
parent ebb1094e
Loading
Loading
Loading
Loading
+29 −9
Original line number Diff line number Diff line
@@ -111,9 +111,10 @@ class Model:
                                      }

      me.conductorOptions = {'nc': 1, # 1-D conduction
                             'chfModel': -1, # CHF model disabled
                             'postChfCheck': 0 # Do not check CHF at the end of the simulation
                             'chfModel': 'none', # CHF model disabled
                             'postChfCheck': 'w3' # Check CHF at end of each edit
                             }
      me.conductorOptionsSet = {'nc': False, 'chfModel': False, 'postChfCheck': False}

      # Parallel model information
      me.channelsInDomain = {}
@@ -709,23 +710,34 @@ class Model:
            - 1 for radial conduction only
            - 2 for radial and azimuthal conduction only
            - 3 for radial, azimuthal, and axial conduction
         chfModel (int): Set to:
            - -1 for no post-CHF heat transfer (always use pre-CHF models)
            - 0 for Biasi
            - 1 for W-3
         postChfCheck (bool): Same options as chfModel.  Meant to be used when the chfModel is disabled.
         chfModel (str): Set to:
            - "none"
            - "biasi"
            - "w3"
            - "groeneveld"
         postChfCheck (str): Same options as chfModel.  Meant to be used when the chfModel is disabled.
            The code cannot go into post-CHF, but the CHF model will still be used to calculate DNBR at the
            end of the simulation.

      """
      if nc:
         me.conductorOptions['nc'] = nc
         me.conductorOptionsSet['nc'] = True

      valid = ['none', 'w3', 'biasi', 'groeneveld']

      if chfModel:
          if chfModel not in valid:
              raise ValueError("The selected CHF model: "+str(chfModel)+" is not valid")
          me.conductorOptions['chfModel'] = chfModel
          me.conductorOptionsSet['chfModel'] = True

      if postChfCheck:
          if postChfCheck not in valid:
              raise ValueError("The selected CHF model: "+str(postChfCheck)+" is not valid")
          me.conductorOptions['postChfCheck'] = postChfCheck
          me.conductorOptionsSet['postChfCheck'] = True


   def setEditOptions(me, chanVTK=None, rodVTK=None, ctfHDF5=None, veracsHDF5=None, chanASCII=None,
         rodEdits=None, dnbEdits=None):
@@ -1121,6 +1133,8 @@ class Model:
                assert('undefined_default_uniform' in me.axialPowerShapeAxial[0.0])
                me.solidObjects[pinID].powID = 'undefined_default_uniform'

      me._chfChecks()

   def _inferInitialConditionsFromBC(me):
      """ If the IC can be inferred from the channel boundary conditions that will be set, returns
      initial mass flow rate, temperature, and pressure.  If not, returns None."""
@@ -1194,6 +1208,12 @@ class Model:
            raise RuntimeError("Attempting to apply boundary condition to undefined channel:"+str(chID))
         me.sections[secID].channels[chID].addBC(bc, level)

   def _chfChecks(me):
       if not me.runSteadyState and me.conductorOptions['postChfCheck']!='none':
           if me.conductorOptionsSet['postChfCheck']:
              warnings.warn("Cannot use post CHF checks when running a transient.  The CHF model will be turned on with the same option instead.")
           me.conductorOptions['chfModel'] = me.conductorOptions['postChfCheck']
           me.conductorOptions['postChfCheck']='none'

class Gap(object):
   """ Defines a gap (a lateral connection between two channels in the same axial section)
+17 −1
Original line number Diff line number Diff line
@@ -270,7 +270,23 @@ def writeDeck(model):
   group8Data.append("    8                                                                                           \n")
   group8Data.append("*Card 8.1                                                                                       \n")
   group8Data.append("** NRRD   NSRD    NC  NRTB  NRAD  NLTY  NSTA   NXF  NCAN  RADF    W3 IHTC  DNBCHK NDM14         \n")
   group8Data.append("{:7d}{:8d}{:6d}     1     0     0     1     1     0     0{:6d}     1{:6d}     0          \n".format(len(heated), len(unheated), model.conductorOptions['nc'], model.conductorOptions['chfModel'], model.conductorOptions['postChfCheck']))
   if model.conductorOptions['chfModel']=='none':
       w3 = -1
   elif model.conductorOptions['chfModel']=='biasi':
       w3 = 0
   elif model.conductorOptions['chfModel']=='w3':
       w3 = 1
   elif model.conductorOptions['chfModel']=='groeneveld':
       w3 = 3
   if model.conductorOptions['postChfCheck']=='none':
       dnbchk = -1
   elif model.conductorOptions['postChfCheck']=='biasi':
       dnbchk = 0
   elif model.conductorOptions['postChfCheck']=='w3':
       dnbchk = 1
   elif model.conductorOptions['postChfCheck']=='groeneveld':
       dnbchk = 3
   group8Data.append("{:7d}{:8d}{:6d}     1     0     0     1     1     0     0{:6d}     1{:6d}     0          \n".format(len(heated), len(unheated), model.conductorOptions['nc'], w3, dnbchk))

   # If this is a parallel model write data
   if model.rodsInDomain:
+15 −9
Original line number Diff line number Diff line
@@ -32,18 +32,24 @@ class SummaryTools(object):
        else:
            _fname = fname
        f = open(_fname, 'w')
        f.write("  |========== operating conditions ===============|====== critical location =======|=============== hot channel conditions ===================|=======|\n")
        f.write("  |  system  | inlet |    inlet      | average    |       |   hot   | hot  | axial |  mass flux    |          |  heat flux    | CHF           |       |\n")
        f.write("  | pressure | temp. |  mass flux    | heat rate  | mdnbr | channel | rod  | level |               |   equil. |               | heat flux     | time  |\n")
        unitsB ="  |  (psia)  |  (F)  | (Mlbm/hr-ft2) | (btu/s-ft) |       |         |      | (in)  | (Mlbm/hr-ft2) |  quality | (Mbtu/hr-ft2) | (Mbtu/hr-ft2) | (sec) |\n"
        unitsS ="  |   (bar)  |  (C)  | (kg/m**2/s)   |  (kW/m)    |       |         |      |  (m)  |   (kg/m**2/s) |  quality |  (kW/m**2)    |  (kW/m**2)    | (sec) |\n"
        #f.write("  |========== operating conditions ===============|====== critical location =======|=============== hot channel conditions ===================|=======|\n")
        #f.write("  |  system  | inlet |    inlet      | average    |       |   hot   | hot  | axial |  mass flux    |          |  heat flux    | CHF           |       |\n")
        #f.write("  | pressure | temp. |  mass flux    | heat rate  | mdnbr | channel | rod  | level |               |   equil. |               | heat flux     | time  |\n")
        #unitsB ="  |  (psia)  |  (F)  | (Mlbm/hr-ft2) | (btu/s-ft) |       |         |      | (in)  | (Mlbm/hr-ft2) |  quality | (Mbtu/hr-ft2) | (Mbtu/hr-ft2) | (sec) |\n"
        #unitsS ="  |   (bar)  |  (C)  | (kg/m**2/s)   |  (kW/m)    |       |         |      |  (m)  |   (kg/m**2/s) |  quality |  (kW/m**2)    |  (kW/m**2)    | (sec) |\n"
        f.write("  |====== operating conditions ======|====== critical location =======|=============== hot channel conditions ===================|=======|\n")
        f.write("  |  system  | inlet |    inlet      |       |   hot   | hot  | axial |  mass flux    |          |  heat flux    | CHF           |       |\n")
        f.write("  | pressure | temp. |  mass flux    | mdnbr | channel | rod  | level |               |   equil. |               | heat flux     | time  |\n")
        unitsB ="  |  (psia)  |  (F)  | (Mlbm/hr-ft2) |       |         |      | (in)  | (Mlbm/hr-ft2) |  quality | (Mbtu/hr-ft2) | (Mbtu/hr-ft2) | (sec) |\n"
        unitsS ="  |   (bar)  |  (C)  | (kg/m**2/s)   |       |         |      |  (m)  |   (kg/m**2/s) |  quality |  (kW/m**2)    |  (kW/m**2)    | (sec) |\n"
        if _units=="si":
            f.write(unitsS)
        else:
            f.write(unitsB)
        f.write("  |===============================================|================================|==========================================================|=======|\n")
        f.write("  |==================================|================================|==========================================================|=======|\n")
        for state in range(1, me.h5.getNumState()+1):
            minState, minPin, theta, level, minDNBR = me.h5.getPinWithMinDNBR(state)
            minDNBR = min(minDNBR, 100.0)
            hotChID = me.h5.getConnChan(minPin, level, theta)
            axial, dnbr = me.h5.getPinAxialDNBR(state, minPin, theta)
            sysPressure = me.h5.getAvePressure(state=state)
@@ -67,12 +73,12 @@ class SummaryTools(object):
            axial, quality = me.h5.getChanEquilibriumQuality(hotChID, state)
            xHot = quality[chLevel]
            axial, q = me.h5.getPinAxialHeatFlux(state, minPin, theta)
            qHot = q[level]
            qHot = max(q[level], 0.0)
            if convert:
                qHot = qHot*unit.t_kJ_MBTU/unit.t_s_hr/unit.t_m_ft**2
            if me.h5.isTransient():
                time = me.h5.getTransientTime(state)
            else:
                time = 0.0
            f.write("{:12.3f}{:8.2f}{:16.3f}{:13s}{:8.4f}{:10d}{:6d}{:9.4f}{:16.4e}{:12.4e}{:16.4e}{:16.4e}{:8.4f}\n".format(sysPressure, inletTemp,
                inletMflux, "", minDNBR, hotChID, minPin, location, mfluxHot, xHot, qHot, minDNBR*qHot, time))
            f.write("{:12.3f}{:8.2f}{:16.3f}{:8.3f}{:10d}{:6d}{:9.4f}{:16.4e}{:12.4e}{:16.4e}{:16.4e}{:8.4f}\n".format(sysPressure, inletTemp,
                inletMflux, minDNBR, hotChID, minPin, location, mfluxHot, xHot, qHot, minDNBR*qHot, time))
+3 −0
Original line number Diff line number Diff line
@@ -196,6 +196,9 @@ def main():
   # If this step is not performed, the core will have a uniform radial and axial power shape.
   builder.setCorePowerShape(radialPower=radPow, axialPower=axPow)

   # The CHF model is disabled by default.  Enable it so DNB is calculated
   model.setConductorModelOptions(chfModel="w3")

   # Set the nominal power and direct heating to coolant
   # Without this, the model power will be zero.
   model.setAveragePower(qprime=linearHeatRate, dhfrac=directHeat)
+83 −83
Original line number Diff line number Diff line
@@ -17733,7 +17733,7 @@
    8
*Card 8.1
** NRRD   NSRD    NC  NRTB  NRAD  NLTY  NSTA   NXF  NCAN  RADF    W3 IHTC  DNBCHK NDM14
   1544       0     1     1     0     0     1     1     0     0    -1     1     0     0          
   1544       0     1     1     0     0     1     1     0     0     1     1    -1     0
{num_domain} 7
{domain} 1
** local_inex    global_index    owner
Loading