Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EUSS measure package tests #119

Merged
merged 470 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
470 commits
Select commit Hold shift + click to select a range
2b8daaf
using OS standards fan curve and fan efficiencies
Jan 11, 2024
ed349c1
Merge remote-tracking branch 'origin/wenyi/updateKaleido' into euss_k…
Jan 11, 2024
07341e6
Merge branch 'main' into euss_kitchen_equip
Jan 11, 2024
4197585
incremental updates to tests
Jan 11, 2024
74a0d97
updates to measure for 100% max airflow and to use standards method for
Jan 11, 2024
b270e05
screening for VAV terminals
Jan 12, 2024
f04cdce
updates for new economizer implementation
Jan 12, 2024
6a85291
updating performance data with Lennox xion products
JanghyunJK Jan 12, 2024
10d6c33
rated cop regression update with lennox xion products
JanghyunJK Jan 12, 2024
8d1ed22
adding/applying low stage eir performances from lennox xion products
JanghyunJK Jan 12, 2024
f047e10
nil error fix
JanghyunJK Jan 12, 2024
31b6d54
Merge branch 'main' into aallen/nighttime_oa_control
Jan 12, 2024
8694d05
fixing incomplete sample space
JanghyunJK Jan 12, 2024
67e1f47
fix for applying high/low eir performances
JanghyunJK Jan 12, 2024
dd2ece8
updates to measure applicability
Jan 12, 2024
8acb6f1
updating modeler description
Jan 12, 2024
dcc511b
corrections to measure applicability criteria
Jan 13, 2024
bada6be
corrections to handling of non-unitary systems
Jan 13, 2024
aae0e58
updates to measure
Jan 13, 2024
ef198d7
updates to name of new schedule
Jan 13, 2024
8b468b2
updates to measure to address review comments
Jan 14, 2024
5299246
adding another DOAS check
Jan 14, 2024
df84dec
implementing updated economizer approach
Jan 14, 2024
cb69084
Merge remote-tracking branch 'origin/main' into aallen/nighttime_oa_c…
Jan 14, 2024
6fc0cd3
updates to tsvs
Jan 14, 2024
16d0c57
updates to tsvs and measure comments
Jan 14, 2024
3efffcd
tsvs
Jan 15, 2024
f6c28dd
updates to screen out psz with gas boiler systems
Jan 16, 2024
d25ce94
finish tests
Jan 16, 2024
78d885e
Merge branch 'main' into origin/ccaradon/euss_hprtu_hr
Jan 16, 2024
483a8d9
Update options lookup files
Jan 16, 2024
9a1b1c9
Remove OA autosize bug
Jan 16, 2024
0ff1245
both options lookup updates
JanghyunJK Jan 16, 2024
324e424
both options lookup updates
JanghyunJK Jan 16, 2024
8c9489d
re-including stripmall
JanghyunJK Jan 16, 2024
d524f62
setting upsizing allowance default to 0%
JanghyunJK Jan 16, 2024
4e78b0c
adding empty sql check
JanghyunJK Jan 16, 2024
a9fcd5d
typos
JanghyunJK Jan 16, 2024
e5def76
Merge branch 'main' into jk/vrf-25pct-sizing-allowance
JanghyunJK Jan 16, 2024
52a1e18
Merge branch 'main' into jk/hprtu-std-performance
JanghyunJK Jan 16, 2024
22682e8
std perf description added
JanghyunJK Jan 16, 2024
eb3e581
Update measure.rb
JanghyunJK Jan 16, 2024
aff4d29
using os convert method
JanghyunJK Jan 16, 2024
29e886b
misc typo
JanghyunJK Jan 16, 2024
3cc9278
refactor output var section
JanghyunJK Jan 16, 2024
df38f6c
changing puts to registerInfo
JanghyunJK Jan 16, 2024
61314b4
Merge branch 'main' into jk/economzier-final-ems-merge
JanghyunJK Jan 16, 2024
461cf37
misc
JanghyunJK Jan 16, 2024
8ef88bf
refactor output var section
JanghyunJK Jan 16, 2024
1dc295f
sql empty check revised
JanghyunJK Jan 16, 2024
0a647cd
fix flow rate object error
Jan 17, 2024
ae56b5b
delete empty file
Jan 17, 2024
fc37ed5
refactoring for checking min oa rates
JanghyunJK Jan 17, 2024
338f814
Remove baseboard error. Remove autosize of OA.
Jan 17, 2024
f8b4b7f
Merge branch 'main' into ccaradon/hp_boiler_fix
Jan 17, 2024
111725a
Merge branch 'main' into mprapros/euss_gto_measures
Jan 17, 2024
0ab194b
Update comstock_measure_comparison.py
Jan 18, 2024
000531e
Merge branch 'main' into jx/demand-flexibility
JieXiong9119 Jan 18, 2024
2ce8c0a
Merge branch 'main' into origin/ccaradon/euss_hprtu_hr
Jan 19, 2024
0f9c25c
measure updates
Jan 19, 2024
014a072
Merge remote-tracking branch 'origin/jk/economzier-final-ems-merge' i…
Jan 19, 2024
34e6a4a
removing apply measure arg
JanghyunJK Jan 19, 2024
425d724
Merge branch 'jk/hprtu-std-performance' into origin/ccaradon/euss_hpr…
Jan 19, 2024
4601de2
move econ and dcv out of loop
Jan 19, 2024
174e9fa
remove HR from options lookup
Jan 19, 2024
b4f94f9
update applicability for dcv and econ
Jan 20, 2024
87b0b2e
updates to measure to screen out hospitals
Jan 20, 2024
af47885
updates to screeen out hospitals
Jan 20, 2024
da55eb3
updates to measure
Jan 22, 2024
68f5615
updates to measure based on testing
Jan 22, 2024
9fa2e5c
Merge branch 'main' into jk/economzier-final-ems-merge
JanghyunJK Jan 22, 2024
36feb1a
adding ems friendly name
JanghyunJK Jan 22, 2024
9b39a38
Merge remote-tracking branch 'origin/jk/economzier-final-ems-merge' i…
Jan 22, 2024
42b13f9
fix VAV applicability and pump settings
Jan 23, 2024
517cf46
change ground pump settings
Jan 23, 2024
23ac0ea
improving DCV screening
Jan 23, 2024
944c623
ems friendly for all vars
JanghyunJK Jan 23, 2024
9cd0149
Clean up measure code
Jan 23, 2024
bca2e95
updates to advanced rtu measure to reifne measure applicability
Jan 23, 2024
ba805d8
updates to measure
Jan 23, 2024
12c8189
correction to typo
Jan 23, 2024
938d826
Clean up print statements; revise staging modification requires to en…
Jan 23, 2024
7c3db33
Update threshold for removing stage
Jan 23, 2024
407c58c
test updates
Jan 23, 2024
5ab6806
test models
Jan 23, 2024
5c7a2ad
Merge remote-tracking branch 'origin/jk/hprtu-std-performance' into e…
Jan 23, 2024
a63c10c
making correction
Jan 23, 2024
ebbd76a
uncommenting method
Jan 23, 2024
c97d539
Merge remote-tracking branch 'origin/jk/economzier-final-ems-merge' i…
Jan 24, 2024
629a377
Merge remote-tracking branch 'origin/ccaradon/hp_boiler_fix' into eus…
Jan 24, 2024
2d2c813
modifying how fan airflow rates are set
Jan 24, 2024
ca845e3
correcting typo
Jan 24, 2024
d7c8fa0
getting rid of commented out code
Jan 24, 2024
93a324b
Fix to ensure there is always a speed 3; clean up some print statements
Jan 24, 2024
7343fae
Remove redundant options; remove economizer defaults
Jan 24, 2024
51f56fc
Merge branch 'main' into origin/ccaradon/euss_hprtu_2
Jan 24, 2024
51793fb
update measure
JieXiong9119 Jan 25, 2024
e190524
updates to fan motor efficiency
Jan 25, 2024
a24cc62
update measure
JieXiong9119 Jan 25, 2024
17ae599
clean test models
JieXiong9119 Jan 25, 2024
976b896
Merge branch 'main' into euss_kitchen_equip
Jan 25, 2024
a0d73cd
add return true
Jan 25, 2024
5a2eeda
Update measure test and deprecated method.
Jan 25, 2024
2df268f
Fix tests; update ERV logic to match ERV measure
Jan 25, 2024
269f29b
Merge branch 'main' into origin/ccaradon/euss_hprtu_2
Jan 25, 2024
478f4a4
clean up print statements
Jan 25, 2024
39b79f6
Merge remote-tracking branch 'origin/jk/economzier-final-ems-merge' i…
Jan 25, 2024
d4778e6
console measure updates
Jan 25, 2024
ee57c77
update sensitivity report measure
JieXiong9119 Jan 26, 2024
905df3c
correcting dcv implementation
Jan 26, 2024
5d7ffcc
Merge branch 'mprapros/euss_gto_measures' of https://github.com/NREL/…
Jan 26, 2024
3fff15c
Merge remote-tracking branch 'origin/rhorsey/bsb-23-10-upgrade' into …
Jan 26, 2024
2269706
options lookup fix for kestrel
Jan 26, 2024
67d5e2a
Update dispatch_schedule_generation.rb
JieXiong9119 Jan 26, 2024
7932215
corrections to dcv implementation
Jan 26, 2024
b9d1149
updates to screening unapplicable system types
Jan 27, 2024
5d59ac1
Update qoi_report measure
JieXiong9119 Jan 28, 2024
9dc666a
correction to old measure name
Jan 28, 2024
07e8330
Merge remote-tracking branch 'origin/jk/economzier-final-ems-merge' i…
Jan 28, 2024
af4927a
incorporating economizer ems updates
Jan 28, 2024
adae583
Merge branch 'main' into mprapros/euss_gto_measures
Jan 29, 2024
a4225ff
update qoi_report measure and supporting measure
JieXiong9119 Jan 29, 2024
703e9fc
Merge branch 'main' into origin/ccaradon/euss_hprtu_2
ChristopherCaradonna Jan 29, 2024
4a94742
update qoi report var name
JieXiong9119 Jan 29, 2024
e0ec151
add catch for PVAV or VAV air loops with one thermal zone
Jan 29, 2024
587e242
Merge branch 'mprapros/euss_gto_measures' of https://github.com/NREL/…
Jan 29, 2024
7a9094a
add return true and fix indentation
Jan 29, 2024
544a854
updates to measure applicability
Jan 29, 2024
c9ca546
Merge branch 'mprapros/euss_gto_measures' of https://github.com/NREL/…
Jan 29, 2024
3b81417
updates to measure
Jan 29, 2024
01e0f90
Update comstock_column_definitions.csv
JieXiong9119 Jan 29, 2024
71f7904
updates to xml
Jan 30, 2024
d4bd3af
updates to screen out evaporative coolers
Jan 30, 2024
cacc583
Merge branch 'main' into origin/ccaradon/euss_hprtu_2
ChristopherCaradonna Jan 30, 2024
e552660
updates to measure
Jan 30, 2024
69c0b2b
unit test draft
JanghyunJK Jan 30, 2024
2265737
updates to measure applicability
Jan 30, 2024
25deaed
updates to comments
Jan 30, 2024
7f61346
updates to measure
Jan 30, 2024
4422eff
Update comstock_column_definitions
JieXiong9119 Jan 31, 2024
24cd3a0
exclude some zones from getting GHP and add baseboards
Jan 31, 2024
708755f
Merge branch 'main' into jk/vrf-25pct-sizing-allowance
JanghyunJK Jan 31, 2024
74865e9
Merge remote-tracking branch 'origin/jk/economizer-damper-fault-fix' …
Jan 31, 2024
a4d58d4
first final draft for unit testing for requested oa
JanghyunJK Jan 31, 2024
8fd1ca9
remove old PVAV EMS sensors
Jan 31, 2024
45fddfc
double borefield size to prevent GHEDesigner errors
Jan 31, 2024
a54df84
Merge branch 'main' into jk/economzier-final-ems-merge
JanghyunJK Jan 31, 2024
3f91d65
unit test cleaning
JanghyunJK Jan 31, 2024
b988689
Update measure.xml
JanghyunJK Jan 31, 2024
a4d1411
fix comments
Jan 31, 2024
4f50559
Merge branch 'main' into jk/hprtu-std-performance
JanghyunJK Jan 31, 2024
47f6b62
update options_lookups.tsv
JieXiong9119 Jan 31, 2024
1cd786e
Merge branch 'main' into jx/demand-flexibility
JieXiong9119 Jan 31, 2024
abc2841
Remove return air functionality and replace with effectivness modifier.
Feb 1, 2024
d79d60c
Merge branch 'main' into origin/ccaradon/euss_hprtu_2
ChristopherCaradonna Feb 1, 2024
79d000d
Merge branch 'main' into jk/economzier-final-ems-merge
JanghyunJK Feb 1, 2024
e11e1ef
Merge branch 'main' into jk/vrf-25pct-sizing-allowance
JanghyunJK Feb 1, 2024
e758991
update options_lookup.tsv
JieXiong9119 Feb 1, 2024
aa9c3c6
baseboard lookup fix
Feb 1, 2024
978dec5
additional logic for unconditioned zones or zones that get baseboards
Feb 1, 2024
fa630a5
Update hvac_economizer_test.rb
JanghyunJK Feb 2, 2024
0bd5701
Merge branch 'origin/ccaradon/euss_hprtu_2' into euss_package_testing
Feb 2, 2024
adf7ee7
Merge remote-tracking branch 'origin/jk/economzier-final-ems-merge' i…
Feb 2, 2024
6a597ba
Merge branch 'main' into jx/demand-flexibility
JieXiong9119 Feb 2, 2024
bd7ca01
correction to applicability criteria
Feb 2, 2024
d604301
updates to test
Feb 3, 2024
857aba7
updates to test
Feb 3, 2024
e39327c
fix related to min oa flow rate
JanghyunJK Feb 3, 2024
c444e15
fixing test to check against oa mass flow rate
JanghyunJK Feb 3, 2024
1829950
adding outpatient test model that includes discrepancy between actual…
JanghyunJK Feb 3, 2024
584e2dc
Update measure.xml
JanghyunJK Feb 3, 2024
2ea5dfe
fix for dummy var naming
JanghyunJK Feb 3, 2024
23b0f5b
Merge branch 'main' into mprapros/euss_gto_measures
Feb 3, 2024
eca1e8f
Merge remote-tracking branch 'origin/jk/hprtu-std-performance' into e…
Feb 3, 2024
dfc064c
Revert "double borefield size to prevent GHEDesigner errors"
Feb 3, 2024
1fea60a
do not skip air loops with ERVs
Feb 3, 2024
afec95f
measure fixes
Feb 3, 2024
9bb5deb
measure fixes
Feb 4, 2024
aacd511
Revert "Revert "double borefield size to prevent GHEDesigner errors""
Feb 4, 2024
1bda766
Merge remote-tracking branch 'origin/jk/economzier-final-ems-merge' i…
Feb 4, 2024
28bd9f9
apply nighttime var sch for ems actuating
JanghyunJK Feb 4, 2024
037f4a1
more description
JanghyunJK Feb 4, 2024
fe5f9dc
typo
JanghyunJK Feb 4, 2024
34f00aa
change borefield size back to 300
Feb 4, 2024
5530361
corrections to indents
Feb 5, 2024
1b907e1
cleaning up indents and comments
Feb 5, 2024
51f134c
clenaing up indents and comments
Feb 5, 2024
62ea7d6
Update hvac_economizer_test.rb
JanghyunJK Feb 5, 2024
f51d21a
test models 3.7 update
JanghyunJK Feb 5, 2024
0363156
updates to check for min OA flow rates
Feb 5, 2024
e127e79
loosening min oa rate calc flag
JanghyunJK Feb 5, 2024
9822d49
Update measure.xml
JanghyunJK Feb 5, 2024
1c1431d
change ghedeisgner failure to not applicable
Feb 5, 2024
77f4bce
updates to measure and measure tests
Feb 6, 2024
c54ab30
updates to measure
Feb 6, 2024
073d670
Fix postprocessing bug
Feb 6, 2024
ee68ee4
Merge remote-tracking branch 'origin/ccaradon/utility_postprocessing_…
Feb 6, 2024
d59e0ea
delete extra cooling coil causing issues with Std. Perf option
Feb 6, 2024
f3e3042
Merge branch 'origin/ccaradon/euss_hprtu_2' into euss_package_testing
Feb 6, 2024
ea0b0f5
remove model output folders
JanghyunJK Feb 7, 2024
14d2dfd
reverting test models
JanghyunJK Feb 7, 2024
ce459e8
update test and clean
JanghyunJK Feb 8, 2024
346cafa
Update applicability check
JieXiong9119 Feb 8, 2024
010ee12
Merge branch 'main' into jx/demand-flexibility
JieXiong9119 Feb 8, 2024
399b9bb
adding nighttime output var
JanghyunJK Feb 8, 2024
815294a
Update measure.xml
JanghyunJK Feb 8, 2024
5591eef
Update hvac_economizer_test.rb
JanghyunJK Feb 8, 2024
834a85b
Update Warehouse_economizer_test.osm
JanghyunJK Feb 8, 2024
055122e
apply ems to only applicable economizers
JanghyunJK Feb 9, 2024
4b69f26
update measure
JieXiong9119 Feb 9, 2024
dc2034e
Merge branch 'main' into euss_package_testing
Feb 9, 2024
8455965
Merge branch 'aallen/advanced_rtu' into euss_package_testing
Feb 9, 2024
9c83130
Merge branch 'aallen/nighttime_oa_control' into euss_package_testing
Feb 9, 2024
bd50f36
Merge branch 'mprapros/euss_gto_measures' into euss_package_testing
Feb 9, 2024
1edce35
Merge remote-tracking branch 'origin/euss_kitchen_equip' into euss_pa…
Feb 9, 2024
4664a68
Merge branch 'jk/economzier-final-ems-merge' into euss_package_testing
Feb 9, 2024
30bc807
updates to TSVs
Feb 9, 2024
64b305f
Merge branch 'aallen/advanced_rtu' into euss_package_testing
Feb 9, 2024
b0bb2a3
update measure
JieXiong9119 Feb 9, 2024
d73dd46
adding if for zone exhaust fan
JanghyunJK Feb 11, 2024
372b0c3
Update measure.xml
JanghyunJK Feb 11, 2024
72a72cf
correcting mistake in check for initialization
Feb 12, 2024
99eb6f1
Merge branch 'aallen/nighttime_oa_control' into aallen/advanced_rtu
Feb 12, 2024
344e779
merging changes from unoccupied OA controls branch
Feb 12, 2024
1ac0210
updates to measure.xml
Feb 12, 2024
0ac1cb6
removing old test file
Feb 12, 2024
efc64b9
cleaning up comments
Feb 12, 2024
26ee03f
updates to measure.xml
Feb 12, 2024
bb67614
merge remote-tracking branch 'origin/aallen/advanced_rtu' into euss_p…
Feb 12, 2024
e9a516d
adding applicability to exclude evap cooler
JanghyunJK Feb 12, 2024
a6e7d3e
updates to measure.xml
Feb 12, 2024
ab606b2
removing added puts statement
Feb 12, 2024
d9c5641
Merge branch 'aallen/advanced_rtu' into euss_package_testing
Feb 12, 2024
9d930ed
measure fixes to accommodate gas unit heaters in warehouses
Feb 12, 2024
4928de7
updates to measure.xml
Feb 12, 2024
864f5b6
Merge branch 'mprapros/euss_gto_measures' into euss_package_testing
Feb 12, 2024
25649ce
Merge branch 'jk/economzier-final-ems-merge' into euss_package_testing
Feb 12, 2024
99e71d4
update dispatch_schedule_generation.rb
JieXiong9119 Feb 12, 2024
50b6c9a
fix borehole depth reporting
Feb 12, 2024
e6a11f1
console measure applicability fix
Feb 13, 2024
520db9c
Merge branch 'mprapros/euss_gto_measures' into euss_package_testing
Feb 13, 2024
06eb7c7
clean up
Feb 13, 2024
67024b3
Merge branch 'ccaradon/fix_utility_bill_post_proc' into euss_package_…
Feb 14, 2024
72dde61
update options for load shift
JieXiong9119 Feb 14, 2024
5360c5a
Merge branch 'jk/vrf-25pct-sizing-allowance' into euss_package_testing
Feb 15, 2024
7900ea1
Update options_lookup.tsv
Feb 15, 2024
96ee5e7
Merge remote-tracking branch 'origin/jx/demand-flexibility' into euss…
Feb 15, 2024
7b014b3
update upgrade measure naming
Feb 15, 2024
aece9d2
update options_lookup.tsv
JieXiong9119 Feb 15, 2024
b1e5dbe
Merge remote-tracking branch 'origin/jx/demand-flexibility' into euss…
Feb 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 44 additions & 14 deletions measures/comstock_sensitivity_reports/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -901,21 +901,51 @@ def run(runner, user_arguments)
thermostat = zone.thermostatSetpointDualSetpoint.get
if thermostat.heatingSetpointTemperatureSchedule.is_initialized
thermostat_heating_schedule = thermostat.heatingSetpointTemperatureSchedule.get
next unless thermostat_heating_schedule.to_ScheduleRuleset.is_initialized
thermostat_heating_schedule = thermostat_heating_schedule.to_ScheduleRuleset.get
heat_min_max = std.schedule_ruleset_annual_min_max_value(thermostat_heating_schedule)
weighted_thermostat_heating_min_c += heat_min_max['min'] * floor_area_m2
weighted_thermostat_heating_max_c += heat_min_max['max'] * floor_area_m2
weighted_thermostat_heating_area_m2 += floor_area_m2
if thermostat_heating_schedule.to_ScheduleRuleset.is_initialized
puts("--- Ruleset schedule")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of "puts" statements throughout.

