performs the calculation of thermodynamic and volumetric properties of natural gas completely in accordance with:
PROPERTIES |
Property |
Set property value |
Get property value |
I |
X(I): mole fraction for |
0 |
Methane |
void SetMoleFraction(short I, double X(I) |
double GetMoleFraction(short I) |
1 | Nitrogen |
2 | Carbon dioxide |
3 | Ethane |
4 | Propane |
5 | Water |
6 | Hydrogen sylfide |
7 | Hydrogen |
8 | Carbon monoxide |
9 | Oxygen |
10 | iso-Butane |
11 | n-Butane |
12 | iso-Pentane |
13 | n-Pentane |
14 | n-Hexane |
15 | n-Heptane |
16 | n-Octane |
17 | n-Nonane |
18 | n-Decane |
19 | Helium |
20 | Argon |
Pressure [MPa] |
void SetPressureMPa(double newP) |
double GetPressureMPa() |
Temperature [K] |
void SetTemperatureK(double newT) |
double GetTemperatureK() |
*Ranges of application (RAP) |
void SetRangeOfApplication(short newRAP) |
short GetRangeOfApplication() |
Protection key |
void SetKeyCode(long newValue) |
n/a |
Mass-based density [kg/m3] | void SetDensity(double newD) |
double GetDensity() |
Reduced density | void SetReducedDensity(double newRD) |
double GetReducedDensity() |
Molar mass [kg/kmol] | n/a |
double GetMolarMass() |
Molar density [kg⋅mole/m3] | n/a |
double GetMolarDensity() |
Compression factor | n/a |
double GetCompressionFactor() |
Molar Gibbs free energy [kj/kmol] |
n/a |
double GetMolarGibsFreeEnergy() |
Molar internal energy [kJ/kmol] | n/a |
double GetMolarInternalEnergy () |
Specific internal energy [kJ/kg] | n/a |
double GetSpecificInternalEnergy () |
Molar enthalpy [kJ/kmol] | n/a |
double GetMolarEnthalpy () |
Specific enthalpy [kJ/kg] | n/a |
double GetSpecificEnthalpy () |
Molar entropy [kJ/(kmol⋅K)] | n/a |
double GetMolarEntropy () |
Specific entropy [kJ/(kg⋅K)] | n/a |
double GetSpecificEntropy () |
Molar isochoric heat capacity [kJ/(kmol⋅K)] | n/a |
double GetMolarIsochoricHeatCapacity () |
Specific isochoric heat capacity [kJ/(kg⋅K)] | n/a |
double GetSpecificIsochoricHeatCapacity () |
Molar isobaric heat capacity [kJ/(kmol⋅K)] | n/a |
double GetMolarIsobaricHeatCapacity () |
Specific isobaric heat capacity [kJ/(kg⋅K)] | n/a |
double GetSpecificIsobaricHeatCapacity () |
Joule-Thomson coefficient [K/MPa] | n/a |
double GetJouleThomsonCoefficient () |
Isentropic exponent | n/a |
double GetIsentropicExponent () |
Speed of sound [m/s] | n/a |
double GetSpeedOfSound () |
**Error status | n/a |
long GetErrorFlag() |
***Error report | n/a |
BSTR GetErrorReport() |
FUNCTION |
long CalculateIso20765x2(short iCalc); Calculates the properties and returns long error status |
short iCalc - defines method of calculation | Input parameters to selected method of calculation |
iCalc=0 (or any iCalc≠1 & ≠2) | Pressure, temperature and mole fractions |
iCalc=1 | Mass-based density, temperature and mole fractions |
iCalc=2 | Reduced density, temperature and mole fractions |
**ERROR STATUS |
long GetErrorFlag() |
Description of Error/Warning flags. |
Bit 0 =1 (000001H) |
Error: There exists at least one mole fraction <0 or >1. |
Bit 1 =1 (000002H) |
Error: Total sum of mole fractions <0.98 or >1.02. |
Bit 2 =1 (000004H) |
Warning: Absolute temperature T<200. This flag warns that the calculated thermodynamic properties may be invalid but, the calculated volumetric properties (reduced density, mass density and compression factor) are valid if only this bit is set. |
Bit 3 =1 (000008H) |
Error: Mole fraction of Methane out of range defined by RAP |
Bit 4 =1 (000010H) |
Error: Mole fraction of Nitrogen out of range defined by RAP |
Bit 5 =1 (000020H) |
Error: Mole fraction of Carbon Dioxide out of range defined by RAP |
Bit 6 =1 (000040H) |
Error: Mole fraction of Ethane out of range defined by RAP |
Bit 7 =1 (000080H) |
Error: Mole fraction of Propane out of range defined by RAP |
Bit 8 =1 (000100H) |
Error: Mole fraction of Water out of range defined by RAP |
Bit 9 =1 (000200H) |
Error: Mole fraction of Hydrogen sulfide out of range defined by RAP |
Bit 10 =1 (000400H) |
Error: Mole fraction of Hydrogen out of range defined by RAP |
Bit 11 =1 (000800H) |
Error: Mole fraction of Carbon monoxide out of range defined by RAP |
Bit 12 =1 (001000H) |
Error: Mole fraction of Oxygen out of range defined by RAP |
Bit 13=1 (002000H) |
Error: Mole fraction of (n-Butane + i-Butane) out of range defined by RAP |
Bit 14 =1 (004000H) |
Error: Mole fraction of (n-pentane + i-Pentane) out of range defined by RAP |
Bit 15 =1 (008000H) |
Error: Mole fraction of n-Hexane out of range defined by RAP |
Bit 16 =1 (010000H) |
Error: Mole fraction of n-Heptane out of range defined by RAP |
Bit 17 =1 (020000H) |
Error: Mole fraction of (n-Octane + n-Nonane + n-Decane) out of range defined by RAP |
Bit 18 =1 (040000H) |
Error: Mole fraction of Helium out of range defined by RAP |
Bit 19 =1 (080000H) |
Error: Mole fraction of Argon out of range defined by RAP |
Bit 20 =1 (100000H) |
Error: Pressure (absolute) out of range defined by RAP |
Bit 21 =1 (200000H) |
Error: Temperature out of range defined by RAP |
Bit 22 =1 (400000H) |
Error: Reduced density out of range |
Bit 23 =1 (800000H) |
Error: Incorrect protection key |
Bit 24,... |
All higher bits are unused. |