Coverage for teaser/examples/verification/verification_ASHRAE_140_920.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 heavy-weight 

6ASHRAE 140 test room 920 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 

23import teaser.logic.utilities as utilities 

24 

25 

26def main(number_of_elements=2): 

27 

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

29 # prj = load_file() 

30 

31 prj.used_library_calc = "IBPSA" 

32 prj.number_of_elements_calc = number_of_elements 

33 prj.merge_windows_calc = False 

34 prj.weather_file_path = utilities.get_full_path( 

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

36 ) 

37 

38 prj.buildings[0].calc_building_parameter( 

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

40 ) 

41 

42 prj.export_ibpsa() 

43 

44 

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

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

47 

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

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

50 the solar radiation after the window by 0.6. 

51 

52 Parameters 

53 ---------- 

54 number_of_elements: int 

55 Number of elements of model 

56 path: str (optional) 

57 Path where Project should be stored as .teaserjson 

58 save: bool (optional) 

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

60 

61 Returns 

62 ------- 

63 

64 prj: Project 

65 Project that contains the building with the test room 

66 

67 """ 

68 prj = Project() 

69 prj.name = "ASHRAE140Verification" 

70 

71 bldg = Building(parent=prj) 

72 bldg.name = "TestBuilding" 

73 

74 tz = ThermalZone(parent=bldg) 

75 tz.name = "TestRoom920" 

76 tz.area = 8.0 * 6.0 

77 tz.volume = tz.area * 2.7 

78 tz.use_conditions = UseConditions(parent=tz) 

79 tz.use_conditions.base_infiltration = 0.41 

80 

81 roof = Rooftop(parent=tz) 

82 roof.name = "Roof" 

83 roof.area = 8.0 * 6.0 

84 roof.orientation = -1.0 

85 roof.tilt = 0.0 

86 roof.inner_convection = 1 

87 roof.outer_convection = 24.67 

88 roof.inner_radiation = 5.13 

89 roof.outer_radiation = 4.63 

90 

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

92 layer_r1.thickness = 0.01 

93 

94 material_r1 = Material(layer_r1) 

95 material_r1.name = "Plasterboard" 

96 material_r1.density = 950.0 

97 material_r1.heat_capac = 840.0 / 1000 

98 material_r1.thermal_conduc = 0.16 

99 material_r1.ir_emissivity = 0.9 

100 

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

102 layer_r2.thickness = 0.1118 

103 

104 material_r2 = Material(layer_r2) 

105 material_r2.name = "Fiberglass" 

106 material_r2.density = 12 

107 material_r2.heat_capac = 840 / 1000 

108 material_r2.thermal_conduc = 0.04 

109 

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

111 layer_r3.thickness = 0.019 

112 

113 material_r3 = Material(layer_r3) 

114 material_r3.name = "Roofdeck" 

115 material_r3.density = 530 

116 material_r3.heat_capac = 900 / 1000 

117 material_r3.thermal_conduc = 0.14 

118 material_r3.solar_absorp = 0.6 

119 material_r3.ir_emissivity = 0.9 

120 

121 out_wall_north = OuterWall(parent=tz) 

122 out_wall_north.name = "OuterWallNorth" 

123 out_wall_north.area = 8.0 * 2.7 

124 out_wall_north.orientation = 0.0 

125 out_wall_north.tilt = 90.0 

126 out_wall_north.inner_convection = 3.16 

127 out_wall_north.outer_convection = 24.67 

128 out_wall_north.inner_radiation = 5.13 

129 out_wall_north.outer_radiation = 4.63 

130 

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

132 layer_own1.thickness = 0.1 

133 

134 material_own1 = Material(layer_own1) 

135 material_own1.name = "Concrete" 

136 material_own1.density = 1400.0 

137 material_own1.heat_capac = 1000 / 1000 

138 material_own1.thermal_conduc = 0.51 

139 material_own1.ir_emissivity = 0.9 

140 

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

142 layer_own2.thickness = 0.062 

143 

144 material_own2 = Material(layer_own2) 

145 material_own2.name = "FoamInsulation" 

146 material_own2.density = 10 

147 material_own2.heat_capac = 1400 / 1000 

148 material_own2.thermal_conduc = 0.04 

149 

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

151 layer_own3.thickness = 0.009 

152 

153 material_own3 = Material(layer_own3) 

154 material_own3.name = "WoodSiding" 

155 material_own3.density = 530 

156 material_own3.heat_capac = 900 / 1000 

157 material_own3.thermal_conduc = 0.14 

158 material_own3.solar_absorp = 0.6 

159 material_own3.ir_emissivity = 0.9 

160 

161 out_wall_east = OuterWall(parent=tz) 

162 out_wall_east.name = "OuterWallEast" 

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

164 out_wall_east.orientation = 90.0 

165 out_wall_east.tilt = 90.0 

166 out_wall_east.inner_convection = 3.16 

167 out_wall_east.outer_convection = 24.67 

168 out_wall_east.inner_radiation = 5.13 

169 out_wall_east.outer_radiation = 4.63 

170 

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

172 layer_owe1.thickness = 0.1 

173 

174 material_owe1 = Material(layer_owe1) 

175 material_owe1.name = "Concrete" 

176 material_owe1.density = 1400.0 

177 material_owe1.heat_capac = 1000 / 1000 

178 material_owe1.thermal_conduc = 0.51 

179 material_owe1.ir_emissivity = 0.9 

180 

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

182 layer_owe2.thickness = 0.062 

183 

184 material_owe2 = Material(layer_owe2) 

185 material_owe2.name = "FoamInsulation" 

186 material_owe2.density = 10 

187 material_owe2.heat_capac = 1400 / 1000 

188 material_owe2.thermal_conduc = 0.04 

189 

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

191 layer_owe3.thickness = 0.009 

192 

193 material_owe3 = Material(layer_owe3) 

194 material_owe3.name = "WoodSiding" 

195 material_owe3.density = 530 

196 material_owe3.heat_capac = 900 / 1000 

197 material_owe3.thermal_conduc = 0.14 

198 material_owe3.solar_absorp = 0.6 

199 material_owe3.ir_emissivity = 0.9 

200 

201 out_wall_south = OuterWall(parent=tz) 

202 out_wall_south.name = "OuterWallSouth" 

203 out_wall_south.area = 8.0 * 2.7 

204 out_wall_south.orientation = 180.0 

205 out_wall_south.tilt = 90.0 

206 out_wall_south.inner_convection = 3.16 

207 out_wall_south.outer_convection = 24.67 

208 out_wall_south.inner_radiation = 5.13 

209 out_wall_south.outer_radiation = 4.63 

210 

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

212 layer_ows1.thickness = 0.1 

213 

214 material_ows1 = Material(layer_ows1) 

215 material_ows1.name = "Concrete" 

216 material_ows1.density = 1400.0 

217 material_ows1.heat_capac = 1000.0 / 1000 

218 material_ows1.thermal_conduc = 0.51 

219 material_ows1.ir_emissivity = 0.9 

220 

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

222 layer_ows2.thickness = 0.062 

223 

224 material_ows2 = Material(layer_ows2) 

225 material_ows2.name = "FoamInsulation" 

226 material_ows2.density = 10 

227 material_ows2.heat_capac = 1400 / 1000 

228 material_ows2.thermal_conduc = 0.04 

229 

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

231 layer_ows3.thickness = 0.009 

232 

233 material_ows3 = Material(layer_ows3) 

234 material_ows3.name = "WoodSiding" 

235 material_ows3.density = 530 

236 material_ows3.heat_capac = 900 / 1000 

237 material_ows3.thermal_conduc = 0.14 

238 material_ows3.solar_absorp = 0.6 

239 material_ows3.ir_emissivity = 0.9 

240 

241 out_wall_west = OuterWall(parent=tz) 

242 out_wall_west.name = "OuterWallWest" 

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

244 out_wall_west.orientation = 270.0 

245 out_wall_west.tilt = 90.0 

246 out_wall_west.inner_convection = 3.16 

247 out_wall_west.outer_convection = 24.67 

248 out_wall_west.inner_radiation = 5.13 

249 out_wall_west.outer_radiation = 4.63 

250 

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

252 layer_oww1.thickness = 0.1 

253 

254 material_oww1 = Material(layer_oww1) 

255 material_oww1.name = "Concrete" 

256 material_oww1.density = 1400.0 

257 material_oww1.heat_capac = 1000.0 / 1000 

258 material_oww1.thermal_conduc = 0.51 

259 material_oww1.ir_emissivity = 0.9 

260 

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

262 layer_oww2.thickness = 0.062 

263 

264 material_oww2 = Material(layer_oww2) 

265 material_oww2.name = "FoamInsulation" 

266 material_oww2.density = 10 

267 material_oww2.heat_capac = 1400 / 1000 

268 material_oww2.thermal_conduc = 0.04 

269 

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

271 layer_oww3.thickness = 0.009 

272 

273 material_oww3 = Material(layer_oww3) 

274 material_oww3.name = "WoodSiding" 

275 material_oww3.density = 530 

276 material_oww3.heat_capac = 900 / 1000 

277 material_oww3.thermal_conduc = 0.14 

278 material_oww3.solar_absorp = 0.6 

279 material_oww3.ir_emissivity = 0.9 

280 

281 in_wall_floor = Floor(parent=tz) 

282 in_wall_floor.name = "InnerWallFloor" 

283 in_wall_floor.area = 6 * 8 

284 in_wall_floor.orientation = -2.0 

285 in_wall_floor.tilt = 0.0 

286 in_wall_floor.inner_convection = 4.13 

287 in_wall_floor.inner_radiation = 5.13 

288 

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

290 layer_iwf1.thickness = 0.08 

291 

292 material_iwf1 = Material(layer_iwf1) 

293 material_iwf1.name = "Concrete" 

294 material_iwf1.density = 1400 

295 material_iwf1.heat_capac = 1000 / 1000 

296 material_iwf1.thermal_conduc = 1.13 

297 material_iwf1.ir_emissivity = 0.9 

298 

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

300 layer_iwf2.thickness = 1.007 

301 

302 material_iwf2 = Material(layer_iwf2) 

303 material_iwf2.name = "Insulation" 

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

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

306 material_iwf2.thermal_conduc = 0.04 

307 

308 win_1 = Window(parent=tz) 

309 win_1.name = "WindowWest" 

310 win_1.area = 3 * 2 

311 win_1.tilt = 90.0 

312 win_1.orientation = 270.0 

313 win_1.inner_convection = 3.16 

314 win_1.inner_radiation = 5.13 

315 win_1.outer_convection = 16.37 

316 win_1.outer_radiation = 4.63 

317 win_1.g_value = 0.789 

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

319 

320 win_1_layer = Layer(parent=win_1) 

321 win_1_layer.id = 1 

322 win_1_layer.thickness = 0.024 

323 

324 win_1_material = Material(win_1_layer) 

325 win_1_material.name = "GlasWindow" 

326 win_1_material.thermal_conduc = 0.15 

327 win_1_material.transmittance = 0.907 

328 win_1_material.ir_emissivity = 0.9 

329 

330 win_2 = Window(parent=tz) 

331 win_2.name = "WindowEast" 

332 win_2.area = 3 * 2 

333 win_2.tilt = 90.0 

334 win_2.orientation = 90.0 

335 win_2.inner_convection = 3.16 

336 win_2.inner_radiation = 5.13 

337 win_2.outer_convection = 16.37 

338 win_2.outer_radiation = 4.63 

339 win_2.g_value = 0.789 

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

341 

342 win_2_layer = Layer(parent=win_2) 

343 win_2_layer.id = 1 

344 win_2_layer.thickness = 0.024 

345 

346 win_2_material = Material(win_2_layer) 

347 win_2_material.name = "GlasWindow" 

348 win_2_material.thermal_conduc = 0.15 

349 win_2_material.transmittance = 0.907 

350 win_2_material.ir_emissivity = 0.9 

351 

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

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

354 # models to default. 

355 

356 if number_of_elements >= 3: 

357 out_wall_gf = GroundFloor(parent=tz) 

358 out_wall_gf.name = "ExtWallGroundFloor" 

359 out_wall_gf.area = 6 * 8 

360 out_wall_gf.orientation = -2.0 

361 out_wall_gf.tilt = 0.0 

362 out_wall_gf.inner_convection = 4.13 

363 out_wall_gf.inner_radiation = 5.13 

364 

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

366 layer_ofgw1.thickness = 1.003 

367 

368 material_ofgw1 = Material(layer_ofgw1) 

369 material_ofgw1.name = "Insulation" 

370 material_ofgw1.density = 0.0001 # as small as possible 

371 material_ofgw1.heat_capac = 0.0001 # as small as possible 

372 material_ofgw1.thermal_conduc = 0.04 

373 

374 if save: 

375 prj.save_project(file_name="ASHRAE140_920", path=path) 

376 

377 return prj 

378 

379 

380if __name__ == "__main__": 

381 main() 

382 print("ASHRAE 920: That's it!")