Coverage for teaser/logic/buildingobjects/calculation/five_element.py: 93%
675 statements
« prev ^ index » next coverage.py v7.4.4, created at 2025-04-29 16:01 +0000
« prev ^ index » next coverage.py v7.4.4, created at 2025-04-29 16:01 +0000
1# created January 2017
3from __future__ import division
4import math
5import numpy as np
6import random
7import warnings
10class FiveElement(object):
11 """This class contains attributes and functions for five element model
13 This model adds new elements for borders with neighboured zones. Doing so,
14 borders to the same zone are lumped, but those to different zones are not.
15 As a consequence, the final model may have more than five elements.
17 It treats OuterWalls, Rooftops and GroundFloors separate resulting in three
18 RC-combination for these, and one additional RC combination per bordered
19 neighboured zone.
20 Depending on the chosen method it will consider an extra resistance for
21 windows or merge all windows into the RC-Combination for outer walls.
23 Parameters
24 ----------
25 thermal_zone: ThermalZone()
26 TEASER instance of ThermalZone
27 merge_windows : boolean
28 True for merging windows into the outer wall's RC-combination,
29 False for separate resistance for window, default is False. (Only
30 supported for IBPSA)
31 t_bt : float [d]
32 Time constant according to VDI 6007 (default t_bt = 5)
34 Attributes
35 ----------
36 Interior Walls
38 area_iw : float [m2]
39 Area of all interior walls.
40 alpha_conv_inner_iw : float [W/(m2K)]
41 Area-weighted convective coefficient of heat transfer of interior
42 walls facing the inside of this thermal zone.
43 alpha_rad_inner_iw : float [W/(m2K)]
44 Area-weighted radiative coefficient of heat transfer of interior
45 walls facing the inside of this thermal zone.
46 alpha_comb_inner_iw : float [W/(m2K)]
47 Area-weighted combined coefficient of heat transfer of interior walls
48 facing the inside of this thermal zone.
49 alpha_conv_outer_iw : float [W/(m2K)]
50 Area-weighted convective coefficient of heat transfer of interior
51 walls facing the adjacent thermal zone. (Currently not supported)
52 alpha_rad_outer_iw : float [W/(m2K)]
53 Area-weighted radiative coefficient of heat transfer of interior
54 walls facing the adjacent thermal zone. (Currently not supported)
55 alpha_comb_outer_iw : float [W/(m2K)]
56 Area-weighted combined coefficient of heat transfer of interior walls
57 facing the adjacent thermal zone. (Currently not supported)
58 ua_value_iw : float [W/K]
59 U-Value times interior wall area. (Does not take adjacent thermal
60 zones into account)
61 r_conv_inner_iw : float [K/W]
62 Sum of convective resistances for all interior walls
63 facing the inside of this thermal zone.
64 r_rad_inner_iw : float [K/W]
65 Sum of radiative resistances for all interior walls facing the
66 inside of this thermal zone
67 r_comb_inner_iw : float [K/W]
68 Sum of combined resistances for all interior walls facing the
69 inside of this thermal zone
70 r1_iw : float [K/W]
71 Lumped resistance of interior walls no heat transfer coefficients for
72 convection and radiation are accounted in this resistance.
73 c1_iw : float [J/K]
74 Lumped capacity of interior walls
76 Outer Walls
78 area_ow : float [m2]
79 Area of all outer walls .
80 alpha_conv_inner_ow : float [W/(m2K)]
81 Area-weighted convective coefficient of heat transfer of outer walls
82 facing the inside of this thermal zone .
83 alpha_rad_inner_ow : float [W/(m2K)]
84 Area-weighted radiative coefficient of heat transfer of outer walls
85 facing the inside of this thermal zone .
86 alpha_comb_inner_ow : float [W/(m2K)]
87 Area-weighted combined coefficient of heat transfer of outer walls
88 facing the inside of this thermal zone .
89 alpha_conv_outer_ow : float [W/(m2K)]
90 Area-weighted convective coefficient of heat transfer of outer walls
91 facing the ambient.
92 alpha_rad_outer_ow : float [W/(m2K)]
93 Area-weighted radiative coefficient of heat transfer of outer walls
94 facing the ambient .
95 alpha_comb_outer_ow : float [W/(m2K)]
96 Area-weighted combined coefficient of heat transfer of outer walls
97 facing the ambient.
98 ua_value_ow : float [W/K]
99 U-Value times outer wall area.
100 r_conv_inner_ow : float [K/W]
101 Sum of convective resistances for all outer walls facing the
102 inside of this thermal zone .
103 r_rad_inner_ow : float [K/W]
104 Sum of radiative resistances for all outer walls facing the
105 inside of this thermal zone .
106 r_comb_inner_ow : float [K/W]
107 Sum of combined resistances for all outer walls facing the
108 inside of this thermal zone.
109 r_conv_outer_ow : float [K/W]
110 Sum of convective resistances for all outer walls facing the
111 ambient.
112 r_rad_outer_ow : float [K/W]
113 Sum of radiative resistances for all outer walls facing the
114 ambient.
115 r_comb_outer_ow : float [K/W]
116 Sum of combined resistances for all outer walls facing the
117 ambient.
118 r1_ow : float [K/W]
119 Lumped resistance of outer walls no heat transfer coefficients for
120 convection and radiation are accounted in this resistance.
121 r_rest_ow : float [K/W]
122 Lumped remaining resistance of outer walls between r1_ow and c1_ow no
123 heat transfer coefficients for convection and radiation are accounted
124 in this resistance.
125 c1_ow : float [J/K]
126 Lumped capacity of outer walls .
127 weightfactor_ow : list of floats
128 Weightfactors of outer walls (UA-Value of walls with same orientation
129 and tilt divided by ua_value_ow)
130 outer_wall_areas : list of floats [m2]
131 Area of all outer walls in one list.
132 ir_emissivity_outer_ow : float
133 Area-weighted ir emissivity of outer wall facing the ambient.
134 ir_emissivity_inner_ow : float
135 Area-weighted ir emissivity of outer walls facing the thermal zone.
136 solar_absorp_ow : float
137 Area-weighted solar absorption of outer walls facing the ambient.
139 Ground Floors
141 area_gf : float [m2]
142 Area of all ground floors.
143 alpha_conv_inner_gf : float [W/(m2K)]
144 Area-weighted convective coefficient of heat transfer of ground floors
145 facing the inside of this thermal zone.
146 alpha_rad_inner_gf : float [W/(m2K)]
147 Area-weighted radiative coefficient of heat transfer of ground floors
148 facing the inside of this thermal zone.
149 alpha_comb_inner_gf : float [W/(m2K)]
150 Area-weighted combined coefficient of heat transfer of ground floors
151 facing the inside of this thermal zone.
152 ua_value_gf : float [W/K]
153 U-Value times ground floor area.
154 r_conv_inner_gf : float [K/W]
155 Sum of convective resistances for all ground floors facing the
156 inside of this thermal zone.
157 r_rad_inner_gf : float [K/W]
158 Sum of radiative resistances for all ground floors facing the
159 inside of this thermal zone.
160 r_comb_inner_gf : float [K/W]
161 Sum of combined resistances for all ground floors facing the
162 inside of this thermal zone.
163 r1_gf : float [K/W]
164 Lumped resistance of ground floors no heat transfer coefficients for
165 convection and radiation are accounted in this resistance.
166 r_rest_gf : float [K/W]
167 Lumped remaining resistance of ground floors between r1_gf and c1_gf no
168 heat transfer coefficients for convection and radiation are accounted
169 in this resistance.
170 c1_gf : float [J/K]
171 Lumped capacity of ground floors.
172 weightfactor_gf : float
173 Weightfactor of ground floors (UA-Value of walls with same orientation
174 and tilt divided by ua_value_gf)
175 ground_floor_area : float [m2]
176 Area of all ground floors.
177 r_rad_gf_iw : float [K/W]
178 Resistance for radiative heat transfer between walls.
179 TODO: needs to be checked
180 ir_emissivity_inner_gf : float
181 Area-weighted ir emissivity of ground floors facing the thermal zone.
183 Rooftops
185 area_rt : float [m2]
186 Area of all rooftops .
187 alpha_conv_inner_rt : float [W/(m2K)]
188 Area-weighted convective coefficient of heat transfer of rooftops
189 facing the inside of this thermal zone .
190 alpha_rad_inner_rt : float [W/(m2K)]
191 Area-weighted radiative coefficient of heat transfer of rooftops
192 facing the inside of this thermal zone .
193 alpha_comb_inner_rt : float [W/(m2K)]
194 Area-weighted combined coefficient of heat transfer of rooftops
195 facing the inside of this thermal zone .
196 alpha_conv_outer_rt : float [W/(m2K)]
197 Area-weighted convective coefficient of heat transfer of rooftops
198 facing the ambient.
199 alpha_rad_outer_rt : float [W/(m2K)]
200 Area-weighted radiative coefficient of heat transfer of rooftops
201 facing the ambient .
202 alpha_comb_outer_rt : float [W/(m2K)]
203 Area-weighted combined coefficient of heat transfer of rooftops
204 facing the ambient.
205 ua_value_rt : float [W/K]
206 U-Value times outer wall area.
207 r_conv_inner_rt : float [K/W]
208 Sum of convective resistances for all rooftops facing the
209 inside of this thermal zone .
210 r_rad_inner_rt : float [K/W]
211 Sum of radiative resistances for all rooftops facing the
212 inside of this thermal zone .
213 r_comb_inner_rt : float [K/W]
214 Sum of combined resistances for all rooftops facing the
215 inside of this thermal zone.
216 r_conv_outer_rt : float [K/W]
217 Sum of convective resistances for all rooftops facing the
218 ambient.
219 r_rad_outer_rt : float [K/W]
220 Sum of radiative resistances for all rooftops facing the
221 ambient.
222 r_comb_outer_rt : float [K/W]
223 Sum of combined resistances for all rooftops facing the
224 ambient.
225 r1_rt : float [K/W]
226 Lumped resistance of rooftops no heat transfer coefficients for
227 convection and radiation are accounted in this resistance.
228 r_rest_rt : float [K/W]
229 Lumped remaining resistance of rooftops between r1_rt and c1_rt no
230 heat transfer coefficients for convection and radiation are accounted
231 in this resistance.
232 c1_rt : float [J/K]
233 Lumped capacity of rooftops .
234 weightfactor_rt : list of floats
235 Weightfactors of rooftops (UA-Value of walls with same orientation
236 and tilt divided by ua_value_rt)
237 weightfactor_win_rt : list of floats
238 Weightfactors of windows in rooftop. CAUTION: this will be always a
239 list full of zeors, as windows are always calculated separatly.
240 outer_wall_areas : list of floats [m2]
241 Area of all rooftops in one list.
242 r_rad_rt_iw : float [K/W]
243 Resistance for radiative heat transfer between walls.
244 TODO: needs to be checked
245 ir_emissivity_outer_rt : float
246 Area-weighted ir emissivity of outer wall facing the ambient.
247 ir_emissivity_inner_rt : float
248 Area-weighted ir emissivity of rooftops facing the thermal zone.
249 solar_absorp_rt : float
250 Area-weighted solar absorption of rooftops facing the ambient.
251 tilt_rt : list of floats [degree]
252 Tilt of rooftops against the horizontal.
253 orientation_rt : list of floats [degree]
254 Orientation of rooftops (Azimuth).
255 0 - North
256 90 - East
257 180 - South
258 270 - West
260 Windows
262 area_win : float [m2]
263 Area of all windows.
264 alpha_conv_inner_win : float [W/(m2K)]
265 Area-weighted convective coefficient of heat transfer of windows
266 facing the inside of this thermal zone.
267 alpha_rad_inner_win : float [W/(m2K)]
268 Area-weighted radiative coefficient of heat transfer of windows
269 facing the inside of this thermal zone.
270 alpha_comb_inner_win : float [W/(m2K)]
271 Area-weighted combined coefficient of heat transfer of windows facing
272 the inside of this thermal zone.
273 ratio_conv_rad_inner_win : float [-]
274 Ratio for windows between convective and radiative heat emission,
275 given in VDI 6007-3
276 alpha_conv_outer_win : float [W/(m2K)]
277 Area-weighted convective coefficient of heat transfer of windows
278 facing the ambient.
279 alpha_rad_outer_win : float [W/(m2K)]
280 Area-weighted radiative coefficient of heat transfer of windows
281 facing the ambient.
282 alpha_comb_outer_win : float [W/(m2K)]
283 Area-weighted combined coefficient of heat transfer of windows facing
284 the ambient.
285 ua_value_win : float [W/K]
286 U-Value times outer wall area.
287 u_value_win : float [W/(m2K)]
288 Area weighted U-Value of windows.
289 r_conv_inner_win : float [K/W]
290 Sum of convective resistances for all windows facing the
291 inside of this thermal zone.
292 r_rad_inner_win : float [K/W]
293 Sum of radiative resistances for all windows facing the
294 inside of this thermal zone.
295 r_comb_inner_win : float [K/W]
296 Sum of combined resistances for all windows facing the
297 inside of this thermal zone.
298 r_conv_outer_win : float [K/W]
299 Sum of convective resistances for all windows facing the
300 ambient.
301 r_rad_outer_win : float [K/W]
302 Sum of radiative resistances for all windows facing the
303 ambient.
304 r_comb_outer_win : float [K/W]
305 Sum of combined resistances for all windows facing the
306 ambient.
307 r1_win : float [K/W]
308 Lumped resistance of windows, no heat transfer coefficients for
309 convection and radiation are accounted in this resistance.
310 weightfactor_win : list of floats
311 Weightfactors of windows (UA-Value of windows with same orientation
312 and tilt divided by ua_value_win or ua_value_win+ua_value_ow,
313 depending if windows is lumped/merged into the walls or not)
314 window_areas : list of floats [m2]
315 Area of all windows in one list, if the windows are merged into the
316 outer wall this list will be full of zeros
317 transparent_areas : list of floats [m2]
318 Area of all transparent elements (most likely windows) in one list,
319 this list will be always filled with the areas, independent if
320 windows are merged into walls or not.
321 solar_absorp_win : float
322 Area-weighted solar absorption for windows. (typically 0.0)
323 ir_emissivity_win : float
324 Area-weighted ir_emissivity for windows. Can be used for windows
325 facing the thermal zone and the ambient.
326 weighted_g_value : float
327 Area-weighted g-Value of all windows.
328 shading_max_irr : list of float [W/m2]
329 Threshold value above which the sunblind becomes active for the whole zone.
330 Threshold regards to the incoming irradiation level with the window direction.
331 This value does not account for heat flux due to the outside temperature.
332 shading_g_total : list of float
333 Factor representing how much of the actual solar irradiation goes through
334 the sunblind and enters the window element, for the case, that the sunblind is
335 activated. Defaults to 1, i.e. no shading is active.
337 Misc values:
339 alpha_rad_inner_mean : float [W/(m2K)]
340 Area-weighted radiative coefficient of all surfaces facing the
341 inside of this thermal zone (OuterWalls, Windows, InnerWalls, ...).
342 alpha_rad_outer_mean : float [W/(m2K)]
343 Area-weighted radiative coefficient of all surfaces facing the
344 ambient (OuterWalls, Windows, ...).
345 heat_load : [W]
346 Static heat load of the thermal zone.
347 facade_areas : list of floats [m2]
348 List containing the area of each facade (with same tilt and
349 orientation) this includes also roofs and ground floors and windows.
350 n_outer : int
351 Number of total facades with different combination of tilt and
352 orientation, windows and outer walls
353 n_rt : int
354 Number of total facades with different combination of tilt and
355 orientation, Rooftops
356 tilt_facade : list of floats [degree]
357 Tilt of facades against the horizontal.
358 orientation_facade : list of floats [degree]
359 Orientation of facades (Azimuth).
360 0 - North
361 90 - East
362 180 - South
363 270 - West
365 """
367 def __init__(self, thermal_zone, merge_windows, t_bt):
368 """Constructor for FourElement"""
370 self.internal_id = random.random()
372 self.thermal_zone = thermal_zone
373 self.merge_windows = merge_windows
374 self.t_bt = t_bt
376 # Attributes of inner walls
377 self.area_iw = 0.0
379 # coefficient of heat transfer facing the inside of this thermal zone
380 self.alpha_conv_inner_iw = 0.0
381 self.alpha_rad_inner_iw = 0.0
382 self.alpha_comb_inner_iw = 0.0
383 # coefficient of heat transfer facing the adjacent thermal zone
384 self.alpha_conv_outer_iw = 0.0
385 self.alpha_rad_outer_iw = 0.0
386 self.alpha_comb_outer_iw = 0.0
388 # UA-Value
389 self.ua_value_iw = 0.0
391 # resistances for heat transfer facing the inside of this thermal zone
392 self.r_conv_inner_iw = 0.0
393 self.r_rad_inner_iw = 0.0
394 self.r_comb_inner_iw = 0.0
395 self.r_conv_outer_iw = 0.0
396 self.r_rad_outer_iw = 0.0
397 self.r_comb_outer_iw = 0.0
399 # lumped resistance/capacity
400 self.r1_iw = 0.0
401 self.c1_iw = 0.0
403 # Attributes for outer walls
404 self.area_ow = 0.0
406 # coefficient of heat transfer facing the inside of this thermal zone
407 self.alpha_conv_inner_ow = 0.0
408 self.alpha_rad_inner_ow = 0.0
409 self.alpha_comb_inner_ow = 0.0
411 # coefficient of heat transfer facing the ambient
412 self.alpha_conv_outer_ow = 0.0
413 self.alpha_rad_outer_ow = 0.0
414 self.alpha_comb_outer_ow = 0.0
416 # UA-Value
417 self.ua_value_ow = 0.0
419 # resistances for heat transfer facing the inside of this thermal zone
420 self.r_conv_inner_ow = 0.0
421 self.r_rad_inner_ow = 0.0
422 self.r_comb_inner_ow = 0.0
424 # resistances for heat transfer facing the ambient
425 self.r_conv_outer_ow = 0.0
426 self.r_rad_outer_ow = 0.0
427 self.r_comb_outer_ow = 0.0
429 # lumped resistances/capacity
430 self.r1_ow = 0.0
431 self.r_rest_ow = 0.0
432 self.c1_ow = 0.0
433 self.r_total_ow = 0.0
435 # Optical properties
436 self.ir_emissivity_outer_ow = 0.0
437 self.ir_emissivity_inner_ow = 0.0
438 self.solar_absorp_ow = 0.0
440 # Additional attributes
441 self.weightfactor_ow = []
442 self.weightfactor_ground = 0.0
443 self.outer_wall_areas = []
445 # Attributes for GroundFloor
446 self.area_gf = 0.0
448 # coefficient of heat transfer facing the inside of this thermal zone
449 self.alpha_conv_inner_gf = 0.0
450 self.alpha_rad_inner_gf = 0.0
451 self.alpha_comb_inner_gf = 0.0
453 # UA-Value
454 self.ua_value_gf = 0.0
456 # resistances for heat transfer facing the inside of this thermal zone
457 self.r_conv_inner_gf = 0.0
458 self.r_rad_inner_gf = 0.0
459 self.r_comb_inner_gf = 0.0
461 # lumped resistances/capacity
462 self.r1_gf = 0.0
463 self.r_rest_gf = 0.0
464 self.c1_gf = 0.0
465 self.r_total_gf = 0.0
467 # Optical properties
468 self.ir_emissivity_inner_gf = 0.0
470 # Additional attributes
472 self.weightfactor_ground = 0.0
474 # Attributes for rooftops
475 self.area_rt = 0.0
477 # coefficient of heat transfer facing the inside of this thermal zone
478 self.alpha_conv_inner_rt = 0.0
479 self.alpha_rad_inner_rt = 0.0
480 self.alpha_comb_inner_rt = 0.0
482 # coefficient of heat transfer facing the ambient
483 self.alpha_conv_outer_rt = 0.0
484 self.alpha_rad_outer_rt = 0.0
485 self.alpha_comb_outer_rt = 0.0
487 # UA-Value
488 self.ua_value_rt = 0.0
490 # resistances for heat transfer facing the inside of this thermal zone
491 self.r_conv_inner_rt = 0.0
492 self.r_rad_inner_rt = 0.0
493 self.r_comb_inner_rt = 0.0
495 # resistances for heat transfer facing the ambient
496 self.r_conv_outer_rt = 0.0
497 self.r_rad_outer_rt = 0.0
498 self.r_comb_outer_rt = 0.0
500 # lumped resistances/capacity
501 self.r1_rt = 0.0
502 self.r_rest_rt = 0.0
503 self.c1_rt = 0.0
504 self.r_total_rt = 0.0
506 # Optical properties
507 self.ir_emissivity_outer_rt = 0.0
508 self.ir_emissivity_inner_rt = 0.0
509 self.solar_absorp_rt = 0.0
511 # Additional attributes
512 self.weightfactor_rt = []
513 self.weightfactor_win_rt = []
514 self.rooftop_areas = []
515 self.tilt_rt = []
516 self.orientation_rt = []
518 # TODO: check this value
519 self.r_rad_rt_iw = 0.0
521 # Attributes for windows
522 self.area_win = 0.0
524 # coefficient of heat transfer facing the inside of this thermal zone
525 self.alpha_conv_inner_win = 0.0
526 self.alpha_rad_inner_win = 0.0
527 self.alpha_comb_inner_win = 0.0
528 self.ratio_conv_rad_inner_win = 0.0
530 # coefficient of heat transfer facing the ambient
531 self.alpha_conv_outer_win = 0.0
532 self.alpha_rad_outer_win = 0.0
533 self.alpha_comb_outer_win = 0.0
535 # UA-Value
536 self.ua_value_win = 0.0
537 self.u_value_win = 0.0
539 # resistances for heat transfer facing the inside of this thermal zone
540 self.r_conv_inner_win = 0.0
541 self.r_rad_inner_win = 0.0
542 self.r_comb_inner_win = 0.0
544 # resistances for heat transfer facing the ambient
545 self.r_conv_outer_win = 0.0
546 self.r_rad_outer_win = 0.0
547 self.r_comb_outer_win = 0.0
549 # lumped resistances/capacity
550 self.r1_win = 0.0
552 # Optical properties
553 self.ir_emissivity_win = 0.0
554 self.ir_emissivity_inner_win = 0.0
555 self.solar_absorp_win = 0.0
557 # Additional attributes
558 self.weightfactor_win = []
559 self.window_areas = []
560 self.transparent_areas = []
561 self.shading_g_total = []
562 self.shading_max_irr = []
563 self.weighted_g_value = 0.0
565 # Attributes for neighboured zones (vectorized - one element per other
566 # zone)
567 self.area_nzb = []
569 # coefficient of heat transfer facing the inside of this thermal zone
570 self.alpha_conv_inner_nzb = []
571 self.alpha_rad_inner_nzb = []
572 self.alpha_comb_inner_nzb = []
574 # coefficient of heat transfer facing the other thermal zone
575 self.alpha_conv_outer_nzb = []
576 self.alpha_rad_outer_nzb = []
577 self.alpha_comb_outer_nzb = []
579 # UA-Value
580 self.ua_value_nzb = []
582 # resistances for heat transfer facing the inside of this thermal zone
583 self.r_conv_inner_nzb = []
584 self.r_rad_inner_nzb = []
585 self.r_comb_inner_nzb = []
587 # resistances for heat transfer facing the ambient
588 self.r_conv_outer_nzb = []
589 self.r_rad_outer_nzb = []
590 self.r_comb_outer_nzb = []
592 # lumped resistances/capacity
593 self.r1_nzb = []
594 self.r_rest_nzb = []
595 self.c1_nzb = []
596 self.r_total_nzb = []
598 # Optical properties
599 self.ir_emissivity_outer_nzb = []
600 self.ir_emissivity_inner_nzb = []
602 # Additional parameters
603 self.nz_index = []
604 self.other_nz_indexes = []
605 self.nzbs_per_nz = []
607 # Misc values
608 self.n_outer = 0
609 self.all_tilts = []
610 self.all_orientations = []
611 self.alpha_rad_inner_mean = 0.0
612 self.alpha_rad_outer_mean = 0.0
613 self.heat_load = 0.0
614 self.cool_load = 0.0
616 # Misc values
618 self.alpha_rad_inner_mean = 0.0
619 self.alpha_rad_outer_mean = 0.0
620 self.n_outer = 0
621 self.n_rt = 0
622 self.facade_areas = []
623 self.tilt_facade = []
624 self.orientation_facade = []
625 self.heat_load = 0.0
626 self.cool_load = 0.0
628 def calc_attributes(self):
629 """Calls all necessary function to calculate model attributes"""
631 for out_wall in self.thermal_zone.outer_walls:
632 out_wall.calc_equivalent_res()
633 out_wall.calc_ua_value()
634 for rt in self.thermal_zone.rooftops:
635 rt.calc_equivalent_res()
636 rt.calc_ua_value()
637 for gf in self.thermal_zone.ground_floors:
638 gf.calc_equivalent_res()
639 gf.calc_ua_value()
640 for nzb in self.thermal_zone.interzonal_elements:
641 nzb.calc_equivalent_res()
642 nzb.calc_ua_value()
643 for win in self.thermal_zone.windows:
644 win.calc_equivalent_res()
645 win.calc_ua_value()
646 for inner_wall in (
647 self.thermal_zone.inner_walls
648 + self.thermal_zone.floors
649 + self.thermal_zone.ceilings
650 ):
651 inner_wall.calc_equivalent_res()
652 inner_wall.calc_ua_value()
654 self.set_calc_default()
655 if len(self.thermal_zone.outer_walls) < 1:
656 warnings.warn(
657 "No walls are defined as outer walls for thermal "
658 + "zone "
659 + self.thermal_zone.name
660 + " in building "
661 + self.thermal_zone.parent.name
662 + ", please be careful with results. In addition "
663 + "this might lead to RunTimeErrors"
664 )
665 else:
666 self._sum_outer_wall_elements()
667 if (
668 len(
669 self.thermal_zone.inner_walls
670 + self.thermal_zone.floors
671 + self.thermal_zone.ceilings
672 + self.nzbs_for_iw
673 )
674 < 1
675 ):
676 warnings.warn(
677 "For thermal zone "
678 + self.thermal_zone.name
679 + " in building "
680 + self.thermal_zone.parent.name
681 + ", no inner walls have been defined."
682 )
683 else:
684 self._sum_inner_wall_elements()
685 self._calc_inner_elements()
686 if (
687 len(self.thermal_zone.find_izes_outer(add_reversed=True))
688 < 1
689 ):
690 warnings.warn(
691 "For thermal zone "
692 + self.thermal_zone.name
693 + " in building "
694 + self.thermal_zone.parent.name
695 + ", no interzonal elements have been defined."
696 )
697 else:
698 self._sum_interzonal_elements()
699 self._calc_interzonal_elements()
700 if len(self.thermal_zone.windows) < 1:
701 warnings.warn(
702 "For thermal zone "
703 + self.thermal_zone.name
704 + " in building "
705 + self.thermal_zone.parent.name
706 + ", no windows have been defined."
707 )
708 else:
709 self._sum_window_elements()
710 if len(self.thermal_zone.ground_floors) < 1:
711 warnings.warn(
712 "For thermal zone "
713 + self.thermal_zone.name
714 + " in building "
715 + self.thermal_zone.parent.name
716 + ", no ground floors have been defined."
717 )
718 else:
719 self._sum_ground_floor_elements()
720 self._calc_ground_floor_elements()
721 if len(self.thermal_zone.rooftops) < 1:
722 warnings.warn(
723 "For thermal zone "
724 + self.thermal_zone.name
725 + " in building "
726 + self.thermal_zone.parent.name
727 + ", no rooftops have been defined."
728 )
729 else:
730 self._sum_rooftop_elements()
731 self._calc_rooftop_elements()
732 if (
733 len(self.thermal_zone.outer_walls) >= 1
734 or len(self.thermal_zone.windows) >= 1
735 ):
736 self._calc_outer_elements()
737 self._calc_wf()
738 self._calc_mean_values()
739 if self.nzbs_for_iw:
740 warnings.warn(
741 "For thermal zone "
742 + self.thermal_zone.name
743 + " in building "
744 + self.thermal_zone.parent.name
745 + ", interzonal elements have been defined that are treated as "
746 + "inner elements based on your settings to them or the project"
747 + " parameter 'method_interzonal_export'."
748 )
749 self._calc_number_of_elements()
750 self._fill_zone_lists()
751 self._calc_heat_load()
752 self.cool_load = -self.heat_load
754 return True
756 @staticmethod
757 def _calc_parallel_connection(element_list, omega, mode='iw'):
758 """Parallel connection of walls according to VDI 6007
760 Calculates the parallel connection of wall elements according to VDI
761 6007, resulting in R1 and C1 (equation 23, 24).
763 Parameters
764 ----------
765 element_list : list
766 List of inner or outer walls
767 omega : float
768 VDI 6007 frequency
769 mode : str
770 'ow' uses r1 and c1_korr
771 'iw' uses r1 and c1 (function falls back here for other strings)
772 'izw_backwards' uses r2 and c1_korr because heat flow goes towards
773 this thermal zone (instead of away from it) for interzonal
774 elements between heated and unheated zones
776 Returns
777 ----------
778 r1 : float [K/W]
779 VDI 6007 resistance for all inner or outer walls
780 c1 : float [K/W]
781 VDI 6007 capacity all for inner or outer walls
782 """
784 for wall_count in range(len(element_list) - 1):
786 if wall_count == 0:
787 if mode == 'izw_backwards':
788 r1_before = element_list[wall_count].r2
789 else:
790 r1_before = element_list[wall_count].r1
791 if mode == 'ow' or mode == 'izw_backwards':
792 c1_before = element_list[wall_count].c1_korr
793 else:
794 c1_before = element_list[wall_count].c1
795 else:
796 r1_before = r1
797 c1_before = c1
798 if mode == 'izw_backwards':
799 r1_add = element_list[wall_count + 1].r2
800 else:
801 r1_add = element_list[wall_count + 1].r1
802 if mode == 'ow' or mode == 'izw_backwards':
803 c1_add = element_list[wall_count + 1].c1_korr
804 else:
805 c1_add = element_list[wall_count + 1].c1
807 r1 = (r1_before * c1_before ** 2 + r1_add * c1_add ** 2
808 + omega ** 2 * r1_before * r1_add * (r1_before + r1_add)
809 * c1_before ** 2 * c1_add ** 2) \
810 / ((c1_before + c1_add) ** 2
811 + omega ** 2 * (r1_before + r1_add) ** 2 * c1_before ** 2
812 * c1_add ** 2)
814 c1 = ((c1_before + c1_add) ** 2
815 + omega ** 2 * (r1_before + r1_add) ** 2 * c1_before ** 2
816 * c1_add ** 2) \
817 / (c1_before + c1_add
818 + omega ** 2
819 * (r1_before ** 2 * c1_before + r1_add ** 2 * c1_add)
820 * c1_before
821 * c1_add)
823 return r1, c1
825 def _sum_outer_wall_elements(self):
826 """Sum attributes for outer wall elements
828 This function sums and computes the area-weighted values,
829 where necessary for coefficients of heat
830 transfer, resistances, areas and UA-Values.
832 For ThreeElement model it treats rooftops and outer walls
833 as one kind of wall type.
835 """
837 self.area_ow = sum(out_wall.area for out_wall in self.thermal_zone.outer_walls)
839 self.ua_value_ow = sum(
840 out_wall.ua_value for out_wall in self.thermal_zone.outer_walls
841 )
843 self.r_total_ow = 1 / self.ua_value_ow
845 # values facing the inside of the thermal zone
847 self.r_conv_inner_ow = 1 / (
848 sum(1 / out_wall.r_inner_conv for out_wall in self.thermal_zone.outer_walls)
849 )
851 self.r_rad_inner_ow = 1 / (
852 sum(1 / out_wall.r_inner_rad for out_wall in self.thermal_zone.outer_walls)
853 )
855 self.r_comb_inner_ow = 1 / (
856 sum(1 / out_wall.r_inner_comb for out_wall in self.thermal_zone.outer_walls)
857 )
859 self.ir_emissivity_inner_ow = (
860 sum(
861 out_wall.layer[0].material.ir_emissivity * out_wall.area
862 for out_wall in self.thermal_zone.outer_walls
863 )
864 ) / self.area_ow
866 self.alpha_conv_inner_ow = 1 / (self.r_conv_inner_ow * self.area_ow)
867 self.alpha_rad_inner_ow = 1 / (self.r_rad_inner_ow * self.area_ow)
868 self.alpha_comb_inner_ow = 1 / (self.r_comb_inner_ow * self.area_ow)
870 # values facing the ambient
871 # ground floor does not have any coefficients on ambient side
873 self.r_conv_outer_ow = 1 / (
874 sum(1 / out_wall.r_outer_conv for out_wall in self.thermal_zone.outer_walls)
875 )
876 self.r_rad_outer_ow = 1 / (
877 sum(1 / out_wall.r_outer_rad for out_wall in self.thermal_zone.outer_walls)
878 )
879 self.r_comb_outer_ow = 1 / (
880 sum(1 / out_wall.r_outer_comb for out_wall in self.thermal_zone.outer_walls)
881 )
883 self.ir_emissivity_outer_ow = (
884 (
885 sum(
886 out_wall.layer[-1].material.ir_emissivity * out_wall.area
887 for out_wall in self.thermal_zone.outer_walls
888 )
889 )
890 ) / self.area_ow
892 self.solar_absorp_ow = (
893 (
894 sum(
895 out_wall.layer[-1].material.solar_absorp * out_wall.area
896 for out_wall in self.thermal_zone.outer_walls
897 )
898 )
899 ) / self.area_ow
901 self.alpha_conv_outer_ow = 1 / (self.r_conv_outer_ow * self.area_ow)
902 self.alpha_rad_outer_ow = 1 / (self.r_rad_outer_ow * self.area_ow)
903 self.alpha_comb_outer_ow = 1 / (self.r_comb_outer_ow * self.area_ow)
905 def _sum_ground_floor_elements(self):
906 """Sum attributes for ground floor elements
908 This function sums and computes the area-weighted values,
909 where necessary (the class doc string) for coefficients of heat
910 transfer, resistances, areas and UA-Values.
912 """
914 self.area_gf = sum(ground.area for ground in self.thermal_zone.ground_floors)
916 self.ua_value_gf = sum(
917 ground.ua_value for ground in self.thermal_zone.ground_floors
918 )
920 self.r_total_gf = 1 / self.ua_value_gf
922 # values facing the inside of the thermal zone
924 self.r_conv_inner_gf = 1 / sum(
925 1 / ground.r_inner_conv for ground in self.thermal_zone.ground_floors
926 )
928 self.r_rad_inner_gf = 1 / sum(
929 1 / ground.r_inner_rad for ground in self.thermal_zone.ground_floors
930 )
932 self.r_comb_inner_gf = 1 / sum(
933 1 / ground.r_inner_comb for ground in self.thermal_zone.ground_floors
934 )
936 self.ir_emissivity_inner_gf = (
937 sum(
938 ground.layer[0].material.ir_emissivity * ground.area
939 for ground in self.thermal_zone.ground_floors
940 )
941 / self.area_gf
942 )
944 self.alpha_conv_inner_gf = 1 / (self.r_conv_inner_gf * self.area_gf)
945 self.alpha_rad_inner_gf = 1 / (self.r_rad_inner_gf * self.area_gf)
946 self.alpha_comb_inner_gf = 1 / (self.r_comb_inner_gf * self.area_gf)
948 def _sum_rooftop_elements(self):
949 """Sum attributes for rooftop elements
951 This function sums and computes the area-weighted values,
952 where necessary for coefficients of heat
953 transfer, resistances, areas and UA-Values.
955 For ThreeElement model it treats rooftops and outer walls
956 as one kind of wall type.
958 """
960 self.area_rt = sum(roof.area for roof in self.thermal_zone.rooftops)
962 self.ua_value_rt = sum(roof.ua_value for roof in self.thermal_zone.rooftops)
964 self.r_total_rt = 1 / self.ua_value_rt
966 # values facing the inside of the thermal zone
968 self.r_conv_inner_rt = 1 / sum(
969 1 / roof.r_inner_conv for roof in self.thermal_zone.rooftops
970 )
972 self.r_rad_inner_rt = 1 / sum(
973 1 / roof.r_inner_rad for roof in self.thermal_zone.rooftops
974 )
976 self.r_comb_inner_rt = 1 / sum(
977 1 / roof.r_inner_comb for roof in self.thermal_zone.rooftops
978 )
980 self.ir_emissivity_inner_rt = (
981 sum(
982 roof.layer[0].material.ir_emissivity * roof.area
983 for roof in self.thermal_zone.rooftops
984 )
985 / self.area_rt
986 )
988 self.alpha_conv_inner_rt = 1 / (self.r_conv_inner_rt * self.area_rt)
989 self.alpha_rad_inner_rt = 1 / (self.r_rad_inner_rt * self.area_rt)
990 self.alpha_comb_inner_rt = 1 / (self.r_comb_inner_rt * self.area_rt)
992 # values facing the ambient
993 # ground floor does not have any coefficients on ambient side
995 self.r_conv_outer_rt = 1 / sum(
996 1 / roof.r_outer_conv for roof in self.thermal_zone.rooftops
997 )
998 self.r_rad_outer_rt = 1 / sum(
999 1 / roof.r_outer_rad for roof in self.thermal_zone.rooftops
1000 )
1001 self.r_comb_outer_rt = 1 / sum(
1002 1 / roof.r_outer_comb for roof in self.thermal_zone.rooftops
1003 )
1005 self.ir_emissivity_outer_rt = (
1006 sum(
1007 roof.layer[-1].material.ir_emissivity * roof.area
1008 for roof in self.thermal_zone.rooftops
1009 )
1010 / self.area_rt
1011 )
1013 self.solar_absorp_rt = (
1014 sum(
1015 roof.layer[-1].material.solar_absorp * roof.area
1016 for roof in self.thermal_zone.rooftops
1017 )
1018 / self.area_rt
1019 )
1021 self.alpha_conv_outer_rt = 1 / (self.r_conv_outer_rt * self.area_rt)
1022 self.alpha_rad_outer_rt = 1 / (self.r_rad_outer_rt * self.area_rt)
1023 self.alpha_comb_outer_rt = 1 / (self.r_comb_outer_rt * self.area_rt)
1025 def _sum_inner_wall_elements(self):
1026 """Sum attributes for interior elements
1028 This function sums and computes the area-weighted values,
1029 where necessary (the class doc string) for coefficients of heat
1030 transfer, resistances, areas and UA-Values.
1032 It treats all inner walls identical.
1034 Function is identical for TwoElement, ThreeElement and FourElement.
1036 Calculation of adjacent thermal zones and thus these attributes are
1037 currently not supported.
1039 """
1040 self.area_iw = (
1041 sum(in_wall.area for in_wall in self.thermal_zone.inner_walls)
1042 + sum(floor.area for floor in self.thermal_zone.floors)
1043 + sum(ceiling.area for ceiling in self.thermal_zone.ceilings)
1044 + sum(nzb.area for nzb in self.nzbs_for_iw)
1045 )
1047 self.ua_value_iw = (
1048 sum(in_wall.ua_value for in_wall in self.thermal_zone.inner_walls)
1049 + sum(floor.ua_value for floor in self.thermal_zone.floors)
1050 + sum(ceiling.ua_value for ceiling in self.thermal_zone.ceilings)
1051 + sum(nzb.ua_value for nzb in self.nzbs_for_iw)
1052 )
1054 # values facing the inside of the thermal zone
1056 self.r_conv_inner_iw = 1 / (
1057 sum(1 / in_wall.r_inner_conv for in_wall in self.thermal_zone.inner_walls)
1058 + sum(1 / floor.r_inner_conv for floor in self.thermal_zone.floors)
1059 + sum(1 / ceiling.r_inner_conv for ceiling in self.thermal_zone.ceilings)
1060 + sum(1 / nzb.r_inner_conv for nzb in self.nzbs_for_iw)
1061 )
1063 self.r_rad_inner_iw = 1 / (
1064 sum(1 / in_wall.r_inner_rad for in_wall in self.thermal_zone.inner_walls)
1065 + sum(1 / floor.r_inner_rad for floor in self.thermal_zone.floors)
1066 + sum(1 / ceiling.r_inner_rad for ceiling in self.thermal_zone.ceilings)
1067 + sum(1 / nzb.r_inner_rad for nzb in self.nzbs_for_iw)
1068 )
1070 self.r_comb_inner_iw = 1 / (
1071 sum(1 / in_wall.r_inner_comb for in_wall in self.thermal_zone.inner_walls)
1072 + sum(1 / floor.r_inner_comb for floor in self.thermal_zone.floors)
1073 + sum(1 / ceiling.r_inner_comb for ceiling in self.thermal_zone.ceilings)
1074 + sum(1 / nzb.r_inner_comb for nzb in self.nzbs_for_iw)
1075 )
1077 self.ir_emissivity_inner_iw = (
1078 sum(
1079 in_wall.layer[0].material.ir_emissivity * in_wall.area
1080 for in_wall in self.thermal_zone.inner_walls
1081 )
1082 + sum(
1083 floor.layer[0].material.ir_emissivity * floor.area
1084 for floor in self.thermal_zone.floors
1085 )
1086 + sum(
1087 ceiling.layer[0].material.ir_emissivity * ceiling.area
1088 for ceiling in self.thermal_zone.ceilings
1089 )
1090 + sum(
1091 nzb.layer[0].material.ir_emissivity * nzb.area
1092 for nzb in self.nzbs_for_iw
1093 )
1094 ) / self.area_iw
1096 self.alpha_conv_inner_iw = 1 / (self.r_conv_inner_iw * self.area_iw)
1097 self.alpha_rad_inner_iw = 1 / (self.r_rad_inner_iw * self.area_iw)
1098 self.alpha_comb_inner_iw = 1 / (self.r_comb_inner_iw * self.area_iw)
1100 def _sum_window_elements(self):
1101 """Sum attributes for window elements
1103 This function sums and computes the area-weighted values,
1104 where necessary (the class doc string) for coefficients of heat
1105 transfer, resistances, areas and UA-Values.
1107 Function is identical for TwoElement, ThreeElement, FourElement and
1108 FiveElement.
1109 """
1111 self.area_win = sum(win.area for win in self.thermal_zone.windows)
1112 self.ua_value_win = sum(win.ua_value for win in self.thermal_zone.windows)
1113 self.u_value_win = self.ua_value_win / self.area_win
1115 # values facing the inside of the thermal zone
1117 self.r_conv_inner_win = 1 / (
1118 sum(1 / win.r_inner_conv for win in self.thermal_zone.windows)
1119 )
1121 self.r_rad_inner_win = 1 / (
1122 sum(1 / win.r_inner_rad for win in self.thermal_zone.windows)
1123 )
1125 self.r_comb_inner_win = 1 / (
1126 sum(1 / win.r_inner_comb for win in self.thermal_zone.windows)
1127 )
1129 self.ir_emissivity_inner_win = (
1130 sum(
1131 win.layer[0].material.ir_emissivity * win.area
1132 for win in self.thermal_zone.windows
1133 )
1134 / self.area_win
1135 )
1137 self.alpha_conv_inner_win = 1 / (self.r_conv_inner_win * self.area_win)
1138 self.alpha_rad_inner_win = 1 / (self.r_rad_inner_win * self.area_win)
1139 self.alpha_comb_inner_win = 1 / (self.r_comb_inner_win * self.area_win)
1140 self.ratio_conv_rad_inner_win = (
1141 sum(win.a_conv * win.area for win in self.thermal_zone.windows)
1142 / self.area_win
1143 )
1145 # values facing the ambient
1147 self.r_conv_outer_win = 1 / (
1148 sum(1 / win.r_outer_conv for win in self.thermal_zone.windows)
1149 )
1151 self.r_rad_outer_win = 1 / (
1152 sum(1 / win.r_outer_rad for win in self.thermal_zone.windows)
1153 )
1155 self.r_comb_outer_win = 1 / (
1156 sum(1 / win.r_outer_comb for win in self.thermal_zone.windows)
1157 )
1159 self.ir_emissivity_win = (
1160 sum(
1161 win.layer[-1].material.ir_emissivity * win.area
1162 for win in self.thermal_zone.windows
1163 )
1164 / self.area_win
1165 )
1167 self.solar_absorp_win = (
1168 sum(
1169 win.layer[-1].material.solar_absorp * win.area
1170 for win in self.thermal_zone.windows
1171 )
1172 / self.area_win
1173 )
1175 self.weighted_g_value = (
1176 sum(win.g_value * win.area for win in self.thermal_zone.windows)
1177 / self.area_win
1178 )
1180 self.alpha_conv_outer_win = 1 / (self.r_conv_outer_win * self.area_win)
1181 self.alpha_rad_outer_win = 1 / (self.r_rad_outer_win * self.area_win)
1182 self.alpha_comb_outer_win = 1 / (self.r_comb_outer_win * self.area_win)
1184 def _sum_interzonal_elements(self):
1185 """Sum attributes for neighboured zone border elements
1187 This function sums and computes the area-weighted values,
1188 where necessary (the class doc string) for coefficients of heat
1189 transfer, resistances, areas and UA-Values.
1191 """
1192 other_nz_indexes = set()
1193 for nz_border in self.thermal_zone.find_izes_outer(add_reversed=True):
1194 other_nz_indexes.add(self.thermal_zone.parent.thermal_zones.index(
1195 nz_border.other_side
1196 ))
1197 self.other_nz_indexes = list(other_nz_indexes)
1198 self.nzbs_per_nz = []
1199 for nz_index in self.other_nz_indexes:
1200 other_nz = self.thermal_zone.parent.thermal_zones[nz_index]
1201 self.nzbs_per_nz.append([])
1202 for nz_border \
1203 in self.thermal_zone.find_izes_outer(add_reversed=True):
1204 if nz_border.other_side is other_nz:
1205 self.nzbs_per_nz[-1].append(nz_border)
1206 nz_border.idx_orientation = nz_index
1208 self.area_nzb = _lump_sum(self.nzbs_per_nz, 'area')
1210 self.ua_value_nzb = _lump_sum(self.nzbs_per_nz, 'ua_value')
1212 self.r_total_nzb = [1 / ua for ua in self.ua_value_nzb]
1214 # values facing the inside of the thermal zone
1216 self.r_conv_inner_nzb = _lump_inverse_sum(self.nzbs_per_nz,
1217 'r_inner_conv')
1219 self.r_rad_inner_nzb = _lump_inverse_sum(self.nzbs_per_nz,
1220 'r_inner_rad')
1222 self.r_comb_inner_nzb = _lump_inverse_sum(self.nzbs_per_nz,
1223 'r_inner_comb')
1225 self.ir_emissivity_inner_nzb = [
1226 sum(el.layer[0].material.ir_emissivity * el.area for el in els) / a
1227 for els, a in zip(self.nzbs_per_nz, self.area_nzb)
1228 ]
1230 self.alpha_conv_inner_nzb = [
1231 1 / (rci * a)
1232 for rci, a in zip(self.r_conv_inner_nzb, self.area_nzb)
1233 ]
1234 self.alpha_rad_inner_nzb = [
1235 1 / (rri * a)
1236 for rri, a in zip(self.r_rad_inner_nzb, self.area_nzb)
1237 ]
1238 self.alpha_comb_inner_nzb = [
1239 1 / (rci * a)
1240 for rci, a in zip(self.r_comb_inner_nzb, self.area_nzb)
1241 ]
1243 # values facing the other zone
1245 self.r_conv_outer_nzb = _lump_inverse_sum(self.nzbs_per_nz,
1246 'r_outer_conv')
1247 self.r_rad_outer_nzb = _lump_inverse_sum(self.nzbs_per_nz,
1248 'r_outer_rad')
1249 self.r_comb_outer_nzb = _lump_inverse_sum(self.nzbs_per_nz,
1250 'r_outer_comb')
1252 self.ir_emissivity_outer_nzb = [
1253 sum(el.layer[-1].material.ir_emissivity * el.area for el in els) / a
1254 for els, a in zip(self.nzbs_per_nz, self.area_nzb)
1255 ]
1257 self.alpha_conv_outer_nzb = [
1258 1 / (rco * a)
1259 for rco, a in zip(self.r_conv_outer_nzb, self.area_nzb)]
1260 self.alpha_rad_outer_nzb = [
1261 1 / (rro * a)
1262 for rro, a in zip(self.r_rad_outer_nzb, self.area_nzb)]
1263 self.alpha_comb_outer_nzb = [
1264 1 / (rco * a)
1265 for rco, a in zip(self.r_comb_outer_nzb, self.area_nzb)
1266 ]
1268 def _calc_outer_elements(self):
1269 """Lumped parameter for outer wall elements
1271 Calculates all necessary parameters for outer walls. This includes
1272 OuterWalls and Rooftops.
1274 Attributes
1275 ----------
1276 omega : float [1/s]
1277 angular frequency with given time period.
1278 outer_walls : list
1279 List containing all TEASER Wall instances that are treated as same
1280 outer wall type. In case of TwoElement model OuterWalls, Rooftops
1281 """
1283 omega = 2 * math.pi / 86400 / self.t_bt
1285 outer_walls = self.thermal_zone.outer_walls
1287 if 0 < len(outer_walls) <= 1:
1288 # only one outer wall, no need to calculate chain matrix
1289 self.r1_ow = outer_walls[0].r1
1290 self.c1_ow = outer_walls[0].c1_korr
1291 elif len(outer_walls) > 1:
1292 # more than one outer wall, calculate chain matrix
1293 self.r1_ow, self.c1_ow = self._calc_parallel_connection(
1294 outer_walls, omega, mode='ow'
1295 )
1296 else:
1297 warnings.warn(
1298 "No walls are defined as outer walls, please be "
1299 "careful with results. In addition this might lead "
1300 "to RunTimeErrors"
1301 )
1303 if self.merge_windows is False:
1304 try:
1306 if len(self.thermal_zone.windows) > 0:
1307 self.r1_win = 1 / sum(
1308 (1 / win.r1) for win in self.thermal_zone.windows
1309 )
1310 if len(self.thermal_zone.outer_walls) > 0:
1311 conduction = 1 / sum(
1312 (1 / element.r_conduc) for element in outer_walls
1313 )
1315 self.r_rest_ow = conduction - self.r1_ow
1317 except RuntimeError:
1318 print(
1319 "As no outer walls or no windows are defined lumped "
1320 "parameter cannot be calculated"
1321 )
1323 if self.merge_windows is True:
1325 try:
1326 if (
1327 len(self.thermal_zone.windows) > 0
1328 and len(self.thermal_zone.outer_walls) > 0
1329 ):
1330 self.r1_win = 1 / sum(
1331 1 / (win.r1 / 6) for win in self.thermal_zone.windows
1332 )
1334 self.r1_ow = 1 / (1 / self.r1_ow + 1 / self.r1_win)
1336 self.r_total_ow = 1 / (self.ua_value_ow + self.ua_value_win)
1337 self.r_rest_ow = (
1338 self.r_total_ow
1339 - self.r1_ow
1340 - 1
1341 / (
1342 (
1343 (1 / self.r_conv_inner_ow)
1344 + (1 / self.r_conv_inner_win)
1345 + (1 / self.r_rad_inner_ow)
1346 + (1 / self.r_rad_inner_win)
1347 )
1348 )
1349 ) - 1 / (self.alpha_comb_outer_ow * self.area_ow)
1351 self.ir_emissivity_inner_ow = (
1352 self.ir_emissivity_inner_ow * self.area_ow
1353 + self.ir_emissivity_inner_win * self.area_win
1354 ) / (self.area_ow + self.area_win)
1356 self.ir_emissivity_outer_ow = (
1357 self.ir_emissivity_outer_ow * self.area_ow
1358 + self.ir_emissivity_win * self.area_win
1359 ) / (self.area_ow + self.area_win)
1361 self.solar_absorp_ow = (
1362 self.solar_absorp_ow * self.area_ow
1363 + self.solar_absorp_win * self.area_win
1364 ) / (self.area_ow + self.area_win)
1366 except RuntimeError:
1367 print(
1368 "As no outer walls or no windows are defined lumped "
1369 "parameter cannot be calculated"
1370 )
1372 def _calc_ground_floor_elements(self):
1373 """Lumped parameter for ground floor elements
1375 Calculates lumped parameters for ground floors. No windows in ground
1376 floor allowed.
1378 Attributes
1379 ----------
1380 omega : float [1/s]
1381 angular frequency with given time period.
1382 """
1383 omega = 2 * math.pi / 86400 / self.t_bt
1385 if 0 < len(self.thermal_zone.ground_floors) <= 1:
1386 # only one outer wall, no need to calculate chain matrix
1387 self.r1_gf = self.thermal_zone.ground_floors[0].r1
1388 self.c1_gf = self.thermal_zone.ground_floors[0].c1_korr
1389 elif len(self.thermal_zone.ground_floors) > 1:
1390 # more than one outer wall, calculate chain matrix
1391 self.r1_gf, self.c1_gf = self._calc_parallel_connection(
1392 self.thermal_zone.ground_floors, omega, mode='ow'
1393 )
1394 else:
1395 warnings.warn(
1396 "No walls are defined as ground floors, please be "
1397 "careful with results. In addition this might lead "
1398 "to RunTimeErrors"
1399 )
1400 try:
1401 conduction = 1 / sum(
1402 (1 / element.r_conduc) for element in self.thermal_zone.ground_floors
1403 )
1405 self.r_rest_gf = conduction - self.r1_gf
1406 except RuntimeError:
1407 print(
1408 "As no ground floors are defined lumped "
1409 "parameter cannot be calculated"
1410 )
1412 def _calc_rooftop_elements(self):
1413 """Lumped parameter for rooftop elements
1415 Calculates lumped parameters for rooftops. Windows are considered in
1416 outer wall calculation. This results in an error concerning the
1417 interior radiation distribution. But currently there is no other option.
1419 Attributes
1420 ----------
1421 omega : float [1/s]
1422 angular frequency with given time period.
1423 """
1425 omega = 2 * math.pi / 86400 / self.t_bt
1427 if 0 < len(self.thermal_zone.rooftops) <= 1:
1428 # only one outer wall, no need to calculate chain matrix
1429 self.r1_rt = self.thermal_zone.rooftops[0].r1
1430 self.c1_rt = self.thermal_zone.rooftops[0].c1_korr
1431 elif len(self.thermal_zone.rooftops) > 1:
1432 # more than one outer wall, calculate chain matrix
1433 self.r1_rt, self.c1_rt = self._calc_parallel_connection(
1434 self.thermal_zone.rooftops, omega, mode='ow'
1435 )
1436 else:
1437 warnings.warn(
1438 "No walls are defined as ground floors, please be "
1439 "careful with results. In addition this might lead "
1440 "to RunTimeErrors"
1441 )
1442 try:
1443 conduction = 1 / sum(
1444 (1 / element.r_conduc) for element in self.thermal_zone.rooftops
1445 )
1447 self.r_rest_rt = conduction - self.r1_rt
1448 except RuntimeError:
1449 print("As no rooftops are defined lumped " "parameter cannot be calculated")
1451 def _calc_inner_elements(self):
1452 """Lumped parameter for inner wall elements
1454 Calculates all necessary parameters for inner walls. This includes
1455 InnerWalls, Ceilings and Floors.
1457 Attributes
1458 ----------
1459 omega : float [1/s]
1460 angular frequency with given time period.
1461 outer_walls : list
1462 List containing all TEASER Wall instances that are treated as same
1463 outer wall type. In case of TwoElement model OuterWalls,
1464 GroundFloors, Rooftops
1465 """
1467 omega = 2 * math.pi / 86400 / self.t_bt
1469 inner_walls = (
1470 self.thermal_zone.inner_walls
1471 + self.thermal_zone.floors
1472 + self.thermal_zone.ceilings
1473 )
1475 for in_wall in inner_walls:
1476 in_wall.calc_equivalent_res()
1477 in_wall.calc_ua_value()
1479 if 0 < len(inner_walls) <= 1:
1480 # only one inner wall, no need to calculate chain matrix
1481 self.r1_iw = inner_walls[0].r1
1482 self.c1_iw = inner_walls[0].c1_korr
1483 elif len(inner_walls) > 1:
1484 # more than one inner wall, calculate chain matrix
1485 self.r1_iw, self.c1_iw = self._calc_parallel_connection(
1486 inner_walls, omega, mode='iw'
1487 )
1488 else:
1489 warnings.warn(
1490 "No walls are defined as inner walls, please be "
1491 "careful with results. In addition this might lead "
1492 "to RunTimeErrors"
1493 )
1495 def _calc_interzonal_elements(self):
1496 """Lumped parameter for neighboured zone border elements
1498 Calculates lumped parameters for borders to
1499 neighboured zones. No windows allowed.
1501 Attributes
1502 ----------
1503 omega : float [1/s]
1504 angular frequency with given time period.
1505 """
1507 omega = 2 * math.pi / 86400 / self.t_bt
1509 any_nzb = False
1510 self.r1_nzb = []
1511 self.c1_nzb = []
1512 for nz_borders in self.nzbs_per_nz:
1513 if 0 < len(nz_borders) <= 1:
1514 # only one nz border, no need to calculate chain matrix
1515 self.c1_nzb.append(nz_borders[0].c1_korr)
1516 conduction = nz_borders[0].r_conduc
1517 if nz_borders[0].interzonal_type_export == 'outer_reversed':
1518 self.r_rest_nzb.append(nz_borders[0].r2)
1519 self.r1_nzb.append(conduction - self.r_rest_nzb[-1])
1520 else:
1521 self.r1_nzb.append(nz_borders[0].r1)
1522 self.r_rest_nzb.append(conduction - self.r1_nzb[-1])
1523 elif len(nz_borders) > 1:
1524 # more than one nz border, calculate chain matrix
1525 if nz_borders[0].interzonal_type_export == 'outer_reversed':
1526 parallel_mode = 'izw_backwards'
1527 else:
1528 parallel_mode = 'ow'
1529 r1_nzb, c1_nzb = self._calc_parallel_connection(
1530 nz_borders, omega, mode=parallel_mode
1531 )
1532 conduction = 1 / sum(1 / nzb.r_conduc for nzb in nz_borders)
1533 if nz_borders[0].interzonal_type_export == 'outer_reversed':
1534 self.r_rest_nzb.append(r1_nzb)
1535 self.r1_nzb.append(conduction - self.r_rest_nzb[-1])
1536 else:
1537 self.r1_nzb.append(r1_nzb)
1538 self.r_rest_nzb.append(conduction - self.r1_nzb[-1])
1539 self.c1_nzb.append(c1_nzb)
1541 def _calc_wf(self):
1542 """Weightfactors for outer elements(walls, roof, ground floor, windows)
1544 Calculates the weightfactors of outer walls, rooftops, including
1545 ground and windows.
1547 """
1549 self.weightfactor_ground = 0.0
1551 if self.merge_windows is True:
1553 for wall in self.thermal_zone.outer_walls:
1554 wall.wf_out = wall.ua_value / (self.ua_value_ow + self.ua_value_win)
1556 for win in self.thermal_zone.windows:
1557 win.wf_out = win.ua_value / (self.ua_value_ow + self.ua_value_win)
1559 for rt in self.thermal_zone.rooftops:
1560 rt.wf_out = rt.ua_value / self.ua_value_rt
1562 elif self.merge_windows is False:
1564 for wall in self.thermal_zone.outer_walls:
1565 wall.wf_out = wall.ua_value / self.ua_value_ow
1567 for win in self.thermal_zone.windows:
1568 win.wf_out = win.ua_value / self.ua_value_win
1570 for rt in self.thermal_zone.rooftops:
1571 rt.wf_out = rt.ua_value / self.ua_value_rt
1573 else:
1574 raise ValueError("specify merge window method correctly")
1576 def _calc_mean_values(self):
1577 """Calculates mean values for inner and outer elements
1579 This function calculates mean values inside the thermal zone (e.g.
1580 the mean value for coefficient of radiative heat transfer between
1581 inner and outer walls
1582 """
1584 self.alpha_rad_inner_mean = (
1585 self.area_ow * self.alpha_rad_inner_ow
1586 + self.area_win * self.alpha_rad_inner_win
1587 + self.area_gf * self.alpha_rad_inner_gf
1588 + self.area_rt * self.alpha_rad_inner_rt
1589 + np.dot(self.area_nzb, self.alpha_rad_inner_nzb)
1590 + self.area_iw * self.alpha_rad_inner_iw
1591 ) / (self.area_ow + self.area_win + self.area_iw + self.area_gf + self.area_rt)
1592 self.alpha_rad_outer_mean = (
1593 self.area_ow * self.alpha_rad_outer_ow
1594 + self.area_rt * self.alpha_rad_outer_rt
1595 + self.area_win * self.alpha_rad_outer_win
1596 ) / (self.area_ow + self.area_rt + self.area_win)
1598 def _calc_number_of_elements(self):
1599 """Calculates the number of facade elements with different tilt/orient
1601 This function calculates the number of outer elements with a
1602 different combination of orientation and tilt, this includes the
1603 outer walls, rooftops and windows.
1604 """
1606 outer_elements = self.thermal_zone.outer_walls + self.thermal_zone.windows
1608 tilt_orient = []
1609 for element in outer_elements:
1610 tilt_orient.append((element.orientation, element.tilt))
1611 self.n_outer = len(list(set(tilt_orient)))
1613 tilt_orient_rt = []
1614 for roof in self.thermal_zone.rooftops:
1615 tilt_orient_rt.append((roof.orientation, roof.tilt))
1616 self.n_rt = len(list(set(tilt_orient_rt)))
1618 def _fill_zone_lists(self):
1619 """Fills lists like weightfactors and tilt, orientation
1621 Fills the lists of a zone according to orientation and tilt of the
1622 zone. Therefore it compares orientation and tilt of all outer
1623 elements and then creates lists for zone weightfactors, orientation,
1624 tilt, ares and sunblinds."""
1626 outer_elements = self.thermal_zone.outer_walls + self.thermal_zone.windows
1628 tilt_orient = []
1629 for element in outer_elements:
1630 tilt_orient.append((element.orientation, element.tilt))
1631 tilt_orient = list(set(tilt_orient))
1633 for i in tilt_orient:
1634 walls = self.thermal_zone.find_walls(i[0], i[1])
1635 wins = self.thermal_zone.find_wins(i[0], i[1])
1637 if self.merge_windows is True:
1638 self.facade_areas.append(
1639 sum([element.area for element in (walls + wins)])
1640 )
1641 else:
1642 self.facade_areas.append(sum([element.area for element in (walls)]))
1644 self.orientation_facade.append(i[0])
1645 self.tilt_facade.append(i[1])
1647 if not walls:
1648 self.weightfactor_ow.append(0.0)
1649 self.outer_wall_areas.append(0.0)
1650 else:
1651 self.weightfactor_ow.append(sum([wall.wf_out for wall in walls]))
1652 self.outer_wall_areas.append(sum([wall.area for wall in walls]))
1654 if not wins:
1655 self.weightfactor_win.append(0.0)
1656 self.shading_g_total.append(1.0)
1657 self.window_areas.append(0.0)
1658 self.transparent_areas.append(0.0)
1659 self.shading_max_irr.append(9999.9)
1660 else:
1661 self.weightfactor_win.append(sum([win.wf_out for win in wins]))
1663 if self.merge_windows is False:
1664 self.window_areas.append(sum([win.area for win in wins]))
1665 self.transparent_areas.append(sum([win.area for win in wins]))
1667 else:
1668 self.window_areas.append(0)
1669 self.transparent_areas.append(sum([win.area for win in wins]))
1670 self.shading_g_total.append(
1671 sum(
1672 [
1673 win.shading_g_total * win.area / sum([w.area for w in wins])
1674 for win in wins
1675 ]
1676 )
1677 )
1678 self.shading_max_irr.append(
1679 sum(
1680 [
1681 win.shading_max_irr * win.area / sum([w.area for w in wins])
1682 for win in wins
1683 ]
1684 )
1685 )
1687 tilt_orient_rt = []
1688 for roof in self.thermal_zone.rooftops:
1689 tilt_orient_rt.append((roof.orientation, roof.tilt))
1690 tilt_orient_rt = list(set(tilt_orient_rt))
1692 for i in tilt_orient_rt:
1693 rts = self.thermal_zone.find_rts(i[0], i[1])
1695 self.orientation_rt.append(i[0])
1696 self.tilt_rt.append(i[1])
1697 self.weightfactor_win_rt.append(0)
1698 if not rts:
1699 self.weightfactor_rt.append(0.0)
1700 self.rooftop_areas.append(0.0)
1701 else:
1702 self.weightfactor_rt.append(sum([rt.wf_out for rt in rts]))
1703 self.rooftop_areas.append(sum([rt.area for rt in rts]))
1705 def _calc_heat_load(self):
1706 """Static heat load calculation
1708 This function calculates the static heat load of the thermal zone by
1709 multiplying the UA-Value of the elements with the given Temperature
1710 difference of t_inside and t_outside. And takes heat losses through
1711 infiltration into account.
1713 Attributes
1714 ----------
1715 ua_value_ow_temp : float [W/(m2*K)]
1716 UA Value without GroundFloors
1717 ua_value_gf_temp : float [W/(m2*K)]
1718 UA Value of all GroundFloors
1719 """
1720 self.heat_load = 0.0
1722 if self.thermal_zone.parent.parent.t_soil_mode == 2:
1723 t_ground = self.thermal_zone.t_ground \
1724 - self.thermal_zone.t_ground_amplitude
1725 else:
1726 t_ground = self.thermal_zone.t_ground
1728 ua_value_ow_temp = self.ua_value_rt + self.ua_value_ow
1730 ua_value_nzb_temp = 0.0
1731 if self.thermal_zone.use_conditions.with_heating:
1732 for other_zone_index, ua_value_izw in zip(self.other_nz_indexes,
1733 self.ua_value_nzb):
1734 if not self.thermal_zone.parent.thermal_zones[
1735 other_zone_index
1736 ].use_conditions.with_heating:
1737 ua_value_nzb_temp += ua_value_izw
1739 self.heat_load_outside_factor = (
1740 (ua_value_ow_temp + self.ua_value_win + ua_value_nzb_temp)
1741 + self.thermal_zone.volume
1742 * self.thermal_zone.use_conditions.infiltration_rate
1743 * 1
1744 / 3600
1745 * self.thermal_zone.heat_capac_air
1746 * self.thermal_zone.density_air
1747 )
1748 self.heat_load_ground_factor = self.ua_value_gf
1749 self.heat_load = \
1750 self.heat_load_outside_factor \
1751 * (self.thermal_zone.t_inside - self.thermal_zone.t_outside) \
1752 + self.heat_load_ground_factor \
1753 * (self.thermal_zone.t_inside - t_ground)
1755 def set_calc_default(self):
1756 """sets default calculation parameters
1757 """
1759 # Attributes of inner walls
1760 self.area_iw = 0.0
1762 # coefficient of heat transfer facing the inside of this thermal zone
1763 self.alpha_conv_inner_iw = 0.0
1764 self.alpha_rad_inner_iw = 0.0
1765 self.alpha_comb_inner_iw = 0.0
1766 # coefficient of heat transfer facing the adjacent thermal zone
1767 self.alpha_conv_outer_iw = 0.0
1768 self.alpha_rad_outer_iw = 0.0
1769 self.alpha_comb_outer_iw = 0.0
1771 # UA-Value
1772 self.ua_value_iw = 0.0
1774 # resistances for heat transfer facing the inside of this thermal zone
1775 self.r_conv_inner_iw = 0.0
1776 self.r_rad_inner_iw = 0.0
1777 self.r_comb_inner_iw = 0.0
1778 self.r_conv_outer_iw = 0.0
1779 self.r_rad_outer_iw = 0.0
1780 self.r_comb_outer_iw = 0.0
1782 # lumped resistance/capacity
1783 self.r1_iw = 0.0
1784 self.c1_iw = 0.0
1786 # Attributes for outer walls
1787 self.area_ow = 0.0
1789 # coefficient of heat transfer facing the inside of this thermal zone
1790 self.alpha_conv_inner_ow = 0.0
1791 self.alpha_rad_inner_ow = 0.0
1792 self.alpha_comb_inner_ow = 0.0
1794 # coefficient of heat transfer facing the ambient
1795 self.alpha_conv_outer_ow = 0.0
1796 self.alpha_rad_outer_ow = 0.0
1797 self.alpha_comb_outer_ow = 0.0
1799 # UA-Value
1800 self.ua_value_ow = 0.0
1802 # resistances for heat transfer facing the inside of this thermal zone
1803 self.r_conv_inner_ow = 0.0
1804 self.r_rad_inner_ow = 0.0
1805 self.r_comb_inner_ow = 0.0
1807 # resistances for heat transfer facing the ambient
1808 self.r_conv_outer_ow = 0.0
1809 self.r_rad_outer_ow = 0.0
1810 self.r_comb_outer_ow = 0.0
1812 # lumped resistances/capacity
1813 self.r1_ow = 0.0
1814 self.r_rest_ow = 0.0
1815 self.c1_ow = 0.0
1816 self.r_total_ow = 0.0
1818 # Optical properties
1819 self.ir_emissivity_outer_ow = 0.0
1820 self.ir_emissivity_inner_ow = 0.0
1821 self.solar_absorp_ow = 0.0
1823 # Additional attributes
1824 self.weightfactor_ow = []
1825 self.weightfactor_ground = 0.0
1826 self.outer_wall_areas = []
1828 # Attributes for GroundFloor
1829 self.area_gf = 0.0
1831 # coefficient of heat transfer facing the inside of this thermal zone
1832 self.alpha_conv_inner_gf = 0.0
1833 self.alpha_rad_inner_gf = 0.0
1834 self.alpha_comb_inner_gf = 0.0
1836 # UA-Value
1837 self.ua_value_gf = 0.0
1839 # resistances for heat transfer facing the inside of this thermal zone
1840 self.r_conv_inner_gf = 0.0
1841 self.r_rad_inner_gf = 0.0
1842 self.r_comb_inner_gf = 0.0
1844 # lumped resistances/capacity
1845 self.r1_gf = 0.0
1846 self.r_rest_gf = 0.0
1847 self.c1_gf = 0.0
1848 self.r_total_gf = 0.0
1850 # Optical properties
1851 self.ir_emissivity_inner_gf = 0.0
1853 # Additional attributes
1855 self.weightfactor_ground = 0.0
1857 # Attributes for rooftops
1858 self.area_rt = 0.0
1860 # coefficient of heat transfer facing the inside of this thermal zone
1861 self.alpha_conv_inner_rt = 0.0
1862 self.alpha_rad_inner_rt = 0.0
1863 self.alpha_comb_inner_rt = 0.0
1865 # coefficient of heat transfer facing the ambient
1866 self.alpha_conv_outer_rt = 0.0
1867 self.alpha_rad_outer_rt = 0.0
1868 self.alpha_comb_outer_rt = 0.0
1870 # UA-Value
1871 self.ua_value_rt = 0.0
1873 # resistances for heat transfer facing the inside of this thermal zone
1874 self.r_conv_inner_rt = 0.0
1875 self.r_rad_inner_rt = 0.0
1876 self.r_comb_inner_rt = 0.0
1878 # resistances for heat transfer facing the ambient
1879 self.r_conv_outer_rt = 0.0
1880 self.r_rad_outer_rt = 0.0
1881 self.r_comb_outer_rt = 0.0
1883 # lumped resistances/capacity
1884 self.r1_rt = 0.0
1885 self.r_rest_rt = 0.0
1886 self.c1_rt = 0.0
1887 self.r_total_rt = 0.0
1889 # Optical properties
1890 self.ir_emissivity_outer_rt = 0.0
1891 self.ir_emissivity_inner_rt = 0.0
1892 self.solar_absorp_rt = 0.0
1894 # Additional attributes
1895 self.weightfactor_rt = []
1896 self.rooftop_areas = []
1897 self.tilt_rt = []
1898 self.orientation_rt = []
1900 # TODO: check this value
1901 self.r_rad_rt_iw = 0.0
1903 # Attributes for windows
1904 self.area_win = 0.0
1906 # coefficient of heat transfer facing the inside of this thermal zone
1907 self.alpha_conv_inner_win = 0.0
1908 self.alpha_rad_inner_win = 0.0
1909 self.alpha_comb_inner_win = 0.0
1910 self.ratio_conv_rad_inner_win = 0.0
1912 # coefficient of heat transfer facing the ambient
1913 self.alpha_conv_outer_win = 0.0
1914 self.alpha_rad_outer_win = 0.0
1915 self.alpha_comb_outer_win = 0.0
1917 # UA-Value
1918 self.ua_value_win = 0.0
1919 self.u_value_win = 0.0
1921 # resistances for heat transfer facing the inside of this thermal zone
1922 self.r_conv_inner_win = 0.0
1923 self.r_rad_inner_win = 0.0
1924 self.r_comb_inner_win = 0.0
1926 # resistances for heat transfer facing the ambient
1927 self.r_conv_outer_win = 0.0
1928 self.r_rad_outer_win = 0.0
1929 self.r_comb_outer_win = 0.0
1931 # lumped resistances/capacity
1932 self.r1_win = 0.0
1934 # Optical properties
1935 self.ir_emissivity_win = 0.0
1936 self.solar_absorp_win = 0.0
1938 # Additional attributes
1939 self.weightfactor_win = []
1940 self.window_areas = []
1941 self.transparent_areas = []
1942 self.shading_g_total = []
1943 self.shading_max_irr = []
1944 self.weighted_g_value = 0.0
1946 # Attributes for neighboured zones (vectorized - one element per other
1947 # zone)
1948 self.area_nzb = []
1950 # coefficient of heat transfer facing the inside of this thermal zone
1951 self.alpha_conv_inner_nzb = []
1952 self.alpha_rad_inner_nzb = []
1953 self.alpha_comb_inner_nzb = []
1955 # coefficient of heat transfer facing the other thermal zone
1956 self.alpha_conv_outer_nzb = []
1957 self.alpha_rad_outer_nzb = []
1958 self.alpha_comb_outer_nzb = []
1960 # UA-Value
1961 self.ua_value_nzb = []
1963 # resistances for heat transfer facing the inside of this thermal zone
1964 self.r_conv_inner_nzb = []
1965 self.r_rad_inner_nzb = []
1966 self.r_comb_inner_nzb = []
1968 # resistances for heat transfer facing the ambient
1969 self.r_conv_outer_nzb = []
1970 self.r_rad_outer_nzb = []
1971 self.r_comb_outer_nzb = []
1973 # lumped resistances/capacity
1974 self.r1_nzb = []
1975 self.r_rest_nzb = []
1976 self.c1_nzb = []
1977 self.r_total_nzb = []
1979 # Optical properties
1980 self.ir_emissivity_outer_nzb = []
1981 self.ir_emissivity_inner_nzb = []
1983 # Additional parameters
1984 self.nz_index = []
1985 self.other_nz_indexes = []
1986 self.nzbs_per_nz = []
1988 # Misc values
1990 self.alpha_rad_inner_mean = 0.0
1991 self.n_outer = 0
1992 self.n_rt = 0
1993 self.facade_areas = []
1994 self.tilt_facade = []
1995 self.orientation_facade = []
1996 self.heat_load = 0.0
1997 self.cool_load = 0.0
1999 @property
2000 def nzbs_for_iw(self):
2001 """returns borders to neighboured zones to be considered as inner walls
2003 Returns
2004 -------
2005 value : list
2006 list of those interzonal elements that are to be treated as
2007 'inner' depending on their 'interzonal_type_export' attribute
2009 """
2010 elements = []
2011 for i in self.thermal_zone.interzonal_elements:
2012 if i.interzonal_type_export == 'inner':
2013 elements.append(i)
2014 else:
2015 pass
2016 return elements
2019def _lump_sum(elements, parameter):
2020 """calculates sums of the parameter of 2nd-level entries in a 2-level list
2022 Parameters
2023 ----------
2024 elements : list
2025 list of lists with building elements
2026 parameter : str
2027 parameter to lump
2029 Returns
2030 -------
2031 lumped_sum : list
2032 list of sums for each sub-list of elements
2033 """
2034 return [sum(eval('el.{}'.format(parameter)) for el in els)
2035 for els in elements]
2038def _lump_inverse_sum(elements, parameter):
2039 """inverse sums of the parameter of 2nd-level entries in a 2-level list
2041 Parameters
2042 ----------
2043 elements : list
2044 list of lists with building elements
2045 parameter : str
2046 parameter to lump
2048 Returns
2049 -------
2050 lumped_sum : list
2051 list of sums of inverse entries for each sub-list of elements
2052 """
2053 return [1 / sum(1 / eval('el.{}'.format(parameter)) for el in els)
2054 for els in elements]