thermostat_heating_schedule = thermostat_heating_schedule.to_ScheduleRuleset.get
cool_min_max = std.schedule_ruleset_annual_min_max_value(thermostat_heating_schedule)
weighted_thermostat_heating_min_c += cool_min_max['min'] * floor_area_m2
weighted_thermostat_heating_max_c += cool_min_max['max'] * floor_area_m2
weighted_thermostat_heating_area_m2 += floor_area_m2
elsif thermostat_heating_schedule.to_ScheduleInterval.is_initialized
puts("--- Interval schedule")
thermostat_heating_schedule = thermostat_heating_schedule.to_ScheduleInterval.get
ts = thermostat_heating_schedule.timeSeries
interval_values_array = ts.values
weighted_thermostat_heating_min_c += interval_values_array.min * floor_area_m2
weighted_thermostat_heating_max_c += interval_values_array.max * floor_area_m2
weighted_thermostat_heating_area_m2 += floor_area_m2
else
puts("--- Not supported schedule")
end
# next unless thermostat_heating_schedule.to_ScheduleRuleset.is_initialized
# thermostat_heating_schedule = thermostat_heating_schedule.to_ScheduleRuleset.get
# heat_min_max = std.schedule_ruleset_annual_min_max_value(thermostat_heating_schedule)
# weighted_thermostat_heating_min_c += heat_min_max['min'] * floor_area_m2
# weighted_thermostat_heating_max_c += heat_min_max['max'] * floor_area_m2
# weighted_thermostat_heating_area_m2 += floor_area_m2
end
if thermostat.coolingSetpointTemperatureSchedule.is_initialized
thermostat_cooling_schedule = thermostat.coolingSetpointTemperatureSchedule.get.to_ScheduleRuleset.get
next unless thermostat_cooling_schedule.to_ScheduleRuleset.is_initialized
thermostat_cooling_schedule = thermostat_cooling_schedule.to_ScheduleRuleset.get
cool_min_max = std.schedule_ruleset_annual_min_max_value(thermostat_cooling_schedule)
weighted_thermostat_cooling_min_c += cool_min_max['min'] * floor_area_m2
weighted_thermostat_cooling_max_c += cool_min_max['max'] * floor_area_m2
weighted_thermostat_cooling_area_m2 += floor_area_m2
thermostat_cooling_schedule = thermostat.coolingSetpointTemperatureSchedule.get
if thermostat_cooling_schedule.to_ScheduleRuleset.is_initialized
puts("--- Ruleset schedule")
thermostat_cooling_schedule = thermostat_cooling_schedule.to_ScheduleRuleset.get
cool_min_max = std.schedule_ruleset_annual_min_max_value(thermostat_cooling_schedule)
weighted_thermostat_cooling_min_c += cool_min_max['min'] * floor_area_m2
weighted_thermostat_cooling_max_c += cool_min_max['max'] * floor_area_m2
weighted_thermostat_cooling_area_m2 += floor_area_m2
elsif thermostat_cooling_schedule.to_ScheduleInterval.is_initialized
puts("--- Interval schedule")
thermostat_cooling_schedule = thermostat_cooling_schedule.to_ScheduleInterval.get
ts = thermostat_cooling_schedule.timeSeries
interval_values_array = ts.values
weighted_thermostat_cooling_min_c += interval_values_array.min * floor_area_m2
weighted_thermostat_cooling_max_c += interval_values_array.max * floor_area_m2
weighted_thermostat_cooling_area_m2 += floor_area_m2
else
puts("--- Not supported schedule")
end
end
end

