Index of /skoge/book-cep/matlab/srk-flash

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]README.html2011-10-28 16:04 1.2K 
[   ]bubsrk.m2010-07-14 06:43 1.4K 
[   ]flashPHsrk.m2010-07-14 06:43 1.9K 
[   ]flashPTsrk.m2010-07-14 06:43 1.7K 
[   ]flashsrk.m2010-07-14 06:43 3.5K 
[   ]srksis-old-wrong-kij.m2011-11-09 14:03 3.1K 
[   ]srksis.m2014-03-11 12:28 3.4K 
[DIR]version-without-solving-cubic-equation/2014-03-11 15:59 -  

MATLAB routines that use the SRK equation of state ( srksis.m ).

These can be used to simulate 
  bubble point ( bubsrk.m ), 
  PT-flash ( flashPTsrk.m ), 
  PH-flash ( flashPHsrk.m ), 
  dynamics flash ( flashsrk.m ) 
  etc., etc.. 

Good luck and thanks to Andreas Linhart for providing the basis for the srksis.m routine! 


EXAMPLE:
Do a pT-flash for a mixture of 40% propane, 40% iso-butane, 10% n-butane, 10% 2-methylbutane at 300 K and 5 bar.

Note 1: You need to change the data in flashPTsrk.m to have another feed composition, p or T
Note 2: You need to change the data in srksis.m if you want to use other components!

We use the following commands (as given as an example in flashPTsrk.m):

x0=[0.3 0.4 0.1], y0=[0.52 0.36 0.07]; VF0=0.5; w0= [x0, y0, VF0]; % initial estimates of x, y and V/F  
w=fmincon('1',w0,[],[],[],[],[],[],@flashPTsrk); 
NC=(length(w)+1)/2; x = [w(1:NC-1) 1-sum(w(1:NC-1))]; y =[w(NC:2*NC-2) 1-sum(w(NC:2*NC-2))]; VF=w(2*NC-1); 
Vapor_fraction=VF, Liquid_Composition = x, Vapor_Composition = y 

The result from Matlab is:

Vapor_fraction = 0.3473
Liquid_Composition = 0.3109    0.4347    0.1181    0.1363
Vapor_Composition = 0.5675    0.3347    0.0660    0.031