Skip to content

Commit

Permalink
Ideal Air Systems Overhaul
Browse files Browse the repository at this point in the history
At the request of @mostaphaRoudsari and the realization that the
original Ideal Air HVAC template was good, I have returned the HVAC
system to it's original state with one exception:  the old template was
not linked to the outdoor air control object.  I took this as an error
and linked the system to the outdoor air object.  I also exposed the
ability to change a lot of the parameters including the HVAC
availability schedule and many of the aspects of the Ideal Air System
like heat recovery, air economizers, and demand controlled ventilation.
  • Loading branch information
chriswmackey committed Jan 11, 2015
1 parent c099e19 commit f3801f5
Show file tree
Hide file tree
Showing 14 changed files with 342 additions and 245 deletions.
244 changes: 70 additions & 174 deletions src/Honeybee_ Run Energy Simulation.py

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions src/Honeybee_Honeybee.py
Expand Up @@ -29,7 +29,7 @@

ghenv.Component.Name = "Honeybee_Honeybee"
ghenv.Component.NickName = 'Honeybee'
ghenv.Component.Message = 'VER 0.0.55\nJAN_07_2015'
ghenv.Component.Message = 'VER 0.0.55\nJAN_10_2015'
ghenv.Component.Category = "Honeybee"
ghenv.Component.SubCategory = "00 | Honeybee"
try: ghenv.Component.AdditionalHelpFromDocStrings = "1"
Expand Down Expand Up @@ -4328,6 +4328,15 @@ def __init__(self, zoneBrep, zoneID, zoneName, program = [None, None], isConditi
self.heatingSetback= ""
self.coolSupplyAirTemp= ""
self.heatSupplyAirTemp= ""
self.coolingCapacity= ""
self.heatingCapacity= ""

self.demandVent= ""
self.airSideEconomizer= ""
self.heatRecovery= ""
self.heatRecoveryEffectiveness= ""

self.HVACAvailabilitySched = ""

if zoneBrep != None:
self.isClosed = self.geometry.IsSolid
Expand Down Expand Up @@ -4425,7 +4434,8 @@ def getCurrentSchedules(self, returnDictionary = False, component = None):
"coolingSetPtSchedule: " + str(self.coolingSetPtSchedule) + "\n" + \
"lightingSchedule: " + str(self.lightingSchedule) + "\n" + \
"equipmentSchedule: " + str(self.equipmentSchedule) + "\n" + \
"infiltrationSchedule: " + str(self.infiltrationSchedule) + "."
"infiltrationSchedule: " + str(self.infiltrationSchedule)+ "\n" + \
"HVACAvailabilitySched: " + str(self.HVACAvailabilitySched) + "."

return report

Expand All @@ -4436,7 +4446,8 @@ def getCurrentSchedules(self, returnDictionary = False, component = None):
"coolingSetPtSchedule" : str(self.coolingSetPtSchedule),
"lightingSchedule" : str(self.lightingSchedule),
"equipmentSchedule" : str(self.equipmentSchedule),
"infiltrationSchedule" : str(self.infiltrationSchedule)}
"infiltrationSchedule" : str(self.infiltrationSchedule),
"HVACAvailabilitySched" : str(self.HVACAvailabilitySched)}

return scheduleDict

Expand Down
40 changes: 20 additions & 20 deletions src/Honeybee_Read EP HVAC Result.py
Expand Up @@ -26,7 +26,7 @@

ghenv.Component.Name = "Honeybee_Read EP HVAC Result"
ghenv.Component.NickName = 'readEP_HVAC_Result'
ghenv.Component.Message = 'VER 0.0.55\nNOV_14_2014'
ghenv.Component.Message = 'VER 0.0.55\nJAN_10_2015'
ghenv.Component.Category = "Honeybee"
ghenv.Component.SubCategory = "09 | Energy | Energy"
#compatibleHBVersion = VER 0.0.55\nAUG_25_2014
Expand Down Expand Up @@ -153,7 +153,7 @@ def checkZone(csvName):

