//
//	Pint.h
//	Copyright (c) 1992,2016 by Prode

// Pint header includes codes for exchanging dara

#ifndef Pint_h
#define Pint_h

// constants to extract Config parameters
// for CFGReal method
#define	      CFG_PAR_TREF  1
#define	      CFG_PAR_PREF  2
#define	      CFG_PAR_HTIN  3
#define	      CFG_PAR_HIN   4
#define	      CFG_PAR_STIN  5
#define	      CFG_PAR_SIN   6
#define	      CFG_PAR_MTIME 7
#define	      CFG_PAR_CTOL  8 
#define	      CFG_PAR_LDMIN 9

// for CFGInt method
#define	      CFG_PAR_MSTR  1 
#define	      CFG_PAR_MSTRC 2
#define	      CFG_PAR_MSTRB 3
#define	      CFG_PAR_MSTRP 4
#define	      CFG_PAR_HMODE 5
#define	      CFG_PAR_SMODE 6
#define	      CFG_PAR_WUNIT 7

// constants to exchange values with predefined tables
#define CMP_TABLE_1 1
#define CMP_TABLE_2 2
#define BIP_TABLE_1 3
#define BIP_TABLE_2 4
#define MOD_TABLE_1 5
#define CFG_TABLE_2 6
#define CFG_TABLE_1 7

#define TABLE_C_UM   1
#define TABLE_C_ROW  2
#define TABLE_C_COL  3
#define TABLE_C_SHOW 4
#define TABLE_C_EDIT 5
#define TABLE_C_LBL  6
#define TABLE_C_F1   7
#define TABLE_C_I1   8
#define TABLE_C_S1   9
#define TABLE_C_SEL  10
#define TABLE_C_MAX  11
#define TABLE_C_MIN  12
#define TABLE_C_NVAL 13


// additional definitions
#define       SORT_CNAME_1   1
#define       SORT_CNAME_2   2
#define       SORT_CNAME_3   3
#define       SORT_CFORM     4

// UMCONV.h
#define		  CONV_UMNS  15	// (max) number of characters

#define       CONV_STR    0		//	no units (String)		""
#define       CONV_PSW    1		//	no units (Psw string)	""
#define       CONV_DATE   2		//	no units (Date string)	""
#define       CONV_CURR   3		//	no units (Currency)		""
#define       CONV_PBUTT  4		//	no units (Push Button)  ""
#define       CONV_CBOX   5		//	no units (Check Box)    ""
#define       CONV_BOOL   6		//	no units (Boolean)		""
#define       CONV_INT    7		//  no units (Integer)		""
#define       CONV_LONG   8		//	no units (Long Integer)	""
#define       CONV_ENUM   9		//	no units (enum)			""
#define       CONV_ENUMT  10	//	no units (tabbed combo)	""
#define       CONV_NUM    11	//	no units (real)			""
// free space for future additions
#define       CONV_UM_P   15	//  Pressure (abs)			"Pa.a"
#define       CONV_UM_DP  16	//	Pressure (rel)			"Pa"
#define       CONV_UM_T   17	//  Temperature	(abs)		"K"
#define       CONV_UM_DT  18	//  Temperature (rel)		"K"
#define       CONV_UM_HM  19	//	Calorific Value			"Kj/Kg"
#define       CONV_UM_HMM 20	//	Calorific Value (molar)	"Kj/Kmol"
#define       CONV_UM_HS  21	//	Power (enthalpy streams)"KW"
#define       CONV_UM_SS  22	//	Entropy Streams			"KJ/(K*s)"
#define       CONV_UM_CP  23	//	Heat Capacity			"kJ/(kg*K)"
#define       CONV_UM_CPM 24	//	Heat Capacity (molar)	"kJ/(kmol*K)"
#define       CONV_UM_W   25	//	Flow (mass basis)		"Kg/s"
#define       CONV_UM_WG  26	//	Flow (gas, mass basis)	"Kg/s"
#define       CONV_UM_D   27	//	Density					"Kg/m3"
#define       CONV_UM_DM  28	//	Density	(molar)			"Kmol/m3"
#define       CONV_UM_SV  29	//	Specific Volume			"m3/Kg"
#define       CONV_UM_SVM 30	//	Specific Volume (molar)	"m3/Kmol"
#define       CONV_UM_TC  31	//  Thermal Conductivity	"W/(m*K)"
#define       CONV_UM_V   32	//	Viscosity (dynamic)		"Pa*s"
#define       CONV_UM_ST  33	//	Surface Tension			"N/m" 
#define       CONV_UM_L   34	//	Lenght					"m"
#define       CONV_UM_A   35	//	Area					"m2"
#define       CONV_UM_VOL 36	//	Volume					"m3"
#define       CONV_UM_M   37	//	Mass					"Kg"
#define       CONV_UM_VL  38	//	Velocity				"m/s"
#define       CONV_UM_ACC 39	//	Acceleration			"m/s2"
#define       CONV_UM_FOR 40	//	Force					"N"
#define       CONV_UM_TM  41	//	Time					"s"
#define       CONV_UM_HF  42	//	Heat Flux				"KW/m2"
#define       CONV_UM_TR  43	//	Thermal Resistance		"K*m2/KW"
#define       CONV_UM_HTC 44	//	Heat Transfer Coefficent"KW/(m2*C)"
#define       CONV_UM_WV  45	//	Flow (volume basis)		"m3/s"
#define       CONV_UM_VK  46	//	viscosity (kinematic)	"m2/s"
#define       CONV_UM_EN  47	//	energy					"KJ"
#define       CONV_UM_EDM 48	//	dipole moment			"c-m"
#define       CONV_UM_SP  49	//	Solubility parameter	"(J/m3)^1/2"
#define       CONV_UM_CV  50	//	Flow Coefficient		"Cv"
#define       CONV_UM_CC  51	//  Compressibility coeff.	“1/Pa”
#define       CONV_UM_JTC 52	//  Joule Thomson coeff.	“K/Pa”
#define       CONV_UM_WM  53	//	Flow (molar basis)		"Kmol/s"
#define       CONV_UM_VE  54	//	Thermal Expansion		"1/K"

