Python code

Python is a great language for developing thermodynamic training resources. Below is a few coding examples to demonstrate finding the thermal efficiency of various steam cycles that I have written over the last few years.

All code is free to use/reuse, but comes with no warranty whatsoever.


Carnot cycle ideal efficiency

An example of calculating cycle efficiency using the programming language Python.

01_carnot_cycle.py

Rankine cycle ideal efficiency

An example of calculating cycle efficiency using the programming language Python.

02_rankine_cycle.py

Rankine superheat cycle ideal efficiency

An example of calculating cycle efficiency using the programming language Python.

03_rankine_superheat_cycle.py

Rankine reheat cycle ideal efficiency

An example of calculating cycle efficiency using the programming language Python.

04_rankine_reheat_cycle.py

Rankine supercritical cycle ideal efficiency

An example of calculating cycle efficiency using the programming language Python.

09-rankine-supercritical-cycle.py

Rankine supercritical double reheat cycle ideal efficiency

An example of calculating cycle efficiency using the programming language Python.

10-rankine-supercritical-cycle-double-Reheat.py


Rankine superheat cycle non-ideal efficiency

An example of calculating cycle efficiency using the programming language Python.

03_rankine_superheat_cycle-non-ideal.py

Rankine superheat cycle non-ideal efficiency (hiRes)

An example of calculating cycle efficiency using the programming language Python.

03_rankine_superheat_cycle-non-ideal-HiRes.py

Rankine reheat cycle non-ideal efficiency

An example of calculating cycle efficiency using the programming language Python.

04_rankine_reheat_cycle-non-ideal.py

Rankine reheat cycle non-ideal efficiency (hiRes)

An example of calculating cycle efficiency using the programming language Python.

04_rankine_reheat_cycle-non-ideal-HiRes.py


Rankine superheat regenerative cycle with closed heater

An example of calculating cycle efficiency using the programming language Python.

05_rankine_superheat_cycle-closed_heater.py

Rankine superheat regenerative cycle with open heater

An example of calculating cycle efficiency using the programming language Python.

05_rankine_superheat_cycle-open_heater.py

Rankine reheat regenerative cycle with open heater

An example of calculating cycle efficiency using the programming language Python.

06_rankine_reheat_cycle-open_heater.py


Rankine Nuclear (PWR) cycle

An example of calculating cycle efficiency using the programming language Python.

11_rankine_nuclear_cycle.py


Password Generator

A version of my password generator application (available on Software download page), but written in python using PyQT5.

pyQT-PasswordGenerator.py


more to come soon!