felib.iso6976 class

The iso6976 performs the calculation of the natural gas properties in accordance with:

ISO-6976: Natural gas - Calculation of calorific values, density and Wobbe index from composition.

Table 1: Description of the iso6976 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

Methane

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

double GetFractionValue (short I)

1

Ethane

2

Propane

3

n-Butane

4

2-Methylpropane

5

n-Pentane

6

2-Methylbutane

7

2,2-Dimethylpropane

8

n-Hexane

9

2-Methylpentane

10

3-Methylpentane

11

2,2-Dymethylbutane

12

2,3-Dymethylbutane

13

n-Heptane

14

n-Octane

15

n-Nonane

16

n-Decane

17

Ethylene

18

Propylene

19

1-Butene

20

cis-2-Butene

21

trans-2-Butene

22

2-Methylpropene

23

1-Pentene

24

Propadiene

25

1,2-Butadiene

26

1,3-Butadiene

27

Acetylene

28

Cyclopentane

29

Methylcyclopentane

30

Ethylcyclopentane

31

Cyclohexane

32

Methylcyclohexane

33

Ethylcyclohexane

34

Benzene

35

Toulene

36

Ethylbenzene

37

0-Xylene

38

Methanol

39

Methanethiol

40

Hydrogen

41

Water

42

Hydrogen sulfide

43

Ammonia

44

Hydrogen cyanide

45

Carbon monoxide

46

Carbonyl sulfide

47

Carbon disulfide

48

Helium

49

Neon

50

Argon

51

Nitrogen

52

Oxygen

53

Carbon dioxide

54

Sulfur dioxide

55

Dinitrogen monoxide

56

Krypton

57

Xenon

Mixture analysis

Set property value

Get property value

N

Description

0

Molar fractions

void SetMixtureAnalysis(short N)

short GetMixtureAnalysis ()

1

Volume fractions

2

Mass fractions

Combustion/metering operating conditions

Set property value

Get property value

N

Description

0

15C/15C and 101.325 kPa

void SetCombustionMeteringConditionsC(short N)

short GetSetCombustionMeteringConditions ()

1

0C/0C and 101.325 kPa

2

15C/0C and 101.325 kPa

3

25C/0C and 101.325 kPa

4

20C/20C and 101.325 kPa

5

25C/20C and 101.325 kPa

Error status

-

long int GetErrorFlag()

RESULTS

Set property value

Get property value

I

Description

0

Superior calorific value - molar basis [kJ/mol]

-

double GetResults (short I)

1

Inferior calorific value - molar basis [kJ/mol]

2

Superior calorific value - mass basis [MJ/kg]

3

Inferior calorific value - mass basis [MJ/kg]

4

Superior calorific value - volumetric basis [MJ/m3]

5

Inferior calorific value - volumetric basis [MJ/m3]

6

Molar mass [kg/mol]

7

Compression factor

8

Relative density

9

Density [kg/m3]

10

Molar density [kg-mole/m3]

11

Wobbe index [MJ/m3]

METHODS

Calculation of natural gas properties in accordance with ISO-6976

long int CalculateIso6976(); calculates natural gas properties and returns long int error status

ERROR STATUS

Error status bits are cleared or set upon the completion of long int CalculateIso6976() function as shown below

Bit 0 =1 (0001H)

The total sum of mole fractions is <0.98 or >1.02.

Bit 1 =1 (0002H)

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 2 =1 (0004H)

The mole fraction of Methane is <0.5 or >1.0.

Bit 3 =1 (0008H)

The mole fraction of Nitrogen is <0 or > 0.3.

Bit 4 =1 (0010H)

The mole fraction of Carbon Dioxide is <0 or >0.15.

Bit 5 =1 (0020H)

The mole fraction of Ethane is <0 or >0.15.

Bit 6 =1 (0040H)

The mole fraction of any other mixture component {X(2),...,X(50),X(52),X(54),...,X(57)} is <0 or >0.05

Bit 7,...

Bit 7 and all higher bits are unused.