Using Condenser to model Feedwater Heater for Rankine Cycle #922
|
I am using Condenser to model HP and Lp heaters for Rankine Cycle. Both the heaters are fed from turbine extraction steam, where pressure is fixed. I am Setting ttd_u for both the heaters. For HP heater the model works and is able to compute extraction steam flow. However for LP heater which is fed from condenser through a pump(water side), the model fails with error like Anyone else faced similar problem or any suggested workaround for this problem? from tespy.networks import Network
from tespy.components import Sink, Source, SteamTurbine,Merge,Pump,CycleCloser,PowerBus,HeatExchanger,Valve, Splitter,PowerSink,PowerBus,Condenser,SimpleHeatExchanger
from tespy.components.power.generator import Generator
from tespy.connections import Connection,PowerConnection
from tespy.components import MovingBoundaryHeatExchanger
# 1. Initialize Network
nw = Network()
nw.units.set_defaults(
temperature="degC", pressure="bar", enthalpy="kJ/kg", power="MW", heat="MW")
# 2. Define Components
steam_source = Source('Steam Source')
cw_source=Source('Cw_in')
da=Merge('da',num_in=3)
cond_mix=Merge('cond_mix',num_in=3)
cep=Pump('cep')
bfp=Pump('bfp')
cep.set_attr(eta_s=0.9)
bfp.set_attr(eta_s=0.9)
hpt1 = SteamTurbine('High Pressure Turbine1')
ipt1_0 = SteamTurbine('IP Turbine1')
ipt1_1 = SteamTurbine('IP Turbine2')
lpt1_0 = SteamTurbine('LP Turbine1')
lpt1_1 = SteamTurbine('LP Turbine2')
v1=Valve('lphdrip')
v2=Valve('hphdrip')
v3=Valve('cep_disch')
#Introduce LP Turbine and LP Heater
bfpt=SteamTurbine('bfpt')
cond1= Condenser("cond1")
cw_sink = Sink('cw_sink')
da_sink = Sink('da_sink')
cond_sink = Sink('cond_sink')
lph_drip_sink = Sink('lph_drip_sink')
s1=Splitter('s1',num_out=3) #HPT Outlet
shaft2=PowerBus("shaft2", num_in=1, num_out=1)
#for introducing HP Heater
s2=Splitter('s2',num_out=2)
# for LP Trubine
s3=Splitter('s3',num_out=2)
sg1 = SimpleHeatExchanger('steam generator1')
sg2 = SimpleHeatExchanger('steam generator2')
#generator = Generator("generator")
#generator.set_attr(eta=0.98)
#grid=PowerSink("grid")
# 3. Create Connections
cc = CycleCloser('cycle closer')
c1_0 = Connection(cc, 'out1', hpt1, 'in1', label='c1')
#c1_1=Connection(sg1,'out1',cc,'in1',label='c1_1')
c1 = Connection(sg1, 'out1', cc, 'in1')
#c2 = Connection(hpt1, 'out1', ipt1_0, 'in1')
#introducing HP Heater from CRH
hph1= Condenser("hph1")
lph1= Condenser("lph1")
#Rheater Introduced
c2_5=Connection(hpt1,'out1',s2,'in1')
c2 = Connection(s2, 'out1', sg2, 'in1')
c2_6=Connection(s2,'out2',hph1,'in1')
c2_8=Connection(hph1,'out1',v2,'in1')
c2_7=Connection(v2,'out1',da,'in3')
c2_4=Connection(sg2, 'out1', ipt1_0, 'in1')
c2_0=Connection(ipt1_0,'out1',s1,'in1')
c2_1 = Connection(s1, 'out1', ipt1_1, 'in1')
c2_2 = Connection(s1, 'out2', da, 'in2')
c2_3 = Connection(s1, 'out3', bfpt, 'in1')
#cooling water connections
c3 = Connection(cw_source, 'out1', cond1, 'in2')
c4 = Connection(cond1, 'out2', cw_sink, 'in1')
c5=Connection(cond1, 'out1', cep, 'in1')
#c6_1=Connection(cep, 'out1', da, 'in1')
#introduce LPH1
#c6_1=Connection(cep, 'out1', lph1, 'in2')
c6_1=Connection(cep, 'out1', lph1, 'in2')
c6_4=Connection(lph1,'out2',v3,'in1')
c6_3=Connection(v3,'out1',da, 'in1')
#c6_1=Connection(cep, 'out1', cond_sink,'in1')
c6_2=Connection(da,'out1',bfp,'in1')
#hph1
c7=Connection(bfp,'out1',hph1,'in2')
c7_1=Connection(hph1,'out2',sg1,'in1')
#c7=Connection(bfp,'out1',sg1,'in1')
#c8=Connection(ipt1_1,'out1',cond1,'in1')
# introduce connections for LP Turbine and lph
c9=Connection(ipt1_1,'out1',lpt1_0,'in1')
c10=Connection(lpt1_0,'out1',s3,'in1')
c10_1=Connection(s3,'out1',lpt1_1,'in1')
c10_2=Connection(s3,'out2',lph1,'in1')
c10_3=Connection(lph1,'out1',v1,'in1')
#c10_4=Connection(lph1,'out1',v1,'in1')
c10_4=Connection(v1,'out1',cond_mix,'in3')
c8_1=Connection(lpt1_1,'out1',cond_mix,'in1')
c8_2=Connection(bfpt,'out1',cond_mix,'in2')
c8_3=Connection(cond_mix,'out1',cond1,'in1')
e8=PowerConnection(bfpt,'power',shaft2,"power_in1",label="e8")
e9=PowerConnection(shaft2,'power_out1',bfp,"power",label="e9")
nw.add_conns(c1,c1_0,c2,c2_0,c2_1,c2_2,c2_3,c2_4,c2_5,c2_6,c2_7,c2_8,c3,c4,c5,c6_1,c6_2,c6_3,c6_4,c7,c7_1,c8_1,c8_2,c8_3,c10,c9,c10_1,c10_2,c10_3,c10_4,e8,e9)
# 4. Set Parameters
c1_0.set_attr(p=256, T=600,m=1827, fluid={'Water': 1})
c2.set_attr(p=40)
c2_0.set_attr(p=12)
c2_4.set_attr(T=610)
#c2.set_attr(p=0.1)
cond1.set_attr(ttd_u=2.5)
c3.set_attr(p=2, T=33, fluid={'Water': 1})
c4.set_attr( p=1.5,T=42) # Extraction pressure defined at HPT outlet
cond1.set_attr(pr1=1)
c6_2.set_attr(x=0)
sg1.set_attr(pr=0.9)
sg2.set_attr(pr=0.9)
c9.set_attr(p=5.5)
c10.set_attr(p=2)
c10_2.set_attr(m=None)
#c2_6.set_attr(m=193)
#c10_3.set_attr(T=95)
#c7.set_attr(p=300)
# Condenser pressure
hpt1.set_attr(eta_s=0.9)
ipt1_0.set_attr(eta_s=0.9)
ipt1_1.set_attr(eta_s=0.9)
lpt1_0.set_attr(eta_s=0.9)
lpt1_1.set_attr(eta_s=0.9)
bfpt.set_attr(eta_s=0.9)
hph1.set_attr(ttd_u=5)
hph1.set_attr(pr2=.95)
lph1.set_attr(ttd_u=4.31)
#lph1.set_attr(ttd_l=0)
lph1.set_attr(pr2=0.95)
#lph1.set_attr(pr1=0.99)
v1.set_attr(pr=0.95)
v2.set_attr(pr=0.95)
v3.set_attr(pr=0.5) |
Replies: 5 comments
|
Hi @sitanshup31, can you post a flowsheet of your problem? Also I'd advise you to build your system step by step by creating a working submodel and then adding the next part. If something does not work it is much easier to know the reason for it. Also, try to give temperature/dew line temperature difference/quality and pressure values at the beginning instead of the temperature differences at the heat exchangers, because these can be quite sensitive to starting values. After the first successful simulation you can then switch the specification to the temperature differences. Best |
|
HBD Model - 1.pdf Attached is the HMBD model of the problem I am trying to solve. Thanks & Regards, **HP Heater**
from tespy.components import Source, Sink, HeatExchanger,Condenser
from tespy.connections import Connection,PowerConnection
from tespy.networks import Network
nw = Network()
nw.units.set_defaults(
temperature="°C",
pressure="bar"
)
so1 = Source("source 1")
so2 = Source("source 2")
si1 = Sink("sink 1")
si2 = Sink("sink 2")
heatex = Condenser("heatexchanger")
c1 = Connection(so1, "out1", heatex, "in1", label="c1")
c2 = Connection(heatex, "out1", si1, "in1", label="c2")
d1 = Connection(so2, "out1", heatex, "in2", label="d1")
d2 = Connection(heatex, "out2", si2, "in1", label="d2")
nw.add_conns(c1, c2, d1, d2)
c1.set_attr(fluid={"water": 1}, T=316, p=40)
#c2.set_attr(T=110)
d1.set_attr(fluid={"water": 1}, T=193, p=299,m=1827)
heatex.set_attr(pr1=1, pr2=0.95,ttd_u=5)
nw.solve("design")
nw.print_results()
**LP Heater**
from tespy.components import Source, Sink, HeatExchanger,Condenser
from tespy.connections import Connection,PowerConnection
from tespy.networks import Network
nw = Network()
nw.units.set_defaults(
temperature="°C",
pressure="bar"
)
so1 = Source("source 1")
so2 = Source("source 2")
si1 = Sink("sink 1")
si2 = Sink("sink 2")
heatex = Condenser("heatexchanger")
c1 = Connection(so1, "out1", heatex, "in1", label="c1")
c2 = Connection(heatex, "out1", si1, "in1", label="c2")
d1 = Connection(so2, "out1", heatex, "in2", label="d1")
d2 = Connection(heatex, "out2", si2, "in1", label="d2")
nw.add_conns(c1, c2, d1, d2)
c1.set_attr(fluid={"water": 1}, T=220, p=2)
#c2.set_attr(T=110)
d1.set_attr(fluid={"water": 1}, T=44, p=25,m=1423)
heatex.set_attr(pr1=1, pr2=0.95,ttd_u=5)
nw.solve("design")
nw.print_results() |
|
This is typically the way, you would work in steps: from tespy.components import Source, Sink, HeatExchanger,Condenser
from tespy.connections import Connection,PowerConnection
from tespy.networks import Network
nw = Network()
nw.units.set_defaults(
temperature="°C",
pressure="bar"
)
so1 = Source("source 1")
so2 = Source("source 2")
si1 = Sink("sink 1")
si2 = Sink("sink 2")
heatex = Condenser("heatexchanger")
c1 = Connection(so1, "out1", heatex, "in1", label="c1")
c2 = Connection(heatex, "out1", si1, "in1", label="c2")
d1 = Connection(so2, "out1", heatex, "in2", label="d1")
d2 = Connection(heatex, "out2", si2, "in1", label="d2")
nw.add_conns(c1, c2, d1, d2)
c1.set_attr(fluid={"water": 1}, T=220, p=2)
d1.set_attr(fluid={"water": 1}, T=44, p=25,m=1423)
d2.set_attr(T=60)
heatex.set_attr(pr1=1, pr2=0.95)
nw.solve("design")
d2.set_attr(T=None)
heatex.set_attr(ttd_u=5)
nw.solve("design")
nw.print_results()It is a starting value problem with the direct specification of the parameters as indicated in the error message. Although it works for the HP heater I usually take these two-step approaches for any kind of simulation. |
|
Hello Francesco, from tespy.networks import Network
from tespy.components import Sink, Source, SteamTurbine,Merge,Pump,CycleCloser,PowerBus, Splitter,PowerSink,PowerBus,Condenser,SimpleHeatExchanger
from tespy.components.power.generator import Generator
from tespy.connections import Connection,PowerConnection
# 1. Initialize Network
nw = Network()
nw.units.set_defaults(
temperature="degC", pressure="bar", enthalpy="kJ/kg", power="MW", heat="MW")
# 2. Define Components
steam_source = Source('Steam Source')
cc = CycleCloser('cycle closer')
cw_source=Source('Cw_in')
da=Merge('da',num_in=3)
cond_mix=Merge('cond_mix',num_in=3)
cep=Pump('cep')
bfp=Pump('bfp')
cep.set_attr(eta_s=0.9)
bfp.set_attr(eta_s=0.9)
hpt1 = SteamTurbine('High Pressure Turbine1')
ipt1_0 = SteamTurbine('IP Turbine1')
ipt1_1 = SteamTurbine('IP Turbine2')
lpt1_0 = SteamTurbine('LP Turbine1')
lpt1_1 = SteamTurbine('LP Turbine2')
bfpt=SteamTurbine('bfpt')
cond1= Condenser("cond1")
cw_sink = Sink('cw_sink')
da_sink = Sink('da_sink')
ext_sink = Sink('ext_sink')
cond_sink = Sink('cond_sink')
s1=Splitter('s1',num_out=3) #HPT Outlet
shaft2=PowerBus("shaft2", num_in=1, num_out=1)
#for HP Heater
s2=Splitter('s2',num_out=2)
# for LP Trubine Extraction/LPH
s3=Splitter('s3',num_out=2)
#Boilers
sg1 = SimpleHeatExchanger('steam generator1')
sg2 = SimpleHeatExchanger('steam generator2')
#introducing HP Heater from CRH
hph1= Condenser("hph1")
#introducing LPH
lph1= Condenser("lph1")
#generator = Generator("generator")
#generator.set_attr(eta=0.98)
#grid=PowerSink("grid")
# 3. Create Connections
c1_1 = Connection(cc, 'out1', hpt1, 'in1', label='c1')
#c1_1=Connection(sg1,'out1',cc,'in1',label='c1_1')
c1_2 = Connection(sg1, 'out1', cc, 'in1')
#c2 = Connection(hpt1, 'out1', ipt1_0, 'in1')
# HPT Connections
c2_1=Connection(hpt1,'out1',s2,'in1')
#Rheater Introduced
c2_2 = Connection(s2, 'out1', sg2, 'in1')
#CRH to HPH
c2_3=Connection(s2,'out2',hph1,'in1')
#HPH Drip to D/A
c2_4=Connection(hph1,'out1',da,'in3')
#Reheater outlet to IPT
c3=Connection(sg2, 'out1', ipt1_0, 'in1')
#IPT Extraction @12 kg
c4_1=Connection(ipt1_0,'out1',s1,'in1')
c4_2 = Connection(s1, 'out1', ipt1_1, 'in1')
#Extraction to D/A
c4_3 = Connection(s1, 'out2', da, 'in2')
#Extraction to BFPT
c4_4 = Connection(s1, 'out3', bfpt, 'in1')
#cooling water connections
c5 = Connection(cw_source, 'out1', cond1, 'in2')
c6 = Connection(cond1, 'out2', cw_sink, 'in1')
#Condenser o/l to CEP
c7_1=Connection(cond1, 'out1', cep, 'in1')
c7_2=Connection(cep, 'out1', lph1, 'in2')
c7_3=Connection(lph1,'out2',da, 'in1')
#D/A o/l to BFP
c8_1=Connection(da,'out1',bfp,'in1')
c8_2=Connection(bfp,'out1',hph1,'in2')
c8_3=Connection(hph1,'out2',sg1,'in1')
#Introducing LPT
c9=Connection(ipt1_1,'out1',lpt1_0,'in1')
#LPT Connections
c10_1=Connection(lpt1_0,'out1',s3,'in1')
c10_2=Connection(s3,'out1',lpt1_1,'in1')
c10_3=Connection(s3,'out2',lph1,'in1')
#Condenser Connections
c11_1=Connection(lpt1_1,'out1',cond_mix,'in1')
c11_2=Connection(bfpt,'out1',cond_mix,'in2')
c11_3=Connection(lph1,'out1',cond_mix,'in3')
c11_4=Connection(cond_mix,'out1',cond1,'in1')
e1=PowerConnection(bfpt,'power',shaft2,"power_in1",label="e8")
e2=PowerConnection(shaft2,'power_out1',bfp,"power",label="e9")
nw.add_conns(c1_1,c1_2,c2_1,c2_2,c2_3,c2_4,c3,c4_1,c4_2,c4_3,c4_4,c5,c6,c7_1,c7_2,c7_3,c8_1,c8_2,c8_3,c9,c10_1,c10_2,c10_3,c11_1,c11_2,c11_3,c11_4,e1,e2)
# 4. Set Parameters
c1_1.set_attr(p=256, T=600,m=1827, fluid={'Water': 1})
#HPT EXhaust/CRH
c2_1.set_attr(p=40)
#IP EXtraction
c4_1.set_attr(p=12)
#HRH Temp
c3.set_attr(T=610)
# CW in and out
c5.set_attr(p=2, T=33, fluid={'Water': 1})
c6.set_attr( p=1.5,T=42)
#Steam Generators
sg1.set_attr(pr=0.9)
sg2.set_attr(pr=0.9)
#Main Condenser
cond1.set_attr(pr1=1)
#either set this or set Condensate Temperature tofollow two step appraoch
#cond1.set_attr(ttd_u=2.5)
c7_1.set_attr(T=42)
#D/A outlet saturated water
c8_1.set_attr(x=0)
#Turbine Efficiencies
hpt1.set_attr(eta_s=0.9)
ipt1_0.set_attr(eta_s=0.9)
ipt1_1.set_attr(eta_s=0.9)
lpt1_0.set_attr(eta_s=0.9)
lpt1_1.set_attr(eta_s=0.9)
bfpt.set_attr(eta_s=0.9)
#IPT Exhaust
c9.set_attr(p=5.5)
#LP Extraction Pressure
c10_1.set_attr(p=2)
#HPH Parameters
hph1.set_attr(pr2=.95)
#either set o/l temp or ttd
#hph1.set_attr(ttd_u=10)
#hph1.set_attr(ttd_u=10)
c8_3.set_attr(T=200)
#LPH Parameters
lph1.set_attr(pr2=.95)
#either set o/l temp or ttd
#lph1.set_attr(ttd_u=5)
c7_3.set_attr(T=100)
#hph1.set_attr(ttd_u=5)
nw.solve(mode='design')
nw.print_results()
cond1.set_attr(ttd_u=2.5)
hph1.set_attr(ttd_u=5)
lph1.set_attr(ttd_u=5)
c7_1.set_attr(T=None)
c7_3.set_attr(T=None)
#c10_3.set_attr(T=None)
c8_3.set_attr(T=None)
nw.solve(mode='design')
#eq=nw.get_linear_dependent_variables()
#print(nw.get_presolved_variables())
#print(eq)
nw.print_results() |
|
We can keep it open, but I'll move it to the discussions. I think that is a better place for others to find it if they have similar issues. |
Hello Francesco,
Was able to solve with following code. However please keep this thread open. Let me try to add cascaded heaters.