Commit c71e689c authored by Wysocki, Aaron's avatar Wysocki, Aaron Committed by Salko Jr, Robert
Browse files

Adding fuel modeling parameters

Description:
Adding conductorModelingOptions inputs for fuel conduction and gap
conductance modeling options.

Gitlab ticket - 4116
parent ba9e61c4
Loading
Loading
Loading
Loading
+116 −29
Original line number Diff line number Diff line
@@ -164,12 +164,41 @@ class Model:
                                        'Tsolid_linf_abs': 1e-4
                                        }

        me.conductorOptions = {'nc': 1,  # 1-D conduction
                               'chfModel': 'none',  # CHF model disabled
                               'postChfCheck': 'w3'  # Check CHF at end of each edit
        me.conductorOptions = {'nc':    # 1-D conduction
                                  {'value': 1, # enabled
                                   'validEntries':[0,1,2,3]},
                               'chfModel':    # CHF model
                                  {'value': 'none', # disabled
                                   'validEntries':['none','biasi','w3','groeneveld']},
                               'postChfCheck':  # Check CHF at end of each edit
                                  {'value': 'w3', # check with w3 model
                                   'validEntries':['none','biasi','w3','groeneveld']},
                               'irelf':    # Impact of fuel relocation on fuel thermal conductivity
                                  {'value': -1, # disabled
                                   'validEntries':[-1, 0, 1, 2, 3]},
                               'iconf':   # Fuel conductivity degradation model disabled
                                  {'value': -1, # disabled
                                   'validEntries':[-1, 0, 1]},
                               'imwr':   # Metal-water reaction model disabled
                                  {'value': -1, # disabled
                                   'validEntries':[-1, 0, 1]},
                               'ifswell':   # Fuel solid and gas swelling models disabled
                                  {'value': -1, # disabled
                                   'validEntries':[-1, 0, 1, 2]},
                               'ifdens':   # Fuel densification model disabled
                                  {'value': -1, # disabled
                                   'validEntries':[-1, 0, 1, 2, 3]},
                               'ifreloc':   # No impact of fuel relocation on gap conductance is modeled
                                  {'value': -1, # disabled
                                   'validEntries':[-1, 0, 1, 2, 3]},
                               'ifcladcreep':   # Clad creep model is disabled
                                  {'value': -1, # disabled
                                   'validEntries':[-1, 0, 1, 2]},
                               }
        me.conductorOptionsSet = {'nc': False,
                                  'chfModel': False, 'postChfCheck': False}

        # Declare each conductor option as not set externally
        for (i,option) in me.conductorOptions.items():
            option['set'] = False

        # Parallel model information
        me.channelsInDomain = {}
@@ -1199,7 +1228,9 @@ class Model:
        if dtmax:
            me.dtMax_steady = dtmax

    def setConductorModelOptions(me, nc=None, chfModel=None, postChfCheck=None):
    def setConductorModelOptions(me, nc=None, chfModel=None, postChfCheck=None,
                                 irelf=None, iconf=None, imwr=None, ifswell=None,
                                 ifdens=None, ifreloc=None, ifcladcreep=None):
        """ Set global modeling options for solid conductors in the model.

        Args:
@@ -1216,27 +1247,83 @@ class Model:
           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.
           irelf (int): Model for the impact of fuel relocation on fuel thermal conductivity. Set to:
              - -1 for the current default CTF modeling option
              -  0 to disable the model
              -  1, 2, or 3 to enable the model
           iconf (int): Fuel conductivity degradation model. Set to:
              - -1 for the current default CTF modeling option
              -  0 to disable the model
              -  1 to enable the model
           imwr (int): Metal-water reaction model. Set to:
              - -1 for the current default CTF modeling option
              -  0 to disable the model
              -  1 to enable the model
           ifswell (int): Fuel solid and gas swelling models. Set to:
              - -1 for the current default CTF modeling option
              -  0 to disable the solid and gas models
              -  1 for the MATPRO solid swelling and modified FRAPCON gas swelling models
              -  2 for the MATRPO solid swelling and MATPRO gas swelling models
           ifdens (int): Fuel densification model. Set to:
              - -1 for the current default CTF modeling option
              -  0 to disable the model
              -  1 for the MATPRO model
              -  2 for the FRAPCON model
              -  3 for the ESCORE model
           ifreloc (int): Model for the impact of fuel relocation on gap conductance. Set to:
              - -1 for the current default CTF modeling option
              -  0 to disable the model
              -  1 for the FRAPCON model
              -  2 for the ESCORE model
              -  3 for the modified ESCORE model
           ifcladcreep (int): Clad creep model. Set to:
              - -1 for the current default CTF modeling option
              -  0 to disable the model
              -  1 for the Hoppe-Hayes model
              -  2 for the Escore model

        """
        me.setSingleConductorOption('nc',nc)
        me.setSingleConductorOption('chfModel',chfModel)
        me.setSingleConductorOption('postChfCheck',postChfCheck)
        me.setSingleConductorOption('irelf',irelf)
        me.setSingleConductorOption('iconf',iconf)
        me.setSingleConductorOption('imwr',imwr)
        me.setSingleConductorOption('ifswell',ifswell)
        me.setSingleConductorOption('ifdens',ifdens)
        me.setSingleConductorOption('ifreloc',ifreloc)
        me.setSingleConductorOption('ifcladcreep',ifcladcreep)

    def setSingleConductorOption(me,name,value):
        """ Receives the name and value of a conductor option and stores
        it if the key name and value are valid. value=None may be specified,
        resulting in no change to the conductor option data.

        Args:
           name (str): the name of a conductor option (e.g. 'nc'), which
               must be one of the keys in me.conductorOptions that was set in
               me.__init__()
           value: the value to be assigned to this conductor option, which
               must have the same type as the default value for this key
               that was set in me.__init__(). The value must also be a member
               of the validEntries list that was declared for this key in
               me.__init__()
               
        """
        if nc is not None:
            me.conductorOptions['nc'] = nc
            me.conductorOptionsSet['nc'] = True

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

        if chfModel is not None:
            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 is not None:
            if postChfCheck not in valid:
                raise ValueError("The selected CHF model: " +
                                 str(postChfCheck) + " is not valid")
            me.conductorOptions['postChfCheck'] = postChfCheck
            me.conductorOptionsSet['postChfCheck'] = True
        if value is not None:
            if not name in me.conductorOptions.keys():
                raise ValueError(name+" is not a valid conductor option")
            if type(value) is not type(me.conductorOptions[name]['value']):
                # Assume all entries must have the same type as the
                # default entry set in this class.
                raise TypeError(name+" must be "+str(type(me.conductorOptions[name]['value']))+
                                " but it was provided as "+str(type(value)))
            if value not in me.conductorOptions[name]['validEntries']:
                raise ValueError("The value provided for "+name+" ("+str(value)+
                                 ") is not one of the valid values: "
                                 +str(me.conductorOptions[name]['validEntries']))
            me.conductorOptions[name]['value'] = value
            me.conductorOptions[name]['set'] = True

    def setEditOptions(me, chanVTK=None, rodVTK=None, ctfHDF5=None, veracsHDF5=None, chanASCII=None,
                       rodEdits=None, dnbEdits=None):
@@ -1835,14 +1922,14 @@ class Model:
            me.sections[secID].channels[chID].addBC(bc, level)

    def _chfChecks(me):
        if not me.runSteadyState and me.conductorOptions['postChfCheck'] != 'none':
            if me.conductorOptionsSet['postChfCheck']:
        if not me.runSteadyState and me.conductorOptions['postChfCheck']['value'] != 'none':
            if me.conductorOptions['postChfCheck']['set']:
                # If the post CHF model was explicitly set, warn the user and set the chf model to this
                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['chfModel']['value'] = me.conductorOptions['postChfCheck']['value']
            # The post-CHF check is not valid for transients, so disable it
            me.conductorOptions['postChfCheck'] = 'none'
            me.conductorOptions['postChfCheck']['value'] = 'none'

    def _sectionConnections(me):
        """Ensure that all connections between sections are consistent"""
+14 −11
Original line number Diff line number Diff line
@@ -391,24 +391,24 @@ def writeDeck(model, filename):
    group8Data.append("*Card 8.1\n")
    group8Data.append(
        "** NRRD   NSRD    NC  NRTB  NRAD  NLTY  NSTA   NXF  NCAN  RADF    W3 IHTC  DNBCHK NDM14\n")
    if model.conductorOptions['chfModel'] == 'none':
    if model.conductorOptions['chfModel']['value'] == 'none':
        w3 = -1
    elif model.conductorOptions['chfModel'] == 'biasi':
    elif model.conductorOptions['chfModel']['value'] == 'biasi':
        w3 = 0
    elif model.conductorOptions['chfModel'] == 'w3':
    elif model.conductorOptions['chfModel']['value'] == 'w3':
        w3 = 1
    elif model.conductorOptions['chfModel'] == 'groeneveld':
    elif model.conductorOptions['chfModel']['value'] == 'groeneveld':
        w3 = 3
    if model.conductorOptions['postChfCheck'] == 'none':
    if model.conductorOptions['postChfCheck']['value'] == 'none':
        dnbchk = -1
    elif model.conductorOptions['postChfCheck'] == 'biasi':
    elif model.conductorOptions['postChfCheck']['value'] == 'biasi':
        dnbchk = 0
    elif model.conductorOptions['postChfCheck'] == 'w3':
    elif model.conductorOptions['postChfCheck']['value'] == 'w3':
        dnbchk = 1
    elif model.conductorOptions['postChfCheck'] == 'groeneveld':
    elif model.conductorOptions['postChfCheck']['value'] == 'groeneveld':
        dnbchk = 3
    group8Data.append("{:7d}{:7d}{:6d}     1     0     0     1     1     0     0{:6d}     1{:6d}     0\n".format(
        len(heated), len(unheated), model.conductorOptions['nc'], w3, dnbchk))
        len(heated), len(unheated), model.conductorOptions['nc']['value'], w3, dnbchk))

    # If this is a parallel model write data
    if model.rodsInDomain:
