fixed the tcold bug

This commit is contained in:
Pilar Monsalvete 2023-03-21 16:11:58 -04:00
parent f3db1e5fee
commit 28dd0f8b0f
3 changed files with 19 additions and 13 deletions

View File

@ -126,17 +126,18 @@ class InselMonthlyEnergyBalance(Insel):
for thermal_boundary in thermal_zone.thermal_boundaries:
type_code = _CONSTRUCTION_CODE[thermal_boundary.type]
window_area = 0
if thermal_boundary.window_ratio < 1:
window_area = thermal_boundary.opaque_area * thermal_boundary.window_ratio / (1 - thermal_boundary.window_ratio)
wall_area = thermal_boundary.opaque_area * (1 + thermal_boundary.window_ratio)
if thermal_boundary.type == cte.WALL:
wall_area = wall_area * (1 - thermal_boundary.parent_surface.percentage_shared)
window_area = wall_area * thermal_boundary.window_ratio
parameters.append(type_code)
if thermal_boundary.type != cte.GROUND:
parameters.append(thermal_boundary.opaque_area + window_area)
parameters.append(wall_area)
parameters.append('0.0')
else:
parameters.append('0.0')
parameters.append(thermal_boundary.opaque_area + window_area)
parameters.append(wall_area)
parameters.append(thermal_boundary.u_value)
parameters.append(window_area)

View File

@ -106,6 +106,8 @@ class ComnetUsageParameters:
_domestic_hot_water = DomesticHotWater()
_domestic_hot_water.density = archetype.domestic_hot_water.density
_domestic_hot_water.service_temperature = archetype.domestic_hot_water.service_temperature
peak_flow = None
if len(cold_water_temperature) > 0:
cold_temperature = cold_water_temperature[cte.YEAR]['epw']
peak_flow = 0
if (archetype.domestic_hot_water.service_temperature - cold_temperature) > 0:

View File

@ -116,9 +116,12 @@ class NrcanUsageParameters:
_domestic_hot_water = DomesticHotWater()
_domestic_hot_water.peak_flow = archetype.domestic_hot_water.peak_flow
_domestic_hot_water.service_temperature = archetype.domestic_hot_water.service_temperature
density = None
if len(cold_water_temperature) > 0:
cold_temperature = cold_water_temperature[cte.YEAR]['epw']
_domestic_hot_water.density = archetype.domestic_hot_water.peak_flow * cte.WATER_DENSITY * cte.WATER_HEAT_CAPACITY \
density = archetype.domestic_hot_water.peak_flow * cte.WATER_DENSITY * cte.WATER_HEAT_CAPACITY \
* (archetype.domestic_hot_water.service_temperature - cold_temperature)
_domestic_hot_water.density = density
_domestic_hot_water.schedules = archetype.domestic_hot_water.schedules
usage.domestic_hot_water = _domestic_hot_water