Merge branch 'master' into jrc-idees-2020

This commit is contained in:
lisazeyen 2024-08-09 14:17:25 +02:00 committed by GitHub
commit fe9185ef3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 1852 additions and 633 deletions

0
borg-it Executable file → Normal file
View File

View File

@ -67,7 +67,6 @@ snapshots:
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#enable
enable:
retrieve: auto
prepare_links_p_nom: false
retrieve_databundle: true
retrieve_cost_data: true
build_cutout: false
@ -370,6 +369,23 @@ biomass:
- Sludge
municipal solid waste:
- Municipal waste
share_unsustainable_use_retained:
2020: 1
2025: 0.66
2030: 0.33
2035: 0
2040: 0
2045: 0
2050: 0
share_sustainable_potential_available:
2020: 0
2025: 0.33
2030: 0.66
2035: 1
2040: 1
2045: 1
2050: 1
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#solar-thermal
solar_thermal:
@ -410,6 +426,22 @@ sector:
2045: 0.8
2050: 1.0
district_heating_loss: 0.15
forward_temperature: 90 #C
return_temperature: 50 #C
heat_source_cooling: 6 #K
heat_pump_cop_approximation:
refrigerant: ammonia
heat_exchanger_pinch_point_temperature_difference: 5 #K
isentropic_compressor_efficiency: 0.8
heat_loss: 0.0
heat_pump_sources:
urban central:
- air
urban decentral:
- air
rural:
- air
- ground
cluster_heat_buses: true
heat_demand_cutout: default
bev_dsm_restriction_value: 0.75
@ -492,7 +524,7 @@ sector:
aviation_demand_factor: 1.
HVC_demand_factor: 1.
time_dep_hp_cop: true
heat_pump_sink_T: 55.
heat_pump_sink_T_individual_heating: 55.
reduce_space_heat_exogenously: true
reduce_space_heat_exogenously_factor:
2020: 0.10 # this results in a space heat demand reduction of 10%
@ -722,7 +754,7 @@ industry:
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#costs
costs:
year: 2030
version: v0.9.0
version: v0.9.1
social_discountrate: 0.02
fill_values:
FOM: 0
@ -1040,6 +1072,7 @@ plotting:
services rural biomass boiler: '#c6cf98'
services urban decentral biomass boiler: '#dde5b5'
biomass to liquid: '#32CD32'
unsustainable bioliquids: '#32CD32'
electrobiofuels: 'red'
BioSNG: '#123456'
# power transmission

View File

