-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVolume.py
291 lines (234 loc) · 13.4 KB
/
Volume.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# Python Import ==================
from abc import ABC, abstractmethod
import math
# User Import ======================
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
# Job : Abstract Class from Control Volume
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
# CABINET SECTION INTERNAL VOLUMES
# HXVUZ is the freezer volume used for heat exchangers(CU. FT.)
# HXVUR is the fresh food volume used for heat exchangers(CU. FT.)
# VOLAZ is the adjusted freezer volume(CU. FT.)
# VOLAR is the adjusted general refrigerated volume(CU. FT.)
class Volume(ABC):
def __init__(self, obj_data):
# Set basic Vras
self.HXVUR = self.TIRT = self.TIRLS = self.TIFT = self.TIRF = self.TIRB = self.CINSUL = None
self.BINFRZ = self.HXVUR = self.TIFLS = self.TIRRS = self.TIRLS = self.TIFT = None
self.TIRF = self.TIRB = self.CINSUL = self.TIFLS = self.TIFT = self.TIFT = self.CINSUL = None
self.SCIN = self.STIN = self.TIFLS = self.TIFLS = self.TIFT = self.CINSUL = self.HXVUR = None
self.TIRT = self.TIRF = self.TIRB = self.TIRLS = None
self.obj_data = obj_data
self.DINS = (self.obj_data.DOL + self.obj_data.DIL) / 10 # change from mm to cm
self.TIFRS = self.obj_data.TIFRS + self.DINS
self.TIFF = self.obj_data.TIFF + self.DINS
self.TIFB = self.obj_data.TIFB + self.DINS
self.BINSUL = obj_data.BINSUL + self.DINS
self.HXVUZ = self.obj_data.HXVUZ * 1000 # change from liter to cm3
# --------------------
@abstractmethod
def calc_volume(self):
pass
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Job : Volume for Configration3(Mode 2)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
class Volume_Ql2(Volume):
def calc_volume(self):
self.HXVUR = self.obj_data.HXVUR * 1000 # change from liter to cm3
self.TIRT = self.obj_data.TIRT + self.DINS
self.TIRLS = self.obj_data.TIRLS + self.DINS
self.TIFT = self.obj_data.TIFT + self.DINS
self.TIRF = self.obj_data.TIRF + self.DINS
self.TIRB = self.obj_data.TIRB + self.DINS
self.CINSUL = self.obj_data.CINSUL + self.DINS
self.BINFRZ = self.obj_data.BINFRZ + self.DINS
self.obj_data.VFZ = ((self.obj_data.WIDTH
- self.obj_data.WALL - self.obj_data.THMUL
- self.TIFRS)
* (self.obj_data.DEPTH - self.TIFF - self.TIFB)
* (self.obj_data.HEIGHT - self.BINFRZ - self.TIFT)
) - self.HXVUZ
self.obj_data.VFF = (self.obj_data.WALL - self.TIRLS) \
* (self.obj_data.DEPTH - self.TIRF - self.TIRB) \
* (self.obj_data.HEIGHT - self.BINSUL - self.TIRT) - self.HXVUR
if self.obj_data.NCCTYPE == 2:
BETA = math.atan(self.obj_data.CDDN / self.obj_data.CCHGT)
HTRIAN = self.obj_data.CCHGT \
- self.BINSUL \
+ self.BINSUL / math.sin(BETA) \
- self.TIRB / math.tan(BETA)
self.obj_data.VFF = self.obj_data.VFF \
- 0.5 * HTRIAN * HTRIAN * math.tan(BETA) * (self.obj_data.WALL - self.TIRLS)
BETA = math.atan(self.obj_data.CDDN / self.obj_data.CCHGT)
HTRIAN = self.obj_data.CCHGT \
- self.BINFRZ + self.BINFRZ / math.sin(BETA) \
- self.TIFB / math.tan(BETA)
self.obj_data.VFZ = self.obj_data.VFZ \
- 0.5 * HTRIAN * HTRIAN * math.tan(BETA) \
* (self.obj_data.WIDTH - self.obj_data.WALL
- self.obj_data.THMUL - self.TIFRS)
if self.obj_data.NCCTYPE == 3:
BETA = math.atan((self.obj_data.CDDN - self.obj_data.CDUP) / self.obj_data.CCHGT)
ALPHA = math.pi / 4.0 - BETA / 2.0
UPPERL = self.obj_data.CDUP - self.TIRB + self.BINSUL * math.tan(ALPHA)
self.obj_data.VFF = self.obj_data.VFF - 0.5 * (2.0 * UPPERL + self.obj_data.CCHGT * math.tan(BETA)) * \
self.obj_data.CCHGT * (self.obj_data.WALL - self.TIRLS)
BETA = math.atan((self.obj_data.CDDN - self.obj_data.CDUP) / self.obj_data.CCHGT)
ALPHA = math.pi / 4.0 - BETA / 2.0
UPPERL = self.obj_data.CDUP - self.TIFB + self.BINFRZ * math.tan(ALPHA)
self.obj_data.VFZ = self.obj_data.VFZ - 0.5 * (2.0 * UPPERL+self.obj_data.CCHGT * math.tan(BETA)) * \
self.obj_data.CCHGT * (self.obj_data.WIDTH - self.obj_data.WALL - self.obj_data.THMUL - self.TIFRS)
self.obj_data.VFZ /= 1000
self.obj_data.VFF /= 1000
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Job : Volume for Configration 1 or 7(Mode 3)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
class Volume_Ql13(Volume):
def calc_volume(self):
self.HXVUR = self.obj_data.HXVUR * 1000 # change from liter to cm3
self.TIFLS = self.obj_data.TIFLS + self.DINS
self.TIRRS = self.obj_data.TIRRS + self.DINS
self.TIRLS = self.obj_data.TIRLS + self.DINS
self.TIFT = self.obj_data.TIFT + self.DINS
self.TIRF = self.obj_data.TIRF + self.DINS
self.TIRB = self.obj_data.TIRB + self.DINS
self.CINSUL = self.obj_data.CINSUL + self.DINS
self.obj_data.VFZ = (self.obj_data.WIDTH - self.TIFLS - self.TIFRS) \
* (self.obj_data.DEPTH - self.TIFF - self.TIFB) \
* (self.obj_data.TOPMUL - self.TIFT) - self.HXVUZ
self.obj_data.VFF = (self.obj_data.DEPTH - self.TIRF - self.TIRB) \
* (self.obj_data.WIDTH - self.TIRLS - self.TIRRS) \
* (self.obj_data.HEIGHT - self.obj_data.TOPMUL - self.obj_data.THMUL - self.BINSUL) \
- self.HXVUR
if self.obj_data.NCCTYPE == 2:
BETA = math.atan(self.obj_data.CDDN / self.obj_data.CCHGT)
HTRIAN = self.obj_data.CCHGT - self.BINSUL + self.BINSUL / math.sin(BETA) \
- self.TIRB / math.tan(BETA)
self.obj_data.VFF = self.obj_data.VFF \
- 0.5 * HTRIAN * HTRIAN * math.tan(BETA) * (self.obj_data.WIDTH - self.TIRLS - self.TIRRS)
if self.obj_data.NCCTYPE == 3:
BETA = math.atan((self.obj_data.CDDN - self.obj_data.CDUP) / self.obj_data.CCHGT)
ALPHA = math.pi / 4.0 - BETA / 2.0
UPPERL = self.obj_data.CDUP - self.TIRB + self.BINSUL * math.tan(ALPHA)
self.obj_data.VFF = self.obj_data.VFF - 0.5 * (2.0 * UPPERL + self.obj_data.CCHGT * math.tan(BETA)) * \
self.obj_data.CCHGT * (self.obj_data.WIDTH - self.TIRLS - self.TIRRS)
self.obj_data.VFZ /= 1000
self.obj_data.VFF /= 1000
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Job : Volume for Configration6(Mode 4)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
class Volume_Ql4(Volume):
def calc_volume(self):
self.TIFLS = self.obj_data.TIFLS + self.DINS
self.TIFT = self.obj_data.TIFT + self.DINS
self.obj_data.VFZ = self.obj_data.VOLAZ
self.obj_data.VFF = (self.obj_data.WIDTH - self.TIFLS - self.TIFRS) \
* (self.obj_data.HEIGHT - self.BINSUL - self.TIFT) \
* (self.obj_data.DEPTH - self.TIFF - self.TIFB) - self.obj_data.VOLAZ
if self.obj_data.NCCTYPE == 2:
BETA = math.atan(self.obj_data.CDDN / self.obj_data.CCHGT)
HTRIAN = self.obj_data.CCHGT - self.BINSUL + self.BINSUL / math.sin(BETA) \
- self.TIFB / math.tan(BETA)
self.obj_data.VFF = self.obj_data.VFF - 0.5 * HTRIAN * HTRIAN * math.tan(BETA) * \
(self.obj_data.WIDTH - self.TIFLS - self.TIFRS)
if self.obj_data.NCCTYPE == 3:
BETA = math.atan((self.obj_data.CDDN - self.obj_data.CDUP) / self.obj_data.CCHGT)
ALPHA = math.pi / 4.0 - BETA / 2.0
UPPERL = self.obj_data.CDUP - self.TIFB + self.BINSUL * math.tan(ALPHA)
self.obj_data.VFF = self.obj_data.VFF - 0.5 * (2.0 * UPPERL + self.obj_data.CCHGT * math.tan(BETA)) * \
self.obj_data.CCHGT * (self.obj_data.WIDTH - self.TIFLS - self.TIFRS)
self.obj_data.VFZ /= 1000
self.obj_data.VFF /= 1000
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Job : Volume for Configration4(Mode 5)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
class Volume_Ql5(Volume):
def calc_volume(self):
self.TIFT = self.obj_data.TIFT + self.DINS
self.CINSUL = self.obj_data.CINSUL + self.DINS
self.SCIN = self.obj_data.SCIN + self.DINS
self.STIN = self.obj_data.STIN + self.DINS
self.obj_data.TIFLS = self.obj_data.TIFRS # create a new var in data
self.TIFLS = self.obj_data.TIFLS + self.DINS
# ----
self.obj_data.VFZ = (((self.obj_data.WIDTH - self.TIFLS - self.TIFRS)
* (self.obj_data.DEPTH - self.TIFF - self.TIFB)
* (self.obj_data.HEIGHT - self.BINSUL - self.TIFT))
- ((self.obj_data.DEPTH - self.TIFF - self.TIFB) * (self.obj_data.CWIDE
- (self.TIFLS + self.TIFRS) / 2.0) * (self.obj_data.CHGT - self.CINSUL))
) - self.HXVUZ
self.obj_data.VFZ /= 1000
self.obj_data.VFF /= 1000
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Job : Volume for Configration5(Mode 7)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
class Volume_Ql7(Volume):
def calc_volume(self):
self.TIFLS = self.obj_data.TIFLS + self.DINS
self.TIFT = self.obj_data.TIFT + self.DINS
self.CINSUL = self.obj_data.CINSUL + self.DINS
self.obj_data.VFZ = (self.obj_data.WIDTH - self.TIFLS - self.TIFRS) \
* (self.obj_data.HEIGHT - self.BINSUL - self.TIFT) \
* (self.obj_data.DEPTH - self.TIFF - self.TIFB) - self.HXVUZ
if self.obj_data.NCCTYPE == 2:
BETA = math.atan(self.obj_data.CDDN / self.obj_data.CCHGT)
HTRIAN = self.obj_data.CCHGT - self.BINSUL \
+ self.BINSUL / math.sin(BETA) \
- self.TIFB / math.tan(BETA)
self.obj_data.VFZ = self.obj_data.VFZ \
- 0.5 * HTRIAN * HTRIAN * math.tan(BETA) * (self.obj_data.WIDTH - self.TIFLS - self.TIFRS)
if self.obj_data.NCCTYPE == 3:
BETA = math.atan((self.obj_data.CDDN - self.obj_data.CDUP) / self.obj_data.CCHGT)
ALPHA = math.pi / 4.0 - BETA / 2.0
UPPERL = self.obj_data.CDUP - self.TIFB + self.BINSUL * math.tan(ALPHA)
self.obj_data.VFZ = self.obj_data.VF\
- 0.5 * (2.0 * UPPERL
+ self.obj_data.CCHGT * math.tan(BETA)) \
* self.obj_data.CCHGT * (self.obj_data.WIDTH - self.TIFLS - self.TIFRS)
self.obj_data.VFZ /= 1000
self.obj_data.VFF /= 1000
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Job : Volume for Configration2(Mode 8)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
class Volume_Ql8(Volume):
def calc_volume(self):
self.HXVUR = self.obj_data.HXVUR * 1000 # change from liter to cm3
self.TIRT = self.obj_data.TIRT + self.DINS
self.TIRF = self.obj_data.TIRF + self.DINS
self.TIRB = self.obj_data.TIRB + self.DINS
self.TIRLS = self.obj_data.TIRLS + self.DINS
self.obj_data.VFZ = ((self.obj_data.HEIGHT - self.obj_data.TOPMUL
- self.obj_data.THMUL - self.BINSUL) * (self.obj_data.WIDTH - 2.0 * self.TIFRS)
* (self.obj_data.DEPTH - self.TIFF - self.TIFB)) - self.HXVUZ
self.obj_data.VFF = ((self.obj_data.TOPMUL - self.TIRT) * (self.obj_data.WIDTH
- 2.0 * self.TIRLS)
* (self.obj_data.DEPTH - self.TIRF - self.TIRB)) - self.HXVUR
if self.obj_data.NCCTYPE == 2:
BETA = math.atan(self.obj_data.CDDN / self.obj_data.CCHGT)
HTRIAN = self.obj_data.CCHGT - self.BINSUL + self.BINSUL / math.sin(BETA) - self.TIFB / math.tan(BETA)
self.obj_data.VFZ = self.obj_data.VFZ - 0.5 * HTRIAN * HTRIAN * math.tan(BETA) * \
(self.obj_data.WIDTH - self.TIFLS - self.TIFRS)
if self.obj_data.NCCTYPE == 3:
BETA = math.atan((self.obj_data.CDDN - self.obj_data.CDUP)) / self.obj_data.CCHGT
ALPHA = math.pi / 4.0 - BETA / 2.0
UPPERL = self.obj_data.CDUP - self.TIFB + self.BINSUL * math.tan(ALPHA)
self.obj_data.VFZ = self.obj_data.VFZ \
- 0.5 * (2.0 * UPPERL
+ self.obj_data.CCHGT * math.tan(BETA)) \
* self.obj_data.CCHGT * (self.obj_data.WIDTH - self.TIFLS - self.TIFRS)
self.obj_data.VFZ /= 1000
self.obj_data.VFF /= 1000