#define       CONV_UM_MIN	CONV_UM_P
#define       CONV_UM_DEF  (CONV_UM_VE - CONV_UM_MIN + 1)
// allow some spare positions for future updates...
#define       CONV_UM_AUX  60	//  Auxiliary unit	
#define       CONV_UM_AUX1 61	//  Auxiliary unit	
#define       CONV_UM_AUX2 62	//  Auxiliary unit
#define       CONV_UM_INT1 63	//  Auxiliary unit
#define       CONV_UM_NO   64	//  do not draw the um button	
#define       CONV_UM_MAX	CONV_UM_NO
#define       CONV_UM_PNR  (CONV_UM_MAX - CONV_UM_MIN + 1)

// PCDBEXT.h
#define HST_INIT        1       // allowable range of values for operating temperature
#define HST_MAX         5.0E3 
#define HSP_INIT        1.0     // allowable range of values for operating pressure
#define HSP_MAX         5.0E9
#define HSV_INIT        5.0E-5  // allowable range of values for specific volume
#define HSV_MAX         20000.0

#define HG_INIT_VAL     5.0E3 // predefined initial value for enthalpy at HST_INIT
#define SG_INIT_VAL     5.0E1 // predefined initial value for entropy  at HST_INIT

// PCINTOBJ.h
#define   STR_NAME_SIZE 50  // name of stream, max number of chars 
#define   MAX_NUM_RSETS 5   // max number of reaction sets 
#define GAS_PHASE			0	// gas phase
#define LIQ_PHASE			1	// liquid
#define SOL_PHASE			2   // solid
#define HYD_PHASE			3   // hydrate


// PCTHERMO.h
#define   F_MULTIPHASE_VL	 1    //  multiphase VL
#define   F_MULTIPHASE_VLS	 2    //  multiphase VLS
#define   F_MULTIPHASE_VLSH	 3    //  multiphase VLSH
#define   F_LPQINIT			 4    //  reduce the number of trial phases (multiphase flash)
#define   F_UICSP			 5	  //  use iso compressibility coeff. to detect single phase state
#define   F_VALIDATEPHASES	 6    //  evaluate stability of each phase in equilibrium
#define   F_PF_LINE_CROSS	 7	  //  end specified phase fraction lines when crossing phase boundary lines
#define   F_HYD_TEST_ALL_STR 8    //  test all structures (not only normal strcutures)


#define   EQPT_VLE			 1	   // type of equilibrum point in VLE/LLE/SLE data regression procedures 	 
#define   EQPT_LLE			 2
#define   EQPT_SLE			 3

#define   BIP_VLE			 0	   // codes for BIP types (VLE/LLE/SLE/CUSTOM) as stored in database 	 
#define   BIP_LLE			 1
#define   BIP_SLE			 2
#define   BIP_HYD			 3

#define   MProp_Fg			 1    //  calculates fugacity + d1 (w,p,t)
#define   MProp_H			 2    //  calculates enthalpy + d1 (w,p,t)
#define   MProp_S			 3    //  calculates entropy + d1 (w,p,t)
#define   MProp_V			 4    //  calculates volume + d1 (w,p,t)

#define REGULAR_M       1     // Regular

							  // LIQUID ACTIVITY	
#define WILSON_M        10    // Wilson								
#define NRTL_M          11    // NRTL                      
#define UNIQUAC_M       12    // Uniquac  

							  // SOAVE REDLICH KWONG AND DERIVED	
#define SRK_M			30    // Soave-Redlich_Kwong Std. SRK(VDW)
#define SRKX_M          31    // Soave-Redlich_Kwong Ext. SRKX(VDW)

#define SRKNHV_M		40    // Soave-Redlich_Kwong Ext. NRTL Mod.Huron Vidal SRKX-NRTL(P-HV) 
#define SRKNLVM_M		41    // Soave-Redlich_Kwong Ext. NRTL Mod.LCVM SRKX-NRTL(P-LCVM)

