v0.7

Changelog of the v0.7 release series.

v0.7.9 - Newton’s Nature (March, 02, 2025)

New Features

  • Implement a new property for connections to report the phase of the fluid, i.e. "l" for liquid, "tp" for two-phase and "g" for gaseous. The phase is only reported in subcritical pressure (PR #592).

  • Implement the Baumann correlation for wet expansion in steamturbines. The feature is available in a new component class, tespy.components.turbomachinery.steam_turbine.SteamTurbine. To use the feature check the documentation of the component class (PR #602).

  • Implement a new component class tespy.components.heat_exchangers.movingboundary.MovingBoundaryHeatExchanger, which allows to make specification of internal pinch temperature difference in case of heat exchanger internal phase changes on the hot or the cold side of the component. It splits the heat exchange automatically in sections, where in each section the phase of the hot and the cold fluid does not change. These sections are utilized to find the minimum pinch internally, and allow to assign heat transfer coefficients UA for all individual sections as well as the total sum (PR #515).

Bug Fixes

  • Run the postprocessing only for a converged solution. Otherwise specified values on buses, components or connections may change to nonsense, because the calculation is based on not-converged results of the variables (PR #609).

  • Fix the fuel cell example and make sure it is tested properly (PR #618).

Contributors

v0.7.8.post2 - Newton’s Nature (December, 29, 2024)

Bug Fixes

  • Fixed a bug in post processing of the ttd_min parameter of HeatExchangers (PR #587).

Contributors

v0.7.8.post1 - Newton’s Nature (December, 06, 2024)

Bug Fixes

  • Fixed a too low upper value boundary for the new dp parameter.

Contributors

v0.7.8 - Newton’s Nature (December, 04, 2024)

New Features

  • The HeatExchanger class now has three new attributes, dp1, dp2 (hot side and cold side pressure drop in network pressure unit) as well as ttd_min for the minimal value of the terminal temperature difference values (PR #581).

Contributors

v0.7.7 - Newton’s Nature (October, 27, 2024)

Bug Fixes

  • Only .json format files are loaded by the load_network method. Furthermore, it is checked whether a file is represented by a class available in the namespace via the @component_registry decorator (PR #536).

  • Fixed a typo in the Jacobian of the hot side and cold side HeatExchanger effectiveness.

Other Changes

  • Make the reset_topology_reduction_specifications method of the Network class a public method (PR #559).

  • Components of class SimpleHeatExchanger need explicit specification of the dissipative attribute in the next major version of tespy in context of the exergy analysis (PR #563).

Documentation

  • Update deprecated information on the indices of variables in the Jacobian of a UserDefinedEquation (PR #552).

  • A note has been added, that the component and connection labels in subsystems should be made unique. On top of that, most of the components module docs isn now testable (PR #553).

Contributors

v0.7.6.post1 - Newton’s Nature (August, 02, 2024)

This is a post release for version 0.7.6 to fix a bug in the postprocessing of the HeatExchanger classes.

Bug Fixes

  • An exception is caught in the heat exchanger post processing, in case the heat exchanger effectiveness cannot be calculated when hot side or cold side inlet temperature value are out of bounds of the fluid properties for the other side respectively (PR #533).

Contributors

v0.7.6 - Newton’s Nature (July, 31, 2024)

New Features

  • Implement new equations for the heat exchanger, i.e. effectiveness parameter. The parameter can be specified for the hot side eff_hot or the cold side eff_cold of the heat exchanger. Additionally, it is possible to specify the maximum value of both with eff_max if it is unknown, which one of them will be the larger one (PR #529).

Bug Fixes

  • The enthalpy numerical precision criterion for mixtures is relaxed: Mixture fluid property results (temperature, volume, entropy, …) are only invalidated, if both absolute and relative precision is not acquired. Previously, the enthalpy of the mixture, calculated with the temperature calculated based on the enthalpy determined by the solver had to be within 1e-3 of the enthalpy determined by the solver (PR #529).

Bug Fixes

  • Fix the logging text for component parameter value violation in the postprocessing (PR #529).

Contributors

v0.7.5 - Newton’s Nature (July, 8, 2024)

Documentation

  • The Rankine cycle example has been adopted to integrate a T-s diagram of the process into the results (PR #514).

  • A bug in the results plot of the gas turbine example has been fixed (PR #522).

Other Features

  • More isolines are now available for the drum (PR #521).

Other Changes

  • Remove unused features in the github workflows and tox testing (PR #523).

  • Simplify dependency installation readthedocs builds (PR #524).

  • Update various parts of the source code to implement more maintainer-friendly features (PR #525).

  • Create numpy 2.0 compatibility (PR #527).

Contributors

v0.7.4 - Newton’s Nature (April, 30, 2024)

Bug Fixes

  • Component and FluidWrapper objects are now available for the load_network function via the @component_registry and @wrapper_registry decorators. E.g. if you are using custom components you can decorate them with the @component_registry and the load a Network with those components without needing to adjust the source code of the load_network function (PR #510).

    >>> from tespy.components.component import component_registry
    >>> from tespy.components import Source, Sink, SimpleHeatExchanger
    >>> from tespy.connections import Connection
    >>> from tespy.networks import Network
    
    >>> @component_registry
    ... class MyComponent(SimpleHeatExchanger):
    ...     pass
    
    >>> c = component_registry.items["MyComponent"]("I am a component")
    >>> c.label
    'I am a component'
    
    >>> nwk = Network()
    >>> c1 = Connection(Source("source"), "out1", c, "in1", label="1")
    >>> c2 = Connection(c, "out1", Sink("sink"), "in1", label="2")
    >>> nwk.add_conns(c1, c2)
    >>> _ = nwk.export("exported_nwk.json")
    >>> nwk = Network.from_json("exported_nwk.json")
    >>> nwk.comps.loc["I am a component", "comp_type"]
    'MyComponent'
    

Contributors

v0.7.3 - Newton’s Nature (April, 15, 2024)

This is a release with some minor fixes and adjustments in styling. The most relevant change is the exposure of the UserDefinedEquation class to the tespy.tools import level.

Contributors

v0.7.1 - Newton’s Nature (January, 21, 2024)

Bug Fixes

  • The delta value of the tespy.connections.connection.Ref class was oriented with the wrong sign. A positive delta lead to a negative value. Fixed in (PR #459).

  • In initial simulations the temperature value of mixtures is 0 by default. For calculating temperatures of the mixtures during that initial simulation, that value was used as starting value causing CoolProp to raise an error and the calculation to crash. This is now prevented by checking if the starting value is reasonable or not (PR #477).

Contributors

v0.7.1 - Newton’s Nature (December, 2, 2023)

Bug Fixes

  • Several bugs introduced by the restructuring of the package in version 0.7.0 have been fixed:

Contributors

v0.7.0 - Newton’s Nature (October, 11, 2023)

For version 0.7.0 TESPy has undergone a large refactoring of its back end:

New Features

Fluid Properties

The implementation of the fluid property back end was modularized and is now much more flexible. The most notable new features are:

  • It is possible to use the same fluid name with different fluid property back ends in different parts of a single network, e.g. in a Rankine Cycle the main cycle can be calculated using standard water fluid properties and in the cooling cycle water may be used as incompressible medium.

  • CoolProp’s binary incompressible mixtures are now supported.

  • The user can implement their own fluid property equations or toolboxes by masquerading the calls in a standard API inheriting from the new FluidPropertyWrapper class. CoolProp remains the standard back end, but you may also use other back ends with this feature.

  • Similarly, the mixture model can be exchanged by implementing custom mixing rules for fluid mixtures.

  • It is not necessary anymore, to specify the full fluid vector if the sum of all fixed fluid mass fractions is equal to 1, e.g. if the old specification was fluid={"H2O": 1, "Air": 0} you can now specify fluid={"H2O": 1}. The list of fluids is passed to the Network class anymore, Network(fluids["H2O", "Air"]) becomes Network().

Performance Improvements

Several performance improvements have been made:

  • Primary variables are not strictly tied to all connections anymore:

    • Any directly specified value removes the respective variable from the system’s variables. For example, a user specified pressure value was part of the system’s variables previously but not touched in the Newton iterations. Now the variable is directly eliminated effectively reducing the size of the problem. The same is true for all variables, i.e. mass flow, pressure, enthalpy and fluid mass fractions.

    • If combinations of pressure and temperature, vapor quality or similar are specified on a single connection, the pressure and enthalpy are pre-solved if feasible eliminating them from the variable space and eliminating the respective (e.g. temperature) equation from the equations.

    • The plant is subdivided into two types of branches:

      1. Branches with a single mass flow (connections related to each other in a way, that their mass flow must be the same). Here the variable space is reduced to a single mass flow variable.

      2. Branches with identical fluid composition (similar to mass flows, but e.g. splitters, drums, droplet separators do not change the fluid composition as well) can also only have a single fluid vector as a variable and not one per connection.

  • Together with the above changes all partial derivatives now only need to be calculated, in case a mass flow, pressure, enthalpy or the fluid mass fraction is a system variable.

General Improvements

The code has been simplified and clean up in a lot of places to improve readability and maintenance.

Breaking Changes

The release introduces two (known) breaking changes:

  • The structure for saved network states has changed to the minimum necessary export. Connections only need their label, their parameter values and the respective units. For that reason, the export of networks to import them at a different place using the load_network functionality has changed as well. If you want to export a network to load it again, you have to use the export method instead of the save method of the network.

  • Support for older Python versions (smaller than 3.9) has been dropped.

Contributors