-
Notifications
You must be signed in to change notification settings - Fork 64
/
four_element.py
1642 lines (1364 loc) · 63.1 KB
/
four_element.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
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# created January 2017
from __future__ import division
import math
import random
import warnings
class FourElement(object):
"""This class contains attributes and functions for four element model
This model adds another element for the roof. Roofs commonly exhibit the
same excitations as exterior walls but have different coefficients of heat
transfer due to their orientation. Thus the model distinguishes
between internal thermal masses and exterior walls divided into
outerwalls (vertical), rooftops and ground plates. While all exterior walls
contribute to heat transfer to the ambient, adiabatic
conditions apply to interior walls. This approach allows considering the
dynamic behaviour induced by internal heat storage. This class calculates
and holds all attributes given in documentation.
It treats OuterWalls, Rooftops and GroundFloors separate resulting in three
RC-combination for these.
Depending on the chosen method it will consider an extra resistance for
windows or merge all windows into the RC-Combination for outer walls.
Parameters
----------
thermal_zone: ThermalZone()
TEASER instance of ThermalZone
merge_windows : boolean
True for merging windows into the outer wall's RC-combination,
False for separate resistance for window, default is False. (Only
supported for IBPSA)
t_bt : float [d]
Time constant according to VDI 6007 (default t_bt = 5)
Attributes
----------
Interior Walls
area_iw : float [m2]
Area of all interior walls.
alpha_conv_inner_iw : float [W/(m2K)]
Area-weighted convective coefficient of heat transfer of interior
walls facing the inside of this thermal zone.
alpha_rad_inner_iw : float [W/(m2K)]
Area-weighted radiative coefficient of heat transfer of interior
walls facing the inside of this thermal zone.
alpha_comb_inner_iw : float [W/(m2K)]
Area-weighted combined coefficient of heat transfer of interior walls
facing the inside of this thermal zone.
alpha_conv_outer_iw : float [W/(m2K)]
Area-weighted convective coefficient of heat transfer of interior
walls facing the adjacent thermal zone. (Currently not supported)
alpha_rad_outer_iw : float [W/(m2K)]
Area-weighted radiative coefficient of heat transfer of interior
walls facing the adjacent thermal zone. (Currently not supported)
alpha_comb_outer_iw : float [W/(m2K)]
Area-weighted combined coefficient of heat transfer of interior walls
facing the adjacent thermal zone. (Currently not supported)
ua_value_iw : float [W/K]
U-Value times interior wall area. (Does not take adjacent thermal
zones into account)
r_conv_inner_iw : float [K/W]
Sum of convective resistances for all interior walls
facing the inside of this thermal zone.
r_rad_inner_iw : float [K/W]
Sum of radiative resistances for all interior walls facing the
inside of this thermal zone
r_comb_inner_iw : float [K/W]
Sum of combined resistances for all interior walls facing the
inside of this thermal zone
r1_iw : float [K/W]
Lumped resistance of interior walls no heat transfer coefficients for
convection and radiation are accounted in this resistance.
c1_iw : float [J/K]
Lumped capacity of interior walls
Outer Walls
area_ow : float [m2]
Area of all outer walls .
alpha_conv_inner_ow : float [W/(m2K)]
Area-weighted convective coefficient of heat transfer of outer walls
facing the inside of this thermal zone .
alpha_rad_inner_ow : float [W/(m2K)]
Area-weighted radiative coefficient of heat transfer of outer walls
facing the inside of this thermal zone .
alpha_comb_inner_ow : float [W/(m2K)]
Area-weighted combined coefficient of heat transfer of outer walls
facing the inside of this thermal zone .
alpha_conv_outer_ow : float [W/(m2K)]
Area-weighted convective coefficient of heat transfer of outer walls
facing the ambient.
alpha_rad_outer_ow : float [W/(m2K)]
Area-weighted radiative coefficient of heat transfer of outer walls
facing the ambient .
alpha_comb_outer_ow : float [W/(m2K)]
Area-weighted combined coefficient of heat transfer of outer walls
facing the ambient.
ua_value_ow : float [W/K]
U-Value times outer wall area.
r_conv_inner_ow : float [K/W]
Sum of convective resistances for all outer walls facing the
inside of this thermal zone .
r_rad_inner_ow : float [K/W]
Sum of radiative resistances for all outer walls facing the
inside of this thermal zone .
r_comb_inner_ow : float [K/W]
Sum of combined resistances for all outer walls facing the
inside of this thermal zone.
r_conv_outer_ow : float [K/W]
Sum of convective resistances for all outer walls facing the
ambient.
r_rad_outer_ow : float [K/W]
Sum of radiative resistances for all outer walls facing the
ambient.
r_comb_outer_ow : float [K/W]
Sum of combined resistances for all outer walls facing the
ambient.
r1_ow : float [K/W]
Lumped resistance of outer walls no heat transfer coefficients for
convection and radiation are accounted in this resistance.
r_rest_ow : float [K/W]
Lumped remaining resistance of outer walls between r1_ow and c1_ow no
heat transfer coefficients for convection and radiation are accounted
in this resistance.
c1_ow : float [J/K]
Lumped capacity of outer walls .
weightfactor_ow : list of floats
Weightfactors of outer walls (UA-Value of walls with same orientation
and tilt divided by ua_value_ow)
outer_wall_areas : list of floats [m2]
Area of all outer walls in one list.
ir_emissivity_outer_ow : float
Area-weighted ir emissivity of outer wall facing the ambient.
ir_emissivity_inner_ow : float
Area-weighted ir emissivity of outer walls facing the thermal zone.
solar_absorp_ow : float
Area-weighted solar absorption of outer walls facing the ambient.
Ground Floors
area_gf : float [m2]
Area of all ground floors.
alpha_conv_inner_gf : float [W/(m2K)]
Area-weighted convective coefficient of heat transfer of ground floors
facing the inside of this thermal zone.
alpha_rad_inner_gf : float [W/(m2K)]
Area-weighted radiative coefficient of heat transfer of ground floors
facing the inside of this thermal zone.
alpha_comb_inner_gf : float [W/(m2K)]
Area-weighted combined coefficient of heat transfer of ground floors
facing the inside of this thermal zone.
ua_value_gf : float [W/K]
U-Value times ground floor area.
r_conv_inner_gf : float [K/W]
Sum of convective resistances for all ground floors facing the
inside of this thermal zone.
r_rad_inner_gf : float [K/W]
Sum of radiative resistances for all ground floors facing the
inside of this thermal zone.
r_comb_inner_gf : float [K/W]
Sum of combined resistances for all ground floors facing the
inside of this thermal zone.
r1_gf : float [K/W]
Lumped resistance of ground floors no heat transfer coefficients for
convection and radiation are accounted in this resistance.
r_rest_gf : float [K/W]
Lumped remaining resistance of ground floors between r1_gf and c1_gf no
heat transfer coefficients for convection and radiation are accounted
in this resistance.
c1_gf : float [J/K]
Lumped capacity of ground floors.
weightfactor_gf : float
Weightfactor of ground floors (UA-Value of walls with same orientation
and tilt divided by ua_value_gf)
ground_floor_area : float [m2]
Area of all ground floors.
r_rad_gf_iw : float [K/W]
Resistance for radiative heat transfer between walls.
TODO: needs to be checked
ir_emissivity_inner_gf : float
Area-weighted ir emissivity of ground floors facing the thermal zone.
Rooftops
area_rt : float [m2]
Area of all rooftops .
alpha_conv_inner_rt : float [W/(m2K)]
Area-weighted convective coefficient of heat transfer of rooftops
facing the inside of this thermal zone .
alpha_rad_inner_rt : float [W/(m2K)]
Area-weighted radiative coefficient of heat transfer of rooftops
facing the inside of this thermal zone .
alpha_comb_inner_rt : float [W/(m2K)]
Area-weighted combined coefficient of heat transfer of rooftops
facing the inside of this thermal zone .
alpha_conv_outer_rt : float [W/(m2K)]
Area-weighted convective coefficient of heat transfer of rooftops
facing the ambient.
alpha_rad_outer_rt : float [W/(m2K)]
Area-weighted radiative coefficient of heat transfer of rooftops
facing the ambient .
alpha_comb_outer_rt : float [W/(m2K)]
Area-weighted combined coefficient of heat transfer of rooftops
facing the ambient.
ua_value_rt : float [W/K]
U-Value times outer wall area.
r_conv_inner_rt : float [K/W]
Sum of convective resistances for all rooftops facing the
inside of this thermal zone .
r_rad_inner_rt : float [K/W]
Sum of radiative resistances for all rooftops facing the
inside of this thermal zone .
r_comb_inner_rt : float [K/W]
Sum of combined resistances for all rooftops facing the
inside of this thermal zone.
r_conv_outer_rt : float [K/W]
Sum of convective resistances for all rooftops facing the
ambient.
r_rad_outer_rt : float [K/W]
Sum of radiative resistances for all rooftops facing the
ambient.
r_comb_outer_rt : float [K/W]
Sum of combined resistances for all rooftops facing the
ambient.
r1_rt : float [K/W]
Lumped resistance of rooftops no heat transfer coefficients for
convection and radiation are accounted in this resistance.
r_rest_rt : float [K/W]
Lumped remaining resistance of rooftops between r1_rt and c1_rt no
heat transfer coefficients for convection and radiation are accounted
in this resistance.
c1_rt : float [J/K]
Lumped capacity of rooftops .
weightfactor_rt : list of floats
Weightfactors of rooftops (UA-Value of walls with same orientation
and tilt divided by ua_value_rt)
weightfactor_win_rt : list of floats
Weightfactors of windows in rooftop. CAUTION: this will be always a
list full of zeors, as windows are always calculated separatly.
outer_wall_areas : list of floats [m2]
Area of all rooftops in one list.
r_rad_rt_iw : float [K/W]
Resistance for radiative heat transfer between walls.
TODO: needs to be checked
ir_emissivity_outer_rt : float
Area-weighted ir emissivity of outer wall facing the ambient.
ir_emissivity_inner_rt : float
Area-weighted ir emissivity of rooftops facing the thermal zone.
solar_absorp_rt : float
Area-weighted solar absorption of rooftops facing the ambient.
tilt_rt : list of floats [degree]
Tilt of rooftops against the horizontal.
orientation_rt : list of floats [degree]
Orientation of rooftops (Azimuth).
0 - North
90 - East
180 - South
270 - West
Windows
area_win : float [m2]
Area of all windows.
alpha_conv_inner_win : float [W/(m2K)]
Area-weighted convective coefficient of heat transfer of windows
facing the inside of this thermal zone.
alpha_rad_inner_win : float [W/(m2K)]
Area-weighted radiative coefficient of heat transfer of windows
facing the inside of this thermal zone.
alpha_comb_inner_win : float [W/(m2K)]
Area-weighted combined coefficient of heat transfer of windows facing
the inside of this thermal zone.
ratio_conv_rad_inner_win : float [-]
Ratio for windows between convective and radiative heat emission,
given in VDI 6007-3
alpha_conv_outer_win : float [W/(m2K)]
Area-weighted convective coefficient of heat transfer of windows
facing the ambient.
alpha_rad_outer_win : float [W/(m2K)]
Area-weighted radiative coefficient of heat transfer of windows
facing the ambient.
alpha_comb_outer_win : float [W/(m2K)]
Area-weighted combined coefficient of heat transfer of windows facing
the ambient.
ua_value_win : float [W/K]
U-Value times outer wall area.
u_value_win : float [W/(m2K)]
Area weighted U-Value of windows.
r_conv_inner_win : float [K/W]
Sum of convective resistances for all windows facing the
inside of this thermal zone.
r_rad_inner_win : float [K/W]
Sum of radiative resistances for all windows facing the
inside of this thermal zone.
r_comb_inner_win : float [K/W]
Sum of combined resistances for all windows facing the
inside of this thermal zone.
r_conv_outer_win : float [K/W]
Sum of convective resistances for all windows facing the
ambient.
r_rad_outer_win : float [K/W]
Sum of radiative resistances for all windows facing the
ambient.
r_comb_outer_win : float [K/W]
Sum of combined resistances for all windows facing the
ambient.
r1_win : float [K/W]
Lumped resistance of windows, no heat transfer coefficients for
convection and radiation are accounted in this resistance.
weightfactor_win : list of floats
Weightfactors of windows (UA-Value of windows with same orientation
and tilt divided by ua_value_win or ua_value_win+ua_value_ow,
depending if windows is lumped/merged into the walls or not)
window_areas : list of floats [m2]
Area of all windows in one list, if the windows are merged into the
outer wall this list will be full of zeros
transparent_areas : list of floats [m2]
Area of all transparent elements (most likely windows) in one list,
this list will be always filled with the areas, independent if
windows are merged into walls or not.
solar_absorp_win : float
Area-weighted solar absorption for windows. (typically 0.0)
ir_emissivity_win : float
Area-weighted ir_emissivity for windows. Can be used for windows
facing the thermal zone and the ambient.
weighted_g_value : float
Area-weighted g-Value of all windows.
g_sunblind : list of floats
G-Value of all sunblinds of each window in a list
Misc values:
alpha_rad_inner_mean : float [W/(m2K)]
Area-weighted radiative coefficient of all surfaces facing the
inside of this thermal zone (OuterWalls, Windows, InnerWalls, ...).
alpha_rad_outer_mean : float [W/(m2K)]
Area-weighted radiative coefficient of all surfaces facing the
ambient (OuterWalls, Windows, ...).
heat_load : [W]
Static heat load of the thermal zone.
facade_areas : list of floats [m2]
List containing the area of each facade (with same tilt and
orientation) this includes also roofs and ground floors and windows.
n_outer : int
Number of total facades with different combination of tilt and
orientation, windows and outer walls
n_rt : int
Number of total facades with different combination of tilt and
orientation, Rooftops
tilt_facade : list of floats [degree]
Tilt of facades against the horizontal.
orientation_facade : list of floats [degree]
Orientation of facades (Azimuth).
0 - North
90 - East
180 - South
270 - West
"""
def __init__(self, thermal_zone, merge_windows, t_bt):
"""Constructor for TwoElement"""
self.internal_id = random.random()
self.thermal_zone = thermal_zone
self.merge_windows = merge_windows
self.t_bt = t_bt
# Attributes of inner walls
self.area_iw = 0.0
# coefficient of heat transfer facing the inside of this thermal zone
self.alpha_conv_inner_iw = 0.0
self.alpha_rad_inner_iw = 0.0
self.alpha_comb_inner_iw = 0.0
# coefficient of heat transfer facing the adjacent thermal zone
self.alpha_conv_outer_iw = 0.0
self.alpha_rad_outer_iw = 0.0
self.alpha_comb_outer_iw = 0.0
# UA-Value
self.ua_value_iw = 0.0
# resistances for heat transfer facing the inside of this thermal zone
self.r_conv_inner_iw = 0.0
self.r_rad_inner_iw = 0.0
self.r_comb_inner_iw = 0.0
self.r_conv_outer_iw = 0.0
self.r_rad_outer_iw = 0.0
self.r_comb_outer_iw = 0.0
# lumped resistance/capacity
self.r1_iw = 0.0
self.c1_iw = 0.0
# Attributes for outer walls
self.area_ow = 0.0
# coefficient of heat transfer facing the inside of this thermal zone
self.alpha_conv_inner_ow = 0.0
self.alpha_rad_inner_ow = 0.0
self.alpha_comb_inner_ow = 0.0
# coefficient of heat transfer facing the ambient
self.alpha_conv_outer_ow = 0.0
self.alpha_rad_outer_ow = 0.0
self.alpha_comb_outer_ow = 0.0
# UA-Value
self.ua_value_ow = 0.0
# resistances for heat transfer facing the inside of this thermal zone
self.r_conv_inner_ow = 0.0
self.r_rad_inner_ow = 0.0
self.r_comb_inner_ow = 0.0
# resistances for heat transfer facing the ambient
self.r_conv_outer_ow = 0.0
self.r_rad_outer_ow = 0.0
self.r_comb_outer_ow = 0.0
# lumped resistances/capacity
self.r1_ow = 0.0
self.r_rest_ow = 0.0
self.c1_ow = 0.0
self.r_total_ow = 0.0
# Optical properties
self.ir_emissivity_outer_ow = 0.0
self.ir_emissivity_inner_ow = 0.0
self.solar_absorp_ow = 0.0
# Additional attributes
self.weightfactor_ow = []
self.weightfactor_ground = 0.0
self.outer_wall_areas = []
# Attributes for GroundFloor
self.area_gf = 0.0
# coefficient of heat transfer facing the inside of this thermal zone
self.alpha_conv_inner_gf = 0.0
self.alpha_rad_inner_gf = 0.0
self.alpha_comb_inner_gf = 0.0
# UA-Value
self.ua_value_gf = 0.0
# resistances for heat transfer facing the inside of this thermal zone
self.r_conv_inner_gf = 0.0
self.r_rad_inner_gf = 0.0
self.r_comb_inner_gf = 0.0
# lumped resistances/capacity
self.r1_gf = 0.0
self.r_rest_gf = 0.0
self.c1_gf = 0.0
self.r_total_gf = 0.0
# Optical properties
self.ir_emissivity_inner_gf = 0.0
# Additional attributes
self.weightfactor_ground = 0.0
# Attributes for rooftops
self.area_rt = 0.0
# coefficient of heat transfer facing the inside of this thermal zone
self.alpha_conv_inner_rt = 0.0
self.alpha_rad_inner_rt = 0.0
self.alpha_comb_inner_rt = 0.0
# coefficient of heat transfer facing the ambient
self.alpha_conv_outer_rt = 0.0
self.alpha_rad_outer_rt = 0.0
self.alpha_comb_outer_rt = 0.0
# UA-Value
self.ua_value_rt = 0.0
# resistances for heat transfer facing the inside of this thermal zone
self.r_conv_inner_rt = 0.0
self.r_rad_inner_rt = 0.0
self.r_comb_inner_rt = 0.0
# resistances for heat transfer facing the ambient
self.r_conv_outer_rt = 0.0
self.r_rad_outer_rt = 0.0
self.r_comb_outer_rt = 0.0
# lumped resistances/capacity
self.r1_rt = 0.0
self.r_rest_rt = 0.0
self.c1_rt = 0.0
self.r_total_rt = 0.0
# Optical properties
self.ir_emissivity_outer_rt = 0.0
self.ir_emissivity_inner_rt = 0.0
self.solar_absorp_rt = 0.0
# Additional attributes
self.weightfactor_rt = []
self.weightfactor_win_rt = []
self.rooftop_areas = []
self.tilt_rt = []
self.orientation_rt = []
# TODO: check this value
self.r_rad_rt_iw = 0.0
# Attributes for windows
self.area_win = 0.0
# coefficient of heat transfer facing the inside of this thermal zone
self.alpha_conv_inner_win = 0.0
self.alpha_rad_inner_win = 0.0
self.alpha_comb_inner_win = 0.0
self.ratio_conv_rad_inner_win = 0.0
# coefficient of heat transfer facing the ambient
self.alpha_conv_outer_win = 0.0
self.alpha_rad_outer_win = 0.0
self.alpha_comb_outer_win = 0.0
# UA-Value
self.ua_value_win = 0.0
self.u_value_win = 0.0
# resistances for heat transfer facing the inside of this thermal zone
self.r_conv_inner_win = 0.0
self.r_rad_inner_win = 0.0
self.r_comb_inner_win = 0.0
# resistances for heat transfer facing the ambient
self.r_conv_outer_win = 0.0
self.r_rad_outer_win = 0.0
self.r_comb_outer_win = 0.0
# lumped resistances/capacity
self.r1_win = 0.0
# Optical properties
self.ir_emissivity_win = 0.0
self.ir_emissivity_inner_win = 0.0
self.solar_absorp_win = 0.0
# Additional attributes
self.weightfactor_win = []
self.window_areas = []
self.transparent_areas = []
self.g_sunblind = []
self.weighted_g_value = 0.0
# Misc values
self.alpha_rad_inner_mean = 0.0
self.alpha_rad_outer_mean = 0.0
self.n_outer = 0
self.n_rt = 0
self.facade_areas = []
self.tilt_facade = []
self.orientation_facade = []
self.heat_load = 0.0
self.cool_load = 0.0
def calc_attributes(self):
"""Calls all necessary function to calculate model attributes"""
for out_wall in self.thermal_zone.outer_walls:
out_wall.calc_equivalent_res()
out_wall.calc_ua_value()
for rt in self.thermal_zone.rooftops:
rt.calc_equivalent_res()
rt.calc_ua_value()
for gf in self.thermal_zone.ground_floors:
gf.calc_equivalent_res()
gf.calc_ua_value()
for win in self.thermal_zone.windows:
win.calc_equivalent_res()
win.calc_ua_value()
for inner_wall in (self.thermal_zone.inner_walls +
self.thermal_zone.floors +
self.thermal_zone.ceilings):
inner_wall.calc_equivalent_res()
inner_wall.calc_ua_value()
self.set_calc_default()
if len(self.thermal_zone.outer_walls) < 1:
warnings.warn("No walls are defined as outer walls for thermal " +
"zone " + self.thermal_zone.name + " in building " +
self.thermal_zone.parent.name +
", please be careful with results. In addition " +
"this might lead to RunTimeErrors")
else:
self._sum_outer_wall_elements()
if len(self.thermal_zone.inner_walls + self.thermal_zone.floors +
self.thermal_zone.ceilings) < 1:
warnings.warn('For thermal zone ' + self.thermal_zone.name +
' in building ' + self.thermal_zone.parent.name +
', no inner walls have been defined.')
else:
self._sum_inner_wall_elements()
self._calc_inner_elements()
if len(self.thermal_zone.windows) < 1:
warnings.warn('For thermal zone ' + self.thermal_zone.name +
' in building ' + self.thermal_zone.parent.name +
', no windows have been defined.')
else:
self._sum_window_elements()
if len(self.thermal_zone.ground_floors) < 1:
warnings.warn('For thermal zone ' + self.thermal_zone.name +
' in building ' + self.thermal_zone.parent.name +
', no ground floors have been defined.')
else:
self._sum_ground_floor_elements()
self._calc_ground_floor_elements()
if len(self.thermal_zone.rooftops) < 1:
warnings.warn('For thermal zone ' + self.thermal_zone.name +
' in building ' + self.thermal_zone.parent.name +
', no rooftops have been defined.')
else:
self._sum_rooftop_elements()
self._calc_rooftop_elements()
if len(self.thermal_zone.outer_walls) >= 1 or \
len(self.thermal_zone.windows) >= 1:
self._calc_outer_elements()
self._calc_wf()
self._calc_mean_values()
self._calc_number_of_elements()
self._fill_zone_lists()
self._calc_heat_load()
return True
@staticmethod
def _calc_parallel_connection(element_list, omega):
"""Parallel connection of walls according to VDI 6007
Calculates the parallel connection of wall elements according to VDI
6007, resulting in R1 and C1 (equation 23, 24).
Parameters
----------
element_list : list
List of inner or outer walls
omega : float
VDI 6007 frequency
Returns
----------
r1 : float [K/W]
VDI 6007 resistance for all inner or outer walls
c1 : float [K/W]
VDI 6007 capacity all for inner or outer walls
"""
for wall_count in range(len(element_list) - 1):
if wall_count == 0:
r1 = (element_list[wall_count].r1 *
element_list[wall_count].c1 ** 2 +
element_list[wall_count + 1].r1 *
element_list[wall_count + 1].c1 ** 2 + omega ** 2 *
element_list[wall_count].r1 *
element_list[wall_count + 1].r1 *
(element_list[wall_count].r1 +
element_list[wall_count + 1].r1) *
element_list[wall_count].c1 ** 2 *
element_list[wall_count + 1].c1 ** 2) / \
((element_list[wall_count].c1 +
element_list[wall_count + 1].c1) ** 2 + omega ** 2 *
(element_list[wall_count].r1 +
element_list[wall_count + 1].r1) ** 2 *
element_list[wall_count].c1 ** 2 *
element_list[wall_count + 1].c1 ** 2)
c1 = ((element_list[wall_count].c1 +
element_list[wall_count + 1].c1) ** 2 + omega ** 2 *
(element_list[wall_count].r1 +
element_list[wall_count + 1].r1) ** 2 *
element_list[wall_count].c1 ** 2 *
element_list[wall_count + 1].c1 ** 2) / \
(element_list[wall_count].c1 +
element_list[wall_count + 1].c1 + omega ** 2 *
(element_list[wall_count].r1 ** 2 *
element_list[wall_count].c1 +
element_list[wall_count + 1].r1 ** 2 *
element_list[wall_count + 1].c1) *
element_list[wall_count].c1 *
element_list[wall_count + 1].c1)
else:
r1x = r1
c1x = c1
r1 = (r1x * c1x ** 2 + element_list[wall_count + 1].r1 *
element_list[wall_count + 1].c1 ** 2 +
omega ** 2 * r1x * element_list[wall_count + 1].r1 *
(r1x + element_list[wall_count + 1].r1) *
c1x ** 2 * element_list[wall_count + 1].c1 ** 2) / \
((c1x + element_list[wall_count + 1].c1) ** 2 +
omega ** 2 * (
r1x + element_list[wall_count + 1].r1) ** 2 *
c1x ** 2 * element_list[wall_count + 1].c1 ** 2)
c1 = ((c1x + element_list[
wall_count + 1].c1) ** 2 + omega ** 2 *
(r1x + element_list[wall_count + 1].r1) ** 2 * c1x ** 2 *
element_list[wall_count + 1].c1 ** 2) / \
(c1x + element_list[wall_count + 1].c1 + omega ** 2 *
(r1x ** 2 * c1x + element_list[wall_count + 1].r1 **
2 * element_list[wall_count + 1].c1) * c1x *
element_list[wall_count + 1].c1)
return r1, c1
def _sum_outer_wall_elements(self):
"""Sum attributes for outer wall elements
This function sums and computes the area-weighted values,
where necessary for coefficients of heat
transfer, resistances, areas and UA-Values.
For ThreeElement model it treats rooftops and outer walls
as one kind of wall type.
"""
self.area_ow = \
(sum(out_wall.area for out_wall in
self.thermal_zone.outer_walls))
self.ua_value_ow = \
(sum(out_wall.ua_value for out_wall in
self.thermal_zone.outer_walls))
self.r_total_ow = 1 / self.ua_value_ow
# values facing the inside of the thermal zone
self.r_conv_inner_ow = (1 /
(sum(1 / out_wall.r_inner_conv for out_wall in
self.thermal_zone.outer_walls)))
self.r_rad_inner_ow = (1 /
(sum(1 / out_wall.r_inner_rad for out_wall in
self.thermal_zone.outer_walls)))
self.r_comb_inner_ow = (1 /
(sum(1 / out_wall.r_inner_comb for out_wall in
self.thermal_zone.outer_walls)))
self.ir_emissivity_inner_ow = (
(sum(out_wall.layer[0].material.ir_emissivity * out_wall.area for
out_wall in self.thermal_zone.outer_walls)) / self.area_ow)
self.alpha_conv_inner_ow = (
1 / (self.r_conv_inner_ow * self.area_ow))
self.alpha_rad_inner_ow = (
1 / (self.r_rad_inner_ow * self.area_ow))
self.alpha_comb_inner_ow = (
1 / (self.r_comb_inner_ow * self.area_ow))
# values facing the ambient
# ground floor does not have any coefficients on ambient side
self.r_conv_outer_ow = (1 /
(sum(1 / out_wall.r_outer_conv for out_wall in
self.thermal_zone.outer_walls)))
self.r_rad_outer_ow = (1 /
(sum(1 / out_wall.r_outer_rad for out_wall in
self.thermal_zone.outer_walls)))
self.r_comb_outer_ow = (1 /
(sum(1 / out_wall.r_outer_comb for out_wall in
self.thermal_zone.outer_walls)))
self.ir_emissivity_outer_ow = (
(sum(out_wall.layer[
-1].material.ir_emissivity * out_wall.area
for
out_wall in
self.thermal_zone.outer_walls))) / self.area_ow
self.solar_absorp_ow = (
(sum(out_wall.layer[
-1].material.solar_absorp * out_wall.area
for
out_wall in
self.thermal_zone.outer_walls))) / self.area_ow
self.alpha_conv_outer_ow = (
1 / (self.r_conv_outer_ow * self.area_ow))
self.alpha_rad_outer_ow = (
1 / (self.r_rad_outer_ow * self.area_ow))
self.alpha_comb_outer_ow = (
1 / (self.r_comb_outer_ow * self.area_ow))
def _sum_ground_floor_elements(self):
"""Sum attributes for ground floor elements
This function sums and computes the area-weighted values,
where necessary (the class doc string) for coefficients of heat
transfer, resistances, areas and UA-Values.
"""
self.area_gf = sum(ground.area for ground in
self.thermal_zone.ground_floors)
self.ua_value_gf = \
(sum(ground.ua_value for ground in
self.thermal_zone.ground_floors))
self.r_total_gf = 1 / self.ua_value_gf
# values facing the inside of the thermal zone
self.r_conv_inner_gf = (1 /
sum(1 / ground.r_inner_conv for ground in
self.thermal_zone.ground_floors))
self.r_rad_inner_gf = (1 /
sum(1 / ground.r_inner_rad for ground in
self.thermal_zone.ground_floors))
self.r_comb_inner_gf = (1 /
sum(1 / ground.r_inner_comb for ground in
self.thermal_zone.ground_floors))
self.ir_emissivity_inner_gf = sum(
ground.layer[0].material.ir_emissivity * ground.area for ground
in self.thermal_zone.ground_floors) / self.area_gf
self.alpha_conv_inner_gf = (
1 / (self.r_conv_inner_gf * self.area_gf))
self.alpha_rad_inner_gf = (
1 / (self.r_rad_inner_gf * self.area_gf))
self.alpha_comb_inner_gf = (
1 / (self.r_comb_inner_gf * self.area_gf))
def _sum_rooftop_elements(self):
"""Sum attributes for rooftop elements
This function sums and computes the area-weighted values,
where necessary for coefficients of heat
transfer, resistances, areas and UA-Values.
For ThreeElement model it treats rooftops and outer walls
as one kind of wall type.
"""
self.area_rt = sum(roof.area for roof in
self.thermal_zone.rooftops)
self.ua_value_rt = sum(roof.ua_value for roof in
self.thermal_zone.rooftops)
self.r_total_rt = 1 / self.ua_value_rt
# values facing the inside of the thermal zone
self.r_conv_inner_rt = (1 / sum(1 / roof.r_inner_conv for roof in
self.thermal_zone.rooftops))
self.r_rad_inner_rt = (1 / sum(1 / roof.r_inner_rad for roof in
self.thermal_zone.rooftops))
self.r_comb_inner_rt = (1 / sum(1 / roof.r_inner_comb for roof in
self.thermal_zone.rooftops))
self.ir_emissivity_inner_rt = sum(
roof.layer[0].material.ir_emissivity * roof.area for
roof in self.thermal_zone.rooftops) / self.area_rt
self.alpha_conv_inner_rt = (
1 / (self.r_conv_inner_rt * self.area_rt))
self.alpha_rad_inner_rt = (
1 / (self.r_rad_inner_rt * self.area_rt))
self.alpha_comb_inner_rt = (
1 / (self.r_comb_inner_rt * self.area_rt))
# values facing the ambient
# ground floor does not have any coefficients on ambient side
self.r_conv_outer_rt = (1 / sum(1 / roof.r_outer_conv for roof in
self.thermal_zone.rooftops))
self.r_rad_outer_rt = (1 / sum(1 / roof.r_outer_rad for roof in
self.thermal_zone.rooftops))
self.r_comb_outer_rt = (1 / sum(1 / roof.r_outer_comb for roof in
self.thermal_zone.rooftops))
self.ir_emissivity_outer_rt = sum(
roof.layer[-1].material.ir_emissivity * roof.area for
roof in self.thermal_zone.rooftops) / self.area_rt
self.solar_absorp_rt = sum(
roof.layer[-1].material.solar_absorp * roof.area for
roof in self.thermal_zone.rooftops) / self.area_rt
self.alpha_conv_outer_rt = (
1 / (self.r_conv_outer_rt * self.area_rt))
self.alpha_rad_outer_rt = (
1 / (self.r_rad_outer_rt * self.area_rt))
self.alpha_comb_outer_rt = (
1 / (self.r_comb_outer_rt * self.area_rt))
def _sum_inner_wall_elements(self):
"""Sum attributes for interior elements
This function sums and computes the area-weighted values,
where necessary (the class doc string) for coefficients of heat
transfer, resistances, areas and UA-Values.
It treats all inner walls identical.
Function is identical for TwoElement, ThreeElement and FourElement.
Calculation of adjacent thermal zones and thus these attributes are
currently not supported.
"""
self.area_iw = \
(sum(in_wall.area for in_wall in
self.thermal_zone.inner_walls)
+ sum(floor.area for floor in
self.thermal_zone.floors)
+ sum(ceiling.area for ceiling in
self.thermal_zone.ceilings))
self.ua_value_iw = \
(sum(in_wall.ua_value for in_wall in
self.thermal_zone.inner_walls)
+ sum(floor.ua_value for floor in
self.thermal_zone.floors)
+ sum(ceiling.ua_value for ceiling in
self.thermal_zone.ceilings))
# values facing the inside of the thermal zone
self.r_conv_inner_iw = (1 /
(sum(1 / in_wall.r_inner_conv for in_wall in
self.thermal_zone.inner_walls)
+ sum(1 / floor.r_inner_conv for floor in
self.thermal_zone.floors)
+ sum(1 / ceiling.r_inner_conv for ceiling in
self.thermal_zone.ceilings)))
self.r_rad_inner_iw = (1 /
(sum(1 / in_wall.r_inner_rad for in_wall in
self.thermal_zone.inner_walls)
+ sum(1 / floor.r_inner_rad for floor in
self.thermal_zone.floors)
+ sum(1 / ceiling.r_inner_rad for ceiling in
self.thermal_zone.ceilings)))
self.r_comb_inner_iw = (1 /
(sum(1 / in_wall.r_inner_comb for in_wall in
self.thermal_zone.inner_walls)
+ sum(1 / floor.r_inner_comb for floor in
self.thermal_zone.floors)
+ sum(1 / ceiling.r_inner_comb for ceiling in
self.thermal_zone.ceilings)))
self.ir_emissivity_inner_iw = (
(sum(in_wall.layer[0].material.ir_emissivity * in_wall.area for
in_wall in self.thermal_zone.inner_walls)
+ sum(floor.layer[0].material.ir_emissivity * floor.area for
floor in self.thermal_zone.floors)
+ sum(ceiling.layer[0].material.ir_emissivity * ceiling.area for
ceiling in self.thermal_zone.ceilings)) / self.area_iw)
self.alpha_conv_inner_iw = (
1 / (self.r_conv_inner_iw * self.area_iw))
self.alpha_rad_inner_iw = (
1 / (self.r_rad_inner_iw * self.area_iw))
self.alpha_comb_inner_iw = (
1 / (self.r_comb_inner_iw * self.area_iw))
# adjacent thermal zones are not supported!
def _sum_window_elements(self):
"""Sum attributes for window elements
This function sums and computes the area-weighted values,
where necessary (the class doc string) for coefficients of heat
transfer, resistances, areas and UA-Values.
Function is identical for TwoElement, ThreeElement and FourElement.
"""
self.area_win = sum(win.area for win in self.thermal_zone.windows)
self.ua_value_win = sum(
win.ua_value for win in self.thermal_zone.windows)