Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new H2 production pathways & biomass competition #377

Closed
Youyi77 opened this issue Jan 23, 2024 · 9 comments
Closed

Adding new H2 production pathways & biomass competition #377

Youyi77 opened this issue Jan 23, 2024 · 9 comments

Comments

@Youyi77
Copy link

Youyi77 commented Jan 23, 2024

Hi, everyone! I am new to the GCAM.
I was trying to build my own scenarios in H2 sector and encountered some problems.

Q1: Adding biogas H2 production pathway

I want to add a new pathway to produce H2 from biogas.

Directly modifying the existing XMLs seems not feasible in my case as I need zenergy_L125.hydrogen R. to extrapolate costs to all GCAM model years.

So my attempted steps are below:

  1. modify raw data in the energy folder to include new production pathways
  2. modify zenergy_L125.hydrogen R code
    The final goal is to reproduce the new L125.globaltech_coef and L125.globaltech_cost for the GCAM to run.

Not sure if I am missing anything, especially I am thinking about the following competition part in Q2.

Q2: The biomass competition

Since biomass/residues can also be used for biofuel, H2, timber, etc, I am confused about how this competition is built in GCAM.

For bioenergy, the GCAM output queries include "purpose-grown biomass production", "residue biomass production" etc. I assume that these are the amount of biomass needed to produce bioenergy under a given scenario.

But the biomass assumption in the H2 sector is generalized as biomass (there is no breakdown on what kind of biomass it is). I traced the cost assumptions for biomass H2 used in GCAM which is derived from NREL H2A. H2A's assumption is to convert all the available biomass to poplar based on heating values.

I am wondering in this case, which part of the model determines whether a certain kind of biomass is supplied to the bioenergy sector or the H2 sector? I can understand that within the H2 sector, all H2 production technologies compete with each other based on the logit choice competition. But I am not sure whether this also applies to cross sectors (i.e. bioenergy and hydrogen). I didn't see there is a separate price for biomass in the H2 sector. So how can the model determine where to supply the biomass?

Also, if I want to build a biogas H2 production pathway, there will be additional competition in the residue biomass as well. So it will be super helpful if I can understand the competition part in GCAM.

Any insights would be greatly appreciated!! Thanks!!

@pkyle
Copy link
Contributor

pkyle commented Jan 24, 2024

In general new hydrogen production technologies can be added just by adding rows to the existing data tables in energy/A25* which you have already identified. As there are no implications for calibration, no other considerations come into play. However producing hydrogen from biogas stretches the possible representations...for the most part, "biomass" in GCAM means solid biomass, and biogases in the inventory data are mapped to the "biomass gasification" technology of the gas processing sector. Gas processing is mostly natural gas but also includes gasified biomass and coal. Gas processing feeds gas pipeline which feeds the gaseous fuels for end-use consumption, wholesale gas and delivered gas. So, implicitly within the model's structure, there is already some biogas-to-h2 in that some portion of the "wholesale gas" input to various hydrogen production technologies is produced from biomass, though it's a small portion and not something we normally report.
Taking a step back, I don't even know why one would want to represent this pathway in isolation in GCAM, or what would be different between a biomass -> biogas -> hydrogen pathway that isn't already captured by the existing biomass -> hydrogen technology, which has gasification as an intermediate step. While the technology in H2A is parameterized around poplar, in GCAM the "biomass" market consists of a variety of solid biomass feedstocks including grasses, crop and forestry residues, and generic wastes from municipal and industrial activities.

@Youyi77
Copy link
Author

Youyi77 commented Jan 24, 2024

Hi Page! @pkyle

Thanks so much for your clarification. That’s super helpful!

I was thinking the feedstock of the "gas" pathway only comes from conventional natural gas. There is surely no need to add another biogas conversion pathway.

But I have a very quick follow-up question on the total biomass needed for H2 production: (That would be great if you could have a look!)

When the “hydrogen production by tech” query is run:

image

  1. “biomass to H2”: shows only biomass (in EJ) used for H2 production in the biomass gasification pathway.
  2. “gas” shows the wholesale natural gas used for H2 production. But natural gas here also includes those produced from gasified biomass. To get that biomass consumed for NG, we need to multiply additional ratios (basically to get how much biomass (in EJ) is needed to produce the required NG) under this given scenario (although it is a small fraction).
  3. “forecourt – natural gas steam reforming” will undergo the same calculation process as “gas”. I think wholesale gas and delivered gas are produced from the same set of technologies. The only difference is their consumer.

The total biomass (in EJ) needed for H2 production would be adding the above 3 parts together.

Not sure if my understanding is correct.

Thank you once again!

@pkyle
Copy link
Contributor

pkyle commented Jan 26, 2024

