File size: 3,912 Bytes
c993983
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
56
57
58
59
60
61
62
from matplotlib import pyplot as plt

class HPIPlot():
    def __init__(self, process_designation, t_sink_out, pyPinch, ev_wp, ko_wp, COPWerte, COPT, gcc_draw, _temperatures, cop_regression):
        self.process_designation = process_designation
        self.grand_composite_curve = gcc_draw
        self.ko_wp = ko_wp
        self.ev_wp = ev_wp
        self.COPWerte = COPWerte
        self.cop_t = COPT
        self.t_sink_out = t_sink_out
        self.pyPinch = pyPinch
        self._temperatures = _temperatures
        self.cop_regression = cop_regression
    def draw_cop_ko(self):
        self.x = []
        self.y = []
        fig1 = plt.figure()
        for i in self.ko_wp[::3]:
            self.x.append(i)
        for i in self.COPWerte[::3]:
            self.y.append(i)
        plt.plot(self.x,self.y)
        plt.grid(True)
        plt.title('COP gegen Qpunkt Ko')#plt.title('Grand Composite Curve')
        plt.xlabel('Qpunkt Ko [kW]')#plt.xlabel('Net Enthalpy Change ∆H (kW)')
        plt.ylabel('COP [-]')#plt.ylabel('Shifted Temperature S (degC)')
    
    def draw_grand_composite_curve(self):
        grand_composite_curve = self.grand_composite_curve
        Tempplus = 0
        self.heat_cascade = self.pyPinch.heat_cascade
        plt.close('all')
        fig = plt.figure()
        if self.heat_cascade[0]['deltaH'] > 0:  
            plt.plot([grand_composite_curve['H'][0],grand_composite_curve['H'][1]], [self.grand_composite_curve['T'][0],self.grand_composite_curve['T'][1]], 'tab:red')
            plt.plot([grand_composite_curve['H'][0],grand_composite_curve['H'][1]], [self.grand_composite_curve['T'][0],self.grand_composite_curve['T'][1]], 'ro')
        elif self.heat_cascade[0]['deltaH'] < 0:
            plt.plot([grand_composite_curve['H'][0],grand_composite_curve['H'][1]], [self.grand_composite_curve['T'][0],self.grand_composite_curve['T'][1]], 'tab:blue')
            plt.plot([grand_composite_curve['H'][0],grand_composite_curve['H'][1]], [grand_composite_curve['T'][0],grand_composite_curve['T'][1]], 'bo')

        for i in range(1, len(self._temperatures)-1):
            if self.heat_cascade[i]['deltaH'] > 0:
                plt.plot([grand_composite_curve['H'][i],grand_composite_curve['H'][i+1]], [grand_composite_curve['T'][i],grand_composite_curve['T'][i+1]], 'tab:red')
                plt.plot([grand_composite_curve['H'][i],grand_composite_curve['H'][i+1]], [grand_composite_curve['T'][i],grand_composite_curve['T'][i+1]], 'ro')
            elif self.heat_cascade[i]['deltaH'] < 0:
                plt.plot([grand_composite_curve['H'][i],grand_composite_curve['H'][i+1]], [grand_composite_curve['T'][i],grand_composite_curve['T'][i+1]], 'tab:blue')
                plt.plot([grand_composite_curve['H'][i],grand_composite_curve['H'][i+1]], [grand_composite_curve['T'][i],grand_composite_curve['T'][i+1]], 'bo')
            elif self.heat_cascade[i]['deltaH'] == 0 and grand_composite_curve['H'][i]!=0:
                plt.plot([grand_composite_curve['H'][i],grand_composite_curve['H'][i+1]], [grand_composite_curve['T'][i],grand_composite_curve['T'][i+1]], 'tab:blue')
                plt.plot([grand_composite_curve['H'][i],grand_composite_curve['H'][i+1]], [grand_composite_curve['T'][i],grand_composite_curve['T'][i+1]], 'bo')

        plt.plot(self.ev_wp[-1],self.cop_t[-1],'g^')
        plt.plot(self.ko_wp[-1],self.t_sink_out,'g^')
        plt.text(0.94*self.ko_wp[-1],0.93*self.t_sink_out,round(self.COPWerte[-1],2))
        plt.grid(True)
        name = self.process_designation
        plt.suptitle('Großverbundkurve {} °C ({})'.format(round(self.t_sink_out,1),name))#plt.title('Grand Composite Curve')
        plt.title(self.cop_regression)
        plt.xlabel('Nettoenthalpiestromänderung ∆H in kW')#plt.xlabel('Net Enthalpy Change ∆H (kW)')
        plt.ylabel('Verschobene Temperatur in °C')#plt.ylabel('Shifted Temperature S (degC)')