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.3.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.3.0
File Size Uploaded Provenance Actions
thermosim-3.3.0.tar.gz 89.0 kB Without provenance Details for thermosim-3.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 169.9 kB

Release files / thermosim-3.3.0.tar.gz

Download URL thermosim-3.3.0.tar.gz
Size 89.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c4fe9455f9f363a5d95978a69eb039b1a3e5c81b4c230de8c89d44c14bc1953e
BLAKE2b-256 checksum
How to use checksums
524d7d67266f73bdc8204a76dfb2be2b18c68e915708cf9b39a4f728834feda5
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.3.0-py3-none-any.whl

Download URL thermosim-3.3.0-py3-none-any.whl
Size 80.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43b0467cb3fc44f557fed4686e54716dda4c2d3baa02dcded6965cc66a934805
BLAKE2b-256 checksum
How to use checksums
b1ea0e1ef921fdd1e94ddfcad64459b50ea01eb6d8d152e651c634cd1a67f4c2
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.3.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