GeoH2 model: Geospatial cost optimization of green hydrogen production including storage and transportation

Graphical abstract

1. Pre-process spatial data : Run the spatial_data_prep.py to convert raw data to common coordinate reference systems, file types, and naming conventions.Then, use the workflow.pyscript to interface with the GLAES package to constrain land availability in the AOI.Next, use the Country_config.ymlfile to interface with the SPIDER package to aggregate spatial data into H3 hexagons.Finally, combine the GLAES and SPIDER results using combine_glaes_spider.py .This generates a hexagon file ready for use in GeoH2.More details are available in the README.mdfile of the GeoH2-data-prep library.See Section 'Spatial pre-processing' for further details on this step.
2. Specify input parameters : Specify input parameters in the Excel files found in the Parameters folder.These include technology availability, demand magnitude and location, country-specific costs and interest rates, transport, conversion, and weather data.See Section 'Parameter specification' for further details on this step.
3. Assign country to hexagons : Run the assign_country.pyscript to assign country-specific interest rates, technology lifetimes, and heat and electricity prices from country_parameters.xlsx to the input hexagons.4. Download weather data : Run the get_weather_data.pyscript to download historical weather data for the AOI and time period of interest specified in the weather parameters file weather_parameters.xlsx .See Section 'Download weather data' for further details on this step.

5.
Optimize transport and conversion : Run the optimize_transport_and_conversion.pyscript to calculate the cost of the optimal hydrogen transportation and conversion strategy from each hexagon to each demand center using road transport and pipelines based on parameters from technology_parameters.xlsx , demand_parameters.xlsx , and country_parameters.xlsx .See Section 'Optimize transport and conversion' for further details on this step.6. Optimize green hydrogen plant : Run the optimize_hydrogen_plant.py script to design a green hydrogen plant to meet hydrogen demand for each demand center and for each transportation mode.Parameters are specified in the Basic_H2_plant OpenStreetMap [8] (LCOH) into cost components associated to different technologies (e.g., electrolyzer, wind, solar).Run the map_costs.pyscript to produce maps illustrating the results over the AOI.See Section 'Total hydrogen costs' for further details on this step.

