A small finding in TESPy Network Class and improvement suggestions #359
-
Hi! I'm a new user of TESPy and still learning. I found this small issue and would like to share with the community. In the Network Class, it is possible to view the network connections and components by calling the The example I'm using is a simple condenser cooled by air, same as in the Condenser example code in tespy.readthedocs: from tespy.networks import Network
from tespy.components import Source, Sink, Condenser
from tespy.connections import Connection
# create a network and components
nw = Network(fluids=['water', 'air'], T_unit='C', p_unit='bar', h_unit='kJ / kg')
air_in = Source(label='air inlet')
air_out = Sink('air outlet')
waste_steam = Source('waste steam')
water = Sink('condensate water')
condenser = Condenser('condenser')
# create connections
air_con = Connection(air_in, 'out1', condenser, 'in2', label='air to condenser')
con_air = Connection(condenser, 'out2', air_out, 'in1', label='condenser to air')
ws_con = Connection(waste_steam, 'out1', condenser, 'in1', label='ws to con')
con_water = Connection(condenser, 'out1', water, 'in1')
nw.add_conns(air_con, con_air, ws_con, con_water) When calling the Correspondingly, the After looking into the source code of Network, it is found that the comps = pd.unique(self.conns[['source', 'target']].values.ravel())
# build the dataframe for components After running It is therefore suggested to initiate the Another attached question is under the example code of Condenser in readthedocs, why the air inlet is Sink and air outlet is Source? amb_in = Sink('ambient air inlet')
amb_out = Source('air outlet') Based on the definition of Source and Sink, should it be like air inlet is Source and air outlet is Sink? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This had been resolved by a previous PR #362 |
Beta Was this translation helpful? Give feedback.
This had been resolved by a previous PR #362