Skip to main content

DOI tests

ThermoSim

ThermoSim logo

ThermoSim is a Python package for modelling and analysing thermodynamic power cycles, built on CoolProp for fluid properties.


Features

  • State-point calculation from any two independent properties (P, T, H, S, Q, D) for water, refrigerants, air and every other CoolProp fluid, plus a built-in Therminol-66 correlation
  • Components: Turbine, Pump, Compressor, Heat Exchanger, TES, Mixer, Splitter, Separator, Expansion Valve, Pipe, Source, Sink
  • Pinch analysis for heat exchangers, with a generalised solver that closes up to three unknowns from {H_hi, H_ho, H_ci, H_co, mh, mc}
  • Automatic mass-flow propagation through branches, splitters and mixers
  • Exergy analysis against a configurable dead state
  • Cycle plots: T-s, P-h and h-s diagrams with saturation domes, heat exchanger temperature profiles, exergy bar/pie charts, energy summaries
  • Sensitivity analysis: single-parameter, multi-output and 2D contour sweeps, with CSV export
  • Save / load model state to JSON
  • 57 unit tests (pytest)

Installation

pip install ThermoSim

To install from source:

git clone https://github.com/Nouman090/ThermoSim.git
cd ThermoSim
pip install -e .

Optional extras: pip install "ThermoSim[all]" adds pymoo (optimisation) and pytest (testing).


Quick example

from ThermoSim import ThermodynamicModel, Turbine, Pump, HeatExchanger
from ThermoSim.plotting import CyclePlotter

Model = ThermodynamicModel()
Model.set_dead_state()

Model.add_point('water', '1', P=8e6,     T=753.15, Mass_flowrate=1)
Model.add_point('water', '2', P=0.008e6)
Model.add_point('water', '3', P=0.008e6, Q=0)
Model.add_point('water', '4', P=8e6)

Turbine(Model, 'Turbine', '1', '2', n_isen=0.85, Calculate=True)
HeatExchanger(Model, 'Condenser', PPT=5, HEX_type='SimpleHEX',
              HeatAdded=False, Hot_In_state='2', Hot_Out_state='3',
              Cold_In_state=None, Cold_Out_state=None, Calculate=True)
Pump(Model, 'Pump', '3', '4', n_isen=1.0, Calculate=True)
HeatExchanger(Model, 'Boiler', PPT=5, HEX_type='SimpleHEX',
              HeatAdded=True, Hot_In_state=None, Hot_Out_state=None,
              Cold_In_state='4', Cold_Out_state='1', Calculate=True)

print(Model)

plotter = CyclePlotter(Model)
plotter.plot_Ts_diagram(['1', '2', '3', '4', '1'])

For cycles with recycle loops or branches, build the components without Calculate=True and let the iterative solver handle the ordering:

Model.Solve(verbose=True)
Model.ModelSummary()

Running the tests

pytest tests/ -v

Who this is for

  • Engineering students studying thermodynamics, energy systems and heat transfer, who want to simulate real energy systems rather than only work through closed-form textbook problems.
  • Researchers modelling, optimising and analysing thermodynamic and energy-efficiency problems.
  • Energy system designers working on power plants, heat exchanger networks, refrigeration cycles and renewable energy systems.

Typical applications

  1. Heat exchanger design and optimisation — double-pipe units, evaporators and condensers, with pinch-point analysis to trade off thermal effectiveness against surface area.
  2. Pumps, turbines and compressors — work output, isentropic efficiency and energy transfer for power generation, refrigeration and HVAC.
  3. Energy efficiency analysis — exergy destruction accounting to locate where useful work is actually being lost.
  4. Thermodynamic cycle simulation — Rankine, regenerative Rankine, Brayton, ORC and refrigeration cycles.

Resources


Contributing

Contributions are welcome. Fork the repository and open a pull request; for major changes, please open an issue to discuss it first.


License

MIT — see LICENSE.


Acknowledgements

Created and maintained by Md. Waheduzzaman Nouman, for educational and research use.

Metadata

Release files for ThermoSim 3.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ThermoSim 3.5.0
File Size Uploaded Provenance Actions
thermosim-3.5.0.tar.gz 106.8 kB Without provenance Details for thermosim-3.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ThermoSim 3.5.0
File Interpreter ABI Platform Actions
thermosim-3.5.0-py3-none-any.whl Python 3 none any Details for thermosim-3.5.0-py3-none-any.whl

Total release size: 202.0 kB

Release files / thermosim-3.5.0.tar.gz

Download URL thermosim-3.5.0.tar.gz
Size 106.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d3eceecb86a1e393602ec6baa9c6bf4461b4fe0a347ba61ed67bfb214e1de63f
BLAKE2b-256 checksum
How to use checksums
140dbd30addcb88f2d2ece05a53068bb53a01a4fd1474b41e4f7e35b3e6a0ce1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / thermosim-3.5.0-py3-none-any.whl

Download URL thermosim-3.5.0-py3-none-any.whl
Size 95.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23d3601fb9f0c73c7c4598b5e8c4c59b2d07bd90be81e7734499c95a8c066b2d
BLAKE2b-256 checksum
How to use checksums
260aa865c2e903157b6be3c7bd9521c1329e917852095f06a56a5cc543cb79c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for ThermoSim 3.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page