Incorporation of ventilation that previously was not writing idf. Working.

Incorporation of percentual losses in distribution
This commit is contained in:
Oriol Gavalda 2023-05-19 18:05:36 -04:00
parent de066b25fb
commit c77c03b759
2 changed files with 24 additions and 71 deletions

View File

@ -113,50 +113,18 @@
<electrical_efficiency>0.22</electrical_efficiency> <electrical_efficiency>0.22</electrical_efficiency>
<storage>true</storage> <storage>true</storage>
</system> </system>
<system id="11" type="water distribution and fancoils" fuel_type="electricity">
<name>Water distribution and fancoils</name>
<demands>
<demand>electricity</demand>
</demands>
<distribution_heat_losses units="%">0</distribution_heat_losses>
<distribution_consumption_fix_flow units="%">4</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">4</distribution_consumption_variable_flow>
<storage>false</storage>
</system>
<system id="12" type="air distribution central" fuel_type="electricity">
<name>Air distribution central</name>
<demands>
<demand>electricity</demand>
</demands>
<distribution_heat_losses units="%">0</distribution_heat_losses>
<distribution_consumption_fix_flow units="%">4</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">4</distribution_consumption_variable_flow>
<storage>false</storage>
</system>
<system id="13" type="DX distribution central" fuel_type="electricity">
<name>DX distribution central</name>
<demands>
<demand>electricity</demand>
</demands>
<distribution_heat_losses units="%">0</distribution_heat_losses>
<distribution_consumption_fix_flow units="%">4</distribution_consumption_fix_flow>
<distribution_consumption_variable_flow units="%">4</distribution_consumption_variable_flow>
<storage>false</storage>
</system>
</systems> </systems>
<system_clusters> <system_clusters>
<system_cluster name="system 1 gas"> <system_cluster name="system 1 gas">
<systems> <systems>
<system_id>1</system_id> <system_id>1</system_id>
<system_id>7</system_id> <system_id>7</system_id>
<system_id>13</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 1 gas pv"> <system_cluster name="system 1 gas pv">
<systems> <systems>
<system_id>1</system_id> <system_id>1</system_id>
<system_id>7</system_id> <system_id>7</system_id>
<system_id>13</system_id>
<system_id>10</system_id> <system_id>10</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
@ -164,14 +132,12 @@
<systems> <systems>
<system_id>2</system_id> <system_id>2</system_id>
<system_id>7</system_id> <system_id>7</system_id>
<system_id>13</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 1 electricity pv"> <system_cluster name="system 1 electricity pv">
<systems> <systems>
<system_id>2</system_id> <system_id>2</system_id>
<system_id>7</system_id> <system_id>7</system_id>
<system_id>13</system_id>
<system_id>10</system_id> <system_id>10</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
@ -179,14 +145,12 @@
<systems> <systems>
<system_id>1</system_id> <system_id>1</system_id>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>11</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 2 gas pv"> <system_cluster name="system 2 gas pv">
<systems> <systems>
<system_id>1</system_id> <system_id>1</system_id>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>11</system_id>
<system_id>10</system_id> <system_id>10</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
@ -194,14 +158,12 @@
<systems> <systems>
<system_id>2</system_id> <system_id>2</system_id>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>11</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 2 electricity pv"> <system_cluster name="system 2 electricity pv">
<systems> <systems>
<system_id>2</system_id> <system_id>2</system_id>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>11</system_id>
<system_id>10</system_id> <system_id>10</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
@ -209,14 +171,12 @@
<systems> <systems>
<system_id>3</system_id> <system_id>3</system_id>
<system_id>4</system_id> <system_id>4</system_id>
<system_id>13</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 3 and 4 gas pv"> <system_cluster name="system 3 and 4 gas pv">
<systems> <systems>
<system_id>3</system_id> <system_id>3</system_id>
<system_id>4</system_id> <system_id>4</system_id>
<system_id>13</system_id>
<system_id>10</system_id> <system_id>10</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
@ -224,27 +184,23 @@
<systems> <systems>
<system_id>4</system_id> <system_id>4</system_id>
<system_id>4</system_id> <system_id>4</system_id>
<system_id>13</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 3 and 4 electricity pv"> <system_cluster name="system 3 and 4 electricity pv">
<systems> <systems>
<system_id>4</system_id> <system_id>4</system_id>
<system_id>4</system_id> <system_id>4</system_id>
<system_id>13</system_id>
<system_id>10</system_id> <system_id>10</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 5"> <system_cluster name="system 5">
<systems> <systems>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>11</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 5 pv"> <system_cluster name="system 5 pv">
<systems> <systems>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>11</system_id>
<system_id>10</system_id> <system_id>10</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
@ -252,14 +208,12 @@
<systems> <systems>
<system_id>5</system_id> <system_id>5</system_id>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>12</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 6 gas pv"> <system_cluster name="system 6 gas pv">
<systems> <systems>
<system_id>5</system_id> <system_id>5</system_id>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>12</system_id>
<system_id>10</system_id> <system_id>10</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
@ -267,14 +221,12 @@
<systems> <systems>
<system_id>6</system_id> <system_id>6</system_id>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>12</system_id>
</systems> </systems>
</system_cluster> </system_cluster>
<system_cluster name="system 6 electricity pv"> <system_cluster name="system 6 electricity pv">
<systems> <systems>
<system_id>6</system_id> <system_id>6</system_id>
<system_id>8</system_id> <system_id>8</system_id>
<system_id>12</system_id>
<system_id>10</system_id> <system_id>10</system_id>
</systems> </systems>
</system_cluster> </system_cluster>

