def generateStUpStream(self):
        stream = Stream()
        stream.FluidDensity = self.FluidDensity
        stream.StartTemp.setAverageTemperature(self.PTStartUp)
        stream.EndTemp.setAverageTemperature(self.PT)
        stream.Type = self.getStreamType(stream.StartTemp.getAvg(), stream.EndTemp.getAvg())
        stream.SpecHeatCap = self.FluidCp
        stream.SpecEnthalpy = self.getSpecificEnthalpy(
            stream.EndTemp.getAvg(), stream.StartTemp.getAvg(), stream.SpecHeatCap
        )
        stream.MassFlowAvg = self.massFlow.getMassFlowStUpNom(self.VolProcMed, self.FluidDensity)
        stream.EnthalpyNom = self.getEnthalpyNom(
            stream.EndTemp, stream.StartTemp, stream.SpecHeatCap, stream.MassFlowAvg
        )
        stream.EnthalpyVector = Status.int.UPH_s_t[self.Process]
        stream.MassFlowVector = self.getMassFlowVector(
            stream.EnthalpyVector, stream.SpecHeatCap, stream.EndTemp, stream.StartTemp
        )
        # stream.EnthalpyNom, stream.EnthalpyVector = self.getEnthalpy(stream.EndTemp.getAvg(), stream.StartTemp.getAvg(), stream.SpecHeatCap, stream.MassFlowVector, stream.MassFlowAvg)
        # stream.MassFlowAvg, stream.MassFlowVector = self.massFlow.getMassFlowStUp(self.VolProcMed, self.FluidDensity, stream.EnthalpyVector, stream.EnthalpyNom)

        stream.HeatTransferCoeff = self.getHeatTransferCoefficient(self.FluidDensity)
        stream.HeatCap = self.getHeatCapacity(stream.MassFlowAvg, stream.SpecHeatCap)
        stream.HotColdType = self.getHotCold(stream.EnthalpyNom)
        stream.OperatingHours = self.massFlow.getStUpOperatingHours()
        self.StUpStream.append(stream)
 def generateWHBelowCondStream(self):
     """
     Generate Waste heat below Cond Stream
     TODO Correct to Waste Heat
     """
     stream = Stream()
     stream.FluidDensity = self.FluidDensity
     stream.StartTemp.setAverageTemperature(self.Tcond)
     stream.EndTemp.setAverageTemperature(self.PTFinal)
     stream.Type = self.getStreamType(stream.StartTemp.getAvg(), stream.EndTemp.getAvg())
     stream.SpecHeatCap = self.FluidCp
     stream.SpecEnthalpy = self.getSpecificEnthalpy(
         stream.EndTemp.getAvg(), stream.StartTemp.getAvg(), stream.SpecHeatCap
     )
     if self.VOutflowCycle != None:
         stream.MassFlowAvg, stream.MassFlowVector = self.massFlow.getMassFlowWH(
             stream.FluidDensity, VOutflowCycle=self.VOutflowCycle
         )
     elif self.mOutflowNom != None:
         stream.MassFlowAvg, stream.MassFlowVector = self.massFlow.getMassFlowWH(
             stream.FluidDensity, mOutflowNom=self.mOutFlowNom
         )
     stream.EnthalpyNom, stream.EnthalpyVector = self.getEnthalpy(
         stream.EndTemp.getAvg(),
         stream.StartTemp.getAvg(),
         stream.SpecHeatCap,
         stream.MassFlowVector,
         stream.MassFlowAvg,
     )
     stream.HeatTransferCoeff = 5000
     stream.HeatCap = self.getHeatCapacity(stream.MassFlowAvg, stream.SpecHeatCap)
     stream.HotColdType = self.getHotCold(stream.EnthalpyNom)
     stream.OperatingHours = self.periodSchedule.getOutflowHoursPerYear()
     self.WasteHeatBC.append(stream)
    def generateWHCondStream(self):
        """
        Generate Waste Heat Cond Stream
        TODO Correct to Waste Heat
        """
        stream = Stream()
        stream.FluidDensity = 1000
        stream.StartTemp.setAverageTemperature(self.Tcond)
        stream.EndTemp.setAverageTemperature(self.Tcond - 0.1)
        stream.Type = self.getProcessStreamType(stream.StartTemp.getAvg(), stream.EndTemp.getAvg())

        stream.SpecEnthalpy = self.LatentHeat
        stream.SpecHeatCap = stream.SpecEnthalpy * 10
        stream.MassFlowAvg, stream.MassFlowVector = self.massFlow.getMassFlowWHCond(
            VOutflowCycle=self.VOutflowCycle,
            FluidDensity=stream.FluidDensity,
            XOutFlow=self.XOutFlow,
            mOutflowNom=self.mOutFlowNom,
        )
        stream.EnthalpyNom, stream.EnthalpyVector = self.getEnthalpy(
            stream.EndTemp.getAvg(),
            stream.StartTemp.getAvg(),
            stream.SpecHeatCap,
            stream.MassFlowVector,
            stream.MassFlowAvg,
        )
        stream.HeatTransferCoeff = 10000
        stream.HeatCap = self.getHeatCapacity(stream.MassFlowAvg, stream.SpecHeatCap)
        stream.HotColdType = self.getHotCold(stream.EnthalpyNom)
        stream.OperatingHours = self.periodSchedule.getOutflowHoursPerYear()
        self.WasteHeatC.append(stream)
    def generateCircStream(self):
        stream = Stream()

        if self.PTInflowRec != None:
            stream.StartTemp.setAverageTemperature(self.PTInflowRec)
        else:
            stream.StartTemp.setAverageTemperature(self.PTInflow)

        stream.FluidDensity = self.FluidDensity
        stream.EndTemp.setAverageTemperature(self.PT)
        stream.Type = self.getStreamType(stream.StartTemp.getAvg(), stream.EndTemp.getAvg())
        stream.SpecHeatCap = self.FluidCp
        stream.SpecEnthalpy = self.getSpecificEnthalpy(
            stream.EndTemp.getAvg(), stream.StartTemp.getAvg(), stream.SpecHeatCap
        )
        stream.MassFlowAvg, stream.MassFlowVector = self.massFlow.getMassFlowCirc(
            stream.FluidDensity, self.VInflowCycle, self.mInflowNom, self.VInflowDay, self.HperDay
        )
        stream.EnthalpyNom, stream.EnthalpyVector = self.getEnthalpy(
            stream.EndTemp.getAvg(),
            stream.StartTemp.getAvg(),
            stream.SpecHeatCap,
            stream.MassFlowVector,
            stream.MassFlowAvg,
        )
        stream.HeatTransferCoeff = self.getHeatTransferCoefficient(self.FluidDensity)
        stream.HeatCap = self.getHeatCapacity(stream.MassFlowAvg, stream.SpecHeatCap)
        stream.HotColdType = self.getHotCold(stream.EnthalpyNom)
        operatingHours = self.periodSchedule.getInflowHoursPerYear()
        self.CircStream.append(stream)
    def generateMaintainanceStream(self):

        stream = Stream()
        stream.StartTemp.setAverageTemperature(self.PT)
        stream.EndTemp.setAverageTemperature(self.PT + 0.1)
        stream.FluidDensity = self.FluidDensity
        stream.Type = self.getProcessStreamType(stream.StartTemp.getAvg(), stream.EndTemp.getAvg())
        stream.SpecHeatCap = 3600
        stream.SpecEnthalpy = self.getSpecificEnthalpy(
            stream.EndTemp.getAvg(), stream.StartTemp.getAvg(), stream.SpecHeatCap
        )
        stream.Enthalpy = []
        for elem in self.periodSchedule.getYearlyBatchOperationProfile():
            stream.Enthalpy.append(elem * self.Qdot)

        stream.MassFlowAvg, stream.MassFlowVector = self.massFlow.getMassFlowOp(stream.Enthalpy, stream.SpecHeatCap)
        stream.HeatTransferCoeff = 5000
        stream.HeatCap = self.getHeatCapacity(stream.MassFlowAvg, stream.SpecHeatCap)
        stream.HotColdType = self.getHotCold(stream.EnthalpyNom)
        stream.OperatingHours = self.periodSchedule.getOperationHoursPerYear()
        self.MaintainanceStream.append(stream)