Exemplo n.º 1
0
    def getInternalPiping(self) -> InternalPiping:
        inputPort = _mfn.PortItem("Crystallizer Input", _mfn.PortItemType.INPUT)
        outputPort = _mfn.PortItem("Crystallizer Output", _mfn.PortItemType.OUTPUT)

        crystalizer = _mfn.Pipe(self.displayName, self.trnsysId, inputPort, outputPort)
        modelPortItemsToGraphicalPortItem = {inputPort: self.inputs[0], outputPort: self.outputs[0]}
        return InternalPiping([crystalizer], modelPortItemsToGraphicalPortItem)
Exemplo n.º 2
0
    def getInternalPiping(self) -> InternalPiping:
        inputPort = _mfn.PortItem("IceStorage Input", _mfn.PortItemType.INPUT)
        outputPort = _mfn.PortItem("IceStorage Output",
                                   _mfn.PortItemType.OUTPUT)
        pipe = _mfn.Pipe(self.displayName, self.trnsysId, inputPort,
                         outputPort)

        return InternalPiping([pipe], {
            inputPort: self.inputs[0],
            outputPort: self.outputs[0]
        })
Exemplo n.º 3
0
 def _getModelAndMapping(self):
     input1 = _mfn.PortItem("Tee Piece Input 1", _mfn.PortItemType.INPUT)
     input2 = _mfn.PortItem("Tee Piece Input 2", _mfn.PortItemType.INPUT)
     output = _mfn.PortItem("Tee Piece Output", _mfn.PortItemType.OUTPUT)
     teePiece = _mfn.TeePiece(self.displayName, self.trnsysId, input1,
                              input2, output)
     modelPortItemsToGraphicalPortItem = {
         input1: self.inputs[0],
         input2: self.inputs[1],
         output: self.outputs[0]
     }
     return teePiece, modelPortItemsToGraphicalPortItem
Exemplo n.º 4
0
    def getInternalPiping(self) -> InternalPiping:
        inputPort = _mfn.PortItem("Pump Input", _mfn.PortItemType.INPUT)
        outputPort = _mfn.PortItem("Pump Output", _mfn.PortItemType.OUTPUT)

        pump = _mfn.Pump(self.displayName, self.trnsysId, inputPort,
                         outputPort)

        modelPortItemsToGraphicalPortItem = {
            inputPort: self.inputs[0],
            outputPort: self.outputs[0]
        }
        return InternalPiping([pump], modelPortItemsToGraphicalPortItem)
Exemplo n.º 5
0
    def getInternalPiping(self) -> _mfs.InternalPiping:
        inputPort = _mfn.PortItem("Ground Source Input",
                                  _mfn.PortItemType.INPUT)
        outputPort = _mfn.PortItem("Ground Source Output",
                                   _mfn.PortItemType.OUTPUT)

        pipe = _mfn.Pipe(self.displayName, self.trnsysId, inputPort,
                         outputPort)

        return _mfs.InternalPiping([pipe], {
            inputPort: self.inputs[0],
            outputPort: self.outputs[0]
        })
Exemplo n.º 6
0
    def getInternalPiping(self) -> InternalPiping:
        pipes = []
        portItems = {}
        for i in range(3):
            inputPort = _mfn.PortItem(f"Input {i+1}", _mfn.PortItemType.INPUT)
            outputPort = _mfn.PortItem(f"Output {i+1}", _mfn.PortItemType.OUTPUT)

            pipe = _mfn.Pipe(f"{self.displayName}Side{i+1}", self.childIds[i], inputPort, outputPort)
            pipes.append(pipe)

            portItems[inputPort] = self.inputs[i]
            portItems[outputPort] = self.outputs[i]

        return InternalPiping(pipes, portItems)
Exemplo n.º 7
0
    def _createPortPairNodes(self):
        portPairsPortItems = {}
        portPairNodes = []
        for directPortPair in self.directPortPairs:
            portPairPortItem1 = _mfn.PortItem("Input", _mfn.PortItemType.INPUT)
            portPairsPortItems[portPairPortItem1] = directPortPair.fromPort

            portPairPortItem2 = _mfn.PortItem("Output", _mfn.PortItemType.OUTPUT)
            portPairsPortItems[portPairPortItem2] = directPortPair.toPort

            portPairName = self._getMassFlowVariableSuffixForDirectPortPair(directPortPair)

            node = _mfn.Pipe(portPairName, directPortPair.trnsysId, portPairPortItem1, portPairPortItem2)
            portPairNodes.append(node)

        return portPairNodes, portPairsPortItems
