Skip to content

thermalogic/SimRankine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

147 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimRankine

DOI

The SimRankine is the demo steady-state simulator of Rankine cycle in Python, C++ , Rust and Modelica.

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

python -m pip install seuif97

Run

type python rankineapp.py in the terminal of ./python

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
make
  • cmake
cmake -B ./build/   
cmake --build ./build/ --config Release

Rust

Prerequisites: the seuif97 library

cargo install seuif97

Run

In the terminal of ./rust

cargo run

Modelica

Prerequisites: Dymola

simrankinemo

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

  • 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

About

The Demo Rankine Cycle Steady-state Simulator in Python,C++ ,Rust and Modelica

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors