-
Hello everyone. I'm new to tespy. I tried to run a simple model with one turbine and condenser. However, it seems that it has a problem calculating the saturation temperature of CO2 at 60 bar. I created the same model with DWSIM set by Coolprop, and everything was ok. I insert this simple code below and hope that you help me figure out how to fix it. from tespy.components import Sink, Source, Turbine, SimpleHeatExchanger, Compressor
from tespy.connections import Connection
from tespy.networks import Network
nw = Network(p_unit='bar', T_unit='C', h_unit='kJ / kg', iterinfo=False)
si = Sink('sink')
so = Source('source')
tu = Turbine('turbine')
con = SimpleHeatExchanger('condenser')
so_tu = Connection(so, 'out1', tu, 'in1')
tu_con = Connection(tu, 'out1', con, 'in1')
con_si = Connection(con, 'out1', si, 'in1')
nw.add_conns(so_tu, tu_con, con_si)
so_tu.set_attr(fluid={'CO2': 1}, m=10, T=150, p=160)
tu.set_attr(eta_s=0.9)
tu_con.set_attr(p=60)
con.set_attr(pr=1)
con_si.set_attr(x=0)
nw.solve('design')
nw.print_results() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! If the solver does not have any starting values (either from previous calculation or specified by the user), then tespy has to guess something. It is not very intelligent at doing it for all kinds of different fluids etc. (basically as a developer of the software you have to have in mind, that you provide all the components and the functionalities but without knowing what fluids people are going to use or what cycles they will build). In that sense: It really helps to provide starting values, pressure guess at outlet condenser in this case: con_si.set_attr(x=0, p0=60) Best |
Beta Was this translation helpful? Give feedback.
Hi!
If the solver does not have any starting values (either from previous calculation or specified by the user), then tespy has to guess something. It is not very intelligent at doing it for all kinds of different fluids etc. (basically as a developer of the software you have to have in mind, that you provide all the components and the functionalities but without knowing what fluids people are going to use or what cycles they will build). In that sense: It really helps to provide starting values, pressure guess at outlet condenser in this case:
Best