Coverage for teaser/logic/buildingobjects/calculation/four_element.py: 96%

551 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2025-04-29 16:01 +0000

1# created January 2017 

2 

3from __future__ import division 

4import math 

5import random 

6import warnings 

7 

8 

9class FourElement(object): 

10 """This class contains attributes and functions for four element model 

11 

12 This model adds another element for the roof. Roofs commonly exhibit the 

13 same excitations as exterior walls but have different coefficients of heat 

14 transfer due to their orientation. Thus the model distinguishes 

15 between internal thermal masses and exterior walls divided into 

16 outerwalls (vertical), rooftops and ground plates. While all exterior walls 

17 contribute to heat transfer to the ambient, adiabatic 

18 conditions apply to interior walls. This approach allows considering the 

19 dynamic behaviour induced by internal heat storage. This class calculates 

20 and holds all attributes given in documentation. 

21 

22 It treats OuterWalls, Rooftops and GroundFloors separate resulting in three 

23 RC-combination for these. 

24 Depending on the chosen method it will consider an extra resistance for 

25 windows or merge all windows into the RC-Combination for outer walls. 

26 

27 Parameters 

28 ---------- 

29 thermal_zone: ThermalZone() 

30 TEASER instance of ThermalZone 

31 merge_windows : boolean 

32 True for merging windows into the outer wall's RC-combination, 

33 False for separate resistance for window, default is False. (Only 

34 supported for IBPSA) 

35 t_bt : float [d] 

36 Time constant according to VDI 6007 (default t_bt = 5) 

37 t_bt_layer : float [d] 

38 Time constant according to VDI 6007 for aggragation of layers (default t_bt = 7) 

39 

40 Attributes 

41 ---------- 

42 Interior Walls 

43 

44 area_iw : float [m2] 

45 Area of all interior walls. 

46 alpha_conv_inner_iw : float [W/(m2K)] 

47 Area-weighted convective coefficient of heat transfer of interior 

48 walls facing the inside of this thermal zone. 

49 alpha_rad_inner_iw : float [W/(m2K)] 

50 Area-weighted radiative coefficient of heat transfer of interior 

51 walls facing the inside of this thermal zone. 

52 alpha_comb_inner_iw : float [W/(m2K)] 

53 Area-weighted combined coefficient of heat transfer of interior walls 

54 facing the inside of this thermal zone. 

55 alpha_conv_outer_iw : float [W/(m2K)] 

56 Area-weighted convective coefficient of heat transfer of interior 

57 walls facing the adjacent thermal zone. (Currently not supported) 

58 alpha_rad_outer_iw : float [W/(m2K)] 

59 Area-weighted radiative coefficient of heat transfer of interior 

60 walls facing the adjacent thermal zone. (Currently not supported) 

61 alpha_comb_outer_iw : float [W/(m2K)] 

62 Area-weighted combined coefficient of heat transfer of interior walls 

63 facing the adjacent thermal zone. (Currently not supported) 

64 ua_value_iw : float [W/K] 

65 U-Value times interior wall area. (Does not take adjacent thermal 

66 zones into account) 

67 r_conv_inner_iw : float [K/W] 

68 Sum of convective resistances for all interior walls 

69 facing the inside of this thermal zone. 

70 r_rad_inner_iw : float [K/W] 

71 Sum of radiative resistances for all interior walls facing the 

72 inside of this thermal zone 

73 r_comb_inner_iw : float [K/W] 

74 Sum of combined resistances for all interior walls facing the 

75 inside of this thermal zone 

76 r1_iw : float [K/W] 

77 Lumped resistance of interior walls no heat transfer coefficients for 

78 convection and radiation are accounted in this resistance. 

79 c1_iw : float [J/K] 

80 Lumped capacity of interior walls 

81 

82 Outer Walls 

83 

84 area_ow : float [m2] 

85 Area of all outer walls . 

86 alpha_conv_inner_ow : float [W/(m2K)] 

87 Area-weighted convective coefficient of heat transfer of outer walls 

88 facing the inside of this thermal zone . 

89 alpha_rad_inner_ow : float [W/(m2K)] 

90 Area-weighted radiative coefficient of heat transfer of outer walls 

91 facing the inside of this thermal zone . 

92 alpha_comb_inner_ow : float [W/(m2K)] 

93 Area-weighted combined coefficient of heat transfer of outer walls 

94 facing the inside of this thermal zone . 

95 alpha_conv_outer_ow : float [W/(m2K)] 

96 Area-weighted convective coefficient of heat transfer of outer walls 

97 facing the ambient. 

98 alpha_rad_outer_ow : float [W/(m2K)] 

99 Area-weighted radiative coefficient of heat transfer of outer walls 

100 facing the ambient . 

101 alpha_comb_outer_ow : float [W/(m2K)] 

102 Area-weighted combined coefficient of heat transfer of outer walls 

103 facing the ambient. 

104 ua_value_ow : float [W/K] 

105 U-Value times outer wall area. 

106 r_conv_inner_ow : float [K/W] 

107 Sum of convective resistances for all outer walls facing the 

108 inside of this thermal zone . 

109 r_rad_inner_ow : float [K/W] 

110 Sum of radiative resistances for all outer walls facing the 

111 inside of this thermal zone . 

112 r_comb_inner_ow : float [K/W] 

113 Sum of combined resistances for all outer walls facing the 

114 inside of this thermal zone. 

115 r_conv_outer_ow : float [K/W] 

116 Sum of convective resistances for all outer walls facing the 

117 ambient. 

118 r_rad_outer_ow : float [K/W] 

119 Sum of radiative resistances for all outer walls facing the 

120 ambient. 

121 r_comb_outer_ow : float [K/W] 

122 Sum of combined resistances for all outer walls facing the 

123 ambient. 

124 r1_ow : float [K/W] 

125 Lumped resistance of outer walls no heat transfer coefficients for 

126 convection and radiation are accounted in this resistance. 

127 r_rest_ow : float [K/W] 

128 Lumped remaining resistance of outer walls between r1_ow and c1_ow no 

129 heat transfer coefficients for convection and radiation are accounted 

130 in this resistance. 

131 c1_ow : float [J/K] 

132 Lumped capacity of outer walls . 

133 weightfactor_ow : list of floats 

134 Weightfactors of outer walls (UA-Value of walls with same orientation 

135 and tilt divided by ua_value_ow) 

136 outer_wall_areas : list of floats [m2] 

137 Area of all outer walls in one list. 

138 ir_emissivity_outer_ow : float 

139 Area-weighted ir emissivity of outer wall facing the ambient. 

140 ir_emissivity_inner_ow : float 

141 Area-weighted ir emissivity of outer walls facing the thermal zone. 

142 solar_absorp_ow : float 

143 Area-weighted solar absorption of outer walls facing the ambient. 

144 

145 Ground Floors 

146 

147 area_gf : float [m2] 

148 Area of all ground floors. 

149 alpha_conv_inner_gf : float [W/(m2K)] 

150 Area-weighted convective coefficient of heat transfer of ground floors 

151 facing the inside of this thermal zone. 

152 alpha_rad_inner_gf : float [W/(m2K)] 

153 Area-weighted radiative coefficient of heat transfer of ground floors 

154 facing the inside of this thermal zone. 

155 alpha_comb_inner_gf : float [W/(m2K)] 

156 Area-weighted combined coefficient of heat transfer of ground floors 

157 facing the inside of this thermal zone. 

158 ua_value_gf : float [W/K] 

159 U-Value times ground floor area. 

160 r_conv_inner_gf : float [K/W] 

161 Sum of convective resistances for all ground floors facing the 

162 inside of this thermal zone. 

163 r_rad_inner_gf : float [K/W] 

164 Sum of radiative resistances for all ground floors facing the 

165 inside of this thermal zone. 

166 r_comb_inner_gf : float [K/W] 

167 Sum of combined resistances for all ground floors facing the 

168 inside of this thermal zone. 

169 r1_gf : float [K/W] 

170 Lumped resistance of ground floors no heat transfer coefficients for 

171 convection and radiation are accounted in this resistance. 

172 r_rest_gf : float [K/W] 

173 Lumped remaining resistance of ground floors between r1_gf and c1_gf no 

174 heat transfer coefficients for convection and radiation are accounted 

175 in this resistance. 

176 c1_gf : float [J/K] 

177 Lumped capacity of ground floors. 

178 weightfactor_gf : float 

179 Weightfactor of ground floors (UA-Value of walls with same orientation 

180 and tilt divided by ua_value_gf) 

181 ground_floor_area : float [m2] 

182 Area of all ground floors. 

183 r_rad_gf_iw : float [K/W] 

184 Resistance for radiative heat transfer between walls. 

185 TODO: needs to be checked 

186 ir_emissivity_inner_gf : float 

187 Area-weighted ir emissivity of ground floors facing the thermal zone. 

188 

189 Rooftops 

190 

191 area_rt : float [m2] 

192 Area of all rooftops . 

193 alpha_conv_inner_rt : float [W/(m2K)] 

194 Area-weighted convective coefficient of heat transfer of rooftops 

195 facing the inside of this thermal zone . 

196 alpha_rad_inner_rt : float [W/(m2K)] 

197 Area-weighted radiative coefficient of heat transfer of rooftops 

198 facing the inside of this thermal zone . 

199 alpha_comb_inner_rt : float [W/(m2K)] 

200 Area-weighted combined coefficient of heat transfer of rooftops 

201 facing the inside of this thermal zone . 

202 alpha_conv_outer_rt : float [W/(m2K)] 

203 Area-weighted convective coefficient of heat transfer of rooftops 

204 facing the ambient. 

205 alpha_rad_outer_rt : float [W/(m2K)] 

206 Area-weighted radiative coefficient of heat transfer of rooftops 

207 facing the ambient . 

208 alpha_comb_outer_rt : float [W/(m2K)] 

209 Area-weighted combined coefficient of heat transfer of rooftops 

210 facing the ambient. 

211 ua_value_rt : float [W/K] 

212 U-Value times outer wall area. 

213 r_conv_inner_rt : float [K/W] 

214 Sum of convective resistances for all rooftops facing the 

215 inside of this thermal zone . 

216 r_rad_inner_rt : float [K/W] 

217 Sum of radiative resistances for all rooftops facing the 

218 inside of this thermal zone . 

219 r_comb_inner_rt : float [K/W] 

220 Sum of combined resistances for all rooftops facing the 

221 inside of this thermal zone. 

222 r_conv_outer_rt : float [K/W] 

223 Sum of convective resistances for all rooftops facing the 

224 ambient. 

225 r_rad_outer_rt : float [K/W] 

226 Sum of radiative resistances for all rooftops facing the 

227 ambient. 

228 r_comb_outer_rt : float [K/W] 

229 Sum of combined resistances for all rooftops facing the 

230 ambient. 

231 r1_rt : float [K/W] 

232 Lumped resistance of rooftops no heat transfer coefficients for 

233 convection and radiation are accounted in this resistance. 

234 r_rest_rt : float [K/W] 

235 Lumped remaining resistance of rooftops between r1_rt and c1_rt no 

236 heat transfer coefficients for convection and radiation are accounted 

237 in this resistance. 

238 c1_rt : float [J/K] 

239 Lumped capacity of rooftops . 

240 weightfactor_rt : list of floats 

241 Weightfactors of rooftops (UA-Value of walls with same orientation 

242 and tilt divided by ua_value_rt) 

243 weightfactor_win_rt : list of floats 

244 Weightfactors of windows in rooftop. CAUTION: this will be always a 

245 list full of zeors, as windows are always calculated separatly. 

246 outer_wall_areas : list of floats [m2] 

247 Area of all rooftops in one list. 

248 r_rad_rt_iw : float [K/W] 

249 Resistance for radiative heat transfer between walls. 

250 TODO: needs to be checked 

251 ir_emissivity_outer_rt : float 

252 Area-weighted ir emissivity of outer wall facing the ambient. 

253 ir_emissivity_inner_rt : float 

254 Area-weighted ir emissivity of rooftops facing the thermal zone. 

255 solar_absorp_rt : float 

256 Area-weighted solar absorption of rooftops facing the ambient. 

257 tilt_rt : list of floats [degree] 

258 Tilt of rooftops against the horizontal. 

259 orientation_rt : list of floats [degree] 

260 Orientation of rooftops (Azimuth). 

261 0 - North 

262 90 - East 

263 180 - South 

264 270 - West 

265 

266 Windows 

267 

268 area_win : float [m2] 

269 Area of all windows. 

270 alpha_conv_inner_win : float [W/(m2K)] 

271 Area-weighted convective coefficient of heat transfer of windows 

272 facing the inside of this thermal zone. 

273 alpha_rad_inner_win : float [W/(m2K)] 

274 Area-weighted radiative coefficient of heat transfer of windows 

275 facing the inside of this thermal zone. 

276 alpha_comb_inner_win : float [W/(m2K)] 

277 Area-weighted combined coefficient of heat transfer of windows facing 

278 the inside of this thermal zone. 

279 ratio_conv_rad_inner_win : float [-] 

280 Ratio for windows between convective and radiative heat emission, 

281 given in VDI 6007-3 

282 alpha_conv_outer_win : float [W/(m2K)] 

283 Area-weighted convective coefficient of heat transfer of windows 

284 facing the ambient. 

285 alpha_rad_outer_win : float [W/(m2K)] 

286 Area-weighted radiative coefficient of heat transfer of windows 

287 facing the ambient. 

288 alpha_comb_outer_win : float [W/(m2K)] 

289 Area-weighted combined coefficient of heat transfer of windows facing 

290 the ambient. 

291 ua_value_win : float [W/K] 

292 U-Value times outer wall area. 

293 u_value_win : float [W/(m2K)] 

294 Area weighted U-Value of windows. 

295 r_conv_inner_win : float [K/W] 

296 Sum of convective resistances for all windows facing the 

297 inside of this thermal zone. 

298 r_rad_inner_win : float [K/W] 

299 Sum of radiative resistances for all windows facing the 

300 inside of this thermal zone. 

301 r_comb_inner_win : float [K/W] 

302 Sum of combined resistances for all windows facing the 

303 inside of this thermal zone. 

304 r_conv_outer_win : float [K/W] 

305 Sum of convective resistances for all windows facing the 

306 ambient. 

307 r_rad_outer_win : float [K/W] 

308 Sum of radiative resistances for all windows facing the 

309 ambient. 

310 r_comb_outer_win : float [K/W] 

311 Sum of combined resistances for all windows facing the 

312 ambient. 

313 r1_win : float [K/W] 

314 Lumped resistance of windows, no heat transfer coefficients for 

315 convection and radiation are accounted in this resistance. 

316 weightfactor_win : list of floats 

317 Weightfactors of windows (UA-Value of windows with same orientation 

318 and tilt divided by ua_value_win or ua_value_win+ua_value_ow, 

319 depending if windows is lumped/merged into the walls or not) 

320 window_areas : list of floats [m2] 

321 Area of all windows in one list, if the windows are merged into the 

322 outer wall this list will be full of zeros 

323 transparent_areas : list of floats [m2] 

324 Area of all transparent elements (most likely windows) in one list, 

325 this list will be always filled with the areas, independent if 

326 windows are merged into walls or not. 

327 solar_absorp_win : float 

328 Area-weighted solar absorption for windows. (typically 0.0) 

329 ir_emissivity_win : float 

330 Area-weighted ir_emissivity for windows. Can be used for windows 

331 facing the thermal zone and the ambient. 

332 weighted_g_value : float 

333 Area-weighted g-Value of all windows. 

334 shading_max_irr : list of float [W/m2] 

335 Threshold value above which the sunblind becomes active for the whole zone. 

336 Threshold regards to the incoming irradiation level with the window direction. 

337 This value does not account for heat flux due to the outside temperature. 

338 shading_g_total : list of float 

339 Factor representing how much of the actual solar irradiation goes through 

340 the sunblind and enters the window element, for the case, that the sunblind is 

341 activated. Defaults to 1, i.e. no shading is active. 

342 

343 Misc values: 

344 

345 alpha_rad_inner_mean : float [W/(m2K)] 

346 Area-weighted radiative coefficient of all surfaces facing the 

347 inside of this thermal zone (OuterWalls, Windows, InnerWalls, ...). 

348 alpha_rad_outer_mean : float [W/(m2K)] 

349 Area-weighted radiative coefficient of all surfaces facing the 

350 ambient (OuterWalls, Windows, ...). 

351 heat_load : [W] 

352 Static heat load of the thermal zone. 

353 heat_load_outside_factor : float [W/K] 

354 Factor needed for recalculation of the heat load of the thermal zone. 

355 This can be used to recalculate the thermalzones heat load inside 

356 Modelica export for parametric studies. This works only together with 

357 heat_load_ground_factor. 

358 

359 heat_load = heat_load_outside_factor * (t_inside - t_outside) + 

360 heat_load_ground_factor * (t_inside - t_ground). 

361 heat_load_ground_factor : float [W/K] 

362 Factor needed for recalculation of the heat load of the thermal zone. 

363 This can be used to recalculate the thermalzones heat load inside 

364 Modelica export for parametric studies. See heat_load_outside_factor. 

365 facade_areas : list of floats [m2] 

366 List containing the area of each facade (with same tilt and 

367 orientation) this includes also roofs and ground floors and windows. 

368 n_outer : int 

369 Number of total facades with different combination of tilt and 

370 orientation, windows and outer walls 

371 n_rt : int 

372 Number of total facades with different combination of tilt and 

373 orientation, Rooftops 

374 tilt_facade : list of floats [degree] 

375 Tilt of facades against the horizontal. 

376 orientation_facade : list of floats [degree] 

377 Orientation of facades (Azimuth). 

378 0 - North 

379 90 - East 

380 180 - South 

381 270 - West 

382 

383 """ 