Expand Down Expand Up @@ -2667,7 +2697,7 @@ def run(runner, user_arguments)
heat_exchanger_weighted_demand_outlet_temperature_c += heat_exchanger_energy_j * heat_exchanger_demand_outlet_temperature_c
end
runner.registerValue('com_report_hvac_ghx_num_boreholes', num_boreholes)
average_borehole_depth_ft = num_boreholes > 0.0 ? total_borehole_depth_ft / num_boreholes.to_f : 0.0
average_borehole_depth_ft = num_boreholes > 0.0 ? total_borehole_depth_ft.to_f : 0.0
runner.registerValue('com_report_hvac_ghx_average_borehole_depth_ft', average_borehole_depth_ft)
average_ghx_design_flow_rate_ft3_per_min = num_boreholes > 0.0 ? total_ghx_design_flow_rate_ft3_per_min / num_boreholes.to_f : 0.0
runner.registerValue('com_report_hvac_average_ghx_design_flow_rate_ft3_per_min', average_ghx_design_flow_rate_ft3_per_min)
Expand Down
203 changes: 203 additions & 0 deletions measures/qoi_report/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# *******************************************************************************

require 'date'

# start the measure
class QOIReport < OpenStudio::Measure::ReportingMeasure
# human readable name
Expand Down Expand Up @@ -81,6 +83,23 @@ def seasons
}
end

def months
return {
'jan' => 1,
'feb' => 2,
'mar' => 3,
'apr' => 4,
'may' => 5,
'jun' => 6,
'jul' => 7,
'aug' => 8,
'sep' => 9,
'oct' => 10,
'nov' => 11,
'dec' => 12
}
end

def average_daily_base_magnitude_by_season
output_names = []
seasons.each do |season, temperature_range|
Expand Down Expand Up @@ -121,13 +140,76 @@ def top_ten_seasonal_timing_of_peak_by_season
return output_names
end

def min_daily_peak_by_month
output_names = []
months.each do |month, month_val|
output_names << "minimum_daily_peak_use_#{month}_kw"
end
return output_names
end

def q1_daily_peak_by_month
output_names = []
months.each do |month, month_val|
output_names << "q1_daily_peak_use_#{month}_kw"
end
return output_names
end

def med_daily_peak_by_month
output_names = []
months.each do |month, month_val|
output_names << "median_daily_peak_use_#{month}_kw"
end
return output_names
end

def q3_daily_peak_by_month
output_names = []
months.each do |month, month_val|
output_names << "q3_daily_peak_use_#{month}_kw"
end
return output_names
end

def max_daily_peak_by_month
output_names = []
months.each do |month, month_val|
output_names << "maximum_daily_peak_use_#{month}_kw"
end
return output_names
end

