Spaces:
Running
Running
File size: 2,207 Bytes
db79a6a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
import csv
from Modules.Pinch.Pinch import Pinch
from Modules.Pinch.PinchPlot import PinchPlot
class Pinchmain():
def __init__(self, CSV, options = {}):
self.PinchAnalyse = Pinch(CSV, options)
self._options = {}
def solvePinch(self, localisation = 'DE'):
self.PinchAnalyse.shiftTemperatures()
self.PinchAnalyse.constructTemperatureInterval()
self.PinchAnalyse.constructProblemTable()
self.PinchAnalyse.constructHeatCascade()
self.PinchAnalyse.constructShiftedCompositeDiagram(localisation)
self.PinchAnalyse.constructCompositeDiagram(localisation)
self.PinchAnalyse.constructGrandCompositeCurve(localisation)
with open("Buffer file for TotalSiteProfile creation.csv", "w", newline="") as csvfile:
self.newstreamsdata = csv.writer(csvfile)
self.newstreamsdata.writerow(self.PinchAnalyse._temperatures)
self.newstreamsdata.writerow(self.PinchAnalyse.heatCascade)
self.newstreamsdata.writerow([self.PinchAnalyse.hotUtility])
if self.PinchAnalyse._options['draw'] == True:
PinchPlot.showPlots()
def solvePinchforISSP(self, localisation = 'DE'):
self.PinchAnalyse.shiftTemperatures()
self.PinchAnalyse.constructTemperatureInterval()
self.PinchAnalyse.constructProblemTable()
self.PinchAnalyse.constructHeatCascade()
self.PinchAnalyse.constructShiftedCompositeDiagram(localisation)
return[self.PinchAnalyse.shiftedCompositeDiagram, self.PinchAnalyse]
def solvePinchforHPI(self, localisation = 'DE'):
self.PinchAnalyse.shiftTemperatures()
self.PinchAnalyse.constructTemperatureInterval()
self.PinchAnalyse.constructProblemTable()
self.PinchAnalyse.constructHeatCascade()
self.PinchAnalyse.constructShiftedCompositeDiagram(localisation)
self.PinchAnalyse.constructCompositeDiagram(localisation)
self.PinchAnalyse.constructGrandCompositeCurve(localisation)
return(self.PinchAnalyse)
#Pinchmain('Example.csv', options={'draw', 'csv'}).solvePinch()
#Pinchmain('Prozess_neu.csv', options={'draw', 'csv'}).solvePinch() |