Skip to content

Commit 4587e4f

Browse files
datejadaabelsiqueira
authored andcommitted
Rename flow_coefficient_in_capacity_constraint to capacity_coefficient
1 parent bcf9b4f commit 4587e4f

13 files changed

Lines changed: 28 additions & 34 deletions

File tree

benchmark/EU/flow-commission.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
commission_year,efficiency,fixed_cost,flow_coefficient_in_capacity_constraint,from_asset,investment_cost,investment_limit,to_asset
1+
commission_year,efficiency,fixed_cost,capacity_coefficient,from_asset,investment_cost,investment_limit,to_asset
22
2050,1.0,0.0,1,NL_E_Balance,0.0,,NL_E_Demand
33
2050,1.0,0.0,1,NL_E_ENS,0.0,,NL_E_Demand
44
2050,1.0,0.0,1,NL_Wind_Onshore,0.0,,NL_E_Balance

docs/src/20-how-to-use.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,4 +403,4 @@ $\text{flow process A} + 0.8 \cdot \text{flow process B} \leq \text{C}$
403403

404404
In that case the sum must be always below the total capacity $\text{C}$, but if you only produce flow through B then you can produce $1.25 \cdot \text{C}$ and still satisfy this constraint.
405405

406-
To set up this parameter you need to fill in the information for the `flow_coefficient_in_capacity_constraint` in the `flow_commission` table, see more in the [model parameters](@ref table_schemas) section.
406+
To set up this parameter you need to fill in the information for the `capacity_coefficient` in the `flow_commission` table, see more in the [model parameters](@ref table_schemas) section.

src/data-preparation.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ function _append_given_durations(appender, row, durations)
198198
if haskey(row, :efficiency)
199199
DuckDB.append(appender, row.efficiency)
200200
end
201-
if haskey(row, :flow_coefficient_in_capacity_constraint)
202-
DuckDB.append(appender, row.flow_coefficient_in_capacity_constraint)
201+
if haskey(row, :capacity_coefficient)
202+
DuckDB.append(appender, row.capacity_coefficient)
203203
end
204204
DuckDB.append(appender, s)
205205
DuckDB.append(appender, e)
@@ -277,7 +277,7 @@ function create_unrolled_partition_tables!(connection)
277277
COALESCE(frpp.specification, 'uniform') AS specification,
278278
COALESCE(frpp.partition::string, '1') AS partition,
279279
flow_commission.efficiency,
280-
flow_commission.flow_coefficient_in_capacity_constraint,
280+
flow_commission.capacity_coefficient,
281281
rep_periods_data.num_timesteps,
282282
FROM flow
283283
CROSS JOIN rep_periods_data
@@ -348,7 +348,7 @@ function create_unrolled_partition_tables!(connection)
348348
year INT,
349349
rep_period INT,
350350
efficiency DOUBLE,
351-
flow_coefficient_in_capacity_constraint DOUBLE,
351+
capacity_coefficient DOUBLE,
352352
time_block_start INT,
353353
time_block_end INT
354354
)",

