Skip to content

Commit f321046

Browse files
authored
Merge pull request #394 from NREL/develop
v0.46.1
2 parents c8db8a5 + ab53b8a commit f321046

File tree

6 files changed

+43
-10
lines changed

6 files changed

+43
-10
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ Classify the change according to the following categories:
2323
### Deprecated
2424
### Removed
2525

26-
## v. 0.46.0
26+
## v0.46.1
27+
### Changed
28+
- Updated the GHP testset .json `./test/scenarios/ghp_inputs.json` to include a nominal HotThermalStorage and ColdThermalStorage system.
29+
### Fixed
30+
- Fixed a bug in which the model fails to build when both GHP and either Hot or Cold Thermal Storage are present.
31+
32+
## v.0.46.0
2733
### Added
2834
- In `src/core/absorption_chiller.jl` struct, added field **heating_load_input** to the AbsorptionChiller struct
2935
- Added new variables **dvHeatToStorage** and **dvHeatFromStorage** which are indexed on `p.heating_loads` and added reconciliation constraints so that **dvProductionToStorage** and **dvDischargeFromStorage** maintain their relationship to state of charge for Hot thermal energy storage.

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "REopt"
22
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
33
authors = ["Nick Laws", "Hallie Dunham <[email protected]>", "Bill Becker <[email protected]>", "Bhavesh Rathod <[email protected]>", "Alex Zolan <[email protected]>", "Amanda Farthing <[email protected]>"]
4-
version = "0.46.0"
4+
version = "0.46.1"
55

66
[deps]
77
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"

src/constraints/storage_constraints.jl

+15-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function add_hot_thermal_storage_dispatch_constraints(m, p, b; _n="")
146146
if !isempty(p.techs.chp)
147147
if !isempty(p.techs.steam_turbine) && p.s.chp.can_supply_steam_turbine
148148
@constraint(m, CHPTechProductionFlowCon[b in p.s.storage.types.hot, t in p.techs.chp, q in p.heating_loads, ts in p.time_steps],
149-
m[Symbol("dvHeatToStorage"*_n)][b,tq,ts] + m[Symbol("dvProductionToWaste"*_n)][t,q,ts] + m[Symbol("dvThermalToSteamTurbine"*_n)][t,q,ts] <=
149+
m[Symbol("dvHeatToStorage"*_n)][b,t,q,ts] + m[Symbol("dvProductionToWaste"*_n)][t,q,ts] + m[Symbol("dvThermalToSteamTurbine"*_n)][t,q,ts] <=
150150
m[Symbol("dvHeatingProduction"*_n)][t,q,ts]
151151
)
152152
else
@@ -181,6 +181,13 @@ function add_hot_thermal_storage_dispatch_constraints(m, p, b; _n="")
181181
sum(m[Symbol("dvHeatFromStorage"*_n)][b,q,ts] for q in p.heating_loads)
182182
)
183183

184+
#Do not allow GHP to charge storage
185+
if !isempty(p.techs.ghp)
186+
for b in p.s.storage.types.hot, t in p.techs.ghp, q in p.heating_loads, ts in p.time_steps
187+
fix(m[Symbol("dvHeatToStorage"*_n)][b,t,q,ts], 0.0, force=true)
188+
end
189+
end
190+
184191
end
185192

186193
function add_cold_thermal_storage_dispatch_constraints(m, p, b; _n="")
@@ -207,6 +214,13 @@ function add_cold_thermal_storage_dispatch_constraints(m, p, b; _n="")
207214
m[Symbol("dvStoragePower"*_n)][b] >= m[Symbol("dvDischargeFromStorage"*_n)][b,ts] +
208215
sum(m[Symbol("dvProductionToStorage"*_n)][b,t,ts] for t in p.techs.cooling)
209216
)
217+
218+
#Do not allow GHP to charge storage
219+
if !isempty(p.techs.ghp)
220+
for b in p.s.storage.types.cold, t in p.techs.ghp, ts in p.time_steps
221+
fix(m[Symbol("dvProductionToStorage"*_n)][b,t,ts], 0.0, force=true)
222+
end
223+
end
210224
end
211225

212226
function add_storage_sum_constraints(m, p; _n="")

src/core/reopt.jl

