Skip to content

Commit

Permalink
feat(shades): Add new Window Shades, Spec-Heat-Cap
Browse files Browse the repository at this point in the history
- New window shades (blinds) component
- Add blinds input for PH Window Construction component
- Add spec-heat-capacity setter component
- Support multiple fresh-air vent ducts
- New Phius blind transmittance calculator component
- update versions
  • Loading branch information
ed-p-may committed Mar 30, 2023
1 parent 21d5cd2 commit 0f10378
Show file tree
Hide file tree
Showing 17 changed files with 349 additions and 27 deletions.
Binary file modified hbph_installer.gh
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#
# Honeybee-PH: A Plugin for adding Passive-House data to LadybugTools Honeybee-Energy Models
#
# This component is part of the PH-Tools toolkit <https://github.com/PH-Tools>.
#
# Copyright (c) 2022, PH-Tools and bldgtyp, llc <[email protected]>
# Honeybee-PH is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 3 of the License,
# or (at your option) any later version.
#
# Honeybee-PH is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a copy of the GNU General Public License
# see <https://github.com/PH-Tools/honeybee_ph/blob/main/LICENSE>.
#
# @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
#
"""
Calculate an effective solar reduction factor for Phius WUFI-Passive Models. This
calcualtor will output a solar transmittance and solar reflectance value which can
be used in a Honeybee Energy "HB Shade Material" to create interior or exterior blinds.
The calculataion here follows the protocol described in the Phius Guidebook v3.1, Appenix N-8
-
If the shading reduction factor for a blind in the closed position is “_material_transmittance”,
and “transmittance_efective_” is in the input in WUFI Passive then:
For exterior blinds use:
Z effective = 0.3 + 0.7 * z
Example: If blinds allow 46% solar access (solar transmittance, Ts) when closed,
use that for "_material_transmittance", and "transmittance_efective_" turns out to be 62%.
Z effective = 0.3 + (0.7*0.46) = 0.622
For interior blinds use:
Z effective = 1- (1-z) * (1-0.6)
Example: If blinds allow 46% solar access (solar transmittance, Ts) when closed,
use that for "_material_transmittance", and "transmittance_efective_" turns out to be 78%.
Z effective = 1 – (1-0.46) * (1-0.6) = 0.784
-
EM March 23, 2023
Args:
_material_transmittance: (float) A value from 0.0 to 1.0
_inside: (bool) Default=True. Set to False if the blinds are mounted ouside.
Returns:
transmittance_effective_: The solar transmittance value. Input this result value
into the "_transmittance_" input on an "HB Shade Material" component.
reflectance_effective_: The solar reflectance value. Input this result value
into the "_reflectance_" input on an "HB Shade Material" component.
"""

try:
from honeybee_ph_utils import preview
except ImportError as e:
raise ImportError('Failed to import honeybee_ph_utils:\t{}'.format(e))

try:
from honeybee_ph_rhino import gh_compo_io, gh_io
except ImportError as e:
raise ImportError('Failed to import honeybee_ph_rhino:\t{}'.format(e))


# -------------------------------------------------------------------------------------
import honeybee_ph_rhino._component_info_
reload(honeybee_ph_rhino._component_info_)
ghenv.Component.Name = "HBPH - Calculate Phius Blind Transmittance"
DEV = honeybee_ph_rhino._component_info_.set_component_params(ghenv, dev=False)
if DEV:
reload(gh_io)
from honeybee_ph_rhino.gh_compo_io import win_calc_phius_blind as gh_compo_io
reload(gh_compo_io)


# -------------------------------------------------------------------------------------
gh_compo_interface = gh_compo_io.GHCompo_CalcPhiusShadeTransmittance(
_material_transmittance,
_inside,
)
transmittance_effective_, reflectance_effective_ = gh_compo_interface.run()
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@
models and outputs.
-
EM October 2, 2022
EM March 22, 2023
Args:
_name_: (str)
_frame: (PhWindowFrame) A HBPH Window Frame to build the window construction from.
_glazing: (PhWindowGlazing) A HBPH Window Glazing to build the window construction from.
_shade: (Optional[EnergyWindowMaterialShade]) An Optional solar shade (roller blind) to add to the
window construction. This will show up as a Solar Protection device in WUFI. Use an
"HB - Shade Material" and set the "_transmittance_" input to desired value. Note that
for WUFI and PHPP, the other values such as thickness and emissivity are disregarded. If
the window construction does not have solar shading simply leave this input blank.
nfrc_u_factor_: (float) Optional NRFC U-Factor for the Window Construction. If none is supplied,
this value will be approximated from the ISO values of the _glazing and _frame.
Note that this is an approximation only. Strictly speaking this ISO value is not valid
Expand Down Expand Up @@ -79,8 +85,9 @@
ghenv.Component.Name = "HBPH - Create PH Window Construction"
DEV = honeybee_ph_rhino._component_info_.set_component_params(ghenv, dev=False)
if DEV:
reload(gh_compo_io)
reload(gh_io)
from honeybee_ph_rhino.gh_compo_io import win_create_constr as gh_compo_io
reload(gh_compo_io)


# ------------------------------------------------------------------------------
Expand All @@ -97,6 +104,7 @@
nfrc_u_factor_,
nfrc_shgc_,
t_vis_,
_shade,
)
construction_ = gh_compo_interface.run()

Expand Down
11 changes: 6 additions & 5 deletions honeybee_grasshopper_ph/src/HBPH - Create Ventilation System.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""
Create new PH-Style Ventilation Equpment which can be aded to HB-Rooms.
-
EM October 2, 2022
EM March 22, 2023
Args:
system_name_: (str) The name to give to the fresh-air ventilation system.
Expand All @@ -48,7 +48,7 @@
raise ImportError('Failed to import honeybee_ph_utils:\t{}'.format(e))

try:
from honeybee_ph_rhino import gh_compo_io
from honeybee_ph_rhino import gh_compo_io, gh_io
except ImportError as e:
raise ImportError('Failed to import honeybee_ph_rhino:\t{}'.format(e))

Expand All @@ -59,16 +59,17 @@
ghenv.Component.Name = "HBPH - Create Ventilation System"
DEV = honeybee_ph_rhino._component_info_.set_component_params(ghenv, dev=False)
if DEV:
reload(gh_compo_io)
reload(gh_io)
from honeybee_ph_rhino.gh_compo_io import mech_create_vent_sys as gh_compo_io


# ------------------------------------------------------------------------------
gh_compo_interface = gh_compo_io.GHCompo_CreateVentSystem(
system_name_,
system_type_,
vent_unit_,
duct_01_,
duct_02_,
supply_ducts_,
exhaust_ducts_,
)
vent_system_ = gh_compo_interface.run()

Expand Down
82 changes: 82 additions & 0 deletions honeybee_grasshopper_ph/src/HBPH - Set Spec Heat Capacity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#
# Honeybee-PH: A Plugin for adding Passive-House data to LadybugTools Honeybee-Energy Models
#
# This component is part of the PH-Tools toolkit <https://github.com/PH-Tools>.
#
# Copyright (c) 2022, PH-Tools and bldgtyp, llc <[email protected]>
# Honeybee-PH is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 3 of the License,
# or (at your option) any later version.
#
# Honeybee-PH is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a copy of the GNU General Public License
# see <https://github.com/PH-Tools/honeybee_ph/blob/main/LICENSE>.
#
# @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
#
"""
Set the Room averge Specific Heat Capacity (Wh/m2-K). If a single value is provided, it
will be used to set the attribute value of each Honeybee-Room input. If a list is provided,
the values will be applied to the Honeybee-Rooms in the order input.
-
EM March 29, 2023
Args:
_room_spec_capacities: (Wh/m2k) Input either -
"1-Lightweight" (Default)
"2-Mixed"
"3-Massive"
_hb_rooms: (List[roomn.Room]) A list of the Honeybee Rooms to set the
Specific Heat Capacity (Wh/m2k) on.
Returns:
hb_rooms_: (List[room.Room]) A list of the Honeybee Rooms with their
Specific Heat Capacity (Wh/m2k) set.
"""

import scriptcontext as sc
import Rhino as rh
import rhinoscriptsyntax as rs
import ghpythonlib.components as ghc
import Grasshopper as gh


try:
from honeybee_ph_utils import preview
except ImportError as e:
raise ImportError('Failed to import honeybee_ph_utils:\t{}'.format(e))

try:
from honeybee_ph_rhino import gh_compo_io, gh_io
except ImportError as e:
raise ImportError('Failed to import honeybee_ph_rhino:\t{}'.format(e))


#-------------------------------------------------------------------------------
import honeybee_ph_rhino._component_info_
reload(honeybee_ph_rhino._component_info_)
ghenv.Component.Name = "HBPH - Set Spec Heat Capacity"
DEV = honeybee_ph_rhino._component_info_.set_component_params(ghenv, dev=False)
if DEV:
from honeybee_ph_rhino.gh_compo_io import set_spec_heat_cap as gh_compo_io
reload(gh_compo_io)


# ------------------------------------------------------------------------------
# -- GH Interface
IGH = gh_io.IGH( ghdoc, ghenv, sc, rh, rs, ghc, gh )


# ------------------------------------------------------------------------------
gh_compo_interface = gh_compo_io.GHCompo_SetRoomSpecHeatCaps(
IGH,
_room_spec_capacities,
_hb_rooms,
)

hb_rooms_ = gh_compo_interface.run()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 13 additions & 1 deletion honeybee_ph_rhino/_component_info_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
These are called when the component is instantiated within the Grasshopper canvas.
"""

RELEASE_VERSION = "Honeybee-PH v1.0.27"
RELEASE_VERSION = "Honeybee-PH v1.0.28"
CATEGORY = "HB-PH"
SUB_CATEGORIES = {
0: "00 | Utils",
Expand Down Expand Up @@ -299,6 +299,12 @@
"Category": CATEGORY,
"SubCategory": 1,
},
"HBPH - Calculate Phius Blind Transmittance" :{
"NickName": " Calc. Phius Blind",
"Message": RELEASE_VERSION,
"Category": CATEGORY,
"SubCategory": 1,
},
# -- Envelope
"HBPH - Create SD Constructions": {
"NickName": "Create SD Const.",
Expand All @@ -324,6 +330,12 @@
"Category": CATEGORY,
"SubCategory": 1,
},
"HBPH - Set Spec Heat Capacity": {
"NickName": "Set Spec Heat Cap.",
"Message": RELEASE_VERSION,
"Category": CATEGORY,
"SubCategory": 1,
},
# -- Shading
"HBPH - Create Building Shading": {
"NickName": "Create Shading",
Expand Down
2 changes: 2 additions & 0 deletions honeybee_ph_rhino/gh_compo_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
from honeybee_ph_rhino.gh_compo_io.win_create_frame import GHCompo_CreatePhWinFrame
from honeybee_ph_rhino.gh_compo_io.win_create_frame_element import GHCompo_CreatePhWinFrameElement
from honeybee_ph_rhino.gh_compo_io.win_set_inst_depth import GHCompo_SetApertureInstallDepth
from honeybee_ph_rhino.gh_compo_io.win_calc_phius_blind import GHCompo_CalcPhiusShadeTransmittance
# -- Envelope
from honeybee_ph_rhino.gh_compo_io.assmbly_create_sd_const import GHCompo_CreateSDConstructions
from honeybee_ph_rhino.gh_compo_io.assmbly_create_mixed_mat import GHCompo_CreateMixedHBMaterial
from honeybee_ph_rhino.gh_compo_io.set_spec_heat_cap import GHCompo_SetRoomSpecHeatCaps
# -- Mech
from honeybee_ph_rhino.gh_compo_io.mech_create_vent_sys import GHCompo_CreateVentSystem
from honeybee_ph_rhino.gh_compo_io.mech_create_ventilator import GHCompo_CreatePhVentilator
Expand Down
40 changes: 29 additions & 11 deletions honeybee_ph_rhino/gh_compo_io/mech_create_vent_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""GHCompo Interface: HBPH - Create Ventilation System."""

try:
from typing import Any, Optional
from typing import Union, Optional, List
except ImportError:
pass #IronPython 2.7

Expand All @@ -27,14 +27,36 @@
class GHCompo_CreateVentSystem(object):
display_name = ghio_validators.HBName("display_name")

def __init__(self, _display_name, _sys_type, _vent_unit, _duct_01, _duct_02):
# type: (str, int, ventilation.Ventilator, Optional[ducting.PhDuctElement], Optional[ducting.PhDuctElement]) -> None
def __init__(self, _display_name, _sys_type, _vent_unit, _supply_ducts, _exhaust_ducts):
# type: (str, int, ventilation.Ventilator, List[ducting.PhDuctElement], List[ducting.PhDuctElement]) -> None
self.display_name = _display_name or "__unnamed_ventilator__"
self.system_type = _sys_type
self.vent_unit = _vent_unit
self.duct_01 = _duct_01
self.duct_02 = _duct_02
self._supply_ducts = _supply_ducts
self._exhaust_ducts = _exhaust_ducts

@property
def supply_ducts(self):
# type: () -> List[ducting.PhDuctElement]
return self._supply_ducts or [ducting.PhDuctElement.default_supply_duct()]

@supply_ducts.setter
def supply_ducts(self, _input):
# type: (Union[ducting.PhDuctElement, List[ducting.PhDuctElement]]) -> None
if not isinstance(_input, list):
self._supply_ducts = [_input]

@property
def exhaust_ducts(self):
# type: () -> List[ducting.PhDuctElement]
return self._exhaust_ducts or [ducting.PhDuctElement.default_exhaust_duct()]

@exhaust_ducts.setter
def exhaust_ducts(self, _input):
# type: (Union[ducting.PhDuctElement, List[ducting.PhDuctElement]]) -> None
if not isinstance(_input, list):
self._supply_ducts = [_input]

@property
def system_type(self):
# type: () -> int
Expand All @@ -52,11 +74,7 @@ def run(self):
vent_system_.display_name = self.display_name or vent_system_.display_name
vent_system_.sys_type = self.system_type
vent_system_.ventilation_unit = self.vent_unit or ventilation.Ventilator()

if self.duct_01:
vent_system_.duct_01 = self.duct_01

if self.duct_02:
vent_system_.duct_02 = self.duct_02
vent_system_.supply_ducting = self.supply_ducts
vent_system_.exhaust_ducting = self.exhaust_ducts

return vent_system_
Loading

0 comments on commit 0f10378

Please sign in to comment.