Problem with Merge and Splitter since switched to Tespy 9 #706
-
Since I switched to tespy 9 I have an issue I cant solve myself. I hope someone else could help me with that. The here shown model raises the following error: Simulation crashed due to an unexpected error:
unable to solve 1phase PY flash with Tmin=584.132, Tmax=3000 due to error: HSU_P_flash_singlephase_Brent could not find a solution because Smolar [193.579 J/mol/K] is above the maximum value of 184.8686532 J/mol/K It works, if the "makeup" and "blowdown" components incl. their Merge and splitter are removed from the network. from tespy.connections import Connection, Ref
from tespy.components import (
Turbine, Source, Sink, Pump,
CycleCloser, SimpleHeatExchanger, Valve, Merge,
Splitter, DropletSeparator,)
from tespy.networks import Network
needed_temperature=230
makeup_factor=0.05
Tamb=20
max_pressure=100
heat=1000E2
needed_pressure=28
h_superheating_max_pressure= 3617
main_pressure=40
#setup network
model= Network()
model.set_attr(iterinfo=False)
model.set_attr(T_unit='C', p_unit='bar', h_unit='kJ / kg')
# create components
boiler = SimpleHeatExchanger('steam boiler' , dissipative=False)
bpt = Turbine('back pressure turbine')
valve = Valve('controlvalve')
hex_heat_sink = SimpleHeatExchanger('hex heat sink', dissipative=False)
feed_pump= Pump('feedpump')
cycl=CycleCloser('CycleCloser')
makeup=Source("Make-up water")
blowdown= Sink("blowdown wastewater")
merge = Merge("Makeup water feed", num_in=2)
split= Splitter("remove wastewater")
#create connections:
c05 = Connection(cycl, 'out1', boiler, 'in1')
c04 = Connection(boiler, 'out1', bpt, 'in1', label='c04')
c03 = Connection(bpt, 'out1', valve, 'in1', label='c03')
c01= Connection(valve, 'out1', hex_heat_sink, 'in1', label='c01')
c1 = Connection(hex_heat_sink, 'out1', split, 'in1', label='c1')
c3 = Connection(split, 'out1', merge, 'in1', label='c3')
c4 = Connection(merge, 'out1', feed_pump, 'in1', label='c4')
c5 = Connection(feed_pump, 'out1', cycl, 'in1', label='c5')
model.add_conns(c05, c04, c03,
c01, c1,c5,)
muw = Connection(makeup, 'out1', merge, 'in2', label='muw')
wawa = Connection(split, 'out2', blowdown, 'in1')
model.add_conns( c3, c4, muw, wawa)
#set attributes:
muw.set_attr(m=Ref(c04, makeup_factor, 0),
T=Tamb,
fluid={"H2O": 1},
p0=needed_pressure)
wawa.set_attr(m=Ref(c04, makeup_factor, 0))
boiler.set_attr(pr = 1, power_connector_location="inlet")
c04.set_attr(fluid={"H2O": 1}, h= h_superheating_max_pressure)
bpt.set_attr(eta_s = 0.85, )
c03.set_attr(p=main_pressure)
c01.set_attr(p = needed_pressure)
hex_heat_sink.set_attr(pr=1,Q=-heat, power_connector_location="outlet")
c1.set_attr(x=0)
feed_pump.set_attr(eta_s =0.95)
c5.set_attr(p=max_pressure)
model.solve('design') |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @HaSchneider, thank you for reporting this. This is a starting value issue, which may come from the fact, that the starting values are selected differently between the two versions. What you can do is to solve in two steps: feed_pump.set_attr() # do not set eta_s here!
c5.set_attr(p=max_pressure, h=Ref(c4, 1, 10)) # instead add a referenced h specification here!
model.solve('design')
# then switch specifications
feed_pump.set_attr(eta_s =0.95)
c5.set_attr(h=None)
model.solve('design') I will adapt the Best Francesco |
Beta Was this translation helpful? Give feedback.
-
This actually solved the issue, but the next is coming right up: I know that the massflows are getting very low there, but without the pipe, I have no problem. from tespy.connections import Connection, Ref
from tespy.components import (
Turbine, Source, Sink, Pump,
CycleCloser, SimpleHeatExchanger, Valve, Merge,
Splitter, Pipe)
from tespy.networks import Network
needed_temperature=230
makeup_factor=0.05
Tamb=20
max_pressure=100
heat=1E4
needed_pressure=28
h_superheating_max_pressure= 3617
main_pressure=40
#setup network
model= Network()
model.set_attr(iterinfo=False)
model.set_attr(T_unit='C', p_unit='bar', h_unit='kJ / kg')
# create components
boiler = SimpleHeatExchanger('steam boiler' , dissipative=False)
bpt = Turbine('back pressure turbine')
valve = Valve('controlvalve')
hex_heat_sink = SimpleHeatExchanger('hex heat sink', dissipative=False)
feed_pump= Pump('feedpump')
cycl=CycleCloser('CycleCloser')
makeup=Source("Make-up water")
blowdown= Sink("blowdown wastewater")
merge = Merge("Makeup water feed", num_in=2)
split= Splitter("remove wastewater")
pipe_cold= Pipe('condensate pipe',dissipative=True)
#create connections:
c05 = Connection(cycl, 'out1', boiler, 'in1')
c04 = Connection(boiler, 'out1', bpt, 'in1', label='c04')
c03 = Connection(bpt, 'out1', valve, 'in1', label='c03')
c01= Connection(valve, 'out1', hex_heat_sink, 'in1', label='c01')
c1 = Connection(hex_heat_sink, 'out1', pipe_cold, 'in1', label='c1')
c2 = Connection(pipe_cold, 'out1', split, 'in1', label='c2')
c3 = Connection(split, 'out1', merge, 'in1', label='c3')
c4 = Connection(merge, 'out1', feed_pump, 'in1', label='c4')
c5 = Connection(feed_pump, 'out1', cycl, 'in1', label='c5')
model.add_conns(c05, c04, c03,
c01, c1,c5,c2,
c3, c4, )
muw = Connection(makeup, 'out1', merge, 'in2', label='muw')
wawa = Connection(split, 'out2', blowdown, 'in1')
model.add_conns( muw, wawa)
#set attributes:
muw.set_attr(m=Ref(c04, makeup_factor, 0),
T=Tamb,
fluid={"H2O": 1},
p0=needed_pressure)
wawa.set_attr(m=Ref(c04, makeup_factor, 0))
boiler.set_attr(pr = 1, power_connector_location="inlet")
c04.set_attr(fluid={"H2O": 1}, h= h_superheating_max_pressure)
bpt.set_attr(eta_s = 0.85, )
c03.set_attr(p=main_pressure)
c01.set_attr(p = needed_pressure)
hex_heat_sink.set_attr(pr=1,Q=-heat, power_connector_location="outlet")
c1.set_attr(x=0)
#feed_pump.set_attr(eta_s =0.85)
c5.set_attr(p=max_pressure,h=Ref(c4, 1, 10))
pipe_cold.set_attr(pr=0.95,
Tamb = Tamb,
kA= 500,
L=1000, D='var',
ks=4.57e-5)
model.solve('design')
|
Beta Was this translation helpful? Give feedback.
Hi @HaSchneider,
thank you for reporting this. This is a starting value issue, which may come from the fact, that the starting values are selected differently between the two versions. What you can do is to solve in two steps:
I will adapt the
convergence_check
method for thePump
class, to force liquid only inlet and outlet state. That will resolve the issue.Best
Francesco