Home

Awesome

GEOH2

Geospatial analysis of hydrogen production costs

GEOH2 calculates the locational cost of green hydrogen production, storage, transport, and conversion to meet demand in a specified location. These costs can be compared to current or projected prices for energy and chemical feedstocks in the region to assess the competitiveness of green hydrogen. Currently, different end-uses, such as fertilizer production, export shipping, and steel production, are not modeled.

The model outputs the levelized cost of hydrogen (LCOH) at the demand location including production, storage, transport, and conversion costs.

In the code provided, the specific use case of Namibia is investigated. Parameter references for this case are attached. However, as the code is written in a generalized way, it is possible to analyse all sorts of regions.

GeoH2 builds upon a preliminary code iteration produced by Leander Müller, available under a CC-BY-4.0 licence: https://github.com/leandermue/GEOH2. It also integrates code produced by Nick Salmon under an MIT licence: https://github.com/nsalmon11/LCOH_Optimisation


Setup instructions

Clone the repository

First, clone the GeoH2 repository using git.

... % git clone https://github.com/ClimateCompatibleGrowth/GeoH2.git

Environment setup

The python package requirements are in the environment.yaml file. You can install these requirements in a new environment using mamba package and environment manager (installation instructions here):

.../GEOH2 % mamba env create -f environment.yaml

Then activate this new environment using

.../GEOH2 % mamba activate geoh2

CDS API setup

The get_weather_data rule downloads the relevant historical weather data from the ERA-5 reanalysis dataset using Atlite to create a cutout. For this process to work, you need to register and set up your CDS API key as described on the Climate Data Store website.

Note: Ensure the API key and URL are affiliated with CDS-Beta.

Solver setup

For the optimize_hydrogen_plant rule to work, you will need a solver installed on your computer. You can use any solver that works with PyPSA, such as Cbc, a free, open-source solver, or Gurobi, a commerical solver with free academic licenses available. Install your solver of choice following the instructions for use with Python and your operating system in the solver's documentation.

In Scripts/optimize_hydrogen_plant.py line 160, the solver is set to gurobi. This must be changed if you choose to use a different solver.

Note: Snakemake uses Cbc, which will be installed upon environment setup. To check, activate your environment and enter mamba list in your terminal for the environment's list of packages.


Preparing input data

Hexagons

To analyse a different area of interest, the input hexagon file needs to be changed, but needs to follow the logic of the one provided.

A full walkthrough on all the tools to create these hexagons are in the GeoH2-data-prep repo.

An explanation of how to create a H3-Hexagon file can be found in the following repo:

https://github.com/carderne/ccg-spider

The hexagon file needs to filled with the following attributes:

Once you have created a hexagon file with these features, save it in the Data folder as hex_final_[COUNTRY ISO CODE].geojson.

Note: COUNTRY ISO CODE is the country's ISO standard 2-letter abbreviation.

Input parameter Excel files

Required input parameters include the spatial area of interest, total annual demand for hydrogen, and prices and cost of capital for infrastructure investments. These values can be either current values or projected values for a single snapshot in time. The parameter values for running the model can be specified in a set of Excel files in the Parameters folder.


Snakemake

This repository uses Snakemake to automate its workflow (for a gentle introduction to Snakemake, see Getting Started with Snakemake on The Carpentries Incubator).

Wildcards

Wildcards specify the data used in the workflow. This workflow uses two wildcards: country (an ISO standard 2-letter abbreviation) and weather_year (a 4-digit year between 1940 and 2023 included in the ERA5 dataset).

Config file

High-level workflow settings are controlled in the config file: config.yaml.

Multiple wildcard values are specified in the scenario section. These can be changed to match the country and weather_year you are analysing.

Renewable generators considered for hydrogen plant construction are included in the generators section.

In the transport section, pipeline_construction and road_construction can be switched from True to False, as needed.

Note: country and weather_year can be a list of more than one, depending on how many countries and years you are analysing.

Rules

Rules can be run multiple ways using Snakemake. Below, you will be able to run rules by entering the rule name or their output in the terminal. Snakemake will run all necessary rules and their corresponding scripts to create an output. While all rules are discussed here for completeness, you do not need to enter each rule one-by-one and can simply enter the output you're interested in or one of the run all rules. Rules are defined in the Snakefile.

Snakemake requires a specification of the number of cores to be used; this can be up to 4.

Run time

The get_weather_data rule, depending on country size and your internet connection, could take from a few minutes to several hours to run. Ensure that you have space on your computer to store the data, which can be several GB.

The optimize_hydrogen_plant rule, depending on country size and the number of demand centers, could take from several minutes to several hours to run.

The optimize_transport_and_conversion rule, depending on country size, should take a few minutes to run.

All other rules take a few seconds to run.

