SUBROUTINE TYPE85 (TIME,XIN,OUT,T,DTDT,PAR,INFO,ICNTRL,*) C************************************************************************ C* Copyright ASHRAE A Toolkit for Primary HVAC System Energy C* Calculation C*********************************************************************** C* SUBROUTINE: TYPE85 (PCHIPLID) C* C* LANGUAGE: FORTRAN 77 C* C* PURPOSE: Identification of the internal power of C* the compressor when all the cylinders C* are unloaded C* The pressure drop at the exhaust of the C* compressor cylinders is taken into account. C*********************************************************************** C* INPUT VARIABLES C* Ifluid Selection of the refrigerant (-) C* If Ifluid C* =1: Refrigerant 12 C* =2: Refrigerant 134a C* =3: Refrigerant 114 C* =4: Refrigerant 22 C* =5: Refrigerant 502 C* =6: Refrigerant 717 (Ammonia) C* xin(1) (-) C* PLorFL If PLorFL (-) C* =1: the user knows the variables associated with C* a working point in part-load regime C* =2: the user only knows the variables associated C* with a working point in full-load regime C* xin(2) (-) C* Mfrwev Water mass flow rate in the evaporator (kg/s) C* in part-load or in full-load regime according to C* the value of PLorFL C* xin(3) (kg/hr) C* Mfrwcd Water mass flow rate in the condenser (kg/s) C* in part-load or in full-load regime according to C* the value of PLorFL C* xin(4) (kg/hr) C* Choice If Choice (-) C* =1: the supply water temperature is known for both C* evaporator and condenser C* =2: the water temperature is known at the evaporator C* supply and at the condenser exhaust C* =3: the exhaust water temperature is known for both C* evaporator and condenser C* =4: the water temperature is known at the evaporator C* exhaust and at the condenser supply C* xin(5) (-) C* Twev1 This value is equal to the evaporator supply or (K) C* exhaust water temperature in part-load or in C* full-load regime according to the value of Choice C* and of PLorFL C* xin(6) (øC) C* Twcd1 This value is equal to the condenser supply or (K) C* exhaust water temperature in part-load or in C* full-load regime according to the value of Choice C* and of PLorFL C* xin(7) (øC) C* W Power consumed by the compressor working in (W) C* part-load or in full-load regime according to C* the value of PLorFL C* xin(8) (kJ/hr) C* Pev Cooling capacity of the chiller in (W) C* part-load or in full-load regime according to C* the value of PLorFL C* xin(9) (kJ/hr) C* Nc Number of loaded cylinders (-) C* ( set to 0.5*NcFL if PLorFL=2 ) C* xin(10) (-) C* NcFL Number of loaded cylinders in full load regime (-) C* xin(11) (-) C* C* OUTPUT VARIABLES C* Wpumping Internal power of the compressor when all the (W) C* cylinders are unloaded C* out(1) (kJ/hr) C* C* PARAMETERS C* AUev Evaporator heat transfer coefficient (W/K) C* par(1) (kJ/hr/øC) C* AUcd Condenser heat transfer coefficient (W/K) C* par(2) (kJ/hr/øC) C* Losses Constant part of the electromechanical losses (W) C* par(3) (kJ/hr) C* Alpha Loss factor allowing to define another (-) C* electromechanical loss which is assumed to be C* proportional to the internal power C* par(4) (-) C* Aex Equivalent nozzle throat area of a cylinder (m**2) C* par(5) (m**2) C* Cf Clearance factor of the compressor (-) C* par(6) (-) C* VsFL Geometric displacement of the compressor (m**3/s) C* in full load regime C* par(7) (m**3/hr) C* C* WATER PROPERTY C* CpWat Specific heat of liquid water (J/kg/K) C* C* REFRIGERANT PROPERTIES C* To Reference temperature (K) C* cpliq Mean specific heat in saturated liquid state (J/kg/K) C* hfo Enthalpy of the saturated liquid at the (J/kg) C* reference temperature C* cpvap Mean specific heat at constant pressure (J/kg/K) C* in superheated vapor state for saturation C* temperatures ranging from 253 K to 283 K C* cpvapcd Mean specific heat at constant pressure (J/kg/K) C* in superheated vapor state for saturation C* temperatures ranging from 303 K to 333 K C* hfgb Vaporization enthalpy at standard boiling (J/kg) C* point (101325 Pa) C* Tb Standard boiling temperature (K) C* Tc Critical temperature (K) C* b Coefficient used in the calculation of the (-) C* vaporization enthalpy C* r Gas constant (J/kg/K) C* Zeta Mean compressibility factor for saturation (-) C* temperatures ranging from 253 K to 283 K C* Zetacd Mean compressibility factor for saturation (-) C* temperatures ranging from 303 K to 333 K C* Gamma Mean isentropic coefficient (-) C* Acl First coefficient in the Clausius-Clapeyron (-) C* equation C* Bcl Second coefficient in the Clausius-Clapeyron (K) C* equation C*********************************************************************** C MAJOR RESTRICTIONS: The surrounding heat exchanges are C neglected. C The compression is assumed to be isentropic. C Perfect gas properties are used. C The chiller is assumed to work with only C one compressor. C C DEVELOPER: Jean Lebrun C Jean-Pascal Bourdouxhe C Marc Grodent C University of LiŠge, Belgium C C DATE: March 1, 1995 C C SUBROUTINE CALLED: PROPERTY C LINKCK C*********************************************************************** C INTERNAL VARIABLES: C Effev Evaporator effectiveness (-) C Effcd Condenser effectiveness (-) C Tev Evaporating temperature (K) C Tcd Condensing temperature (K) C Pcd Heat rejected in the condenser (W) C p1 Evaporating pressure (Pa) C p3 Condensing pressure (Pa) C v2p Specific volume at point 2' (m**3/kg) C p2 Pressure at point 2 (Pa) C T1p Temperature after the heating-up (K) C v1p Specific volume after the heating-up (m**3/kg) C Effvol Volumetric effectiveness of the compressor (-) C MfrRef Refrigerant mass flow rate (kg/s) C Wpl Power consumed by the compressor in part-load (W) C Wis Isentropic compression power consumed by the (W) C loaded cylinders C Vs Geometric displacement of the compressor (m**3/kg) C for specified working conditions C Win Internal power consumed by the compressor (W) C dpex Pressure drop at the compressor exhaust (Pa) C TolRel Relative error tolerance (-) C ErrRel Relative error (-) C C Wpumpp,T1pp and dpexp are variables used in the iterative C scheme. C*********************************************************************** INTEGER*4 INFO DOUBLE PRECISION XIN,OUT REAL Nc,Mfrwev,Mfrwcd,MfrRef,Ifluid,NcFL,Losses DIMENSION PAR(7),XIN(11),OUT(1),INFO(15) COMMON /LUNITS/ LUR,LUW,IFORM,LUK COMMON /SIM/ TIME0,TFINAL,DELT,IWARN COMMON /STORE/ NSTORE,IAV,S(5000) COMMON /CONFIG/ TRNEDT,PERCOM,HEADER,PRTLAB,LNKCHK,PRUNIT,IOCHEK, & PRWARN INFO(6)=1 DATA TolRel,CpWat/1E-05,4187/ C*** INPUTS 11 (converted in SI units) C************* Ifluid=SNGL(xin(1)) PLorFL=SNGL(xin(2)) Mfrwev=SNGL(xin(3)/3600.) Mfrwcd=SNGL(xin(4)/3600.) Choice=SNGL(xin(5)) Twev1=SNGL(xin(6)+273.15) Twcd1=SNGL(xin(7)+273.15) W=SNGL(xin(8)/3.6) Pev=SNGL(xin(9)/3.6) Nc=SNGL(xin(10)) NcFL=SNGL(xin(11)) C*** PARAMETERS 7 (converted in SI units) C**************** AUev=par(1)/3.6 AUcd=par(2)/3.6 Losses=par(3)/3.6 Alpha=par(4) Aex=par(5) Cf=par(6) VsFL=par(7)/3600. C2*** Selection of the refrigerant CALL PROPERTY (Ifluid,To,cpliq,hfo,cpvap,cpvapcd,hfgb,Tb,Tc, & b,r,Zeta,Zetacd,Gamma,Acl,Bcl,*1) CALL LINKCK('TYPE85','PROPERTY',1,99) 1 CONTINUE Gm1G=(Gamma-1)/Gamma NChoice=INT(Choice) C1*** Calculate the evaporating temperature according to the C1*** information available Effev=1-EXP(-AUev/(CpWat*Mfrwev)) IF ((NChoice.EQ.1).OR.(NChoice.EQ.2)) THEN Tev=Twev1-Pev/(Effev*CpWat*Mfrwev) ELSE Tev=Twev1+(Pev/(CpWat*Mfrwev))*(1-1/Effev) ENDIF C1*** Calculate the condensing temperature according to the C1*** information available Pcd=Pev+W Effcd=1-EXP(-AUcd/(CpWat*Mfrwcd)) IF ((NChoice.EQ.1).OR.(NChoice.EQ.4)) THEN Tcd=Twcd1+Pcd/(Effcd*CpWat*Mfrwcd) ELSE Tcd=Twcd1+(Pcd/(CpWat*Mfrwcd))*(1/Effcd-1) ENDIF C1*** Calculate the evaporating pressure p1=1000*EXP(Acl+Bcl/Tev) C1*** Calculate the condensing pressure p3=1000*EXP(Acl+Bcl/Tcd) C2*** Calculate the power consumed by the compressor C2*** in part-load regime IF (PLorFL.EQ.2) THEN Nc=0.5*NcFL Wpl=(0.82*(Nc/NcFL-1)+1)*W ELSE Wpl=W ENDIF C1*** Calculate the geometric displacement of the compressor Vs=Nc/NcFL*VsFL C1*** Calculate the internal power consumed by the C1*** the compressor Win=(Wpl-Losses)/(1+Alpha) C1*** Beginning of the first loop C2*** First guess of the pumping-losses Wpumping=1 10 CONTINUE C1*** Beginning of the second loop C2*** First guess of the temperature after the heating-up T1p=Tev C2*** Calculate the specific volumes after the heating-up and at point 2' 20 v1p=Zeta*r*T1p/p1 v2p=Zeta*r*T1p/p3*(p3/p1)**Gm1G C1*** Beginning of the third loop C2*** First guess of the pressure drop dpex=1 30 p2=p3+dpex C2*** Calculate the volumetric efficiency of the compressor Effvol=1+Cf-Cf*(p2/p1)**(1/Gamma) C1*** Calculate the refrigerant mass flow rate MfrRef=Effvol*Vs/v1p dpexp=dpex C2*** Recalculate the pressure drop dpex=MfrRef**2*v2p/(2*(Nc*Aex)**2) ErrRel=ABS((dpex-dpexp)/dpexp) C2*** If converged, leave the third loop IF (ErrRel.GT.TolRel) GOTO 30 C2*** Calculate the isentropic compression power Wis=MfrRef*Zeta*r*T1p*((p2/p1)**Gm1G-1)/Gm1G T1pp=T1p C1*** Recalculate the temperature after the heating-up T1p=Tev+(Losses+Alpha*Wis+(1+Alpha)*(1-Nc/NcFL)* & Wpumping)/(MfrRef*cpvap) ErrRel=ABS((T1p-T1pp)/T1pp) C2*** If converged, leave the second loop IF (ErrRel.GT.TolRel) GOTO 20 C1*** Calculate the internal power of the compressor when all the C1*** cylinders are unloaded Wpumpp=Wpumping Wpumping=(Win-Wis)/(1-Nc/NcFL) ErrRel=ABS((Wpumping-Wpumpp)/Wpumpp) C2*** If converged, leave the first loop IF (ErrRel.GT.TolRel) GOTO 10 Wpumping=Wpumpp C*** OUTPUTS 1 (converted in TRNSYS units) C************* out(1)=DBLE(Wpumping*3.6) RETURN 1 END SUBROUTINE PROPERTY (Ifluid,To,cpliq,hfo,cpvap,cpvapcd,hfgb,Tb,Tc, & b,r,Zeta,Zetacd,Gamma,Acl,Bcl,*) C************************************************************************ C* Copyright ASHRAE A Toolkit for Primary HVAC System Energy C* Calculation C*********************************************************************** C* SUBROUTINE: PROPERTY C* C* LANGUAGE: FORTRAN 77 C* C* PURPOSE: Selection of the thermodynamic properties C* of a given refrigerant. C*********************************************************************** C* INPUT VARIABLES: C* Ifluid Selection of the refrigerant (-) C* If Ifluid C* =1: Refrigerant 12 C* =2: Refrigerant 134a C* =3: Refrigerant 114 C* =4: Refrigerant 22 C* =5: Refrigerant 502 C* =6: Refrigerant 717 (Ammonia) C*********************************************************************** C* OUTPUT VARIABLES: C* To Reference temperature (K) C* cpliq Mean specific heat in saturated liquid state (J/kg/K) C* hfo Enthalpy of the saturated liquid at the (J/kg) C* reference temperature C* cpvap Mean specific heat at constant pressure (J/kg/K) C* in superheated vapor state for saturation C* temperatures ranging from 253 K to 283 K C* cpvapcd Mean specific heat at constant pressure (J/kg/K) C* in superheated vapor state for saturation C* temperatures ranging from 303 K to 333 K C* hfgb Vaporization enthalpy at standard boiling (J/kg) C* point (101325 Pa) C* Tb Standard boiling temperature (K) C* Tc Critical temperature (K) C* b Coefficient used in the calculation of the (-) C* vaporization enthalpy C* r Gas constant (J/kg/K) C* Zeta Mean compressibility factor for saturation (-) C* temperatures ranging from 253 K to 283 K C* Zetacd Mean compressibility factor for saturation (-) C* temperatures ranging from 303 K to 333 K C* Gamma Mean isentropic coefficient (-) C* Acl First coefficient in the Clausius-Clapeyron (-) C* equation C* Bcl Second coefficient in the Clausius-Clapeyron (K) C* equation C*********************************************************************** C MAJOR RESTRICTION: Perfect gas approximation is used C C DEVELOPER: Claudio Saavedra C University of Concepcion, Chile C Marc Grodent, Jean-Pascal Bourdouxhe C University of LiŠge, Belgium C C DATE: March 1, 1995 C*********************************************************************** REAL Ifluid To=233.15 IF (Ifluid.EQ.1) THEN cpliq=917 hfo=0 cpvap=641.6 cpvapcd=779 hfgb=165300 Tb=243.4 Tc=385.2 b=0.37 r=68.7539 Zeta=0.9403 Zetacd=0.8670 Gamma=1.086 Acl=14.669 Bcl=-2443.13 ENDIF IF (Ifluid.EQ.2) THEN cpliq=1265 hfo=0 cpvap=892.5 cpvapcd=1144 hfgb=215100 Tb=246.9 Tc=374.3 b=0.376 r=81.4899 Zeta=0.9411 Zetacd=0.8610 Gamma=1.072 Acl=15.489 Bcl=-2681.99 ENDIF IF (Ifluid.EQ.3) THEN cpliq=925 hfo=0 cpvap=693.6 cpvapcd=784 hfgb=136100 Tb=276.9 Tc=418.9 b=0.359 r=48.6393 Zeta=0.9757 Zetacd=0.9260 Gamma=1.056 Acl=15.107 Bcl=-2908.73 ENDIF IF (Ifluid.EQ.4) THEN cpliq=1144 hfo=0 cpvap=710.4 cpvapcd=936 hfgb=233700 Tb=232.4 Tc=369.2 b=0.369 r=96.1426 Zeta=0.9300 Zetacd=0.8440 Gamma=1.114 Acl=15.070 Bcl=-2421.94 ENDIF IF (Ifluid.EQ.5) THEN cpliq=1090 hfo=0 cpvap=732 cpvapcd=965 hfgb=172500 Tb=227.8 Tc=355.4 b=0.374 r=74.4752 Zeta=0.9130 Zetacd=0.8150 Gamma=1.065 Acl=14.809 Bcl=-2312.21 ENDIF IF (Ifluid.EQ.6) THEN cpliq=4575 hfo=0 cpvap=2447.1 cpvapcd=3159 hfgb=1372900 Tb=239.8 Tc=405.6 b=0.396 r=488.2214 Zeta=0.9570 Zetacd=0.8960 Gamma=1.230 Acl=16.204 Bcl=-2772.39 ENDIF RETURN 1 END SUBROUTINE LINKCK(ENAME1,ENAME2,ILINK,LNKTYP) C*************************************************************************** C THIS SUBROUTINE WAS WRITTEN FOR TRNSYS 14.0 LINK CHECKING - THIS ROUTINE C IS CALLED BY OTHER SUBROUTINES WHEN AN UNLINKED SUBROUTINE HAS BEEN C FOUND. LINKCK IS NEEDED IN ORDER TO AVOID PUTTING COMMON BLOCKS LUNITS C AND CONFIG IN THE TRNSYS TYPES - JWT -- 3/93 C*************************************************************************** COMMON /LUNITS/ LUR,LUW,IFORM,LUK COMMON /CONFIG/ TRNEDT,PERCOM,HEADER,PRTLAB,LNKCHK,PRUNIT,IOCHEK, 1 PRWARN COMMON /SIM/TIME0,TFINAL,DELT,IWARN CHARACTER*1 TRNEDT,PERCOM,HEADER,PRTLAB,LNKCHK,PRUNIT,IOCHEK, 1 PRWARN CHARACTER*6 ENAME1,ENAME2 INTEGER ILINK,LNKTYP C ILINK = 1 --> GENERATE AN ERROR MESSAGE AND STOP TRNSYS C ILINK = 2 --> GENERATE A WARNING BUT DON'T STOP TRNSYS C ILINK = 3 --> TRNSYS HAS FOUND AN UNLINKED TYPE - GENERATE AN ERROR AND C STOP THE PROGRAM C ILINK = 4 --> WARN THE USER THAT A ROUTINE REQUIRES AN EXTERNAL FUNCTION C ENAME1 --> CALLING PROGRAM THAT NEEDED THE UNLINKED FILE C ENAME2 --> FILE THAT WAS NOT FOUND BY ENAME1 SUBROUTINE C LNKTYP --> TYPE NUMBER THAT IS UNLINKED IF((LNKCHK.EQ.'Y').OR.(LNKCHK.EQ.'y')) THEN IF(ILINK.EQ.1) THEN WRITE(LUW,20) 104,ENAME1,ENAME2 WRITE(LUW,15) CALL MYSTOP(104) ELSE IF(ILINK.EQ.2) THEN WRITE(LUW,20) 104,ENAME1,ENAME2 IWARN=IWARN+1 ELSE IF(ILINK.EQ.3) THEN WRITE(LUW,25) 105,LNKTYP,LNKTYP WRITE(LUW,15) CALL MYSTOP(105) ELSE IF(ILINK.EQ.4) THEN WRITE(LUW,35) LNKTYP,ENAME1,ENAME2 IWARN=IWARN+1 ELSE IF(ILINK.EQ.5) THEN WRITE(LUW,40) 105,LNKTYP,LNKTYP WRITE(LUW,15) CALL MYSTOP(105) ELSE WRITE(LUW,30) ENAME1 IWARN=IWARN+1 ENDIF ENDIF 15 FORMAT(//2X,47H*** SIMULATION TERMINATED WITH ERROR STATUS ***/) 20 FORMAT(//,1X,'***** ERROR *****',8X,'TRNSYS ERROR # ',I3,/1X,A6, 1' REQUIRES THE FILE "',A6,'" WHICH WAS CALLED BUT NOT LINKED.',/1X 1,'PLEASE LINK IN THE REQUIRED FILE AND RERUN THE SIMULATION.') 25 FORMAT(//,1X,'***** ERROR *****',8X,'TRNSYS ERROR # ',I3,/1X, 1'TYPE ',I3,' WAS CALLED IN THE TRNSYS INPUT FILE BUT NOT LINKED.', 1/1X,'LINK TYPE ',I3,' BEFORE RUNNING THIS SIMULATION.') 30 FORMAT(/1X,'*****WARNING*****',/1X,'THE LINKCK SUBROUTINE WAS CALL 1ED WITH AN INVALID OPERAND.',/1X,'THE PROGRAM WHICH CALLED LINKCK 1WITH THE IMPROPER OPERAND WAS ',A6,'.',/1X,'PLEASE MAKE SURE THAT 1THE CALLING PROGRAM IS FIXED OR UNLINKED SUBROUTINES MAY ',/1X,'GO 1 UNNOTICED.') 35 FORMAT(/1X,'*****WARNING*****',/1X,'UNIT ',I2,' ',A6,' REQUIRES TH 1E SUBROUTINE ',A6,/1X,'MAKE SURE THAT THIS SUBROUTINE IS LINKED IN 1 TO AVOID PROBLEMS. IT MAY ALREADY BE LINKED IN.',/) 40 FORMAT(//,1X,'***** ERROR *****',8X,'TRNSYS ERROR # ',I3,/1X, 1'TYPE',I3,' WAS CALLED IN THE TRNSYS INPUT FILE BUT NOT LINKED.', 1/1X,'A DUMMY TYPE SUBROUTINE WAS CALLED IN ITS PLACE. PLEASE LINK' 1,/1X,'TYPE',I3,' BEFORE RUNNING THIS SIMULATION OR TURN OFF THE CH 1ECK'/1X,'FOR UNLINKED SUBROUTINES OPTION IN THE CONFIGURATION FILE 1.') RETURN END