Coverage for teaser/examples/verification/verification_ASHRAE_140_620.py: 99%

279 statements  

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

1# Created March 2017 

2# TEASER Development Team 

3 

4""" 

5This script contains of three functions. The first one loads the light-weight 

6ASHRAE 140 test room 620 from a `*.teaserjson` file. The second one creates 

7that room within the code. The third one computes parameter with the help of 

8one of the aforementioned functions. 

9""" 

10 

11import os 

12from teaser.project import Project 

13from teaser.logic.buildingobjects.building import Building 

14from teaser.logic.buildingobjects.thermalzone import ThermalZone 

15from teaser.logic.buildingobjects.buildingphysics.rooftop import Rooftop 

16from teaser.logic.buildingobjects.buildingphysics.layer import Layer 

17from teaser.logic.buildingobjects.buildingphysics.material import Material 

18from teaser.logic.buildingobjects.buildingphysics.outerwall import OuterWall 

19from teaser.logic.buildingobjects.buildingphysics.floor import Floor 

20from teaser.logic.buildingobjects.buildingphysics.groundfloor import GroundFloor 

21from teaser.logic.buildingobjects.buildingphysics.window import Window 

22from teaser.logic.buildingobjects.useconditions import UseConditions 

23 

24import teaser.logic.utilities as utilities 

25 

26 

27def main(number_of_elements=2): 

28 

29 prj = from_scratch(number_of_elements=number_of_elements, save=False) 

30 # prj = load_file() 

31 

32 prj.used_library_calc = "IBPSA" 

33 prj.number_of_elements_calc = number_of_elements 

34 prj.merge_windows_calc = False 

35 prj.weather_file_path = utilities.get_full_path( 

36 os.path.join("data", "input", "inputdata", "weatherdata", "ASHRAE140.mos") 

37 ) 

38 

39 prj.buildings[0].calc_building_parameter( 

40 number_of_elements=number_of_elements, merge_windows=False, used_library="IBPSA" 

41 ) 

42 

43 prj.export_ibpsa() 

44 

45 

46def from_scratch(number_of_elements, save=False, path=utilities.get_default_path()): 

47 """This function creates the test room from scratch. 

48 

49 Notes: The standard defines an solar absorption coefficient for interior 

50 surfaces of 0.6. We do not consider this, but we could by multiplying 

51 the solar radiation after the window by 0.6. 

52 

53 Parameters 

54 ---------- 

55 number_of_elements: int 

56 Number of elements of model 

57 path: str (optional) 

58 Path where Project should be stored as .teaserjson 

59 save: bool (optional) 

60 True if Project should be stored as .teaserjson at path 

61 

62 Returns 

63 ------- 

64 

65 prj: Project 

66 Project that contains the building with the test room 

67 

68 """ 

69 prj = Project() 

70 prj.name = "ASHRAE140Verification" 

71 

72 bldg = Building(parent=prj) 

73 bldg.name = "TestBuilding" 

74 

75 tz = ThermalZone(parent=bldg) 

76 tz.name = "TestRoom620" 

77 tz.area = 8.0 * 6.0 

78 tz.volume = tz.area * 2.7 

79 tz.use_conditions = UseConditions(parent=tz) 

80 tz.use_conditions.base_infiltration = 0.41 

81 

82 roof = Rooftop(parent=tz) 

83 roof.name = "Roof" 

84 roof.area = 8.0 * 6.0 

85 roof.orientation = -1.0 

86 roof.tilt = 0.0 

87 roof.inner_convection = 1 

88 roof.outer_convection = 24.67 

89 roof.inner_radiation = 5.13 

90 roof.outer_radiation = 4.63 

91 

92 layer_r1 = Layer(parent=roof, id=0) 

93 layer_r1.thickness = 0.01 

94 

95 material_r1 = Material(layer_r1) 

96 material_r1.name = "Plasterboard" 

97 material_r1.density = 950.0 

98 material_r1.heat_capac = 840.0 / 1000 

99 material_r1.thermal_conduc = 0.16 

100 material_r1.ir_emissivity = 0.9 

101 

102 layer_r2 = Layer(parent=roof, id=1) 

103 layer_r2.thickness = 0.1118 

104 