384 

385 def __init__(self, thermal_zone, merge_windows, t_bt, t_bt_layer=7): 

386 """Constructor for FourElement""" 

387 

388 self.internal_id = random.random() 

389 

390 self.thermal_zone = thermal_zone 

391 self.merge_windows = merge_windows 

392 self.t_bt = t_bt 

393 self.t_bt_layer = t_bt_layer 

394 

395 # Attributes of inner walls 

396 self.area_iw = 0.0 

397 

398 # coefficient of heat transfer facing the inside of this thermal zone 

399 self.alpha_conv_inner_iw = 0.0 

400 self.alpha_rad_inner_iw = 0.0 

401 self.alpha_comb_inner_iw = 0.0 

402 # coefficient of heat transfer facing the adjacent thermal zone 

403 self.alpha_conv_outer_iw = 0.0 

404 self.alpha_rad_outer_iw = 0.0 

405 self.alpha_comb_outer_iw = 0.0 

406 

407 # UA-Value 

408 self.ua_value_iw = 0.0 

409 

410 # resistances for heat transfer facing the inside of this thermal zone 

411 self.r_conv_inner_iw = 0.0 

412 self.r_rad_inner_iw = 0.0 

413 self.r_comb_inner_iw = 0.0 

414 self.r_conv_outer_iw = 0.0 