def med_daily_peak_timing_by_month
output_names = []
months.each do |month, month_val|
output_names << "median_daily_peak_timing_#{month}_hour"
end
return output_names
end

def total_electricity_by_month
output_names = []
months.each do |month, month_val|
output_names << "total_electricity_use_#{month}_kwh"
end
return output_names
end

def outputs
output_names = []
output_names += average_daily_base_magnitude_by_season
output_names += average_daily_peak_magnitude_by_season
output_names += average_daily_peak_timing_by_season
output_names += top_ten_daily_seasonal_peak_magnitude_by_season
output_names += top_ten_seasonal_timing_of_peak_by_season
output_names += min_daily_peak_by_month
output_names += q1_daily_peak_by_month
output_names += med_daily_peak_by_month
output_names += q3_daily_peak_by_month
output_names += max_daily_peak_by_month
output_names += med_daily_peak_timing_by_month
output_names += total_electricity_by_month

result = OpenStudio::Measure::OSOutputVector.new
output_names.each do |output|
Expand Down Expand Up @@ -225,6 +307,41 @@ def run(runner, user_arguments)
report_sim_output(runner, "average_of_top_ten_highest_peaks_timing_#{season}_hour", average_daily_timing(timeseries, temperature_range, 'max', 10), '', '')
end

