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

Add optional emission buses to facades #170

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/oemof/tabular/facades/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class Conversion(Converter, Facade):

output_parameters: dict = field(default_factory=dict)

emissions: dict = field(default_factory=dict)

def build_solph_components(self):
""" """
self.conversion_factors.update(
Expand Down Expand Up @@ -132,3 +134,12 @@ def build_solph_components(self):
)
}
)

if self.emissions:
self.outputs.update({bus: Flow() for bus in self.emissions.keys()})
self.conversion_factors.update(
{
bus: sequence(emission_factor)
for bus, emission_factor in self.emissions.items()
}
)
3 changes: 3 additions & 0 deletions tests/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,16 @@ def test_conversion(self):
r""" """
bus_biomass = solph.Bus("biomass")
bus_heat = solph.Bus("heat")
bus_co2_em = solph.Bus("co2_em")
bus_ch4_em = solph.Bus("ch4_em")

conversion = Conversion(
label="biomass_plant",
carrier="biomass",
tech="st",
from_bus=bus_biomass,
to_bus=bus_heat,
emissions={bus_co2_em: 0.5, bus_ch4_em: 10},
SabineHaas marked this conversation as resolved.
Show resolved Hide resolved
capacity=100,
efficiency=0.4,
)
Expand Down
Loading