This project demonstrates fully automated, headless simulation of process flowsheets in DWSIM using Python. The workflow programmatically constructs and evaluates a Plug Flow Reactor (PFR) and a rigorous distillation column, followed by parametric sweep studies.
- Python Version: 3.10 or 3.11 (recommended for
pythonnetcompatibility) - DWSIM Version: 8.x (standard Windows installation)
Install required Python libraries:
pip install -r requirements.txtpython run_screening.py- The simulation runs completely headless (no GUI interaction).
- Progress is logged to console and
simulation.log. - Results are continuously written to
results.csv.
This video demonstrates:
- Headless execution of the automation script
- Parametric sweep in real time
- Generated outputs (CSV and plots)
-
Uses DWSIM Automation3 API via
pythonnet -
No prebuilt flowsheets or GUI usage
-
Programmatically creates:
-
Property package (Peng-Robinson)
-
Material and energy streams
-
Reaction set (n-pentane isomerization)
-
Unit operations:
- Plug Flow Reactor (
RCT_PFR) - Rigorous Distillation Column (
RigorousColumn)
- Plug Flow Reactor (
-
-
Variables:
- Reactor Volume: 0.5 → 10 m³
- Temperature: 350 → 450 K
-
Total cases: 25
-
Variables:
- Reflux Ratio: 1.2 → 4.0
- Number of Stages: 10 → 25
-
Total cases: 20
-
Isothermal PFR: Reactor temperature is fixed; DWSIM computes heat duty required to maintain isothermal conditions.
-
Property Package: Peng-Robinson (PR) — suitable for non-polar hydrocarbon systems and VLE prediction.
-
Reaction Model: First-order kinetic model for n-pentane isomerization:
- Pre-exponential factor: (1.2 \times 10^8 , s^{-1})
- Activation energy: (65 , kJ/mol)
Below is a sample terminal output demonstrating fully automated, headless execution of the simulation workflow:
![]() |
![]() |
Highlights:
- Headless execution using DWSIM Automation API (no GUI interaction)
- Automated parametric sweep across PFR and distillation column cases
- Real-time logging of simulation progress and outputs
- Successful execution of all simulation cases without failure
Contains all simulation cases (45 total) with:
This dataset includes:
- Input parameters
- Simulation outputs
- Success flags and error handling
Metadata
case_type,success_flag,error_message
Input Variables
V,T,RR,N
Key Performance Indicators (KPIs)
conversiondistillate_puritynC5_outlet_flowiC5_outlet_flowtemperature_outheat_dutycondenser_dutyreboiler_duty
Generated visualizations showing parametric trends:
Insights from plots:
- Conversion increases with temperature and reactor volume
- Distillation purity improves with reflux ratio
- Energy consumption increases with separation performance
-
pfr_conversion_vs_volume.png Effect of reactor size on conversion
-
pfr_conversion_vs_temperature.png Temperature dependence of reaction kinetics
-
col_purity_vs_reflux.png Impact of reflux ratio on separation
-
col_duty_vs_stages.png Energy requirement vs number of stages
- Reaction Kinetics: Conversion increases strongly with temperature due to Arrhenius dependence.
- Reactor Design: Larger reactor volumes increase residence time, improving conversion at lower temperatures.
- Thermodynamic Limitation: Separation of n-pentane and isopentane is difficult due to close boiling points (~10°C difference).
- Column Behavior: Increasing reflux ratio improves purity but significantly increases energy consumption.
- Optimal Trade-off: High purity requires both higher reflux and more stages, leading to diminishing returns.
- Fully headless simulation (no GUI)
- Programmatic flowsheet construction
- Robust error handling and logging
- Automated parametric sweep execution
- Structured data export and visualization
project/
│── run_screening.py
│── requirements.txt
│── README.md
│── results.csv
│── simulation.log
│── simulation_report.txt
│── plots/
- All simulations executed successfully (45/45 cases).
- The workflow is scalable for larger screening and optimization studies.
This project demonstrates the ability to:
- Build complete process flowsheets programmatically using DWSIM Automation API
- Perform headless simulation without GUI interaction
- Implement parametric sweeps for reactor and separation units
- Extract and analyze key engineering performance metrics
- Generate structured outputs and visualizations
The work reflects a strong integration of process engineering fundamentals with Python-based automation.
The separation of n-pentane and isopentane is thermodynamically limited due to their close boiling points. This is reflected in the simulation results where purity plateaus despite increasing reflux ratio and stages.




