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

Enable guide tubes with veracsHDF5 in nodal models

There was previous coding which attempted to print guide tubes to the rod map, but guide tubes ought to be excluded. This makes it print fuel rods only.  Additionally, the nodal_p7 tests were calling Model::setEditOptions, but rodMap and chanMap can only be set by calling SquareLatticeLWR_Nodal::setEditOptions. This was also fixed.

Gitlab Ticket # - 4648
parent 39ad2400
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -22,8 +22,9 @@ tests:
      - cd $BLD_DIR
      - rm -rf *
      - $SRC_DIR/config.sh $SRC_DIR
      - make -j16
      - ctest -j16
      - make -j4
      - conda activate py2
      - ctest -j4
   after_script:
      - SRC_DIR=`pwd`
      - cd $BLD_DIR
+2 −3
Original line number Diff line number Diff line
@@ -19,9 +19,8 @@ ENDIF(NOT TRIBITS_PROCESSING_PACKAGE)

file(COPY tests SubKit doc LICENSE MANIFEST.in README.md setup.py DESTINATION  ${CMAKE_CURRENT_BINARY_DIR})

find_package(PythonInterp 2.7.5 REQUIRED )
find_package(PythonLibs 2.7.5 REQUIRED )
find_program(PYTHON "python")
find_package(Python2 REQUIRED )
find_program(PYTHON "python2")
SET(PYTHON_EXE
    ${PYTHON}
)
+4 −1
Original line number Diff line number Diff line
@@ -1356,7 +1356,7 @@ class Model:
            me.conductorOptions[name]['set'] = True

    def setEditOptions(me, chanVTK=None, rodVTK=None, ctfHDF5=None, veracsHDF5=None, chanASCII=None,
                       rodEdits=None, dnbEdits=None):
                       rodEdits=None, dnbEdits=None, mainTextOutput=None):
        """Set the code output options.

        Args:
@@ -1367,6 +1367,7 @@ class Model:
            chanASCII (bool): Set to True to write the ASCII channel output file.
            rodEdits (bool): Set to True to write rod edit information to the standard CTF .out file (Note the rod information in the .out file is limited in scope and it is better to get rod data from the native HDF5 file).
            dnbEdits (bool): Set  to True to produce the CTF .dnb file, which contains information about DNB (default False).
            mainTextOutput (bool): Set to True to produce the standard CTF .out file (default True).

        """
        if chanVTK is not None:
@@ -1383,6 +1384,8 @@ class Model:
            me.editOptions['rod_edits'] = rodEdits
        if dnbEdits is not None:
            me.editOptions['dnb_edits'] = dnbEdits
        if mainTextOutput is not None:
            me.editOptions['main_text_output'] = mainTextOutput
        return None

    def generateModel(me, filename='deck.inp'):
+16 −33
Original line number Diff line number Diff line
@@ -665,7 +665,8 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
    """
    def __init__(me, model, coreMap, assemMaps, pitch, dz, solidGeoms, startChanIndex=1, assemPitch=None,
                 baffleGap=0.0, sectionID=1, symOpt=1, assemLosses=None, assemLossLevels=None,
                 assemGridBlockageRatios=None, assemGridEnhancementCoeffs=None, rodDomains=None, modelGuideTubes=False, sym_opt=1):
                 assemGridBlockageRatios=None, assemGridEnhancementCoeffs=None, rodDomains=None, modelGuideTubes=False, sym_opt=1,
                 gapWidthMult=1.0, gapLengthMult=1.0):
        assert(isinstance(model, Model.Model))
        assert(len(coreMap) > 0)
        assert(utils.isArraySquare(coreMap))
@@ -737,8 +738,8 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
                    if southGaps:
                        gaps = gaps + southGaps
                    for gap in gaps:
                        model.setGap(gap.ii, gap.jj, gap.width,
                                     gap.length, mult=gap.mult)
                        model.setGap(gap.ii, gap.jj, gap.width*gapWidthMult,
                                     gap.length*gapLengthMult, mult=gap.mult)

        # Add the solid geometry objects
        for solidTypeID in solidGeoDict.keys():
@@ -989,7 +990,7 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
        return valsDict

    def setEditOptions(me, chanVTK=None, rodVTK=None, ctfHDF5=None, veracsHDF5=None, chanASCII=None,
                       rodEdits=None, dnbEdits=None):
                       rodEdits=None, dnbEdits=None, mainTextOutput=None):
        """
        Delegates setting edits to the Model instance contained in this builder.

