|
Hello, I find a code on github (https://github.com/oemof/heat-pump-tutorial/blob/main/heat-pump-partload-tespy.ipynb) but I am trying to modify it to make it with specific values and other working fluid. But when I am trying for CO2 in a supercritical state I have errors, I try to look at exemple and other discussion about the use of sCO2, but I have difficulties to understand how it work and need a hand to help me. Here is the beginning of the code where I have the first error : from tespy.components import Condenser, HeatExchanger, CycleCloser, Compressor, Valve, Source, Sink
from tespy.connections import Connection, Ref
from tespy.networks import Network
wf = "R744"
nwk = Network(iterinfo=False)
nwk.units.set_defaults(
pressure="bar",
temperature="°C",
pressure_difference="bar"
)
cp = Compressor("compressor")
ev = HeatExchanger("evaporator")
cd = Condenser("condenser")
va = Valve("expansion valve")
cc = CycleCloser("cycle closer")
so1 = Source("geothermal heat source")
si1 = Sink("geothermal heat sink")
so2 = Source("heating source")
si2 = Sink("heating sink")
c0 = Connection(va, "out1", cc, "in1", label="0")
c1 = Connection(cc, "out1", ev, "in2", label="1")
c2 = Connection(ev, "out2", cp, "in1", label="2")
c3 = Connection(cp, "out1", cd, "in1", label="3")
c4 = Connection(cd, "out1", va, "in1", label="4")
nwk.add_conns(c0, c1, c2, c3, c4)
c11 = Connection(so1, "out1", ev, "in1", label="11")
c12 = Connection(ev, "out1", si1, "in1", label="12")
c21 = Connection(so2, "out1", cd, "in2", label="21")
c22 = Connection(cd, "out2", si2, "in1", label="22")
nwk.add_conns(c11, c12, c21, c22)
# connections
c2.set_attr(T=1.6)
c4.set_attr(T=45)
# components
Q_design = -1770e3
cp.set_attr(eta_s=0.675)
cd.set_attr(Q=Q_design)
# connections
T_ambient_design = 5.6
c2.set_attr(fluid={wf: 1}, x=1.0)
c11.set_attr(fluid={"Water": 0.7, "Ethanol": 0.3}, p=1.6, T=T_ambient_design)
c12.set_attr(T=3.3 )
c21.set_attr(fluid={"Water": 1}, p=3.4, T=35.6)
c22.set_attr(T=41.8)
# components
cd.set_attr(pr1=0.98, pr2=0.98)
ev.set_attr(pr1=0.98, pr2=0.98)
nwk.solve("design")
nwk.print_results() |
Replies: 1 comment 1 reply
|
Hi @WinniEsz, thank you for reaching out. There are two issues in your code:
|
Hi @WinniEsz,
thank you for reaching out. There are two issues in your code:
The mixture of water and ethanol is not supported by tespy in the way you want it. To use such a mixture there are two options:
fluid={"INCOMP::MEA[0.3]|mass": 1}fluid={"Water[0.7]&Ethanol[0.3]|mass": 1}. This is only required if you need flash calculations, and is very slow compared to the imcompressible variant.You are trying to use a
Condensercomponent for a fluid which is in supercritical state. TheCondenserimposes liquid saturated state at the hot side outlet, which is impossible for a supercri…