urbanopt-reopt 0.10.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/release.yml +25 -0
- data/.github/workflows/nightly_ci_build.yml +10 -3
- data/CHANGELOG.md +16 -0
- data/Gemfile +1 -1
- data/LICENSE.md +1 -1
- data/RDOC_MAIN.md +19 -19
- data/README.md +20 -20
- data/doc_templates/LICENSE.md +1 -1
- data/doc_templates/copyright_erb.txt +1 -1
- data/docs/README.md +18 -18
- data/docs/package-lock.json +4806 -4836
- data/docs/schemas/reopt-input-schema.md +25 -23
- data/docs/schemas/reopt-output-schema.md +7 -7
- data/index.md +22 -22
- data/lib/urbanopt/reopt/feature_report_adapter.rb +241 -208
- data/lib/urbanopt/reopt/reopt_lite_api.rb +98 -59
- data/lib/urbanopt/reopt/reopt_post_processor.rb +34 -33
- data/lib/urbanopt/reopt/reopt_schema/reopt_input_schema.json +1126 -1106
- data/lib/urbanopt/reopt/reopt_schema/reopt_output_schema.json +449 -524
- data/lib/urbanopt/reopt/scenario/reopt_scenario_csv.rb +7 -7
- data/lib/urbanopt/reopt/scenario_report_adapter.rb +275 -240
- data/lib/urbanopt/reopt/version.rb +1 -1
- data/urbanopt-reopt.gemspec +5 -3
- metadata +35 -8
- data/Jenkinsfile +0 -10
@@ -8,15 +8,19 @@ The following shows the complete set of inputs to the REopt Lite AP which is cal
|
|
8
8
|
|
9
9
|
## Required Inputs
|
10
10
|
|
11
|
-
The only required parameters to the REopt Lite API (called internally by the gem) are:
|
11
|
+
The only required parameters to the REopt Lite API (called internally by the gem) are:
|
12
12
|
- *latitude*
|
13
|
-
- *longitude*
|
14
|
-
- *urdb_response*
|
15
|
-
|
16
|
-
|
17
|
-
- *
|
18
|
-
|
19
|
-
|
13
|
+
- *longitude*
|
14
|
+
- *urdb_response* OR one of the following sets:
|
15
|
+
- *urdb_label*
|
16
|
+
- *monthly_energy_rates* **and** *monthly_demand_rates*
|
17
|
+
- *blended_annual_demand_rate* **and** *blended_annual_energy_rate*
|
18
|
+
- *urdb_utility_name* **and** *urdb_rate_name*
|
19
|
+
- *tou_energy_rates_per_kwh*
|
20
|
+
|
21
|
+
- *loads_kw* OR one of the following sets:
|
22
|
+
- *doe_reference_name* **and** *annual_kwh*
|
23
|
+
- *doe_reference_name* **and** *monthly_totals_kwh*
|
20
24
|
|
21
25
|
The gem sources *latitude*, *longitude* and *loads_kw* from a Feature or Scenario Report directly. If no specific *urdb_response* or *urdb_label* is specified as an custom assumption (see below), then a constant rate of $0.13/kWh with no demand charge is provided by the gem as a default to the REopt API.
|
22
26
|
|
@@ -24,28 +28,26 @@ Otherwise, all non-required input parameters will be filled in with default valu
|
|
24
28
|
|
25
29
|
|
26
30
|
```
|
27
|
-
{
|
28
|
-
"
|
29
|
-
"
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
}
|
31
|
+
{
|
32
|
+
"Site":{
|
33
|
+
"latitude":45,
|
34
|
+
"longitude":-110
|
35
|
+
},
|
36
|
+
"ElectricTariff": {
|
37
|
+
"urdb_label":"594976725457a37b1175d089"
|
38
|
+
},
|
39
|
+
"ElectricLoad":{
|
40
|
+
"doe_reference_name":"Hospital",
|
41
|
+
"annual_kwh":1000000
|
40
42
|
}
|
41
43
|
}
|
42
44
|
```
|
43
45
|
|
44
46
|
## Setting Custom Assumptions
|
45
47
|
|
46
|
-
If you wish to use custom input parameters, other than default values, you have a couple of options.
|
48
|
+
If you wish to use custom input parameters, other than default values, you have a couple of options.
|
47
49
|
|
48
|
-
* 1) Custom hashes, formatted as described above, can be directly paramaterized when invoking _reopt_json_from_scenario_report_ or _reopt_jsons_from_scenario_feature_reports_ from a **URBANopt::REopt::ScenarioReportAdapter**, or _reopt_json_from_feature_report_ from a **URBANopt::REopt::FeatureReportAdapter**.
|
50
|
+
* 1) Custom hashes, formatted as described above, can be directly paramaterized when invoking _reopt_json_from_scenario_report_ or _reopt_jsons_from_scenario_feature_reports_ from a **URBANopt::REopt::ScenarioReportAdapter**, or _reopt_json_from_feature_report_ from a **URBANopt::REopt::FeatureReportAdapter**.
|
49
51
|
|
50
52
|
* 2) Paths to custom hashes, formatted as described above and saved as JSON files in a common folder, can be specified in the input REopt Scenario CSV. See the [example project](https://github.com/TK-23/urbanopt-example-geojson-reopt-project.git) for more information on how to do this.
|
51
53
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# REopt Lite Outputs Schema
|
2
2
|
|
3
|
-
When the gem calls the REopt Lite APUI it recieves the following complete set of results described in the data dictionary below. Only those needed to update a Feature or Scenario Report's distributed_generation attibute set and timeseries CSV are pulled from the reponse and transferred to the Feature or Scenario Report. You may choose to modify the code to include more or less of the full REopt Lite response.
|
3
|
+
When the gem calls the REopt Lite APUI it recieves the following complete set of results described in the data dictionary below. Only those needed to update a Feature or Scenario Report's distributed_generation attibute set and timeseries CSV are pulled from the reponse and transferred to the Feature or Scenario Report. You may choose to modify the code to include more or less of the full REopt Lite response.
|
4
4
|
|
5
5
|
## Data Dictionary
|
6
6
|
<ReoptOutputSchema />
|
@@ -12,12 +12,12 @@ The REopt Lite API updates the distributed_generation attributes of a Scenario o
|
|
12
12
|
|
13
13
|
```
|
14
14
|
"distributed_generation": {
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
15
|
+
"lcc": 100000000.0,
|
16
|
+
"npv": 10000000.0,
|
17
|
+
"year_one_energy_cost_before_tax": 7000000.0,
|
18
|
+
"year_one_demand_cost_before_tax": 3000000.0,
|
19
|
+
"year_one_bill_before_tax": 10000000.0,
|
20
|
+
"lifecycle_energy_cost_after_tax": 70000000.0,
|
21
21
|
"solar_pv": {
|
22
22
|
"size_kw": 30000.0
|
23
23
|
},
|
data/index.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# **URBANopt REopt Gem**
|
2
2
|
|
3
|
-
The **URBANopt<sup>™</sup> REopt Gem** extends **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the [REopt
|
4
|
-
REopt
|
3
|
+
The **URBANopt<sup>™</sup> REopt Gem** extends **URBANopt::Reporting::DefaultReports::ScenarioReport** and **URBANopt::Reporting::DefaultReports::FeatureReport** with the ability to derive cost-optimal distributed energy resource (DER) technology sizes and annual dispatch strageties via the [REopt](https://reopt.nrel.gov/tool) decision support platform.
|
4
|
+
REopt is a technoeconomic model which leverages mixed integer linear programming to identify the cost-optimal sizing of solar PV, Wind, Storage and/or diesel generation given an electric load profile, a utility rate tariff and other technoeconomic parameters. See [https://developer.nrel.gov/docs/energy-optimization/reopt/v2/](https://developer.nrel.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
|
5
5
|
|
6
6
|
See the [example project](https://github.com/urbanopt/urbanopt-example-reopt-project.git) for more infomation about usage of this gem.
|
7
7
|
|
@@ -10,9 +10,9 @@ See the [example project](https://github.com/urbanopt/urbanopt-example-reopt-pro
|
|
10
10
|
## Installation
|
11
11
|
|
12
12
|
See [https://docs.urbanopt.net/installation/installation.html](https://docs.urbanopt.net/installation/installation.html) for instructions on prerequiste software, including:
|
13
|
-
- Ruby 2.2
|
14
|
-
- Bundler 1.
|
15
|
-
- OpenStudio
|
13
|
+
- Ruby 2.7.2
|
14
|
+
- Bundler 1.21.0
|
15
|
+
- OpenStudio 3.7.0
|
16
16
|
|
17
17
|
Add this line to your application's Gemfile:
|
18
18
|
|
@@ -31,16 +31,16 @@ Or install it yourself as:
|
|
31
31
|
|
32
32
|
## Functionality
|
33
33
|
|
34
|
-
This gem is used to call the REopt
|
34
|
+
This gem is used to call the REopt API on a Scenario Report or Feature Report to update the object's Distributed Generation attributes (including system financial and sizing metrics) as shown in an example below:
|
35
35
|
|
36
36
|
```
|
37
37
|
"distributed_generation": {
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
38
|
+
"lcc": 100000000.0,
|
39
|
+
"npv": 10000000.0,
|
40
|
+
"year_one_energy_cost_before_tax": 7000000.0,
|
41
|
+
"year_one_demand_cost_before_tax": 3000000.0,
|
42
|
+
"year_one_bill_before_tax": 10000000.0,
|
43
|
+
"lifecycle_energy_cost_after_tax": 70000000.0,
|
44
44
|
"solar_pv": {
|
45
45
|
"size_kw": 30000.0
|
46
46
|
},
|
@@ -83,9 +83,9 @@ Moreover, the following optimal dispatch fields are added to its timeseries CSV.
|
|
83
83
|
| ElectricityProduced:Wind:ToGrid | kWh |
|
84
84
|
```
|
85
85
|
|
86
|
-
The REopt
|
86
|
+
The REopt has default values for all non-required input parameters that are used unless the user specifies custom assumptions. See [https://developer.nrel.gov/docs/energy-optimization/reopt/v2/](https://developer.nrel.gov/docs/energy-optimization/reopt/v2/) for more detailed information on input parameters and default assumptions.
|
87
87
|
|
88
|
-
<b>Note:</b> Required attributes for a REopt run include latitude and longitude. If no utility rate is specified in your REopt
|
88
|
+
<b>Note:</b> Required attributes for a REopt run include latitude and longitude. If no utility rate is specified in your REopt assumption settings, then a constant default rate of $0.13 is assumed without demand charges. Also, by default, only solar PV and storage are considered in the analysis (i.e. Wind and Generators are excluded from consideration).
|
89
89
|
|
90
90
|
|
91
91
|
|
@@ -101,19 +101,19 @@ feature_reports_hash = {} # <insert a Feature Report hash here>
|
|
101
101
|
#Create a Feature Report
|
102
102
|
feature_report = URBANopt::Reporting::DefaultReports::FeatureReport.new(feature_reports_hash)
|
103
103
|
|
104
|
-
#Specify a file name where REopt
|
104
|
+
#Specify a file name where REopt results will be written in JSON format
|
105
105
|
reopt_output_file = File.join(feature_report.directory_name, 'feature_report_reopt_run1.json')
|
106
106
|
|
107
|
-
#Specify a file name where the new timeseries CSV will be written after REopt
|
107
|
+
#Specify a file name where the new timeseries CSV will be written after REopt has determined cost optimal dispatch
|
108
108
|
timeseries_output_file = File.join(feature_report.directory_name, 'feature_report_timeseries1.csv')
|
109
109
|
|
110
|
-
#Specify non-default REopt
|
110
|
+
#Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
|
111
111
|
reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
|
112
112
|
|
113
|
-
#Create a REopt
|
113
|
+
#Create a REopt Post Processor to call the API, note you will need a Developer.nrel.gov API key in this step
|
114
114
|
reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(nil, nil, nil, DEVELOPER_NREL_KEY)
|
115
115
|
|
116
|
-
#Call REopt
|
116
|
+
#Call REopt with the post processor to update the feature's distributed generation attributes and timeseries CSV.
|
117
117
|
updated_feature_report = reopt_post_processor.run_feature_report(feature_report,reopt_assumptions_file,reopt_output_file,timeseries_output_file)
|
118
118
|
|
119
119
|
```
|
@@ -142,13 +142,13 @@ scenario_report = URBANopt::Reporting::DefaultReports::ScenarioReport.new({:dire
|
|
142
142
|
scenario_report.add_feature_report(feature_report)
|
143
143
|
end
|
144
144
|
|
145
|
-
#Specify non-default REopt
|
145
|
+
#Specify non-default REopt assumptions, saved in JSON format, to be used in calling the API
|
146
146
|
reopt_assumptions_file = File.join(File.dirname(__FILE__), '../files/reopt_assumptions_basic.json')
|
147
147
|
|
148
|
-
#Create a REopt
|
148
|
+
#Create a REopt Post Processor to call the API, note you will need a Developer.nrel.gov API key in this step
|
149
149
|
reopt_post_processor = URBANopt::REopt::REoptPostProcessor.new(scenario_report, reopt_assumptions_file, nil, DEVELOPER_NREL_KEY)
|
150
150
|
|
151
|
-
#Call REopt
|
151
|
+
#Call REopt with the post processor once on the sceanrio's aggregated load to update the scenario's distributed generation attributes and timeseries CSV.
|
152
152
|
updated_scenario_report = reopt_post_processor.run_scenario_report(scenario_report)
|
153
153
|
|
154
154
|
```
|