@@ -555,10 +555,13 @@ def writeDeck(model, filename):
    group9Data.append("    9\n")
    group9Data.append("*Card 9.1\n")
    group9Data.append(
        "** NFLT IRLF ICNF IMWR NDM5 NDM6 NDM7 NDM8 NDM9 NM10 NM11 NM12 NM13 NM14\n")
        "** NFLT IRLF ICNF IMWR ISWL IDNS IRLG CREEP NDM9 NM10 NM11 NM12 NM13 NM14\n")
    numtype = len(list(set(model.solidTypeIDs.values())))
    group9Data.append(
        "{0:7d}    0    0    0    0    0    0    0    0    0    0    0    0    0\n".format(numtype))
        "{0:7d}{1:5d}{2:5d}{3:5d}{4:5d}{5:5d}{6:5d}{7:5d}    0    0    0    0    0    0\n".format(
            numtype, model.conductorOptions['irelf']['value'], model.conductorOptions['iconf']['value'], model.conductorOptions['imwr']['value'],
            model.conductorOptions['ifswell']['value'], model.conductorOptions['ifdens']['value'], model.conductorOptions['ifreloc']['value'],
            model.conductorOptions['ifcladcreep']['value']))

    def charID(pinobj):
        if isinstance(pinobj, Solid.FuelRod):
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ home directory.

