diff --git a/.gitignore b/.gitignore index b79cd7ab..c9d2e171 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ data/costs_*.csv dask-worker-space/ publications.jrc.ec.europa.eu/ +d1gam3xoknrgr2.cloudfront.net/ *.org diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 54f451bb..ba2e404b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: # Sort package imports alphabetically - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.0 hooks: - id: isort args: ["--profile", "black", "--filter-files"] diff --git a/README.md b/README.md index 7ef67114..4a58d75c 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,9 @@ The dataset consists of: - A grid model based on a modified [GridKit](https://github.com/bdw/GridKit) extraction of the [ENTSO-E Transmission System - Map](https://www.entsoe.eu/data/map/). The grid model contains 6763 lines + Map](https://www.entsoe.eu/data/map/). The grid model contains 7072 lines (alternating current lines at and above 220kV voltage level and all high - voltage direct current lines) and 3642 substations. + voltage direct current lines) and 3803 substations. - The open power plant database [powerplantmatching](https://github.com/FRESNA/powerplantmatching). - Electrical demand time series from the diff --git a/config/config.default.yaml b/config/config.default.yaml index 5a588650..4c8bf7d9 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -18,8 +18,6 @@ remote: ssh: "" path: "" -focus_weights: false - # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run run: name: "" @@ -88,7 +86,7 @@ co2_budget: # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#electricity electricity: - voltages: [220., 300., 380.] + voltages: [220., 300., 380., 500., 750.] gaslimit: false co2limit: 7.75e+7 co2base: 1.487e+9 @@ -137,14 +135,14 @@ atlite: # module: era5 europe-2013-era5: module: era5 # in priority order - x: [-12., 35.] + x: [-12., 42.] y: [33., 72] dx: 0.3 dy: 0.3 time: ['2013', '2013'] europe-2013-sarah: module: [sarah, era5] # in priority order - x: [-12., 45.] + x: [-12., 42.] y: [33., 65] dx: 0.2 dy: 0.2 @@ -237,10 +235,13 @@ lines: 220.: "Al/St 240/40 2-bundle 220.0" 300.: "Al/St 240/40 3-bundle 300.0" 380.: "Al/St 240/40 4-bundle 380.0" + 500.: "Al/St 240/40 4-bundle 380.0" + 750.: "Al/St 560/50 4-bundle 750.0" s_max_pu: 0.7 s_nom_max: .inf max_extension: .inf length_factor: 1.25 + reconnect_crimea: true under_construction: 'zero' # 'zero': set capacity to zero, 'remove': remove, 'keep': with full capacity dynamic_line_rating: activate: false @@ -449,6 +450,7 @@ sector: methanation: true helmeth: false coal_cc: false + coal_for_industry_cc: false dac: true co2_vent: false central_heat_vent: false @@ -597,6 +599,7 @@ costs: # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#clustering clustering: + focus_weights: false simplify_network: to_substations: false algorithm: kmeans # choose from: [hac, kmeans] @@ -722,6 +725,7 @@ plotting: H2: "Hydrogen Storage" lines: "Transmission Lines" ror: "Run of River" + load: "Load Shedding" ac: "AC" dc: "DC" @@ -988,3 +992,4 @@ plotting: DC: "#8a1caf" DC-DC: "#8a1caf" DC link: "#8a1caf" + load: "#dd2e23" diff --git a/config/config.entsoe-all.yaml b/config/config.entsoe-all.yaml new file mode 100644 index 00000000..dd19d2c7 --- /dev/null +++ b/config/config.entsoe-all.yaml @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: 2017-2023 The PyPSA-Eur Authors +# +# SPDX-License-Identifier: CC0-1.0 + +run: + name: "entsoe-all" + disable_progressbar: true + shared_resources: false + shared_cutouts: true + +scenario: + simpl: + - '' + ll: + - vopt + clusters: + - 39 + - 128 + - 256 + opts: + - '' + sector_opts: + - '' + planning_horizons: + - '' + +# TODO add Turkey (TR) +countries: ['AL', 'AT', 'BA', 'BE', 'BG', 'CH', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'ME', 'MD', 'MK', 'NL', 'NO', 'PL', 'PT', 'RO', 'RS', 'SE', 'SI', 'SK', 'UA'] + +electricity: + custom_powerplants: true + co2limit: 9.59e+7 + co2base: 1.918e+9 + +lines: + reconnect_crimea: true + +enable: + retrieve: true + retrieve_databundle: true + retrieve_sector_databundle: false + retrieve_cost_data: true + retrieve_cutout: true diff --git a/data/GDP_PPP_30arcsec_v3_mapped_default.csv b/data/GDP_PPP_30arcsec_v3_mapped_default.csv new file mode 100644 index 00000000..f0e640b3 --- /dev/null +++ b/data/GDP_PPP_30arcsec_v3_mapped_default.csv @@ -0,0 +1,151 @@ +name,GDP_PPP,country +3140,632728.0438507323,MD +3139,806541.9318093687,MD +3142,1392454.6690911907,MD +3152,897871.2903553953,MD +3246,645554.8588933202,MD +7049,1150156.4449477682,MD +1924,162285.16792916053,UA +1970,751970.6071848695,UA +2974,368873.75840156944,UA +2977,294847.85539198935,UA +2979,197988.13680768458,UA +2980,301371.2491126519,UA +3031,56925.21878805953,UA +3032,139395.18279351242,UA +3033,145377.8061037629,UA +3035,52282.83655208812,UA +3036,497950.25890516065,UA +3037,1183293.1987702171,UA +3038,255005.98207636533,UA +3039,224711.50098325178,UA +3040,342959.943226467,UA +3044,69119.31486955672,UA +3045,246273.65986119965,UA +3047,146742.08407299497,UA +3049,107265.7028733467,UA +3050,1126147.985259493,UA +3051,69833.56303043803,UA +3052,67230.88206577855,UA +3053,27019.224685201345,UA +3054,260571.47337292184,UA +3055,88760.94152915622,UA +3056,101368.26196568517,UA +3058,55752.92329667119,UA +3059,89024.37880630122,UA +3062,358411.291265149,UA +3064,75081.64142862396,UA +3065,158101.42949135564,UA +3066,83763.89576442329,UA +3068,173474.51218344545,UA +3069,60327.01572375589,UA +3070,18073.687271955278,UA +3071,249069.43314695224,UA +3072,220707.35700825177,UA +3073,61342.30137462664,UA +3074,254235.98867635374,UA +3077,769558.9832370486,UA +3078,132674.2315809836,UA +3079,1388517.1478032232,UA +3080,1861003.8718246964,UA +3082,140123.73854745473,UA +3083,834887.5595419679,UA +3084,1910795.5590558557,UA +3086,93828.36549170096,UA +3088,347197.65113392205,UA +3089,3754718.141734592,UA +3090,521912.69768585655,UA +3093,232818.05269714879,UA +3095,435376.20361377904,UA +3099,345596.5288937008,UA +3100,175689.10947424968,UA +3105,538438.9311459162,UA +3107,88096.86032871014,UA +3108,79847.68447063807,UA +3109,348504.73449373,UA +3144,71657.0165675802,UA +3146,80342.05037424155,UA +3158,74465.12922576343,UA +3164,3102112.2672631275,UA +3165,65215.04081671433,UA +3166,413924.2225725632,UA +3167,135060.0056434935,UA +3168,54980.442979330146,UA +3170,29584.879122227037,UA +3171,142780.68163047134,UA +3172,40436.63814695243,UA +3173,1253342.1790126422,UA +3174,173842.03139155387,UA +3176,65699.76352408895,UA +3177,143591.75419817626,UA +3178,56434.04525832523,UA +3179,389996.1670051216,UA +3180,138452.84503524794,UA +3181,67402.59500436619,UA +3184,51204.293695376415,UA +3185,46867.82356528432,UA +3186,103892.35612417295,UA +3187,193668.91476930346,UA +3189,54584.176457692694,UA +3190,219077.64942830536,UA +3197,88516.52699983507,UA +3198,298166.8272673622,UA +3199,61334.952541812374,UA +3229,175692.61136747137,UA +3230,106722.62773321665,UA +3236,61542.06264321315,UA +3241,83752.90489164277,UA +4301,48419.52825967164,UA +4305,147759.74280349456,UA +4306,53156.905740992224,UA +4315,218025.78516351627,UA +4317,155240.40554731718,UA +4318,1342144.2459407183,UA +4319,91669.1449633853,UA +4321,85852.49282415409,UA +4347,67938.7698430624,UA +4357,20064.979012172935,UA +4360,47840.51245168512,UA +4361,55580.924388032574,UA +4362,165753.82588729708,UA +4363,46390.2448142152,UA +4365,96265.47592938849,UA +4366,272003.25510057947,UA +4367,80878.50229245829,UA +4370,330072.35444044066,UA +4371,7707066.181975477,UA +4373,2019766.7891575783,UA +4374,985354.331818515,UA +4377,230805.08833664874,UA +4382,125670.67125287943,UA +4383,46914.065511740075,UA +4384,48020.804310510954,UA +4385,55612.34707641123,UA +4387,74558.3475791577,UA +4388,245243.33449409154,UA +4389,95696.56767732685,UA +4391,251085.7523045193,UA +4401,66375.82996856027,UA +4403,111954.41038437477,UA +4405,46911.68560148837,UA +4408,150782.51691456966,UA +4409,112776.7399582134,UA +4410,153076.56860965435,UA +4412,192629.31238456024,UA +4413,181295.3120834606,UA +4414,995694.9413199169,UA +4416,157640.7868989174,UA +4418,77580.20674809469,UA +4420,122320.99275223716,UA +4424,184891.10924920067,UA +4425,84486.75974340564,UA +4431,50485.84380961137,UA +4435,231040.45446464577,UA +4436,81222.18707585508,UA +4438,114819.76472988473,UA +4439,76839.1052178896,UA +4440,135337.0313562152,UA +4441,49159.485269198034,UA +7031,42001.73757065917,UA +7059,159790.48382874,UA +7063,39599.10564971086,UA diff --git a/data/custom_powerplants.csv b/data/custom_powerplants.csv index 4e039b7a..4fd47498 100644 --- a/data/custom_powerplants.csv +++ b/data/custom_powerplants.csv @@ -1 +1,37 @@ -Name,Fueltype,Technology,Set,Country,Capacity,Efficiency,Duration,Volume_Mm3,DamHeight_m,YearCommissioned,Retrofit,lat,lon,projectID,YearDecommissioning +,Name,Fueltype,Technology,Set,Country,Capacity,Efficiency,Duration,Volume_Mm3,DamHeight_m,StorageCapacity_MWh,DateIn,DateRetrofit,DateMothball,DateOut,lat,lon,EIC,projectID +1266,Khmelnitskiy,Nuclear,,PP,UA,1901.8916595755832,,0.0,0.0,0.0,0.0,1988.0,2005.0,,,50.3023,26.6466,[nan],"{'GEO': ['GEO3842'], 'GPD': ['WRI1005111'], 'CARMA': ['CARMA22000']}" +1268,Kaniv,Hydro,Reservoir,PP,UA,452.1656050955414,,0.0,0.0,0.0,0.0,1972.0,2003.0,,,49.76653,31.47165,[nan],"{'GEO': ['GEO43017'], 'GPD': ['WRI1005122'], 'CARMA': ['CARMA21140']}" +1269,Kahovska kakhovka,Hydro,Reservoir,PP,UA,352.45222929936307,,0.0,0.0,0.0,0.0,1955.0,1956.0,,,46.77858,33.36965,[nan],"{'GEO': ['GEO43018'], 'GPD': ['WRI1005118'], 'CARMA': ['CARMA20855']}" +1347,Kharkiv,Natural Gas,Steam Turbine,CHP,UA,494.94274967602314,,0.0,0.0,0.0,0.0,1979.0,1980.0,,,49.9719,36107,[nan],"{'GEO': ['GEO43027'], 'GPD': ['WRI1005126'], 'CARMA': ['CARMA21972']}" +1348,Kremenchuk,Hydro,Reservoir,PP,UA,617.0382165605096,,0.0,0.0,0.0,0.0,1959.0,1960.0,,,49.07759,33.2505,[nan],"{'GEO': ['GEO43019'], 'GPD': ['WRI1005121'], 'CARMA': ['CARMA23072']}" +1377,Krivorozhskaya,Hard Coal,Steam Turbine,PP,UA,2600.0164509342876,,0.0,0.0,0.0,0.0,1965.0,1992.0,,,47.5432,33.6583,[nan],"{'GEO': ['GEO42989'], 'GPD': ['WRI1005100'], 'CARMA': ['CARMA23176']}" +1407,Zmiyevskaya zmiivskaya,Hard Coal,Steam Turbine,PP,UA,2028.3816283884514,,0.0,0.0,0.0,0.0,1960.0,2005.0,,,49.5852,36.5231,[nan],"{'GEO': ['GEO42999'], 'GPD': ['WRI1005103'], 'CARMA': ['CARMA51042']}" +1408,Pridneprovskaya,Hard Coal,Steam Turbine,CHP,UA,1627.3152609570984,,0.0,0.0,0.0,0.0,1959.0,1966.0,,,48.4051,35.1131,[nan],"{'GEO': ['GEO42990'], 'GPD': ['WRI1005102'], 'CARMA': ['CARMA35874']}" +1409,Kurakhovskaya,Hard Coal,Steam Turbine,PP,UA,1371.0015824607397,,0.0,0.0,0.0,0.0,1972.0,2003.0,,,47.9944,37.24022,[nan],"{'GEO': ['GEO42994'], 'GPD': ['WRI1005104'], 'CARMA': ['CARMA23339']}" +1410,Dobrotvorsky,Hard Coal,Steam Turbine,PP,UA,553.1949895604868,,0.0,0.0,0.0,0.0,1960.0,1964.0,,,50.2133,24375,[nan],"{'GEO': ['GEO42992'], 'GPD': ['WRI1005096'], 'CARMA': ['CARMA10971']}" +1422,Zuyevskaya,Hard Coal,Steam Turbine,PP,UA,1147.87960333801,,0.0,0.0,0.0,0.0,1982.0,2007.0,,,48.0331,38.28615,[nan],"{'GEO': ['GEO42995'], 'GPD': ['WRI1005106'], 'CARMA': ['CARMA51083']}" +1423,Zaporozhye,Nuclear,,PP,UA,5705.67497872675,,0.0,0.0,0.0,0.0,1985.0,1996.0,,,47.5119,34.5863,[nan],"{'GEO': ['GEO6207'], 'GPD': ['WRI1005114'], 'CARMA': ['CARMA50875']}" +1424,Trypilska,Hard Coal,Steam Turbine,PP,UA,1659.5849686814602,,0.0,0.0,0.0,0.0,1969.0,1972.0,,,50.1344,30.7468,[nan],"{'GEO': ['GEO43000'], 'GPD': ['WRI1005099'], 'CARMA': ['CARMA46410']}" +1425,Tashlyk,Hydro,Pumped Storage,Store,UA,285.55968954109585,,0.0,0.0,0.0,0.0,2006.0,2007.0,,,47.7968,31.1811,[nan],"{'GEO': ['GEO43025'], 'GPD': ['WRI1005117'], 'CARMA': ['CARMA44696']}" +1426,Starobeshivska,Hard Coal,Steam Turbine,PP,UA,1636.5351774497733,,0.0,0.0,0.0,0.0,1961.0,1967.0,,,47.7997,38.00612,[nan],"{'GEO': ['GEO43003'], 'GPD': ['WRI1005105'], 'CARMA': ['CARMA43083']}" +1427,South,Nuclear,,PP,UA,2852.837489363375,,0.0,0.0,0.0,0.0,1983.0,1989.0,,,47812,31.22,[nan],"{'GEO': ['GEO5475'], 'GPD': ['WRI1005113'], 'CARMA': ['CARMA42555']}" +1428,Rovno rivne,Nuclear,,PP,UA,2695.931427448389,,0.0,0.0,0.0,0.0,1981.0,2006.0,,,51.3245,25.89744,[nan],"{'GEO': ['GEO5174'], 'GPD': ['WRI1005112'], 'CARMA': ['CARMA38114']}" +1429,Ladyzhinska,Hard Coal,Steam Turbine,PP,UA,1659.5849686814602,,0.0,0.0,0.0,0.0,1970.0,1971.0,,,48706,29.2202,[nan],"{'GEO': ['GEO42993'], 'GPD': ['WRI1005098'], 'CARMA': ['CARMA24024']}" +1430,Kiev,Hydro,Pumped Storage,PP,UA,635.8694635681177,,0.0,0.0,0.0,0.0,1964.0,1972.0,,,50.5998,30501,"[nan, nan]","{'GEO': ['GEO43024', 'GEO43023'], 'GPD': ['WRI1005123', 'WRI1005124'], 'CARMA': ['CARMA23516', 'CARMA23517']}" +2450,Cet chisinau,Natural Gas,,PP,MD,306.0,,0.0,0.0,0.0,0.0,,,,,47.027550000000005,28.8801,"[nan, nan]","{'GPD': ['WRI1002985', 'WRI1002984'], 'CARMA': ['CARMA8450', 'CARMA8451']}" +2460,Hydropower che costesti,Hydro,,PP,MD,16.0,,0.0,0.0,0.0,0.0,1978.0,,,,47.8381,27.2246,[nan],"{'GPD': ['WRI1002987'], 'CARMA': ['CARMA9496']}" +2465,Moldavskaya gres,Hard Coal,,PP,MD,2520.0,,0.0,0.0,0.0,0.0,,,,,46.6292,29.9407,[nan],"{'GPD': ['WRI1002989'], 'CARMA': ['CARMA28979']}" +2466,Hydropower dubasari,Hydro,,PP,MD,48.0,,0.0,0.0,0.0,0.0,,,,,47.2778,29123,[nan],"{'GPD': ['WRI1002988'], 'CARMA': ['CARMA11384']}" +2676,Cet nord balti,Natural Gas,,PP,MD,24.0,,0.0,0.0,0.0,0.0,,,,,47.7492,27.8938,[nan],"{'GPD': ['WRI1002986'], 'CARMA': ['CARMA3071']}" +2699,Dniprodzerzhynsk,Hydro,Reservoir,PP,UA,360.3503184713376,,0.0,0.0,0.0,0.0,1963.0,1964.0,,,48.5485,34.541015,[nan],"{'GEO': ['GEO43020'], 'GPD': ['WRI1005119']}" +2707,Burshtynska tes,Hard Coal,Steam Turbine,PP,UA,2212.779958241947,,0.0,0.0,0.0,0.0,1965.0,1984.0,,,49.21038,24.66654,[nan],"{'GEO': ['GEO42991'], 'GPD': ['WRI1005097']}" +2708,Danipro dnieper,Hydro,Reservoir,PP,UA,1484.8407643312103,,0.0,0.0,0.0,0.0,1932.0,1947.0,,,47.86944,35.08611,[nan],"{'GEO': ['GEO43016'], 'GPD': ['WRI1005120']}" +2709,Dniester,Hydro,Pumped Storage,Store,UA,612.7241020616891,,0.0,0.0,0.0,0.0,2009.0,2011.0,,,48.51361,27.47333,[nan],"{'GEO': ['GEO43022'], 'GPD': ['WRI1005116', 'WRI1005115']}" +2710,Kiev,Natural Gas,Steam Turbine,CHP,UA,458.2803237740955,,0.0,0.0,0.0,0.0,1982.0,1984.0,,,50532,30.6625,[nan],"{'GEO': ['GEO42998'], 'GPD': ['WRI1005125']}" +2712,Luganskaya,Hard Coal,Steam Turbine,PP,UA,1060.2903966575996,,0.0,0.0,0.0,0.0,1962.0,1969.0,,,48.74781,39.2624,[nan],"{'GEO': ['GEO42996'], 'GPD': ['WRI1005110']}" +2713,Slavyanskaya,Hard Coal,Steam Turbine,PP,UA,737.5933194139823,,0.0,0.0,0.0,0.0,1971.0,1971.0,,,48872,37.76567,[nan],"{'GEO': ['GEO43002'], 'GPD': ['WRI1005109']}" +2714,Vuhlehirska uglegorskaya,Hard Coal,Steam Turbine,PP,UA,3319.1699373629203,,0.0,0.0,0.0,0.0,1972.0,1977.0,,,48.4633,38.20328,[nan],"{'GEO': ['GEO43001'], 'GPD': ['WRI1005107']}" +2715,Zaporiska,Hard Coal,Steam Turbine,PP,UA,3319.1699373629203,,0.0,0.0,0.0,0.0,1972.0,1977.0,,,47.5089,34.6253,[nan],"{'GEO': ['GEO42988'], 'GPD': ['WRI1005101']}" +3678,Mironovskaya,Hard Coal,,PP,UA,815.0,,0.0,0.0,0.0,0.0,,,,,48.3407,38.4049,[nan],"{'GPD': ['WRI1005108'], 'CARMA': ['CARMA28679']}" +3679,Kramatorskaya,Hard Coal,,PP,UA,120.0,,0.0,0.0,0.0,0.0,1974.0,,,,48.7477,37.5723,[nan],"{'GPD': ['WRI1075856'], 'CARMA': ['CARMA54560']}" +3680,Chernihiv,Hard Coal,,PP,UA,200.0,,0.0,0.0,0.0,0.0,1968.0,,,,51455,31.2602,[nan],"{'GPD': ['WRI1075853'], 'CARMA': ['CARMA8190']}" diff --git a/data/eia_hydro_annual_generation.csv b/data/eia_hydro_annual_generation.csv index 9b781ee3..859decf7 100644 --- a/data/eia_hydro_annual_generation.csv +++ b/data/eia_hydro_annual_generation.csv @@ -1,50 +1,53 @@ -https://www.eia.gov/international/data/world/electricity/electricity-generation?pd=2&p=000000000000000000000000000000g&u=1&f=A&v=mapbubble&a=-&i=none&vo=value&t=R&g=000000000000002&l=73-1028i008017kg6368g80a4k000e0ag00gg0004g8g0ho00g000400008&s=315532800000&e=1577836800000&ev=false& -Report generated on: 03-28-2022 11:20:48 -"API","","1980","1981","1982","1983","1984","1985","1986","1987","1988","1989","1990","1991","1992","1993","1994","1995","1996","1997","1998","1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012","2013","2014","2015","2016","2017","2018","2019","2020" -"","hydroelectricity net generation (billion kWh)","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","" -"INTL.33-12-EURO-BKWH.A"," Europe","458.018","464.155","459.881","473.685","481.241","476.739","459.535","491.085","534.517","465.365","474.466","475.47","509.041","526.448","531.815","543.743","529.114164","543.845616","562.441501","569.308453","591.206662","587.371195","541.542535","506.19703","544.536443","545.176179","537.335934","540.934407","567.557921","564.244482","619.96477","543.05273","600.46622","631.86431","619.59229","615.53013","629.98906","562.59258","619.31106","610.62616","670.925" -"INTL.33-12-ALB-BKWH.A"," Albania","2.919","3.018","3.093","3.167","3.241","3.315","3.365","3.979","3.713","3.846","2.82","3.483","3.187","3.281","3.733","4.162","5.669","4.978","4.872","5.231","4.548","3.519","3.477","5.117","5.411","5.319","4.951","2.76","3.759","5.201","7.49133","4.09068","4.67775","6.88941","4.67676","5.83605","7.70418","4.47975","8.46648","5.15394","5.281" -"INTL.33-12-AUT-BKWH.A"," Austria","28.501","30.008","29.893","29.577","28.384","30.288","30.496","25.401","35.151","34.641","31.179","31.112","34.483","36.336","35.349","36.696","33.874","35.744","36.792","40.292","41.418","40.05","39.825","32.883","36.394","36.31","35.48","36.732","37.969","40.487","36.466","32.511","41.862","40.138","39.001","35.255","37.954","36.462","35.73","40.43655","45.344" -"INTL.33-12-BEL-BKWH.A"," Belgium","0.274","0.377","0.325","0.331","0.348","0.282","0.339","0.425","0.354","0.3","0.263","0.226","0.338","0.252","0.342","0.335","0.237","0.30195","0.38511","0.338","0.455","0.437","0.356","0.245","0.314","0.285","0.355","0.385","0.406","0.325","0.298","0.193","0.353","0.376","0.289","0.314","0.367","0.268","0.311","0.108","1.29" -"INTL.33-12-BIH-BKWH.A"," Bosnia and Herzegovina","--","--","--","--","--","--","--","--","--","--","--","--","3.374","2.343","3.424","3.607","5.104","4.608","4.511","5.477","5.043","5.129","5.215","4.456","5.919","5.938","5.798","3.961","4.818","6.177","7.946","4.343","4.173","7.164","5.876","5.495","5.585","3.7521","6.35382","6.02019","6.1" -"INTL.33-12-BGR-BKWH.A"," Bulgaria","3.674","3.58","3.018","3.318","3.226","2.214","2.302","2.512","2.569","2.662","1.859","2.417","2.042","1.923","1.453","2.291","2.89","2.726","3.066","2.725","2.646","1.72","2.172","2.999","3.136","4.294","4.196","2.845","2.796","3.435","4.98168","2.84328","3.14622","3.99564","4.55598","5.59845","3.8412","2.79972","5.09553","3.34917","3.37" -"INTL.33-12-HRV-BKWH.A"," Croatia","--","--","--","--","--","--","--","--","--","--","--","--","4.298","4.302","4.881","5.212","7.156","5.234","5.403","6.524","5.794","6.482","5.311","4.827","6.888","6.27","5.94","4.194","5.164","6.663","9.035","4.983","4.789","8.536","8.917","6.327","6.784","5.255","7.62399","5.87268","3.4" -"INTL.33-12-CYP-BKWH.A"," Cyprus","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0" -"INTL.33-12-CZE-BKWH.A"," Czech Republic","--","--","--","--","--","--","--","--","--","--","--","--","--","1.355","1.445","1.982","1.949","1.68201","1.382","1.664","1.7404","2.033","2.467","1.369","1.999","2.356","2.525","2.068","2.004","2.405","2.775","1.95","2.107","2.704","1.909","1.779","1.983","1.852","1.615","1.98792","3.4" -"INTL.33-12-DNK-BKWH.A"," Denmark","0.03","0.031","0.028","0.036","0.028","0.027","0.029","0.029","0.032","0.027","0.027","0.026","0.028","0.027","0.033","0.03","0.019","0.019","0.02673","0.031","0.03","0.028","0.032","0.021","0.027","0.023","0.023","0.028","0.026","0.019","0.021","0.017","0.017","0.013","0.015","0.018","0.019","0.018","0.015","0.01584","0.02" -"INTL.33-12-EST-BKWH.A"," Estonia","--","--","--","--","--","--","--","--","--","--","--","--","0.001","0.001","0.003","0.002","0.002","0.003","0.004","0.004","0.005","0.007","0.006","0.013","0.022","0.022","0.014","0.021","0.028","0.032","0.027","0.03","0.042","0.026","0.027","0.027","0.035","0.026","0.015","0.01881","0.04" -"INTL.33-12-FRO-BKWH.A"," Faroe Islands","0.049","0.049","0.049","0.049","0.049","0.049","0.049","0.049","0.062","0.071","0.074","0.074","0.083","0.073","0.075","0.075","0.069564","0.075066","0.076501","0.069453","0.075262","0.075195","0.095535","0.08483","0.093443","0.097986","0.099934","0.103407","0.094921","0.091482","0.06676","0.092","0.099","0.091","0.121","0.132","0.105","0.11","0.107","0.102","0.11" -"INTL.33-12-FIN-BKWH.A"," Finland","10.115","13.518","12.958","13.445","13.115","12.211","12.266","13.658","13.229","12.9","10.75","13.065","14.956","13.341","11.669","12.796","11.742","12.11958","14.9","12.652","14.513","13.073","10.668","9.495","14.919","13.646","11.379","14.035","16.941","12.559","12.743","12.278","16.667","12.672","13.24","16.584","15.634","14.61","13.137","12.31461","15.56" -"INTL.33-12-CSK-BKWH.A"," Former Czechoslovakia","4.8","4.2","3.7","3.9","3.2","4.3","4","4.853","4.355","4.229","3.919","3.119","3.602","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--" -"INTL.33-12-SCG-BKWH.A"," Former Serbia and Montenegro","--","--","--","--","--","--","--","--","--","--","--","--","11.23","10.395","11.016","12.071","14.266","12.636","12.763","13.243","11.88","12.326","11.633","9.752","11.01","11.912","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--" -"INTL.33-12-YUG-BKWH.A"," Former Yugoslavia","27.868","25.044","23.295","21.623","25.645","24.363","27.474","25.98","25.612","23.256","19.601","18.929","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--" -"INTL.33-12-FRA-BKWH.A"," France","68.253","70.358","68.6","67.515","64.01","60.248","60.953","68.623","73.952","45.744","52.796","56.277","68.313","64.3","78.057","72.196","64.43","63.151","61.479","71.832","66.466","73.888","59.992","58.567","59.276","50.965","55.741","57.029","63.017","56.428","61.945","45.184","59.099","71.042","62.993","54.876","60.094","49.389","64.485","56.98242","64.84" -"INTL.33-12-DEU-BKWH.A"," Germany","--","--","--","--","--","--","--","--","--","--","--","14.742","17.223","17.699","19.731","21.562","21.737","17.18343","17.044","19.451","21.515","22.506","22.893","19.071","20.866","19.442","19.808","20.957","20.239","18.841","20.678","17.323","21.331","22.66","19.31","18.664","20.214","19.985","17.815","19.86039","24.75" -"INTL.33-12-DDR-BKWH.A"," Germany, East","1.658","1.718","1.748","1.683","1.748","1.758","1.767","1.726","1.719","1.551","1.389","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--" -"INTL.33-12-DEUW-BKWH.A"," Germany, West","17.125","17.889","17.694","16.713","16.434","15.354","16.526","18.36","18.128","16.482","15.769","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--" -"INTL.33-12-GIB-BKWH.A"," Gibraltar","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0" -"INTL.33-12-GRC-BKWH.A"," Greece","3.396","3.398","3.551","2.331","2.852","2.792","3.222","2.768","2.354","1.888","1.751","3.068","2.181","2.26","2.573","3.494","4.305","3.84318","3.68","4.546","3.656","2.076","2.772","4.718","4.625","4.967","5.806","2.565","3.279","5.32","7.431","3.998","4.387","6.337","4.464","5.782","5.543","3.962","5.035","3.9798","3.43" -"INTL.33-12-HUN-BKWH.A"," Hungary","0.111","0.166","0.158","0.153","0.179","0.153","0.152","0.167","0.167","0.156","0.176","0.192","0.156","0.164","0.159","0.161","0.205","0.21384","0.15345","0.179","0.176","0.184","0.192","0.169","0.203","0.2","0.184","0.208","0.211","0.226","0.184","0.216","0.206","0.208","0.294","0.227","0.253","0.214","0.216","0.21681","0.24" -"INTL.33-12-ISL-BKWH.A"," Iceland","3.053","3.085","3.407","3.588","3.738","3.667","3.846","3.918","4.169","4.217","4.162","4.162","4.267","4.421","4.47","4.635","4.724","5.15493","5.565","5.987","6.292","6.512","6.907","7.017","7.063","6.949","7.22","8.31","12.303","12.156","12.51","12.382","12.214","12.747","12.554","13.541","13.092","13.892","13.679","13.32441","12.46" -"INTL.33-12-IRL-BKWH.A"," Ireland","0.833","0.855","0.792","0.776","0.68","0.824","0.91","0.673","0.862","0.684","0.69","0.738","0.809","0.757","0.911","0.706","0.715","0.67122","0.907","0.838","0.838","0.59","0.903","0.592","0.624","0.625","0.717","0.66","0.959","0.893","0.593","0.699","0.795","0.593","0.701","0.798","0.674","0.685","0.687","0.87813","1.21" -"INTL.33-12-ITA-BKWH.A"," Italy","44.997","42.782","41.216","40.96","41.923","40.616","40.626","39.05","40.205","33.647","31.31","41.817","41.778","41.011","44.212","37.404","41.617","41.18697","40.808","44.911","43.763","46.343","39.125","33.303","41.915","35.706","36.624","32.488","41.207","48.647","50.506","45.36477","41.45625","52.24626","57.95955","45.08163","42.00768","35.83701","48.29913","45.31824","47.72" -"INTL.33-12-XKS-BKWH.A"," Kosovo","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","0.075","0.119","0.154","0.104","0.095","0.142","0.149","0.139","0.243","0.177","0.27027","0.2079","0.26" -"INTL.33-12-LVA-BKWH.A"," Latvia","--","--","--","--","--","--","--","--","--","--","--","--","2.498","2.846","3.272","2.908","1.841","2.922","2.99","2.729","2.791","2.805","2.438","2.243","3.078","3.293","2.671","2.706","3.078","3.422","3.488","2.857","3.677","2.838","1.953","1.841","2.523","4.356","2.417","2.08692","2.59" -"INTL.33-12-LTU-BKWH.A"," Lithuania","--","--","--","--","--","--","--","--","--","--","--","--","0.308","0.389","0.447","0.369","0.323","0.291","0.413","0.409","0.336","0.322","0.35","0.323","0.417","0.446193","0.393","0.417","0.398","0.42","0.535","0.475","0.419","0.516","0.395","0.346","0.45","0.597","0.427","0.34254","1.06" -"INTL.33-12-LUX-BKWH.A"," Luxembourg","0.086","0.095","0.084","0.083","0.088","0.071","0.084","0.101","0.097","0.072","0.07","0.083","0.069","0.066","0.117","0.087","0.059","0.082","0.114","0.084","0.119","0.117","0.098","0.078","0.103","0.093","0.11","0.116","0.131","0.105","0.104","0.061","0.095","0.114","0.104","0.095","0.111","0.082","0.089","0.10593","1.09" -"INTL.33-12-MLT-BKWH.A"," Malta","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0" -"INTL.33-12-MNE-BKWH.A"," Montenegro","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","1.733","1.271","1.524","2.05","2.723","1.192","1.462","2.479","1.734","1.476","1.825","1.014","2.09187","1.78","1.8" -"INTL.33-12-NLD-BKWH.A"," Netherlands","0","0","0","0","0","0.003","0.003","0.001","0.002","0.037","0.119","0.079","0.119","0.091","0.1","0.087","0.079","0.09108","0.111","0.089","0.141","0.116","0.109","0.071","0.094","0.087","0.105","0.106","0.101","0.097","0.105","0.057","0.104","0.114","0.112","0.093","0.1","0.061","0.072","0.07326","0.05" -"INTL.33-12-MKD-BKWH.A"," North Macedonia","--","--","--","--","--","--","--","--","--","--","--","--","0.817","0.517","0.696","0.793","0.842","0.891","1.072","1.375","1.158","0.62","0.749","1.36","1.467","1.477","1.634","1","0.832","1.257","2.407","1.419","1.031","1.568","1.195","1.846","1.878","1.099","1.773","1.15236","1.24" -"INTL.33-12-NOR-BKWH.A"," Norway","82.717","91.876","91.507","104.704","104.895","101.464","95.321","102.341","107.919","117.369","119.933","109.032","115.505","118.024","110.398","120.315","102.823","108.677","114.546","120.237","140.4","119.258","128.078","104.425","107.693","134.331","118.175","132.319","137.654","124.03","116.257","119.78","141.189","127.551","134.844","136.662","142.244","141.651","138.202","123.66288","141.69" -"INTL.33-12-POL-BKWH.A"," Poland","2.326","2.116","1.528","1.658","1.394","1.833","1.534","1.644","1.775","1.593","1.403","1.411","1.492","1.473","1.716","1.868","1.912","1.941","2.286","2.133","2.085","2.302","2.256","1.654","2.06","2.179","2.022","2.328","2.13","2.351","2.9","2.313","2.02","2.421","2.165","1.814","2.117","2.552","1.949","1.93842","2.93" -"INTL.33-12-PRT-BKWH.A"," Portugal","7.873","4.934","6.82","7.897","9.609","10.512","8.364","9.005","12.037","5.72","9.065","8.952","4.599","8.453","10.551","8.26","14.613","12.97395","12.853","7.213","11.21","13.894","7.722","15.566","9.77","4.684","10.892","9.991","6.73","8.201","15.954","11.423","5.589","13.652","15.471","8.615","15.608","5.79","12.316","8.6526","13.96" -"INTL.33-12-ROU-BKWH.A"," Romania","12.506","12.605","11.731","9.934","11.208","11.772","10.688","11.084","13.479","12.497","10.87","14.107","11.583","12.64","12.916","16.526","15.597","17.334","18.69","18.107","14.63","14.774","15.886","13.126","16.348","20.005","18.172","15.806","17.023","15.379","19.684","14.581","11.945","14.807","18.618","16.467","17.848","14.349","17.48736","15.65289","15.53" -"INTL.33-12-SRB-BKWH.A"," Serbia","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","10.855","9.937","9.468","10.436","11.772","8.58","9.193","10.101","10.893","9.979","10.684","9.061","10.53261","10.07028","9.66" -"INTL.33-12-SVK-BKWH.A"," Slovakia","--","--","--","--","--","--","--","--","--","--","--","--","--","3.432","4.311","4.831","4.185","4.023","4.224","4.429","4.569","4.878","5.215","3.4452","4.059","4.592","4.355","4.406","4","4.324","5.184","3.211","3.687","4.329","3.762","3.701","4.302","4.321","3.506","4.27383","4.67" -"INTL.33-12-SVN-BKWH.A"," Slovenia","--","--","--","--","--","--","--","--","--","--","--","--","3.379","2.974","3.348","3.187","3.616","3.046","3.4","3.684","3.771","3.741","3.265","2.916","4.033","3.426","3.555","3.233","3.978","4.666","4.452","3.506","3.841","4.562","6.011","3.75","4.443","3.814","4.643","4.43421","5.24" -"INTL.33-12-ESP-BKWH.A"," Spain","29.16","21.64","25.99","26.696","31.088","30.895","26.105","27.016","34.76","19.046","25.16","27.01","18.731","24.133","27.898","22.881","39.404","34.43","33.665","22.634","29.274","40.617","22.691","40.643","31.359","18.209","25.699","27.036","23.13","26.147","41.576","30.07","20.192","36.45","38.815","27.656","35.77","18.007","33.743","24.23025","33.34" -"INTL.33-12-SWE-BKWH.A"," Sweden","58.133","59.006","54.369","62.801","67.106","70.095","60.134","70.95","69.016","70.911","71.778","62.603","73.588","73.905","58.508","67.421","51.2226","68.365","74.25","70.974","77.798","78.269","65.696","53.005","59.522","72.075","61.106","65.497","68.378","65.193","66.279","66.047","78.333","60.81","63.227","74.734","61.645","64.651","61.79","64.46583","71.6" -"INTL.33-12-CHE-BKWH.A"," Switzerland","32.481","35.13","35.974","35.069","29.871","31.731","32.576","34.328","35.437","29.477","29.497","31.756","32.373","35.416","38.678","34.817","28.458","33.70257","33.136","39.604","36.466","40.895","34.862","34.471","33.411","30.914","30.649","34.898","35.676","35.366","35.704","32.069","38.218","38.08","37.659","37.879","34.281","33.754","34.637","37.6596","40.62" -"INTL.33-12-TUR-BKWH.A"," Turkey","11.159","12.308","13.81","11.13","13.19","11.822","11.637","18.314","28.447","17.61","22.917","22.456","26.302","33.611","30.28","35.186","40.07","39.41784","41.80671","34.33","30.57","23.77","33.346","34.977","45.623","39.165","43.802","35.492","32.937","35.598","51.423","51.155","56.669","58.225","39.75","65.856","66.686","57.824","59.49","87.99714","77.39" -"INTL.33-12-GBR-BKWH.A"," United Kingdom","3.921","4.369","4.543","4.548","3.992","4.08","4.767","4.13","4.915","4.732","5.119","4.534","5.329","4.237","5.043","4.79","3.359","4.127","5.067","5.283","5.035","4.015","4.74","3.195","4.795","4.873","4.547","5.026","5.094","5.178","3.566","5.655","5.286","4.667","5.832","6.246","5.342","5.836","5.189","5.89941","7.64" +https://www.eia.gov/international/data/world/electricity/electricity-generation?pd=2&p=000000000000000000000000000000g&u=1&f=A&v=mapbubble&a=-&i=none&vo=value&t=R&g=000000000000002&l=73-1028i008017kg6368g80a4k000e0ag00gg0004g8g0ho00g000400008&l=72-00000000000000000000000000080000000000000000000g&s=315532800000&e=1609459200000&ev=false&,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +Report generated on: 01-06-2023 21:17:46,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +API,,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 +,hydroelectricity net generation (billion kWh),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +INTL.33-12-EURO-BKWH.A, Europe,"458,018","464,155","459,881","473,685","481,241","476,739","459,535","491,085","534,517","465,365","474,466","475,47","509,041","526,448","531,815","543,743","529,114164","543,845616","562,491501","566,861453","588,644662","584,806195","539,051405","503,7067","542,112443","542,974669","535,006084","538,449707","565,143111","561,761402","617,547148","540,926277","598,055253","629,44709","617,111295","613,079848","627,720566217","560,362524","616,5081462","606,5997419","644,1106599","628,1390143" +INTL.33-12-ALB-BKWH.A, Albania,"2,919","3,018","3,093","3,167","3,241","3,315","3,365","3,979","3,713","3,846","2,82","3,483","3,187","3,281","3,733","4,162","5,669","4,978","4,872","5,231","4,548","3,519","3,477","5,117","5,411","5,319","4,951","2,76","3,759","5,201","7,49133","4,09068","4,67775","6,88941","4,67676","5,83605","7,70418","4,47975","8,46648","5,15394","5,281","8,891943" +INTL.33-12-AUT-BKWH.A, Austria,"28,501","30,008","29,893","29,577","28,384","30,288","30,496","25,401","35,151","34,641","31,179","31,112","34,483","36,336","35,349","36,696","33,874","35,744","36,792","40,292","41,418","40,05","39,825","32,883","36,394","36,31","35,48","36,732","37,969","40,487","36,466","32,511","41,862","40,138","39,001","35,255","37,954","36,462","35,73","40,43655","41,9356096","38,75133" +INTL.33-12-BEL-BKWH.A, Belgium,"0,274","0,377","0,325","0,331","0,348","0,282","0,339","0,425","0,354","0,3","0,263","0,226","0,338","0,252","0,342","0,335","0,237","0,30195","0,38511","0,338","0,455","0,437","0,356","0,245","0,314","0,285","0,355","0,385","0,406","0,325","0,298","0,193","0,353","0,376","0,289","0,314","0,367","0,268","0,3135","0,302","0,2669","0,3933" +INTL.33-12-BIH-BKWH.A, Bosnia and Herzegovina,--,--,--,--,--,--,--,--,--,--,--,--,"3,374","2,343","3,424","3,607","5,104","4,608","4,511","5,477","5,043","5,129","5,215","4,456","5,919","5,938","5,798","3,961","4,818","6,177","7,946","4,343","4,173","7,164","5,876","5,495","5,585","3,7521","6,35382","6,02019","4,58","6,722" +INTL.33-12-BGR-BKWH.A, Bulgaria,"3,674","3,58","3,018","3,318","3,226","2,214","2,302","2,512","2,569","2,662","1,859","2,417","2,042","1,923","1,453","2,291","2,89","2,726","3,066","2,725","2,646","1,72","2,172","2,999","3,136","4,294","4,196","2,845","2,796","3,435","4,98168","2,84328","3,14622","3,99564","4,55598","5,59845","3,8412","2,79972","5,09553","2,929499","2,820398","4,819205" +INTL.33-12-HRV-BKWH.A, Croatia,--,--,--,--,--,--,--,--,--,--,--,--,"4,298","4,302","4,881","5,212","7,156","5,234","5,403","6,524","5,794","6,482","5,311","4,827","6,888","6,27","5,94","4,194","5,164","6,663","9,035","4,983","4,789","8,536","8,917","6,327","6,784","5,255","7,62399","5,87268","5,6624","7,1277" +INTL.33-12-CYP-BKWH.A, Cyprus,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +INTL.33-12-CZE-BKWH.A, Czechia,--,--,--,--,--,--,--,--,--,--,--,--,--,"1,355","1,445","1,982","1,949","1,68201","1,382","1,664","1,7404","2,033","2,467","1,369","1,999","2,356","2,525","2,068","2,004","2,405","2,775","1,95","2,107","2,704","1,909","1,779","1,983","1,852","1,615","1,98792","2,143884","2,40852" +INTL.33-12-DNK-BKWH.A, Denmark,"0,03","0,031","0,028","0,036","0,028","0,027","0,029","0,029","0,032","0,027","0,027","0,026","0,028","0,027","0,033","0,03","0,019","0,019","0,02673","0,031","0,03","0,028","0,032","0,021","0,027","0,023","0,023","0,028","0,026","0,019","0,021","0,017","0,017","0,013","0,015","0,01803","0,01927","0,017871","0,0148621","0,0172171","0,017064","0,016295" +INTL.33-12-EST-BKWH.A, Estonia,--,--,--,--,--,--,--,--,--,--,--,--,"0,001","0,001","0,003","0,002","0,002","0,003","0,004","0,004","0,005","0,007","0,006","0,013","0,022","0,022","0,014","0,021","0,028","0,032","0,027","0,029999","0,042","0,026","0,027","0,027","0,035","0,025999","0,0150003","0,0189999","0,03","0,0248" +INTL.33-12-FRO-BKWH.A, Faroe Islands,"0,049","0,049","0,049","0,049","0,049","0,049","0,049","0,049","0,062","0,071","0,074","0,074","0,083","0,073","0,075","0,075","0,069564","0,075066","0,076501","0,069453","0,075262","0,075195","0,095535","0,08483","0,093443","0,097986","0,099934","0,103407","0,094921","0,091482","0,06676","0,092","0,099","0,091","0,121","0,132","0,105","0,11","0,107","0,102","0,11","0,11" +INTL.33-12-FIN-BKWH.A, Finland,"10,115","13,518","12,958","13,445","13,115","12,211","12,266","13,658","13,229","12,9","10,75","13,065","14,956","13,341","11,669","12,796","11,742","12,11958","14,9","12,652","14,513","13,073","10,668","9,495","14,919","13,646","11,379","14,035","16,941","12,559","12,743","12,278001","16,666998","12,672","13,240001","16,583999","15,634127","14,609473","13,1369998","12,2454823","15,883","15,766" +INTL.33-12-CSK-BKWH.A, Former Czechoslovakia,"4,8","4,2","3,7","3,9","3,2","4,3",4,"4,853","4,355","4,229","3,919","3,119","3,602",--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,-- +INTL.33-12-SCG-BKWH.A, Former Serbia and Montenegro,--,--,--,--,--,--,--,--,--,--,--,--,"11,23","10,395","11,016","12,071","14,266","12,636","12,763","13,243","11,88","12,326","11,633","9,752","11,01","11,912",--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,-- +INTL.33-12-YUG-BKWH.A, Former Yugoslavia,"27,868","25,044","23,295","21,623","25,645","24,363","27,474","25,98","25,612","23,256","19,601","18,929",--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,-- +INTL.33-12-FRA-BKWH.A, France,"68,253","70,358","68,6","67,515","64,01","60,248","60,953","68,623","73,952","45,744","52,796","56,277","68,313","64,3","78,057","72,196","64,43","63,151","61,479","71,832","66,466","73,888","59,992","58,567","59,276","50,965","55,741","57,029","63,017","56,428","61,945","45,184","59,099","71,042","62,993","54,876","60,094","49,389","64,485","56,913891","62,06191","58,856657" +INTL.33-12-DEU-BKWH.A, Germany,--,--,--,--,--,--,--,--,--,--,--,"14,742","17,223","17,699","19,731","21,562","21,737","17,18343","17,044","19,451","21,515","22,506","22,893","19,071","20,866","19,442","19,808","20,957","20,239","18,841","20,678","17,323","21,331","22,66","19,31","18,664","20,214","19,985","17,694","19,731","18,322","19,252" +INTL.33-12-DDR-BKWH.A," Germany, East","1,658","1,718","1,748","1,683","1,748","1,758","1,767","1,726","1,719","1,551","1,389",--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,-- +INTL.33-12-DEUW-BKWH.A," Germany, West","17,125","17,889","17,694","16,713","16,434","15,354","16,526","18,36","18,128","16,482","15,769",--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,-- +INTL.33-12-GIB-BKWH.A, Gibraltar,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +INTL.33-12-GRC-BKWH.A, Greece,"3,396","3,398","3,551","2,331","2,852","2,792","3,222","2,768","2,354","1,888","1,751","3,068","2,181","2,26","2,573","3,494","4,305","3,84318","3,68","4,546","3,656","2,076","2,772","4,718","4,625","4,967","5,806","2,565","3,279","5,32","7,431","3,998","4,387","6,337","4,464","5,782","5,543","3,962","5,035","3,9798","3,343687","5,909225" +INTL.33-12-HUN-BKWH.A, Hungary,"0,111","0,166","0,158","0,153","0,179","0,153","0,152","0,167","0,167","0,156","0,176","0,192","0,156","0,164","0,159","0,161","0,205","0,21384","0,15345","0,179","0,176","0,184","0,192","0,169","0,203","0,2","0,184","0,208","0,211","0,226","0,184","0,215999","0,205999","0,207999","0,294001","0,226719","0,253308","0,213999","0,216","0,2129999","0,238","0,202379" +INTL.33-12-ISL-BKWH.A, Iceland,"3,053","3,085","3,407","3,588","3,738","3,667","3,846","3,918","4,169","4,217","4,162","4,162","4,267","4,421","4,47","4,635","4,724","5,15493","5,565","5,987","6,292","6,512","6,907","7,017","7,063","6,949","7,22","8,31","12,303","12,156","12,509999","12,381999","12,213999","12,747001","12,554","13,541","13,091609","13,891929","13,679377","13,32911","12,9196201","13,5746171" +INTL.33-12-IRL-BKWH.A, Ireland,"0,833","0,855","0,792","0,776","0,68","0,824","0,91","0,673","0,862","0,684","0,69","0,738","0,809","0,757","0,911","0,706","0,715","0,67122","0,907","0,838","0,838","0,59","0,903","0,592","0,624","0,625","0,717","0,66","0,959","0,893","0,593","0,699","0,795","0,593","0,701","0,798","0,674","0,685","0,687","0,87813","0,932656","0,750122" +INTL.33-12-ITA-BKWH.A, Italy,"44,997","42,782","41,216","40,96","41,923","40,616","40,626","39,05","40,205","33,647","31,31","41,817","41,778","41,011","44,212","37,404","41,617","41,18697","40,808","44,911","43,763","46,343","39,125","33,303","41,915","35,706","36,624","32,488","41,207","48,647","50,506","45,36477","41,45625","52,24626","57,95955","45,08163","42,00768","35,83701","48,29913","45,31824","47,551784","44,739" +INTL.33-12-XKS-BKWH.A, Kosovo,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,"0,075","0,119","0,154","0,104","0,095","0,142","0,149","0,139","0,243","0,177","0,27027","0,2079","0,262826","0,300635" +INTL.33-12-LVA-BKWH.A, Latvia,--,--,--,--,--,--,--,--,--,--,--,--,"2,498","2,846","3,272","2,908","1,841","2,922","2,99","2,729","2,791","2,805","2,438","2,243","3,078","3,293","2,671","2,706","3,078","3,422","3,487998","2,8568","3,677","2,838","1,953","1,841","2,522819","4,355513","2,4170639","2,0958919","2,5840101","2,6889293" +INTL.33-12-LTU-BKWH.A, Lithuania,--,--,--,--,--,--,--,--,--,--,--,--,"0,308","0,389","0,447","0,369","0,323","0,291","0,413","0,409","0,336","0,322","0,35","0,323","0,417","0,446193","0,393","0,417","0,398","0,42","0,535","0,475","0,419","0,516","0,395","0,346","0,45","0,597","0,427","0,34254","0,3006","0,3837" +INTL.33-12-LUX-BKWH.A, Luxembourg,"0,086","0,095","0,084","0,083","0,088","0,071","0,084","0,101","0,097","0,072","0,07","0,083","0,069","0,066","0,117","0,087","0,059","0,082","0,114","0,084","0,119","0,117","0,098","0,078","0,103","0,093","0,11","0,116","0,131","0,105","0,104","0,061","0,095","0,114","0,104","0,095","0,111","0,082","0,089","0,10593","0,091602","0,1068" +INTL.33-12-MLT-BKWH.A, Malta,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +INTL.33-12-MNE-BKWH.A, Montenegro,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,"1,733","1,271","1,524","2,05","2,723","1,192","1,462","2,479","1,734","1,476","1,825","1,014","1,693443","1,262781","0,867637","1,212652" +INTL.33-12-NLD-BKWH.A, Netherlands,0,0,0,0,0,"0,003","0,003","0,001","0,002","0,037","0,119","0,079","0,119","0,091","0,1","0,087","0,079","0,09108","0,111","0,089","0,141","0,116","0,109","0,071","0,094","0,087","0,105","0,106","0,101","0,097","0,105","0,057","0,104389","0,11431","0,112202","0,0927","0,100078","0,060759","0,0723481","0,074182","0,0462851","0,0838927" +INTL.33-12-MKD-BKWH.A, North Macedonia,--,--,--,--,--,--,--,--,--,--,--,--,"0,817","0,517","0,696","0,793","0,842","0,891","1,072","1,375","1,158","0,62","0,749","1,36","1,467","1,477","1,634",1,"0,832","1,257","2,407","1,419","1,031","1,568","1,195","1,846","1,878","1,099","1,773","1,15236","1,277144","1,451623" +INTL.33-12-NOR-BKWH.A, Norway,"82,717","91,876","91,507","104,704","104,895","101,464","95,321","102,341","107,919","117,369","119,933","109,032","115,505","118,024","110,398","120,315","102,823","108,677","114,546","120,237","140,4","119,258","128,078","104,425","107,693","134,331","118,175","132,319","137,654","124,03","116,257","119,78","141,189","127,551","134,844","136,662","142,244","141,651","138,202","123,66288","141,69",144 +INTL.33-12-POL-BKWH.A, Poland,"2,326","2,116","1,528","1,658","1,394","1,833","1,534","1,644","1,775","1,593","1,403","1,411","1,492","1,473","1,716","1,868","1,912","1,941","2,286","2,133","2,085","2,302","2,256","1,654","2,06","2,179","2,022","2,328","2,13","2,351","2,9","2,313","2,02","2,421","2,165","1,814","2,117","2,552","1,949","1,93842","2,118337","2,339192" +INTL.33-12-PRT-BKWH.A, Portugal,"7,873","4,934","6,82","7,897","9,609","10,512","8,364","9,005","12,037","5,72","9,065","8,952","4,599","8,453","10,551","8,26","14,613","12,97395","12,853","7,213","11,21","13,894","7,722","15,566","9,77","4,684","10,892","9,991","6,73","8,201","15,954","11,423","5,589","13,652","15,471","8,615","15,608","5,79","12,316","8,6526","12,082581","11,846464" +INTL.33-12-ROU-BKWH.A, Romania,"12,506","12,605","11,731","9,934","11,208","11,772","10,688","11,084","13,479","12,497","10,87","14,107","11,583","12,64","12,916","16,526","15,597","17,334","18,69","18,107","14,63","14,774","15,886","13,126","16,348","20,005","18,172","15,806","17,023","15,379","19,684","14,581","11,945","14,807","18,618","16,467","17,848","14,349","17,48736","15,580622","15,381243","17,376933" +INTL.33-12-SRB-BKWH.A, Serbia,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,"10,855","9,937","9,468","10,436","11,772","8,58","9,193","10,101","10,893","9,979","10,684","9,061","10,53261","9,457175","9,034496","11,284232" +INTL.33-12-SVK-BKWH.A, Slovakia,--,--,--,--,--,--,--,--,--,--,--,--,--,"3,432","4,311","4,831","4,185","4,023","4,224","4,429","4,569","4,878","5,215","3,4452","4,059","4,592","4,355","4,406",4,"4,324","5,184","3,211","3,687","4,329","3,762","3,701","4,302","4,321","3,506","4,27383","4,517","4,17" +INTL.33-12-SVN-BKWH.A, Slovenia,--,--,--,--,--,--,--,--,--,--,--,--,"3,379","2,974","3,348","3,187","3,616","3,046","3,4","3,684","3,771","3,741","3,265","2,916","4,033","3,426","3,555","3,233","3,978","4,666","4,452","3,506","3,841","4,562","6,011","3,75","4,443","3,814","4,643","4,43421","4,93406","4,711944" +INTL.33-12-ESP-BKWH.A, Spain,"29,16","21,64","25,99","26,696","31,088","30,895","26,105","27,016","34,76","19,046","25,16","27,01","18,731","24,133","27,898","22,881","39,404","34,43","33,665","22,634","29,274","40,617","22,691","40,643","31,359","18,209","25,699","27,036","23,13","26,147","41,576","30,07","20,192","36,45","38,815","27,656","35,77","18,007","33,743","24,23025","30,507","29,626" +INTL.33-12-SWE-BKWH.A, Sweden,"58,133","59,006","54,369","62,801","67,106","70,095","60,134","70,95","69,016","70,911","71,778","62,603","73,588","73,905","58,508","67,421","51,2226","68,365","74,25","70,974","77,798","78,269","65,696","53,005","59,522","72,075","61,106","65,497","68,378","65,193","66,279","66,047","78,333","60,81","63,227","74,734","61,645","64,651","61,79","64,46583","71,6","71,086" +INTL.33-12-CHE-BKWH.A, Switzerland,"32,481","35,13","35,974","35,069","29,871","31,731","32,576","34,328","35,437","29,477","29,497","31,756","32,373","35,416","38,678","34,817","28,458","33,70257","33,136","37,104","33,854","38,29","32,323","31,948","30,938","28,664","28,273","32,362","33,214","32,833","33,261","29,906","35,783","35,628","35,122","35,378","31,984","31,47968","32,095881","35,156989","37,867647","36,964485" +INTL.33-12-TUR-BKWH.A, Turkey,"11,159","12,308","13,81","11,13","13,19","11,822","11,637","18,314","28,447","17,61","22,917","22,456","26,302","33,611","30,28","35,186","40,07","39,41784","41,80671","34,33","30,57","23,77","33,346","34,977","45,623","39,165","43,802","35,492","32,937","35,598","51,423001","51,154999","56,668998","58,225","39,750001","65,856","66,685883","57,823851","59,490211","88,2094218","78,094369","55,1755392" +INTL.33-12-GBR-BKWH.A, United Kingdom,"3,921","4,369","4,543","4,548","3,992","4,08","4,767","4,13","4,915","4,732","5,119","4,534","5,329","4,237","5,043","4,79","3,359","4,127","5,117","5,336","5,085","4,055","4,78787","3,22767","4,844","4,92149","4,59315","5,0773","5,14119","5,22792","3,59138","5,69175","5,30965","4,70147","5,8878","6,29727","5,370412217","5,88187","5,44327","5,84628","6,75391","5,0149" +, Eurasia,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +INTL.33-12-MDA-BKWH.A, Moldova,--,--,--,--,--,--,--,--,--,--,--,--,"0,255","0,371","0,275","0,321","0,362","0,378","0,387","0,363","0,392","0,359","0,348","0,358","0,35","0,359","0,365","0,354","0,385","0,354","0,403","0,348","0,266","0,311","0,317","0,265","0,228","0,282","0,27324","0,29799","0,276","0,316" +INTL.33-12-UKR-BKWH.A, Ukraine,--,--,--,--,--,--,--,--,--,--,--,--,"7,725","10,929","11,997","9,853","8,546","9,757","15,756","14,177","11,161","11,912","9,531","9,146","11,635","12,239","12,757","10,042","11,397","11,817","13,02","10,837","10,374","13,663","8,393","5,343","7,594","8,856","10,32372","6,5083","7,5638","10,3326" diff --git a/doc/configtables/clustering.csv b/doc/configtables/clustering.csv index 5f52c222..e831ca84 100644 --- a/doc/configtables/clustering.csv +++ b/doc/configtables/clustering.csv @@ -1,4 +1,5 @@ ,Unit,Values,Description +focus_weights,,,Optionally specify the focus weights for the clustering of countries. For instance: `DE: 0.8` will distribute 80% of all nodes to Germany and 20% to the rest of the countries. simplify_network,,, -- to_substations,bool,"{'true','false'}","Aggregates all nodes without power injection (positive or negative, i.e. demand or generation) to electrically closest ones" -- algorithm,str,"One of {‘kmeans’, ‘hac’, ‘modularity‘}", diff --git a/doc/configtables/licenses.csv b/doc/configtables/licenses.csv index 3e25f5df..37f46cd0 100644 --- a/doc/configtables/licenses.csv +++ b/doc/configtables/licenses.csv @@ -5,7 +5,7 @@ "naturalearth/*",,,,,http://www.naturalearthdata.com/about/terms-of-use/ "NUTS_2013 _60M_SH/*","x","x",,"x",https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units "cantons.csv","x",,"x",,https://en.wikipedia.org/wiki/Data_codes_for_Switzerland -"EIA_hydro_generation _2000_2014.csv","x",,,,https://www.eia.gov/about/copyrights_reuse.php +"eia_hydro_annual_generation.csv","x",,,,https://www.eia.gov/about/copyrights_reuse.php "GEBCO_2014_2D.nc","x",,,,https://www.gebco.net/data_and_products/gridded_bathymetry_data/documents/gebco_2014_historic.pdf "hydro_capacities.csv","x",,,, "je-e-21.03.02.xls","x","x",,,https://www.bfs.admin.ch/bfs/en/home/fso/swiss-federal-statistical-office/terms-of-use.html diff --git a/doc/configtables/lines.csv b/doc/configtables/lines.csv index ec9ec007..3707d4a6 100644 --- a/doc/configtables/lines.csv +++ b/doc/configtables/lines.csv @@ -5,6 +5,7 @@ s_nom_max,MW,"float","Global upper limit for the maximum capacity of each extend max_extension,MW,"float","Upper limit for the extended capacity of each extendable line." length_factor,--,float,"Correction factor to account for the fact that buses are *not* connected by lines through air-line distance." under_construction,--,"One of {'zero': set capacity to zero, 'remove': remove completely, 'keep': keep with full capacity}","Specifies how to handle lines which are currently under construction." +reconnect_crimea,--,"true or false","Whether to reconnect Crimea to the Ukrainian grid" dynamic_line_rating,,, -- activate,bool,"true or false","Whether to take dynamic line rating into account" -- cutout,--,"Should be a folder listed in the configuration ``atlite: cutouts:`` (e.g. 'europe-2013-era5') or reference an existing folder in the directory ``cutouts``. Source module must be ERA5.","Specifies the directory where the relevant weather data ist stored." diff --git a/doc/configtables/sector.csv b/doc/configtables/sector.csv index 856ea074..599f1ccb 100644 --- a/doc/configtables/sector.csv +++ b/doc/configtables/sector.csv @@ -73,6 +73,7 @@ marginal_cost_storage,currency/MWh ,float,The marginal cost of discharging batte methanation,--,"{true, false}",Add option for transforming hydrogen and CO2 into methane using methanation. helmeth,--,"{true, false}",Add option for transforming power into gas using HELMETH (Integrated High-Temperature ELectrolysis and METHanation for Effective Power to Gas Conversion) coal_cc,--,"{true, false}",Add option for coal CHPs with carbon capture +coal_for_industry_cc,--,"{true, false}",Add option for carbon capture in integrated steel making (blast furnaces) dac,--,"{true, false}",Add option for Direct Air Capture (DAC) co2_vent,--,"{true, false}",Add option for vent out CO2 from storages to the atmosphere. allam_cycle,--,"{true, false}",Add option to include `Allam cycle gas power plants `_ diff --git a/doc/configtables/toplevel.csv b/doc/configtables/toplevel.csv index a27623bd..67954389 100644 --- a/doc/configtables/toplevel.csv +++ b/doc/configtables/toplevel.csv @@ -10,4 +10,3 @@ private,,, remote,,, -- ssh,--,,Optionally specify the SSH of a remote cluster to be synchronized. -- path,--,,Optionally specify the file path within the remote cluster to be synchronized. -focus_weights,,,Optionally specify the focus weights for the clustering of countries. For instance: `DE: 0.8` will distribute 80% of all nodes to Germany and 20% to the rest of the countries. diff --git a/doc/img/base.png b/doc/img/base.png index e1c3b6f2..071c4995 100644 Binary files a/doc/img/base.png and b/doc/img/base.png differ diff --git a/doc/img/elec_s_X.png b/doc/img/elec_s_X.png index e0f4f4a3..37c10479 100644 Binary files a/doc/img/elec_s_X.png and b/doc/img/elec_s_X.png differ diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 9b1381ce..5d0f3d1f 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -12,6 +12,8 @@ Upcoming Release * Updated Global Energy Monitor LNG terminal data to March 2023 version. +* Add option for carbon capture in integrated steelworks. + * For industry distribution, use EPRTR as fallback if ETS data is not available. * The minimum capacity for renewable generators when using the myopic option has been fixed. @@ -33,12 +35,27 @@ Upcoming Release * Split configuration to enable SMR and SMR CC. +* The configuration setting for country focus weights when clustering the + network has been moved from ``focus_weights:`` to ``clustering: + focus_weights:``. Backwards compatibility to old config files is maintained. + * The ``mock_snakemake`` function can now be used with a Snakefile from a different directory using the new ``root_dir`` argument. +* Merged option to extend geographical scope to Ukraine and Moldova. These + countries are excluded by default and is currently constrained to power-sector + only parts of the workflow. A special config file + `config/config.entsoe-all.yaml` was added as an example to run the workflow + with all ENTSO-E member countries (including observer members like Ukraine and + Moldova). Moldova can currently only be included in conjunction with Ukraine + due to the absence of demand data. The Crimean power system is manually + reconnected to the main Ukrainian grid with the configuration option + `reconnect_crimea`. + **Bugs and Compatibility** * A bug preventing custom powerplants specified in ``data/custom_powerplants.csv`` was fixed. (https://github.com/PyPSA/pypsa-eur/pull/732) +* Fix nodal fraction in ``add_existing_year`` when using distributed generators PyPSA-Eur 0.8.1 (27th July 2023) diff --git a/doc/retrieve.rst b/doc/retrieve.rst index f6c92092..06a07441 100644 --- a/doc/retrieve.rst +++ b/doc/retrieve.rst @@ -22,11 +22,11 @@ Rule ``retrieve_databundle`` Rule ``retrieve_cutout`` ============================ -.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3517949.svg - :target: https://doi.org/10.5281/zenodo.3517949 +.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.6382570.svg + :target: https://doi.org/10.5281/zenodo.6382570 Cutouts are spatio-temporal subsets of the European weather data from the `ECMWF ERA5 `_ reanalysis dataset and the `CMSAF SARAH-2 `_ solar surface radiation dataset for the year 2013. -They have been prepared by and are for use with the `atlite `_ tool. You can either generate them yourself using the ``build_cutouts`` rule or retrieve them directly from `zenodo `__ through the rule ``retrieve_cutout``. +They have been prepared by and are for use with the `atlite `_ tool. You can either generate them yourself using the ``build_cutouts`` rule or retrieve them directly from `zenodo `__ through the rule ``retrieve_cutout``. The :ref:`tutorial` uses a smaller cutout than required for the full model (30 MB), which is also automatically downloaded. .. note:: diff --git a/envs/environment.yaml b/envs/environment.yaml index fe2282bc..5ec368ac 100644 --- a/envs/environment.yaml +++ b/envs/environment.yaml @@ -11,7 +11,7 @@ dependencies: - pip - atlite>=0.2.9 -- pypsa==0.25.2 +- pypsa - linopy - dask diff --git a/rules/build_electricity.smk b/rules/build_electricity.smk index cc4f6f5e..873e7c3a 100644 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -206,10 +206,62 @@ rule build_ship_raster: "../scripts/build_ship_raster.py" +rule determine_availability_matrix_MD_UA: + input: + copernicus=RESOURCES + + "Copernicus_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif", + wdpa=RESOURCES + f"WDPA_{bYYYY}.gpkg", + wdpa_marine=RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine.gpkg", + gebco=lambda w: ( + "data/bundle/GEBCO_2014_2D.nc" + if "max_depth" in config["renewable"][w.technology].keys() + else [] + ), + ship_density=lambda w: ( + RESOURCES + "shipdensity_raster.tif" + if "ship_threshold" in config["renewable"][w.technology].keys() + else [] + ), + country_shapes=RESOURCES + "country_shapes.geojson", + offshore_shapes=RESOURCES + "offshore_shapes.geojson", + regions=lambda w: ( + RESOURCES + "regions_onshore.geojson" + if w.technology in ("onwind", "solar") + else RESOURCES + "regions_offshore.geojson" + ), + cutout=lambda w: "cutouts/" + + CDIR + + config["renewable"][w.technology]["cutout"] + + ".nc", + output: + availability_matrix=RESOURCES + "availability_matrix_MD-UA_{technology}.nc", + availability_map=RESOURCES + "availability_matrix_MD-UA_{technology}.png", + log: + LOGS + "determine_availability_matrix_MD_UA_{technology}.log", + threads: ATLITE_NPROCESSES + resources: + mem_mb=ATLITE_NPROCESSES * 5000, + conda: + "../envs/environment.yaml" + script: + "../scripts/determine_availability_matrix_MD_UA.py" + + +# Optional input when having Ukraine (UA) or Moldova (MD) in the countries list +if {"UA", "MD"}.intersection(set(config["countries"])): + opt = { + "availability_matrix_MD_UA": RESOURCES + + "availability_matrix_MD-UA_{technology}.nc" + } +else: + opt = {} + + rule build_renewable_profiles: params: renewable=config["renewable"], input: + **opt, base_network=RESOURCES + "networks/base.nc", corine=ancient("data/bundle/corine/g250_clc06_V18_5.tif"), natura=lambda w: ( @@ -355,6 +407,7 @@ rule add_electricity: else [], load=RESOURCES + "load.csv", nuts3_shapes=RESOURCES + "nuts3_shapes.geojson", + ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv", output: RESOURCES + "networks/elec.nc", log: @@ -374,7 +427,9 @@ rule simplify_network: params: simplify_network=config["clustering"]["simplify_network"], aggregation_strategies=config["clustering"].get("aggregation_strategies", {}), - focus_weights=config.get("focus_weights", None), + focus_weights=config["clustering"].get( + "focus_weights", config.get("focus_weights") + ), renewable_carriers=config["electricity"]["renewable_carriers"], max_hours=config["electricity"]["max_hours"], length_factor=config["lines"]["length_factor"], @@ -409,7 +464,9 @@ rule cluster_network: cluster_network=config["clustering"]["cluster_network"], aggregation_strategies=config["clustering"].get("aggregation_strategies", {}), custom_busmap=config["enable"].get("custom_busmap", False), - focus_weights=config.get("focus_weights", None), + focus_weights=config["clustering"].get( + "focus_weights", config.get("focus_weights") + ), renewable_carriers=config["electricity"]["renewable_carriers"], conventional_carriers=config["electricity"].get("conventional_carriers", []), max_hours=config["electricity"]["max_hours"], diff --git a/rules/build_sector.smk b/rules/build_sector.smk index 5a9e8646..dd49fc6f 100644 --- a/rules/build_sector.smk +++ b/rules/build_sector.smk @@ -269,7 +269,7 @@ rule build_biomass_potentials: biomass=config["biomass"], input: enspreso_biomass=HTTP.remote( - "https://cidportal.jrc.ec.europa.eu/ftp/jrc-opendata/ENSPRESO/ENSPRESO_BIOMASS.xlsx", + "https://zenodo.org/records/10356004/files/ENSPRESO_BIOMASS.xlsx", keep_local=True, ), nuts2="data/bundle-sector/nuts/NUTS_RG_10M_2013_4326_LEVL_2.geojson", # https://gisco-services.ec.europa.eu/distribution/v2/nuts/download/#nuts21 diff --git a/rules/retrieve.smk b/rules/retrieve.smk index ddb519be..75cf8062 100644 --- a/rules/retrieve.smk +++ b/rules/retrieve.smk @@ -2,6 +2,9 @@ # # SPDX-License-Identifier: MIT +import requests +from datetime import datetime, timedelta + if config["enable"].get("retrieve", "auto") == "auto": config["enable"]["retrieve"] = has_internet_access() @@ -224,6 +227,87 @@ if config["enable"]["retrieve"]: run: move(input[0], output[0]) +if config["enable"]["retrieve"]: + + # Downloading Copernicus Global Land Cover for land cover and land use: + # Website: https://land.copernicus.eu/global/products/lc + rule download_copernicus_land_cover: + input: + HTTP.remote( + "zenodo.org/record/3939050/files/PROBAV_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif", + static=True, + ), + output: + RESOURCES + "Copernicus_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif", + run: move(input[0], output[0]) + + +if config["enable"]["retrieve"]: + + current_month = datetime.now().strftime('%b') + current_year = datetime.now().strftime('%Y') + bYYYY = f"{current_month}{current_year}" + + def check_file_exists(url): + response = requests.head(url) + return response.status_code == 200 + + url = f'https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bYYYY}_Public.zip' + + if not check_file_exists(url): + prev_month = (datetime.now()-timedelta(30)).strftime('%b') + bYYYY = f"{prev_month}{current_year}" + assert check_file_exists(f'https://d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bYYYY}_Public.zip'), "The file does not exist." + + # Downloading protected area database from WDPA + # extract the main zip and then merge the contained 3 zipped shapefiles + # Website: https://www.protectedplanet.net/en/thematic-areas/wdpa + rule download_wdpa: + input: + HTTP.remote( + f"d1gam3xoknrgr2.cloudfront.net/current/WDPA_{bYYYY}_Public_shp.zip", + static=True, + keep_local=True, + ) + params: + zip=RESOURCES + f"WDPA_{bYYYY}_shp.zip", + folder=directory(RESOURCES + f"WDPA_{bYYYY}"), + output: + gpkg=RESOURCES + f"WDPA_{bYYYY}.gpkg", + run: + shell("cp {input} {params.zip}") + shell("unzip -o {params.zip} -d {params.folder}") + for i in range(3): + # vsizip is special driver for directly working with zipped shapefiles in ogr2ogr + layer_path = f"/vsizip/{params.folder}/WDPA_{bYYYY}_Public_shp_{i}.zip" + print(f"Adding layer {i+1} of 3 to combined output file.") + shell("ogr2ogr -f gpkg -update -append {output.gpkg} {layer_path}") + + + # Downloading Marine protected area database from WDPA + # extract the main zip and then merge the contained 3 zipped shapefiles + # Website: https://www.protectedplanet.net/en/thematic-areas/marine-protected-areas + rule download_wdpa_marine: + input: + HTTP.remote( + f"d1gam3xoknrgr2.cloudfront.net/current/WDPA_WDOECM_{bYYYY}_Public_marine_shp.zip", + static=True, + keep_local=True, + ), + params: + zip=RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine.zip", + folder=directory(RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine"), + output: + gpkg=RESOURCES + f"WDPA_WDOECM_{bYYYY}_marine.gpkg", + run: + shell("cp {input} {params.zip}") + shell("unzip -o {params.zip} -d {params.folder}") + for i in range(3): + # vsizip is special driver for directly working with zipped shapefiles in ogr2ogr + layer_path = f"/vsizip/{params.folder}/WDPA_WDOECM_{bYYYY}_Public_marine_shp_{i}.zip" + print(f"Adding layer {i+1} of 3 to combined output file.") + shell("ogr2ogr -f gpkg -update -append {output.gpkg} {layer_path}") + if config["enable"]["retrieve"]: diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index 2bb0a6bb..e626f456 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -84,6 +84,7 @@ It further adds extendable ``generators`` with **zero** capacity for import logging from itertools import product +from typing import Dict, List import geopandas as gpd import numpy as np @@ -255,6 +256,7 @@ def load_powerplants(ppl_fn): "bioenergy": "biomass", "ccgt, thermal": "CCGT", "hard coal": "coal", + "natural gas": "OCGT", } return ( pd.read_csv(ppl_fn, index_col=0, dtype={"bus": "str"}) @@ -279,11 +281,13 @@ def shapes_to_shapes(orig, dest): return transfer -def attach_load(n, regions, load, nuts3_shapes, countries, scaling=1.0): +def attach_load(n, regions, load, nuts3_shapes, ua_md_gdp, countries, scaling=1.0): substation_lv_i = n.buses.index[n.buses["substation_lv"]] regions = gpd.read_file(regions).set_index("name").reindex(substation_lv_i) opsd_load = pd.read_csv(load, index_col=0, parse_dates=True).filter(items=countries) + ua_md_gdp = pd.read_csv(ua_md_gdp, dtype={"name": "str"}).set_index("name") + logger.info(f"Load data scaled with scalling factor {scaling}.") opsd_load *= scaling @@ -291,6 +295,7 @@ def attach_load(n, regions, load, nuts3_shapes, countries, scaling=1.0): def upsample(cntry, group): l = opsd_load[cntry] + if len(group) == 1: return pd.DataFrame({group.index[0]: l}) nuts3_cntry = nuts3.loc[nuts3.country == cntry] @@ -305,6 +310,9 @@ def attach_load(n, regions, load, nuts3_shapes, countries, scaling=1.0): # relative factors 0.6 and 0.4 have been determined from a linear # regression on the country to continent load data factors = normed(0.6 * normed(gdp_n) + 0.4 * normed(pop_n)) + if cntry in ["UA", "MD"]: + # overwrite factor because nuts3 provides no data for UA+MD + factors = normed(ua_md_gdp.loc[group.index, "GDP_PPP"].squeeze()) return pd.DataFrame( factors.values * l.values[:, np.newaxis], index=l.index, @@ -710,7 +718,17 @@ def attach_extendable_generators(n, costs, ppl, carriers): ) -def attach_OPSD_renewables(n, tech_map): +def attach_OPSD_renewables(n: pypsa.Network, tech_map: Dict[str, List[str]]) -> None: + """ + Attach renewable capacities from the OPSD dataset to the network. + + Args: + - n: The PyPSA network to attach the capacities to. + - tech_map: A dictionary mapping fuel types to carrier names. + + Returns: + - None + """ tech_string = ", ".join(sum(tech_map.values(), [])) logger.info(f"Using OPSD renewable capacities for carriers {tech_string}.") @@ -735,7 +753,26 @@ def attach_OPSD_renewables(n, tech_map): n.generators.p_nom_min.update(gens.bus.map(caps).dropna()) -def estimate_renewable_capacities(n, year, tech_map, expansion_limit, countries): +def estimate_renewable_capacities( + n: pypsa.Network, year: int, tech_map: dict, expansion_limit: bool, countries: list +) -> None: + """ + Estimate a different between renewable capacities in the network and + reported country totals from IRENASTAT dataset. Distribute the difference + with a heuristic. + + Heuristic: n.generators_t.p_max_pu.mean() * n.generators.p_nom_max + + Args: + - n: The PyPSA network. + - year: The year of optimisation. + - tech_map: A dictionary mapping fuel types to carrier names. + - expansion_limit: Boolean value from config file + - countries: A list of country codes to estimate capacities for. + + Returns: + - None + """ if not len(countries) or not len(tech_map): return @@ -752,7 +789,10 @@ def estimate_renewable_capacities(n, year, tech_map, expansion_limit, countries) for ppm_technology, techs in tech_map.items(): tech_i = n.generators.query("carrier in @techs").index - stats = capacities.loc[ppm_technology].reindex(countries, fill_value=0.0) + if ppm_technology in capacities.index.get_level_values("Technology"): + stats = capacities.loc[ppm_technology].reindex(countries, fill_value=0.0) + else: + stats = pd.Series(0.0, index=countries) country = n.generators.bus[tech_i].map(n.buses.country) existent = n.generators.p_nom[tech_i].groupby(country).sum() missing = stats - existent @@ -825,6 +865,7 @@ if __name__ == "__main__": snakemake.input.regions, snakemake.input.load, snakemake.input.nuts3_shapes, + snakemake.input.ua_md_gdp, params.countries, params.scaling_factor, ) diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py index 1474b004..1842166b 100644 --- a/scripts/add_existing_baseyear.py +++ b/scripts/add_existing_baseyear.py @@ -88,7 +88,9 @@ def add_existing_renewables(df_agg): ] cfs = n.generators_t.p_max_pu[gens].mean() cfs_key = cfs / cfs.sum() - nodal_fraction.loc[n.generators.loc[gens, "bus"]] = cfs_key.values + nodal_fraction.loc[n.generators.loc[gens, "bus"]] = cfs_key.groupby( + n.generators.loc[gens, "bus"] + ).sum() nodal_df = df.loc[n.buses.loc[elec_buses, "country"]] nodal_df.index = elec_buses diff --git a/scripts/base_network.py b/scripts/base_network.py index b453ab5f..1929c59a 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -366,6 +366,25 @@ def _apply_parameter_corrections(n, parameter_corrections): df.loc[inds, attr] = r[inds].astype(df[attr].dtype) +def _reconnect_crimea(lines): + logger.info("Reconnecting Crimea to the Ukrainian grid.") + lines_to_crimea = pd.DataFrame( + { + "bus0": ["3065", "3181", "3181"], + "bus1": ["3057", "3055", "3057"], + "v_nom": [300, 300, 300], + "num_parallel": [1, 1, 1], + "length": [140, 120, 140], + "carrier": ["AC", "AC", "AC"], + "underground": [False, False, False], + "under_construction": [False, False, False], + }, + index=["Melitopol", "Liubymivka left", "Luibymivka right"], + ) + + return pd.concat([lines, lines_to_crimea]) + + def _set_electrical_parameters_lines(lines, config): v_noms = config["electricity"]["voltages"] linetypes = config["lines"]["types"] @@ -450,12 +469,12 @@ def _remove_dangling_branches(branches, buses): ) -def _remove_unconnected_components(network): +def _remove_unconnected_components(network, threshold=6): _, labels = csgraph.connected_components(network.adjacency_matrix(), directed=False) component = pd.Series(labels, index=network.buses.index) component_sizes = component.value_counts() - components_to_remove = component_sizes.iloc[1:] + components_to_remove = component_sizes.loc[component_sizes < threshold] logger.info( f"Removing {len(components_to_remove)} unconnected network components with less than {components_to_remove.max()} buses. In total {components_to_remove.sum()} buses." @@ -699,6 +718,9 @@ def base_network( lines = _load_lines_from_eg(buses, eg_lines) transformers = _load_transformers_from_eg(buses, eg_transformers) + if config["lines"].get("reconnect_crimea", True) and "UA" in config["countries"]: + lines = _reconnect_crimea(lines) + lines = _set_electrical_parameters_lines(lines, config) transformers = _set_electrical_parameters_transformers(transformers, config) links = _set_electrical_parameters_links(links, config, links_p_nom) diff --git a/scripts/build_electricity_demand.py b/scripts/build_electricity_demand.py index 781ad991..f7b6cddd 100755 --- a/scripts/build_electricity_demand.py +++ b/scripts/build_electricity_demand.py @@ -155,7 +155,7 @@ def copy_timeslice(load, cntry, start, stop, delta, fn_load=None): ].values -def manual_adjustment(load, fn_load, powerstatistics): +def manual_adjustment(load, fn_load, powerstatistics, countries): """ Adjust gaps manual for load data from OPSD time-series package. @@ -278,6 +278,14 @@ def manual_adjustment(load, fn_load, powerstatistics): load, "LU", "2019-02-05 20:00", "2019-02-06 19:00", Delta(weeks=-1) ) + if "UA" in countries: + copy_timeslice( + load, "UA", "2013-01-25 14:00", "2013-01-28 21:00", Delta(weeks=1) + ) + copy_timeslice( + load, "UA", "2013-10-28 03:00", "2013-10-28 20:00", Delta(weeks=1) + ) + return load @@ -298,8 +306,22 @@ if __name__ == "__main__": load = load_timeseries(snakemake.input[0], years, countries, powerstatistics) + if "UA" in countries: + # attach load of UA (best data only for entsoe transparency) + load_ua = load_timeseries(snakemake.input[0], "2018", ["UA"], False) + snapshot_year = str(snapshots.year.unique().item()) + time_diff = pd.Timestamp("2018") - pd.Timestamp(snapshot_year) + load_ua.index -= ( + time_diff # hack indices (currently, UA is manually set to 2018) + ) + load["UA"] = load_ua + # attach load of MD (no time-series available, use 2020-totals and distribute according to UA): + # https://www.iea.org/data-and-statistics/data-browser/?country=MOLDOVA&fuel=Energy%20consumption&indicator=TotElecCons + if "MD" in countries: + load["MD"] = 6.2e6 * (load_ua / load_ua.sum()) + if snakemake.params.load["manual_adjustments"]: - load = manual_adjustment(load, snakemake.input[0], powerstatistics) + load = manual_adjustment(load, snakemake.input[0], powerstatistics, countries) if load.empty: logger.warning("Build electricity demand time series is empty.") diff --git a/scripts/build_hydro_profile.py b/scripts/build_hydro_profile.py index bed666f2..65cc22b7 100644 --- a/scripts/build_hydro_profile.py +++ b/scripts/build_hydro_profile.py @@ -26,7 +26,7 @@ Relevant Settings Inputs ------ -- ``data/bundle/EIA_hydro_generation_2000_2014.csv``: Hydroelectricity net generation per country and year (`EIA `_) +- ``data/bundle/eia_hydro_annual_generation.csv``: Hydroelectricity net generation per country and year (`EIA `_) .. image:: img/hydrogeneration.png :scale: 33 % @@ -72,12 +72,14 @@ cc = coco.CountryConverter() def get_eia_annual_hydro_generation(fn, countries): # in billion kWh/a = TWh/a - df = pd.read_csv(fn, skiprows=2, index_col=1, na_values=[" ", "--"]).iloc[1:, 1:] + df = pd.read_csv( + fn, skiprows=2, index_col=1, na_values=[" ", "--"], decimal="," + ).iloc[1:, 1:] df.index = df.index.str.strip() former_countries = { "Former Czechoslovakia": dict( - countries=["Czech Republic", "Slovakia"], start=1980, end=1992 + countries=["Czechia", "Slovakia"], start=1980, end=1992 ), "Former Serbia and Montenegro": dict( countries=["Serbia", "Montenegro"], start=1992, end=2005 diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py index ed7cf434..3a1c525e 100644 --- a/scripts/build_renewable_profiles.py +++ b/scripts/build_renewable_profiles.py @@ -287,6 +287,14 @@ if __name__ == "__main__": else: availability = cutout.availabilitymatrix(regions, excluder, **kwargs) + # For Moldova and Ukraine: Overwrite parts not covered by Corine with + # externally determined available areas + if "availability_matrix_MD_UA" in snakemake.input.keys(): + availability_MDUA = xr.open_dataarray( + snakemake.input["availability_matrix_MD_UA"] + ) + availability.loc[availability_MDUA.coords] = availability_MDUA + area = cutout.grid.to_crs(3035).area / 1e6 area = xr.DataArray( area.values.reshape(cutout.shape), [cutout.coords["y"], cutout.coords["x"]] diff --git a/scripts/build_shapes.py b/scripts/build_shapes.py index fa707ad5..35bae147 100644 --- a/scripts/build_shapes.py +++ b/scripts/build_shapes.py @@ -174,8 +174,8 @@ def nuts3(country_shapes, nuts3, nuts3pop, nuts3gdp, ch_cantons, ch_popgdp): pd.MultiIndex.from_tuples(pop.pop("unit,geo\\time").str.split(",")) ) .loc["THS"] - .applymap(lambda x: pd.to_numeric(x, errors="coerce")) - .fillna(method="bfill", axis=1) + .map(lambda x: pd.to_numeric(x, errors="coerce")) + .bfill(axis=1) )["2014"] gdp = pd.read_table(nuts3gdp, na_values=[":"], delimiter=" ?\t", engine="python") @@ -184,8 +184,8 @@ def nuts3(country_shapes, nuts3, nuts3pop, nuts3gdp, ch_cantons, ch_popgdp): pd.MultiIndex.from_tuples(gdp.pop("unit,geo\\time").str.split(",")) ) .loc["EUR_HAB"] - .applymap(lambda x: pd.to_numeric(x, errors="coerce")) - .fillna(method="bfill", axis=1) + .map(lambda x: pd.to_numeric(x, errors="coerce")) + .bfill(axis=1) )["2014"] cantons = pd.read_csv(ch_cantons) diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index dc4e8c4e..0f3f351f 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -16,8 +16,7 @@ Relevant Settings clustering: cluster_network: aggregation_strategies: - - focus_weights: + focus_weights: solving: solver: @@ -271,7 +270,7 @@ def distribute_clusters(n, n_clusters, focus_weights=None, solver_name="cbc"): ) opt = po.SolverFactory(solver_name) - if not opt.has_capability("quadratic_objective"): + if solver_name == "appsi_highs" or not opt.has_capability("quadratic_objective"): logger.warning( f"The configured solver `{solver_name}` does not support quadratic objectives. Falling back to `ipopt`." ) @@ -466,9 +465,13 @@ if __name__ == "__main__": params = snakemake.params solver_name = snakemake.config["solving"]["solver"]["name"] + solver_name = "appsi_highs" if solver_name == "highs" else solver_name n = pypsa.Network(snakemake.input.network) + # remove integer outputs for compatibility with PyPSA v0.26.0 + n.generators.drop("n_mod", axis=1, inplace=True, errors='ignore') + exclude_carriers = params.cluster_network["exclude_carriers"] aggregate_carriers = set(n.generators.carrier) - set(exclude_carriers) conventional_carriers = set(params.conventional_carriers) diff --git a/scripts/determine_availability_matrix_MD_UA.py b/scripts/determine_availability_matrix_MD_UA.py new file mode 100644 index 00000000..8d10f45d --- /dev/null +++ b/scripts/determine_availability_matrix_MD_UA.py @@ -0,0 +1,156 @@ +# -*- coding: utf-8 -*- +# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors +# +# SPDX-License-Identifier: MIT + +import functools +import logging +import time + +import atlite +import fiona +import geopandas as gpd +import matplotlib.pyplot as plt +import numpy as np +from _helpers import configure_logging +from atlite.gis import shape_availability +from rasterio.plot import show + +logger = logging.getLogger(__name__) + + +def get_wdpa_layer_name(wdpa_fn, layer_substring): + """ + Get layername from file "wdpa_fn" whose name contains "layer_substring". + """ + l = fiona.listlayers(wdpa_fn) + return [_ for _ in l if layer_substring in _][0] + + +if __name__ == "__main__": + if "snakemake" not in globals(): + from _helpers import mock_snakemake + + snakemake = mock_snakemake( + "determine_availability_matrix_MD_UA", technology="solar" + ) + configure_logging(snakemake) + + nprocesses = None # snakemake.config["atlite"].get("nprocesses") + noprogress = not snakemake.config["atlite"].get("show_progress", True) + config = snakemake.config["renewable"][snakemake.wildcards.technology] + + cutout = atlite.Cutout(snakemake.input.cutout) + regions = ( + gpd.read_file(snakemake.input.regions).set_index("name").rename_axis("bus") + ) + buses = regions.index + + excluder = atlite.ExclusionContainer(crs=3035, res=100) + + corine = config.get("corine", {}) + if "grid_codes" in corine: + # Land cover codes to emulate CORINE results + if snakemake.wildcards.technology == "solar": + codes = [20, 30, 40, 50, 60, 90, 100] + elif snakemake.wildcards.technology == "onwind": + codes = [20, 30, 40, 60, 100] + elif snakemake.wildcards.technology == "offwind-ac": + codes = [80, 200] + elif snakemake.wildcards.technology == "offwind-dc": + codes = [80, 200] + else: + assert False, "technology not supported" + + excluder.add_raster( + snakemake.input.copernicus, codes=codes, invert=True, crs="EPSG:4326" + ) + if "distance" in corine and corine.get("distance", 0.0) > 0.0: + # Land cover codes to emulate CORINE results + if snakemake.wildcards.technology == "onwind": + codes = [50] + else: + assert False, "technology not supported" + + buffer = corine["distance"] + excluder.add_raster( + snakemake.input.copernicus, codes=codes, buffer=buffer, crs="EPSG:4326" + ) + + if config["natura"]: + wdpa_fn = ( + snakemake.input.wdpa_marine + if "offwind" in snakemake.wildcards.technology + else snakemake.input.wdpa + ) + layer = get_wdpa_layer_name(wdpa_fn, "polygons") + wdpa = gpd.read_file( + wdpa_fn, + bbox=regions.geometry, + layer=layer, + ).to_crs(3035) + if not wdpa.empty: + excluder.add_geometry(wdpa.geometry) + + layer = get_wdpa_layer_name(wdpa_fn, "points") + wdpa_pts = gpd.read_file( + wdpa_fn, + bbox=regions.geometry, + layer=layer, + ).to_crs(3035) + wdpa_pts = wdpa_pts[wdpa_pts["REP_AREA"] > 1] + wdpa_pts["buffer_radius"] = np.sqrt(wdpa_pts["REP_AREA"] / np.pi) * 1000 + wdpa_pts = wdpa_pts.set_geometry( + wdpa_pts["geometry"].buffer(wdpa_pts["buffer_radius"]) + ) + if not wdpa_pts.empty: + excluder.add_geometry(wdpa_pts.geometry) + + if "max_depth" in config: + # lambda not supported for atlite + multiprocessing + # use named function np.greater with partially frozen argument instead + # and exclude areas where: -max_depth > grid cell depth + func = functools.partial(np.greater, -config["max_depth"]) + excluder.add_raster(snakemake.input.gebco, codes=func, crs=4236, nodata=-1000) + + if "min_shore_distance" in config: + buffer = config["min_shore_distance"] + excluder.add_geometry(snakemake.input.country_shapes, buffer=buffer) + + if "max_shore_distance" in config: + buffer = config["max_shore_distance"] + excluder.add_geometry( + snakemake.input.country_shapes, buffer=buffer, invert=True + ) + + if "ship_threshold" in config: + shipping_threshold = config["ship_threshold"] * 8760 * 6 + func = functools.partial(np.less, shipping_threshold) + excluder.add_raster( + snakemake.input.ship_density, codes=func, crs=4326, allow_no_overlap=True + ) + + kwargs = dict(nprocesses=nprocesses, disable_progressbar=noprogress) + if noprogress: + logger.info("Calculate landuse availabilities...") + start = time.time() + availability = cutout.availabilitymatrix(regions, excluder, **kwargs) + duration = time.time() - start + logger.info(f"Completed availability calculation ({duration:2.2f}s)") + else: + availability = cutout.availabilitymatrix(regions, excluder, **kwargs) + + regions_geometry = regions.to_crs(3035).geometry + band, transform = shape_availability(regions_geometry, excluder) + fig, ax = plt.subplots(figsize=(4, 8)) + gpd.GeoSeries(regions_geometry.unary_union).plot(ax=ax, color="none") + show(band, transform=transform, cmap="Greens", ax=ax) + plt.axis("off") + plt.savefig(snakemake.output.availability_map, bbox_inches="tight", dpi=500) + + # Limit results only to buses for UA and MD + buses = regions.loc[regions["country"].isin(["UA", "MD"])].index.values + availability = availability.sel(bus=buses) + + # Save and plot for verification + availability.to_netcdf(snakemake.output.availability_matrix) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index f585ad04..ccfa3352 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -145,6 +145,8 @@ def define_spatial(nodes, options): spatial.coal = SimpleNamespace() spatial.coal.nodes = ["EU coal"] spatial.coal.locations = ["EU"] + spatial.coal.industry = ["coal for industry"] + spatial.coal.industry_cc = ["coal for industry CC"] # lignite spatial.lignite = SimpleNamespace() @@ -2003,7 +2005,11 @@ def add_heat(n, costs): space_heat_demand = demand * w_space[sec][node] # normed time profile of space heat demand 'space_pu' (values between 0-1), # p_max_pu/p_min_pu of retrofitting generators - space_pu = (space_heat_demand / space_heat_demand.max()).to_frame(name=node) + space_pu = ( + (space_heat_demand / space_heat_demand.max()) + .to_frame(name=node) + .fillna(0) + ) # minimum heat demand 'dE' after retrofitting in units of original heat demand (values between 0-1) dE = retro_data.loc[(ct, sec), ("dE")] @@ -2015,6 +2021,9 @@ def add_heat(n, costs): * floor_area_node / ((1 - dE) * space_heat_demand.max()) ) + if space_heat_demand.max() == 0: + capital_cost = capital_cost.apply(lambda b: 0 if b == np.inf else b) + # number of possible retrofitting measures 'strengths' (set in list at config.yaml 'l_strength') # given in additional insulation thickness [m] # for each measure, a retrofitting generator is added at the node @@ -2907,15 +2916,56 @@ def add_industry(n, costs): + mwh_coal_per_mwh_coke * industrial_demand["coke"].sum() ) / nhours + n.madd( + "Bus", + spatial.coal.industry, + location=spatial.coal.locations, + carrier="coal for industry", + unit="MWh_LHV", + ) + n.madd( "Load", - spatial.coal.nodes, - suffix=" for industry", - bus=spatial.coal.nodes, + spatial.coal.industry, + bus=spatial.coal.industry, carrier="coal for industry", p_set=p_set, ) + n.madd( + "Link", + spatial.coal.industry, + bus0=spatial.coal.nodes, + bus1=spatial.coal.industry, + bus2="co2 atmosphere", + carrier="coal for industry", + p_nom_extendable=True, + p_min_pu=1.0, + efficiency=1.0, + efficiency2=costs.at["coal", "CO2 intensity"], + ) + + if options.get("coal_for_industry_cc", False): + n.madd( + "Link", + spatial.coal.industry_cc, + bus0=spatial.coal.nodes, + bus1=spatial.coal.industry, + bus2="co2 atmosphere", + bus3=spatial.co2.nodes, + carrier="coal for industry CC", + p_min_pu=1.0, + p_nom_extendable=True, + capital_cost=costs.at["cement capture", "fixed"] + * costs.at["coal", "CO2 intensity"], + efficiency=0.9, + efficiency2=costs.at["coal", "CO2 intensity"] + * (1 - costs.at["cement capture", "capture_rate"]), + efficiency3=costs.at["coal", "CO2 intensity"] + * costs.at["cement capture", "capture_rate"], + lifetime=costs.at["cement capture", "lifetime"], + ) + def add_waste_heat(n): # TODO options? diff --git a/scripts/simplify_network.py b/scripts/simplify_network.py index 251f4bd8..d12062c2 100644 --- a/scripts/simplify_network.py +++ b/scripts/simplify_network.py @@ -536,6 +536,9 @@ if __name__ == "__main__": n = pypsa.Network(snakemake.input.network) Nyears = n.snapshot_weightings.objective.sum() / 8760 + # remove integer outputs for compatibility with PyPSA v0.26.0 + n.generators.drop("n_mod", axis=1, inplace=True, errors='ignore') + n, trafo_map = simplify_network_to_380(n) technology_costs = load_costs(