Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make t_bt customizable #799

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion teaser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys
import os

__version__ = "1.1.0"
__version__ = "1.1.1"


new_path = os.path.join(os.path.expanduser('~'), ("TEASEROutput"))
Expand Down
19 changes: 16 additions & 3 deletions teaser/logic/buildingobjects/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,17 @@ class Building(object):
library_attr : Annex() or AixLib() instance
Classes with specific functions and attributes for building models in
IBPSA and AixLib. Python classes can be found in calculation package.

"""
t_bt : float
Time constant according to VDI 6007.
Default 5 d, only change if you know what you are doing.
See https://publications.rwth-aachen.de/record/749705/files/749705.pdf for more
information (Section 4.1.2)
t_bt_layer: float
Time constant according to VDI 6007 for aggragation of layers.
Default 7 d, only change if you know what you are doing
See https://publications.rwth-aachen.de/record/749705/files/749705.pdf for more
information (Section 4.1.2)
"""

def __init__(
self,
Expand Down Expand Up @@ -176,6 +185,9 @@ def __init__(

self.library_attr = None

self.t_bt = 5
self.t_bt_layer = 7

def set_outer_wall_area(self, new_area, orientation):
"""Outer area wall setter

Expand Down Expand Up @@ -386,7 +398,8 @@ def calc_building_parameter(
zone.calc_zone_parameters(
number_of_elements=number_of_elements,
merge_windows=merge_windows,
t_bt=5,
t_bt=self.t_bt,
t_bt_layer=self.t_bt_layer
)
self.sum_heat_load += zone.model_attr.heat_load
self.area_rt += sum(rf.area for rf in zone.rooftops)
Expand Down
11 changes: 7 additions & 4 deletions teaser/logic/buildingobjects/calculation/four_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class FourElement(object):
supported for IBPSA)
t_bt : float [d]
Time constant according to VDI 6007 (default t_bt = 5)
t_bt_layer : float [d]
Time constant according to VDI 6007 for aggragation of layers (default t_bt = 7)

Attributes
----------
Expand Down Expand Up @@ -380,14 +382,15 @@ class FourElement(object):

"""

def __init__(self, thermal_zone, merge_windows, t_bt):
def __init__(self, thermal_zone, merge_windows, t_bt, t_bt_layer=7):
"""Constructor for TwoElement"""

self.internal_id = random.random()

self.thermal_zone = thermal_zone
self.merge_windows = merge_windows
self.t_bt = t_bt
self.t_bt_layer = t_bt_layer

# Attributes of inner walls
self.area_iw = 0.0
Expand Down Expand Up @@ -596,13 +599,13 @@ def calc_attributes(self):
"""Calls all necessary function to calculate model attributes"""

for out_wall in self.thermal_zone.outer_walls:
out_wall.calc_equivalent_res()
out_wall.calc_equivalent_res(t_bt=self.t_bt_layer)
out_wall.calc_ua_value()
for rt in self.thermal_zone.rooftops:
rt.calc_equivalent_res()
rt.calc_equivalent_res(t_bt=self.t_bt_layer)
rt.calc_ua_value()
for gf in self.thermal_zone.ground_floors:
gf.calc_equivalent_res()
gf.calc_equivalent_res(t_bt=self.t_bt_layer)
gf.calc_ua_value()
for win in self.thermal_zone.windows:
win.calc_equivalent_res()
Expand Down
9 changes: 6 additions & 3 deletions teaser/logic/buildingobjects/calculation/one_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class OneElement(object):
supported for IBPSA)
t_bt : float [d]
Time constant according to VDI 6007 (default t_bt = 5)
t_bt_layer : float [d]
Time constant according to VDI 6007 for aggragation of layers (default t_bt = 7)

Attributes
----------
Expand Down Expand Up @@ -231,14 +233,15 @@ class OneElement(object):

"""

def __init__(self, thermal_zone, merge_windows, t_bt):
def __init__(self, thermal_zone, merge_windows, t_bt, t_bt_layer=7):
"""Constructor for TwoElement"""

self.internal_id = random.random()

self.thermal_zone = thermal_zone
self.merge_windows = merge_windows
self.t_bt = t_bt
self.t_bt_layer = t_bt_layer

# Attributes for outer walls (OuterWall, Rooftop, GroundFloor)
self.area_ow = 0.0
Expand Down Expand Up @@ -349,7 +352,7 @@ def calc_attributes(self):
)

for out_wall in outer_walls:
out_wall.calc_equivalent_res()
out_wall.calc_equivalent_res(t_bt=self.t_bt_layer)
out_wall.calc_ua_value()
for win in self.thermal_zone.windows:
win.calc_equivalent_res()
Expand All @@ -359,7 +362,7 @@ def calc_attributes(self):
+ self.thermal_zone.floors
+ self.thermal_zone.ceilings
):
inner_wall.calc_equivalent_res()
inner_wall.calc_equivalent_res(t_bt=self.t_bt_layer)
inner_wall.calc_ua_value()

self.set_calc_default()
Expand Down
11 changes: 7 additions & 4 deletions teaser/logic/buildingobjects/calculation/three_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class ThreeElement(object):
supported for IBPSA)
t_bt : float [d]
Time constant according to VDI 6007 (default t_bt = 5)
t_bt_layer : float [d]
Time constant according to VDI 6007 for aggragation of layers (default t_bt = 7)

Attributes
----------
Expand Down Expand Up @@ -306,14 +308,15 @@ class ThreeElement(object):

"""

def __init__(self, thermal_zone, merge_windows, t_bt):
def __init__(self, thermal_zone, merge_windows, t_bt, t_bt_layer=7):
"""Constructor for ThreeElement"""

self.internal_id = random.random()

self.thermal_zone = thermal_zone
self.merge_windows = merge_windows
self.t_bt = t_bt
self.t_bt_layer = t_bt_layer

# Attributes of inner walls
self.area_iw = 0.0
Expand Down Expand Up @@ -476,10 +479,10 @@ def calc_attributes(self):
outer_walls = self.thermal_zone.outer_walls + self.thermal_zone.rooftops

for out_wall in outer_walls:
out_wall.calc_equivalent_res()
out_wall.calc_equivalent_res(t_bt=self.t_bt_layer)
out_wall.calc_ua_value()
for gf in self.thermal_zone.ground_floors:
gf.calc_equivalent_res()
gf.calc_equivalent_res(t_bt=self.t_bt_layer)
gf.calc_ua_value()
for win in self.thermal_zone.windows:
win.calc_equivalent_res()
Expand All @@ -489,7 +492,7 @@ def calc_attributes(self):
+ self.thermal_zone.floors
+ self.thermal_zone.ceilings
):
inner_wall.calc_equivalent_res()
inner_wall.calc_equivalent_res(t_bt=self.t_bt_layer)
inner_wall.calc_ua_value()

