You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Brightway2中搭建关联生物圈的前景技术系统及案例建模?

基于Brightway2搭建风电-电解制氢-氢气压缩全流程系统

前期准备:Brightway2初始化与Ecoinvent加载

首先完成Brightway2项目初始化,并加载已授权的Ecoinvent数据库(以3.8 cutoff版本为例):

import brightway2 as bw

# 设置并初始化项目
bw.projects.set_current("Hydrogen_Production_System")
bw.bw2setup()  # 初始化基础生物圈数据库

# 加载Ecoinvent数据库(首次导入需替换路径并执行导入代码)
ecoinvent_db = bw.Database("ecoinvent 3.8 cutoff")
# 首次导入代码(仅执行一次):
# ei_importer = bw.SingleOutputEcospold2Importer("/path/to/ecoinvent/datasets", "ecoinvent 3.8 cutoff")
# ei_importer.apply_strategies()
# ei_importer.statistics()
# ei_importer.write_database()

创建前景系统数据库

前景(技术圈)活动需放在独立数据库中:

fgdb = bw.Database("hydrogen_production_foreground")
fgdb.register()

前景活动与交换搭建

1. 风力涡轮机发电活动

从Ecoinvent获取对应风电活动,封装为前景节点(也可直接使用Ecoinvent活动):

# 从Ecoinvent查找陆上风电活动(名称根据版本调整)
wind_tech = ecoinvent_db.search("electricity production, wind, onshore")[0]

# 创建自定义风力发电前景活动
wind_turbine = fgdb.new_activity(
    code="wind_turbine_1kwh",
    name="Wind turbine electricity output",
    unit="kilowatt hour",
    description="Produces 1kWh onshore wind electricity"
)
wind_turbine.save()

# 添加生产交换:关联Ecoinvent风电技术
wind_turbine.new_exchange(
    input=wind_tech,
    amount=1,
    unit="kilowatt hour",
    type="production"
).save()

2. 水电解制氢活动

完善你已编写的代码,补充超纯水消耗与氧气排放交换:

# 从Ecoinvent获取目标国家电力混合与超纯水活动
electricity_mix = ecoinvent_db.search("electricity production, mix, [你的国家名称]")[0]
ultrapure_water = ecoinvent_db.search("water, ultra-pure, production")[0]

# 创建PEM电解制氢活动
electrolysis = fgdb.new_activity(
    code="electrolysis_pem",
    name="Hydrogen from PEM electrolysis",
    unit="kilogram"
)
electrolysis.save()

# 添加电能消耗交换
electrolysis.new_exchange(
    input=electricity_mix,
    amount=55,
    unit="kilowatt hour",
    type="technosphere"
).save()

# 添加超纯水消耗交换
electrolysis.new_exchange(
    input=ultrapure_water,
    amount=9,
    unit="kilogram",
    type="technosphere"
).save()

# 添加氧气生物圈排放交换
oxygen = bw.Database("biosphere3").search("oxygen, gaseous")[0]
electrolysis.new_exchange(
    input=oxygen,
    amount=8,
    unit="kilogram",
    type="biosphere"
).save()

# 添加氢气产出交换
electrolysis.new_exchange(
    input=electrolysis,
    amount=1,
    unit="kilogram",
    type="production"
).save()

3. 氢气压缩活动

搭建从20bar到50bar的氢气压缩活动:

# 创建氢气压缩活动
h2_compression = fgdb.new_activity(
    code="h2_compression_20to50bar",
    name="Hydrogen compression (20bar → 50bar)",
    unit="kilogram"
)
h2_compression.save()

# 添加待压缩氢气输入(来自电解制氢活动)
h2_compression.new_exchange(
    input=electrolysis,
    amount=1,
    unit="kilogram",
    type="technosphere"
).save()

# 添加电力混合消耗交换
h2_compression.new_exchange(
    input=electricity_mix,
    amount=0.44,
    unit="kilowatt hour",
    type="technosphere"
).save()

# 添加压缩后氢气产出交换
h2_compression.new_exchange(
    input=h2_compression,
    amount=1,
    unit="kilogram",
    type="production"
).save()

计算全球变暖潜势(GWP)

使用IPCC 2013方法学计算各节点的GWP值:

# 加载IPCC 2013 GWP 100a评价方法
ipcc_gwp = bw.Method(("IPCC 2013", "climate change", "GWP 100a"))

# 计算压缩后氢气的GWP
lca_h2 = bw.LCA({h2_compression: 1}, ipcc_gwp)
lca_h2.lci()
lca_h2.lcia()
print(f"Compressed hydrogen GWP: {lca_h2.score:.4f} kg CO₂-eq/kg H₂")

# 计算风电的GWP
lca_wind = bw.LCA({wind_turbine: 1}, ipcc_gwp)
lca_wind.lci()
lca_wind.lcia()
print(f"Wind electricity GWP: {lca_wind.score:.6f} kg CO₂-eq/kWh")

内容的提问来源于stack exchange,提问作者zakalaka

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 22:32:52