Coverage for teaser/examples/e12_include_adjacent_zones_and_varying_soil_temps.py: 0%
417 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# -*- coding: utf-8 -*-
2# @Author: Philip Groesdonk
3# @Date: 2019-06-30 09:09:09
5"""
6This script demonstrates five features of TEASER:
7 - how borders between adjacent zones can be modelled
8 - in connection to that, the export to a FiveElement AixLib ROM model
9 - how elements (here windows) can be newer than the building and get the
10 respective typical properties
11 - how non-constant soil temperatures are included
12 - how custom templates for the Modelica export are used
13 - the different estimation approaches for the interior wall area
15"""
17from teaser.project import Project
18from teaser.data.dataclass import DataClass
19from teaser.logic.buildingobjects.buildingphysics.layer import Layer
20from teaser.logic.buildingobjects.buildingphysics.material import Material
21from teaser.logic.buildingobjects.buildingphysics.outerwall import OuterWall
22from teaser.logic.buildingobjects.buildingphysics.groundfloor import GroundFloor
23from teaser.logic.buildingobjects.buildingphysics.window import Window
24from teaser.logic.buildingobjects.buildingphysics.interzonalwall import (
25 InterzonalWall
26)
27from teaser.logic.buildingobjects.thermalzone import ThermalZone
28from teaser.logic.buildingobjects.useconditions import UseConditions
29from teaser.logic.buildingobjects.building import Building
30from teaser.logic.buildingobjects.buildingphysics.rooftop import Rooftop
31from teaser.data.utilities import ConstructionData
32import teaser.logic.utilities as utilities
33import os
34import shutil
37def example_interzonal_single_building():
38 """
39 This example features the data presented in a contribution to the 2023
40 International Modelica Conference: https://doi.org/10.3384/ecp204577
41 """
42 # for the conference publication, four variations were calculated
43 # see paper, in particular its Table 1, for details
44 for variation in ['A', 'B', 'C', 'D']:
45 # this project is initialized without data class
46 prj = Project(False)
47 # now, we can set 'tabula_de' manually
48 prj.data = DataClass(construction_data=ConstructionData.tabula_de_standard)
50 if variation == 'D':
51 # this is the variation that represents the actual state of the building
52 prj.load_project(utilities.get_full_path(
53 f"examples/examplefiles/e10_varD.json"
54 ))
56 # in the json for variation D, one interzonal element is missing, so we
57 # can show in the example how it is manually added
58 # Because we want to add the properties manually here, check the
59 # generation of variations A to C further below to see how typical
60 # element properties are added to interzonal elements
62 # Add the interzonal element connecting zone 0 (attic) and zone 2 (main
63 # zone)
64 attic = prj.buildings[0].thermal_zones[0]
65 main_zone = prj.buildings[0].thermal_zones[2]
67 # It needs to be as an element of both the attic and the main zone
68 # The two elements, although representing the same physical element,
69 # are not semantically connected in the TEASER project due to the
70 # hierarchical structure project > building > thermal zone > element.
71 # Therefore, make sure that changes to one element always have to be
72 # implemented also for its counterpart.
74 # start with the ceiling of the main zone
75 from teaser.logic.buildingobjects.buildingphysics.interzonalceiling\
76 import InterzonalCeiling
77 main_ceiling = InterzonalCeiling(parent=main_zone, other_side=attic)
78 main_ceiling.name = "floor_4C797480FF814849944536D7EDE2A122_2"
79 main_ceiling.area = 48.90700957621479
80 main_ceiling.orientation = -1
81 main_ceiling.tilt = 0.0
82 main_ceiling.inner_convection = 5.0
83 main_ceiling.outer_convection = 5.0
84 main_ceiling.inner_radiation = 5.0
85 main_ceiling.outer_radiation = 5.0
87 # First layer: concrete
88 layer_mc1 = Layer(parent=main_ceiling, id=0)
89 layer_mc1.thickness = 0.02
90 material_mc1 = Material(layer_mc1)
91 material_mc1.name = "Tile"
92 material_mc1.density = 2400.0
93 material_mc1.heat_capac = 1.0
94 material_mc1.thermal_conduc = 2.5
95 material_mc1.solar_absorp = 0.7
96 material_mc1.ir_emissivity = 0.9
98 # Second layer: mineral wool
99 layer_mc2 = Layer(parent=main_ceiling, id=1)
100 layer_mc2.thickness = 0.13
101 material_mc2 = Material(layer_mc2)
102 material_mc2.name = "Mineralwolle_13cm"
103 material_mc2.density = 1800.0
104 material_mc2.heat_capac = 0.95
105 material_mc2.thermal_conduc = 0.06
106 material_mc2.solar_absorp = 0.7
107 material_mc2.ir_emissivity = 0.9
109 # now add the attic floor and give it the same properties
110 # differences are
111 # a) the orientation (-2 instead of -1)
112 # b) the layer sequence is inverted - because the sequence always starts
113 # at the inside of the thermal zone the element belongs to
114 from teaser.logic.buildingobjects.buildingphysics.interzonalfloor\
115 import InterzonalFloor
116 attic_floor = InterzonalFloor(parent=attic, other_side=main_zone)
117 attic_floor.name = "floor_4C797480FF814849944536D7EDE2A122_2"
118 attic_floor.area = 48.90700957621479
119 attic_floor.orientation = -2
120 attic_floor.tilt = 0.0
121 attic_floor.inner_convection = 5.0
122 attic_floor.outer_convection = 5.0
123 attic_floor.inner_radiation = 5.0
124 attic_floor.outer_radiation = 5.0
126 # First layer: mineral wool
127 layer_af1 = Layer(parent=attic_floor, id=0)
128 layer_af1.thickness = 0.13
129 material_af1 = Material(layer_af1)
130 material_af1.name = "Mineralwolle_13cm"
131 material_af1.density = 1800.0
132 material_af1.heat_capac = 0.95
133 material_af1.thermal_conduc = 0.06
134 material_af1.solar_absorp = 0.7
135 material_af1.ir_emissivity = 0.9
137 # Second layer: concrete
138 layer_af2 = Layer(parent=attic_floor, id=1)
139 layer_af2.thickness = 0.02
140 material_af2 = Material(layer_af2)
141 material_af2.name = "Tile"
142 material_af2.density = 2400.0
143 material_af2.heat_capac = 1.0
144 material_af2.thermal_conduc = 2.5
145 material_af2.solar_absorp = 0.7
146 material_af2.ir_emissivity = 0.9
148 elif variation in ('A', 'B', 'C'):
149 prj.load_project(utilities.get_full_path(
150 f"examples/examplefiles/e10_raw.json"
151 ))
153 # The default properties from the typology (selected previously by
154 # setting the data class) need to be loaded element-wise, replacing all
155 # previously set energy-relevant parameters of the elements.
156 # Here, we just load the standard existing state for the year of
157 # construction for each element. Note that
158 for tz in prj.buildings[0].thermal_zones:
159 # Note that the windows get a different year of construction (1995)
160 # than the rest of the building (1965, from the json import file).
161 for el in tz.windows:
162 el.load_type_element(
163 type_element_key="Window_[1995, 2001]_tabula_"
164 "de_standard_1_SFH"
165 )
166 el.shading_max_irr = 10000
167 # rooftops, ground floors and interzonal elements have a clearly
168 # associated TABULA standard construction. See the publication
169 # mentioned above for details about when which standard construction
170 # is used for interzonal elements.
171 # (here, typical outer elements are loaded, because
172 # tz.use_conditions.with_heating is False for attic and basement
173 # and True for the main zone)
174 for el in tz.rooftops + tz.ground_floors + tz.interzonal_elements:
175 el.load_type_element(el.year_of_construction,
176 'tabula_de_standard_1_SFH')
177 # There are two different standard constructions for some element
178 # types in some TABULA type building, especially outer walls.
179 # This is why two outer wall elements are stored in the JSON file
180 # here and why generate_archetype will create similar structures,
181 # too. The ratio of their sizes is sourced from the TABULA
182 # publications. In total, they sum up to the size of the actual
183 # building's wall.
184 for el in tz.outer_walls[:4]:
185 el.load_type_element(el.year_of_construction,
186 'tabula_de_standard_1_SFH')
187 for el in tz.outer_walls[4:]:
188 el.load_type_element(el.year_of_construction,
189 'tabula_de_standard_2_SFH')
191 for tz in prj.buildings[0].thermal_zones:
192 # In this case, we want to simulate one-directional heat flow. This
193 # is why we adapt the respective convection coefficients
194 for el in tz.rooftops:
195 el.inner_convection = 5.0
196 for el in tz.ground_floors:
197 el.inner_convection = 0.9
198 for el in tz.interzonal_ceilings:
199 if el.other_side is prj.buildings[0].thermal_zones[2]:
200 # border (from basement) to main zone
201 el.inner_convection = 0.9
202 el.outer_convection = 0.9
203 else:
204 # border (from main zone) to attic
205 el.inner_convection = 5.0
206 el.outer_convection = 5.0
207 for el in tz.interzonal_floors:
208 if el.other_side is prj.buildings[0].thermal_zones[2]:
209 # border (from attic) to main zone
210 el.inner_convection = 5.0
211 el.outer_convection = 5.0
212 else:
213 # border (from main zone) to basement
214 el.inner_convection = 0.9
215 el.outer_convection = 0.9
217 # change the project name so exports are clearly recognizable
218 prj.name = 'Example_e10_var' + variation
220 # three ways for setting the inner wall area
221 # if you run the example, you will see the difference in the console output.
222 # for both approximation approaches (A and B), it is essential that you
223 # set the number of floors per zone before calling tz.set_inner_wall_area().
224 # If you don't, the function will assume the zone has the same number of
225 # floors as the building.
226 if variation == 'A':
227 # use the approach that was implemented in TEASER the first version
228 prj.buildings[0].inner_wall_approximation_approach = 'teaser_default'
229 elif variation == 'B':
230 # use the new approach that checks typical room sizes and outer elements
231 # in this case, interzonal elements must be created beforehand. They may
232 # influence the result of the application.
233 prj.buildings[0].inner_wall_approximation_approach \
234 = 'typical_minus_outer_extended'
235 elif variation == 'C':
236 # define the areas manually for each zone
237 iw_areas = [0, 81.6764, 132.74215581488374]
238 ceil_areas = [0, 0, 66.15407513491138]
239 floor_areas = [0, 0, 66.15407513491138]
241 # calculate the areas and print the result to the console
242 thermal_zone_dict = {0: 'attic', 1: 'basement', 2: 'main zone'}
243 print('inner wall sizes for variation ' + variation)
244 for tzno, tz in enumerate(prj.buildings[0].thermal_zones):
245 print(f'Thermal zone {tzno} ({thermal_zone_dict[tzno]}):')
246 if tzno == 0 or tzno == 1:
247 tz.number_of_floors = 1
248 elif tzno == 2:
249 tz.number_of_floors = 2
250 if variation in ['A', 'B']:
251 tz.set_inner_wall_area()
252 elif variation == 'C':
253 for iw in tz.inner_walls:
254 iw.area = iw_areas[tzno]
255 for ceil in tz.ceilings:
256 ceil.area = ceil_areas[tzno]
257 for floor in tz.floors:
258 floor.area = floor_areas[tzno]
259 zone_wall_area = 0
260 for i, iw in enumerate(tz.inner_walls):
261 print(f'inner wall {i}: area {iw.area} m²')
262 zone_wall_area += iw.area
263 for i, iw in enumerate(tz.floors):
264 print(f'floor {i}: area {iw.area} m²')
265 zone_wall_area += iw.area
266 for i, iw in enumerate(tz.ceilings):
267 print(f'ceiling {i}: area {iw.area} m²')
268 zone_wall_area += iw.area
269 print(f'total interior area for zone {tzno}: {zone_wall_area} m²')
271 # for this specific application, we want to simulate the temperature in an
272 # unoccupied building which was actually measured during a period in
273 # February 2019. This is why the following steps are taken:
275 # 1. the soil temperature is set to the temperature measured on the contact
276 # surface between building element and soil
277 prj.t_soil_mode = 3
278 prj.t_soil_file_path = utilities.get_full_path(
279 "examples/examplefiles/t_soil_example_e10.txt"
280 )
282 # 2. the weather is set to the actual weather at the time
283 prj.weather_file_path = utilities.get_full_path(
284 "examples/examplefiles/DEU_NW_Morschenich_for_example_e10.mos"
285 )
287 # 3. we restrict the simulation time to the interesting part of the year
288 # (but leave enough time for the model reaching a steady state before
289 # the measurement starts)
290 prj.modelica_info.start_time = 1497600
291 prj.modelica_info.stop_time = 5155200
293 # 4. we make sure that heaters, coolers, internal gains and automatical
294 # shading do not influence the calculation
295 for tz in prj.buildings[0].thermal_zones:
296 tz.use_conditions.cooling_profile = 373.15
297 tz.use_conditions.heating_profile = 253.15
298 tz.use_conditions.lighting_profile = 0
299 tz.use_conditions.machines_profile = 0
300 tz.use_conditions.persons_profile = 0
301 # set the maximum irradiation (above which shading is automatically
302 # applied in the simulation) to an unreachable number
303 for el in tz.windows:
304 el.shading_max_irr = 10000
306 # for the calculation, we choose number of elements 5 and library AixLib
307 for building in prj.buildings:
308 building.calc_building_parameter(
309 number_of_elements=5,
310 used_library="AixLib"
311 )
313 # now, we do not want to use the default Multizone template, but a custom
314 # template. It has two important features:
315 # 1. the Medium DryAirNasa is used because the default SimpleAir cannot
316 # handle interior temperatures below 0 °C, but those will be present in
317 # the unheated attic here
318 # 2. additional internal gains are connected to the ports of the Multizone
319 export_path = prj.export_aixlib(
320 custom_multizone_template_path=utilities.get_full_path(
321 "examples/examplefiles/e10_Multizone_template"
322 )
323 )
324 # the additional import source files need to be copied to the export path
325 shutil.copyfile(
326 utilities.get_full_path("examples/examplefiles/e10_AddIntGains.txt"),
327 os.path.join(export_path, prj.buildings[0].name, "e10_AddIntGains.txt")
328 )
330 return prj
333def example_interzonal_ashrae_960():
334 """
335 This example creates a two-zone model as far as possible according to
336 Test Case 960 of ASHRAE 140-2020
337 """
339 prj = Project()
340 prj.name = "ASHRAE140"
341 prj.data = DataClass(construction_data=ConstructionData.iwu_heavy)
343 bldg = Building(parent=prj)
344 bldg.name = "Case960"
345 bldg.year_of_construction = 2015
346 bldg.number_of_floors = 1
347 bldg.height_of_floors = 2.7
349 tz1 = ThermalZone(parent=bldg)
350 tz1.name = "BackZone"
351 tz1.area = 8 * 6
352 tz1.volume = tz1.area * bldg.number_of_floors * bldg.height_of_floors
353 tz1.infiltration_rate = 0.414
355 tz2 = ThermalZone(parent=bldg)
356 tz2.name = "SunZone"
357 tz2.area = 8 * 2
358 tz2.volume = tz2.area * bldg.number_of_floors * bldg.height_of_floors
359 tz2.infiltration_rate = 0.414
360 # set dummy use conditions
361 tz1.use_conditions = UseConditions(parent=tz1)
362 tz1.use_conditions.load_use_conditions("Living", prj.data)
363 tz2.use_conditions = UseConditions(parent=tz2)
364 tz2.use_conditions.load_use_conditions("Living", prj.data)
365 # adapt as needed
366 tz1.use_conditions.with_heating = True
367 tz1.use_conditions.with_cooling = True
368 tz1.use_conditions.persons = 0
369 tz1.use_conditions.fixed_heat_flow_rate_persons = 0
370 tz1.use_conditions.internal_gains_moisture_no_people = 0
371 tz1.use_conditions.use_constant_infiltration = True
372 tz1.use_conditions.machines = 200.0 / tz1.area
373 tz1.use_conditions.fixed_lighting_power = 0.0
374 tz1.use_conditions.heating_profile = [293.15] * 24
375 tz1.use_conditions.cooling_profile = [300.15] * 24
376 tz1.use_conditions.persons_profile = [0.0] * 24
377 tz1.use_conditions.machines_profile = [1.0] * 24
378 tz1.use_conditions.lighting_profile = [0.0] * 24
379 tz2.use_conditions.with_heating = False
380 tz2.use_conditions.with_cooling = False
381 tz2.use_conditions.persons = 0
382 tz2.use_conditions.fixed_heat_flow_rate_persons = 0
383 tz2.use_conditions.internal_gains_moisture_no_people = 0
384 tz2.use_conditions.use_constant_infiltration = True
385 tz2.use_conditions.machines = 0.0
386 tz2.use_conditions.fixed_lighting_power = 0.0
387 tz2.use_conditions.heating_profile = [0.15] * 24
388 tz2.use_conditions.cooling_profile = [500.15] * 24
389 tz2.use_conditions.persons_profile = [0.0] * 24
390 tz2.use_conditions.machines_profile = [0.0] * 24
391 tz2.use_conditions.lighting_profile = [0.0] * 24
393 # build up rooftop
394 roof_back = Rooftop(parent=tz1)
395 roof_back.name = "roof_back"
396 roof_back.area = tz1.area
397 roof_back.orientation = -1
398 roof_back.tilt = 0.0
399 roof_back.inner_convection = 1.8
400 roof_back.outer_convection = 14.4
401 roof_back.inner_radiation = -0.1
402 roof_back.outer_radiation = 7.4
404 ks = [0.16, 0.04, 0.14]
405 materials = ['Plasterboard', 'Fiberglass quilt', 'Roofdeck']
406 thicknesses = [0.010, 0.1118, 0.019]
407 densities = [950, 12, 530]
408 c_ps = [0.840, 0.840, 0.900]
409 for layer_id, (k, matname, thickness, density, c_p) in enumerate(zip(
410 ks, materials, thicknesses, densities, c_ps
411 )):
412 layer = Layer(parent=roof_back, id=layer_id)
413 layer.thickness = thickness
414 material = Material(layer)
415 material.name = matname
416 material.density = density
417 material.heat_capac = c_p
418 material.thermal_conduc = k
419 material.ir_emissivity = 0.9
420 material.solar_absorp = 0.6
422 out_wall_dict = {"OuterWall_north": [10.0, 90.0, 0.0],
423 "OuterWall_east": [14.0, 90.0, 90.0],
424 "OuterWall_west": [14.0, 90.0, 270.0]}
425 for key, value in out_wall_dict.items():
426 # Instantiate class, key is the name
427 out_wall = OuterWall(parent=tz1)
428 out_wall.name = key
429 ks = [0.16, 0.04, 0.14]
430 materials = ['Plasterboard', 'Fiberglass quilt', 'Wood siding']
431 thicknesses = [0.012, 0.066, 0.009]
432 densities = [950, 12, 530]
433 c_ps = [0.840, 0.840, 0.900]
434 for layer_id, (k, matname, thickness, density, c_p) in enumerate(zip(
435 ks, materials, thicknesses, densities, c_ps
436 )):
437 layer = Layer(parent=out_wall, id=layer_id)
438 layer.thickness = thickness
439 material = Material(layer)
440 material.name = matname
441 material.density = density
442 material.heat_capac = c_p
443 material.thermal_conduc = k
444 material.ir_emissivity = 0.9
445 material.solar_absorp = 0.6
446 # area, tilt and orientation need to be set individually.
447 out_wall.area = value[0]
448 out_wall.tilt = value[1]
449 out_wall.orientation = value[2]
450 out_wall.inner_convection = 2.2
451 out_wall.outer_convection = 11.9
452 out_wall.inner_radiation = -0.4
453 out_wall.outer_radiation = 9.7
455 # For ground floors the orientation is always -2
456 ground_floor_dict = {"GroundFloor": [48.0, 0.0, -2]}
457 for key, value in ground_floor_dict.items():
458 ground = GroundFloor(parent=tz1)
459 ground.name = key
460 ks = [0.14, 0.04]
461 materials = ['Timber flooring', 'Insulation']
462 thicknesses = [0.025, 1.003]
463 densities = [650, 0.00001]
464 c_ps = [1.2, 0.000001]
465 for layer_id, (k, matname, thickness, density, c_p) in enumerate(zip(
466 ks, materials, thicknesses, densities, c_ps
467 )):
468 layer = Layer(parent=ground, id=layer_id)
469 layer.thickness = thickness
470 material = Material(layer)
471 material.name = matname
472 material.density = density
473 material.heat_capac = c_p
474 material.thermal_conduc = k
475 material.ir_emissivity = 0.9
476 material.solar_absorp = 0.6
477 ground.area = value[0]
478 ground.tilt = value[1]
479 ground.orientation = value[2]
480 ground.inner_convection = 2.2
481 ground.outer_convection = 0.8
482 ground.inner_radiation = 1.5
483 ground.outer_radiation = 4.4
485 # build up rooftop
486 roof = Rooftop(parent=tz2)
487 roof.name = "roof_sun"
488 roof.area = tz1.area
489 roof.orientation = -1
490 roof.tilt = 0.0
491 roof.inner_convection = 1.8
492 roof.outer_convection = 14.4
493 roof.inner_radiation = -0.1
494 roof.outer_radiation = 7.4
496 ks = [0.16, 0.04, 0.14]
497 materials = ['Plasterboard', 'Fiberglass quilt', 'Roofdeck']
498 thicknesses = [0.010, 0.1118, 0.019]
499 densities = [950, 12, 530]
500 c_ps = [0.840, 0.840, 0.900]
501 for layer_id, (k, matname, thickness, density, c_p) in enumerate(zip(
502 ks, materials, thicknesses, densities, c_ps
503 )):
504 layer = Layer(parent=roof, id=layer_id)
505 layer.thickness = thickness
506 material = Material(layer)
507 material.name = matname
508 material.density = density
509 material.heat_capac = c_p
510 material.thermal_conduc = k
511 material.ir_emissivity = 0.9
512 material.solar_absorp = 0.6
514 out_wall_dict = {"OuterWall_south": [8*2.7-6-6, 90.0, 180.0],
515 "OuterWall_east": [5.4, 90.0, 90.0],
516 "OuterWall_west": [5.4, 90.0, 270.0]}
517 for key, value in out_wall_dict.items():
518 # Instantiate class, key is the name
519 out_wall = OuterWall(parent=tz2)
520 out_wall.name = key
521 ks = [0.51, 0.04, 0.14]
522 materials = ['Concrete block', 'Foam insulation', 'Wood siding']
523 thicknesses = [0.1, 0.0615, 0.009]
524 densities = [1400, 10, 530]
525 c_ps = [1, 1.4, 0.900]
526 for layer_id, (k, matname, thickness, density, c_p) in enumerate(zip(
527 ks, materials, thicknesses, densities, c_ps
528 )):
529 layer = Layer(parent=out_wall, id=layer_id)
530 layer.thickness = thickness
531 material = Material(layer)
532 material.name = matname
533 material.density = density
534 material.heat_capac = c_p
535 material.thermal_conduc = k
536 material.ir_emissivity = 0.9
537 material.solar_absorp = 0.6
538 # area, tilt and orientation need to be set individually.
539 out_wall.area = value[0]
540 out_wall.tilt = value[1]
541 out_wall.orientation = value[2]
542 out_wall.inner_convection = 2.2
543 out_wall.outer_convection = 11.9
544 out_wall.inner_radiation = -0.4
545 out_wall.outer_radiation = 9.7
547 # For ground floors the orientation is always -2
548 ground_floor_dict = {"GroundFloor": [16.0, 0.0, -2]}
549 for key, value in ground_floor_dict.items():
550 ground = GroundFloor(parent=tz2)
551 ground.name = key
552 ks = [1.13, 0.04]
553 materials = ['Concrete slab', 'Insulation']
554 thicknesses = [0.080, 1.007]
555 densities = [1400, 0.00001]
556 c_ps = [1, 0.000001]
557 for layer_id, (k, matname, thickness, density, c_p) in enumerate(zip(
558 ks, materials, thicknesses, densities, c_ps
559 )):
560 layer = Layer(parent=ground, id=layer_id)
561 layer.thickness = thickness
562 material = Material(layer)
563 material.name = matname
564 material.density = density
565 material.heat_capac = c_p
566 material.thermal_conduc = k
567 material.ir_emissivity = 0.9
568 material.solar_absorp = 0.6
569 ground.area = value[0]
570 ground.tilt = value[1]
571 ground.orientation = value[2]
572 ground.inner_convection = 2.2
573 ground.outer_convection = 0.8
574 ground.inner_radiation = 1.5
575 ground.outer_radiation = 4.4
577 win_dict = {"Window_south1": [6.0, 90.0, 180.0],
578 "Window_south2": [6.0, 90.0, 180.0]}
579 for key, value in win_dict.items():
580 win = Window(parent=tz2)
581 win.name = key
582 win.area = value[0]
583 win.tilt = value[1]
584 win.orientation = value[2]
585 win.inner_convection = 2.4
586 win.inner_radiation = 2.1
587 win.outer_convection = 8.0
588 win.outer_radiation = 9.8
589 win.g_value = 0.769
590 win.a_conv = 0.03
591 win.shading_g_total = 0.0
592 win.shading_max_irr = 10000.0
594 # One equivalent layer for windows
595 win_layer = Layer(parent=win)
596 win_layer.id = 1
597 win_layer.thickness = (0.47650 - 0.22222 - 0.05618) / 1
598 # Material for glass
599 win_material = Material(win_layer)
600 win_material.name = "GlasWindow"
601 win_material.thermal_conduc = 1
602 win_material.transmittance = 0.834 * 0.834
604 # finally, add the zone boundary (for each zone)
605 for tzfront, tzback in zip([tz1, tz2], [tz2, tz1]):
606 boundary = InterzonalWall(parent=tzfront, other_side=tzback)
607 boundary.name = "floor_4C797480FF814849944536D7EDE2A122_2"
608 boundary.area = 48.90700957621479
609 boundary.orientation = -1
610 boundary.tilt = 0.0
611 # this is unclear, taking wall values
612 boundary.inner_convection = 2.2
613 boundary.outer_convection = 11.9
614 boundary.inner_radiation = -0.4
615 boundary.outer_radiation = 9.7
617 # First layer: concrete
618 layer_mc1 = Layer(parent=boundary, id=0)
619 layer_mc1.thickness = 0.2
620 material_mc1 = Material(layer_mc1)
621 material_mc1.name = "boundary_material"
622 material_mc1.density = 1400.0
623 material_mc1.heat_capac = 1.0
624 material_mc1.thermal_conduc = 0.51
625 material_mc1.solar_absorp = 0.6
626 material_mc1.ir_emissivity = 0.9
628 # 1. the soil temperature is set to the temperature measured on the contact
629 # surface between building element and soil
630 prj.t_soil_mode = 3
631 prj.t_soil_file_path = utilities.get_full_path(
632 "examples/examplefiles/t_soil_from_ashrae_140_air_temp.txt"
633 )
634 # 2. the weather is set to the actual weather at the time
635 prj.weather_file_path = "modelica://AixLib/Resources/WeatherData/ASHRAE140.mos"
637 # for the calculation, we choose number of elements 5 and library AixLib
638 for building in prj.buildings:
639 building.calc_building_parameter(
640 number_of_elements=5,
641 used_library="AixLib"
642 )
644 export_path = prj.export_aixlib()
647if __name__ == '__main__':
648 prj1 = example_interzonal_single_building()
649 example_interzonal_ashrae_960()
651 print("Example 11: That's it! :)")