# PARSE THE RESULT FILE.
if _resultFileAddress and gotData == True:
try:
#try:
result = open(_resultFileAddress, 'r')

for lineCount, line in enumerate(result):
Expand All @@ -163,55 +163,55 @@ def checkZone(csvName):
for columnCount, column in enumerate(line.split(',')):
if 'Zone Ideal Loads Zone Sensible Cooling Energy' in column:
key.append(0)
zoneName = checkZone(" " + column.split(':')[0].split('ZONEHVAC')[0])
zoneName = checkZone(" " + column.split(':')[0].split(' IDEAL LOADS AIR SYSTEM')[0])
makeHeader(sensibleCooling, int(path[columnCount]), zoneName, column.split('(')[-1].split(')')[0], "Sensible Cooling Energy", "kWh", True)
dataTypeList[0] = True

elif 'Zone Ideal Loads Zone Latent Cooling Energy' in column:
key.append(1)
zoneName = checkZone(" " + column.split(':')[0].split('ZONEHVAC')[0])
zoneName = checkZone(" " + column.split(':')[0].split(' IDEAL LOADS AIR SYSTEM')[0])
makeHeader(latentCooling, int(path[columnCount]), zoneName, column.split('(')[-1].split(')')[0], "Latent Cooling Energy", "kWh", True)
dataTypeList[1] = True

elif 'Zone Ideal Loads Zone Sensible Heating Energy' in column:
key.append(2)
zoneName = checkZone(" " + column.split(':')[0].split('ZONEHVAC')[0])
zoneName = checkZone(" " + column.split(':')[0].split(' IDEAL LOADS AIR SYSTEM')[0])
makeHeader(sensibleHeating, int(path[columnCount]), zoneName, column.split('(')[-1].split(')')[0], "Sensible Heating Energy", "kWh", True)
dataTypeList[2] = True

elif 'Zone Ideal Loads Zone Latent Heating Energy' in column:
key.append(3)
zoneName = checkZone(" " + column.split(':')[0].split('ZONEHVAC')[0])
zoneName = checkZone(" " + column.split(':')[0].split(' IDEAL LOADS AIR SYSTEM')[0])
makeHeader(latentHeating, int(path[columnCount]), zoneName, column.split('(')[-1].split(')')[0], "Latent Heating Energy", "kWh", True)
dataTypeList[3] = True

elif 'System Node Mass Flow Rate' in column:
if column.startswith("NODE") or "RETURN" in column or "OUTDOOR AIR" in column:
if column.startswith("NODE") or "RETURN" in column or "OUTDOOR AIR" in column or "ZONE AIR NODE" in column:
key.append(-1)
path.append(-1)
else:
key.append(4)
zoneName = checkZone(" " + column.split(':')[0].split(' ZONE AIR NODE')[0])
zoneName = checkZone(" " + column.split(':')[0].split(' IDEAL LOADS SUPPLY INLET')[0])
makeHeader(supplyMassFlow, int(path[columnCount]), zoneName, column.split('(')[-1].split(')')[0], "Supply Air Mass Flow Rate", "kg/s", True)
dataTypeList[4] = True

elif 'System Node Temperature' in column:
if column.startswith("NODE") or "RETURN" in column or "OUTDOOR AIR" in column:
if column.startswith("NODE") or "RETURN" in column or "OUTDOOR AIR" in column or "ZONE AIR NODE" in column:
key.append(-1)
path.append(-1)
else:
key.append(5)
zoneName = checkZone(" " + column.split(':')[0].split(' ZONE AIR NODE')[0])
zoneName = checkZone(" " + column.split(':')[0].split(' IDEAL LOADS SUPPLY INLET')[0])
makeHeader(supplyAirTemp, int(path[columnCount]), zoneName, column.split('(')[-1].split(')')[0], "Supply Air Temperature", "C", False)
dataTypeList[5] = True

