Skip to content

Commit

Permalink
feat(result): Add components for HVAC size result parsing
Browse files Browse the repository at this point in the history
This commit adds components to parse the size of HVAC components and peak loads.
  • Loading branch information
chriswmackey authored and Chris Mackey committed May 16, 2020
1 parent cfcc0c3 commit 713027b
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 5 deletions.
2 changes: 1 addition & 1 deletion honeybee_grasshopper_energy/src/HB Read Face Result.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

ghenv.Component.Name = 'HB Read Face Result'
ghenv.Component.NickName = 'FaceResult'
ghenv.Component.Message = '0.1.1'
ghenv.Component.Message = '0.1.2'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '6 :: Result'
ghenv.Component.AdditionalHelpFromDocStrings = '1'
Expand Down
89 changes: 89 additions & 0 deletions honeybee_grasshopper_energy/src/HB Read HVAC Sizing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Ladybug: A Plugin for Environmental Analysis (GPL)
# This file is part of Ladybug.
#
# Copyright (c) 2020, Ladybug Tools.
# You should have received a copy of the GNU General Public License
# along with Ladybug; If not, see <http://www.gnu.org/licenses/>.
#
# @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>

"""
Parse the peak load and HVAC component sizes from an SQL result file that has
been generated from an energy simulation.
-
Args:
_sql: The file path of the SQL result file that has been generated from
an energy simulation.
comp_type_: An optional name of a HVAC component type, which will filter
the HVAC components that appear in the output comp_props and
comp_values. Connecting nothing here will mean that all HVAC
component sizes are imported and a full list of possible components
will appear in the comp_types output.
Returns:
zone_names: A list of zone names (honeybee Room identifiers) that correspond
to the zone_peak_load and zone_peak_heat below.
zone_peak_cool: A list of numbers for the peak cooling load of each zone
on the summer design day. These correspond to the zone_names above.
zone_peak_heat: A list of numbers for the peak heating load of each zone
on the winter design day. These correspond to the zone_names above.
comp_types: A list of HVAC component types that are available in the results.
This will be equal to the input comp_type_ if a value is connected.
comp_properties: A list of text descriptions for HVAC component properties.
These correspond to the comp_values below.
comp_values: Values denoting the size of various zone HVAC components
(eg. zone terminal sizes, boiler/chiller sizes, lengths of chilled
beams, etc.). These correspond to the comp_properties above.
"""

ghenv.Component.Name = 'HB Read HVAC Sizing'
ghenv.Component.NickName = 'ReadHVAC'
ghenv.Component.Message = '0.1.0'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '6 :: Result'
ghenv.Component.AdditionalHelpFromDocStrings = '1'

try:
from honeybee_energy.result.sql import SQLiteResult
except ImportError as e:
raise ImportError('\nFailed to import honeybee_energy:\n\t{}'.format(e))

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


if all_required_inputs(ghenv.Component):
# create the objects and lists to be filled
sql_obj = SQLiteResult(_sql)
zone_names = []
zone_peak_cool = []
zone_peak_heat = []
comp_properties_mtx = []
comp_values_mtx = []

# get the peak zone heating and cooling
for zone_size in sql_obj.zone_cooling_sizes:
zone_names.append(zone_size.zone_name)
zone_peak_cool.append(zone_size.calculated_design_load)
for zone_size in sql_obj.zone_heating_sizes:
zone_peak_heat.append(zone_size.calculated_design_load)

# get the HVAC component sizes
if comp_type_ is None:
comp_types = sql_obj.component_types
for comp_size in sql_obj.component_sizes:
comp_properties_mtx.append(comp_size.descriptions)
comp_values_mtx.append(comp_size.values)
else:
comp_types = comp_type_
for comp_size in sql_obj.component_sizes_by_type(comp_type_):
comp_properties_mtx.append(comp_size.descriptions)
comp_values_mtx.append(comp_size.values)

# convert HVAC components to data trees
comp_properties = list_to_data_tree(comp_properties_mtx)
comp_values = list_to_data_tree(comp_values_mtx)
4 changes: 2 additions & 2 deletions honeybee_grasshopper_energy/src/HB Read Result Dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

ghenv.Component.Name = 'HB Read Result Dictionary'
ghenv.Component.NickName = 'ReadRDD'
ghenv.Component.Message = '0.1.0'
ghenv.Component.Message = '0.1.1'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '6 :: Result'
ghenv.Component.AdditionalHelpFromDocStrings = '1'
ghenv.Component.AdditionalHelpFromDocStrings = '0'

try:
from honeybee_energy.result.rdd import RDD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

ghenv.Component.Name = 'HB Read Room Comfort Result'
ghenv.Component.NickName = 'RoomComfortResult'
ghenv.Component.Message = '0.1.1'
ghenv.Component.Message = '0.1.2'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '6 :: Result'
ghenv.Component.AdditionalHelpFromDocStrings = '1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

ghenv.Component.Name = 'HB Read Room Energy Result'
ghenv.Component.NickName = 'RoomEnergyResult'
ghenv.Component.Message = '0.1.2'
ghenv.Component.Message = '0.1.3'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '6 :: Result'
ghenv.Component.AdditionalHelpFromDocStrings = '1'
Expand Down
47 changes: 47 additions & 0 deletions honeybee_grasshopper_energy/src/HB Read Zone Sizing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Ladybug: A Plugin for Environmental Analysis (GPL)
# This file is part of Ladybug.
#
# Copyright (c) 2020, Ladybug Tools.
# You should have received a copy of the GNU General Public License
# along with Ladybug; If not, see <http://www.gnu.org/licenses/>.
#
# @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>

"""
Parse a zone sizing (ZSZ) csv result file from an energy simulation to get data
collections for the cooling/heating load over the peak design day.
-
Args:
_zsz: Full path to a zone sizing (ZSZ) csv result file that was
generated by EnergyPlus.
Returns:
cooling_load: a list of HourlyContinuousCollections for zone cooling load.
There will be one data collection per conditioned zone in the model.
heating_load: a list of HourlyContinuousCollections for zone heating load.
There will be one data collection per conditioned zone in the model.
"""

ghenv.Component.Name = 'HB Read Zone Sizing'
ghenv.Component.NickName = 'ReadZSZ'
ghenv.Component.Message = '0.1.0'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '6 :: Result'
ghenv.Component.AdditionalHelpFromDocStrings = '1'

try:
from honeybee_energy.result.zsz import ZSZ
except ImportError as e:
raise ImportError('\nFailed to import honeybee_energy:\n\t{}'.format(e))

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


if all_required_inputs(ghenv.Component):
zsz_obj = ZSZ(_zsz)
cooling_load = zsz_obj.cooling_load_data
heating_load = zsz_obj.heating_load_data
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified samples/single_family_energy_model.gh
Binary file not shown.

0 comments on commit 713027b

Please sign in to comment.