Skip to main content

Interface between simulation models and brightway25

Project description


SiModIn

Simulation Model Interface

Interface between simulation models and brightway25.

Getting started

The basic usage of SiModIn will be presented for an Tespy powerplant model from the offical Tespy documentation.

To use the existing SiModIn model, import and instantiate the SimModel class:

from simodin import interface as link
from tespy_example import tespy_model

my_model= tespy_model('powerplant')

Than inititate the model and calculate it.

my_model.init_model()
my_model.calculate_model()

Create the technosphere dictionary and pass the model to an modelInterface instance.

my_model.technosphere

my_interface= link.modelInterface('tespy powerplant',my_model)

For LCA calculation, the needed brightway25 dataset needs to be linked to the technosphere flows:

import bw2data as bd

bd.projects.set_current('bw_meets_tespy')
my_interface.methods=[('ecoinvent-3.11',  'EF v3.1',  'climate change',  'global warming potential (GWP100)')]
ei=bd.Database('ecoinvent-3.11-cutoff')

ei_heat=[act for act in ei if 'heat production, at hard coal industrial furnace 1-10MW' in act['name']
 and 'Europe without Switzerland' in act['location'] ][0]
my_interface.technosphere['heat source'].source=ei_heat

ei_water=[act for act in ei if 'market for tap water' in act['name']
 and 'Europe without Switzerland' in act['location'] ][0]

my_interface.technosphere['cooling water source'].source=ei_water
my_interface.technosphere['cooling water source'].dataset_correction = 0.1 #blowdown rate

After that, the LCA calculation can be executed or the data exported to a brightway25 database:

my_interface.calculate_background_impact()
my_interface.calculate_impact()
code= my_interface.export_to_bw()

This and further examples how to use SiModIn can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simodin-0.0.4.dev2.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simodin-0.0.4.dev2-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file simodin-0.0.4.dev2.tar.gz.

File metadata

  • Download URL: simodin-0.0.4.dev2.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for simodin-0.0.4.dev2.tar.gz
Algorithm Hash digest
SHA256 12e798eb1df78b460824cdfb5462d9009ad680af27c0b62be7861eaa960242ff
MD5 6c9dcc3861cb77f9e8b912b09e9678e4
BLAKE2b-256 d385ffc60d4776b7a9143bc6d520efa679807cfc2c71358e46549181db11c343

See more details on using hashes here.

File details

Details for the file simodin-0.0.4.dev2-py3-none-any.whl.

File metadata

  • Download URL: simodin-0.0.4.dev2-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for simodin-0.0.4.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 522db83abcc791d36d56754bbc1391086f2729b1482e1430a834efc9e66769f1
MD5 09f74fb5f4ba6efaaa537673d5a0a9ce
BLAKE2b-256 b00fe9e1eda673c6856f306eb50968f162dc95808f5e2827ddde0d6618f78f0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page