105 material_r2 = Material(layer_r2) 

106 material_r2.name = "Fiberglass" 

107 material_r2.density = 12 

108 material_r2.heat_capac = 840 / 1000 

109 material_r2.thermal_conduc = 0.04 

110 

111 layer_r3 = Layer(parent=roof, id=2) 

112 layer_r3.thickness = 0.019 

113 

114 material_r3 = Material(layer_r3) 

115 material_r3.name = "Roofdeck" 

116 material_r3.density = 530 

117 material_r3.heat_capac = 900 / 1000 

118 material_r3.thermal_conduc = 0.14 

119 material_r3.solar_absorp = 0.6 

120 material_r3.ir_emissivity = 0.9 

121 

122 out_wall_north = OuterWall(parent=tz) 

123 out_wall_north.name = "OuterWallNorth" 

124 out_wall_north.area = 8.0 * 2.7 

125 out_wall_north.orientation = 0.0 

126 out_wall_north.tilt = 90.0 

127 out_wall_north.inner_convection = 3.16 

128 out_wall_north.outer_convection = 24.67 

129 out_wall_north.inner_radiation = 5.13 

130 out_wall_north.outer_radiation = 4.63 

131 

132 layer_own1 = Layer(parent=out_wall_north, id=0) 

133 layer_own1.thickness = 0.012 

134 

135 material_own1 = Material(layer_own1) 

136 material_own1.name = "Plasterboard" 

137 material_own1.density = 950.0 

138 material_own1.heat_capac = 840.0 / 1000 

139 material_own1.thermal_conduc = 0.16 

140 material_own1.ir_emissivity = 0.9 

141 

142 layer_own2 = Layer(parent=out_wall_north, id=1) 

143 layer_own2.thickness = 0.066 

144 

145 material_own2 = Material(layer_own2) 

146 material_own2.name = "Fiberglass" 

147 material_own2.density = 12 

148 material_own2.heat_capac = 840 / 1000 

149 material_own2.thermal_conduc = 0.04 

150 

151 layer_own3 = Layer(parent=out_wall_north, id=2) 

152 layer_own3.thickness = 0.009 

153 

154 material_own3 = Material(layer_own3) 

155 material_own3.name = "WoodSiding" 

156 material_own3.density = 530 

157 material_own3.heat_capac = 900 / 1000 

158 material_own3.thermal_conduc = 0.14 

159 material_own3.solar_absorp = 0.6 

160 material_own3.ir_emissivity = 0.9 

161 

162 out_wall_east = OuterWall(parent=tz) 

163 out_wall_east.name = "OuterWallEast" 

164 out_wall_east.area = 6.0 * 2.7 - 3.0 * 2.0 # minus one window 

165 out_wall_east.orientation = 90.0 

166 out_wall_east.tilt = 90.0 

167 out_wall_east.inner_convection = 3.16 

168 out_wall_east.outer_convection = 24.67 

169 out_wall_east.inner_radiation = 5.13 

170 out_wall_east.outer_radiation = 4.63 

171 

172 layer_owe1 = Layer(parent=out_wall_east, id=0) 

173 layer_owe1.thickness = 0.012 

174 

175 material_owe1 = Material(layer_owe1) 

176 material_owe1.name = "Plasterboard" 

177 material_owe1.density = 950.0 

178 material_owe1.heat_capac = 840.0 / 1000 

179 material_owe1.thermal_conduc = 0.16 

180 material_owe1.ir_emissivity = 0.9 

181 

182 layer_owe2 = Layer(parent=out_wall_east, id=1) 

183 layer_owe2.thickness = 0.066 

184 

185 material_owe2 = Material(layer_owe2) 

186 material_owe2.name = "Fiberglass" 

187 material_owe2.density = 12 

188 material_owe2.heat_capac = 840 / 1000 

189 material_owe2.thermal_conduc = 0.04 

190 

191 layer_owe3 = Layer(parent=out_wall_east, id=2) 

192 layer_owe3.thickness = 0.009 

193 

194 material_owe3 = Material(layer_owe3) 

195 material_owe3.name = "WoodSiding" 

196 material_owe3.density = 530 

197 material_owe3.heat_capac = 900 / 1000 

