gpa 2172-1996 (2002).pdf

29
Reproduced By GLOBAL ENGINEERING DOCUMENTS With The Pennission 01 API Under Royalty Azreement Calculation of Gross Heating Value, Relative Density and Compressibility Factor for Natural Gas Mixtures from Compositional Analysis [;¡PI' --- GPA Standard 2172-96 I Reaffirmed 3/2002 l J , Adopted as Tentative Standard, 1972 Revised and Adopted as Standard, 1976 Reprinted, 1974, 1980, 1982, 1988, 1991 Revised 1984, 1986, 1996 Published by Gas Processors Association 6526 East 60th Street Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:04:58 2003 Tulsa, Oklahoma 74145 American Petroleum Institute API MPMS 14.5

Upload: anhuga

Post on 17-Jan-2016

1.497 views

Category:

Documents


332 download

TRANSCRIPT

Page 1: GPA 2172-1996 (2002).pdf

Reproduced By GLOBAL ENGINEERING DOCUMENTS With The Pennission 01 API Under Royalty Azreement

Calculation of Gross Heating Value, Relative Density and Compressibility Factor

for Natural Gas Mixtures from Compositional Analysis

[;¡PI' ---

GPA Standard 2172-96 I Reaffirmed 3/2002 l

J

,

Adopted as Tentative Standard, 1972 Revised and Adopted as Standard, 1976 Reprinted, 1974, 1980, 1982, 1988, 1991

Revised 1984, 1986, 1996

Published by Gas Processors Association 6526 East 60th Street

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:04:58 2003

Tulsa, Oklahoma 74145

American Petroleum Institute

API MPMS 14.5

Page 2: GPA 2172-1996 (2002).pdf

DISCLAIMER

GPA publications necessarily address problems of a general nature and may be used by anyone desiring to do so. Every effort has been made by GPA to assure accuracy and reliability of the information contained in its publications. With respect to particular circumstances, local, state, and federal laws and regulations should be reviewed. It is not the intent of GPA to assume the duties of employers, manufacturers, or suppliers to wam and properly train employees, or others exposed, conceming health and safety risks or precautions.

GPA makes no representation, warranty, or guarantee in connection with this publication and hereby expressly disclaims any liability or responsibility for loss or damage resulting from its use or for the violation of any federal, state, or municipal regulation with which this publication may conflict, or for any infringement of letters of patent regarding apparatus, equipment, or method so covered.

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:06: 13 2003

1

Page 3: GPA 2172-1996 (2002).pdf

1. Scope

1.1 This standard presents procedures for calculating, at base conditions from composition, the following properties of natural gas mixtures: gross heating value, relative density (real and ideal), and compressibility factor. The effect of water upon these calculations is somewhat complicated. Because this document relates primarily to custody transfer, the water effect ineluded is an acceptable contractual calculation. The Appendix of this standard contains a detailed investigation of the effect of water and detailed derivations of the equations presented in the standard.

2. Summary of Method

2.1 From the composition (expressed in mole fractions) of a natural gas sample, it is possible to calculate the gross heating value, relative density and compressibility (real gas) factor for the sample. When analyzing the sample for composition, it is essential to inelude all components (other than water) with mole fractions greater tban or equal to 0.0001 in the analysis (sorne routine analyses ignore constituents such as He and H2S but they are important for accurate calculations). The gas sample should be collected according to the latest version of GPA Standard 2166 and the sample analysis should conform to the latest version of GPA Standard 2261 (or to other acceptable methods).

3. Definitions

3.1 Gross Heating Value - the amount of energy transferred as heat per mas s or mole from the complete, ideal combustion of the gas with oxygen (from air), at a base temperature in which all water formed by the reaction condenses to liquid (as explained in the Appendix this is a hypothetical state, but it is

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:06: 18 2003

2

acceptable for custody transfer). If the gross heating value has a volumetric rather than a mass or molar basis, a base pressure must be specified along with a base temperature.

3.2 Relative density - the ratio of the mass density of the gas at the measurement temperature and pressure to the density of dry air (the assumed composition of air appears in the Appendix) at the same temperature and pressure. Adjusting the result to the hypothetical ideal gas state converts the relative density into the molar mass ratio.

3.3 Compressibility Factor - the ratio of the actual volume of a given mass of gas to its volume calculated from the ideal gas law using given conditions of temperature and pressure.

3.4 Dimensions-

1 Btu/lbm = 2.326 Jeg-l (exact) 1 lbm = 453.59237 g (exact) 1 Btu ::::: 1055.0559 J 1 atm = 101325 Pa (exact)

::::: 14.69595 Ibfe in-2 (psi a) 1 ft3 ::::: 0.0283168 m3

4. Equations for Custody Transfer Calculations

4.1 Gross Heating Value (Volumetric Basis)

N ~ id = ~xiHví (1) i=1

HVid (sat) = (1- xw)HVid (dry) (2)

where Hvid is tbe gross heating value per volume at base temperature and pressure, superscript id denotes an ideal gas property, dry denotes dry gas, sat denotes gas saturated with water, Xi are mole

Page 4: GPA 2172-1996 (2002).pdf

fractions, N is the total number of components (excluding water) and Xw is the mole fraction of water in the gas. This Standard assumes that compositions are reported dry which is the usual case. The Appendix illustrates procedures for the situation in which compositions include water. The latter quantity can be calculated from

(3)

where p:at is the vapor pressure of water at the base temperature and Pb is the base pressure. The following table provides (l-xw) for sorne common base pressures

used in the United States with a base temperature of 60·P where the vapor pressure of water is 0.25636 psia.

P¡, (psia) l-xw

14.50 0.9823 14.696 0.9826 14.73 0.9826 15.025 0.9829

The next table presents (l-xw ) for sorne common base temperatures used outside the United States with a base pressure of 1 atm.

7;,( oC) (1- xw)

O 0.9940 15 0.9832 20 0.9769 25 0.9687

4.2 Relative Density

G=d/da = (MPT"Za)/(MaP.1Z) (4)

if T= Ta and P = Pa then

G = (M / Ma)(Za / Z) == Gid(Za I Z) (5)

where G is relative density, d is mass density, M is molar mass, P is pressure, T is temperature, Z is compressibility

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:06:24 2003

3

factor and subscript a denotes a property of air. Calculation from composition uses:

N

L id = x.G I I

i=1

4.3 Compressibility Pactor

(6)

At base conditions (near ambient) a simple expression which provides the compressibility (real gas) factor within experimental error for natural gas mixtures is:

(7)

where the b i are "summation factors" as defined in the Appendix and listed in Table 1. Note: AGA-8-92 is the required compressibility factor method to be used in association with calculations under API Chapter 14.3 / ANSI 2530 I AGA-3 I GPA 8185. These two methods, in general, do not provide exactly the same value. The difference should be on-the-order-of 1 part in 10,000 which is well within experimental error.

5. Example Calculations

5.1 Table 1 contains values of HV;d,

G:J and bi (along with heating values on mass and molar· bases as well as net heating values) for the normal constituents of natural gas mixtures required to calculate the various properties covered in this standard. Table 2 and Table 3 provide calculations illustrating custody transfer applications. The Appendix contains derivations and calculations illustrating the more nearly correet treatment of water.

Page 5: GPA 2172-1996 (2002).pdf

6. Computer Program

6.1 A listing of a Basic computer program which can perform either custody transfer or engineering calculations is supplied with this standard. Typical output from this program precedes the listing. The values from computer output for sorne of the properties differ from those reported in the Tables (usually by one part in the last place). This is caused by different round off and truncation protocols between the computer and the hand calculator.

7. Caution

7.1 The properties reported in this document derive from experimental measurements which, in general, are accurate to no better than 1 part in 1000.

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:06:29 2003

4

The extra digits which appear in the Tables alleviate problems associated with round-off and interna] consistency, but they are not significant.

For numerical reasons, the values of sorne properties in this standard may differ slightly from those in GPA Standard 2145 (l part in 10000 or less). These discrepancies are well within experimental error. In such cases, GP A 2145 takes preceden ce for accounting purposes and GP A 2172 takes precedence for technical calculations. The values in GPA 2145 have been adjusted to achieve complete numerical consistency within that tableo

Page 6: GPA 2172-1996 (2002).pdf

:¡;:O '" o D-~ ::::t:>:::::!. e = =;:::¡: c=::~ O~ DO = orD O"> A ~BS '-"O NO 00 00 l.N O

O '-" N V R> ~

:3 ce; o' o ::::l

u ~ c: ro e :3 ::::l

~ ~ ro

Table 1. Properties of Naltural Gas Components at 60°F and 14.696 psia (1)

Compound Formula Molar Mass Molar Mass Ideal Gross Heating Value (5) Ideal Net Heating Value

(3) Ratio, dd Hnid

Hmid

H/d

hnid

hmid

h/d

Ib.lbmol- I (4) Id· mol -1 Btu ·Ibm- I Btu·ft-J Id· mol

-1 Btu ·Ibm- I Btu . n-J

Hydrogen H2 2.0159 0.06960 286.20 61022 324.2 241.79 51566 273.93 Helium He 4.0026 0.13820 O O O O O O Water H20 18.0153 0.62202 44.409 1059.8 50.312 O O O Carbon Monoxide CO 28.010 0.96711 282.9 4342 320.5 282.9 4342 320.5 Nitrogen N2 28.0134 0.96723 O O O O O O Oxygen Ü2 31.9988 1.1048 O O O O O O Hydrogen Sulfide H2S 34.08 1.1767 562.4 7094.2 637.1 517.99 6534 586.8 Argon Ar 39.948 1.3793 O O O O O O Carbon Dioxide C02 44.010 1.5196 O O O O O O

Air (2) 28.9625 1.0000 O O O O O O

Methane CH4 16.043 0.55392 891.63 23891 1010.0 802.71 21511 909.4 Ethane C2H6 30.070 1.0382 1562.06 22333 1769.7 1428.83 20429 1618.7 Propane C3Hs 44.097 1.5226 2220.99 21653 2516.1 2043.3 19922 2314.9 i-Butane C4HIO 58.123 2.0068 2870.45 21232 3251.9 2648.4 19590 3000.4 n-Butane C4HIO 58.123 2.0068 2879.63 21300 3262.3 2657.6 19658 3010.8 i-Pentane CsHI2 72.150 2.4912 3531.5 21043 4000.9 3265.0 19456 3699.0 n-Pentane C5H12 72.150 2.4912 3535.8 21085 4008.9 3269.3 19481 3703.9 n-Hexane C6HI4 86.177 2.9755 4198.1 20943 4755.9 3887.2 19393 4403.9 n-Heptane C7H16 100.204 3.4598 4857.2 20839 5502.5 4501.9 19315 5100.3 n-Oetane CsHls 114.231 3.9441 5515.9 20759 6248.9 5116.2 19256 5796.2 n-Nonane C9H20 128.258 4.4284 6175.9 20701 6996.5 5731.8 19213 6493.6 n-Decane CIOH22 142.285 4.9127 6834.9 20651 7742.9 6346.4 19176 7189.9

(1) This table is consistent with GPA 2145-89, but it is necessary to use the values from the most recent edition of GPA 2145 for custody transfer caIculations. (2) Composition from: Jones, F. E.; J. Res. Nat. Bur. Stand., 83, 419 (1978). (3) 1984 Atomic Weights: C == 12.011, H = 1.00794, O = 15.9994, N = 14.0067, S = 32.06 (4) Molar Mass Ratio is the ratio of the molar mass of the gas to that of airo (S) Based upon ideal reaction; the entry for water represents the total enthalpy of vaporization. (6) To obtain Hvih or hvid at other pressures multiply the value in this table hy the desired pressure (in psia) divided by 14.696 psia.

5

Summation

Factor, bi

. -1 pSla

O O 0.0623 0.0053 0.0044 0.0073 0.0253 0.0071 0.0197

0.0050

0.0116 0.0239 0.0344 0.0458 0.0478 0.0581 0.0631 0.0802 0.0944 0.1137 0.1331 0.1538

Page 7: GPA 2172-1996 (2002).pdf

:¡;:o '" o D-~ ::::t:>:::::!. e = =;:::¡: c=::~ O~ DO = .. ro O O"> A .. Al ~(./)

O NO 00 00 l.N O

O Ul N V R> ~

:3 ro :o. C)

'" ::::l

u ;p.. c: ro e :3 ::::l

~ ;:::.. ro

Table 1 (cont.)

Neopentane 2-Methylpentane 3-Methylpentane 2,2-Dimethylbutane 2,3-Dimethylbutane Cyclopropane Cyclobutane Cyclopentane Cyclohexane Ethyne (acetylene) Ethene (ethylene) Propene (propylene) Benzene

Butanes (ave) Pentanes (ave) Hexanes (ave) Butenes (ave) Pentenes ave

C5H12 72.015 2.4912 3517.27 C6HI4 86.177 2.9755 4190.43 C6H14 86.177 2.9755 4193.03 C6HI4 86.177 2.9755 4180.63 C6HI4 86.177 2.9755 4188.41 C3H6 42.081 1.4529 2092.78 C4Hs 56.108 1.9373 2747.08 C5HIO 70.134 2.4215 3322.04 C6H12 84.161 2.9059 3955.84 C21f2 26.038 0.8990 1301.32 C2H4 28.054 0.9686 1412.06 C3H6 42.081 1.4529 2059.35 C6H6 78.1 14 2.6971 3202.74

C4HIO 58.123 2.0068 2875 C5HI2 72.150 2.4912 3534 C6HI4 86.177 2.9755 4190 C4Hs 56.108 1.9372 2716 C5HIO 70.134 2.4215 3375

20958 3985 3250.8 19371 3683 20905 4747 3879.6 19355 4395 0.080 20918 4750 3882.2 19367 4398 0.080 20856 4736 3869.8 19306 4384 0.080 20895 4745 3877.5 19344 4393 0.080 21381 2371 1959.6 20020 2220 21049 2747 2569.4 19688 2911 20364 3764 3100.0 19003 3512 20208 4482 3689.4 18847 4180 21487 1474 1256.9 20753 1424 ·0.021 21640 1600 1323.2 20278 1499 0.020 21039 2333 1926.1 19678 2182 0.033 18177 3742 3169.5 17444 3591 0.069

21266 3257 2653 19623 3006 0.046 21056 4003 3267 19469 3702 0.062 20904 4747 3879 19353 4395 0.080 20811 3077 2538 19450 2876 0.046 20691 3824 3153 19328 3572 0.060

6

Page 8: GPA 2172-1996 (2002).pdf

:¡;:O '" o D-~ ::::t:>:::::!. e = =;:::¡: c=::~ O~ DO = .. ro O "'A ~BS "'O NO 00 00 l.N O

O Ul N V R> ~

:3 ce; o· o ::::l

u ;:s. c: ro e :3 ::::l

~ ~ ro

Table 2. Example Calculations of Gas Prollerties at 60°F and 14.696 lisia (Gas Analysis on Dry Basis)

Compound x¡ a¡

Methane 0.8302 1 Ethane 0.0745 2 Propane 0.0439 3 i-Butane 0.0083 4 n-Butane 0.0108 4 i-Pentane 0.0031 5 n-Pentane 0.0025 5 Hexane 0.0030 6 Helium 0.0003 O Nitrogen 0.0032 O Carbon Dioxid. 0.0202 O

Summation 1.0000

Xw = 1.0(0.25636)/14.696 = 0.0174

Gid (dry gas) = 0.6991

fl¡ H ¡d r¡ v. ,

4 O 1010.0 6 O 1769.7 8 O 2516.1

10 O 3251.9 10 O 3262.3 12 O 4000.9 12 O 4008.9 14 O 4755.9

O O O O O O O O O

dd , b¡ x¡a¡ x¡fl¡ x¡r¡ ·d

x¡Hv; ·d

x¡c:

0.55392 0.0116 0.8302 3.3208 O 838.5 0.4599 1.03820 0.0239 0.1490 0.4470 O 131.8 0.0773 1.52260 0.0344 0.1317 0.3512 O 110.5 0.0668 2.00680 0.0458 0.0332 0.0830 O 27.0 0.0167 2.00680 0.0478 0.0432 0.1080 O 35.2 0.0217 2.49120 0.0581 0.0155 0.0372 O 12.4 0.0077 2.49120 0.0631 0.0125 0.03 O 10.0 0.0062 2.97550 0.0802 0.0180 0.0420 O 14.3 0.0089 0.13820 O O O O O 0.0000 0.96723 0.0044 O O O O 0.0031 1.51960 0.0197 O O O O 0.0307

1.2333 4.4192 O 1179.7 0.6991

1 - X w = 0.9826

Gid (sat gas) = 0.6991(0.9826) + 0.0174(0.62202) = 0.6978

x¡b¡

0.00963 0.00178 0.00151 0.00038 0.00052 0.00018 0.00016 0.00024 0.00000 0.00001 0.00040

0.01481 -

Z (dry gas) = 1 - [0.01481]204.696) = 0.9968

Z (dry air) = 1 - [0.0050]204.696) = 0.9996

G (dry gas, dry air) = 0.6991(0.9996)/0.9968 = 0.7011

G (dry gas, sat air) = 0.6991(0.9995)/0.9968 = 0.7010

Z (sat gas) = 1 - [0.9826(0.01481) + 0.0174(0.0623)]204.696) = 0.9964

Z (sat air) = 1 - [0.9826(0.0050) + 0.0174(0.0623)]204.696) = 0.9995

G (sat gas, dry air) = 0.6978(0.9996)/0.9964 = 0.7001

HVid (dry gas, dry air) = 1179.7 Btu·ft-3

Hvid (sat gas, dry air) = 1179.7(0.9826) = 1159.1 Btu·ft-3

G (sat gas, sat air) = 0.6978(0.9995)/0.9964 = 0.7000

{HVid /Z }(dry gas, dry air) = 1179.7/0.9968 = 1183.5 Btu·ft-3

{HvidJZ} (sat gas, dry air) = 1159.1(0.9964) = 1163.3 Btu·ft-3

Note Division of Hvid by Z does not give a real gas heating value but rather an ideal gas heating value per real cubic feet. Any digits carried beyond 1 part in 1000 are not significant but only allieviate round-off error. Although C02 has a carbon atom, its a = O because it is not part of the fu el formula CaHI3Sy.

