NX-19 Calculations for Compressibility
NX-19 Calculations for Compressibility
(OP)
thread1036-309842: Need Excel Calc for Linepack Calculation
Thanks to linepacker for the VBA for calculating the supercompressibility factor. There are some minor errors in the VBA code & points for those wishing to use it.
1) You need to replace
nx19_Padj = (156.47 * nx19_Ppsia) / (160.8 - (7.22 * SG) + moleCO2 - (0.392 * moleN2))
with
nx19_Padj = (156.47 * Ppsig) / (160.8 - (7.22 * SG) + moleCO2 - (0.392 * moleN2))
This is because nx19_Padj is supposed to be in psig. Also, not doing it would result in double counting of the atmospheric pressure (14.7 psia) when computing the variable nx19_Pii
2) You need to replace
nx19_fpv = ((1 + (0.00132 / nx19_Tao ^ 3.25)) ^ -2) / (((1 / ((nx19_B / nx19_Dp) - nx19_Dp + (nx19_N / (3 * nx19_Pii))))) ^ 0.5)
with
nx19_fpv = ((1 + (0.00132 / nx19_Tao ^ 3.25)) ^ -2) / (((1 / ((nx19_B / nx19_Dp) - nx19_Dp + (nx19_N / (3 * nx19_Pii))))) ^ 0.5)
3) The VBA code provided is only valid for a certain range of temperature & pressure when the E equals E2 (and not when E equals E1, E3, E4, E5a, E5b, E5c, or E6). You will need to refer to the NX-19 document to incorporate these into the code.
Thanks again to Linepacker (errors notiwthstanding)
Enjoy!
Thanks to linepacker for the VBA for calculating the supercompressibility factor. There are some minor errors in the VBA code & points for those wishing to use it.
1) You need to replace
nx19_Padj = (156.47 * nx19_Ppsia) / (160.8 - (7.22 * SG) + moleCO2 - (0.392 * moleN2))
with
nx19_Padj = (156.47 * Ppsig) / (160.8 - (7.22 * SG) + moleCO2 - (0.392 * moleN2))
This is because nx19_Padj is supposed to be in psig. Also, not doing it would result in double counting of the atmospheric pressure (14.7 psia) when computing the variable nx19_Pii
2) You need to replace
nx19_fpv = ((1 + (0.00132 / nx19_Tao ^ 3.25)) ^ -2) / (((1 / ((nx19_B / nx19_Dp) - nx19_Dp + (nx19_N / (3 * nx19_Pii))))) ^ 0.5)
with
nx19_fpv = ((1 + (0.00132 / nx19_Tao ^ 3.25)) ^ -2) / (((1 / ((nx19_B / nx19_Dp) - nx19_Dp + (nx19_N / (3 * nx19_Pii))))) ^ 0.5)
3) The VBA code provided is only valid for a certain range of temperature & pressure when the E equals E2 (and not when E equals E1, E3, E4, E5a, E5b, E5c, or E6). You will need to refer to the NX-19 document to incorporate these into the code.
Thanks again to Linepacker (errors notiwthstanding)
Enjoy!





RE: NX-19 Calculations for Compressibility
2) You need to replace
nx19_fpv = ((1 + (0.00132 / nx19_Tao ^ 3.25)) ^ -2) / (((1 / ((nx19_B / nx19_Dp) - nx19_Dp + (nx19_N / (3 * nx19_Pii))))) ^ 0.5)
with
nx19_fpv = ((1 + (0.00132 / nx19_Tao ^ 3.25)) ^ -1) / (((1 / ((nx19_B / nx19_Dp) - nx19_Dp + (nx19_N / (3 * nx19_Pii))))) ^ 0.5)
RE: NX-19 Calculations for Compressibility
Tc (critical temperature) =169.01+314.001*Spgr where spgr is specific gravity
Pc (critical Pressure) = 708.75-57.5*Spgr
Pr = PSIA at conditions / Pc
Tr = T (rankin) at conditions / Tc
z = 1 + (0.0703 *Pr / Tr) * (1 - 6 / Tr ^ 2)
At 60F and 1000 psia on a .6 spgr gas, z = .8682
RE: NX-19 Calculations for Compressibility
If it ain't broke, don't fix it. If it's not safe ... make it that way.
RE: NX-19 Calculations for Compressibility
If it ain't broke, don't fix it. If it's not safe ... make it that way.
RE: NX-19 Calculations for Compressibility
RE: NX-19 Calculations for Compressibility
If it ain't broke, don't fix it. If it's not safe ... make it that way.