You are on page 1of 8

OMAR-LGx Measurement API2540

OCTAL INFORMATION ABSTRACT # IA002-V9509

Implementation OF API2540
In OMAR-LGx Flow Computer
Conversion of Hydrocarbon Liquids to Net Volumes at Reference Conditions

Copyright  1997 - Octal Systems Inc.

Octal Systems Inc. – www.octal-systems.com IA002-V9509 1


OMAR-LGx Measurement API2540

Octal Systems Inc. – www.octal-systems.com IA002-V9509 2


OMAR-LGx Measurement API2540

SUBJECT: Hydrocarbon Liquids Flow Measurement in Allen Bradley PLC

1.0 INTRODUCTION

The following describes the means and methods used for measurement of Hydrocarbon
Liquids on the Allen Bradley PLC-5 platform using the OMAR-LGx Flow Computer Software by
Octal Systems Inc.

1.1 System Design

The OMAR-LGx Flow Measurement package developed by Octal Systems Inc. of Calgary,
Alberta has been designed to run in the Allen Bradley 1771 DMC Coprocessor under the
Microware OS-9 multitasking Operating System environment. The software package has
been coded in the 'C programming language. It is compiled to a binary format in the native
Motorola MC6800 machine language code before downloading to the Coprocessor. The
executable file as it runs in the Coprocessor is inaccessible to the PLC user or programmer,
and hence no unauthorized changes can be made to this code.

1.2 Flow Calculation Platform

The DMC 1771 is a high performance 32 bit state of the art Coprocessor that is capable of
high precision mathematical calculations equal to or better than any Flow Computer
available at this time. When used with a suitable PLC5 processor, it provides a reliable and
flexible platform for liquids measurement applications.

1.3 Flow Measurement Standards

The OMAR-LGx Software designed for measurement of Hydrocarbon liquids is capable of two
types of measurements.

I - The GPA 8173 Standard for converting Mass of Natural Gas Liquids and Vapours to
Equivalent Liquid Volumes. (Value of physical constants as per GPA Standard 2145).

2 - The API 2540 standard for Hydrocarbon Liquids flow measurement with density from 500
kg/m3 to 1075 kg/m3. The calculation supports the complete density range by
implementation of the full API Tables (Table 23/53 for density correction and Table 24/54 for
Ctl computation) in the Coprocessor.

3 – The AGA3, AGA7 and AGA8 standards for the measurement of Hydrocarbon fluids.

Note: See Appendix A for details of references.

Octal Systems Inc. – www.octal-systems.com IA002-V9509 3


OMAR-LGx Measurement API2540

2.0 SYSTEM IMPLEMENTATION: API 2540

The PLC I/O modules serve as an interface to the liquid flow process. The following line
conditions are monitored by the PLC:

- Line Temperature
- Line Pressure
- Line Density
- Flow Meter pulses
- Differential Pressure (Orifice)

The above process conditions are sampled by the PLC on a continuous basis and made
available to the Coprocessor for the API 2540 calculations.

The measurement process may be broken down into four main stages described below.

2.1 Stage 1: Convert the flowing density to density at 15 Deg.C.

Depending on the value of the Line Density, appropriate subroutines are selected to carry out
the Density correction. If the Line Density is between 500 kg./ou.m and 610 kg./cu.rn, the
API Table 23A/53A is used to look up the density at 15 Deg.C.

If the Line Density is greater than 610 kg./cu.m but less than 1075 kglcu.m, then the API
algorithms are used to reference the density to 15 Deg.C. The subroutine adheres strictly to
the API standard ensuring that the calculations are done within the density and temperature
constraints specified by the standard. If these constraints are violated by the process inputs,
the measurement subroutines are designed to annunciate this condition and use default
values.

• Note: The logic of the OMAR Measurement system allows the user to input density
already referenced to 15 Deg.C (instead of the density at flowing conditions). When this
is done, Stage I is completely bypassed by the Coprocessor logic.

2.2 Stage 2: Calculate Volume Correction Factor Ctl

Two process input variables are required by the API Standard (Table 54/24) for generating the
Volume Correction Factor Ctl:

- Line Density referenced to 15 Deg C (or 60 Deg F)


- Line Temperature

The subroutines utilize table look up for product density between 500 kg/cu.m and 610
kg/cu.m. For densities higher than 610 kg/cu.m and less than 1075 kg/cu.m, algorithms are
used within the API specified temperature and density constraints. If the process conditions fall
outside of these constraints, then this condition is annunciated and a user defined default
numeric value is used for Ctl.

Octal Systems Inc. – www.octal-systems.com IA002-V9509 4


OMAR-LGx Measurement API2540

Note 1: The OMAR measurement system logic allows the user to bypass the Ctl
calculation entirely and utilize a user defined default numeric value for Ctl.

2.3 Stage 3: Calculate Compressibility Factor Cpl

In order to calculate the Compressibility factor, the algorithms require the following input variables:

- Line Temperature
- Line pressure
- Equilibrium Vapour Pressure (Note 2)
- Density corrected to 15 Deg C / 60 Deg F

The algorithm adheres strictly to the API Standard to ensure that all the specified constraints
are implemented. Provided the corrected input density is between 350 kg/cu.m and 1047
kg/cu.m, the measurement routines calculate a value for the compressibility factor Cpl. If any
of the specified limits are violated, this condition is annunciated and a user defined default
numeric value for Cpl is used in the calculations.