@@ -1004,15 +1005,13 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
              (Note the rod information in the .out file is limited in scope and it is better to
               get rod data from the native HDF5 file).
            dnbEdits (bool): Set  to True to produce the CTF .dnb file, which contains information about DNB (default False).
            mainTextOutput (bool): Set to True to produce the standard CTF .out file (default True).
        """
        if veracsHDF5 == True:
            rodMap, chanMap, assemMap, symOpt = me.getChannelAndRodMaps()
            me.model.setCoreMaps(rodMap, chanMap, assemMap, symOpt)
            if me.modelGuideTubes:
                raise RuntimeError("Nodal VERA CS edits are not compatible with modelGuideTubes=True. "
                                   + " Set modelGuideTubes=False")
        me.model.setEditOptions(chanVTK, rodVTK, ctfHDF5,
                                veracsHDF5, chanASCII, rodEdits, dnbEdits)
                                veracsHDF5, chanASCII, rodEdits, dnbEdits, mainTextOutput)

    def getChannelAndRodMaps(me):
        """
@@ -1032,10 +1031,6 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
            assemMap is a 2 dimensional list
            symOpt is an int: 1=full sym, 4=qtr sym
        """
        if me.modelGuideTubes:
            raise RuntimeError("Model guide tubes is currently not supported "
                               + "by the nodal veracsHDF5 writer. Set modelGuideTubes=False.")
        else:
        rodMap = np.zeros((len(me.chMapObj.chAssemIdx), len(
            me.chMapObj.chAssemIdx[0])), dtype=int)

@@ -1043,7 +1038,6 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
        for obj in me.model.solidObjects.values():
            # this only works in full sym mode for now
            assert(obj.symtype == 1)

        # create the rodMap
        for asm_i in range(me.chMapObj.getAssemDimLen()):
            for asm_j in range(me.chMapObj.getAssemDimLen()):
@@ -1056,18 +1050,7 @@ class SquareLatticeLWR_Nodal(CoreBuilder.Core):
                        assert len(rods) == 4

                    # fill rodMap
                    if me.modelGuideTubes:
                        # top nodes in asm
                        rodMap[asm_i * 2 + 0][asm_j * 4 + 0] = int(assemID)
                        rodMap[asm_i * 2 + 0][asm_j * 4 + 1] = int(assemID)
                        rodMap[asm_i * 2 + 0][asm_j * 4 + 2] = int(assemID)
                        rodMap[asm_i * 2 + 0][asm_j * 4 + 3] = int(assemID)
                        # bottom nodes in asm
                        rodMap[asm_i * 2 + 1][asm_j * 4 + 0] = int(assemID)
                        rodMap[asm_i * 2 + 1][asm_j * 4 + 1] = int(assemID)
                        rodMap[asm_i * 2 + 1][asm_j * 4 + 2] = int(assemID)
                        rodMap[asm_i * 2 + 1][asm_j * 4 + 3] = int(assemID)
                    else:

                    # top nodes in asm
                    rodMap[asm_i * 2 + 0][asm_j * 2 + 0] = int(assemID)
                    rodMap[asm_i * 2 + 0][asm_j * 2 + 1] = int(assemID)
+4 −0
Original line number Diff line number Diff line
@@ -838,6 +838,10 @@ def writeDeck(model, filename):
    group14Data.append('  -14\n')
    group14Data.append('**               KEY     VALUE\n')
    for key in model.editOptions:
        if key=='hdf5':
            if model.editOptions[key] and not model.rodMap:
                raise RuntimeError(
                    "Card Group 14: veracsHDF5 was set to True but no rodMap was provided")
        group14Data.append('{:>20s}{:10d}\n'.format(
            key, int(model.editOptions[key])))
    group14Data.append('end 14\n')
Loading