Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 23b96dd

Browse files
authoredJan 11, 2024
Merge pull request #560 from NREL/develop
Fix /summary endpoint, fix generator cost input, add LCC outputs
2 parents a2f52af + a1c1ac6 commit 23b96dd

8 files changed

+163
-85
lines changed
 

‎CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ Classify the change according to the following categories:
2727
### Patches
2828

2929

30+
## v3.3.0
31+
### Minor Updates
32+
#### Added
33+
- Added the following BAU outputs: lifecycle_chp_standby_cost_after_tax, lifecycle_elecbill_after_tax, lifecycle_production_incentive_after_tax, lifecycle_outage_cost, lifecycle_MG_upgrade_and_fuel_cost
34+
### Changed
35+
- Updated REopt.jl version to 0.39.1 along with updates to other dependencies
36+
#### Fixed
37+
- Fixed setting of default Generator `installed_cost_per_kw` so that user inputs are not overridden
38+
- Avoid /summary endpoint error with off-grid runs where there is no ElectricTariff
39+
3040
## v3.2.3
3141
### Minor Updates
3242
##### Changed

‎julia_src/highs/Manifest.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
790790

791791
[[deps.REopt]]
792792
deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"]
793-
git-tree-sha1 = "a56f12eca2b737e9d9210000ee599920001cc303"
794-
repo-rev = "v0.38.1"
795-
repo-url = "https://github.com/NREL/REopt.jl.git"
793+
git-tree-sha1 = "013fc07e92f4b742f09b7adae75d2d63dfbc9237"
796794
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
797-
version = "0.38.1"
795+
version = "0.39.0"
798796

799797
[[deps.Random]]
800798
deps = ["SHA", "Serialization"]

‎julia_src/xpress/Manifest.toml

+81-76
Large diffs are not rendered by default.

‎reoptjl/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def obj_create(self, bundle, **kwargs):
9898
meta = {
9999
"run_uuid": run_uuid,
100100
"api_version": 3,
101-
"reopt_version": "0.38.1",
101+
"reopt_version": "0.39.1",
102102
"status": "Validating..."
103103
}
104104
bundle.data.update({"APIMeta": meta})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Generated by Django 4.0.7 on 2023-11-30 20:30
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('reoptjl', '0050_apimeta_api_key'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='financialoutputs',
15+
name='lifecycle_MG_upgrade_and_fuel_cost_bau',
16+
field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This is the cost to upgrade generation and storage technologies to be included in microgridplus present value of microgrid fuel costs.', null=True),
17+
),
18+
migrations.AddField(
19+
model_name='financialoutputs',
20+
name='lifecycle_chp_standby_cost_after_tax_bau',
21+
field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This value is the present value of all CHP standby charges, after tax.', null=True),
22+
),
23+
migrations.AddField(
24+
model_name='financialoutputs',
25+
name='lifecycle_elecbill_after_tax_bau',
26+
field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This value is the present value of all electric utility charges, after tax.', null=True),
27+
),
28+
migrations.AddField(
29+
model_name='financialoutputs',
30+
name='lifecycle_outage_cost_bau',
31+
field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). Expected outage cost.', null=True),
32+
),
33+
migrations.AddField(
34+
model_name='financialoutputs',
35+
name='lifecycle_production_incentive_after_tax_bau',
36+
field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This value is the present value of all production-based incentives, after tax.', null=True),
37+
),
38+
]

‎reoptjl/models.py