src/input-schemas.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,15 @@
548548
}
549549
},
550550
"flow_commission": {
551+
"capacity_coefficient": {
552+
"constraints": {
553+
"minimum": 0
554+
},
555+
"default": 1,
556+
"description": "Coefficient for the flow in the maximum capacity constraints.",
557+
"type": "DOUBLE",
558+
"unit_of_measure": "p.u."
559+
},
551560
"commission_year": {
552561
"description": "Year of commissioning",
553562
"type": "INTEGER"
@@ -567,15 +576,6 @@
567576
"type": "DOUBLE",
568577
"unit_of_measure": "CUR/MW/year"
569578
},
570-
"flow_coefficient_in_capacity_constraint": {
571-
"constraints": {
572-
"minimum": 0
573-
},
574-
"default": 1,
575-
"description": "Coefficient for the flow in the maximum capacity constraints.",
576-
"type": "DOUBLE",
577-
"unit_of_measure": "p.u."
578-
},
579579
"from_asset": {
580580
"description": "Name of the asset. Same as the one in the `asset` table.",
581581
"type": "VARCHAR"

src/model-preparation.jl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,7 @@ function add_expression_terms_rep_period_constraints!(
9898
flow.table_name,
9999
grouped_var_table_name,
100100
[case.asset_match, :year, :rep_period],
101-
[
102-
:id,
103-
:time_block_start,
104-
:time_block_end,
105-
:efficiency,
106-
:flow_coefficient_in_capacity_constraint,
107-
];
101+
[:id, :time_block_start, :time_block_end, :efficiency, :capacity_coefficient];
108102
rename_columns = Dict(case.asset_match => :asset),
109103
)
110104

@@ -125,7 +119,7 @@ function add_expression_terms_rep_period_constraints!(
125119
var.time_block_start AS var_time_block_start_vec,
126120
var.time_block_end AS var_time_block_end_vec,
127121
var.efficiency,
128-
var.flow_coefficient_in_capacity_constraint,
122+
var.capacity_coefficient,
129123
asset.type AS type,
130124
$resolution_query AS resolution,
131125
FROM $grouped_cons_table_name AS cons
@@ -152,13 +146,13 @@ function add_expression_terms_rep_period_constraints!(
152146
time_block_start::Int32,
153147
time_block_end::Int32,
154148
efficiency::Float64,
155-
flow_coefficient_in_capacity_constraint::Float64,
149+
capacity_coefficient::Float64,
156150
) in zip(
157151
group_row.var_id_vec::Vector{Union{Missing,Int64}},
158152
group_row.var_time_block_start_vec::Vector{Union{Missing,Int32}},
159153
group_row.var_time_block_end_vec::Vector{Union{Missing,Int32}},
160154
group_row.efficiency::Vector{Union{Missing,Float64}},
161-
group_row.flow_coefficient_in_capacity_constraint::Vector{Union{Missing,Float64}},
155+
group_row.capacity_coefficient::Vector{Union{Missing,Float64}},
162156
)
163157
time_block = time_block_start:time_block_end
164158
# Step 1.1.1.
@@ -171,7 +165,7 @@ function add_expression_terms_rep_period_constraints!(
171165
flow_coefficient =
172166
if group_row.type::String in case.selected_assets || use_highest_resolution
173167
if multiply_by_capacity_coefficient
174-
flow_coefficient_in_capacity_constraint
168+
capacity_coefficient
175169
else
176170
1.0
177171
end

src/sql/create-variables.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ select
1515
year,
1616
rep_period,
1717
efficiency,
18-
flow_coefficient_in_capacity_constraint,
18+
capacity_coefficient,
1919
time_block_start,
2020
time_block_end,
2121
from

test/inputs/Multi-year Investments/flow-commission.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from_asset,to_asset,commission_year,fixed_cost,investment_cost,efficiency,investment_limit,flow_coefficient_in_capacity_constraint
1+
from_asset,to_asset,commission_year,fixed_cost,investment_cost,efficiency,investment_limit,capacity_coefficient
22
battery,demand,2030,0.0,350.0,0.95,,1
33
wind,demand,2030,0.0,350.0,0.0,,1
44
ens,demand,2050,0.0,350.0,0.0,,1

test/inputs/Norse/flow-commission.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from_asset,to_asset,commission_year,fixed_cost,investment_cost,efficiency,investment_limit,flow_coefficient_in_capacity_constraint
1+
from_asset,to_asset,commission_year,fixed_cost,investment_cost,efficiency,investment_limit,capacity_coefficient
22
G_imports,Midgard_CCGT,2030,0.0,0.0,1.0,0.0,1
33
Midgard_E_demand,Midgard_Hydro,2030,0.0,0.0,0.7,0.0,1
44
Midgard_PHS,Midgard_E_demand,2030,0.0,0.0,0.85,0.0,1

test/inputs/Power-flow/flow-commission.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from_asset,to_asset,commission_year,fixed_cost,investment_cost,efficiency,investment_limit,flow_coefficient_in_capacity_constraint
1+
from_asset,to_asset,commission_year,fixed_cost,investment_cost,efficiency,investment_limit,capacity_coefficient
22
ccgt,demand,2030,0.0,0.0,0.0,,1
33
ccgt,hub,2030,0.0,0.0,0.0,,1
44
hub,demand,2030,0.0,0.0,0.0,,1

test/inputs/Storage/flow-commission.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from_asset,to_asset,commission_year,fixed_cost,investment_cost,efficiency,investment_limit,flow_coefficient_in_capacity_constraint
1+
from_asset,to_asset,commission_year,fixed_cost,investment_cost,efficiency,investment_limit,capacity_coefficient
22
wind,demand,2030,0.0,0.0,0.0,,1
33
battery,demand,2030,0.0,0.0,0.95,,1
44
phs,demand,2030,0.0,0.0,0.85,,1

0 commit comments

Comments
 (0)