#define PR_M			50    // Peng Robinson Std. PR(VDW)
#define PRX_M           51    // Peng Robinson Ext. PRX(VDW)

#define PRWWS_M         55    // Peng Robinson Ext. Wilson Wong Sandler PRX-Wilson(WS)
#define PRUQWS_M        56    // Peng Robinson Ext. UNIQUAC Wong Sandler PRX-UNIQUAC(WS)
#define PRNWS_M         57    // Peng Robinson Ext. NRTL Wong Sandler PRX-NRTL(WS)
#define PRUFWS_M        59    // Peng Robinson Ext. UNIFAC Wong Sandler PRX-UNIFAC(WS)

#define PRNHV_M         60    // Peng Robinson Ext. NRTL Mod.Huron Vidal PRX-NRTL(P-HV)  
#define PRWHV_M         61    // Peng Robinson Ext. Wilson Mod.Huron Vidal PRX-Wilson(P-HV) 
#define PRUQHV_M        62    // Peng Robinson Ext. UNIQUAC Mod.Huron Vidal PRX-UNIQUAC(P-HV) 

#define PRWMV2_M        65    // Peng Robinson Ext. Wilson MHV2 PRX-Wilson(MHV2)  
#define PRUQMV2_M       66    // Peng Robinson Ext. UNIQUAC MHV2 PRX-UNIQUAC(MHV2)  
#define PRNMV2_M        67    // Peng Robinson Ext. NRTL MHV2 PRX-NRTL(MHV2)  

#define PRNLVM_M        70    // Peng Robinson Ext. NRTL Mod.LCVM PRX-NRTL(P-LCVM) 
#define PRWLVM_M        71    // Peng Robinson Ext. Wilson Mod.LCVM PRX-Wilson(P-LCVM)
#define PRUQLVM_M       72    // Peng Robinson Ext. UNIQUAC Mod.LCVM PRX-UNIQUAC(P-LCVM)

							  // VIRIAL	
#define BWR_M           80    // BWR
#define BWRS_M          81    // BWRS

							  // CORRESPONDING STATES	
#define LK_M            90    // Lee Kesler
#define LKP_M           91    // Lee Kesler Plocker

							  // MODELS INCLUDING ASSOCIATION CONTRIBUTE	
#define PSAFT_M         100   // P-SAFT

#define SRKCPA_M        110   // SRKX-CPA(VDW)
#define PRCPA_M         111   // PRX-CPA(VDW)

#define PRCPANHV_M      115   // Peng Robinson Ext. CPA NRTL Mod. Huron Vidal PRXCPA-NRTL(P-HV)
#define PRCPANLVM_M     116   // Peng Robinson Ext. CPA NRTL Mod. LCVM PRXCPA-NRTL(P-LCVM)
#define PRCPANMHV2_M    117   // Peng Robinson Ext. CPA NRTL Mod. MHV2  PRXCPA-NRTL(P-MHV2)
#define PRCPANWS_M      118   // Peng Robinson Ext. CPA NRTL Mod. Wong Sandler  PRXCPA-NRTL(P-WS)

#define SRKCPANHV_M     120   // SRKX-CPA-NRTL(P-HV)

						  // PREDICTIVE
#define UNIFAC_M        130   // Unifac

							  // SOLIDS 

#define SPRNHV_M		150   // Solid Pure (Peng Robinson Ext. NRTL Mod. Huron Vidal) SPRX-NRTL(P-HV)
#define SPRCPANHV_M		151   // Solid Pure (Peng Robinson Ext. CPA NRTL Mod. Huron Vidal) SPRXCPA-NRTL(P-HV)

#define SSPRNHV_M		153   // Solid Solution (Peng Robinson Ext. NRTL Mod. Huron Vidal) SSPRX-NRTL(P-HV)

                              // Hydrates

#define HPRCPANHV_M     170   // Hydrate (Peng Robinson Ext. CPA NRTL Mod. Huron Vidal) HPRXCPA-NRTL(P-HV) 
#define HPRNHV_M        171   // Hydrate (Peng Robinson Ext. NRTL Mod. Huron Vidal) HPRX-NRTL(P-HV) 

							  // ELECTROLYTES

#define PITZER_M		200	  // Pitzer PITZER
#define PRCPAENHV_M		205	  // Peng Robinson Ext. CPA NRTL Mod. Huron Vidal Electrolyte PRXCPA-E-NRTL(P-HV) 
#define PSAFTE_M        210   // P-SAFT-Electrolyte PSAFT-E

							  // STANDARDS	

#define STEAM_M         300   // Steam tables (IAPWS 95)

#define GERG2008_M      315   // GERG 2008 AGA 2017


/* POINTER defines a generic pointer type */
typedef char* POINTER;

/* UINT4 defines a four byte word */
typedef unsigned long int UINT4;

/* BYTE defines a unsigned character */
typedef unsigned char BYTE;

/* WORD defines a unsigned short int */
typedef unsigned short WORD;

/* DWORD defines a unsigned long */
typedef unsigned long DWORD;


#endif /* Pint_h */
