Skip to content

Commit

Permalink
fix(hvac): Add reports and warnings for rooms with no setpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Aug 10, 2023
1 parent c2b1328 commit 1ecfc86
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 42 deletions.
Binary file modified honeybee_grasshopper_energy/icon/HB All-Air HVAC.png
Loading
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
Loading
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 Detailed HVAC.png
Loading
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 HeatCool HVAC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 2 additions & 9 deletions honeybee_grasshopper_energy/json/HB_All-Air_HVAC.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
{
"version": "1.6.0",
"version": "1.6.1",
"nickname": "AllAirHVAC",
"outputs": [
[
{
"access": "None",
"name": "report",
"description": "Reports, errors, warnings, etc.",
"type": null,
"default": null
},
{
"access": "None",
"name": "rooms",
Expand Down Expand Up @@ -78,7 +71,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, 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 hvac_count = 0\n for room in rooms:\n if room.properties.energy.is_conditioned:\n room.properties.energy.hvac = hvac\n rel_rooms.append(room)\n hvac_count += 1\n\n # give a warning if no rooms were conditioned\n if hvac_count == 0:\n msg = 'None of the connected Rooms are conditioned.\\n' \\\n 'Set rooms to be conditioned using the \"HB Set Conditioned\" component.'\n print(msg)\n give_warning(ghenv.Component, msg)\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_obj = rm.properties.energy.ventilation\n if vent_obj is not None:\n vent_scheds.add(vent_obj.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",
"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, no_setp_rooms = [], []\n hvac_count = 0\n for room in rooms:\n if room.properties.energy.is_conditioned:\n room.properties.energy.hvac = hvac\n rel_rooms.append(room)\n hvac_count += 1\n if room.properties.energy.setpoint is None:\n no_setp_rooms.append(room.full_id)\n\n # give a warning if no rooms were conditioned\n if hvac_count == 0:\n msg = 'None of the connected Rooms are conditioned.\\n' \\\n 'Set rooms to be conditioned using the \"HB Set Conditioned\" component.'\n print(msg)\n give_warning(ghenv.Component, msg)\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_obj = rm.properties.energy.ventilation\n if vent_obj is not None:\n vent_scheds.add(vent_obj.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\n # print a message if some of the rooms lack a setpoint specification\n if len(no_setp_rooms) != 0:\n msg = 'The following Rooms have the HVAC system assigned to them '\\\n 'but they lack a thermostat setpoint specification.\\nThese Rooms ' \\\n 'without setpoints will be treated as unconditioned in EnergyPlus '\\\n 'simulation.\\n{}'.format('\\n'.join(no_setp_rooms))\n print(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
Loading

0 comments on commit 1ecfc86

Please sign in to comment.