.. code-block:: bash

   ./config.sh
   ./config.sh ~/SubKit

4. Run make install

+2 −2
Original line number Diff line number Diff line
@@ -420,8 +420,8 @@ ctf model
**NGR
    9
*Card 9.1
** NFLT IRLF ICNF IMWR NDM5 NDM6 NDM7 NDM8 NDM9 NM10 NM11 NM12 NM13 NM14
      1    0    0    0    0    0    0    0    0    0    0    0    0    0
** NFLT IRLF ICNF IMWR ISWL IDNS IRLG CREEP NDM9 NM10 NM11 NM12 NM13 NM14
      1   -1   -1   -1   -1   -1   -1   -1    0    0    0    0    0    0
*Card 9.6
**  I FTYP           DROD            DIN   NFUL IMTF IMTC DUM8 DUM9  DUM10  DUM11  DUM12  DUM13  DUM14  EPSO
    1 tube   1.447800e-02    1.24780e-02      1    0    0    0   0       0     0     0      0    0    0.0
+2 −2
Original line number Diff line number Diff line
@@ -20621,8 +20621,8 @@
**NGR
    9
*Card 9.1
** NFLT IRLF ICNF IMWR NDM5 NDM6 NDM7 NDM8 NDM9 NM10 NM11 NM12 NM13 NM14
      1    0    0    0    0    0    0    0    0    0    0    0    0    0
** NFLT IRLF ICNF IMWR ISWL IDNS IRLG CREEP NDM9 NM10 NM11 NM12 NM13 NM14
      1   -1   -1   -1   -1   -1   -1   -1    0    0    0    0    0    0
*Card 9.2
**  I FTYP       DROD       DFUL  NFUL IMTF IMTC IMOX DCRE        TCLD        FTDS IGPC IGFC IRDP  EPSO
    1 nucl  0.0095000  0.0081920    10    0    0    0    0 5.70000e-04 1.00000e+00    0    0    0   0.0
Loading