Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hvac): Add warning when not all HVAC schedules are the same #306

Merged
merged 1 commit into from Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified honeybee_grasshopper_energy/icon/HB All-Air HVAC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified honeybee_grasshopper_energy/icon/HB DOAS HVAC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions honeybee_grasshopper_energy/json/HB_All-Air_HVAC.json
@@ -1,5 +1,5 @@
{
"version": "1.4.0",
"version": "1.4.1",
"nickname": "AllAirHVAC",
"outputs": [
[
Expand Down Expand Up @@ -78,7 +78,7 @@
}
],
"subcategory": "4 :: HVAC",
"code": "\nimport os\nimport json\n\ntry: # import the honeybee extension\n from honeybee.typing import clean_and_id_ep_string, clean_ep_string\n from honeybee.model import Model\n from honeybee.room import Room\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the honeybee-energy extension\n from honeybee_energy.config import folders\n from honeybee_energy.hvac.allair import EQUIPMENT_TYPES_DICT\n from honeybee_energy.lib.schedules import schedule_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n# dictionary to get correct vintages\nvintages = {\n 'DOE_Ref_Pre_1980': 'DOE_Ref_Pre_1980',\n 'DOE_Ref_1980_2004': 'DOE_Ref_1980_2004',\n 'ASHRAE_2004': 'ASHRAE_2004',\n 'ASHRAE_2007': 'ASHRAE_2007',\n 'ASHRAE_2010': 'ASHRAE_2010',\n 'ASHRAE_2013': 'ASHRAE_2013',\n 'ASHRAE_2016': 'ASHRAE_2016',\n 'ASHRAE_2019': 'ASHRAE_2019',\n 'DOE Ref Pre-1980': 'DOE_Ref_Pre_1980',\n 'DOE Ref 1980-2004': 'DOE_Ref_1980_2004',\n '90.1-2004': 'ASHRAE_2004',\n '90.1-2007': 'ASHRAE_2007',\n '90.1-2010': 'ASHRAE_2010',\n '90.1-2013': 'ASHRAE_2013',\n 'pre_1980': 'DOE_Ref_Pre_1980',\n '1980_2004': 'DOE_Ref_1980_2004',\n '2004': 'ASHRAE_2004',\n '2007': 'ASHRAE_2007',\n '2010': 'ASHRAE_2010',\n '2013': 'ASHRAE_2013',\n '2016': 'ASHRAE_2016',\n '2019': 'ASHRAE_2019',\n None: 'ASHRAE_2019'\n}\n\n# dictionary of HVAC template names\next_folder = folders.standards_extension_folders[0]\nhvac_reg = os.path.join(ext_folder, 'hvac_registry.json')\nwith open(hvac_reg, 'r') as f:\n hvac_dict = json.load(f)\n\n\nif all_required_inputs(ghenv.Component):\n # extract any rooms from input Models and duplicate the rooms\n rooms = []\n for hb_obj in _rooms:\n if isinstance(hb_obj, Model):\n rooms.extend([room.duplicate() for room in hb_obj.rooms])\n elif isinstance(hb_obj, Room):\n rooms.append(hb_obj.duplicate())\n else:\n raise ValueError(\n 'Expected Honeybee Room or Model. Got {}.'.format(type(hb_obj)))\n\n # process any input properties for the HVAC system\n try: # get the class for the HVAC system\n try:\n _sys_name = hvac_dict[_system_type]\n except KeyError:\n _sys_name = _system_type\n hvac_class = EQUIPMENT_TYPES_DICT[_sys_name]\n except KeyError:\n raise ValueError('System Type \"{}\" is not recognized as an all-air HVAC '\n 'system.'.format(_system_type))\n vintage = vintages[_vintage_] # get the vintage of the HVAC\n name = clean_and_id_ep_string('All-Air HVAC') if _name_ is None else clean_ep_string(_name_)\n\n # create the HVAC\n hvac = hvac_class(name, vintage, _sys_name)\n if _economizer_ is not None:\n hvac.economizer_type = _economizer_\n if sensible_hr_ is not None:\n hvac.sensible_heat_recovery = sensible_hr_\n if latent_hr_ is not None:\n hvac.latent_heat_recovery = latent_hr_\n if dcv_:\n hvac.demand_controlled_ventilation = True\n if _name_ is not None:\n hvac.display_name = _name_\n\n # apply the HVAC system to the rooms\n for room in rooms:\n if room.properties.energy.is_conditioned:\n room.properties.energy.hvac = hvac\n",
"code": "\nimport os\nimport json\n\ntry: # import the honeybee extension\n from honeybee.typing import clean_and_id_ep_string, clean_ep_string\n from honeybee.model import Model\n from honeybee.room import Room\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the honeybee-energy extension\n from honeybee_energy.config import folders\n from honeybee_energy.hvac.allair import EQUIPMENT_TYPES_DICT\n from honeybee_energy.lib.schedules import schedule_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs, give_warning\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n# dictionary to get correct vintages\nvintages = {\n 'DOE_Ref_Pre_1980': 'DOE_Ref_Pre_1980',\n 'DOE_Ref_1980_2004': 'DOE_Ref_1980_2004',\n 'ASHRAE_2004': 'ASHRAE_2004',\n 'ASHRAE_2007': 'ASHRAE_2007',\n 'ASHRAE_2010': 'ASHRAE_2010',\n 'ASHRAE_2013': 'ASHRAE_2013',\n 'ASHRAE_2016': 'ASHRAE_2016',\n 'ASHRAE_2019': 'ASHRAE_2019',\n 'DOE Ref Pre-1980': 'DOE_Ref_Pre_1980',\n 'DOE Ref 1980-2004': 'DOE_Ref_1980_2004',\n '90.1-2004': 'ASHRAE_2004',\n '90.1-2007': 'ASHRAE_2007',\n '90.1-2010': 'ASHRAE_2010',\n '90.1-2013': 'ASHRAE_2013',\n 'pre_1980': 'DOE_Ref_Pre_1980',\n '1980_2004': 'DOE_Ref_1980_2004',\n '2004': 'ASHRAE_2004',\n '2007': 'ASHRAE_2007',\n '2010': 'ASHRAE_2010',\n '2013': 'ASHRAE_2013',\n '2016': 'ASHRAE_2016',\n '2019': 'ASHRAE_2019',\n None: 'ASHRAE_2019'\n}\n\n# dictionary of HVAC template names\next_folder = folders.standards_extension_folders[0]\nhvac_reg = os.path.join(ext_folder, 'hvac_registry.json')\nwith open(hvac_reg, 'r') as f:\n hvac_dict = json.load(f)\n\n\nif all_required_inputs(ghenv.Component):\n # extract any rooms from input Models and duplicate the rooms\n rooms = []\n for hb_obj in _rooms:\n if isinstance(hb_obj, Model):\n rooms.extend([room.duplicate() for room in hb_obj.rooms])\n elif isinstance(hb_obj, Room):\n rooms.append(hb_obj.duplicate())\n else:\n raise ValueError(\n 'Expected Honeybee Room or Model. Got {}.'.format(type(hb_obj)))\n\n # process any input properties for the HVAC system\n try: # get the class for the HVAC system\n try:\n _sys_name = hvac_dict[_system_type]\n except KeyError:\n _sys_name = _system_type\n hvac_class = EQUIPMENT_TYPES_DICT[_sys_name]\n except KeyError:\n raise ValueError('System Type \"{}\" is not recognized as an all-air HVAC '\n 'system.'.format(_system_type))\n vintage = vintages[_vintage_] # get the vintage of the HVAC\n name = clean_and_id_ep_string('All-Air HVAC') if _name_ is None else clean_ep_string(_name_)\n\n # create the HVAC\n hvac = hvac_class(name, vintage, _sys_name)\n if _economizer_ is not None:\n hvac.economizer_type = _economizer_\n if sensible_hr_ is not None:\n hvac.sensible_heat_recovery = sensible_hr_\n if latent_hr_ is not None:\n hvac.latent_heat_recovery = latent_hr_\n if dcv_:\n hvac.demand_controlled_ventilation = True\n if _name_ is not None:\n hvac.display_name = _name_\n\n # apply the HVAC system to the rooms\n rel_rooms = []\n for room in rooms:\n if room.properties.energy.is_conditioned:\n room.properties.energy.hvac = hvac\n rel_rooms.append(room)\n\n # give a warning if all of the ventilation schedules are not the same\n if 'PTAC' not in _sys_name and 'PTHP' not in _sys_name:\n vent_scheds = set()\n for rm in rel_rooms:\n vent_scheds.add(rm.properties.energy.ventilation.schedule)\n if len(vent_scheds) > 1:\n msg = 'The system type uses a central air loop but not all of the ' \\\n 'rooms have the same ventilation schedule.\\n' \\\n 'All ventilation schedules will be ignored.'\n give_warning(ghenv.Component, msg)\n",
"category": "HB-Energy",
"name": "HB All-Air HVAC",
"description": "Apply an All-Air template HVAC to a list of Honeybee Rooms.\n_\nAll-air systems provide both ventilation and satisfaction of heating + cooling\ndemand with the same stream of warm/cool air. As such, they often grant tight\ncontrol over zone humidity. However, because such systems often involve the\ncooling of air only to reheat it again, they are often more energy intensive\nthan systems that separate ventilation from the meeting of thermal loads.\n-"
Expand Down
4 changes: 2 additions & 2 deletions honeybee_grasshopper_energy/json/HB_DOAS_HVAC.json
@@ -1,5 +1,5 @@
{
"version": "1.4.0",
"version": "1.4.1",
"nickname": "DOASHVAC",
"outputs": [
[
Expand Down Expand Up @@ -78,7 +78,7 @@
}
],
"subcategory": "4 :: HVAC",
"code": "\nimport os\nimport json\n\ntry: # import the honeybee extension\n from honeybee.typing import clean_and_id_ep_string, clean_ep_string\n from honeybee.model import Model\n from honeybee.room import Room\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the honeybee-energy extension\n from honeybee_energy.config import folders\n from honeybee_energy.hvac.doas import EQUIPMENT_TYPES_DICT\n from honeybee_energy.lib.schedules import schedule_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n# dictionary to get correct vintages\nvintages = {\n 'DOE_Ref_Pre_1980': 'DOE_Ref_Pre_1980',\n 'DOE_Ref_1980_2004': 'DOE_Ref_1980_2004',\n 'ASHRAE_2004': 'ASHRAE_2004',\n 'ASHRAE_2007': 'ASHRAE_2007',\n 'ASHRAE_2010': 'ASHRAE_2010',\n 'ASHRAE_2013': 'ASHRAE_2013',\n 'ASHRAE_2016': 'ASHRAE_2016',\n 'ASHRAE_2019': 'ASHRAE_2019',\n 'DOE Ref Pre-1980': 'DOE_Ref_Pre_1980',\n 'DOE Ref 1980-2004': 'DOE_Ref_1980_2004',\n '90.1-2004': 'ASHRAE_2004',\n '90.1-2007': 'ASHRAE_2007',\n '90.1-2010': 'ASHRAE_2010',\n '90.1-2013': 'ASHRAE_2013',\n 'pre_1980': 'DOE_Ref_Pre_1980',\n '1980_2004': 'DOE_Ref_1980_2004',\n '2004': 'ASHRAE_2004',\n '2007': 'ASHRAE_2007',\n '2010': 'ASHRAE_2010',\n '2013': 'ASHRAE_2013',\n '2016': 'ASHRAE_2016',\n '2019': 'ASHRAE_2019',\n None: 'ASHRAE_2019'\n}\n\n# dictionary of HVAC template names\next_folder = folders.standards_extension_folders[0]\nhvac_reg = os.path.join(ext_folder, 'hvac_registry.json')\nwith open(hvac_reg, 'r') as f:\n hvac_dict = json.load(f)\n\n\nif all_required_inputs(ghenv.Component):\n # extract any rooms from input Models and duplicate the rooms\n rooms = []\n for hb_obj in _rooms:\n if isinstance(hb_obj, Model):\n rooms.extend([room.duplicate() for room in hb_obj.rooms])\n elif isinstance(hb_obj, Room):\n rooms.append(hb_obj.duplicate())\n else:\n raise ValueError(\n 'Expected Honeybee Room or Model. Got {}.'.format(type(hb_obj)))\n\n # process any input properties for the HVAC system\n try: # get the class for the HVAC system\n try:\n _sys_name = hvac_dict[_system_type]\n except KeyError:\n _sys_name = _system_type\n hvac_class = EQUIPMENT_TYPES_DICT[_sys_name]\n except KeyError:\n raise ValueError('System Type \"{}\" is not recognized as a DOAS HVAC '\n 'system.'.format(_system_type))\n vintage = vintages[_vintage_] # get the vintage of the HVAC\n name = clean_and_id_ep_string('DOAS HVAC') if _name_ is None else clean_ep_string(_name_)\n\n # create the HVAC\n hvac = hvac_class(name, vintage, _sys_name, sensible_hr_, latent_hr_, dcv_)\n if doas_avail_sch_ is not None:\n if isinstance(doas_avail_sch_, str):\n doas_avail_sch_ = schedule_by_identifier(doas_avail_sch_)\n hvac.doas_availability_schedule = doas_avail_sch_\n if _name_ is not None:\n hvac.display_name = _name_\n\n # apply the HVAC system to the rooms\n for room in rooms:\n if room.properties.energy.is_conditioned:\n room.properties.energy.hvac = hvac\n",
"code": "\nimport os\nimport json\n\ntry: # import the honeybee extension\n from honeybee.typing import clean_and_id_ep_string, clean_ep_string\n from honeybee.model import Model\n from honeybee.room import Room\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the honeybee-energy extension\n from honeybee_energy.config import folders\n from honeybee_energy.hvac.doas import EQUIPMENT_TYPES_DICT\n from honeybee_energy.lib.schedules import schedule_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs, give_warning\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n# dictionary to get correct vintages\nvintages = {\n 'DOE_Ref_Pre_1980': 'DOE_Ref_Pre_1980',\n 'DOE_Ref_1980_2004': 'DOE_Ref_1980_2004',\n 'ASHRAE_2004': 'ASHRAE_2004',\n 'ASHRAE_2007': 'ASHRAE_2007',\n 'ASHRAE_2010': 'ASHRAE_2010',\n 'ASHRAE_2013': 'ASHRAE_2013',\n 'ASHRAE_2016': 'ASHRAE_2016',\n 'ASHRAE_2019': 'ASHRAE_2019',\n 'DOE Ref Pre-1980': 'DOE_Ref_Pre_1980',\n 'DOE Ref 1980-2004': 'DOE_Ref_1980_2004',\n '90.1-2004': 'ASHRAE_2004',\n '90.1-2007': 'ASHRAE_2007',\n '90.1-2010': 'ASHRAE_2010',\n '90.1-2013': 'ASHRAE_2013',\n 'pre_1980': 'DOE_Ref_Pre_1980',\n '1980_2004': 'DOE_Ref_1980_2004',\n '2004': 'ASHRAE_2004',\n '2007': 'ASHRAE_2007',\n '2010': 'ASHRAE_2010',\n '2013': 'ASHRAE_2013',\n '2016': 'ASHRAE_2016',\n '2019': 'ASHRAE_2019',\n None: 'ASHRAE_2019'\n}\n\n# dictionary of HVAC template names\next_folder = folders.standards_extension_folders[0]\nhvac_reg = os.path.join(ext_folder, 'hvac_registry.json')\nwith open(hvac_reg, 'r') as f:\n hvac_dict = json.load(f)\n\n\nif all_required_inputs(ghenv.Component):\n # extract any rooms from input Models and duplicate the rooms\n rooms = []\n for hb_obj in _rooms:\n if isinstance(hb_obj, Model):\n rooms.extend([room.duplicate() for room in hb_obj.rooms])\n elif isinstance(hb_obj, Room):\n rooms.append(hb_obj.duplicate())\n else:\n raise ValueError(\n 'Expected Honeybee Room or Model. Got {}.'.format(type(hb_obj)))\n\n # process any input properties for the HVAC system\n try: # get the class for the HVAC system\n try:\n _sys_name = hvac_dict[_system_type]\n except KeyError:\n _sys_name = _system_type\n hvac_class = EQUIPMENT_TYPES_DICT[_sys_name]\n except KeyError:\n raise ValueError('System Type \"{}\" is not recognized as a DOAS HVAC '\n 'system.'.format(_system_type))\n vintage = vintages[_vintage_] # get the vintage of the HVAC\n name = clean_and_id_ep_string('DOAS HVAC') if _name_ is None else clean_ep_string(_name_)\n\n # create the HVAC\n hvac = hvac_class(name, vintage, _sys_name, sensible_hr_, latent_hr_, dcv_)\n if doas_avail_sch_ is not None:\n if isinstance(doas_avail_sch_, str):\n doas_avail_sch_ = schedule_by_identifier(doas_avail_sch_)\n hvac.doas_availability_schedule = doas_avail_sch_\n if _name_ is not None:\n hvac.display_name = _name_\n\n # apply the HVAC system to the rooms\n vent_scheds = set()\n for room in rooms:\n if room.properties.energy.is_conditioned:\n room.properties.energy.hvac = hvac\n vent_scheds.add(room.properties.energy.ventilation.schedule)\n\n # give a warning if all of the ventilation schedules are not the same\n if len(vent_scheds) > 1:\n msg = 'The system type uses a central air loop but not all of the ' \\\n 'rooms have the same ventilation schedule.\\n' \\\n 'All ventilation schedules will be ignored.'\n give_warning(ghenv.Component, msg)\n",
"category": "HB-Energy",
"name": "HB DOAS HVAC",
"description": "Apply a Dedicated Outdoor Air System (DOAS) template HVAC to Honeybee Rooms.\n_\nDOAS systems separate minimum ventilation supply from the satisfaction of heating\n+ cooling demand. Ventilation air tends to be supplied at neutral temperatures\n(close to room air temperature) and heating / cooling loads are met with additional\npieces of zone equipment (eg. Fan Coil Units (FCUs)).\n_\nBecause DOAS systems only have to cool down and re-heat the minimum ventilation air,\nthey tend to use less energy than all-air systems. They also tend to use less energy\nto distribute heating + cooling by puping around hot/cold water or refrigerant\ninstead of blowing hot/cold air. However, they do not provide as good of control\nover humidity and so they may not be appropriate for rooms with high latent loads\nlike auditoriums, kitchens, laundromats, etc.\n-"
Expand Down
17 changes: 15 additions & 2 deletions honeybee_grasshopper_energy/src/HB All-Air HVAC.py
Expand Up @@ -61,7 +61,7 @@

ghenv.Component.Name = "HB All-Air HVAC"
ghenv.Component.NickName = 'AllAirHVAC'
ghenv.Component.Message = '1.4.0'
ghenv.Component.Message = '1.4.1'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '4 :: HVAC'
ghenv.Component.AdditionalHelpFromDocStrings = '2'
Expand All @@ -84,7 +84,7 @@
raise ImportError('\nFailed to import honeybee_energy:\n\t{}'.format(e))

try:
from ladybug_rhino.grasshopper import all_required_inputs
from ladybug_rhino.grasshopper import all_required_inputs, give_warning
except ImportError as e:
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))