# Daily peak minimum by month (12)
months.each do |month, month_val|
report_sim_output(runner, "minimum_daily_peak_#{month}_kw", daily_peak_stats_by_month(timeseries, month_val, 'min'), '', '')
end

# Daily peak first quartile (25%) by month (12)
months.each do |month, month_val|
report_sim_output(runner, "q1_daily_peak_#{month}_kw", daily_peak_stats_by_month(timeseries, month_val, 'q1'), '', '')
end

# Daily peak median by month (12)
months.each do |month, month_val|
report_sim_output(runner, "median_daily_peak_#{month}_kw", daily_peak_stats_by_month(timeseries, month_val, 'med'), '', '')
end

# Daily peak third quartile (75%) by month (12)
months.each do |month, month_val|
report_sim_output(runner, "q3_daily_peak_#{month}_kw", daily_peak_stats_by_month(timeseries, month_val, 'q3'), '', '')
end

# Daily peak maximum by month (12)
months.each do |month, month_val|
report_sim_output(runner, "maximum_daily_peak_#{month}_kw", daily_peak_stats_by_month(timeseries, month_val, 'max'), '', '')
end

# Daily peak timing median by month (12)
months.each do |month, month_val|
report_sim_output(runner, "median_daily_peak_timing_#{month}_hour", daily_peak_timing_stats_by_month(timeseries, month_val, 'med'), '', '')
end