415 self.r_rad_outer_iw = 0.0 

416 self.r_comb_outer_iw = 0.0 

417 

418 # lumped resistance/capacity 

419 self.r1_iw = 0.0 

420 self.c1_iw = 0.0 

421 

422 # Attributes for outer walls 

423 self.area_ow = 0.0 

424 

425 # coefficient of heat transfer facing the inside of this thermal zone 

426 self.alpha_conv_inner_ow = 0.0 

427 self.alpha_rad_inner_ow = 0.0 

428 self.alpha_comb_inner_ow = 0.0 

429 

430 # coefficient of heat transfer facing the ambient 

431 self.alpha_conv_outer_ow = 0.0 

432 self.alpha_rad_outer_ow = 0.0 

433 self.alpha_comb_outer_ow = 0.0 

434 

435 # UA-Value 

436 self.ua_value_ow = 0.0 

437 

438 # resistances for heat transfer facing the inside of this thermal zone 

439 self.r_conv_inner_ow = 0.0 

440 self.r_rad_inner_ow = 0.0 

441 self.r_comb_inner_ow = 0.0 

442 

443 # resistances for heat transfer facing the ambient 

444 self.r_conv_outer_ow = 0.0 

445 self.r_rad_outer_ow = 0.0 

446 self.r_comb_outer_ow = 0.0 

447 

448 # lumped resistances/capacity 

449 self.r1_ow = 0.0 

450 self.r_rest_ow = 0.0 

451 self.c1_ow = 0.0 

452 self.r_total_ow = 0.0 

453 

454 # Optical properties 

455 self.ir_emissivity_outer_ow = 0.0 

456 self.ir_emissivity_inner_ow = 0.0 

457 self.solar_absorp_ow = 0.0 

458 

459 # Additional attributes 

460 self.weightfactor_ow = [] 

461 self.weightfactor_ground = 0.0 

462 self.outer_wall_areas = [] 

463 

464 # Attributes for GroundFloor 

465 self.area_gf = 0.0 

466 

467 # coefficient of heat transfer facing the inside of this thermal zone 

468 self.alpha_conv_inner_gf = 0.0 

469 self.alpha_rad_inner_gf = 0.0 

470 self.alpha_comb_inner_gf = 0.0 

471 

472 # UA-Value 

473 self.ua_value_gf = 0.0 

474 

475 # resistances for heat transfer facing the inside of this thermal zone 

476 self.r_conv_inner_gf = 0.0 

477 self.r_rad_inner_gf = 0.0 

478 self.r_comb_inner_gf = 0.0 

479 

480 # lumped resistances/capacity 

481 self.r1_gf = 0.0 

482 self.r_rest_gf = 0.0 

483 self.c1_gf = 0.0 

484 self.r_total_gf = 0.0 

485 

486 # Optical properties 

487 self.ir_emissivity_inner_gf = 0.0 

488 

489 # Additional attributes 

490 

491 self.weightfactor_ground = 0.0 

492 

493 # Attributes for rooftops 

494 self.area_rt = 0.0 

495 

496 # coefficient of heat transfer facing the inside of this thermal zone 

497 self.alpha_conv_inner_rt = 0.0 

498 self.alpha_rad_inner_rt = 0.0 

499 self.alpha_comb_inner_rt = 0.0 

500 

501 # coefficient of heat transfer facing the ambient 

502 self.alpha_conv_outer_rt = 0.0 

503 self.alpha_rad_outer_rt = 0.0 

504 self.alpha_comb_outer_rt = 0.0 

505 

506 # UA-Value 

507 self.ua_value_rt = 0.0 

508 

509 # resistances for heat transfer facing the inside of this thermal zone 

510 self.r_conv_inner_rt = 0.0 

511 self.r_rad_inner_rt = 0.0 

512 self.r_comb_inner_rt = 0.0 

513 

514 # resistances for heat transfer facing the ambient 

515 self.r_conv_outer_rt = 0.0 

516 self.r_rad_outer_rt = 0.0 

517 self.r_comb_outer_rt = 0.0 

518 

519 # lumped resistances/capacity 

520 self.r1_rt = 0.0 

521 self.r_rest_rt = 0.0 

522 self.c1_rt = 0.0 

523 self.r_total_rt = 0.0 

524 

525 # Optical properties 

526 self.ir_emissivity_outer_rt = 0.0 

527 self.ir_emissivity_inner_rt = 0.0 

528 self.solar_absorp_rt = 0.0 

529 

530 # Additional attributes 

531 self.weightfactor_rt = [] 

532 self.weightfactor_win_rt = [] 

533 self.rooftop_areas = [] 

534 self.tilt_rt = [] 

535 self.orientation_rt = [] 

536 

537 # TODO: check this value 

538 self.r_rad_rt_iw = 0.0 

539 

540 # Attributes for windows 

541 self.area_win = 0.0 

542 

543 # coefficient of heat transfer facing the inside of this thermal zone 

544 self.alpha_conv_inner_win = 0.0 

545 self.alpha_rad_inner_win = 0.0 

546 self.alpha_comb_inner_win = 0.0 

547 self.ratio_conv_rad_inner_win = 0.0 

548 

549 # coefficient of heat transfer facing the ambient 

550 self.alpha_conv_outer_win = 0.0 

551 self.alpha_rad_outer_win = 0.0 

552 self.alpha_comb_outer_win = 0.0 

553 

554 # UA-Value 

555 self.ua_value_win = 0.0 

556 self.u_value_win = 0.0 

557 

558 # resistances for heat transfer facing the inside of this thermal zone 

559 self.r_conv_inner_win = 0.0 

560 self.r_rad_inner_win = 0.0 

561 self.r_comb_inner_win = 0.0 

562 

563 # resistances for heat transfer facing the ambient 

564 self.r_conv_outer_win = 0.0 

565 self.r_rad_outer_win = 0.0 

566 self.r_comb_outer_win = 0.0 

567 

568 # lumped resistances/capacity 

569 self.r1_win = 0.0 

570 

571 # Optical properties 

572 self.ir_emissivity_win = 0.0 

573 self.ir_emissivity_inner_win = 0.0 

574 self.solar_absorp_win = 0.0 

575 

576 # Additional attributes 

577 self.weightfactor_win = [] 

578 self.window_areas = [] 

579 self.transparent_areas = [] 

580 self.shading_g_total = [] 

581 self.shading_max_irr = [] 

582 self.weighted_g_value = 0.0 

583 

584 # Misc values 

585 

586 self.alpha_rad_inner_mean = 0.0 

587 self.alpha_rad_outer_mean = 0.0 

588 self.n_outer = 0 

589 self.n_rt = 0 

590 self.facade_areas = [] 

591 self.tilt_facade = [] 

592 self.orientation_facade = [] 

593 self.heat_load = 0.0 

594 self.cool_load = 0.0 

595 self.heat_load_outside_factor = 0.0 

596 self.heat_load_ground_factor = 0.0 

597 

598 def calc_attributes(self): 

599 """Calls all necessary function to calculate model attributes""" 

600 for out_wall in self.thermal_zone.outer_walls + self.thermal_zone.find_izes_outer(): 

601 out_wall.calc_equivalent_res(t_bt=self.t_bt_layer) 

602 out_wall.calc_ua_value() 

603 for rt in self.thermal_zone.rooftops: 

604 rt.calc_equivalent_res(t_bt=self.t_bt_layer) 

605 rt.calc_ua_value() 

606 for gf in self.thermal_zone.ground_floors: 

607 gf.calc_equivalent_res(t_bt=self.t_bt_layer) 

608 gf.calc_ua_value() 

609 for win in self.thermal_zone.windows: 

610 win.calc_equivalent_res() 

611 win.calc_ua_value() 

612 for inner_wall in ( 

613 self.thermal_zone.inner_walls 

614 + self.thermal_zone.floors 

615 + self.thermal_zone.ceilings 

616 + self.nzbs_for_iw 

617 ): 

618 inner_wall.calc_equivalent_res() 

619 inner_wall.calc_ua_value() 

620 

621 self.set_calc_default() 

622 if len(self.thermal_zone.outer_walls + self.thermal_zone.find_izes_outer()) < 1: 

623 warnings.warn( 

624 "No walls are defined as outer walls for thermal " 

625 + "zone " 

626 + self.thermal_zone.name 

627 + " in building " 

628 + self.thermal_zone.parent.name 

629 + ", please be careful with results. In addition " 

630 + "this might lead to RunTimeErrors" 

631 ) 

632 else: 

633 self._sum_outer_wall_elements() 

634 if ( 

635 len( 

636 self.thermal_zone.inner_walls 

637 + self.thermal_zone.floors 

638 + self.thermal_zone.ceilings 

639 + self.nzbs_for_iw 

640 ) 

641 < 1 

642 ): 

643 warnings.warn( 

644 "For thermal zone " 

645 + self.thermal_zone.name 

646 + " in building " 

647 + self.thermal_zone.parent.name 

648 + ", no inner walls have been defined." 

649 ) 

650 else: 

651 self._sum_inner_wall_elements() 

652 self._calc_inner_elements() 

653 if len(self.thermal_zone.windows) < 1: 

