Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
ebd10b1
fix typos and persist default ghedesigner soil values when no additio…
kflemin Aug 19, 2025
9bf576c
adding fan sp reset measure
Sep 10, 2025
7bab538
temp setback measure
Sep 10, 2025
e257d71
enable criteria pollutant emissions in full metadata
mdahlhausen Sep 10, 2025
be2cf35
Add missing district energy emissions columns to postprocessing (#391)
mdahlhausen Sep 10, 2025
d9af7a7
Update plotting_mixin.py
ChristopherCaradonna Sep 11, 2025
6067120
Merge remote-tracking branch 'origin/ccaradon/sdr_2025_r4' into ghp_m…
Sep 11, 2025
8193a81
turn off equipment counts from reporting
Sep 12, 2025
e2302b2
Merge branch 'ccaradon/sdr_2025_r4' of https://github.com/NREL/ComSto…
Sep 12, 2025
62202b8
updates to reporting measure
Sep 12, 2025
890aaae
adding output variable
Sep 15, 2025
4418d9f
updates
Sep 16, 2025
5a44a0d
small clean up item
Sep 16, 2025
7fe53c2
initial updates for added output variables
Sep 16, 2025
4e29504
updates to measure for added output variables
Sep 16, 2025
39dd749
Merge branch 'ccaradon/sdr_2025_r4' of https://github.com/NREL/ComSto…
Sep 16, 2025
5944278
pulling postproc updates in
Sep 16, 2025
2ce4ed6
adding output variables
Sep 16, 2025
8a455b7
Merge branch 'main' into ccaradon/sdr_2025_r4
ChristopherCaradonna Sep 16, 2025
24a4f70
options lookup update
JanghyunJK Sep 11, 2025
a366b72
measure update
JanghyunJK Sep 11, 2025
f3aa406
set stage 3 performance metrics as nominal performances
JanghyunJK Sep 16, 2025
a639c2a
options lookup update
JanghyunJK Sep 11, 2025
51bf204
measure update
JanghyunJK Sep 11, 2025
3436555
Merge pull request #403 from NREL/equipment_counts
amylebar Sep 17, 2025
ba0f1b4
Merge pull request #405 from NREL/ghp_measure_fixes
ChristopherCaradonna Sep 17, 2025
c7347ff
cleanup
Sep 17, 2025
3e59ab5
Merge branch 'ccaradon/sdr_2025_r4' of https://github.com/NREL/ComSto…
Sep 17, 2025
ab72dde
pulling in changes from sdr branch
Sep 17, 2025
8ebc587
updates from rubocop
Sep 17, 2025
5dbbe3b
rubocop and clean up on sensitivity reports and thermostat files
Sep 17, 2025
ba0f1e7
Update resources/measures/upgrade_hvac_rtu_adv/tests/measure_test.rb
JanghyunJK Sep 18, 2025
a610edf
license
JanghyunJK Sep 18, 2025
d6be41b
typo fix
JanghyunJK Sep 18, 2025
8a47689
Update LICENSE.md
JanghyunJK Sep 18, 2025
964e5ec
Update upgrade_measure_tests.txt
JanghyunJK Sep 18, 2025
90c4caf
Update upgrade_measure_tests.txt
JanghyunJK Sep 18, 2025
2c0d562
added output variable and corrected existing variable name
Sep 18, 2025
1bf8f2c
reduced SHR
JanghyunJK Sep 18, 2025
a0615d1
Merge branch 'ccaradon/sdr_2025_r4' of https://github.com/NREL/ComSto…
Sep 22, 2025
3a9eff1
Merge branch 'main' into ccaradon/sdr_2025_r4
ChristopherCaradonna Sep 22, 2025
cb330ed
adding unit conversion
Sep 23, 2025
bbdd582
Setting up testing runs
ChristopherCaradonna Sep 25, 2025
d15359b
adding district/ground-source as applicable + skipping swh
JanghyunJK Sep 30, 2025
d103598
proper control spec extraction for heating loop
JanghyunJK Sep 30, 2025
b329e4c
rubocop
JanghyunJK Sep 30, 2025
c6561c2
more unit tests
JanghyunJK Sep 30, 2025
8d9cf6e
more unit test models
JanghyunJK Sep 30, 2025
8c6789d
reset arg default value to false
JanghyunJK Oct 2, 2025
811c120
Update performance_map_CCHP_spec_2027.json
JanghyunJK Oct 3, 2025
3821bb9
json updates with new defrost eir curve
JanghyunJK Oct 3, 2025
1acee4a
fix min/max bounds for twb/tdb
JanghyunJK Oct 3, 2025
7e586df
fix indentation
JanghyunJK Oct 3, 2025
740d1fb
another typo fix
JanghyunJK Oct 3, 2025
add20c7
adding unit test for biquadratic curves using Twb and Tdb
JanghyunJK Oct 3, 2025
ef6a92e
pump spec extraction first draft
JanghyunJK Oct 6, 2025
3810e8f
ind var name swap
JanghyunJK Oct 6, 2025
829f43e
ind var name swap + min/max limits correction
JanghyunJK Oct 6, 2025
51f4462
Update measure.xml
JanghyunJK Oct 6, 2025
d1fe61a
unit test for pump specs
JanghyunJK Oct 6, 2025
f4e41e5
Update Variable List.xlsx
JanghyunJK Oct 6, 2025
aa9f088
Update comstock_column_definitions.csv
JanghyunJK Oct 6, 2025
c9ce3e3
Update resources/measures/upgrade_hvac_add_heat_pump_rtu/tests/measur…
JanghyunJK Oct 6, 2025
d6fa34c
Merge pull request #416 from NREL/jk/hprtu_defrost_power_revision
JanghyunJK Oct 6, 2025
401a376
Dependency update
axelstudios Oct 10, 2025
1fdfa6a
Improved path
axelstudios Oct 13, 2025
be263dd
Update resources/measures/upgrade_hvac_fan_static_pressure_reset/meas…
amyeallen1 Oct 21, 2025
f090a75
Update resources/measures/upgrade_hvac_fan_static_pressure_reset/test…
amyeallen1 Oct 21, 2025
61a5b62
Merge branch 'aallen/sp_reset_new' of https://github.com/NREL/ComStoc…
Oct 21, 2025
298c9d8
updated xml file
Oct 21, 2025
480f0c0
updates to read me
Oct 21, 2025
12c65ce
Update resources/measures/upgrade_add_thermostat_setback/tests/upgrad…
amyeallen1 Oct 21, 2025
22bfc0a
Update resources/measures/upgrade_add_thermostat_setback/tests/upgrad…
amyeallen1 Oct 21, 2025
f73c57d
updates to readme and xml
Oct 21, 2025
5f96ffe
Merge branch 'aallen/tstat_setback_new' of https://github.com/NREL/Co…
Oct 21, 2025
f3ab989
getting rid of extra spaces
Oct 21, 2025
34c4182
correcting indentation
Oct 21, 2025
a93f859
correcting indentation
Oct 21, 2025
d8c244c
cleaning up indents
Oct 21, 2025
d7bdfad
rubocop
Oct 21, 2025
8dc3c1b
revisions to variable name and definition
Oct 21, 2025
ec7fe63
Update resources/measures/upgrade_add_thermostat_setback/measure.rb
amyeallen1 Oct 21, 2025
a95cc24
removing unused method
Oct 21, 2025
3fa208b
updating variable name
Oct 21, 2025
870bec0
cleaning up indents
Oct 21, 2025
d56fd6d
rerunning rubocop
Oct 21, 2025
a1a9aab
adding in conversion from vol to mass flow rate
Oct 21, 2025
1072bed
adding test model
Oct 21, 2025
07f68b5
updates to test
Oct 21, 2025
f81c4c4
updates to register NA cases
Oct 21, 2025
7bde049
updating how fan coeffs are set
Oct 21, 2025
84902e9
updates to measure
Oct 21, 2025
c465891
correcting parenthesis
Oct 21, 2025
4a45efd
refining avg flow rate calculation
Oct 22, 2025
6986a2a
cleaning up debugging
Oct 22, 2025
755c77b
cleaning up comments
Oct 23, 2025
ee40831
registervalue fix
JanghyunJK Oct 27, 2025
d10c0d4
cleaning up rubocop
amyeallen1 Oct 29, 2025
180d759
cleaning up rubocop
amyeallen1 Oct 29, 2025
f317a67
update to handle case where fan flow not accessible
amyeallen1 Oct 29, 2025
cb3bc21
dealing with case where fan design flow rate can't be accesssed
amyeallen1 Oct 29, 2025
cf4fd58
progress
ChristopherCaradonna Oct 29, 2025
1e26157
adding units to variable names
amyeallen1 Oct 29, 2025
dcbd3c4
added variable to variable list
amyeallen1 Oct 29, 2025
4ad4099
adding variable, wip
amyeallen1 Oct 29, 2025
5564a79
correcting rubocop changes
amyeallen1 Oct 29, 2025
a917ba8
clarifying variable names
amyeallen1 Oct 29, 2025
9594592
adding license file
amyeallen1 Oct 29, 2025
270f38c
adding license
amyeallen1 Oct 29, 2025
357a06e
adding comments on method source
amyeallen1 Oct 29, 2025
2008241
updating comments on measure source
amyeallen1 Oct 29, 2025
d61c4f5
adding new output var to column definitions
amyeallen1 Oct 29, 2025
6cdf705
adding add'l output to columns
amyeallen1 Oct 29, 2025
c2fed07
correcting variable name
amyeallen1 Oct 29, 2025
c895fa5
taking out debugging
amyeallen1 Oct 29, 2025
517e896
adding outputs to variable list
amyeallen1 Oct 29, 2025
0f14c61
updating variable type to boolean
amyeallen1 Oct 30, 2025
6685775
updating variable type to boolean
amyeallen1 Oct 30, 2025
97424fa
updating variable type
amyeallen1 Oct 30, 2025
de8a348
fix nil register
JanghyunJK Oct 30, 2025
a16e9e7
updating error handling
amyeallen1 Oct 30, 2025
1506ea3
Merge pull request #404 from NREL/jx/df-measure-add-leap-year-process…
ChristopherCaradonna Sep 17, 2025
3e688d6
move test files
JanghyunJK Oct 31, 2025
db1786f
moving test files
JanghyunJK Oct 31, 2025
55a3b9a
Merge pull request #397 from NREL/jk/hvac_pump_upgrade
ChristopherCaradonna Oct 31, 2025
0f809bd
Merge branch 'ccaradon/sdr_2025_r4' into jk/hvac_rtuadv_upgrade
ChristopherCaradonna Oct 31, 2025
eca4382
Merge pull request #398 from NREL/jk/hvac_rtuadv_upgrade
ChristopherCaradonna Oct 31, 2025
a7562f4
updating options lookup
amyeallen1 Oct 31, 2025
669f52a
updating options
amyeallen1 Oct 31, 2025
c2624ee
updating options lookup
amyeallen1 Oct 31, 2025
860f1ca
Merge branch 'ccaradon/sdr_2025_r4' into aallen/tstat_setback_new
ChristopherCaradonna Oct 31, 2025
c4634bd
Update Variable List.xlsx
ChristopherCaradonna Oct 31, 2025
a250168
Merge pull request #408 from NREL/aallen/tstat_setback_new
ChristopherCaradonna Oct 31, 2025
d89f29d
Update comstock_column_definitions.csv
ChristopherCaradonna Oct 31, 2025
0f24a0f
Merge branch 'ccaradon/sdr_2025_r4' into aallen/sp_reset_new
ChristopherCaradonna Oct 31, 2025
d3dc16e
Update Variable List.xlsx
ChristopherCaradonna Oct 31, 2025
f5dde10
Merge pull request #407 from NREL/aallen/sp_reset_new
ChristopherCaradonna Oct 31, 2025
71c4f85
updates to column naming for output variables
amyeallen1 Nov 3, 2025
34cdd3c
pushed to wrong branch; evert "updates to column naming for output va…
amyeallen1 Nov 3, 2025
c84fb57
updates to column naming
amyeallen1 Nov 3, 2025
faefdf2
fix syntax to catch skipped zones
Nov 3, 2025
4126d90
correcting vav airflow ratio output
amyeallen1 Nov 3, 2025
78efcb9
Merge pull request #423 from NREL/tstat_setback_update_column_names
ChristopherCaradonna Nov 3, 2025
ad22f4f
Add correct naming for grocery stores to PV battery storage lookup.
ChristopherCaradonna Nov 4, 2025
14316b4
Plotting updates - works for measure comparisons, but needs cleanup
ChristopherCaradonna Nov 5, 2025
4185c1d
Move AWS/S3 methods to comstock.py
ChristopherCaradonna Nov 6, 2025
7f605d1
Move S3 retrieval methods to comstock.py
ChristopherCaradonna Nov 6, 2025
50b35fd
works with both states and counties but not yet multiple at one time
ChristopherCaradonna Nov 7, 2025
d529345
refactor code to accommodate multiple state/county queries together f…
ChristopherCaradonna Nov 7, 2025
f234281
Update compare_upgrades-test_timeseries_plots.py
ChristopherCaradonna Nov 7, 2025
06a6261
update spatial lookup table for new buildstock sample
ChristopherCaradonna Nov 13, 2025
2cad1f8
Dependency update for sdr_2025_r4
axelstudios Nov 14, 2025
6e878d5
Add AMI plot functionality and some cleanup
ChristopherCaradonna Nov 14, 2025
3f524ef
Add spatial_tract_lookup_table_publish_v10
axelstudios Nov 17, 2025
2854224
Adds warning if an applicability list for timeseries is empty instead…
ChristopherCaradonna Nov 18, 2025
49aee7c
Fixed Int32/Int64 issue
axelstudios Nov 18, 2025
0613d25
Fixed AWS aggregate failure summaries issue
axelstudios Nov 19, 2025
b8e1533
WIP dependency change
axelstudios Nov 19, 2025
5b49d3e
Merge branch 'ccaradon/sdr_2025_r4' into ccaradon/sdr_2025_r4_fix_tim…
ChristopherCaradonna Nov 19, 2025
27f45bc
Fixed AWS aggregate failure summaries issue
axelstudios Nov 19, 2025
50b5c6c
Comment S3 resources that are breaking pickling
axelstudios Nov 19, 2025
e1d5a82
Merge branch 'ccaradon/sdr_2025_r4' of https://github.com/NREL/ComSto…
ChristopherCaradonna Nov 24, 2025
cdb8298
Update comstock_apportionment.py
ChristopherCaradonna Nov 24, 2025
c00b8fc
Update comstock_column_definitions.csv
ChristopherCaradonna Nov 25, 2025
f436aea
add missing imports, remove duplicate propane and fuel oil columns
ChristopherCaradonna Nov 25, 2025
cd1ff5d
Merge pull request #429 from NREL/ccaradoj/sdr_2025_r4_fix_other_fuel…
eringold Nov 25, 2025
b77c60d
Merge pull request #432 from NREL/ccaradoj/sdr_2025_r4_fix_other_fuel…
ChristopherCaradonna Dec 1, 2025
fea90c3
Fix truth data download
axelstudios Dec 1, 2025
925eccb
Merge branch 'ccaradon/sdr_2025_r4' into ccaradon/sdr_2025_r4_fix_tim…
ChristopherCaradonna Dec 22, 2025
d64e60a
Update postprocessing/comstockpostproc/plotting_mixin.py
ChristopherCaradonna Dec 22, 2025
9d337a2
Update postprocessing/comstockpostproc/comstock.py
ChristopherCaradonna Dec 22, 2025
1014b95
Update postprocessing/comstockpostproc/plotting_mixin.py
ChristopherCaradonna Dec 22, 2025
3ef0577
Update postprocessing/comstockpostproc/plotting_mixin.py
ChristopherCaradonna Dec 22, 2025
14650c5
PR review updates
ChristopherCaradonna Dec 30, 2025
168b72c
Merge branch 'ccaradon/sdr_2025_r4_fix_timeseries_plots' of https://g…
ChristopherCaradonna Dec 30, 2025
043aec3
Various updates from PR comments
ChristopherCaradonna Dec 30, 2025
5ab9d26
Merge pull request #428 from NREL/ccaradon/sdr_2025_r4_fix_timeseries…
rHorsey Jan 7, 2026
cae5913
sensitivity measure cleanup
ChristopherCaradonna Jan 7, 2026
da1627d
Merge branch 'main' into ccaradon/sdr_2025_r4
ChristopherCaradonna Jan 8, 2026
c90b170
Merge pull request #440 from NREL/ccaradon/clean_up_sensitivity_measure
ChristopherCaradonna Jan 8, 2026
262e2e9
updating model used in test
amyeallen1 Jan 9, 2026
14168a3
Merge branch 'ccaradon/sdr_2025_r4' of https://github.com/NREL/ComSto…
amyeallen1 Jan 9, 2026
7d340de
PR cleanup
ChristopherCaradonna Jan 9, 2026
8e30781
updates from rubocop based on run with comstock config
amyeallen1 Jan 9, 2026
91cb6ba
updates after running rubocop with comstock specific config
amyeallen1 Jan 9, 2026
b05ff0d
measure tests and rubocop
ChristopherCaradonna Jan 12, 2026
76dcbf8
add expand_path to load_model()
mdahlhausen Jan 12, 2026
3b34f6e
Merge pull request #443 from NREL/thermostat_measure_updates
ChristopherCaradonna Jan 13, 2026
57bd469
Merge pull request #444 from NREL/sp_reset_measure_updates
ChristopherCaradonna Jan 13, 2026
c7bdd59
Merge branch 'ccaradon/sdr_2025_r4' into ccaradon/fix_measure_tests_2…
ChristopherCaradonna Jan 13, 2026
279aab7
rubocop and measure test updates
ChristopherCaradonna Jan 14, 2026
c058e21
fix DF measures and minor clean up
ChristopherCaradonna Jan 16, 2026
563990b
fix file path for DF measure
ChristopherCaradonna Jan 19, 2026
025afdf
Merge branch 'main' into ccaradon/fix_measure_tests_2025R3
ChristopherCaradonna Jan 21, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

class HardsizeModelTest < Minitest::Test
def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def epws_for_tests
end

def load_model(osm_path)
osm_path = File.expand_path(osm_path)
translator = OpenStudio::OSVersion::VersionTranslator.new
model = translator.loadModel(OpenStudio::Path.new(osm_path))
assert(!model.empty?)
Expand Down
78 changes: 39 additions & 39 deletions resources/measures/upgrade_add_pvwatts/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ def model_add_pvwatts_inverter(model,
end

# load data respirces
def load_standards_data()
def load_standards_data
@standards_data = {}
battery_data = JSON.parse(File.read(File.expand_path(File.dirname(__FILE__) + "/resources/deer_t24_2022.battery_storage_system.json")))
battery_data = JSON.parse(File.read(File.expand_path("#{File.dirname(__FILE__)}/resources/deer_t24_2022.battery_storage_system.json")))
@standards_data.merge!(battery_data)
return true
end
Expand Down Expand Up @@ -179,7 +179,7 @@ def model_find_object(hash_of_objects, search_criteria)
matching_objects << object
end

if matching_objects.size.zero?
if matching_objects.empty?
desired_object = nil
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.Model', "Find objects search criteria returned no results. Search criteria: #{search_criteria}. Called from #{caller(0)[1]}")
elsif matching_objects.size == 1
Expand All @@ -196,7 +196,7 @@ def model_find_object(hash_of_objects, search_criteria)
def model_get_battery_capacity(building_type)
# populate search hash
search_criteria = {
'building_type' => building_type,
'building_type' => building_type
}
# search battery storage table for energy capacity
battery_capacity = model_find_object(@standards_data['battery_storage_system'], search_criteria)
Expand Down Expand Up @@ -226,7 +226,7 @@ def model_add_electric_storage_simple(model,
if schedule.nil?
# default always on
battery_schedule = model.alwaysOnDiscreteSchedule
elsif schedule.class == String
elsif schedule.instance_of?(String)
if schedule == 'alwaysOffDiscreteSchedule'
battery_schedule = model.alwaysOffDiscreteSchedule
else
Expand Down Expand Up @@ -332,7 +332,7 @@ def run(model, runner, user_arguments)

# add electric load center distribution
electric_load_center_distribution = OpenStudio::Model::ElectricLoadCenterDistribution.new(model)
electric_load_center_distribution.setName("PV Battery Load Center")
electric_load_center_distribution.setName('PV Battery Load Center')
electric_load_center_distribution.setInverter(pv_inverter)
electric_load_center_distribution.setGeneratorOperationSchemeType('TrackElectrical')
electric_load_center_distribution.setElectricalBussType('DirectCurrentWithInverter')
Expand All @@ -350,35 +350,35 @@ def run(model, runner, user_arguments)
if incl_batt_storage

# load battery data
load_standards_data()
load_standards_data

# get building type to assign battery design parameters
if model.getBuilding.standardsBuildingType.is_initialized
building_type = model.getBuilding.standardsBuildingType.get
else
runner.registerError("Building type not found.")
runner.registerError('Building type not found.')
return true
end

pv_size_kw = pv_system_capacity / 1000
battery_data = model_get_battery_capacity(building_type)
battery_data = model_get_battery_capacity(building_type)
if battery_data.nil?
runner.registerError("Battery storage parameters not found for building type '#{building_type}'. Please ensure this building type exists in the battery storage JSON.")
return false
end
b_factor = battery_data["battery_storage_factor_b_energy_capacity"]
b_factor = battery_data['battery_storage_factor_b_energy_capacity']

# D factor is Rated single charge-discharge cycle AC to AC (round-trip) efficiency of the battery storage system
# default value is 0.95 * 0.95 from CBECC Rule Batt:RoundTripEff
# d_factor = 0.95 * 0.95
# set by minimum prescriptive requirement of JA12.2.2.1(b)
d_factor = 0.80
battery_kwh = (pv_size_kw * b_factor) / (d_factor ** 0.5)
battery_kwh = (pv_size_kw * b_factor) / (d_factor**0.5)

# calculate battery power capacity per Equation 140.10-C
c_factor = battery_data["battery_storage_factor_c_power_capacity"]
c_factor = battery_data['battery_storage_factor_c_power_capacity']
battery_kw = (pv_size_kw * c_factor)
OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.Model', "Creating a Battery Storage system with capacity of #{battery_kwh.round(2)} kWh and charge/discharge power of #{battery_kw.round(2)} kW.")
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.Model', "Creating a Battery Storage system with capacity of #{battery_kwh.round(2)} kWh and charge/discharge power of #{battery_kw.round(2)} kW.")
battery = model_add_electric_storage_simple(model, max_storage_capacity_kwh: battery_kwh, max_charge_power_kw: battery_kw, max_discharge_power_kw: battery_kw)
converter = model_add_electric_storage_converter(model)

Expand All @@ -390,38 +390,38 @@ def run(model, runner, user_arguments)
electric_load_center_distribution.setStorageOperationScheme('TrackFacilityElectricDemandStoreExcessOnSite')
# get final conditions
elcss = model.getElectricLoadCenterStorageSimples
batt_size_kwh = elcss.map { |b| b.maximumStorageCapacity }.sum / 3.6e6 # convert to kWh from joules
total_discharge_power_kw = elcss.map { |b| b.maximumPowerforDischarging }.sum / 1000 # convert to kw from w
total_charge_power_kw = elcss.map { |b| b.maximumPowerforCharging }.sum / 1000 # convert to kw from W
batt_size_kwh = elcss.map(&:maximumStorageCapacity).sum / 3.6e6 # convert to kWh from joules
total_discharge_power_kw = elcss.map(&:maximumPowerforDischarging).sum / 1000 # convert to kw from w
total_charge_power_kw = elcss.map(&:maximumPowerforCharging).sum / 1000 # convert to kw from W
end

if battery.nil?
# report final condition of model with battery
runner.registerFinalCondition("The building finished with " \
"#{(pv_system_capacity / 1000).round(0)} kW of PV covering " \
"#{pv_area_ft2.round(0)} ft² of roof area. The module type is " \
"#{pv_module_type}, the array type is " \
"#{pv_array_type}, the system losses are " \
"#{pv_system_losses}, the tilt angle is " \
"#{pv_title_angle.round(0)}°, and the azimuth angle is " \
"#{pv_azimuth_angle.round(0)}°. The inverter has a DC to AC size ratio of " \
"#{pv_inverter.dcToACSizeRatio} and an inverter efficiency of " \
"#{(pv_inverter.inverterEfficiency * 100).round(0)}%.")
runner.registerFinalCondition('The building finished with ' \
"#{(pv_system_capacity / 1000).round(0)} kW of PV covering " \
"#{pv_area_ft2.round(0)} ft² of roof area. The module type is " \
"#{pv_module_type}, the array type is " \
"#{pv_array_type}, the system losses are " \
"#{pv_system_losses}, the tilt angle is " \
"#{pv_title_angle.round(0)}°, and the azimuth angle is " \
"#{pv_azimuth_angle.round(0)}°. The inverter has a DC to AC size ratio of " \
"#{pv_inverter.dcToACSizeRatio} and an inverter efficiency of " \
"#{(pv_inverter.inverterEfficiency * 100).round(0)}%.")
else
# report final condition of model with no battery
runner.registerFinalCondition("The building finished with " \
"#{(pv_system_capacity / 1000).round(0)} kW of PV covering " \
"#{pv_area_ft2.round(0)} ft^2 of roof area. The module type is " \
"#{pv_module_type}, the array type is " \
"#{pv_array_type}, the system losses are " \
"#{pv_system_losses}, the tilt angle is " \
"#{pv_title_angle.round(0)}°, and the azimuth angle is " \
"#{pv_azimuth_angle.round(0)}°. The inverter has a DC to AC size ratio of " \
"#{pv_inverter.dcToACSizeRatio} and an inverter efficiency of " \
"#{(pv_inverter.inverterEfficiency * 100).round(0)}%. For storage, the model has a total battery capacity of " \
"#{batt_size_kwh.round(1)} kWh, a maximum discharging power of " \
"#{total_discharge_power_kw.round(0)} kW, and a maximum charging power of " \
"#{total_charge_power_kw.round(0)} kW.")
runner.registerFinalCondition('The building finished with ' \
"#{(pv_system_capacity / 1000).round(0)} kW of PV covering " \
"#{pv_area_ft2.round(0)} ft^2 of roof area. The module type is " \
"#{pv_module_type}, the array type is " \
"#{pv_array_type}, the system losses are " \
"#{pv_system_losses}, the tilt angle is " \
"#{pv_title_angle.round(0)}°, and the azimuth angle is " \
"#{pv_azimuth_angle.round(0)}°. The inverter has a DC to AC size ratio of " \
"#{pv_inverter.dcToACSizeRatio} and an inverter efficiency of " \
"#{(pv_inverter.inverterEfficiency * 100).round(0)}%. For storage, the model has a total battery capacity of " \
"#{batt_size_kwh.round(1)} kWh, a maximum discharging power of " \
"#{total_discharge_power_kw.round(0)} kW, and a maximum charging power of " \
"#{total_charge_power_kw.round(0)} kW.")
end

true
Expand Down
Loading