FE-ISO12213-3-DLL


FE-ISO12213-3-DLL (felib.iso12213x2) is a component of felib.dll.
Felib.iso12213x3 performs the calculation of:

  • compresion factor
  • mass density in kg/m3
  • molar density in kmol/3
  • molar mass in kg/kmol

completely in accordance with:

ISO 12213-3:2006; EN ISO 12213-3:2009: Natural gas - Calculation of compression factor -
  • Part3: Calculation using physical properties

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

PROPERTIES
Description Set property value Get property value
Pressure [bar] void Set­PressureBar­(double newValue) double Get­PressureBar()
Temperature [°C] void Set­Temperature­DegC­(double newValue) double Get­Temperature­DegC()
Mole fraction of carbon dioxide void Set­Mole­Fraction­CO2­(double newValue) double Get­Mole­Fraction­CO2()
Mole fraction of hydrogen void Set­Mole­FractionH2(double newValue) double Get­Mole­FractionH2()
Relative density at T2=273.15[K], p2=1.01325[bar] void Set­Relative­Density­(double newValue) double Get­Relative­Density()
Superior calorific value at T1=298.15[K], T2=273.15[K], p1=p2=1.01325[bar] void Set­Superior­Calorific­Value­(double newValue) double Get­Superior­Calorific­Value()
Protection key void SetKeyCode(long nNewValue) n/a
Error status n/a long GetErrorStatus()
Error report n/a BSTR GetError­Report()
Compression factor n/a double GetCompression()
Density [kg/m3] n/a double GetDensity()
Molar density [kmol/m3] n/a double GetMolarDensity()
Molar mass [kg/kmol] n/a double GetMolarMass()
FUNCTION
Function prototype long int Calculate­Iso12213x3(); calculates compression, density, molar density and molar mass and returns long int representing error status
ERROR STATUS
long GetError­Status() Description of Error flags.
Bit 0 =1 (000001H) Pressure <0.000001 or >120.0 bar.
Bit 1 =1 (000002H) Temperature <-23.0 or >65.0 °C.
Bit 2 =1 (000004H) d>(0.55+0.97⋅mfrCO2-0.45⋅mfrH2)
d - density
mfrCO2 - mole fraction of carbon dioxide
mfrH2 - mole fraction of hydrogen
Bit 3 =1 (000008H) No convergence in iteration with molar heating value
Bit 4 =1 (000010H) No convergence in iteration with the second virial coefficient
Bit 5 =1 (000020H) Calculated mole fraction of N2 (mfrN2) out of range, i.e. -0.01>mfrN2>0.5
Bit 6 =1 (000040H) Sum of mole fractions of N2 (mfrN2) and CO2 (mfrCO2) out of range: (mfrN2+mfrCO2)<0.5
Bit 7 =1 (000080H) The internal consistency of the input data for the third iteration loop does not satisfy the condition relating relative density and mole fractions:
d>(0.55+0.4⋅mfrN2+0.97⋅mfrCO2-0.45⋅mfrH2)
mfrN2 - mole fraction for nitrogen
mfrCO2 - mole fraction for carbon dioxide
mfrH2 - mole fraction of hydrogen
Bit 8 =1 (000100H) No solution - square root of negative value (B11⋅B33<0)
Bit 9 =1 (000200H) No solution - exponentiation of negative value
Bit 10 =1 (000400H) No convergence
Bit 11 =1 (000800H) Mole fraction of Carbon dioxide <0 or >0.3
Bit 12 =1 (001000H) Mole fraction of Nitrogen <0 or >0.1
Bit 13=1 (002000H) Superior calorific value <20 or >48 MJ/m3
Bit 14 =1 (004000H) Relative density <0.55 or >0.9.
Bit 15,...,Bit 23 Unused.
Bit 24 =1 (1000000H) Incorrect key code.
Bit 25,... Bit 25 and all higher bits are unused.