Skip to content

Commit

Permalink
fix(simulate): Expose new efficiency standard options
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Feb 11, 2023
1 parent 5ef9fa1 commit ec7269e
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 8 deletions.
Binary file modified honeybee_grasshopper_energy/icon/HB Sizing Parameter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 25 additions & 4 deletions honeybee_grasshopper_energy/json/HB_Sizing_Parameter.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.0",
"version": "1.6.1",
"nickname": "SizingPar",
"outputs": [
[
Expand Down Expand Up @@ -30,20 +30,41 @@
{
"access": "item",
"name": "_heating_fac_",
"description": "A number that will get multiplied by the peak heating load\nfor each zone in the model in order to size the heating system for\nthe model. Must be greater than 0. Default: 1.25.",
"description": "A number that will get multiplied by the peak heating load\nfor each zone in the model in order to size the heating system for\nthe model. Must be greater than 0. (Default: 1.25).",
"type": "double",
"default": null
},
{
"access": "item",
"name": "_cooling_fac_",
"description": "A number that will get multiplied by the peak cooling load\nfor each zone in the model in order to size the cooling system for\nthe model. Must be greater than 0. Default: 1.15.",
"description": "A number that will get multiplied by the peak cooling load\nfor each zone in the model in order to size the cooling system for\nthe model. Must be greater than 0. (Default: 1.15).",
"type": "double",
"default": null
},
{
"access": "item",
"name": "eff_standard_",
"description": "Text to specify the efficiency standard, which will automatically\nset the efficiencies of all HVAC equipment when provided. Note that\nproviding a standard here will cause the OpenStudio translation\nprocess to perform an additional sizing calculation with EnergyPlus,\nwhich is needed since the default efficiencies of equipment vary\ndependingon their size. THIS WILL SIGNIFICANTLY INCREASE\nTRANSLATION TIME TO OPENSTUDIO. However, it is often\nworthwhile when the goal is to match the HVAC specification with a\nparticular standard. The \"HB Building Vintages\" component has a full\nlist of supported HVAC efficiency standards. You can also choose\nfrom the following.\n* DOE_Ref_Pre_1980\n* DOE_Ref_1980_2004\n* ASHRAE_2004\n* ASHRAE_2007\n* ASHRAE_2010\n* ASHRAE_2013\n* ASHRAE_2016\n* ASHRAE_2019",
"type": "string",
"default": null
},
{
"access": "item",
"name": "climate_zone_",
"description": "Script variable SizingPar",
"type": "string",
"default": null
},
{
"access": "item",
"name": "bldg_type_",
"description": "Script variable SizingPar",
"type": "string",
"default": null
}
],
"subcategory": "5 :: Simulate",
"code": "\ntry:\n from honeybee_energy.simulation.sizing import SizingParameter\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\n\n# set default sizing factors\nheating_fac = 1.25 if _heating_fac_ is None else _heating_fac_\ncooling_fac = 1.15 if _cooling_fac_ is None else _cooling_fac_\n\n# create the object\nsizing = SizingParameter(None, heating_fac, cooling_fac)\n\n# apply design days from ddy\nif ddy_file_ is not None:\n if filter_ddays_ == 1:\n sizing.add_from_ddy_996_004(ddy_file_)\n elif filter_ddays_ == 2:\n sizing.add_from_ddy_990_010(ddy_file_)\n else:\n sizing.add_from_ddy(ddy_file_)\n",
"code": "\ntry:\n from honeybee_energy.simulation.sizing import SizingParameter\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\n# dictionary to get correct efficiency standards\nEFF_STANDARDS = {\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 '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}\n\n# set default sizing factors\nheating_fac = 1.25 if _heating_fac_ is None else _heating_fac_\ncooling_fac = 1.15 if _cooling_fac_ is None else _cooling_fac_\n\n# create the object\nsizing = SizingParameter(None, heating_fac, cooling_fac)\n\n# apply design days from ddy\nif ddy_file_ is not None:\n if filter_ddays_ == 1:\n sizing.add_from_ddy_996_004(ddy_file_)\n elif filter_ddays_ == 2:\n sizing.add_from_ddy_990_010(ddy_file_)\n else:\n sizing.add_from_ddy(ddy_file_)\n\n# set the efficiency standard if provided\nif eff_standard_ is not None:\n sizing.efficiency_standard = EFF_STANDARDS[eff_standard_]\nif climate_zone_ is not None:\n sizing.climate_zone = climate_zone_\nif bldg_type_ is not None:\n sizing.building_type = bldg_type_\n",
"category": "HB-Energy",
"name": "HB Sizing Parameter",
"description": "Create parameters with criteria for sizing the heating and cooling system.\n-"
Expand Down
85 changes: 81 additions & 4 deletions honeybee_grasshopper_energy/src/HB Sizing Parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,61 @@
99.0% and 1.0% design days.
_heating_fac_: A number that will get multiplied by the peak heating load
for each zone in the model in order to size the heating system for
the model. Must be greater than 0. Default: 1.25.
the model. Must be greater than 0. (Default: 1.25).
_cooling_fac_: A number that will get multiplied by the peak cooling load
for each zone in the model in order to size the cooling system for
the model. Must be greater than 0. Default: 1.15.
the model. Must be greater than 0. (Default: 1.15).
eff_standard_: Text to specify the efficiency standard, which will automatically
set the efficiencies of all HVAC equipment when provided. Note that
providing a standard here will cause the OpenStudio translation
process to perform an additional sizing calculation with EnergyPlus,
which is needed since the default efficiencies of equipment vary
dependingon their size. THIS WILL SIGNIFICANTLY INCREASE
TRANSLATION TIME TO OPENSTUDIO. However, it is often
worthwhile when the goal is to match the HVAC specification with a
particular standard. The "HB Building Vintages" component has a full
list of supported HVAC efficiency standards. You can also choose
from the following.
* DOE_Ref_Pre_1980
* DOE_Ref_1980_2004
* ASHRAE_2004
* ASHRAE_2007
* ASHRAE_2010
* ASHRAE_2013
* ASHRAE_2016
* ASHRAE_2019
climate_zone: Text indicating the ASHRAE climate zone to be used with the
efficiency_standard. When unspecified, the climate zone will be
inferred from the design days. This input can be a single
integer (in which case it is interpreted as A) or it can include the
A, B, or C qualifier (eg. 3C). Typically, the "LB Import STAT"
component can yield the climate zone for a particular location.
building_type: Text for the building type to be used in the efficiency_standard.
If the type is not recognized or is None, it will be assumed that the
building is a generic NonResidential. The following have meaning
for the standard.
* NonResidential
* Residential
* MidriseApartment
* HighriseApartment
* LargeOffice
* MediumOffice
* SmallOffice
* Retail
* StripMall
* PrimarySchool
* SecondarySchool
* SmallHotel
* LargeHotel
* Hospital
* Outpatient
* Warehouse
* SuperMarket
* FullServiceRestaurant
* QuickServiceRestaurant
* Laboratory
* Courthouse
Returns:
sizing: Parameters with criteria for sizing the heating and cooling system.
These can be connected to the "HB Simulation Parameter" component in
Expand All @@ -36,7 +86,7 @@

ghenv.Component.Name = 'HB Sizing Parameter'
ghenv.Component.NickName = 'SizingPar'
ghenv.Component.Message = '1.6.0'
ghenv.Component.Message = '1.6.1'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '5 :: Simulate'
ghenv.Component.AdditionalHelpFromDocStrings = '3'
Expand All @@ -46,6 +96,25 @@
except ImportError as e:
raise ImportError('\nFailed to import honeybee_energy:\n\t{}'.format(e))

# dictionary to get correct efficiency standards
EFF_STANDARDS = {
'DOE_Ref_Pre_1980': 'DOE_Ref_Pre_1980',
'DOE_Ref_1980_2004': 'DOE_Ref_1980_2004',
'ASHRAE_2004': 'ASHRAE_2004',
'ASHRAE_2007': 'ASHRAE_2007',
'ASHRAE_2010': 'ASHRAE_2010',
'ASHRAE_2013': 'ASHRAE_2013',
'ASHRAE_2016': 'ASHRAE_2016',
'ASHRAE_2019': 'ASHRAE_2019',
'pre_1980': 'DOE_Ref_Pre_1980',
'1980_2004': 'DOE_Ref_1980_2004',
'2004': 'ASHRAE_2004',
'2007': 'ASHRAE_2007',
'2010': 'ASHRAE_2010',
'2013': 'ASHRAE_2013',
'2016': 'ASHRAE_2016',
'2019': 'ASHRAE_2019'
}

# set default sizing factors
heating_fac = 1.25 if _heating_fac_ is None else _heating_fac_
Expand All @@ -62,3 +131,11 @@
sizing.add_from_ddy_990_010(ddy_file_)
else:
sizing.add_from_ddy(ddy_file_)

# set the efficiency standard if provided
if eff_standard_ is not None:
sizing.efficiency_standard = EFF_STANDARDS[eff_standard_]
if climate_zone_ is not None:
sizing.climate_zone = climate_zone_
if bldg_type_ is not None:
sizing.building_type = bldg_type_
Binary file not shown.
Binary file not shown.
Binary file modified samples/shoe_box_energy_model.gh
Binary file not shown.

0 comments on commit ec7269e

Please sign in to comment.