gas_grid

The module containing code aiming to insert the methane grid into the database

The central module containing all code dealing with the import of data from SciGRID_gas (IGGIELGN dataset) and with the insertion fo the CH4 buses and links into the database for the scenarios eGon2035 and eGon100RE.

The SciGRID_gas data downloaded with download_SciGRID_gas_data() into the folder ./datasets/gas_data/data are also used by other modules.

In this module, only the IGGIELGN_Nodes and IGGIELGN_PipeSegments cvs files are used in the function insert_gas_data() that inserts the CH4 buses and links, which for the case of gas represent pipelines, into the database.

class GasNodesAndPipes(dependencies)[source]

Bases: egon.data.datasets.Dataset

Insert the CH4 buses and links into the database.

Insert the CH4 buses and links, which for the case of gas represent pipelines, into the database for the scenarios eGon2035 and eGon100RE with the functions insert_gas_data() and insert_gas_data_eGon100RE().

Dependencies
Resulting tables
name = 'GasNodesAndPipes'
version = '0.0.9'
ch4_nodes_number_G(gas_nodes_list)[source]

Return the number of CH4 buses in Germany

Parameters:gas_nodes_list (pandas.DataFrame) – Dataframe containing the gas nodes in Europe
Returns:N_ch4_nodes_G (int) – Number of CH4 buses in Germany
define_gas_nodes_list()[source]

Define list of CH4 buses from SciGRID_gas IGGIELGN data

The CH4 nodes are modelled as buses. Therefore the SciGRID_gas nodes are red from the IGGIELGN_Nodes cvs file previously downloaded in the function download_SciGRID_gas_data(), corrected (erroneous country), and returned as dataframe.

Returns:gas_nodes_list (pandas.DataFrame) – Dataframe containing the gas nodes in Europe
download_SciGRID_gas_data()[source]

Download SciGRID_gas IGGIELGN data from Zenodo

The following data for CH4 are downloaded into the folder ./datasets/gas_data/data:

  • Buses (file IGGIELGN_Nodes.csv),
  • Pipelines (file IGGIELGN_PipeSegments.csv),
  • Productions (file IGGIELGN_Productions.csv),
  • Storages (file IGGIELGN_Storages.csv),
  • LNG terminals (file IGGIELGN_LNGs.csv).

For more information on these data refer, to the SciGRID_gas IGGIELGN documentation.

Returns:None
insert_CH4_nodes_list(gas_nodes_list)[source]

Insert list of German CH4 nodes into the database for eGon2035

Insert the list of German CH4 nodes into the database by executing the following steps:

  • Receive the buses as parameter (from SciGRID_gas IGGIELGN data)
  • Add the missing information: scn_name and carrier
  • Clean the database table grid.egon_etrago_bus of the CH4 buses of the specific scenario (eGon2035) in Germany
  • Insert the buses in the table grid.egon_etrago_bus
Parameters:gas_nodes_list (pandas.DataFrame) – Dataframe containing the gas nodes in Europe
Returns:None
insert_gas_buses_abroad(scn_name='eGon2035')[source]

Insert CH4 buses in neighbouring countries to database for eGon2035

For the scenario eGon2035, insert central CH4 buses in foreign countries to the database. The considered foreign countries are the direct neighbouring countries, with the addition of Russia that is considered as a source of fossil CH4. Therefore, the following steps are executed:

  • Definition of the foreign buses with the function import_central_buses_egon100 from the module electrical_neighbours
  • Removal of the superfluous buses in order to have only one bus in each neighbouring country
  • Removal of the the irrelevant columns
  • Addition of the missing information: scn_name and carrier
  • Attribution of an id to each bus
  • Cleaning of the database table grid.egon_etrago_bus of the CH4 buses of the specific scenario (eGon2035) out of Germany
  • Insertion of the neighbouring buses in the table grid.egon_etrago_bus.
Returns:gdf_abroad_buses (pandas.DataFrame) – Dataframe containing the gas buses in the neighbouring countries and one in the center of Germany in test mode
insert_gas_data()[source]

Overall function for importing methane data for eGon2035

This function import the methane data (buses and pipelines) for eGon2035, by executing the following steps:

This function inserts data into the database and has no return.

insert_gas_data_eGon100RE()[source]

Overall function for importing methane data for eGon100RE

This function import the methane data (buses and pipelines) for eGon100RE, by copying the CH4 buses from the eGon2035 scenario using the function copy_and_modify_buses from the module etrago_helpers. The methane pipelines are also copied and their capacities are adapted: one share of the methane grid is retroffited into an hydrogen grid, so the methane pieplines nominal capacities are reduced from this share (calculated in the pyspa-eur-sec run).

This function inserts data into the database and has no return.

insert_gas_pipeline_list(gas_nodes_list, abroad_gas_nodes_list, scn_name='eGon2035')[source]

Insert list of gas pipelines into the database

The gas pipelines, modelled as Pypsa links are red from the IGGIELGN_PipeSegments csv file previously downloded in the function download_SciGRID_gas_data(), adapted and inserted in the database for the eGon2035 scenario. The manual corrections allows to:

  • Delete gas pipelines disconnected of the rest of the gas grid
  • Connect one pipeline (also connected to Norway) disconnected of the rest of the gas grid
  • Correct erroneous country of some pipelines

The capacities of the pipelines are determined by the correspondance table given by the Parameters for the classification of gas pipelines in Electricity, heat, and gas sector data for modeling the German system related to the pipeline diameter given in the SciGRID_gas dataset.

The database is cleaned before the insertion of the pipelines.

Parameters:
  • gas_nodes_list (dataframe) – Dataframe containing the gas nodes in Europe
  • abroad_gas_nodes_list (dataframe) – Dataframe containing the gas buses in the neighbouring countries and one in the center of Germany in test mode
  • scn_name (str) – Name of the scenario
Returns:

None

remove_isolated_gas_buses()[source]

Delete CH4 buses which are disconnected of the CH4 grid for the eGon2035 scenario

This function deletes directly in the database and has no return.