@ -53,7 +53,6 @@ extensions = [
autodoc_mock_imports = [
"atlite",
"snakemake",
"pycountry",
"rioxarray",
"country_converter",
"tabula",

View File

@ -5,3 +5,5 @@ classes ,,,
-- solid biomass,--,Array of biomass comodity,The comodity that are included as solid biomass
-- not included,--,Array of biomass comodity,The comodity that are not included as a biomass potential
-- biogas,--,Array of biomass comodity,The comodity that are included as biogas
share_unsustainable_use_retained,--,Dictionary with planning horizons as keys., Share of unsustainable biomass use retained using primary production of Eurostat data as reference
share_sustainable_potential_available,--,Dictionary with planning horizons as keys., Share determines phase-in of ENSPRESO biomass potentials

1 Unit Values Description
5 -- solid biomass -- Array of biomass comodity The comodity that are included as solid biomass
6 -- not included -- Array of biomass comodity The comodity that are not included as a biomass potential
7 -- biogas -- Array of biomass comodity The comodity that are included as biogas
8 share_unsustainable_use_retained -- Dictionary with planning horizons as keys. Share of unsustainable biomass use retained using primary production of Eurostat data as reference
9 share_sustainable_potential_available -- Dictionary with planning horizons as keys. Share determines phase-in of ENSPRESO biomass potentials

View File

@ -1,6 +1,5 @@
,Unit,Values,Description
enable,str or bool,"{auto, true, false}","Switch to include (true) or exclude (false) the retrieve_* rules of snakemake into the workflow; 'auto' sets true|false based on availability of an internet connection to prevent issues with snakemake failing due to lack of internet connection."
prepare_links_p_nom,bool,"{true, false}","Switch to retrieve current HVDC projects from `Wikipedia <https://en.wikipedia.org/wiki/List_of_HVDC_projects>`_"
retrieve_databundle,bool,"{true, false}","Switch to retrieve databundle from zenodo via the rule :mod:`retrieve_databundle` or whether to keep a custom databundle located in the corresponding folder."
retrieve_cost_data,bool,"{true, false}","Switch to retrieve technology cost data from `technology-data repository <https://github.com/PyPSA/technology-data>`_."
build_cutout,bool,"{true, false}","Switch to enable the building of cutouts via the rule :mod:`build_cutout`."

1 Unit Values Description
2 enable str or bool {auto, true, false} Switch to include (true) or exclude (false) the retrieve_* rules of snakemake into the workflow; 'auto' sets true|false based on availability of an internet connection to prevent issues with snakemake failing due to lack of internet connection.
prepare_links_p_nom bool {true, false} Switch to retrieve current HVDC projects from `Wikipedia <https://en.wikipedia.org/wiki/List_of_HVDC_projects>`_
3 retrieve_databundle bool {true, false} Switch to retrieve databundle from zenodo via the rule :mod:`retrieve_databundle` or whether to keep a custom databundle located in the corresponding folder.
4 retrieve_cost_data bool {true, false} Switch to retrieve technology cost data from `technology-data repository <https://github.com/PyPSA/technology-data>`_.
5 build_cutout bool {true, false} Switch to enable the building of cutouts via the rule :mod:`build_cutout`.

View File

@ -1,162 +1,174 @@
,Unit,Values,Description
transport,--,"{true, false}",Flag to include transport sector.
heating,--,"{true, false}",Flag to include heating sector.
biomass,--,"{true, false}",Flag to include biomass sector.
industry,--,"{true, false}",Flag to include industry sector.
agriculture,--,"{true, false}",Flag to include agriculture sector.
fossil_fuels,--,"{true, false}","Flag to include imports of fossil fuels ( [""coal"", ""gas"", ""oil"", ""lignite""])"
district_heating,--,,`prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_
-- potential,--,float,maximum fraction of urban demand which can be supplied by district heating
-- progress,--,Dictionary with planning horizons as keys., Increase of today's district heating demand to potential maximum district heating share. Progress = 0 means today's district heating share. Progress = 1 means maximum fraction of urban demand is supplied by district heating
-- district_heating_loss,--,float,Share increase in district heat demand in urban central due to heat losses
cluster_heat_buses,--,"{true, false}",Cluster residential and service heat buses in `prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_ to one to save memory.
,,,
bev_dsm_restriction _value,--,float,Adds a lower state of charge (SOC) limit for battery electric vehicles (BEV) to manage its own energy demand (DSM). Located in `build_transport_demand.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/build_transport_demand.py>`_. Set to 0 for no restriction on BEV DSM
bev_dsm_restriction _time,--,float,Time at which SOC of BEV has to be dsm_restriction_value
transport_heating _deadband_upper,°C,float,"The maximum temperature in the vehicle. At higher temperatures, the energy required for cooling in the vehicle increases."
transport_heating _deadband_lower,°C,float,"The minimum temperature in the vehicle. At lower temperatures, the energy required for heating in the vehicle increases."
,,,
ICE_lower_degree_factor,--,float,Share increase in energy demand in internal combustion engine (ICE) for each degree difference between the cold environment and the minimum temperature.
ICE_upper_degree_factor,--,float,Share increase in energy demand in internal combustion engine (ICE) for each degree difference between the hot environment and the maximum temperature.
EV_lower_degree_factor,--,float,Share increase in energy demand in electric vehicles (EV) for each degree difference between the cold environment and the minimum temperature.
EV_upper_degree_factor,--,float,Share increase in energy demand in electric vehicles (EV) for each degree difference between the hot environment and the maximum temperature.
bev_dsm,--,"{true, false}",Add the option for battery electric vehicles (BEV) to participate in demand-side management (DSM)
,,,
bev_availability,--,float,The share for battery electric vehicles (BEV) that are able to do demand side management (DSM)
bev_energy,--,float,The average size of battery electric vehicles (BEV) in MWh
bev_charge_efficiency,--,float,Battery electric vehicles (BEV) charge and discharge efficiency
bev_charge_rate,MWh,float,The power consumption for one electric vehicle (EV) in MWh. Value derived from 3-phase charger with 11 kW.
bev_avail_max,--,float,The maximum share plugged-in availability for passenger electric vehicles.
bev_avail_mean,--,float,The average share plugged-in availability for passenger electric vehicles.
v2g,--,"{true, false}",Allows feed-in to grid from EV battery
land_transport_fuel_cell _share,--,Dictionary with planning horizons as keys.,The share of vehicles that uses fuel cells in a given year
land_transport_electric _share,--,Dictionary with planning horizons as keys.,The share of vehicles that uses electric vehicles (EV) in a given year
land_transport_ice _share,--,Dictionary with planning horizons as keys.,The share of vehicles that uses internal combustion engines (ICE) in a given year. What is not EV or FCEV is oil-fuelled ICE.
transport_electric_efficiency,MWh/100km,float,The conversion efficiencies of electric vehicles in transport
transport_fuel_cell_efficiency,MWh/100km,float,The H2 conversion efficiencies of fuel cells in transport
transport_ice_efficiency,MWh/100km,float,The oil conversion efficiencies of internal combustion engine (ICE) in transport
agriculture_machinery _electric_share,--,float,The share for agricultural machinery that uses electricity
agriculture_machinery _oil_share,--,float,The share for agricultural machinery that uses oil
agriculture_machinery _fuel_efficiency,--,float,The efficiency of electric-powered machinery in the conversion of electricity to meet agricultural needs.
agriculture_machinery _electric_efficiency,--,float,The efficiency of oil-powered machinery in the conversion of oil to meet agricultural needs.
Mwh_MeOH_per_MWh_H2,LHV,float,"The energy amount of the produced methanol per energy amount of hydrogen. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 64."
MWh_MeOH_per_tCO2,LHV,float,"The energy amount of the produced methanol per ton of CO2. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 66."
MWh_MeOH_per_MWh_e,LHV,float,"The energy amount of the produced methanol per energy amount of electricity. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 64."
shipping_hydrogen _liquefaction,--,"{true, false}",Whether to include liquefaction costs for hydrogen demand in shipping.
,,,
shipping_hydrogen_share,--,Dictionary with planning horizons as keys.,The share of ships powered by hydrogen in a given year
shipping_methanol_share,--,Dictionary with planning horizons as keys.,The share of ships powered by methanol in a given year
shipping_oil_share,--,Dictionary with planning horizons as keys.,The share of ships powered by oil in a given year
shipping_methanol _efficiency,--,float,The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the `IEA <https://www.iea-amf.org/app/webroot/files/file/Annex%20Reports/AMF_Annex_56.pdf>`_
,,,
shipping_oil_efficiency,--,float,The efficiency of oil-powered ships in the conversion of oil to meet shipping needs (propulsion). Base value derived from 2011
aviation_demand_factor,--,float,The proportion of demand for aviation compared to today's consumption
HVC_demand_factor,--,float,The proportion of demand for high-value chemicals compared to today's consumption
,,,
time_dep_hp_cop,--,"{true, false}",Consider the time dependent coefficient of performance (COP) of the heat pump
heat_pump_sink_T,°C,float,The temperature heat sink used in heat pumps based on DTU / large area radiators. The value is conservatively high to cover hot water and space heating in poorly-insulated buildings
reduce_space_heat _exogenously,--,"{true, false}",Influence on space heating demand by a certain factor (applied before losses in district heating).
reduce_space_heat _exogenously_factor,--,Dictionary with planning horizons as keys.,"A positive factor can mean renovation or demolition of a building. If the factor is negative, it can mean an increase in floor area, increased thermal comfort, population growth. The default factors are determined by the `Eurocalc Homes and buildings decarbonization scenario <http://tool.european-calculator.eu/app/buildings/building-types-area/?levers=1ddd4444421213bdbbbddd44444ffffff11f411111221111211l212221>`_"
retrofitting,,,
-- retro_endogen,--,"{true, false}",Add retrofitting as an endogenous system which co-optimise space heat savings.
-- cost_factor,--,float,Weight costs for building renovation
-- interest_rate,--,float,The interest rate for investment in building components
-- annualise_cost,--,"{true, false}",Annualise the investment costs of retrofitting
-- tax_weighting,--,"{true, false}",Weight the costs of retrofitting depending on taxes in countries
-- construction_index,--,"{true, false}",Weight the costs of retrofitting depending on labour/material costs per country
tes,--,"{true, false}",Add option for storing thermal energy in large water pits associated with district heating systems and individual thermal energy storage (TES)
tes_tau,,,The time constant used to calculate the decay of thermal energy in thermal energy storage (TES): 1- :math:`e^{-1/24τ}`.
-- decentral,days,float,The time constant in decentralized thermal energy storage (TES)
-- central,days,float,The time constant in centralized thermal energy storage (TES)
boilers,--,"{true, false}",Add option for transforming gas into heat using gas boilers
resistive_heaters,--,"{true, false}",Add option for transforming electricity into heat using resistive heaters (independently from gas boilers)
oil_boilers,--,"{true, false}",Add option for transforming oil into heat using boilers
biomass_boiler,--,"{true, false}",Add option for transforming biomass into heat using boilers
overdimension_individual_heating,--,float,Add option for overdimensioning individual heating systems by a certain factor. This allows them to cover heat demand peaks e.g. 10% higher than those in the data with a setting of 1.1.
chp,--,"{true, false}",Add option for using Combined Heat and Power (CHP)
micro_chp,--,"{true, false}",Add option for using Combined Heat and Power (CHP) for decentral areas.
solar_thermal,--,"{true, false}",Add option for using solar thermal to generate heat.
solar_cf_correction,--,float,The correction factor for the value provided by the solar thermal profile calculations
marginal_cost_storage,currency/MWh ,float,The marginal cost of discharging batteries in distributed grids
methanation,--,"{true, false}",Add option for transforming hydrogen and CO2 into methane using methanation.
coal_cc,--,"{true, false}",Add option for coal CHPs with carbon capture
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 <https://en.wikipedia.org/wiki/Allam_power_cycle>`_
hydrogen_fuel_cell,--,"{true, false}",Add option to include hydrogen fuel cell for re-electrification. Assuming OCGT technology costs
hydrogen_turbine,--,"{true, false}",Add option to include hydrogen turbine for re-electrification. Assuming OCGT technology costs
SMR,--,"{true, false}",Add option for transforming natural gas into hydrogen and CO2 using Steam Methane Reforming (SMR)
SMR CC,--,"{true, false}",Add option for transforming natural gas into hydrogen and CO2 using Steam Methane Reforming (SMR) and Carbon Capture (CC)
regional_methanol_demand,--,"{true, false}",Spatially resolve methanol demand. Set to true if regional CO2 constraints needed.
regional_oil_demand,--,"{true, false}",Spatially resolve oil demand. Set to true if regional CO2 constraints needed.
regional_co2 _sequestration_potential,,,
-- enable,--,"{true, false}",Add option for regionally-resolved geological carbon dioxide sequestration potentials based on `CO2StoP <https://setis.ec.europa.eu/european-co2-storage-database_en>`_.
-- attribute,--,string or list,Name (or list of names) of the attribute(s) for the sequestration potential
-- include_onshore,--,"{true, false}",Add options for including onshore sequestration potentials
-- min_size,Gt ,float,Any sites with lower potential than this value will be excluded
-- max_size,Gt ,float,The maximum sequestration potential for any one site.
-- years_of_storage,years,float,The years until potential exhausted at optimised annual rate
co2_sequestration_potential,MtCO2/a,float,The potential of sequestering CO2 in Europe per year
co2_sequestration_cost,currency/tCO2,float,The cost of sequestering a ton of CO2
co2_sequestration_lifetime,years,int,The lifetime of a CO2 sequestration site
co2_spatial,--,"{true, false}","Add option to spatially resolve carrier representing stored carbon dioxide. This allows for more detailed modelling of CCUTS, e.g. regarding the capturing of industrial process emissions, usage as feedstock for electrofuels, transport of carbon dioxide, and geological sequestration sites."
,,,
co2network,--,"{true, false}",Add option for planning a new carbon dioxide transmission network
co2_network_cost_factor,p.u.,float,The cost factor for the capital cost of the carbon dioxide transmission network
,,,
cc_fraction,--,float,The default fraction of CO2 captured with post-combustion capture
hydrogen_underground _storage,--,"{true, false}",Add options for storing hydrogen underground. Storage potential depends regionally.
hydrogen_underground _storage_locations,,"{onshore, nearshore, offshore}","The location where hydrogen underground storage can be located. Onshore, nearshore, offshore means it must be located more than 50 km away from the sea, within 50 km of the sea, or within the sea itself respectively."
,,,
ammonia,--,"{true, false, regional}","Add ammonia as a carrrier. It can be either true (copperplated NH3), false (no NH3 carrier) or ""regional"" (regionalised NH3 without network)"
min_part_load_fischer _tropsch,per unit of p_nom ,float,The minimum unit dispatch (``p_min_pu``) for the Fischer-Tropsch process
min_part_load _methanolisation,per unit of p_nom ,float,The minimum unit dispatch (``p_min_pu``) for the methanolisation process
,,,
use_fischer_tropsch _waste_heat,--,"{true, false}",Add option for using waste heat of Fischer Tropsch in district heating networks
use_fuel_cell_waste_heat,--,"{true, false}",Add option for using waste heat of fuel cells in district heating networks
use_electrolysis_waste _heat,--,"{true, false}",Add option for using waste heat of electrolysis in district heating networks
electricity_transmission _grid,--,"{true, false}",Switch for enabling/disabling the electricity transmission grid.
electricity_distribution _grid,--,"{true, false}",Add a simplified representation of the exchange capacity between transmission and distribution grid level through a link.
electricity_distribution _grid_cost_factor,,,Multiplies the investment cost of the electricity distribution grid
,,,
electricity_grid _connection,--,"{true, false}",Add the cost of electricity grid connection for onshore wind and solar
transmission_efficiency,,,Section to specify transmission losses or compression energy demands of bidirectional links. Splits them into two capacity-linked unidirectional links.
-- {carrier},--,str,The carrier of the link.
-- -- efficiency_static,p.u.,float,Length-independent transmission efficiency.
-- -- efficiency_per_1000km,p.u. per 1000 km,float,Length-dependent transmission efficiency ($\eta^{\text{length}}$)
-- -- compression_per_1000km,p.u. per 1000 km,float,Length-dependent electricity demand for compression ($\eta \cdot \text{length}$) implemented as multi-link to local electricity bus.
H2_network,--,"{true, false}",Add option for new hydrogen pipelines
gas_network,--,"{true, false}","Add existing natural gas infrastructure, incl. LNG terminals, production and entry-points. The existing gas network is added with a lossless transport model. A length-weighted `k-edge augmentation algorithm <https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation.html#networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation>`_ can be run to add new candidate gas pipelines such that all regions of the model can be connected to the gas network. When activated, all the gas demands are regionally disaggregated as well."
H2_retrofit,--,"{true, false}",Add option for retrofiting existing pipelines to transport hydrogen.
H2_retrofit_capacity _per_CH4,--,float,"The ratio for H2 capacity per original CH4 capacity of retrofitted pipelines. The `European Hydrogen Backbone (April, 2020) p.15 <https://gasforclimate2050.eu/wp-content/uploads/2020/07/2020_European-Hydrogen-Backbone_Report.pdf>`_ 60% of original natural gas capacity could be used in cost-optimal case as H2 capacity."
gas_network_connectivity _upgrade ,--,float,The number of desired edge connectivity (k) in the length-weighted `k-edge augmentation algorithm <https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation.html#networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation>`_ used for the gas network
gas_distribution_grid,--,"{true, false}",Add a gas distribution grid
gas_distribution_grid _cost_factor,,,Multiplier for the investment cost of the gas distribution grid
,,,
biomass_spatial,--,"{true, false}",Add option for resolving biomass demand regionally
biomass_transport,--,"{true, false}",Add option for transporting solid biomass between nodes
biogas_upgrading_cc,--,"{true, false}",Add option to capture CO2 from biomass upgrading
conventional_generation,,,Add a more detailed description of conventional carriers. Any power generation requires the consumption of fuel from nodes representing that fuel.
biomass_to_liquid,--,"{true, false}",Add option for transforming solid biomass into liquid fuel with the same properties as oil
biosng,--,"{true, false}",Add option for transforming solid biomass into synthesis gas with the same properties as natural gas
municipal_solid_waste,--,"{true, false}",Add option for municipal solid waste
limit_max_growth,,,
-- enable,--,"{true, false}",Add option to limit the maximum growth of a carrier
-- factor,p.u.,float,The maximum growth factor of a carrier (e.g. 1.3 allows 30% larger than max historic growth)
-- max_growth,,,
-- -- {carrier},GW,float,The historic maximum growth of a carrier
-- max_relative_growth,,,
-- -- {carrier},p.u.,float,The historic maximum relative growth of a carrier
,,,
enhanced_geothermal,,,
-- enable,--,"{true, false}",Add option to include Enhanced Geothermal Systems
-- flexible,--,"{true, false}",Add option for flexible operation (see Ricks et al. 2024)
-- max_hours,--,int,The maximum hours the reservoir can be charged under flexible operation
-- max_boost,--,float,The maximum boost in power output under flexible operation
-- var_cf,--,"{true, false}",Add option for variable capacity factor (see Ricks et al. 2024)
-- sustainability_factor,--,float,Share of sourced heat that is replenished by the earth's core (see details in `build_egs_potentials.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/build_egs_potentials.py>`_)
solid_biomass_import,,,
-- enable,--,"{true, false}",Add option to include solid biomass imports
-- price,currency/MWh,float,Price for importing solid biomass
-- max_amount,Twh,float,Maximum solid biomass import potential
-- upstream_emissions_factor,p.u.,float,Upstream emissions of solid biomass imports
,Unit,Values,Description
transport,--,"{true, false}",Flag to include transport sector.
heating,--,"{true, false}",Flag to include heating sector.
biomass,--,"{true, false}",Flag to include biomass sector.
industry,--,"{true, false}",Flag to include industry sector.
agriculture,--,"{true, false}",Flag to include agriculture sector.
fossil_fuels,--,"{true, false}","Flag to include imports of fossil fuels ( [""coal"", ""gas"", ""oil"", ""lignite""])"
district_heating,--,,`prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_
-- potential,--,float,maximum fraction of urban demand which can be supplied by district heating
-- progress,--,Dictionary with planning horizons as keys., Increase of today's district heating demand to potential maximum district heating share. Progress = 0 means today's district heating share. Progress = 1 means maximum fraction of urban demand is supplied by district heating
-- district_heating_loss,--,float,Share increase in district heat demand in urban central due to heat losses
-- forward_temperature,°C,float,Forward temperature in district heating
-- return_temperature,°C,float,Return temperature in district heating. Must be lower than forward temperature
-- heat_source_cooling,K,float,Cooling of heat source for heat pumps
-- heat_pump_cop_approximation,,,
-- -- refrigerant,--,"{ammonia, isobutane}",Heat pump refrigerant assumed for COP approximation
-- -- heat_exchanger_pinch_point_temperature_difference,K,float,Heat pump pinch point temperature difference in heat exchangers assumed for approximation.
-- -- isentropic_compressor_efficiency,--,float,Isentropic efficiency of heat pump compressor assumed for approximation. Must be between 0 and 1.
-- -- heat_loss,--,float,Heat pump heat loss assumed for approximation. Must be between 0 and 1.
-- heat_pump_sources,--,,
-- -- urban central,--,List of heat sources for heat pumps in urban central heating,
-- -- urban decentral,--,List of heat sources for heat pumps in urban decentral heating,
-- -- rural,--,List of heat sources for heat pumps in rural heating,
cluster_heat_buses,--,"{true, false}",Cluster residential and service heat buses in `prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_ to one to save memory.
,,,
bev_dsm_restriction _value,--,float,Adds a lower state of charge (SOC) limit for battery electric vehicles (BEV) to manage its own energy demand (DSM). Located in `build_transport_demand.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/build_transport_demand.py>`_. Set to 0 for no restriction on BEV DSM
bev_dsm_restriction _time,--,float,Time at which SOC of BEV has to be dsm_restriction_value
transport_heating _deadband_upper,°C,float,"The maximum temperature in the vehicle. At higher temperatures, the energy required for cooling in the vehicle increases."
transport_heating _deadband_lower,°C,float,"The minimum temperature in the vehicle. At lower temperatures, the energy required for heating in the vehicle increases."
,,,
ICE_lower_degree_factor,--,float,Share increase in energy demand in internal combustion engine (ICE) for each degree difference between the cold environment and the minimum temperature.
ICE_upper_degree_factor,--,float,Share increase in energy demand in internal combustion engine (ICE) for each degree difference between the hot environment and the maximum temperature.
EV_lower_degree_factor,--,float,Share increase in energy demand in electric vehicles (EV) for each degree difference between the cold environment and the minimum temperature.
EV_upper_degree_factor,--,float,Share increase in energy demand in electric vehicles (EV) for each degree difference between the hot environment and the maximum temperature.
bev_dsm,--,"{true, false}",Add the option for battery electric vehicles (BEV) to participate in demand-side management (DSM)
,,,
bev_availability,--,float,The share for battery electric vehicles (BEV) that are able to do demand side management (DSM)
bev_energy,--,float,The average size of battery electric vehicles (BEV) in MWh
bev_charge_efficiency,--,float,Battery electric vehicles (BEV) charge and discharge efficiency
bev_charge_rate,MWh,float,The power consumption for one electric vehicle (EV) in MWh. Value derived from 3-phase charger with 11 kW.
bev_avail_max,--,float,The maximum share plugged-in availability for passenger electric vehicles.
bev_avail_mean,--,float,The average share plugged-in availability for passenger electric vehicles.
v2g,--,"{true, false}",Allows feed-in to grid from EV battery
land_transport_fuel_cell _share,--,Dictionary with planning horizons as keys.,The share of vehicles that uses fuel cells in a given year
land_transport_electric _share,--,Dictionary with planning horizons as keys.,The share of vehicles that uses electric vehicles (EV) in a given year
land_transport_ice _share,--,Dictionary with planning horizons as keys.,The share of vehicles that uses internal combustion engines (ICE) in a given year. What is not EV or FCEV is oil-fuelled ICE.
transport_electric_efficiency,MWh/100km,float,The conversion efficiencies of electric vehicles in transport
transport_fuel_cell_efficiency,MWh/100km,float,The H2 conversion efficiencies of fuel cells in transport
transport_ice_efficiency,MWh/100km,float,The oil conversion efficiencies of internal combustion engine (ICE) in transport
agriculture_machinery _electric_share,--,float,The share for agricultural machinery that uses electricity
agriculture_machinery _oil_share,--,float,The share for agricultural machinery that uses oil
agriculture_machinery _fuel_efficiency,--,float,The efficiency of electric-powered machinery in the conversion of electricity to meet agricultural needs.
agriculture_machinery _electric_efficiency,--,float,The efficiency of oil-powered machinery in the conversion of oil to meet agricultural needs.
Mwh_MeOH_per_MWh_H2,LHV,float,"The energy amount of the produced methanol per energy amount of hydrogen. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 64."
MWh_MeOH_per_tCO2,LHV,float,"The energy amount of the produced methanol per ton of CO2. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 66."
MWh_MeOH_per_MWh_e,LHV,float,"The energy amount of the produced methanol per energy amount of electricity. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 64."
shipping_hydrogen _liquefaction,--,"{true, false}",Whether to include liquefaction costs for hydrogen demand in shipping.
,,,
shipping_hydrogen_share,--,Dictionary with planning horizons as keys.,The share of ships powered by hydrogen in a given year
shipping_methanol_share,--,Dictionary with planning horizons as keys.,The share of ships powered by methanol in a given year
shipping_oil_share,--,Dictionary with planning horizons as keys.,The share of ships powered by oil in a given year
shipping_methanol _efficiency,--,float,The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the `IEA <https://www.iea-amf.org/app/webroot/files/file/Annex%20Reports/AMF_Annex_56.pdf>`_
,,,
shipping_oil_efficiency,--,float,The efficiency of oil-powered ships in the conversion of oil to meet shipping needs (propulsion). Base value derived from 2011
aviation_demand_factor,--,float,The proportion of demand for aviation compared to today's consumption
HVC_demand_factor,--,float,The proportion of demand for high-value chemicals compared to today's consumption
,,,
time_dep_hp_cop,--,"{true, false}",Consider the time dependent coefficient of performance (COP) of the heat pump
heat_pump_sink_T,°C,float,The temperature heat sink used in heat pumps based on DTU / large area radiators. The value is conservatively high to cover hot water and space heating in poorly-insulated buildings
reduce_space_heat _exogenously,--,"{true, false}",Influence on space heating demand by a certain factor (applied before losses in district heating).
reduce_space_heat _exogenously_factor,--,Dictionary with planning horizons as keys.,"A positive factor can mean renovation or demolition of a building. If the factor is negative, it can mean an increase in floor area, increased thermal comfort, population growth. The default factors are determined by the `Eurocalc Homes and buildings decarbonization scenario <http://tool.european-calculator.eu/app/buildings/building-types-area/?levers=1ddd4444421213bdbbbddd44444ffffff11f411111221111211l212221>`_"
retrofitting,,,
-- retro_endogen,--,"{true, false}",Add retrofitting as an endogenous system which co-optimise space heat savings.
-- cost_factor,--,float,Weight costs for building renovation
-- interest_rate,--,float,The interest rate for investment in building components
-- annualise_cost,--,"{true, false}",Annualise the investment costs of retrofitting
-- tax_weighting,--,"{true, false}",Weight the costs of retrofitting depending on taxes in countries
-- construction_index,--,"{true, false}",Weight the costs of retrofitting depending on labour/material costs per country
tes,--,"{true, false}",Add option for storing thermal energy in large water pits associated with district heating systems and individual thermal energy storage (TES)
tes_tau,,,The time constant used to calculate the decay of thermal energy in thermal energy storage (TES): 1- :math:`e^{-1/24τ}`.
-- decentral,days,float,The time constant in decentralized thermal energy storage (TES)
-- central,days,float,The time constant in centralized thermal energy storage (TES)
boilers,--,"{true, false}",Add option for transforming gas into heat using gas boilers
resistive_heaters,--,"{true, false}",Add option for transforming electricity into heat using resistive heaters (independently from gas boilers)
oil_boilers,--,"{true, false}",Add option for transforming oil into heat using boilers
biomass_boiler,--,"{true, false}",Add option for transforming biomass into heat using boilers
overdimension_individual_heating,--,float,Add option for overdimensioning individual heating systems by a certain factor. This allows them to cover heat demand peaks e.g. 10% higher than those in the data with a setting of 1.1.
chp,--,"{true, false}",Add option for using Combined Heat and Power (CHP)
micro_chp,--,"{true, false}",Add option for using Combined Heat and Power (CHP) for decentral areas.
solar_thermal,--,"{true, false}",Add option for using solar thermal to generate heat.
solar_cf_correction,--,float,The correction factor for the value provided by the solar thermal profile calculations
marginal_cost_storage,currency/MWh ,float,The marginal cost of discharging batteries in distributed grids
methanation,--,"{true, false}",Add option for transforming hydrogen and CO2 into methane using methanation.
coal_cc,--,"{true, false}",Add option for coal CHPs with carbon capture
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 <https://en.wikipedia.org/wiki/Allam_power_cycle>`_
hydrogen_fuel_cell,--,"{true, false}",Add option to include hydrogen fuel cell for re-electrification. Assuming OCGT technology costs
hydrogen_turbine,--,"{true, false}",Add option to include hydrogen turbine for re-electrification. Assuming OCGT technology costs
SMR,--,"{true, false}",Add option for transforming natural gas into hydrogen and CO2 using Steam Methane Reforming (SMR)
SMR CC,--,"{true, false}",Add option for transforming natural gas into hydrogen and CO2 using Steam Methane Reforming (SMR) and Carbon Capture (CC)
regional_methanol_demand,--,"{true, false}",Spatially resolve methanol demand. Set to true if regional CO2 constraints needed.
regional_oil_demand,--,"{true, false}",Spatially resolve oil demand. Set to true if regional CO2 constraints needed.
regional_co2 _sequestration_potential,,,
-- enable,--,"{true, false}",Add option for regionally-resolved geological carbon dioxide sequestration potentials based on `CO2StoP <https://setis.ec.europa.eu/european-co2-storage-database_en>`_.
-- attribute,--,string or list,Name (or list of names) of the attribute(s) for the sequestration potential
-- include_onshore,--,"{true, false}",Add options for including onshore sequestration potentials
-- min_size,Gt ,float,Any sites with lower potential than this value will be excluded
-- max_size,Gt ,float,The maximum sequestration potential for any one site.
-- years_of_storage,years,float,The years until potential exhausted at optimised annual rate
co2_sequestration_potential,MtCO2/a,float,The potential of sequestering CO2 in Europe per year
co2_sequestration_cost,currency/tCO2,float,The cost of sequestering a ton of CO2
co2_sequestration_lifetime,years,int,The lifetime of a CO2 sequestration site
co2_spatial,--,"{true, false}","Add option to spatially resolve carrier representing stored carbon dioxide. This allows for more detailed modelling of CCUTS, e.g. regarding the capturing of industrial process emissions, usage as feedstock for electrofuels, transport of carbon dioxide, and geological sequestration sites."
,,,
co2network,--,"{true, false}",Add option for planning a new carbon dioxide transmission network
co2_network_cost_factor,p.u.,float,The cost factor for the capital cost of the carbon dioxide transmission network
,,,
cc_fraction,--,float,The default fraction of CO2 captured with post-combustion capture
hydrogen_underground _storage,--,"{true, false}",Add options for storing hydrogen underground. Storage potential depends regionally.
hydrogen_underground _storage_locations,,"{onshore, nearshore, offshore}","The location where hydrogen underground storage can be located. Onshore, nearshore, offshore means it must be located more than 50 km away from the sea, within 50 km of the sea, or within the sea itself respectively."
,,,
ammonia,--,"{true, false, regional}","Add ammonia as a carrrier. It can be either true (copperplated NH3), false (no NH3 carrier) or ""regional"" (regionalised NH3 without network)"
min_part_load_fischer _tropsch,per unit of p_nom ,float,The minimum unit dispatch (``p_min_pu``) for the Fischer-Tropsch process
min_part_load _methanolisation,per unit of p_nom ,float,The minimum unit dispatch (``p_min_pu``) for the methanolisation process
,,,
use_fischer_tropsch _waste_heat,--,"{true, false}",Add option for using waste heat of Fischer Tropsch in district heating networks
use_fuel_cell_waste_heat,--,"{true, false}",Add option for using waste heat of fuel cells in district heating networks
use_electrolysis_waste _heat,--,"{true, false}",Add option for using waste heat of electrolysis in district heating networks
electricity_transmission _grid,--,"{true, false}",Switch for enabling/disabling the electricity transmission grid.
electricity_distribution _grid,--,"{true, false}",Add a simplified representation of the exchange capacity between transmission and distribution grid level through a link.
electricity_distribution _grid_cost_factor,,,Multiplies the investment cost of the electricity distribution grid
,,,
electricity_grid _connection,--,"{true, false}",Add the cost of electricity grid connection for onshore wind and solar
transmission_efficiency,,,Section to specify transmission losses or compression energy demands of bidirectional links. Splits them into two capacity-linked unidirectional links.
-- {carrier},--,str,The carrier of the link.
-- -- efficiency_static,p.u.,float,Length-independent transmission efficiency.
-- -- efficiency_per_1000km,p.u. per 1000 km,float,Length-dependent transmission efficiency ($\eta^{\text{length}}$)
-- -- compression_per_1000km,p.u. per 1000 km,float,Length-dependent electricity demand for compression ($\eta \cdot \text{length}$) implemented as multi-link to local electricity bus.
H2_network,--,"{true, false}",Add option for new hydrogen pipelines
gas_network,--,"{true, false}","Add existing natural gas infrastructure, incl. LNG terminals, production and entry-points. The existing gas network is added with a lossless transport model. A length-weighted `k-edge augmentation algorithm <https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation.html#networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation>`_ can be run to add new candidate gas pipelines such that all regions of the model can be connected to the gas network. When activated, all the gas demands are regionally disaggregated as well."
H2_retrofit,--,"{true, false}",Add option for retrofiting existing pipelines to transport hydrogen.
H2_retrofit_capacity _per_CH4,--,float,"The ratio for H2 capacity per original CH4 capacity of retrofitted pipelines. The `European Hydrogen Backbone (April, 2020) p.15 <https://gasforclimate2050.eu/wp-content/uploads/2020/07/2020_European-Hydrogen-Backbone_Report.pdf>`_ 60% of original natural gas capacity could be used in cost-optimal case as H2 capacity."
gas_network_connectivity _upgrade ,--,float,The number of desired edge connectivity (k) in the length-weighted `k-edge augmentation algorithm <https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation.html#networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation>`_ used for the gas network
gas_distribution_grid,--,"{true, false}",Add a gas distribution grid
gas_distribution_grid _cost_factor,,,Multiplier for the investment cost of the gas distribution grid
,,,
biomass_spatial,--,"{true, false}",Add option for resolving biomass demand regionally
biomass_transport,--,"{true, false}",Add option for transporting solid biomass between nodes
biogas_upgrading_cc,--,"{true, false}",Add option to capture CO2 from biomass upgrading
conventional_generation,,,Add a more detailed description of conventional carriers. Any power generation requires the consumption of fuel from nodes representing that fuel.
biomass_to_liquid,--,"{true, false}",Add option for transforming solid biomass into liquid fuel with the same properties as oil
biosng,--,"{true, false}",Add option for transforming solid biomass into synthesis gas with the same properties as natural gas
municipal_solid_waste,--,"{true, false}",Add option for municipal solid waste
limit_max_growth,,,
-- enable,--,"{true, false}",Add option to limit the maximum growth of a carrier
-- factor,p.u.,float,The maximum growth factor of a carrier (e.g. 1.3 allows 30% larger than max historic growth)
-- max_growth,,,
-- -- {carrier},GW,float,The historic maximum growth of a carrier
-- max_relative_growth,,,
-- -- {carrier},p.u.,float,The historic maximum relative growth of a carrier
,,,
enhanced_geothermal,,,
-- enable,--,"{true, false}",Add option to include Enhanced Geothermal Systems
-- flexible,--,"{true, false}",Add option for flexible operation (see Ricks et al. 2024)
-- max_hours,--,int,The maximum hours the reservoir can be charged under flexible operation
-- max_boost,--,float,The maximum boost in power output under flexible operation
-- var_cf,--,"{true, false}",Add option for variable capacity factor (see Ricks et al. 2024)
-- sustainability_factor,--,float,Share of sourced heat that is replenished by the earth's core (see details in `build_egs_potentials.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/build_egs_potentials.py>`_)
solid_biomass_import,,,
-- enable,--,"{true, false}",Add option to include solid biomass imports
-- price,currency/MWh,float,Price for importing solid biomass
-- max_amount,Twh,float,Maximum solid biomass import potential
-- upstream_emissions_factor,p.u.,float,Upstream emissions of solid biomass imports

1 Unit Values Description
2 transport -- {true, false} Flag to include transport sector.
3 heating -- {true, false} Flag to include heating sector.
4 biomass -- {true, false} Flag to include biomass sector.
5 industry -- {true, false} Flag to include industry sector.
6 agriculture -- {true, false} Flag to include agriculture sector.
7 fossil_fuels -- {true, false} Flag to include imports of fossil fuels ( ["coal", "gas", "oil", "lignite"])
8 district_heating -- `prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_
9 -- potential -- float maximum fraction of urban demand which can be supplied by district heating
10 -- progress -- Dictionary with planning horizons as keys. Increase of today's district heating demand to potential maximum district heating share. Progress = 0 means today's district heating share. Progress = 1 means maximum fraction of urban demand is supplied by district heating
11 -- district_heating_loss -- float Share increase in district heat demand in urban central due to heat losses
12 cluster_heat_buses -- forward_temperature -- °C {true, false} float Cluster residential and service heat buses in `prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_ to one to save memory. Forward temperature in district heating
13 -- return_temperature °C float Return temperature in district heating. Must be lower than forward temperature
14 bev_dsm_restriction _value -- heat_source_cooling -- K float Adds a lower state of charge (SOC) limit for battery electric vehicles (BEV) to manage its own energy demand (DSM). Located in `build_transport_demand.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/build_transport_demand.py>`_. Set to 0 for no restriction on BEV DSM Cooling of heat source for heat pumps
15 bev_dsm_restriction _time -- heat_pump_cop_approximation -- float Time at which SOC of BEV has to be dsm_restriction_value
16 transport_heating _deadband_upper -- -- refrigerant °C -- float {ammonia, isobutane} The maximum temperature in the vehicle. At higher temperatures, the energy required for cooling in the vehicle increases. Heat pump refrigerant assumed for COP approximation
17 transport_heating _deadband_lower -- -- heat_exchanger_pinch_point_temperature_difference °C K float The minimum temperature in the vehicle. At lower temperatures, the energy required for heating in the vehicle increases. Heat pump pinch point temperature difference in heat exchangers assumed for approximation.
18 -- -- isentropic_compressor_efficiency -- float Isentropic efficiency of heat pump compressor assumed for approximation. Must be between 0 and 1.
19 ICE_lower_degree_factor -- -- heat_loss -- float Share increase in energy demand in internal combustion engine (ICE) for each degree difference between the cold environment and the minimum temperature. Heat pump heat loss assumed for approximation. Must be between 0 and 1.
20 ICE_upper_degree_factor -- heat_pump_sources -- float Share increase in energy demand in internal combustion engine (ICE) for each degree difference between the hot environment and the maximum temperature.
21 EV_lower_degree_factor -- -- urban central -- float List of heat sources for heat pumps in urban central heating Share increase in energy demand in electric vehicles (EV) for each degree difference between the cold environment and the minimum temperature.
22 EV_upper_degree_factor -- -- urban decentral -- float List of heat sources for heat pumps in urban decentral heating Share increase in energy demand in electric vehicles (EV) for each degree difference between the hot environment and the maximum temperature.
23 bev_dsm -- -- rural -- {true, false} List of heat sources for heat pumps in rural heating Add the option for battery electric vehicles (BEV) to participate in demand-side management (DSM)
24 cluster_heat_buses -- {true, false} Cluster residential and service heat buses in `prepare_sector_network.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/prepare_sector_network.py>`_ to one to save memory.
25 bev_availability -- float The share for battery electric vehicles (BEV) that are able to do demand side management (DSM)
26 bev_energy bev_dsm_restriction _value -- float The average size of battery electric vehicles (BEV) in MWh Adds a lower state of charge (SOC) limit for battery electric vehicles (BEV) to manage its own energy demand (DSM). Located in `build_transport_demand.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/build_transport_demand.py>`_. Set to 0 for no restriction on BEV DSM
27 bev_charge_efficiency bev_dsm_restriction _time -- float Battery electric vehicles (BEV) charge and discharge efficiency Time at which SOC of BEV has to be dsm_restriction_value
28 bev_charge_rate transport_heating _deadband_upper MWh °C float The power consumption for one electric vehicle (EV) in MWh. Value derived from 3-phase charger with 11 kW. The maximum temperature in the vehicle. At higher temperatures, the energy required for cooling in the vehicle increases.
29 bev_avail_max transport_heating _deadband_lower -- °C float The maximum share plugged-in availability for passenger electric vehicles. The minimum temperature in the vehicle. At lower temperatures, the energy required for heating in the vehicle increases.
30 bev_avail_mean -- float The average share plugged-in availability for passenger electric vehicles.
31 v2g ICE_lower_degree_factor -- {true, false} float Allows feed-in to grid from EV battery Share increase in energy demand in internal combustion engine (ICE) for each degree difference between the cold environment and the minimum temperature.
32 land_transport_fuel_cell _share ICE_upper_degree_factor -- Dictionary with planning horizons as keys. float The share of vehicles that uses fuel cells in a given year Share increase in energy demand in internal combustion engine (ICE) for each degree difference between the hot environment and the maximum temperature.
33 land_transport_electric _share EV_lower_degree_factor -- Dictionary with planning horizons as keys. float The share of vehicles that uses electric vehicles (EV) in a given year Share increase in energy demand in electric vehicles (EV) for each degree difference between the cold environment and the minimum temperature.
34 land_transport_ice _share EV_upper_degree_factor -- Dictionary with planning horizons as keys. float The share of vehicles that uses internal combustion engines (ICE) in a given year. What is not EV or FCEV is oil-fuelled ICE. Share increase in energy demand in electric vehicles (EV) for each degree difference between the hot environment and the maximum temperature.
35 transport_electric_efficiency bev_dsm MWh/100km -- float {true, false} The conversion efficiencies of electric vehicles in transport Add the option for battery electric vehicles (BEV) to participate in demand-side management (DSM)
36 transport_fuel_cell_efficiency MWh/100km float The H2 conversion efficiencies of fuel cells in transport
37 transport_ice_efficiency bev_availability MWh/100km -- float The oil conversion efficiencies of internal combustion engine (ICE) in transport The share for battery electric vehicles (BEV) that are able to do demand side management (DSM)
38 agriculture_machinery _electric_share bev_energy -- float The share for agricultural machinery that uses electricity The average size of battery electric vehicles (BEV) in MWh
39 agriculture_machinery _oil_share bev_charge_efficiency -- float The share for agricultural machinery that uses oil Battery electric vehicles (BEV) charge and discharge efficiency
40 agriculture_machinery _fuel_efficiency bev_charge_rate -- MWh float The efficiency of electric-powered machinery in the conversion of electricity to meet agricultural needs. The power consumption for one electric vehicle (EV) in MWh. Value derived from 3-phase charger with 11 kW.
41 agriculture_machinery _electric_efficiency bev_avail_max -- float The efficiency of oil-powered machinery in the conversion of oil to meet agricultural needs. The maximum share plugged-in availability for passenger electric vehicles.
42 Mwh_MeOH_per_MWh_H2 bev_avail_mean LHV -- float The energy amount of the produced methanol per energy amount of hydrogen. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 64. The average share plugged-in availability for passenger electric vehicles.
43 MWh_MeOH_per_tCO2 v2g LHV -- float {true, false} The energy amount of the produced methanol per ton of CO2. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 66. Allows feed-in to grid from EV battery
44 MWh_MeOH_per_MWh_e land_transport_fuel_cell _share LHV -- float Dictionary with planning horizons as keys. The energy amount of the produced methanol per energy amount of electricity. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 64. The share of vehicles that uses fuel cells in a given year
45 shipping_hydrogen _liquefaction land_transport_electric _share -- {true, false} Dictionary with planning horizons as keys. Whether to include liquefaction costs for hydrogen demand in shipping. The share of vehicles that uses electric vehicles (EV) in a given year
46 land_transport_ice _share -- Dictionary with planning horizons as keys. The share of vehicles that uses internal combustion engines (ICE) in a given year. What is not EV or FCEV is oil-fuelled ICE.
47 shipping_hydrogen_share transport_electric_efficiency -- MWh/100km Dictionary with planning horizons as keys. float The share of ships powered by hydrogen in a given year The conversion efficiencies of electric vehicles in transport
48 shipping_methanol_share transport_fuel_cell_efficiency -- MWh/100km Dictionary with planning horizons as keys. float The share of ships powered by methanol in a given year The H2 conversion efficiencies of fuel cells in transport
49 shipping_oil_share transport_ice_efficiency -- MWh/100km Dictionary with planning horizons as keys. float The share of ships powered by oil in a given year The oil conversion efficiencies of internal combustion engine (ICE) in transport
50 shipping_methanol _efficiency agriculture_machinery _electric_share -- float The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the `IEA <https://www.iea-amf.org/app/webroot/files/file/Annex%20Reports/AMF_Annex_56.pdf>`_ The share for agricultural machinery that uses electricity
51 agriculture_machinery _oil_share -- float The share for agricultural machinery that uses oil
52 shipping_oil_efficiency agriculture_machinery _fuel_efficiency -- float The efficiency of oil-powered ships in the conversion of oil to meet shipping needs (propulsion). Base value derived from 2011 The efficiency of electric-powered machinery in the conversion of electricity to meet agricultural needs.
53 aviation_demand_factor agriculture_machinery _electric_efficiency -- float The proportion of demand for aviation compared to today's consumption The efficiency of oil-powered machinery in the conversion of oil to meet agricultural needs.
54 HVC_demand_factor Mwh_MeOH_per_MWh_H2 -- LHV float The proportion of demand for high-value chemicals compared to today's consumption The energy amount of the produced methanol per energy amount of hydrogen. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 64.
55 MWh_MeOH_per_tCO2 LHV float The energy amount of the produced methanol per ton of CO2. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 66.
56 time_dep_hp_cop MWh_MeOH_per_MWh_e -- LHV {true, false} float Consider the time dependent coefficient of performance (COP) of the heat pump The energy amount of the produced methanol per energy amount of electricity. From `DECHEMA (2017) <https://dechema.de/dechema_media/Downloads/Positionspapiere/Technology_study_Low_carbon_energy_and_feedstock_for_the_European_chemical_industry-p-20002750.pdf>`_, page 64.
57 heat_pump_sink_T shipping_hydrogen _liquefaction °C -- float {true, false} The temperature heat sink used in heat pumps based on DTU / large area radiators. The value is conservatively high to cover hot water and space heating in poorly-insulated buildings Whether to include liquefaction costs for hydrogen demand in shipping.
58 reduce_space_heat _exogenously -- {true, false} Influence on space heating demand by a certain factor (applied before losses in district heating).
59 reduce_space_heat _exogenously_factor shipping_hydrogen_share -- Dictionary with planning horizons as keys. A positive factor can mean renovation or demolition of a building. If the factor is negative, it can mean an increase in floor area, increased thermal comfort, population growth. The default factors are determined by the `Eurocalc Homes and buildings decarbonization scenario <http://tool.european-calculator.eu/app/buildings/building-types-area/?levers=1ddd4444421213bdbbbddd44444ffffff11f411111221111211l212221>`_ The share of ships powered by hydrogen in a given year
60 retrofitting shipping_methanol_share -- Dictionary with planning horizons as keys. The share of ships powered by methanol in a given year
61 -- retro_endogen shipping_oil_share -- {true, false} Dictionary with planning horizons as keys. Add retrofitting as an endogenous system which co-optimise space heat savings. The share of ships powered by oil in a given year
62 -- cost_factor shipping_methanol _efficiency -- float Weight costs for building renovation The efficiency of methanol-powered ships in the conversion of methanol to meet shipping needs (propulsion). The efficiency increase from oil can be 10-15% higher according to the `IEA <https://www.iea-amf.org/app/webroot/files/file/Annex%20Reports/AMF_Annex_56.pdf>`_
63 -- interest_rate -- float The interest rate for investment in building components
64 -- annualise_cost shipping_oil_efficiency -- {true, false} float Annualise the investment costs of retrofitting The efficiency of oil-powered ships in the conversion of oil to meet shipping needs (propulsion). Base value derived from 2011
65 -- tax_weighting aviation_demand_factor -- {true, false} float Weight the costs of retrofitting depending on taxes in countries The proportion of demand for aviation compared to today's consumption
66 -- construction_index HVC_demand_factor -- {true, false} float Weight the costs of retrofitting depending on labour/material costs per country The proportion of demand for high-value chemicals compared to today's consumption
67 tes -- {true, false} Add option for storing thermal energy in large water pits associated with district heating systems and individual thermal energy storage (TES)
68 tes_tau time_dep_hp_cop -- {true, false} The time constant used to calculate the decay of thermal energy in thermal energy storage (TES): 1- :math:`e^{-1/24τ}`. Consider the time dependent coefficient of performance (COP) of the heat pump
69 -- decentral heat_pump_sink_T days °C float The time constant in decentralized thermal energy storage (TES) The temperature heat sink used in heat pumps based on DTU / large area radiators. The value is conservatively high to cover hot water and space heating in poorly-insulated buildings
70 -- central reduce_space_heat _exogenously days -- float {true, false} The time constant in centralized thermal energy storage (TES) Influence on space heating demand by a certain factor (applied before losses in district heating).
71 boilers reduce_space_heat _exogenously_factor -- {true, false} Dictionary with planning horizons as keys. Add option for transforming gas into heat using gas boilers A positive factor can mean renovation or demolition of a building. If the factor is negative, it can mean an increase in floor area, increased thermal comfort, population growth. The default factors are determined by the `Eurocalc Homes and buildings decarbonization scenario <http://tool.european-calculator.eu/app/buildings/building-types-area/?levers=1ddd4444421213bdbbbddd44444ffffff11f411111221111211l212221>`_
72 resistive_heaters retrofitting -- {true, false} Add option for transforming electricity into heat using resistive heaters (independently from gas boilers)
73 oil_boilers -- retro_endogen -- {true, false} Add option for transforming oil into heat using boilers Add retrofitting as an endogenous system which co-optimise space heat savings.
74 biomass_boiler -- cost_factor -- {true, false} float Add option for transforming biomass into heat using boilers Weight costs for building renovation
75 overdimension_individual_heating -- interest_rate -- float Add option for overdimensioning individual heating systems by a certain factor. This allows them to cover heat demand peaks e.g. 10% higher than those in the data with a setting of 1.1. The interest rate for investment in building components
76 chp -- annualise_cost -- {true, false} Add option for using Combined Heat and Power (CHP) Annualise the investment costs of retrofitting
77 micro_chp -- tax_weighting -- {true, false} Add option for using Combined Heat and Power (CHP) for decentral areas. Weight the costs of retrofitting depending on taxes in countries
78 solar_thermal -- construction_index -- {true, false} Add option for using solar thermal to generate heat. Weight the costs of retrofitting depending on labour/material costs per country
79 solar_cf_correction tes -- float {true, false} The correction factor for the value provided by the solar thermal profile calculations Add option for storing thermal energy in large water pits associated with district heating systems and individual thermal energy storage (TES)
80 marginal_cost_storage tes_tau currency/MWh float The marginal cost of discharging batteries in distributed grids The time constant used to calculate the decay of thermal energy in thermal energy storage (TES): 1- :math:`e^{-1/24τ}`.
81 methanation -- decentral -- days {true, false} float Add option for transforming hydrogen and CO2 into methane using methanation. The time constant in decentralized thermal energy storage (TES)
82 coal_cc -- central -- days {true, false} float Add option for coal CHPs with carbon capture The time constant in centralized thermal energy storage (TES)
83 dac boilers -- {true, false} Add option for Direct Air Capture (DAC) Add option for transforming gas into heat using gas boilers
84 co2_vent resistive_heaters -- {true, false} Add option for vent out CO2 from storages to the atmosphere. Add option for transforming electricity into heat using resistive heaters (independently from gas boilers)
85 allam_cycle oil_boilers -- {true, false} Add option to include `Allam cycle gas power plants <https://en.wikipedia.org/wiki/Allam_power_cycle>`_ Add option for transforming oil into heat using boilers
86 hydrogen_fuel_cell biomass_boiler -- {true, false} Add option to include hydrogen fuel cell for re-electrification. Assuming OCGT technology costs Add option for transforming biomass into heat using boilers
87 hydrogen_turbine overdimension_individual_heating -- {true, false} float Add option to include hydrogen turbine for re-electrification. Assuming OCGT technology costs Add option for overdimensioning individual heating systems by a certain factor. This allows them to cover heat demand peaks e.g. 10% higher than those in the data with a setting of 1.1.
88 SMR chp -- {true, false} Add option for transforming natural gas into hydrogen and CO2 using Steam Methane Reforming (SMR) Add option for using Combined Heat and Power (CHP)
89 SMR CC micro_chp -- {true, false} Add option for transforming natural gas into hydrogen and CO2 using Steam Methane Reforming (SMR) and Carbon Capture (CC) Add option for using Combined Heat and Power (CHP) for decentral areas.
90 regional_methanol_demand solar_thermal -- {true, false} Spatially resolve methanol demand. Set to true if regional CO2 constraints needed. Add option for using solar thermal to generate heat.
91 regional_oil_demand solar_cf_correction -- {true, false} float Spatially resolve oil demand. Set to true if regional CO2 constraints needed. The correction factor for the value provided by the solar thermal profile calculations
92 regional_co2 _sequestration_potential marginal_cost_storage currency/MWh float The marginal cost of discharging batteries in distributed grids
93 -- enable methanation -- {true, false} Add option for regionally-resolved geological carbon dioxide sequestration potentials based on `CO2StoP <https://setis.ec.europa.eu/european-co2-storage-database_en>`_. Add option for transforming hydrogen and CO2 into methane using methanation.
94 -- attribute coal_cc -- string or list {true, false} Name (or list of names) of the attribute(s) for the sequestration potential Add option for coal CHPs with carbon capture
95 -- include_onshore dac -- {true, false} Add options for including onshore sequestration potentials Add option for Direct Air Capture (DAC)
96 -- min_size co2_vent Gt -- float {true, false} Any sites with lower potential than this value will be excluded Add option for vent out CO2 from storages to the atmosphere.
97 -- max_size allam_cycle Gt -- float {true, false} The maximum sequestration potential for any one site. Add option to include `Allam cycle gas power plants <https://en.wikipedia.org/wiki/Allam_power_cycle>`_
98 -- years_of_storage hydrogen_fuel_cell years -- float {true, false} The years until potential exhausted at optimised annual rate Add option to include hydrogen fuel cell for re-electrification. Assuming OCGT technology costs
99 co2_sequestration_potential hydrogen_turbine MtCO2/a -- float {true, false} The potential of sequestering CO2 in Europe per year Add option to include hydrogen turbine for re-electrification. Assuming OCGT technology costs
100 co2_sequestration_cost SMR currency/tCO2 -- float {true, false} The cost of sequestering a ton of CO2 Add option for transforming natural gas into hydrogen and CO2 using Steam Methane Reforming (SMR)
101 co2_sequestration_lifetime SMR CC years -- int {true, false} The lifetime of a CO2 sequestration site Add option for transforming natural gas into hydrogen and CO2 using Steam Methane Reforming (SMR) and Carbon Capture (CC)
102 co2_spatial regional_methanol_demand -- {true, false} Add option to spatially resolve carrier representing stored carbon dioxide. This allows for more detailed modelling of CCUTS, e.g. regarding the capturing of industrial process emissions, usage as feedstock for electrofuels, transport of carbon dioxide, and geological sequestration sites. Spatially resolve methanol demand. Set to true if regional CO2 constraints needed.
103 regional_oil_demand -- {true, false} Spatially resolve oil demand. Set to true if regional CO2 constraints needed.
104 co2network regional_co2 _sequestration_potential -- {true, false} Add option for planning a new carbon dioxide transmission network
105 co2_network_cost_factor -- enable p.u. -- float {true, false} The cost factor for the capital cost of the carbon dioxide transmission network Add option for regionally-resolved geological carbon dioxide sequestration potentials based on `CO2StoP <https://setis.ec.europa.eu/european-co2-storage-database_en>`_.
106 -- attribute -- string or list Name (or list of names) of the attribute(s) for the sequestration potential
107 cc_fraction -- include_onshore -- float {true, false} The default fraction of CO2 captured with post-combustion capture Add options for including onshore sequestration potentials
108 hydrogen_underground _storage -- min_size -- Gt {true, false} float Add options for storing hydrogen underground. Storage potential depends regionally. Any sites with lower potential than this value will be excluded
109 hydrogen_underground _storage_locations -- max_size Gt {onshore, nearshore, offshore} float The location where hydrogen underground storage can be located. Onshore, nearshore, offshore means it must be located more than 50 km away from the sea, within 50 km of the sea, or within the sea itself respectively. The maximum sequestration potential for any one site.
110 -- years_of_storage years float The years until potential exhausted at optimised annual rate
111 ammonia co2_sequestration_potential -- MtCO2/a {true, false, regional} float Add ammonia as a carrrier. It can be either true (copperplated NH3), false (no NH3 carrier) or "regional" (regionalised NH3 without network) The potential of sequestering CO2 in Europe per year
112 min_part_load_fischer _tropsch co2_sequestration_cost per unit of p_nom currency/tCO2 float The minimum unit dispatch (``p_min_pu``) for the Fischer-Tropsch process The cost of sequestering a ton of CO2
113 min_part_load _methanolisation co2_sequestration_lifetime per unit of p_nom years float int The minimum unit dispatch (``p_min_pu``) for the methanolisation process The lifetime of a CO2 sequestration site
114 co2_spatial -- {true, false} Add option to spatially resolve carrier representing stored carbon dioxide. This allows for more detailed modelling of CCUTS, e.g. regarding the capturing of industrial process emissions, usage as feedstock for electrofuels, transport of carbon dioxide, and geological sequestration sites.
115 use_fischer_tropsch _waste_heat -- {true, false} Add option for using waste heat of Fischer Tropsch in district heating networks
116 use_fuel_cell_waste_heat co2network -- {true, false} Add option for using waste heat of fuel cells in district heating networks Add option for planning a new carbon dioxide transmission network
117 use_electrolysis_waste _heat co2_network_cost_factor -- p.u. {true, false} float Add option for using waste heat of electrolysis in district heating networks The cost factor for the capital cost of the carbon dioxide transmission network
118 electricity_transmission _grid -- {true, false} Switch for enabling/disabling the electricity transmission grid.
119 electricity_distribution _grid cc_fraction -- {true, false} float Add a simplified representation of the exchange capacity between transmission and distribution grid level through a link. The default fraction of CO2 captured with post-combustion capture
120 electricity_distribution _grid_cost_factor hydrogen_underground _storage -- {true, false} Multiplies the investment cost of the electricity distribution grid Add options for storing hydrogen underground. Storage potential depends regionally.
121 hydrogen_underground _storage_locations {onshore, nearshore, offshore} The location where hydrogen underground storage can be located. Onshore, nearshore, offshore means it must be located more than 50 km away from the sea, within 50 km of the sea, or within the sea itself respectively.
122 electricity_grid _connection -- {true, false} Add the cost of electricity grid connection for onshore wind and solar
123 transmission_efficiency ammonia -- {true, false, regional} Section to specify transmission losses or compression energy demands of bidirectional links. Splits them into two capacity-linked unidirectional links. Add ammonia as a carrrier. It can be either true (copperplated NH3), false (no NH3 carrier) or "regional" (regionalised NH3 without network)
124 -- {carrier} min_part_load_fischer _tropsch -- per unit of p_nom str float The carrier of the link. The minimum unit dispatch (``p_min_pu``) for the Fischer-Tropsch process
125 -- -- efficiency_static min_part_load _methanolisation p.u. per unit of p_nom float Length-independent transmission efficiency. The minimum unit dispatch (``p_min_pu``) for the methanolisation process
126 -- -- efficiency_per_1000km p.u. per 1000 km float Length-dependent transmission efficiency ($\eta^{\text{length}}$)
127 -- -- compression_per_1000km use_fischer_tropsch _waste_heat p.u. per 1000 km -- float {true, false} Length-dependent electricity demand for compression ($\eta \cdot \text{length}$) implemented as multi-link to local electricity bus. Add option for using waste heat of Fischer Tropsch in district heating networks
128 H2_network use_fuel_cell_waste_heat -- {true, false} Add option for new hydrogen pipelines Add option for using waste heat of fuel cells in district heating networks
129 gas_network use_electrolysis_waste _heat -- {true, false} Add existing natural gas infrastructure, incl. LNG terminals, production and entry-points. The existing gas network is added with a lossless transport model. A length-weighted `k-edge augmentation algorithm <https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation.html#networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation>`_ can be run to add new candidate gas pipelines such that all regions of the model can be connected to the gas network. When activated, all the gas demands are regionally disaggregated as well. Add option for using waste heat of electrolysis in district heating networks
130 H2_retrofit electricity_transmission _grid -- {true, false} Add option for retrofiting existing pipelines to transport hydrogen. Switch for enabling/disabling the electricity transmission grid.
131 H2_retrofit_capacity _per_CH4 electricity_distribution _grid -- float {true, false} The ratio for H2 capacity per original CH4 capacity of retrofitted pipelines. The `European Hydrogen Backbone (April, 2020) p.15 <https://gasforclimate2050.eu/wp-content/uploads/2020/07/2020_European-Hydrogen-Backbone_Report.pdf>`_ 60% of original natural gas capacity could be used in cost-optimal case as H2 capacity. Add a simplified representation of the exchange capacity between transmission and distribution grid level through a link.
132 gas_network_connectivity _upgrade electricity_distribution _grid_cost_factor -- float The number of desired edge connectivity (k) in the length-weighted `k-edge augmentation algorithm <https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation.html#networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation>`_ used for the gas network Multiplies the investment cost of the electricity distribution grid
133 gas_distribution_grid -- {true, false} Add a gas distribution grid
134 gas_distribution_grid _cost_factor electricity_grid _connection -- {true, false} Multiplier for the investment cost of the gas distribution grid Add the cost of electricity grid connection for onshore wind and solar
135 transmission_efficiency Section to specify transmission losses or compression energy demands of bidirectional links. Splits them into two capacity-linked unidirectional links.
136 biomass_spatial -- {carrier} -- {true, false} str Add option for resolving biomass demand regionally The carrier of the link.
137 biomass_transport -- -- efficiency_static -- p.u. {true, false} float Add option for transporting solid biomass between nodes Length-independent transmission efficiency.
138 biogas_upgrading_cc -- -- efficiency_per_1000km -- p.u. per 1000 km {true, false} float Add option to capture CO2 from biomass upgrading Length-dependent transmission efficiency ($\eta^{\text{length}}$)
139 conventional_generation -- -- compression_per_1000km p.u. per 1000 km float Add a more detailed description of conventional carriers. Any power generation requires the consumption of fuel from nodes representing that fuel. Length-dependent electricity demand for compression ($\eta \cdot \text{length}$) implemented as multi-link to local electricity bus.
140 biomass_to_liquid H2_network -- {true, false} Add option for transforming solid biomass into liquid fuel with the same properties as oil Add option for new hydrogen pipelines
141 biosng gas_network -- {true, false} Add option for transforming solid biomass into synthesis gas with the same properties as natural gas Add existing natural gas infrastructure, incl. LNG terminals, production and entry-points. The existing gas network is added with a lossless transport model. A length-weighted `k-edge augmentation algorithm <https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation.html#networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation>`_ can be run to add new candidate gas pipelines such that all regions of the model can be connected to the gas network. When activated, all the gas demands are regionally disaggregated as well.
142 municipal_solid_waste H2_retrofit -- {true, false} Add option for municipal solid waste Add option for retrofiting existing pipelines to transport hydrogen.
143 limit_max_growth H2_retrofit_capacity _per_CH4 -- float The ratio for H2 capacity per original CH4 capacity of retrofitted pipelines. The `European Hydrogen Backbone (April, 2020) p.15 <https://gasforclimate2050.eu/wp-content/uploads/2020/07/2020_European-Hydrogen-Backbone_Report.pdf>`_ 60% of original natural gas capacity could be used in cost-optimal case as H2 capacity.
144 -- enable gas_network_connectivity _upgrade -- {true, false} float Add option to limit the maximum growth of a carrier The number of desired edge connectivity (k) in the length-weighted `k-edge augmentation algorithm <https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation.html#networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation>`_ used for the gas network
145 -- factor gas_distribution_grid p.u. -- float {true, false} The maximum growth factor of a carrier (e.g. 1.3 allows 30% larger than max historic growth) Add a gas distribution grid
146 -- max_growth gas_distribution_grid _cost_factor Multiplier for the investment cost of the gas distribution grid
147 -- -- {carrier} GW float The historic maximum growth of a carrier
148 -- max_relative_growth biomass_spatial -- {true, false} Add option for resolving biomass demand regionally
149 -- -- {carrier} biomass_transport p.u. -- float {true, false} The historic maximum relative growth of a carrier Add option for transporting solid biomass between nodes
150 biogas_upgrading_cc -- {true, false} Add option to capture CO2 from biomass upgrading
151 enhanced_geothermal conventional_generation Add a more detailed description of conventional carriers. Any power generation requires the consumption of fuel from nodes representing that fuel.
152 -- enable biomass_to_liquid -- {true, false} Add option to include Enhanced Geothermal Systems Add option for transforming solid biomass into liquid fuel with the same properties as oil
153 -- flexible biosng -- {true, false} Add option for flexible operation (see Ricks et al. 2024) Add option for transforming solid biomass into synthesis gas with the same properties as natural gas
154 -- max_hours municipal_solid_waste -- int {true, false} The maximum hours the reservoir can be charged under flexible operation Add option for municipal solid waste
155 -- max_boost limit_max_growth -- float The maximum boost in power output under flexible operation
156 -- var_cf -- enable -- {true, false} Add option for variable capacity factor (see Ricks et al. 2024) Add option to limit the maximum growth of a carrier
157 -- sustainability_factor -- factor -- p.u. float Share of sourced heat that is replenished by the earth's core (see details in `build_egs_potentials.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/build_egs_potentials.py>`_) The maximum growth factor of a carrier (e.g. 1.3 allows 30% larger than max historic growth)
158 solid_biomass_import -- max_growth
159 -- enable -- -- {carrier} -- GW {true, false} float Add option to include solid biomass imports The historic maximum growth of a carrier
160 -- price -- max_relative_growth currency/MWh float Price for importing solid biomass
161 -- max_amount -- -- {carrier} Twh p.u. float Maximum solid biomass import potential The historic maximum relative growth of a carrier
162 -- upstream_emissions_factor p.u. float Upstream emissions of solid biomass imports
163 enhanced_geothermal
164 -- enable -- {true, false} Add option to include Enhanced Geothermal Systems
165 -- flexible -- {true, false} Add option for flexible operation (see Ricks et al. 2024)
166 -- max_hours -- int The maximum hours the reservoir can be charged under flexible operation
167 -- max_boost -- float The maximum boost in power output under flexible operation
168 -- var_cf -- {true, false} Add option for variable capacity factor (see Ricks et al. 2024)
169 -- sustainability_factor -- float Share of sourced heat that is replenished by the earth's core (see details in `build_egs_potentials.py <https://github.com/PyPSA/pypsa-eur-sec/blob/master/scripts/build_egs_potentials.py>`_)
170 solid_biomass_import
171 -- enable -- {true, false} Add option to include solid biomass imports
172 -- price currency/MWh float Price for importing solid biomass
173 -- max_amount Twh float Maximum solid biomass import potential
174 -- upstream_emissions_factor p.u. float Upstream emissions of solid biomass imports

View File

@ -41,11 +41,6 @@ Rule ``build_cutout``
.. automodule:: build_cutout
Rule ``prepare_links_p_nom``
===============================
.. automodule:: prepare_links_p_nom
.. _base:
Rule ``base_network``

View File

@ -19,6 +19,14 @@ Upcoming Release
* Add flag ``sector: fossil_fuels`` in config to remove the option of importing fossil fuels
* Added unsustainable biomass potentials for solid, gaseous, and liquid biomass. The potentials can be phased-out and/or
substituted by the phase-in of sustainable biomass types using the config parameters
``biomass: share_unsustainable_use_retained`` and ``biomass: share_sustainable_potential_available``.
* The rule ``prepare_links_p_nom`` was removed since it was outdated and not used.
* Changed heat pump COP approximation for central heating to be based on `Jensen et al. (2018) <https://backend.orbit.dtu.dk/ws/portalfiles/portal/151965635/MAIN_Final.pdf>`__ and a default forward temperature of 90C. This is more realistic for district heating than the previously used approximation method.
* split solid biomass potentials into solid biomass and municipal solid waste. Add option to use municipal solid waste. This option is only activated in combination with the flag ``waste_to_energy``
* Add option to import solid biomass

View File

@ -17,7 +17,6 @@ tabula-py
# cartopy
scikit-learn
pycountry
pyyaml
seaborn
memory_profiler

View File

@ -18,7 +18,6 @@ dependencies:
# Dependencies of the workflow itself
- xlrd
- openpyxl!=3.1.1
- pycountry
- seaborn
- snakemake-minimal>=8.14
- memory_profiler

View File

@ -2,21 +2,6 @@
#
# SPDX-License-Identifier: MIT
if config["enable"].get("prepare_links_p_nom", False):
rule prepare_links_p_nom:
output:
"data/links_p_nom.csv",
log:
logs("prepare_links_p_nom.log"),
threads: 1
resources:
mem_mb=1500,
conda:
"../envs/environment.yaml"
script:
"../scripts/prepare_links_p_nom.py"
rule build_electricity_demand:
params:
@ -106,8 +91,8 @@ rule build_shapes:
params:
countries=config_provider("countries"),
input:
naturalearth=ancient("data/bundle/naturalearth/ne_10m_admin_0_countries.shp"),
eez=ancient("data/bundle/eez/World_EEZ_v8_2014.shp"),
naturalearth=ancient("data/naturalearth/ne_10m_admin_0_countries_deu.shp"),
eez=ancient("data/eez/World_EEZ_v12_20231025_gpkg/eez_v12.gpkg"),
nuts3=ancient("data/bundle/NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp"),
nuts3pop=ancient("data/bundle/nama_10r_3popgdp.tsv.gz"),
nuts3gdp=ancient("data/bundle/nama_10r_3gdp.tsv.gz"),

View File

@ -217,13 +217,27 @@ rule build_temperature_profiles:
rule build_cop_profiles:
params:
heat_pump_sink_T=config_provider("sector", "heat_pump_sink_T"),
heat_pump_sink_T_decentral_heating=config_provider(
"sector", "heat_pump_sink_T_individual_heating"
),
forward_temperature_central_heating=config_provider(
"sector", "district_heating", "forward_temperature"
),
return_temperature_central_heating=config_provider(
"sector", "district_heating", "return_temperature"
),
heat_source_cooling_central_heating=config_provider(
"sector", "district_heating", "heat_source_cooling"
),
heat_pump_cop_approximation_central_heating=config_provider(
"sector", "district_heating", "heat_pump_cop_approximation"
),
heat_pump_sources=config_provider("sector", "heat_pump_sources"),
input:
temp_soil_total=resources("temp_soil_total_elec_s{simpl}_{clusters}.nc"),
temp_air_total=resources("temp_air_total_elec_s{simpl}_{clusters}.nc"),
output:
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_profiles=resources("cop_profiles_elec_s{simpl}_{clusters}.nc"),
resources:
mem_mb=20000,
log:
@ -233,7 +247,7 @@ rule build_cop_profiles:
conda:
"../envs/environment.yaml"
script:
"../scripts/build_cop_profiles.py"
"../scripts/build_cop_profiles/run.py"
def solar_thermal_cutout(wildcards):
@ -331,7 +345,8 @@ rule build_biomass_potentials:
"https://zenodo.org/records/10356004/files/ENSPRESO_BIOMASS.xlsx",
keep_local=True,
),
nuts2="data/bundle/nuts/NUTS_RG_10M_2013_4326_LEVL_2.geojson", # https://gisco-services.ec.europa.eu/distribution/v2/nuts/download/#nuts21
eurostat="data/eurostat/Balances-April2023",
nuts2="data/bundle/nuts/NUTS_RG_10M_2013_4326_LEVL_2.geojson",
regions_onshore=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
nuts3_population=ancient("data/bundle/nama_10r_3popgdp.tsv.gz"),
swiss_cantons=ancient("data/ch_cantons.csv"),
@ -344,7 +359,7 @@ rule build_biomass_potentials:
biomass_potentials=resources(
"biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.csv"
),
threads: 1
threads: 8
resources:
mem_mb=1000,
log:
@ -943,7 +958,10 @@ rule prepare_sector_network:
countries=config_provider("countries"),
adjustments=config_provider("adjustments", "sector"),
emissions_scope=config_provider("energy", "emissions"),
biomass=config_provider("biomass"),
RDIR=RDIR,
heat_pump_sources=config_provider("sector", "heat_pump_sources"),
heat_systems=config_provider("sector", "heat_systems"),
input:
unpack(input_profile_offwind),
**rules.cluster_gas_network.output,
@ -1020,8 +1038,7 @@ rule prepare_sector_network:
),
temp_soil_total=resources("temp_soil_total_elec_s{simpl}_{clusters}.nc"),
temp_air_total=resources("temp_air_total_elec_s{simpl}_{clusters}.nc"),
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_profiles=resources("cop_profiles_elec_s{simpl}_{clusters}.nc"),
solar_thermal_total=lambda w: (
resources("solar_thermal_total_elec_s{simpl}_{clusters}.nc")
if config_provider("sector", "solar_thermal")(w)

View File

@ -4,6 +4,7 @@
import requests
from datetime import datetime, timedelta
from shutil import move, unpack_archive
if config["enable"].get("retrieve", "auto") == "auto":
config["enable"]["retrieve"] = has_internet_access()
@ -15,8 +16,6 @@ if config["enable"]["retrieve"] is False:
if config["enable"]["retrieve"] and config["enable"].get("retrieve_databundle", True):
datafiles = [
"je-e-21.03.02.xls",
"eez/World_EEZ_v8_2014.shp",
"naturalearth/ne_10m_admin_0_countries.shp",
"NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp",
"nama_10r_3popgdp.tsv.gz",
"nama_10r_3gdp.tsv.gz",
@ -223,6 +222,64 @@ if config["enable"]["retrieve"]:
move(input[0], output[0])
if config["enable"]["retrieve"]:
rule retrieve_eez:
params:
zip="data/eez/World_EEZ_v12_20231025_gpkg.zip",
output:
gpkg="data/eez/World_EEZ_v12_20231025_gpkg/eez_v12.gpkg",
run:
import os
import requests
from uuid import uuid4
name = str(uuid4())[:8]
org = str(uuid4())[:8]
response = requests.post(
"https://www.marineregions.org/download_file.php",
params={"name": "World_EEZ_v12_20231025_gpkg.zip"},
data={
"name": name,
"organisation": org,
"email": f"{name}@{org}.org",
"country": "Germany",
"user_category": "academia",
"purpose_category": "Research",
"agree": "1",
},
)
with open(params["zip"], "wb") as f:
f.write(response.content)
output_folder = Path(params["zip"]).parent
unpack_archive(params["zip"], output_folder)
os.remove(params["zip"])
if config["enable"]["retrieve"]:
# Download directly from naciscdn.org which is a redirect from naturalearth.com
# (https://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-0-countries/)
# Use point-of-view (POV) variant of Germany so that Crimea is included.
rule retrieve_naturalearth_countries:
input:
storage(
"https://naciscdn.org/naturalearth/10m/cultural/ne_10m_admin_0_countries_deu.zip"
),
params:
zip="data/naturalearth/ne_10m_admin_0_countries_deu.zip",
output:
countries="data/naturalearth/ne_10m_admin_0_countries_deu.shp",
run:
move(input[0], params["zip"])
output_folder = Path(output["countries"]).parent
unpack_archive(params["zip"], output_folder)
os.remove(params["zip"])
if config["enable"]["retrieve"]:
# Some logic to find the correct file URL
# Sometimes files are released delayed or ahead of schedule, check which file is currently available

View File

@ -9,6 +9,7 @@ rule add_existing_baseyear:
sector=config_provider("sector"),
existing_capacities=config_provider("existing_capacities"),
costs=config_provider("costs"),
heat_pump_sources=config_provider("sector", "heat_pump_sources"),
input:
network=RESULTS
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
@ -21,8 +22,7 @@ rule add_existing_baseyear:
config_provider("scenario", "planning_horizons", 0)(w)
)
),
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_profiles=resources("cop_profiles_elec_s{simpl}_{clusters}.nc"),
existing_heating_distribution=resources(
"existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
),
@ -69,6 +69,7 @@ rule add_brownfield:
snapshots=config_provider("snapshots"),
drop_leap_day=config_provider("enable", "drop_leap_day"),
carriers=config_provider("electricity", "renewable_carriers"),
heat_pump_sources=config_provider("sector", "heat_pump_sources"),
input:
unpack(input_profile_tech_brownfield),
simplify_busmap=resources("busmap_elec_s{simpl}.csv"),
@ -77,8 +78,7 @@ rule add_brownfield:
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
network_p=solved_previous_horizon, #solved network at previous time step
costs=resources("costs_{planning_horizons}.csv"),
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_profiles=resources("cop_profiles_elec_s{simpl}_{clusters}.nc"),
output:
RESULTS
+ "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",

View File

@ -7,6 +7,7 @@ rule add_existing_baseyear:
sector=config_provider("sector"),
existing_capacities=config_provider("existing_capacities"),
costs=config_provider("costs"),
heat_pump_sources=config_provider("sector", "heat_pump_sources"),
input:
network=RESULTS
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
@ -19,8 +20,7 @@ rule add_existing_baseyear:
config_provider("scenario", "planning_horizons", 0)(w)
)
),
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
cop_profiles=resources("cop_profiles_elec_s{simpl}_{clusters}.nc"),
existing_heating_distribution=resources(
"existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
),

View File

@ -24,6 +24,10 @@ from _helpers import (
from add_electricity import sanitize_carriers
from prepare_sector_network import cluster_heat_buses, define_spatial, prepare_costs
from scripts.definitions.heat_sector import HeatSector
from scripts.definitions.heat_system import HeatSystem
from scripts.definitions.heat_system_type import HeatSystemType
logger = logging.getLogger(__name__)
cc = coco.CountryConverter()
idx = pd.IndexSlice
@ -416,14 +420,14 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas
def add_heating_capacities_installed_before_baseyear(
n,
baseyear,
grouping_years,
ashp_cop,
gshp_cop,
time_dep_hp_cop,
costs,
default_lifetime,
n: pypsa.Network,
baseyear: int,
grouping_years: list,
cop: dict,
time_dep_hp_cop: bool,
costs: pd.DataFrame,
default_lifetime: int,
existing_heating: pd.DataFrame,
):
"""
Parameters
@ -435,141 +439,158 @@ def add_heating_capacities_installed_before_baseyear(
currently assumed heating capacities split between residential and
services proportional to heating load in both 50% capacities
in rural buses 50% in urban buses
cop: xr.DataArray
DataArray with time-dependent coefficients of performance (COPs) heat pumps. Coordinates are heat sources (see config), heat system types (see :file:`scripts/enums/HeatSystemType.py`), nodes and snapshots.
time_dep_hp_cop: bool
If True, time-dependent (dynamic) COPs are used for heat pumps
"""
logger.debug(f"Adding heating capacities installed before {baseyear}")
existing_heating = pd.read_csv(
snakemake.input.existing_heating_distribution, header=[0, 1], index_col=0
)
for heat_system in existing_heating.columns.get_level_values(0).unique():
heat_system = HeatSystem(heat_system)
for name in existing_heating.columns.get_level_values(0).unique():
name_type = "central" if name == "urban central" else "decentral"
nodes = pd.Index(
n.buses.location[n.buses.index.str.contains(f"{heat_system} heat")]
)
nodes = pd.Index(n.buses.location[n.buses.index.str.contains(f"{name} heat")])
if (name_type != "central") and options["electricity_distribution_grid"]:
if (not heat_system == HeatSystem.URBAN_CENTRAL) and options[
"electricity_distribution_grid"
]:
nodes_elec = nodes + " low voltage"
else:
nodes_elec = nodes
heat_pump_type = "air" if "urban" in name else "ground"
# Add heat pumps
costs_name = f"decentral {heat_pump_type}-sourced heat pump"
cop = {"air": ashp_cop, "ground": gshp_cop}
if time_dep_hp_cop:
efficiency = cop[heat_pump_type][nodes]
else:
efficiency = costs.at[costs_name, "efficiency"]
too_large_grouping_years = [gy for gy in grouping_years if gy >= int(baseyear)]
if too_large_grouping_years:
logger.warning(
f"Grouping years >= baseyear are ignored. Dropping {too_large_grouping_years}."
)
valid_grouping_years = pd.Series(
[
int(grouping_year)
for grouping_year in grouping_years
if int(grouping_year) + default_lifetime > int(baseyear)
and int(grouping_year) < int(baseyear)
too_large_grouping_years = [
gy for gy in grouping_years if gy >= int(baseyear)
]
)
if too_large_grouping_years:
logger.warning(
f"Grouping years >= baseyear are ignored. Dropping {too_large_grouping_years}."
)
valid_grouping_years = pd.Series(
[
int(grouping_year)
for grouping_year in grouping_years
if int(grouping_year) + default_lifetime > int(baseyear)
and int(grouping_year) < int(baseyear)
]
)
assert valid_grouping_years.is_monotonic_increasing
assert valid_grouping_years.is_monotonic_increasing
# get number of years of each interval
_years = valid_grouping_years.diff()
# Fill NA from .diff() with value for the first interval
_years[0] = valid_grouping_years[0] - baseyear + default_lifetime
# Installation is assumed to be linear for the past
ratios = _years / _years.sum()
# get number of years of each interval
_years = valid_grouping_years.diff()
# Fill NA from .diff() with value for the first interval
_years[0] = valid_grouping_years[0] - baseyear + default_lifetime
# Installation is assumed to be linear for the past
ratios = _years / _years.sum()
for ratio, grouping_year in zip(ratios, valid_grouping_years):
# Add heat pumps
for heat_source in snakemake.params.heat_pump_sources[
heat_system.system_type.value
]:
costs_name = heat_system.heat_pump_costs_name(heat_source)
n.madd(
"Link",
nodes,
suffix=f" {name} {heat_pump_type} heat pump-{grouping_year}",
bus0=nodes_elec,
bus1=nodes + " " + name + " heat",
carrier=f"{name} {heat_pump_type} heat pump",
efficiency=efficiency,
capital_cost=costs.at[costs_name, "efficiency"]
* costs.at[costs_name, "fixed"],
p_nom=existing_heating.loc[nodes, (name, f"{heat_pump_type} heat pump")]
* ratio
/ costs.at[costs_name, "efficiency"],
build_year=int(grouping_year),
lifetime=costs.at[costs_name, "lifetime"],
)
efficiency = (
cop.sel(
heat_system=heat_system.system_type.value,
heat_source=heat_source,
name=nodes,
)
.to_pandas()
.reindex(index=n.snapshots)
if time_dep_hp_cop
else costs.at[costs_name, "efficiency"]
)
n.madd(
"Link",
nodes,
suffix=f" {heat_system} {heat_source} heat pump-{grouping_year}",
bus0=nodes_elec,
bus1=nodes + " " + heat_system.value + " heat",
carrier=f"{heat_system} {heat_source} heat pump",
efficiency=efficiency,
capital_cost=costs.at[costs_name, "efficiency"]
* costs.at[costs_name, "fixed"],
p_nom=existing_heating.loc[
nodes, (heat_system.value, f"{heat_source} heat pump")
]
* ratio
/ costs.at[costs_name, "efficiency"],
build_year=int(grouping_year),
lifetime=costs.at[costs_name, "lifetime"],
)
# add resistive heater, gas boilers and oil boilers
n.madd(
"Link",
nodes,
suffix=f" {name} resistive heater-{grouping_year}",
suffix=f" {heat_system} resistive heater-{grouping_year}",
bus0=nodes_elec,
bus1=nodes + " " + name + " heat",
carrier=name + " resistive heater",
efficiency=costs.at[f"{name_type} resistive heater", "efficiency"],
bus1=nodes + " " + heat_system.value + " heat",
carrier=heat_system.value + " resistive heater",
efficiency=costs.at[
heat_system.resistive_heater_costs_name, "efficiency"
],
capital_cost=(
costs.at[f"{name_type} resistive heater", "efficiency"]
* costs.at[f"{name_type} resistive heater", "fixed"]
costs.at[heat_system.resistive_heater_costs_name, "efficiency"]
* costs.at[heat_system.resistive_heater_costs_name, "fixed"]
),
p_nom=(
existing_heating.loc[nodes, (name, "resistive heater")]
existing_heating.loc[nodes, (heat_system.value, "resistive heater")]
* ratio
/ costs.at[f"{name_type} resistive heater", "efficiency"]
/ costs.at[heat_system.resistive_heater_costs_name, "efficiency"]
),
build_year=int(grouping_year),
lifetime=costs.at[f"{name_type} resistive heater", "lifetime"],
lifetime=costs.at[heat_system.resistive_heater_costs_name, "lifetime"],
)
n.madd(
"Link",
nodes,
suffix=f" {name} gas boiler-{grouping_year}",
suffix=f"{heat_system} gas boiler-{grouping_year}",
bus0="EU gas" if "EU gas" in spatial.gas.nodes else nodes + " gas",
bus1=nodes + " " + name + " heat",
bus1=nodes + " " + heat_system.value + " heat",
bus2="co2 atmosphere",
carrier=name + " gas boiler",
efficiency=costs.at[f"{name_type} gas boiler", "efficiency"],
carrier=heat_system.value + " gas boiler",
efficiency=costs.at[heat_system.gas_boiler_costs_name, "efficiency"],
efficiency2=costs.at["gas", "CO2 intensity"],
capital_cost=(
costs.at[f"{name_type} gas boiler", "efficiency"]
* costs.at[f"{name_type} gas boiler", "fixed"]
costs.at[heat_system.gas_boiler_costs_name, "efficiency"]
* costs.at[heat_system.gas_boiler_costs_name, "fixed"]
),
p_nom=(
existing_heating.loc[nodes, (name, "gas boiler")]
existing_heating.loc[nodes, (heat_system.value, "gas boiler")]
* ratio
/ costs.at[f"{name_type} gas boiler", "efficiency"]
/ costs.at[heat_system.gas_boiler_costs_name, "efficiency"]
),
build_year=int(grouping_year),
lifetime=costs.at[f"{name_type} gas boiler", "lifetime"],
lifetime=costs.at[heat_system.gas_boiler_costs_name, "lifetime"],
)
n.madd(
"Link",
nodes,
suffix=f" {name} oil boiler-{grouping_year}",
suffix=f" {heat_system} oil boiler-{grouping_year}",
bus0=spatial.oil.nodes,
bus1=nodes + " " + name + " heat",
bus1=nodes + " " + heat_system.value + " heat",
bus2="co2 atmosphere",
carrier=name + " oil boiler",
efficiency=costs.at["decentral oil boiler", "efficiency"],
carrier=heat_system.value + " oil boiler",
efficiency=costs.at[heat_system.oil_boiler_costs_name, "efficiency"],
efficiency2=costs.at["oil", "CO2 intensity"],
capital_cost=costs.at["decentral oil boiler", "efficiency"]
* costs.at["decentral oil boiler", "fixed"],
capital_cost=costs.at[heat_system.oil_boiler_costs_name, "efficiency"]
* costs.at[heat_system.oil_boiler_costs_name, "fixed"],
p_nom=(
existing_heating.loc[nodes, (name, "oil boiler")]
existing_heating.loc[nodes, (heat_system.value, "oil boiler")]
* ratio
/ costs.at["decentral oil boiler", "efficiency"]
/ costs.at[heat_system.oil_boiler_costs_name, "efficiency"]
),
build_year=int(grouping_year),
lifetime=costs.at[f"{name_type} gas boiler", "lifetime"],
lifetime=costs.at[
f"{heat_system.central_or_decentral} gas boiler", "lifetime"
],
)
# delete links with p_nom=nan corresponding to extra nodes in country
@ -639,29 +660,22 @@ if __name__ == "__main__":
)
if options["heating"]:
time_dep_hp_cop = options["time_dep_hp_cop"]
ashp_cop = (
xr.open_dataarray(snakemake.input.cop_air_total)
.to_pandas()
.reindex(index=n.snapshots)
)
gshp_cop = (
xr.open_dataarray(snakemake.input.cop_soil_total)
.to_pandas()
.reindex(index=n.snapshots)
)
default_lifetime = snakemake.params.existing_capacities[
"default_heating_lifetime"
]
add_heating_capacities_installed_before_baseyear(
n,
baseyear,
grouping_years_heat,
ashp_cop,
gshp_cop,
time_dep_hp_cop,
costs,
default_lifetime,
n=n,
baseyear=baseyear,
grouping_years=grouping_years_heat,
cop=xr.open_dataarray(snakemake.input.cop_profiles),
time_dep_hp_cop=options["time_dep_hp_cop"],
costs=costs,
default_lifetime=snakemake.params.existing_capacities[
"default_heating_lifetime"
],
existing_heating=pd.read_csv(
snakemake.input.existing_heating_distribution,
header=[0, 1],
index_col=0,
),
)
if options.get("cluster_heat_buses", False):

View File

@ -13,11 +13,51 @@ import geopandas as gpd
import numpy as np
import pandas as pd
from _helpers import configure_logging, set_scenario_config
from build_energy_totals import build_eurostat
logger = logging.getLogger(__name__)
AVAILABLE_BIOMASS_YEARS = [2010, 2020, 2030, 2040, 2050]
def _calc_unsustainable_potential(df, df_unsustainable, share_unsus, resource_type):
"""
Calculate the unsustainable biomass potential for a given resource type or
regex.
Parameters
----------
df : pd.DataFrame
The dataframe with sustainable biomass potentials.
df_unsustainable : pd.DataFrame
The dataframe with unsustainable biomass potentials.
share_unsus : float
The share of unsustainable biomass potential retained.
resource_type : str or regex
The resource type to calculate the unsustainable potential for.
Returns
-------
pd.Series
The unsustainable biomass potential for the given resource type or regex.
"""
if "|" in resource_type:
resource_potential = df_unsustainable.filter(regex=resource_type).sum(axis=1)
else:
resource_potential = df_unsustainable[resource_type]
return (
df.apply(
lambda c: c.sum()
/ df.loc[df.index.str[:2] == c.name[:2]].sum().sum()
* resource_potential.loc[c.name[:2]],
axis=1,
)
.mul(share_unsus)
.clip(lower=0)
)
def build_nuts_population_data(year=2013):
pop = pd.read_csv(
snakemake.input.nuts3_population,
@ -211,15 +251,104 @@ def convert_nuts2_to_regions(bio_nuts2, regions):
return bio_regions
def add_unsustainable_potentials(df):
"""
Add unsustainable biomass potentials to the given dataframe. The difference
between the data of JRC and Eurostat is assumed to be unsustainable
biomass.
Parameters
----------
df : pd.DataFrame
The dataframe with sustainable biomass potentials.
unsustainable_biomass : str
Path to the file with unsustainable biomass potentials.
Returns
-------
pd.DataFrame
The dataframe with added unsustainable biomass potentials.
"""
if "GB" in snakemake.config["countries"]:
latest_year = 2019
else:
latest_year = 2021
idees_rename = {"GR": "EL", "GB": "UK"}
df_unsustainable = (
build_eurostat(
countries=snakemake.config["countries"],
input_eurostat=snakemake.input.eurostat,
nprocesses=int(snakemake.threads),
)
.xs(
max(min(latest_year, int(snakemake.wildcards.planning_horizons)), 1990),
level=1,
)
.xs("Primary production", level=2)
.droplevel([1, 2, 3])
)
df_unsustainable.index = df_unsustainable.index.str.strip()
df_unsustainable = df_unsustainable.rename(
{v: k for k, v in idees_rename.items()}, axis=0
)
bio_carriers = [
"Primary solid biofuels",
"Biogases",
"Renewable municipal waste",
"Pure biogasoline",
"Blended biogasoline",
"Pure biodiesels",
"Blended biodiesels",
"Pure bio jet kerosene",
"Blended bio jet kerosene",
"Other liquid biofuels",
]
df_unsustainable = df_unsustainable[bio_carriers]
# Phase out unsustainable biomass potentials linearly from 2020 to 2035 while phasing in sustainable potentials
share_unsus = params.get("share_unsustainable_use_retained").get(investment_year)
df_wo_ch = df.drop(df.filter(regex="CH\d", axis=0).index)
# Calculate unsustainable solid biomass
df_wo_ch["unsustainable solid biomass"] = _calc_unsustainable_potential(
df_wo_ch, df_unsustainable, share_unsus, "Primary solid biofuels"
)
# Calculate unsustainable biogas
df_wo_ch["unsustainable biogas"] = _calc_unsustainable_potential(
df_wo_ch, df_unsustainable, share_unsus, "Biogases"
)
# Calculate unsustainable bioliquids
df_wo_ch["unsustainable bioliquids"] = _calc_unsustainable_potential(
df_wo_ch,
df_unsustainable,
share_unsus,
resource_type="gasoline|diesel|kerosene|liquid",
)
share_sus = params.get("share_sustainable_potential_available").get(investment_year)
df *= share_sus
df = df.join(df_wo_ch.filter(like="unsustainable")).fillna(0)
return df
if __name__ == "__main__":
if "snakemake" not in globals():
from _helpers import mock_snakemake
snakemake = mock_snakemake(
"build_biomass_potentials",
simpl="",
clusters="5",
planning_horizons=2050,
clusters="37",
planning_horizons=2020,
)
configure_logging(snakemake)
@ -269,6 +398,8 @@ if __name__ == "__main__":
grouper = {v: k for k, vv in params["classes"].items() for v in vv}
df = df.T.groupby(grouper).sum().T
df = add_unsustainable_potentials(df)
df *= 1e6 # TWh/a to MWh/a
df.index.name = "MWh/a"

View File

@ -1,69 +0,0 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
"""
Build coefficient of performance (COP) time series for air- or ground-sourced
heat pumps.
The COP is approximated as a quatratic function of the temperature difference between source and
sink, based on Staffell et al. 2012.
This rule is executed in ``build_sector.smk``.
Relevant Settings
-----------------
.. code:: yaml
heat_pump_sink_T:
Inputs:
-------
- ``resources/<run_name>/temp_soil_total_elec_s<simpl>_<clusters>.nc``: Soil temperature (total) time series.
- ``resources/<run_name>/temp_air_total_elec_s<simpl>_<clusters>.nc``: Ambient air temperature (total) time series.
Outputs:
--------
- ``resources/cop_soil_total_elec_s<simpl>_<clusters>.nc``: COP (ground-sourced) time series (total).
- ``resources/cop_air_total_elec_s<simpl>_<clusters>.nc``: COP (air-sourced) time series (total).
References
----------
[1] Staffell et al., Energy & Environmental Science 11 (2012): A review of domestic heat pumps, https://doi.org/10.1039/C2EE22653G.
"""
import xarray as xr
from _helpers import set_scenario_config
def coefficient_of_performance(delta_T, source="air"):
if source == "air":
return 6.81 - 0.121 * delta_T + 0.000630 * delta_T**2
elif source == "soil":
return 8.77 - 0.150 * delta_T + 0.000734 * delta_T**2
else:
raise NotImplementedError("'source' must be one of ['air', 'soil']")
if __name__ == "__main__":
if "snakemake" not in globals():
from _helpers import mock_snakemake
snakemake = mock_snakemake(
"build_cop_profiles",
simpl="",
clusters=48,
)
set_scenario_config(snakemake)
for source in ["air", "soil"]:
source_T = xr.open_dataarray(snakemake.input[f"temp_{source}_total"])
delta_T = snakemake.params.heat_pump_sink_T - source_T
cop = coefficient_of_performance(delta_T, source)
cop.to_netcdf(snakemake.output[f"cop_{source}_total"])

View File

@ -0,0 +1,111 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
from abc import ABC, abstractmethod
from typing import Union
import numpy as np
import xarray as xr
class BaseCopApproximator(ABC):
"""
Abstract class for approximating the coefficient of performance (COP) of a
heat pump.
Attributes:
----------
forward_temperature_celsius : Union[xr.DataArray, np.array]
The forward temperature in Celsius.
source_inlet_temperature_celsius : Union[xr.DataArray, np.array]
The source inlet temperature in Celsius.
Methods:
-------
__init__(self, forward_temperature_celsius, source_inlet_temperature_celsius)
Initialize CopApproximator.
approximate_cop(self)
Approximate heat pump coefficient of performance (COP).
celsius_to_kelvin(t_celsius)
Convert temperature from Celsius to Kelvin.
logarithmic_mean(t_hot, t_cold)
Calculate the logarithmic mean temperature difference.
"""
def __init__(
self,
forward_temperature_celsius: Union[xr.DataArray, np.array],
source_inlet_temperature_celsius: Union[xr.DataArray, np.array],
):
"""
Initialize CopApproximator.
Parameters:
----------
forward_temperature_celsius : Union[xr.DataArray, np.array]
The forward temperature in Celsius.
source_inlet_temperature_celsius : Union[xr.DataArray, np.array]
The source inlet temperature in Celsius.
"""
pass
@abstractmethod
def approximate_cop(self) -> Union[xr.DataArray, np.array]:
"""
Approximate heat pump coefficient of performance (COP).
Returns:
-------
Union[xr.DataArray, np.array]
The calculated COP values.
"""
pass
@staticmethod
def celsius_to_kelvin(
t_celsius: Union[float, xr.DataArray, np.array]
) -> Union[float, xr.DataArray, np.array]:
"""
Convert temperature from Celsius to Kelvin.
Parameters:
----------
t_celsius : Union[float, xr.DataArray, np.array]
Temperature in Celsius.
Returns:
-------
Union[float, xr.DataArray, np.array]
Temperature in Kelvin.
"""
if (np.asarray(t_celsius) > 200).any():
raise ValueError(
"t_celsius > 200. Are you sure you are using the right units?"
)
return t_celsius + 273.15
@staticmethod
def logarithmic_mean(
t_hot: Union[float, xr.DataArray, np.ndarray],
t_cold: Union[float, xr.DataArray, np.ndarray],
) -> Union[float, xr.DataArray, np.ndarray]:
"""
Calculate the logarithmic mean temperature difference.
Parameters:
----------
t_hot : Union[float, xr.DataArray, np.ndarray]
Hot temperature.
t_cold : Union[float, xr.DataArray, np.ndarray]
Cold temperature.
Returns:
-------
Union[float, xr.DataArray, np.ndarray]
Logarithmic mean temperature difference.
"""
if (np.asarray(t_hot <= t_cold)).any():
raise ValueError("t_hot must be greater than t_cold")
return (t_hot - t_cold) / np.log(t_hot / t_cold)

View File

@ -0,0 +1,392 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
from typing import Union
import numpy as np
import xarray as xr
from BaseCopApproximator import BaseCopApproximator
class CentralHeatingCopApproximator(BaseCopApproximator):
"""
Approximate the coefficient of performance (COP) for a heat pump in a
central heating system (district heating).
Uses an approximation method proposed by Jensen et al. (2018) and
default parameters from Pieper et al. (2020). The method is based on
a thermodynamic heat pump model with some hard-to-know parameters
being approximated.
Attributes:
----------
forward_temperature_celsius : Union[xr.DataArray, np.array]
The forward temperature in Celsius.
return_temperature_celsius : Union[xr.DataArray, np.array]
The return temperature in Celsius.
source_inlet_temperature_celsius : Union[xr.DataArray, np.array]
The source inlet temperature in Celsius.
source_outlet_temperature_celsius : Union[xr.DataArray, np.array]
The source outlet temperature in Celsius.
delta_t_pinch_point : float, optional
The pinch point temperature difference, by default 5.
isentropic_compressor_efficiency : float, optional
The isentropic compressor efficiency, by default 0.8.
heat_loss : float, optional
The heat loss, by default 0.0.
Methods:
-------
__init__(
forward_temperature_celsius: Union[xr.DataArray, np.array],
source_inlet_temperature_celsius: Union[xr.DataArray, np.array],
return_temperature_celsius: Union[xr.DataArray, np.array],
source_outlet_temperature_celsius: Union[xr.DataArray, np.array],
delta_t_pinch_point: float = 5,
isentropic_compressor_efficiency: float = 0.8,
heat_loss: float = 0.0,
) -> None:
Initializes the CentralHeatingCopApproximator object.
approximate_cop(self) -> Union[xr.DataArray, np.array]:
Calculate the coefficient of performance (COP) for the system.
_approximate_delta_t_refrigerant_source(
self, delta_t_source: Union[xr.DataArray, np.array]
) -> Union[xr.DataArray, np.array]:
Approximates the temperature difference between the refrigerant and the source.
_approximate_delta_t_refrigerant_sink(
self,
refrigerant: str = "ammonia",
a: float = {"ammonia": 0.2, "isobutane": -0.0011},
b: float = {"ammonia": 0.2, "isobutane": 0.3},
c: float = {"ammonia": 0.016, "isobutane": 2.4},
) -> Union[xr.DataArray, np.array]:
Approximates the temperature difference between the refrigerant and heat sink.
_ratio_evaporation_compression_work_approximation(
self,
refrigerant: str = "ammonia",
a: float = {"ammonia": 0.0014, "isobutane": 0.0035},
) -> Union[xr.DataArray, np.array]:
Calculate the ratio of evaporation to compression work based on approximation.
_approximate_delta_t_refrigerant_sink(
self,
refrigerant: str = "ammonia",
a: float = {"ammonia": 0.2, "isobutane": -0.0011},
b: float = {"ammonia": 0.2, "isobutane": 0.3},
c: float = {"ammonia": 0.016, "isobutane": 2.4},
) -> Union[xr.DataArray, np.array]:
Approximates the temperature difference between the refrigerant and heat sink.
_ratio_evaporation_compression_work_approximation(
self,
refrigerant: str = "ammonia",
a: float = {"ammonia": 0.0014, "isobutane": 0.0035},
) -> Union[xr.DataArray, np.array]:
Calculate the ratio of evaporation to compression work based on approximation.
"""
def __init__(
self,
forward_temperature_celsius: Union[xr.DataArray, np.array],
source_inlet_temperature_celsius: Union[xr.DataArray, np.array],
return_temperature_celsius: Union[xr.DataArray, np.array],
source_outlet_temperature_celsius: Union[xr.DataArray, np.array],
delta_t_pinch_point: float = 5,
isentropic_compressor_efficiency: float = 0.8,
heat_loss: float = 0.0,
) -> None:
"""
Initializes the CentralHeatingCopApproximator object.
Parameters:
----------
forward_temperature_celsius : Union[xr.DataArray, np.array]
The forward temperature in Celsius.
return_temperature_celsius : Union[xr.DataArray, np.array]
The return temperature in Celsius.
source_inlet_temperature_celsius : Union[xr.DataArray, np.array]
The source inlet temperature in Celsius.
source_outlet_temperature_celsius : Union[xr.DataArray, np.array]
The source outlet temperature in Celsius.
delta_t_pinch_point : float, optional
The pinch point temperature difference, by default 5.
isentropic_compressor_efficiency : float, optional
The isentropic compressor efficiency, by default 0.8.
heat_loss : float, optional
The heat loss, by default 0.0.
"""
self.t_source_in_kelvin = BaseCopApproximator.celsius_to_kelvin(
source_inlet_temperature_celsius
)
self.t_sink_out_kelvin = BaseCopApproximator.celsius_to_kelvin(
forward_temperature_celsius
)
self.t_sink_in_kelvin = BaseCopApproximator.celsius_to_kelvin(
return_temperature_celsius
)
self.t_source_out = BaseCopApproximator.celsius_to_kelvin(
source_outlet_temperature_celsius
)
self.isentropic_efficiency_compressor_kelvin = isentropic_compressor_efficiency
self.heat_loss = heat_loss
self.delta_t_pinch = delta_t_pinch_point
def approximate_cop(self) -> Union[xr.DataArray, np.array]:
"""
Calculate the coefficient of performance (COP) for the system.
Returns:
--------
Union[xr.DataArray, np.array]: The calculated COP values.
"""
return (
self.ideal_lorenz_cop
* (
(
1
+ (self.delta_t_refrigerant_sink + self.delta_t_pinch)
/ self.t_sink_mean_kelvin
)
/ (
1
+ (
self.delta_t_refrigerant_sink
+ self.delta_t_refrigerant_source
+ 2 * self.delta_t_pinch
)
/ self.delta_t_lift
)
)
* self.isentropic_efficiency_compressor_kelvin
* (1 - self.ratio_evaporation_compression_work)
+ 1
- self.isentropic_efficiency_compressor_kelvin
- self.heat_loss
)
@property
def t_sink_mean_kelvin(self) -> Union[xr.DataArray, np.array]:
"""
Calculate the logarithmic mean temperature difference between the cold
and hot sinks.
Returns
-------
Union[xr.DataArray, np.array]
The mean temperature difference.
"""
return BaseCopApproximator.logarithmic_mean(
t_cold=self.t_sink_in_kelvin, t_hot=self.t_sink_out_kelvin
)
@property
def t_source_mean_kelvin(self) -> Union[xr.DataArray, np.array]:
"""
Calculate the logarithmic mean temperature of the heat source.
Returns
-------
Union[xr.DataArray, np.array]
The mean temperature of the heat source.
"""
return BaseCopApproximator.logarithmic_mean(
t_hot=self.t_source_in_kelvin, t_cold=self.t_source_out
)
@property
def delta_t_lift(self) -> Union[xr.DataArray, np.array]:
"""
Calculate the temperature lift as the difference between the
logarithmic sink and source temperatures.
Returns
-------
Union[xr.DataArray, np.array]
The temperature difference between the sink and source.
"""
return self.t_sink_mean_kelvin - self.t_source_mean_kelvin
@property
def ideal_lorenz_cop(self) -> Union[xr.DataArray, np.array]:
"""
Ideal Lorenz coefficient of performance (COP).
The ideal Lorenz COP is calculated as the ratio of the mean sink temperature
to the lift temperature difference.
Returns
-------
np.array
The ideal Lorenz COP.
"""
return self.t_sink_mean_kelvin / self.delta_t_lift
@property
def delta_t_refrigerant_source(self) -> Union[xr.DataArray, np.array]:
"""
Calculate the temperature difference between the refrigerant source
inlet and outlet.
Returns
-------
Union[xr.DataArray, np.array]
The temperature difference between the refrigerant source inlet and outlet.
"""
return self._approximate_delta_t_refrigerant_source(
delta_t_source=self.t_source_in_kelvin - self.t_source_out
)
@property
def delta_t_refrigerant_sink(self) -> Union[xr.DataArray, np.array]:
"""
Temperature difference between the refrigerant and the sink based on
approximation.
Returns
-------
Union[xr.DataArray, np.array]
The temperature difference between the refrigerant and the sink.
"""
return self._approximate_delta_t_refrigerant_sink()
@property
def ratio_evaporation_compression_work(self) -> Union[xr.DataArray, np.array]:
"""
Calculate the ratio of evaporation to compression work based on
approximation.
Returns
-------
Union[xr.DataArray, np.array]
The calculated ratio of evaporation to compression work.
"""
return self._ratio_evaporation_compression_work_approximation()
@property
def delta_t_sink(self) -> Union[xr.DataArray, np.array]:
"""
Calculate the temperature difference at the sink.
Returns
-------
Union[xr.DataArray, np.array]
The temperature difference at the sink.
"""
return self.t_sink_out_kelvin - self.t_sink_in_kelvin
def _approximate_delta_t_refrigerant_source(
self, delta_t_source: Union[xr.DataArray, np.array]
) -> Union[xr.DataArray, np.array]:
"""
Approximates the temperature difference between the refrigerant and the
source.
Parameters
----------
delta_t_source : Union[xr.DataArray, np.array]
The temperature difference for the refrigerant source.
Returns
-------
Union[xr.DataArray, np.array]
The approximate temperature difference between the refrigerant and heat source.
"""
return delta_t_source / 2
def _approximate_delta_t_refrigerant_sink(
self,
refrigerant: str = "ammonia",
a: float = {"ammonia": 0.2, "isobutane": -0.0011},
b: float = {"ammonia": 0.2, "isobutane": 0.3},
c: float = {"ammonia": 0.016, "isobutane": 2.4},
) -> Union[xr.DataArray, np.array]:
"""
Approximates the temperature difference between the refrigerant and
heat sink.
Parameters:
----------
refrigerant : str, optional
The refrigerant used in the system. Either 'isobutane' or 'ammonia. Default is 'ammonia'.
a : float, optional
Coefficient for the temperature difference between the sink and source, default is 0.2.
b : float, optional
Coefficient for the temperature difference at the sink, default is 0.2.
c : float, optional
Constant term, default is 0.016.
Returns:
-------
Union[xr.DataArray, np.array]
The approximate temperature difference between the refrigerant and heat sink.
Notes:
------
This function assumes ammonia as the refrigerant.
The approximate temperature difference at the refrigerant sink is calculated using the following formula:
a * (t_sink_out - t_source_out + 2 * delta_t_pinch) + b * delta_t_sink + c
"""
if refrigerant not in a.keys():
raise ValueError(
f"Invalid refrigerant '{refrigerant}'. Must be one of {a.keys()}"
)
return (
a[refrigerant]
* (self.t_sink_out_kelvin - self.t_source_out + 2 * self.delta_t_pinch)
+ b[refrigerant] * self.delta_t_sink
+ c[refrigerant]
)
def _ratio_evaporation_compression_work_approximation(
self,
refrigerant: str = "ammonia",
a: float = {"ammonia": 0.0014, "isobutane": 0.0035},
b: float = {"ammonia": -0.0015, "isobutane": -0.0033},
c: float = {"ammonia": 0.039, "isobutane": 0.053},
) -> Union[xr.DataArray, np.array]:
"""
Calculate the ratio of evaporation to compression work approximation.
Parameters:
----------
refrigerant : str, optional
The refrigerant used in the system. Either 'isobutane' or 'ammonia. Default is 'ammonia'.
a : float, optional
Coefficient 'a' in the approximation equation. Default is 0.0014.
b : float, optional
Coefficient 'b' in the approximation equation. Default is -0.0015.
c : float, optional
Coefficient 'c' in the approximation equation. Default is 0.039.
Returns:
-------
Union[xr.DataArray, np.array]
The approximated ratio of evaporation to compression work.
Notes:
------
This function assumes ammonia as the refrigerant.
The approximation equation used is:
ratio = a * (t_sink_out - t_source_out + 2 * delta_t_pinch) + b * delta_t_sink + c
"""
if refrigerant not in a.keys():
raise ValueError(
f"Invalid refrigerant '{refrigerant}'. Must be one of {a.keys()}"
)
return (
a[refrigerant]
* (self.t_sink_out_kelvin - self.t_source_out + 2 * self.delta_t_pinch)
+ b[refrigerant] * self.delta_t_sink
+ c[refrigerant]
)

View File

@ -0,0 +1,110 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
from typing import Union
import numpy as np
import xarray as xr
from BaseCopApproximator import BaseCopApproximator
class DecentralHeatingCopApproximator(BaseCopApproximator):
"""
Approximate the coefficient of performance (COP) for a heat pump in a
decentral heating system (individual/household heating).
Uses a quadratic regression on the temperature difference between the source and sink based on empirical data proposed by Staffell et al. 2012.
Attributes
----------
forward_temperature_celsius : Union[xr.DataArray, np.array]
The forward temperature in Celsius.
source_inlet_temperature_celsius : Union[xr.DataArray, np.array]
The source inlet temperature in Celsius.
source_type : str
The source of the heat pump. Must be either 'air' or 'ground'.
Methods
-------
__init__(forward_temperature_celsius, source_inlet_temperature_celsius, source_type)
Initialize the DecentralHeatingCopApproximator object.
approximate_cop()
Compute the COP values using quadratic regression for air-/ground-source heat pumps.
_approximate_cop_air_source()
Evaluate quadratic regression for an air-sourced heat pump.
_approximate_cop_ground_source()
Evaluate quadratic regression for a ground-sourced heat pump.
References
----------
[1] Staffell et al., Energy & Environmental Science 11 (2012): A review of domestic heat pumps, https://doi.org/10.1039/C2EE22653G.
"""
def __init__(
self,
forward_temperature_celsius: Union[xr.DataArray, np.array],
source_inlet_temperature_celsius: Union[xr.DataArray, np.array],
source_type: str,
):
"""
Initialize the DecentralHeatingCopApproximator object.
Parameters
----------
forward_temperature_celsius : Union[xr.DataArray, np.array]
The forward temperature in Celsius.
source_inlet_temperature_celsius : Union[xr.DataArray, np.array]
The source inlet temperature in Celsius.
source_type : str
The source of the heat pump. Must be either 'air' or 'ground'.
"""
self.delta_t = forward_temperature_celsius - source_inlet_temperature_celsius
if source_type not in ["air", "ground"]:
raise ValueError("'source_type' must be one of ['air', 'ground']")
else:
self.source_type = source_type
def approximate_cop(self) -> Union[xr.DataArray, np.array]:
"""
Compute the COP values using quadratic regression for air-/ground-
source heat pumps.
Returns
-------
Union[xr.DataArray, np.array]
The calculated COP values.
"""
if self.source_type == "air":
return self._approximate_cop_air_source()
elif self.source_type == "ground":
return self._approximate_cop_ground_source()
def _approximate_cop_air_source(self) -> Union[xr.DataArray, np.array]:
"""
Evaluate quadratic regression for an air-sourced heat pump.
COP = 6.81 - 0.121 * delta_T + 0.000630 * delta_T^2
Returns
-------
Union[xr.DataArray, np.array]
The calculated COP values.
"""
return 6.81 - 0.121 * self.delta_t + 0.000630 * self.delta_t**2
def _approximate_cop_ground_source(self) -> Union[xr.DataArray, np.array]:
"""
Evaluate quadratic regression for a ground-sourced heat pump.
COP = 8.77 - 0.150 * delta_T + 0.000734 * delta_T^2
Returns
-------
Union[xr.DataArray, np.array]
The calculated COP values.
"""
return 8.77 - 0.150 * self.delta_t + 0.000734 * self.delta_t**2

View File

@ -0,0 +1,95 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
import sys
import numpy as np
import pandas as pd
import xarray as xr
from _helpers import set_scenario_config
from CentralHeatingCopApproximator import CentralHeatingCopApproximator
from DecentralHeatingCopApproximator import DecentralHeatingCopApproximator
from scripts.definitions.heat_system_type import HeatSystemType
sys.path.append("..")
def get_cop(
heat_system_type: str,
heat_source: str,
source_inlet_temperature_celsius: xr.DataArray,
) -> xr.DataArray:
"""
Calculate the coefficient of performance (COP) for a heating system.
Parameters
----------
heat_system_type : str
The type of heating system.
heat_source : str
The heat source used in the heating system.
source_inlet_temperature_celsius : xr.DataArray
The inlet temperature of the heat source in Celsius.
Returns
-------
xr.DataArray
The calculated coefficient of performance (COP) for the heating system.
"""
if HeatSystemType(heat_system_type).is_central:
return CentralHeatingCopApproximator(
forward_temperature_celsius=snakemake.params.forward_temperature_central_heating,
return_temperature_celsius=snakemake.params.return_temperature_central_heating,
source_inlet_temperature_celsius=source_inlet_temperature_celsius,
source_outlet_temperature_celsius=source_inlet_temperature_celsius
- snakemake.params.heat_source_cooling_central_heating,
).approximate_cop()
else:
return DecentralHeatingCopApproximator(
forward_temperature_celsius=snakemake.params.heat_pump_sink_T_decentral_heating,
source_inlet_temperature_celsius=source_inlet_temperature_celsius,
source_type=heat_source,
).approximate_cop()
if __name__ == "__main__":
if "snakemake" not in globals():
from _helpers import mock_snakemake
snakemake = mock_snakemake(
"build_cop_profiles",
simpl="",
clusters=48,
)
set_scenario_config(snakemake)
cop_all_system_types = []
for heat_system_type, heat_sources in snakemake.params.heat_pump_sources.items():
cop_this_system_type = []
for heat_source in heat_sources:
source_inlet_temperature_celsius = xr.open_dataarray(
snakemake.input[f"temp_{heat_source.replace('ground', 'soil')}_total"]
)
cop_da = get_cop(
heat_system_type=heat_system_type,
heat_source=heat_source,
source_inlet_temperature_celsius=source_inlet_temperature_celsius,
)
cop_this_system_type.append(cop_da)
cop_all_system_types.append(
xr.concat(
cop_this_system_type, dim=pd.Index(heat_sources, name="heat_source")
)
)
cop_dataarray = xr.concat(
cop_all_system_types,
dim=pd.Index(snakemake.params.heat_pump_sources.keys(), name="heat_system"),
)
cop_dataarray.to_netcdf(snakemake.output.cop_profiles)

View File

@ -26,7 +26,7 @@ Inputs
.. image:: img/countries.png
:scale: 33 %
- ``data/bundle/eez/World_EEZ_v8_2014.shp``: World `exclusive economic zones <https://en.wikipedia.org/wiki/Exclusive_economic_zone>`_ (EEZ)
- ``data/eez/World_EEZ_v12_20231025_gpkg/eez_v12.gpkg ``: World `exclusive economic zones <https://en.wikipedia.org/wiki/Exclusive_economic_zone>`_ (EEZ)
.. image:: img/eez.png
:scale: 33 %
@ -73,22 +73,16 @@ from functools import reduce
from itertools import takewhile
from operator import attrgetter
import country_converter as coco
import geopandas as gpd
import numpy as np
import pandas as pd
import pycountry as pyc
from _helpers import configure_logging, set_scenario_config
from shapely.geometry import MultiPolygon, Polygon
logger = logging.getLogger(__name__)
def _get_country(target, **keys):
assert len(keys) == 1
try:
return getattr(pyc.countries.get(**keys), target)
except (KeyError, AttributeError):
return np.nan
cc = coco.CountryConverter()
def _simplify_polys(polys, minarea=0.1, tolerance=None, filterremote=True):
@ -135,22 +129,15 @@ def countries(naturalearth, country_list):
return s
def eez(country_shapes, eez, country_list):
def eez(eez, country_list):
df = gpd.read_file(eez)
df = df.loc[
df["ISO_3digit"].isin(
[_get_country("alpha_3", alpha_2=c) for c in country_list]
)
]
df["name"] = df["ISO_3digit"].map(lambda c: _get_country("alpha_2", alpha_3=c))
iso3_list = cc.convert(country_list, src="ISO2", to="ISO3")
df = df.query("ISO_TER1 in @iso3_list and POL_TYPE == '200NM'").copy()
df["name"] = cc.convert(df.ISO_TER1, src="ISO3", to="ISO2")
s = df.set_index("name").geometry.map(
lambda s: _simplify_polys(s, filterremote=False)
)
s = gpd.GeoSeries(
{k: v for k, v in s.items() if v.distance(country_shapes[k]) < 1e-3},
crs=df.crs,
)
s = s.to_frame("geometry")
s = s.to_frame("geometry").set_crs(df.crs)
s.index.name = "name"
return s
@ -262,9 +249,7 @@ if __name__ == "__main__":
country_shapes = countries(snakemake.input.naturalearth, snakemake.params.countries)
country_shapes.reset_index().to_file(snakemake.output.country_shapes)
offshore_shapes = eez(
country_shapes, snakemake.input.eez, snakemake.params.countries
)
offshore_shapes = eez(snakemake.input.eez, snakemake.params.countries)
offshore_shapes.reset_index().to_file(snakemake.output.offshore_shapes)
europe_shape = gpd.GeoDataFrame(

View File

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
from enum import Enum
class HeatSector(Enum):
"""
Enumeration class representing different heat sectors.
Attributes:
RESIDENTIAL (str): Represents the residential heat sector.
SERVICES (str): Represents the services heat sector.
"""
RESIDENTIAL = "residential"
SERVICES = "services"
def __str__(self) -> str:
"""
Returns the string representation of the heat sector.
Returns:
str: The string representation of the heat sector.
"""
return self.value

View File

@ -0,0 +1,267 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
from enum import Enum
from scripts.definitions.heat_sector import HeatSector
from scripts.definitions.heat_system_type import HeatSystemType
class HeatSystem(Enum):
"""
Enumeration representing different heat systems.
Attributes
----------
RESIDENTIAL_RURAL : str
Heat system for residential areas in rural locations.
SERVICES_RURAL : str
Heat system for service areas in rural locations.
RESIDENTIAL_URBAN_DECENTRAL : str
Heat system for residential areas in urban decentralized locations.
SERVICES_URBAN_DECENTRAL : str
Heat system for service areas in urban decentralized locations.
URBAN_CENTRAL : str
Heat system for urban central areas.
Methods
-------
__str__()
Returns the string representation of the heat system.
central_or_decentral()
Returns whether the heat system is central or decentralized.
system_type()
Returns the type of the heat system.
sector()
Returns the sector of the heat system.
rural()
Returns whether the heat system is for rural areas.
urban_decentral()
Returns whether the heat system is for urban decentralized areas.
urban()
Returns whether the heat system is for urban areas.
heat_demand_weighting(urban_fraction=None, dist_fraction=None)
Calculates the heat demand weighting based on urban fraction and distribution fraction.
heat_pump_costs_name(heat_source)
Generates the name for the heat pump costs based on the heat source.
"""
RESIDENTIAL_RURAL = "residential rural"
SERVICES_RURAL = "services rural"
RESIDENTIAL_URBAN_DECENTRAL = "residential urban decentral"
SERVICES_URBAN_DECENTRAL = "services urban decentral"
URBAN_CENTRAL = "urban central"
def __init__(self, *args):
super().__init__(*args)
def __str__(self) -> str:
"""
Returns the string representation of the heat system.
Returns
-------
str
The string representation of the heat system.
"""
return self.value
@property
def central_or_decentral(self) -> str:
"""
Returns whether the heat system is central or decentralized.
Returns
-------
str
"central" if the heat system is central, "decentral" otherwise.
"""
if self == HeatSystem.URBAN_CENTRAL:
return "central"
else:
return "decentral"
@property
def system_type(self) -> HeatSystemType:
"""
Returns the type of the heat system.
Returns
-------
str
The type of the heat system.
Raises
------
RuntimeError
If the heat system is invalid.
"""
if self == HeatSystem.URBAN_CENTRAL:
return HeatSystemType.URBAN_CENTRAL
elif (
self == HeatSystem.RESIDENTIAL_URBAN_DECENTRAL
or self == HeatSystem.SERVICES_URBAN_DECENTRAL
):
return HeatSystemType.URBAN_DECENTRAL
elif self == HeatSystem.RESIDENTIAL_RURAL or self == HeatSystem.SERVICES_RURAL:
return HeatSystemType.RURAL
else:
raise RuntimeError(f"Invalid heat system: {self}")
@property
def sector(self) -> HeatSector:
"""
Returns the sector of the heat system.
Returns
-------
HeatSector
The sector of the heat system.
"""
if (
self == HeatSystem.RESIDENTIAL_RURAL
or self == HeatSystem.RESIDENTIAL_URBAN_DECENTRAL
):
return HeatSector.RESIDENTIAL
elif (
self == HeatSystem.SERVICES_RURAL
or self == HeatSystem.SERVICES_URBAN_DECENTRAL
):
return HeatSector.SERVICES
else:
"tot"
@property
def is_rural(self) -> bool:
"""
Returns whether the heat system is for rural areas.
Returns
-------
bool
True if the heat system is for rural areas, False otherwise.
"""
if self == HeatSystem.RESIDENTIAL_RURAL or self == HeatSystem.SERVICES_RURAL:
return True
else:
return False
@property
def is_urban_decentral(self) -> bool:
"""
Returns whether the heat system is for urban decentralized areas.
Returns
-------
bool
True if the heat system is for urban decentralized areas, False otherwise.
"""
if (
self == HeatSystem.RESIDENTIAL_URBAN_DECENTRAL
or self == HeatSystem.SERVICES_URBAN_DECENTRAL
):
return True
else:
return False
@property
def is_urban(self) -> bool:
"""
Returns whether the heat system is for urban areas.
Returns
-------
bool True if the heat system is for urban areas, False otherwise.
"""
return not self.is_rural
def heat_demand_weighting(self, urban_fraction=None, dist_fraction=None) -> float:
"""
Calculates the heat demand weighting based on urban fraction and
distribution fraction.
Parameters
----------
urban_fraction : float, optional
The fraction of urban heat demand.
dist_fraction : float, optional
The fraction of distributed heat demand.
Returns
-------
float
The heat demand weighting.
Raises
------
RuntimeError
If the heat system is invalid.
"""
if "rural" in self.value:
return 1 - urban_fraction
elif "urban central" in self.value:
return dist_fraction
elif "urban decentral" in self.value:
return urban_fraction - dist_fraction
else:
raise RuntimeError(f"Invalid heat system: {self}")
def heat_pump_costs_name(self, heat_source: str) -> str:
"""
Generates the name for the heat pump costs based on the heat source and
system.
Used to retrieve data from `technology-data <https://github.com/PyPSA/technology-data>`.
Parameters
----------
heat_source : str
The heat source.
Returns
-------
str
The name for the heat pump costs.
"""
return f"{self.central_or_decentral} {heat_source}-sourced heat pump"
@property
def resistive_heater_costs_name(self) -> str:
"""
Generates the name for the resistive heater costs based on the heat
system.
Used to retrieve data from `technology-data <https://github.com/PyPSA/technology-data>`.
Returns
-------
str
The name for the heater costs.
"""
return f"{self.central_or_decentral} resistive heater"
@property
def gas_boiler_costs_name(self) -> str:
"""
Generates the name for the gas boiler costs based on the heat system.
Used to retrieve data from `technology-data <https://github.com/PyPSA/technology-data>`.
Returns
-------
str
The name for the gas boiler costs.
"""
return f"{self.central_or_decentral} gas boiler"
@property
def oil_boiler_costs_name(self) -> str:
"""
Generates the name for the oil boiler costs based on the heat system.
Used to retrieve data from `technology-data <https://github.com/PyPSA/technology-data>`.
Returns
-------
str
The name for the oil boiler costs.
"""
return "decentral oil boiler"

View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
from enum import Enum
class HeatSystemType(Enum):
"""
Enumeration representing different types of heat systems.
"""
URBAN_CENTRAL = "urban central"
URBAN_DECENTRAL = "urban decentral"
RURAL = "rural"
def __str__(self) -> str:
"""
Returns the string representation of the heat system type.
Returns:
str: The string representation of the heat system type.
"""
return self.value
@property
def is_central(self) -> bool:
"""
Returns whether the heat system type is central.
Returns:
bool: True if the heat system type is central, False otherwise.
"""
return self == HeatSystemType.URBAN_CENTRAL

View File

@ -1,95 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2017-2024 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
"""
Extracts capacities of HVDC links from `Wikipedia.
<https://en.wikipedia.org/wiki/List_of_HVDC_projects>`_.
Relevant Settings
-----------------
.. code:: yaml
enable:
prepare_links_p_nom:
.. seealso::
Documentation of the configuration file ``config/config.yaml`` at
:ref:`toplevel_cf`
Inputs
------
*None*
Outputs
-------
- ``data/links_p_nom.csv``: A plain download of https://en.wikipedia.org/wiki/List_of_HVDC_projects#Europe plus extracted coordinates.
Description
-----------
*None*
"""
import logging
import pandas as pd
from _helpers import configure_logging, set_scenario_config
logger = logging.getLogger(__name__)
def multiply(s):
return s.str[0].astype(float) * s.str[1].astype(float)
def extract_coordinates(s):
regex = (
r"(\d{1,2})°(\d{1,2})(\d{1,2})″(N|S) " r"(\d{1,2})°(\d{1,2})(\d{1,2})″(E|W)"
)
e = s.str.extract(regex, expand=True)
lat = (
e[0].astype(float) + (e[1].astype(float) + e[2].astype(float) / 60.0) / 60.0
) * e[3].map({"N": +1.0, "S": -1.0})
lon = (
e[4].astype(float) + (e[5].astype(float) + e[6].astype(float) / 60.0) / 60.0
) * e[7].map({"E": +1.0, "W": -1.0})
return lon, lat
if __name__ == "__main__":
if "snakemake" not in globals():
from _helpers import mock_snakemake # rule must be enabled in config
snakemake = mock_snakemake("prepare_links_p_nom", simpl="")
configure_logging(snakemake)
set_scenario_config(snakemake)
links_p_nom = pd.read_html(
"https://en.wikipedia.org/wiki/List_of_HVDC_projects", header=0, match="SwePol"
)[0]
mw = "Power (MW)"
m_b = links_p_nom[mw].str.contains("x").fillna(False)
links_p_nom.loc[m_b, mw] = links_p_nom.loc[m_b, mw].str.split("x").pipe(multiply)
links_p_nom[mw] = (
links_p_nom[mw].str.extract("[-/]?([\d.]+)", expand=False).astype(float)
)
links_p_nom["x1"], links_p_nom["y1"] = extract_coordinates(
links_p_nom["Converterstation 1"]
)
links_p_nom["x2"], links_p_nom["y2"] = extract_coordinates(
links_p_nom["Converterstation 2"]
)
links_p_nom.dropna(subset=["x1", "y1", "x2", "y2"]).to_csv(
snakemake.output[0], index=False
)

View File

@ -37,6 +37,10 @@ from pypsa.geo import haversine_pts
from pypsa.io import import_components_from_dataframe
from scipy.stats import beta
from scripts.definitions.heat_sector import HeatSector
from scripts.definitions.heat_system import HeatSystem
from scripts.definitions.heat_system_type import HeatSystemType
spatial = SimpleNamespace()
logger = logging.getLogger(__name__)
@ -60,6 +64,7 @@ def define_spatial(nodes, options):
if options.get("biomass_spatial", options["biomass_transport"]):
spatial.biomass.nodes = nodes + " solid biomass"
spatial.biomass.bioliquids = nodes + " bioliquids"
spatial.biomass.locations = nodes
spatial.biomass.industry = nodes + " solid biomass for industry"
spatial.biomass.industry_cc = nodes + " solid biomass for industry CC"
@ -67,6 +72,7 @@ def define_spatial(nodes, options):
spatial.msw.locations = nodes
else:
spatial.biomass.nodes = ["EU solid biomass"]
spatial.biomass.bioliquids = ["EU unsustainable bioliquids"]
spatial.biomass.locations = ["EU"]
spatial.biomass.industry = ["solid biomass for industry"]
spatial.biomass.industry_cc = ["solid biomass for industry CC"]
@ -1776,7 +1782,7 @@ def build_heat_demand(n):
.unstack(level=1)
)
sectors = ["residential", "services"]
sectors = [sector.value for sector in HeatSector]
uses = ["water", "space"]
heat_demand = {}
@ -1804,10 +1810,21 @@ def build_heat_demand(n):
return heat_demand
def add_heat(n, costs):
def add_heat(n: pypsa.Network, costs: pd.DataFrame, cop: xr.DataArray):
"""
Add heat sector to the network.
Parameters:
n (pypsa.Network): The PyPSA network object.
costs (pd.DataFrame): DataFrame containing cost information.
cop (xr.DataArray): DataArray containing coefficient of performance (COP) values.
Returns:
None
"""
logger.info("Add heat sector")
sectors = ["residential", "services"]
sectors = [sector.value for sector in HeatSector]
heat_demand = build_heat_demand(n)
@ -1826,23 +1843,6 @@ def add_heat(n, costs):
for sector in sectors:
heat_demand[sector + " space"] = (1 - dE) * heat_demand[sector + " space"]
heat_systems = [
"residential rural",
"services rural",
"residential urban decentral",
"services urban decentral",
"urban central",
]
cop = {
"air": xr.open_dataarray(snakemake.input.cop_air_total)
.to_pandas()
.reindex(index=n.snapshots),
"ground": xr.open_dataarray(snakemake.input.cop_soil_total)
.to_pandas()
.reindex(index=n.snapshots),
}
if options["solar_thermal"]:
solar_thermal = (
xr.open_dataarray(snakemake.input.solar_thermal_total)
@ -1852,31 +1852,34 @@ def add_heat(n, costs):
# 1e3 converts from W/m^2 to MW/(1000m^2) = kW/m^2
solar_thermal = options["solar_cf_correction"] * solar_thermal / 1e3
for name in heat_systems:
name_type = "central" if name == "urban central" else "decentral"
for (
heat_system
) in (
HeatSystem
): # this loops through all heat systems defined in _entities.HeatSystem
if name == "urban central":
if heat_system == HeatSystem.URBAN_CENTRAL:
nodes = dist_fraction.index[dist_fraction > 0]
else:
nodes = pop_layout.index
n.add("Carrier", name + " heat")
n.add("Carrier", f"{heat_system} heat")
n.madd(
"Bus",
nodes + f" {name} heat",
nodes + f" {heat_system.value} heat",
location=nodes,
carrier=name + " heat",
carrier=f"{heat_system.value} heat",
unit="MWh_th",
)
if name == "urban central" and options.get("central_heat_vent"):
if heat_system == HeatSystem.URBAN_CENTRAL and options.get("central_heat_vent"):
n.madd(
"Generator",
nodes + f" {name} heat vent",
bus=nodes + f" {name} heat",
nodes + f" {heat_system} heat vent",
bus=nodes + f" {heat_system} heat",
location=nodes,
carrier=name + " heat vent",
carrier=f"{heat_system} heat vent",
p_nom_extendable=True,
p_max_pu=0,
p_min_pu=-1,
@ -1884,30 +1887,24 @@ def add_heat(n, costs):
)
## Add heat load
factor = heat_system.heat_demand_weighting(
urban_fraction=urban_fraction[nodes], dist_fraction=dist_fraction[nodes]
)
if not heat_system == HeatSystem.URBAN_CENTRAL:
heat_load = (
heat_demand[
[
heat_system.sector.value + " water",
heat_system.sector.value + " space",
]
]
.T.groupby(level=1)
.sum()
.T[nodes]
.multiply(factor)
)
for sector in sectors:
# heat demand weighting
if "rural" in name:
factor = 1 - urban_fraction[nodes]
elif "urban central" in name:
factor = dist_fraction[nodes]
elif "urban decentral" in name:
factor = urban_fraction[nodes] - dist_fraction[nodes]
else:
raise NotImplementedError(
f" {name} not in " f"heat systems: {heat_systems}"
)
if sector in name:
heat_load = (
heat_demand[[sector + " water", sector + " space"]]
.T.groupby(level=1)
.sum()
.T[nodes]
.multiply(factor)
)
if name == "urban central":
if heat_system == HeatSystem.URBAN_CENTRAL:
heat_load = (
heat_demand.T.groupby(level=1)
.sum()
@ -1920,20 +1917,25 @@ def add_heat(n, costs):
n.madd(
"Load",
nodes,
suffix=f" {name} heat",
bus=nodes + f" {name} heat",
carrier=name + " heat",
suffix=f" {heat_system} heat",
bus=nodes + f" {heat_system} heat",
carrier=f"{heat_system} heat",
p_set=heat_load,
)
## Add heat pumps
heat_pump_types = ["air"] if "urban" in name else ["ground", "air"]
for heat_pump_type in heat_pump_types:
costs_name = f"{name_type} {heat_pump_type}-sourced heat pump"
for heat_source in snakemake.params.heat_pump_sources[
heat_system.system_type.value
]:
costs_name = heat_system.heat_pump_costs_name(heat_source)
efficiency = (
cop[heat_pump_type][nodes]
cop.sel(
heat_system=heat_system.system_type.value,
heat_source=heat_source,
name=nodes,
)
.to_pandas()
.reindex(index=n.snapshots)
if options["time_dep_hp_cop"]
else costs.at[costs_name, "efficiency"]
)
@ -1941,10 +1943,10 @@ def add_heat(n, costs):
n.madd(
"Link",
nodes,
suffix=f" {name} {heat_pump_type} heat pump",
suffix=f" {heat_system} {heat_source} heat pump",
bus0=nodes,
bus1=nodes + f" {name} heat",
carrier=f"{name} {heat_pump_type} heat pump",
bus1=nodes + f" {heat_system} heat",
carrier=f"{heat_system} {heat_source} heat pump",
efficiency=efficiency,
capital_cost=costs.at[costs_name, "efficiency"]
* costs.at[costs_name, "fixed"]
@ -1954,59 +1956,65 @@ def add_heat(n, costs):
)
if options["tes"]:
n.add("Carrier", name + " water tanks")
n.add("Carrier", f"{heat_system} water tanks")
n.madd(
"Bus",
nodes + f" {name} water tanks",
nodes + f" {heat_system} water tanks",
location=nodes,
carrier=name + " water tanks",
carrier=f"{heat_system} water tanks",
unit="MWh_th",
)
n.madd(
"Link",
nodes + f" {name} water tanks charger",
bus0=nodes + f" {name} heat",
bus1=nodes + f" {name} water tanks",
nodes + f" {heat_system} water tanks charger",
bus0=nodes + f" {heat_system} heat",
bus1=nodes + f" {heat_system} water tanks",
efficiency=costs.at["water tank charger", "efficiency"],
carrier=name + " water tanks charger",
carrier=f"{heat_system} water tanks charger",
p_nom_extendable=True,
)
n.madd(
"Link",
nodes + f" {name} water tanks discharger",
bus0=nodes + f" {name} water tanks",
bus1=nodes + f" {name} heat",
carrier=name + " water tanks discharger",
nodes + f" {heat_system} water tanks discharger",
bus0=nodes + f" {heat_system} water tanks",
bus1=nodes + f" {heat_system} heat",
carrier=f"{heat_system} water tanks discharger",
efficiency=costs.at["water tank discharger", "efficiency"],
p_nom_extendable=True,
)
tes_time_constant_days = options["tes_tau"][name_type]
tes_time_constant_days = options["tes_tau"][
heat_system.central_or_decentral
]
n.madd(
"Store",
nodes + f" {name} water tanks",
bus=nodes + f" {name} water tanks",
nodes + f" {heat_system} water tanks",
bus=nodes + f" {heat_system} water tanks",
e_cyclic=True,
e_nom_extendable=True,
carrier=name + " water tanks",
carrier=f"{heat_system} water tanks",
standing_loss=1 - np.exp(-1 / 24 / tes_time_constant_days),
capital_cost=costs.at[name_type + " water tank storage", "fixed"],
lifetime=costs.at[name_type + " water tank storage", "lifetime"],
capital_cost=costs.at[
heat_system.central_or_decentral + " water tank storage", "fixed"
],
lifetime=costs.at[
heat_system.central_or_decentral + " water tank storage", "lifetime"
],
)
if options["resistive_heaters"]:
key = f"{name_type} resistive heater"
key = f"{heat_system.central_or_decentral} resistive heater"
n.madd(
"Link",
nodes + f" {name} resistive heater",
nodes + f" {heat_system} resistive heater",
bus0=nodes,
bus1=nodes + f" {name} heat",
carrier=name + " resistive heater",
bus1=nodes + f" {heat_system} heat",
carrier=f"{heat_system} resistive heater",
efficiency=costs.at[key, "efficiency"],
capital_cost=costs.at[key, "efficiency"]
* costs.at[key, "fixed"]
@ -2016,16 +2024,16 @@ def add_heat(n, costs):
)
if options["boilers"]:
key = f"{name_type} gas boiler"
key = f"{heat_system.central_or_decentral} gas boiler"
n.madd(
"Link",
nodes + f" {name} gas boiler",
nodes + f" {heat_system} gas boiler",
p_nom_extendable=True,
bus0=spatial.gas.df.loc[nodes, "nodes"].values,
bus1=nodes + f" {name} heat",
bus1=nodes + f" {heat_system} heat",
bus2="co2 atmosphere",
carrier=name + " gas boiler",
carrier=f"{heat_system} gas boiler",
efficiency=costs.at[key, "efficiency"],
efficiency2=costs.at["gas", "CO2 intensity"],
capital_cost=costs.at[key, "efficiency"]
@ -2035,22 +2043,26 @@ def add_heat(n, costs):
)
if options["solar_thermal"]:
n.add("Carrier", name + " solar thermal")
n.add("Carrier", f"{heat_system} solar thermal")
n.madd(
"Generator",
nodes,
suffix=f" {name} solar thermal collector",
bus=nodes + f" {name} heat",
carrier=name + " solar thermal",
suffix=f" {heat_system} solar thermal collector",
bus=nodes + f" {heat_system} heat",
carrier=f"{heat_system} solar thermal",
p_nom_extendable=True,
capital_cost=costs.at[name_type + " solar thermal", "fixed"]
capital_cost=costs.at[
heat_system.central_or_decentral + " solar thermal", "fixed"
]
* overdim_factor,
p_max_pu=solar_thermal[nodes],
lifetime=costs.at[name_type + " solar thermal", "lifetime"],
lifetime=costs.at[
heat_system.central_or_decentral + " solar thermal", "lifetime"
],
)
if options["chp"] and name == "urban central":
if options["chp"] and heat_system == HeatSystem.URBAN_CENTRAL:
# add gas CHP; biomass CHP is added in biomass section
n.madd(
"Link",
@ -2107,16 +2119,20 @@ def add_heat(n, costs):
lifetime=costs.at["central gas CHP", "lifetime"],
)
if options["chp"] and options["micro_chp"] and name != "urban central":
if (
options["chp"]
and options["micro_chp"]
and heat_system.value != "urban central"
):
n.madd(
"Link",
nodes + f" {name} micro gas CHP",
nodes + f" {heat_system} micro gas CHP",
p_nom_extendable=True,
bus0=spatial.gas.df.loc[nodes, "nodes"].values,
bus1=nodes,
bus2=nodes + f" {name} heat",
bus2=nodes + f" {heat_system} heat",
bus3="co2 atmosphere",
carrier=name + " micro gas CHP",
carrier=heat_system.value + " micro gas CHP",
efficiency=costs.at["micro CHP", "efficiency"],
efficiency2=costs.at["micro CHP", "efficiency-heat"],
efficiency3=costs.at["gas", "CO2 intensity"],
@ -2152,7 +2168,7 @@ def add_heat(n, costs):
) / heat_demand.T.groupby(level=[1]).sum().T
for name in n.loads[
n.loads.carrier.isin([x + " heat" for x in heat_systems])
n.loads.carrier.isin([x + " heat" for x in HeatSystem])
].index:
node = n.buses.loc[name, "location"]
ct = pop_layout.loc[node, "ct"]
@ -2248,8 +2264,14 @@ def add_biomass(n, costs):
biogas_potentials_spatial = biomass_potentials["biogas"].rename(
index=lambda x: x + " biogas"
)
unsustainable_biogas_potentials_spatial = biomass_potentials[
"unsustainable biogas"
].rename(index=lambda x: x + " biogas")
else:
biogas_potentials_spatial = biomass_potentials["biogas"].sum()
unsustainable_biogas_potentials_spatial = biomass_potentials[
"unsustainable biogas"
].sum()
if options.get("biomass_spatial", options["biomass_transport"]):
solid_biomass_potentials_spatial = biomass_potentials["solid biomass"].rename(
@ -2258,11 +2280,27 @@ def add_biomass(n, costs):
msw_biomass_potentials_spatial = biomass_potentials[
"municipal solid waste"
].rename(index=lambda x: x + " municipal solid waste")
unsustainable_solid_biomass_potentials_spatial = biomass_potentials[
"unsustainable solid biomass"
].rename(index=lambda x: x + " solid biomass")
else:
solid_biomass_potentials_spatial = biomass_potentials["solid biomass"].sum()
msw_biomass_potentials_spatial = biomass_potentials[
"municipal solid waste"
].sum()
unsustainable_solid_biomass_potentials_spatial = biomass_potentials[
"unsustainable solid biomass"
].sum()
if options["regional_oil_demand"]:
unsustainable_liquid_biofuel_potentials_spatial = biomass_potentials[
"unsustainable bioliquids"
].rename(index=lambda x: x + " bioliquids")
else:
unsustainable_liquid_biofuel_potentials_spatial = biomass_potentials[
"unsustainable bioliquids"
].sum()
n.add("Carrier", "biogas")
n.add("Carrier", "solid biomass")
@ -2387,6 +2425,81 @@ def add_biomass(n, costs):
p_nom_extendable=True,
)
if biomass_potentials.filter(like="unsustainable").sum().sum() > 0:
# Create timeseries to force usage of unsustainable potentials
e_max_pu = pd.DataFrame(1, index=n.snapshots, columns=spatial.gas.biogas)
e_max_pu.iloc[-1] = 0
n.madd(
"Store",
spatial.gas.biogas,
suffix=" unsustainable",
bus=spatial.gas.biogas,
carrier="unsustainable biogas",
e_nom=unsustainable_biogas_potentials_spatial,
marginal_cost=costs.at["biogas", "fuel"],
e_initial=unsustainable_biogas_potentials_spatial,
e_nom_extendable=False,
e_max_pu=e_max_pu,
)
e_max_pu = pd.DataFrame(1, index=n.snapshots, columns=spatial.biomass.nodes)
e_max_pu.iloc[-1] = 0
n.madd(
"Store",
spatial.biomass.nodes,
suffix=" unsustainable",
bus=spatial.biomass.nodes,
carrier="unsustainable solid biomass",
e_nom=unsustainable_solid_biomass_potentials_spatial,
marginal_cost=costs.at["fuelwood", "fuel"],
e_initial=unsustainable_solid_biomass_potentials_spatial,
e_nom_extendable=False,
e_max_pu=e_max_pu,
)
n.madd(
"Bus",
spatial.biomass.bioliquids,
location=spatial.biomass.locations,
carrier="unsustainable bioliquids",
unit="MWh_LHV",
)
e_max_pu = pd.DataFrame(
1, index=n.snapshots, columns=spatial.biomass.bioliquids
)
e_max_pu.iloc[-1] = 0
n.madd(
"Store",
spatial.biomass.bioliquids,
suffix=" unsustainable",
bus=spatial.biomass.bioliquids,
carrier="unsustainable bioliquids",
e_nom=unsustainable_liquid_biofuel_potentials_spatial,
marginal_cost=costs.at["biodiesel crops", "fuel"],
e_initial=unsustainable_liquid_biofuel_potentials_spatial,
e_nom_extendable=False,
e_max_pu=e_max_pu,
)
n.madd(
"Link",
spatial.biomass.bioliquids,
bus0=spatial.biomass.bioliquids,
bus1=spatial.oil.nodes,
bus2="co2 atmosphere",
carrier="unsustainable bioliquids",
efficiency=1,
efficiency2=-costs.at["solid biomass", "CO2 intensity"]
+ costs.at["BtL", "CO2 stored"],
p_nom=unsustainable_liquid_biofuel_potentials_spatial,
marginal_cost=costs.at["BtL", "VOM"],
)
n.madd(
"Link",
spatial.gas.biogas_to_gas,
@ -3110,27 +3223,23 @@ def add_industry(n, costs):
if options["oil_boilers"]:
nodes = pop_layout.index
for name in [
"residential rural",
"services rural",
"residential urban decentral",
"services urban decentral",
]:
n.madd(
"Link",
nodes + f" {name} oil boiler",
p_nom_extendable=True,
bus0=spatial.oil.nodes,
bus1=nodes + f" {name} heat",
bus2="co2 atmosphere",
carrier=f"{name} oil boiler",
efficiency=costs.at["decentral oil boiler", "efficiency"],
efficiency2=costs.at["oil", "CO2 intensity"],
capital_cost=costs.at["decentral oil boiler", "efficiency"]
* costs.at["decentral oil boiler", "fixed"]
* options["overdimension_individual_heating"],
lifetime=costs.at["decentral oil boiler", "lifetime"],
)
for heat_system in HeatSystem:
if not heat_system == HeatSystem.URBAN_CENTRAL:
n.madd(
"Link",
nodes + f" {heat_system} oil boiler",
p_nom_extendable=True,
bus0=spatial.oil.nodes,
bus1=nodes + f" {heat_system} heat",
bus2="co2 atmosphere",
carrier=f"{heat_system} oil boiler",
efficiency=costs.at["decentral oil boiler", "efficiency"],
efficiency2=costs.at["oil", "CO2 intensity"],
capital_cost=costs.at["decentral oil boiler", "efficiency"]
* costs.at["decentral oil boiler", "fixed"]
* options["overdimension_individual_heating"],
lifetime=costs.at["decentral oil boiler", "lifetime"],
)
n.madd(
"Link",
@ -4122,6 +4231,7 @@ def add_enhanced_geothermal(n, egs_potentials, egs_overlap, costs):
# %%
if __name__ == "__main__":
if "snakemake" not in globals():
from _helpers import mock_snakemake
snakemake = mock_snakemake(
@ -4186,7 +4296,7 @@ if __name__ == "__main__":
add_land_transport(n, costs)
if options["heating"]:
add_heat(n, costs)
add_heat(n=n, costs=costs, cop=xr.open_dataarray(snakemake.input.cop_profiles))
if options["biomass"]:
add_biomass(n, costs)