v0.9¶
Changelog of the v0.9 release series.
v0.9.16 - Kelvin’s Kingdom (April, 27, 2026)¶
New features¶
There is a new type of connection,
HAConnection, which utilizes the HAPropsSI functionalities of CoolProp. The feature is still in experimental stage, go and check it out in the example on this page (PR #940).
Other Changes¶
Improve convergence behavior of
UAandkArelated equations ofHeatExchangerclasses (PR #953).Implement a method to catch all-zero entries in rows of the Jacobian to continue iterations (PR #955).
Remove under-stoichiometric combustion due to numerical issues with hydrogen (PR #957). UPDATE: The fix has been reverted and a better solutions was implemented: (94063d3).
Bug Fixes¶
UPDATE post3: The temperature starting value guess for referenced temperature specifications was originally updated before updating all guess values for all connections. This could lead to doing a guess for one conneciton, while the referenced connection did not have that update yet (3d99318).
Contributors¶
v0.9.15 - Kelvin’s Kingdom (April, 18, 2026)¶
New Features¶
A draft for a high-level
tespy.modelclass is available:ModelTemplate. The class provides some interfacing and orchestration methods to make sensitivity analysis, cycle plotting and optimization easier. For examples on how to use it please check the Integration and Optimization tutorials (PR #944).The API for
OptimizationProblemchanged from nested type dictionary specification to flat type dictionary specification and is fully compatible to the newModelTemplateclass. We strongly recommend to use it together with :code:`ModelTemplate` in the future. The optimization tutorial has been revised accordingly (PR #944).
Other Changes¶
The
set_attrmethods ofComponentandConnectiontype classes have been refactored for improved readability and maintainability. The responsibility for the value checks now lies in separate methods, which are handled by the respective data containers (PR #936).The
set_attrmethod ofNetworkclass has been deprecated, now all the attributes need to be directly assigned in the future (PR #939).TESPy now exports
'vol'as key for specific volume in context of data transfer to fluprodia for cycle plots. fluprodia version 4.1 will align with the TESPy unit and naming schemes (PR #941).There now is a quantity for
pressure_differenceseparate from thepressurequantity. You will need to specify them individually in the future (PR #942).T_dewandT_bubbleare now also available as outputs parameters of the connection post-processing (PR #944).It is possible to set or unset a
UserDefinedEquationwithout needing to remove and add it again to aNetwork, check the example in the respective section of the docs (PR #944).HeatExchangerclass type components now also have thecalc_sectionsmethod to make QT diagrams in the same structure as available inSectionedHeatExchanger(PR #944).Improve performance for passing data to the
Network.resultsdataframes (PR #944).
Bug Fixes¶
Fixed a bug, which prevented reading the correct information for the connections adjacent to a component in
local_offdesign=Truemode in a design simulation or with an individualdesign_pathin an offdesign simulation (PR #943).Fixed a bug that prevented derivative calculation for volumetric flow of gas mixtures and the postprocessing of valve type components (PR #949).
Contributors¶
Francesco Witte (@fwitte)
Konstantinos Papanikandros
v0.9.14 - Kelvin’s Kingdom (April, 7, 2026)¶
Bug Fixes¶
When setting a Ref for a temperature, the starting value for enthalpy of the connection with the Ref specified is updated in preprocessing (PR #921).
When loading a
Networkfrom its serialized form theis_varinformation of component properties being a variable was missing (PR #932).For component characteristic maps the default if no map is found in the
tespy.datamodule was aCharLineby accident. This was a silent error because if not used, it did not do any trouble. Only when importing aNetworkand reconstructing the component parameters theCharMapcould not be constructed successfully because it was missing dimensions (PR #933).The reactor classes
FuelCellandWaterElectrolyzerwere missing the implementation for aPowerConnection(PR #934).
Other Changes¶
A
CITATION.cfffile is available to reference the GitHub repository (PR #917).You can now specify the flow speed at the inlet of pipes (PR #924).
It is now possible to specify the efficiency of class
Pumpbased on flow work (\(v\cdot \int dp\)) next to isentropic efficiency (PR #927).The
SectionedHeatExchangerandMovingBoundaryHeatExchangernow can utilize theUA_charas offdesign parameter. It utilizes the characteristickA_charlines of the standard heat exchangers to evaluate the change ofUAtoUA_designas function of mass flow. It is similar to theUA_cecchinatomethod, but does not need the specification of Reynolds exponents, area or alpha ratios (PR #928).
Contributors¶
Francesco Witte (@fwitte)
v0.9.13 - Kelvin’s Kingdom (March, 5, 2026)¶
New Features¶
The
Valveclass now has flow coefficientKvequations implemented. You can either specify theKvvalue directly, specify aKv_charwith anopeningwhich does a value lookup ofKvas function of theopeningor you can provide a custom function, which takes theopeningand a set of custom parameters that will be called by the equation (PR #891).It is now possible to dynamically add missing combustion fluids to your model by importing
COMBUSTION_FLUIDSfrom thetespy.toolsmodule and adding the respective information (fluid name, LHV and/or enthalpy of formation). For an example check out the docs:tespy.components.combustion.base.CombustionChamber(PR #770).The
Pumpclass now implements hydraulic head over flow and frequency as well as efficiency over flow and frequency characteristic maps. For an example check out the docs:tespy.components.turbomachinery.pump.Pump(PR #911)You can skip the complete postprocessing of components and connections after solving a model. This can speed up the calculations quite significantly and might be useful, if you are executing many simulations and you are not interested in all results and internal validations (value checks of the results to identify negative pinches, efficiencies larger than 1 etc.) (PR #907).
Other Changes¶
Characteristic map extrapolation is possible by providing the keyword
extrapolate=Truewhen creating the map.
Contributors¶
Francesco Witte (@fwitte)
v0.9.12 - Kelvin’s Kingdom (January, 24, 2026)¶
New Features¶
Custom fluid property wrappers can now receive arbitrary
kwargsmaking injection of information for the underlying property models much easier. Check the section on the incompressible fluid properties (PR #877).There is a new
FluidPropertyWrapperfor incompressible fluids such as thermo-oils, which you can pass measurement or manufacturer data to. TheIncompressibleFluidWrapperwill automatically fit functions to the data points you provide:heat capacity and density: linear interpolation \(f\left(T\right) = A + B \cdot T\).
viscosity: exponential polynomial equation \(\eta\left(T\right) = e ^ {\frac{A}{T ^ 3} + \frac{B}{T ^ 2} + \frac{C}{T} + D}\)
For an example in a TESPy model see this section (PR #878).
Other changes¶
The optimization API has changed to integrate
pymooinstead ofPyGMO. This change was done, becausePyGMOrequired conda to be installed on Windows, and the latest installable version available with pip for Linux based systems was broken.Very few changes have to be made to utilize
pymoocompared to the original implementation withPyGMO, which only concernspecifying the population,
selecting the algorithm and
running the optimization.
Old variant:
algo = pg.algorithm(pg.ihs(gen=num_gen, seed=42)) # create starting population pop = pg.population(pg.problem(optimize), size=num_ind, seed=42) optimize.run(algo, pop, num_ind, num_gen) results = optimize.individuals
New variant:
algorithm = DE(pop_size=20) res = minimize( problem, algorithm, termination=('n_gen', num_evo) ) results = problem.log
With the new implementation you also have more control on automatic termination of the optimization. For all information see the pymoo docs, and check out the tutorial to see, how to use
pymoo(PR #872).The logging of the optimization with pymoo now can keep track of additional kpi (PR #873).
Many methods of the
Networkclass, that are supposed to be private are now named appropriately with a leading underscore. On top, some methods have been renamed to clarify what they do (PR #875).The logging level of some messages has been changed from warning to debug (PR #893).
isentropic method for calculation of isentropic outlet enthalpy can now receive starting values for both inlet and outlet temperature in the context of gas mixtures (PR #896).
Bug Fixes¶
The starting points for fluid wrapper propagation now can handle classes that inherit from the starting point components. Before, they had to have the identical name because a class name comparison was done (PR #871).
Fix a bug in the specification of the relaxation factors that cause the pressure relaxation factor to overwrite the factors for all other variables (PR #875).
Contributors¶
Francesco Witte (@fwitte)
v0.9.11 - Kelvin’s Kingdom (December, 17, 2025)¶
Other changes¶
The documentation has been completely restructured to improve navigation. On top new tutorials on creating custom components and model debugging, a section on frequently asked questions and a more compact overview on the available component classes and the respective specification parameters with their underlying equations have been added (PR #820).
Bug Fixes¶
The moving boundary identification failed in some cases, when the phase change boundary was directly at the inlet or the outlet of a respective stream in the heat exchanger because brentq was to able to perform the root finding in that case (PR #865).
With the change of the scaling of the variables in context of the calculation of numerical derivatives, the identification of minimum and maximum enthalpy limits is now working as expected again (PR #867).
Contributors¶
Francesco Witte (@fwitte)
Malte Fritz (@maltefritz)
Jonas Freißmann (@jfreissmann)
v0.9.10 - Kelvin’s Kingdom (November, 30, 2025)¶
New Features¶
The
MovingBoundaryHeatExchangernow handles a pressure drop by assuming linear change of pressure with enthalpy. Furthermore, this capability is integrated into theSectionedHeatExchanger, which uses the specified number of sections and inserts the phase change boundaries additionally into its sections. With this theSectionedHeatExchangeralso identifies phase changes correctly (PR #851).
Other changes¶
Physical exergy evaluation: Introduced a robust, domain-safe fallback for cases where CoolProp cannot evaluate ambient-state properties
h(p0, T0)ors(p0, T0). When the ambient temperatureT0is below the FluidPropertyWrapper’s minimum supported temperature, TESPy now evaluates the reference state at the wrapper’sTmin(offset by1e-6 Kto avoid boundary issues) and calculates the physical exergy with respect to that temperature without exergy splitting (PR #828).Numerical derivative calculation is now done with a different delta for the central differences of the variables. Instead of having a fixed absolute delta, the delta is relative to size or absolute for variable values that are very close to zero (PR #851).
Bug Fixes¶
Contributors¶
v0.9.9 - Kelvin’s Kingdom (November, 7, 2025)¶
Other changes¶
The parsing/exporting a tespy model to exerpy has been included in the exerpy package in its latest release. Therefore the respective capabilities and methods are removed from tespy (PR #729).
Bug Fixes¶
Some component parameters were missing the quantity specification. This has been fixed (PR #823).
Some component equations were utilizing the
.valproperty inside some equations, leading to false results when these properties were specified in non-SI units (PR #832).Fix an issue with the
PolynomialCompressorWithCoolingin which the parametersdp_coolingandpr_coolingwhere missing the specification ofnum_eq_sets(PR #836).
Contributors¶
Francesco Witte (@fwitte)
v0.9.8 - Kelvin’s Kingdom (October, 17, 2025)¶
New Features¶
It is now possible the specify pressure indirectly by specifying the dew line or bubble line temperature of the fluid
T_deworT_bubble. Specifying any of these will precalculate the pressure in the preprocessing and set it as fixed value on the respective connection (PR #793).A new component
SectionedHeatExchangeris available. This component works similar to theMovingBoundaryHeatExchangerbut discretizes with a specific number of steps (user specified) over the enthalpy and linearly over the pressure drop. This allows you to integrate pressure drop in the UA and internal pinch calculation. For an example look up the component in the API documentation (PR #794).A new component
PolynomialCompressorWithCoolingis available. This component is an extension on thePolynomialCompressoradding a inflow and an outflow for a cooling fluid. Theeta_recoveryidentifies the share of heat transferred from the dissipated heat (based on thedissipation_ratio) of the refrigerant. Along with this a restructuring has taken place, and thePolynomialCompressorclasses now are located in thetespy.components.displacementmachinerymodule.Attention
With the components moving you now need to import the compressor specific setup methods for the polynomials calculations from the new module, e.g.:
>>> from tespy.components.displacementmachinery.polynomial_compressor import generate_eta_polys_from_data
(PR #804).
Other changes¶
Q_diss_relof thePolynomialCompressorclass has been renamed todissipation_ratio(PR #802).A nice new tutorial on the different types of heat exchangers is available (PR #798).
Parameter groups (e.g.
darcy_grouporUA_cecchinato) can now be specified to not be used in design or offdesign even when all elements of the group are set withoffdesign=["UA_cecchinato"](PR #812).It is now possible to desirialize a
Networkfrom a dictionary. For this you have to do the following:>>> from tespy.networks import Network >>> from tespy.components import Source, Sink >>> from tespy.connections import Connection >>> nw = Network() >>> c = Connection(Source("source"), "out1", Sink("sink"), "in1", label="c") >>> nw.add_conns(c) >>> serialization = nw.export() # you can save the serialization in a variable >>> new_nw = Network.from_dict(serialization)
(PR #816).
Bug Fixes¶
Contributors¶
Francesco Witte (@fwitte)
v0.9.7 - Kelvin’s Kingdom (September, 28, 2025)¶
New Features¶
A partload UA modification is available for the
MovingBoundaryHeatExchangerclass implementing the equation described in [5] (PR #752).There is a method to automatically extract all states and processes within a cycle to be passed to fluprodia. You can import the
get_plotting_datafrom thetespy.toolsmodule and then pass your Network object as well as a connection label of the cycle (the label of any connection within that cycle works) to retrieve the data required by fluprodia. Consider the example of a simple heat pump below:Show network setup code
>>> from tespy.networks import Network >>> from tespy.connections import Connection >>> from tespy.components import ( ... CycleCloser, MovingBoundaryHeatExchanger, Compressor, Valve, ... SimpleHeatExchanger, Source, Sink ... ) >>> nw = Network(iterinfo=False) >>> nw.units.set_defaults( ... temperature="°C", pressure="bar" ... ) >>> cp = Compressor("compressor") >>> cc = CycleCloser("cycle_closer") >>> cd = MovingBoundaryHeatExchanger("condenser") >>> va = Valve("expansion valve") >>> ev = SimpleHeatExchanger("evaporator") >>> so = Source("water source") >>> si = Sink("water sink") >>> c1 = Connection(cc, "out1", cd, "in1", label="c1") >>> c2 = Connection(cd, "out1", va, "in1", label="c2") >>> c3 = Connection(va, "out1", ev, "in1", label="c3") >>> c4 = Connection(ev, "out1", cp, "in1", label="c4") >>> c5 = Connection(cp, "out1", cc, "in1", label="c5") >>> nw.add_conns(c1, c2, c3, c4, c5) >>> a1 = Connection(so, "out1", cd, "in2", label="a1") >>> a2 = Connection(cd, "out2", si, "in1", label="a2") >>> nw.add_conns(a1, a2) >>> cd.set_attr(dp1=0, dp2=0, Q=-1e6) >>> ev.set_attr(dp=0) >>> cp.set_attr(eta_s=0.8) >>> c1.set_attr(fluid={"R290": 1}) >>> c2.set_attr(td_bubble=5, T=65) >>> c4.set_attr(td_dew=5, T=15) >>> a1.set_attr(fluid={"water": 1}, p=1, T=50) >>> a2.set_attr(T=65) >>> c2.set_attr(T=None) >>> cd.set_attr(td_pinch=5) # resolve with minimal pinch specification >>> nw.solve("design") >>> nw.assert_convergence()
Now you create the diagram:
>>> from fluprodia import FluidPropertyDiagram >>> import matplotlib.pyplot as plt >>> diagram = FluidPropertyDiagram("R290") >>> diagram.set_unit_system(units=nw.units) >>> diagram.set_isolines_subcritical(0, 120) >>> diagram.calc_isolines()
You can retrieve the process data and points from the mentioned method and then call the fluprodia method on it:
>>> from tespy.tools import get_plotting_data >>> processes, points = get_plotting_data(nw, "c1") >>> processes = { ... key: diagram.calc_individual_isoline(**value) ... for key, value in processes.items() ... if value is not None ... }
And then make the plot:
>>> fig, ax = plt.subplots(1) >>> diagram.draw_isolines(fig, ax, "Ts", 1000, 2750, 0, 120) >>> for label, values in processes.items(): ... _ = ax.plot(values["s"], values["T"], label=label, color="tab:red") >>> for label, point in points.items(): ... _ = ax.scatter(point["s"], point["T"], label=label, color="tab:red")
For visualization purpose, it is also possible to include the secondary sides of heat exchangers specifically in context of
Tsdiagrams!>>> from tespy.tools.plotting import get_heatexchanger_secondary_Ts >>> other_processes, other_points = get_heatexchanger_secondary_Ts(nw, "c1") >>> for data in other_processes.values(): ... for label, values in data.items(): ... _ = ax.plot(values["s"], values["T"], label=label, color="tab:blue") >>> for data in other_points.values(): ... for label, point in data.items(): ... _ = ax.scatter(point["s"], point["T"], label=label, color="tab:blue") >>> fig.savefig("process_Ts.svg", bbox_inches="tight")
(PR #785).
Bug Fixes¶
The printout of components included the units in the
Network.print_results()method. This was not intended and removed again. On top, all columns that, where all entries areNaNare removed as well (PR #782).Pint cache is not placed inside package installation anymore but inside
platforms.user_cache_dir(PR #787).
Contributors¶
Francesco Witte (@fwitte)
v0.9.6 - Kelvin’s Kingdom (September, 22, 2025)¶
New Features¶
There is a new component
ParallelFlowHeatExchangerimplementing parallel flow heat exchange, which works analogously to the counter current variantHeatExchanger(PR #766).
Bug Fixes¶
Calculation with humid air (water air mixtures) were broken for a state where partial pressure of the water exactly corresponds the saturation pressure at the given temperature of the mixture. Now there is an additional check in place to make sure the correct calculations are employed (PR #774).
The caching for pint broke when the python version of an environment was changed. Now a
__pint_cache__is placed in the tespy installation folder, to which thecache_folderof pint’sUnitRegistryis linked (PR #777).
Contributors¶
Francesco Witte (@fwitte)
v0.9.5 - Kelvin’s Kingdom (September, 6, 2025)¶
New Features¶
Temperature differences to bubble and dew temperature are now explicitly set with the
td_bubbleandtd_dewparameters, which will replace the specification ofTd_bpin the next major release. The API for these specifications is as follows:td_bubblereferences the temperature at bubble line (T(p,Q=0))td_dewreferences the temperature at dew line (T(p,Q=1))For pure fluids, this will be the same temperature, for mixtures (e.g. as accessible through REFPROP it will not)!
For
td_bubble:A positive value indicates a temperature below bubble temperature by the specified value.
A negative value indicates a temperature above bubble temperature by the specified value.
For
td_dew:A positive value indicates a temperature above dew temperature by the specified value.
A negative value indicates a temperature below dew temperature by the specified value.
You can also specify
td_bubble=0ortd_dew=0, which will enforce saturated liquid or saturated gas state.
>>> from tespy.connections import Connection >>> from tespy.networks import Network >>> from tespy.components import Source, Sink >>> nw = Network(iterinfo=False) >>> nw.units.set_defaults(temperature="degC", pressure="bar") >>> so = Source("source") >>> si = Sink("sink") >>> c = Connection(so, "out1", si, "in1") >>> nw.add_conns(c) >>> c.set_attr(fluid={"R290": 1}, m=1, p=10, td_bubble=5) >>> nw.solve("design") >>> round(c.T.val, 2) 21.94 >>> c.set_attr(td_bubble=None, td_dew=5) >>> nw.solve("design") >>> round(c.T.val, 2) 31.94 >>> c.set_attr(td_dew=-5) >>> nw.solve("design") >>> round(c.T.val, 2) 21.94 >>> c.set_attr(td_dew=None, td_bubble=-5) >>> nw.solve("design") >>> round(c.T.val, 2) 31.94 >>> c.set_attr(td_bubble=0) >>> nw.solve("design") >>> round(c.T.val, 2) 26.94
(PR #758).
Other Changes¶
Component parameters which have
structure_matrixspecified now also invoke equations if the do not havefuncassociated at the same time. This was already the case for mandatory constraints, but now it is also rolled out to the parameters (PR #756).Selection of mass flow starting values, where no value is available is now reproducibly random (PR #755).
Fix a couple of broken internal links (PR #757).
Immediately check temperature difference unit compatibility when specifying via
set_defaults(PR #764).Make a modification to the
_calc_td_logmethod ofSimpleHeatExchangerclasses to enable simulations with tiny temperature difference between fluid outlet and ambient temperature (PR #761).
Bug Fixes¶
Contributors¶
Francesco Witte (@fwitte)
v0.9.4 - Kelvin’s Kingdom (August, 31, 2025)¶
API Changes¶
The specification of units via the
Networkclass instance is deprecated and will be removed with the next major release. Use the newUnitsclass from the tespy.units module instead. It also includes units for all component properties.>>> from tespy.networks import Network >>> from tespy.components import ( ... Source, Sink, Turbine, SimpleHeatExchanger, PowerSink, Generator ... ) >>> from tespy.connections import Connection, PowerConnection >>> nw = Network(iterinfo=False) >>> nw.units.set_defaults(**{ ... "pressure": "bar", ... "pressure_difference": "bar", ... "temperature": "degC", ... "temperature_difference": "delta_degC", ... "power": "MW", ... "heat": "hp", ... "efficiency": "%" ... }) >>> source = Source("source") >>> heater = SimpleHeatExchanger("heater") >>> turbine = Turbine("turbine") >>> sink = Sink("sink") >>> generator = Generator("generator") >>> grid = PowerSink("grid") >>> c1 = Connection(source, "out1", heater, "in1", label="c1") >>> c2 = Connection(heater, "out1", turbine, "in1", label="c2") >>> c3 = Connection(turbine, "out1", sink, "in1", label="c3") >>> e1 = PowerConnection(turbine, "power", generator, "power_in", label="e1") >>> e2 = PowerConnection(generator, "power_out", grid, "power", label="e2") >>> nw.add_conns(c1, c2, c3, e1, e2)
Parameter specifications come with the specified units.
>>> c1.set_attr(fluid={"water": 1}, T=25, p=100) # degC and bar >>> c2.set_attr(T=600) # degC >>> c3.set_attr(p=5) # bar >>> e2.set_attr(E=10) # MW >>> heater.set_attr(dp=5) # pressure drop -> bar >>> generator.set_attr(eta=97) # efficiency >>> turbine.set_attr(eta_s=85) # efficiency >>> nw.solve("design")
It is even possible to specify a custom unit for a single parameter:
>>> Q = nw.units.ureg.Quantity >>> heater.set_attr(dp=Q(20, "psi")) # set pressure drop with in psi >>> nw.solve("design") >>> round(c2.p.val_with_unit, 4) # retrieve pint.Quantity <Quantity(98.621, 'bar')> >>> round(turbine.P.val, 2) # val still only retrieves number, but in specified default unit -10.31 >>> round(heater.dp.val, 1) # individually assign units are retained 20.0
If you want to make use of the unit conversion capabilities yourself for custom components and their attributes, then you have to provide the
quantityinformation to the respective parameter. For more information on this, please check the respective section in the docs.In the back-end of the
tespy.componentsyou have to adjust the access to internal component property values. Previously, these were accessed through thevalproperty of the respective object, e.g.turbine efficiency:
turbine.eta_s.val
return ( -(outl.h.val_SI - inl.h.val_SI) + ( isentropic( inl.p.val_SI, inl.h.val_SI, outl.p.val_SI, inl.fluid_data, inl.mixing_rule, T0=inl.T.val_SI ) - inl.h.val_SI ) * self.eta_s.val_SI )
With the introduction of units for all component parameters, these should now exclusively be accessed with the
val_SIproperty, which also aligns the API with theConnectionclass API, e.g.:turbine efficiency:
turbine.eta_s.val_SI
return ( -(outl.h.val_SI - inl.h.val_SI) + ( isentropic( inl.p.val_SI, inl.h.val_SI, outl.p.val_SI, inl.fluid_data, inl.mixing_rule, T0=inl.T.val_SI ) - inl.h.val_SI ) * self.eta_s.val )
The old way of access may still work if you are exclusively using SI units in your models, but may have unexpected side-effects.
New Features¶
A new component
Nodeis available. The component combines theSplitterandMergecomponent in a single one, meaning you can connect multiple inlets and multiple outlets at the same time. The pressure is forced equal for all connections, the enthalpy and fluid composition will be equal for all of the outlets and based on the incoming fluids’ states (PR #733).TESPy now integrates pint for unit conversions. With this change, you can now also specify units for the missing connection parameters
quality:
x,temperature differences:
Td_bpandpower/heat
EforPowerConnections
as well as all component parameters. For an example on how to work with the new units, please check this section (PR #743).
A new component
PolynomialCompressoris available. The component uses EN 12900 type polynomial coefficients to calculate isentropic and volumetric efficiencies, and can take dissipative heat loss into consideration. Displacement in offdesign conditions can be calculated based on variable rpm of the compressor. For an extensive example please check the docstrings of this component (PR #741).
Other Changes¶
A few broken internal links have been fixed in the documentation (PR #735).
An error is raised, when a Subsystem calls its
add_connsmethod and the label of the to be added connection is already existing inside the Subsystem (PR #745).For pure fluids in two-phase at the state of
p=pandT=T0the splitting of exergy was broken, because the enthalpyh(p=p, T=T0)cannot be calculated. Insteadex_thermis assigned0.0in this case (PR #738).Clean up some residual code, that was not used anymore (PR #753).
Contributors¶
Francesco Witte (@fwitte)
v0.9.3 - Kelvin’s Kingdom (July, 30, 2025)¶
Hotfix for Postreleases¶
UserDefinedEquationsnow automatically reassign their connection and component objections. This is necessary in context of pygmo base optimization (PR #726).When either
ttd_uorttd_lon a classHeatExchangercomponent is zero,kAwill be set to nan to prevent a crash (PR #728).A bug has been fixed, that applied a convergence check based on
Td_bpvalue even if it was not a set value (PR #731).
Other Changes¶
Td_bpandxare now set tonan, if the state of the fluid is supercritical. The_make_p_subcriticalmethod has been removed from theFluidPropertyWrapperclasses, because the convergence helpers will ensure, that no two-phase properties are accessed in supercritical states. Otherwise it was possible, that a simulation converged with a supercritical state andxorTd_bpset by the user (PR #722).
Bug Fixes¶
When adding connections to a subsystem in the
create_networkmethod components were sometimes added multiple times (PR #718).The error message when imposing boundary conditions leading to a cyclic linear dependency was wrong for some instances (PR #720).
The starting value guesses for enthalpy of
Turbineclass instances now differentiates between supercritical and non-supercritical pressure (PR #721).
Contributors¶
v0.9.2 - Kelvin’s Kingdom (July, 24, 2025)¶
Other Changes¶
The generic starting values have been reworked to some extent (and as an interim solution). Through this, the guesses are more fluid agnostic and should work better for a larger variety of fluids, including incompressibles. An overall refactoring of this part of the presolver follow in the future (PR #708).
Bug Fixes¶
The
Pumpconvergence check now enforces liquid state in the first iterations (PR #708).The
FutureWarningHandlernow passes through the warnings correctly to the logger without change the type of warning (PR #712).The
_to_exerpyexport of theNetworkinstance was broken due to the change in the connector IDs for some components with the introduction of thePowerConnectionclass (PR #713).
Contributors¶
v0.9.1 - Kelvin’s Kingdom (June, 27, 2025)¶
New Features¶
A new component
Pipelinehas been added, which can calculate heat losses based on its material, insulation as well as the surrounding conditions, e.g. if it is an above surface pipeline or a subsurface buried pipeline (PR #661).
Other Changes¶
A short description has been added to the
SimpleHeatExchangerdocstrings on how to use thePowerConnectionin this context (PR #705).
Contributors¶
Francesco Witte (@fwitte)
v0.9.0 - Kelvin’s Kingdom (June, 27, 2025)¶
This version of tespy comes with a refactoring of the complete presolver and solver back-end. This comes with many changes in the back-end APIs and potentially with unintended consequences for models, which were recently working and stopped working with this version. All tests in tespy including the different models have been carried out successfully in context of the refactoring, but it cannot be guaranteed, that this is the case for all models. For that reason: We are looking forward for your feedback to the new version. You can submit your feedback on this GitHub discussion.
On the high-level API (what users see when working with the standard components of tespy) few changes have been made, they are listed below. In contrast, the back-end has changed quite a bit. The most relevant changes in your custom component implementations are listed in that sections. Apart from these changes, further API changes will follow in the future. These will be dealing with:
The units of different quantities so that both component and connection parameters can be associated with non-SI units in a structured way.
The post-processing of components and connections will be harmonized.
High-level API changes¶
The
UserDefinedEquationnow needs additional specifications. You have to provide thedependentsand thederivhas become optional. Thedependentskeyword takes a function, which returns a list of variables the equation depends on and then automatically performs the calculation of all partial derivatives. Thederivmethod may still be passed, in this case, it will be used instead of automatically determining the derivatives.In the
derivmethod, the placement of values in the Jacobian has changed and should now be made through thepartial_derivativemethod of theUserDefinedEquationinstance.See the docs for the specific implementations.
The
reset_topology_reduction_specificationsmethod of theNetworkhas been deprecated and is not required anymore.The
Busclass and theExergyAnalysisclass will be deprecated in the next major version release following v0.9. ThePowerConnectionand the respective power components replace theBusclass. TheExergyAnalysisfeature moved to an external library: exerpy.
Back-end API changes¶
The mandatory constraints of components are also stored in
DataContainerinstances, instead of plain dictionaries.Every mandatory constraint or component parameter associated with an equation now requires the specification of the
dependentskeyword, which is a method, that returns the variables, the equation depends on, similar to theUserDefinedEquation. This allows the solver to automatically determine the partial derivatives of the corresponding equation.The specification of the
derivmethod is now optional for parameters, that are associated with a single equation. It overrides the automatic derivative calculation using thedependentsand may be useful in context of analytical derivative formulations. For multi-equation parameters, thederivmethod formulation is still mandatory.Instead of providing a
funcanddependentsfor equations, that connect pairs of two variables in a linear way, e.g. pressure ratio or delta pressure specification, enthalpy or mass flow equality, etc., it is now possible to provide astructure_matrixmethod. This method will be used be the presolving steps to reduce the variable space by creating mappings between the physical variables on the different connections to variables, that can represent multiple other variables at the same time. This reduces the size of the problem and can improve calculation speed. In the future, this will also simplify the activating or deactivating of specific variables for the solver or removing parts of the network.For a couple of examples please refer to the updated documentation section on custom components.
New Features¶
The
Busclass will be deprecated in favor ofPowerConnectionswith respective componentsPowerSource,Motor,Generator,PowerSinkandPowerBus. These are optional connections and components, that can connect to components likeTurbine,Compressor,PumporSimpleHeatExchanger. It streamlines the API between connections transporting material flows and connections with non-material flows. For more information and examples please check this section in the docs.The new version of tespy comes with great debugging capabilities, which allow you to explore, which variables have been solved in presolving with the help of which equations. Also, the variables left for the solver to solve for and the corresponding equations can be outputted after the presolving. Read more information in the new section on debugging.
With the refactored preprocessing, it linear relationships between pairs of variables (e.g. inlet to outlet pressure with specified pressure ratio) will be presolved in a way, that fixing any of the pressure values in a branch of connected pressure values will determine the value of all of them. This will help you with the initial set up of your model: At the example of the pressure, there is no difference anymore between fixing one pressure value with a number of pressure ratios or pressure differences between connections in a connected branch and fixing individual pressure values for all of those connections (as it was recommended to generate stable starting values before version 0.9).
You can now customize the orientation for the optimization by passing a list of
TrueandFalsevalues in theminimizeargument (PR #704).
Known Issues¶
The setting of starting values is still done connection by connection, even if the variable of one connection is linearly dependent to a variable of a different connection and both are mapped to a common variable for the final problem formulation. The starting value for the common variable will be taken from one of the both original variables. The procedure will be updated in a future release.
The
Busclass preprocessing and solving process has not been updated to the same back-end API as it has been done for the components, connections and user defined equations as the class is deprecated.
Other Changes¶
Removed python 3.9 support.
Removed
load_networkanddocument_modelsmodules.
Bug Fixes¶
Fixed a bug which made the simulation crash, when using
MITSWorLiBras fluids as theirT_freezeis equal to 0 K in CoolProp (PR #703).
Contributors¶
Francesco Witte (@fwitte)