# Daily peak timing median by month (12)
months.each do |month, month_val|
report_sim_output(runner, "total_electricity_use_#{month}_kwh", monthly_energy(timeseries, month_val, 'total'), '', '')
end

sqlFile.close

return true
Expand Down Expand Up @@ -294,6 +411,92 @@ def average_daily_timing(timeseries, temperature_range, min_or_max, top = "all")
return daily_vals.inject { |sum, el| sum + el }.to_f / daily_vals.size
end

def day_of_year_to_date(day_of_year, year)
date = Date.new(year, 1, 1) + day_of_year - 1
month = date.month
day = date.day
return month, day
end

def calculate_percentile(array, percentile)
sorted_array = array.sort
n = sorted_array.length

index = (percentile * (n - 1) / 100.0).floor
fractional_part = (percentile * (n - 1) / 100.0) % 1

if fractional_part.zero?
return sorted_array[index]
else
lower_value = sorted_array[index]
upper_value = sorted_array[index + 1]
return (1 - fractional_part) * lower_value + fractional_part * upper_value
end
end

def daily_peak_stats_by_month(timeseries, month_val, stats_option = "max", year = 2018)
daily_peak_by_month = []
timeseries['total_site_electricity_kw'].each_slice(24).with_index do |kws, doy|
month, day = day_of_year_to_date(doy, year)
if month == month_val
daily_peak_by_month << kws.max
end
end
stats_by_month = nil
if stats_option == "min"
stats_by_month = daily_peak_by_month.min
elsif stats_option == "q1"
stats_by_month = calculate_percentile(daily_peak_by_month,25)
elsif stats_option == "med"
stats_by_month = calculate_percentile(daily_peak_by_month,50)
elsif stats_option == "q3"
stats_by_month = calculate_percentile(daily_peak_by_month,75)
elsif stats_option == "max"
stats_by_month = daily_peak_by_month.max
else
return nil
end
return stats_by_month
end

