-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvcc_cycle.py
137 lines (94 loc) · 4.29 KB
/
vcc_cycle.py
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
__author__ = 'Peter Eriksson @ KTH 2015'
import vcc_input
import vcc_functions
# Description:
# This file describes the vcc cycle for the introduction
# Scientific parameters
k = 273.15
folder = '../../Report/LaTeX/data/'
# Load input data from file
input_data = {}
# Evaporator
input_data["ev_temperature"] = -20 + k # [C] Evaporator temperature
input_data["ev_super_heat"] = 20 # [K] Evaporator outlet super heating
input_data["ev_pressure_drop"] = 100e3 # [Pa] Evaporator pressure drop
# Suction line
input_data["sl_temperature_change"] = 20 # [K] Superheat (Suction line)
input_data["sl_pressure_drop"] = 10e3 # [Pa] Suction Line
# Compressor
input_data["capacity_volumetric"] = 1
input_data["efficiency_isentropic"] = 0.8 # [-] Isentropic Efficiency 0=Bitzer data
input_data["efficiency_volymetric"] = 1 # [-] Volymetric Efficiency
# Discharge line
input_data["dl_temperature_change"] = 40 # [K] Superheat (Suction line)
input_data["dl_pressure_drop"] = 100e3 # [K] Superheat (Suction line)
# Condenser
input_data["co_temperature"] = 40 + k # [C] Temperature
input_data["co_sub_cooling"] = 15 # [K] Outlet super cooling
input_data["co_pressure_drop"] = 600e3 # [Pa] Pressure drop
# Liquid line
input_data["ll_temperature_change"] = 8 # [K] Superheat (Suction line)
input_data["ll_pressure_drop"] = 300e3 # [K] Superheat (Suction line)
# Set refrigerant data
ref_R404A = vcc_input.refrigerant("R449A")
# Instatiate system data for refrigerant respectively
R404A = vcc_functions.Vcc(ref_R404A)
R404A.set_input_data(input_data)
#R404A.set_compressor_data('R449A-4FES-5Y.xls')
R404A.set_compressor_data(input_data["efficiency_isentropic"])
R404A.calculate()
envelope = R404A.build_envelope()
# Write the envelope
file_envelope = open(str("%s%s.dat" % (folder, 'Nomenclature-envelope')), 'w+')
file_envelope.write("ethalpy pressure\n")
for f in range(0, len(envelope['p'])):
file_envelope.write(str("%f %f\n" % (envelope['h'][f], envelope['p'][f])))
file_envelope.close()
# Write the cycle
file_cycle = open(str("%s%s.dat" % (folder, 'Nomenclature-cycle')), 'w+')
file_cycle.write("ethalpy pressure\n")
for f in range(-1, 10):
file_cycle.write(str("%f %f\n" % (R404A._h[f]/1e3, R404A._p[f]/1e5)))
file_cycle.close()
# Write the hs
file_hs = open(str("%s%s.dat" % (folder, 'Nomenclature-hs')), 'w+')
file_hs.write("ethalpy pressure\n")
file_hs.write(str("%f %f\n" % (R404A._h[7]/1e3, R404A._p[7]/1e5)))
file_hs.write(str("%f %f\n" % (R404A._h[7]/1e3, 0.5)))
file_hs.close()
# Write the h2k
file_h1k = open(str("%s%s.dat" % (folder, 'Nomenclature-h1k')), 'w+')
file_h1k.write("ethalpy pressure\n")
file_h1k.write(str("%f %f\n" % (R404A._h[1]/1e3, R404A._p[1]/1e5)))
file_h1k.write(str("%f %f\n" % (R404A._h[1]/1e3, 0.5)))
file_h1k.close()
# Write the h2k
file_h2k = open(str("%s%s.dat" % (folder, 'Nomenclature-h2k')), 'w+')
file_h2k.write("ethalpy pressure\n")
file_h2k.write(str("%f %f\n" % (R404A._h[0]/1e3, R404A._p[0]/1e5)))
file_h2k.write(str("%f %f\n" % (R404A._h[0]/1e3, 0.5)))
file_h2k.close()
# Write the h1kis-line
file_h1kis_line = open(str("%s%s.dat" % (folder, 'Nomenclature-h1kis-line')), 'w+')
file_h1kis_line.write("ethalpy pressure\n")
file_h1kis_line.write(str("%f %f\n" % (R404A._h[0]/1e3, R404A._p[0]/1e5)))
file_h1kis_line.write(str("%f %f\n" % (R404A._h1k_is/1e3, R404A._p[1]/1e5)))
file_h1kis_line.close()
# Write the h1kis
file_h1kis = open(str("%s%s.dat" % (folder, 'Nomenclature-h1kis')), 'w+')
file_h1kis.write("ethalpy pressure\n")
file_h1kis.write(str("%f %f\n" % (R404A._h1k_is/1e3, R404A._p[1]/1e5)))
file_h1kis.write(str("%f %f\n" % (R404A._h1k_is/1e3, 0.5)))
file_h1kis.close()
# Write the p1m
file_p1m = open(str("%s%s.dat" % (folder, 'Nomenclature-p1m')), 'w+')
file_p1m.write("ethalpy pressure\n")
file_p1m.write(str("%f %f\n" % ((R404A.h(3)+R404A.h(4))/2e3, (R404A.p(3)+R404A.p(4))/2e5-0.1)))
file_p1m.write(str("%f %f\n" % (50, (R404A.p(3)+R404A.p(4))/2e5-0.1)))
file_p1m.close()
# Write the p1m
file_p2m = open(str("%s%s.dat" % (folder, 'Nomenclature-p2m')), 'w+')
file_p2m.write("ethalpy pressure\n")
file_p2m.write(str("%f %f\n" % ((R404A.h(7)+R404A.h(8))/2e3, (R404A.p(7)+R404A.p(8))/2e5-0.05)))
file_p2m.write(str("%f %f\n" % (50, (R404A.p(7)+R404A.p(8))/2e5-0.05)))
file_p2m.close()