v0.1.1 (May, 14, 2019)#
New Features#
Specifcation of temperature below or above boiling point temperature with
Td_bp
keyword on connections (PR #64).Path specifications for the
init_path
anddesign_path
in the networks module as well aspath
in the network_reader module now work with relative and absolute paths. The feature has been tested on windows and linux machines (PR #66).
Documentation#
Updated “Using TESPy” according to the new features, you can find an Example for the usage of the
Td_bp
and thestate
keyword at the bottom of this release message.
Parameter renaming#
Testing#
Tests and doctests have been adjusted and updated to test the new features.
Added software tests for OS X (PR #68), windows tests to follow.
Bug fixes#
Other changes#
Modified printouts of connection properties for
network.print_results()
-function (668ca6)Changed access to imported network’s connections (
mynetwork.imp_conns['{source}:{source id}_{target}:{target id}']
, replace{...}
by the respectve component or id). (a5a867).Improved convergence stability for temperatures specified near to the two phase area using the keyowrd
state='l'
(for liquid) orstate='g'
(for gaseous). The convergence check manipulates the enthalpy values at this connection in order to meet the phase specification (PR #64).
Example#
from tespy import cmp, con, nwk
import numpy as np
# network
fluid_list = ['NH3', 'water']
nw = nwk.network(fluids=fluid_list, T_unit='C', p_unit='bar', h_unit='kJ / kg')
# components
tesin = cmp.sink('TES in')
tesout = cmp.source('TES out')
hsin = cmp.sink('HS in')
hsout = cmp.source('HS out')
he = cmp.heat_exchanger('heat exchanger')
# connection
tes_he = con.connection(tesout, 'out1', he, 'in2')
he_tes = con.connection(he, 'out2', tesin, 'in1')
hs_he = con.connection(hsout, 'out1', he, 'in1')
he_hs = con.connection(he, 'out1', hsin, 'in1')
nw.add_conns(tes_he, he_tes, hs_he, he_hs)
# heat exchanger parameters
he.set_attr(pr1=0.98, pr2=0.98, ttd_u=42, Q=-90e3)
# hot side parameters
hs_he.set_attr(T=70, p=9.4, fluid={'NH3': 1, 'water': 0})
he_hs.set_attr(T=35)
# cold side inlet
tes_he.set_attr(T=18, p=5, fluid={'NH3': 0, 'water': 1})
# solve
nw.solve('design')
fill = '############################################################'
print(fill)
print('See, the calculation did not work: The temperature value for the '
'hot side outlet is near to the two phase region. A singularity '
'appears in the solution process, as the temperature equation\'s '
'derivative towards enthalpy will be zero in this region.')
print(fill)
## let's retry with state keyword (state should be gaseous)
he_hs.set_attr(state='g')
nw.solve('design')
nw.print_results()
print(fill)
print('The state keyword prevents the fluids state at the hot side outlet '
'from going into two phase region, a solution is found.')
print(fill)
# so how does the superheating or subcooling work?
# remove state and temperature specification, add superheating specification
# temperature difference to boiling point = 10 K
he_hs.set_attr(state=np.nan, T=np.nan, Td_bp=10)
nw.solve('design')
nw.print_results()
print(fill)
print('The temperature at hot side outlet is 10 K above the (prior) unkown '
'boiling point temperature at that point.')
print(fill)
Contributors#
Francesco Witte
Shuang Chen