elif 'System Node Relative Humidity' in column:
if column.startswith("NODE") or "RETURN" in column or "OUTDOOR AIR" in column:
if column.startswith("NODE") or "RETURN" in column or "OUTDOOR AIR" in column or "ZONE AIR NODE" in column:
key.append(-1)
path.append(-1)
else:
key.append(6)
zoneName = checkZone(" " + column.split(':')[0].split(' ZONE AIR NODE')[0])
zoneName = checkZone(" " + column.split(':')[0].split(' IDEAL LOADS SUPPLY INLET')[0])
makeHeader(supplyAirHumidity, int(path[columnCount]), zoneName, column.split('(')[-1].split(')')[0], "Supply Air Relative Humidity", "%", False)
dataTypeList[6] = True

Expand Down Expand Up @@ -244,14 +244,14 @@ def checkZone(csvName):

result.close()
parseSuccess = True
except:
try: result.close()
except: pass
parseSuccess = False
warn = 'Failed to parse the result file. The csv file might not have existed when connected or the simulation did not run correctly.'+ \
'Try reconnecting the _resultfileAddress to this component or re-running your simulation.'
print warn
ghenv.Component.AddRuntimeMessage(gh.GH_RuntimeMessageLevel.Warning, warn)
#except:
# try: result.close()
# except: pass
# parseSuccess = False
# warn = 'Failed to parse the result file. The csv file might not have existed when connected or the simulation did not run correctly.'+ \
# 'Try reconnecting the _resultfileAddress to this component or re-running your simulation.'
# print warn
# ghenv.Component.AddRuntimeMessage(gh.GH_RuntimeMessageLevel.Warning, warn)



Expand Down
4 changes: 2 additions & 2 deletions src/Honeybee_Read EP Result.py
Expand Up @@ -37,7 +37,7 @@

ghenv.Component.Name = "Honeybee_Read EP Result"
ghenv.Component.NickName = 'readEPResult'
ghenv.Component.Message = 'VER 0.0.55\nDEC_07_2014'
ghenv.Component.Message = 'VER 0.0.55\nJAN_10_2015'
ghenv.Component.Category = "Honeybee"
ghenv.Component.SubCategory = "09 | Energy | Energy"
ghenv.Component.AdditionalHelpFromDocStrings = "4"
Expand Down Expand Up @@ -313,7 +313,7 @@ def checkZoneOther(dataIndex, csvName):
makeHeader(relativeHumidity, int(path[columnCount]), zoneName, column.split('(')[-1].split(')')[0], "Relative Humidity", "%", False)
dataTypeList[16] = True

elif 'Zone' in column and not "ZONEHVAC" in column:
elif 'Zone' in column and not "System" in column and not "SYSTEM" in column:
key.append(14)
zoneName = checkZoneOther(dataIndex, (" " + column.split(':')[0]))
makeHeader(otherZoneData, int(path[columnCount]), zoneName, column.split('(')[-1].split(')')[0], column.split(':')[-1].split(' [')[0], column.split('[')[-1].split(']')[0], False)
Expand Down
75 changes: 61 additions & 14 deletions src/Honeybee_Set EnergyPlus Zone Schedules.py
Expand Up @@ -4,26 +4,28 @@
# under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

