Coder Social home page Coder Social logo

Comments (9)

pkyle avatar pkyle commented on May 20, 2024 1

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.

from gcam-core.

pkyle avatar pkyle commented on May 20, 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.

from gcam-core.

Youyi77 avatar Youyi77 commented on May 20, 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!

from gcam-core.

Youyi77 avatar Youyi77 commented on May 20, 2024

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

from gcam-core.

Youyi77 avatar Youyi77 commented on May 20, 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!

from gcam-core.

pkyle avatar pkyle commented on May 20, 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.

from gcam-core.

Youyi77 avatar Youyi77 commented on May 20, 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!!

from gcam-core.

pkyle avatar pkyle commented on May 20, 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.

from gcam-core.

Youyi77 avatar Youyi77 commented on May 20, 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!!

from gcam-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.