Module Refprop Public Declare Sub SETUPdll Lib "d:\refprop\vb\REFPROP.DLL" (ByRef i As Long, ByVal hfld As String, ByVal hfmix As String, ByVal hrf As String, ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long, ByRef ln2 As Long, ByRef ln3 As Long, ByRef ln4 As Long) Public Declare Sub SETMIXdll Lib "d:\refprop\vb\REFPROP.DLL" (ByVal hmxnme As String, ByVal hfmix As String, ByVal hrf As String, ByRef ncc As Long, ByVal hfile As String, ByRef x As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long, ByRef ln2 As Long, ByRef ln3 As Long, ByRef ln4 As Long, ByRef ln5 As Long) Public Declare Sub SETPATHdll Lib "d:\refprop\vb\REFPROP.DLL" (ByVal htype As String, ByRef ln As Long) Public Declare Sub SETMODdll Lib "REFPROP.DLL" (ByRef i As Long, ByVal htype As String, ByVal hmix As String, ByVal hcomp As String, ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long, ByRef ln2 As Long, ByRef ln3 As Long, ByRef ln4 As Long) Public Declare Sub SETREFdll Lib "REFPROP.DLL" (ByVal hrf As String, ByRef ixflag As Long, ByRef x0 As Double, ByRef h0 As Double, ByRef s0 As Double, ByRef t0 As Double, ByRef p0 As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long, ByRef ln2 As Long) Public Declare Sub GERG04dll Lib "REFPROP.DLL" (ByRef nc As Long, ByRef iflag As Long, ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long) Public Declare Sub TPFLSHdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef p As Double, ByRef x As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub TPRHOdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef p As Double, ByRef x As Double, ByRef j As Long, ByRef i As Long, ByRef d As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub THERMdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef p As Double, ByRef ee As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef hjt As Double) Public Declare Sub THERM2dll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef p As Double, ByRef ee As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef z As Double, ByRef hjt As Double, ByRef aH As Double, ByRef g As Double, ByRef kappa As Double, ByRef beta As Double, ByRef dPdD As Double, ByRef d2PdD2 As Double, ByRef dPdT As Double, ByRef dDdT As Double, ByRef dDdP As Double, ByRef d2PT2 As Double, ByRef d2PdTD As Double, ByRef spare3 As Double, ByRef spare4 As Double) Public Declare Sub THERM3dll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef kappa As Double, ByRef beta As Double, ByRef isenk As Double, ByRef kt As Double, ByRef betas As Double, ByRef bs As Double, ByRef kkt As Double, ByRef thrott As Double, ByRef pi As Double, ByRef spht As Double) Public Declare Sub THERM0dll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef p As Double, ByRef ee As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef a As Double, ByRef g As Double) Public Declare Sub ENTROdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef s As Double) Public Declare Sub ENTHALdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef h As Double) Public Declare Sub CVCPdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef Cv As Double, ByRef Cp As Double) Public Declare Sub PRESSdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef p As Double) Public Declare Sub AGdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef a As Double, ByRef g As Double) Public Declare Sub DPDDdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef rho As Double, ByRef x As Double, ByRef dPdD As Double) Public Declare Sub DPDD2dll Lib "REFPROP.DLL" (ByRef t As Double, ByRef rho As Double, ByRef x As Double, ByRef d2PdD2 As Double) Public Declare Sub DPDTdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef rho As Double, ByRef x As Double, ByRef dPdT As Double) Public Declare Sub DDDPdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef rho As Double, ByRef x As Double, ByRef dDdP As Double) Public Declare Sub DDDTdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef rho As Double, ByRef x As Double, ByRef dDdT As Double) Public Declare Sub DHD1dll Lib "REFPROP.DLL" (ByRef t As Double, ByRef rho As Double, ByRef x As Double, ByRef dHdT_D As Double, ByRef dHdT_P As Double, ByRef dHdD_T As Double, ByRef dHdD_P As Double, ByRef dHdP_T As Double, ByRef dHdP_D As Double) Public Declare Sub SATTdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef x As Double, ByRef i As Long, ByRef p As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub SATPdll Lib "REFPROP.DLL" (ByRef p As Double, ByRef x As Double, ByRef i As Long, ByRef t As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub SATDdll Lib "REFPROP.DLL" (ByRef d As Double, ByRef x As Double, ByRef kph As Long, ByRef kr As Long, ByRef t As Double, ByRef p As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub SATHdll Lib "REFPROP.DLL" (ByRef h As Double, ByRef x As Double, ByRef kph As Long, ByRef nroot As Long, ByRef k1 As Long, ByRef t1 As Double, ByRef p1 As Double, ByRef D1 As Double, ByRef k2 As Long, ByRef t2 As Double, ByRef p2 As Double, ByRef d2 As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub SATEdll Lib "REFPROP.DLL" (ByRef ee As Double, ByRef x As Double, ByRef kph As Long, ByRef nroot As Long, ByRef k1 As Long, ByRef t1 As Double, ByRef p1 As Double, ByRef D1 As Double, ByRef k2 As Long, ByRef t2 As Double, ByRef p2 As Double, ByRef d2 As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub SATSdll Lib "REFPROP.DLL" (ByRef s As Double, ByRef x As Double, ByRef kph As Long, ByRef nroot As Long, ByRef k1 As Long, ByRef t1 As Double, ByRef p1 As Double, ByRef D1 As Double, ByRef k2 As Long, ByRef t2 As Double, ByRef p2 As Double, ByRef d2 As Double, ByRef k3 As Long, ByRef t3 As Double, ByRef p3 As Double, ByRef d3 As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub CV2PKdll Lib "REFPROP.DLL" (ByRef icomp As Long, ByRef t As Double, ByRef rho As Double, ByRef cv2p As Double, ByRef csat As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub CSATKdll Lib "REFPROP.DLL" (ByRef icomp As Long, ByRef t As Double, ByRef kph As Long, ByRef p As Double, ByRef rho As Double, ByRef csat As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub DPTSATKdll Lib "REFPROP.DLL" (ByRef icomp As Long, ByRef t As Double, ByRef kph As Long, ByRef p As Double, ByRef rho As Double, ByRef csat As Double, ByRef dpdtsat As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub TDFLSHdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef p As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub PDFLSHdll Lib "REFPROP.DLL" (ByRef p As Double, ByRef d As Double, ByRef x As Double, ByRef t As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub PHFLSHdll Lib "REFPROP.DLL" (ByRef p As Double, ByRef h As Double, ByRef x As Double, ByRef t As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub PSFLSHdll Lib "REFPROP.DLL" (ByRef p As Double, ByRef s As Double, ByRef x As Double, ByRef t As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef h As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub PEFLSHdll Lib "REFPROP.DLL" (ByRef p As Double, ByRef ee As Double, ByRef x As Double, ByRef t As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub THFLSHdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef h As Double, ByRef x As Double, ByRef i As Long, ByRef p As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub TSFLSHdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef s As Double, ByRef x As Double, ByRef i As Long, ByRef p As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef h As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub TEFLSHdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef ee As Double, ByRef x As Double, ByRef i As Long, ByRef p As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub DHFLSHdll Lib "REFPROP.DLL" (ByRef d As Double, ByRef h As Double, ByRef x As Double, ByRef t As Double, ByRef p As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub DSFLSHdll Lib "REFPROP.DLL" (ByRef d As Double, ByRef s As Double, ByRef x As Double, ByRef t As Double, ByRef p As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef h As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub DEFLSHdll Lib "REFPROP.DLL" (ByRef d As Double, ByRef ee As Double, ByRef x As Double, ByRef t As Double, ByRef p As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub HSFLSHdll Lib "REFPROP.DLL" (ByRef h As Double, ByRef s As Double, ByRef z As Double, ByRef t As Double, ByRef p As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ee As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub ESFLSHdll Lib "REFPROP.DLL" (ByRef ee As Double, ByRef s As Double, ByRef z As Double, ByRef t As Double, ByRef p As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef h As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub FPVdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef p As Double, ByRef x As Double, ByRef f As Double) Public Declare Sub TQFLSHdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef q As Double, ByRef x As Double, ByRef kq As Long, ByRef p As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef ee As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub PQFLSHdll Lib "REFPROP.DLL" (ByRef p As Double, ByRef q As Double, ByRef x As Double, ByRef kq As Long, ByRef t As Double, ByRef d As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef ee As Double, ByRef h As Double, ByRef s As Double, ByRef Cv As Double, ByRef Cp As Double, ByRef w As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub ABFL1dll Lib "REFPROP.DLL" (ByRef a As Double, ByRef b As Double, ByRef x As Double, ByRef i As Long, ByVal ab As String, ByRef dmin As Double, ByRef dmax As Double, ByRef t As Double, ByRef p As Double, ByRef d As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long, ByRef ln2 As Long) Public Declare Sub ABFL2dll Lib "REFPROP.DLL" (ByRef a As Double, ByRef b As Double, ByRef x As Double, ByRef kq As Long, ByRef ksat As Long, ByVal ab As String, ByRef tbub As Double, ByRef tdew As Double, ByRef pbub As Double, ByRef pdew As Double, ByRef Dlbub As Double, ByRef Dvdew As Double, ByRef ybub As Double, ByRef xdew As Double, ByRef t As Double, ByRef p As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef x As Double, ByRef y As Double, ByRef q As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long, ByRef ln2 As Long) Public Declare Sub DBFL2dll Lib "REFPROP.DLL" (ByRef d As Double, ByRef b As Double, ByRef x As Double, ByRef i As Long, ByVal ab As String, ByRef t As Double, ByRef p As Double, ByRef Dl As Double, ByRef Dv As Double, ByRef xliq As Double, ByRef xvap As Double, ByRef q As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long, ByRef ln2 As Long) Public Declare Sub CRITPdll Lib "REFPROP.DLL" (ByRef x As Double, ByRef tc As Double, ByRef pc As Double, ByRef dc As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub VIRBdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef x As Double, ByRef b As Double) Public Declare Sub DBDTdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef x As Double, ByRef dbt As Double) Public Declare Sub VIRCdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef x As Double, ByRef c As Double) Public Declare Sub TRNPRPdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef eta As Double, ByRef tcx As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub FGCTYdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef f As Double) Public Declare Sub DIELECdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef de As Double) Public Declare Sub SURFTdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef d As Double, ByRef x As Double, ByRef sigma As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub SURTENdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef rhol As Double, ByRef rhov As Double, ByRef xl As Double, ByRef xv As Double, ByRef sigma As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub MELTTdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef x As Double, ByRef p As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub MLTH2Odll Lib "REFPROP.DLL" (ByRef t As Double, ByRef p1 As Double, ByRef p2 As Double) Public Declare Sub MELTPdll Lib "REFPROP.DLL" (ByRef p As Double, ByRef x As Double, ByRef t As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub SUBLTdll Lib "REFPROP.DLL" (ByRef t As Double, ByRef x As Double, ByRef p As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub SUBLPdll Lib "REFPROP.DLL" (ByRef p As Double, ByRef x As Double, ByRef t As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub WMOLdll Lib "REFPROP.DLL" (ByRef x As Double, ByRef wm As Double) Public Declare Sub XMASSdll Lib "REFPROP.DLL" (ByRef xmol As Double, ByRef xkg As Double, ByRef wmix As Double) Public Declare Sub XMOLEdll Lib "REFPROP.DLL" (ByRef xkg As Double, ByRef xmol As Double, ByRef wmix As Double) Public Declare Sub QMASSdll Lib "REFPROP.DLL" (ByRef qmol As Double, ByRef xl As Double, ByRef xv As Double, ByRef qkg As Double, ByRef xlkg As Double, ByRef xvkg As Double, ByRef wliq As Double, ByRef wvap As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub QMOLEdll Lib "REFPROP.DLL" (ByRef qkg As Double, ByRef xlkg As Double, ByRef xvkg As Double, ByRef qmol As Double, ByRef xl As Double, ByRef xv As Double, ByRef wliq As Double, ByRef wvap As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln As Long) Public Declare Sub INFOdll Lib "REFPROP.DLL" (ByRef icomp As Long, ByRef wmm As Double, ByRef ttrp As Double, ByRef tnbpt As Double, ByRef tc As Double, ByRef pc As Double, ByRef dc As Double, ByRef Zc As Double, ByRef acf As Double, ByRef dip As Double, ByRef Rgas As Double) Public Declare Sub LIMITXdll Lib "REFPROP.DLL" (ByVal htyp As String, ByRef t As Double, ByRef d As Double, ByRef p As Double, ByRef x As Double, ByRef tmin As Double, ByRef tmax As Double, ByRef dmax As Double, ByRef pmax As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long, ByRef ln2 As Long) Public Declare Sub LIMITKdll Lib "REFPROP.DLL" (ByVal htyp As String, ByRef icomp As Long, ByRef t As Double, ByRef d As Double, ByRef p As Double, ByRef tmin As Double, ByRef tmax As Double, ByRef dmax As Double, ByRef pmax As Double, ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long, ByRef ln2 As Long) Public Declare Sub SETKTVdll Lib "REFPROP.DLL" (ByRef icomp As Long, ByRef jcomp As Long, ByVal hmodij As String, ByRef fij As Double, ByVal hfmix As String, ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long, ByRef ln2 As Long, ByRef ln3 As Long) Public Declare Sub GETKTVdll Lib "REFPROP.DLL" (ByRef icomp As Long, ByRef jcomp As Long, ByVal hmodij As String, ByRef fij As Double, ByVal hfmix As String, ByVal hfij As String, ByVal hbinp As String, ByVal hmxrul As String, ByRef ln1 As Long, ByRef ln2 As Long, ByRef ln3 As Long, ByRef ln4 As Long, ByRef ln5 As Long) Public Declare Sub GETFIJdll Lib "REFPROP.DLL" (ByVal hmodij As String, ByRef fij As Double, ByVal hfij As String, ByVal hmxrul As String, ByRef ln1 As Long, ByRef ln2 As Long, ByRef ln3 As Long) Public Declare Sub PREOSdll Lib "REFPROP.DLL" (ByRef i As Long) Public Declare Sub SETAGAdll Lib "REFPROP.DLL" (ByRef ierr As Long, ByVal herr As String, ByRef ln1 As Long) Sub Calculate() Dim MaxComps As Long = 20 Dim nc, ierr As Long Dim t, p, d, Dl, Dv, q, ee, h, s, cp, cv, w, hjt As Double Dim z, Helm, Gibbs, kappa, beta, dPdD, d2PdD2, dPdT, dDdT, dDdP, d2PT2, d2PdTD, spare3, spare4 As Double Dim x(MaxComps), xliq(MaxComps), xvap(MaxComps) As Double Dim wmliq, wmvap, eta, tcx As Double Dim herr, hfmix, hrf, hfld, hmxnme, hpath As String 'Call SETPATH to set the path where the fluid files are located hpath = "d:\refprop\vb\fluids" + Space(255) Call SETPATHdll(hpath, 255&) 'Setup a binary mixture of methane and ethane hfld = "methane|ethane" + Space(10000) hfmix = "hmx.bnc" + Space(255) hrf = "DEF" herr = Space(255) nc = 2 Call SETUPdll(nc, hfld, hfmix, hrf, ierr, herr, 10000&, 255&, 3&, 255&) If ierr Then MessageBox.Show(herr) x(1) = 0.5 x(2) = 0.5 'This mixture is 2-phase at 200 K and 1 MPa, the equilibrium compositions will be returned in xliq and xvap t = 200 p = 1000 Call TPFLSHdll(t, p, x(1), d, Dl, Dv, xliq(1), xvap(1), q, ee, h, s, cp, cv, w, ierr, herr, 255&) 'Calculate molar mass of liquid and vapor compositions Call WMOLdll(xliq(1), wmliq) Call WMOLdll(xvap(1), wmvap) 'Calculate properties of liquid state (w is speed of sound, hjt is Joule-Thomson value) Call THERMdll(t, Dl, xliq(1), p, ee, h, s, cv, cp, w, hjt) 'Use THERM2 to get even more properties Call THERM2dll(t, Dl, xliq(1), p, ee, h, s, cv, cp, w, z, hjt, Helm, Gibbs, kappa, beta, dPdD, d2PdD2, dPdT, dDdT, dDdP, d2PT2, d2PdTD, spare3, spare4) 'Calculate transport properties at the liquid state Call TRNPRPdll(t, Dl, xliq(1), eta, tcx, ierr, herr, 255&) Stop 'Cal SETMIX to setup the R404A mixture. This will return the parameters nc and hfld, as well as the x array. hmxnme = "R404A.mix" + Space(255) hfmix = "hmx.bnc" + Space(255) hrf = "DEF" Call SETMIXdll(hmxnme, hfmix, hrf, nc, hfld, x(1), ierr, herr, 255&, 255&, 3&, 10000&, 255&) If ierr Then MessageBox.Show(herr) t = 300 p = 1000 Call TPFLSHdll(t, p, x(1), d, Dl, Dv, xliq(1), xvap(1), q, ee, h, s, cp, cv, w, ierr, herr, 255&) 'Calculate transport properties Call TRNPRPdll(t, d, x(1), eta, tcx, ierr, herr, 255&) Stop End Sub End Module