Rule to remove all files

Note: This rule does not work on Windows, as of yet. Please manually remove the files you need to.

This rule is important to know first, as it will remove all the files that the below rules will create as well as the file you initially saved into the Data folder as hex_final_[COUNTRY ISO CODE].geojson.

This is to allow for a quicker transition to analyse more data and to clear up space. Make sure you save the created files that you need elsewhere before running the following rule into the terminal:

snakemake -j [NUMBER OF CORES TO BE USED] clean

Run all rules

This section can be used to run all rules, without having to run exact output files. If any files are changed after a completed run, the same command can be used again and Snakemake will only run the necessary scripts to ensure the results are up to date.

The total hydrogen cost for all scenarios can be run by entering the following rule into the terminal:

snakemake -j [NUMBER OF CORES TO BE USED] calculate_all_countries_and_years_total_hydrogen_costs

Similarly, you can map hydrogen costs for all scenarios with the following rule:

snakemake -j [NUMBER OF CORES TO BE USED] map_all_countries_and_years

assign_country rule

Assign country-specific interest rates, technology lifetimes, and heat and electricity prices from country_parameters.xlsx to different hexagons based on their country.

You can run this rule by entering the following command in your terminal:

snakemake -j [NUMBER OF CORES TO BE USED] Data/hexagons_with_country_[COUNTRY ISO CODE].geojson

get_weather_data rule

You can run this rule by entering the following command in your terminal:

snakemake -j [NUMBER OF CORES TO BE USED] Cutouts/[COUNTRY ISO CODE]_[WEATHER YEAR].nc

optimize_transport_and_conversion rule

Calculate the cost of the optimal hydrogen transportation and conversion strategy from each hexagon to each demand center, using both pipelines and road transport, using parameters from technology_parameters.xlsx, demand_parameters.xlsx, and country_parameters.xlsx.

You can run this rule by entering the following command in your terminal:

snakemake -j [NUMBER OF CORES TO BE USED] Resources/hex_transport_[COUNTRY ISO CODE].geojson

calculate_water_costs rule

Calculate water costs from the ocean and freshwater bodies for hydrogen production in each hexagon using Parameters/technology_parameters.xlsx and Parameters/country_parameters.xlsx.

You can run this rule by entering the following command in your terminal:

snakemake -j [NUMBER OF CORES TO BE USED] Resources/hex_water_[COUNTRY ISO CODE].geojson

optimize_hydrogen_plant rule

Design green hydrogen plant to meet the hydrogen demand profile for each demand center for each transportation method to each demand center using the optimize_hydrogen_plant.py script. Ensure that you have specified your hydrogen plant parameters in the CSV files in the Parameters/Basic_H2_plant folder, your investment parameters in Parameters/investment_parameters.xlsx, and your demand centers in Parameters/demand_parameters.xlsx.

You can run this rule by entering the following command in your terminal:

snakemake -j [NUMBER OF CORES TO BE USED] Resources/hex_lcoh_[COUNTRY ISO CODE]_[WEATHER YEAR].geojson

calculate_total_hydrogen_cost rule

Combine results to find the lowest-cost method of producing, transporting, and converting hydrogen for each demand center.

You can run this rule by entering the following command in your terminal:

snakemake -j [NUMBER OF CORES TO BE USED] Results/hex_total_cost_[COUNTRY ISO CODE]_[WEATHER YEAR].geojson

calculate_cost_components rule

Calculate the cost for each type of equipment in each polygon.

You can run this rule by entering the following command in your terminal:

snakemake -j [NUMBER OF CORES TO BE USED] Results/hex_cost_components_[COUNTRY ISO CODE]_[WEATHER YEAR].geojson

map_costs rule

Visualize the spatial variation in different costs per kilogram of hydrogen.

You can run this rule by entering the following command in your terminal:

snakemake -j [NUMBER OF CORES TO BE USED] Plots/[COUNTRY ISO CODE]_[WEATHER YEAR]

Limitations

This model considers only greenfield wind and solar plants for hydrogen production. Therefore it does not consider using grid electricity or existing generation for hydrogen production. The model further assumes that all excess electricity is curtailed.

While the design of the green hydrogen plant is convex and therefore guarenteed to find the global optimum solution if it exists, the selection of the trucking strategy is greedy to avoid the long computation times and potential computational intractability associated with a mixed-integer optimization problem.

Currently, only land transport is considered in the model. To calculate the cost of hydrogen production for export, any additional costs for conversion and transport via ship or undersea pipeline must be added in post-processing.

Transport costs are calculated from the center of the hexagon to the demand center. When using large hexagon sizes, this assumption may over- or underestimate transportation costs significantly. Additionally, only path length is considered when calculating the cost of road and pipeline construction. Additional costs due to terrain are not considered.