"""
Set Schedules
Use this component to change the schedules of your HBZones.
-
Provided by Honeybee 0.0.55
Args:
_HBZones:...
occupancySchedule_: ...
heatingSetPtSchedule_: ...
coolingSetPtSchedule_: ...
lightingSchedule_: ...
equipmentSchedule_: ...
infiltrationSchedule_: ...
_HBZones: HBZones for which you want to change shcedules.
occupancySchedule_: A text string representing the occupancy shceudle that you want to use. This can be either a shcedule from the schedule libirary or a CSV file path to a CSV schedule you created with the "Honeybee_Create CSV Schedule" component.
occupancyActivitySchs_: A text string representing the shceudle for the metabolic rate of the occupants that you want to use. This can be either a shcedule from the schedule libirary or a CSV file path to a CSV schedule you created with the "Honeybee_Create CSV Schedule" component. If this is a CSV schedule, the values in it should be Watts and the "units_" input should be "ActivityLevel."
heatingSetPtSchedule_: A text string representing the heating setpoint shceudle that you want to use. This can be either a shcedule from the schedule libirary or a CSV file path to a CSV schedule you created with the "Honeybee_Create CSV Schedule" component. If it is a CSV schedule, the values in it should be temperature values in Celcius and the "units_" input should be "Temperature."
coolingSetPtSchedule_: A text string representing the cooling setpoint shceudle that you want to use. This can be either a shcedule from the schedule libirary or a CSV file path to a CSV schedule you created with the "Honeybee_Create CSV Schedule" component. If it is a CSV schedule, the values in it should be temperature values in Celcius and the "units_" input should be "Temperature."
lightingSchedule_: A text string representing the lighting shceudle that you want to use. This can be either a shcedule from the schedule libirary or a CSV file path to a CSV schedule you created with the "Honeybee_Create CSV Schedule" component.
equipmentSchedule_: A text string representing the equipment shceudle that you want to use. This can be either a shcedule from the schedule libirary or a CSV file path to a CSV schedule you created with the "Honeybee_Create CSV Schedule" component.
infiltrationSchedule_: A text string representing the infiltration shceudle that you want to use. This can be either a shcedule from the schedule libirary or a CSV file path to a CSV schedule you created with the "Honeybee_Create CSV Schedule" component.
HVACAvailabiltySchs_: A text string representing the HVAC availability that you want to use. This can be either a shcedule from the schedule libirary or a CSV file path to a CSV schedule you created with the "Honeybee_Create CSV Schedule" component.
Returns:
schedules:...
HBZones:...
schedules: A report of what shcedules are assigned to each zone.
HBZones: HBZones that have had thier shcedules modified.
"""

ghenv.Component.Name = "Honeybee_Set EnergyPlus Zone Schedules"
ghenv.Component.NickName = 'setEPZoneSchedules'
ghenv.Component.Message = 'VER 0.0.55\nNOV_29_2014'
ghenv.Component.Message = 'VER 0.0.55\nJAN_10_2015'
ghenv.Component.Category = "Honeybee"
ghenv.Component.SubCategory = "08 | Energy | Set Zone Properties"
#compatibleHBVersion = VER 0.0.55\nAUG_25_2014
Expand All @@ -37,7 +39,44 @@
import os


def main(HBZones, occupancySchedule, occupancyActivitySch, heatingSetPtSchedule, coolingSetPtSchedule, lightingSchedule, equipmentSchedule, infiltrationSchedule):

def checkTheInputs():
#If the user puts in only one value, apply that value to all of the zones.
def duplicateData(data, calcLength):
dupData = []
for count in range(calcLength):
dupData.append(data[0])
return dupData

if len(occupancySchedules_) == 1: occupancySchedules = duplicateData(occupancySchedules_, len(_HBZones))
else: occupancySchedules = occupancySchedules_

if len(occupancyActivitySchs_) == 1: occupancyActivitySchs = duplicateData(occupancyActivitySchs_, len(_HBZones))
else: occupancyActivitySchs = occupancyActivitySchs_

if len(coolingSetPtSchedules_) == 1: coolingSetPtSchedules = duplicateData(coolingSetPtSchedules_, len(_HBZones))
else: coolingSetPtSchedules = coolingSetPtSchedules_

if len(heatingSetPtSchedules_) == 1: heatingSetPtSchedules = duplicateData(heatingSetPtSchedules_, len(_HBZones))
else: heatingSetPtSchedules = heatingSetPtSchedules_

if len(lightingSchedules_) == 1: lightingSchedules = duplicateData(lightingSchedules_, len(_HBZones))
else: lightingSchedules = lightingSchedules_

