-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQCtrl.py
735 lines (596 loc) · 31.7 KB
/
QCtrl.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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
# Python Import ====================
# User Import ======================
from .Volume import *
from .View import *
from common_classes.Unit import Unit
from .Ql2 import Ql2
from .Ql13 import Ql13
from .Ql467 import Ql467
from .Ql5 import Ql5
from .Ql8 import Ql8
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Job : Abstract Class from Control Q class
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
class QCtrl_Abstract(ABC):
def __init__(self, objdata):
self.obj_data = objdata
# Abstract methods
# ----------------------------------------------------------
# Job : Change units, from the give SI units.(individual for every sub-class)
# Input :
#
# Output :
# ----------------------------------------------------------
@abstractmethod
def adjust_units(self):
pass
# ----------------------------------------------------------
# Job : Output data from obj_data data store.(individual for every sub-class)
# Input : str_file_cab: cabinet data file name to save to
# str_file_cycle: cycle data file name to save to
# Output :
# ----------------------------------------------------------
@abstractmethod
def view(self, str_file_cab, str_file_cycle, str_path_cab="", str_path_cycle=""):
pass
# ----------------------------------------------------------
# Job : calcultae volume of freezer & fresh food compartment(individual for every sub-class)
# Input :
#
# Output :
# ----------------------------------------------------------
@abstractmethod
def volume(self):
pass
# ----------------------------------------------------------
# Job : inialize extra varibale in ob_data object with value(individual for every sub-class)
# Input :
#
# Output :
# ----------------------------------------------------------
@abstractmethod
def setup_vars_extra(self):
pass
# ----------------------------------------------------------
# Job : Calculate heat rate anaylis for cabinet.(individual for every sub-class)
# Input :
#
# Output :
# ----------------------------------------------------------
@abstractmethod
def calculte(self):
pass
# ----------------------------------------------------------
# Job : Calculate cycle data,(individual for every sub-class)
# Input :
#
# Output :
# ----------------------------------------------------------
@abstractmethod
def calculte_cycle(self):
pass
# ----------------------------------------------------------
# Job : setup common vars required by all module with zero value.(common for all)
# Input :
#
# Output :
# ----------------------------------------------------------
def set_vars_common(self):
self.obj_data.setup_vars(0.0, ['VFZ', 'VFF', 'NCCTYPE', 'NMOD', 'WATERF', 'WATERZ'])
# ----------------------------------------------------------
# Job : Calculate cycle type according to Compressor Compartment dimentions.(common for all)
# Input : CCHGT: Compressor Compartment Height
# CDUP: Compressor Compartment Top Depth
# Output :
# ----------------------------------------------------------
def set_ncctype(self):
# this value is NA in mode 5
if self.obj_data.NMOD == 5:
return
ncc_type = None
if self.obj_data.CCHGT != 0.0:
if self.obj_data.CDUP != 0.0:
ncc_type = 3
else:
ncc_type = 2
else:
ncc_type = 1
self.obj_data.NCCTYPE = ncc_type
# ----------------------------------------------------------
# Job : Get the mode, related to the current configration.(common for all).
# Input : Configration
#
# Output : Mode
# ----------------------------------------------------------
def setMode(self):
# Python comment IRFTYP
# 1: Two door, top - mount refrigerator / freezer
# 2: Two door, bottom - mount refrigerator / freezer
# 3: Side by side refrigerator / freezer
# 4: Chest freezer
# 5: Upright freezer
# 6: One door refrigerator
# 7: Two door refrigerator / freezer
ITYMOD = [3, 8, 2, 5, 7, 4, 3] # internal number of the configuration to be run
# Configration 1 == > Cab_NMOD = 3 Top - mount refrigerator / freezer
# Configration 2 == > Cab_NMOD = 8 Bottom - mount refrigerator / freezer
# Configration 3 == > Cab_NMOD = 2 Side - by - side refrigerator / freezer
# Configration 4 == > Cab_NMOD = 5 Chest freezer
# Configration 5 == > Cab_NMOD = 7 Upright freezer
# Configration 6 == > Cab_NMOD = 4 Single - door refrigerator
# Configration 7 == > Cab_NMOD = 3 Top - mount refrigerator / freezer
if 1 <= self.obj_data.IRFTYP <= 7: # extar safety check
self.obj_data.NMOD = ITYMOD[self.obj_data.IRFTYP - 1]
else:
print("Error in Configration @Start")
# ----------------------------------------------------------
# Job : common equation to all modules used to start cycle calulations.(common for all)
# Input :
#
# Output :
# ----------------------------------------------------------
def calc_cycle_start(self):
#
# Total Door Opening Heat Leaks
#
self.obj_data.QSDRFF = self.obj_data.QDFFCS
self.obj_data.QLDRFF = self.obj_data.QDFFCL
self.obj_data.QFDRFF = self.obj_data.QDFFFL - self.obj_data.QDFFCL
self.obj_data.QSDRFZ = self.obj_data.QDFZFS
self.obj_data.QLDRFZ = self.obj_data.QDFZCL
self.obj_data.QFDRFZ = self.obj_data.QDFZFL - self.obj_data.QDFZCL
# ----------------------------------------------------------
# Job : common unit change from SI.(common for all)
# Input :
#
# Output :
# ----------------------------------------------------------
def adj_unit_common(self):
self.obj_data.HEIGHT = Unit.cm_feet(self.obj_data.HEIGHT)
self.obj_data.WIDTH = Unit.cm_feet(self.obj_data.WIDTH)
self.obj_data.DEPTH = Unit.cm_feet(self.obj_data.DEPTH)
self.obj_data.DIL = Unit.mm_feet(self.obj_data.DIL)
self.obj_data.DOL = Unit.mm_feet(self.obj_data.DOL)
self.obj_data.TIFRS = Unit.cm_feet(self.obj_data.TIFRS)
self.obj_data.DGSKT = Unit.cm_feet(self.obj_data.DGSKT)
# --------------------
self.obj_data.BINSUL = Unit.cm_feet(self.obj_data.BINSUL)
# --------------------
self.obj_data.TIFB = Unit.cm_feet(self.obj_data.TIFB)
self.obj_data.TIFF = Unit.cm_feet(self.obj_data.TIFF)
self.obj_data.COL = Unit.WattMK_BtuHrFtF(self.obj_data.COL)
self.obj_data.CIL = Unit.WattMK_BtuHrFtF(self.obj_data.CIL)
self.obj_data.HXVUZ = Unit.liter_ft3(self.obj_data.HXVUZ)
self.obj_data.VOLAZ = Unit.liter_ft3(self.obj_data.VOLAZ)
self.obj_data.HRFRZ = (self.obj_data.SECFRZ / 3600.0) * self.obj_data.FRZOPN
self.obj_data.TDRAIR = Unit.c_f(self.obj_data.TDRAIR)
self.obj_data.TA = self.obj_data.TDRAIR
self.obj_data.TROOM = Unit.c_f(self.obj_data.TROOM)
self.obj_data.TFRZ = Unit.c_f(self.obj_data.TFRZ)
self.obj_data.TBTM = Unit.c_f(self.obj_data.TBTM)
self.qrdset()
# ----------------------------------------------------------
# Job : cycle calculation pnly for modes 5 & 7.(common for all)
# this method called from Ql5 for mode(5) and Ql467(form mode 4,6,7)
# Input :
#
# Output :
# ----------------------------------------------------------
def calc_cycle_Mode57(self):
self.obj_data.QFZTOT = self.obj_data.QRSIDE + self.obj_data.QLSIDE \
+ self.obj_data.QBACK + self.obj_data.QFRONT + self.obj_data.QTOP \
+ self.obj_data.QBOTTM + self.obj_data.QW \
+ self.obj_data.QGZF + self.obj_data.QSDRFZ + self.obj_data.QLDRFZ \
+ self.obj_data.QFDRFZ + self.obj_data.FZASHQ + self.obj_data.FZHEAT \
+ self.obj_data.FZREFQ + self.obj_data.FZPENA
self.obj_data.QHTFZ = self.obj_data.FZASHQ + self.obj_data.FZHEAT
# ----------------------------------------------------------
# Job : setup room temperatures value, for many variables
# Input :
#
# Output :
# ----------------------------------------------------------
def qrdset(self):
# set up the convection coefficients around the cabinet
# modified to combine radiation and convection
# define the temperatures seen by each side
self.obj_data.TFRONT = self.obj_data.TROOM
self.obj_data.TLSIDE = self.obj_data.TROOM
self.obj_data.TRSIDE = self.obj_data.TROOM
self.obj_data.TTOP = self.obj_data.TROOM
self.obj_data.TBACK = self.obj_data.TROOM
self.obj_data.TFFRNT = self.obj_data.TROOM
self.obj_data.TFBACK = self.obj_data.TROOM
self.obj_data.TFLSID = self.obj_data.TROOM
self.obj_data.TFRSID = self.obj_data.TROOM
self.obj_data.TTOP = self.obj_data.TROOM
self.obj_data.TRAFTT = self.obj_data.TROOM
self.obj_data.TRABKT = self.obj_data.TROOM
self.obj_data.TRALTT = self.obj_data.TROOM
self.obj_data.TRARTT = self.obj_data.TROOM
self.obj_data.TRADT = self.obj_data.TROOM
self.obj_data.TRADBT = self.obj_data.TROOM
self.obj_data.TRFRNT = self.obj_data.TROOM
self.obj_data.TRBACK = self.obj_data.TROOM
self.obj_data.TRLSID = self.obj_data.TROOM
self.obj_data.TRRSID = self.obj_data.TROOM
self.obj_data.TRAFTB = self.obj_data.TROOM
self.obj_data.TRABKB = self.obj_data.TROOM
self.obj_data.TRALTB = self.obj_data.TROOM
self.obj_data.TRARTB = self.obj_data.TROOM
self.obj_data.TRADBT = self.obj_data.TROOM
#
# define the convection coefficients
#
HIREF = 1.0
HOREF = 1.47
# Correct for the inner and outer liners
HIREF = 1.0 / (1.0 / HIREF + self.obj_data.DIL / 12.0 / self.obj_data.CIL)
HOREF = 1.0 / (1.0 / HOREF + self.obj_data.DOL / 12.0 / self.obj_data.COL)
self.obj_data.HI = HIREF
self.obj_data.HO = HOREF
self.obj_data.HIFTT = HIREF
self.obj_data.HIFMUL = 1.0
self.obj_data.HIBKT = HIREF
self.obj_data.HILTT = HIREF
self.obj_data.HIRTT = HIREF
self.obj_data.HIRMUL = 1.0
self.obj_data.HITOP = HIREF
self.obj_data.HIFTB = HIREF
self.obj_data.HIBKB = HIREF
self.obj_data.HILTB = HIREF
self.obj_data.HIRTB = HIREF
self.obj_data.HIBOT = HIREF
self.obj_data.HIFRT = HIREF
self.obj_data.HIBCK = HIREF
self.obj_data.HILFT = HIREF
self.obj_data.HIRGT = HIREF
self.obj_data.HOFTT = HOREF
self.obj_data.HOBKT = HOREF
self.obj_data.HOLTT = HOREF
self.obj_data.HORTT = HOREF
self.obj_data.HOTOP = HOREF
self.obj_data.HOFTB = HOREF
self.obj_data.HOBKB = HOREF
self.obj_data.HOLTB = HOREF
self.obj_data.HORTB = HOREF
self.obj_data.HOBOT = HOREF
self.obj_data.HOFRT = HOREF
self.obj_data.HOBCK = HOREF
self.obj_data.HOLFT = HOREF
self.obj_data.HORGT = HOREF
self.obj_data.HIWP = HIREF
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Job : Control class for Q12(mode 2)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
class QCtrl_Ql2(QCtrl_Abstract):
def view(self, str_cab_out, str_cycle, str_path_cab="", str_path_cycle=""):
obj_view = View_Ql2(self.obj_data, str_cab_out, str_cycle, str_path_cab, str_path_cycle)
obj_view.show_rep()
def volume(self):
obj_volume = Volume_Ql2(self.obj_data)
obj_volume.calc_volume()
def calculte_cycle(self):
self.calc_cycle_start()
self.obj_data.QMULN = -self.obj_data.QMUL
self.obj_data.QFFTOT = self.obj_data.QLSIDE + self.obj_data.QBACKL \
+ self.obj_data.QFRNTL + self.obj_data.QLTOP + self.obj_data.QLBTTM \
+ self.obj_data.QMULN + self.obj_data.QWFF + self.obj_data.QGR \
+ self.obj_data.QSDRFF + self.obj_data.QLDRFF \
+ self.obj_data.QFDRFF + self.obj_data.FFASHQ + self.obj_data.FFHEAT \
+ self.obj_data.FFREFQ + self.obj_data.FFPENA
self.obj_data.QFZTOT = self.obj_data.QRSIDE + self.obj_data.QBACKR \
+ self.obj_data.QFRNTR + self.obj_data.QRTOP + self.obj_data.QRBTTM \
+ self.obj_data.QMUL + self.obj_data.QWFZ + self.obj_data.QGZF \
+ self.obj_data.QSDRFZ + self.obj_data.QLDRFZ \
+ self.obj_data.QFDRFZ + self.obj_data.FZASHQ + self.obj_data.FZHEAT \
+ self.obj_data.FZREFQ + self.obj_data.FZPENA
self.obj_data.QHTFF = self.obj_data.FFASHQ + self.obj_data.FFHEAT
self.obj_data.QHTFZ = self.obj_data.FZASHQ + self.obj_data.FZHEAT
def calculte(self):
obj = Ql2(self.obj_data)
def setup_vars_extra(self):
self.obj_data.setup_vars(0.0, ['BOTTOM'])
def adjust_units(self):
self.obj_data.HLGZF = Unit.WattM_BtuThHInchF(self.obj_data.HLGZF)
self.obj_data.HLRG = Unit.WattM_BtuThHInchF(self.obj_data.HLRG)
self.obj_data.CINSUL = Unit.cm_feet(self.obj_data.CINSUL)
self.obj_data.TIFT = Unit.cm_feet(self.obj_data.TIFT)
self.obj_data.TIRLS = Unit.cm_feet(self.obj_data.TIRLS)
self.obj_data.BINFRZ = Unit.cm_feet(self.obj_data.BINFRZ)
self.obj_data.TFF = Unit.c_f(self.obj_data.TFF)
# self.obj_data.RKIN = 0.0
# same as Unit.CmWattM2K_BtuHrFtF(1/input_value)
self.obj_data.RKINFF = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RFF)
self.obj_data.RKINFZ = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RFRZ)
self.obj_data.WKINR = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RWEDGER)
self.obj_data.WKIN = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RWEDGE)
self.obj_data.DKINFF = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RDRFF)
self.obj_data.DKINFZ = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RDRFZ)
self.obj_data.CKMUL = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RMUL)
# ----
self.obj_data.TIRT = Unit.cm_feet(self.obj_data.TIRT)
self.obj_data.TIRF = Unit.cm_feet(self.obj_data.TIRF)
self.obj_data.TIRB = Unit.cm_feet(self.obj_data.TIRB)
# --
self.obj_data.CDUP = Unit.cm_feet(self.obj_data.CDUP)
self.obj_data.CDDN = Unit.cm_feet(self.obj_data.CDDN)
self.obj_data.CCHGT = Unit.cm_feet(self.obj_data.CCHGT)
# ----
self.obj_data.WALL = Unit.cm_feet(self.obj_data.WALL)
self.obj_data.THMUL = Unit.cm_feet(self.obj_data.THMUL)
# ----
self.obj_data.FFASHQ = Unit.Watt_BtuH(self.obj_data.FFASHQ)
self.obj_data.FZASHQ = Unit.Watt_BtuH(self.obj_data.FZASHQ)
self.obj_data.FFREFQ = Unit.Watt_BtuH(self.obj_data.FFREFQ)
self.obj_data.FZREFQ = Unit.Watt_BtuH(self.obj_data.FZREFQ)
self.obj_data.FFHEAT = Unit.Watt_BtuH(self.obj_data.FFHEAT)
self.obj_data.FZHEAT = Unit.Watt_BtuH(self.obj_data.FZHEAT)
self.obj_data.FZPENA = Unit.Watt_BtuH(self.obj_data.FZPENA)
self.obj_data.FFPENA = Unit.Watt_BtuH(self.obj_data.FFPENA)
self.obj_data.HXVUR = Unit.liter_ft3(self.obj_data.HXVUR)
self.obj_data.WEDGE = Unit.cm_feet(self.obj_data.WEDGE)
self.obj_data.WEDGER = Unit.cm_feet(self.obj_data.WEDGER)
self.obj_data.VOLAR = Unit.liter_ft3(self.obj_data.VOLAR)
self.obj_data.FLANGE = Unit.cm_feet(self.obj_data.FLANGE)
self.obj_data.FLANGER = Unit.cm_feet(self.obj_data.FLANGER)
self.obj_data.FLGB = self.obj_data.FLANGER
self.obj_data.HRFFC = (self.obj_data.SECFFC / 3600.0) * self.obj_data.FFCOPN
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Job : Control class for Q113(mode 1,3)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
class QCtrl_Ql13(QCtrl_Abstract):
def view(self, str_cab_out, str_cycle, str_path_cab="", str_path_cycle=""):
obj_view = View_Ql13(self.obj_data, str_cab_out, str_cycle, str_path_cab, str_path_cycle)
obj_view.show_rep()
def volume(self):
obj_volume = Volume_Ql13(self.obj_data)
obj_volume.calc_volume()
def calculte(self):
obj = Ql13(self.obj_data)
def calculte_cycle(self):
self.calc_cycle_start()
self.obj_data.QMULN = -self.obj_data.QMULI
self.obj_data.QFFTOT = self.obj_data.QRRSID + self.obj_data.QRLSID \
+ self.obj_data.QRBACK + self.obj_data.QRFRNT + self.obj_data.QBOTTM \
+ self.obj_data.QMULN + self.obj_data.QWFF + self.obj_data.QGR \
+ self.obj_data.QSDRFF + self.obj_data.QFDRFF \
+ self.obj_data.QLDRFF + self.obj_data.FFASHQ + self.obj_data.FFHEAT \
+ self.obj_data.FFREFQ + self.obj_data.FFPENA
self.obj_data.QFZTOT = self.obj_data.QFRSID + self.obj_data.QFLSID \
+ self.obj_data.QFBACK + self.obj_data.QFFRNT + self.obj_data.QTOP \
+ self.obj_data.QMULI + self.obj_data.QWFZ + self.obj_data.QGZF \
+ self.obj_data.QSDRFZ + self.obj_data.QLDRFZ \
+ self.obj_data.QFDRFZ + self.obj_data.FZASHQ + self.obj_data.FZHEAT \
+ self.obj_data.FZREFQ + self.obj_data.FZPENA
self.obj_data.QHTFF = self.obj_data.FFASHQ + self.obj_data.FFHEAT
self.obj_data.QHTFZ = self.obj_data.FZASHQ + self.obj_data.FZHEAT
def setup_vars_extra(self):
self.obj_data.setup_vars(0.0, ['QMUL'])
def adjust_units(self):
self.obj_data.HLFZG = Unit.WattM_BtuThHInchF(self.obj_data.HLFZG)
self.obj_data.HLRG = Unit.WattM_BtuThHInchF(self.obj_data.HLRG)
self.obj_data.TFF = Unit.c_f(self.obj_data.TFF)
self.obj_data.TIRRS = Unit.cm_feet(self.obj_data.TIRRS)
self.obj_data.TIRLS = Unit.cm_feet(self.obj_data.TIRLS)
self.obj_data.TIFLS = Unit.cm_feet(self.obj_data.TIFLS)
self.obj_data.TIFT = Unit.cm_feet(self.obj_data.TIFT)
# self.obj_data.RKIN = 0.0
self.obj_data.CINSUL = Unit.cm_feet(self.obj_data.CINSUL)
# same as Unit.CmWattM2K_BtuHrFtF(1/input_value)
self.obj_data.RKINFF = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RFF)
self.obj_data.RKINFZ = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RFRZ)
self.obj_data.WKINR = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RWEDGER)
self.obj_data.WKIN = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RWEDGE)
self.obj_data.DKINFF = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RDRFF)
self.obj_data.DKINFZ = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RDRFZ)
self.obj_data.CKMUL = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RMUL)
# ----
self.obj_data.FFASHQ = Unit.Watt_BtuH(self.obj_data.FFASHQ)
self.obj_data.FZASHQ = Unit.Watt_BtuH(self.obj_data.FZASHQ)
self.obj_data.FFREFQ = Unit.Watt_BtuH(self.obj_data.FFREFQ)
self.obj_data.FZREFQ = Unit.Watt_BtuH(self.obj_data.FZREFQ)
self.obj_data.FFHEAT = Unit.Watt_BtuH(self.obj_data.FFHEAT)
self.obj_data.FZHEAT = Unit.Watt_BtuH(self.obj_data.FZHEAT)
self.obj_data.FFPENA = Unit.Watt_BtuH(self.obj_data.FFPENA)
self.obj_data.FZPENA = Unit.Watt_BtuH(self.obj_data.FZPENA)
self.obj_data.HRFFC = (self.obj_data.SECFFC / 3600.0) * self.obj_data.FFCOPN
self.obj_data.WEDGE = Unit.cm_feet(self.obj_data.WEDGE)
self.obj_data.WEDGER = Unit.cm_feet(self.obj_data.WEDGER)
self.obj_data.FLANGE = Unit.cm_feet(self.obj_data.FLANGE)
self.obj_data.FLANGER = Unit.cm_feet(self.obj_data.FLANGER)
self.obj_data.TOPMUL = Unit.cm_feet(self.obj_data.TOPMUL)
self.obj_data.THMUL = Unit.cm_feet(self.obj_data.THMUL)
self.obj_data.HXVUR = Unit.liter_ft3(self.obj_data.HXVUR)
self.obj_data.TIRF = Unit.cm_feet(self.obj_data.TIRF)
self.obj_data.TIRB = Unit.cm_feet(self.obj_data.TIRB)
self.obj_data.VOLAR = Unit.liter_ft3(self.obj_data.VOLAR)
self.obj_data.CDUP = Unit.cm_feet(self.obj_data.CDUP)
self.obj_data.CDDN = Unit.cm_feet(self.obj_data.CDDN)
self.obj_data.CCHGT = Unit.cm_feet(self.obj_data.CCHGT)
self.obj_data.FLGB = self.obj_data.FLANGER
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Job : Control class for Q1467(mode 4,7)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
class QCtrl_Ql467(QCtrl_Abstract):
def view(self, str_cab_out, str_cycle, str_path_cab="", str_path_cycle=""):
if self.obj_data.NMOD == 7:
obj_view = View_Ql7(self.obj_data, str_cab_out, str_cycle, str_path_cab, str_path_cycle)
else:
obj_view = View_Ql4(self.obj_data, str_cab_out, str_cycle, str_path_cab, str_path_cycle)
obj_view.show_rep()
def volume(self):
if self.obj_data.NMOD == 4:
obj_volume = Volume_Ql4(self.obj_data)
else:
obj_volume = Volume_Ql7(self.obj_data)
obj_volume.calc_volume()
def calculte(self):
obj = Ql467(self.obj_data)
def calculte_cycle(self):
self.calc_cycle_start()
self.calc_cycle_Mode57()
def setup_vars_extra(self):
# TFF was add, it is found in Config.6(mode 4), and not found in Config.5(mode7)
# To prevent var is not found error in Ql456 with deal with both mode.
self.obj_data.setup_vars(0.0, ['BOTTOM', 'TFF', 'FW', 'FH', 'FD', 'VOLAR', 'FFCOPN', ' HRFFC'])
def adjust_units(self):
self.obj_data.TIFLS = Unit.cm_feet(self.obj_data.TIFLS)
self.obj_data.TIFT = Unit.cm_feet(self.obj_data.TIFT)
self.obj_data.CINSUL = Unit.cm_feet(self.obj_data.CINSUL)
self.obj_data.FH = Unit.cm_inch(self.obj_data.FH)
self.obj_data.FW = Unit.cm_inch(self.obj_data.FW)
self.obj_data.FD = Unit.cm_inch(self.obj_data.FD)
self.obj_data.CDUP = Unit.cm_feet(self.obj_data.CDUP)
self.obj_data.CDDN = Unit.cm_feet(self.obj_data.CDDN)
# same as Unit.CmWattM2K_BtuHrFtF(1/input_value)
self.obj_data.RKIN = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RCAB)
self.obj_data.WKIN = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RWEDGE)
self.obj_data.DKIN = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RDOOR)
self.obj_data.RCAB = 1.0 / (self.obj_data.RKIN * 12)
self.obj_data.RWEDGE = 1.0 / (self.obj_data.WKIN * 12)
self.obj_data.RDOOR = 1.0 / (self.obj_data.RKIN * 12)
self.obj_data.HLFZG = Unit.WattM_BtuThHInchF(self.obj_data.HLFZG)
# --
self.obj_data.FZHEAT = Unit.Watt_BtuH(self.obj_data.FZHEAT)
self.obj_data.FZASHQ = Unit.Watt_BtuH(self.obj_data.FZASHQ)
self.obj_data.FZREFQ = Unit.Watt_BtuH(self.obj_data.FZREFQ)
self.obj_data.FZPENA = Unit.Watt_BtuH(self.obj_data.FZPENA)
self.obj_data.FW = Unit.cm_feet(self.obj_data.FW)
self.obj_data.FD = Unit.cm_feet(self.obj_data.FD)
self.obj_data.FH = Unit.cm_feet(self.obj_data.FH)
self.obj_data.TFF = Unit.c_f(self.obj_data.TFF)
self.obj_data.WEDGE = Unit.cm_feet(self.obj_data.WEDGE)
self.obj_data.FLANGE = Unit.cm_feet(self.obj_data.FLANGE)
self.obj_data.FLGB = self.obj_data.FLANGE
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Job : Control class for Q15(mode 5)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
class QCtrl_Ql5(QCtrl_Abstract):
def view(self, str_cab_out, str_cycle, str_path_cab="", str_path_cycle=""):
obj_view = View_Ql5(self.obj_data, str_cab_out, str_cycle, str_path_cab, str_path_cycle)
obj_view.show_rep()
def volume(self):
obj_volume = Volume_Ql5(self.obj_data)
obj_volume.calc_volume()
def calculte(self):
obj = Ql5(self.obj_data)
def calculte_cycle(self):
self.calc_cycle_start()
self.obj_data.QBTTM = self.obj_data.QBOTTM + self.obj_data.QSH + self.obj_data.QSV
self.obj_data.QFZTOT = self.obj_data.QRSIDE + self.obj_data.QLSIDE \
+ self.obj_data.QBACK + self.obj_data.QFRONT + self.obj_data.QTOP \
+ self.obj_data.QBTTM + self.obj_data.QGZF + self.obj_data.QSDRFZ \
+ self.obj_data.QLDRFZ + self.obj_data.QFDRFZ \
+ self.obj_data.FZASHQ + self.obj_data.FZHEAT + self.obj_data.FZREFQ + self.obj_data.FZPENA
self.obj_data.QHTFZ = self.obj_data.FZASHQ + self.obj_data.FZHEAT
self.calc_cycle_Mode57()
def setup_vars_extra(self):
self.obj_data.setup_vars(0.0, ['QW', 'VOLAR', 'FFCOPN', 'HRFFC'])
def adjust_units(self):
self.obj_data.TIFT = Unit.cm_feet(self.obj_data.TIFT)
self.obj_data.CINSUL = Unit.cm_feet(self.obj_data.CINSUL)
self.obj_data.CWIDE = Unit.cm_feet(self.obj_data.CWIDE)
self.obj_data.CHGT = Unit.cm_feet(self.obj_data.CHGT)
self.obj_data.SCIN = Unit.cm_feet(self.obj_data.SCIN)
self.obj_data.STIN = Unit.cm_feet(self.obj_data.STIN)
self.obj_data.TFF = self.obj_data.TFRZ
self.obj_data.TIFLS = self.obj_data.TIFRS
# same as Unit.CmWattM2K_BtuHrFtF(1/input_value)
self.obj_data.RKIN = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RCAB)
self.obj_data.TKIN = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RTOP)
self.obj_data.RCAB = 1.0 / (self.obj_data.RKIN * 12)
# --
self.obj_data.FZASHQ = Unit.Watt_BtuH(self.obj_data.FZASHQ)
self.obj_data.FZREFQ = Unit.Watt_BtuH(self.obj_data.FZREFQ)
self.obj_data.FZHEAT = Unit.Watt_BtuH(self.obj_data.FZHEAT)
self.obj_data.FZPENA = Unit.Watt_BtuH(self.obj_data.FZPENA)
# --
# self.obj_data.HIWP = 0.0
self.obj_data.HLFZG = Unit.WattM_BtuThHInchF(self.obj_data.HLFZG)
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Job : Control class for Q18(mode 8)
#
# Editor : aymhenry@gmail.com
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
class QCtrl_Ql8(QCtrl_Abstract):
def view(self, str_cab_out, str_cycle, str_path_cab="", str_path_cycle=""):
obj_view = View_Ql8(self.obj_data, str_cab_out, str_cycle, str_path_cab, str_path_cycle)
obj_view.show_rep()
def volume(self):
obj_volume = Volume_Ql8(self.obj_data)
obj_volume.calc_volume()
def calculte(self):
obj = Ql8(self.obj_data)
def calculte_cycle(self):
self.calc_cycle_start()
self.obj_data.QMULN = -self.obj_data.QMUL
self.obj_data.QFFTOT = self.obj_data.QRRSID + self.obj_data.QRLSID \
+ self.obj_data.QRBACK + self.obj_data.QRFRNT + self.obj_data.QTOP + \
+ self.obj_data.QMULN + self.obj_data.QWFF + self.obj_data.QGR \
+ self.obj_data.QSDRFF + self.obj_data.QLDRFF + \
+ self.obj_data.QFDRFF + self.obj_data.FFASHQ + self.obj_data.FFHEAT \
+ self.obj_data.FFREFQ + self.obj_data.FFPENA
self.obj_data.QFZTOT = self.obj_data.QFRSID + self.obj_data.QFLSID \
+ self.obj_data.QFBACK + self.obj_data.QFFRNT + self.obj_data.QBOTTM \
+ self.obj_data.QBCOMP + self.obj_data.QMUL + self.obj_data.QWFZ \
+ self.obj_data.QGZF + self.obj_data.QSDRFZ \
+ self.obj_data.QLDRFZ + self.obj_data.QFDRFZ + self.obj_data.FZASHQ \
+ self.obj_data.FZPENA + self.obj_data.FZHEAT \
+ self.obj_data.FZREFQ
self.obj_data.QHTFF = self.obj_data.FFASHQ + self.obj_data.FFHEAT
self.obj_data.QHTFZ = self.obj_data.FZASHQ + self.obj_data.FZHEAT
def setup_vars_extra(self):
self.obj_data.setup_vars(0.0, ['QBCOMP'])
def adjust_units(self):
# self.obj_data.RKIN = 0.0
# same as Unit.CmWattM2K_BtuHrFtF(1/input_value)
self.obj_data.RKINFF = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RFF)
self.obj_data.RKINFZ = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RFRZ)
self.obj_data.WKINR = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RWEDGER)
self.obj_data.WKIN = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RWEDGE)
self.obj_data.DKINFF = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RDRFF)
self.obj_data.DKINFZ = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RDRFZ)
self.obj_data.CKMUL = 1.0 / Unit.BtuHrFtF_CmWattM2K(self.obj_data.RMUL)
self.obj_data.CDUP = Unit.cm_feet(self.obj_data.CDUP)
self.obj_data.CDDN = Unit.cm_feet(self.obj_data.CDDN)
self.obj_data.HLGZF = Unit.WattM_BtuThHInchF(self.obj_data.HLGZF)
self.obj_data.HLRG = Unit.WattM_BtuThHInchF(self.obj_data.HLRG)
self.obj_data.HXVUR = Unit.liter_ft3(self.obj_data.HXVUR)
# ----
self.obj_data.FFPENA = Unit.Watt_BtuH(self.obj_data.FFPENA)
self.obj_data.FZPENA = Unit.Watt_BtuH(self.obj_data.FZPENA)
self.obj_data.FFASHQ = Unit.Watt_BtuH(self.obj_data.FFASHQ)
self.obj_data.FZASHQ = Unit.Watt_BtuH(self.obj_data.FZASHQ)
self.obj_data.FFREFQ = Unit.Watt_BtuH(self.obj_data.FFREFQ)
self.obj_data.FZREFQ = Unit.Watt_BtuH(self.obj_data.FZREFQ)
self.obj_data.FFHEAT = Unit.Watt_BtuH(self.obj_data.FFHEAT)
self.obj_data.FZHEAT = Unit.Watt_BtuH(self.obj_data.FZHEAT)
# ----------
self.obj_data.WEDGE = Unit.cm_feet(self.obj_data.WEDGE)
self.obj_data.WEDGER = Unit.cm_feet(self.obj_data.WEDGER)
self.obj_data.TIRLS = Unit.cm_feet(self.obj_data.TIRLS)
self.obj_data.TIRF = Unit.cm_feet(self.obj_data.TIRF)
self.obj_data.TIRB = Unit.cm_feet(self.obj_data.TIRB)
self.obj_data.FLANGE = Unit.cm_feet(self.obj_data.FLANGE)
self.obj_data.FLANGER = Unit.cm_feet(self.obj_data.FLANGER)
self.obj_data.TOPMUL = Unit.cm_feet(self.obj_data.TOPMUL)
self.obj_data.THMUL = Unit.cm_feet(self.obj_data.THMUL)
self.obj_data.TIRT = Unit.cm_feet(self.obj_data.TIRT)
self.obj_data.VOLAR = Unit.liter_ft3(self.obj_data.VOLAR)
self.obj_data.HRFFC = (self.obj_data.SECFFC / 3600.0) * self.obj_data.FFCOPN
self.obj_data.TFF = Unit.c_f(self.obj_data.TFF)
self.obj_data.FLGB = self.obj_data.FLANGER
self.obj_data.TIFLS = self.obj_data.TIFRS
self.obj_data.TIRRS = self.obj_data.TIRLS
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-