The availability of water for electrolysis is not limited in regions that could potentially face drought, and a single prices for freshwater and ocean water are used throughout the modeled area.


Citation

If you decide to use GeoH2, please kindly cite us using the following:

Halloran, C., Leonard, A., Salmon, N., Müller, L., & Hirmer, S. (2024). GeoH2 model: Geospatial cost optimization of green hydrogen production including storage and transportation. MethodsX, 12, 102660. https://doi.org/10.1016/j.mex.2024.102660.

@article{Halloran_GeoH2_model_Geospatial_2024,
author = {Halloran, Claire and Leonard, Alycia and Salmon, Nicholas and Müller, Leander and Hirmer, Stephanie},
doi = {10.1016/j.mex.2024.102660},
journal = {MethodsX},
month = jun,
pages = {102660},
title = {{GeoH2 model: Geospatial cost optimization of green hydrogen production including storage and transportation}},
volume = {12},
year = {2024}
}

Case study parameters

This repository includes sample parameters for a hydrogen production case in Namibia. References for these parameters are included in the tables below for reference. For the results of this case, please refer to the model MethodsX article: https://doi.org/10.1016/j.mex.2024.102660.

Green hydrogen plant parameters:

HardwareParameterValueUnitsRef.
Solar photovoltaicCapex1,470,000€/MWAllington et al., 2021
Wind turbinesCapex1,580,000€/MWAllington et al., 2021
Hydrogen electrolysisCapex1,250,000€/MWMüller et al., 2022
Hydrogen electrolysisEfficiency0.59MWh H2/MWh elTaibi et al., 2020
Hydrogen compressionIsentropic efficiency0.051MWh el/MWh H2Müller et al., 2022
Hydrogen storage unloadingEfficiency1MWh H2/MWh H2-storedAssumption
BatteryCapex95,000€/MWBloombergNEF, 2022
Hydrogen storageCapex21,700€/MWhMüller et al., 2022

Conversion parameters:

ProcessParameterValueUnitsRef.
500 bar compressionHeat capacity0.0039444kWh/kg/KKurzweil and Dietlmeier, 2016
500 bar compressionInput temperature298.15KMüller et al., 2022
500 bar compressionInput pressure25barMüller et al., 2022
500 bar compressionIsentropic exponent1.402Kurzweil and Dietlmeier, 2016
500 bar compressionIsentropic efficiency0.8Müller et al., 2022
500 bar compressionCompressor lifetime15yearsCerniauskas, 2021
500 bar compressionCompressor capex coefficient40,035€/kg H2/dayCerniauskas, 2021
500 bar compressionCompressor opex4% capex/yearCerniauskas, 2021
Hydrogen liquificationElectricity demand9.93kWh/kg H2Ausfelder and Dura
Hydrogen liquificationCapex quadratic coefficient-0.0002€/(kg H2)^2Müller et al., 2022
Hydrogen liquificationCapex linear coefficient1,781.9€/kg H2Müller et al., 2022
Hydrogen liquificationCapex constant300,000,000Müller et al., 2022
Hydrogen liquificationOpex8% capex/yearCerniauskas, 2021
Hydrogen liquificationPlant lifetime20yearsCerniauskas, 2021
LOHC hydrogenationElectricity demand0.35kWh/kg H2Andersson and Grönkvist, 2019
LOHC hydrogenationHeat demand-9kWh/kg H2Hydrogenious, 2022
LOHC hydrogenationCapex coefficient0.84kWh/kg H2/yearIEA, 2020
LOHC hydrogenationOpex4% capex/yearIEA, 2020
LOHC hydrogenationPlant lifetime25yearsIEA, 2020
LOHC hydrogenationCarrier costs2€/kg carrierClark, 2020
LOHC hydrogenationCarrier ratio16.1kg carrier/kg H2Arlt and Obermeier, 2017
LOHC dehydrogenationElectricity demand0.35kWh/kg H2Andersson and Grönkvist, 2019
LOHC dehydrogenationHeat demand12kWh/kg H2Hydrogenious, 2022
LOHC dehydrogenationCapex coefficient2.46kWh/kg H2IEA, 2020
LOHC dehydrogenationOpex4% capex/yearIEA, 2020
LOHC dehydrogenationPlant lifetime25yearsIEA, 2020
Ammonia synthesisElectricity demand2.809kWh/kg H2IEA, 2021
Ammonia synthesisCapex coefficient0.75717kWh/g H2/yearIEA, 2021
Ammonia synthesisOpex1.5% capex/yearIEA, 2020
Ammonia synthesisPlant lifetime25yearsIEA, 2020
Ammonia crackingHeat demand4.2kWh/kg H2Andersson and Grönkvist, 2019
Ammonia crackingCapex coefficient17,262,450kWh/g H2/hourCesaro et al., 2021
Ammonia crackingOpex2% capex/yearMüller et al., 2022
Ammonia crackingPlant lifetime25yearsMüller et al., 2022