Well, if you're looking to get the energy inputs to hydrogen production, then you'll want to switch the query to one that reports inputs; this current one is reporting hydrogen production, in EJ. Then, if you want the full primary energy inputs to the process, backing each fuel commodity out to the primary energy used to produce it, then you'll need to look upstream in the gas pipeline and gas processing sectors. Wholesale gas (and delivered gas) provided to the hydrogen production sector would be multiplied by the pipeline input-output coefficient (usually about 1.02; units of natural gas put into the pipelines divided by the units delivered to end users, with the difference being the natural gas that is used to power pipeline compressors), and then that amount would be disaggregated into natural gas, coal, and biomass, based on the respective output shares of each in the gas processing sector, and then each of these quantities would multiplied by its input-output coefficient in the gas processing sector. These are assumed 1 for natural gas and about 1.3 for biomass and coal gasification, but they can be looked up by either querying the IO-coefficient directly, or just by querying the inputs and outputs of gas processing and dividing the one by the other.

@Youyi77
Copy link
Author

Youyi77 commented Jan 27, 2024

Hi Page! Many thanks for your guidance!! Really helpful.

@Youyi77 Youyi77 closed this as completed Jan 27, 2024
@Youyi77
Copy link
Author

Youyi77 commented Jan 30, 2024

Hi Page @pkyle , a quick follow-up. How can I run the query for IO-coefficient directly? For H2, there is a tab in modelinterface that I could run directly. But for other technologies (i.e. iron and steel), there isn't a pre-set-up IO query.

What I have been doing to get the Iron and steel IO coefficient in every year:

  1. Go back to the original raw data file. Find the "A323.globaltech_coef. csv" in energy folder
  2. Trace back its downstream files in R. Find the "L2323.GlobalTechCoef_iron_steel" file in the cache. Then read it in R.

Wondering if there is a simple way to do it?

Thanks so much!

@Youyi77 Youyi77 reopened this Jan 30, 2024
@pkyle
Copy link
Contributor

pkyle commented Jan 31, 2024

Good catch finding that one query that does IO-coefficients! We should probably have a query of IO-coefficient in just the general queries set, that would return results for all technologies in the model. Anyway you can just copy that hydrogen technology IO coefficients query, go to the iron and steel section, paste it in, and then "Edit" that query from the model interface, updating the title and the filtering criteria in the XPATH window which currently reads and contains(@name,'H2')
Just switch that to and contains(@name,'iron and steel')
Once that's done, and you've tested it out and it works, you can go to File -> Save which will add the new query to your default query file that's used whenever you open up a database.

@Youyi77
Copy link
Author

Youyi77 commented Feb 1, 2024

Hi Page! @pkyle Thank you so much for your help as always.

Yes! For iron and steel sector, it does work well.

I am also trying on other sectors by modifying XPATH based on each sector's characteristics.

Some failed examples that showed no results:
agricultural energy use sector: *[@type='sector' and contains(@name, 'agricultural energy use')]/*[@type='input']/IO-coefficient/node()
cement sector: *[@type='sector' and contains(@name, 'cement')]/*[@type='technology']/*[@type='input']/IO-coefficient/node()

The problem is that I am guessing the xml structure of each sector (based on existing queries).

Is there any suggestion where I can find the structure output results. So that I can modify these XPATH correctly and don't have to bother you all the time!

Thank you!!

@pkyle
Copy link
Contributor

pkyle commented Feb 1, 2024

The reason those are failing is that a single slash ]/*[ indicates to go down one level, whereas multiple slashes [//*[ indicates to go down multiple levels (2 or more). IO-coefficients are several levels down from the sector. Still I'd recommend not using multiple slashes, but rather specifying the structure, so that there won't be any ambiguity about the results that print out. All IO-coefficients will print with their associated sector, subsector, technology, and input name, reducing the likelihood of silent aggregations which occur when data has the same identifying information. e.g. the query for agricultural energy use would look like this;
*[@type='sector' and contains(@name, 'agricultural')]/*[@type='subsector']/*[@type='technology']/*[@type='input']/IO-coefficient[@vintage=parent::*/parent::*/@year]/node()
Several things to note...first off, when we're doing string matching using the contains() function, we don't need to specify the exact name of the sector, if the sector has a unique enough name. On the other hand, using this contains() function for cement will return information for both the cement and process heat cement sectors. If you want to be specific, you can just use instead and (@name='cement')
Second, that strange set of text towards the end[@vintage=parent::*/parent::*/@year]/node() is something I'd recommend keeping in these queries generally, because it suppresses the historical vintage cohorts operating in each time period which are explicitly tracked in some sectors.
If you don't have that, and run the query in e.g. iron and steel where vintage cohorts are tracked over time, what you'll see is that the IO coefficients multiply in each future time period; if blast furnaces were taking in 0.015 GJ of coal per kg of steel in 2015, it'll print out as 0.030 in 2020, 0.045 in 2025, and so on. That's because e.g. in 2025, there are three vintage cohorts of the technology operating in the time period (2015, 2020, 2025), and if our query doesn't filter to only the present time period, the model interface will just silently add them all up.

@Youyi77
Copy link
Author

Youyi77 commented Feb 2, 2024

Hi Page!! @pkyle Now it makes so much more sense to me. All works well.
These are so helpful for me to understand the whole structure. Thank you so much for explaining these details!!

@Youyi77 Youyi77 closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants