Skip to content

Commit

Permalink
fix(load): Add an option for people latent heat fraction
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed May 9, 2023
1 parent 25e5d6c commit b433881
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Binary file modified honeybee_grasshopper_energy/icon/HB People.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions honeybee_grasshopper_energy/json/HB_People.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.0",
"version": "1.6.1",
"nickname": "People",
"outputs": [
[
Expand Down Expand Up @@ -40,10 +40,17 @@
"description": "A schedule for the activity of the occupants over the course\nof the year. The type limt of this schedule should be \"Activity Level\"\nand the values of the schedule equal to the number of Watts given off\nby an individual person in the room. If None, it will a default constant\nschedule with 120 Watts per person will be used, which is typical of\nawake, adult humans who are seated.",
"type": "System.Object",
"default": null
},
{
"access": "item",
"name": "latent_fraction_",
"description": "An optional number between 0 and 1 for the fraction of the heat\ngiven off by people that is latent (as opposed to sensible). when\nunspecified, this will be autocalculated based on the activity level\nand the conditions in the room at each timestep of the simulation.\nThe autocalculation therefore accounts for the change in heat loss\nthrough respiration and sweating that occurs at warmer temperatures\nand higher activity levels, which is generally truer to physics\ncompared to a fixed number.",
"type": "double",
"default": null
}
],
"subcategory": "3 :: Loads",
"code": "\ntry: # import the core honeybee dependencies\n from honeybee.typing import clean_and_id_ep_string, clean_ep_string\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry:\n from honeybee_energy.load.people import People\n from honeybee_energy.lib.schedules import schedule_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # make a default People name if none is provided\n name = clean_and_id_ep_string('People') if _name_ is None else \\\n clean_ep_string(_name_)\n\n # get the schedules\n if isinstance(_occupancy_sch, str):\n _occupancy_sch = schedule_by_identifier(_occupancy_sch)\n if isinstance(_activity_sch_, str):\n _activity_sch_ = schedule_by_identifier(_activity_sch_)\n\n # create the People object\n people = People(name, _ppl_per_area, _occupancy_sch, _activity_sch_)\n if _name_ is not None:\n people.display_name = _name_\n",
"code": "\ntry: # import the core honeybee dependencies\n from honeybee.typing import clean_and_id_ep_string, clean_ep_string\n from honeybee.altnumber import autocalculate\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry:\n from honeybee_energy.load.people import People\n from honeybee_energy.lib.schedules import schedule_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # make a default People name if none is provided\n name = clean_and_id_ep_string('People') if _name_ is None else \\\n clean_ep_string(_name_)\n latent = autocalculate if latent_fraction_ is None else latent_fraction_\n\n # get the schedules\n if isinstance(_occupancy_sch, str):\n _occupancy_sch = schedule_by_identifier(_occupancy_sch)\n if isinstance(_activity_sch_, str):\n _activity_sch_ = schedule_by_identifier(_activity_sch_)\n\n # create the People object\n people = People(name, _ppl_per_area, _occupancy_sch, _activity_sch_,\n latent_fraction=latent)\n if _name_ is not None:\n people.display_name = _name_\n",
"category": "HB-Energy",
"name": "HB People",
"description": "Create a People object that can be used to create a ProgramType or be assigned\ndirectly to a Room.\n-"
Expand Down
15 changes: 13 additions & 2 deletions honeybee_grasshopper_energy/src/HB People.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
by an individual person in the room. If None, it will a default constant
schedule with 120 Watts per person will be used, which is typical of
awake, adult humans who are seated.
latent_fraction_: An optional number between 0 and 1 for the fraction of the heat
given off by people that is latent (as opposed to sensible). when
unspecified, this will be autocalculated based on the activity level
and the conditions in the room at each timestep of the simulation.
The autocalculation therefore accounts for the change in heat loss
through respiration and sweating that occurs at warmer temperatures
and higher activity levels, which is generally truer to physics
compared to a fixed number.
Returns:
people: A People object that can be used to create a ProgramType or
Expand All @@ -35,13 +43,14 @@

ghenv.Component.Name = "HB People"
ghenv.Component.NickName = 'People'
ghenv.Component.Message = '1.6.0'
ghenv.Component.Message = '1.6.1'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = '3 :: Loads'
ghenv.Component.AdditionalHelpFromDocStrings = "3"

try: # import the core honeybee dependencies
from honeybee.typing import clean_and_id_ep_string, clean_ep_string
from honeybee.altnumber import autocalculate
except ImportError as e:
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))

Expand All @@ -61,6 +70,7 @@
# make a default People name if none is provided
name = clean_and_id_ep_string('People') if _name_ is None else \
clean_ep_string(_name_)
latent = autocalculate if latent_fraction_ is None else latent_fraction_

# get the schedules
if isinstance(_occupancy_sch, str):
Expand All @@ -69,6 +79,7 @@
_activity_sch_ = schedule_by_identifier(_activity_sch_)

# create the People object
people = People(name, _ppl_per_area, _occupancy_sch, _activity_sch_)
people = People(name, _ppl_per_area, _occupancy_sch, _activity_sch_,
latent_fraction=latent)
if _name_ is not None:
people.display_name = _name_
Binary file modified honeybee_grasshopper_energy/user_objects/HB People.ghuser
Binary file not shown.

0 comments on commit b433881

Please sign in to comment.