Skip to content

Commit

Permalink
Merge pull request #424 from RWTH-EBC/issue423_warnings
Browse files Browse the repository at this point in the history
Adds warnings but allows no windows, no roofs, no ground floor and no…
  • Loading branch information
mlauster authored Mar 30, 2017
2 parents e394306 + 2f582d1 commit 38ec436
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ record ${zone.parent.name}_${zone.name} "${zone.parent.name}_${zone.name}"
alphaWin = ${zone.model_attr.alpha_conv_inner_win},
RWin = ${zone.model_attr.r1_win},
gWin = ${zone.model_attr.weighted_g_value},
UWin= ${zone.model_attr.ua_value_win/zone.model_attr.area_win},
UWin= ${zone.model_attr.u_value_win},
ratioWinConRad = ${zone.model_attr.ratio_conv_rad_inner_win},
AExt = ${get_list(zone.model_attr.facade_areas)},
alphaExt = ${zone.model_attr.alpha_conv_inner_ow},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ record ${zone.parent.name}_${zone.name} "${zone.parent.name}_${zone.name}"
alphaWin = ${zone.model_attr.alpha_conv_inner_win},
RWin = ${zone.model_attr.r1_win},
gWin = ${zone.model_attr.weighted_g_value},
UWin= ${zone.model_attr.ua_value_win/zone.model_attr.area_win},
UWin= ${zone.model_attr.u_value_win},
ratioWinConRad = ${zone.model_attr.ratio_conv_rad_inner_win},
AExt = ${get_list(zone.model_attr.facade_areas)},
alphaExt = ${zone.model_attr.alpha_conv_inner_ow},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ record ${zone.parent.name}_${zone.name} "${zone.parent.name}_${zone.name}"
alphaWin = ${zone.model_attr.alpha_conv_inner_win},
RWin = ${zone.model_attr.r1_win},
gWin = ${zone.model_attr.weighted_g_value},
UWin= ${zone.model_attr.ua_value_win/zone.model_attr.area_win},
UWin= ${zone.model_attr.u_value_win},
ratioWinConRad = ${zone.model_attr.ratio_conv_rad_inner_win},
AExt = ${get_list(zone.model_attr.facade_areas)},
alphaExt = ${zone.model_attr.alpha_conv_inner_ow},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ record ${zone.parent.name}_${zone.name} "${zone.parent.name}_${zone.name}"
alphaWin = ${zone.model_attr.alpha_conv_inner_win},
RWin = ${zone.model_attr.r1_win},
gWin = ${zone.model_attr.weighted_g_value},
UWin= ${zone.model_attr.ua_value_win/zone.model_attr.area_win},
UWin= ${zone.model_attr.u_value_win},
ratioWinConRad = ${zone.model_attr.ratio_conv_rad_inner_win},
AExt = ${get_list(zone.model_attr.facade_areas)},
alphaExt = ${zone.model_attr.alpha_conv_inner_ow},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ model ${zone.parent.name}_${zone.name}
"Calculates direct solar radiation on titled surface for all directions"
annotation (Placement(transformation(extent={{-68,52},{-48,72}})));
Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${zone.model_attr.n_outer},
UWin=${zone.model_attr.ua_value_win/zone.model_attr.area_win})
UWin=${zone.model_attr.u_value_win})
"Correction factor for solar transmission"
annotation (Placement(transformation(extent={{6,54},{26,74}})));
Annex60.ThermalZones.ReducedOrder.RC.FourElements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ model ${zone.parent.name}_${zone.name}
"Calculates direct solar radiation on titled surface for all directions"
annotation (Placement(transformation(extent={{-68,52},{-48,72}})));
Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${zone.model_attr.n_outer},
UWin=${zone.model_attr.ua_value_win/zone.model_attr.area_win})
UWin=${zone.model_attr.u_value_win})
"Correction factor for solar transmission"
annotation (Placement(transformation(extent={{6,54},{26,74}})));
Annex60.ThermalZones.ReducedOrder.RC.OneElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ model ${zone.parent.name}_${zone.name}
"Calculates direct solar radiation on titled surface for all directions"
annotation (Placement(transformation(extent={{-68,52},{-48,72}})));
Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${zone.model_attr.n_outer},
UWin=${zone.model_attr.ua_value_win/zone.model_attr.area_win})
UWin=${zone.model_attr.u_value_win})
"Correction factor for solar transmission"
annotation (Placement(transformation(extent={{6,54},{26,74}})));
Annex60.ThermalZones.ReducedOrder.RC.ThreeElements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ model ${zone.parent.name}_${zone.name}
"Calculates direct solar radiation on titled surface for all directions"
annotation (Placement(transformation(extent={{-68,52},{-48,72}})));
Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${zone.model_attr.n_outer},
UWin=${zone.model_attr.ua_value_win/zone.model_attr.area_win})
UWin=${zone.model_attr.u_value_win})
"Correction factor for solar transmission"
annotation (Placement(transformation(extent={{6,54},{26,74}})));
Annex60.ThermalZones.ReducedOrder.RC.TwoElements
Expand Down
75 changes: 55 additions & 20 deletions teaser/logic/buildingobjects/calculation/four_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ class FourElement(object):
the ambient.
ua_value_win : float [W/K]
U-Value times outer wall area.
u_value_win : float [W/(m2K)]
Area weighted U-Value of windows.
r_conv_inner_win : float [K/W]
Sum of convective resistances for all windows facing the
inside of this thermal zone.
Expand Down Expand Up @@ -530,6 +532,7 @@ def __init__(self, thermal_zone, merge_windows, t_bt):

