diff --git a/honeybee_grasshopper_energy/src/HB IdealAir.py b/honeybee_grasshopper_energy/src/HB IdealAir.py new file mode 100644 index 00000000..875d9a59 --- /dev/null +++ b/honeybee_grasshopper_energy/src/HB IdealAir.py @@ -0,0 +1,100 @@ +# Honeybee: A Plugin for Environmental Analysis (GPL) +# This file is part of Honeybee. +# +# Copyright (c) 2019, Ladybug Tools. +# You should have received a copy of the GNU General Public License +# along with Honeybee; If not, see . +# +# @license GPL-3.0+ + +""" +Apply a customized IdealAirSystem to Honeybee Rooms. +- + + Args: + _rooms: Honeybee Rooms to which the input ideal air properties will + be assigned. + _economizer_: Text to indicate the type of air-side economizer used on + the ideal air system. Economizers will mix in a greater amount of + outdoor air to cool the zone (rather than running the cooling system) + when the zone needs cooling and the outdoor air is cooler than the zone. + Choose from the options below. Default: DifferentialDryBulb. + * NoEconomizer + * DifferentialDryBulb + * DifferentialEnthalpy + dcv_: Boolean to note whether demand controlled ventilation should be + used on the system, which will vary the amount of ventilation air + according to the occupancy schedule of the zone. Default: False. + sensible_hr_: A number between 0 and 1 for the effectiveness of sensible + heat recovery within the system. Default: 0. + latent_hr_: A number between 0 and 1 for the effectiveness of latent heat + recovery within the system. Default: 0. + _heat_temp_: A number for the maximum heating supply air temperature + [C]. Default: 50, which is typical for many air-based HVAC systems. + _cool_temp_: A number for the minimum cooling supply air temperature + [C]. Default: 13, which is typical for many air-based HVAC systems. + _heat_limit_: A number for the maximum heating capacity in Watts. This + can also be the text 'autosize' to indicate that the capacity should + be determined during the EnergyPlus sizing calculation. This can also + be the text 'NoLimit' to indicate no upper limit to the heating + capacity. Default: 'autosize'. + _cool_limit_: A number for the maximum cooling capacity in Watts. This + can also be the text 'autosize' to indicate that the capacity should + be determined during the EnergyPlus sizing calculation. This can also + be the text 'NoLimit' to indicate no upper limit to the cooling + capacity. Default: 'autosize'. + + Returns: + rooms: The input Rooms with their Ideal Air Systems edited. +""" + +ghenv.Component.Name = "HB IdealAir" +ghenv.Component.NickName = 'IdealAir' +ghenv.Component.Message = '0.1.0' +ghenv.Component.Category = 'Energy' +ghenv.Component.SubCategory = '4 :: HVAC' +ghenv.Component.AdditionalHelpFromDocStrings = '1' + + +try: # import the honeybee-energy extension + from honeybee_energy.hvac.idealair import IdealAirSystem +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): + # duplicate the initial objects + rooms = [room.duplicate() for room in _rooms] + + for room in rooms: + if room.properties.energy.is_conditioned: + # check to be sure the assigned HVAC system is an IdealAirSystem + if not isinstance(room.properties.energy.hvac, IdealAirSystem): + room.properties.energy.add_default_ideal_air() + + # create the customized ideal air system + new_ideal_air = room.properties.energy.hvac.duplicate() + if _economizer_ is not None: + new_ideal_air.economizer_type = _economizer_ + if dcv_ is not None: + new_ideal_air.demand_controlled_ventilation = dcv_ + if sensible_hr_ is not None: + new_ideal_air.sensible_heat_recovery = sensible_hr_ + if latent_hr_ is not None: + new_ideal_air.latent_heat_recovery = latent_hr_ + if _heat_temp_ is not None: + new_ideal_air.heating_air_temperature = _heat_temp_ + if _cool_temp_ is not None: + new_ideal_air.cooling_air_temperature = _cool_temp_ + if _heat_limit_ is not None: + new_ideal_air.heating_limit = _heat_limit_ + if _cool_limit_ is not None: + new_ideal_air.cooling_limit = _cool_limit_ + + # assign the HVAC to the Room + room.properties.energy.hvac = new_ideal_air diff --git a/honeybee_grasshopper_energy/user_objects/HB IdealAir.ghuser b/honeybee_grasshopper_energy/user_objects/HB IdealAir.ghuser new file mode 100644 index 00000000..69e29cd4 Binary files /dev/null and b/honeybee_grasshopper_energy/user_objects/HB IdealAir.ghuser differ diff --git a/samples/full_building_energy_model.gh b/samples/full_building_energy_model.gh index b1ace3d0..3b7365b9 100644 Binary files a/samples/full_building_energy_model.gh and b/samples/full_building_energy_model.gh differ