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.
Air_Separation.py: Main script. Connects to PRO/II via COM, copies a source.przto 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.
- Windows OS (COM automation)
- Installed and licensed PRO/II (tested with SimSci/AVEVA PRO/II; ensure the Database COM server
SimSciDbs.Database.102is available) - Python 3.8+ on Windows
- Python packages:
pywin32,numpy
Install Python dependencies:
pip install pywin32 numpy- Ensure PRO/II is installed and you can open
Casebook_Air_Separation_Plant.przmanually. - Set the source project path inside
Air_Separation.py(variabledb_path_origin). Example:The script copies this file to the current working directory asdb_path_origin = r"D:\\Bryan\\ESPOL\\Model_HR_3CDN.prz"
Working_file.przand runs the simulation on that working copy. - Run the script from PowerShell or CMD:
python Air_Separation.py
- The script will:
- Initialize the PRO/II COM server
- Import the
.inpcorresponding 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.
- If your PRO/II installation registers a different COM ProgID (e.g.,
SimSciDbs.Database.110), update the dispatch string inAir_Separation.py:win32.Dispatch("SimSciDbs.Database.110")
- The script imports the
.inpthat shares the same stem as the working.prz(e.g.,Working_file.inp). Ensure the.inpis 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.
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 callRunCalcsand record KPIs - Persist results to CSV/Parquet and visualize with
matplotlib/seaborn
- 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_pathand that.przand.inpare accessible.
If you use this repository, please cite the associated work (see the paper linked above).