+7-7
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,19 @@ function build_reopt!(m::JuMP.AbstractModel, p::REoptInputs)
216216
elseif b in p.s.storage.types.hot
217217
@constraint(m, [q in q in setdiff(p.heating_loads, p.heating_loads_served_by_tes[b]), ts in p.time_steps], m[:dvHeatFromStorage][b,q,ts] == 0)
218218
if "DomesticHotWater" in p.heating_loads_served_by_tes[b]
219-
@constraint(m, [t in setdiff(p.heating_techs, p.techs_can_serve_dhw), ts in p.time_steps], m[:dvHeatToStorage][b,"DomesticHotWater",ts] == 0)
219+
@constraint(m, [t in setdiff(p.heating_techs, p.techs_can_serve_dhw), ts in p.time_steps], m[:dvHeatToStorage][b,t,"DomesticHotWater",ts] == 0)
220220
else
221-
@constraint(m, [t in p.heating_techs, ts in p.time_steps], m[:dvHeatToStorage][b,"DomesticHotWater",ts] == 0)
221+
@constraint(m, [t in p.heating_techs, ts in p.time_steps], m[:dvHeatToStorage][b,t,"DomesticHotWater",ts] == 0)
222222
end
223223
if "SpaceHeating" in p.heating_loads_served_by_tes[b]
224-
@constraint(m, [t in setdiff(p.heating_techs, p.techs_can_serve_space_heating), ts in p.time_steps], m[:dvHeatToStorage][b,"SpaceHeating",ts] == 0)
224+
@constraint(m, [t in setdiff(p.heating_techs, p.techs_can_serve_space_heating), ts in p.time_steps], m[:dvHeatToStorage][b,t,"SpaceHeating",ts] == 0)
225225
else
226-
@constraint(m, [t in p.heating_techs, ts in p.time_steps], m[:dvHeatToStorage][b,"SpaceHeating",ts] == 0)
226+
@constraint(m, [t in p.heating_techs, ts in p.time_steps], m[:dvHeatToStorage][b,t,"SpaceHeating",ts] == 0)
227227
end
228228
if "ProcessHeat" in p.heating_loads_served_by_tes[b]
229-
@constraint(m, [t in setdiff(p.heating_techs, p.techs_can_serve_process_heat), ts in p.time_steps], m[:dvHeatToStorage][b,"ProcessHeat",ts] == 0)
229+
@constraint(m, [t in setdiff(p.heating_techs, p.techs_can_serve_process_heat), ts in p.time_steps], m[:dvHeatToStorage][b,t,"ProcessHeat",ts] == 0)
230230
else
231-
@constraint(m, [t in p.heating_techs, ts in p.time_steps], m[:dvHeatToStorage][b,"ProcessHeat",ts] == 0)
231+
@constraint(m, [t in p.heating_techs, ts in p.time_steps], m[:dvHeatToStorage][b,t,"ProcessHeat",ts] == 0)
232232
end
233233
end
234234
else
@@ -584,7 +584,7 @@ function add_variables!(m::JuMP.AbstractModel, p::REoptInputs)
584584
dvGridPurchase[p.time_steps, 1:p.s.electric_tariff.n_energy_tiers] >= 0 # Power from grid dispatched to meet electrical load [kW]
585585
dvRatedProduction[p.techs.all, p.time_steps] >= 0 # Rated production of technology t [kW]
586586
dvCurtail[p.techs.all, p.time_steps] >= 0 # [kW]
587-
dvProductionToStorage[p.s.storage.types.all, p.techs.all, p.time_steps] >= 0 # Power from technology t used to charge storage system b [kW]
587+
dvProductionToStorage[p.s.storage.types.all, union(p.techs.ghp,p.techs.all), p.time_steps] >= 0 # Power from technology t used to charge storage system b [kW]
588588
dvDischargeFromStorage[p.s.storage.types.all, p.time_steps] >= 0 # Power discharged from storage system b [kW]
589589
dvGridToStorage[p.s.storage.types.elec, p.time_steps] >= 0 # Electrical power delivered to storage by the grid [kW]
590590
dvStoredEnergy[p.s.storage.types.all, 0:p.time_steps[end]] >= 0 # State of charge of storage system b

src/core/steam_turbine.jl

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
can_wholesale::Bool = false
2626
can_export_beyond_nem_limit::Bool = false
2727
can_curtail::Bool = false
28+
can_serve_dhw::Bool = true
29+
can_serve_space_heating::Bool = true
30+
can_serve_process_heat::Bool = true
2831
2932
macrs_option_years::Int = 0
3033
macrs_bonus_fraction::Float64 = 0.0

test/scenarios/ghp_inputs.json

+10
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,15 @@
5555
"ElectricStorage": {
5656
"max_kw": 0.0,
5757
"max_kwh": 0.0
58+
},
59+
"ColdThermalStorage": {
60+
"min_gal": 10,
61+
"max_gal": 10,
62+
"thermal_decay_rate_fraction": 0.0
63+
},
64+
"HotThermalStorage": {
65+
"min_gal": 10,
66+
"max_gal": 10,
67+
"thermal_decay_rate_fraction": 0.0
5868
}
5969
}

0 commit comments

Comments
 (0)