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
"Found singularity in Jacobian matrix, calculation aborted! The setup of you problem seems to be solvable. It failed due to partial derivatives in the Jacobian being zero, which were expected not to be zero, or the other way around.". When i set extraction flow instead of ttd_u, the model works.
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)
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
"Found singularity in Jacobian matrix, calculation aborted! The setup of you problem seems to be solvable. It failed due to partial derivatives in the Jacobian being zero, which were expected not to be zero, or the other way around.". When i set extraction flow instead of ttd_u, the model works.
Anyone else faced similar problem or any suggested workaround for this problem?
Code reproduced below