Merge pull request 'ep_23.2.0' (#58) from ep_23.2.0 into main

Reviewed-on: https://nextgenerations-cities.encs.concordia.ca/gitea/CERC/hub/pulls/58
This commit is contained in:
Guille Gutierrez 2023-12-07 13:22:23 -05:00
commit e025510c93
5 changed files with 13902 additions and 1336 deletions

View File

@ -276,11 +276,11 @@ class Idf:
self._idf.newidfobject(self._COMPACT_SCHEDULE, **_kwargs)
def _write_schedules_file(self, usage, schedule):
file_name = str((Path(self._output_path) / f'{schedule.type} schedules {usage}.dat').resolve())
file_name = str((Path(self._output_path) / f'{schedule.type} schedules {usage}.csv').resolve())
with open(file_name, 'w', encoding='utf8') as file:
for value in schedule.values:
file.write(f'{str(value)},\n')
return file_name
return Path(file_name).name
def _add_file_schedule(self, usage, schedule, file_name):
_schedule = self._idf.newidfobject(self._FILE_SCHEDULE, Name=f'{schedule.type} schedules {usage}')
@ -403,7 +403,7 @@ class Idf:
self._idf.newidfobject(self._PEOPLE,
Name=f'{zone_name}_occupancy',
Zone_or_ZoneList_Name=zone_name,
Zone_or_ZoneList_or_Space_or_SpaceList_Name=zone_name,
Number_of_People_Schedule_Name=f'Occupancy schedules {thermal_zone.usage_name}',
Number_of_People_Calculation_Method="People",
Number_of_People=number_of_people,
@ -420,7 +420,7 @@ class Idf:
self._idf.newidfobject(self._LIGHTS,
Name=f'{zone_name}_lights',
Zone_or_ZoneList_Name=zone_name,
Zone_or_ZoneList_or_Space_or_SpaceList_Name=zone_name,
Schedule_Name=f'Lighting schedules {thermal_zone.usage_name}',
Design_Level_Calculation_Method=method,
Watts_per_Zone_Floor_Area=watts_per_zone_floor_area,
@ -439,7 +439,7 @@ class Idf:
self._idf.newidfobject(self._APPLIANCES,
Fuel_Type=fuel_type,
Name=f'{zone_name}_appliance',
Zone_or_ZoneList_Name=zone_name,
Zone_or_ZoneList_or_Space_or_SpaceList_Name=zone_name,
Schedule_Name=f'Appliance schedules {thermal_zone.usage_name}',
Design_Level_Calculation_Method=method,
Power_per_Zone_Floor_Area=watts_per_zone_floor_area,
@ -453,7 +453,7 @@ class Idf:
_infiltration = thermal_zone.infiltration_rate_system_off * cte.HOUR_TO_SECONDS
self._idf.newidfobject(self._INFILTRATION,
Name=f'{zone_name}_infiltration',
Zone_or_ZoneList_Name=zone_name,
Zone_or_ZoneList_or_Space_or_SpaceList_Name=zone_name,
Schedule_Name=schedule,
Design_Flow_Rate_Calculation_Method='AirChanges/Hour',
Air_Changes_per_Hour=_infiltration
@ -464,7 +464,7 @@ class Idf:
_air_change = thermal_zone.mechanical_air_change * cte.HOUR_TO_SECONDS
self._idf.newidfobject(self._VENTILATION,
Name=f'{zone_name}_ventilation',
Zone_or_ZoneList_Name=zone_name,
Zone_or_ZoneList_or_Space_or_SpaceList_Name=zone_name,
Schedule_Name=schedule,
Design_Flow_Rate_Calculation_Method='AirChanges/Hour',
Air_Changes_per_Hour=_air_change
@ -627,8 +627,8 @@ class Idf:
self._idf.intersect_match()
def _add_shading(self, building):
for surface in building.surfaces:
shading = self._idf.newidfobject(self._SHADING, Name=f'{surface.name}')
for i, surface in enumerate(building.surfaces):
shading = self._idf.newidfobject(self._SHADING, Name=f'{building.name}_{i}')
coordinates = self._matrix_to_list(surface.solid_polygon.coordinates,
self._city.lower_corner)
shading.setcoords(coordinates)
@ -636,17 +636,17 @@ class Idf:
if solar_reflectance is None:
solar_reflectance = ConfigurationHelper().short_wave_reflectance
self._idf.newidfobject(self._SHADING_PROPERTY,
Shading_Surface_Name=f'{surface.name}',
Shading_Surface_Name=f'{building.name}_{i}',
Diffuse_Solar_Reflectance_of_Unglazed_Part_of_Shading_Surface=solar_reflectance,
Fraction_of_Shading_Surface_That_Is_Glazed=0)
def _add_pure_geometry(self, building, zone_name):
for surface in building.surfaces:
for index, surface in enumerate(building.surfaces):
outside_boundary_condition = 'Outdoors'
sun_exposure = 'SunExposed'
wind_exposure = 'WindExposed'
idf_surface_type = self.idf_surfaces[surface.type]
_kwargs = {'Name': f'{surface.name}',
_kwargs = {'Name': f'Building_{building.name}_surface_{index}',
'Surface_Type': idf_surface_type,
'Zone_Name': zone_name}
if surface.type == cte.GROUND:
@ -655,7 +655,7 @@ class Idf:
wind_exposure = 'NoWind'
if surface.percentage_shared is not None and surface.percentage_shared > 0.5:
outside_boundary_condition = 'Surface'
outside_boundary_condition_object = surface.name
outside_boundary_condition_object = f'Building_{building.name}_surface_{index}'
sun_exposure = 'NoSun'
wind_exposure = 'NoWind'
_kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object
@ -680,12 +680,12 @@ class Idf:
def _add_surfaces(self, building, zone_name):
for thermal_zone in building.thermal_zones_from_internal_zones:
for boundary in thermal_zone.thermal_boundaries:
for index, boundary in enumerate(thermal_zone.thermal_boundaries):
idf_surface_type = self.idf_surfaces[boundary.parent_surface.type]
outside_boundary_condition = 'Outdoors'
sun_exposure = 'SunExposed'
wind_exposure = 'WindExposed'
_kwargs = {'Name': f'{boundary.parent_surface.name}',
_kwargs = {'Name': f'Building_{building.name}_surface_{index}',
'Surface_Type': idf_surface_type,
'Zone_Name': zone_name}
if boundary.parent_surface.type == cte.GROUND:
@ -694,7 +694,7 @@ class Idf:
wind_exposure = 'NoWind'
if boundary.parent_surface.percentage_shared is not None and boundary.parent_surface.percentage_shared > 0.5:
outside_boundary_condition = 'Surface'
outside_boundary_condition_object = boundary.parent_surface.name
outside_boundary_condition_object = f'Building_{building.name}_surface_{index}'
sun_exposure = 'NoSun'
wind_exposure = 'NoWind'
_kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
! HVAC: None.
!
Version,9.5;
Version,23.2;
Timestep,4;
@ -127,31 +127,25 @@
No, !- Do HVAC Sizing Simulation for Sizing Periods
1; !- Maximum Number of HVAC Sizing Simulation Passes
Output:Table:SummaryReports, AnnualBuildingUtilityPerformanceSummary,
DemandEndUseComponentsSummary,
SensibleHeatGainSummary,
InputVerificationandResultsSummary,
AdaptiveComfortSummary,
Standard62.1Summary,
ClimaticDataSummary,
EquipmentSummary,
EnvelopeSummary,
LightingSummary,
HVACSizingSummary,
SystemSummary,
ComponentSizingSummary,
OutdoorAirSummary,
ObjectCountSummary,
EndUseEnergyConsumptionOtherFuelsMonthly,
PeakEnergyEndUseOtherFuelsMonthly;
Output:VariableDictionary,Regular;
Output:Variable,*,Site Outdoor Air Drybulb Temperature,Timestep;
OutputControl:Table:Style, CommaAndHTML,JtoKWH;
Output:Variable,*,Site Outdoor Air Wetbulb Temperature,Timestep;
Output:Meter,DISTRICTHEATING:Facility,hourly;
Output:Meter,DISTRICTCOOLING:Facility,hourly;
Output:Meter,InteriorEquipment:Electricity,hourly;
Output:Meter,InteriorLights:Electricity,hourly;
Output:Variable,*,Site Outdoor Air Dewpoint Temperature,Timestep;
Output:Variable,*,Site Solar Azimuth Angle,Timestep;
Output:Variable,*,Site Solar Altitude Angle,Timestep;
Output:Variable,*,Site Direct Solar Radiation Rate per Area,Timestep;
Output:Variable,*,Site Diffuse Solar Radiation Rate per Area,Timestep;
OutputControl:Table:Style,
HTML; !- Column Separator
Output:Table:SummaryReports,
AllSummary; !- Report 1 Name
OutputControl:IlluminanceMap:Style,
Comma; !- Column separator

View File

@ -213,8 +213,6 @@ class Geojson:
polygon = Polygon(coordinates)
polygon.area = igh.ground_area(coordinates)
surfaces[-1] = Surface(polygon, polygon)
if len(surfaces) > 1:
raise ValueError('too many surfaces!!!!')
building = Building(f'{building_name}', surfaces, year_of_construction, function)
for alias in building_aliases:
building.add_alias(alias)

View File

@ -143,7 +143,6 @@ class TestExports(TestCase):
EnergyBuildingsExportsFactory('idf', city, self._output_path).export()
UsageFactory('nrcan', city).enrich()
WeatherFactory('epw', city).enrich()
print(self._output_path)
try:
EnergyBuildingsExportsFactory('idf', city, self._output_path).export()
except Exception: