zfactor spreadsheet version

24
P E N G - R O B I N S O N E Q U A T I O N O F S T A T E : Z F A C Purpose This workbook provides a working example of the z factor, enthalpy and en multi-component fluid using the Peng-Robinson Equation of State (EOS). T calculation written into the zfactor Excel add-in but provided in this fo less familiar with code to understand the calculation approach. Liability No warrantees are made with respect to the accuracy or applicability of t spreadsheet. The onous is on the user to verify that any results obtaine appropriate for the work being carrying out. Copyright This spreadsheet is the intellectual property of the author, Andrew Hooks and distribute it however, you may not make it available for download fro prior written consent and you must not remove or obscure any notices rega Contact Email: For other tools, visit: www.firstprincipleseng.wordpress.com

Upload: chanadas

Post on 03-Sep-2015

5 views

Category:

Documents


0 download

DESCRIPTION

Zfactor Spreadsheet Version

TRANSCRIPT

INTROP E N G - R O B I N S O N E Q U A T I O N O F S T A T E : Z F A C T O R

PurposeThis workbook provides a working example of the z factor, enthalpy and entropy calculations for a multi-component fluid using the Peng-Robinson Equation of State (EOS). This is the same calculation written into the zfactor Excel add-in but provided in this format to help users who are less familiar with code to understand the calculation approach.LiabilityNo warrantees are made with respect to the accuracy or applicability of the calculations in this spreadsheet. The onous is on the user to verify that any results obtained are correct and appropriate for the work being carrying out.CopyrightThis spreadsheet is the intellectual property of the author, Andrew Hooks. You are free to use it and distribute it however, you may not make it available for download from any website without prior written consent and you must not remove or obscure any notices regarding authorship.ContactEmail:For other tools, visit: www.firstprincipleseng.wordpress.com

zFactorP E N G - R O B I N S O N E Q U A T I O N O F S T A T E : Z F A C T O R Stream conditionsConstantsTemperature310.92KR8.31451kPa.m3/(kmol.K)Pressure689.47kPaAz factor0.9767-Enthalpy-80019kJ/kgmolEntropy171kJ/(kgmol.K)Constants and derived propertiesCompositionComponent constantsBinary interaction parameters (from Unisim Design)Component derived propertiesIdeal gas heat capacitiesdH(ideal)
Andrew.Hooks: dH idealCp = dH/dT = A + B*T + C*T^2 + D*T^3 + ...dH = Integral{Cp.dT} from T1 to T2 = A*(T2-T1) + B/2*(T2^2-T1^2) + C/3*(T2^3-T1^3) + ...dS(ideal)
Andrew.Hooks: dS idealdS = Integral{dQrev/T}dQrev = dH at constant pressure, and dH = Cp.dTCp = A + B*T + C*T^2 + D*T^3 + ...Cp/T = A/T + B + C*T + D*T^2 + ...dS = Integral{Cp/T.dT} from T1 to T2 = A*[LN(T2)-LN(T1)] + B*(T2-T1) + C/2*(T2^2 - T1^2) + D/3*(T2^3-T1^3) + ...Reference H, SIDMolFrnMolWeightCritTempCritPresAccFactorNitrogenCO2MethaneEthanePropanei-Butanen-Butanei-Pentanen-Pentanekappa
Andrew.Hooks: kappaw>0.49= 0.379642 + (1.48503 - (0.164423 - 1.016666 * w) * w) * ww0.49= 0.379642 + (1.48503 - (0.164423 - 1.016666 * w) * w) * ww 00.9767**r = 0-If there are multiple roots we use fugacity (related to Gibbs Free Energy) to determine which is the stable root (the root with the lowest fugacity is the-stable root). For a single component fluid the transition between z(v) and z(l) denotes the vapour-liquid phase change. However, for a multi-componentr < 0-fluid the phase transition occurs over a range of P,T (lighter components vapourising first etc) and the change from z(v) to z(l) does not correspond to the -phase transition boundary (a dew/bubble point calculation is required for this which considers the fugacities of the individual components). In fact for a -multi-component fluid the z values in the region either side of the phase transition will be "suspect" as we are likely to be in the two phase region.z factor can only meaningfully be calculated for a single phase fluid. If two phases exist then a flash calc must be performed to determine the compositionDetermine stable rootof the separate liquid and vapour phases and z calculated for each of them.z(vap)0.9767In addition note that even though there may be 2 or 3 roots this does not imply that we are in the two phase region - this may or may not be the case.z(liq)0.9767Fugacity(vap)0.9769Fugacity(liq)0.9769z0.9767-z(add-in)UNAVAIL.EthalpyEthalpy and entropy are state properties which means that their value at a given T, P is independent of the path taken to get thereWe define a reference enthalpy at a given P, T then calculate the change in enthalpy to the requested P, T in two steps - first an ideal step (no change in P), then a departure function to account for non-ideality at high pressureDifferent literature/software uses different reference values which isn't really important since we are normally interested in the change in enthalpyHYSYS and UNISIM use the Heat of formation at 25C as the reference enthalpy and this is also adopted here to make it easy for users to carry out their own validation if desiredReference enthalpyArbitary reference value (since practical calculations are interested in change in enthalpy)Reference T298.15KReference P101.325kPaAH reference-80385kJ/kgmolH(ref) = SUM[xi.dH(formation)]dH ideal (T.ref --> T)Change in enthalpy from reference T to requested T (at P=1 bara therefore "ideal" change in enthalpy)dH ideal556kJ/kgmoldH (ideal) = SUM[xi.dHideal]H departure (P=1bara --> P)Change in enthalpy from (T requested, P=1bara) to (T requested, P=P requested). "Departure function"Kappa0.431-Tc224Kalpha0.852-H departure-191kJ/kgmolHd = (z - 1 - LN((z + (1 + Sqr(2)) * B) / (z + (1 - Sqr(2)) * B)) * A / (B * Sqr(8)) * (1 + K * Sqr(Tr) / Sqr(alpha))) * GAS_CONST * Temp"Real" enthalpyHreal-80019kJ/kgmolEnthalpy = Href + dHideal + HdHreal (add-in)UNAVAIL.kJ/kgmol EntropyS reference179kJ/(kgmol.K)S(ref) = SUM[xi.dS(formation)]dS ideal1.83kJ/(kgmol.K)dS (ideal) = SUM[xi.dSideal]dS mixing6.28kJ/(kgmol.K)Enthalpy of mixing is zero for an ideal fluid but entropy of mixing is not, dS(mix) = -R*SUM[xi.LN(xi)]S departure-0.42kJ/(kgmol.K)Sd = GAS_CONST * LN(z - B) - LN((z + (1 + Sqr(2)) * B) / (z + (1 - Sqr(2)) * B)) * A * GAS_CONST / (B * Sqr(8)) * (K * Sqr(Tr) / Sqr(alpha))S depart. (ref.)0.00kJ/(kgmol.K)Sd(ref) is ignored since it requires recalculation of z at reference P,T and is generally very small. It is calculated in the zfactor add-inS real171kJ/(kgmol.K)Entropy = Sref + dSideal + dSmix - GAS_CONST * LN(Pres / Pref) + Sd - Sd_refS real (add-in)UNAVAIL.kJ/(kgmol.K)z factor add-inThe zfactor add-in expands on the above calculations - adding Cp-real and Cv-real, Isenthalpic and Isentropic temperature/pressure change etc. which allowus to model real world processes (e.g. compression or expansion across a valve or turbo-expander) These calculations are the same as those carried out above but need to be solved multiple times, or as an iteration, and are therefore well suited for code, e.g.* Cp-real = dH/dT as dT approaches 0 requires two enthalpy calculations* Isenthalpic temperature rise (compression) requies an iteration to find the temperature (at the target pressure) that corresponds to dS=0

Used for Enthalpy/Entropy calculation only

zFactorChartP E N G - R O B I N S O N E Q U A T I O N O F S T A T E : Z F A C T O R C H A R TTable created using the 'Scenario Tool' Add-in - available from https://firstprincipleseng.wordpress.com/category/excel/Re-run scenarios to update results for a change in compositionPressureTemperaturezkPaAK-INP: '[zfactor-spreadsheet-version.xlsx]zFactor'!$C$5INP: '[zfactor-spreadsheet-version.xlsx]zFactor'!$C$4OUT: '[zfactor-spreadsheet-version.xlsx]zFactor'!$C$6100248.150.9952000.9913000.9864000.9815000.9776000.9727000.9678000.9629000.95810000.95320000.90530000.85740000.80850000.76060000.71270000.66780000.62790000.594100000.570110000.556120000.551130000.551140000.556150000.564160000.574170000.585180000.598190000.612200000.627210000.642220000.657230000.673240000.689250000.705260000.721270000.737280000.753290000.770300000.786310000.803320000.819330000.836340000.852350000.869360000.886370000.902380000.919390000.935400000.952100273.150.9962000.9933000.9894000.9865000.9826000.9797000.9758000.9729000.96910000.96520000.93030000.89640000.86350000.83160000.80070000.77180000.74590000.722100000.703110000.688120000.677130000.669140000.666150000.665160000.667170000.671180000.677190000.685200000.694210000.703220000.714230000.725240000.737250000.749260000.762270000.775280000.788290000.801300000.815310000.828320000.842330000.856340000.870350000.884360000.898370000.913380000.927390000.941400000.955100298.150.9972000.9953000.9924000.9895000.9876000.9847000.9818000.9799000.97610000.97420000.94830000.92340000.89950000.87660000.85570000.83580000.81790000.801100000.787110000.776120000.766130000.759140000.754150000.751160000.750170000.751180000.754190000.757200000.762210000.768220000.775230000.782240000.791250000.800260000.809270000.819280000.829290000.840300000.850310000.862320000.873330000.884340000.896350000.908360000.920370000.932380000.944390000.956400000.969100323.150.9982000.9963000.9944000.9925000.9906000.9887000.9868000.9849000.98210000.98020000.96130000.94240000.92450000.90860000.89370000.87880000.86690000.854100000.844110000.836120000.829130000.823140000.819150000.816160000.815170000.815180000.816190000.818200000.821210000.825220000.830230000.835240000.841250000.848260000.855270000.862280000.870290000.879300000.888310000.897320000.906330000.915340000.925350000.935360000.945370000.955380000.966390000.976400000.987T=-25'C100200300400500600700800900100020003000400050006000700080009000100001100012000130001400015000160001700018000190002000021000220002300024000250002600027000280002900030000310003200033000340003500036000370003800039000400000.995327927047317210.990648932999079750.985963020703241040.981270196703364910.976570471499109920.971863859823293370.967150380936580680.962430058940922710.957702923112919490.952969008258372390.905269456076601140.856989511471352160.808345072701727620.759787807191708580.712184042632622690.667053307815112960.626703603396105760.593836451735467510.57037846262167080.556445534569872780.550604094614454920.55091622188580680.55566664148505640.563567812405520120.573713221524428270.585475823357194280.598420349024643580.612240789335638190.62671851762303210.64169469876575980.657052059471872620.672702705520343060.68857985675911060.704632148043407460.720819634974010910.7371109501242280.753481248041344530.769910699427890030.786383373359761380.802886397525467980.819409320283754680.835943621026433160.852482330774705250.86901973558879320.88555114281325020.902072695444291030.918581223671816050.935074125372895470.95154926932415562T=0'C100200300400500600700800900100020003000400050006000700080009000100001100012000130001400015000160001700018000190002000021000220002300024000250002600027000280002900030000310003200033000340003500036000370003800039000400000.996491291832512620.992984701035564580.989480348119574190.985978357469063040.982478857456715150.97898198056015850.975487863481471210.971996647269407490.968508477444335550.965023504125865020.930386162101841330.896273079233149920.862932728153378960.830691929632158650.799967290014502060.77126505181993610.745157696208033740.722226758231061970.702973336681720130.687720354456706540.676547663793350740.669290928727783840.665600266819907360.665025456453005370.667092946535202460.671357348869265680.677427114531291560.684971912284125570.69371977641204330.703449794342223540.713983661292222020.72517771278964060.736916053811162760.749104903666385710.761668058097547670.774543296658543050.787679556544565230.801034713691923580.81457383916002390.828267825340776250.842092299429647580.856026760207985740.870053888856126330.884158995878267180.898329574937346440.912554941058049020.926825935737723090.941134685386324050.95547440248792748T=25'C100200300400500600700800900100020003000400050006000700080009000100001100012000130001400015000160001700018000190002000021000220002300024000250002600027000280002900030000310003200033000340003500036000370003800039000400000.997332332564637050.994670394347128670.992014298889921430.989364161670212240.986720100120154540.984082233646520480.981450683649772060.978825573542481230.976207028767050340.97359517681266650.947874302910618690.92297863005569880.899070786094029680.8763337509862430.854967129781390560.835179840599411080.817178753201400990.801153727245462740.787260808927873420.775606596419205820.766237271493719560.759134988372450750.754222356353750010.75137352087007270.750428870239295160.751210172204796470.753533738447390470.757220401935481680.762102126293916050.768025704223622930.774854256376108050.78246724085880970.790759559137851340.799640187525260120.809030621751537390.818863312109156080.829080188995884090.839631327622503920.850473769101735780.86157049690113940.872889558007677540.8844033138094910.896087804457895040.907922210934083430.919888400354759160.931970541704284950.944154780893430190.956428965667603940.96878241235055407T=50'C100200300400500600700800900100020003000400050006000700080009000100001100012000130001400015000160001700018000190002000021000220002300024000250002600027000280002900030000310003200033000340003500036000370003800039000400000.997954871447857550.995916613774179950.993885309604111810.991861042254030820.989843895724878630.987833954694939950.985831304512051030.983836031185222890.981848221375669630.979867962387220630.960500311554597360.941988068228469480.924426873534101470.907914740388248820.892548996026945260.878422477028334540.865619185028615230.854209771259571540.844247347787477230.835764172224032760.828769683681526590.82325017949197310.819170157693220660.816475083159925450.815095139074566880.814949443419658690.815950242511611860.818006706277955020.821028095779566590.824926211596129780.82961713786889890.835022363614761790.841069394543822350.847691974464078960.854830025468388380.862429398629087180.870441507442940350.878822898006730190.887534794377252910.896542645203910690.905815688344160260.915326543340589160.925050836840159650.934966862788031760.945055277120528730.955298825387627120.96568210100599350.976191331495163790.98681418994992809

Pressure [kPa(A)]

z factor [-]

https://firstprincipleseng.wordpress.com/category/excel/