Skip to content

Rule build_powerplants

Workflow Diagram

See the complete workflow in the repository.

digraph snakemake_dag { graph [bgcolor=white, margin=0, size="8,5" ]; node [fontname=sans, fontsize=10, penwidth=2, shape=box, style=rounded ]; edge [color=grey, penwidth=2 ]; 4 [color="0.61 0.6 0.85", label=add_electricity]; 6 [color="0.17 0.6 0.85", label=base_network]; 7 [color="0.58 0.6 0.85", fillcolor=gray, label=build_powerplants, style=filled]; 6 -> 7; 7 -> 4; }

Script Documentation

Retrieves conventional powerplant capacities and locations from powerplantmatching <https://github.com/FRESNA/powerplantmatching>_, assigns these to buses and creates a .csv file. It is possible to merge the powerplant database with, or replace it using, one or more custom powerplant files.

Relevant Settings

.. code:: yaml

electricity:
  powerplants_filter:
  custom_powerplants:
    filepaths:
    method:

.. seealso:: Documentation of the configuration file config.yaml at :ref:electricity

Inputs

  • networks/base.nc: confer :ref:base.
  • Files listed under custom_powerplants.filepaths: custom powerplants in the same format as powerplantmatching <https://github.com/FRESNA/powerplantmatching>_ provides or as the OSM extractor generates.

Outputs

  • resource/powerplants.csv: A list of conventional power plants (i.e. neither wind nor solar) with fields for name, fuel type, technology, country, capacity in MW, duration, commissioning year, retrofit year, latitude, longitude, and dam information as documented in the powerplantmatching README <https://github.com/FRESNA/powerplantmatching/blob/master/README.md>_; additionally it includes information on the closest substation/bus in networks/base.nc.

    .. image:: /img/powerplantmatching.png :width: 30 %

    Source: powerplantmatching on GitHub <https://github.com/FRESNA/powerplantmatching>_

Description

The configuration option electricity: powerplants_filter specifies a pandas.query command applied to the complete powerplant dataset, including both powerplantmatching and custom powerplants.

The electricity: custom_powerplants section specifies the custom files and how they are applied. method accepts false, merge, or replace and is applied once to the complete set of configured files. merge appends all configured custom powerplants to the filtered powerplantmatching dataset, while replace discards the complete powerplantmatching dataset and uses all configured custom files instead.

  1. Using only powerplantmatching data:

    .. code:: yaml

    custom_powerplants:
      filepaths:
      - data/custom_powerplants.csv
      method: false
    
  2. Adding all powerplants from a custom file:

    .. code:: yaml

    custom_powerplants:
      filepaths:
      - data/custom_powerplants.csv
      method: merge
    
  3. Replacing the complete powerplantmatching dataset:

    .. code:: yaml

    custom_powerplants:
      filepaths:
      - data/custom_powerplants.csv
      method: replace
    
  4. Combining multiple custom files:

Multiple custom powerplant files can be provided. A single method is applied to the complete set of configured files.

.. code:: yaml

   custom_powerplants:
     filepaths:
     - data/custom_powerplants_US.csv
     - data/custom_powerplants_CA.csv
     method: merge

The available methods are:

  • false: ignore the custom files and use only powerplantmatching data.
  • merge: add all configured custom files to the filtered powerplantmatching dataset.
  • replace: discard the complete powerplantmatching dataset and use only the configured custom files.

  • Obtaining different outcomes for different countries:

Country-specific replacement can be achieved by excluding the corresponding country from powerplants_filter and then merging the custom files.

.. code:: yaml

   powerplants_filter: (DateOut >= 2022 or DateOut != DateOut) and (DateIn <= 2023 or DateIn != DateIn) and Country != 'United States'

   custom_powerplants:
     filepaths:
     - data/custom_powerplants_US.csv
     - data/custom_powerplants_CA.csv
     method: merge

In this example:

  • US plants are taken only from custom_powerplants_US.csv because US plants are excluded from powerplantmatching.
  • CA plants from custom_powerplants_CA.csv are added to the existing powerplantmatching data.
  • Countries without a custom file, such as MX, use only powerplantmatching data.

Custom powerplant file format ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Custom powerplant CSV files should follow the powerplantmatching format, with some additional considerations.

Required columns:

id, Name, Fueltype, Technology, Set, Country, Capacity, Efficiency, DateIn, DateRetrofit, DateOut, lat, lon, Duration, Volume_Mm3, DamHeight_m, StorageCapacity_MWh, EIC, and projectID.

Considerations for column values:

  • Fueltype should use the corresponding powerplantmatching fuel category, such as Natural Gas.
  • Natural-gas plants should specify OCGT or CCGT in the Technology column.
  • Hydro plants with Technology set to Reservoir are represented as storage units. Use ror for hydro plants that should be represented as generators.
  • Country values are converted to ISO 3166-1 alpha-2 codes after the custom files have been applied. Both full country names and alpha-2 codes are therefore accepted in custom files.

OSM mapping assumptions ~~~~~~~~~~~~~~~~~~~~~~~

The following assumptions were made when mapping custom OSM-extracted power plants to the powerplantmatching format:

  1. The benchmark powerplantmatching values were taken as follows:

  2. Fueltype: Hydro, Hard Coal, Natural Gas, Lignite, Nuclear, Oil, Bioenergy, Wind, Geothermal, Solar, Waste, and Other.

  3. Technology: Reservoir, Pumped Storage, Run-Of-River, Steam Turbine, CCGT, OCGT, PV, CCGT, Thermal, Offshore, and Storage Technologies.
  4. Set: Store, PP, and CHP.

  5. OSM-extracted features were mapped to powerplantmatching values using the following rules:

  6. coal -> Hard Coal

  7. wind_turbine -> Onshore
  8. horizontal_axis -> Onshore
  9. vertical_axis -> Offshore
  10. nuclear -> Steam Turbine

  11. All hydro objects extracted from OSM were interpreted as generation technologies, although Run-Of-River, Pumped Storage, and Reservoir may also belong to Storage Technologies in powerplantmatching.

  12. The OSM extraction was assumed to ignore non-generation features such as CHP plants and natural-gas storage, unlike powerplantmatching.

add_custom_powerplants(ppl, custom_powerplants_files, method)

Merge or replace powerplantmatching data with custom powerplant files.

Parameters

ppl : pd.DataFrame Powerplantmatching dataframe. custom_powerplants_files : list[str] Paths to custom powerplant CSV files. method : bool or str Method applied to all custom files together. Accepted values are False, "merge", and "replace".

Returns

pd.DataFrame Powerplant dataframe after applying the custom files.

replace_natural_gas_technology(df)

Maps and replaces gas technologies in the powerplants.csv onto model compliant carriers.