self.set_calc_default()
Expand Down
9 changes: 6 additions & 3 deletions teaser/logic/buildingobjects/calculation/two_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class TwoElement(object):
supported for IBPSA)
t_bt : float [d]
Time constant according to VDI 6007 (default t_bt = 5)
t_bt_layer : float [d]
Time constant according to VDI 6007 for aggragation of layers (default t_bt = 7)

Attributes
----------
Expand Down Expand Up @@ -267,14 +269,15 @@ class TwoElement(object):

"""

def __init__(self, thermal_zone, merge_windows, t_bt):
def __init__(self, thermal_zone, merge_windows, t_bt, t_bt_layer=7):
"""Constructor for TwoElement"""

self.internal_id = random.random()

self.thermal_zone = thermal_zone
self.merge_windows = merge_windows
self.t_bt = t_bt
self.t_bt_layer = t_bt_layer

# Attributes of inner walls
self.area_iw = 0.0
Expand Down Expand Up @@ -412,7 +415,7 @@ def calc_attributes(self):
)

for out_wall in outer_walls:
out_wall.calc_equivalent_res()
out_wall.calc_equivalent_res(t_bt=self.t_bt_layer)
out_wall.calc_ua_value()
for win in self.thermal_zone.windows:
win.calc_equivalent_res()
Expand All @@ -422,7 +425,7 @@ def calc_attributes(self):
+ self.thermal_zone.floors
+ self.thermal_zone.ceilings
):
inner_wall.calc_equivalent_res()
inner_wall.calc_equivalent_res(t_bt=self.t_bt_layer)
inner_wall.calc_ua_value()

self.set_calc_default()
Expand Down
19 changes: 14 additions & 5 deletions teaser/logic/buildingobjects/thermalzone.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def calc_zone_parameters(
self,
number_of_elements=2,
merge_windows=False,
t_bt=5):
t_bt=5,
t_bt_layer=7
):
"""RC-Calculation for the thermal zone

Based on the input parameters (used model) this function instantiates
Expand Down Expand Up @@ -139,31 +141,38 @@ def calc_zone_parameters(

t_bt : float
Time constant according to VDI 6007 (default t_bt = 5)
t_bt_layer: float
Time constant according to VDI 6007 for aggragation of layers (default t_bt = 7)
"""

if number_of_elements == 1:
self.model_attr = OneElement(
thermal_zone=self,
merge_windows=merge_windows,
t_bt=t_bt)
t_bt=t_bt,
t_bt_layer=t_bt_layer)
self.model_attr.calc_attributes()
elif number_of_elements == 2:
self.model_attr = TwoElement(
thermal_zone=self,
merge_windows=merge_windows,
t_bt=t_bt)
t_bt=t_bt,
t_bt_layer=t_bt_layer)
self.model_attr.calc_attributes()
elif number_of_elements == 3:
self.model_attr = ThreeElement(
thermal_zone=self,
merge_windows=merge_windows,
t_bt=t_bt)
t_bt=t_bt,
t_bt_layer=t_bt_layer)
self.model_attr.calc_attributes()
elif number_of_elements == 4:
self.model_attr = FourElement(
thermal_zone=self,
merge_windows=merge_windows,
t_bt=t_bt)
t_bt=t_bt,
t_bt_layer=t_bt_layer
)
self.model_attr.calc_attributes()

def find_walls(self, orientation, tilt):
Expand Down
Loading