Expand Down Expand Up @@ -161,6 +161,19 @@
hvac.display_name = _name_

# apply the HVAC system to the rooms
rel_rooms = []
for room in rooms:
if room.properties.energy.is_conditioned:
room.properties.energy.hvac = hvac
rel_rooms.append(room)

# give a warning if all of the ventilation schedules are not the same
if 'PTAC' not in _sys_name and 'PTHP' not in _sys_name:
vent_scheds = set()
for rm in rel_rooms:
vent_scheds.add(rm.properties.energy.ventilation.schedule)
if len(vent_scheds) > 1:
msg = 'The system type uses a central air loop but not all of the ' \
'rooms have the same ventilation schedule.\n' \
'All ventilation schedules will be ignored.'
give_warning(ghenv.Component, msg)
13 changes: 11 additions & 2 deletions honeybee_grasshopper_energy/src/HB DOAS HVAC.py
Expand Up @@ -61,7 +61,7 @@

ghenv.Component.Name = "HB DOAS HVAC"
ghenv.Component.NickName = 'DOASHVAC'
ghenv.Component.Message = '1.4.0'
ghenv.Component.Message = '1.4.1'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '4 :: HVAC'
ghenv.Component.AdditionalHelpFromDocStrings = '3'
Expand All @@ -84,7 +84,7 @@
raise ImportError('\nFailed to import honeybee_energy:\n\t{}'.format(e))

try:
from ladybug_rhino.grasshopper import all_required_inputs
from ladybug_rhino.grasshopper import all_required_inputs, give_warning
except ImportError as e:
raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))

Expand Down Expand Up @@ -157,6 +157,15 @@
hvac.display_name = _name_

# apply the HVAC system to the rooms
vent_scheds = set()
for room in rooms:
if room.properties.energy.is_conditioned:
room.properties.energy.hvac = hvac
vent_scheds.add(room.properties.energy.ventilation.schedule)

# give a warning if all of the ventilation schedules are not the same
if len(vent_scheds) > 1:
msg = 'The system type uses a central air loop but not all of the ' \
'rooms have the same ventilation schedule.\n' \
'All ventilation schedules will be ignored.'
give_warning(ghenv.Component, msg)
Binary file modified honeybee_grasshopper_energy/user_objects/HB All-Air HVAC.ghuser
Binary file not shown.
Binary file modified honeybee_grasshopper_energy/user_objects/HB DOAS HVAC.ghuser
Binary file not shown.
Binary file modified samples/single_family_comfort_study.gh
Binary file not shown.