654 warnings.warn( 

655 "For thermal zone " 

656 + self.thermal_zone.name 

657 + " in building " 

658 + self.thermal_zone.parent.name 

659 + ", no windows have been defined." 

660 ) 

661 else: 

662 self._sum_window_elements() 

663 if len(self.thermal_zone.ground_floors) < 1: 

664 warnings.warn( 

665 "For thermal zone " 

666 + self.thermal_zone.name 

667 + " in building " 

668 + self.thermal_zone.parent.name 

669 + ", no ground floors have been defined." 

670 ) 

671 else: 

672 self._sum_ground_floor_elements() 

673 self._calc_ground_floor_elements() 

674 if len(self.thermal_zone.rooftops) < 1: 

675 warnings.warn( 

676 "For thermal zone " 

677 + self.thermal_zone.name 

678 + " in building " 

679 + self.thermal_zone.parent.name 

680 + ", no rooftops have been defined." 

681 ) 

682 else: 

683 self._sum_rooftop_elements() 

684 self._calc_rooftop_elements() 

685 if ( 

686 len(self.thermal_zone.outer_walls) >= 1 

687 or len(self.thermal_zone.windows) >= 1 

688 or len(self.thermal_zone.find_izes_outer()) >= 1 

689 ): 

690 self._calc_outer_elements() 

691 self._calc_wf() 

692 self._calc_mean_values() 

693 if len(self.thermal_zone.interzonal_elements) >= 1: 

694 warnings.warn( 

695 "For thermal zone " 

696 + self.thermal_zone.name 

697 + " in building " 

698 + self.thermal_zone.parent.name 

699 + ", interzonal elements have been defined. FourElement export " 

700 + "will treat them as outer walls or inner walls depending on " 

701 + "the project parameter 'method_interzonal_export'. Consider " 

702 + "using FiveElement instead." 

703 ) 

704 self._calc_number_of_elements() 

705 self._fill_zone_lists() 

706 self._calc_heat_load() 

707 self.cool_load = -self.heat_load 

708 

709 return True 

710 

711 @staticmethod 

712 def _calc_parallel_connection(element_list, omega, mode='iw'): 

713 """Parallel connection of walls according to VDI 6007 

714 

715 Calculates the parallel connection of wall elements according to VDI 

716 6007, resulting in R1 and C1 (equation 23, 24). 

717 

718 Parameters 

719 ---------- 

720 element_list : list 

721 List of inner or outer walls 

722 omega : float 

723 VDI 6007 frequency 

724 mode : str 

725 'ow' uses r1 and c1_korr 

726 'iw' uses r1 and c1 (function falls back here for other strings) 

727 

728 Returns 

729 ------- 

730 r1 : float [K/W] 

731 VDI 6007 resistance for all inner or outer walls 

732 c1 : float [K/W] 

733 VDI 6007 capacity all for inner or outer walls 

734 """ 

735 

736 for wall_count in range(len(element_list) - 1): 

737 

738 if wall_count == 0: 

739 r1_before = element_list[wall_count].r1 

740 if mode == 'ow': 

741 c1_before = element_list[wall_count].c1_korr 

742 else: 

743 c1_before = element_list[wall_count].c1 

744 else: 

745 r1_before = r1 

746 c1_before = c1 

747 r1_add = element_list[wall_count + 1].r1 

748 if mode == 'ow': 

749 c1_add = element_list[wall_count + 1].c1_korr 

750 else: 

751 c1_add = element_list[wall_count + 1].c1 

752 

753 r1 = ( 

754 r1_before * c1_before ** 2 + r1_add * c1_add ** 2 

755 + omega ** 2 * r1_before * r1_add * (r1_before + r1_add) 

756 * c1_before ** 2 * c1_add ** 2 

757 ) / ( 

758 (c1_before + c1_add) ** 2 

759 + omega ** 2 * (r1_before + r1_add) ** 2 * c1_before ** 2 

760 * c1_add ** 2 

761 ) 

762 

763 c1 = ( 

764 (c1_before + c1_add) ** 2 

765 + omega ** 2 * (r1_before + r1_add) ** 2 * c1_before ** 2 

766 * c1_add ** 2 

767 ) / ( 

768 c1_before + c1_add 

769 + omega ** 2 

770 * (r1_before ** 2 * c1_before + r1_add ** 2 * c1_add) 

771 * c1_before * c1_add 

772 ) 

773 

774 return r1, c1 

775 

776 def _sum_outer_wall_elements(self): 

777 """Sum attributes for outer wall elements 

778 

779 This function sums and computes the area-weighted values, 

780 where necessary for coefficients of heat 

781 transfer, resistances, areas and UA-Values. 

782 

783 For FourElement model it treats outer walls and zone borders to 

784 neighboured zones (if this zone is heated) 

785 as one kind of wall type. 

786 

787 """ 

788 

789 outer_walls = self.thermal_zone.outer_walls + self.thermal_zone.find_izes_outer() 

790 

791 self.area_ow = sum(out_wall.area for out_wall in outer_walls) 

792 

793 self.ua_value_ow = sum( 

794 out_wall.ua_value for out_wall in outer_walls 

795 ) 

796 

797 self.r_total_ow = 1 / self.ua_value_ow 

798 

799 # values facing the inside of the thermal zone 

800 

801 self.r_conv_inner_ow = 1 / ( 

802 sum(1 / out_wall.r_inner_conv for out_wall in outer_walls) 

803 ) 

804 

805 self.r_rad_inner_ow = 1 / ( 

806 sum(1 / out_wall.r_inner_rad for out_wall in outer_walls) 

807 ) 

808 

809 self.r_comb_inner_ow = 1 / ( 

810 sum(1 / out_wall.r_inner_comb for out_wall in outer_walls) 

811 ) 

812 

813 self.ir_emissivity_inner_ow = ( 

814 sum( 

815 out_wall.layer[0].material.ir_emissivity * out_wall.area 

816 for out_wall in outer_walls 

817 ) 

818 ) / self.area_ow 

819 

820 self.alpha_conv_inner_ow = 1 / (self.r_conv_inner_ow * self.area_ow) 

821 self.alpha_rad_inner_ow = 1 / (self.r_rad_inner_ow * self.area_ow) 

822 self.alpha_comb_inner_ow = 1 / (self.r_comb_inner_ow * self.area_ow) 

823 

824 # values facing the ambient 

825 # ground floor does not have any coefficients on ambient side 

826 

827 self.r_conv_outer_ow = 1 / ( 

828 sum(1 / out_wall.r_outer_conv for out_wall in outer_walls) 

829 ) 

830 self.r_rad_outer_ow = 1 / ( 

831 sum(1 / out_wall.r_outer_rad for out_wall in outer_walls) 

832 ) 

833 self.r_comb_outer_ow = 1 / ( 

834 sum(1 / out_wall.r_outer_comb for out_wall in outer_walls) 

835 ) 

836 

837 self.ir_emissivity_outer_ow = ( 

838 ( 

839 sum( 

840 out_wall.layer[-1].material.ir_emissivity * out_wall.area 

841 for out_wall in outer_walls 

842 ) 

843 ) 

844 ) / self.area_ow 

845 

846 self.solar_absorp_ow = ( 

847 ( 

848 sum( 

849 out_wall.layer[-1].material.solar_absorp * out_wall.area 

850 for out_wall in outer_walls 

851 ) 

852 ) 

853 ) / self.area_ow 

854 

855 self.alpha_conv_outer_ow = 1 / (self.r_conv_outer_ow * self.area_ow) 

856 self.alpha_rad_outer_ow = 1 / (self.r_rad_outer_ow * self.area_ow) 

857 self.alpha_comb_outer_ow = 1 / (self.r_comb_outer_ow * self.area_ow) 

858 

859 def _sum_ground_floor_elements(self): 

860 """Sum attributes for ground floor elements 

861 

862 This function sums and computes the area-weighted values, 

863 where necessary (the class doc string) for coefficients of heat 

864 transfer, resistances, areas and UA-Values. 

865 

866 """ 

867 

868 self.area_gf = sum(ground.area for ground in self.thermal_zone.ground_floors) 

869 

870 self.ua_value_gf = sum( 

871 ground.ua_value for ground in self.thermal_zone.ground_floors 

872 ) 

873 

874 self.r_total_gf = 1 / self.ua_value_gf 

875 

876 # values facing the inside of the thermal zone 

877 

878 self.r_conv_inner_gf = 1 / sum( 

879 1 / ground.r_inner_conv for ground in self.thermal_zone.ground_floors 

880 ) 

881 

882 self.r_rad_inner_gf = 1 / sum( 

883 1 / ground.r_inner_rad for ground in self.thermal_zone.ground_floors 

884 ) 

885 

886 self.r_comb_inner_gf = 1 / sum( 

887 1 / ground.r_inner_comb for ground in self.thermal_zone.ground_floors 

888 ) 

889 

890 self.ir_emissivity_inner_gf = ( 

891 sum( 

892 ground.layer[0].material.ir_emissivity * ground.area 

893 for ground in self.thermal_zone.ground_floors 

894 ) 

895 / self.area_gf 

896 ) 

897 

898 self.alpha_conv_inner_gf = 1 / (self.r_conv_inner_gf * self.area_gf) 

899 self.alpha_rad_inner_gf = 1 / (self.r_rad_inner_gf * self.area_gf) 

900 self.alpha_comb_inner_gf = 1 / (self.r_comb_inner_gf * self.area_gf) 

901 

902 def _sum_rooftop_elements(self): 