+21
Original file line numberDiff line numberDiff line change
@@ -1019,14 +1019,26 @@ class FinancialOutputs(BaseModel, models.Model):
10191019
null=True, blank=True,
10201020
help_text=("Component of lifecycle costs (LCC). This value is the present value of all CHP standby charges, after tax.")
10211021
)
1022+
lifecycle_chp_standby_cost_after_tax_bau = models.FloatField(
1023+
null=True, blank=True,
1024+
help_text=("BAU Component of lifecycle costs (LCC). This value is the present value of all CHP standby charges, after tax.")
1025+
)
10221026
lifecycle_elecbill_after_tax = models.FloatField(
10231027
null=True, blank=True,
10241028
help_text=("Component of lifecycle costs (LCC). This value is the present value of all electric utility charges, after tax.")
10251029
)
1030+
lifecycle_elecbill_after_tax_bau = models.FloatField(
1031+
null=True, blank=True,
1032+
help_text=("BAU Component of lifecycle costs (LCC). This value is the present value of all electric utility charges, after tax.")
1033+
)
10261034
lifecycle_production_incentive_after_tax = models.FloatField(
10271035
null=True, blank=True,
10281036
help_text=("Component of lifecycle costs (LCC). This value is the present value of all production-based incentives, after tax.")
10291037
)
1038+
lifecycle_production_incentive_after_tax_bau = models.FloatField(
1039+
null=True, blank=True,
1040+
help_text=("BAU Component of lifecycle costs (LCC). This value is the present value of all production-based incentives, after tax.")
1041+
)
10301042
lifecycle_offgrid_other_annual_costs_after_tax = models.FloatField(
10311043
null=True, blank=True,
10321044
help_text=("Component of lifecycle costs (LCC). This value is the present value of offgrid_other_annual_costs over the analysis period, after tax.")
@@ -1040,11 +1052,20 @@ class FinancialOutputs(BaseModel, models.Model):
10401052
null=True, blank=True,
10411053
help_text=("Component of lifecycle costs (LCC). Expected outage cost.")
10421054
)
1055+
lifecycle_outage_cost_bau = models.FloatField(
1056+
null=True, blank=True,
1057+
help_text=("BAU Component of lifecycle costs (LCC). Expected outage cost.")
1058+
)
10431059
lifecycle_MG_upgrade_and_fuel_cost = models.FloatField(
10441060
null=True, blank=True,
10451061
help_text=("Component of lifecycle costs (LCC). This is the cost to upgrade generation and storage technologies to be included in microgrid"
10461062
"plus present value of microgrid fuel costs.")
10471063
)
1064+
lifecycle_MG_upgrade_and_fuel_cost_bau = models.FloatField(
1065+
null=True, blank=True,
1066+
help_text=("BAU Component of lifecycle costs (LCC). This is the cost to upgrade generation and storage technologies to be included in microgrid"
1067+
"plus present value of microgrid fuel costs.")
1068+
)
10481069
replacements_future_cost_after_tax = models.FloatField(
10491070
null=True, blank=True,
10501071
help_text="Future cost of replacing storage and/or generator systems, after tax."

‎reoptjl/validators.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -455,13 +455,16 @@ def update_pv_defaults_offgrid(self, pvmodel):
455455
if self.models["Generator"].__getattribute__("om_cost_per_kw") == None:
456456
if self.models["Settings"].off_grid_flag==False:
457457
self.models["Generator"].om_cost_per_kw = 20.0
458+
else:
459+
self.models["Generator"].om_cost_per_kw = 10.0
460+
461+
if self.models["Generator"].__getattribute__("installed_cost_per_kw") == None:
462+
if self.models["Settings"].off_grid_flag==False:
458463
if self.models["Generator"].only_runs_during_grid_outage:
459464
self.models["Generator"].installed_cost_per_kw = 650.0
460465
else:
461466
self.models["Generator"].installed_cost_per_kw = 800.0
462-
self.models["Generator"]
463-
else:
464-
self.models["Generator"].om_cost_per_kw = 10.0
467+
else:
465468
self.models["Generator"].installed_cost_per_kw = 880.0
466469

467470
if self.models["Generator"].__getattribute__("min_turn_down_fraction") == None:

‎reoptjl/views.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,10 @@ def queryset_for_summary(api_metas,summary_dict:dict):
855855
)
856856
if len(tariffOuts) > 0:
857857
for m in tariffOuts:
858-
summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = (m.year_one_energy_cost_before_tax_bau + m.year_one_demand_cost_before_tax_bau + m.year_one_fixed_cost_before_tax_bau + m.year_one_min_charge_adder_before_tax_bau) - (m.year_one_energy_cost_before_tax + m.year_one_demand_cost_before_tax + m.year_one_fixed_cost_before_tax + m.year_one_min_charge_adder_before_tax)
858+
if len(tariffInputs) > 0:
859+
summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = m.year_one_bill_before_tax_bau - m.year_one_bill_before_tax
860+
else:
861+
summary_dict[str(m.meta.run_uuid)]['year_one_savings_us_dollars'] = 0.0
859862

860863
load = ElectricLoadInputs.objects.filter(meta__run_uuid__in=run_uuids).only(
861864
'meta__run_uuid',

0 commit comments

Comments
 (0)
Please sign in to comment.