Commit Graph

369 Commits

Author SHA1 Message Date
Fabian Neumann
13251d33cc no machinery electric share, fix add to madd 2021-08-18 16:17:59 +02:00
Fabian Neumann
351964b1e7 add logger.info for agriculture 2021-08-18 09:42:05 +02:00
Fabian Neumann
17c96edf72 agriculture: correctly convert units, fix efficiency gain, ICE aggregation for oil 2021-08-16 16:27:25 +02:00
Fabian Neumann
38352927fc Merge branch 'master' into agriculture-energy-co2 2021-08-16 14:30:15 +02:00
Fabian Neumann
ad23a648c4
Merge branch 'master' into enspreso-biomass 2021-08-10 10:43:52 +02:00
Fabian Neumann
05c2332420 fix syntax error in master 2021-08-10 10:27:54 +02:00
Fabian Neumann
928d1f23ed biomass_transport: improve spatial biomass potential handling 2021-08-09 18:03:20 +02:00
Fabian Neumann
3eb404ff68 biomass_transport: correct and simplify spatial management 2021-08-09 17:51:37 +02:00
Fabian Neumann
6711d721b9 biomass_transport: fix cost calculation and get from remote 2021-08-09 16:30:38 +02:00
Fabian Neumann
0da8f8f80e
Merge branch 'master' into biomass-transport 2021-08-06 15:58:23 +02:00
Fabian Neumann
54a509f3dd
Merge branch 'master' into co2-network 2021-08-06 15:51:40 +02:00
Fabian Neumann
3754643e81 add co2 sequestration potential global constraint 2021-08-06 12:46:03 +02:00
Fabian Neumann
e7c6b8c2c8
Merge branch 'master' into dh-share 2021-08-04 18:29:57 +02:00
Fabian Neumann
87596dd015
add H2 liquefaction cost to H2 shipping demand (#145)
* add H2 liquefaction cost to H2 shipping demand

* rename bus to 'H2 liquid'

* add release note

* make consideration of liquefaction costs for shipping optional

* update release notes
2021-08-04 18:28:18 +02:00
Fabian Neumann
96afff0487
Adapt to technology-data changes (#146)
* adapt to technology-data changes from https://github.com/PyPSA/technology-data/pull/35

* switch to new H2 (g) pipeline cost
2021-08-04 18:19:42 +02:00
martavp
fab31e6524
Exogenous transition path for shipping, Steel, and Aluminum production (#136)
* Update .gitignore

* 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.

* 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.

* 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

* small follow-up to merge

* Add oil consumed in shipping as a load to EU oil bus

* Update scripts/prepare_sector_network.py

* add planning_horizons wildcard to benchmark paths

* fixup: double fraction_primary for steel

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-08-04 18:19:02 +02:00
Fabian Neumann
50dd4ce285 prepare: fix syntax error 2021-08-04 18:13:01 +02:00
Fabian Neumann
67d40ae5d9 remove unused line 2021-08-04 14:54:00 +02:00
Fabian Neumann
f4aa345c74 apply spatial management of gas nodes 2021-08-04 14:47:13 +02:00
Fabian Neumann
e5c61c8cf0 With H2_retrofit, gas network can be removed for free, without it can be expanded for a cost 2021-08-04 11:09:31 +02:00
Fabian Neumann
6507526d22 add retrofitting costs from technology-data 2021-08-04 10:36:16 +02:00
Fabian Neumann
006a68b3cf add option for retrofitted pipe capacity per CH4 capacity 2021-08-04 10:35:02 +02:00
Fabian Neumann
6a86a04743 add gas network spatial management 2021-08-04 09:48:23 +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
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
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
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
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
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
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
Fabian Neumann
555002a35b fixup: remove remaining instances of {network} wildcard from recent PR 2021-05-19 13:57:44 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Tom Brown
1c5f471acb Include option for grid connection cost for onshore and utility PV
Only include these technologies since they are connected at new
locations.

Other technologies can fit in at existing connections.
2020-05-11 13:37:10 +02:00
Tom Brown
478832f484 Merge branch 'master' of github.com:nworbmot/pypsa-eur-sec 2020-04-29 09:53:11 +02:00
d-fine dev
a4db176458 add new link oil boiler
* prepare_sector_network:
    - add link for oil boiler in function add_industry()
    - add function for partitioning clusters into different heat node types

* config.yaml: add option for oil_boiler

* costs.csv: add costs for oil boiler
2020-04-09 14:58:03 +02:00
Tom Brown
bd85f751ac Include home battery for low voltage node 2020-03-26 14:54:10 +01:00
Tom Brown
31cad1bd6d Separate rooftop and utility solar PV 2020-03-26 10:06:59 +01:00
Tom Brown
9b326ba493 Include electricity distribution grid between load and EVs 2020-03-25 12:52:25 +01:00
Tom Brown
17e8d114b1 Allow wave costs to be modified 2020-01-14 21:36:35 +01:00
Tom Brown
2278d67687 Add wave with default minimum costs 2020-01-11 09:11:09 +01:00
Tom Brown
0e5dcbbce4 Fix clash of names in creation of candidate network for H2
Sometimes Lines and Links have same name, so need MultiIndex to avoid
a clash of names.
2019-12-26 10:21:22 +00:00
Tom Brown
52581466b6 Account for chemical industry process emissions more carefully
Remove emissions from hydrogen production for ammonia (since H2 now
comes from electrolysis).

Allow process emissions from petrochemical production to be captured
(the carbon is not necessarily fossil, but could come from CCU).
2019-12-18 09:45:14 +01:00
Tom Brown
41f7f44dcf Make CCS optional for SMR and industry process emissions 2019-12-13 18:06:38 +01:00
Tom Brown
49a68bdd35 Separate CHP gas/solid biomass, with/without CCS
Also fix CHP p_nom_ratio constraint, and battery charger/discharger
constraint.
2019-12-12 15:03:51 +01:00
Tom Brown
3fac944e5b 191108: Include a correctly-costed H2 network
Offers same topology to optimisation for H2 grid as that of HVAC and
HVDC grid.
2019-11-26 18:00:45 +01:00
Tom Brown
019e2f3f25 Split heat demand into residential and services with diff profiles
All urban central (i.e. district heating) is aggregated to the same
profile and bus.

The code is now written to cycle over each heating sector to add
demand and supply technologies, only changing what is necessary to
change, rather than just copying chunks of code and modifying
parameters there. This should make it easier to get an overview of
what's going on.
2019-08-07 11:33:29 +02:00
Tom Brown
eebac1bfa3 Deduct electric heating from electricity load profile
Otherwise it is double-counted in both the heating and the electricity
load profiles. This removes 454 TWh/a from electricity.
2019-08-01 16:16:05 +02:00
Tom Brown
d3a0f7e67d Diff intraday heat profiles for (res, services) x (water, space)
These are specified in data/heat_load_profile.csv.

The resulting heat_demand df has MultiIndex columns, where the first
level is ["sector use"], and the second level level is nodes.
2019-08-01 15:43:04 +02:00
Tom Brown
72b7ea0997 Allow space heating to be linearly reduced (without cost so far) 2019-07-31 14:22:33 +02:00
Tom Brown
886b7c5f48 Include micro-CHP using PEMFC 2019-07-28 13:10:21 +02:00
Tom Brown
ae1ea81520 Copper plate biogas and solid biomass
Because there was insufficient solid biomass in 3-4 countries to
supply industry for it locally, and we need to account for transport
of solid biomass.

Should be replaced by transport cost links between countries.
2019-07-21 12:09:18 +02:00
Tom Brown
03670c1ab3 Simplify industry load-link-bus to avoid numerical problems
Gurobi had numerical problems solving the system.

Trivial load-link-bus combinations to manage CO2 have been replaced
with simple loads.
2019-07-19 12:10:22 +02:00
Tom Brown
06cb526fef Re-integrate industry, aviation and shipping into model
Following plan by Marta and Kun
2019-07-19 10:21:12 +02:00
Tom Brown
ddca9afcc7 Give all loads a carrier; rename heat buses; fix district h losses
Heat buses renamed to:

rural (for low-density areas where district heating not possible)

urban decentral (for high-density areas without district heating and
individual heating technologies) (used to be called "urban")

urban central (for high-density areas with district heating) (used to
be called "central")

District heating losses applied only to urban central.
2019-07-16 16:00:21 +02:00
Tom Brown
6cc676d6cf 190516: Try removing H2 network too 2019-07-12 08:51:25 +02:00
Tom Brown
ae3059f676 Add "central" option to remove electricity grid (HVAC, HVDC, B2B) 2019-05-16 16:08:16 +02:00
Tom Brown
9ad0eb01e2 Use waste heat from FT and fuel cells in district heating 2019-05-14 11:49:32 +02:00
Tom Brown
71c04909b5 Allow option of underground H2 storage 2019-05-13 16:47:54 +02:00
Tom Brown
3c28e4daba Include lossless and costless H2 network to examine benefit
Agglomerate H2 storage for this case.

Need to replace with separate H2 links and stores.
2019-05-12 11:27:56 +02:00
Tom Brown
a10a7d2b15 Limit sequestration to 200 Mt/a, introduce SMR, vent stored CO2 2019-05-11 15:55:06 +02:00
Tom Brown
0ab5bd200a Fix gas and oil stores so that they allow fossil fuel extraction
Before both initial SOC and final SOC were set to be zero, which
prevents synthetic fuel transfer over the year boundary, and prevents
the use of fossil fuels for non-zero CO2 scenarios.

Now done properly with cyclic Store (prevents accumulation of fossil
fuels as a form of sequestration) and Generator (to imitate fossil
fuel extraction).
2019-05-08 12:18:18 +02:00
Tom Brown
82a057791e Allow storing FT fuels, cost for FT conversion, fossil FT fuels
Also include raw data/costs.csv
2019-04-30 12:05:36 +02:00
Tom Brown
952534c5c9 Generalise limitation of tech potentials
tech name must only appear, but not be identical to generator
carrier. This allows to use the name "offshore" for both "offshore-ac"
and "offshore-dc", but then "solar" also catches "solar thermal",
which is fine since for solar thermal potentials are np.inf, unless
limit is 0 since np.inf*0 is nan.
2019-04-24 12:17:42 +02:00
Tom Brown
5157041ee2 Update for compatibility with latest PyPSA-eur master branch
Remove non-renewable generator and storage units from electricity-only
base network, since they're added differently here with links.

Remove unncessary cruft from config.yaml which is not used by
PyPSA-Eur-Sec (e.g. renewable configuration parameters).

Rename "naptha" to correct "naphtha".
2019-04-18 15:23:37 +02:00
Tom Brown
e88b6c850f Fix prepare_sector_network to reproduce old sector prenetworks
from pypsa-eur sector branch
2019-04-17 17:04:33 +02:00
Tom Brown
ad865c18c6 Copy prepare_network.py from pypsa-eur sector commit 95820e57f795
...to scripts/prepare_sector_network.py
2019-04-17 14:24:22 +02:00