903 """Sum attributes for rooftop elements 

904 

905 This function sums and computes the area-weighted values, 

906 where necessary for coefficients of heat 

907 transfer, resistances, areas and UA-Values. 

908 

909 For FourElement model it treats outer walls and zone borders to 

910 neighboured zones (if this zone is heated) 

911 as one kind of wall type. 

912 

913 """ 

914 

915 self.area_rt = sum(roof.area for roof in self.thermal_zone.rooftops) 

916 

917 self.ua_value_rt = sum(roof.ua_value for roof in self.thermal_zone.rooftops) 

918 

919 self.r_total_rt = 1 / self.ua_value_rt 

920 

921 # values facing the inside of the thermal zone 

922 

923 self.r_conv_inner_rt = 1 / sum( 

924 1 / roof.r_inner_conv for roof in self.thermal_zone.rooftops 

925 ) 

926 

927 self.r_rad_inner_rt = 1 / sum( 

928 1 / roof.r_inner_rad for roof in self.thermal_zone.rooftops 

929 ) 

930 

931 self.r_comb_inner_rt = 1 / sum( 

932 1 / roof.r_inner_comb for roof in self.thermal_zone.rooftops 

933 ) 

934 

935 self.ir_emissivity_inner_rt = ( 

936 sum( 

937 roof.layer[0].material.ir_emissivity * roof.area 

938 for roof in self.thermal_zone.rooftops 

939 ) 

940 / self.area_rt 

941 ) 

942 

943 self.alpha_conv_inner_rt = 1 / (self.r_conv_inner_rt * self.area_rt) 

944 self.alpha_rad_inner_rt = 1 / (self.r_rad_inner_rt * self.area_rt) 

945 self.alpha_comb_inner_rt = 1 / (self.r_comb_inner_rt * self.area_rt) 

946 

947 # values facing the ambient 

948 # ground floor does not have any coefficients on ambient side 

949 

950 self.r_conv_outer_rt = 1 / sum( 

951 1 / roof.r_outer_conv for roof in self.thermal_zone.rooftops 

952 ) 

953 self.r_rad_outer_rt = 1 / sum( 

954 1 / roof.r_outer_rad for roof in self.thermal_zone.rooftops 

955 ) 

956 self.r_comb_outer_rt = 1 / sum( 

957 1 / roof.r_outer_comb for roof in self.thermal_zone.rooftops 

958 ) 

959 

960 self.ir_emissivity_outer_rt = ( 

961 sum( 

962 roof.layer[-1].material.ir_emissivity * roof.area 

963 for roof in self.thermal_zone.rooftops 

964 ) 

965 / self.area_rt 

966 ) 

967 

968 self.solar_absorp_rt = ( 

969 sum( 

970 roof.layer[-1].material.solar_absorp * roof.area 

971 for roof in self.thermal_zone.rooftops 

972 ) 

973 / self.area_rt 

974 ) 

975 

976 self.alpha_conv_outer_rt = 1 / (self.r_conv_outer_rt * self.area_rt) 

977 self.alpha_rad_outer_rt = 1 / (self.r_rad_outer_rt * self.area_rt) 

978 self.alpha_comb_outer_rt = 1 / (self.r_comb_outer_rt * self.area_rt) 

979 

980 def _sum_inner_wall_elements(self): 

981 """Sum attributes for interior elements 

982 

983 This function sums and computes the area-weighted values, 

984 where necessary (the class doc string) for coefficients of heat 

985 transfer, resistances, areas and UA-Values. 

986 

987 It treats all inner walls identical. 

988 

989 Function is identical for TwoElement, ThreeElement and FourElement. 

990 

991 Calculation of adjacent thermal zones and thus these attributes are 

992 currently not supported. 

993 

994 """ 

995 self.area_iw = ( 

996 sum(in_wall.area for in_wall in self.thermal_zone.inner_walls) 

997 + sum(floor.area for floor in self.thermal_zone.floors) 

998 + sum(ceiling.area for ceiling in self.thermal_zone.ceilings) 

999 + sum(nzb.area for nzb in self.nzbs_for_iw) 

1000 ) 

1001 

1002 self.ua_value_iw = ( 

1003 sum(in_wall.ua_value for in_wall in self.thermal_zone.inner_walls) 

1004 + sum(floor.ua_value for floor in self.thermal_zone.floors) 

1005 + sum(ceiling.ua_value for ceiling in self.thermal_zone.ceilings) 

1006 + sum(nzb.ua_value for nzb in self.nzbs_for_iw) 

1007 ) 

1008 

1009 # values facing the inside of the thermal zone 

1010 

1011 self.r_conv_inner_iw = 1 / ( 

1012 sum(1 / in_wall.r_inner_conv for in_wall in self.thermal_zone.inner_walls) 

1013 + sum(1 / floor.r_inner_conv for floor in self.thermal_zone.floors) 

1014 + sum(1 / ceiling.r_inner_conv for ceiling in self.thermal_zone.ceilings) 

1015 + sum(1 / nzb.r_inner_conv for nzb in self.nzbs_for_iw) 

1016 ) 

1017 

1018 self.r_rad_inner_iw = 1 / ( 

1019 sum(1 / in_wall.r_inner_rad for in_wall in self.thermal_zone.inner_walls) 

1020 + sum(1 / floor.r_inner_rad for floor in self.thermal_zone.floors) 

1021 + sum(1 / ceiling.r_inner_rad for ceiling in self.thermal_zone.ceilings) 

1022 + sum(1 / nzb.r_inner_rad for nzb in self.nzbs_for_iw) 

1023 ) 

1024 

1025 self.r_comb_inner_iw = 1 / ( 

1026 sum(1 / in_wall.r_inner_comb for in_wall in self.thermal_zone.inner_walls) 

1027 + sum(1 / floor.r_inner_comb for floor in self.thermal_zone.floors) 

1028 + sum(1 / ceiling.r_inner_comb for ceiling in self.thermal_zone.ceilings) 

1029 + sum(1 / nzb.r_inner_comb for nzb in self.nzbs_for_iw) 

1030 ) 

1031 

1032 self.ir_emissivity_inner_iw = ( 

1033 sum( 

1034 in_wall.layer[0].material.ir_emissivity * in_wall.area 

1035 for in_wall in self.thermal_zone.inner_walls 

1036 ) 

1037 + sum( 

1038 floor.layer[0].material.ir_emissivity * floor.area 

1039 for floor in self.thermal_zone.floors 

1040 ) 

1041 + sum( 

1042 ceiling.layer[0].material.ir_emissivity * ceiling.area 

1043 for ceiling in self.thermal_zone.ceilings 

1044 ) 

1045 + sum( 

1046 nzb.layer[0].material.ir_emissivity * nzb.area 

1047 for nzb in self.nzbs_for_iw 

1048 ) 

1049 ) / self.area_iw 

1050 

1051 self.alpha_conv_inner_iw = 1 / (self.r_conv_inner_iw * self.area_iw) 

1052 self.alpha_rad_inner_iw = 1 / (self.r_rad_inner_iw * self.area_iw) 

1053 self.alpha_comb_inner_iw = 1 / (self.r_comb_inner_iw * self.area_iw) 

1054 

1055 # adjacent thermal zones are not supported! 

1056 

1057 def _sum_window_elements(self): 

1058 """Sum attributes for window elements 

1059 

1060 This function sums and computes the area-weighted values, 

1061 where necessary (the class doc string) for coefficients of heat 

1062 transfer, resistances, areas and UA-Values. 

1063 

1064 Function is identical for TwoElement, ThreeElement and FourElement. 

1065 """ 

1066 

1067 self.area_win = sum(win.area for win in self.thermal_zone.windows) 

1068 self.ua_value_win = sum(win.ua_value for win in self.thermal_zone.windows) 

1069 self.u_value_win = self.ua_value_win / self.area_win 

1070 

1071 # values facing the inside of the thermal zone 

1072 

1073 self.r_conv_inner_win = 1 / ( 

1074 sum(1 / win.r_inner_conv for win in self.thermal_zone.windows) 

1075 ) 

1076 

1077 self.r_rad_inner_win = 1 / ( 

1078 sum(1 / win.r_inner_rad for win in self.thermal_zone.windows) 

1079 ) 

1080 

1081 self.r_comb_inner_win = 1 / ( 

1082 sum(1 / win.r_inner_comb for win in self.thermal_zone.windows) 

1083 ) 

1084 

1085 self.ir_emissivity_inner_win = ( 

1086 sum( 

1087 win.layer[0].material.ir_emissivity * win.area 

1088 for win in self.thermal_zone.windows 

1089 ) 

1090 / self.area_win 

1091 ) 

1092 

1093 self.alpha_conv_inner_win = 1 / (self.r_conv_inner_win * self.area_win) 

1094 self.alpha_rad_inner_win = 1 / (self.r_rad_inner_win * self.area_win) 

1095 self.alpha_comb_inner_win = 1 / (self.r_comb_inner_win * self.area_win) 

1096 self.ratio_conv_rad_inner_win = ( 

1097 sum(win.a_conv * win.area for win in self.thermal_zone.windows) 

1098 / self.area_win 

1099 ) 

1100 

1101 # values facing the ambient 

1102 

1103 self.r_conv_outer_win = 1 / ( 

1104 sum(1 / win.r_outer_conv for win in self.thermal_zone.windows) 

1105 ) 

1106 

1107 self.r_rad_outer_win = 1 / ( 

1108 sum(1 / win.r_outer_rad for win in self.thermal_zone.windows) 

1109 ) 

1110 

