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!
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!