From 84ac6bf628cab55a71018e802ea254cb63f33783 Mon Sep 17 00:00:00 2001 From: tanushree04 Date: Mon, 26 Jan 2026 16:09:36 -0700 Subject: [PATCH 1/2] add fuel timeseries to reopt assumption file, update fuel cost, capital cost --- example_files/reopt/base_assumptions.json | 2 +- example_files/reopt/multiPV_assumptions.json | 2 +- lib/uo_cli.rb | 26 +++++++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/example_files/reopt/base_assumptions.json b/example_files/reopt/base_assumptions.json index c7a48e75a..456743da5 100644 --- a/example_files/reopt/base_assumptions.json +++ b/example_files/reopt/base_assumptions.json @@ -133,6 +133,6 @@ "om_cost_per_kw": 0.0 }, "ExistingBoiler": { - "fuel_cost_per_mmbtu": 100 + "fuel_cost_per_mmbtu": 4.5 } } diff --git a/example_files/reopt/multiPV_assumptions.json b/example_files/reopt/multiPV_assumptions.json index 99c6ee977..1d73b2ddf 100644 --- a/example_files/reopt/multiPV_assumptions.json +++ b/example_files/reopt/multiPV_assumptions.json @@ -171,6 +171,6 @@ "om_cost_per_kw": 0.0 }, "ExistingBoiler": { - "fuel_cost_per_mmbtu": 100 + "fuel_cost_per_mmbtu": 4.5 } } diff --git a/lib/uo_cli.rb b/lib/uo_cli.rb index 1e8466d55..f7a77d1db 100755 --- a/lib/uo_cli.rb +++ b/lib/uo_cli.rb @@ -610,8 +610,8 @@ def self.create_reopt_scenario_cost_file(existing_scenario_file) # add additional capital cost columns to it table.each do |row| - row['Total Capital Costs ($)'] = 100 - row['Capital Cost Per Floor Area ($/sq.ft.)'] = 100 + row['Total Capital Costs ($)'] = 1 + row['Capital Cost Per Floor Area ($/sq.ft.)'] = 1 end # write the updated table back to the file @@ -1715,8 +1715,8 @@ def self.install_python_dependencies # Check if the fuel cost has been overridden in the assumptions file if assumptions_hash[:ExistingBoiler] && assumptions_hash[:ExistingBoiler][:fuel_cost_per_mmbtu] - if assumptions_hash[:ExistingBoiler][:fuel_cost_per_mmbtu] == 100 - puts "WARNING: The 'fuel_cost_per_mmbtu' under 'ExistingBoiler' is still set to the default value of 100. Please update this value with a realistic fuel cost." + if assumptions_hash[:ExistingBoiler][:fuel_cost_per_mmbtu] == 4.5 + puts "WARNING: The 'fuel_cost_per_mmbtu' under 'ExistingBoiler' is still set a national average value of $4.5/MMBtu. Please update this value with a fuel cost value for your site." else puts "INFO: The 'fuel_cost_per_mmbtu' under 'ExistingBoiler' has been overridden with a value of #{assumptions_hash[:ExistingBoiler][:fuel_cost_per_mmbtu]}." end @@ -1725,6 +1725,24 @@ def self.install_python_dependencies puts "WARNING: There is no 'ExistingBoiler.fuel_cost_per_mmbtu' value in the assumptions file." end + # Add timeseries data for fuel consumption to assumptions file, if present + # read scenario csv report + assumptions_hash[:SpaceHeatingLoad] = {} + assumptions_hash[:SpaceHeatingLoad][:fuel_loads_mmbtu_per_hour] = [] + scenario_csv = CSV.read(File.join(@root_dir, 'run', @scenario_name.downcase, 'default_scenario_report.csv'), headers: true) + + column_name = 'NaturalGas:Facility(kBtu)' + + # Read every row + if scenario_csv.headers.include?(column_name) + puts "\nINFO: Found '#{column_name}' column in default_scenario_report.csv. Adding space heating fuel load timeseries to REopt assumptions.\n" + scenario_csv.each do |row| + kbtu_value = row[column_name].to_f + mmbtu_value = kbtu_value / 1000.0 + assumptions_hash[:SpaceHeatingLoad][:fuel_loads_mmbtu_per_hour] << mmbtu_value + end + end + # Write assumptions hash to file since REoptPostProcessor reads from file temp_assumptions_file = File.join(@root_dir, 'run', @scenario_name.downcase, 'temp_reopt_scenario_assumptions.json') File.open(temp_assumptions_file, 'w') { |f| f.write JSON.pretty_generate(assumptions_hash) } From 4ca20272bb5172346dd443e0e24584d94d984a40 Mon Sep 17 00:00:00 2001 From: kflemin <2205659+kflemin@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:14:17 -0700 Subject: [PATCH 2/2] typo --- lib/uo_cli.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/uo_cli.rb b/lib/uo_cli.rb index 0f23192db..7e584dce3 100755 --- a/lib/uo_cli.rb +++ b/lib/uo_cli.rb @@ -1720,7 +1720,7 @@ def self.install_python_dependencies if (scenario_file.headers & required_columns).any? # assume cost analysis if either column is present puts "\nINFO: Capital cost data found in ScenarioFile. Preparing wind capital costs for REopt Analysis...\n" - + # retrieve assumptions hash for modifications assumptions_hash = JSON.parse(File.read(File.expand_path(scenario_assumptions)), symbolize_names: true) @@ -1787,6 +1787,7 @@ def self.install_python_dependencies # There is no existing boiler fuel cost. Warn user. puts "WARNING: There is no 'ExistingBoiler.fuel_cost_per_mmbtu' value in the assumptions file." end + end # Add timeseries data for fuel consumption to assumptions file, if present # read scenario csv report