Spatial pre-processing
Before running GeoH2, spatial input data for the AOI must be processed into a single GeoJSON file following the H3 hexagon standard [4] .Spatial input data are required to (1) constrain land availability for renewable energy infrastructure, and (2) calculate costs associated with transport and water supply in each hexagon.While the land availability constraints can be customized (i.e., more or less constraints can be included based on the user's preference), final hexagons must include a distance to water bodies, waterways, and road networks to enable the transport and water calculations.As such, the essential spatial input data are: country boundaries, coastlines, waterways, water bodies, and roads.We also suggest including land availability constraints based on land cover classifications and protected areas, though these can be omitted or changed if desired.These data can be downloaded from the sources suggested in Table 1 .
The GeoH2-data-prep library facilitates spatial input data preparation [9] .Alongside performing conversions to common coordinate reference systems, file types, and naming conventions, this library interfaces with the Geospatial Land Availability for Energy Systems (GLAES) [10] and Spatially Integrated Development of Energy and Resources (SPIDER) [11] packages.
The GLAES library is used to constrain land availability throughout the AOI in order to determine the maximum number of wind and solar installations which are theoretically possible in each hexagon.An example GLAES script (i.e., workflow.py) is provided in GeoH2-data-prep.This example constrains land availability based on land cover types obtained from Corine Land Cover (CLC) and distance from the coast and protected areas using 100 m resolution.It allocates 4 MW National Renewable Energy Laboratory reference turbines [12] and 100 MWp solar photovoltaic (PV) plants in the available area.For wind installations, this example excludes coastlines, protected areas, herbaceous wetlands, and permanent water bodies.For solar PV, it also excludes agricultural areas.It furthermore excludes a 250 m buffer around coastlines and protected areas.Note that this is just an example to illustrate GLAES usage.The resolution, turbine size, solar plant size, exclusion types, and buffers are project specific.The sample file must be customized to match the types of infrastructure available and the land constraints which are necessary in the AOI.
The script saves the wind turbine and PV plant placements as.SHP files, and the excluded area for both wind and PV as.TIF files.
The constraints on land availability can be customized by editing the workflow.pyscript based on user preferences.Next, the SPIDER library is used to generate H3 hexagons which tile across the AOI.These are the basis for the GeoH2 input spatial dataset.SPIDER is run using its own command line interface (CLI) -the user provides a configuration file in the CLI which specifies the features of the hexagons to be created.Details on running the CLI are available in the SPIDER documentation [13] .The GeoH2-data-prep library provides a SPIDER configuration file ( Country_config.yml ) which can be used with the SPIDER CLI to generate the hexagons required for GeoH2 .This configuration specifies level four H3 resolution and includes the distance from each hexagon to the nearest ocean, waterway, water body, and road as attributes.While the distance attributes must not be changed, as they are essential to processes in GeoH2 , the H3 resolution can be changed to suit the user's needs.Note that if a smaller hexagon size is used, this will increase the GeoH2 run-time.
Finally, the results of GLAES and SPIDER (i.e., the theoretical turbine/PV placements and the hexagons with distance attributes) are combined to form the final GeoH2 input file.The combine_glaes_spider.py script counts the number of turbines and the number of PV plants per hexagon and appends this number to each hexagon, producing a final GeoJSON ready for use in the GeoH2 model.

Parameter specification
Along with the spatial input file, a number of technical and economic parameters are inputs for the GeoH2 model.Input parameters include annual hydrogen demand, infrastructure prices, and the cost of capital for a snapshot in time.Additionally, in the Basic H2 plant folder, there are several comma-separated values (CSV) files containing the global parameters for optimizing the hydrogen plant design.All power units are MW and all energy units are MWh.For more information on these parameters, refer to the PyPSA documentation [14] .

Download weather data
The get_weather_data.py script downloads weather data for the AOI from the ERA5 dataset [15] using the atlite [16] library.These data are used to model historical wind and solar generation potential and inform the hydrogen plant optimization.The ERA5 dataset is available at an hourly time resolution from 1940 to present and approximately 30 by 30 km spatial resolution.
It is freely available to download for registered users.As such, GeoH2 users will need to register at the Copernicus Climate Data Store and set up their API key before running this script.

Optimize transport and conversion
The optimize_transport_and_conversion.py script calculates the lowest-cost hydrogen transport strategy from every hexagon to every demand center.The transport strategy includes whether to transport the hydrogen by truck or by pipeline, and what form of hydrogen (i.e., 500 bar hydrogen, liquid hydrogen, liquid organic hydrogen carriers (LOHC), or ammonia) to transport.Total transportation and conversion costs include road or pipeline construction, transportation operating costs, conversion to the form used for transportation, and conversion of the transported form of hydrogen to the form required at the demand center.First, the transport distance is calculated.For each hexagon, the distance from the centroid of the hexagon to each demand center is calculated.If the demand center is within the hexagon, only conversion costs to the final demand state are included in transportation and conversion costs.If the demand center is outside the hexagon, this distance is used to calculate transport costs.
Next, road transport costs are calculated.If road construction is allowed, the cost of extending the nearest road is calculated for each off-road hexagon based on the distance to the nearest road.Otherwise, trucking is not an option for transportation for hexagons which do not have access to roads.The number of trucks and trailers needed is calculated based on total hydrogen demand, distance to the demand center, and average truck speed assuming full-time truck use.The model calculates trucking costs assuming that the trucks travel on the shortest possible path to the demand center, rather than calculating road distance.Trucking costs include diesel price, driver wages, truck capital and operational expenses, and trailer capital and operational expenses.
Finally, if pipeline construction is allowed, the cost of pipeline construction from every hexagon to each demand center is calculated.Otherwise, pipeline transportation is not an option for any hexagon.Pipeline costs per kilometer and compressor costs are defined for three sizes of pipeline based on their capacity: small (up to 1.2 GW), medium (1.2 to 4.7 GW), and large (4.7 to 13 GW).

Optimize green hydrogen plant
The optimize_hydrogen_plant.py script optimizes investment and operation of an off-grid green hydrogen plant to meet a specific demand.The PyPSA library [14] is used to optimize the capacity of solar PV, onshore wind, electrolyzer, lithium-ion batteries, and compressed hydrogen storage to produce green hydrogen to meet the specified demand.Note that a solver which is compatible with PyPSA (e.g., Cbc, Gurobi) must be installed to complete this step.
Weather data is converted to hourly onshore wind and solar PV potential using atlite [16] .Onshore wind generation potential is calculated using 100 m wind speed, and forecast surface roughness, the aerodynamic roughness length.Publicly-available wind power curves can be used within atlite or custom power curves can be specified.Solar PV potential is calculated using top of atmosphere incident solar radiation, direct and diffuse influx, albedo, and air temperature at 2 m height to calculate panel efficiency.Crystalline silicon solar panels are assumed.
Annual hydrogen demand is converted to hourly demand schedules based on the transport methods considered.For pipeline transport, constant hourly demand is assumed.For trucking transport, an hourly demand profile is created based on the number of trucks arriving at the plant each hour to achieve a roughly constant delivery schedule at the demand center.The trucking demand schedule is designed to achieve no wait time for trucks to fill with hydrogen.
For each hexagon and demand center pair, hydrogen production costs to meet the pipeline and trucking transportation demand profiles and the optimal capacity of several key components are saved.

Water costs
Water costs for the optimised hydrogen plant are calculated using the water_cost.pyscript.Both freshwater and ocean water options are considered.Treatment costs for each are defined based on the different energy requirements for each source (e.g., to account for desalination in the ocean case).The cost to transport the required demand of water to each hexagon from the nearest available source of each type is also considered in the total water cost.The lowest of the two options is taken as the final water cost, and this is exported as a GeoJSON file ( hex_water.geojson).

Total hydrogen costs
The optimized total hydrogen cost is determined in the total_hydrogen_cost.py script.This total includes production costs, transport costs (including infrastructure construction costs if needed), conversion costs, and water costs.Costs are calculated for both trucking and pipeline transport options.Both are saved, and the lowest of the two is stored as the final optimal lowest cost.All results are saved to a GeoJSON file ( hex_total_cost.GeoJSON ).Using the cost_by_component.pyscript, these results can be broken down by technology component.This script provides a file hex_cost_components.geojson with the capacities, capital costs, and overall contribution of each technology towards LCOH for each hexagon.
The results can be visualized using map_costs.py .This script produces heatmaps for each cost component saved to the GeoJ-SON hex_total_cost.GeoJSON for quick visualisation.

Case study
This model is demonstrated using a case study of green hydrogen production in Namibia.This case study simulates a hydrogen demand of 60.6 kT/year to be delivered to Lüderitz port (-26.64,15.14) as green ammonia for export.The demand level is the median planned capacity of those planned projects in the IEA hydrogen database which are: (a) located in continental sub-Saharan Africa, (b) plan to use wind or solar to produce hydrogen via electrolysis, and (c) are intended to go online by 2030 [17] .Interest rates for both production plant technologies and infrastructures are set at 6% for comparability with the IEA levelised cost of hydrogen maps [18] .The case study uses 481 H4-level hexagons.Wetland, built-up areas, and water bodies are excluded from available land for generation/plant construction.The area within 250 m of coastlines or protected areas is also excluded.PV is excluded from agricultural areas.All input files used in this case study, including capital cost assumptions and technical parameters, are made available in the Appendix.
The LCOH to meet this demand in different locations throughout Namibia is shown in Fig. 1 .The costs range between € 5.43 and € 9.21 per kilogram of green hydrogen arriving at Lüderitz.In all hexagons, pipeline transport is the lowest-cost option.
The LCOH for the lowest-and highest-cost production locations are broken down into cost components in Fig. 2 .In the lowestcost location, wind turbines produce all the electricity for electrolysis and very little battery storage is necessary.In the highest-cost location, a large capacity of solar PV as well as wind turbines are needed to produce electricity, and additional battery storage is required because of diurnal variation in solar generation.

Method validation
Comparing the results of the GeoH2 model with other green hydrogen costs projections validates that the model produces high-end but reasonable cost estimates.The lowest LCOH in the Namibian case study as presented in this paper (i.e., € 5.43 per kg) closely aligns with the estimated LCOH of € 5.13 per kg reported in [19] .Additionally, the Jülich Forschungszentrum projects a marginally lower minmum LCOH of € 4.17 per kg, with an average € 5.04 per kg.This again aligns well with the estimates produced in this case.
However, more optimistic estimates for the future also exist.For instance, the Fraunhofer Institute for Solar Energy Systems projects € 1.13 per kg for 2030 [3] .Similarly, the International Energy Agency projects low-end costs of $2.50 per kg in Namibia by 2030 [18] .Finally, the Namibia Investment Promotion and Development Board, an organization focused on driving investment into Namibia, estimates that $1.50 per kg will be feasible [20] .However, the assumptions underlying these optimistic estimates remain largely unclear.
This points to the larger problem of opaqueness in current hydrogen modelling, for both models which align with GeoH2 results and those which are more optimistic.While the authors would be interested in assessing the influence of different cost and technical assumption in causing the cost variation across models, this is not possible as other models largely do not make their methods and assumptions transparent and accessible.
The strong spatial variation and generally high-end cost projections resulting from the GeoH2 model presented in this paper are unsurprising, as the model is programmed to require a constant hydrogen supply by default.This approach was adopted because many industrial processes necessitate a consistent supply of hydrogen, leading to the assumption of constant hourly demand and resulting in a realistic, albeit high-end, estimate of hydrogen costs.This assumption therefore increases the costs of battery storage, compressed hydrogen storage, and renewable oversizing which enable the consistent supply over time.In contrast, other models make the liberal assumption of fully flexible hydrogen production [2] or leverage genetic algorithms to co-optimise the production profile for least costs [3] .They thus provide a lower bound of hydrogen costs that excludes storage and renewable overcapacity costs.
The conservative estimates from the GeoH2 model therefore complement analysis by the Hydrogen Council and other to provide a fuller picture of total hydrogen costs accounting for practical constraints and spatial variability.

Fig. 1 .
Fig. 1.The levelized cost of hydrogen (LCOH) in € /kg for the case study in Namibia.

Fig. 2 .
Fig. 2.Cost breakdown for the lowest-and highest-cost hexagons for green hydrogen production in Namibia.Note that the costs of transport and water processing are included in the "Other " segment.

Table 1
Key spatial data inputs and recommended sources for GeoH2.
folder, investment_parameters.xlsx, and demand_parameters.xlsx .See Section 'Optimize green hydrogen plant' for further details on this step.7. Calculate water costs Run the water_cost.pyscript to calculate ocean and freshwater water costs for hydrogen production in each hexagon using technology_parameters.xlsxand country_parameters.xlsx .See Section 'Water costs' for further details on this step.8. Calculate and visualise total hydrogen costs : Run the total_hydrogen_cost.py script to find the lowest-cost method of producing, transporting, and converting hydrogen in each hexagon for each demand center by combining the results of the optimize_transport_and_conversion.py, optimize_hydrogen_plant.py , and water_cost.pyscripts.The costs_by_component.py script can be run after total_hydrogen_cost.py to split the levelized cost of hydrogen The weather parameters file ( weather_parameters.xlsx ) includes the geographic area, defined with a latitude-longitude bounding box, and temporal range to download historical weather data from the European Centre for Medium-Range Weather Forecasts Reanalysis v5 (ERA5).This dataset is used to calculate wind and solar generation potential across the AOI.At least a year is recommended for the temporal range to capture seasonal variation in renewable potential, but longer time periods will increase computation time for optimizing the hydrogen plant design.The other parameters files specify the water, transport, and conversion requirements.The technology parameters file ( technology_parameters.xlsx ) specifies costs and energy densities for water processing and road infrastructure, water demand, and whether road and hydrogen pipeline construction is allowed.The pipeline parameters file ( pipeline_parameters.xlsx ) includes the price, capacity, and lifetime data for different sizes of hydrogen pipelines.The transport parameters file ( transport_parameters.xlsx ) includes the parameters related to road transport of hydrogen, including truck speed, cost, lifetime, and capacity.The conversion parameters file ( conversion_parameters.xlsx ) includes parameters related to converting between states of hydrogen.
These parameters are specified in a set of Excel files in the Parameters folder in the GeoH2 library.The demand parameters file ( demand_parameters.xlsx ) defines a list of demand centers.The latitude and longitude of each demand center and the annual demand (in terms of hydrogen mass) and desired hydrogen state (i.e., 500 bar H 2 , liquid H 2 , or NH 3 ) must be specified.If multiple forms of hydrogen are demanded in one location, the demand center name must be different (e.g., Nairobi H 2 and Nairobi NH 3 ), as duplicate demand center names will cause problems in the model.The country parameters file ( country_parameters.xlsx ) includes country-and technology-specific interest rates, heat and electricity costs, and asset lifetimes.These must be added for all countries in the AOI.