Problems with drum simulation #358
-
Problems with drum simulation from tespy.components import Drum, HeatExchanger, Sink, Source
from tespy.networks import Network
from tespy.connections.connection import Connection
from CoolProp.CoolProp import PropsSI as PSI
drum = Drum('drum')
pre = HeatExchanger('preheater')
evap = HeatExchanger('evaporator')
w_source = Source('water source')
w_sink = Sink('water sink')
g_source = Source('gas source')
g_sink = Sink('gas sink')
nw = Network(fluids=['Water', 'air'])
nw.set_attr(p_unit='bar', T_unit='C', h_unit='kJ / kg', iterinfo=True)
# main flux
c1 = Connection(w_source, 'out1', pre, 'in1', label='1')
c2 = Connection(pre, 'out1', drum, 'in1', label='2')
c3 = Connection(drum, 'out1', evap, 'in1', label='3')
c4 = Connection(evap, 'out1', drum, 'in2', label='4')
c5 = Connection(drum, 'out2', w_sink, 'in1', label='5')
nw.add_conns(c1, c2, c3, c4, c5)
# gas flux
cg1 = Connection(g_source, 'out1', evap, 'in2', label='g1')
cg2 = Connection(evap, 'out2', pre, 'in2', label='g2')
cg3 = Connection(pre, 'out2', g_sink, 'in1', label='g3')
nw.add_conns(cg1, cg2, cg3)
# component parameters
pre.set_attr(pr1=0.96, pr2=0.96)
evap.set_attr(pr1=0.96, pr2=0.96)
# fixed parameters
# water from pump
c1.set_attr(fluid={'Water': 1, 'air':0}, p=15, T=45)
# flue gas from diesel engines
cg1.set_attr(fluid={'Water': 0, 'air': 1}, m=21.42, T=231.18)
# project parameters
# water after preheater
c2.set_attr(Td_bp=-2)
# ttdl at preheater
pre.set_attr(ttd_u=5)
# water after evaporator
c4.set_attr(Td_bp=2)
nw.solve('design') |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @icarofvilasboas, I am out of office right now without having my laptop with me. I try to give you some ideas, but I cannot confirm: You need to connect the heat exchangers correctly, hot side is index 1, which should be the flue gas part. Then pressure information information is missing on the flue gas part (cg1). Finally, the drum implies equality of pressure at all inlets and outlets, therefore you cannot impose the pr2 for the evaporator. Removing it should do the job. Could you give me feedback, if that did work? Have a nice day Francesco |
Beta Was this translation helpful? Give feedback.
-
Hi @fwitte, Tank you so much for your support. It solved my problem. from tespy.components import Drum, HeatExchanger, Sink, Source
from tespy.networks import Network
from tespy.connections.connection import Connection
from CoolProp.CoolProp import PropsSI as PSI
drum = Drum('drum')
pre = HeatExchanger('preheater')
evap = HeatExchanger('evaporator')
w_source = Source('water source')
w_sink = Sink('water sink')
g_source = Source('gas source')
g_sink = Sink('gas sink')
nw = Network(fluids=['Water', 'air'])
nw.set_attr(p_unit='bar', T_unit='C', h_unit='kJ / kg', iterinfo=True)
# main flux
c1 = Connection(w_source, 'out1', pre, 'in2', label='1')
c2 = Connection(pre, 'out2', drum, 'in1', label='2')
c3 = Connection(drum, 'out1', evap, 'in2', label='3')
c4 = Connection(evap, 'out2', drum, 'in2', label='4')
c5 = Connection(drum, 'out2', w_sink, 'in1', label='5')
nw.add_conns(c1, c2, c3, c4, c5)
# gas flux
cg1 = Connection(g_source, 'out1', evap, 'in1', label='g1')
cg2 = Connection(evap, 'out1', pre, 'in1', label='g2')
cg3 = Connection(pre, 'out1', g_sink, 'in1', label='g3')
nw.add_conns(cg1, cg2, cg3)
# component parameters
pre.set_attr(pr1=0.96, pr2=0.96)
evap.set_attr(pr1=0.96)
# fixed parameters
# water from pump
c1.set_attr(fluid={'Water': 1, 'air':0}, p=15, T=45)
# flue gas from diesel engines
cg1.set_attr(fluid={'Water': 0, 'air': 1}, p=1.01325, m=21.42, T=231.18)
# project parameters
# water after preheater
c2.set_attr(Td_bp=-2)
# ttdl at preheater
pre.set_attr(ttd_u=5)
# water after evaporator
c4.set_attr(Td_bp=2)
nw.solve('design') |
Beta Was this translation helpful? Give feedback.
Hi @icarofvilasboas,
I am out of office right now without having my laptop with me.
I try to give you some ideas, but I cannot confirm: You need to connect the heat exchangers correctly, hot side is index 1, which should be the flue gas part. Then pressure information information is missing on the flue gas part (cg1). Finally, the drum implies equality of pressure at all inlets and outlets, therefore you cannot impose the pr2 for the evaporator. Removing it should do the job. Could you give me feedback, if that did work?
Have a nice day
Francesco