CG39AGA-1 CONTENTS TABLE OF CONTENTS PAGE SECTION AND TITLE 1.0 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 PRODUCT DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 PRODUCT SUPPORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 RELATED LITERATURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 1-1 1-8 1-9 2.0 AGA3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 3.0 TURBINE_METER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 4.0 COMPR_FACTOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 5.0 COMPR_FACTOR_s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 6.0 COMPR_FACTOR_b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 7.0 COM_FACTOR_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 8.0 COM_FACTOR_2_s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1 9.0 AGA3_CF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1 10.0 TURB_METER_CF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1 LIST OF FIGURES FIGURE AND TITLE PAGE 1-1 1-2 1-3 1-4 1-5 AGA Application Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AGA3_CF and TURB_METER_CF Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . COM_FACTOR_2_ and AGA3 Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . COMPR_FACTOR_ Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TURBINE_METER Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 2-1 AGA3 Block Contents (Page 1 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 AGA3 Block Contents (Page 2 of 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 3-1 TURBINE_METER Block Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 November 1997 1-3 1-4 1-5 1-6 1-7 i CONTENTS CG39AGA-1 LIST OF FIGURES (Continued) PAGE FIGURE AND TITLE 4-1 4-1 4-1 4-1 COMPR_FACTOR Block Contents (Page 1 of 4) COMPR_FACTOR Block Contents (Page 2 of 4) COMPR_FACTOR Block Contents (Page 3 of 4) COMPR_FACTOR Block Contents (Page 4 of 4) 5-1 5-1 5-1 COMPR_FACTOR_s (Page 1 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 COMPR_FACTOR_s (Page 2 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 COMPR_FACTOR_s (Page 3 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 6-1 6-1 6-1 COMPR_FACTOR_b (Page 1 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 COMPR_FACTOR_b (Page 2 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 COMPR_FACTOR_b (Page 3 of 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 7-1 7-1 7-1 7-1 COM_FACTOR_2 (Page 1 of 4) COM_FACTOR_2 (Page 2 of 4) COM_FACTOR_2 (Page 3 of 4) COM_FACTOR_2 (Page 4 of 4) 8-1 8-1 8-1 8-1 COM_FACTOR_2_s (Page 1 of 4) COM_FACTOR_2_s (Page 2 of 4) COM_FACTOR_2_s (Page 3 of 4) COM_FACTOR_2_s (Page 4 of 4) 9-1 9-1 9-1 9-1 9-1 9-1 9-1 9-1 AGA3_CF (Page 1 of 8) AGA3_CF (Page 2 of 8) AGA3_CF (Page 3 of 8) AGA3_CF (Page 4 of 8) AGA3_CF (Page 5 of 8) AGA3_CF (Page 6 of 8) AGA3_CF (Page 7 of 8) AGA3_CF (Page 8 of 8) 10-1 10-1 10-1 10-1 10-1 TURB_METER_CF (Page 1 of 5) TURB_METER_CF (Page 2 of 5) TURB_METER_CF (Page 3 of 5) TURB_METER_CF (Page 4 of 5) TURB_METER_CF (Page 5 of 5) ii ..................................... ..................................... ..................................... ..................................... .................................................. .................................................. .................................................. .................................................. ................................................ ................................................ ................................................ ................................................ 4-2 4-3 4-4 4-5 7-3 7-4 7-5 7-6 8-3 8-4 8-5 8-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10 ................................................ ................................................ ................................................ ................................................ ................................................ 10-3 10-4 10-5 10-6 10-7 November 1997 CG39AGA-1 CONTENTS SIGNIFICANT CHANGES IN REVISION 3 The significant changes in revision 3, which are indicated by change bars located in text page margins, primarily involve the use of COM_FACTOR_2_ blocks and an additional input to the AGA3_CF block to indicate flow conditions measured upstream or downstream. The locations in this configuration guide of information affected by these changes and a brief description of their effect are provided as follows: 4.0 COMPR_FACTOR: Clarified the fact that this block should also be used to calculate compressibility at standard or base conditions if either the COMPR_FACTOR_s or COMPR_FACTOR_b block is not applicable. Changed the value of X for calculating the required number of scans from 20 to 12. Added the output rho for density in lb/cu. ft. 5.0 COMPR_FACTOR_s: Added output rho for density in lb/cu. ft. 6.0 COMPR_FACTOR_b: Added output rho for density in lb/cu. ft. 9.0 AGA3_CF: Revised the value of X for calculating the required number of scans from 25 to 17. Added input of DNSTRM to indicate that the downstream tap is used to measure flowing conditions. Added note to output Cprime that Qb = Cprime* [(Pf*hw)**0.5]. 10.0 TURB_METER_CF: Revised the typical value of X for calculating the required number of scans from 20 to 12. A.0 APPENDIX A - EXAMPLE WITH AGA3 AND COM_FACTOR_2 BLOCKS: Deleted B.0 APPENDIX B - EXAMPLE WITH TURBINE_METER AND COM_FACTOR_2 BLOCKS: Deleted # November 1997 iii CONTENTS iv CG39AGA-1 November 1997 CG39AGA-1 INTRODUCTION 1.0 INTRODUCTION This document describes the AGA (American Gas Association) Application Library (Version 3.00 or higher) that contains a set of derived function blocks (DFBs) that are pre-configured at the factory to perform AGA natural gas flow calculations. These calculations include those relating to orifice metering, turbine metering, and compressibility factor calculation. The library is in the form of a stand-alone off-line ACM configuration that is part of a system named AGA. The configuration is intended to be opened identically to opening any other off-line database, and the blocks are to be selectively copied from the library configuration and pasted into the user-developed configuration. The library can be used directly from the floppy, or it can be used from a hard disk after first copying the entire library floppy contents onto the hard disk (keep all subdirectories intact). This document describes each block and provides a graphical presentation of each of the blocks in the AGA Application Library (see Figures 1-1 to 1-5). This configuration guide is organized into the following sections: • Section 1, Introduction • Section 2, AGA3 • Section 3, TURBINE_METER • Section 4, COMPR_FACTOR • Section 5, COMPR_FACTOR_s • Section 6, COMPR_FACTOR_b • Section 7, COM_FACTOR_2 • Section 8, COM_FACTOR_2_s • Section 9, AGA3_CF • Section 10, TURB_METER_CF 1.1 PRODUCT DESCRIPTION AGA (American Gas Association) natural gas flow calculations are a means to accurately measure the flow of natural gas using a variety of flowmeter types. In a series of different reports, the AGA provides equations for determining the flow rate by use of orifice meters (Report No. 3) and by use of turbine meters (Report No. 7), and for determining the compressibility factor of the gas at various conditions (Report No. 8. Compressibility factors are essential data for the flowmeter equations. These rigorous AGA calculations are November 1997 1-1 INTRODUCTION CG39AGA-1 generally required for custody transfer and accounting purposes. The AGA Library blocks perform the calculations provided in these three AGA reports. Refer to the document AGA Natural Gas Flow Calculations in the APACS Controller (AD39-3, provided with this configuration guide) for application data and additional background information on the AGA calculations. The AGA3 block continuously calculates the volume flow rate of natural gas at base conditions and the composite orifice flow factor for an orifice flow meter with flange taps, in accordance with the factors approach presented in AGA Report No. 3. The TURBINE_METER block continuously calculates the gas volume flow rate at base conditions for an axial-flow gas turbine meter, in accordance with AGA Report No. 7. Both blocks require the determination of gas compressibility factors for flowing and base conditions (and for AGA3 standard conditions). The purpose of the COMPR_FACTOR_ and COM_FACTOR_2_ blocks are to calculate the compressibility factors, in accordance with AGA Report No. 8. The COMPR_FACTOR_ blocks use equations from the AGA Report No. 8 dated December 1985. The COMPR_FACTOR_s block is to be used for AGA standard conditions (14.73 psia, 60EF) and the COMPR_FACTOR_b block is to be used for base conditions. The COMPR_FACTOR_s and the COMPR_FACTOR_b blocks use a simplified equation that is applicable only if the gas composition is at least 80 mol % methane, and the pressure is less than 16 psia. The COMPR_FACTOR block is to be used for flowing conditions and can be copied to use for standard and/or base conditions if the simplified blocks are not applicable. The COM_FACTOR_2_ blocks use equations from the November 1992 AGA Report No. 8 (Second Edition, July 1994). The newer equations in the 1992 report were designed to be more accurate than the * 1985 equations when the flowing pressure is very high (e.g. 2000 psia). The COM_FACTOR_2_ blocks are * much more time-consuming than the older equations, so they should only be used when necessary. The COM_FACTOR_2 block is to be used for flowing and base conditions, and the COM_FACTOR_2_s block is to be used for AGA standard conditions. Both the COMPR_FACTOR_ and COM_FACTOR_2_ sets of blocks have an array input (named x) that is used to enter the gas composition. Each array element is to be the mol fraction of a particular component. The index numbers of each possible component are listed in the documentation for each block. The COMPR_FACTOR_ blocks require a 20-element array for the x input [e.g. x1(1..20)] and have identical component index assignments. The COM_FACTOR_2_ blocks require a 21-element array [e.g. x2(1..21)] and have identical component index assignments. However, the component index assignments for the COM_FACTOR_2_ set are different than index assignments for the COMPR_FACTOR_ set. As a convenience, the equations from the AGA3 and COMPR_FACTOR_ blocks have been combined to form the AGA_CF block. Similarly, the TURBINE_METER and COMPR_FACTOR_ blocks have been combined into the TURB_METER_CF block. These blocks use the older compressibility factor equations, and automatically determine if the simplified equations can be applied to standard and/or base conditions. * The AGA3_CF block has an input to indicate if the flowing conditions are measured at the upstream or * downstream taps. 1-2 November 1997 CG39AGA-1 November 1997 INTRODUCTION 1-3 INTRODUCTION 1-4 CG39AGA-1 November 1997 CG39AGA-1 November 1997 INTRODUCTION 1-5 INTRODUCTION 1-6 CG39AGA-1 November 1997 CG39AGA-1 November 1997 INTRODUCTION 1-7 INTRODUCTION CG39AGA-1 1.2 PRODUCT SUPPORT Product support can be obtained from the Moore Products Co. Technical Information Center (TIC). TIC is a customer service center that provides direct telephone support on technical issues related to the functionality, application, and integration of all products supplied by Moore Products Co. To contact TIC for support, either call 215-646-7400, extension 4TIC (4842) or leave a message in the bulletin board service (BBS) by calling 215-283-4968. The following information should be at hand when contacting TIC for support: C Caller ID number, or name and company name (When someone calls for support for the first time, a personal caller number is assigned. This number is mailed in the form of a caller card. Having the number available when calling for support will allow the TIC representative taking the call to use the central customer database to quickly identify the caller’s location and past support needs.) • Product part number, software version, and serial number, all of which are identified on the software’s disk label • Computer brand name, model number, and hardware configuration (types of disk drives, memory size, video adapter, etc.), if applicable • Version number of operating system (e.g. UNIX, OSF/Motif), if applicable • If there is a problem with software operation: - The steps performed before the problem occurred - Any error messages displayed • It would also be helpful to have the following information: - 4-mation version number - Documentation about your system’s architecture For product support outside of North America, an alternative support system is available by contacting the appropriate Moore Products Co. regional location: Australia Moore Products Co. (Australia) Pty. Ltd. Tel: (61) (2) 9319 4877 Canada Moore Products Co. (Canada) Inc. Tel: (905) 457 9638 France Factory Systemes Tel: (33) 1 64 61 68 68 Moore Controls Pvt. Limited Tel: (91) (212) 770171 Italy Moore Products Co. (Italia) S.r.l. Tel: (39) (2) 2940 1094 Mexico Moore Products de Mexico S.A. de C.V. Tel: (52) 5 611 9858; (52) 5 615 1948; (52) 5 615 0262; or (52) 5 615 0238 India 1-8 November 1997 CG39AGA-1 INTRODUCTION The Netherlands Moore Products Co. B.V. Tel: (31) 180 461111 South Africa Moore Controls S.A. (Pty) Ltd. Tel: (27) 11 466 1673/9 Singapore Moore Products Co. (S) Pte. Ltd. Tel: (65) 299 6051 United Kingdom Moore Products Co. (U.K.) Ltd. Tel: (44) (1935) 706262 1.3 RELATED LITERATURE The following Moore Products Co. literature is available for reference: C AGA Natural Gas Flow Calculations in the APACS® Controller (AD39-3) C 4-mation 3.XX: - C 4-mation User’s Manual, Installation and Operation (UM39-6) 4-mation User’s Manual, Function Block Languages (UM39-7) 4-mation 4.XX: - 4-mation Installation and Operation (UM39-11) 4-mation Function Block Language (UM39-12) The following vendor literature should be available as needed: • • Microsoft® MS-DOS® Operating System Reference Microsoft Windows™ 3.1 (or later) Operating System Reference # November 1997 1-9 INTRODUCTION 1-10 CG39AGA-1 November 1997 CG39AGA-1 AGA3 2.0 AGA3 The derived block AGA3 continuously calculates the volume flow rate of natural gas at base conditions and the composite orifice flow factor for an orifice flow meter with flange taps, in accordance with the factors approach presented in AGA Report No. 3. The composite orifice flow factor C' is updated continuously for temperature effects and periodically for all other effects. The periodic update of C' is triggered by a function block input. Since the C' recalculation requires iteration, it is time-sliced, using a snapshot of the function block inputs and determining a new C' after several controller scans (typically 4 to 5). The volume flow rate (Qv) and C' are first calculated for the standard conditions used in the AGA report (14.73 psia pressure, 60EF temperature), and are then adjusted to the base conditions. Block contents are shown graphically on Figure 21. The inputs are: hw = orifice differential pressure (in wc) Pf1 = flowing pressure at upstream tap (psia) Tf = flowing temperature (EF) Zf1 = compressibility at flowing conditions at upstream tap Zs = compressibility at AGA standard conditions of 14.73 psia and 60EF Gr = specific gravity Pb = base pressure (psia) Tb = base temperature (EF) Zb = compressibility at base conditions dr = orifice plate bore diameter at reference temperature (in) Dr = meter tube internal diameter at reference temperature (in) RECALC = rising-edge trigger for the periodic recalculation of part of C' The outputs are: Qb Cprime DONE = volume flow rate at base conditions (SCFH) = composite orifice flow factor C' (SCFH/(((psi)(in wc))**0.5)) = periodic recalculation DONE status Reference: AGA Report No. 3, Orifice Metering of Natural Gas, Part 3, August 1992 (AGA Catalog No. XQ9210). Several assumptions from the AGA3 report are incorporated in this block. If any of these assumptions do not apply, the block may need to be modified. Cross-references to the structured text statements with equations and assumptions from the AGA3 report appear throughout the block. The assumptions are: C Ps (standard pressure) = 14.73 psia, Ts (standard temperature) = 60EF, and Zsair (compressibility of air at standard conditions) = 0.999590. C The orifice plate material is type 304 or 316 stainless steel, the meter tube material is carbon steel, and Tr (reference temperature for the orifice bore and tube diameters) = 68EF. November 1997 2-1 AGA3 CG39AGA-1 C The nominal pipe size is 2" or larger; the beta is 0.1-0.75, with d larger than 0.45"; and pipe Reynolds number Re is greater than or equal to 4000. C The expansion factor (Y) and absolute flowing pressure (Pf) are referenced to the upstream tap (Y1 and Pf1 are used), and 0 < (hw/(27.707*Pf)) <= 0.2. Note that Pf1 = Pf2 + (hw/27.07), where Pf2 is the pressure measured at the downstream tap. C k (isentropic exponent) = 1.3. C mu (dynamic viscosity) = 0.0000069 lbm per ft-sec. Each instance of the AGA3 block occupies approximately 8K of memory. Normal execution time (when C' recalculation is not occurring) is 0.6 ms in an ACM040 (2 ms in an ACM030). During the 4 to 5 recalculation scans, the execution time is 3 ms for an ACM040 (10 ms for an ACM030). # 2-2 November 1997 CG39AGA-1 TURBINE_METER 3.0 TURBINE_METER The derived block TURBINE_METER continuously calculates the gas volume flow rate at base conditions for an axial-flow gas turbine meter, in accordance with AGA Report No. 7. Block contents are shown graphically on Figure 3-1. The inputs are: Qf Pf Tf Zf Pb Tb Zb = volume flow rate (any units) = flowing pressure (psia) = flowing temperature (EF) = compressibility at flowing conditions = base pressure (psia) = base temperature (EF) = compressibility at base conditions The output is: Qb = volume flow rate at base conditions (same as Qf units) Reference: Section 6 of the AGA Turbine Meter Report No. 7, 1985 (AGA Catalog No. XQ0585). Each instance of the TURBINE_METER block occupies approximately 2.3K of memory. The execution time is 0.2 ms in an ACM040 (0.6 ms in an ACM030). # November 1997 3-1 TURBINE_METER 3-2 CG39AGA-1 November 1997 CG39AGA-1 COMPR_FACTOR 4.0 COMPR_FACTOR The derived block COMPR_FACTOR calculates the compressibility factor of a natural gas at a given pressure and temperature in accordance with the primary method presented in AGA Report No. 8 (December 1985). The COMPR_FACTOR block is intended to be used for finding the compressibility at flowing conditions (Zf). This block can also be used to calculate the compressibility at standard or base conditions (Zs or Zb) if the COMPR_FACTOR_s or the COMPR_FACTOR_b block is not applicable. The calculation is to be triggered periodically (via a function block input) and can require more than a minute to complete. Because the calculation is slow, it is time-sliced, using a snapshot of the function block inputs and determining a new Z after the required number of controller scans. The required number of scans depends on the composition of the gas. Use [(# of components)**2 + X] to calculate the required number of scans (a typical value for X is 12). A boolean output is provided to indicate that the calculation is completed. Block contents are shown graphically on Figure 4-1. * * The inputs are: x = gas composition as an array x[1..20] (The index of each component follows.) P = pressure (psia) T = temperature (EF) RECALC = rising-edge trigger for the periodic recalculation of the compressibility factor The outputs are: Z Gr DONE rho = compressibility factor = gas relative density (specific gravity) (to be used in the AGA3 calculation if this block is used for standard conditions) = calculation DONE status = density (lb/cu.ft) * Reference: AGA Compressibility and Supercompressibility for Natural Gas Report No. 8, December 1985 (AGA Catalog No. XQ1285). Cross-references to the structured text statements with equations from the AGA8 report appear throughout the block. The index of each component is as follows: 1 = Nitrogen 2 = Carbon Dioxide 3 = Hydrogen Sulfide 4 = Water 5 = Helium 6 = Methane 7 = Ethane 8 = Propane 9 = n-Butane 10 = i-butane 11 = n-Pentane 12 = i-pentane 13 = n-Hexane 14 = n-Heptane 15 = n-Octane 16 = n-Nonane 17 = n-Decane 18 = Oxygen 19 = Carbon Monoxide 20 = Hydrogen Each instance of the COMPR_FACTOR block occupies approximately 23K of memory. The execution time during calculation averages 3 ms in an ACM040 (10 ms in an ACM030). November 1997 4-1 COMPR_FACTOR CG39AGA-1 # 4-2 November 1997 COMPR_FACTOR 4-6 CG39AGA-1 November 1997 CG39AGA-1 COMPR_FACTOR_s 5.0 COMPR_FACTOR_s The derived block COMPR_FACTOR_s calculates the compressibility factor of a natural gas at standard conditions (Zs), in accordance with the primary method presented in AGA Report No. 8 (December 1985). This block uses a simplified compressibility equation that is valid for a gas mixture that is more than 80 mol percent methane. Standard conditions are assumed to be those identified as standard in the AGA3 report No. 3: 14.73 psia pressure and 60EF temperature. The calculation is to be triggered periodically (via a function block input) and requires several controller scans to complete. Since the calculation is slow, it is time-sliced, using a snapshot of the function block inputs and determining a new Zs after the required number of controller scans. The required number of scans depends on the composition of the gas. Use [(# of components)**2 + 2] to calculate the required number of scans. A boolean output is provided to indicate that the calculation is completed. Block contents are shown graphically on Figure 5-1. The inputs are: x = gas composition as an array x[1..20] (The index of each component follows.) RECALC = rising-edge trigger for the periodic recalculation of the compressibility factor The outputs are: Zs Gr DONE rho = standard compressibility factor = gas relative density (specific gravity) (to be used in the AGA3 calculation) = calculation DONE status = density (lb/cu.ft) * Reference: AGA Compressibility and Supercompressibility for Natural Gas Report No. 8, December 1985 (AGA Catalog No. XQ1285). Cross-references to the structured text statements with equations from the AGA8 report appear throughout the block. The index of each component is as follows: 1 = Nitrogen 2 = Carbon Dioxide 3 = Hydrogen Sulfide 4 = Water 5 = Helium 6 = Methane 7 = Ethane 8 = Propane 9 = n-Butane 10 = i-butane 11 = n-Pentane 12 = i-pentane 13 = n-Hexane 14 = n-Heptane 15 = n-Octane 16 = n-Nonane 17 = n-Decane 18 = Oxygen 19 = Carbon Monoxide 20 = Hydrogen Each instance of the COMPR_FACTOR_s block occupies approximately 12K of memory. The execution time during calculation averages 3 ms in an ACM040 (10 ms in an ACM030). # November 1997 5-1 COMPR_FACTOR_s 5-2 CG39AGA-1 November 1997 CG39AGA-1 COMPR_FACTOR_b 6.0 COMPR_FACTOR_b The derived block COMPR_FACTOR_b calculates the compressibility factor of a natural gas at base conditions (Zb) in accordance with the primary method presented in AGA Report No. 8 (December 1985). The block uses a simplified compressibility equation that is valid for a gas mixture that is more than 80 mol percent methane and for a base pressure of no greater than 16.0 psia. The calculation is to be triggered periodically (via a function block input) and requires several controller scans to complete. Since the calculation is slow, it is time-sliced, using a snapshot of the function block inputs and determining a new Zs after the required number of controller scans. The required number of scans depends on the composition of the gas. Use [(# of components)**2 + 2] to calculate the required number of scans. A boolean output is provided to indicate that the calculation is completed. Block contents are shown graphically on Figure 6-1. The inputs are: x = gas composition as an array x[1..20] (The index of each component follows.) Pb = base pressure (psia) Tb = base temperature (EF) RECALC = rising-edge trigger for the periodic recalculation of the compressibility factor The outputs are: Zb DONE rho = base compressibility factor = calculation DONE status = density (lb/cu.ft) * Reference: AGA Compressibility and Supercompressibility for Natural Gas Report No. 8, December 1985 (AGA Catalog No. XQ1285). Cross-references to the structured text statements with equations from the AGA8 report appear throughout the block. The index of each component is as follows: 1 = Nitrogen 2 = Carbon Dioxide 3 = Hydrogen Sulfide 4 = Water 5 = Helium 6 = Methane 7 = Ethane 8 = Propane 9 = n-Butane 10 = i-butane 11 = n-Pentane 12 = i-pentane 13 = n-Hexane 14 = n-Heptane 15 = n-Octane 16 = n-Nonane 17 = n-Decane 18 = Oxygen 19 = Carbon Monoxide 20 = Hydrogen Each instance of the COMPR_FACTOR_b block occupies approximately 12K of memory. The execution time during calculation averages 3 ms in an ACM040 (10 ms in an ACM030). # November 1997 6-1 COMPR_FACTOR_b 6-4 6-2 CG39AGA-1 October 1997 CG39AGA-1 November 1997 COMPR_FACTOR_b 6-3 CG39AGA-1 COM_FACTOR_2 7.0 COM_FACTOR_2 The derived block COM_FACTOR_2 calculates the compressibility factor and density of a natural gas at a given pressure and temperature in accordance with the detail characterization method presented in AGA Report No. 8, November 1992 (Second Edition, July 1994). This block is intended to be used for finding the compressibility at flowing conditions (Zf) or at base conditions (Zb). The calculation is to be triggered periodically (via a function block input) and can require several minutes to complete. Since the calculation is slow, it is time-sliced, using a snapshot of the function block inputs and determines a new Z after the required number of controller scans. The required number of scans depends on the composition of the gas and whether the composition has changed. Approximately (47*X + 15) scans are required (if the composition has not changed), and a typical value for X is 5. If the composition has changed, additional (9*N*(N+1)) scans are required, where N is the number of components. A boolean output is provided to indicate that the calculation is completed. Block contents are shown graphically on Figure 7-1. The inputs are: x = gas composition as an array x[1..21] (The index of each component follows.) P = pressure (psia) T = temperature (EF) RECALC = rising-edge trigger for the periodic recalculation of the compressibility factor The outputs are: Z DONE rho = compressibility factor = calculation DONE status = density (lb/cu.ft) Reference: AGA Compressibility Factors of Natural Gas Report No. 8, November 1992 (AGA Catalog No. XQ9212; Second Edition, July 1994). Cross-references to the structured text statements with equations from the AGA8 report appear throughout the block. The index of each component is as follows: 1 = Methane 2 = Nitrogen 3 = Carbon Dioxide 4 = Ethane 5 = Propane 6 = Water 7 = Hydrogen Sulfide November 1997 8 = Hydrogen 9 = Carbon Monoxide 10 = Oxygen 11 = i-Butane 12 = n-Butane 13 = i-Pentane 14 = n-Pentane 15 = n-Hexane 16 = n-Heptane 17 = n-Octane 18 = n-Nonane 19 = n-Decane 20 = Helium 21 = Argon 7-1 COM_FACTOR_2 CG39AGA-1 Each instance of the COM_FACTOR_2 block occupies approximately 17.5K of memory (plus an overhead of 25K for the global variables shared by all of the COM_FACTOR_2 and COM_FACTOR_2_s blocks). The execution time during recalculation averages 2.1 ms in an ACM040 (7 ms in an ACM030) if the composition has not changed, and 3 ms in an ACM040 (10 ms in an ACM030) if the composition has changed. # 7-2 November 1997 CG39AGA-1 COM_FACTOR_2_s 8.0 COM_FACTOR_2_s The derived block COM_FACTOR_2_s calculates the compressibility factor and density of a natural gas at standard conditions (Zs) in accordance with the detail characterization method presented in AGA Report No. 8, November 1992 (Second Edition, July 1994). Standard conditions are assumed to be the conditions used as standard in the AGA3 Report No. 3: 14.73 psia pressure and 60EF temperature. The calculation is to be triggered periodically (via a function block input), and can require several minutes to complete. Since the calculation is slow, it is time-sliced, using a snapshot of the function block inputs and determining a new Z after the required number of controller scans. The required number of scans depends on the composition of the gas and whether the composition has changed. Approximately (47*X + 15) scans are required (if the composition has not changed), and a typical value for X is 3. If the composition has changed, additional (9*N*(N+1)) scans are required, where N is the number of components. A boolean output is provided to indicate that the calculation is completed. Block contents are shown graphically on Figure 8-1. The inputs are: x = gas composition as an array x[1..21] (the index of each component is listed below) P = pressure (psia) T = temperature (EF) RECALC = rising-edge trigger for the periodic recalculation of the compressibility factor The outputs are: Z DONE rho = compressibility factor = calculation DONE status = density (lb/cu.ft) Reference: AGA Compressibility Factors of Natural Gas Report No. 8, November 1992 (AGA Catalog No. XQ9212; Second Edition, July 1994). Cross-references to the structured text statements with equations from the AGA8 report appear throughout the block. The index of each component is as follows: 1 = Methane 2 = Nitrogen 3 = Carbon Dioxide 4 = Ethane 5 = Propane 6 = Water 7 = Hydrogen Sulfide November 1997 8 = Hydrogen 9 = Carbon Monoxide 10 = Oxygen 11 = i-Butane 12 = n-Butane 13 = i-Pentane 14 = n-Pentane 15 = n-Hexane 16 = n-Heptane 17 = n-Octane 18 = n-Nonane 19 = n-Decane 20 = Helium 21 = Argon 8-1 COM_FACTOR_2_s CG39AGA-1 Each instance of the COM_FACTOR_2_s block occupies approximately 17.5K of memory (plus an overhead of 25K for the global variables shared by all of the COM_FACTOR_2 and COM_FACTOR_2_s blocks). The execution time during recalculation averages 2.1 ms in an ACM040 (7 ms in an ACM030) if the composition has not changed, and 3 ms in an ACM040 (10 ms in an ACM030) if the composition has changed. # 8-2 November 1997 CG39AGA-1 AGA3_CF 9.0 AGA3_CF The derived block AGA3_CF is a combination of the AGA3 block and the COMPR_FACTOR_ blocks. This block continuously calculates the volume flow rate of natural gas at base conditions and the composite orifice flow factor for an orifice flowmeter with flange taps, in accordance with the factors approach presented in AGA Report No. 3. The composite orifice flow factor C' is updated continuously for temperature effects and periodically for all other effects. The periodic update of C' is triggered by a function block input. The first part of the block calculates the compressibility factors of a natural gas at the pressure and temperature values corresponding to flowing conditions (Zf), AGA standard conditions (Zs), and base conditions (Zb). The compressibility factors are calculated in accordance with the primary method presented in AGA Report No. 8 (December 1985) and are used by the second part of the block for the periodic recalculation of C'. AGA standard conditions are presented in the AGA3 report as 14.73 psia pressure and 60E F temperature. The simplified method presented in the AGA8 report is used for the Zs and Zb calculation if the gas mixture is more than 80 mol percent methane. Also, for Zb, the base pressure must be less than 16 psia. Since the periodic C' recalculation and the associated compressibility factor calculations require iteration and are time-consuming, the calculations are time-sliced, using a snapshot of the function block inputs and determining a new C' after several controller scans. The required number of scans for the periodic update depends on the composition of the gas. Use [(# of components)**2 + X] to calculate the required number of scans (typical value for X is 17). A boolean output is provided to indicate that the C' recalculation is completed. Block contents are shown graphically on Figure 9-1. * The inputs are: hw Pf Tf DNSTRM = orifice differential pressure (in wc) = flowing pressure (psia) = flowing temperature (EF) = indication that the downstream tap is used to measure the flowing conditions (FALSE = upstream tap; TRUE = downstream tap) Pb = base pressure (psia) Tb = base temperature (EF) dr = orifice plate bore diameter at reference temperature (in) Dr = meter tube internal diameter at reference temperature (in) x = gas composition (mol fractions) as an array x[1..20] (The index of each component follows.) CHNG_x = status indicating that the gas composition has changed (used when the periodic recalculation is triggered to indicate that Zs and/or Zb must be recalculated) RECALC = rising-edge trigger for the periodic recalculation of part of C' November 1997 * * 9-1 AGA3_CF CG39AGA-1 The outputs are: Qb Cprime * DONE = volume flow rate at base conditions (SCFH) = composite orifice flow factor C' (SCFH/(((psi)(in wc))**0.5)) Note that Qb = Cprime* [(Pf*hw)**05]. = periodic recalculation DONE status References: AGA Report No. 3, Orifice Metering of Natural Gas, Part 3, August 1992 (AGA Catalog No. XQ9210). AGA Compressibility and Supercompressibility for Natural Gas Report No. 8, December 1985 (AGA Catalog No. XQ1285). The index of each component is as follows: 1 = Nitrogen 2 = Carbon Dioxide 3 = Hydrogen Sulfide 4 = Water 5 = Helium 6 = Methane 7 = Ethane 8 = Propane 9 = n-Butane 10 = i-butane 11 = n-Pentane 12 = i-pentane 13 = n-Hexane 14 = n-Heptane 15 = n-Octane 16 = n-Nonane 17 = n-Decane 18 = Oxygen 19 = Carbon Monoxide 20 = Hydrogen Cross-references to the structured text statements with equations from the AGA8 report appear throughout the first part of the block. Several assumptions from the AGA3 report are incorporated in this block. If any of these assumptions do not apply, the block may need to be modified. Cross-references to the structured text statements with equations and assumptions from the AGA3 report appear throughout the second part of the block. The assumptions are: C Ps (standard pressure) = 14.73 psia, Ts (standard temperature) = 60EF, and Zsair (compressibility of air at standard conditions) = 0.999590. C The orifice plate material is type 304 or 316 stainless steel. The meter tube material is carbon steel. Tr (reference temperature for the orifice bore and tube diameters) = 68EF. C The nominal pipe size is 2" or larger. The beta is 0.1-0.75, with d larger than 0.45". Pipe Reynolds number Re is greater than or equal to 4000. * C 0 < (hw/(27.707*Pf)) <= 0.2. C k (isentropic exponent) = 1.3. C mu (dynamic viscosity) = 0.0000069 lbm per ft-sec. Each instance of the AGA3_CF block occupies approximately 45K of memory. Normal execution time (when C' recalculation is not occurring) is 0.6 ms in an ACM040 (2 ms in an ACM030). During C' recalculation, the execution time is 3 ms for an ACM040 (10 ms for an ACM030). # 9-2 November 1997 CG39AGA-1 TURB_METER_CF 10.0 TURB_METER_CF The derived block TURB_METER_CF is a combination of the TURBINE_METER block and the COMPR_FACTOR_ blocks. This block continuously calculates the volume flow rate of natural gas at base conditions for an axial-flow gas turbine meter, in accordance with AGA Report No. 7. The first part of the block periodically calculates the compressibility factors of a natural gas at the pressure and temperature values corresponding to flowing conditions (Zf) and base conditions (Zb). The compressibility factors are calculated in accordance with the primary method presented in AGA report No. 8 (December 1985) and are used by the second part of the block for the flow calculation. The periodic update of the compressibility factors is triggered by a function block input. Since the periodic compressibility factor calculations require iteration and are time-consuming, the calculations are time-sliced, using a snapshot of the function block inputs and determining the compressibility factors after several controller scans. The required number of scans for the periodic update depends on the composition of the gas. Use [(# of components)**2 + X] to calculate the required number of scans (a typical value for X is 12). A boolean output is provided to indicate that the compressibility factor recalculation is completed. Block contents are shown graphically on Figure 10-1. The inputs are: Qf Pf Tf Pb Tb x = volume flow rate (any units) = flowing pressure (psia) = flowing temperature (E F) = base pressure (psia) = base temperature (E F) = gas composition (mol fractions) as an array x[1..20] (The index of each component follows.) CHNG_x = status indicating that the gas composition has changed (used when the periodic recalculation is triggered to indicate that Zb must be recalculated) RECALC = rising-edge trigger for the periodic recalculation of the compressibility factors The outputs are: Qb DONE = volume flow rate at base conditions (same units as Qf) = periodic compressibility factor recalculation DONE status References: Section 6 of the AGA Turbine Meter Report No. 7, 1985 (AGA Catalog No. XQ0585). AGA Compressibility and Supercompressibility for Natural Gas Report No. 8, December 1985 (AGA Catalog No. XQ1285). November 1997 10-1 | TURB_METER CG39AGA-1 The index of each component is as follows: 1 = Nitrogen 2 = Carbon Dioxide 3 = Hydrogen Sulfide 4 = Water 5 = Helium 6 = Methane 7 = Ethane 8 = Propane 9 = n-Butane 10 = i-butane 11 = n-Pentane 12 = i-pentane 13 = n-Hexane 14 = n-Heptane 15 = n-Octane 16 = n-Nonane 17 = n-Decane 18 = Oxygen 19 = Carbon Monoxide 20 = Hydrogen Cross-references to the structured text statements with equations from the AGA8 report appear throughout the first part of the block. In the second part of the block, the cross-references provided are to the AGA7 report. Each instance of the TURB_METER_CF block occupies approximately 31K of memory. Normal execution time (when C' recalculation is not occurring) is 0.4 ms in an ACM040 (1.2 ms in an ACM030). During compressibility factor recalculation, the execution time averages 3 ms in an ACM040 (10 ms in an ACM030). # 10-2 November 1997