About the Setting of pressure loss along the way #398
-
Dear fwitte, I still have the question about how to set the pressure loss between components in the cycle. For example , I want to set 3% pressure loss on the way from compressor outlet to heatexchanger inlet. This is the code I wrote roughly. I set the valve assembly to control the pressure loss of the pipeline. I don't know whether this setting is correct. from tespy.networks import Network
from tespy.components import Source, Sink, CycleCloser, Compressor, HeatExchanger,HeatExchangerSimple, Valve, Turbine
from tespy.connections import Connection, Bus
# specification of ambient state
pamb = 0.101325
Tamb = 298.15
# setting up network
nw = Network(fluids=['CO2'])
nw.set_attr(
T_unit='K', p_unit='MPa', h_unit='kJ / kg', m_unit='kg / s',
s_unit="kJ / kgK")
# components definition
water_in = Source('Water source')
water_out = Sink('Water sink')
closer = CycleCloser('Cycle closer')
cp1 = Compressor('Compressor 1', fkt_group='CMP')
rec1 = HeatExchanger('Recuperator 1', fkt_group='REC')
cooler = HeatExchangerSimple('Water cooler')
heater = HeatExchangerSimple('Heater')
pi1 = Valve('pipe 1')
pi2 = Valve('pipe 2')
pi3 = Valve('pipe 3')
pi4 = Valve('pipe 4')
pi5 = Valve('pipe 5')
pi6 = Valve('pipe 6')
turb = Turbine('Turbine')
# connections definition
# power cycle
c1 = Connection(pi1, 'out1', cp1, 'in1', label='1')
c2 = Connection(cp1, 'out1', pi2, 'in1', label='2')
c3 = Connection(pi2, 'out1', rec1, 'in2', label='3')
c4 = Connection(rec1, 'out2', pi3, 'in1', label='4')
c5 = Connection(pi3, 'out1', heater, 'in1', label='5')
c0 = Connection(heater, 'out1', pi4, 'in1', label='0')
c6 = Connection(pi4, 'out1', closer, 'in1', label='6')
c12 = Connection(closer, 'out1', turb, 'in1', label='12')
c7 = Connection(turb, 'out1', pi5, 'in1', label='7')
c8 = Connection(pi5, 'out1', rec1, 'in1', label='8')
c9 = Connection(rec1, 'out1', pi6, 'in1', label='9')
c10 = Connection(pi6, 'out1', cooler, 'in1', label='10')
c11 = Connection(cooler, 'out1', pi1, 'in1', label='11')
# add connections to network
nw.add_conns(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12)
# power bus
power = Bus('total output power')
power.add_comps({'comp': turb, 'char': 1, 'base': 'component'},
{'comp': cp1, 'char': 1, 'base': 'bus'})
heat_input_bus = Bus('heat input')
heat_input_bus.add_comps({'comp': heater, 'base': 'bus'})
nw.add_busses(power, heat_input_bus)
# connection parameters
power.set_attr(P=-10.0e6)
c1.set_attr(p=7.7, T=34+273.15, fluid={'CO2': 1})
c2.set_attr(p=27)
c6.set_attr(T=530+273.15)
cp1.set_attr(eta_s=0.82)
rec1.set_attr(ttd_l=10, pr1=0.98, pr2=0.98)
heater.set_attr(pr=0.98)
cooler.set_attr(pr=0.98)
turb.set_attr(eta_s=0.85)
pi1.set_attr(pr=0.97)
pi2.set_attr(pr=0.97)
pi3.set_attr(pr=0.97)
pi4.set_attr(pr=0.97)
pi5.set_attr(pr=0.97)
pi6.set_attr(pr=0.97)
nw.solve(mode='design')
nw.print_results() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Silencesy99, now I do think I understand better, what you were trying to do. Your idea is correct and the code looks good (it works on my machine and the outcome does what you want, doesnt it?). The pressures all have the 3 % change in your "pipe" components:
If appart from the pressure loss you want to have heat losses (change in enthalpy) you could uses Best Francesco |
Beta Was this translation helpful? Give feedback.
Hi @Silencesy99,
now I do think I understand better, what you were trying to do. Your idea is correct and the code looks good (it works on my machine and the outcome does what you want, doesnt it?). The pressures all have the 3 % change in your "pipe" components: