Missing node in exergy analysis #539
-
Hi all! Any ideas what I did wrong? Here is a minimal example of the problem: from tespy.networks import Network
from tespy.components import (
Source, Sink, CycleCloser, SimpleHeatExchanger, Merge, Splitter,
)
from tespy.connections import Connection, Ref, Bus
from tespy.tools import ExergyAnalysis
#creation of components:
nw = Network()
nw.set_attr(iterinfo=False)
nw.set_attr(T_unit='C', p_unit='bar', h_unit='kJ / kg')
heat_sink = SimpleHeatExchanger('heat sink')
merge_injection = Merge("Injection")
dummy_sink= Sink('dummy sink')
injection_source =Source('injection_source')
condensate_split= Splitter("split condensate")
cycl=CycleCloser('CycleCloser')
boiler = SimpleHeatExchanger('steam boiler')
inj_cycle = CycleCloser('injection cycle')
# Setup of connections
superheated_steam= Connection(boiler, 'out1', merge_injection, 'in1')
inj_condensate = Connection(injection_source, 'out1', merge_injection, 'in2')
saturated_steam = Connection(merge_injection, 'out1', heat_sink, 'in1')
condensate_1 = Connection(heat_sink, 'out1', condensate_split, 'in1')
inj_condensate_return = Connection(condensate_split, 'out2', dummy_sink, 'in1')
condensate_return_1 = Connection(condensate_split, 'out1', cycl, 'in1')
condensate_return_2= Connection(cycl,'out1', boiler, 'in1' )
nw.add_conns(condensate_1,
inj_condensate_return,
inj_condensate,
saturated_steam,
superheated_steam,
condensate_return_1,
condensate_return_2)
# specify attributes:
superheated_steam.set_attr(fluid={'water':1}, p=40, Td_bp= 10)
condensate_1.set_attr(x=0)
condensate_return_1.set_attr(m=Ref(superheated_steam,1,0))
inj_condensate.set_attr(x=0, fluid={'water':1})
saturated_steam.set_attr(x=1)
heat_sink.set_attr(pr=1)
#Add busses:
product_bus =Bus('heat bus', P=-10000)
product_bus.add_comps({'comp':heat_sink})
fuel_bus = Bus('boiler bus')
fuel_bus.add_comps({'comp':boiler, 'base':'bus'})
water_bus = Bus('water bus')
water_bus.add_comps({'comp':injection_source, 'base':'bus'})
waste_water_bus = Bus('wastewater bus')
waste_water_bus.add_comps({'comp':dummy_sink, 'base':'component'})
nw.add_busses(fuel_bus, product_bus, waste_water_bus, water_bus)
nw.solve('design')
ean = ExergyAnalysis(nw,
E_P=[product_bus],
E_F=[fuel_bus, water_bus],
E_L=[waste_water_bus]
)
ean.analyse(pamb=1, Tamb=20)
import plotly.graph_objects as go
links, nodes = ean.generate_plotly_sankey_input()
fig = go.Figure(go.Sankey(
arrangement='snap',
node={
'label': nodes,
'pad':11,
'color': 'orange'
},
link=links
))
fig.show() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @HaSchneider and thanks for reaching out! The issue is in the heat_sink = SimpleHeatExchanger('heat sink', dissipative=False) A dissipative component has no defined exergy product. This would be the case, if the energy provided to the heat sink would just be considered a heat loss to the ambient. |
Beta Was this translation helpful? Give feedback.
Hi @HaSchneider and thanks for reaching out!
The issue is in the
SimpleHeatExchanger
being defined as dissipative component by default. I should change it, so the user gets an error, that the component has to be specified as dissipative or not explicitly. You can fix this in the current version of tespy by changing this line:A dissipative component has no defined exergy product. This would be the case, if the energy provided to the heat sink would just be considered a heat loss to the ambient.