Skip to content

Commit 77657cf

Browse files
authored
Merge pull request #1784 from NREL/ruby-docs
More ruby documentation
2 parents 2132765 + 9252cf1 commit 77657cf

38 files changed

+1255
-1764
lines changed

BuildResidentialHPXML/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,7 @@ Pipe diameter of the geothermal loop. Only applies to ground-to-air heat pump ty
27772777

27782778
**Heating System 2: Type**
27792779

2780-
The type of the second heating system.
2780+
The type of the second heating system. If a heat pump is specified and the backup type is 'separate', this heating system represents 'separate' backup heating. For ducted heat pumps where the backup heating system is a 'Furnace', the backup would typically be characterized as 'integrated' in that the furnace and heat pump share the same distribution system and blower fan; a 'Furnace' as 'separate' backup to a ducted heat pump is not supported.
27812781

27822782
- **Name:** ``heating_system_2_type``
27832783
- **Type:** ``Choice``

BuildResidentialHPXML/measure.rb

+61-61
Large diffs are not rendered by default.

BuildResidentialHPXML/measure.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<schema_version>3.1</schema_version>
44
<name>build_residential_hpxml</name>
55
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
6-
<version_id>8d558b94-90a7-4f68-86a0-8f80b41ddbb5</version_id>
7-
<version_modified>2024-08-06T22:34:22Z</version_modified>
6+
<version_id>ffacf8b9-4562-4319-ab8a-f4a63fc0126f</version_id>
7+
<version_modified>2024-08-16T19:31:29Z</version_modified>
88
<xml_checksum>2C38F48B</xml_checksum>
99
<class_name>BuildResidentialHPXML</class_name>
1010
<display_name>HPXML Builder</display_name>
@@ -3359,7 +3359,7 @@
33593359
<argument>
33603360
<name>heating_system_2_type</name>
33613361
<display_name>Heating System 2: Type</display_name>
3362-
<description>The type of the second heating system.</description>
3362+
<description>The type of the second heating system. If a heat pump is specified and the backup type is 'separate', this heating system represents 'separate' backup heating. For ducted heat pumps where the backup heating system is a 'Furnace', the backup would typically be characterized as 'integrated' in that the furnace and heat pump share the same distribution system and blower fan; a 'Furnace' as 'separate' backup to a ducted heat pump is not supported.</description>
33633363
<type>Choice</type>
33643364
<required>true</required>
33653365
<model_dependent>false</model_dependent>
@@ -7389,7 +7389,7 @@
73897389
<filename>README.md</filename>
73907390
<filetype>md</filetype>
73917391
<usage_type>readme</usage_type>
7392-
<checksum>B702F428</checksum>
7392+
<checksum>FCAE28E2</checksum>
73937393
</file>
73947394
<file>
73957395
<filename>README.md.erb</filename>
@@ -7406,13 +7406,13 @@
74067406
<filename>measure.rb</filename>
74077407
<filetype>rb</filetype>
74087408
<usage_type>script</usage_type>
7409-
<checksum>0472491B</checksum>
7409+
<checksum>3E87E8F5</checksum>
74107410
</file>
74117411
<file>
74127412
<filename>geometry.rb</filename>
74137413
<filetype>rb</filetype>
74147414
<usage_type>resource</usage_type>
7415-
<checksum>2764D675</checksum>
7415+
<checksum>523DF705</checksum>
74167416
</file>
74177417
<file>
74187418
<filename>test_build_residential_hpxml.rb</filename>

