v0.8¶
Changelog of the v0.8 release series.
v0.8.3 - Newton’s Nature (June, 21, 2025)¶
Bug Fixes¶
The export method
to_exerpynow includes the results for components (PR #688).
Contributors¶
v0.8.2 - Newton’s Nature (June, 12, 2025)¶
API changes¶
The API of the
Subsystemclass has been revised to make it act more like aNetwork. You can get components and connections from the subsystem with respective methods, and theSubsystemInterfaceclass is utilized to target thesubsystem.inletandsubsystem.outletin aConnectionobject. For the required changes please check the respective section in the docs (PR #652).The attribute
progressof the classNetworkhas been removed. (PR #684).To raise an
AssertionErroron non-convergence of a simulation you must now useNetwork.assert_convergence()instead ofNetwork._convergence_check()(PR #684).
New Features¶
The combustion based component classes
CombustionChamber,DiabaticCombustionChamberandCombustionEnginecan now handle carbonmonoxide as fuel (PR #674).The
Network’ssolvemethod will now assign status values depending of the outcome of the simulation. Check the section on convergence for more information (PR #684).
Other Changes¶
The partial derivatives for specified temperature are only calculated towards enthalpy and pressure, not towards the fluid compostion. The reason for this is, that it is not intended, that the composition of a fluid can be determined by specifying temperature. Removing this saves a lot of computational overhead for mixtures (PR #674).
The calculation of the logarithmic temperature difference in heat exchanger classes was error-prone due to rounding differences in temperature. The calculation is now consistent through all respective classes and can handle temperature differences to a precision of
1e-6(PR #679).The export method
to_exerpynow includes the results for components (PR #680).
Contributors¶
Francesco Witte (@fwitte)
v0.8.1 - Newton’s Nature (May, 29, 2025)¶
New Features¶
The
CoolPropWrapperAPI can now handle CoolProp based mixtures and allows the user to specify which type of mixture fractions to use (mass, molar, volume). This is mostly for REFPROP support and will require further adaptions for theCoolPropWrapperin the future, because the pure fluid functions may not be applicable in the context of mixtures (PR #655).In case you are working with incompressible mixtures, this feature is API breaking. You need to append
|mass,|volumeor|molarto your fluid name string at the very end to specify, which type of mixture is used. This information can be retrieved from the CoolProp online documentation on the incompressible fluids.
Bug Fixes¶
In case parts of a
Networkwere missing aCycleCloseror aSourceandSinkcombination a misleading error was raised. These cases are checked for explicitly now to make debugging easier (PR #653).The logging of warnings for
HeatExchangerbased components includes the label of the component, when cold or hot side effectiveness cannot be calculated (PR #670).
Contributors¶
Francesco Witte (@fwitte)
Fixes for v0.8.0¶
Bug Fixes¶
A bug was fixed in CoolProp version 6.8.0 #2447 for the S800 fluid. The tests/examples affected by this in tespy have been updated (PR #640).
In case a heat exchanger heats up the same mass flow (e.g. in a recuperator or internal heat exchanger), the derivative to the mass flow was assigned wrong (PR #646).
Other Changes¶
To improve convergence for offdesign calculation and problems with small initial increment of the variables the heuristics for the convergence check based on the components have been adjusted (PR #641).
Update code, which was subject to be changed with the major release of 0.8.
Contributors¶
Francesco Witte (@fwitte)
v0.8.0 - Newton’s Nature (April, 23, 2025)¶
API breaking changes¶
The
OptimizationProblemimplements the following changes (see PR #610):The dtype for
objectivehas been changed to list. With a single element list, a single objective optimization is carried out. With lists containing more elements, multi-objective optimization will be carried out.The function argument
genof therunmethod has been renamed toevo. The same applies for theindividualsdataframe.Your tespy model now needs to have a function
get_objectivesinstead ofget_objectiveand it must return a list of values.The intermediate printing during optimization has been removed.
Exporting or saving a network state to the filesystem will create a single
jsonfile in the future, meaning you need to change the path to"export.json", for example. Also, you need to replace thedesign_pathandinit_patharguments for your networks to point to the respective json file. To transform an existing export or save state from the old API of v0.7, you can use thev07_to_v08_exportand thev07_to_v08_savemethods. They will return a dictionary with the respective data, which you can dump into a.jsonfile.This also breaks the API of the
tespy.networks.network_reader.load_networkmethod, meaning exported network data based ontespy<0.8are not compatible with howtespy>=0.8is handling the data. Use the described method above to adjust that. On top of that, instead of theload_networkmethod, use thefrom_jsonclass method to import networks in the future:Saving a state of the network and using it to initialize
>>> from tespy.networks import Network >>> from tespy.connections import Connection >>> from tespy.components import Source, Sink >>> nwk = Network(iterinfo=False) >>> so = Source("source") >>> si = Sink("sink") >>> c1 = Connection(so, "out1", si, "in1", label="1") >>> nwk.add_conns(c1) >>> c1.set_attr(m=1, p=10, T=100, fluid={"air": 1}) >>> nwk.solve("design") >>> data = nwk.save("design.json") >>> nwk.solve("design", init_path="design.json")
Saving the state of the network to csv files
You can also export your state to a folder + csv files tree.
nwk.save_csv(“csv_state_export_folder”)
Exporting and Importing a Network
The export of the network is written to the specified path, and will return the data as a dictionary as well. If you only want to retain the data without writing them to the filesystem, you can call the method without passing a path.
>>> data = nwk.export("tmp.json") >>> list(data.keys()) ['Network', 'Connection', 'Component'] >>> list(data["Component"]) ['Sink', 'Source'] >>> imported_nw = Network.from_json("tmp.json") >>> data_without_json_writing = nwk.export() >>> list(data_without_json_writing["Connection"]["Connection"]) ['1']
Diff: (PR #605 and PR #638 <https://github.com/oemof/tespy/pull/638>).
New Features¶
The parameter for delta pressure (
dp) is now available on all components, that do feature the pressure ratioprparameter (PR #628).Attention
Please note, that the
dpparameter follows the network unit specification for pressure. If your network unit isbar, then the pressure drop will also use bar as unit.Modify the
OptimizationProblemclass to allow multi-objective optimization (PR #610).Component bypassing is now possible by specifying
bypasson a component. This applies pressure and enthalpy equality to the inlet and corresponding outlet connection pairs of components. This only works for single inlet-single outlet components as well as heat exchanger components with two sides (PR #615).>>> from tespy.networks import Network >>> from tespy.connections import Connection >>> from tespy.components import Source, Sink, SimpleHeatExchanger >>> nw = Network() >>> nw.units.set_defaults( ... pressure="bar", ... temperature="°C", ... enthalpy="kJ / kg" ... ) >>> nw.iterinfo = False >>> source = Source("In") >>> sink = Sink("Out") >>> heater = SimpleHeatExchanger("Heater") >>> c1 = Connection(source, "out1", heater, "in1", "1") >>> c2 = Connection(heater, "out1", sink, "in1", "2") >>> nw.add_conns(c1, c2) >>> c1.set_attr(T=100, p=2, m=1, fluid={"water":1}) >>> heater.set_attr(Q=2e6, pr=0.9) >>> nw.solve("design") >>> heater.set_attr(bypass=True) >>> nw.solve("design")
Contributors¶
Francesco Witte (@fwitte)