7

Page 9: GPA 2172-1996 (2002).pdf

:¡;:o '" o D-~ ::::t:>:::::!. e = =;:::¡: c=::~ O~ DO = orD O"> A éj,;:::o N(./)

O NO 00 00 l.N O

O Ul N V R> ~

:3 ro :o. n '" ::::l

u ~ c: ro e :3 ::::l

~ ~ ro

Table 3. Example Calculations of Gas Properties at 60°F and 14.696 psi a (Gas Analysis on Wet Basis)

{Ji H id dd b¡ xi{J¡ 'd 'd

Compound x¡ a¡ Y¡ v¡ I x¡a¡ x¡Y¡ x¡Hv; x¡G; x¡b¡

Methane 0.8157 1 4 O 1010.0 0.55392 0.0116 0.8157 3.2629 O 823.9 0.4518 0.00946 Ethane 0.0732 2 6 O 1769.7 1.03820 0.0239 0.1464 0.4392 O 129.5 0.0760 0.00175 Propane 0.0431 3 8 O 2516.1 1.52260 0.0344 0.1294 0.3451 O 108.5 0.0657 0.00148 i-Butane 0.0082 4 10 O 3251.9 2.00680 0.0458 0.0326 0.0816 O 26.5 0.0164 0.00037 n-Butane 0.0106 4 10 O 3262.3 2.00680 0.0478 0.0424 0.1061 O 34.6 0.0213 0.00051 i-Pentane 0.0030 5 12 O 4000.9 2.49120 0.0581 0.0152 0.0366 O 12.2 0.0076 0.00018 n-Pentane 0.0025 5 12 O 4008.9 2.49120 0.0631 0.0123 0.0295 O 9.8 0.0061 0.00015 Hexane 0.0029 6 14 O 4755.9 2.97550 0.0802 0.0177 0.0413 O 14.0 0.0088 0.00024 Helium 0.0003 O O O O 0.13820 O O O O O O 0

1

Nitrogen 0.0031 O O O O 0.96723 0.0044 O O O O 0.0030 O Carbon Dioxid« 0.0198 O O O O 1.51960 0.0197 O O O O 0.0302 0.00039 Water 0.0174 O O O 50.3 0.62202 0.0623 O O O 0.9 0.0108 ¡ 0.00109

Summation 1.0000 1.2118 4.3421 O 1160.0 0.6977 . 0.01564

(]id (sat gas) = 0.6977

Z (sat gas) = 1 - [0.01564]2(14.696) = 0.9964

Z (dry air) = 1 - [0.0050]2(14.696) = 0.9996

G (sat gas, dry air) = 0.6977(0.9996)/0.9964 = 0.6999

Hv id (sat gas, dry air) = 1160.0 - 0.9 = 1159.1 Btu·ft-3

Z (sat air) = 1 - [0.9826(0.0050) + 0.0174(0.0623)]2(14.696) = 0.9995

G (sat gas, sat air) = 0.6977(0.9995)/0.9964 = 0.6999

{HvidíZ} (sat gas, dry air) = 1159.1(0.9964) = 1163.3 Btu·ft-3

Note Division of Hvid by Z does not give a real gas heating value but rather an ideal gas heating value per real cubic feet. Any digits carried beyond 1 part in 1000 are not significant but only alIieviate round-off error. Although C02 has a carhon atom, its a = O because it is not part of the fuel formula CaHpSy.

8

Page 10: GPA 2172-1996 (2002).pdf

APPENDIX

DETAILS OF CALCULATION METHODS AND TREATMENT OF WATER

Custody transfer of natural gas utilizes a simple pricing equation which states that the cost of gas is the rate of energy re1eased upon combustion multiplied by the price of gas per energy unit multiplied by the time or accounting periodo The rate of energy released upon combustion is the product of the heating value of the gas and the fIowrate of the gas. The flowrate of the gas requires knowledge of the compressibility factor and the relative density of the gas. All three custody transfer properties (heating value, compressibility factor, and relative density) can be calculated from the composition given pure component property tables.

This appendix presents rigorous equations to calculate from composition the custody transfer properties of natural gas. The equations for calculating the properties of dry natural gas are well known, but this appendix also presents an account of the effects of water contained in the gas and in the air used to bum the gas.

EQUATION DEVELOPMENT

The heating value of a natural gas is the absolute value of its enthalpy of combustion in an ideal combustion reaction. The heating value is, therefore, an ideal gas property that can be calculated unambiguously from tables of pure component values and it has no pressure dependence.

An ideal combustion reaction with fuel and air in the ideal gas state and the possibility of water in the füel and air is:

CaHpS/id) +(a+ {3/4 +r)(1 + e)Q(id)+O.04383(a + {3/4 + r)(l + e)Ar(id)

+ [O.00162(a + {3/4 + r)(l + e) + Xc 1(1- xN - xcl]C02(id)

+ [3.72873(a + {314 + r)(1 + e) + xN /(1- xN - xcl]N2(id) + (n! + n: )H20(id)

= [a +O.OOI62(a + {3/4 +r)(1 + e) + xc /(I- xN - xc)]C02(id)

+ n:Hp(id) + n:H20( 1) + ¡S02 (id)

+ [3.72873(a + {3/4 + r)(l + e) + x N 1(1- x N - Xc )JN2(id)

+O.04383(a + {3/4 + r)(1 + e)Ar(id) + (a + {3/4+r)e02(id)

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:06:57 2003

9

(1)

Page 11: GPA 2172-1996 (2002).pdf

where "id" denotes the ideal gas state, a, f3 and r are stoichiometric coefficients, e ís the fractíon

excess air, the composition of air is assumed to be that of Table Al, n! are the moles of water

contained in the gas, n: are the moles of water contained in the air, n: are the moles of water

contained in the product gas mixture, n; are the moles of gas which actually condense, Xc is the

mole fraction of CO2 in the gas and X N is the mole fraetion of N2 in the gas. If air has been injected into the gas, it is assumed that the effect is accounted for in the excess fraction e. Fuel gas

mixtures would have non-integer values of a, f3 and r.

It is customary to define hypothetical referenee states for the water formed by the reaction denoted by Equation 1 (as opposed to "speetator" water which enters the reaction carried by the gas or air). If we as sume that the water formed in the reaction remains in the ideal gas state, the heating value is termed "net." If we assume that the water formed in the reaction condenses totally to the liquid state, the heating value is termed "gross." The gross heating value is greater than the net heating value by the ideal enthalpy of vaporization for water:

Heating value (gross) - Heating value (net) = Hw{id) - Hw(l) (2)

where H denotes enthalpy, 1 denotes liquid state and subscript w indicates water. The quantity

Hw(id) - Hw(l) is the ideal enthalpy of vaporization for water.

It is possible to calculate a real gas heating value rather than using a hypothetical state, but the calculations are tedious, the numerícal values are negligibly different and the mathematical simplicity of the defining equation is lost. lt is customary in the gas industry to use gross heating value for most calculations, so for the remainder of this appendix the term "heatíng value" refers to the gross value.

Heating value is measured on a mass or molar basis and con verted to the ideal gas state for reporting. Thus, at any given temperature the heating value is

(3) i=1

(4)

where Hn id is the heating value in energy per mole, Xi is the mole fraetion, N is the number of

components in the mixture, Hm id is the heating value in energy per mass, and M is the molar

mass. Clearly, Hm id multiplied by the molar mass (with units of mass per mole) gives Hn id•

Both Hn id and Hm id are independent of pressure, but both are functions of temperature and composition.

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:03 2003

10

Page 12: GPA 2172-1996 (2002).pdf

The natural gas industry uses heating value with dimensions of energy per volume in its ca1culations.

'¡ese dimensions result from multiplying Hnid

or Hmid

by density or mass density of the ideal gas ;spectively:

N

Hvid =(P/ RT)Hnid =(MP/ RT)Hmid = LxiHv/d

i=1 (5)

where HVid

is the heating value in energy per volume, P is absolute pressure, T is absolute temperature and R

is the gas constant (=8.314471 Jemol- 1eKl=1O.7316 psiaeft3elbmol-¡e·R-I). HVid

depends upon temperature,

composition and pressure. Table A2 contains values for HVid

at 60 'p and 14.696 psia. These values are only valid at the specified T and P. Conversion to another pressure is simply a matter of multiplying by the ratio of the new P and 14.696 psia:

HV id = HV id (Table2)[P /14.696] (6)

When using Eguation 6, H/d

(Table A2) should be ca1culated using the values from Table A2 in Eguation 5; the individual values in Table A2 should not be con verted. Conversion to another temperature is more complicated. Heating value data exist at 25 oC based upon the reaction:

(7)

The experiments use pure oxygen and are corrected to stoichiometric proportions. It is necessary to correct the_ sensible heat effects to arrive at a different temperature:

Hn id (T) = Hn id (25) + f~l~ L C~ - L C~d "LT

rr r J ~here

" C d = aCid + (f.l /2)Cd + ,í'id ~ p p.CO, fJ p,H,O ¡'-p,SO, rr

" Cid = Cid + (a + f.l / 4 + y)Cid ~ P p,CaHpS, fJ p.O,

r

'd

and C~ is the ideal specific heat at constant pressure, r denotes reactants and rr denotes products.

The cost of gas comes from the simple accounting eguation

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:08 2003

11

(8)

(9)

(lO)

(11)

Page 13: GPA 2172-1996 (2002).pdf

where e is the cost, (¿id is the ideal rate of energy transfer, pid is the price of gas per ideal energy

unit andilt is the accounting periodo Using real gas rate of energy transfer merely requires a price of gas per real energy unit which would differ from that in Equation 11 in exact proportion to the

ratio of (¿ and (¿id

( 12)

(¿id results from multiplication of heating value by gas flowrate

(13)

where n, m and Vid are the molar, mass and ideal gas flowrates, respectively. Gas industry practice dictates use of real gas volumetric flowrate (most flowmeters, such as orifices, provide naturally the mass flowrate which, if used, would lead to more accurate measurement). Thus, it is necessary to convert the real gas flowrate into an ideal gas flowrate to use in Equation 13

(14)

where Z is the compressibility factor (which is defined as the ratio of real gas volume to ideal gas volume). Now the energy flowrate becomes

(15)

The factor l/Z in Equation 15 rigorously converts the real gas flowrate into an ideal gas flowrate. It does not convert heating value into a real gas property. Often calorimeter and chromatograph

manufacturers report the value of HVid IZas output. This is a convenience for the user allowing

immediate multiplication by V and thus satisfying Equation 15.

The truncated virial equation of state satisfactorily represents Z at pressures near ambient

Z = I+BPI RT (16)

where B is the second virial coefficient which is a function only of temperature and composition. The virial coefficient is (to a good approximation)

where the bi are "summation factors" which equal

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:14 2003

12

(17)

Page 14: GPA 2172-1996 (2002).pdf

(18)

Table 2 lists values for bi •

Another property required to evaluate flowrate is the molar mass of the gas. Historically, the gas industry obtains this value from measurements of the gas relative density which is the mass density of gas divided by the mas s density of air

(19)

where d is mass density and subscript a refers to air. If the P and T of gas and air are identical (as recommended for measurement)

(20)

where Gid is ideal relative density which equals the molar mass ratio of gas to airo The molar

mass of air for the assumed composition is 28.9625 g-mol- 1. Gid is a simple function of composition

t=-i

Table A2 lists values for G/d.

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:20 2003

(21 )

13

Page 15: GPA 2172-1996 (2002).pdf

ACCOUNTING POR WATER

If the gas contains water (or must be assumed to be saturated) but the compositíonal analysis is on a dry basis, it is necessary to adjust the mole fractions to account for the fact that water has displaced sorne gas, thus lowering the heating value. The mole fraetion of water in the gas results from the definition of relative humidity

(22)

(based upon one mole ofthe fue! Ca Hf3Sy) where h~ is the relative humidity of the gas, P:' is thc

vapor pressure of water and nw denotes moles of water. For saturated gas hg is unity. Rearranging Equation 22 gives the moles of water

The corrected mole fractions then become

(24)

and the heating valuebecomes

N

HVid = (1- xwYLx;nHv;d (25) i=l

where water is not included in the N components of the sumrnation. If the compositional analysis

determines Xw and water is inc1uded in the N components of the summation

N

H id = ~ x~<1 HVid - X HVid V L.,¿, l W 11/ (26)

i=l

It is necessary to remove the effect of water because, although water has a heating value, it is only a condensation effeet. Water carried by wet gas (spectator water) does not actually condense and, by definitíon, water formed in the reaction contributes to heating value.

Accounting for water in the aboye manner is sufficient for defined custody transfer conditions, but when trying to model actual situations the question beeomes much more complicated. It is obvious that aH of the reaction water actuaHy cannot condense because in a situation in which both gas and air are dry sorne of the reaetion water saturates the produet gases

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:25 2003

14

Page 16: GPA 2172-1996 (2002).pdf

and the remainder condenses. 1t is possible to account for these effects in a general manner. To do

.. t lIt g a v d 1 SO, It IS necessary O ca cu a e nw' nw' nw, an nw'

n! 1[1 + (X N + Xc )/(1- x N - xc) + n~,] = hK P,,~ 1 P

n! = (h g P,,~ 1 P)/[(l- x N - xc)(l- hKp,,~ 1 p)

n: I[ 4.77418( a + /314 + y)(1 + E) + n~.] = hU p.~ / P

n:. = 4.77418(a + /3/4 + y)(1 + E)(ha P: 1 P)/(I- ha p.~ 1 p)

n: I{a + y +(XN + xc)/(l- XN - xc)+ (a + /314 + y)[0.00162(1 + E)

+3.72873(1 + E) + 0.04383(1 + E) + E] + n:J = P: / P

< = {a + y + (x N + xc)/(I- xN - Xc) + (a + /314 + y)[0.00162(1 +E)

+3.72873(1 +E)+0.04383(1 +t:)+ E]}(P: / P)/(l- P: / p)

(27)

(28)

(29)

(30)

where hu is the relative humidity of the airo Equation 27 and 28 are reformulations of Equation 22 to refIect inlet conditions. Equation 29 reflects Equation 22 for the saturated product gas (it must

be saturated before any water can condense). Equation 30 is a water balance: /3/2 are the moles

of water formed by the reaction, n! + n: are the moles of water which enter with the gas and air,

n: are the moles of water which saturate the product gas and n! are the moles of water which condense. Therefore, the complete correction for the effect of water on heating value is:

HVid = Hv id (Equation250r26) + {(h K P: / P)/(l- x N - xc)(l- hK P: 1 P)

+4.77418(a + {314 + y)(l +E)(h"P: / P)/(l- ha P: / P)

-[a + y + (xN - xc)/(l- xN - xd + (a + /314 + y)(3.77418 + 4.77418E)]

x(p: /P)/(l-P,,~ IP)}Hv: (31)

Depending upon the relative humidities of the gas and air, the observed heating value can be greater or smaller than that ca1culated using Equation 25 or 26. A humidity of air exists for each

gas aboye which lIV id is greater than that calculated by Equation 25 or 26. That critical value

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:31 2003

15

Page 17: GPA 2172-1996 (2002).pdf

depends upon the gas composition, the humidity of the gas and the amount of excess air. For

pure, dry methane with no excess air hu = 0.79345.

REAL GAS PROPERTIES

In principal, we have enough information to convert the heating value to a real gas property

(it is not necessary to do so for relative density because the molar mass ratio, Gid, is the desired

property). This is simply a matter of evaluating the integral:

(32)

where

(33)

where V is the molar volume. The temperature dependen ce of b must be defined, but in the custody transfer region it is easy to do so. The products and reactants again correspond to Equation 7.

While it is obviously possible to make the required calculations to convert the heating value into a real gas property, it serves no custody transfer purpose to do so. As we have seen, the cost equation is unchanged; the calculations, while obvious, are tedious; Hn is slightly different from Hnid because the base pressure is Iow; the likelihood of having aIl the information required to employ Equation 31 is remote.

The heating value is defined in a hypothetical state. It is not possible, at base conditions, to have all the water formed in the reaction be either all gas or allliquid; sorne of the water formed is in each state. Thus, if the definition is of a hypothetical state, using a hypothetical real gas rather than an ideal gas state adds nothing but complexity.

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:36 2003

16

Page 18: GPA 2172-1996 (2002).pdf

Table Al

Assumed Composition of Air from: Jones, F. E.; J. Res. Nat. Bur. Stand.; 83; 419 (1978)

Component Mole Fraction

N2 0.78102

°2 0.20946

Ar 0.00918

C02 0.00034

1.00000

Table A2 Properties of Natural Gas Components at 60°F and 14.696 psi a

Component Formula

Water H20

Nitrogen N2 Carbon Dioxide C02

Air Table 1 Methane CH4

Ethane C2H6 Propane C3H8 i-Butane C4H lO Butane C4H 1O i-Pentane C5H12 Pentane C5H 12 Hexane C6H14

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:42 2003

G id b (psia-2)

0.62202 0.0623

0.96723 0.0044

1.5196 0.0197

1.00000 0.0050 0.55392 0.0116

1.0382 0.0239

1.5226 0.0344

2.0068 0.0458

2.0068 0.0478

2.4912 0.0581

2.4912 0.0631

2.9755 0.0802

17

HVid (Btu. ft-3)

50.312

O

O

O 1010.0

1769.7

2516.1

3251.9

3262.3

4000.9

4008.9

4755.9

Page 19: GPA 2172-1996 (2002).pdf

:¡;:O '" o D-~ ::::t:>:::::!. e = =;:::¡: c=::~ O~ DO = orD --JA .. Al +>(./) --JO NO 00 00 l.N O

O Ul N V R> ~

:3 ro :o. C)

'" ::::l

u ;:s. c: ro e :3 ::::l

~ ;:::.. ro

Table A3. Example Calculatioos of Gas Properties at 60°F aod 14.696 psia (Gas Aoalysis 00 Dry Basis)

Compound Xi a¡

Methane 0.8302 1 Ethane 0.0745 2 Propane 0.0439 3 i-Butane 0.0083 4 n-Butane 0.0108 4 i-Pentane 0.0031 5 n-Pentane 0.0025 5 Hexane 0.0030 6 Helium 0.0003 O Nitrogen 0.0032 O Carbon Dioxidl 0.0202 O

Summation 1.0000

hg = 0.3, ha =0.5

x~= 0.3(0.25636)/14.696 = 0.0052

Gid = 0.6991

(J¡ Y¡ H id v¡

4 O 1010.0 6 O 1769.7 8 O 2516.1

10 O 3251.9 10 O 3262.3 12 O 4000.9 12 O 4008.9 14 O 4755.9

O O O O O O O O O

Z = 1 - [0.9948(0.01481) + 0.0052(0.0623)]2(14.696) = 0.9967

Z a = 1 - [0.9913(.0050) + 0.0087(0.0623)]2(14.696) = 0.9996

G = 0.6991(0.9996)/0.9967 = 0.7011

HVid = 0.9948(1179.7) = 1173.6 Btu·ft-3

cid I

0.55392 1.03820 1.52260 2.00680 2.00680 2.49120 2.49120 2.97550 0.13820 0.96723 1.51960

b¡ x¡a¡ xJ3¡ x¡Y¡ ¡d

x¡Hv¡ ¡d

x¡G¡

0.0116 0.8302 3.3208 O 838.5 0.4599 0.0239 0.1490 0.4470 O 131.8 0.0773 0.0344 0.1317 0.3512 O 110.5 0.0668 0.0458 0.0332 0.0830 O 27.0 0.0167 0.0478 0.0432 0.1080 O 35.2 0.0217 0.0581 0.0155 0.0372 O 12.4 0.0077 0.0631 0.0125 0.03 O 10.0 0.0062 0.0802 0.0180 0.0420 O 14.3 0.008.9

O O O O O 0.0000 0.0044 O O O O 0.0031 0.0197 O O O O 0.0307

1.2333 4.4192 O 1179.7 0.6991 -

P; = 0.25636 psia E. = 0.2

x~= 0.5(0.25636)/14.696 = 0.0087

Hvid /Z = 1173.6/0.9967 = 1177.5 Btu·ft-3

HVid (obs) = 1173.6 + {0.0052/[0.9766(0.9948)] + 4.77418(2.3381)(1.2)(0.0087)10.9913) - { 1.2333 - 0.0170/0.9766 + 2.3381 [3.77418 +

4.77418(0.2)]}(0.25636114.696)/(1 - 0.25636/14.696)}50.312 = 1168.8 Btu·ft-3

Note Division of Hvid by Z does not give a real gas heating value but rather an ideal gas heating value per real cubic feet. Any digits carried beyond 1 part in 1000 are not significant but only allieviate round-off error. Although C02 has a carbon atom, its a = O because it is not part of the fuel formula CaH¡:ISy.

18

x¡b¡

0.00963 0.00178 0.00151 0.00038 0.00052 0.00018 0.00016 0.00024 0.00000 0.00001 0.00040

0.01481

Page 20: GPA 2172-1996 (2002).pdf

NATURAL GAS PROPERTIES FROM COMPOSITION

CONDITIONS: TCheating value) = 60 DEG F T(density) = 60 DEG F P = 14.696 psi a

ANALYSIS

x(CH4) = 0.8302 x(C6HI4) = 0.0030 x(C2H6) = 0.0745 x(C7HI6) = 0.0000 x(C3H8) = 0.0439 x(C86HI8) = 0.0000 x(iC4H10) = 0.0083 x(C9H20) = 0.0000 x(C4HIO) = 0.0108 x(CIOH22) = 0.0000 x(iC5H12 = 0.0031 x(H2) = 0.0000 x(C5HI2) = 0.0025 x(He) = 0.0003

Molar Mass = 20.248 Molar Mass Ratio = 0.69909 Relative Density = 0.70109 Compressibility Factor = 0.99677

SATURATED ANALYSIS

x(CH4) = 0.8157 x(C2H6) = 0.0732 x(C3H8) = 0.0431 x(iC4HIO) = 0.0082 x(C4HIO) = 0.0106 x(iC5H12 = 0.0030 x(C5H12) = 0.0025

Molar Mass Molar Mass Ratio Re1ative Density Compressibility Factor

CONDITIONS:

= 20.209 = 0.69775 = 0.70001 = 0.99639

x(C6HI4) = 0.0029 x(C7HI6) = 0.0000 x(C86HI8) = 0.0000 x(C9H20) = 0.0000 x(CIOH22) = 0.0000 x(H2) = 0.0000 x(He) = 0.0003

WET ANAL YSIS

RELATIVE HUMIDITY=0.5 HUMIDITY OF GAS=0.3 SATURATED ANALYSIS

x(CH4) = 0.8259 x(C2H6) = 0.0741 x(C3H8) = 0.0437 x(iC4HlO) = 0.0083 x(C4HlO) = 0.0107 x(iC5H12 = 0.0031 x(C5HI2) = 0.0025

Molar Mass Molar Mass Ratio Relative Density Compressibility Factor

= 20.235 = 0.69868 = 0.70075 = 0.99666

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:53 2003

x(C6HI4) = 0.0030 x(C7HI6) = 0.0000 x(C86HI8) = 0.0000 x(C9H20) = 0.0000 x(ClOH22) = 0.0000 x(H2) = 0.0000 x(He) = 0.0003

19

x(H20) = 0.0000 x(CO) = 0.0000 x(N2) = 0.0032 x(02) = 0.0000 x(H2S) = 0.0000 x(Ar) = 0.0000 x(C02) = 0.0202

GROSS HEA TING V ALUES 22111 Btu-lb-1

1179.7 Btu-(ldeal CF)-l 1183.6 Btu-(Real CF)-l

x(H20) = 0.0174 x(CO) = 0.0000 x(N2) = 0.0031 x(02) = 0.0000 x(H2S) = 0.0000 x(Ar) = 0.0000 x(C02) = 0.0198

GROS S HEA TING V ALUES 21767 Btu-Ib-1

1159.2 Btu-(ldeal CF)-I 1163.3 Btue(Real CF)-I

FRACTION OF EXCESS AIR=0.2

x(H20) = 0.0052 x(CO) = 0.0000 x(N2) = 0.0032 x(02) = 0.0000 x(H2S) = 0.0000 x(Ar) = 0.0000 x(C02) = 0.0201

GROSS HEA TING VALUES 21919 Btu-Ib-I

1168.8 Btu-(ldeal CF)-I 1172.7 Btu-(Real CF)-I

Page 21: GPA 2172-1996 (2002).pdf

CALL TEXTFONT (4) REM REM REM REM REM REM REM REM *************************** DECLARE ************************************

REM ************************** VARIABLES *********************************** REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM

Al, A2, A3 AA, AB, AC, AD ALPHA B BETA BP COW EA

F$, FILENAME$ FAC GAMMA

GI GR Hl - H5, HC H HA HG HM, HV, HVR HN HNA ITR, ITR2 NA$ NAW NGW NVW

P PC PP PW RM

SUMX Tl T2 TA, TB TC TR VC X XW Z Zl, Z2 ZA

SPECIFIC HEAT CONSTANTS CALCULATION VARIABLES FOR SPECIFIC HEATS NUMBER OF CARBON ATOMS IN THE FUEL SUMMATION FACTOR NUMBER OF HYDROGEN ATOMS IN THE FUEL SECOND VIRAL COEFFICIENT CHECK VARIABLE FOR MOLE FRACTIONS SUM FRACTION OF EXCESS AIR CHARACTER STRING VARIABLES CALCULATION VARIABLE FOR Z NUMBER OF SULFUR ATOMS IN FU EL MOLAR MASS RATIO RELATIVE DENSITY CALCULATION VARIABLES FOR HEATING VALUE HEATING VALUE AT 25 C KJ/MOL RELATIVE HUMIDITY OF AIR RELATIVE HUMIDITY OF GAS GROSS HEATING VALUE HEATING VALUE OF GAS DUMMY VARIABLE FOR HN

COUNTER VARIABLES FOR LOOPS NAME STRING MOLES OF WATER ENTERING WITH AIR MOLES OF WATER ENTERING WITH GAS MOLES OF WATER IN VAPOR PHASE PRESSURE CRITICAL PRESSURE PRESSURE IN PASCALS VAPOR PRESSURE OF WATER MOLAR MASS SUM OF MOLE FRATIONS BASE TEMPERATURE FOR RELATIVE DENSITY BASE TEMPERATURE FOR HEATING VALUE DUMMY VARIABLES FOR Tl AND T2 CRITICAL TEMPERATURE REDUCED TEMPERATURE CRITICAL VOLUME MOLE FRACTION WATER SATURATED MOLE FRACTIONS COMPRESSIBILTY FACTOR OF GAS CALCULATION VARIABLES FOR WATER VAPOR PRESSURE COMPRESSIBILTY FACTOR OF AIR

REM ************************************************************************

REM REM REM

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:07:59 2003

20

Page 22: GPA 2172-1996 (2002).pdf

REM REM REM REM ********************* SETTING UP TITLE PAGE ***************************

REM CLS PRINT; PRINT ; PRINT PRINT PRINT SPC(20); "CALCULATION OF GROSS HEATING VALUE," PRINT PRINT SPC (16); "RELATIVE DENSITY and COMPRESSIBILITY FACTOR" PRINT PRINT SPC(26); "for NATURAL GAS MIXTURES" PRINT PRINT SPC(25); "from COMPOSITIONAL ANALYSIS" PRINT PRINT SPC(36); "1993" PRINT PRINT SPC(25); "GAS PROCESSORS ASSOCIATION" PRINT PRINT SPC(27); "6526 EAST 60th STREET" PRINT PRINT SPC(25); "TULSA, OKLAHOMA 74145 USA" PRINT PRINT SPC(31); "developed at" PRINT SPC(10); "Texas A & M University, College Station, Texas 77843 USA" PRINT; PRINT ; PRINT : PRINT SPC(5); "(press the space bar)" 10 I$ = INKEY$; IF 1$ = "" GOTa 10 CLS : PRINT : PRINT : PRINT : PRINT : PRINT INPUT "DO YOU WISH TO SAVE THE OUTPUT TO A FILE"; F$ IF F$ "Y' THEN 20 IF F$ = "y" THEN 20 GOTa 30 20 PRINT "Name the drive and file." PRINT "For example, B:STREAMl.DAT" INPUT "What are the drive and filename"; FileName$ OPEN "o", 1, FileName$ REM REM ******************* DIMENSIONING VARIABLES ***************************** REM 30 DIM X(21}, TC(21), VC(21J, A1(22), A2(22), A3(22) DIM RM(21), NA$(21), B(21), H(21) DI~1

REM

V1\ 1'l1 , .l~\~.J..1

REM ******************* READING IN DATA ************************************ REM FOR A = 1 TO 21

READ NA$ (A) NEXT A DATA " (CH4) DATA " (C5H12) DATA " (H2) DATA " (H2S) FOR A = 1 TO 21

" (C2H6) " (C3H8) "(C6H14) " (C7H16) " (He) " (H20) " (AR) " (C02)

"(iC4H10) " " (C8H18) " (CO)

"(C4H10) "(C9H20) " (N2)

_READ Te (A), VC (A), Al (A), A2 (A), A3 (A), H (A), RM (A) NEXT A READ A1(22}, A2 {22}, A3(22) DATA 190.55, .0000990, DATA 305.33, .0001470, DATA 369.85, .0002000, DATA 407.85, .0002590, DATA 425.16, .0002550, DATA 460.43, .0003060, DATA 469.70, .0003040, DATA 507.40, .0003700,

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:08:04 2003

4.1947, 5.9569, 8.2671,

10.8240, 11.1090, 13.4120, 13.5870, 16.1340,

.003639, .00001490, 890.630,

.013770, .00001690, 1560.690,

.022860, .00001900, 2219.170,

.031530, .00000820, 2868.200,

.028750, .00001820, 2877.400,

.035400, .00001400, 3528.830,

.032880, .00001400, 3535.770,

.039860, .00003600, 4194.950,

21

" (iC5H12) "(C10H22) " (02)

16.0430 30.0700 44.0970 58.1230 58.1230 72.1500 72 .1500 86.1770

Page 23: GPA 2172-1996 (2002).pdf

DATA 540.20, .0004320, 18.6420, .047860, .00003840, 4853.430, 100.2040

DATA 568.83, .0004920, 21.1920, .054800, .00004300, 5511.800, 114.2310

DATA 594.64, .0005480, 23.7300, .061720, .00004760, 6171.150, 128.2580

DATA 617.60, .0006030, 26.2800, .068900, .00005250, 6829.700, 142.2850

DATA 33.20, .0000650, 3.4330, .001550, -.00000740, 285.830, 2.0159 DATA 5.19, .0000573, 2.5000, .000000, .00000000, 0000.000, 4.0026 DATA 647.14, .0000559, 4.0260, .000410, .00000255, 44.106, 18.0153 DATA 132.91, .0000930, 3.5030, .000090, .00000090, 282.980, 28.0100 DATA 126.20, .0000891 , 3.5020, .000060, .00000000, 0000.000, 28.0134 DATA 154.58, .0000733, 3.5200, .000440, .00000280, 0000.000, 31. 9988 DATA 373.40, .0000982, 4.0700, .001180, .00000280, 562.010, 34.0800 DATA 150.86, .0000746, 2.5000, .000000, .00000000, 0000.000, 39.9480 DATA 304.21, .0000942, 4.3240, .005800, -.00000650, 0000.000, 44.0100 DATA 4.707, .0043900, 0.0000013 K$ = "Y" : L$ = lIyl1

REM REM ****** INPUTTING TEMPERATURE, PRESSURE, AND MOLE FRATIONS *************** REM 40 CLS : PRINT : PRINT : PRINT : IF K$ = "Y" THEN 50 IF K$ = "y" THEN 50 PRINT : PRINT : PRINT : IF K$ <> "Y" THEN 80 50 PRINT SPC(3); "Do you use the same base temperature for density and heating va1ue" INPUT Y$: IF Y$ = "Y" THEN 60 IF Y$ = "y" THEN 60 INPUT "What is the base temperature for density? ", T1: TA = T1 INPUT "What is the base temperature for heating va1ue? ", T2: TB T2 GOTO 70 60 INPUT "What is the base temperature?" T1: T2 = T1 TA = T1: TB = T2 70 INPUT "What is the base pressure?" P Ti = TA: T2 = TB ITR2 = O IF L$ = "Y" THEN 90 IF L$ = "y" THEN 90 IF L$ <> "y" THEN 100 IF L$ <> "Y" THEN 100 90 FOR A = 1 TO 21

PRINT "X"; NA$ (A); "=";

INPUT X(A) XA(A) = X(A)

NEXT A 100 FOR 1 = 1 TO 21 XII) = XA(I)

NEXT 1 CLS : PRINT : PRINT : PRINT PRINT SPC(21); "NATURAL GAS PROPERTIES FROM COMPOSITION": PRINT : PRINT IF T1 >= 30 THEN 110 PRINT "CONDITIONS:"; SPC(l); "T(heating va1ue) ="; T2; "C;"; SPC(2); "T(density) ="; T1; "C;"; SPC (2); "P ="; P; "kPA": PRINT T1 = T1 + 273.15: T2 = T2 + 273.15 PP = P * 1000 GOTO 120 110 PRINT ·CONDITIONS:"; SPC(l); "T(heating va1ue) ="; T2; "F;"; SPC(2); "T(density) ="; Ti; "F;"; SPC(2); "P ="; P; "PSIA": PRINT T1 = (T1 + 459.67) I 1.8: T2 = (T2 + 459.67) I 1.8 PP = P I .0001450377# 120 PRINT SPC(35); "ANALYSIS": PRINT

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:08: 10 2003

22

Page 24: GPA 2172-1996 (2002).pdf

REM REM REM

*******************

FOR 1 = 1 TO 21 TR TC{I) / T1

CALCULATING SUMMATION FACTORS *********************

BP VC{I) * (2.058978# * TR - 7.020596# * TR A 2 + 5.953652# * TR A 3 -2.057299# * TR ~ 4)

B{I) = SQR{ABS{BP) / (8.314471 * T1)) NEXT I REM REM ******************* CALCULATING ZA *************************************

REM B(13) = -B(13): B(14) -8(14) ZA = 1 - PP * (.78102 * B(17) + .20946 * B(18) + .00918 * B(20) + .00034 * B(21))~2

REM REM ******************* SETTING ITERATION CHECK ****************************

REM ITR = O REM REM ******************* CHECKING MOLE FRACTION SUM *************************

REM SUMX = O FOR I = 1 TO 21: SUMX = SUMX + X(I): NEXT I COW = ABS{SUMX - 1) IF COW < .000005 THEN 130 CLS : PRINT "WARNING: mole fractions do not surn to unity." PRINT : PRINT "Do you wish to re-enter your data?" INPUT Y$ IF Y$ = "Y" THEN 50 IF Y$ = "y" THEN 50 130 IF F$ = "Y" THEN 140 IF F$ = "y" THEl'! 140 GOTO 170 140 PRINT #1, SPC(21): "NATURAL GAS PROPERTIES FROM COMPOSITION": PRINT #1, PRINT #1, IF TA > 30 THEN 150 PRINT #1. "CONDITIONS:"; Spe{l); "T(heating value) ="; TB; "e;": Spe(2); "T(density) ="; TA; "e;"; Spe(2); "P ="; P; "kPA": PRINT #1. GOTO 160 150 PRINT #1, "eONDITIONS:"; Spe{l); "T(heating value) ="; TB; "F;"; Spe(2); "T{density) =": TA: "F:": SPC(2); .p =": P: "PSI1>.": PRINT #1, 160 PRINT #1, Spe(35): "ANALYSIS": PRINT #1, REM REM ***** eALeULATING MOLAR MASS, RELATIVE DENSITY, AND HEATING VALUE ***** REM 170 GI = o: HN = o: RM = o FOR 1 = 1 TO 21

IF X{I) = O THEN 270 IF I > 4 THEN 180 AA I * A1(21) + (I + 1) * A1(15) «3 * 1 + 1) AB 1 * A2(21) + (I + 1) * A2 (15) «3 * Ae 1 * A3(21) + (1 + 1) * A3(15) ({3 * AD 1 + 1 GOTO 260 180 IF 1 <> 5 THEN 190 AA 4 * A1(21) + 5 * Al(15) 6.5 * A1(18) AS = 4 * A2(21) + 5 * A2(15) - 6.5 * A2\18)

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:08: 15 2003

23

1 + 1) 1 + 1)

/ 2) * A1(18) I 2) * A2{lB) I 2) * A3(18)

Page 25: GPA 2172-1996 (2002).pdf

AC = 4 * A3(21) + 5 * A3(15) - 6.5 * A3(lB) AD = 5 GOTO 260 190 IF 1 < 6 OR 1 > 7 THEN 200 AA 5 * A1(21) + 6 * A1(15) - B * A1(lB) AB 5 * A2(21) + 6 * A2 (15) - 8 * A2(18) AC 5 * A3(21) + 6 * A3(15) - B * A3(18) AD 6 GOTO 260 200 IF 1 < 8 OR 1 > 12 THEN 210 AA (1 2) * A1(211 + (1 - 1) * Al(lS) - «3 * 1 - 5) /2) * Al(18) AB (1 - 2) * A2(21) + (1 1) * A2(15) - «3 * 1 - 5) / 2) * A2(lB) AC (1 - 2) * A3 ( 21) + (1 1 ) * A3 ( 15) - « 3 * 1 5 ) / 2) * A3 ( 18 ) AD 1 - 1

GOTO 260 13 THEN 220

.5 * A1(lB)

.5 * A2(18)

.5 * A3(lB)

210 IF 1 <> AA A1(15) AB A2(15)­AC A3(15) AD 1 GOTO 260 220 IF 1 <> 15 THEN 230 AA A1(15) AB A2(15) AC A3(15) AD 1 GOTO 260 230 IF 1 <> 16 THEN 240 AA Al (21) .5 * A1(18) AB A2 (21) .5 * A2(18) AC A3(21) .5 * A3(18) AD O GOTO 260 240 IF 1 <> 19 THEN 250 AA Al(15) + A1(22) 1.5 * Al(18) AB A2(lS) + A2(22) 1.5 * A2(18) AC A3(lS) + A3(22) 1.5 * A3(18) AD 1 GOTO 260 250 IF 1 <> 14 AND 1 <> 17 AND 1 <> 18 AND 1 <> 20 AND 1 <> 21 THEN 260 AA A1(I) AB = A2(I) AC A3{I) AD O

260 H3 = T2 - 273.15 H2 AD * (-.04135 * (H3 - 25) + 3.724E-05 * (H3 - 25) " 2) H5 (AC - A3(I» * (H3 * H3 + H3 * 50 + 625) / 3 H4 AA - A1(I) + (AB - A2{I») * (H3 + 25) / 2 - HS H1 (H3 - 25) * H4 * 8.314480000000001D-03 HC H(I) - Hl + H2 HN HN + XCI) * HC HN HN - X{lS) * H(15) HNA = HN

270 NEXT 1 280 FAC = O: RM = O FOR 1 = 1 TO 21

FAC = FAC + XCI) * B(I) RM = RM + XII) * RM(I)

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:08:21 2003

24

Page 26: GPA 2172-1996 (2002).pdf

NEXT 1 Z = 1 - PP * FAC * FAC HM = 1000 * HN / RM: AV = 1000 * HN * PP / (8314.48# * T2): HVR

GI = RM / 28.9625: GR = GI * ZA / Z REM

AV / Z

REM ********************** PRINTING RESULTS *******************************

REM 1 FOR 1 = 1 TO 7

\= #.#### x\ \= #.#### x\ \= PRINT SPC(7); USING "x\ #.####"; NA$(I); XII); NA$(I + 7); XII + 7); NA$(I + 14); XII + 14)

NEXT 1 PRINT: PRINT SPC(7); USING "Molar Mass HEATING VALUES "; RM IF F$ = "Y" THEN 290: IF F$ = "y" THEN 290 GOTO 300 290 FOR 1 = 1 TO 7

= ##.## GROSS

PRINT #1, SPC(7); USING "x\ \= #.#### x\ \= #.#### x\ \= #.####"; NA$(I); XII); NA$(I + 7); XII .¡. 7); NA$(I .¡. 14); XII + 14) NEXT 1

300 IF TA >= 30 THEN 320: IF TB >= 30 THEN 320 PRINT SPC(7); USING "Molar Mass Ratio #.##### kJ/kg"; GI; HM PRINT SPC(7); USING "Relative Density #.##### kJ /Ideal CM"; GR; HV PRINT SPC(7); USING "Compressibilty Factor #.##### kJ/Real CM"; Z; HVR IF F$ = "Y" THEN 310 IF F$ = "y" THEN 310 GOTO 350 310 PRINT #1, : PRINT #1, SPC(7); USING "Molar Mass GROSS HEATING VALUES"; RM PRINT n, SPC(7); USING "Molar Mass Ratio :;: #.##### kJ/kg"¡ GI; HM PRINT n, SPC(7); USING "Relative Density :;: #.##### kJ/ldeal CM"; GR; HV PRINT #1, SPC(7); USING "Compressibilty Factor:;: #.##### kJ /Real CM"; Z; HVR GOTO 340 320 HM = HM * .4299226# HV = HV * .02683919# HVR=HV/Z PRINT SPC(7); USING "Molar Mass Ratio #.##### Btu/lb"; GI; HM PRINT SPC(7); USING "Relative Density #.##### Btu/ldeal CF"; GR; HV PRINT SPC(7); USING "Compressibilty Factor = #.##### Btu/Real CF"¡ Z; HVR IF F$ = "Y" THEN 330: IF F$ = "y. THEN 330 GOTO 350 330 PRINT #1, : PRINT #1, SPC(7)¡ USING "Molar Mass GROSS HEATING VALUES"¡ RM PRINT #1, SPC(7); USING "Molar Mass Ratio = #.##### Btu/lb"; GI; HM PRINT n, SPC(7); USING "Relative Density = #.##### Btu/Ideal CF"¡ GR; HV PRINT #1, SPC(7); USING "Compressibilty Factor #.##### Btu/Real CF"¡ Z; HVR

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:08:27 2003

25

#####

#####

#####

= ##.U#

###U

#####

#####

#####

####.#

####.#

##.###

#####

####.#

####.#

Page 27: GPA 2172-1996 (2002).pdf

340 PRINT #1, T'********************************************************************************"

350 PRINT "********************************************************************************'1

REM REM *************** INPUTTING FOR HARD COPY ********************************

REM PRINT : PRINT "DO YOU WANT A HARD COPY NOW (ONLY APPLICABLE FOR DAT MATRIX OR PCL PRINTER)?" INPUT Yl$ IF Yl$ "y" THEN 440 IF Yl$ = "y" THEN 440 REM REM *************** CALCULATING SATURATED VALUES ***************************

REM 360 IF ITR = 1 THEN 500 IF X(15) = 1 THEN 380 INPUT "Do you want to calculate water saturated values for custody transfer?" , Y$ IF Y$ = "Y" THEN 370 IF Y$ = "y" THEN 370 GOTO 510 370 XW = X(15): X(15) = O Zl = ((4.4412543D-13 * Ti - 8.4150417D-l0) * Ti + .000017838301#) Z2 = (Zl * Ti - .028354721#) * T1 + 18.87643854# - (2991.2729# / T1 +

6017.0128#) / Ti PW = EXP(Z2 + 2.858487# * LOG(Tl)) FOR 1 = 1 TO 21: X(I) X(I) * (1 - PW / PP) / (1 - XW): NEXT 1 X(15) = PW / PP HN = (1 - X(15)) * HN 380 ITR = ITR + 1 CLS : PRINT : PRINT : PRINT PRINT PRINT SPC(35); "SATURATED ANALYSIS": PRINT IF F$ = "Y" THEN 390 IF F$ = "y" THEN 390 GOTO 280 390 PRINT #1, SPC(35); "SATURATED ANALYSIS": PRINT #1, GOTO 280 400 IF F$ = "Y" THEN CLOSE #1: IF F$ = .y" THEN CLOSE #1 PRINT : PRINT : PRINT : PRINT "DO YOU WANT TO DO ANOTHER CALCULATION?" INPUT Y$ IF Y$ = "Y" THEN 410 IF Y$ = "y" THEN 410 GOTO 490 410 INPUT "DO YOU WANT TO SAVE OUTPUT TO A FILE"; F$ IF F$ = "y" THEN 420 IF F$ = "y" THEN 420 GOTO 430 420 PRINT "What drive and filename wou1d you like to save the output on?" PRINT "For example, B:STREAM1.DAT" INPUT "What is the desired drive and filename"; FileName$ OPEN "o", 1, Fi1eName$ 430 PRINT : PRINT : PRINT "DO YOU WANT TO CHANGE THE TEMPERATURE OR PRESSURE?" INPUT K$ PRINT : PRINT "DO YOU WANT TO CHANGE YOUR MOLE FRACTIONS" INPUT L$ IF L$ = "Y" THEN 490

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:08:32 2003

26

Page 28: GPA 2172-1996 (2002).pdf

IF L$ "y" THEN 40 IF K$ "Y" THEN 40 IF K$ "y" THEN 40 GOTO 80 REM REM ******************

REM

PRINTING HARD COPY **********************************

440 IF ITR <> 1 THEN LPRINT SPC(21); "NATURAL GAS PROPERTIES FROM COMPOSITION": LPRINT : LPRINT IF TA >= 30 THEN 450: IF TB >= 30 THEN 450 IF ITR <> 1 THEN LPRINT "CONDITIONS:"; SPC(l); "T(heating value) ="; TB; "DEG C"; SPC(2); "T(density) ="; TA; "DEG C"; SPC(2); "P ="; P; "kPA": LPRINT GOTO 460 450 IF ITR <> 1 THEN LPRINT "CONDITIONS:"; SPC(l); "T(heating value) ="; TB; "DEG F"; SPC(2); "T(density) ="; TA; "DEG F"; SPC(2); "P ="; P; "PSIA": LPRINT 460 IF ITR <> 1 THEN LPRINT SPC(35); "ANALYSIS": LPRINT IF ITR2 = 1 THEN LPRINT SPC(33); "WET ANALYSIS" IF ITR2 = 1 THEN LPRINT "CONDITIONS:": LPRINT : LPRINT "RELATIVE HUMIDITY ="; HA; SPC(3); "HUMIDITY OF GAS ="; HG; SPC(3); "FRACTION OF EXCESS AIR ="; EA IF ITR = 1 THEN LPRINT SPC(30); "SATURATED ANALYSIS": LPRINT FOR 1 = 1 TO 7

LPRINT SPC(7); USING "x\ \= #.#### x\ \= #.#### x\ #.####"; NA$(I); X(I); NA$(I + 7); X(I + 7); NA$(I + 14); X(I + 14) NEXT I

\=

LPRINT : LPRINT SPC(7); USING "Molar Mass HEATING VALUES"; RM

= ##.### GROSS

IF TA >= 30 THEN 470: IF TB >= 30 THEN 470 LPRINT SPC(7); USING "Molar Mass Ratio kJ/kg"; GI; HM

LPRINT SPC(7); USING "Re1ative Density kJ /Ideal CM"; GR; HV LPRINT SPC(7); USING "Compressibi1ty Factor k.J !Real CM"; Z; HVR 470 LPRINT SPC(7); USING "Molar Mass Ratio Btu/lb"; GI; HM

LPRINT SPC(7); USING "Relative Density BtulIdeal CF"; GR; HV

LPRINT SPC(7); USING "Compressibilty Factor Btu/Real CF"; Z; HVR IF ITR2 = 1 THEN GOTO 480 LPRINT

#.##### #####

#.##### #####

#.##### #####

= # .##### U###

#.##### ####.#

#.##### ####.#

"********************************************************************************"

480 IF ITR = 1 THEN 500: IF ITR2 = 1 THEN 400 GOTO 360 490 END 500 IF ITR2 = 1 THEN 400 REM REM ****************************** WET CALCULATIONS ************************ REM

510 INPUT "Do you want wet values for engineering calculations?" , Y$ ITR 1: ITR2 = 1 IF Y$ = "Y" THEN 520 IF Y$ = "y" THEN 520 GOTO 400

520 INPUT "What is the relative humidity of air (use fraction not percent)?", HA PRINT : PRINT "Enter a O for relative humidity of gas to default to X(water) inputted earlier.": PRINT

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:08:38 2003

27

Page 29: GPA 2172-1996 (2002).pdf

INPUT "What is the relative hurnidity of the gas (use fraction not percent)?", HG INPUT "What is the fraction of excess air (use fraction not percent)?", EA FOR I 1 TO 21 XII) XA(I)

NEXT I ALPHA = O: BETA = O: ITR2 O FOR I = 1 TO 4

ALPHA = ALPHA + 1 * XII) BETA = BETA + (3 + I + (1 - 1)) * XII)

NEXT I FOR 1 = 5 TO 6

ALPHA = ALPHA + (1 - 1) * XII) BETA = BETA + 2 * I * XII)

NEXT 1 FOR 1 = 7 TO 8

ALPHA = ALPHA + (1 - 2) * XII) BETA = BETA + (2 * 1 - 2) * XII)

NEXT 1 BETA = BETA + 2 * X(19) GAMMA = X(19) XW X(15): X(15) = O Z1 = ((4.4412543D-13 * TI - 8.4150417D-10) * T1 + .000017838301#) Z2 = (Z1 * T1 - .028354721#) * T1 + 18.87643854# - (2991.2729# / T1 + 6017.0128#) / T1 PW = EXP(Z2 + 2.858487# * LOG(T1)) X(15) = HG * PW / PP HGA = XW * PP / PW IF ABS(HGA - HG) > .2 * HG THEN PRINT "INCONSISTENT VALUE FOR HG ANO X (WATER) " FOR I = 1 TO 21

XII) = (1 - X(15)) * XII) NEXT 1 HN = (1 - X(15)) * HNA NGW = (HG * PW / PP) / ((1 - X(17) - X(21)) * (1 - HG * PW / PP)) NAW = 4.77418 * (ALPHA + BETA / 4 + GAMMA) * (1 + EA) * (HA * PW I PP) / (1 - HA * PW / PP) NVW = (ALPHA + GAMMA + (X(17) + X(21)) / (1 - X(17) - X(21)) + (ALPHA + BETA / 4 + GAMMA) * (3.77418 + 4.77418 * EA)) HN = HN + (NGW + NAW - NVW * (PW / PP) / (1 - PW / PP)) * H(15) ITR2 = ITR2 + 1 CLS : PRINT : PRINT : PRINT : PRINT : PRINT PRINT

PRINT SPC(33); "WET ANALYSIS":

PRINT : PRINT "CONDITIONS:": PRINT PRINT "RELATIVE HUMIDITY ="; HA; SPC(3); "HUMIDITY OF GAS "FRACTION OF EXCESS AIR ="; EA: PRINT IF F$ = "Y" THEN 530: IF F$ = "y" THEN 530 GOTO 280 530 PRINT #1, : PRINT #1, SPC(33); "WET ANALYSIS" PRINT # 1. "CONDITIONS : ": PRINT #1,

_11 w - ,

PRINT #1, "RELATIVE HUMIDITY ="; HA; SPC(3); "HUMIDITY OF GAS "FRACTION OF EXCESS AIR ="; EA: PRINT #1, GOTO 280

Copyright by the <RSOC000052>& American Petroleum Institute Wed Aug 13 08:08:43 2003

28

HG; SPC(3);

_11 • - , HG; SPC(3);