BuildResidentialHPXML/resources/geometry.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,7 @@ def self.get_abs_azimuth(relative_azimuth:,
19191919
# @param space [OpenStudio::Model::Space] the foundation space adjacent to the rim joist
19201920
# @param rim_joist_height [Double] height of the rim joists (ft)
19211921
# @param z [Double] z coordinate of the bottom of the rim joists
1922-
# @return [void]
1922+
# @return [nil]
19231923
def self.add_rim_joist(model:,
19241924
polygon:,
19251925
space:,
@@ -1963,7 +1963,7 @@ def self.add_rim_joist(model:,
19631963
# @param model [OpenStudio::Model::Model] OpenStudio Model object
19641964
# @param footprint_polygon [OpenStudio::Point3dVector] an OpenStudio::Point3dVector object
19651965
# @param space [OpenStudio::Model::Space] an OpenStudio::Model::Space object
1966-
# @return [void]
1966+
# @return [nil]
19671967
def self.assign_indexes(model:,
19681968
footprint_polygon:,
19691969
space:)
@@ -2010,7 +2010,7 @@ def self.assign_indexes(model:,
20102010
# We can't deterministically assign indexes to these surfaces.
20112011
#
20122012
# @param model [OpenStudio::Model::Model] OpenStudio Model object
2013-
# @return [void]
2013+
# @return [nil]
20142014
def self.assign_remaining_surface_indexes(model:)
20152015
model.getSurfaces.each do |surface|
20162016
next if surface.additionalProperties.getFeatureAsInteger('Index').is_initialized
@@ -2273,7 +2273,7 @@ def self.add_windows_to_wall(surface:,
22732273
# @param win_num [Integer] The window number for the current surface
22742274
# @param facade [String] front, back, left, or right
22752275
# @param model [OpenStudio::Model::Model] OpenStudio Model object
2276-
# @return [void]
2276+
# @return [nil]
22772277
def self.add_window_to_wall(surface:,
22782278
win_width:,
22792279
win_height:,
@@ -2535,7 +2535,7 @@ def self.get_attic_space(model:,
25352535
# @param model [OpenStudio::Model::Model] OpenStudio Model object
25362536
# @param foundation_type [String] HPXML location for foundation type
25372537
# @param foundation_height [Double] height of the foundation (m)
2538-
# @return [void]
2538+
# @return [nil]
25392539
def self.apply_ambient_foundation_shift(model:,
25402540
foundation_type:,
25412541
foundation_height:)

BuildResidentialScheduleFile/measure.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ def run(model, runner, user_arguments)
178178
#
179179
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
180180
# @param doc [Oga::XML::Document] Oga XML Document object
181-
# @param hpxml_path [String] path of the input HPXML file
182-
# @param hpxml_output_path [String] path of the output HPXML file
181+
# @param hpxml_path [String] Path to the HPXML file
182+
# @param hpxml_output_path [String] Path to the output HPXML file
183183
# @param schedules_filepaths [Array<String>] array of SchedulesFilePath strings in the input HPXML file
184184
# @param args [Hash] Map of :argument_name => value
185185
def write_modified_hpxml(runner, doc, hpxml_path, hpxml_output_path, schedules_filepaths, args)

BuildResidentialScheduleFile/measure.xml

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<schema_version>3.1</schema_version>
44
<name>build_residential_schedule_file</name>
55
<uid>f770b2db-1a9f-4e99-99a7-7f3161a594b1</uid>
6-
<version_id>82cc5cf7-51fc-435c-9ea1-429bf4b72080</version_id>
7-
<version_modified>2024-07-15T21:48:21Z</version_modified>
6+
<version_id>c82306e3-de8f-4659-b356-4e9cd05205e1</version_id>
7+
<version_modified>2024-08-16T19:20:19Z</version_modified>
88
<xml_checksum>03F02484</xml_checksum>
99
<class_name>BuildResidentialScheduleFile</class_name>
1010
<display_name>Schedule File Builder</display_name>
@@ -133,13 +133,13 @@
133133
<filename>measure.rb</filename>
134134
<filetype>rb</filetype>
135135
<usage_type>script</usage_type>
136-
<checksum>D2B0EB5F</checksum>
136+
<checksum>038D2D11</checksum>
137137
</file>
138138
<file>
139139
<filename>README.md</filename>
140140
<filetype>md</filetype>
141141
<usage_type>resource</usage_type>
142-
<checksum>08194138</checksum>
142+
<checksum>7060BE69</checksum>
143143
</file>
144144
<file>
145145
<filename>clothes_dryer_consumption_dist.csv</filename>
@@ -169,7 +169,7 @@
169169
<filename>constants.rb</filename>
170170
<filetype>rb</filetype>
171171
<usage_type>resource</usage_type>
172-
<checksum>B2B70AD9</checksum>
172+
<checksum>962DC751</checksum>
173173
</file>
174174
<file>
175175
<filename>cooking_consumption_dist.csv</filename>
@@ -220,16 +220,16 @@
220220
<checksum>419E598E</checksum>
221221
</file>
222222
<file>
223-
<filename>schedules.rb</filename>
224-
<filetype>rb</filetype>
223+
<filename>schedules.csv</filename>
224+
<filetype>csv</filetype>
225225
<usage_type>resource</usage_type>
226-
<checksum>A0CC250C</checksum>
226+
<checksum>7B6640FE</checksum>
227227
</file>
228228
<file>
229-
<filename>schedules_config.md</filename>
230-
<filetype>md</filetype>
229+
<filename>schedules.rb</filename>
230+
<filetype>rb</filetype>
231231
<usage_type>resource</usage_type>
232-
<checksum>916BF4C3</checksum>
232+
<checksum>25A966F4</checksum>
233233
</file>
234234
<file>
235235
<filename>shower_cluster_size_probability.csv</filename>

BuildResidentialScheduleFile/resources/README.md

+85-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
Stochastic Occupancy Modeling introduces major changes to most occupant-related schedules.
2-
Occupant activities are now generated on-the-fly and saved to CSV files used by `OpenStudio` Schedule:File objects.
1+
# Stochastic Occupancy Modeling
2+
3+
The `BuildResidentialScheduleFile` measure introduces major changes to most occupant-related schedules.
4+
5+
## Overview
6+
7+
Occupant activities are now generated on-the-fly and saved to CSV files used by OpenStudio/EnergyPlus `Schedule:File` objects.
38
Schedules are generated using time-inhomogenous Markov chains derived from American Time Use Survey data, supplemented with sampling duration and power level from NEEA RBSA data, as well as DHW draw duration and flow rate data from Aquacraft/AWWA data.
49
See [Stochastic simulation of occupant-driven energy use in a bottom-up residential building stock model](https://www.sciencedirect.com/science/article/pii/S0306261922011540) for a more complete description of the methodology.
510

6-
The `BuildResidentialScheduleFile` measure outputs a schedule CSV file (available inside the `run` folder of each building simulation output).
11+
## Outputs
12+
13+
The `BuildResidentialScheduleFile` measure outputs schedule CSV files (available inside the `run` folder of each building simulation output).
714
The schedule CSV file contains the following columns:
815
* `occupants`
916
* `lighting_interior`
@@ -27,42 +34,108 @@ The `sleeping` column represents the fractional percent of the total number of o
2734

2835
There are the same number of rows as the total simulation time-step (e.g., 35040 if 15-min, 8760 if hourly [8784, if leap year]).
2936

30-
The `ScheduleGenerator` class uses Markov chain based simulation to generate the schedule.csv.
37+
## The `ScheduleGenerator`
38+
39+
This class uses Markov chain based simulation to generate the schedule CSV files.
3140
To support that, several pre-generated set of files are used, contained in the following folders:
3241
* `weekday`
3342
* `weekend`
3443

35-
These two folders contain the Markov chain initial probability, Markov chain transition and also appliance duration probabilities csv files.
44+
These two folders contain the Markov chain initial probability, Markov chain transition and also appliance duration probabilities CSV files.
3645
The appliance duration probabilities here are used during the Markov chain simulation to determine duration of various appliances.
3746
The files are divided into four clusters (cluster0 to cluster3), for 4 occupant behavior types.
3847

39-
`<enduse>_consumption_dist.csv`
48+
The following sections describe the remaining files found in the schedule generator resources folder.
49+
50+
### `<enduse>_consumption_dist.csv`
4051

4152
These files contain the 15-min power consumption kWh samples for the given end use, obtained from RBSA (average 15-min end use kWh for each submetered home; N=number of homes with that end use).
4253
The schedule generator randomly picks one of these values to determine the power level of the appliance schedule.
4354

44-
`<enduse>_duration_dist.csv`
55+
Here, `<enduse>` may be:
56+
* `clothes_dryer`
57+
* `clothes_washer`
58+
* `cooking`
59+
* `dishwasher`
60+
61+
### `<enduse>_duration_dist.csv`
4562

4663
These files contain the samples of runtime duration of different end uses, in 15-min increments, generated from the RBSA dataset.
4764
So, a value of 3 means 45 minutes.
4865
Each row is for one household, and each column is the duration of one instance of the appliance running.
4966

50-
For the above `<enduse>_consumption_dist.csv` and `<enduse>_duration_dist.csv` files, `<enduse>` may be:
67+
Again, `<enduse>` may be:
5168
* `clothes_dryer`
5269
* `clothes_washer`
5370
* `cooking`
5471
* `dishwasher`
5572

56-
`<enduse>_cluster_size_probability.csv`
73+
### `<enduse>_cluster_size_probability.csv`
5774

5875
These files contain the probability distribution of the event cluster size for different domestic hot water end uses, obtained from the HotWaterEventScheduleGenerator Excel file.
5976
The first row is the probability of a cluster size of 1 event, second row for probability of cluster size of 2 events and so on.
6077

61-
For the above `<enduse>_cluster_size_probability.csv` files, `<enduse>` may be:
78+
Here, `<enduse>` may be:
6279
* `hot_water_clothes_washer`
6380
* `hot_water_dishwasher`
6481
* `shower`
6582

66-
`constants.rb`
83+
### `<enduse>_event_duration_probability.csv`
84+
85+
TODO
86+
87+
Again, `<enduse>` may be:
88+
* `hot_water_clothes_washer`
89+
* `hot_water_dishwasher`
90+
* `shower`
91+
92+
### `constants.rb` and `schedules.csv`
93+
94+
These files contain various miscellaneous configurations for the schedule generator.
95+
Their meanings and sources are defined below.
96+
97+
#### Occupancy Types
98+
99+
Occupancy cluster types: Mostly Home, Early Regular Worker, Mostly Away, Regular Worker.
100+
Probabilities are derived from ATUS using the k-modes algorithm.
101+
102+
#### Plug Loads
103+
104+
This is the baseline schedule for misc plugload, lighting and ceiling fan.
105+
It will be modified based on occupancy.
106+
Television plugload uses the same schedule as misc plugload.
107+
108+
#### Lighting
109+
110+
Indoor lighting schedule is generated on the fly.
111+
Garage lighting uses the same schedule as indoor lighting.
112+
113+
#### Cooking
114+
115+
Monthly energy use multipliers for cooking stove/oven/range from average of multiple end-use submetering datasets (HEMS, RBSAM, ELCAP, Mass Res 1, Pecan St.).
116+
Power draw distribution is based on csv files.
117+
118+
#### Clothes Dryer
119+
120+
Monthly energy use multipliers for clothes dryer from average of multiple end-use submetering datasets (HEMS, RBSAM, ELCAP, Mass Res 1, Pecan St., FSEC).
121+
Power draw distribution is based on csv files.
122+
123+
#### Clothes Washer
124+
125+
Monthly energy use multipliers for clothes washer and dishwasher from average of multiple end-use submetering datasets (generally HEMS, RBSAM, ELCAP, Mass Res 1, and Pecan St.).
126+
Power draw distribution is based on csv files.
127+
128+
#### Dishwasher
129+
130+
Monthly energy use multipliers for clothes washer and dishwasher from average of multiple end-use submetering datasets (generally HEMS, RBSAM, ELCAP, Mass Res 1, Pecan St., and FSEC).
131+
Power draw distribution is based on csv files.
132+
133+
#### Water Draw Events
134+
135+
Probabilities for all water draw events are extracted from DHW event generators.
136+
The onset, duration, events_per_cluster_probs, flow rate mean and std could all refer to the DHW event generator excel sheet ('event characteristics' and 'Start Times' sheet).
137+
138+
#### Sink
67139

68-
This file contains various miscellaneous configurations for the schedule generator, and their meanings and sources are defined within the file.
140+
avg_sink_clusters_per_hh -> Average sink cluster per house hold. Set to 6657 for U.S. average of 2.53 occupants per household, based on relationship of 6885 clusters for 25 gpd, from Building America DHW Event Schedule Generator,
141+
Set to 6657 for U.S. average of 2.53 occupants per household, based on relationship of 6885 clusters for 25 gpd, from Building America DHW Event Schedule Generator.

0 commit comments

Comments
 (0)