Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit battery storage duration #332

Merged
merged 58 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
056fb39
add limit to battery energy capacity
atpham88 Nov 4, 2023
ff9492c
specify 8-hr battery storage
atpham88 Nov 5, 2023
adcfdc6
set default battery duration to 30 hours
atpham88 Dec 1, 2023
ee968be
Merge branch 'develop' into limit_battery_energy_cap
adfarth Feb 7, 2024
57d5d1b
change input name, address test
adfarth Feb 7, 2024
93b3cfc
tab
adfarth Feb 7, 2024
26365ad
added min duration
atpham88 Apr 8, 2024
92b9e3e
add min duration
atpham88 Apr 8, 2024
0527030
Update CHANGELOG.md
atpham88 Apr 8, 2024
b0a8dde
Update CHANGELOG.md
atpham88 Apr 8, 2024
719fdaf
Merge branch 'develop' into limit_battery_energy_cap
atpham88 Apr 8, 2024
16adef6
Merge branch 'develop' into limit_battery_energy_cap
adfarth Apr 19, 2024
443cb1d
Update CHANGELOG.md
adfarth Apr 19, 2024
b97cf90
add error catch
adfarth Apr 19, 2024
c74620c
Merge branch 'develop' into limit_battery_energy_cap
adfarth Apr 21, 2024
b6bd56f
Merge branch 'develop' into limit_battery_energy_cap
adfarth Apr 30, 2024
f8f5f2d
Merge branch 'develop' into limit_battery_energy_cap
adfarth May 1, 2024
8d826c9
Merge branch 'develop' into limit_battery_energy_cap
adfarth May 3, 2024
c29ca5c
Merge branch 'develop' into limit_battery_energy_cap
adfarth May 22, 2024
e167bf6
Update electric_storage.jl
atpham88 Jun 4, 2024
91053a4
Merge branch 'develop' into limit_battery_energy_cap
atpham88 Jun 4, 2024
7fffffc
Merge branch 'develop' into limit_battery_energy_cap
atpham88 Jun 4, 2024
c185bd7
Update electric_storage.jl
atpham88 Jun 4, 2024
4bf4f52
Update electric_storage.jl
atpham88 Jun 5, 2024
39ba5b9
Update electric_storage.jl
atpham88 Jun 5, 2024
cd1ff88
testing
atpham88 Jun 5, 2024
c6ad307
testing
atpham88 Jun 5, 2024
a08b8ba
Update storage_constraints.jl
atpham88 Jun 5, 2024
ad99fbd
testing
atpham88 Jun 6, 2024
4acba27
testing
atpham88 Jun 7, 2024
500148e
added max and min duration params to thermal storage
atpham88 Jun 14, 2024
46c749b
Merge branch 'develop' into limit_battery_energy_cap
atpham88 Jun 30, 2024
2b62672
fixed typo
atpham88 Jul 3, 2024
00b46e7
fixed typo
atpham88 Jul 3, 2024
aaf865e
increased max bat duration
atpham88 Jul 5, 2024
b338884
Merge branch 'develop' into limit_battery_energy_cap
atpham88 Aug 29, 2024
151b102
Merge pull request #431 from NREL/develop
zolanaj Sep 26, 2024
34d2697
Merge branch 'master' into limit_battery_energy_cap
atpham88 Oct 2, 2024
092ce37
Merge branch 'develop' into limit_battery_energy_cap
adfarth Oct 11, 2024
f65ea02
Update CHANGELOG.md
adfarth Oct 11, 2024
2266097
align markdown text with actual default
adfarth Oct 11, 2024
c06cd28
Merge branch 'develop' into limit_battery_energy_cap
adfarth Oct 11, 2024
cce7714
set the same max duration for electric & thermal storage
atpham88 Oct 11, 2024
1f3b00a
removed unnecessary comments
atpham88 Oct 11, 2024
4cd6394
Update thermal_storage.jl
atpham88 Oct 13, 2024
3cb56bd
Update thermal_storage.jl
atpham88 Oct 13, 2024
807e3da
Update electric_storage.jl
atpham88 Oct 13, 2024
c078f6b
test with smaller max duration
atpham88 Oct 13, 2024
4be8fca
added storage duration test
atpham88 Oct 13, 2024
61fc54a
test with smaller default battery duration
atpham88 Oct 14, 2024
12187b9
Merge branch 'develop' into limit_battery_energy_cap
adfarth Oct 14, 2024
ac22cde
Merge branch 'limit_battery_energy_cap' of https://github.com/NREL/RE…
adfarth Oct 14, 2024
0534ea9
add min and max to thermal storage inputs markdown
adfarth Oct 14, 2024
64b82c0
Update CHANGELOG.md
adfarth Oct 14, 2024
25409f6
only allow min/max_duration_hours in elec storage
atpham88 Oct 19, 2024
9394ffd
Merge branch 'develop' into limit_battery_energy_cap
atpham88 Oct 19, 2024
2b364cb
minor cleaned up
atpham88 Oct 19, 2024
e2df51b
Update thermal_storage.jl
atpham88 Oct 19, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Classify the change according to the following categories:
### Deprecated
### Removed

## Develop - 2024-10-11
### Added
- Add new **ElectricStorage** parameters **max_duration_hours** and **min_duration_hours** to bound the energy duration of battery storage

