





				  PROGRAM 'AGA'



				   Version 4.0



				       by



				   B. K. Berge

				  206 Cliff Ave.

			    Valley Springs, SD 57068

			    CompuServe: 101653,3544

		      Internet: 101653.3544@compuserve.com        



	  B. K. Berge is a member of the Association of Shareware 
	  Professionals (ASP).  ASP wants to make sure that the 
	  shareware principle works for you. If you are unable to 
	  resolve a shareware-related problem with an ASP member by 
	  contacting the member directly, ASP may be able to help. 
	  The ASP Ombudsman can help you resolve a dispute or problem 
	  with an ASP member, but does not provide technical support 
	  for members' products. Please write to the ASP Ombudsman at 
	  545 Grover Road, Muskegon, MI 49442 or send a CompuServe 
	  message via CompuServe Mail to ASP Ombudsman 72050,1433.



			    DISCLAIMER - AGREEMENT

	  Users of 'AGA' must accept this disclaimer of warranty:
	  This program material is supplied as is.  The author disclaims
	  all warranties, expressed or implied, including, without 
	  limitation, the warranties of merchantability and of fitness
	  for any purpose.  The author assumes no liability for incidental 
	  or consequential damages in connection with or arising from the 
	  furnishing, use, or performance of this program material.
















									ii


	  1.0  INTRODUCTION

	  1.1  General

	  'AGA' calculates gas and liquid orifice flow meters based 
	  on ANSI/API 2530-1991, Part 3 (AGA-3) (Ref. 1).

	  This is a 'shareware' program and NOT a 'freebie'.  You are
	  expected to register if you continue using the program for 
	  more than 30 days.  However, the program does not have any 
	  'nag-screens' to encourage you to register, and will function
	  with no limitations if you do not register.  Upon registration 
	  you will receive both the DOS and Windows versions of the
	  program supplied on two (2) floppy disks.

	  The program will size orifice plates for given design 
	  conditions, find pressure drop for a given flow, or flow for
	  a given pressure drop.  The standard (API-2530) is 
	  originally designed for gas orifices.  In this program it is
	  also used for liquid orifices.


	  1.2  Program Requirements and Overview

	  The minimum equipment configuration required by 'AGA':
	    a) DOS version:
		1) An IBM PC, XT, AT or compatible computer
		2) 256 K or more of RAM memory
		3) DOS 2.0 or later operating system

	    b) Windows version:
		1) A computer with 80386 processor or better (486, Pentium)
		2) 4 MB of RAM memory
		3) Windows 3.+


	  1.3  Program Information

	  The program is divided into 4 major sub-programs:
		- normal gas orifices
		- normal liquid orifices
		- gas restriction orifices (critical flow orifices)
		- liquid restriction orifices

	  'AGA' lets you choose between U.S. and SI units.  The 
	  gas routines (normal orifice and restriction orifice routines) 
	  will perform orifice-calculations for:

		- Natural gas
		- Air
		- Nitrogen



				       








									iii


	  For natural gas the AGA-8 Equation of State (EOS) is used for
	  calculating physical properties.  For air and nitrogen the
	  Redlich-Kwong EOS is used.
	  
	  The liquid orifice routines include:

		- Oil (gas-free)
		- Water 
		- Methanol (MeOH)
		- Monoethylene Glycol (MEG)
		- Diethylene Glycol (DEG) 
		- Triethylene Glycol (TEG)

	  For MeOH, MEG, DEG, and TEG the amount of water in solution 
	  (0-100 Weight %) can be given, and the program will 
	  calculate the physical properties of the solution.


	  2.0  USING 'AGA'

	  STEP 1: Install the program:

	  a) DOS version:
	     Put the program diskette in drive A and type: A:\INSTALL
	     This will install the DOS-programs in directory C:\ORIFICE
	     or show you how to install the program in a directory of your 
	     choice.

	  b) Windows version:
	     The Windows version of the program uses the Visual Basic 3.0
	     runtime DLL.  Put the program diskette in drive A.  From 
	     the Microsoft Windows Program Manager, choose RUN from the 
	     FILE menu and type: A:\SETUP or double-click on the SETUP.EXE
	     file in drive A.  Setup will copy the program to directory
	     C:\ORIFICE unless you make your own choice.  If you want the
	     program-icon to appear in another group window, move it to 
	     where you want 'AGA' to be and delete the window group 
	     made by Setup.  Save your selections.

	  STEP 2:  Start the program by typing "AGA" from the DOS-prompt, 
		   or 'click' on the correct icon:

			       FLOW -ORIFICE

			FLOW-ORIFICE CALCULATION PROGRAM

		ANSI/API 2530-1991, Part 3 (AGA Report No. 3)  
       -------------------------------------------------------------------

	       Copyright (C) 1996 by B. K. Berge (Version 4.0)











				       

									iv


	  The Disclaimer is shown before the main menu appears: 

		      Gas Orifice
		      Liquid Orifice
		      Restriction Orifice - Gas
		      Restriction Orifice - Liquid
		      EXIT


	  STEP 3: Calculation Options:

	  After choosing type and method of calculation the input-screen 
	  will appear.  For gas-calculations you have to enter specific 
	  gas gravity, temperature and pressure.  You can also give 
	  molefractions of N2, CO2 and H2S for sour gas calculations.

	  The AGA-8 equation is used for calculating Z-factor 
	  (compressibility factor) for natural gases.  The equation is
	  complex, and calculation time may be long depending on your 
	  computer-type.  The Redlich-Kwong equation of state is used 
	  for air and nitrogen.

	  For oil-calculations you have to enter specific oil gravity, 
	  temperature and pressure.  It is also recommended to give
	  molecular weight of oil.  For water-calculations the input 
	  requirements are salinity, temperature, and pressure.
	  NOTE: It is assumed that all dissolved solids for water are 
	  expressed as equivalent sodium chloride concentration.  The 
	  results are an orifice specification sheet giving the necessary 
	  data for design of an orifice or evaluating an existing orifice.


	  STEP 4: Interpreting the results:

	  The results will contain a few factors that you should know:

	  ANSI/API 2530-1991, Part 3 (AGA-3)
	  ----------------------------------

	  The basic flow equation is:

	      Qv = Fn*(Fc+Fsl)*Y1*Fpb*Ftb*Ftf*Fgr*Fpv*Sqrt(Pf1*hw)

	      where
		Fn = Numeric conversion factor
		Cd = Discharge coefficient = (Fc + Fsl)
		Fc = Orifice calculation factor
		Fsl= Slope factor
		Y1 = Expansion factor based on upstream tap
		Fpb= Pressure base factor, here set to 1.0 (14.73 psia)
		Ftb= Temperature base factor, set to 1.0 (60 deg F)

				       





									
									
									
									
									
									v


		Ftf= Flowing temperature factor
		Fgr= Specific gravity factor
		Fpv= Super-compressibility factor
		Pf1= Absolute flowing pressure based on upstream tap
		hw = Orifice differential pressure, in H2O at 60 deg F
	  
	  The definition of these factors are given in Ref. 1.

	  The above equation is often simplified to:

			Qv = C' * Sqrt(Pf1*hw)

	  where C' is called the Composite orifice flow factor.

	  The velocity of approach factor is defined as:

			Ev = 1/(Sqrt(1-Beta^4))

	  The flow coefficient, Alpha, is defined as:

			Alpha = Ev * Cd

	  and orifice to pipe diameter ratio is given as

			Beta = OD/PID 

	  For other factors and the factors for pipe taps you are advised 
	  to consult the standard (API-2530-1991, Part 3, Ref.1).


	  3.0  LIMITATIONS

	  3.1  Physical Properties

	  Natural gas properties are limited to:

			0.55 <= SPGG < 2.0

			1.05 <= TEMPRD < 3.0

			  0  <= PRSPRD < 30

	  Liquid correlations used here should be within the
	  following limits:

			14.696 Psia < PRS < 6000 Psia

			32 deg F < TEM < 250 deg F







				       

				       



									
									
									vi


	  In addition the oil properties are limited by a specific
	  oil gravity range of:

			0.63 < SPGO < 2.0

	  and water properties are limited by a maximum salt-content:

			0 % < NaCl < 25 %
	  
	  
	  3.2  Orifice Limitations

	  For specifications regarding tolerances and restrictions to 
	  the orifices themselves, length of pipe preceding and 
	  following the orifice, and tapping points, you are advised 
	  to check the standard (Ref. 1).

	  The beta ratio, BETA (orifice to tube diameter ratio, 
	  (BETA = OD/PID) is limited as follows:

	  Flange taps:   0.15 < BETA < 0.7
	  Pipe taps  :   0.20 < BETA < 0.67

	  These limits do not apply for restriction orifices.

	  The limitations on pipe diameters and orifice diameters are:

			1.667 in < PID < 29.25 in

	  or nominal bore lines, PipeD:

			2.0 in < PipeD < 30 in

			0.250 in < OD < 21.5 in


	  4.0 REFERENCES

	  1. "Manual of Petroleum Measurement Standards Chapter 14 -
	     Natural Gas Fluids Measurement", Section 3 - Concentric,
	     Square-Edged Orifice Meters, Part 3 - Natural Gas 
	     Applications, API Standard 2530-1991, 3rd Ed., American 
	     Petroleum Institute, Washington, D.C. (1992).

	  2. Miller, R.W., "Flow Measurement Engineering Handbook", 2nd
	     Ed., McGraw-Hill Publishing Co., New York, NY (1989) 2-30
	     - 2-37.

	  3. "Compressibility and Supercompressibility for Natural Gas
	     and other Hydrocarbon Gases", Transmission Measurement
	     Committee Report no. 8, AGA Catalog No. XQ 1285, 
	     Arlington, VA (1986).




				       





									
									vii


	  4. "Phase Behavior", Reprint Series, SPE, Dallas (1981), 15,
	     52-63 and 211-223.

	  5. Edmister, W.C. and Lee, B.I., "Applied Hydrocarbon Thermo-
	     dynamics", Vol. 1, 2nd Ed., Gulf Publishing Co., Houston,
	     TX (1984) 47-49.

	  6. Reid, R.C., Prausnitz, J.M., and Sherwood, T.K., "The
	     Properties of Gases and Liquids", 3rd Ed., McGraw-Hill
	     Book Co. Inc., New York, NY (1977) 503-506, and 536-537.
	
	  7. Buthod, P., "Specific Heats of Natural Gases", Oil and 
	     Gas J. (Sept. 29, 1949) 60.

	  8. Standing, M.B., "Volumetric and Phase Behavior of Oil
	     Field Hydrocarbon Systems", SPE, Dallas (1977) 121-127.

	  9. McCain Jr., W.D., "Reservoir-Fluid Property Correlations -
	     State of the Art", SPE Reservoir Engineering (May 1991) 
	     266-272.

	 10. Craft, B.C., Hawkins, H.F. and Terry, R.E., "Applied
	     Petroleum Reservoir Engineering", 2nd Ed., Prentice Hall,
	     Englewood Cliffs (1991) 40-44.

	 11. Dickey, D.S., "Practical Formulas Calculate Water 
	     Properties", Chemical Engineering (Nov. 1991) 235-236.

	 12. Gallant, R.W., "Physical Properties of Hydrocarbons", 
	     Vol. 1, 2nd Printing, Gulf Publishing Co., Houston, TX
	     (1974) 62-68 and 110-119.




	    -----------------  *    *    *  -----------------


	  5.0 REGISTRATION 

	  'AGA' is a "shareware program" and is provided at no charge
	  to the user for evaluation.  Feel free to share it with your
	  friends.  The essence of "user-supported" software is to
	  provide personal computer users with quality software without
	  high prices, and yet to provide incentive for programmers to
	  continue to develop new products.  If you find this program
	  useful and find that you continue using 'AGA' after a 
	  reasonable trial period, you are encouraged to register.
	  The $19.95 registration fee will license one copy for use on 
	  any one computer at any one time, provide 1 year support 
	  (by mail, CompuServe or Internet), a free booklet giving 
	  you the equations used in the program, and next upgrade free.




				      






									viii


	  Commercial users of 'AGA' should register and pay for their
	  copies of 'AGA' within 30 days of first use.  Site-License 
	  arrangements may be made by contacting the address below.

	  Anyone distributing 'AGA' for any kind of renumeration 
	  (except the Society of Petroleum Engineers, SPE), must first 
	  contact the address below for authorization.  This 
	  authorization will be automatically granted to distributors 
	  recognized by ASP as adhering to its guidelines for shareware 
	  distributors, and such distributors may begin offering 'AGA'
	  immediately. (However, to keep the distributor up-to-date with 
	  the latest version, please notify the address below).
	  
	  
	  SHAREWARE REGISTRATION FORM

	  Your Name............         ______________________________
	  Company Name.........         ______________________________
	  Street Address.......         ______________________________
	  P.O. Box.............         ____________________
	  City.................         ____________________
	  State, Zip...........         __ _________________ 
	  Country..............         ____________________

	  Preferred disk type: 
					3-1/2" 720 KB  _
					3-1/2" 1.44 MB _
					5-1/4" 360 KB  _
					5-1/4" 1.2 MB  _

	  Fill out the form with a check of $19.95 and mail to:

	  B. K. Berge, 206 Cliff Ave., Valley Springs, SD 57068

	  CompuServe: 101653,3544
	  Internet: 101653.3544@compuserve.com

	  Other programs by the author ($14.95 registration fee each
	  if you have registered other software from the author):
	  
	  GOW      - Calculates gas, oil and water PVT properties 
		     based on the users's choice of methods.
       
	  GASWATER - Natural Gas-Water interaction calculations
		     (Hydrate calculations, water content of 
		     natural gas, MeOH/Glycol injection calculations 
		     and CO2 solid formation calculations).

	  ISO      - Orifice calculations based on International
		     Standard ISO-5167-1:1991.  The same calculations
		     are performed as for 'AGA'.  The ISO standard is
		     basically used in Europe, and gives similar results
		     as 'AGA'.    


