Commit Graph

434 Commits

Author SHA1 Message Date
Fabian Neumann
006a68b3cf add option for retrofitted pipe capacity per CH4 capacity 2021-08-04 10:35:02 +02:00
Fabian Neumann
473d57a957 clean build_gas_network 2021-08-04 10:28:50 +02:00
Fabian Neumann
6a86a04743 add gas network spatial management 2021-08-04 09:48:23 +02:00
Leon
85111e2ae3
Omitting unnecessary constraints on the CHP units (#155)
* Omitting unnecessary constraints on the CHP units

All CHPs in pypsa-eur-sec are operating on the backpressure line and this set of extra constraints to ensure working in the operational space of the CHPs is hence not necessary at the moment.

* remove chp constraints function call
2021-08-04 09:20:09 +02:00
lisazeyen
554b55ff3d
Update solve_network.py
fix bug in pipe retroftting constraint
2021-07-13 08:50:15 +02:00
Fabian Neumann
3f43656a92 call define_spatial 2021-07-12 12:37:37 +02:00
Fabian Neumann
d1298fa93d use spatial namespace to manage biomass transport resolution 2021-07-12 12:31:18 +02:00
Fabian Neumann
2563d1277a spatially-explicit biomass potentials from ENSPRESO (NUTS2) 2021-07-11 17:52:32 +02:00
lisazeyen
9039b130fa
bug fix to avoid same link names for DAX 2021-07-09 15:30:21 +02:00
Fabian Neumann
36fdde7887 correctly name co2 submarine pipeline! 2021-07-09 14:36:13 +02:00
lisazeyen
0127c47035
Update prepare_sector_network.py
bug fix when calculating urban central heat demand
2021-07-09 13:56:44 +02:00
Fabian Neumann
d58a7f86a4 allow copperplated carbon capture to be distributed freely to co2 stores 2021-07-09 13:22:00 +02:00
Fabian Neumann
cd99089628 account for underwater fraction 2021-07-09 13:10:43 +02:00
Fabian Neumann
2b204c45e4 run define_spatial in __main__ 2021-07-09 12:51:48 +02:00
Fabian Neumann
4f9d2f9d5f add concept for management of spatial resolutions 2021-07-09 12:50:40 +02:00
Fabian Neumann
62bba87cda add co2 network topology
Co-authored-by: lisazeyen <lisa.zeyen@web.de>
2021-07-09 10:44:29 +02:00
lisazeyen
76f36d0a1a add option to take today's district heating share 2021-07-08 14:41:34 +02:00
Fabian Neumann
a98870e159 correction for .madd() and call co2_network 2021-07-07 18:07:57 +02:00
Fabian Neumann
d976a8faf7 add CO2 network [first draft] 2021-07-07 17:58:47 +02:00
Fabian Neumann
2bd9a3993b fix typo 2021-07-06 18:36:04 +02:00
Fabian Neumann
67ee6cb86e first step towards agriculture, forestry and fishing 2021-07-06 18:32:35 +02:00
martavp
3a6a1f90ab
Sensitivity e nom max (#143)
* Update .gitignore

* include e_nom_max sensitivity

* remove change in gitignore

* Update doc/release_notes.rst

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-07-06 17:12:39 +02:00
Fabian Neumann
c3f554e442
Update scripts/prepare_sector_network.py 2021-07-06 10:54:34 +02:00
Fabian Neumann
195cabba0c merge master 2021-07-06 09:55:41 +02:00
martavp
103ad49671 Enable use of lower generators clustering than network clustering 2021-07-05 12:19:43 +02:00
martavp
82e9a48b74 Add oil consumed in shipping as a load to EU oil bus 2021-07-05 11:29:02 +02:00
Fabian Neumann
ad3da28117 small follow-up to merge 2021-07-03 13:03:47 +02:00
Fabian Neumann
732046dba0 merge master 2021-07-03 12:46:09 +02:00
Fabian Neumann
81b009e062 minor code cleaning 2021-07-02 15:08:06 +02:00
Fabian Neumann
89eccd4f70 merge master 2021-07-02 15:00:19 +02:00
Fabian Neumann
fd1121af4a add rule for build_biomass_transport_costs 2021-07-02 11:07:35 +02:00
Fabian Neumann
e97c4dd3c0 merge master 2021-07-02 10:12:43 +02:00
Fabian Neumann
4ebbd294ec apply suggestions from code review 2021-07-02 09:34:24 +02:00
Fabian Neumann
fa8f7887f9
Update scripts/prepare_sector_network.py 2021-07-02 09:31:41 +02:00
lisazeyen
ca685a10af
add home battery storage and inverter costs (#99)
* add home battery storage and inverter costs

* Update prepare_sector_network.py

* add release note

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-07-01 20:16:12 +02:00
Fabian Neumann
1fc1d2a17d
Revision complete (#139)
* ammonia_production: minor cleaning and move into __main__ (#106)

* biomass_potentials: code cleaning and automatic country index inferral (#107)

* Revision: build energy totals (#111)

* blacken

* energy_totals: preliminaries

* energy_totals: update build_swiss

* energy_totals: update build_eurostat

* energy_totals: update build_idees

* energy_totals: update build_energy_totals

* energy_totals: update build_eea_co2

* energy_totals: update build_eurostat_co2

* energy_totals: update build_co2_totals

* energy_totals: update build_transport_data

* energy_totals: add tqdm progressbar to idees

* energy_totals: adjust __main__ section

* energy_totals: handle inputs via Snakefile and config

* energy_totals: handle data and emissions year via config

* energy_totals: fix reading in eurostat for different years

* energy_totals: fix erroneous drop duplicates
This caused problems for waste management in HU and SI

* energy_totals: make scope selection of CO2 or GHG a config option

* Revision: build industrial production per country (#114)

* industry-ppc: format

* industry-ppc: rewrite for performance

* industry-ppc: move reference year to config

* industry-ppct: tidy up and format (#115)

* remove stale industry demand rules (#116)

* industry-epc: rewrite for performance (#117)

* Revision: industrial distribution key (#118)

* industry-distribution: first tidying

* industry-distribution: first tidying

* industry-distribution: fix syntax

* Revision: industrial energy demand per node today (#119)

* industry-epn: minor code cleaning

* industry-epn: remove accidental artifact

* industry-epn: remove accidental artifact II

* industry-ppn: code cleaning (#120)

* minor code cleaning (#121)

* Revision: industry sector ratios (#122)

* sector-ratios: basic reformatting

* sector-ratios: add new read_excel function that filters year already

* sector-ratios: rename jrc to idees

* sector-ratios: rename conv_factor to toe_to_MWh

* sector-ratios: modularise into functions

* Move overriding of component attributes to function and into data (#123)

* move overriding of component attributes to central function and store in separate folder

* fix return of helper.override_component_attrs

* prepare: fix accidental syntax error

* override_component_attrs: bugfix that aligns with pypsa components

* Revision: build population layout (#108)

* population_layouts: move inside __main__ and blacken

* population_layouts: misc code cleaning and multiprocessing

* population_layouts: fix fill_values assignment of urban fractions

* population_layouts: bugfig for UK-GB naming ambiguity

* population_layouts: sort countries alphabetically for better overview

* config: change path to atlite cutout

* Revision: build clustered population layouts (#112)

* population_layouts: move inside __main__ and blacken

* population_layouts: misc code cleaning and multiprocessing

* population_layouts: fix fill_values assignment of urban fractions

* population_layouts: bugfig for UK-GB naming ambiguity

* population_layouts: sort countries alphabetically for better overview

* cl_pop_layout: blacken

* cl_pop_layout: turn GeoDataFrame into GeoSeries + code cleaning

* cl_pop_layout: add fraction column which is repeatedly calculated downstream

* Revision: build various heating-related time series (#113)

* population_layouts: move inside __main__ and blacken

* population_layouts: misc code cleaning and multiprocessing

* population_layouts: fix fill_values assignment of urban fractions

* population_layouts: bugfig for UK-GB naming ambiguity

* population_layouts: sort countries alphabetically for better overview

* cl_pop_layout: blacken

* cl_pop_layout: turn GeoDataFrame into GeoSeries + code cleaning

* gitignore: add .vscode

* heating_profiles: update to new atlite and move into __main__

* heating_profiles: remove extra cutout

* heating_profiles: load regions with .buffer(0) and remove clean_invalid_geometries

* heating_profiles: load regions with .buffer(0) before squeeze()

* heating_profiles: account for transpose of dataarray

* heating_profiles: account for transpose of dataarray in add_exiting_baseyear

* Reduce verbosity of Snakefile (2) (#128)

* tidy Snakefile light

* Snakefile: fix indents

* Snakefile: add missing RDIR

* tidy config by removing quotes and expanding lists (#109)

* bugfix: reorder squeeze() and buffer()

* plot/summary: cosmetic changes including: (#131)

- matplotlibrc for default style and backend
- remove unused config options
- option to configure geomap colors
- option to configure geomap bounds

* solve: align with pypsa-eur using ilopf (#129)

* tidy myopic code scripts (#132)

* use mock_snakemake from pypsa-eur (#133)

* Snakefile: add benchmark files to each rule

* Snakefile: only run build_retro_cost if endogenously optimised

* Snakefile: remove old {network} wildcard constraints

* WIP: Revision: prepare_sector_network (#124)

* population_layouts: move inside __main__ and blacken

* population_layouts: misc code cleaning and multiprocessing

* population_layouts: fix fill_values assignment of urban fractions

* population_layouts: bugfig for UK-GB naming ambiguity

* population_layouts: sort countries alphabetically for better overview

* cl_pop_layout: blacken

* cl_pop_layout: turn GeoDataFrame into GeoSeries + code cleaning

* move overriding of component attributes to central function and store in separate folder

* prepare: sort imports and remove six dependency

* prepare: remove add_emission_prices

* prepare: remove unused set_line_s_max_pu
This is a function from prepare_network

* prepare: remove unused set_line_volume_limit
This is a PyPSA-Eur function from prepare_network

* prepare: tidy add_co2limit

* remove six dependency

* prepare: tidy code first batch

* prepare: extend override_component_attrs to avoid hacky madd

* prepare: remove hacky madd() for individual components

* prepare: tidy shift function

* prepare: nodes and countries from n.buses not pop_layout

* prepare: tidy loading of pop_layout

* prepare: fix prepare_costs function

* prepare: optimise loading of traffic data

* prepare: move localizer into generate_periodic profiles

* prepare: some formatting of transport data

* prepare: eliminate some code duplication

* prepare: fix remove_h2_network
- only try to remove EU H2 store if it exists
- remove readding nodal Stores because they are never removed

* prepare: move cost adjustment to own function

* prepare: fix a syntax error

* prepare: add investment_year to get() assuming global variable

* prepare: move co2_totals out of prepare_data()

* Snakefile: remove unused prepare_sector_network inputs

* prepare: move limit p/s_nom of lines/links into function

* prepare: tidy add_co2limit file handling

* Snakefile: fix tabs

* override_component_attrs: add n/a defaults

* README: Add network picture to make scope clear

* README: Fix date of preprint (was too optimistic...)

* prepare: move some more config options to config.yaml

* prepare: runtime bugfixes

* fix benchmark path

* adjust plot ylims

* add unit attribute to bus, correct cement capture efficiency

* bugfix: land usage constrained missed inplace operation

Co-authored-by: Tom Brown <tom@nworbmot.org>

* add release notes

* remove old fix_branches() function

* deps: make geopy optional, remove unused imports

* increase default BarConvTol

* get ready for upcoming PyPSA release

* re-remove ** bug

* amend release notes

Co-authored-by: Tom Brown <tom@nworbmot.org>
2021-07-01 20:09:04 +02:00
lisazeyen
e7b55d034e modify constraint for pipe retrofitting according to H2 backbone strategy 2021-06-23 14:55:21 +02:00
lisazeyen
e2d23949bb add different colors for new and retrofitted H2 pipes 2021-06-23 14:54:33 +02:00
lisazeyen
8f58218080 recalculate pipe capacity based on the pipe diameter 2021-06-23 14:53:54 +02:00
lisazeyen
97f041e82c adjust summary and plot functions 2021-06-21 12:36:40 +02:00
lisazeyen
c963d356f7 add existing methane pipe lines and option to H2 retrofitting, update to new atlite version 2021-06-21 12:36:06 +02:00
lisazeyen
447c2119a6 add constraint for retrofitting existing gas pipes to H2 pipes 2021-06-21 12:34:47 +02:00
lisazeyen
17a1153648 comment functions, remove not used input 2021-06-21 12:34:08 +02:00
lisazeyen
e4dad6429d update for atlite version 0.2.4 2021-06-21 07:59:57 +02:00
lisazeyen
c5b3551687 fix spelling mistake 2021-06-18 09:45:51 +02:00
lisazeyen
4d913c9a93 split EU gas, EU biogas and EU gas for industry into gas bus for each cluster 2021-06-18 09:45:29 +02:00
lisazeyen
dbec103593 add mock_snakemake from pypsa-eur 2021-06-18 09:41:18 +02:00
martavp
0a92d23698 Make transformation of Steel and Aluminum production depends on year
Previously, the transformation of the Steel and Aluminum production was assumed to occur overnight.
This commit enables the definition of a transformation path via the config.yaml file.
This requires adding the {planning_horizon} to the input and output file name of the following rules:
build_industrial_production_per_country_tomorrow
build_industrial_production_per_node
build_industry_energy_demand_per_node
prepare_sector_network
2021-06-17 16:13:05 +02:00
martavp
a57135b086 Split colours for H2 in Industry and H2 in shipping when plotting balances.
When plotting the balance for H2, the rename dictionary merges all the demands containing H2.
This commit disables such merging and keeps different colours for H2 in shipping and H2 in industry. This is useful when one wants to look at the H2 balance and have an overview of where the H2 is consumed in the model.
2021-06-17 15:12:10 +02:00
lisazeyen
6cde3c2b57 add mock_snakemake function to pypsa-eur-sec 2021-06-17 09:36:36 +02:00
lisazeyen
feefaa3d41 Merge branch 'master' into retrofit-gas-pipelines 2021-06-17 06:38:47 +02:00
martavp
e2354c18ac Add fictitious load to account for non-transformed shipping emissions
The share of shipping demand that is transformed is defined now for different years to be used with the myopic code.
The carbon emission from the remaining share is treated as a negative load on the atmospheric carbon dioxide bus, just like aviation and land transport emissions.
2021-06-16 17:52:42 +02:00
lisazeyen
846f57fde6 add script for biomass transport costs. Converts JRC-EU-Times transport cost' 2021-06-11 14:36:56 +02:00
Fabian Neumann
32365312da
retro: fix renaming u_values subsectors and btype (#127)
by not looping the .replace() across all columns of the dataframe.

Circumvents: TypeError: Cannot compare types 'ndarray(dtype=float64)' and 'str'
2021-05-25 15:51:38 +02:00
Fabian Neumann
bea8194b7b
prepare: add costs for biogas upgrading (#126)
Co-authored-by: lisazeyen <lisa.zeyen@web.de>

Co-authored-by: lisazeyen <lisa.zeyen@web.de>
2021-05-25 09:42:01 +02:00
lisazeyen
0e3d21f5a4
add EU oil bus already when adding land transport to be able to run the model without industry and avoid warning of missing bus. Add a check for scaling down total electricity demand to avoid warning of invalid value in double_scalar (#100) 2021-05-25 09:03:02 +02:00
Leon
e367f8ae11
Fix error when running without the industry sector (#96)
Fixing that the code stops with an error if running without the industry sector, e.g. only including electricity and heat. When the industry sector is not included, balances_df.index.levels[0] does not include "process emissions". Using the XOR operator "^" does then add it instead of removing it when compared to the co2_carriers list. The XOR operator does only work as intended, i.e. excluding the three emission-related strings, when these strings are already in the original list. The proposed change fixes the issue.
2021-05-24 22:11:24 +02:00
Fabian Neumann
555002a35b fixup: remove remaining instances of {network} wildcard from recent PR 2021-05-19 13:57:44 +02:00
lisazeyen
33f7f5026e Merge branch 'master' into retrofit-gas-pipelines 2021-05-12 15:20:49 +02:00
Tom Brown
8bfb1490c1
Merge branch 'master' into retro-updated 2021-04-30 18:12:20 +02:00
Tom Brown
e28ddbd710 config: rename vary in vary_space_heat_exogenously to reduce
Since the factor reduces demand with default positive sign.
2021-04-30 17:57:16 +02:00
Fabian Neumann
3e3001455a
address FutureWarning regarding set operations on pd.Index (#103) 2021-04-29 17:11:10 +02:00
Fabian Neumann
a156d44f28
remove unused {network} wildcard (#104) 2021-04-29 16:52:35 +02:00
Fabian Neumann
184aee76ca make yaml loading safe 2021-04-27 09:54:52 +02:00
lisazeyen
b979441462
Import sys (#98)
* import sys package and remove unnecassary imports

* add encoding when reading csv files to the old (and soon depreciated) build_retro_cost script
2021-04-23 11:26:53 +02:00
Leon
55eb722ead
Make code more readable; remove misleading function arguments and add necessary ones (#94)
* Make code more readable; remove misleading function arguments and add necessary ones

* Update scripts/build_energy_totals.py

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-04-23 11:26:38 +02:00
lisazeyen
7af2941156 rename space heat demand reduction in config.yaml and prepare_sector_network.py script, adjust exogenously assumed space heat demand reductions to more conservative assumptions 2021-04-19 17:20:52 +02:00
lisazeyen
50f02f64e8 build_gas_network: first steps to map current gas infrastructure to PyPSA-Eur-Sec 2021-04-15 14:21:48 +02:00
Tom Brown
1cbef8e61f Add fictitious load to account for land transport ICE emissions
Recently ICE vehicles were added, but the emissions were not accounted
for. Now, like aviation emissions, they are added as a negative load
to the "co2 atmosphere" bus.
2021-03-04 18:20:23 +01:00
lisazeyen
36685bd016 update retro script to include ventilation, thermal bridges and heat gains. Add necessary input files in the Snakefile, remove no longer needed file 2021-02-24 16:51:58 +01:00
lisazeyen
088c5ab805 adjust make summary functions to work without industry sector 2021-02-23 15:42:43 +01:00
lisazeyen
8cabeb5871 update master branch
Merge branch 'master' of https://github.com/PyPSA/pypsa-eur-sec
2021-02-23 10:16:35 +01:00
martavp
b264f2947d
Merge branch 'master' into master 2021-02-04 09:15:03 +01:00
Tom Brown
31ed6ebc16 Correct heat output of central gas and solid biomass CHP with CC
The heat output from the carbon capture (CC) was being subtracted from
the CHP rather than the heat input.

Since the heat output and heat input are the same in the DEA
technology database (but at different temperatures), this bug has no
consequence, but still better to correct it.
2021-02-02 13:16:17 +01:00
Tom Brown
54a28db84f Change name of liquid hydrocarbon bus from Fischer-Tropsch to oil
Reasoning: we can also have fossil and biomass liquid hydrocarbons, as
well as production from the Fischer-Tropsch process, particularly for
simulations before 2050.
2021-01-26 10:55:38 +01:00
Tom Brown
4fd164f73c config.yaml: Remove battery and H2 Stores from PyPSA-Eur
I.e. what's taken over from PyPSA-Eur in config["pypsa_eur"] from
"Store" is [].

PyPSA-Eur-Sec adds its own batteries and H2 Stores.
2021-01-25 14:17:31 +01:00
Tom Brown
0dc9196b76
Merge pull request #90 from martavp/alter-cost-potential
Add a factor to alter cost or capacity potential via the config file
2021-01-18 18:19:24 +01:00
Tom Brown
b133cd6656
Merge pull request #89 from martavp/distribute_CO2budget
Distribute CO2 budget among the planning horizons for the myopic option
2021-01-18 18:17:15 +01:00
martavp
fd6239db5c allowing factor to alter the cost or p_nom_max 2021-01-14 13:51:10 +01:00
martavp
e180931ce1 Move ploting of carbon budget distribution to plot_summary.py 2021-01-14 10:06:29 +01:00
martavp
918d803c0d Add commented line regarding hack for unicode error in snakemake 2021-01-12 11:57:22 +01:00
martavp
fcc54bada3 Calculate and save cumulative costs for the myopic approach
Creates an additional file in results/csvs including the cumulative costs with different social discount rates
2021-01-12 10:58:00 +01:00
martavp
4a681749d7 Add function build_carbon_budget()
For the myopic method, based on the carbon budget indicated in the config file (sector_opts), a CO2 limit is calculated for every planning_horizon following an exponential or beta decay.  A file with CO2 limit in every planning_horizon and a plot showing historical and planned CO2 emissions
are saved in the results
2021-01-12 10:57:29 +01:00
martavp
ceba265c0a build_eea_co2() now reads version23 of UNFCCC inventory.
**This requires updating to UNFCCC_v23.csv in the data bundle**

This enables that the same function is used to read emissions in 2018, which are assumed to remain constant in 2019 and 2020 and subtracted from carbon budget (estimated from 2018 on).

I checked and 1990 emissions calculated with UNFCCC_v23 are very similar to those calculated with UNFCCC_v21 (<1% differences in all values at EU level).
Some countries show higher deviations, mainly in domestic aviation and navigation. I guess because those values started to be reported later and v23 should include more accurate values.
2021-01-12 10:57:09 +01:00
martavp
6a7b1d5450 Fix unicode error due to dash before sawdust
A quick fix to https://github.com/PyPSA/pypsa-eur-sec/issues/79
2021-01-12 10:53:22 +01:00
martavp
c623b82b39 Make explicit solver_dir=tmpdir
Running the rule solve_network in the university cluster, I was getting a "No space left on device" error. Making solve_dir=tmpdir by default avoids this error and makes it easier to identify any problem with temp files
2021-01-12 10:51:12 +01:00
martavp
b7b7407756 Adapt nomenclature from "YearCommissioned" to "DataIn"
This was breaking add_existing_baseyear.py and it is now fixed. Column name for commissioning year in powerplantmatching has changed. Now "DataIn" is used as column name, also when renewable capacities per country are added to the power plants dataframe
2021-01-12 10:46:30 +01:00
martavp
b98235c1f1 Allow specifying an option to alter the capital cost of carriers by a factor indicated in the config file, eg: solar+c0.5
This is almost a direct copy PyPSA-Eur #167
https://github.com/PyPSA/pypsa-eur/pull/167

A factor altering the maximum capacity (p_nom_max) can also be specified by e.g. solar+p3

One should be careful when using this for solar because the factor is applied to all the generators whose carrier includes the string 'solar' (i.e., it is applied to both utility and rooftop solar)

I would suggest implementing 'solar utility' and 'solar rooftop' as carriers, since this can be useful for other selecting processes. Is there is any reason for keeping 'solar' as a carrier for 'solar utility'?

The previous way of increasing maximum capacity via the config file (e.g 'solar3') is still present in the code.
2021-01-04 10:13:30 +01:00
martavp
7c464f166b Calculate and save cumulative costs for the myopic approach
Creates an additional file in results/csvs including the cumulative costs with different social discount rates
2020-12-30 15:56:34 +01:00
martavp
3457d4ee38 Add function build_carbon_budget()
For the myopic method, based on the carbon budget indicated in the config file (sector_opts), a CO2 limit is calculated for every planning_horizon following an exponential or beta decay.  A file with CO2 limit in every planning_horizon and a plot showing historical and planned CO2 emissions
are saved in the results
2020-12-30 15:55:08 +01:00
martavp
7479ba0424 Fix unicode error due to dash before sawdust
A quick fix to https://github.com/PyPSA/pypsa-eur-sec/issues/79
2020-12-30 12:14:08 +01:00
martavp
5db196f92a build_eea_co2() now reads version23 of UNFCCC inventory.
**This requires updating to UNFCCC_v23.csv in the data bundle**

This enables that the same function is used to read emissions in 2018, which are assumed to remain constant in 2019 and 2020 and subtracted from carbon budget (estimated from 2018 on).

I checked and 1990 emissions calculated with UNFCCC_v23 are very similar to those calculated with UNFCCC_v21 (<1% differences in all values at EU level).
Some countries show higher deviations, mainly in domestic aviation and navigation. I guess because those values started to be reported later and v23 should include more accurate values.
2020-12-29 11:31:00 +01:00
martavp
ec5efcc93d Make explicit solver_dir=tmpdir
Running the rule solve_network in the university cluster, I was getting a "No space left on device" error. Making solve_dir=tmpdir by default avoids this error and makes it easier to identify any problem with temp files
2020-12-28 15:39:05 +01:00
martavp
3ae8021cb6 Adapt nomenclature from "YearCommissioned" to "DataIn"
This was breaking add_existing_baseyear.py and it is now fixed. Column name for commissioning year in powerplantmatching has changed. Now "DataIn" is used as column name, also when renewable capacities per country are added to the power plants dataframe
2020-12-26 17:47:32 +01:00
Tom Brown
b2c40dfe30 Replace old "industry CC" assumption with DEA "cement capture" 2020-12-09 18:47:50 +01:00
Tom Brown
19a7a1a684 Implement DAC properly with electricity and heat demand
Before it just had a fixed marginal cost. Now it uses DEA assumptions
for heat, electricity and capital costs.

This necessitates locating it somewhere concrete. Heat is taken from
urban central or decentral buses.
2020-12-09 18:19:57 +01:00
Tom Brown
0d96ec1de4 Use DEA capture rates for CHP CC rather than default rate 2020-12-09 17:26:29 +01:00
Tom Brown
608c9a5ac5 Replace gas and solid biomass CHP CCS with CHP + DEA CC
Use DEA assumptions for post-combustion carbon capture.

Also rename CCS as CC whenever only carbon capture is involved, since
sequestration (or CCU) is a separate step.
2020-12-09 16:38:49 +01:00
Tom Brown
3ff669b07b Move CO2 sequestration potential and costs to config.yaml 2020-12-09 15:36:45 +01:00
Tom Brown
b8f1f30183 Make code compatible with PyPSA-Eur v0.3.0
Only change was to remove the Store-Link-Bus combinations for
batteries and H2 storage from PyPSA-Eur, since they are implemented
with different names, costs and voltage level in PyPSA-Eur-Sec.

Removals are now done in a more transparent way in the config.yaml.
2020-12-09 15:18:01 +01:00
Tom Brown
098281b432 Correct central CHP from extraction to back pressure
The assumptions for c_b and c_v and eta were arranged assuming
extraction plants (like the coal CHP in DEA).

However, if you look in DEA assumptions at "09b Wood Pellets Medium"
(used for solid biomass CHP) and "Gas turbine simple cycle (large)"
(used for gas CHP) they are not extraction plants but back pressure
plants.

The back pressure coefficient in DEA c_b is simply

c_b = name plate electricity efficiency / name plate heat efficiency

both measured when both heat and electricity are produced at maximum.

For the extraction plants, the efficiency was measured in condensation
mode, i.e. no heat production.
2020-12-07 12:32:53 +01:00
Tom Brown
47a618f385 Replace large CHP 2-link feasibility diagram with single link
In almost 99.5% of cases the CHP dispatches along the backpressure
line where heat output is proportional to electricity output.

So we can switch to a single link to avoid the burden of modelling the
full electricity-heat feasibility space of CHPs.

This only applies to large CHPs in district heating networks.
2020-12-07 10:48:24 +01:00
Tom Brown
21c4fd4761
Merge pull request #80 from PyPSA/retro-new-pandas
Retro new pandas
2020-12-04 16:17:10 +01:00
lisazeyen
0187d4d1d4 make retro script work with newer version of pandas 2020-12-02 13:34:33 +01:00
lisazeyen
57aea1db35 drop H2 and battery buses from pypsa-eur 2020-12-02 13:03:13 +01:00
lisazeyen
de33ed3eb5 update mocksnakemake for testing 2020-12-02 12:48:11 +01:00
Tom Brown
2c49b8e3c3 config: Move heat pump sink temp from script to config.yaml 2020-12-02 11:51:27 +01:00
Tom Brown
1ea31f0e57 Redo investment-year-dependent exogenous retrofitting parameter
Specify as dictionary, use get_parameter to get correct value.

Also remove old parameter "space_heating_fraction" since this is
superceded by the new exogenous retro code.
2020-12-01 14:41:11 +01:00
Tom Brown
974155bd46 Merge branch 'master' into retro 2020-11-30 17:07:43 +01:00
Tom Brown
17bf0dfbb1 prepare_costs: use default lifetime from config.yaml
Rather than hard-coding 25 years.
2020-11-30 17:01:14 +01:00
Tom Brown
7cfce2e324
Merge pull request #76 from PyPSA/country-subsets
energy_totals: only fix 'BA' if in list of countries
2020-11-30 16:43:15 +01:00
Tom Brown
90e1d75df6 land transport: allow share of fossil-FCEV-EV to change over time
Allow share of land transport to be set exogenously in config.yaml.
2020-11-30 16:20:26 +01:00
Tom Brown
abbaa0d098 Move CO2 budgets from data/co2_budget.csv to dict in config.yaml
Strategy is too keep as much of configuration in config.yaml as
possible.

We also aim to allow exogenous investment-year-dependent
configurations to be done in a similar manner (e.g. share of district
heating or FCEV transport).
2020-11-30 13:21:38 +01:00
Fabian Neumann
a143ab7122 energy_totals: only fix 'BA' if in list of countries 2020-11-24 13:44:02 +01:00
lisazeyen
e511dac148 fix bug for urban_fraction factor, rewrite pattern for defining country, location and temporal resolution, add more comments for endogenously retrofitting 2020-11-11 18:18:56 +01:00
Tom Brown
65944e20ca plot_network: Fix bugs in plotting of today's network 2020-10-28 18:47:28 +01:00
Tom Brown
a613da6031 make_summary: Don't add back line costs for LV for PyPSA-Eur > 0.2.0
PyPSA-Eur now includes HVAC and HVDC line costs with LV option.

So don't add them back to costs afterwards.
2020-10-28 18:24:54 +01:00
Tom Brown
9721dccc0f Make micro CHP optional, option to reduce non-NH3 basic chemicals
Also add option to limit extension of HVAC and HVDC transmission
lines.

Also fix bug that option to limit solar & wind potential was bypassed.
2020-10-28 18:21:28 +01:00
lisazeyen
63f1e99c8b remove unnecessary variables when adding endogenously retrofitting 2020-10-21 19:19:38 +02:00
lisazeyen
1e2895023b add script for building retro costs per country and sector, add retrofitting parameters to config.yaml 2020-10-21 16:04:27 +02:00
lisazeyen
d1282ba315 add option for endogenously retrofitting 2020-10-21 15:21:26 +02:00
Tom Brown
989495ce79 prepare_sector_network: Type of new busmap index and values to str
Otherwise they're read in as integers and the mapping fails.
2020-10-21 14:31:37 +02:00
lisazeyen
301d74f059 add option for exogenously retrofitting, space heat demand is reduced before adding losses in DH 2020-10-21 14:30:26 +02:00
lisazeyen
75ff2d19ee move transport data input path to Snakefile 2020-10-21 13:45:49 +02:00
lisazeyen
0563c986a2 modify mocksnakemake for testing 2020-10-21 13:35:34 +02:00
Tom Brown
f0ef0e1136
Merge pull request #70 from eb5194/master
compatibility with pypsa-eur PR: clustermaps to csv
2020-10-21 13:01:17 +02:00
lisazeyen
b4fbb47d29 fix bug when adding biomass industry demand, add option to remove biomass transport and have only single EU biomass node 2020-10-21 07:21:09 +02:00
lisazeyen
13cae7d66f drop nan values to avoid runtime error when removing todays electricity demand 2020-10-20 14:19:07 +02:00
lisazeyen
ae9c0d9530 prepare_sector_network: split industry demand for biomass to single nodes 2020-10-20 14:08:17 +02:00
lisazeyen
651a7ff693 add biomass transport, split potential for solid biomass to nodes, add costs for upgrading biogas to gas 2020-10-20 13:46:39 +02:00
lisazeyen
b4f1c570d6 move input data path for emobility/transport data to snakemake input 2020-10-20 10:13:02 +02:00
lisazeyen
2b9ac511b5 update mocksnakemake for testing 2020-10-20 09:34:45 +02:00
Tom Brown
e8b923e076 industry: subtract today's ind elec demand, add back new demand
Since today's industrial electricity demand is distributed by
population and GDP, subtract this from the regular electricity demand
(which already has space/water heating subtracted).

Now regular electricity demand is only non-heating electricity demand
in residential and tertiary sectors.

Add back new industry electricity demand at the correct locations, as
determined using the hotmaps database.
2020-10-12 14:56:41 +02:00
Tom Brown
80cbe98630 industry: add current nodal electricity demand to subtract later 2020-10-12 13:26:21 +02:00
Tom Brown
f2b347334d industry: build nodal energy demand from nodal production 2020-10-12 12:20:04 +02:00
Tom Brown
f0937e203b industry: separate code for distribution key from nodal production
This allows us to reuse the key for today's nodal energy demand from
industry.
2020-10-12 12:07:49 +02:00
Tom Brown
90f5349b7d Use hotmaps industrial database for distribution in each country
I.e. per sector geographical distribution of industrial facilities
within each country.

Drop facilities outside Europe and with no geocoordinates.

Use ETS emissions as a distribution key; where emissions data is
missing, substitute with an average for that sector and that country
(strong assumption).
2020-10-05 20:04:04 +02:00
eb5194
5dabdac288 add_existing_baseyear: read input file as .csv 2020-10-02 12:21:31 +02:00
eb5194
9fac6f5392 prepare_sector_network: read input file as .csv 2020-10-02 12:20:55 +02:00
Tom Brown
b862bb95cd Fix H2 underground potentials from TWh to MWh; simplify H2 data 2020-09-25 16:23:45 +02:00
Tom Brown
de52711700 Fix calculation of solar rooftop potentials for "m" clusters
I.e. when the generators are clustered to the "simplified" network
resolution, but the grid is clustered further, e.g. by using the
clusters = 37m "m" option.
2020-09-25 15:25:41 +02:00
Tom Brown
6b964865e7
Merge pull request #69 from PyPSA/salt_cavern_potential
Salt cavern potential
2020-09-22 20:19:29 +02:00
Tom Brown
a1904886ac
Merge branch 'master' into distribution 2020-09-22 20:18:21 +02:00
Tom Brown
98435d7fc6
Merge pull request #68 from PyPSA/yaml_loader
read config.yaml for testing with yaml.safe_load()
2020-09-22 20:17:32 +02:00
lisazeyen
7972637334 add upper energy capacity limit for hydrogen storage per country, caution: for multiple nodes in one country storage potential is distributed by population 2020-09-22 09:54:52 +02:00
lisazeyen
27e2584ae8 split hydrogen storage into underground storage in salt cavern for countries with potential, others overground hydrogen storage, switch costs from gas storage to corresponding hydrogen storage 2020-09-22 09:52:53 +02:00
lisazeyen
7fe7dc381f read config.yaml for testing with yaml.safe_load() 2020-09-22 09:32:24 +02:00
lisazeyen
e1babafa35 remove taken the minimum of old solar p_nom_max and solar rooftop because no overlap between the potentials 2020-09-22 09:24:30 +02:00
lisazeyen
736c7166ac add missing multiplication with gas distribution grid cost factor 2020-09-22 09:18:28 +02:00
Tom Brown
791a58fc6b Make selection of biomass classes (solid, biogas) more explicit
List classes in config.yaml, rather than integer selection in
build_biomass_potentials.py.

Also output potentials for all years and scenarios for analysis.
2020-09-21 18:35:45 +02:00
Tom Brown
44ee205820 Fix recalculation of offshore connection costs for "m" clusters
I.e. when the generators are clustered to the "simplified" network
resolution, but the grid is clustered further, e.g. by using the
clusters = 37m "m" option.
2020-09-21 17:04:45 +02:00
Tom Brown
ac4100922a Include also industry new electricity load at low voltage bus
For consistency with the existing industry electricity load already
there.

This only applies when the electricity distribution grid is inserted.
2020-09-21 12:06:20 +02:00
lisazeyen
6d440499d5 add option to add costs for gas distribution. Caution, currently assuming same costs for gas distribution as the ones for electricity distribution 2020-09-15 18:03:33 +02:00
lisazeyen
b2789960fc add missing resistive heater and micro CHP to electricity distribution, add new electricity demand for industry to electricity distribution, restrict solar rooftop potential, change for testing mocksnakemake input for the costs to technology database 2020-09-15 17:48:57 +02:00
Tom Brown
06a3b029d8 When changing prim/secondary production, take account of existing
Don't fix uniform ratios e.g. of 0.3:0.7 primary:secondary for steel
and aluminium, but convert the necessary amount of existing primary in
each country so that the overall ratio applies at European level.

This stops sudden swings from primary to secondary in countries
dominated by primary production.
2020-09-07 19:15:40 +02:00
Tom Brown
c58f18667d Add non-EU28 energy demand per country and sector for today
Use the industrial production per sector and multiply with EU28
averages for energy per sector.
2020-09-07 19:12:47 +02:00
Tom Brown
783e026ebf Separate ammonia from basic chemicals in today's industry energy 2020-09-07 18:41:07 +02:00
Tom Brown
04629b5113 For DRI+EAF route for primary steel, add electricity for DRI shaft 2020-09-07 17:23:31 +02:00
Tom Brown
916aa5e0d9 Generate today's industry demand per ct and per sector
Only covers EU28 at the moment.

Uses the energy balances sheets from JRC-IDEES.
2020-09-07 16:48:06 +02:00
Tom Brown
aa3ffb9ac2 Remove biomass from chemicals, cement; increase in PPA, FBT
Remove non-existing biomass from chemicals and cement, since these
need higher temperatures than achievable with residues and waste.

Increase biomass in pulp and paper (since already used extensively
here and T < 500), and replace methane with biomass in food, beverages
and tobacco, since temperatures needed are low (T < 500).
2020-09-07 14:49:20 +02:00
Tom Brown
f3dcda9179 Include integrated steelworks in industry_sector_ratio
Also switch it from sep=";" to ","
2020-09-07 11:04:50 +02:00
Tom Brown
f45b9a37ae Separate ammonia from other "Basic chemicals"
This allows us to control the substitution of natural gas for hydrogen
in NH3 production.

Remaining basic chemicals are olefins, BTX and chlorine.

For 2015 NH3 production, we use the USGS data source.
2020-08-28 19:13:18 +02:00
Tom Brown
b761281b3d Move changes to primary/secondary routes for Al/St to new script
This was handled before in industry_sector_ratios.csv which was
confusing.

Now industry_sector_ratios.csv represents the genuine energy
consumption per tonne of material for each industrial route
(MWh/tMaterial).

An new file is created with ktMaterial/a in
industrial_production_per_country_tomorrow.csv which contains changes
to the fraction of primary/secondary routes compared to today's
production in industrial_production_per_country.csv.

This is less confusing I think.
2020-08-26 16:13:01 +02:00
Tom Brown
851142fe0f Separate script for industrial production per ct from energy demand 2020-08-26 13:12:16 +02:00
Tom Brown
37f36047ca Industry demand: Also record material production per industry 2020-08-26 12:06:01 +02:00
Tom Brown
515416fd75 PyPSA-Eur-Sec Version 0.2.0
Please see the release notes:

https://pypsa-eur-sec.readthedocs.io/en/latest/release_notes.html#pypsa-eur-sec-0-2-0-21st-august-2020

for more information.
2020-08-21 12:34:20 +02:00
Tom Brown
beefb57c25 Fix plotting of maps and balances; move log/benchmark to results/ 2020-08-21 12:15:01 +02:00
Tom Brown
fa767772d6 Remove onshore wind land costs, since included in latest DEA data 2020-08-20 18:41:19 +02:00
Tom Brown
95e676828a Remove old data/costs.csv and dependencies on it 2020-08-20 14:26:39 +02:00
Tom Brown
3f5aa60ad2 solve_network: Refactor land use constraints for renewables 2020-08-19 20:25:04 +02:00
Tom Brown
6b40504159 add_existing_baseyears: Correct for p_nom data is thermal output
p_nom in PyPSA is capacity on the input side (from final energy),
whereas existing capacities are given on output side (i.e. heat
delivered).
2020-08-19 12:51:53 +02:00
Tom Brown
6444f7fde9 Weight offshore connection costs with aggregation weight
Rather than taking a mean of the clustered connection costs.

Apply cost update also for overnight scenarios based on planning year.

Add land costs for onshore wind.
2020-08-19 12:41:17 +02:00
martavp
35e1d4b03b fix bug when determining elec_buses 2020-08-17 12:08:49 +02:00
martavp
d4be632e7a add add_land_constraint. The constraint is now imposed in a simplified way.
The p_nom for already installed capacities are substrated from the p_nom_max of extendable capacities.
2020-08-17 12:04:45 +02:00
martavp
6037882dbb small change in commented line 2020-08-14 11:04:35 +02:00
Tom Brown
8c196a7a21 Take care of CHPs when doing p_nom < threshold & extra_functionality
- add_brownfield.py: Have to make sure that for each CHP there is both
  a heat and electric link, but they have different p_nom for each
  CHP, so have to make sure we don't remove one without the other.

- solve_network.py: Make sure extra_functionality constraints for CHP
  power-heat feasibility graph also work for non-extendable CHPs.
2020-08-14 09:11:19 +02:00
Tom Brown
7e6c7b3dd3 Merge branch 'master' of github.com:martavp/pypsa-eur-sec into martavp-master 2020-08-12 18:10:41 +02:00
Tom Brown
663e1195e1 Add suffix -year to optimized components before solving
This simplifies the structure of add_brownfield.py dramatically.

Some other changes need to be make elsewhere because of name
changes (e.g. battery constraints in solve_network.py).
2020-08-12 18:08:01 +02:00
martavp
89a48bfad3 include existing conventional carriers in config file 2020-08-12 11:24:15 +02:00
martavp
18ff256811 Update cost for wind and solar, including the AC and DC connection costs for offshore.
In order to calculate connection costs, average values for underground_fraction and average_distance are calculated for all the buses in the initial network mapped to the clustered network.
2020-08-12 11:08:09 +02:00
Tom Brown
16b05a570d Distribute heating technologies within each country by population 2020-08-11 11:09:39 +02:00
Tom Brown
a59b2bce19 Add location attribute to each bus
E.g. "DE0 0 residential rural heat" has location "DE0 0", and "EU gas"
and "co2 atmosphere" have location "EU".
2020-08-11 11:07:55 +02:00
Tom Brown
1d6b6483e0 add_existing_baseyear: Divide p_nom by efficiency for Links
This is because the p_nom of a Link is the thermal capacity at bus0,
whereas the capacities we have are the electrical capacity at bus1.
2020-08-11 09:55:39 +02:00
Tom Brown
658f8ad00c Distribute existing power plants to the correct nodes
Previously they were distributed only by country to the first node in
the country.

Now conventional power plants are assigned to the correct node using
the bus map from PyPSA-Eur.

Wind and solar are distributed in each country by capacity factor.

The code has been refactored and a bug was fixed whereby total
capacities of wind and solar in each country were not correct.

Now the years in the config.yaml for myopic are integers not strings.
2020-08-10 20:30:29 +02:00
Tom Brown
b57a6c18f8 Make directory for costs files configurable
Default to parallel directory for technology_data repository.
2020-07-30 08:27:33 +02:00
Tom Brown
ece21bfdfa add_existing_baseyear.py: Add carrier to conventional generators 2020-07-30 08:22:27 +02:00
Tom Brown
7abe928337 prepare_sector_network: Fix costs bug and carrier bug
In prepare_costs, you need the min_count=1 in the sum so that it
generates NaNs for missing data (rather than 0) so that NaNs can be
subsituted by .fillna in the next line. Otherwise many values
(discount rates and efficiencies for solar, wind) are set to zero.

Also added carriers, storage and generators for coal, nuclear and
oil. (This needs to be organized better soon so that the carriers are
defined in config.yaml.)
2020-07-29 15:50:40 +02:00
martavp
4523f324cd Group the generators existing before base year into categories and add them to the network as e.g. solar-2005, solar-2010, solar-2015 2020-07-18 11:22:30 +02:00
martavp
17a348d1e6 Add lifetime attribute to generators, links and stores in prepare_sector_network and use that attribute to check if a generator optimized in a previous time step should be added in add_brownfield (or if its lifetime has expired) 2020-07-17 15:20:20 +02:00
martavp
fa0b88a9b1 Add lifetime and build_year attributes to generators, links and stores. 2020-07-14 20:04:36 +02:00
martavp
7d1500604f import prepare_cost function from prepare_sector_network 2020-07-14 13:28:10 +02:00
martavp
201e4d2f57 simplify make_summary and plot_summary since now overnight also includes planning_horizons and carbon_budget_name 2020-07-08 16:35:50 +02:00
martavp
dedabe695e Add conditional use of add_land_use_constraint (only for config['foresight']='myopic') 2020-07-08 16:32:17 +02:00
martavp
a4c22a29a4 Remove generators, stores and links whose installationYear + lifetime < year. Correct commented lines to YearDecomissioning > year 2020-07-08 16:28:08 +02:00
martavp
059d1daed8 activate rule add_land_use constraint 2020-07-08 08:53:17 +02:00
martavp
8c53506897 include dependence of the number of header lines in csv files based on if overnigh or mypic option is selected 2020-07-07 18:46:12 +02:00
martavp
cf3c45321e include planning_horizons and co2_budget_name in multindex if options['foresight']='myopic' 2020-07-07 18:42:25 +02:00
martavp
0f85f18e86 Add land use constraint to e.g. all the solar installed in different years 2020-07-07 18:40:17 +02:00
martavp
236da36d5e Include myopic option in prepare_network.py so that, when selected, it reads CO2_limit from a carbon_budget file 2020-07-07 18:37:42 +02:00
martavp
95f80aeba7 Add scripts to (a) include existing power and heating capacities installed before the base year, and (b) add to year n, capacities optimized in year n-1.
Existing onwind and offwind capacity are now read from IRENA database, similarly to solar capacities. Previously we were using thewindpower.net database which is not open.
2020-07-07 18:26:31 +02:00