1111 self.r_comb_outer_win = 1 / ( 

1112 sum(1 / win.r_outer_comb for win in self.thermal_zone.windows) 

1113 ) 

1114 

1115 self.ir_emissivity_win = ( 

1116 sum( 

1117 win.layer[-1].material.ir_emissivity * win.area 

1118 for win in self.thermal_zone.windows 

1119 ) 

1120 / self.area_win 

1121 ) 

1122 

1123 self.solar_absorp_win = ( 

1124 sum( 

1125 win.layer[-1].material.solar_absorp * win.area 

1126 for win in self.thermal_zone.windows 

1127 ) 

1128 / self.area_win 

1129 ) 

1130 

1131 self.weighted_g_value = ( 

1132 sum(win.g_value * win.area for win in self.thermal_zone.windows) 

1133 / self.area_win 

1134 ) 

1135 

1136 self.alpha_conv_outer_win = 1 / (self.r_conv_outer_win * self.area_win) 

1137 self.alpha_rad_outer_win = 1 / (self.r_rad_outer_win * self.area_win) 

1138 self.alpha_comb_outer_win = 1 / (self.r_comb_outer_win * self.area_win) 

1139 

1140 def _calc_outer_elements(self): 

1141 """Lumped parameter for outer wall elements 

1142 

1143 Calculates all necessary parameters for outer walls. This includes 

1144 OuterWalls and Rooftops. 

1145 

1146 Attributes 

1147 ---------- 

1148 omega : float [1/s] 

1149 angular frequency with given time period. 

1150 outer_walls : list 

1151 List containing all TEASER Wall instances that are treated as same 

1152 outer wall type. In case of TwoElement model OuterWalls, Rooftops 

1153 """ 

1154 

1155 omega = 2 * math.pi / 86400 / self.t_bt 

1156 

1157 outer_walls = self.thermal_zone.outer_walls + self.thermal_zone.find_izes_outer() 

1158 

1159 if 0 < len(outer_walls) <= 1: 

1160 # only one outer wall, no need to calculate chain matrix 

1161 self.r1_ow = outer_walls[0].r1 

1162 self.c1_ow = outer_walls[0].c1_korr 

1163 elif len(outer_walls) > 1: 

1164 # more than one outer wall, calculate chain matrix 

1165 self.r1_ow, self.c1_ow = self._calc_parallel_connection( 

1166 outer_walls, omega, mode='ow' 

1167 ) 

1168 else: 

1169 warnings.warn( 

1170 "No walls are defined as outer walls, please be " 

1171 "careful with results. In addition this might lead " 

1172 "to RunTimeErrors" 

1173 ) 

1174 

1175 if self.merge_windows is False: 

1176 try: 

1177 

1178 if len(self.thermal_zone.windows) > 0: 

1179 self.r1_win = 1 / sum( 

1180 (1 / win.r1) for win in self.thermal_zone.windows 

1181 ) 

1182 if len(outer_walls) > 0: 

1183 conduction = 1 / sum( 

1184 (1 / element.r_conduc) for element in outer_walls 

1185 ) 

1186 

1187 self.r_rest_ow = conduction - self.r1_ow 

1188 

1189 except RuntimeError: 

1190 print( 

1191 "As no outer walls or no windows are defined lumped " 

1192 "parameter cannot be calculated" 

1193 ) 

1194 

1195 if self.merge_windows is True: 

1196 

1197 try: 

1198 if ( 

1199 len(self.thermal_zone.windows) > 0 

1200 and len(outer_walls) > 0 

1201 ): 

1202 self.r1_win = 1 / sum( 

1203 1 / (win.r1 / 6) for win in self.thermal_zone.windows 

1204 ) 

1205 

1206 self.r1_ow = 1 / (1 / self.r1_ow + 1 / self.r1_win) 

1207 

1208 self.r_total_ow = 1 / (self.ua_value_ow + self.ua_value_win) 

1209 self.r_rest_ow = ( 

1210 self.r_total_ow 

1211 - self.r1_ow 

1212 - 1 

1213 / ( 

1214 ( 

1215 (1 / self.r_conv_inner_ow) 

1216 + (1 / self.r_conv_inner_win) 

1217 + (1 / self.r_rad_inner_ow) 

1218 + (1 / self.r_rad_inner_win) 

1219 ) 

1220 ) 

1221 ) - 1 / (self.alpha_comb_outer_ow * self.area_ow) 

1222 

1223 self.ir_emissivity_inner_ow = ( 

1224 self.ir_emissivity_inner_ow * self.area_ow 

1225 + self.ir_emissivity_inner_win * self.area_win 

1226 ) / (self.area_ow + self.area_win) 

1227 

1228 self.ir_emissivity_outer_ow = ( 

1229 self.ir_emissivity_outer_ow * self.area_ow 

1230 + self.ir_emissivity_win * self.area_win 

1231 ) / (self.area_ow + self.area_win) 

1232 

1233 self.solar_absorp_ow = ( 

1234 self.solar_absorp_ow * self.area_ow 

1235 + self.solar_absorp_win * self.area_win 

1236 ) / (self.area_ow + self.area_win) 

1237 

1238 except RuntimeError: 

1239 print( 

1240 "As no outer walls or no windows are defined lumped " 

1241 "parameter cannot be calculated" 

1242 ) 

1243 

1244 def _calc_ground_floor_elements(self): 

1245 """Lumped parameter for ground floor elements 

1246 

1247 Calculates lumped parameters for ground floors. No windows in ground 

1248 floor allowed. 

1249 

1250 Attributes 

1251 ---------- 

1252 omega : float [1/s] 

1253 angular frequency with given time period. 

1254 """ 

1255 

1256 omega = 2 * math.pi / 86400 / self.t_bt 

1257 

1258 if 0 < len(self.thermal_zone.ground_floors) <= 1: 

1259 # only one outer wall, no need to calculate chain matrix 

1260 self.r1_gf = self.thermal_zone.ground_floors[0].r1 

1261 self.c1_gf = self.thermal_zone.ground_floors[0].c1_korr 

1262 elif len(self.thermal_zone.ground_floors) > 1: 

1263 # more than one outer wall, calculate chain matrix 

1264 self.r1_gf, self.c1_gf = self._calc_parallel_connection( 

1265 self.thermal_zone.ground_floors, omega, mode='ow' 

1266 ) 

1267 else: 

1268 warnings.warn( 

1269 "No walls are defined as ground floors, please be " 

1270 "careful with results. In addition this might lead " 

1271 "to RunTimeErrors" 

1272 ) 

1273 try: 

1274 conduction = 1 / sum( 

1275 (1 / element.r_conduc) for element in self.thermal_zone.ground_floors 

1276 ) 

1277 

1278 self.r_rest_gf = conduction - self.r1_gf 

1279 except RuntimeError: 

1280 print( 

1281 "As no ground floors are defined lumped " 

1282 "parameter cannot be calculated" 

1283 ) 

1284 

1285 def _calc_rooftop_elements(self): 

1286 """Lumped parameter for ground floor elements 

1287 

1288 Calculates lumped parameters for rooftops. Windows are considered in 

1289 outer wall calculation. This results in an error concerning the 

1290 interior radiation distribution. But currently there is no other option. 

1291 

1292 Attributes 

1293 ---------- 

1294 omega : float [1/s] 

1295 angular frequency with given time period. 

1296 """ 

1297 

1298 omega = 2 * math.pi / 86400 / self.t_bt 

1299 

1300 if 0 < len(self.thermal_zone.rooftops) <= 1: 

1301 # only one outer wall, no need to calculate chain matrix 

1302 self.r1_rt = self.thermal_zone.rooftops[0].r1 

1303 self.c1_rt = self.thermal_zone.rooftops[0].c1_korr 

1304 elif len(self.thermal_zone.rooftops) > 1: 

1305 # more than one outer wall, calculate chain matrix 

1306 self.r1_rt, self.c1_rt = self._calc_parallel_connection( 

1307 self.thermal_zone.rooftops, omega, mode='ow' 

1308 ) 

1309 else: 

1310 warnings.warn( 

1311 "No walls are defined as ground floors, please be " 

1312 "careful with results. In addition this might lead " 

1313 "to RunTimeErrors" 

1314 ) 

1315 try: 

1316 conduction = 1 / sum( 

1317 (1 / element.r_conduc) for element in self.thermal_zone.rooftops 

1318 ) 

1319 

1320 self.r_rest_rt = conduction - self.r1_rt 

1321 except RuntimeError: 

1322 print("As no rooftops are defined lumped " "parameter cannot be calculated") 

1323 

1324 def _calc_inner_elements(self): 

1325 """Lumped parameter for inner wall elements 

1326 

1327 Calculates all necessary parameters for inner walls. This includes 

1328 InnerWalls, Ceilings and Floors. 

1329 

1330 Attributes 

1331 ---------- 

1332 omega : float [1/s] 

1333 angular frequency with given time period. 

1334 outer_walls : list 

1335 List containing all TEASER Wall instances that are treated as same 

1336 outer wall type. In case of TwoElement model OuterWalls, 

1337 GroundFloors, Rooftops 

1338 """ 

1339 

1340 omega = 2 * math.pi / 86400 / self.t_bt 

1341 

1342 inner_walls = ( 

1343 self.thermal_zone.inner_walls 

1344 + self.thermal_zone.floors 

1345 + self.thermal_zone.ceilings 

1346 + self.nzbs_for_iw 

1347 ) 

1348 

1349 for in_wall in inner_walls: 

1350 in_wall.calc_equivalent_res() 