def daily_peak_timing_stats_by_month(timeseries, month_val, stats_option = "med", year = 2018)
daily_peak_timing_by_month = []
timeseries['total_site_electricity_kw'].each_slice(24).with_index do |kws, doy|
month, day = day_of_year_to_date(doy, year)
if month == month_val
daily_peak_timing_by_month << kws.index(kws.max)
end
end
stats_by_month = nil
if stats_option == "med"
stats_by_month = calculate_percentile(daily_peak_timing_by_month,50)
elsif stats_option == "mean"
stats_by_month = daily_peak_timing_by_month.inject { |sum, el| sum + el }.to_f / daily_peak_timing_by_month.size
else
return nil
end
return stats_by_month
end

def monthly_energy(timeseries, month_val, stats_option = "total", year = 2018)
daily_energy_by_month = []
timeseries['total_site_electricity_kw'].each_slice(24).with_index do |kws, doy|
month, day = day_of_year_to_date(doy, year)
if month == month_val
daily_energy_by_month << kws.inject { |sum, el| sum + el }.to_f
end
end
energy_by_month = nil
if stats_option == "total"
energy_by_month = daily_energy_by_month.inject { |sum, el| sum + el }.to_f
elsif stats_option == "mean"
energy_by_month = daily_energy_by_month.inject { |sum, el| sum + el }.to_f / daily_energy_by_month.size
else
return nil
end
return energy_by_month
end

def report_sim_output(runner, name, total_val, os_units, desired_units, percent_of_val = 1.0)
if total_val.nil?
runner.registerInfo("Registering (blank) for #{name}.")
Expand Down
Loading