felib.aga8x85 class

The aga8x85 class performs the calculation of mole average, molar density, density and compression in accordance with:

AGA-8: Compressibility and supercompressibility for natural gas and other hydrocarbon gases - Transmission Measurement Committee Report No. 8.9, 1985. (withdrawn)

Table 1: Description of the aga8x85 class interface: properties (variables), methods (functions) and error flags.

 PROPERTIES

 Natural gas component

Set property value

Get property value

I

 X(I) mole fraction for

0

Nitrogen

 void SetComponentMolarFraction(short I, double X(I))

 double GetComponentMolarFraction(short I)

1

Carbon Dioxide

2

Hydrogen Sylfide

3

Water

4

Helium

5

Methane

6

Ethane

7

Propane

8

n-Butane

9

i-Butane

10

n-Pentane

11

i-Pentane

12

n-Hexane

13

n-Heptane

14

n-Octane

15

n-Nonane

16

n-Decane

17

Oxygen

18

Carbon Monoxide

19

Hydrogen

Pressure [Pa]

void SetPressurePa(double newP)

double GetPressurePa()

Temperature [C]

void SetTemperatureDegC(double newT)

double GetTemperatureDegC()

Error status

-

long int GetErrorFlag()

Mole average

-

double GetMoleAverage()

Molar density [kg-mole/m3]

-

double GetMolarDensity()

Density [kg/m3] (see Figure)

-

double GetDensity()

Compression (see Figure)

-

double Compression()

METHODS

Calculation of AGA-8 equation of state

long int calculateAGA8(); calculates mole average, molar density, density and compression and returns long int error status

ERROR STATUS

Error status bits are cleared or set upon the completion of long int calculateAGA8() method as follows

Bit 0 =1 (0001H)

There exist at least one mole fraction < 0.

Bit 1 =1 (0002H)

The total sum of mole fractions <0.98 or >1.02

Bit 2 =1 (0004H)

The total sum of mole fractions is not exactly equal to 1. This bit denotes only the warning that the fractions have been normalized to give the total sum of mole fractions equal to 1. If only bit 2 was set during the calculation the results are valid.

Bit 3 =1 (0008H)

The mole fraction of Nitrogen > 0.5.

Bit 4 =1 (0010H)

The mole fraction of Carbon Dioxide >0.5.

Bit 5 =1 (0020H)

The mole fraction of Methane <0.5 or >1.0.

Bit 6 =1 (0040H)

The mole fraction of Ethane > 0.2.

Bit 7 =1 (0080H)

The mole fraction of propane > 0.05.

Bit 8 =1 (0100H)

The mole fraction of Butanes (n-Butane + i-Butane) >0.03.

Bit 9 =1 (0200H)

The mole fraction of Pentanes (n-pentane + i-Pentane) >0.02.

Bit 10 =1 (0400H)

The mole fraction of Hexanes + heavier hydrocarbons (n-Hexane + n-Heptane + n-Octane + n-Nonane + n-Decane) >0.01.

Bit 11 =1 (0800H)

The mole fraction of (Water + Vapour + Hydrogen Sulfide + Hydrogen + Carbon Monoxide + Oxigen + Helium + Argon) >0.01.

Bit 12 =1 (1000H)

The pressure < 0.1 Pa or Pressure > 138000000 Pa.

Bit 13 =1 (2000H)

The temperature < -128 C or Temperature > 205 C.

Bit 14,...

All higher bits are unused.