## v0.48.0
### Added
- Added new file `src/core/ASHP.jl` with new technology **ASHP**, which uses electricity as input and provides heating and/or cooling as output; load balancing and technology-specific constraints have been updated and added accordingly
Expand Down
11 changes: 11 additions & 0 deletions src/constraints/storage_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ function add_storage_size_constraints(m, p, b; _n="")
@constraint(m,
m[Symbol("dvStoragePower"*_n)][b] <= p.s.storage.attr[b].max_kw
)

# Constraint (4c)-3: Limit on Storage Energy Capacity based on Duration Hours
@constraint(m,
m[Symbol("dvStorageEnergy"*_n)][b] <= m[Symbol("dvStoragePower"*_n)][b] * p.s.storage.attr[b].max_duration_hours #p.s.storage.attr[b].max_duration_hours
adfarth marked this conversation as resolved.
Show resolved Hide resolved
)

@constraint(m,
m[Symbol("dvStorageEnergy"*_n)][b] >= m[Symbol("dvStoragePower"*_n)][b] * p.s.storage.attr[b].min_duration_hours #p.s.storage.attr[b].min_duration_hours
)


end


Expand Down
14 changes: 13 additions & 1 deletion src/core/energy_storage/electric_storage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ end
model_degradation::Bool = false
degradation::Dict = Dict()
minimum_avg_soc_fraction::Float64 = 0.0
min_duration_hours::Real = 0.0 # Minimum amount of time storage can discharge at its rated power capacity
max_duration_hours::Real = 100000.0 # Maximum amount of time storage can discharge at its rated power capacity (ratio of ElectricStorage size_kwh to size_kw)
```
"""
Base.@kwdef struct ElectricStorageDefaults
Expand Down Expand Up @@ -198,6 +200,8 @@ Base.@kwdef struct ElectricStorageDefaults
model_degradation::Bool = false
degradation::Dict = Dict()
minimum_avg_soc_fraction::Float64 = 0.0
min_duration_hours::Real = 0.0
max_duration_hours::Real = 100000.0
end


Expand Down Expand Up @@ -239,6 +243,8 @@ struct ElectricStorage <: AbstractElectricStorage
model_degradation::Bool
degradation::Degradation
minimum_avg_soc_fraction::Float64
min_duration_hours::Real
max_duration_hours::Real

function ElectricStorage(d::Dict, f::Financial)
s = ElectricStorageDefaults(;d...)
Expand All @@ -251,6 +257,10 @@ struct ElectricStorage <: AbstractElectricStorage
@warn "Battery replacement costs (per_kwh) will not be considered because battery_replacement_year is greater than or equal to analysis_years."
end

if s.min_duration_hours > s.max_duration_hours
throw(@error("ElectricStorage min_duration_hours must be less than max_duration_hours."))
end

net_present_cost_per_kw = effective_cost(;
itc_basis = s.installed_cost_per_kw,
replacement_cost = s.inverter_replacement_year >= f.analysis_years ? 0.0 : s.replace_cost_per_kw,
Expand Down Expand Up @@ -326,7 +336,9 @@ struct ElectricStorage <: AbstractElectricStorage
net_present_cost_per_kwh,
s.model_degradation,
degr,
s.minimum_avg_soc_fraction
s.minimum_avg_soc_fraction,
s.min_duration_hours,
s.max_duration_hours
)
end
end
17 changes: 15 additions & 2 deletions src/core/energy_storage/thermal_storage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Base.@kwdef struct ColdThermalStorageDefaults <: AbstractThermalStorageDefaults
macrs_itc_reduction::Float64 = 0.5
total_itc_fraction::Float64 = 0.3
total_rebate_per_kwh::Float64 = 0.0
min_duration_hours::Real = 0.0
max_duration_hours::Real = 9999999999.0
adfarth marked this conversation as resolved.
Show resolved Hide resolved
end


Expand Down Expand Up @@ -86,6 +88,8 @@ Base.@kwdef struct HotThermalStorageDefaults <: AbstractThermalStorageDefaults
can_serve_dhw::Bool = true
can_serve_space_heating::Bool = true
can_serve_process_heat::Bool = false
min_duration_hours::Real = 0.0
max_duration_hours::Real = 9999999999.0
end


Expand Down Expand Up @@ -119,6 +123,8 @@ struct ColdThermalStorage <: AbstractThermalStorage
discharge_efficiency::Float64
net_present_cost_per_kwh::Float64
om_cost_per_kwh::Float64
min_duration_hours::Real
max_duration_hours::Real

function ColdThermalStorage(s::AbstractThermalStorageDefaults, f::Financial, time_steps_per_hour::Int)

Expand Down Expand Up @@ -167,7 +173,9 @@ struct ColdThermalStorage <: AbstractThermalStorage
charge_efficiency,
discharge_efficiency,
net_present_cost_per_kwh,
om_cost_per_kwh
om_cost_per_kwh,
s.min_duration_hours,
s.max_duration_hours
)
end
end
Expand Down Expand Up @@ -205,6 +213,9 @@ struct HotThermalStorage <: AbstractThermalStorage
can_serve_dhw::Bool
can_serve_space_heating::Bool
can_serve_process_heat::Bool
min_duration_hours::Real
max_duration_hours::Real


function HotThermalStorage(s::AbstractThermalStorageDefaults, f::Financial, time_steps_per_hour::Int)

Expand Down Expand Up @@ -256,7 +267,9 @@ struct HotThermalStorage <: AbstractThermalStorage
om_cost_per_kwh,
s.can_serve_dhw,
s.can_serve_space_heating,
s.can_serve_process_heat
s.can_serve_process_heat,
s.min_duration_hours,
s.max_duration_hours
)
end
end
Expand Down
Loading