/*************************************************************************
* �ļ�:	NGCal.h
**************************************************************************/
#ifndef _NGCal_H
#define _NGCal_H
#include <stdio.h>
#include <stdlib.h>
#define NORMAL              9000
#define NGCal_NGCal         9001
#define MEMORY_ALLOCATION_ERROR      9002
#define GENERAL_CALCULATION_FAILURE  9003
#define MAX_NUM_OF_ITERATIONS_EXCEEDED 9004
#define NEGATIVE_DENSITY_DERIVATIVE 9005
#define MAX_DENSITY_IN_BRAKET_EXCEEDED 9006
#define FLOW_CALC_ERROR 9007
#define FLOW_CALC_DIEDAI_ERROR 9008
#define NUMBEROFCOMPONENTS 21
#define M_PI 3.1415926535897932
#define MAX_NUM_OF_ITERATIONS 100
#define P_CHG_TOL 0.001
#define T_CHG_TOL 0.001
#define P_MAX    1.379e8
#define P_MIN    0.0
#define T_MAX    473.15
#define T_MIN    143.0
#define RGASKJ  8.314510e-3
#define RGAS    8.314510
typedef struct tagNGParSTRUCT
{
	long lStatus;
	int bForceUpdate;
	double adMixture[21];
	int dCbtj;
	double dPb;
	double dTb;
	double dPf;
	double dTf;
	double dMrx;
	double dZb;
	double dZf;
	double dFpv;
	double dDb;
	double dDf;
	double dRhob;
	double dRhof;
	double dRD_Ideal;
	double dRD_Real;
	double dHo;
	double dH;
	double dS;
	double dCpi;
	double dCp;
	double dCv;
	double dk;
	double dKappa;
	double dSOS;
	double dCstar;
	double dHhvMol;
	double dLhvMol;
} NGParSTRUCT;


enum gascomp {
    XiC1=0, XiN2, XiCO2, XiC2, XiC3,
    XiH2O, XiH2S, XiH2, XiCO, XiO2,
    XiIC4, XiNC4, XiIC5, XiNC5, XiNC6,
    XiNC7, XiNC8, XiNC9, XiNC10, XiHe, XiAr
};


 int NGCal_Init(NGParSTRUCT * ptNGPar);
 int NGCal_UnInit(void);


 double SOS(NGParSTRUCT *);


 double Crit(NGParSTRUCT *, double);

#endif
