Skip to content

bryanpiguave/Air-Separation

Repository files navigation

Air-Separation

This project simulates an air separation (oxygen production) plant by orchestrating a PRO/II process simulation via Python (COM automation). It enables data extraction, sensitivity analysis, and optimization of key operating variables.

For background and methodology, see: First Paper and Second Paper.

Repository structure

  • Air_Separation.py: Main script. Connects to PRO/II via COM, copies a source .prz to a working file, sets inputs, runs calculations, and computes KPIs/CAPEX/OPEX.
  • cost_utils.py: Cost calculation helpers (compressors, expanders, towers, trays, HX, MSHE, pump, ASU scaling).
  • Casebook_Air_Separation_Plant.prz: PRO/II casebook (project) file used by the script.
  • Casebook_Air_Separation_Plant.inp: PRO/II input file imported by the script.
  • A8_Air_Separation_Plant.prz, Air_Separation_Bryan.prz: Additional PRO/II project variants (optional/legacy).
  • Readme.md: Project documentation.

Prerequisites

  • Windows OS (COM automation)
  • Installed and licensed PRO/II (tested with SimSci/AVEVA PRO/II; ensure the Database COM server SimSciDbs.Database.102 is available)
  • Python 3.8+ on Windows
  • Python packages: pywin32, numpy

Install Python dependencies:

pip install pywin32 numpy

Usage

  1. Ensure PRO/II is installed and you can open Casebook_Air_Separation_Plant.prz manually.
  2. Set the source project path inside Air_Separation.py (variable db_path_origin). Example:
    db_path_origin = r"D:\\Bryan\\ESPOL\\Model_HR_3CDN.prz"
    The script copies this file to the current working directory as Working_file.prz and runs the simulation on that working copy.
  3. Run the script from PowerShell or CMD:
    python Air_Separation.py
  4. The script will:
    • Initialize the PRO/II COM server
    • Import the .inp corresponding to the working .prz
    • Open the working database Working_file.prz
    • Acquire a security seat
    • Apply input changes (HX temps/liquid fractions, column pressure/reflux, ARG duty)
    • Run calculations and generate a report
    • Compute recoveries, duties, equipment costs (via cost_utils.py), CAPEX and OPEX
    • Release the security seat and close

Output artifacts (report files) are generated by PRO/II in the same directory as the project unless configured otherwise.

Configuration notes

  • If your PRO/II installation registers a different COM ProgID (e.g., SimSciDbs.Database.110), update the dispatch string in Air_Separation.py:
    win32.Dispatch("SimSciDbs.Database.110")
  • The script imports the .inp that shares the same stem as the working .prz (e.g., Working_file.inp). Ensure the .inp is available or adjust the import line if needed.
  • Costs are computed using functions in cost_utils.py. You can modify factor choices (e.g., FM) or unit assumptions there.

Extending: Sensitivity and optimization

The repository includes the basic wiring to control and query PRO/II. To add sensitivity analysis and optimization:

  • Identify decision variables and KPIs via ActivateObject(...).Get/SetAttribute* APIs
  • Loop over variable grids or use an optimizer (e.g., scipy, nevergrad) to call RunCalcs and record KPIs
  • Persist results to CSV/Parquet and visualize with matplotlib/seaborn

Troubleshooting

  • COM dispatch fails: verify PRO/II is installed and the COM server ProgID matches. Run Python as Administrator if needed.
  • License/seat errors: ensure you have available PRO/II licenses; the script requests a security seat (GetSecuritySeat(2)).
  • File not found: check db_path and that .prz and .inp are accessible.

Citation

If you use this repository, please cite the associated work (see the paper linked above).

About

Optimization process using PRO II and Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages