Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
81 views
12 pages
Phase Separator
phase separator simulation
Uploaded by
Naufal Hadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Phase Separator For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
81 views
12 pages
Phase Separator
phase separator simulation
Uploaded by
Naufal Hadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Phase Separator For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Phase Separator For Later
You are on page 1
/ 12
Search
Fullscreen
Programming Series be Material Balance Simulation of Binary Mixture in Two Phase Separator - © Just using python! ® Naufal HadiOverview Two-phase separators (also known as flash separator, flashing vessel/tank, and knock-out drum ) are one of the most common types of process equipment used in the industry including oil refineries, chemical plants, refrigeration systems, natural gas and petrochemical processing plants. Two phase separators handles two-phase fluids. One is gaseous phase and the other is liquid phase. As its name suggests, it is used for separating gas and liquid in wet gas stream, or more generally the gas/liquid stream. Material balance on two phase separator can be achieved by applying thermodynamic. It’s including equation of state and vapor liquid equilibrium. This calculation are easily solved using process simulation software. But in this case I will perform the calculation only using python, a multi purpose programming language. So let’s take a look a problem. Horizontal two phase separator The Problem >>> ® Naufal HadiThe Problems Astream at 1000 kmol/h consisting mixture of benzene and toluene are separated using two phase separator. The stream contains 0.75 (mole fraction) of benzene (z:). The separator operating condition is 87 °C and atmospheric pressure (1.01 bar). Using thermodynamic properties of both component and Peng-Robinson as equation of state, define : a. molar fraction of both component in vapor phase (y: and ys) b. molar fraction of both component in liquid phase (x: and x2) c. vapor flows at top separator (V) d. liquid flows at bottom separator (L) F = 1000 kmol/h 2 = 0.75 benzene 22 = 0.25 toluene Solution >>> ® Naufal HadiWARNING ! Freeze at this page and try to solve on your own Just kidding, © let’s slide to next page ) Naufal Hadi 3Solution The solution are done by deriving material balance and combining with vapor liquid equilibrium. from material balance : Pa=LtV = tL=F-V for i component gives : Fy=Ly+Wy, because L= F-V: Fu,=Fx-Vx + W, solving for yi: _Fa+Vx,—Fx, Vv F E E JEG AHF Ne and 7-9 a From vapor liquid equilibrium : and: Exj=2y=1 => = Ex Ey=0 now divide equation (I) with x; respectively gives : rearranging : a1 Ka1-te2h oxo o=(1-K}+(Z-1)5 ) Naufal Hadimultiply both side with » gives : 0=(1-K,)9+(2—1) Xi rearranging and apply K,= z —K=1+9(K,-1) y solving for yi: 2K, YT @(K-1) by dividing both side with K, gives x:: z, x, = =! merce ie with =z recalling : x,-Zy,=0 yield : 2) The equation (2) also called as Rachford-Rice Equation and used to solve material balance with gives good convergence stability. Now we are going to solve this equation by python code using it’s library. The library are called phasepy, which is python package for calculation of physical properties of phases at thermodynamic equilibrium. For installation and documentation you can visit their website. The Code >>> ® Naufal HadiThe Code To easily understand how the code are working, I suggest using Jupyter Notebook, a scientific python editor. It has friendly interface which return every line of codes that we write. Now launch Jupyter Notebook. Import package [1]: [# import necessary library ‘import nunpy as np fron phasepy import component, mixture, preos fron phasepy.equilibriun inport flash Now set given data, operating condition, and thermodynamic properties of components [2]: (# given data F = 1000 # nolar flow. knol/h T = 87. + 273.15 # vessel temperature, converted to K P = 1.01 # vessel pressure, bar 2 = np.array([0.75, 9.25]) # overall molar fraction component [3]: # define component thermodynamical properties benzene = component(nane='benzene’, Tc=562.2, Pc=48.98, Zc=0.271, Ve=259.9, 210, 13.7819, 2726.81, 217.572], GC={"CH=C':6}) toluene = conponent(nane="toluene’, Tc=591.8, Pe= W=0.262, Ant=[13.9320, 3056.96, -217.625], GC={"CH=C'z6, 'CH3:1}) +06, Zc=0.264, Ve=316, Define equation of state and mixing rules for mixture [4]: # setting up eos mix = mixture(benzene, toluene) #mix given component mix.unifac() # using dortnund modified unifac mixing rule eos = preos(mix, ‘mhv_unifac') # peng robinson equation of state ) Naufal HadiNow our initial setting are complete, let’s set random value for initial guess [5]: # initial guess x0 = np.array({0.4, 9.6]) # Liquid molar fraction to guess yO = np.array([@.2, 0.8]) # vapor molar fraction to guess And start calculation using flash command [6]: |# start calculation sep = flash(x®, y@, 'VL', Z, T, P, eos) # solver for flash calculation [7]: sep Sep stand for separation, which is new variable to store calculation result. The flash command will return array that contains molar vapor fraction (y, and y2), liquid vapor fraction (x, and X2) and overall liquid fraction (x). Now let’s check the results. [7]: (array([0.81063167, 0.18936833]), array([0.64528823, 0.35471177]), ©.3667014050359152) Jn order to facilitate further calculations, we must separate one by one to independent variable. To do that we just index the array [8]: y1 = (sep[o])[0] # benzene vapor fraction, indexing fron tuple y2 = (sep[6])[1] # toluene vapor fraction, indexing from tuple x1 = (sep[1])[0] # benzene liquid fraction, indexing from tuple x2 = (sep[1])[1] # benzene liquid fraction, indexing from tuple [9]: yt y2, xd, 32 [9]: (0.8106316699864328, 0, 18936833001356734, 9.6452882348270927, 9.35471176517290726) Now Yi, V2, Yo X2, are independent variable that contains molar fraction in liquid and vapor phase for both component. Next we have calculate the flow of vapor phase at top separator and liquid phase at bottom separator. This is done by simply applying linear algebra solve dt using matrix. ® Naufal Hadifrom material balance of each component gives : Fz; = Lx + Wi Faz = Lx + Wp we can rearrange it in matrix form : x BI (ZI - (Fe x Yo} \V] ~ \Fa,| Matrix generation in jupyter notebook [10]: # compute vapor flow and liquid flow using matrix ‘import scipy.linalg # import new library A= np.array (Cyt, xt],{y2, x21]) B = np.array ([F*Z[0], F*z[1]]) [41]: print (a) print (8) [19]: [[e.81063167 0.64528823] [e.18936833 0.3547117]] (750. 250.] (benzene component) (oluene component) In order to solve this matrix, we have to import another package that handle linear algebra system [12]: # now solve the matrix € = scipy.linalg.solve(A,B) # solver for linear algebra And final results that contains vapor and liquid flow [43]: print (C) [13]: [633.29859496 366. 70140504) ) Naufal HadiComplete Code peed eee) ese ee eee ory Pee iseet eth) Bee Rotary 1000 arr) en p-array((@.75, 0.251) Co eee nae Paice eC eee 7 a es =(13.7819, 2726.81, 217.572], oer Oy Peo ena eee eee ee Ce er Ant=[13.9320, 3056.96, -217.625], ee 6, 1}) ieee cece) mix.unifac() Coes ream Omer Tas) cone en oN) ere ieee) eat (sep[2]) (0) en aUpes) (sep[1]) (0) (sept) (1) Se MURS EDD ere m Grace arden} eeect men ere tC a) esas asus rests esas print print print PostyThis code are available in my github page. You can download or pull the code for free. To run the code just simply type in terminal : python separator. py Then we get : Vapor Flow (V) : 122.04308131931882 kmol/h benzene fraction in vapor (y1) _: 0.8642111622668507 toluene fraction in vapor (y2) _: 0.13578883773314926 Liquid Flow (L) : 877.9569186806812 kmol/h benzene fraction in liquid (x1): 0.7341237287758344 toluene fraction in liquid (x2): 0.2658762712241656 ® Naufal Hadi 10Thanks for your time ! Enjoy this post and feel free to like and comment. End ® Naufal Hadi
You might also like
AVP - Distillation Solved Problems
PDF
100% (2)
AVP - Distillation Solved Problems
47 pages
Steel Plate Thickness and Weight: Nominal Size Thickness Weight (lb/ft2) in MM
PDF
No ratings yet
Steel Plate Thickness and Weight: Nominal Size Thickness Weight (lb/ft2) in MM
2 pages
CEP Thermo-2
PDF
No ratings yet
CEP Thermo-2
13 pages
LabExercise3 2
PDF
No ratings yet
LabExercise3 2
21 pages
Distillation: Unit Operations (Che 347/ 251)
PDF
No ratings yet
Distillation: Unit Operations (Che 347/ 251)
27 pages
Sample For Solution Manual For Chemical Engineering Computation With MATLAB® 2nd Edition by Yeong Koo Yeo
PDF
No ratings yet
Sample For Solution Manual For Chemical Engineering Computation With MATLAB® 2nd Edition by Yeong Koo Yeo
10 pages
' (Cheng313 DR Irfan)
PDF
No ratings yet
' (Cheng313 DR Irfan)
268 pages
Reactor Design Python Code
PDF
No ratings yet
Reactor Design Python Code
23 pages
Plug Flow Reactor Module Using Matlab
PDF
100% (1)
Plug Flow Reactor Module Using Matlab
11 pages
Exercises For Lecture x2
PDF
No ratings yet
Exercises For Lecture x2
8 pages
Aquino Lab 05
PDF
100% (1)
Aquino Lab 05
13 pages
Problem 6: Heat Exchange in A Series of Tanks
PDF
0% (1)
Problem 6: Heat Exchange in A Series of Tanks
5 pages
Phasepy Readthedocs Io en Latest
PDF
No ratings yet
Phasepy Readthedocs Io en Latest
80 pages
Phasepy Documentation
PDF
No ratings yet
Phasepy Documentation
56 pages
Process Modeling and Simulation Lab Report
PDF
No ratings yet
Process Modeling and Simulation Lab Report
46 pages
Types Distillation
PDF
No ratings yet
Types Distillation
81 pages
Process Simulation Lab Manual For Chemical Engineering - Graduate Level
PDF
No ratings yet
Process Simulation Lab Manual For Chemical Engineering - Graduate Level
57 pages
CH3133 - Week 06 - Aqsha - Khoa
PDF
No ratings yet
CH3133 - Week 06 - Aqsha - Khoa
81 pages
DWSIM Report
PDF
No ratings yet
DWSIM Report
34 pages
Material Balance Calculations of VLE Systems
PDF
No ratings yet
Material Balance Calculations of VLE Systems
9 pages
Simplified Cantera User Guide - Python Edition 2015
PDF
100% (1)
Simplified Cantera User Guide - Python Edition 2015
6 pages
Scilab Chemical Engineering Applications
PDF
No ratings yet
Scilab Chemical Engineering Applications
20 pages
Handout Part 2
PDF
No ratings yet
Handout Part 2
34 pages
Week 8 - Tutorial Distillation Part A With Answers
PDF
No ratings yet
Week 8 - Tutorial Distillation Part A With Answers
31 pages
Scilab Chemical Reactor Design - P. Harriott
PDF
No ratings yet
Scilab Chemical Reactor Design - P. Harriott
116 pages
Lect 4 PONCHON-SAVARIT-METHOD 1
PDF
No ratings yet
Lect 4 PONCHON-SAVARIT-METHOD 1
44 pages
HW6 Toma Takahashi
PDF
No ratings yet
HW6 Toma Takahashi
27 pages
Chapter 2
PDF
No ratings yet
Chapter 2
46 pages
32 Example 2
PDF
No ratings yet
32 Example 2
16 pages
Cae 22411
PDF
No ratings yet
Cae 22411
13 pages
Flash Steam Recovery
PDF
No ratings yet
Flash Steam Recovery
8 pages
Ponchon Savarit Method
PDF
No ratings yet
Ponchon Savarit Method
47 pages
PMS Lab Exp.
PDF
No ratings yet
PMS Lab Exp.
7 pages
Assignment - 18 October 2024 - EHPCO2A
PDF
No ratings yet
Assignment - 18 October 2024 - EHPCO2A
7 pages
Solved Examples in
PDF
No ratings yet
Solved Examples in
6 pages
Vapor Liquid Equilibria
PDF
No ratings yet
Vapor Liquid Equilibria
38 pages
Molecules 28 01768 v2
PDF
No ratings yet
Molecules 28 01768 v2
20 pages
Free and Open Source Software
PDF
No ratings yet
Free and Open Source Software
9 pages
Assignment04 PSL Updated3
PDF
No ratings yet
Assignment04 PSL Updated3
5 pages
Lab Report 3
PDF
No ratings yet
Lab Report 3
9 pages
Updated Chapter# 2 After Correction and Modification
PDF
No ratings yet
Updated Chapter# 2 After Correction and Modification
54 pages
Double Pipe Rating
PDF
No ratings yet
Double Pipe Rating
5 pages
McCabe-Thiele Diagrams For Binary Distillation
PDF
No ratings yet
McCabe-Thiele Diagrams For Binary Distillation
8 pages
CAPD Lab PDF
PDF
No ratings yet
CAPD Lab PDF
37 pages
Basic Mass Balance Calculation Using Python
PDF
No ratings yet
Basic Mass Balance Calculation Using Python
9 pages
Use of Advanced Educational Technologies in A Process Simulation Course
PDF
No ratings yet
Use of Advanced Educational Technologies in A Process Simulation Course
22 pages
PC 2 2005 Kotora
PDF
No ratings yet
PC 2 2005 Kotora
13 pages
03 Equilibria (I)
PDF
No ratings yet
03 Equilibria (I)
11 pages
386 Lesson 23 - Selectivity and Yield
PDF
No ratings yet
386 Lesson 23 - Selectivity and Yield
11 pages
Chapter 2 Numerical Methods With MATLAB: X A/b X 0 0 0 0
PDF
No ratings yet
Chapter 2 Numerical Methods With MATLAB: X A/b X 0 0 0 0
10 pages
CHE 42 - Problem Set 1 - Phase Equilibrium
PDF
No ratings yet
CHE 42 - Problem Set 1 - Phase Equilibrium
3 pages
Lec 30
PDF
No ratings yet
Lec 30
18 pages
Flash Distillation - Che 411-27-01-2021
PDF
No ratings yet
Flash Distillation - Che 411-27-01-2021
18 pages
Fluid Phase Equilibria: Morteza Ardeshir Larijani, Mohamad Bayat, Hossein Afshin
PDF
No ratings yet
Fluid Phase Equilibria: Morteza Ardeshir Larijani, Mohamad Bayat, Hossein Afshin
14 pages
Excel Based
PDF
No ratings yet
Excel Based
24 pages
UDCTModule2 Extra
PDF
No ratings yet
UDCTModule2 Extra
20 pages
Practice Lab 3 - Linear Algebra Using Python
PDF
No ratings yet
Practice Lab 3 - Linear Algebra Using Python
1 page
CH138P WS 1.2 Lorian, LBD
PDF
No ratings yet
CH138P WS 1.2 Lorian, LBD
6 pages
CHE 42 - Problem Set 1 - Phase Equilibrium
PDF
No ratings yet
CHE 42 - Problem Set 1 - Phase Equilibrium
3 pages
2 Lewis Sorel Method
PDF
No ratings yet
2 Lewis Sorel Method
18 pages
Simplify Flash Calculations
PDF
No ratings yet
Simplify Flash Calculations
5 pages
Matlab Exercise
PDF
No ratings yet
Matlab Exercise
8 pages