Carlo Prato
Carlo Prato

Reputation: 313

LCI calculations in brightway and access to CFs

I have imported ecoinvent 3.7.1 on a brightway project and i followed a few tutorials to understand brightway set up procedures and usage.

I want to use brightway to perform calculations on the inventory data of some processes (in particular i want to sum all emissions to air of CO2, CH4, N2O.

I tried with:

for exc in process.biosphere():
    for k,v in exc.items():
        print("\n",k,v)

But what i found to be in the bioshpere data is not the ecoinvent inventory, but the UPR. How do i access the LCI results?

Edit: i also tried to instantiate an lca and query the related biosphere object after performing lci() and lcia() but i always find the UPR data

eidb = bw.Database('ecoinvent 3.7.1_cutoff_ecoSpold02') #seleziono il db 

process = eidb.search("diesel, burned in agricultural machinery")
method = ('IPCC 2013', 'climate change', 'GWP 100a')

lca = LCA({process[0]:1},method)
lca.lci()
lca.lcia()
lca.biosphere_dict
lca.biosphere_matrix

After this, i need to access the C.F. for such elements (the method i am interested in is IPCC 2013, GWP100a indicator). Is it possible to access the C.F.s for this method/substances in any way?

Upvotes: 1

Views: 364

Answers (2)

Carlo Prato
Carlo Prato

Reputation: 313

In the end, installing the Activity Browser ( https://github.com/LCA-ActivityBrowser/activity-browser ) was the easieast way to understand what i was doing and get the results i was looking for!

Upvotes: 1

mfastudillo
mfastudillo

Reputation: 1631

you ask several things in the same question, but I will try to answer them.

lets take as an example the query you used. If I run

searchquery = eidb.search("diesel, burned in agricultural machinery")

I get two results. the market and the transforming activities, for the example I choose the transforming activity.

You can loop the biosphere exchanges of that activity and have a look to some of their attributes:

for exc in transf_act.biosphere():
   print(exc.input,exc.amount,exc.unit)

if you want to calculate the LCI (e.g. how much N2O will be emitted per kg of diesel burned considering all the life cycle:

lca = bw.LCA(demand={transf_act:1}) # you don't need a method unless you want LCIA results
lca.lci()
lca.inventory

the inventory is a sparse matrix with biosphere flows as rows and activities as columns, which with the common notation would be $B \cdot diag(s)$. It is not super straight forward to operate with it but you can ask a more specific question if you really need to dig into that matrix.

to get the CO2eq score of the LCA of burning diesel in an agricultural machinery

lca = bw.LCA(demand={transf_act:1},
   method=('IPCC 2013', 'climate change', 'GWP 100a'))
lca.lci()
lca.lcia()
lca.score

to have a look to the characterisation factors of the IPCC method:

cfs = bw.Method(('IPCC 2013', 'climate change', 'GWP 100a')).load()

Upvotes: 2

Related Questions