if len(equipmentSchedules_) == 1: equipmentSchedules = duplicateData(equipmentSchedules_, len(_HBZones))
else: equipmentSchedules = equipmentSchedules_

if len(infiltrationSchedules_) == 1: infiltrationSchedules = duplicateData(infiltrationSchedules_, len(_HBZones))
else: infiltrationSchedules = infiltrationSchedules_

if len(HVACAvailabilitySchs_) == 1: HVACAvailabilitySchs = duplicateData(HVACAvailabilitySchs_, len(_HBZones))
else: HVACAvailabilitySchs = HVACAvailabilitySchs_


return occupancySchedules, occupancyActivitySchs, coolingSetPtSchedules, heatingSetPtSchedules, lightingSchedules, equipmentSchedules, infiltrationSchedules, HVACAvailabilitySchs


def main(HBZones, occupancySchedule, occupancyActivitySch, heatingSetPtSchedule, coolingSetPtSchedule, lightingSchedule, equipmentSchedule, infiltrationSchedule, HVACAvailabilitySchs):
# check for Honeybee
if not sc.sticky.has_key('honeybee_release'):
print "You should first let Honeybee to fly..."
Expand All @@ -57,7 +96,7 @@ def main(HBZones, occupancySchedule, occupancyActivitySch, heatingSetPtSchedule,
return -1

# make sure schedules are in HB schedule
schedules = [occupancySchedule, heatingSetPtSchedule, coolingSetPtSchedule, lightingSchedule, equipmentSchedule, infiltrationSchedule]
schedules = [occupancySchedule, heatingSetPtSchedule, coolingSetPtSchedule, lightingSchedule, equipmentSchedule, infiltrationSchedule, HVACAvailabilitySchs]
HBScheduleList = sc.sticky["honeybee_ScheduleLib"].keys()

for scheduleList in schedules:
Expand Down Expand Up @@ -105,6 +144,9 @@ def main(HBZones, occupancySchedule, occupancyActivitySch, heatingSetPtSchedule,
if infiltrationSchedule != [] and infiltrationSchedule[0] != None:
try: HBZone.infiltrationSchedule = infiltrationSchedule[zoneCount]
except: HBZone.infiltrationSchedule = infiltrationSchedule[0]
if HVACAvailabilitySchs != [] and HVACAvailabilitySchs[0] != None:
try: HBZone.HVACAvailabilitySched = HVACAvailabilitySchs[zoneCount]
except: HBZone.HVACAvailabilitySched = HVACAvailabilitySchs[0]

schedules.append(HBZone.getCurrentSchedules())

Expand All @@ -113,7 +155,12 @@ def main(HBZones, occupancySchedule, occupancyActivitySch, heatingSetPtSchedule,
return HBZones, schedules



occupancySchedules, occupancyActivitySchs, coolingSetPtSchedules, heatingSetPtSchedules, lightingSchedules, equipmentSchedules, infiltrationSchedules, HVACAvailabilitySchs = checkTheInputs()

if _HBZones and _HBZones[0]!=None:
results = main(_HBZones, occupancySchedules_, occupancyActivitySchs_, heatingSetPtSchedules_, coolingSetPtSchedules_, lightingSchedules_, equipmentSchedules_, infiltrationSchedules_)
occupancySchedules, occupancyActivitySchs, coolingSetPtSchedules, heatingSetPtSchedules, lightingSchedules, equipmentSchedules, infiltrationSchedules, HVACAvailabilitySchs = checkTheInputs()

results = main(_HBZones, occupancySchedules, occupancyActivitySchs, heatingSetPtSchedules, coolingSetPtSchedules, lightingSchedules, equipmentSchedules, infiltrationSchedules, HVACAvailabilitySchs)

if results != -1: HBZones, schedules = results

1 comment on commit f3801f5

@mostaphaRoudsari
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chriswmackey! Looks great to me. It is much cleaner now.

Please sign in to comment.