# SimRankine **Repository Path**: thermalogic/SimRankine ## Basic Information - **Project Name**: SimRankine - **Description**: The demo steady-state simulator of Rankine cycle in Python, C++, Rust and Modelica - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: oop - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-06 - **Last Updated**: 2026-05-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SimRankine [![DOI](https://zenodo.org/badge/306221786.svg)](https://zenodo.org/badge/latestdoi/306221786) The SimRankine is the demo steady-state simulator of Rankine cycle in Python, C++ , Rust and Modelica. * Sequential-modular approach - [Python](./python) - [C++](./cpp) - [Rust](./rust) * [Modelica](./mo) ## Key Features(Python,C++,Rust) - **JSON Configuration**: Describes system structure and parameters through JSON files - **Equipment Factory Pattern**: Automatically creates and manages equipment objects - **Port Data Sharing**: Achieves automatic data synchronization between equipment through pointer sharing - **Polling Device-Readiness**: Finds calculation order by repeatedly traversing and computing ready equipment - **Modular Design**: Easy to extend with new equipment types ## Python ### Prerequisites: seuif97 ```bash python -m pip install seuif97 ``` ### Run type `python rankineapp.py` in the terminal of `./python` ```bash python rankineapp.py ``` ## C++ ### Prerequisites: the seuif97 dynamic library 1. building the dynamic library: https://github.com/thermalogic/RustSEUIF97 2. put the dynamic library in `./cpp/bin` ### Run In the terminal of `./cpp` * make ```bash make ``` * cmake ```bash cmake -B ./build/ cmake --build ./build/ --config Release ``` ## Rust ### Prerequisites: the seuif97 library ``` cargo install seuif97 ``` ### Run In the terminal of `./rust` ```bash cargo run ``` ## Modelica **Prerequisites**: Dymola ![simrankinemo](./img/simrankinemo.jpg) ## The Example Rankine cycles Michael J. Moran, Howard N. Shapiro, Daisie D. Boettner, Margaret B. Bailey. Fundamentals of Engineering Thermodynamics(7th Edition). John Wiley & Sons, Inc. 2011 Chapter 8: Vapor Power Systems [The Jupyter Notebook of Example Rankine Cycles](https://github.com/thermalogic/PyRankine/tree/master) * Example 8.1: Analyzing an Ideal Rankine Cycle, P438 * Example 8.2: Analyzing a Rankine Cycle with Irreversibilities, P444 * Example 8.3: Evaluating Performance of an Ideal Reheat Cycle, P449 * Example 8.4: Evaluating Performance of a Reheat Cycle with Turbine Irreversibility, P451 * Example 8.5: The Regenerative Cycle with Open Feedwater Heater, P456 ## Supported Components * Boiler * TurbineEx0 # Simple expansion turbine * TurbineEx1 # Single extraction turbine * Pump * Condenser * OpenedHeaterDw0 # Open feedwater heater ### Boiler ``` ↑ oPort main steam ┌───┼───┐ │ │ │ │ │ │ │ │ │ └───┼───┘ ↑ iPort main feedwater json object example: { "name": "Boiler", "devtype": "BOILER", "iPort": {"p": 8.0, "t": None, "x": None, "fdot": None}, "oPort": {"p": 8.0, "t": None, "x": 1.0, "fdot": 1.0} } ``` ### TurbineEx0 ``` iNode inlet steam ┌────────┐ ↓ ╱ │ ┤ │ ╲ │ └────────┤ ↓ oNode exhausted steam extracted steam 0 json object example { "name": "Turbine1", "type": "TURBINE-EX0", "ef": 1.00, "iPort":, "oPort": } ``` ### TurbineEx1 ``` iPort inlet steam ┌────────┐ ↓ ╱ │ ┤ │ ╲ │ └──┬─────┤ ePort ↓ ↓ oPort exhausted steam extracted steam 1 json object example { "name": "Turbine1", "type": "TURBINEEX1", "ef": 0.85, "iPort":, "oPort": j, "ePort": k } ``` ### Pump ``` ┌───────┐ │ │ oPort ← ┼───────┼← iPort │ │ └───────┘ json object example: { "name": "Feedwater Pump1", "devtype": "PUMP", "ef": 1.00, "iPort": {"p": 8.0, "t": None, "x": None, "fdot": None}, "oPort": {"p": 8.0, "t": None, "x": 1.0, "fdot": 1.0} } ``` ### Condenser ``` ↓ iPort exhausted steam ┌───┴───┐ │ │ │ │ │ │ └───┬───┘ ↓ oPort condensate water json object example: { "name": "Condenser1", "devtype": "CONDENSER", "iPort[0]": i, "oPort[0]": j } ``` ### OpenedHeaterDw0 ``` ↓ inPort extracted steam ┌───┴───┐ feedwater │ │ outPort_fw ← ┤ │← inPort_fw feedwater │ │ └───────┘ json object example: { "name": "OpenedFeedwaterHeater1", "devtype": "FWH-OPEN-DW0", "iPort":i, "iPort_fw":j, "oPort_fw":k } ``` ## Cite as * Cheng Maohua. (2021). SimRankine: the demo steady-state simulator of Rankine cycle in Python, C++ and Modelica (2.0.0). Zenodo. https://doi.org/10.5281/zenodo.4585581