oemof / tespy

Thermal Engineering Systems in Python (TESPy). This package provides a powerful simulation toolkit for thermal engineering plants such as power plants, district heating systems or heat pumps.
https://tespy.readthedocs.io
MIT License
256 stars 80 forks source link

Tespy condensing separated gas from Dropletseparator in Condenser #426

Closed evaporr closed 1 year ago

evaporr commented 1 year ago

Hello everyone,

I want to simulate a circuit where a fluid with liquid and gas phase flows into a droplet separator so that the gas is separated from the liquid phase. Then the separated gas should be condensed in a condenser to the liquid state (see circuit diagram). Unfortunately the properties of the gas do not change in my latest simulation.

image

The printout shows no change in temperature, pressure and enthalpy between the inlet of the condenser (connection "steam_out" (3)) and the outlet (connection "fluid_out" (4)). I would assume that the enthalpy or the temperature of the gas changes as it passes through the condenser. Can anyone help me to get the gas condensed correctly in my circuit?

Thanks and best regards!

from tespy.components import Sink, Condenser, Source, HeatExchangerSimple, Valve, DropletSeparator
from tespy.connections import Connection, Bus
from tespy.networks import Network
from fluprodia import FluidPropertyDiagram
import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
import numpy as np

nw = Network(fluids=['water'],
             T_unit='C', p_unit='bar', h_unit='kJ / kg', s_unit='J / kgK')

#Define components
source_sw = Source('seawater source')
source_hw = Source('steam source')
con = Condenser('condenser')
sink_cw = Sink('sink cooling water Condenser')
sink_fluid = Sink('sink fluid')
heater = HeatExchangerSimple('Heater Seawater')
ev = Valve('Evaporator')
ds = DropletSeparator('DropletSep')
sink_brine = Sink('Sink Brine')

#Add Connections
cw_con_in = Connection(source_sw, 'out1', con, 'in2', label = '0')
cw_con_out = Connection(con, 'out2', sink_cw, 'in1', label = '1')
ev_out = Connection(source_hw, 'out1', ds, 'in1', label = '2')
steam_out = Connection(ds, 'out1', con, 'in1', label = '3')
fluid_out = Connection(con, 'out1', sink_fluid, 'in1', label = '4')
brine_out = Connection (ds, 'out2', sink_brine, 'in1', label = '5')

nw.add_conns(cw_con_in, #0
             cw_con_out,#1
             ev_out,    #2
             steam_out, #3
             fluid_out, #4
             brine_out) #5

#Parametization connections
cw_con_in.set_attr(fluid={'water': 1}, T=20, p=10, m=100)
ev_out.set_attr(fluid={'water': 1}, h=2200, T=130)

#Parametization components
con.set_attr(pr1=0.99, pr2=0.99, ttd_u=80)

# Simulate
nw.solve(mode='design')
nw.print_results()