ThermoSim
ThermoSim is a Python package for simulating and analyzing thermodynamic model.
ThermoSim
A Python package for modelling and analysing thermodynamic power cycles.
Features
- State point calculation using CoolProp (water, refrigerants, air, etc.)
- Components: Turbine, Pump, Compressor, Heat Exchanger, Mixer, Splitter, Expansion Valve, Separator, Pipe, TES, Source, Sink
- Exergy analysis with dead-state reference
- Cycle plots: T-s, P-h, h-s diagrams with saturation domes
- Pinch analysis for heat exchangers
- Sensitivity analysis: single-parameter, multi-output, and 2D contour sweeps
- Save/Load model state to JSON
- 48+ unit tests with pytest
Installation
pip install CoolProp scipy matplotlib numpy pandas pymoo pytest
🚀 Quick Example
<<<<<<< HEAD
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'])
##Test Run
pytest tests/ -v
📚 Resources
- 🧾 PyPI Package
- 🛠 Source Code
- ❓ Report Issues
- 📘 Wiki
✨ Features
- Support for different working and heating fluids
- Handles mass and energy balances automatically
- Designed for academic and research-grade modeling
🤝 Contributing
You're welcome to contribute! Fork the repository and open a pull request. For major changes, please discuss via an issue first.
📄 License
This project is licensed under the MIT License.
See the LICENSE file for more details.
🙌 Acknowledgements
Created and maintained by Md. Waheduzzaman Nouman, for educational and research use.
This documentation is intended for:
-
Engineering Students: Those studying thermodynamics, energy systems, and heat transfer. The module provides a practical tool to simulate real-world energy systems and understand thermodynamic concepts.
-
Researchers: Professionals and researchers working in the field of thermodynamics and energy efficiency can use this module for modeling, optimization, and analysis of complex systems.
-
Energy System Designers: Engineers involved in designing and optimizing thermodynamic systems such as power plants, heat exchangers, refrigeration cycles, and renewable energy systems.
Real-World Applications
-
Heat Exchanger Design and Optimization: The module simulates various types of heat exchangers (e.g., double-pipe, evaporator, condenser), helping engineers optimize thermal efficiency and energy usage in industrial applications.
-
Pumps and Turbines: It can model pumps and turbines used in power generation, refrigeration, and HVAC systems, providing insights into performance metrics like work output, efficiency, and energy transfer
-
Energy Efficiency Analysis: By integrating components like expansion valves and PCM (Phase Change Materials), the model supports the design of energy-efficient systems in heating, cooling, and refrigeration sectors.
-
Simulation of Thermodynamic Cycles: The module supports the simulation of thermodynamic cycles, including Rankine and refrigeration cycles, helping in the evaluation of system performance, energy conservation, and operational optimization.
License
MIT
c93e50c82d03eece8612d6db09b20b1bbd2ce23c
Metadata
Release files for ThermoSim 3.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| thermosim-3.2.1.tar.gz | 67.5 kB | Without provenance | Details for thermosim-3.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| thermosim-3.2.1-py3-none-any.whl | Python 3 | none | any | Details for thermosim-3.2.1-py3-none-any.whl |
Total release size: 134.3 kB
Release files / thermosim-3.2.1.tar.gz
| Download URL | thermosim-3.2.1.tar.gz |
|---|---|
| Size | 67.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74acfb3269b1a9f17cdbc075d286530bfc8928bb7bb17da1d213b8682292e517
|
|
BLAKE2b-256 checksum How to use checksums |
74a692bcd381262a01a11cd8538a4d8fa63be8bc8b4267f839f82ad41db4934f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / thermosim-3.2.1-py3-none-any.whl
| Download URL | thermosim-3.2.1-py3-none-any.whl |
|---|---|
| Size | 66.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3f917b126222c0d6d4f8931b303b5026451c2a7fd79418e4704dfcac53b7b69
|
|
BLAKE2b-256 checksum How to use checksums |
f1abf26827095232fbb0b5d2f419b8f5730cecb8871d323c26807838910a614d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for ThermoSim 3.2.1
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.