Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX-19 Calculations for Compressibility 1

Status
Not open for further replies.

anicefob

Chemical
Joined
Jun 18, 2012
Messages
2
Location
US
thread1036-309842

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!
 
CORRECTION in above:

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)
 
here is a simpliar method for compressibility of natural gases with under 4% inerts

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
 
If NX-19 is the subject, simpler methods are of no interest.

If it ain't broke, don't fix it. If it's not safe ... make it that way.
 
No offense meant.

If it ain't broke, don't fix it. If it's not safe ... make it that way.
 
the question was calculating zfactor to find LINE PACK. He found NX-19 and was having problems. Here is a simple way to get the same answer. Now, if the OP was trying to replicate API measurement, yeah the choice of z factor subroutines is limited.
 
No, "linepacker" was the user name of the guy that asked the original question about NX-19 a long time ago. This post is a correction to the code that was posted in the referenced thread.

If it ain't broke, don't fix it. If it's not safe ... make it that way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top