198 material_owe3.thermal_conduc = 0.14 

199 material_owe3.solar_absorp = 0.6 

200 material_owe3.ir_emissivity = 0.9 

201 

202 out_wall_south = OuterWall(parent=tz) 

203 out_wall_south.name = "OuterWallSouth" 

204 out_wall_south.area = 8.0 * 2.7 

205 out_wall_south.orientation = 180.0 

206 out_wall_south.tilt = 90.0 

207 out_wall_south.inner_convection = 3.16 

208 out_wall_south.outer_convection = 24.67 

209 out_wall_south.inner_radiation = 5.13 

210 out_wall_south.outer_radiation = 4.63 

211 

212 layer_ows1 = Layer(parent=out_wall_south, id=0) 

213 layer_ows1.thickness = 0.012 

214 

215 material_ows1 = Material(layer_ows1) 

216 material_ows1.name = "Plasterboard" 

217 material_ows1.density = 950.0 

218 material_ows1.heat_capac = 840.0 / 1000 

219 material_ows1.thermal_conduc = 0.16 

220 material_ows1.ir_emissivity = 0.9 

221 

222 layer_ows2 = Layer(parent=out_wall_south, id=1) 

223 layer_ows2.thickness = 0.066 

224 

225 material_ows2 = Material(layer_ows2) 

226 material_ows2.name = "Fiberglass" 

227 material_ows2.density = 12 

228 material_ows2.heat_capac = 840 / 1000 

229 material_ows2.thermal_conduc = 0.04 

230 

231 layer_ows3 = Layer(parent=out_wall_south, id=2) 

232 layer_ows3.thickness = 0.009 

233 

234 material_ows3 = Material(layer_ows3) 

235 material_ows3.name = "WoodSiding" 

236 material_ows3.density = 530 

237 material_ows3.heat_capac = 900 / 1000 

238 material_ows3.thermal_conduc = 0.14 

239 material_ows3.solar_absorp = 0.6 

240 material_ows3.ir_emissivity = 0.9 

241 

242 out_wall_west = OuterWall(parent=tz) 

243 out_wall_west.name = "OuterWallWest" 

244 out_wall_west.area = 6 * 2.7 - 3.0 * 2.0 # minus one window 

245 out_wall_west.orientation = 270.0 

246 out_wall_west.tilt = 90.0 

247 out_wall_west.inner_convection = 3.16 

248 out_wall_west.outer_convection = 24.67 

249 out_wall_west.inner_radiation = 5.13 

250 out_wall_west.outer_radiation = 4.63 

251 

252 layer_oww1 = Layer(parent=out_wall_west, id=0) 

253 layer_oww1.thickness = 0.012 

254 

255 material_oww1 = Material(layer_oww1) 

256 material_oww1.name = "Plasterboard" 

257 material_oww1.density = 950.0 

258 material_oww1.heat_capac = 840.0 / 1000 

259 material_oww1.thermal_conduc = 0.16 

260 material_oww1.ir_emissivity = 0.9 

261 

262 layer_oww2 = Layer(parent=out_wall_west, id=1) 

263 layer_oww2.thickness = 0.066 

264 

265 material_oww2 = Material(layer_oww2) 

266 material_oww2.name = "Fiberglass" 

267 material_oww2.density = 12 

268 material_oww2.heat_capac = 840 / 1000 

269 material_oww2.thermal_conduc = 0.04 

270 

271 layer_oww3 = Layer(parent=out_wall_west, id=2) 

272 layer_oww3.thickness = 0.009 

273 

274 material_oww3 = Material(layer_oww3) 

275 material_oww3.name = "WoodSiding" 

276 material_oww3.density = 530 

277 material_oww3.heat_capac = 900 / 1000 

278 material_oww3.thermal_conduc = 0.14 

279 material_oww3.solar_absorp = 0.6 

280 material_oww3.ir_emissivity = 0.9 

281 

282 in_wall_floor = Floor(parent=tz) 

283 in_wall_floor.name = "InnerWallFloor" 

284 in_wall_floor.area = 6 * 8 

285 in_wall_floor.orientation = -2.0 

286 in_wall_floor.tilt = 0.0 

287 in_wall_floor.inner_convection = 4.13 

288 in_wall_floor.inner_radiation = 5.13 

289 

290 layer_iwf1 = Layer(parent=in_wall_floor, id=0) 

291 layer_iwf1.thickness = 0.025 

292 

293 material_iwf1 = Material(layer_iwf1) 

294 material_iwf1.name = "TimberFlooring" 

295 material_iwf1.density = 650 

296 material_iwf1.heat_capac = 1200 / 1000 

297 material_iwf1.thermal_conduc = 0.14 

298 material_iwf1.ir_emissivity = 0.9 

299 

300 layer_iwf2 = Layer(parent=in_wall_floor, id=1) 

301 layer_iwf2.thickness = 1.003 

302 

303 material_iwf2 = Material(layer_iwf2) 

304 material_iwf2.name = "Insulation" 

305 material_iwf2.density = 0.000000000001 # 0.0001, as small as possible 

306 material_iwf2.heat_capac = 0.000000000001 # 0.0001, as small as possible 

307 material_iwf2.thermal_conduc = 0.04 

308 

309 win_1 = Window(parent=tz) 

310 win_1.name = "WindowWest" 

311 win_1.area = 3 * 2 

312 win_1.tilt = 90.0 

313 win_1.orientation = 270.0 

314 win_1.inner_convection = 3.16 

315 win_1.inner_radiation = 5.13 

316 win_1.outer_convection = 16.37 

317 win_1.outer_radiation = 4.63 

318 win_1.g_value = 0.789 

319 win_1.a_conv = 0.03 # for the given U-value extracted from VDI 6007-2/-3 

320 

321 win_1_layer = Layer(parent=win_1) 

322 win_1_layer.id = 1 

323 win_1_layer.thickness = 0.024 

324 

325 win_1_material = Material(win_1_layer) 

326 win_1_material.name = "GlasWindow" 

327 win_1_material.thermal_conduc = 0.15 

328 win_1_material.transmittance = 0.907 

329 win_1_material.ir_emissivity = 0.9 

330 

331 win_2 = Window(parent=tz) 

332 win_2.name = "WindowEast" 

333 win_2.area = 3 * 2 

334 win_2.tilt = 90.0 

335 win_2.orientation = 90.0 

336 win_2.inner_convection = 3.16 

337 win_2.inner_radiation = 5.13 

338 win_2.outer_convection = 16.37 

339 win_2.outer_radiation = 4.63 

340 win_2.g_value = 0.789 

341 win_2.a_conv = 0.03 # for the given U-value extracted from VDI 6007-2/-3 

342 

343 win_2_layer = Layer(parent=win_2) 

344 win_2_layer.id = 1 

345 win_2_layer.thickness = 0.024 

346 

347 win_2_material = Material(win_2_layer) 

348 win_2_material.name = "GlasWindow" 

349 win_2_material.thermal_conduc = 0.15 

350 win_2_material.transmittance = 0.907 

351 win_2_material.ir_emissivity = 0.9 

352 

353 # This is a dummy ground floor to export three and four elements models. 

354 # Please set values for floor plate in three element and four element 

355 # models to default. 

356 

357 if number_of_elements >= 3: 

358 out_wall_gf = GroundFloor(parent=tz) 

359 out_wall_gf.name = "ExtWallGroundFloor" 

360 out_wall_gf.area = 6 * 8 

361 out_wall_gf.orientation = -2.0 

362 out_wall_gf.tilt = 0.0 

363 out_wall_gf.inner_convection = 4.13 

364 out_wall_gf.inner_radiation = 5.13 

365 

366 layer_ofgw1 = Layer(parent=out_wall_gf, id=0) 

367 layer_ofgw1.thickness = 1.003 

368 

369 material_ofgw1 = Material(layer_ofgw1) 

370 material_ofgw1.name = "Insulation" 

371 material_ofgw1.density = 0.0001 # as small as possible 

372 material_ofgw1.heat_capac = 0.0001 # as small as possible 

373 material_ofgw1.thermal_conduc = 0.04 

374 

375 if save: 

376 prj.save_project(file_name="ASHRAE140_620", path=path) 

377 

378 return prj 

379 

380 

381if __name__ == "__main__": 

382 main() 

383 print("ASHRAE 620: That's it!")