Skip to content

Commit 1cf137e

Browse files
author
WolfBunke
authored
Merge pull request #240 from openego/feature/adjust_generator_single
Feature/adjust generator single
2 parents 14377e8 + 47dc238 commit 1cf137e

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

dataprocessing/sql_snippets/ego_dp_powerflow_assignment_generator.sql

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ CREATE TABLE model_draft.ego_supply_pf_generator_single (
3131
w_id bigint,
3232
aggr_id bigint,
3333
source_name character varying,
34+
voltage_level smallint,
3435
CONSTRAINT generator_single_data_pkey PRIMARY KEY (scn_name, generator_id),
3536
CONSTRAINT generator_data_source_fk FOREIGN KEY (source)
3637
REFERENCES model_draft.ego_grid_pf_hv_source (source_id) MATCH SIMPLE
@@ -40,41 +41,41 @@ CREATE TABLE model_draft.ego_supply_pf_generator_single (
4041

4142
-- DELETE FROM model_draft.ego_supply_pf_generator_single WHERE scn_name = 'Status Quo';
4243

43-
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name)
44-
SELECT 'Status Quo', un_id, otg_id, capacity, fuel
44+
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name, voltage_level)
45+
SELECT 'Status Quo', un_id, otg_id, capacity, fuel, voltage_level
4546
FROM model_draft.ego_supply_conv_powerplant_sq_mview a
4647
WHERE a.fuel <> 'pumped_storage' AND a.un_id IS NOT NULL AND a.capacity IS NOT NULL; -- pumped storage units are ignored here and will be listed in storage table
4748

48-
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name)
49-
SELECT 'Status Quo', un_id, otg_id, electrical_capacity/1000, generation_type
49+
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name, voltage_level)
50+
SELECT 'Status Quo', un_id, otg_id, electrical_capacity/1000, generation_type, voltage_level
5051
FROM model_draft.ego_supply_res_powerplant_sq_mview a
5152
WHERE a.un_id IS NOT NULL AND a.electrical_capacity IS NOT NULL;
5253

5354
-- NEP 2035
5455

5556
-- DELETE FROM model_draft.ego_supply_pf_generator_single WHERE scn_name = 'NEP 2035';
5657

57-
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name)
58-
SELECT 'NEP 2035', un_id, otg_id, capacity, fuel
58+
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name, voltage_level)
59+
SELECT 'NEP 2035', un_id, otg_id, capacity, fuel, voltage_level
5960
FROM model_draft.ego_supply_conv_powerplant_nep2035_mview a
6061
WHERE a.fuel <> 'pumped_storage' AND a.un_id IS NOT NULL AND a.capacity IS NOT NULL; -- pumped storage units are ignored here and will be listed in storage table
6162

62-
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name)
63-
SELECT 'NEP 2035', un_id, otg_id, electrical_capacity/1000, generation_type
63+
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name, voltage_level)
64+
SELECT 'NEP 2035', un_id, otg_id, electrical_capacity/1000, generation_type, voltage_level
6465
FROM model_draft.ego_supply_res_powerplant_nep2035_mview a
6566
WHERE a.un_id IS NOT NULL AND a.electrical_capacity IS NOT NULL;
6667

6768
-- eGo 100
6869

6970
-- DELETE FROM model_draft.ego_supply_pf_generator_single WHERE scn_name = 'eGo 100';
7071

71-
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name)
72-
SELECT 'eGo 100', un_id, otg_id, capacity, fuel
72+
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name, voltage_level)
73+
SELECT 'eGo 100', un_id, otg_id, capacity, fuel, voltage_level
7374
FROM model_draft.ego_supply_conv_powerplant_ego100_mview a
7475
WHERE a.fuel <> 'pumped_storage' AND a.un_id IS NOT NULL AND a.capacity IS NOT NULL; -- pumped storage units are ignored here and will be listed in storage table
7576

76-
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name)
77-
SELECT 'eGo 100', un_id, otg_id, electrical_capacity/1000, generation_type
77+
INSERT INTO model_draft.ego_supply_pf_generator_single (scn_name, generator_id, bus, p_nom, source_name, voltage_level)
78+
SELECT 'eGo 100', un_id, otg_id, electrical_capacity/1000, generation_type, voltage_level
7879
FROM model_draft.ego_supply_res_powerplant_ego100_mview a
7980
WHERE a.un_id IS NOT NULL AND a.electrical_capacity IS NOT NULL;
8081

@@ -148,6 +149,9 @@ COMMENT ON TABLE model_draft.ego_supply_pf_generator_single IS
148149
"Unit": "" },
149150
{"Name": "aggr_id",
150151
"Description": "aggregate id",
152+
"Unit": "" },
153+
{"Name": "voltage_level",
154+
"Description": "voltage level to which the power plant is assigned",
151155
"Unit": "" }],
152156
"Changes":[
153157
{"Name": "Mario Kropshofer",

0 commit comments

Comments
 (0)