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:
commit
e025510c93
|
@ -276,11 +276,11 @@ class Idf:
|
||||||
self._idf.newidfobject(self._COMPACT_SCHEDULE, **_kwargs)
|
self._idf.newidfobject(self._COMPACT_SCHEDULE, **_kwargs)
|
||||||
|
|
||||||
def _write_schedules_file(self, usage, schedule):
|
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:
|
with open(file_name, 'w', encoding='utf8') as file:
|
||||||
for value in schedule.values:
|
for value in schedule.values:
|
||||||
file.write(f'{str(value)},\n')
|
file.write(f'{str(value)},\n')
|
||||||
return file_name
|
return Path(file_name).name
|
||||||
|
|
||||||
def _add_file_schedule(self, usage, schedule, file_name):
|
def _add_file_schedule(self, usage, schedule, file_name):
|
||||||
_schedule = self._idf.newidfobject(self._FILE_SCHEDULE, Name=f'{schedule.type} schedules {usage}')
|
_schedule = self._idf.newidfobject(self._FILE_SCHEDULE, Name=f'{schedule.type} schedules {usage}')
|
||||||
|
@ -403,7 +403,7 @@ class Idf:
|
||||||
|
|
||||||
self._idf.newidfobject(self._PEOPLE,
|
self._idf.newidfobject(self._PEOPLE,
|
||||||
Name=f'{zone_name}_occupancy',
|
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_Schedule_Name=f'Occupancy schedules {thermal_zone.usage_name}',
|
||||||
Number_of_People_Calculation_Method="People",
|
Number_of_People_Calculation_Method="People",
|
||||||
Number_of_People=number_of_people,
|
Number_of_People=number_of_people,
|
||||||
|
@ -420,7 +420,7 @@ class Idf:
|
||||||
|
|
||||||
self._idf.newidfobject(self._LIGHTS,
|
self._idf.newidfobject(self._LIGHTS,
|
||||||
Name=f'{zone_name}_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}',
|
Schedule_Name=f'Lighting schedules {thermal_zone.usage_name}',
|
||||||
Design_Level_Calculation_Method=method,
|
Design_Level_Calculation_Method=method,
|
||||||
Watts_per_Zone_Floor_Area=watts_per_zone_floor_area,
|
Watts_per_Zone_Floor_Area=watts_per_zone_floor_area,
|
||||||
|
@ -439,7 +439,7 @@ class Idf:
|
||||||
self._idf.newidfobject(self._APPLIANCES,
|
self._idf.newidfobject(self._APPLIANCES,
|
||||||
Fuel_Type=fuel_type,
|
Fuel_Type=fuel_type,
|
||||||
Name=f'{zone_name}_appliance',
|
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}',
|
Schedule_Name=f'Appliance schedules {thermal_zone.usage_name}',
|
||||||
Design_Level_Calculation_Method=method,
|
Design_Level_Calculation_Method=method,
|
||||||
Power_per_Zone_Floor_Area=watts_per_zone_floor_area,
|
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
|
_infiltration = thermal_zone.infiltration_rate_system_off * cte.HOUR_TO_SECONDS
|
||||||
self._idf.newidfobject(self._INFILTRATION,
|
self._idf.newidfobject(self._INFILTRATION,
|
||||||
Name=f'{zone_name}_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,
|
Schedule_Name=schedule,
|
||||||
Design_Flow_Rate_Calculation_Method='AirChanges/Hour',
|
Design_Flow_Rate_Calculation_Method='AirChanges/Hour',
|
||||||
Air_Changes_per_Hour=_infiltration
|
Air_Changes_per_Hour=_infiltration
|
||||||
|
@ -464,7 +464,7 @@ class Idf:
|
||||||
_air_change = thermal_zone.mechanical_air_change * cte.HOUR_TO_SECONDS
|
_air_change = thermal_zone.mechanical_air_change * cte.HOUR_TO_SECONDS
|
||||||
self._idf.newidfobject(self._VENTILATION,
|
self._idf.newidfobject(self._VENTILATION,
|
||||||
Name=f'{zone_name}_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,
|
Schedule_Name=schedule,
|
||||||
Design_Flow_Rate_Calculation_Method='AirChanges/Hour',
|
Design_Flow_Rate_Calculation_Method='AirChanges/Hour',
|
||||||
Air_Changes_per_Hour=_air_change
|
Air_Changes_per_Hour=_air_change
|
||||||
|
@ -627,8 +627,8 @@ class Idf:
|
||||||
self._idf.intersect_match()
|
self._idf.intersect_match()
|
||||||
|
|
||||||
def _add_shading(self, building):
|
def _add_shading(self, building):
|
||||||
for surface in building.surfaces:
|
for i, surface in enumerate(building.surfaces):
|
||||||
shading = self._idf.newidfobject(self._SHADING, Name=f'{surface.name}')
|
shading = self._idf.newidfobject(self._SHADING, Name=f'{building.name}_{i}')
|
||||||
coordinates = self._matrix_to_list(surface.solid_polygon.coordinates,
|
coordinates = self._matrix_to_list(surface.solid_polygon.coordinates,
|
||||||
self._city.lower_corner)
|
self._city.lower_corner)
|
||||||
shading.setcoords(coordinates)
|
shading.setcoords(coordinates)
|
||||||
|
@ -636,17 +636,17 @@ class Idf:
|
||||||
if solar_reflectance is None:
|
if solar_reflectance is None:
|
||||||
solar_reflectance = ConfigurationHelper().short_wave_reflectance
|
solar_reflectance = ConfigurationHelper().short_wave_reflectance
|
||||||
self._idf.newidfobject(self._SHADING_PROPERTY,
|
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,
|
Diffuse_Solar_Reflectance_of_Unglazed_Part_of_Shading_Surface=solar_reflectance,
|
||||||
Fraction_of_Shading_Surface_That_Is_Glazed=0)
|
Fraction_of_Shading_Surface_That_Is_Glazed=0)
|
||||||
|
|
||||||
def _add_pure_geometry(self, building, zone_name):
|
def _add_pure_geometry(self, building, zone_name):
|
||||||
for surface in building.surfaces:
|
for index, surface in enumerate(building.surfaces):
|
||||||
outside_boundary_condition = 'Outdoors'
|
outside_boundary_condition = 'Outdoors'
|
||||||
sun_exposure = 'SunExposed'
|
sun_exposure = 'SunExposed'
|
||||||
wind_exposure = 'WindExposed'
|
wind_exposure = 'WindExposed'
|
||||||
idf_surface_type = self.idf_surfaces[surface.type]
|
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,
|
'Surface_Type': idf_surface_type,
|
||||||
'Zone_Name': zone_name}
|
'Zone_Name': zone_name}
|
||||||
if surface.type == cte.GROUND:
|
if surface.type == cte.GROUND:
|
||||||
|
@ -655,7 +655,7 @@ class Idf:
|
||||||
wind_exposure = 'NoWind'
|
wind_exposure = 'NoWind'
|
||||||
if surface.percentage_shared is not None and surface.percentage_shared > 0.5:
|
if surface.percentage_shared is not None and surface.percentage_shared > 0.5:
|
||||||
outside_boundary_condition = 'Surface'
|
outside_boundary_condition = 'Surface'
|
||||||
outside_boundary_condition_object = surface.name
|
outside_boundary_condition_object = f'Building_{building.name}_surface_{index}'
|
||||||
sun_exposure = 'NoSun'
|
sun_exposure = 'NoSun'
|
||||||
wind_exposure = 'NoWind'
|
wind_exposure = 'NoWind'
|
||||||
_kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object
|
_kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object
|
||||||
|
@ -680,12 +680,12 @@ class Idf:
|
||||||
|
|
||||||
def _add_surfaces(self, building, zone_name):
|
def _add_surfaces(self, building, zone_name):
|
||||||
for thermal_zone in building.thermal_zones_from_internal_zones:
|
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]
|
idf_surface_type = self.idf_surfaces[boundary.parent_surface.type]
|
||||||
outside_boundary_condition = 'Outdoors'
|
outside_boundary_condition = 'Outdoors'
|
||||||
sun_exposure = 'SunExposed'
|
sun_exposure = 'SunExposed'
|
||||||
wind_exposure = 'WindExposed'
|
wind_exposure = 'WindExposed'
|
||||||
_kwargs = {'Name': f'{boundary.parent_surface.name}',
|
_kwargs = {'Name': f'Building_{building.name}_surface_{index}',
|
||||||
'Surface_Type': idf_surface_type,
|
'Surface_Type': idf_surface_type,
|
||||||
'Zone_Name': zone_name}
|
'Zone_Name': zone_name}
|
||||||
if boundary.parent_surface.type == cte.GROUND:
|
if boundary.parent_surface.type == cte.GROUND:
|
||||||
|
@ -694,7 +694,7 @@ class Idf:
|
||||||
wind_exposure = 'NoWind'
|
wind_exposure = 'NoWind'
|
||||||
if boundary.parent_surface.percentage_shared is not None and boundary.parent_surface.percentage_shared > 0.5:
|
if boundary.parent_surface.percentage_shared is not None and boundary.parent_surface.percentage_shared > 0.5:
|
||||||
outside_boundary_condition = 'Surface'
|
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'
|
sun_exposure = 'NoSun'
|
||||||
wind_exposure = 'NoWind'
|
wind_exposure = 'NoWind'
|
||||||
_kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object
|
_kwargs['Outside_Boundary_Condition_Object'] = outside_boundary_condition_object
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,7 +13,7 @@
|
||||||
! HVAC: None.
|
! HVAC: None.
|
||||||
!
|
!
|
||||||
|
|
||||||
Version,9.5;
|
Version,23.2;
|
||||||
|
|
||||||
Timestep,4;
|
Timestep,4;
|
||||||
|
|
||||||
|
@ -127,31 +127,25 @@
|
||||||
No, !- Do HVAC Sizing Simulation for Sizing Periods
|
No, !- Do HVAC Sizing Simulation for Sizing Periods
|
||||||
1; !- Maximum Number of HVAC Sizing Simulation Passes
|
1; !- Maximum Number of HVAC Sizing Simulation Passes
|
||||||
|
|
||||||
Output:Table:SummaryReports, AnnualBuildingUtilityPerformanceSummary,
|
Output:VariableDictionary,Regular;
|
||||||
DemandEndUseComponentsSummary,
|
|
||||||
SensibleHeatGainSummary,
|
|
||||||
InputVerificationandResultsSummary,
|
|
||||||
AdaptiveComfortSummary,
|
|
||||||
Standard62.1Summary,
|
|
||||||
ClimaticDataSummary,
|
|
||||||
EquipmentSummary,
|
|
||||||
EnvelopeSummary,
|
|
||||||
LightingSummary,
|
|
||||||
HVACSizingSummary,
|
|
||||||
SystemSummary,
|
|
||||||
ComponentSizingSummary,
|
|
||||||
OutdoorAirSummary,
|
|
||||||
ObjectCountSummary,
|
|
||||||
EndUseEnergyConsumptionOtherFuelsMonthly,
|
|
||||||
PeakEnergyEndUseOtherFuelsMonthly;
|
|
||||||
|
|
||||||
|
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:Variable,*,Site Outdoor Air Dewpoint Temperature,Timestep;
|
||||||
Output:Meter,DISTRICTCOOLING:Facility,hourly;
|
|
||||||
Output:Meter,InteriorEquipment:Electricity,hourly;
|
Output:Variable,*,Site Solar Azimuth Angle,Timestep;
|
||||||
Output:Meter,InteriorLights:Electricity,hourly;
|
|
||||||
|
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
|
|
||||||
|
|
|
@ -213,8 +213,6 @@ class Geojson:
|
||||||
polygon = Polygon(coordinates)
|
polygon = Polygon(coordinates)
|
||||||
polygon.area = igh.ground_area(coordinates)
|
polygon.area = igh.ground_area(coordinates)
|
||||||
surfaces[-1] = Surface(polygon, polygon)
|
surfaces[-1] = Surface(polygon, polygon)
|
||||||
if len(surfaces) > 1:
|
|
||||||
raise ValueError('too many surfaces!!!!')
|
|
||||||
building = Building(f'{building_name}', surfaces, year_of_construction, function)
|
building = Building(f'{building_name}', surfaces, year_of_construction, function)
|
||||||
for alias in building_aliases:
|
for alias in building_aliases:
|
||||||
building.add_alias(alias)
|
building.add_alias(alias)
|
||||||
|
|
|
@ -143,7 +143,6 @@ class TestExports(TestCase):
|
||||||
EnergyBuildingsExportsFactory('idf', city, self._output_path).export()
|
EnergyBuildingsExportsFactory('idf', city, self._output_path).export()
|
||||||
UsageFactory('nrcan', city).enrich()
|
UsageFactory('nrcan', city).enrich()
|
||||||
WeatherFactory('epw', city).enrich()
|
WeatherFactory('epw', city).enrich()
|
||||||
print(self._output_path)
|
|
||||||
try:
|
try:
|
||||||
EnergyBuildingsExportsFactory('idf', city, self._output_path).export()
|
EnergyBuildingsExportsFactory('idf', city, self._output_path).export()
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user