# UA-Value
self.ua_value_win = 0.0
self.u_value_win = 0.0

# resistances for heat transfer facing the inside of this thermal zone
self.r_conv_inner_win = 0.0
Expand Down Expand Up @@ -583,15 +586,41 @@ def calc_attributes(self):
win.calc_ua_value()

self.set_calc_default()
if len(self.thermal_zone.outer_walls) < 1:
warnings.warn("No walls are defined as outer walls for thermal " +
"zone " + self.thermal_zone.name + " in building " +
self.thermal_zone.parent.name +
", please be careful with results. In addition " +
"this might lead to RunTimeErrors")
self._sum_outer_wall_elements()
self._sum_ground_floor_elements()
self._sum_rooftop_elements()
self._sum_inner_wall_elements()
self._sum_window_elements()
self._calc_outer_elements()
self._calc_ground_floor_elements()
if len(self.thermal_zone.inner_walls) < 1:
warnings.warn('For thermal zone ' + self.thermal_zone.name +
' in building ' + self.thermal_zone.parent.name +
', no inner walls have been defined.')
else:
self._sum_inner_wall_elements()
self._calc_inner_elements()
if len(self.thermal_zone.windows) < 1:
warnings.warn('For thermal zone ' + self.thermal_zone.name +
' in building ' + self.thermal_zone.parent.name +
', no windows have been defined.')
else:
self._sum_window_elements()
if len(self.thermal_zone.ground_floors) < 1:
warnings.warn('For thermal zone ' + self.thermal_zone.name +
' in building ' + self.thermal_zone.parent.name +
', no ground floors have been defined.')
else:
self._sum_ground_floor_elements()
self._calc_ground_floor_elements()
if len(self.thermal_zone.ground_floors) < 1:
warnings.warn('For thermal zone ' + self.thermal_zone.name +
' in building ' + self.thermal_zone.parent.name +
', no rooftops have been defined.')
else:
self._sum_rooftop_elements()
self._calc_rooftop_elements()
self._calc_inner_elements()
self._calc_outer_elements()
self._calc_wf()
self._calc_mean_values()
self._calc_number_of_elements()
Expand Down Expand Up @@ -958,6 +987,7 @@ def _sum_window_elements(self):
self.area_win = sum(win.area for win in self.thermal_zone.windows)
self.ua_value_win = sum(
win.ua_value for win in self.thermal_zone.windows)
self.u_value_win = self.ua_value_win/self.area_win

# values facing the inside of the thermal zone

Expand Down Expand Up @@ -1048,8 +1078,9 @@ def _calc_outer_elements(self):
if self.merge_windows is False:
try:

self.r1_win = (1 / sum((1 / win.r1) for
win in self.thermal_zone.windows))
if len(self.thermal_zone.windows) > 0:
self.r1_win = (1 / sum((1 / win.r1) for win in
self.thermal_zone.windows))

conduction = (1 / sum((1 / element.r_conduc) for element in
outer_walls))
Expand All @@ -1063,17 +1094,20 @@ def _calc_outer_elements(self):
if self.merge_windows is True:

try:
self.r1_win = 1 / sum(1 / (win.r1 / 6) for win in
self.thermal_zone.windows)

self.r1_ow = 1 / (1 / self.r1_ow + 1 / self.r1_win)
self.r_total_ow = 1 / (self.ua_value_ow + self.ua_value_win)
self.r_rest_ow = (self.r_total_ow - self.r1_ow - 1 / (
((1 / self.r_conv_inner_ow)
+ (1 / self.r_conv_inner_win)
+ (1 / self.r_rad_inner_ow)
+ (1 / self.r_rad_inner_win)))) - 1 / (
self.alpha_comb_outer_ow * self.area_ow)
if len(self.thermal_zone.windows) > 0:
self.r1_win = 1 / sum(1 / (win.r1 / 6) for win in
self.thermal_zone.windows)

self.r1_ow = 1 / (1 / self.r1_ow + 1 / self.r1_win)

self.r_total_ow = 1 / (self.ua_value_ow +
self.ua_value_win)
self.r_rest_ow = (self.r_total_ow - self.r1_ow - 1 / (
((1 / self.r_conv_inner_ow)
+ (1 / self.r_conv_inner_win)
+ (1 / self.r_rad_inner_ow)
+ (1 / self.r_rad_inner_win)))) - 1 / (
self.alpha_comb_outer_ow * self.area_ow)

self.ir_emissivity_inner_ow = (
(self.ir_emissivity_inner_ow * self.area_ow
Expand Down Expand Up @@ -1558,6 +1592,7 @@ def set_calc_default(self):

# UA-Value
self.ua_value_win = 0.0
self.u_value_win = 0.0

# resistances for heat transfer facing the inside of this thermal zone
self.r_conv_inner_win = 0.0
Expand Down
52 changes: 34 additions & 18 deletions teaser/logic/buildingobjects/calculation/one_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ class OneElement(object):
Area-weighted combined coefficient of heat transfer of windows facing
the ambient.
ua_value_win : float [W/K]
U-Value times outer wall area.
U-Value times window wall area.
u_value_win : float [W/(m2K)]
Area weighted U-Value of windows.
r_conv_inner_win : float [K/W]
Sum of convective resistances for all windows facing the
inside of this thermal zone.
Expand Down Expand Up @@ -278,6 +280,7 @@ def __init__(self, thermal_zone, merge_windows, t_bt):

# UA-Value
self.ua_value_win = 0.0
self.u_value_win = 0.0

# resistances for heat transfer facing the inside of this thermal zone
self.r_conv_inner_win = 0.0
Expand Down Expand Up @@ -328,8 +331,19 @@ def calc_attributes(self):
win.calc_ua_value()

self.set_calc_default()
if len(outer_walls) < 1:
warnings.warn("No walls are defined as outer walls for thermal " +
"zone " + self.thermal_zone.name + " in building " +
self.thermal_zone.parent.name +
", please be careful with results. In addition " +
"this might lead to RunTimeErrors")
self._sum_outer_wall_elements()
self._sum_window_elements()
if len(self.thermal_zone.windows) < 1:
warnings.warn('For thermal zone ' + self.thermal_zone.name +
' in building ' + self.thermal_zone.parent.name +
', no windows have been defined.')
else:
self._sum_window_elements()
self._calc_outer_elements()
self._calc_wf()
self._calc_mean_values()
Expand Down Expand Up @@ -545,6 +559,7 @@ def _sum_window_elements(self):
self.area_win = sum(win.area for win in self.thermal_zone.windows)
self.ua_value_win = sum(
win.ua_value for win in self.thermal_zone.windows)
self.u_value_win = self.ua_value_win/self.area_win

self.r_total_win = 1 / self.ua_value_win
# values facing the inside of the thermal zone
Expand Down Expand Up @@ -630,16 +645,13 @@ def _calc_outer_elements(self):
# more than one outer wall, calculate chain matrix
self.r1_ow, self.c1_ow = self._calc_parallel_connection(outer_walls,
omega)
else:
warnings.warn("No walls are defined as outer walls, please be "
"careful with results. In addition this might lead "
"to RunTimeErrors")

if self.merge_windows is False:
try:

self.r1_win = (1 / sum((1 / win.r1) for
win in self.thermal_zone.windows))
if len(self.thermal_zone.windows) > 0:
self.r1_win = (1 / sum((1 / win.r1) for win in
self.thermal_zone.windows))

conduction = (1 / sum((1 / element.r_conduc) for element in
outer_walls))
Expand All @@ -654,17 +666,20 @@ def _calc_outer_elements(self):

try:

self.r1_win = 1 / sum(1 / (win.r1 / 6) for win in
self.thermal_zone.windows)
if len(self.thermal_zone.windows) > 0:
self.r1_win = 1 / sum(1 / (win.r1 / 6) for win in
self.thermal_zone.windows)

self.r1_ow = 1 / (1 / self.r1_ow + 1 / self.r1_win)

self.r1_ow = 1 / (1 / self.r1_ow + 1 / self.r1_win)
self.r_total_ow = 1 / (self.ua_value_ow + self.ua_value_win)
self.r_rest_ow = (self.r_total_ow - self.r1_ow - 1 / (
((1 / self.r_conv_inner_ow)
+ (1 / self.r_conv_inner_win)
+ (1 / self.r_rad_inner_ow)
+ (1 / self.r_rad_inner_win)))) - 1 / (
self.alpha_comb_outer_ow * self.area_ow)
self.r_total_ow = 1 / (self.ua_value_ow +
self.ua_value_win)
self.r_rest_ow = (self.r_total_ow - self.r1_ow - 1 / (
((1 / self.r_conv_inner_ow)
+ (1 / self.r_conv_inner_win)
+ (1 / self.r_rad_inner_ow)
+ (1 / self.r_rad_inner_win)))) - 1 / (
self.alpha_comb_outer_ow * self.area_ow)

self.ir_emissivity_inner_ow = (
(self.ir_emissivity_inner_ow * self.area_ow
Expand Down Expand Up @@ -931,6 +946,7 @@ def set_calc_default(self):

# UA-Value
self.ua_value_win = 0.0
self.u_value_win = 0.0

# resistances for heat transfer facing the inside of this thermal zone
self.r_conv_inner_win = 0.0
Expand Down
Loading

0 comments on commit 38ec436

Please sign in to comment.