Skip to content

Commit

Permalink
Create new parameters for storage methods (#603)
Browse files Browse the repository at this point in the history
* Add parameters to schema

* Chang structures

* Change io

* Change input data

* Change data to make sure one storage uses new method

* Fix error rebase
  • Loading branch information
gnawin authored Apr 29, 2024
1 parent 29814b7 commit 1e267eb
Show file tree
Hide file tree
Showing 8 changed files with 497 additions and 472 deletions.
812 changes: 406 additions & 406 deletions benchmark/EU/assets-data.csv

Large diffs are not rendered by default.

37 changes: 21 additions & 16 deletions src/input-schemas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@ const schemas = (
assets = (
# Schema for the assets-data.csv file.
data = OrderedDict(
:name => Symbol, # Name of Asset (geographical?)
:type => Symbol, # Producer/Consumer/Storage/Conversion
:active => Bool, # Active or decomissioned
:investable => Bool, # Whether able to invest
:investment_integer => Bool, # Whether investment is integer or continuous
:investment_cost => Float64, # kEUR/MW/year
:investment_limit => Union{Missing,Float64}, # MW (Missing -> no limit)
:capacity => Float64, # MW
:initial_capacity => Float64, # MW
:peak_demand => Float64, # MW
:consumer_balance_sense => Union{Missing,Symbol}, # Sense of the consumer balance constraint (default ==)
:is_seasonal => Bool, # Whether seasonal storage (e.g. hydro) or not (e.g. battery)
:storage_inflows => Float64, # MWh/year
:initial_storage_capacity => Float64, # MWh
:initial_storage_level => Union{Missing,Float64}, # MWh (Missing -> free initial level)
:energy_to_power_ratio => Float64, # Hours
:name => Symbol, # Name of Asset (geographical?)
:type => Symbol, # Producer/Consumer/Storage/Conversion
:active => Bool, # Active or decomissioned
:investable => Bool, # Whether able to invest
:investment_integer => Bool, # Whether investment is integer or continuous
:investment_cost => Float64, # kEUR/MW/year
:investment_limit => Union{Missing,Float64}, # MW (Missing -> no limit)
:capacity => Float64, # MW
:initial_capacity => Float64, # MW
:peak_demand => Float64, # MW
:consumer_balance_sense => Union{Missing,Symbol}, # Sense of the consumer balance constraint (default ==)
:is_seasonal => Bool, # Whether seasonal storage (e.g. hydro) or not (e.g. battery)
:storage_inflows => Float64, # MWh/year
:initial_storage_capacity => Float64, # MWh
:initial_storage_level => Union{Missing,Float64}, # MWh (Missing -> free initial level)
:energy_to_power_ratio => Float64, # Hours
:storage_method_energy => Bool, # Whether storage method is energy or not (i.e., fixed_ratio)
:investment_cost_storage_energy => Float64, # kEUR/MWh/year
:investment_limit_storage_energy => Union{Missing,Float64}, # MWh (Missing -> no limit)
:capacity_storage_energy => Float64, # MWh
:investment_integer_storage_energy => Bool, # Whether investment for storage energy is integer or continuous
),

# Schema for the assets-profiles.csv file.
Expand Down
5 changes: 5 additions & 0 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ function create_internal_structures(table_tree::TableTree)
row.initial_storage_capacity,
row.initial_storage_level,
row.energy_to_power_ratio,
row.storage_method_energy,
row.investment_cost_storage_energy,
row.investment_limit_storage_energy,
row.capacity_storage_energy,
row.investment_integer_storage_energy,
) for row in eachrow(table_tree.static.assets)
]

Expand Down
15 changes: 15 additions & 0 deletions src/structures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ mutable struct GraphAssetData
initial_storage_capacity::Float64
initial_storage_level::Union{Missing,Float64}
energy_to_power_ratio::Float64
storage_method_energy::Bool
investment_cost_storage_energy::Float64
investment_limit_storage_energy::Union{Missing,Float64}
capacity_storage_energy::Float64
investment_integer_storage_energy::Bool
timeframe_profiles::Dict{Symbol,Vector{Float64}}
rep_periods_profiles::Dict{Tuple{Symbol,Int},Vector{Float64}}
timeframe_partitions::Vector{PeriodsBlock}
Expand All @@ -106,6 +111,11 @@ mutable struct GraphAssetData
initial_storage_capacity,
initial_storage_level,
energy_to_power_ratio,
storage_method_energy,
investment_cost_storage_energy,
investment_limit_storage_energy,
capacity_storage_energy,
investment_integer_storage_energy,
)
timeframe_profiles = Dict{Symbol,Vector{Float64}}()
rep_periods_profiles = Dict{Tuple{Symbol,Int},Vector{Float64}}()
Expand All @@ -126,6 +136,11 @@ mutable struct GraphAssetData
initial_storage_capacity,
initial_storage_level,
energy_to_power_ratio,
storage_method_energy,
investment_cost_storage_energy,
investment_limit_storage_energy,
capacity_storage_energy,
investment_integer_storage_energy,
timeframe_profiles,
rep_periods_profiles,
timeframe_partitions,
Expand Down
48 changes: 24 additions & 24 deletions test/inputs/Norse/assets-data.csv
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
,{producer;consumer;storage;hub;conversion},{true;false},{true;false},{true;false},kEUR/MW/year,MW,MW,MW,MW,{empty;==;>=},{true;false},MWh/year,MWh,MWh,h
name,type,active,investable,investment_integer,investment_cost,investment_limit,capacity,initial_capacity,peak_demand,consumer_balance_sense,is_seasonal,storage_inflows,initial_storage_capacity,initial_storage_level,energy_to_power_ratio
Asgard_Battery,storage,true,true,true,300,,10,0,0,,false,0,0,,100
Asgard_Solar,producer,true,true,true,350,50000,100,0,0,,false,0,0,0,0
Asgard_E_demand,consumer,true,false,false,0,0,0,0,65787.17792,,false,0,0,0,0
Asgard_CCGT,conversion,true,true,true,650,,500,0,0,,false,0,0,0,0
G_imports,producer,true,false,false,0,0,0,75000,0,,false,0,0,0,0
Midgard_Wind,producer,true,true,true,1300,80000,3,0,0,,false,0,0,0,0
Midgard_Hydro,storage,true,false,false,1600,0,0,250,0,,true,10000,50000,25000,0
Midgard_Nuclear_SMR,producer,true,true,false,6000,,150,1000,0,,false,0,0,0,0
Midgard_E_imports,producer,true,false,false,0,0,0,500,0,,false,0,0,0,0
Midgard_CCGT,conversion,true,true,true,650,,500,0,0,,false,0,0,0,0
Midgard_E_demand,consumer,true,false,false,0,0,0,0,19604.76443,,false,0,0,0,0
Valhalla_H2_generator,conversion,true,true,true,479,,100,0,0,,false,0,0,0,0
Valhalla_H2_storage,storage,true,true,true,0.1,,500,0,0,,true,0,0,,10000
Valhalla_H2_demand,consumer,true,false,false,0,0,0,0,745.735,,false,0,0,0,0
Valhalla_Electrolyser,conversion,true,true,true,1260,,100,500,0,,false,0,0,0,0
Valhalla_E_balance,hub,true,false,false,0,0,0,0,0,,false,0,0,0,0
Valhalla_E_exports,consumer,true,false,false,0,0,0,0,50,,false,0,0,0,0
Valhalla_Fuel_cell,conversion,true,true,true,800,,100,0,0,,false,0,0,0,0
Valhalla_Heat_pump,conversion,true,true,true,300,,100,0,0,,false,0,0,0,0
Valhalla_Waste_heat,producer,true,false,false,1450,,200,0,0,,false,0,0,0,0
Valhalla_Heat_demand,consumer,true,false,false,0,0,0,0,3548.42445,>=,false,0,0,0,0
Valhalla_GT,conversion,true,true,true,400,100000,500,0,0,,false,0,0,0,0
,{producer;consumer;storage;hub;conversion},{true;false},{true;false},{true;false},kEUR/MW/year,MW,MW,MW,MW,{empty;==;>=},{true;false},MWh/year,MWh,MWh,h,{true;false},kEUR/MWh/year,MWh,MWh,{true;false}
name,type,active,investable,investment_integer,investment_cost,investment_limit,capacity,initial_capacity,peak_demand,consumer_balance_sense,is_seasonal,storage_inflows,initial_storage_capacity,initial_storage_level,energy_to_power_ratio,storage_method_energy,investment_cost_storage_energy,investment_limit_storage_energy,capacity_storage_energy,investment_integer_storage_energy
Asgard_Battery,storage,true,true,true,300,,10,0,0,,false,0,0,,100,true,30,1000,10,true
Asgard_Solar,producer,true,true,true,350,50000,100,0,0,,false,0,0,0,0,false,0,,0,false
Asgard_E_demand,consumer,true,false,false,0,0,0,0,65787.17792,,false,0,0,0,0,false,0,,0,false
Asgard_CCGT,conversion,true,true,true,650,,500,0,0,,false,0,0,0,0,false,0,,0,false
G_imports,producer,true,false,false,0,0,0,75000,0,,false,0,0,0,0,false,0,,0,false
Midgard_Wind,producer,true,true,true,1300,80000,3,0,0,,false,0,0,0,0,false,0,,0,false
Midgard_Hydro,storage,true,false,false,1600,0,0,250,0,,true,10000,50000,25000,0,false,0,,0,false
Midgard_Nuclear_SMR,producer,true,true,false,6000,,150,1000,0,,false,0,0,0,0,false,0,,0,false
Midgard_E_imports,producer,true,false,false,0,0,0,500,0,,false,0,0,0,0,false,0,,0,false
Midgard_CCGT,conversion,true,true,true,650,,500,0,0,,false,0,0,0,0,false,0,,0,false
Midgard_E_demand,consumer,true,false,false,0,0,0,0,19604.76443,,false,0,0,0,0,false,0,,0,false
Valhalla_H2_generator,conversion,true,true,true,479,,100,0,0,,false,0,0,0,0,false,0,,0,false
Valhalla_H2_storage,storage,true,true,true,0.1,,500,0,0,,true,0,0,,10000,false,10,,100,true
Valhalla_H2_demand,consumer,true,false,false,0,0,0,0,745.735,,false,0,0,0,0,false,0,,0,false
Valhalla_Electrolyser,conversion,true,true,true,1260,,100,500,0,,false,0,0,0,0,false,0,,0,false
Valhalla_E_balance,hub,true,false,false,0,0,0,0,0,,false,0,0,0,0,false,0,,0,false
Valhalla_E_exports,consumer,true,false,false,0,0,0,0,50,,false,0,0,0,0,false,0,,0,false
Valhalla_Fuel_cell,conversion,true,true,true,800,,100,0,0,,false,0,0,0,0,false,0,,0,false
Valhalla_Heat_pump,conversion,true,true,true,300,,100,0,0,,false,0,0,0,0,false,0,,0,false
Valhalla_Waste_heat,producer,true,false,false,1450,,200,0,0,,false,0,0,0,0,false,0,,0,false
Valhalla_Heat_demand,consumer,true,false,false,0,0,0,0,3548.42445,>=,false,0,0,0,0,false,0,,0,false
Valhalla_GT,conversion,true,true,true,400,100000,500,0,0,,false,0,0,0,0,false,0,,0,false
20 changes: 10 additions & 10 deletions test/inputs/Storage/assets-data.csv
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
,{producer;consumer;storage;hub;conversion},{true;false},{true;false},{true;false},kEUR/MW/year,MW,MW,MW,MW,{empty;==;>=},{true;false},MWh/year,MWh,MWh,h
name,type,active,investable,investment_integer,investment_cost,investment_limit,capacity,initial_capacity,peak_demand,consumer_balance_sense,is_seasonal,storage_inflows,initial_storage_capacity,initial_storage_level,energy_to_power_ratio
ocgt,producer,true,false,false,0,,100,100,0,,false,0,0,0,0
ccgt,producer,true,false,false,0,,400,800,0,,false,0,0,0,0
wind,producer,true,false,false,0,,50,1750,0,,false,0,0,0,0
solar,producer,true,false,false,0,,10,450,0,,false,0,0,0,0
ens,producer,true,false,false,0,,0,1240,0,,false,0,0,0,0
battery,storage,true,false,false,0,,10,10,0,,false,0,20,0,0
phs,storage,true,false,false,0,,100,100,0,,true,0,4800,2400,0
demand,consumer,true,false,false,0,,0,0,1240,,false,0,0,0,0
,{producer;consumer;storage;hub;conversion},{true;false},{true;false},{true;false},kEUR/MW/year,MW,MW,MW,MW,{empty;==;>=},{true;false},MWh/year,MWh,MWh,h,{true;false},kEUR/MWh/year,MWh,MWh,{true;false}
name,type,active,investable,investment_integer,investment_cost,investment_limit,capacity,initial_capacity,peak_demand,consumer_balance_sense,is_seasonal,storage_inflows,initial_storage_capacity,initial_storage_level,energy_to_power_ratio,storage_method_energy,investment_cost_storage_energy,investment_limit_storage_energy,capacity_storage_energy,investment_integer_storage_energy
ocgt,producer,true,false,false,0,,100,100,0,,false,0,0,0,0,false,0,,0,false
ccgt,producer,true,false,false,0,,400,800,0,,false,0,0,0,0,false,0,,0,false
wind,producer,true,false,false,0,,50,1750,0,,false,0,0,0,0,false,0,,0,false
solar,producer,true,false,false,0,,10,450,0,,false,0,0,0,0,false,0,,0,false
ens,producer,true,false,false,0,,0,1240,0,,false,0,0,0,0,false,0,,0,false
battery,storage,true,false,false,0,,10,10,0,,false,0,20,0,0,false,0,,0,false
phs,storage,true,false,false,0,,100,100,0,,true,0,4800,2400,0,false,0,,0,false
demand,consumer,true,false,false,0,,0,0,1240,,false,0,0,0,0,false,0,,0,false
16 changes: 8 additions & 8 deletions test/inputs/Tiny/assets-data.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
,{producer;consumer},{true;false},{true;false},{true;false},kEUR/MW/year,MW,MW,MW,MW,{empty;==;>=},{true;false},MWh/year,MWh,MWh,h
name,type,active,investable,investment_integer,investment_cost,investment_limit,capacity,initial_capacity,peak_demand,consumer_balance_sense,is_seasonal,storage_inflows,initial_storage_capacity,initial_storage_level,energy_to_power_ratio
ocgt,producer,true,true,true,25,,100,0,0,,false,0,0,0,0
ccgt,producer,true,true,true,40,10000,400,0,0,,false,0,0,0,0
wind,producer,true,true,true,70,,50,0,0,,false,0,0,0,0
solar,producer,true,true,true,50,,10,0,0,,false,0,0,0,0
ens,producer,true,false,false,0,,0,1115,0,,false,0,0,0,0
demand,consumer,true,false,false,0,,0,0,1115,,false,0,0,0,0
,{producer;consumer},{true;false},{true;false},{true;false},kEUR/MW/year,MW,MW,MW,MW,{empty;==;>=},{true;false},MWh/year,MWh,MWh,h,{true;false},kEUR/MWh/year,MWh,MWh,{true;false}
name,type,active,investable,investment_integer,investment_cost,investment_limit,capacity,initial_capacity,peak_demand,consumer_balance_sense,is_seasonal,storage_inflows,initial_storage_capacity,initial_storage_level,energy_to_power_ratio,storage_method_energy,investment_cost_storage_energy,investment_limit_storage_energy,capacity_storage_energy,investment_integer_storage_energy
ocgt,producer,true,true,true,25,,100,0,0,,false,0,0,0,0,false,0,,0,false
ccgt,producer,true,true,true,40,10000,400,0,0,,false,0,0,0,0,false,0,,0,false
wind,producer,true,true,true,70,,50,0,0,,false,0,0,0,0,false,0,,0,false
solar,producer,true,true,true,50,,10,0,0,,false,0,0,0,0,false,0,,0,false
ens,producer,true,false,false,0,,0,1115,0,,false,0,0,0,0,false,0,,0,false
demand,consumer,true,false,false,0,,0,0,1115,,false,0,0,0,0,false,0,,0,false
16 changes: 8 additions & 8 deletions test/inputs/Variable Resolution/assets-data.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
,{producer;consumer},{true;false},{true;false},{true;false},kEUR/MW/year,MW,MW,MW,MW,{empty;==;>=},{true;false},MWh/year,MWh,MWh,h
name,type,active,investable,investment_integer,investment_cost,investment_limit,capacity,initial_capacity,peak_demand,consumer_balance_sense,is_seasonal,storage_inflows,initial_storage_capacity,initial_storage_level,energy_to_power_ratio
H2,producer,true,false,false,0,,400,400,0,,false,0,0,0,0
ccgt,conversion,true,false,false,0,,100,100,0,,false,0,0,0,0
wind,producer,true,false,false,0,,50,100,0,,false,0,0,0,0
phs,storage,true,false,false,0,,25,25,0,,false,0,150,0,6
demand,consumer,true,false,false,0,,0,0,100,,false,0,0,0,0
balance,hub,true,false,false,0,,0,0,0,,false,0,0,0,0
,{producer;consumer},{true;false},{true;false},{true;false},kEUR/MW/year,MW,MW,MW,MW,{empty;==;>=},{true;false},MWh/year,MWh,MWh,h,{true;false},kEUR/MWh/year,MWh,MWh,{true;false}
name,type,active,investable,investment_integer,investment_cost,investment_limit,capacity,initial_capacity,peak_demand,consumer_balance_sense,is_seasonal,storage_inflows,initial_storage_capacity,initial_storage_level,energy_to_power_ratio,storage_method_energy,investment_cost_storage_energy,investment_limit_storage_energy,capacity_storage_energy,investment_integer_storage_energy
H2,producer,true,false,false,0,,400,400,0,,false,0,0,0,0,false,0,,0,false
ccgt,conversion,true,false,false,0,,100,100,0,,false,0,0,0,0,false,0,,0,false
wind,producer,true,false,false,0,,50,100,0,,false,0,0,0,0,false,0,,0,false
phs,storage,true,false,false,0,,25,25,0,,false,0,150,0,6,false,0,,0,false
demand,consumer,true,false,false,0,,0,0,100,,false,0,0,0,0,false,0,,0,false
balance,hub,true,false,false,0,,0,0,0,,false,0,0,0,0,false,0,,0,false

0 comments on commit 1e267eb

Please sign in to comment.