Trucking parameters:

HardwareParameterValueUnitsRef.
All trucksAverage truck speed70km/hAssumption
All trucksWorking hours24h/dayAssumption
All trucksDiesel price1.5€/LAssumption
All trucksDriver wage2.85€/hMüller et al., 2022
All trucksWorking days365days/yearAssumption
All trucksMax driving distance160,000km/yearMüller et al., 2022
All trucksTruck capex160,000Reuss et al., 2017
All trucksTruck Opex12% capex/yearReuss et al., 2017
All trucksDiesel consumption35L/100 kmReuss et al., 2017
All trucksTruck lifetime8yearsReuss et al., 2017
All trucksTrailer lifetime12yearsReuss et al., 2017
500 bar hydrogen trailerTrailer capex660,000Cerniauskas, 2021
500 bar hydrogen trailerTrailer opex2% capex/yearCerniauskas, 2021
500 bar hydrogen trailerTrailer capacity1,100kg H2Cerniauskas, 2021
500 bar hydrogen trailerLoading and unloading time1.5hoursCerniauskas, 2021
Liquid hydrogen trailerTrailer capex860,000Reuss et al., 2017
Liquid hydrogen trailerTrailer opex2% capex/yearReuss et al., 2017
Liquid hydrogen trailerTrailer capacity4,300kg H2Reuss et al., 2017
Liquid hydrogen trailerLoading and unloading time3hoursReuss et al., 2017
LOHC trailerTrailer capex660,000IEA, 2020
LOHC trailerTrailer opex2% capex/yearReuss et al., 2017
LOHC trailerTrailer capacity1,800kg H2Reuss et al., 2017
LOHC trailerLoading and unloading time1.5hoursReuss et al., 2017
Ammonia trailerTrailer capex210,000IEA, 2020
Ammonia trailerTrailer opex2% capex/yearIEA, 2020
Ammonia trailerTrailer capacity2,600kg H2IEA, 2020
Ammonia trailerLoading and unloading time1.5hoursIEA, 2020

Road parameters:

Road lengthParameterValueUnitsRef.
Short road (<10 km)Capex626,478.45€/kmMüller et al., 2022
Long road (>10 km)Capex481,866.6€/kmMüller et al., 2022
All roadsOpex7,149.7€/km/yearMüller et al., 2022

Pipeline parameters:

Pipeline sizeParameterValueUnitsRef.
All pipelinesOpex1.25% capex/yearJens et al., 2021
All pipelinesAvailability95%Müller et al., 2022
All pipelinesPipeline lifetime42.5yearsJens et al., 2021
All pipelinesCompressor lifetime24yearsJens et al., 2021
All pipelinesElectricity demand0.000614kWh/kg H2/kmJens et al., 2021
Large pipelineMaximum capacity13GWJens et al., 2021
Large pipelinePipeline capex2,800,000€/kmJens et al., 2021
Large pipelineCompressor capex620,000€/kmJens et al., 2021
Medium pipelineMaximum capacity4.7GWJens et al., 2021
Medium pipelinePipeline capex2,200,000€/kmJens et al., 2021
Medium pipelineCompressor capex310,000€/kmJens et al., 2021
Small pipelineMaximum capacity1.2GWJens et al., 2021
Small pipelinePipeline capex90,000€/kmJens et al., 2021
Small pipelineCompressor capex90,000€/kmJens et al., 2021

Water parameters:

TypeParameterValueUnitsRef.
FreshwaterTreatment electricity demand0.4kWh/m^3 waterUS Dept. of Energy, 2016
Ocean waterTreatment electricity demand3.7kWh/m^3 waterPatterson et al., 2019
All waterTransport cost0.1€/100 km/m^3 waterZhou and Tol, 2005
All waterWater specific cost1.25€/m^3 waterWasreb, 2019
All waterWater demand21L water/kg H2Taibi et al., 2020

Country-specific parameters:

CountryParameterValueUnitsRef.
NamibiaElectricity price0.10465€/kWhGlobalPetrolPrices.com
NamibiaHeat price0.02€/kWhAssumption
NamibiaSolar interest rate6%Assumption
NamibiaSolar lifetime20yearsAssumption
NamibiaWind interest rate6%Assumption
NamibiaWind lifetime20yearsAssumption
NamibiaPlant interest rate6%Assumption
NamibiaPlant lifetime20yearsAssumption
NamibiaInfrastructure interest rate6%Assumption
NamibiaInfrastructure lifetime50yearsMüller et al., 2022