1351 in_wall.calc_ua_value() 

1352 

1353 if 0 < len(inner_walls) <= 1: 

1354 # only one inner wall, no need to calculate chain matrix 

1355 self.r1_iw = inner_walls[0].r1 

1356 self.c1_iw = inner_walls[0].c1_korr 

1357 elif len(inner_walls) > 1: 

1358 # more than one inner wall, calculate chain matrix 

1359 self.r1_iw, self.c1_iw = self._calc_parallel_connection( 

1360 inner_walls, omega, mode='iw' 

1361 ) 

1362 else: 

1363 warnings.warn( 

1364 "No walls are defined as inner walls, please be " 

1365 "careful with results. In addition this might lead " 

1366 "to RunTimeErrors" 

1367 ) 

1368 

1369 def _calc_wf(self): 

1370 """Weightfactors for outer elements(walls, roof, ground floor, windows) 

1371 

1372 Calculates the weightfactors of outer walls, rooftops, including 

1373 ground and windows. 

1374 

1375 """ 

1376 

1377 self.weightfactor_ground = 0.0 

1378 

1379 if self.merge_windows is True: 

1380 

1381 for wall in self.thermal_zone.outer_walls + self.thermal_zone.find_izes_outer(): 

1382 wall.wf_out = wall.ua_value / (self.ua_value_ow + self.ua_value_win) 

1383 

1384 for win in self.thermal_zone.windows: 

1385 win.wf_out = win.ua_value / (self.ua_value_ow + self.ua_value_win) 

1386 

1387 for rt in self.thermal_zone.rooftops: 

1388 rt.wf_out = rt.ua_value / self.ua_value_rt 

1389 

1390 elif self.merge_windows is False: 

1391 

1392 for wall in self.thermal_zone.outer_walls + self.thermal_zone.find_izes_outer(): 

1393 wall.wf_out = wall.ua_value / self.ua_value_ow 

1394 

1395 for win in self.thermal_zone.windows: 

1396 win.wf_out = win.ua_value / self.ua_value_win 

1397 

1398 for rt in self.thermal_zone.rooftops: 

1399 rt.wf_out = rt.ua_value / self.ua_value_rt 

1400 

1401 else: 

1402 raise ValueError("specify merge window method correctly") 

1403 

1404 def _calc_mean_values(self): 

1405 """Calculates mean values for inner and outer elements 

1406 

1407 This function calculates mean values inside the thermal zone (e.g. 

1408 the mean value for coefficient of radiative heat transfer between 

1409 inner and outer walls 

1410 """ 

1411 

1412 self.alpha_rad_inner_mean = ( 

1413 self.area_ow * self.alpha_rad_inner_ow 

1414 + self.area_win * self.alpha_rad_inner_win 

1415 + self.area_gf * self.alpha_rad_inner_gf 

1416 + self.area_rt * self.alpha_rad_inner_rt 

1417 + self.area_iw * self.alpha_rad_inner_iw 

1418 ) / (self.area_ow + self.area_win + self.area_iw + self.area_gf + self.area_rt) 

1419 self.alpha_rad_outer_mean = ( 

1420 self.area_ow * self.alpha_rad_outer_ow 

1421 + self.area_rt * self.alpha_rad_outer_rt 

1422 + self.area_win * self.alpha_rad_outer_win 

1423 ) / (self.area_ow + self.area_rt + self.area_win) 

1424 

1425 def _calc_number_of_elements(self): 

1426 """Calculates the number of facade elements with different tilt/orient 

1427 

1428 This function calculates the number of outer elements with a 

1429 different combination of orientation and tilt, this includes the 

1430 outer walls and borders to unheated neighboured zones if 

1431 this zone is heated. 

1432 """ 

1433 

1434 outer_elements = ( 

1435 self.thermal_zone.outer_walls 

1436 + self.thermal_zone.find_izes_outer() 

1437 + self.thermal_zone.windows 

1438 ) 

1439 

1440 tilt_orient = [] 

1441 for element in outer_elements: 

1442 tilt_orient.append((element.orientation, element.tilt)) 

1443 self.n_outer = len(list(set(tilt_orient))) 

1444 

1445 tilt_orient_rt = [] 

1446 for roof in self.thermal_zone.rooftops: 

1447 tilt_orient_rt.append((roof.orientation, roof.tilt)) 

1448 self.n_rt = len(list(set(tilt_orient_rt))) 

1449 

1450 def _fill_zone_lists(self): 

1451 """Fills lists like weightfactors and tilt, orientation 

1452 

1453 Fills the lists of a zone according to orientation and tilt of the 

1454 zone. Therefore it compares orientation and tilt of all outer 

1455 elements and then creates lists for zone weightfactors, orientation, 

1456 tilt, ares and sunblinds.""" 

1457 

1458 outer_elements = ( 

1459 self.thermal_zone.outer_walls 

1460 + self.thermal_zone.find_izes_outer() 

1461 + self.thermal_zone.windows 

1462 ) 

1463 

1464 tilt_orient = [] 

1465 for element in outer_elements: 

1466 tilt_orient.append((element.orientation, element.tilt)) 

1467 tilt_orient = list(set(tilt_orient)) 

1468 

1469 for i in tilt_orient: 

1470 wall_nzb = self.thermal_zone.find_walls( 

1471 i[0], i[1] 

1472 ) + self.thermal_zone.find_izes_outer( 

1473 i[0], i[1] 

1474 ) 

1475 wins = self.thermal_zone.find_wins(i[0], i[1]) 

1476 

1477 if self.merge_windows is True: 

1478 self.facade_areas.append( 

1479 sum([element.area for element in (wall_nzb + wins)]) 

1480 ) 

1481 else: 

1482 self.facade_areas.append(sum([element.area for element 

1483 in (wall_nzb)])) 

1484 

1485 self.orientation_facade.append(i[0]) 

1486 self.tilt_facade.append(i[1]) 

1487 

1488 if not wall_nzb: 

1489 self.weightfactor_ow.append(0.0) 

1490 self.outer_wall_areas.append(0.0) 

1491 else: 

1492 self.weightfactor_ow.append(sum([wall.wf_out 

1493 for wall in wall_nzb])) 

1494 self.outer_wall_areas.append(sum([wall.area 

1495 for wall in wall_nzb])) 

1496 

1497 if not wins: 

1498 self.weightfactor_win.append(0.0) 

1499 self.shading_g_total.append(1.0) 

1500 self.window_areas.append(0.0) 

1501 self.transparent_areas.append(0.0) 

1502 self.shading_max_irr.append(9999.9) 

1503 else: 

1504 self.weightfactor_win.append(sum([win.wf_out for win in wins])) 

1505 

1506 if self.merge_windows is False: 

1507 self.window_areas.append(sum([win.area for win in wins])) 

1508 self.transparent_areas.append(sum([win.area for win in wins])) 

1509 

1510 else: 

1511 self.window_areas.append(0) 

1512 self.transparent_areas.append(sum([win.area for win in wins])) 

1513 self.shading_g_total.append( 

1514 sum( 

1515 [ 

1516 win.shading_g_total * win.area / sum([w.area for w in wins]) 

1517 for win in wins 

1518 ] 

1519 ) 

1520 ) 

1521 self.shading_max_irr.append( 

1522 sum( 

1523 [ 

1524 win.shading_max_irr * win.area / sum([w.area for w in wins]) 

1525 for win in wins 

1526 ] 

1527 ) 

1528 ) 

1529 

1530 tilt_orient_rt = [] 

1531 for roof in self.thermal_zone.rooftops: 

1532 tilt_orient_rt.append((roof.orientation, roof.tilt)) 

1533 tilt_orient_rt = list(set(tilt_orient_rt)) 

1534 

1535 for i in tilt_orient_rt: 

1536 rts = self.thermal_zone.find_rts(i[0], i[1]) 

1537 

1538 self.orientation_rt.append(i[0]) 

1539 self.tilt_rt.append(i[1]) 

1540 self.weightfactor_win_rt.append(0) 

1541 if not rts: 

1542 self.weightfactor_rt.append(0.0) 

1543 self.rooftop_areas.append(0.0) 

1544 else: 

1545 self.weightfactor_rt.append(sum([rt.wf_out for rt in rts])) 

1546 self.rooftop_areas.append(sum([rt.area for rt in rts])) 

1547 

1548 def _calc_heat_load(self): 

1549 """Static heat load calculation 

1550 

1551 This function calculates the static heat load of the thermal zone by 

1552 multiplying the UA-Value of the elements with the given Temperature 

1553 difference of t_inside and t_outside. And takes heat losses through 

1554 infiltration into account. 

1555 

1556 Attributes 

1557 ---------- 

1558 ua_value_ow_temp : float [W/(m2*K)] 

1559 UA Value without GroundFloors 

1560 ua_value_gf_temp : float [W/(m2*K)] 

1561 UA Value of all GroundFloors 

1562 """ 

1563 if self.thermal_zone.use_conditions.base_infiltration > 0.5: 

1564 warnings.warn("The base_infiltration is larger than 0.5, " 

1565 "which could lead to ideal heaters being too small.") 

1566 

1567 self.heat_load = 0.0 

1568 

1569 if self.thermal_zone.parent.parent.t_soil_mode == 2: 

1570 t_ground = self.thermal_zone.t_ground \ 

1571 - self.thermal_zone.t_ground_amplitude 

1572 else: 

1573 t_ground = self.thermal_zone.t_ground 

1574 

1575 ua_value_ow_temp = self.ua_value_rt + self.ua_value_ow 

