Coverage for teaser/examples/verification/verification_ASHRAE_140_600.py: 99%
279 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 March 2017
2# TEASER Development Team
4"""
5This script contains of three functions. The first one loads the light-weight
6ASHRAE 140 test room 600 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"""
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
26def main(number_of_elements=2):
28 prj = from_scratch(number_of_elements=number_of_elements, save=False)
29 # prj = load_file()
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 )
38 prj.buildings[0].calc_building_parameter(
39 number_of_elements=number_of_elements, merge_windows=False, used_library="IBPSA"
40 )
42 prj.export_ibpsa()
45def from_scratch(number_of_elements, save=False, path=utilities.get_default_path()):
46 """This function creates the test room from scratch.
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.
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
61 Returns
62 -------
64 prj: Project
65 Project that contains the building with the test room
67 """
68 prj = Project()
69 prj.name = "ASHRAE140Verification"
71 bldg = Building(parent=prj)
72 bldg.name = "TestBuilding"
74 tz = ThermalZone(parent=bldg)
75 tz.name = "TestRoom600"
76 tz.area = 8.0 * 6.0
77 tz.volume = tz.area * 2.7
79 tz.use_conditions = UseConditions(parent=tz)
80 tz.use_conditions.base_infiltration = 0.41
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
92 layer_r1 = Layer(parent=roof, id=0)
93 layer_r1.thickness = 0.01
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
102 layer_r2 = Layer(parent=roof, id=1)
103 layer_r2.thickness = 0.1118
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
111 layer_r3 = Layer(parent=roof, id=2)
112 layer_r3.thickness = 0.019
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
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
132 layer_own1 = Layer(parent=out_wall_north, id=0)
133 layer_own1.thickness = 0.012
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
142 layer_own2 = Layer(parent=out_wall_north, id=1)
143 layer_own2.thickness = 0.066
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
151 layer_own3 = Layer(parent=out_wall_north, id=2)
152 layer_own3.thickness = 0.009
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
162 out_wall_east = OuterWall(parent=tz)
163 out_wall_east.name = "OuterWallEast"
164 out_wall_east.area = 6.0 * 2.7
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
172 layer_owe1 = Layer(parent=out_wall_east, id=0)
173 layer_owe1.thickness = 0.012
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
182 layer_owe2 = Layer(parent=out_wall_east, id=1)
183 layer_owe2.thickness = 0.066
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
191 layer_owe3 = Layer(parent=out_wall_east, id=2)
192 layer_owe3.thickness = 0.009
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
202 out_wall_south = OuterWall(parent=tz)
203 out_wall_south.name = "OuterWallSouth"
204 out_wall_south.area = (8.0 * 2.7) - 2 * (3 * 2) # minus two windows
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
212 layer_ows1 = Layer(parent=out_wall_south, id=0)
213 layer_ows1.thickness = 0.012
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
222 layer_ows2 = Layer(parent=out_wall_south, id=1)
223 layer_ows2.thickness = 0.066
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
231 layer_ows3 = Layer(parent=out_wall_south, id=2)
232 layer_ows3.thickness = 0.009
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
242 out_wall_west = OuterWall(parent=tz)
243 out_wall_west.name = "OuterWallWest"
244 out_wall_west.area = 6 * 2.7
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
252 layer_oww1 = Layer(parent=out_wall_west, id=0)
253 layer_oww1.thickness = 0.012
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
262 layer_oww2 = Layer(parent=out_wall_west, id=1)
263 layer_oww2.thickness = 0.066
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
271 layer_oww3 = Layer(parent=out_wall_west, id=2)
272 layer_oww3.thickness = 0.009
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
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
290 layer_iwf1 = Layer(parent=in_wall_floor, id=0)
291 layer_iwf1.thickness = 0.025
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
300 layer_iwf2 = Layer(parent=in_wall_floor, id=1)
301 layer_iwf2.thickness = 1.003
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
309 win_1 = Window(parent=tz)
310 win_1.name = "WindowSouthLeft"
311 win_1.area = 3 * 2
312 win_1.tilt = 90.0
313 win_1.orientation = 180.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
321 win_1_layer = Layer(parent=win_1)
322 win_1_layer.id = 1
323 win_1_layer.thickness = 0.024
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
331 win_2 = Window(parent=tz)
332 win_2.name = "WindowSouthRight"
333 win_2.area = 3 * 2
334 win_2.tilt = 90.0
335 win_2.orientation = 180.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
343 win_2_layer = Layer(parent=win_2)
344 win_2_layer.id = 1
345 win_2_layer.thickness = 0.024
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
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.
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
366 layer_ofgw1 = Layer(parent=out_wall_gf, id=0)
367 layer_ofgw1.thickness = 1.003
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
375 if save:
376 prj.save_project(file_name="ASHRAE140_600", path=path)
378 return prj
381if __name__ == "__main__":
382 main()
383 print("ASHRAE 600: That's it!")