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

Fix a bug and add a test

Description:

Gitlab Ticket # - XXXX
parent ea9ab8bc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1016,20 +1016,20 @@ class Model:
              end of the simulation.

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

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

        if chfModel:
        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:
        if postChfCheck is not None:
            if postChfCheck not in valid:
                raise ValueError("The selected CHF model: "
                                 + str(postChfCheck) + " is not valid")
+1 −1
Original line number Diff line number Diff line
@@ -353,7 +353,7 @@ def writeDeck(model, filename):
        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(
    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))

    # If this is a parallel model write data
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ ctf model
    8
*Card 8.1
** NRRD   NSRD    NC  NRTB  NRAD  NLTY  NSTA   NXF  NCAN  RADF    W3 IHTC  DNBCHK NDM14
      1       0     1     1     0     0     1     1     0     0    -1     1     1     0
      1      0     0     1     0     0     1     1     0     0    -1     1     1     0
*Card 8.2
**    N   IFTY   IAXP   NRND DAXMIN  RMULT         HGAP  ISECR       HTAMB        TAMB  SYMROD  HTCMAP TKEMAP NSUBAX NSUBAZ
*Card 8.3
+3 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
# - There was a bug in the boundary condition getter in the Model class, which was getting hit by this script
#   and crashing the code
# - The mass/energy balance units were wrong, which was fixed here.
# - Fixed a bug with enabling/disabling the conduction model, which is used here
# - Tests the ability for the user to enable the entrainment model

import sys
sys.path.insert(0, '../../')
@@ -60,6 +62,7 @@ def main():
                         vv_l2_abs=1e2, vv_linf_abs=1e-3, vd_l2_abs=1e2, vd_linf_abs=1e-3,
                         dtmin=1e-7, dtmax=1e-4)
    model.setModel(enableEntrainment=True)
    model.setConductorModelOptions(nc=0)

    model.generateModel()