View File

@ -427,9 +427,9 @@ class Idf:
for zone in self._idf.idfobjects["ZONE"]: for zone in self._idf.idfobjects["ZONE"]:
if zone.Name == f'{zone_name}_infiltration': if zone.Name == f'{zone_name}_infiltration':
return return
schedule = f'Infiltration schedules {thermal_zone.usage_name}' schedule = f'Ventilation schedules {thermal_zone.usage_name}'
if schedule not in self._idf.idfobjects[self._HOURLY_SCHEDULE]: #if schedule not in self._idf.idfobjects[self._HOURLY_SCHEDULE]:
return # return
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_Name=zone_name,
@ -443,15 +443,15 @@ class Idf:
if zone.Name == f'{zone_name}_ventilation': if zone.Name == f'{zone_name}_ventilation':
return return
schedule = f'Ventilation schedules {thermal_zone.usage_name}' schedule = f'Ventilation schedules {thermal_zone.usage_name}'
if schedule not in self._idf.idfobjects[self._HOURLY_SCHEDULE]: #if schedule not in self._idf.idfobjects[self._HOURLY_SCHEDULE]:
return # return
# todo: revise ventilation with Pilar # todo: revise ventilation with Pilar
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_Name=zone_name,
Schedule_Name=schedule, Schedule_Name=schedule,
Design_Flow_Rate_Calculation_Method='AirChanges/Hour', Design_Flow_Rate_Calculation_Method='AirChanges/Hour',
Flow_Rate_per_Zone_Floor_Area=thermal_zone.mechanical_air_change Air_Changes_per_Hour=thermal_zone.mechanical_air_change
) )
def _add_dhw(self, thermal_zone, zone_name): def _add_dhw(self, thermal_zone, zone_name):
@ -510,8 +510,8 @@ class Idf:
if building.name in self._target_buildings or building.name in self._adjacent_buildings: if building.name in self._target_buildings or building.name in self._adjacent_buildings:
_new_schedules = self._create_infiltration_schedules(thermal_zone) _new_schedules = self._create_infiltration_schedules(thermal_zone)
self._add_schedules(usage, 'Infiltration', _new_schedules) self._add_schedules(usage, 'Infiltration', _new_schedules)
_new_schedules2 = self._create_ventilation_schedules(thermal_zone) _new_schedules = self._create_ventilation_schedules(thermal_zone)
self._add_schedules(usage, 'Ventilation', _new_schedules2) self._add_schedules(usage, 'Ventilation', _new_schedules)
self._add_schedules(usage, 'Occupancy', thermal_zone.occupancy.occupancy_schedules) self._add_schedules(usage, 'Occupancy', thermal_zone.occupancy.occupancy_schedules)
self._add_schedules(usage, 'HVAC AVAIL', thermal_zone.thermal_control.hvac_availability_schedules) self._add_schedules(usage, 'HVAC AVAIL', thermal_zone.thermal_control.hvac_availability_schedules)
self._add_schedules(usage, 'Heating thermostat', thermal_zone.thermal_control.heating_set_point_schedules) self._add_schedules(usage, 'Heating thermostat', thermal_zone.thermal_control.heating_set_point_schedules)
@ -536,6 +536,7 @@ class Idf:
self._add_zone(thermal_zone, building.name) self._add_zone(thermal_zone, building.name)
self._add_heating_system(thermal_zone, building.name) self._add_heating_system(thermal_zone, building.name)
self._add_infiltration(thermal_zone, building.name) self._add_infiltration(thermal_zone, building.name)
self._add_ventilation(thermal_zone, building.name)
self._add_occupancy(thermal_zone, building.name) self._add_occupancy(thermal_zone, building.name)
self._add_lighting(thermal_zone, building.name) self._add_lighting(thermal_zone, building.name)
self._add_appliances(thermal_zone, building.name) self._add_appliances(thermal_zone, building.name)