Skip to content

Commit

Permalink
Merge branch 'develop' into feature-more-consistent-test-folder-struc…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
timtroendle committed Jul 3, 2024
2 parents 9936cf6 + c47fdf2 commit 6648952
Show file tree
Hide file tree
Showing 23 changed files with 605 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
- id: end-of-file-fixer
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
rev: v0.5.0
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

* **ADD** Spatial resolution that aligns with the regions defined by the [e-Highway 2050 project](https://cordis.europa.eu/project/id/308908/reporting) (`ehighways`) (#370).

* **ADD** fully-electrified heat demand (#284, #343, #390, #391).
* **ADD** fully-electrified heat demand (#284, #343, #389) and heat pumps with variable COP to meet that demand (#80, #39).

* **ADD** fully-electrified road transportation (#270, #271, #358). A parameter allows to define the share of uncontrolled (timeseries) vs controlled charging (optimised) by the solver (#338). Data for controlled charging constraints is readily available (#356), but corresponding constraints are not yet implemented (#385).

Expand Down
13 changes: 10 additions & 3 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ rule techs_and_locations_template:
params:
scaling_factors = config["scaling-factors"],
capacity_factors = config["capacity-factors"]["average"],
max_power_densities = config["parameters"]["maximum-installable-power-density"]
max_power_densities = config["parameters"]["maximum-installable-power-density"],
heat_pump_shares = config["parameters"]["heat-pump"]["heat-pump-shares"],
wildcard_constraints:
tech_group = "(?!transmission).*" # i.e. all but transmission
conda: "envs/default.yaml"
Expand Down Expand Up @@ -159,15 +160,18 @@ rule model_template:
"techs/demand/electrified-heat.yaml",
"techs/storage/electricity.yaml",
"techs/storage/hydro.yaml",
"techs/storage/heat.yaml",
"techs/supply/biofuel.yaml",
"techs/supply/hydro.yaml",
"techs/supply/load-shedding.yaml",
"techs/supply/open-field-solar-and-wind-onshore.yaml",
"techs/supply/rooftop-solar.yaml",
"techs/supply/wind-offshore.yaml",
"techs/supply/nuclear.yaml",
"techs/supply/heat-from-electricity.yaml",
]
),
cop_data = "build/models/{resolution}/timeseries/supply/heat-pump-cop.csv",
capacityfactor_timeseries_data = expand(
"build/models/{{resolution}}/timeseries/supply/capacityfactors-{technology}.csv",
technology=ALL_CF_TECHNOLOGIES
Expand Down Expand Up @@ -241,9 +245,12 @@ rule test:
capacity_factor_timeseries = expand(
"build/models/{{resolution}}/timeseries/supply/capacityfactors-{technology}.csv",
technology=ALL_CF_TECHNOLOGIES
)
),
unscaled_space_heat = "build/data/heat/hourly_unscaled_heat_demand.nc",
cop = "build/models/{resolution}/timeseries/supply/heat-pump-cop.csv"
params:
config = config
config = config,
test_args = [] # add e.g. "--pdb" to enter ipdb on test failure
log: "build/logs/{resolution}/test-report.html"
output: "build/logs/{resolution}/test.success"
conda: "./envs/test.yaml"
Expand Down
32 changes: 21 additions & 11 deletions config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ data-sources:
gridded-weather-data: https://zenodo.org/records/11516744/files/{data_var}.nc
when2heat-params: https://zenodo.org/records/10965295/files/{dataset}?download=1
population: https://ec.europa.eu/eurostat/cache/GISCO/geodatafiles/JRC_GRID_2018.zip
heat-pump-characteristics: https://sandbox.zenodo.org/records/45378/files/wamak-heat-pump-characteristics.nc
data-pre-processing:
fill-missing-values:
jrc-idees:
Expand Down Expand Up @@ -188,30 +189,39 @@ parameters:
nuts-year: 2013
heat:
space_heat:
carnot-performance: 0.36 # [Nouvel_2015]
gas-eff: 0.97 # [DEA_2016], but 70-80% according to [Qu_2014]
oil-eff: 0.9 # [DEA_2016], but 0.63 according to [martin_2014]
gas-eff: 0.97 # [@DEA:2020], but 70-80% according to [Qu_2014]
oil-eff: 0.9 # [@DEA:2020], but 0.63 according to [martin_2014]
solid-fossil-eff: 0.8 # Assume same as biofuel
biofuel-eff: 0.8 # [mermoud_2015] [Chandrasekaran_2013] [DEA_2016]
biofuel-eff: 0.8 # [@DEA:2020] [mermoud_2015] [Chandrasekaran_2013] [DEA_2016]
solar-thermal-eff: 1 # Eurostat energy balances method
electricity-eff: 1 # must be 1 for the time being (we assume 1 -> 1 electricity -> heat conversion)
space-heat-temp: 36 # degrees C [Nouvel_2015]
hp-cop: 3.5
water_heat:
gas-eff: 0.97 # [DEA_2016], but 70-80% according to [Qu_2014]
oil-eff: 0.9 # [DEA_2016], but 0.63 according to [martin_2014]
hot_water:
gas-eff: 0.97 # [@DEA:2020], but 70-80% according to [Qu_2014]
oil-eff: 0.9 # [@DEA:2020], but 0.63 according to [martin_2014]
solid-fossil-eff: 0.8 # Assume same as biofuel
biofuel-eff: 0.8 # [mermoud_2015] [Chandrasekaran_2013] [DEA_2016]
solar-thermal-eff: 1 # Eurostat energy balances method
electricity-eff: 1 # must be 1 for the time being (we assume 1 -> 1 electricity -> heat conversion)
water-heat-temp: 52 # degrees C [Nouvel_2015]
hp-cop: 3.5
cooking:
gas-eff: 0.28 # [Karunanithy_2016]
oil-eff: 0.28 # [Karunanithy_2016] assuming oil == gas efficiency
solid-fossil-eff: 0.15 # [Ramanathan_1994] scaled down 60%, based on values calculated by [Karunanithy_2016]
biofuel-eff: 0.1 # [Ramanathan_1994] scaled down 60%, based on values calculated by [Karunanithy_2016]
electricity-eff: 0.5 # [Karunanithy_2016] based on 2/3 40% efficient direct electric, 1/3 70% efficient induction
heat-pump:
sink-temperature: # All values are assumed.
underfloor: 35
radiator-large: 50
radiator-conventional: 65
hot-water: 60
space-heat-sink-shares: # All values are assumed.
underfloor: 0.1
radiator-large: 0.15
radiator-conventional: 0.75
heat-pump-shares: # see https://stats.ehpa.org, 2018 market data assuming current ashp = air-to-air AND air-to-water
ashp: 0.9
gshp: 0.1
correction-factor: 0.85 # [@Ruhnau:2019]
quality-control:
load:
outlier-data-thresholds:
Expand Down
87 changes: 71 additions & 16 deletions config/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ properties:
type: string
pattern: ^(https?|http?):\/\/.+
description: "Web address of population data."
heat-pump-characteristics:
type: string
pattern: ^(https?|http?):\/\/.*\.(nc)$
description: >
Web address of manufacturer heat pump characteristic dataset.
Expected dimensions are:
- source (intended source of ambient temperature of the heat pump - air or ground)
- product (names of manufacturer products)
- sink_temp (sink temperature in degrees C)
- source_temp (source temperature in degrees C)
- data_type (characteristics of the heat pumps, e.g. COP, Heating capacity)
data-pre-processing:
type: object
description: Parameters for the pre-processing of raw data.
Expand Down Expand Up @@ -447,9 +458,6 @@ properties:
description: Parameters of space heating technologies.
additionalProperties: false
properties:
carnot-performance:
type: number
description: Carnot performance.
gas-eff:
type: number
description: Gas boiler efficiency.
Expand All @@ -468,13 +476,7 @@ properties:
electricity-eff:
type: number
description: Electric heater efficiency.
space-heat-temp:
type: number
description: Space heating temperature.
hp-cop:
type: number
description: Heat pump coefficient of performance.
water_heat:
hot_water:
type: object
description: Parameters of water heating technologies.
additionalProperties: false
Expand All @@ -497,12 +499,6 @@ properties:
electricity-eff:
type: number
description: Electric heater efficiency.
water-heat-temp:
type: number
description: Water heating temperature.
hp-cop:
type: number
description: Heat pump coefficient of performance.
cooking:
type: object
description: Parameters of cooking technologies.
Expand All @@ -523,6 +519,65 @@ properties:
electricity-eff:
type: number
description: Electric stove efficiency.

heat-pump:
type: object
description: Parameters to define heat pump operating characteristics
additionalProperties: false
properties:
sink-temperature:
type: object
description: Assumed running temperature (degrees C) of different heating methods.
additionalProperties: false
properties:
underfloor:
type: integer
description: Underfloor heating.
radiator-large:
type: integer
description: Large radiators (usually installed alongside heat pumps during retrofit).
radiator-conventional:
type: integer
description: Conventional radiators (usually installed alongside gas boilers).
hot-water:
type: integer
description: Hot water temperature (not space heating).
space-heat-sink-shares:
type: object
description: Share of building stock assumed to have different space heating methods
additionalProperties: false
properties:
underfloor:
type: number
description: Underfloor heating.
radiator-large:
type: number
description: Large radiators (usually installed alongside heat pumps during retrofit).
radiator-conventional:
type: number
description: Conventional radiators (usually installed alongside gas boilers).
heat-pump-shares:
type: object
description: >-
Market share of air- vs ground-source heat pumps, which will be used to create a generic "heat pump" technology.
Must sum to 1.
additionalProperties: false
properties:
ashp:
type: number
description: Air-source heat pump
minimum: 0
maximum: 1
gshp:
type: number
description: Ground-source heat pump
minimum: 0
maximum: 1
correction-factor:
type: number
minimum: 0
maximum: 1
description: Correction factor to go from manufacturer data on heat pump performance to 'real' system performance.
scope:
type: object
description: Spatial and temporal scope bounding the models.
Expand Down
10 changes: 9 additions & 1 deletion docs/about/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ Schröder, A., Kunz, F., Meiss, J., Mendelevitch, R., & Von Hirschhausen, C.

### @DEA:2020

Danish Energy Agency. (2020). <i>Technology Data for Generation of Electricity and District Heating.</i> [https://ens.dk/en/our-services/projections-and-models/technology-data/technology-data-generation-electricity-and](https://ens.dk/en/our-services/projections-and-models/technology-data/technology-data-generation-electricity-and)
Danish Energy Agency. (2020). _Technology Data for Generation of Electricity and District Heating, version 9._ <https://ens.dk/en/our-services/projections-and-models/technology-data/technology-data-generation-electricity-and>

### @DEA:2019

Danish Energy Agency. (2019). _Technology Data for Energy storage, version 4._ <https://ens.dk/en/our-services/technology-catalogues/technology-data-energy-storage>

### @DEA:2017

Danish Energy Agency. (2017). _Technology Data for heating installations, version 1._ <https://ens.dk/en/our-services/technology-catalogues/technology-data-individual-heating-plants>

### @Wealer:2019

Expand Down
31 changes: 30 additions & 1 deletion docs/model/customisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ Here, we describe each module in terms of the technologies they contain (`callio
The ratio is derived from typical values of commercial lithium-ion batteries available today (2021).
Constraining hydrogen storage as well ensures it does not directly compete with battery storage, but is used instead for durations of fours hours and longer.

??? note "storage/heat.yaml"

=== "Technologies"

**heat_storage_small**: Abstract [technology group](https://calliope.readthedocs.io/en/v0.6.10/user/advanced_features.html#using-tech-groups-to-group-configuration).
This "technology" only becomes part of the model when defining technologies in the overrides of this file.

=== "Overrides"

**add_heat_pump_storage**: Add storage buffer for heat pumps.
Adds the technology `hp_heat_storage_small` using the `heat_storage_small` abstract technology group.

**add_electric_heater_storage**: Add storage buffer for direct electric heaters.
Adds the technology `electric_heater_heat_storage_small` using the `heat_storage_small` abstract technology group.

=== "Scenarios"

**add_heat_tech_storage**: Add all technology storage buffers at once.

??? note "storage/hydro.yaml"

Expand All @@ -101,6 +119,18 @@ Here, we describe each module in terms of the technologies they contain (`callio

**biofuel**: Biofuel

??? note "supply/heat-from-electricity.yaml"

=== "Technologies"

**heat_pump**: Heat pump.

**heat_pump_tech_heat_to_demand**: Dummy technology to convert heat pump output to a carrier that can be used to meet heat demand.

**electric_heater**: Direct electric heater.

**electric_heater_tech_heat_to_demand**: Dummy technology to convert electric heater output to a carrier that can be used to meet heat demand.

??? note "supply/hydro.yaml"

=== "Technologies"
Expand Down Expand Up @@ -133,7 +163,6 @@ Here, we describe each module in terms of the technologies they contain (`callio
Calliope provides a built-in mechanism that is similar: [`ensure-feasibility`](https://calliope.readthedocs.io/en/v{{ calliope_version }}/user/building.html#allowing-for-unmet-demand).
The benefit of using the `load-shedding` override over Calliope's built-in mechanism is that it is more targeted towards modelling shedding of electrical load and provides more flexibility -- for example in terms of the cost of shed load.


??? note "supply/nuclear.yaml"

=== "Technologies"
Expand Down
1 change: 1 addition & 0 deletions docs/model/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Within each resolution-specific model directory, there is a subdirectory for tec
├── {resolution} <- An individual folder for each spatial resolution.
│ ├── timeseries <- All timeseries data CSV files.
| | |── supply
| | | └── heat-pump-cop.csv <- Timeseries of heat pump coefficients of performance (COPs).
| | | └── capacityfactors-{technology}.csv <- Timeseries of capacityfactors of all renewables.
| | └── demand
| | | └── electricity.csv <- Timeseries of electricity demand on each node.
Expand Down
2 changes: 2 additions & 0 deletions envs/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ dependencies:
- netCDF4=1.6.2
- hdf5=1.12.2
- libnetcdf=4.8.1
- scipy=1.9.1
- dask=2023.2.0
- pip:
- -e ./lib
- styleframe==4.2
2 changes: 2 additions & 0 deletions lib/eurocalliopelib/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import jinja2
import numpy as np

from eurocalliopelib import filters

Expand All @@ -20,6 +21,7 @@ def parametrise_template(path_to_template, path_to_output_yaml, **kwargs):
undefined=jinja2.StrictUndefined, # This ensures that missing pandas index elements raise an exception instead of silently returning None
)
env.filters["unit"] = filters.unit
env.globals["mean"] = np.mean
rendered = env.get_template(path_to_template.name).render(**kwargs)

with open(path_to_output_yaml, "w") as result_file:
Expand Down
Loading

0 comments on commit 6648952

Please sign in to comment.