• Note 1: The OMAR measurement system logic allows the user to bypass the Cpl
calculation entirely and use a fixed numeric value of 1.

• Note 2: The system software allows for the automatic calculation of the product
Equilibrium Vapour Pressure per the GPA-TP15 technical paper (A simplified Vapour
Pressure Correlation for Commercial NGLs. See OCTAL Information Abstract IA004-
V9509.)

2.4 Stage 4: Calculate Incremental Product Volumes

The OMAR measurement system software running in the Coprocessor can monitor
incremental flowing product volume at every program scan in two possible ways:

- Pulse Input Metering


- Differential Producer Metering

2.4.1 Pulse Input Metering of Product Gross Volume:

If the application involves use of a pulse input device (turbine meter, vortex meter, positive
displacement meter etc.) the Coprocessor uses the PLC I/0 resources (pulse input card) to
track the number of pulses being received at every program scan. This information is used to
calculate the incremental volume for the previous scan as follows:

UVgrs = (UPulses - MKF) * MCF

Octal Systems Inc. – www.octal-systems.com IA002-V9509 5


OMAR-LGx Measurement API2540

Where:
UVgrs : Incremental Gross Volume
UPulses : Incremental Number of Meter Pulses
MKF : Meter Base K Factor (pulses per unit volume)
MCF : Meter Correction Factor

The gross volume is totalized using the equation:

Vgtotal = Vgtotal + UVgrs

Where:

Vgtotal : Gross Volurme Accumulated Total

• Note: The OMAR measurement system includes the facility to characterize the Meter Base
K Factor relative to the measured flow rate of the product using the Lagrange or the Linear
Curve Fit method. The user may use or bypass this option on a per meter basis. ( See
OCTAL Information Abstract IA005-9505)

2.4.2 Differential Producer Metering of Product Gross Volume :

If the application involves use of a differential producer device (orifice plate, pitot tube etc.)
the Coprocessor uses the PLC I/O resources (analog input card) to sample the differential
pressure and the static line pressure at every program scan. At the same time the program
also tracks the time interval since the previous program scan. This information is used to
calculate the instantaneous product flowrate (per AGA 3 Report) as follows:

Qhg = C’ * Sqrt[Hw * Density]

Where:
Qhg : Product Gross Flow Rate (Unit Volume per hour)
C’ : 'Me measurement device constant
Hw : Differential Pressure
Density : Line Density

The incremental gross volume per program scan is calculated as follows:

UVgrs = (Qgh/3600) * UT

Where:
UT : Time interval for the previous program scan (seconds)

The gross volume is totalized using the equation:

Octal Systems Inc. – www.octal-systems.com IA002-V9509 6


OMAR-LGx Measurement API2540

Vgtotal = Vgtotal + UVgrs

2.5 Metering of Product Net Volume

The net incremental product volume per program scan is calculated as follows:

UVnet = UVgrs * Ctl * Cpl

Where:
UVnet : incremental Net Volume

The value of the incremental volume is referenced to standard conditions.

The net volume is totalized using the equation:

Vntotal = Vntotal + UVnet

Where:

Vntotal : Net Volume Accumulated Total

2.6 Metering Of Product Mass

The incremental mass is calculated from incremental net volume and the product density
referenced to 15 Deg.C as follows:

UMass = UVnet * Denl5C

Where:
UMass : Incremental product mass
Denl5C : Product density corrected to 15 Deg.C

The product mass is totalized using the equation:

Mtotal = Mtotal + UMass

Where:

Mtotal : Product Mass Accumulated Total

• Note: Alternate method for calculating product mass uses Gross Volume and Flowing Density

Octal Systems Inc. – www.octal-systems.com IA002-V9509 7


OMAR-LGx Measurement API2540

APPENDIX A

American Petroleum Institute


Manual of Petroleum Measurement Standards
Metering of NGLs & Crude Oils (API 2540)

a. Density Correction to Reference Temperature


Chapter 11.1.53, 11.1.23
Table 53A, 23A: Generalized Crude Oils
b. Correction of Volume to Reference Temperature and Thermal Expansion: Ctl.
Chapter 11.1.54, 11.1.24
Table 54A, 24A: Generalized Crude Oils
c. Compressibility Factors for Hydrocarbons: Cpl.
Chapter 11.2.1/Chapter 11.2.2
d. Orifice Metering of NGLs & Crude Oils
Chapter 14.3 / 14.8
e. Calculation of Liquid Petroleum Quantities Measured by Turbine or Displacement
Meters
Chapter 12.2
f. Flow Measurement Using Electronic Metering Systems
Chapter 21.1

American Gas Association

a. Orifice Metering of Natural Gas & Other Hydrocarbon Fluids


AGA Report No. 3 (1985, 1992)
b. Compressibilty, Supercompressibilty for Natural Gas and Other Hydrocarbon Gases
AGA Report No. 8 (1992)

Gas Processors Association

a. Table of Physical Constants of Hydrocarbons and Other Components of Natural Gas


GPA
Standard 2145-93
b. Converting Mass of Natural Gas Liquids and Vapours to Equivalent Volumes GPA
Standard
8173-90
c. A Simplified Vapour Pressure Correction for Commercial NGLs
GPA Document Tp-15

Octal Systems Inc. – www.octal-systems.com IA002-V9509 8

You might also like