FE-ISO6976-DLL


FE-ISO6976-DLL (felib.iso6976) is a component of felib.dll.
Felib.iso6976. FE-ISO6976-DLL performs the calculation of natural gas properties completely in accordance with:

ISO 6976:1995: Natural gas - calculation of calorific values, density, relative density and Wobbe index from composition, Ref. number: ISO 6976:1995/Cor 1:1997

Description of felib.iso6976 class interface: properties (variables), method (function) and error status flags.

PROPERTIES
Property Set property value Get property value
I X(I): mole fraction for
0 Methane void Set­Fraction­Value­(short I, double X(I)) double Get­Fraction­Value­(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
30 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 Mole fractions void Set­Mixture­Analysis­(short N) short Get­Mixture­Analysis­()
1 Volume fractions
2 Mass fractions
Combustion/metering operating conditions Set property value Get property value
N Description
0 15°C/15°C and 101.325 kPa void Set­Combustion­Metering­Conditions­(short N) short Get­Combustion­Metering­Conditions­()
1 0°C/0°C and 101.325 kPa
2 15°C/0°C and 101.325 kPa
3 25°C/0°C and 101.325 kPa
4 20°C/20°C and 101.325 kPa
5 25°C/20°C and 101.325 kPa
Protection key void SetKeyCode(long nNewValue) n/a
Error status n/a long GetErrorFlag()
Results Set property value Get property value
I Description
0 Superior calorific value - molar basis [kJ/mol] n/a 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
8 Density [kg/m3]
10 Molar density [kg-mole/m3]
11 Wobbe index [MJ/m3]
FUNCTION
Function prototype long CalculateIso6976(); calculates natural gas properties and returns long int error status
ERROR STATUS
Error status bits are cleared or set upon execution of the function CalculateIso6976().
long GetError­Flag() bits Description of Error/Warning flags.
Bit 0 =1 (0001H) Error: Total sum of mole fractions <0.98 or >1.02.
Bit 1 =1 (0002H) Warning: 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) Error: Mole fraction of Methane <0.5 or >1.0.
Bit 3 =1 (0008H) Error: Mole fraction of Nitrogen <0 or >0.3.
Bit 4 =1 (0010H) Error: Mole fraction of Carbon Dioxide <0 or >0.15.
Bit 5 =1 (0020H) Error: Mole fraction of Ethane <0 or >0.15.
Bit 6 =1 (0040H) Error: 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 23 Unused.
Bit 24 =1 (1000000H) Error: Incorrect protection key.
Bit 25,... Bit 25 and all higher bits are unused.