-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(result): Add components for HVAC size result parsing
This commit adds components to parse the size of HVAC components and peak loads.
- Loading branch information
1 parent
cfcc0c3
commit 713027b
Showing
13 changed files
with
141 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 modified
BIN
+0 Bytes
(100%)
honeybee_grasshopper_energy/user_objects/HB Read Face Result.ghuser
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-9 Bytes
(100%)
honeybee_grasshopper_energy/user_objects/HB Read Result Dictionary.ghuser
Binary file not shown.
Binary file modified
BIN
-3 Bytes
(100%)
honeybee_grasshopper_energy/user_objects/HB Read Room Comfort Result.ghuser
Binary file not shown.
Binary file modified
BIN
-8 Bytes
(100%)
honeybee_grasshopper_energy/user_objects/HB Read Room Energy Result.ghuser
Binary file not shown.
Binary file not shown.
Binary file not shown.