v0.1¶
Changelog of the v0.1 release series.
v0.1.4 (December, 12, 2019)¶
New Features¶
Implemented difference pressure vs mass flow characteristic line for valve (c4eec6d).
Documentation¶
Fix typos in docstrings in components module (PR #102).
Parameter renaming¶
Testing¶
Bug fixes¶
Other changes¶
This is the last release before version 0.2.0.
Contributors¶
Francesco Witte
v0.1.3 (November, 6, 2019)¶
New Features¶
Individual design path specification is available: Specify the design_path individually for single connections or a components in your network, if you want the individual design parameters be loaded from a different design case than the network’s design case given in the network’s design path (PR #84).
Implement local design and local offdesign features: It is possible to design a plant while some parts of the plant are in offdesign mode. This is useful, e.g. when designing an extraction turbine, where the district heating condenser is designed for maximum extraction and the backpressure turbine is designed for minimum extraction (PR #92).
Implement warning messages for all components, if the component’s properties are out of physical bounds. The bounds can be customized when specifying a property by data containers (read more at component parameter specification), (PR #85).
Documentation¶
Parameter renaming¶
Testing¶
Bug fixes¶
Offdesign values for connections are specified from the design case files (PR #84). Before, the offdesign values were the actual values of the fluid property in the last calculation (which is not necessarily the design case).
Add debug logging message, if the enthalpy is adjusted on connections with the keyword
statespecified (PR #85).
Other changes¶
Improved calculation speed for fluid mixture properties with the parameter T0 as starting value for root finding (PR #84).
Contributors¶
Francesco Witte
v0.1.2 (August, 6, 2019)¶
New Features¶
The water electrolyzer is available as new component of TESPy (PR #73).
The components
combustion chamber <tespy.components.components.base>andcogeneration unit <tespy.components.components.cogeneration_unit>now work with fuel mixtures, too. Specification of the component’s fuel is not required anymore, the software automatically detects, which fuels are connected to the component’s inlets. Available fuels are: methane, ethane, propane, butane and hydrogen (PR #79).Add busses to the
network's result printout <tespy.networks.network.print_results>.
Documentation¶
Parameter renaming¶
Testing¶
Bug fixes¶
Fix convergence check for negative minimum enthalpy values (PR #71).
Add an error message if the user did not add any connections to the network (PR #79).
Fix loading bus information from design-case .csv-file. Components can be attached to multiple busses now (PR #79).
Fix solar collector energy balance equation and adjust documentation (PR #83).
Other changes¶
Water Electrolyzer Example¶
from tespy import cmp, con, nwk
fluid_list = ['O2', 'H2O', 'H2']
nw = nwk.network(fluids=fluid_list, T_unit='C', p_unit='bar')
# sinks and sources
fw = cmp.source('feed water')
oxy = cmp.sink('oxygen sink')
hydro = cmp.sink('hydrogen sink')
cw = cmp.source('cooling water')
cw_hot = cmp.sink('cooling water out')
# specification of electrolysis efficiency
el = cmp.water_electrolyzer('electrolyzer 1', eta=0.8, design=['eta'], offdesign=['eta_char'])
# hydrogen compression
comp = cmp.compressor('compressor', eta_s=0.9)
# specify the feed water mass flow
# the fluid composition at the feed water inlet and the oxygen as well as
# hydrogen outlets are not required. These parameters are set automatically.
fw_el = con.connection(fw, 'out1', el, 'in2', m=0.1, p=10, T=15)
el_o = con.connection(el, 'out2', oxy, 'in1')
el_cmp = con.connection(el, 'out3', comp, 'in1', T=50)
cmp_h = con.connection(comp, 'out1', hydro, 'in1', p=50)
# cooling water specifications
cw_el = con.connection(cw, 'out1', el, 'in1', fluid={'H2O': 1, 'H2': 0, 'O2': 0}, p=5, T=15)
el_cw = con.connection(el, 'out1', cw_hot, 'in1', T=45, p=4.9)
nw.add_conns(fw_el, el_o, el_cmp, cmp_h, cw_el, el_cw)
# solve design case
nw.solve('design')
nw.save('tmp')
# test offdesign case
nw.solve('offdesign', design_path='tmp')
# change feed water flow and recalculate operation
fw_el.set_attr(m=0.05)
nw.solve('offdesign', design_path='tmp')
Contributors¶
Francesco Witte
Tim Hoener, Nils Stolze, Markus Brandt
v0.1.1 (May, 14, 2019)¶
New Features¶
Specification of temperature below or above boiling point temperature with
Td_bpkeyword on connections (PR #64).Path specifications for the
init_pathanddesign_pathin the networks module as well aspathin 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_bpand thestatekeyword 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) unknown '
'boiling point temperature at that point.')
print(fill)
Contributors¶
Francesco Witte
Shuang Chen
v0.1.0 (February, 2, 2019)¶
New Features¶
Added new component node and modified equations for simple heat exchangers to work with negative mass flows. The node component is able to switch between merge and splitter equations according to the directions of the mass flows. Please beware, that the amount of the equations of a splitter and a merge is not the same, thus the number of equations provided by the node depend on the flow direction and may change within the calculation process. In order to make use of the node, a network should always contain more than one node, so that a different node can compensate a possible change in flow direction (PR #43).
Added examples for components, busses, connections etc. in the docstrings. You will find the examples in either your editors help pane or the online documentation of the API (PR #45).
Added an interface attribute for sinks and sources changing the component type from sink/source to subsys_interface when exporting the network, if you specify
interface=Truefor these type of components. This way, you can reimport the saved network and connect it to a different network. Also imported components, connections and busses are easily accessible by their label (components/busses) or their target with target id (connections). For an example, see the module documentationtespy.network_reader. (PR #46).Added logging (console and log-file), see how to use it (PR #51).
Documentation¶
Adapted documentation and examples in regard of new features. Examples have been moved to the oemof-examples repository.
Improved consistency in documentation of all modules (PR #45).
Registered a DOI for TESPy version 0.1.0.
Parameter renaming¶
networks
init_file -> init_path
design_file -> design_path
structure -> deprecated: Providing
structure=Trueon saving the network is not required anymore, the network structure is exported automatically.
Note
The initialisation method and handling of design and offdesign calculations has been adjusted. In future, please specify the path to the folder, where your results have been saved, e.g.:
mynetwork.save('path/to/folder')
mynetwork.solve('offdesign', design_path='path/to/folder', init_path='path/to/folder')
Testing¶
The examples in the docstrings are used as doctests.
Component tests have been implemented.
General tests for errors, printouts and fluid properties have been implemented.
Benchmark test for a heat pump model (still to be improved, see inline comments).
Testcoverage will be checked for every PR in the future!
See PR #52.
Bug fixes¶
Adjusted network export and network import to work for grouped component properties and characteristic maps (PR #46).
Redesigned pre- and postprocessing of component properties as some errors occurred before. Design parameters are now always gathered from the component .csv-file containing the design point information (saved design state of the network) (PR #50).
Other changes¶
Improved calculation speed by swapping the CoolProp.CoolProp.PropsSI-calls with CoolProp.AbstractState calls (PR #49).
Contributors¶
Francesco Witte