Calculation Gross Heating Value - GPA - API

You might also like

Download as pdf
Download as pdf
You are on page 1of 29
Calculation of Gross Heating Value, Relative Density and Compressibility Factor for Natural Gas Mixtures from Compositional Analysis American L Petroleum Institute (GPA Standard 2172.96 ‘APIMPMS 145 ‘Adopted as Tentative Standard, 1972 Revised and Adopted as Standard, 1976 Reprinted, 1974, 1980, 1982, 1988, 1991 Rovisod 1984, 1986, 1996 Published by Gas Processors Association 16526 East 60th Stroct Tulsa, Oklahoma 74145 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, concerning 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 ot 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. 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 included 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 include all components (other than water) with mole fractions greater than or equal to 0.0001 in the analysis (some routine analyses ignore constituents such as He and HS 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 mass ot 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 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"! (exact) 1 Ibm = 453,59237 g (exact) 1 Btu ~ 1055.0559 J 1 atm = 101325 Pa (exact) = 14,69595 Ibfoin" (psia) 1 f0 = 0.0283168 m? 4. Equations for Custody ‘Transfer Calculations 4.1 Gross Heating Value (Volumetric Basis) Hv" (dry) = x,Hyj! + x,Hvil +--+ xy Hv x)Hvit qd) fa Hv"(sat) = (1- x, Hv" (dry) @ where Hv" is the 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, x,are mole fractions, N is the total number of components (excluding water) and x, 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 caleulated from x= PER @) where P%” is the vapor pressure of water atthe base temperature and Ps is the base pressure. The following table provides (1-xy) for some common base pressures used in the United States with a base temperature of 60°F where the vapor pressure of water is 0.25636 psia. R(psia) Ix, 14.50 0.9823 14.696 0.9826 14.73 0.9826 15,025 0.9829 The next table presents (1-xy) for some ‘common base temperatures used outside the United States with a base pressure of latm. R(‘c) (Im) 0 0.9940 15 0.9832 20 0.9769 25 0.9687 4.2 Relative Density G=did,=(MPT,Z,)(M,P,TZ) (4) if 7=T, and P= Pa then G=(M/M,)Z,/Z)=6"(Z,/Z) (5) where G is relative density, d is mass density, M is molar mass, P is pressure, T is temperature, Z is compressibility factor and subscript a denotes a property Calculation from composition w => 4G (6) 4.3 Compressibility Factor At base conditions (near ambient) a simple expression which provides the compressibility (real gas) factor within experimental error for natural gas mixtures is: Ze oa afSaa] o where the b; 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 / AGA-3 / GPA 8185. These two methods, in general, do not provide exactly the same value. part in 10,000 which is well within experimental error. 5. Example Calculations 5.1 Table 1 contains values of Hy/*, GH and b, (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 roperties 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 correct treatment of water 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 some 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, The extra digits. which appear in the Tables alleviate problems associated with round-off and internal consistency, but they are not significant. For numerical reasons, the values of some properties in this standard may differ slightly from those in GPA Standard 2145 (1 part in 10000 or less). These discrepancies are well within experimental error. In such cases, GPA 2145 takes precedence for accounting purposes and GPA 2172 takes precedence for technical calculations. The values in GPA 2145 have been adjusted to achieve complete numerical consistency within that table. “isd 969°41 q Papin (1 aad pansop atp Aq ayge sgn Ur ange ain Knut somssaxdsoino We py 30 yy URGO Ox. (9) naear yeopt uodn paseg (s) oe aH pill (5) onic SunvoH $s029 [apt Sse SOIOW. (D Bisd 969°pT pue J, 09 38 sjuauodwoZ sep jeINyEN Jo sensedorg “1 21qe1, (quo) T arqe, Z “Ag HD vjnusi0} jory ou Jo wed 20U st 1 asneseq Q = 70 SI “‘UIOTE HOQIeD e sey ZOD USNOWTY youre JJo-punoi eyeiAdtTTe ATwo 1ng qWEs'IUss 10 are QOOT UL wed | PUEKEq pate sup AU “yeoy o1qno yeal Jad anqea Bapreay seB eap) ue soUTES Ing anyea Bupeoy ses fear ¥ OA1B 0M SOP Z AQ prA7f JOUOISIAI 310N cM C'E911 = (P966O)I'OSTI = (ae Aup ‘se3 ws) { Z/ptH} UM [STI = (9786 ONL'ELLI = Ge Aip ‘se8 es) py cM S'E8TI = 8966 0/2 6L11 = (ate Aap ‘se3 Aup){ Z/ py} UME L6LUT = (re Lap ‘se Arp) pty 0004'0 = 7966'0(S666'0)8L69°0 = (atv 1s ‘seB ws) O10L'0 = 8966'0AS666'0)1669'0 = (ate IBS ‘seB AIp) 1004°0 = +966'0(9666'0)8L69°0 = (te Aup ‘se8 es) 5 1102°0 = 8966'0/(9666'0)1669'0 = (te Aip ‘se Asp) 5, $666°0 = (969°P 1)c[(€Z90'0)¥L10'0 + (0S00'0)9Z86'0] - I = (are eS) Z 9666°0 = (969°p1)el0S00'0) - 1 = (are Aap) Z 99660 = (969° F L)cl(EZ90 O)PL 100 + (18710'0)9Z36'0] - I = (Ses ws) Z 8966°0 = (969°PL)cl 8p 10'0) - I = (S23 Asp) Z 8469'0 = (ZO7ZZ9'0)PL10'0 + (9786'0)1669'0 = (SeS Tes) pr 1669°0 = (S88 Gp) pi 97860 = "x -T PLIO'O = 969° PINSESSTO)O'T = “* Lepore Z6LLL Oo 0000"1 vonewungs ZOO ipXo1d uoqeg z€00°0 ueBouN £000°0 1H 0€00°0 eueXoH $z00"0 eueiued-u be00°0 eueiueg 8010°0 eueing-u £800°0 eueing- 6e¥0'0 ‘uedoie S¢20°0 oueuia zoee'o 0%000°0 46100 096151 40000°0 yb00'0 = €2Z96"0 00000°0 0 ozeet'o ”Z000°0 ogtoo © zogo.o ss ossze'z © G'SGLy 94000°0 SZlo0 Fe90°0-Oztey'z ©6800 81000°0 S100 1850°0 Ozl6h'z 6000 2$000°0 zZevo'o ZOO OBgOO'Z§ e'zOzE 8800070 ZeE0'0 850.0: 0B900' «OT LSZE 15400°0 ZMEV0 — pyEO.O «= Ogzzs't F9LSZ 82100°0 O6rl'0 © 6EZ0'O.sOzBEOL L'69LE £9600°0 zoes'o 9ito"0—zeesso_'oLoL e0000000000 (siseg Aaq uo syshpeuy sep) eisd 969°pT PUL J, 09 38 SaMsOdorg Sed Jo suoHEINITeD adwexy “7 FIqE, Agdyy5 ejnuziog jong otp Jo wed you St a1 asneDaq Q = 10 SY} ‘Wore UogsED ¥ Sey TOD YBNOIPTY “2049 yyo-punox oweraatiTe Aquo 1nq WeOYTUsIS you axe OOO! UL wed | puokeg poured susIp AY yea} o1gno jeas Jod onyea SuNesy seB peopt we soUex Inq anyea SupwoY ses [eos ve OAL Jou Soop Z AQ prt] JO UOISIAI HON ME €'C911 = (6966 OT 6ST = (are Aap ‘seB yes) { Zt} 6669'0 = 1966 05666 O)LL69'0 = (318 wes ‘se wes) 5 $666'0 = (969°b1)z{(€290 O)PL10'0 + (0S00'0)9786°0) - I = (ate ws) Z vostoro BOLOOO 6£000"0 ° ° ‘2000°0 000°0 81000°0 +s000°0 2£000'0 8h 1L00°0 $£100°0 9¥600'0 2469°0 0091 leve'y z0zz9"0 09619"F €2296'0 ozeet‘o ossze'e ozter'z ozter'2 02900°% og900'% ogzes"t ozeeo't z6ess'0 e UNG 6ST = 60 - OOOET = (He Aap ‘e8 wes) pet HT 8669'0 = $966'0(9666'0)LL69"0 = (are Asp ‘sed 1s) 9666'0 = (969° 1)eL0S00°0] - I = Gre A1p) Z ¥966'0 = (969'pLzlv9S10'0) - I = (se8 WS) Z ecoccc000000 ranttnneocce £1690 = (S83 288) px) 0000'F PLI00 8610°0 be00'0 8000'0 6z00°0 $200'0 og00'0 9010°0 z2800'0 1ev0°0 zez0'0 zs18'0 (siseq 1944 uo sisdqeuy sep) esd 969°)T PuE J, 09 He sepssdorg sep Jo suopENNIED aduIEXY “¢ O146L uonewuns soem prcoig uoqueg UsBO.IN wnieHi auexoH, eueiued-u euequed-} eueing-u eueing-1 euedold eueutg en ltl nENEaoNasaa sce Sant 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 released upon combustion multiplied by the price of gas per energy unit multiplied by the time or accounting period. The rate of energy released upon combustion is the product of the heating value of the gas and the flowrate of the gas, The flowrate of the gas requites 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 burn 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 fuel and air is: CHS; id) + (or+ B/4-+ 7) +€)0, (id) + 0.04383( 0+ B/4+\I+e)Ar(id) +10.00162(a + B/4+7)(1 +e) + x¢/(I-xy —xc)ICO, (id) +13.72873(a.+ B/4+7)1 +e) + xy (1-4 —x¢)IN,(id) + (nf +5) H,O(id) = [0 +0,00162(cr + B/4+7)(1+e)+x¢M(1~xy~ xe)ICO,(id) +n H,O(id) +n. H,0(2) + 50, (id) +[3.7287H(a + B/4+\(1 + €) + xy /(I- xy — X¢)]N; (id) +0,04383(a + B/4+)(1+ €)Ar(id) + (a+ B/4+7)e0,(id) ( where "id" denotes the ideal gas state, at, f and 7 are stoichiometric coefficients, ¢ is the fraction excess air, the composition of air is assumed to be that of Table Al, nf are the moles of water contained in the gas, n? are the moles of water contained in the air, ny, are the moles of water contained in the product gas mixture, n}, are the moles of gas which actually condense, 1, is the mole fraction of CO, in the gas and x, is the mole fraction of N, in the gas. If air has been injected into the gas, itis assumed that the effect is accounted for in the excess fraction e. Fuel gas mixtures would have non-integer values of at, and y. Itis customary to define hypothetical reference states for the water formed by the reaction denoted by Equation 1 (as opposed to “spectator” water which enters the reaction carried by the gas or air). If we assume 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) = H,(id)- H,() @ where H denotes enthalpy, 1 denotes liquid state and subscript w indicates water. The quantity H, (id) ~ H,(2) is the ideal enthalpy of vaporization for water. This possible to calculate a real gas heating value rather than using a hypothetical state, but the calculations are tedious, the numerical values are negligibly different and the mathematical simplicity of the defining equation is lost. It is customary in the gas industry to use gross heating value for most calculations, so for the remainder of this appendix the term “heating value” refers to the gross value. ‘Heating value is measured on a mass or molar basis and converted to the ideal gas state for reporting. Thus, at any given temperature the heating value is Hn! = Sa Hn! @ Hm =) x.M Hm“ 12M, @ a i where Hn is the heating value in energy per mole, x, is the mole fraction, N is the number of components in the mixture, Hm’ is the heating value in energy per mass, and M is the molar mass. Clearly, Hm multiplied by the molar mass (with units of mass per mole) gives Hn“. Both Hn and Hm are independent of pressure, but both are functions of temperature and composition. 10 ‘The natural gas industry uses heating value with dimensions of energy per volume in its calculations. ese dimensions result from multiplying Hn” or Hm by density or mass density of the ideal gas pectively: Hv! =(P/RT) Hn" = (MP/ RT) Hm 6) ere Hv" i the heating value in energy per volume, P is absolute pressure, T is absolute temperature and R the gas constant (=8.314471 Jemol-!*K-!=10.7316 psiasfi?+lbmol'+"R-!). Hv depends upon temperature, position and pressure. Table A2 contains values for Hv“ at 60 °F and 14.696 psia. These values are only lid at the specified T and P. Conversion to another pressure is simply a matter of multiplying by the ratio of :new P and 14,696 psia: Hy" = Hv (Table2)[P/14.696] 6) hen using Equation 6, HV“ (Table A2) should be calculated using the values from Table A2 in Equation 5; the fividual values in Table A2 should not be converted. Conversion to another temperature is more mplicated. Heating value data exist at 25 °C based upon the reaction: C,HpS (id) + (0+ B14 + 7)0,(id) = CO, (id) + (B12)H,0() + 960, (id) a € experiments use pure oxygen and are corrected to stoichiometric proportions. It is necessary to correct the asible heat effects to arrive at a different temperature: Hn¥(D)= sites [Sef > ctr (8) vere LEP = eCheo, + (B/D no +10 ” C2) LOE = Cheays, + (0+ BI4+ NGO, : (10) 4G isthe ideal specific heat at constant pressure, r denotes reactants and rr denotes products. The cost of gas comes from the simple accounting equation c= OM pHar a " XG" (21) Table A2 lists values for Gi". 13 ACCOUNTING FOR WATER If the gas contains water (or must be assumed to be saturated) but the compositional analysis is on a dry basis, it is necessary to adjust the mole fractions to account for the fact that water has displaced some gas, thus lowering the heating value. The mole fraction of water in the {gas results from the definition of relative humidity =n, M(l+n,) (22) (based upon one mole of the fuel C,H,S,) where Af is the relative humidity of the gas, PS is the vapor pressure of water and n, denotes moles of water. For saturated gas ht is unity. Rearranging Equation 22 gives the moles of water n, =x, M(1-x,) (23) ‘The corrected mole fractions then become 1 1 een _ and the heating value becomes x Hv" =(1-x,) xf" Hv? (25) where water is not included in the N components of the summation. If the compositional analysis determines x,, and water is included in the N components of the suramation Hy" = Dx Hyi! — x, Hv (26) ro It is necessary to remove the effect of water because, although water has a heating value, itis only a condensation effect. Water carried by wet gas (spectator water) does not actually condense and, by definition, water formed in the reaction contributes to heating value, Accounting for water in the above manner is sufficient for defined custody transfer conditions, but when trying to model actual situations the question becomes much more complicated. It is obvious that all of the reaction water actually cannot condense because in a situation in which both gas and air are dry some of the reaction water saturates the product gases 14 and the remainder condenses. It is possible to account for these effects in a general manner. To do is necessary to calculate nf, ni, m3, and n}. HEMI + (xy + Xe) (I= xy ~ xc) tnt) = APS IP nf = (EPS 1 P)M(~ xy ~ xe) - AES /P) @) ni A.T7418(0 + B/4+y\(l +e) + ng )=h°PS/P nf =4,77418(0+ B/4+ 7) +6)(h* Pe / P)/(I-h°Po /P) (28) Ry Hoe+ y + (xy +.X¢) (I~ ty Xe) + (+ B/ 4+ 7)10.00162(1 +e) 43.72873(1 + €) + 0.04383(1 +e) +€]+ 22) = PE /P ML SCH Y + (xy + Xc)M(1- Fy — Xe) + (Ce + B14 + )N0.00162(1 +e) 43.7287H(1 + €) + 0.04383(1 +e) + €}}(P2/P)(1- Po/P) (29) nhs Bl2tnt tnt ny 30) | where h, is the relative humidity of the air. Equation 27 and 28 are reformulations of Equation 22 to reflect 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: /2 are the moles | of water formed by the reaction, nf +n, are the moles of water which enter with the gas and air, nn 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: Hy" = Hv" (Equation25or26) + ((h* Pe | P) (1 — xy — X¢)(1— A"P? | P) | 4.774 18(0+ B/4 +7) + €)(H°PS / PI h*PE IP) a+ 7 + (Ry — Xe) —8y — He) + (G+ B14 + )GB.77A18 + 4.774186) \ xP? 1 P)/(1- P21 P) HV GI) Depending upon the relative humidities of the gas and air, the observed heating value can be . sgreater or smaller than that calculated using Equation 25 or 26. A humidity of air exists for each gas above which Hv“ is greater than that calculated by Equation 25 or 26. That critical value 15 depends upon the gas composition, the humidity of the gas and the amount of excess air. For pure, dry methane with no excess air h, = 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, G”, is the desired property). This is simply a matter of evaluating the integral: aw-me =A) (F) Je : where MH) yf ®%) 23-7 Boer (#) 1%) -2 Tp RTOS (33) whereV is the molar volume. The temperature dependence 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 itis 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; His slightly different from Hrd because the base pressure is low; the likelihood of having all 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 all liquid; some of the water formed is in cach 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. 16 Table Al Assumed Composition of Air from: Jones, F. E.; J. Res. Nat. Bur. Stand.; 83; 419 (1978) Component —Mole Fraction No 0.78102 roy 0.20946 Ar 0.00918 CO, 0.00034 1.00000 Table A2 Properties of Natural Gas Components at 60 °F and 14.696 psia Component Formula ct b(psia*) Hv (Buus ft) Water 1,0 0.62202 0.0623 $0312 | Nitrogen No 0.96723 0.0044 0 i Carbon Dioxide C03 15196 0.0197 0 Air Table 1 1.00000 0.0050 0 Methane CHy 0.55392 0.0116 1010.0 Ethane CoH 1.0382 0.0239 1769.7 Propane C3Hg 1.5226 0.0344 2516.1 i-Butane Calo 2.0068 0.0458 32519 Butane C4lio 2,0068 0.0478 3262.3 i-Pentane C5Hy2 2.4912 0.0581 4000.9 Pentane CsHy2 24912 0.0631 4008.9 Hexane CoHig 2.9755 0.0802 47559 7 ‘Table A3. Example Calculations of Gas Properties at 60 “F and 14.696 psia (Ga Methane o.es02 1 4 0 10100 0.65002 0.0116 0.8902 Ethane 0.0745 2 6 0 17697 1.03820 0.0239 0.1490 0.44 Propane 0.0489 3 8 0 2516.1 1.52260 0.0344 0.1817 0.35 [-Butane 0.0088 4 10 0 82519 2.00680 0.0458 0.0832 0.08 n-Butane 0.0108 4 10 0 3262.3 2.00680 0.0478 0.0432 0.10 i-Pentane 0.0081 5 12 0 4000.9 2.49120 0.0581 0.0155 0.03 n-Pentane 0.0025 5 12 0 4008.9 2.49120 0.0631 0.0125 0. Hexane 0.0030 6 14. 0 4785.9 2.97550 0.0802 0.0180 0.04 Helium 0.0003 9 0 0 0 0.13820 ° ° Nitrogen 0.0032 0 oO 0 0 0.96728 0.0044 o Carbon Dioxid_0.0202 0 0 0 0 1.51960 0.0197 9 ‘Summation hg=03, hg =0.5 Py = 0.25636 psia €=0.2 x4= 0.3(0.25636)/14.696 = 0.0052 x= 0.5(0.25636)/14.696 = 0. Git =0.6991 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)]%(14.696) = 0.9996 G =0.6991(0.9996)/0.9967 = 0.7011 Hyid = 0,9948(1179.7) = 1173.6 Bu-ft3 Hv /Z = 173.610.9967 = 117 Hy‘4(obs) = 1173.6 + {0.0052/[0.9766(0.9948)] + 4.77418(2.338 1)(1.2)(0.0087)/0.9913) - {1.2333 - 0.01 4.77418(0.2)]}(0.25636/14,696)((1 - 0.25636/14,696)}50.312 = 1168.8 But? Note Division of Hv by Z does not give a real gas heating value but rather an ideal gas heating value per! Any digits carried beyond 1 part in 1000 are not significant but only allieviate round-off error. Although CO, has a carbon atom, its 0 = 0 because it is not part of the fuel formula CaHpSy- 18 NATURAL GAS PROPERTIES FROM COMPOSITION CONDITIONS: T(heating value) = 60 DEG F ‘T(density) = 60 DEG F P= 14.696 psia ANALYSIS. x(CH4) = 0.8302 x(C6HI4) x(H20) x(C2H6) = 0.0745 x(C7HI16) x(CO) x(C3H8) = 0.0439 x(C86H18) x(N2) xGC4HI0) = 0.0083 x(C9H20) = 0: x(02) x(C4H10) = 0.0108 x(C10H22) = 0.0000 x(H2S) x((CSHI2 = 0.0031 x(H2) x(Ar) x(CSHI2) = 0.0025 x(He) x(C02) Molar Mass = 20.248 GROSS HEATING VALUES Molar Mass Ratio = (0,69909 22111 Btuelb-! Relative Density = 070109 1179.7 Btue(Ideal CF)! Compressibility Factor = 0.99677 1183.6 Btus(Real CF}? SATURATED ANALYSIS x(CH4) = 0.8157 x(C6HI4) = 0.0029 x(H20) x(C2H6) = 0.0732 x(C7HI6) = 0.0000 x(CO) x(C3H8) = 0.0431 x(C86HI8) = 0.0000 x(N2) x(IC4H10) = 0.0082 x(C9H20) = 0.0000 x(02) x(C4H10) = 0.0106 x(C10H22) = 0.0000 x(H28) x((CSHI2 = 0.0030 x(H2) 0.0000 x(Ar) x(CSHI2) = 0.0025 x(He) 0.0003 x(CO2) Molar Mass = 20.209 GROSS HEATING VALUES Molar Mass Ratio = 0.69775 21767 Btu Relative Density = 0.70001 11592 Bi deal Cy! Compressibility Factor = 0.99639 1163.3. Btus(Real CE)! . WET ANALYSIS CONDITIONS: RELATIVE HUMIDITY=0.5 HUMIDITY OF GAS=0.3 FRACTION OF EXCESS AIR=0.2 SATURATED ANALYSIS x(CH4) = 0.8259 x(C6HI4) x(H20) = 0,0052 x(C2H6) = 0.0741 x(C7H16) = 0 x(CO) = 0,0000 x(C3H8) = 0.0437 x(C86HI8) = 0.0000 x(N2) = 0.0032 x((C4H10) = 0.0083 x(C9H20) = 04 x(02) = 0,0000 x(C4H10) = 0.0107 x(C10H22) x(H2S) = 0.0000 x((CSHI2 = 0.0031 x(H2) x(Ar)_ = 0.0000 x(CSHI2) = 0.0025 x(He) x(CO2) = 0.0201 Molar Mass = 20.235 GROSS HEATING VALUES Molar Mass Ratio = 0.69868 21919 Btuslb! Relative Density = 0.70075 1168.8 Btue(Ideal CF)" Compressibility Factor = 0.99666 19 1172.7, Bue(Real CF) CALL TEXTFONT (4) 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 REY REM REM REM Aeetetanerennuseeneeneneeee DECLARE 44444: Anasaesaaweanedeesneeeean® VARIABLES + AL, A2, a3 AA, AB, AC, AD ALPHA BETA BP cow EA FS, FILENAMES FAC cama cI oR HL - HS, HC H BA HG EM, HN RNA. HV, VR XR, TTR2 NAS NAW Now www P 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 POR MOLE FRACTIONS SUM FRACTION OF EXCESS AIR CHARACTER STRING VARIABLES CALCULATION VARIABLE FOR 2 NUMBER OF SULFUR ATOMS IN FUEL 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 FEATING 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 PRATIONS BASE TEMPERATURE FOR RELATIVE DENSITY BASE TEMPERATURE FOR HEATING VALUE DUOY VARIABLES FOR T1 AND 2 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 20 REM AbtatdAeeees@#QieAtOH SETTING UP TITLE PAGE (OE ttHieRerneeesenaaee PRINT : PRINT SPC(26); “for NATURAL GAS MIXTURES* “from COMPOSITIONAL ANALYSIS" "1993 'SPC(25); “GAS PROCESSORS ASSOCIATION’ PRINT : PRINT "6526 EAST 60th STREET" “TULSA, OKLAHOMA 74145 USA* “developed i “Texas A & M Univer: ‘CALCULATION OF GROSS HEATING VALUE," “RELATIVE DENSITY and COMPRESSIBILITY FACTOR" PRINT SPC(5); ‘(press the space bar)" = INKBY$: IF I$ = ** GoTo 10 : PRINT : PRINT “DO YOU WISH TO SAVE THE OUTPUT 70 A FILE"; FE REM REY REM REM CLS : PRINT : PRINT : PRINT SPC(20); PRINT : PRINT SPC(16); PRINT : PRINT PRINT : PRINT SPC(25) PRINT : PRINT SPC(36); PRIN? : PRINT PRINT : PRINT SPC(27); PRINT : PRINT SPC(25); PRINT : PRINT SPC(31); PRINT SPC(10) PRINT : PRINT : PRINT 10 3$ cus : PRINT : INPUT IF P$ = 'Y* THEN 20- IF P§ = ty* THEN 20 coro, 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 *44tteeueeeeeeteass DIMENSIONING VARIABLES t###4h+eteeneAte eS eHeHEHHO RE REM 30 DI mM x(22), DIM XA(21) REM REY tttteteteeeteeetess READING IN DATA tHthAAAAAAAA ane enaAANSRAMH ee nRRRBOED REM, 7e(21), FOR A = 170 21 READ NAS (A) NEXT DATA DATA DATA, DATA aA "(cHa) 7 (C5H12) *(H2) *(H2s) *, "(C2H6) —*, *(C3HB) , "(CeHI4) +, + (C7HI6) "1 (He) *, 5 (H20) +, TOR) *, (C02) FOR A= 1 70 21 READ TC(A), NEXT READ DATA DATA DATA, DATA DATA, DATA DATA DATA a a1(22), 190.55, 305.33, 369.85, 407.85, 425.16, 460.43, 469.70, 507.40, OIA), AL(A), AZ(A), A2(22), A3(22) -0000990, 0001470, 0002000, -0002590, -0002550, -0003060,, 0003040, 0003700, 4.1947, 5.9569, 8.2671, 10.8240, 11.1090, 13.4120, 13.5870, 16.1340, 003639, -013770, 022860, -031530, -028750, 035400, 032880, 039860, a1 vo(24), A122), A2(22), A3 (22) DIM RM(21), NA§(21), B(21), H(21) *(ican10) "(ceHI8) + (CO) AB(A), H(A), RMIA) 00001490, 00001690, -00001900, 00000820, 00001820, 00001400, +00001400, 00003600, *, “(caH10) =, *(C9H20) ") "(N2) 890,630, 1560.690, 229.170, 2868.20, 2877.40, 3528.830, 3535.70, 4194.950, ty, College Station, Texas 77843 USA" , s(iesHa2) + + (CLOH22) * 1802) 16,0430 30,0700 -0970 58. 58. +1500 a4 2 72 86. 1230 1230 1500 1770 DATA $40.20, .0004320, 18.6420, .047860, 00003840, 4953.430, 100.2040 DATA 568.83, .0004920, 21.1920, .054800, .00004300, 551.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 PATA 5.19, 0000573, 2.5000, .000000, .00000000, 000.000, 4.0026 DATA 647.14, .0000559, 4.0260, .000410, .00000255, 44.106, 18.0153 PATA 132.91, .0000930, 3.5030, .000090, .00000090, 282.980, 28.0100 PATA 126.20, .0000891, 3.5020, .000060, .00000000, 000.000, 28.0134 DATA 184.58, .0000733, 3.5200, .000440, .00000280, 0000.00, 31.9988 DATA 373.40, .0000982, 4.0700, .001180, 00000280, $62,010, 34.0800 DATA 150.86, 0000746, 2.5000, .000000, .00000000, 000.000, 39.9480 DATA 304.21, .0000942, 4.3240, .005800, -.00000650, 000.000, 44.0100 DATA 4.707, .0043900, 0.000013 KS = Lg 2 ye" REM, REM ****#* INPUTTING TEMPERATURE, PRESSURE, AND MOLE FRATIONS *##*t+¥4eesA8« REM 40 CLS : PRINT : PRINT : PRINT : IF K§ = 'Y* THEN 50 IP 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 value" INPUT Y$: IF ¥$ = "Y" THEN 60 “IF Y$ = ty" THEN 60 INPUT “What is the base temperature for density? *, Tl: TA = TL INPUT ‘What is the base temperature for heating value? *, 12: TB = T2 coro 70 60 INPUT “what is the base temperature? *, Tl: T2 = 71 TA = Tl: TB = 12 70 INPUT ‘What is the base pressure? *, P TL = TA: 12 = 7B TTR2 = 0 IF Lg = *Y" THEN 90 IP L$ = ty" THEN 90 IP L$ <> ‘Yt THEN 100 IP L$ <> *y* THEN 100 90 FOR A= 1 70 21 PRINT *X"; NA$(A) INPUT x(a) XA(A) = X(A) NEXT A 100 FOR T= 1 70 24 (1) = XA(T) NEXT I CLS : PRINT ; PRINT : PRINT PRINT SPC(21); “NATURAL GAS PROPERTIES FROM COMPOSITION": PRINT : PRINT IP T1 >= 30 THEN 110 PRINT ‘CONDITIONS:"; SPC(1); "T(heating value) PTL; "Cy"; SPC(2); "PB =t; P; "KPA": PRINT. TL = TL + 273.15: 72 = 72 + 273.15 PP = P * 1000 Goro 120 110 PRINT *CONDITIONS:*; SPC(1): "T(heating value) = *T(density) ="; TL; "F:"; SPC(2); "P="; P: *PSIA TL = (TL + 459.67) / 1.8: T2 = (T2 + 459.67) / 1.8 PP =P / .0001450377% 120 PRINT sPC(35); "ANALYSIS": PRINT 492; *C;t; SPC(2); "T(density) 92; “Fit; SPC(2); PRINT: 22 REM REM 440 REM FOR I = seeneaeeueeseeee CRECULATING SUMMATION FACTORS t##h##esssteeeeeeenes 170 21 TR = TC(I) / TL BP = Ve(I) * (2.058978# * TR - 7,0205964 * TR“ 2 + 5.953652# * TR* 3 ~ 2.05729: (I) = NEXT REM REM REM B(13) ZA=1 B(21)) REY REM +46 REM ITR = 0 REM REM +¥+ REM sum = FOR I = 9# * TR * A) SQR(ABS(BP) / (8.314471 * 71) Senet treet: CALCULATING 22 COOH AAHHHa eta a ae eeetiineneae -B(13): B(14) = -B(16) - PP * (.78102 * B(17) + .20946 * B(18) + .00918 * B(20) + .00034 * n2 sesseeuseetteees SEDTING ITERATION CHECK *#####404seeestAAteeeRHRR EEE seesesesvesseets CHECKING MOLE FRACTION SUM *##04sseeresseterenenstes ° 1 TO 24: Stk = SUNK + X(I): NEXT T cow = ABS(sUmK = 1) IP cow cls : Pl PRINT : rNpur ¥: IF y$ IB Y§ = 130 IF IF FS coro 17 PRINT #: IF TA > PRINT #1, “CONDITIONS "T (dens; < 000005 THEN 130 RINT "WARNING: mole fractions do not sum to unity." PRINT "Do you wish to re-enter your data?” $ sy" THEN 50 ty" THEN 50 Fg = ty" THEN 140 ‘THEN 140 0 140 PRINT #1, SPC(21); ‘NATURAL GAS PROPERTIES FROM COMPOSITION": PRINT #1, 2, 30 THEN 150 2 SPC(1); "T(heating value) ="; 7B; “ ity) =") TA; "Cy"; SPC(2); "P="; P; “KPAT: PRINT #1, ty SPCU2); Goro 160 150 PRINT #1, *CONDITIONS:*; SPC(1); *P(heating value) *T(density) 1B: °F, iP) “PSIA": PRINT #1, sPc(2); 3 TA; *F;7; SPC(2); *P 160 PRINT #1, SPC(35); "ANALYSIS": PRINT #1, REM REM ¢** REM 170 Gt FOR I = IF x(1 IF > %* CALCULATING MOLAR MASS, RELATIVE DENSITY, AND HEATING VALUE ***** = 0: Ms 0: RM= 0 170 21 ) = 0 THEN 270 4 THEN 180 * AL(2i) + (r+ 1) * AL(L5) * aa(2i) + (1 + 1) * A2(15) * a3(21) + (r+ 1) * A3(25) + (3 "T4417 /2) * ate) (3 *r4#2) / 2) * a2(a8) (3 *re42) / 2) * age) 60 I <> § THEN 190 * A(2a) + 5 * AL(IS) ~ 6.5 * AL(18) *A2(21) + 5 * A2(15) - 6.5 * A2\18) 23 ac = 4 * A3(21) 5 * a3(15) - 6.5 * A3(18) aD = 5 GoTo 260 190 IF I < 6 OR I > 7 THEN 200 aA A1(21) + 6 * AL(15) - 8 ¥ A1(18) aB A2(21) + 6 * A2(15) ~ 8 * A2(18) ac A3(21) + 6 * A3(15) - 8 * A3(28) AD = Goro 260 200 IF ¥ < 8 OR I > 12 THEN 210 AR = (I= 2) * AL(Q1) + (T= 1) * al(5) - (3: E- 5) / 2) * AL(18) ABs (I~ 2) * A2(21) + (XT ~ 4) * A2(15) - (3 - 5) / 2) * A2(28) AC = (I~ 2) * A3(24) + (X - 2) * A3(5) - (3 *# TF - $) 7 2) * A3(18) aD=I-1 Goro 260 210 IF I <> 13 THEN 220 AA = A115) ~ 15 * AL(18) AB = A2(15) ~ .5 *-A2(18) AC = A3(15) - .5 * A3(18) aD=1 Goro 260 220 IF I <> 15 THEN 230 AK = A1(25) AB = A2(15) AC = A3(15) aD=1 coro 260 230 IF I <> 16 THEN 240 AA = A1(21) - .5.* A1(18) AB = A2(21) ~ .5 * A2(18) AC = A3(21) ~ .5 * A3(18) aD =O Goro 260 240 IF T <> 19 THEN 250 AA = A1(15) + A1(22) ~ 1.5 * AL(18) AB = A2(15) + A2(22) - 1.5 * a2(18) AC = A3(15) + A3(22) - 1.5 * A3(18) aD=1 Goro 260 250 IF T <> 14 AND I <> 17 AND I <> 18 AND I <> 20 AND I <> 21 THEN 260 AA = AL() AB = A2(z) AC = A3(z) AD =0 260 WB = 72 - 273.15 H2 = AD * (~.04135 * (H3 - 25) + 3.724B-05 * (HB - 25) * 2) HS = (AC - A3(T)) * (HB * HB + HB * 50 + 625) / 3 Hd = AA ~ AL(I) + (AB ~ A2(I)) * (HB + 25) / 2 ~ HS HL = (H3 = 25) * Ha * 8.324480000000001D-03 He = H(Z) - HL + Hz HN = HN + X(I) * HC HN = HN ~ x(15) * #05) HVA = BN 270 NEXT I 280 FAC = 0: RM = FOR I= 170 21 FAC = FAC + X(I) * B(T) RM + X(Z) + RM(T) 24 NEXT I 2=1- PP * FAC * FAC HM = 1000 * HN / RM: HV = 1000 * HN * PP / (8314.488 * 72 GI = RM / 28,9625: GR = GI * 2A / 2 REM REM *¢##0eeeueveneeeeerer® PRINTING RESULTS SHHRHERHEEEARARAH EWE RESAEAREAAA REM 1 FORT = 1707 HVR = HV / 2 PRINT SPC(7); USING "x\ Hee x\ \= weet x #.8BHHS; NAG(ID; X(I)7 NAS (I 4 7); X(X + 7); NAG(T + 14)7 X(T + 14) NEXT I PRINT : PRINT SPC(7); USING "Molar Mass Pe Gross EATING VALUES "; RM IP F$ = *Y* THEN 290: Goro 300 290 FORT = 1707 PRINT #1, SPC(7 \= B.HREES; NAS(I); X(T); NAS(T + 7); X(Z + 7); NAG(T + 14 NEXT T 300 IP TA >= 30 THEN 320: IF TB >= 30 THEN 320 PRINT SPC(7); USING "Molar Mass Ratio ate ents ka/kg"; GI; HM PRINT SPC(7); USING "Relative Density Peery ene xg/Tdeal CM"; GR; HV PRINT SPC(7); USING "Compressibilty Factor = #.¢#### sents kg/Real CM"; 2; HVR IP FS = *Y* THEN 310 IF F§ = "y* THEN 320 Goro 350 310 PRINT #1, : PRINT #1, SPC(7); USING ‘Molar Mass = ete GROSS HEATING VALUES"; RM PRINT #1, SPC(7); USING "Molar Mass Ratio = eete fete kg/kg"; GT; EM PRINT #1, SPC(7); USING "Relative Density a.nnaes ane xg/Tdeal CM"; GR: BV PRINT #1, SPC(7); USING "Compressibilty Factor = #.##### tenes kg/Real CM"; 2; HVR Goro 340 "320 HM = HM * .42992268 HV = HV * .02683919¢ HR = HV / 2 PRINT SPC(7); USING "Molar Mass Ratio +e Hatdt Btu/Ib"; GT; HM PRINT SPC(7); USING “Relative Density OR atte Btu/Tdeal CF"; GR; HV PRINT SPC(7); USING *Compressibilty Factor Btu/Real CF"; Z; EVR IP FG = *Y" THEN 330: IF F§ = *y" THEN 330 Goro 350 330 PRINT #1, : PRINT #1, SPC(7); USING "Molar Mass = Ree GROSS HEATING VALUES"; RM PRINT #1, SPC(7); USING "Molar Mass Ratio = hate sete Btu/Ib*; GI; HM PRINT #1, SPC(7); USING "Relative Density Btu/Ideal CF"; GR; HV PRINT #1, SPC(7); USING "Compressibilty Factor = #.¢#6## freee Btu/Real CF*; Z; HVR IF F§ = ty" THEN 290 USING *x\ \= este x\ \= ttee x 7 K(I + 14) ane anne aeeee 25 $$ ere 340 PRINT #1, 350 PRINT REM REM ¢444+s00e08800# INPUTTING FOR HARD COPY *#4###0betteetsateereeaeessaaeee REM PRINT ; PRINT "DO YOU WANT A HARD COPY NOW (ONLY APPLICABLE FOR DAT MATRIX OR PCL PRINTER) ?* INPUT Y1§ IP Y1g = *Y* THEN 440 IP Y1g = *y" THEN 440 REM REM 4¢44#¢00844048 CALCULATING SATURATED VALUES *##44++¢+044¢ttH HAR Ceaaaae REM. 360 IF TTR = 1 THEN 500 IF X(15) = 1 THEN 380 INPUT “Do you want to calculate water saturated values for custody transfer?", Ys IF Y$ = *yt THEN 370 IF Y$ = *y* THEN 370 Goro 510 370 HH = X(15): X(15) = 0 ZL = ((4.4412543D-13 * TL - 8,4150417D-20) * T1 + .0000178383018) 22 = (21 * TL - .028354721#) * T1 + 18,876438548 ~ (2991.27298 / TL + : 6017.01288) / TL PW = EXP(22 + 2.858487# * LOG(T1)) FOR T= 10 21: X(Z) = X(I) * (1 - PW/ PP) / (1 ~ XW): NEXT T x15) = Pw / PP HN = (1 = X(25)) * HN 380 TTR = I7R + 2 CLS : PRINT : PRINT : PRIWD : PRINT : PRINT SPC(35); "SATURATED ANALYSIS": PRINT IP F§ = *Y* THEN 390 IF P§ = ty" THEN 390 Goro 280 390 PRINT #1, SPC(35); "SATURATED ANALYSIS": PRINT #1, Goro 280 400 IF F$ = "y* THEN CLOSE #1: IF F§ = "y* THEN CLOSE #1 PRINT : PRINT : PRINT : PRINT "DO YOU WANT 70 DO ANOTHER CALCULATION?* INPUT YS IF Y§ = "Y? THEN 410 IP Y$ = ‘y* THEN 410 coro 490 410 INPUT "Do YOU WANT TO SAVE OUTPUT TO A FILE"; FS IF F§ = °Y" THEN 420 IP FG = *y* THEN 420 Goro 430 420 PRINT ‘What drive and filename would you like to save the output on?* PRINT ‘For example, B:STREAMI.DAT* INPUT “What is the desired drive and filenames; FileNane$ OPEN "o", 1, FileName$ 430 PRINT : PRINT : PRINT “DO YOU WANT TO CHANGE THE TEMPERATURE OR PRESSURE?" INPUT KS PRINT : PRINT "DO YOU WANT TO CHANGE YOUR MOLE FRACTIONS" INPUT L$ IF L§ = *Y* THEN 490 IF L$ = ty" THEN 40 IF KS = *¥* THEN 40 IF KS = ty" THEN 40 Goro 80 REM REM *¢44teeeeeeeeesee4 PRINTING HARD COPY *##t0eteseteueaaeunneaanennesaaaee REM 440 IF TTR <> 1 THEN LPRINT SPC(21); "NATURAL GAS PROPERTIES FROM COMPOSITION’ LPRINT + LPRINT IF TA >= 30 THEN 450: IF TB >= 30 THEN 450 IF JTR <> 1 THEN LPRINT “CONDITIONS:"; SPC(1); "T(heating value) ="; TB; "DEG ct; SPC(2); "T(density) ="; TA; "DEG C*; SPC(2);-"P =*; P; "KPA*: LPRINT coro 460 450 IF TTR <> 1 THEN LPRINT “CONDITYONS:"; $PC(1); *T(heating value) ="; 7B; “DEG FY; SPC(2); "P(density) ="; TA; "DEG F"; SPC(2); "P="; P; "PSIAT: LPRINT 460 IF TTR <> 1 THEN LPRINT SPC(35); "ANALYSIS*: LPRINT IF 1TR2 = 1 THEN LPRINT SPC(33); “WEP ANALYSTS* IP TTR = 1 THEN LPRINT “CONDITIONS: *: LPRINT : LPRINT "RELATIVE HUMIDITY ="; HA; SPC(3); "HUMIDITY OF GAS ="; HG; SPC(3); "FRACTION OF EXCESS AIR IP TTR = 1 THEN LPRINT SPC(30); “SATURATED ANALYSIS": LPRINT FOR I = 170 7 LPRINT SPC(7); USING *x\ aanee x\ nent ea #.9HHHT | NAS (I); X(I); NAG(Z + 7); MCE + 7); NAS(T + 24); X(T + 14) NEXT I LPRINT : LPRINT SPC(7); USING "Molar Mass nent cross, HEATING VALUES"; RM IF TA >= 30 THEN 470: IF TB >= 30 THEN 470 LPRINT SPC(7); USING "Molar Mass Ratio mG seen ka/kg"; GI: HM LPRINT SPC(7); USING *Relative Density a neeee aeeaa xg/Ideal CM"; GR; HV LPRINT SPC(7); USING *Compressibilty Factor = #.###8# ad kg/Real CM"; 2; HVR 470 LPRINT SPC(7); USING “Molar Mass Ratio = een aeeen Btu/Ib"; GI; HM LPRINT SPC(7); USING *Relative Density = ene nate Btu/Ideal CF*; GR; HV LPRINT SPC(7); USING *Compressibilty Factor = #.4##f# 1H Btu/Real CF"; 2; HVR IF ITR2 = 1 THEN GOTO 480 LPRINT 480 IF TTR = 1 THEN S00: IF ITR2 = 1 THEN 400 coro 360 490 END 500 IF ITR2 REM REM ##AtAAuseseceeAAAMe OS AAMuOEAAH WET CALCULATIONS “A4¢etteteneanennnaaaaan REN. 510 INPUT “Do you want wet values for engineering calculations?", Y$ TTR = 1: TTR2 = 1 1 THEN 400 IF Y$ = *Y* THEN 520 IF Y$ = *y* THEN 520 Goro 400 520 INPUT "What is the relative humidity of air (use fraction not percent)?", HA PRINT : PRINT "Enter a 0 for relative humidity of gas to default to x(water) inputted earlier.": PRINT 27 | | INPUT “What is the relative humidity of the gas (use fraction not percent)?*, HG INPUT “What is the fraction of excess air (use fraction not percent)?", EA FOR I= 1 70 21 X(I) = XA(I) NEXT I ALPHA = 0: BETA = 0: ITR2 = 0 FORT = 1704 ALPHA = ALPHA + I * X(T) BETA = BETA + (3 + I + (I - 1)) * X(Z) NEXT T FOR I = 5 70 6 ALPHA = ALPHA + (I - 1) * X(Z) BETA = BETA + 2 * I * X(z) NEXT 1 FOR I= 770 8 ALPHA = ALPHA + (I~ 2) * X(I) BETA = BETA + (2 * I - 2) * X(I) NEXT I BETA = BETA + 2 * X(19) Gama = x(29) XW = X(15): X(15) = 0 21 = ((4.4412543D-13 * T1 - 8.4150417D-10) * TL + .0000178383016) 22 = (Z1'* Tl - .028354721#) * TL + 18.87643854# - (2991.27298 / TL + 6017.01288) / 71 Pa = EXP(22 + 2.858487# * LOG(T1)) X(15) = BG * PH / PP HGA = XW * PP / PW IF ABS(HGA ~ HG) > .2 * HG THEN PRINT "INCONSISTENT VALUE FOR HG AND X(WATER)* FOR I = 1 70 21 X(I) = (1 ~ ¥(15)) * XZ) NEXT 1 w= (1 = X(25)) * BNA NGW = (HG * PW / PP) / ((1 - X(17) - X(21)) * (1 - HG * PH / PP)) NAW = 4.77418 * (ALPHA + BETA / 4 + GAMMA) * (1 + EA) * (HA * PW / PP) / (1 - HA * Pu / PP) NNVW = (ALPHA + GAMMA + (X(17) + X(21)) / (1 = X(17) - X(21)) + (ALPHA + BETA / 4 + GAMMA) * (3.77418 + 4.77418 * EA)) HN = HN + (NGW + NAW - NW * (PW / PP) / (1 - PW / PP)) * HUIS) | TTR2 = 1TR2 +1 CLS : PRINT ; PRINT ; PRINT ; PRINT : PRINT ; PRINT SPC(33); "WET ANALYSIS*: PRINT . PRINT : PRINT CONDITIONS: PRINT “RELATIVE HUMIDITY “FRACTION OF EXCESS AIR ="; IF FS coro 280 530 PRINT $1, : PRINT #1, SPC(33); "WET ANALYSIS" PRINT #1, "CONDITIONS: *: PRINT #1, PRINT #1, "RELATIVE HUMIDITY ="; HA; SPC(3); “HUMIDITY OF GAS ="; HG; SPC(3); “FRACTION OF EXCESS AIR ="; EA: PRINT #1, coro 280 : PRINT HA; SPC(3); “HUMIDITY OF GAS BA: PRINT *Y" THEN 530: IF P$ = ty" THEN 530 HG; SPC(3); 28

You might also like