Exemplo n.º 8
0
    def _createHeatExchangerNodes(self):
        heatExchangerPortItems = {}
        heatExchangerNodes = []
        for heatExchanger in self.heatExchangers:
            heatExchangerPortItem1 = _mfn.PortItem("Heat Exchanger Input", _mfn.PortItemType.INPUT)
            heatExchangerPortItems[heatExchangerPortItem1] = heatExchanger.port1

            heatExchangerPortItem2 = _mfn.PortItem("Heat Exchanger Output", _mfn.PortItemType.OUTPUT)
            heatExchangerPortItems[heatExchangerPortItem2] = heatExchanger.port2

            name = self._getMassFlowVariableSuffixForHeatExchanger(heatExchanger)

            node = _mfn.Pipe(name, heatExchanger.trnsysId, heatExchangerPortItem1, heatExchangerPortItem2)
            heatExchangerNodes.append(node)

        return heatExchangerNodes, heatExchangerPortItems
Exemplo n.º 9
0
    def getInternalPiping(self) -> InternalPiping:
        condenserInput = _mfn.PortItem("Condenser Input", _mfn.PortItemType.INPUT)
        condenserOutput = _mfn.PortItem("Condenser Output", _mfn.PortItemType.OUTPUT)
        condenserPipe = _mfn.Pipe(f"{self.displayName}Cond", self.childIds[0], condenserInput, condenserOutput)

        evaporatorInput = _mfn.PortItem("Evaporator Input", _mfn.PortItemType.INPUT)
        evaporatorOutput = _mfn.PortItem("Evaporator Output", _mfn.PortItemType.OUTPUT)
        evaporatorPipe = _mfn.Pipe(f"{self.displayName}Evap", self.childIds[1], evaporatorInput, evaporatorOutput)

        modelPortItemsToGraphicalPortItem = {
            condenserInput: self.inputs[1],
            condenserOutput: self.outputs[1],
            evaporatorInput: self.inputs[0],
            evaporatorOutput: self.outputs[0],
        }
        nodes = [condenserPipe, evaporatorPipe]

        return InternalPiping(nodes, modelPortItemsToGraphicalPortItem)
Exemplo n.º 10
0
    def getInternalPiping(self) -> InternalPiping:
        assert len(self.inputs) == len(self.outputs)

        pipes = []
        portItems = {}
        for i, (graphicalInputPort, graphicalOutputPort) in enumerate(
                zip(self.inputs, self.outputs)):
            inputPort = _mfn.PortItem(f"Input {i+1}", _mfn.PortItemType.INPUT)
            outputPort = _mfn.PortItem(f"Output {i+1}",
                                       _mfn.PortItemType.OUTPUT)
            pipe = _mfn.Pipe(f"{self.displayName}X{i}", self.childIds[0],
                             inputPort, outputPort)

            pipes.append(pipe)
            portItems[inputPort] = graphicalInputPort
            portItems[outputPort] = graphicalOutputPort

        return InternalPiping(pipes, portItems)
Exemplo n.º 11
0
    def getInternalPiping(self) -> InternalPiping:
        side1Input = _mfn.PortItem("Side Input 1", _mfn.PortItemType.INPUT)
        side1Output = _mfn.PortItem("Side Output 1", _mfn.PortItemType.OUTPUT)
        side1Pipe = _mfn.Pipe(f"{self.displayName}Side1", self.childIds[0],
                              side1Input, side1Output)

        side2Input = _mfn.PortItem("Side Input 2", _mfn.PortItemType.INPUT)
        side2Output = _mfn.PortItem("Side Output 2", _mfn.PortItemType.OUTPUT)
        side2Pipe = _mfn.Pipe(f"{self.displayName}Side2", self.childIds[1],
                              side2Input, side2Output)

        modelPortItemsToGraphicalPortItem = {
            side1Input: self.inputs[0],
            side1Output: self.outputs[0],
            side2Input: self.inputs[1],
            side2Output: self.outputs[1]
        }

        return InternalPiping([side1Pipe, side2Pipe],
                              modelPortItemsToGraphicalPortItem)
Exemplo n.º 12
0
    def getInternalPiping(self) -> InternalPiping:
        portItem = _mfn.PortItem("WTap Input", _mfn.PortItemType.INPUT)
        sink = _mfn.Sink(self.displayName, self.trnsysId, portItem)

        return InternalPiping([sink], {portItem: self.inputs[0]})
Exemplo n.º 13
0
 def getInternalPiping(self) -> InternalPiping:
     outputPort = _mfn.PortItem("WTap Output", _mfn.PortItemType.OUTPUT)
     source = _mfn.Source(self.displayName, self.trnsysId, outputPort)
     return InternalPiping([source], {outputPort: self.outputs[0]})