1576 self.heat_load_outside_factor = ( 

1577 (ua_value_ow_temp + self.ua_value_win) 

1578 + self.thermal_zone.volume 

1579 * self.thermal_zone.use_conditions.normative_infiltration 

1580 * 1 

1581 / 3600 

1582 * self.thermal_zone.heat_capac_air 

1583 * self.thermal_zone.density_air 

1584 ) 

1585 self.heat_load_ground_factor = self.ua_value_gf 

1586 self.heat_load = \ 

1587 self.heat_load_outside_factor \ 

1588 * (self.thermal_zone.t_inside - self.thermal_zone.t_outside) \ 

1589 + self.heat_load_ground_factor \ 

1590 * (self.thermal_zone.t_inside - t_ground) 

1591 

1592 def set_calc_default(self): 

1593 """sets default calculation parameters 

1594 """ 

1595 

1596 # Attributes of inner walls 

1597 self.area_iw = 0.0 

1598 

1599 # coefficient of heat transfer facing the inside of this thermal zone 

1600 self.alpha_conv_inner_iw = 0.0 

1601 self.alpha_rad_inner_iw = 0.0 

1602 self.alpha_comb_inner_iw = 0.0 

1603 # coefficient of heat transfer facing the adjacent thermal zone 

1604 self.alpha_conv_outer_iw = 0.0 

1605 self.alpha_rad_outer_iw = 0.0 

1606 self.alpha_comb_outer_iw = 0.0 

1607 

1608 # UA-Value 

1609 self.ua_value_iw = 0.0 

1610 

1611 # resistances for heat transfer facing the inside of this thermal zone 

1612 self.r_conv_inner_iw = 0.0 

1613 self.r_rad_inner_iw = 0.0 

1614 self.r_comb_inner_iw = 0.0 

1615 self.r_conv_outer_iw = 0.0 

1616 self.r_rad_outer_iw = 0.0 

1617 self.r_comb_outer_iw = 0.0 

1618 

1619 # lumped resistance/capacity 

1620 self.r1_iw = 0.0 

1621 self.c1_iw = 0.0 

1622 

1623 # Attributes for outer walls 

1624 self.area_ow = 0.0 

1625 

1626 # coefficient of heat transfer facing the inside of this thermal zone 

1627 self.alpha_conv_inner_ow = 0.0 

1628 self.alpha_rad_inner_ow = 0.0 

1629 self.alpha_comb_inner_ow = 0.0 

1630 

1631 # coefficient of heat transfer facing the ambient 

1632 self.alpha_conv_outer_ow = 0.0 

1633 self.alpha_rad_outer_ow = 0.0 

1634 self.alpha_comb_outer_ow = 0.0 

1635 

1636 # UA-Value 

1637 self.ua_value_ow = 0.0 

1638 

1639 # resistances for heat transfer facing the inside of this thermal zone 

1640 self.r_conv_inner_ow = 0.0 

1641 self.r_rad_inner_ow = 0.0 

1642 self.r_comb_inner_ow = 0.0 

1643 

1644 # resistances for heat transfer facing the ambient 

1645 self.r_conv_outer_ow = 0.0 

1646 self.r_rad_outer_ow = 0.0 

1647 self.r_comb_outer_ow = 0.0 

1648 

1649 # lumped resistances/capacity 

1650 self.r1_ow = 0.0 

1651 self.r_rest_ow = 0.0 

1652 self.c1_ow = 0.0 

1653 self.r_total_ow = 0.0 

1654 

1655 # Optical properties 

1656 self.ir_emissivity_outer_ow = 0.0 

1657 self.ir_emissivity_inner_ow = 0.0 

1658 self.solar_absorp_ow = 0.0 

1659 

1660 # Additional attributes 

1661 self.weightfactor_ow = [] 

1662 self.weightfactor_ground = 0.0 

1663 self.outer_wall_areas = [] 

1664 

1665 # Attributes for GroundFloor 

1666 self.area_gf = 0.0 

1667 

1668 # coefficient of heat transfer facing the inside of this thermal zone 

1669 self.alpha_conv_inner_gf = 0.0 

1670 self.alpha_rad_inner_gf = 0.0 

1671 self.alpha_comb_inner_gf = 0.0 

1672 

1673 # UA-Value 

1674 self.ua_value_gf = 0.0 

1675 

1676 # resistances for heat transfer facing the inside of this thermal zone 

1677 self.r_conv_inner_gf = 0.0 

1678 self.r_rad_inner_gf = 0.0 

1679 self.r_comb_inner_gf = 0.0 

1680 

1681 # lumped resistances/capacity 

1682 self.r1_gf = 0.0 

1683 self.r_rest_gf = 0.0 

1684 self.c1_gf = 0.0 

1685 self.r_total_gf = 0.0 

1686 

1687 # Optical properties 

1688 self.ir_emissivity_inner_gf = 0.0 

1689 

1690 # Additional attributes 

1691 

1692 self.weightfactor_ground = 0.0 

1693 

1694 # Attributes for rooftops 

1695 self.area_rt = 0.0 

1696 

1697 # coefficient of heat transfer facing the inside of this thermal zone 

1698 self.alpha_conv_inner_rt = 0.0 

1699 self.alpha_rad_inner_rt = 0.0 

1700 self.alpha_comb_inner_rt = 0.0 

1701 

1702 # coefficient of heat transfer facing the ambient 

1703 self.alpha_conv_outer_rt = 0.0 

1704 self.alpha_rad_outer_rt = 0.0 

1705 self.alpha_comb_outer_rt = 0.0 

1706 

1707 # UA-Value 

1708 self.ua_value_rt = 0.0 

1709 

1710 # resistances for heat transfer facing the inside of this thermal zone 

1711 self.r_conv_inner_rt = 0.0 

1712 self.r_rad_inner_rt = 0.0 

1713 self.r_comb_inner_rt = 0.0 

1714 

1715 # resistances for heat transfer facing the ambient 

1716 self.r_conv_outer_rt = 0.0 

1717 self.r_rad_outer_rt = 0.0 

1718 self.r_comb_outer_rt = 0.0 

1719 

1720 # lumped resistances/capacity 

1721 self.r1_rt = 0.0 

1722 self.r_rest_rt = 0.0 

1723 self.c1_rt = 0.0 

1724 self.r_total_rt = 0.0 

1725 

1726 # Optical properties 

1727 self.ir_emissivity_outer_rt = 0.0 

1728 self.ir_emissivity_inner_rt = 0.0 

1729 self.solar_absorp_rt = 0.0 

1730 

1731 # Additional attributes 

1732 self.weightfactor_rt = [] 

1733 self.rooftop_areas = [] 

1734 self.tilt_rt = [] 

1735 self.orientation_rt = [] 

1736 

1737 # TODO: check this value 

1738 self.r_rad_rt_iw = 0.0 

1739 

1740 # Attributes for windows 

1741 self.area_win = 0.0 

1742 

1743 # coefficient of heat transfer facing the inside of this thermal zone 

1744 self.alpha_conv_inner_win = 0.0 

1745 self.alpha_rad_inner_win = 0.0 

1746 self.alpha_comb_inner_win = 0.0 

1747 self.ratio_conv_rad_inner_win = 0.0 

1748 

1749 # coefficient of heat transfer facing the ambient 

1750 self.alpha_conv_outer_win = 0.0 

1751 self.alpha_rad_outer_win = 0.0 

1752 self.alpha_comb_outer_win = 0.0 

1753 

1754 # UA-Value 

1755 self.ua_value_win = 0.0 

1756 self.u_value_win = 0.0 

1757 

1758 # resistances for heat transfer facing the inside of this thermal zone 

1759 self.r_conv_inner_win = 0.0 

1760 self.r_rad_inner_win = 0.0 

1761 self.r_comb_inner_win = 0.0 

1762 

1763 # resistances for heat transfer facing the ambient 

1764 self.r_conv_outer_win = 0.0 

1765 self.r_rad_outer_win = 0.0 

1766 self.r_comb_outer_win = 0.0 

1767 

1768 # lumped resistances/capacity 

1769 self.r1_win = 0.0 

1770 

1771 # Optical properties 

1772 self.ir_emissivity_win = 0.0 

1773 self.solar_absorp_win = 0.0 

1774 

1775 # Additional attributes 

1776 self.weightfactor_win = [] 

1777 self.window_areas = [] 

1778 self.transparent_areas = [] 

1779 self.shading_g_total = [] 

1780 self.shading_max_irr = [] 

1781 self.weighted_g_value = 0.0 

1782 

1783 # Misc values 

1784 

1785 self.alpha_rad_inner_mean = 0.0 

1786 self.n_outer = 0 

1787 self.n_rt = 0 

1788 self.facade_areas = [] 

1789 self.tilt_facade = [] 

1790 self.orientation_facade = [] 

1791 self.heat_load = 0.0 

1792 self.cool_load = 0.0 

1793 

1794 @property 

1795 def nzbs_for_iw(self): 

1796 """returns borders to neighboured zones to be considered as inner walls 

1797 

1798 Returns 

1799 ------- 

1800 value : list 

1801 list of those interzonal elements that are NOT to be treated as 

1802 'outer_ordered' depending on their 'interzonal_type_export' 

1803 attribute 

1804 

1805 """ 

1806 elements = [] 

1807 for i in self.thermal_zone.interzonal_elements: 

1808 if not i.interzonal_type_export == 'outer_ordered': 

1809 elements.append(i) 

1810 else: 

1811 pass 

1812 return elements