Flash Drum and Distillation Column
Simulating two fundamental separation processes: an isothermal binary flash drum and a multi-tray distillation column built from individual DistillationTray blocks wired in series.
Part 1: Isothermal Flash Drum
A flash drum separates a liquid feed into vapor and liquid streams using vapor-liquid equilibrium (VLE). The drum uses Raoult's law with Antoine correlations to compute K-values:
MATHDISPLAY0ENDMATH
The Rachford-Rice equation determines the vapor fraction MATHINLINE1ENDMATH, from which the vapor (MATHINLINE2ENDMATH) and liquid (MATHINLINE3ENDMATH) compositions follow.
Configure a flash drum for a benzene-toluene mixture (default Antoine coefficients). Feed an equimolar mixture at 1 atm and sweep temperature from 340 K to 400 K. This range covers the bubble point (365 K) and dew point (380 K) of the mixture, so we can observe the transition from all-liquid to two-phase to all-vapor.
18:18:16 - INFO - LOGGING (log: True) 18:18:16 - INFO - BLOCKS (total: 6, dynamic: 1, static: 5, eventful: 0) 18:18:16 - INFO - GRAPH (nodes: 6, edges: 8, alg. depth: 2, loop depth: 0, runtime: 0.751ms) 18:18:16 - INFO - STARTING -> TRANSIENT (Duration: 120.00s) 18:18:16 - INFO - -------------------- 1% | 0.0s<0.2s | 1395.5 it/s 18:18:16 - INFO - ####---------------- 20% | 0.0s<0.1s | 2923.1 it/s 18:18:16 - INFO - ########------------ 40% | 0.0s<0.1s | 2549.1 it/s 18:18:16 - INFO - ############-------- 60% | 0.1s<0.0s | 2991.1 it/s 18:18:16 - INFO - ################---- 80% | 0.1s<0.0s | 2623.0 it/s 18:18:16 - INFO - #################### 100% | 0.1s<--:-- | 2461.0 it/s 18:18:16 - INFO - FINISHED -> TRANSIENT (total steps: 240, successful: 240, runtime: 125.66 ms)
As temperature increases, more liquid vaporizes (higher vapor rate). The vapor is enriched in the lighter component (benzene), while the liquid becomes richer in toluene — the classic VLE separation.
Part 2: Distillation Column (5 Trays)
A distillation column is built by wiring multiple DistillationTray blocks in series. Each tray enforces vapor-liquid equilibrium with a constant relative volatility MATHINLINE1ENDMATH:
MATHDISPLAY0ENDMATH
Under constant molar overflow (CMO), liquid flows down and vapor flows up with constant rates MATHINLINE2ENDMATH and MATHINLINE3ENDMATH. We feed the column at the middle tray.
Wire the trays: liquid cascades downward (tray MATHINLINE0ENDMATH liquid output MATHINLINE1ENDMATH tray MATHINLINE2ENDMATH liquid input), vapor rises upward (tray MATHINLINE3ENDMATH vapor output MATHINLINE4ENDMATH tray MATHINLINE5ENDMATH vapor input). External feeds enter the top and bottom.
18:18:17 - INFO - LOGGING (log: True) 18:18:17 - INFO - BLOCKS (total: 10, dynamic: 5, static: 5, eventful: 0) 18:18:17 - INFO - GRAPH (nodes: 10, edges: 25, alg. depth: 1, loop depth: 3, runtime: 0.596ms) 18:18:17 - INFO - STARTING -> TRANSIENT (Duration: 30.00s) 18:18:17 - INFO - -------------------- 1% | 0.0s<0.7s | 799.2 it/s 18:18:17 - INFO - ####---------------- 20% | 0.1s<0.5s | 962.9 it/s 18:18:17 - INFO - ########------------ 40% | 0.3s<0.4s | 944.7 it/s 18:18:17 - INFO - ############-------- 60% | 0.4s<0.3s | 955.2 it/s 18:18:17 - INFO - ################---- 80% | 0.5s<0.1s | 1235.2 it/s 18:18:17 - INFO - #################### 100% | 0.6s<--:-- | 1717.5 it/s 18:18:17 - INFO - FINISHED -> TRANSIENT (total steps: 600, successful: 600, runtime: 583.56 ms)
The column separates the light and heavy components across its trays. The top tray is enriched in the light component (high MATHINLINE0ENDMATH) while the bottom tray is depleted. The steady-state composition profile shows the characteristic staircase that a McCabe-Thiele diagram would predict for this relative volatility.