SUBROUTINE TYPE76(TIME,XIN,OUT,T,DTDT,PAR,INFO,ICNTRL,*) C*********************************************************************** C* PROGRAM: PISCHIL1 & PISCHIL2 C* + PISCOMP1 & PISCOMP2 C* C* LANGAGE: FORTRAN 77 C* C* PURPOSE: Parameter identification based on C* reciprocating chiller performances C* in steady-state regime C* The pressure drop at the compressor C* exhaust can be taken into account. C*********************************************************************** C* INPUT VARIABLES C* XIN(1)=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(2)=N Number of available working points (-) C* XIN(3)=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* =-1: TYPE76 is used instead of PISCOMP1 or PISCOMP2 C* XIN(4)=PevG Guess of the refrigerating capacity (KJ/hr) C* If choice=-1, any value will do (not optional) C* XIN(5)=PcdG Guess of the heat rejected in the condenser (KJ/hr) C* If choice=-1, any value will do (not optional) C* XIN(6:...) Array containing (for each working point): C* -the refrigerating capacity XIN(6*I-5+5) (KJ/hr) C* -the power consumed by the compressor (KJ/hr) C* XIN(6*I-4+5) C* -XIN(6*I-3+5) C* the water mass flow rate in the evaporator (kg/hr) C* if Choice is positive; C* the superheat in the evaporator otherwise (C) C* -XIN(6*I-2+5) C* the water mass flow rate in the condenser (kg/hr) C* if Choice is positive; C* the subcooling in the condenser otherwise (C) C* -XIN(6*I-1+5) C* the evaporator supply or exhaust water (C) C* temperature according to the value of Choice C* (if Choice is positive); C* the evaporating temperature otherwise C* -XIN(6*I+5) C* the condenser supply or exhaust water temperature (C) C* according to the value of Choice C* (if Choice is positive); C* the condensing temperature otherwise C* C* OUTPUT VARIABLES C* OUT(1)=LossesId Constant part of the electromechanical (KJ/hr) C* losses C* OUT(2)=AlphaId Loss factor allowing to define another (-) C* electromechanical loss which is supposed to C* be proportional to the isentropic power C* OUT(3)=CfId Clearance factor of the compressor (-) C* OUT(4)=VsFLId Geometric displacement of the compressor (m**3/s) C* OUT(5)=SEw Dimensionless standard deviation of the linear (-) C* regression over the power consumed by C* the compressor C* OUT(6)=SEv Dimensionless standard deviation of the linear (-) C* regression over the refrigerant volume flow C* rate entering the compressor C* OUT(7)=AUevId Value of the evaporator heat transfer (KJ/hr-C) C* coefficient C* If Choice=-1, this value has no meaning C* OUT(8)=AUcdId Value of the condenser heat transfer (KJ/hr-C) C* coefficient C* If Choice=-1, this value has no meaning C* OUT(9)=CstId Ratio of the nozzle throat area of a cylinder (-) C* to the section of a cylinder C* OUT(10)=AexId Nozzle throat area of a cylinder (m**2) C* OUT(5*I-4+10)=Wisg Array containing the isentropic compression (KJ/hr) C* power calculated for each working point C* OUT(5*I-3+10)=pfactorg Array containing the value of pfactor (-) C* calculated for each working point C* OUT(5*I-2+10)=Vg Array containing the refrigerant volume (m**3/hr) C* flow rate entering the compressor C* calculated for each working point C* OUT(5*I-1+10) Array containing the refrigerant volume (m**3/hr) C* flow rate entering the compressor C* calculated for each working point by using C* the parameters of the linear regression C* OUT(5*I+10) Array containing the power consumed by the (KJ/hr) C* compressor calculated for each working point by C* using the parameters of the linear regression C* C* PARAMETERS C* PAR(1)=NcFL Number of cylinders used in full load (-) C* If the pressure drop at the compressor exhaust C* is not taken into account, NcFL MUST BE A C* NEGATIVE NUMBER (not 0). C* The following parameters are optional. Nevertheless, if AUevi,AUevf,... C* need to be specified, then PAR(2) to PAR(5) must also be defined C* (if they are not needed, their value has no importance). C* PAR(2)=Acyl Section of a cylinder (m**2) C* If the pressure drop at the compressor exhaust C* is not taken into account and Choice=-1, C* Acyl is not required C* PAR(3)=Csti Lower bound of the parameter Cst which is (-) C* the ratio of the nozzle throat area of a cylinder C* to the section of a cylinder C* If the pressure drop at the compressor exhaust C* is not taken into account and Choice=-1, C* Csti is not required C* PAR(4)=Cstf Upper bound of the parameter Cst (-) C* If the pressure drop at the compressor exhaust C* is not taken into account and Choice=-1, C* Cstf is not required C* PAR(5)=dCst Increment applied to the parameter Cst (-) C* If the pressure drop at the compressor exhaust C* is not taken into account and Choice=-1, C* dCst is not required C* PAR(6)=AUevi Lower bound of the evaporator heat transfer (KJ/hr-C) C* coefficient C* If Choice=-1, this parameter is not required C* PAR(7)=AUevf Upper bound of the evaporator heat transfer (KJ/hr-C) C* coefficient C* If Choice=-1, this parameter is not required C* PAR(8)=AUcdi Lower bound of the condenser heat transfer (KJ/hr-C) C* coefficient C* If Choice=-1, this parameter is not required C* PAR(9)=AUcdf Upper bound of the condenser heat transfer (KJ/hr-C) C* coefficient C* If Choice=-1, this parameter is not required C* PAR(10)=dAUev Increment (KJ/hr-C) C* If Choice=-1, this parameter is not required C* PAR(11)=dAUcd Increment (KJ/hr-C) C* If Choice=-1, this parameter is not required C* C* WATER PROPERTY C* CpWat Specific heat of liquid water (KJ/kg-C) C* C* REFRIGERANT PROPERTIES C* To Reference temperature (C) C* cpliq Mean specific heat in saturated liquid state (KJ/kg-C) C* hfo Enthalpy of the saturated liquid at the (KJ/kg) C* reference temperature C* cpvap Mean specific heat at constant pressure (KJ/kg-C) C* in superheated vapor state C* hfgo Enthalpy of vaporization at the reference (KJ/kg) C* temperature C* r Gas constant (KJ/kg-K) C* Zeta Mean compressibility factor (-) 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 surrouding heat exchanges are C neglected. The refrigerant leaves the C evaporator and the condenser as saturated C vapor and saturated liquid respectively. C The maximum number of working point is C equal to 82. The compression is assumed to C be isentropic. C Perfect gas properties are used. C C DEVELOPER: Jean Lebrun C (of the TOOLKIT subroutine) Jean-Pascal Bourdouxhe C Marc Grodent C University of Liege, Belgium C C DATE: October 7, 1993 C Modified for TRNSYS: July 1994-Madison C Mark Nott C C SUBROUTINES CALLED: PROPERTY C ERROR C FIT C TYPE CALLED: TYPE88 C*********************************************************************** C INTERNAL VARIABLES: C Effev Evaporator effectiveness C Effcd Condenser effectiveness C Tev Array containing the evaporating temperature (C) C calculated for each working point C Tcd Array containing the condensing temperature (C) C calculated for each working point C MfrRef Refrigerant mass flow rate calculated by (kg/hr) C the subroutine TYPE88 C Pev Refrigerating capacity calculated by the (KJ/hr) C subroutine TYPE88 C Pcomp Power consumed by the compressor calculated (KJ/hr) C by the subroutine TYPE88 C Pcd Heat rejected in the condenser calculated (KJ/hr) C by the subroutine TYPE88 C COP Coefficient of performance calculated by (-) C the subroutine TYPE88 C Twevap This value is equal to the evaporator exhaust (C) C or supply water temperature according to the value C of Choice and calculated by the subroutine TYPE88 C Twcond This value is equal to the condenser exhaust (C) C or supply water temperature according to the value C of Choice and calculated by the subroutine TYPE88 C Dc Array containing (for each working point): C -the refrigerating capacity Dc(2*I-1) (KJ/hr) C calculated by the subroutine TYPE88 C -the power consumed by the C compressor Dc(2*I) (KJ/hr) C calculated by the subroutine TYPE88 C F Function to minimize (-) C Fmin Lowest value of the function F (-) C pevap Array containing the evaporating pressure (Pa) C for each working point C pcond Array containing the condensing pressure (Pa) C for each working point C T1 Array containing the temperature at the (C) C evaporator exhaust for each working point C T1p Array containing the temperature (C) C after heating-up for each working point C h1 Enthalpy at the evaporator exhaust (KJ/kg) C T3 Array containing the temperature at the (C) C condenser exhaust for each working point C h3 Enthalpy at the condenser exhaust (KJ/kg) C p2 Pressure at point 2 (Pa) C v2p Specific volume at point 2 prime (m**3/kg) C MfrRef Array containing the refrigerant mass (kg/hr) C flow rate for each working point C Toler Relative error tolerance (-) C ErrRel Relative error (-) C C T1pp is a variable used in the iterative scheme C SEw1,T1p1,AlphaId,LossesId,CstId and AexId are storage variables C Sum1 and Sum2 are variables used in the calculation of the C function to minimize C Id,pfactorg,Vg and Wisg are storage arrays C*********************************************************************** REAL N,NcFL REAL*8 LossesId INTEGER Ifluid DIMENSION Dc(164),Te(82),Tc(82), & pfactor(82),V(82),Wis(82),pfactorg(82), & Vg(82),Wisg(82),YP(82),PHI(2),PHIP(2) DIMENSION pevap(82),pcond(82),T1(82), & T3(82),T1p(82),T1p1(82) REAL MfrRef(82) REAL X(2,82),XP(2,82) REAL Id(9) INTEGER*4 INFO DIMENSION PAR(11), XIN(497), OUT(420),INFO(15) DIMENSION PARA(7), XINA(10), OUTA(7) DOUBLE PRECISION XIN,OUT,XINA,OUTA COMMON /STORE/ NSTORE, IAV, S(5000) COMMON /LUNITS/ LUR, LUW, IFORM, LUK COMMON /SYSTEM/ COMP COMMON /SIM/ TIMEO,TFINAL,DELT,IWARN COMMON /CONFIG/ TRNEDT,PERCOM,HEADER,PRTLAB,LNKCHK,PRUNIT,IOCHEK, . PRWARN DATA Toler,NCOEF/1E-5,2/ C PARAMETERS NcFL = PAR(1) Acyl = PAR(2) Csti = PAR(3) Cstf = PAR(4) dCst = PAR(5) AUevi = PAR(6) AUevf = PAR(7) AUcdi = PAR(8) AUcdf = PAR(9) dAUev = PAR(10) dAUcd = PAR(11) C INPUTS Ifluid = INT(XIN(1)+0.1) N = XIN(2) Choice = XIN(3) PevG = XIN(4) PcdG = XIN(5) INFO(6) = 420 CpWat = 4.187 Nb=INT(N) IF (Choice.EQ.-1) THEN AUevi=0 AUevf=0 dAUev=1 AUcdi=0 AUcdf=0 dAUcd=1 ENDIF Fmin=999E25 Nev=INT((AUevf-AUevi)/dAUev+1) Ncd=INT((AUcdf-AUcdi)/dAUcd+1) C For each value of the evaporator heat transfer coefficient C we calculate: AUevId=AUevi DO 30 J=1,Nev C For each value of the condenser heat transfer coefficient C we calculate: AUcdId=AUcdi DO 40 K=1,Ncd C For each working point we calculate: DO 50 L=1,Nb IF (Choice.GT.0) THEN C Calculate the evaporator and condenser effectiveness Effev=1-EXP(-AUevId/(CpWat*XIN(6*L-3+5))) Effcd=1-EXP(-AUcdId/(CpWat*XIN(6*L-2+5))) C Calculate the evaporating and condensing temperature according C to the value of Choice NChoice=INT(Choice) GOTO (53,54,55,56),NChoice C Twsuev and Twsucd are known 53 Te(L)=XIN(6*L-1+5)-XIN(6*L-5+5)/ & (Effev*CpWat*XIN(6*L-3+5)) Tc(L)=XIN(6*L+5)+(XIN(6*L-5+5)+XIN(6*L-4+5)) & /(Effcd*CpWat*XIN(6*L-2+5)) GOTO 57 C Twsuev and Twexcd are known 54 Te(L)=XIN(6*L-1+5)-XIN(6*L-5+5)/ & (Effev*CpWat*XIN(6*L-3+5)) Tc(L)=XIN(6*L+5)+(XIN(6*L-5+5)+XIN(6*L-4+5))* & (1/Effcd-1)/(CpWat*XIN(6*L-2+5)) GOTO 57 C Twexev and Twexcd are known 55 Te(L)=XIN(6*L-1+5)+XIN(6*L-5+5)*(1-1/Effev)/ & (CpWat*XIN(6*L-3+5)) Tc(L)=XIN(6*L+5)+(XIN(6*L-5+5)+XIN(6*L-4+5))* & (1/Effcd-1)/(CpWat*XIN(6*L-2+5)) GOTO 57 C Twexev and Twsucd are known 56 Te(L)=XIN(6*L-1+5)+XIN(6*L-5+5)*(1-1/Effev)/(CpWat* & XIN(6*L-3+5)) Tc(L)=XIN(6*L+5)+(XIN(6*L-5+5)+XIN(6*L-4+5))/(Effcd* & CpWat*XIN(6*L-2+5)) 57 CONTINUE ELSE Te(L)=XIN(6*L-1+5) Tc(L)=XIN(6*L+5) ENDIF 50 CONTINUE C Calculate the compressor parameters associated with the C values of the heat transfer coefficients C Selection of the refrigerant CALL PROPERTY(Ifluid,To,cpliq,hfo,cpvap,hfgo,r,Zeta, & Gamma,Acl,Bcl,*500) 500 CONTINUE Gm1G=(Gamma-1)/Gamma IF (NcFL.LE.0) THEN Csti=0 Cstf=0 dCst=1 Acyl=1 ENDIF C For each working point we calculate: DO 20 I=1,Nb C Calculate the evaporating and the condensing pressures pevap(I)=1000*EXP(Acl+Bcl/(Te(I)+To)) pcond(I)=1000*EXP(Acl+Bcl/(Tc(I)+To)) C Calculate the temperature at the evaporator and C condenser exhaust IF (Choice.GT.0) THEN T1(I)=Te(I) T3(I)=Tc(I) ELSE T1(I)=Te(I)+XIN(6*I-3+5) T3(I)=Tc(I)-XIN(6*I-2+5) ENDIF C Calculate the enthalpy at the evaporator and C condenser exhaust h1=hfo+hfgo+cpvap*T1(I) h3=hfo+cpliq*T3(I) C Calculate the refrigerant mass flow rate MfrRef(I)=XIN(6*I-5+5)/(h1-h3) 20 CONTINUE Sew1=1E12 Jp=INT((Cstf-Csti)/dCst+1) C For each possible value of the parameter Cst we calculate DO 25 Lp=1,Jp Cst=Csti+FLOAT(Lp-1)*dCst C Calculate the nozzle throat area of a cylinder Aex=Cst*Acyl DO 41 I=1,Nb C Beginning of the loop C First guess of the temperature after heating-up T1p(I)=T1(I) 51 IF (NcFL.GT.0) THEN C Calculate the specific volume at point 2 prime rest=(pcond(I)/pevap(I))**Gm1G v2p=rest*Zeta*r*1000*(T1p(I)+To)/pcond(I) C Calculate the pressure at point 2 p2=pcond(I)+(MfrRef(I)/3600)**2*v2p/(2*(NcFL*Aex)**2) ELSE p2=pcond(I) ENDIF C Calculate the isentropic compression power part=MfrRef(I)*Zeta*r Wis(I)=part*(T1p(I)+To)*1/Gm1G*((p2/pevap(I))**Gm1G-1) T1pp=T1p(I) C Recalculate the temperature after heating-up T1p(I)=T1(I)+(XIN(6*I-4+5)-Wis(I))/(MfrRef(I)*cpvap) ErrRel=ABS((T1p(I)-T1pp)/T1pp) C If converged ,leave loop IF (ErrRel.GT.Toler) GOTO 51 C Up-to-date the variables used in the linear regression C over the power consumed by the compressor XP(1,I)=1.0 XP(2,I)=Wis(I) YP(I)=XIN(6*I-4+5) 41 CONTINUE C Calculate the parameters Alpha and Losses of the compressor CALL FIT(NCOEF,Nb,NCOEF,Nb,XP,YP,PHIP,IFLAG,*240) 240 CONTINUE Alpha=PHIP(2)-1 Losses=PHIP(1) C Calculate the dimensionless standard deviation of the linear C regression over the power consumed by the compressor Slope=PHIP(2) CALL ERROR(N,Wis,YP,Slope,SEw,*250) 250 CONTINUE C IF SEw is lower than the smallest value found so far THEN C store the value of the variables associated with the value C of Cst considered IF (SEw.LT.SEw1) THEN C Storage of the dimensionless standard deviation SEw1=SEw C Storage of the temperature after heating-up for each C working point DO 61 Kp=1,Nb T1p1(Kp)=T1p(Kp) 61 CONTINUE C Storage of the parameters Alpha,Losses,Cst and Aex C of the compressor AlphaId=Alpha LossesId=Losses CstId=Cst AexId=Aex ENDIF 25 CONTINUE C For each working point we calculate: DO 71 I=1,Nb C Calculate the refrigerant volume flow rate entering the C compressor associated with the optimal value of Cst C *1000 so that in m**3/hr V(I)=MfrRef(I)*Zeta*r*1000*(T1p1(I)+To)/pevap(I) IF (NcFL.GT.0) THEN rest=(pcond(I)/pevap(I))**Gm1G v2p=rest*Zeta*r*1000*(T1p1(I)+To)/pcond(I) p2=pcond(I)+(MfrRef(I)/3600)**2*v2p/(2*(NcFL*AexId)**2) ELSE p2=pcond(I) ENDIF C Calculate the value of pfactor associated with the optimal C value of Cst pfactor(I)=(p2/pevap(I))**(1/Gamma)-1 C Calculate the isentropic compression power associated with C the optimal value of Cst part=MfrRef(I)*Zeta*r*(T1p1(I)+To) Wis(I)=part*((p2/pevap(I))**Gm1G-1)/Gm1G C Up-to-date the variables used in the linear regression over C the refrigerant volume flow rate entering the compressor X(1,I)=1.0 X(2,I)=pfactor(I) 71 CONTINUE C Calculate the two last parameters CfId and VsFLId of the compressor CALL FIT(NCOEF,Nb,NCOEF,Nb,X,V,PHI,IFLAG,*271) 271 CONTINUE C /3600 so that in m**3/s VsFLId=PHI(1)/3600 CfId=-PHI(2)/PHI(1) Sew=Sew1 IF (Choice.GT.0) THEN C For each working point, call TYPE88 in order to C calculate the refrigerating capacity and the power consumed C by the compressor C (if Choice is greater than 0) DO 70 L=1,Nb PARA(1)=AUevId PARA(2)=AUcdId PARA(3)=LossesId PARA(4)=AlphaId PARA(5)=CfId PARA(6)=VsFLId IF (NcFL.GT.0) THEN PARA(7)=AexId ENDIF XINA(1)=Ifluid XINA(2)=XIN(6*L-3+5) XINA(3)=XIN(6*L-2+5) XINA(4)=Choice XINA(5)=XIN(6*L-1+5) XINA(6)=XIN(6*L+5) XINA(7)=PevG XINA(8)=PcdG XINA(9)=NcFL XINA(10)=NcFL CALL TYPE88(TIME,XINA,OUTA,T,DTDT,PARA,INFO,ICNTRL,*600) 600 CONTINUE Dc(2*L-1) = OUTA(2) Dc(2*L) = OUTA(3) 70 CONTINUE C Initialization of the variables used in the calculation of C the function to minimize Sum1=0 Sum2=0 DO 80 L=1,Nb C Up-to-date of the variables used in the calculation of C the function to minimize Sum1=Sum1+((XIN(6*L-5+5)-Dc(2*L-1))/XIN(6*L-5+5))**2 Sum2=Sum2+((XIN(6*L-4+5)-Dc(2*L))/XIN(6*L-4+5))**2 80 CONTINUE ELSE Sum1=0 Sum2=0 ENDIF C Calculate the value of the function to minimize F=Sum1+Sum2 C IF F is lower than the smallest value found so far THEN store C the value of the variables associated with the two heat C transfer coefficients considered IF (F.LT.Fmin) THEN C Storage of the value of the function to minimize Fmin=F C Storage of the chiller parameters Id(1)=AUevId Id(2)=AUcdId Id(3)=LossesId Id(4)=AlphaId Id(5)=VsFLId Id(6)=CfId Id(7)=CstId Id(8)=AexId Id(9)=Sew C For each working point, storage of the value of pfactor, of the C refrigerant volume flow rate entering the compressor and of the C isentropic compression power DO 90 L=1,Nb pfactorg(L)=pfactor(L) Vg(L)=V(L) Wisg(L)=Wis(L) 90 CONTINUE ENDIF C Caculate a new value of the condenser heat transfer coefficient AUcdId=AUcdId+dAUcd 40 CONTINUE C Calculate a new value of the evaporator heat transfer coefficient AUevId=AUevId+dAUev 30 CONTINUE C Calculate the dimensionless standard deviation of the C linear regression over the refrigerant volume flow rate C entering the compressor Slope=-Id(5)*Id(6)*3600 CALL ERROR(N,pfactorg,Vg,Slope,SEv,*100) 100 CONTINUE C The values of the output variables AUevId=Id(1) AUcdId=Id(2) LossesId=Id(3) AlphaId=Id(4) VsFLId=Id(5) CfId=Id(6) CstId=Id(7) AexId=Id(8) SEw=Id(9) C OUTPUT OUT(1) = LossesId OUT(2) = AlphaId OUT(3) = CfId OUT(4) = VsFLId OUT(5) = SEw OUT(6) = SEv OUT(7) = AUevId OUT(8) = AUcdId OUT(9) = CstId OUT(10)= AexId DO 110 K=1,Nb OUT(5*K-4+10) = Wisg(K) OUT(5*K-3+10) = pfactorg(K) OUT(5*K-2+10) = Vg(K) OUT(5*K-1+10) = pfactorg(K)*(-CfId*VsFLId*3600)+VsFLId*3600 OUT(5*K+10) = Wisg(K)*(1+AlphaId)+LossesId 110 CONTINUE RETURN 1 END SUBROUTINE PROPERTY(Ifluid,To,cpliq,hfo,cpvap,hfgo,r,Zeta, & Gamma,Acl,Bcl,*) 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 (KJ/kg-C) C* hfo Enthalpy of the saturated liquid at the (KJ/kg) C* reference temperature C* cpvap Mean specific heat at constant pressure (KJ/kg-C) C* in superheated vapor state C* hfgo Enthalpy of vaporization at the reference (KJ/kg) C* temperature C* r Gas constan (KJ/kg-K) C* Zeta Mean compressibility factor (-) 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 (of the TOOLKIT subroutine) University of Concepcion, Chile C Marc Grodent C University of Liege, Belgium C C DATE: February 24, 1993 C Modified for TRNSYS: July 1994-Madison C Mark Nott C*********************************************************************** INTEGER Ifluid To=273.15 IF (Ifluid.EQ.1) THEN cpliq = 0.917 hfo = 200.00 hfgo = 152.440 r = 0.0687539 Zeta = 0.9403 Gamma = 1.086 Acl = 14.669 Bcl = -2443.13 cpvap = 0.6416 ENDIF IF (Ifluid.EQ.2) THEN cpliq = 1.265 hfo = 200.00 hfgo = 197.900 r = 0.0814899 Zeta = 0.9411 Gamma = 1.072 Acl = 15.489 Bcl = -2681.99 cpvap = 0.8925 ENDIF IF (Ifluid.EQ.3) THEN cpliq = 925 hfo = 200.00 hfgo = 133.100 r = 0.0486393 Zeta = 0.9757 Gamma = 1.056 Acl = 15.107 Bcl = -2908.73 cpvap = 0.6936 ENDIF IF (Ifluid.EQ.4) THEN cpliq = 1.144 hfo = 200.00 hfgo = 204.590 r = 0.0961426 Zeta = 0.9300 Gamma = 1.114 Acl = 15.070 Bcl = -2421.94 cpvap = 0.7104 ENDIF IF (Ifluid.EQ.5) THEN cpliq = 1.090 hfo = 200.00 hfgo = 146.630 r = 0.0744752 Zeta = 0.9130 Gamma = 1.065 Acl = 14.809 Bcl = -2312.21 cpvap = 0.732 ENDIF IF (Ifluid.EQ.6) THEN cpliq = 4.575 hfo = -762.750 hfgo = 1261.930 r = 0.4882214 Zeta = 0.9570 Gamma = 1.230 Acl = 16.204 Bcl = -2772.39 cpvap = 2.4471 ENDIF RETURN 1 END SUBROUTINE ERROR(N,X,Y,Slope,ASyx,*) C*********************************************************************** C* SUBROUTINE: ERROR C* C* LANGAGE: FORTRAN 77 C* C* PURPOSE: Calculation of the dimensionless standard C* deviation of the linear regressions C*********************************************************************** C* INPUT VARIABLES C* N Number of available working points (-) C* X Array containing either the isentropic (KJ/hr) or (-) C* compression power or the value of pfactor C* for each working point C* Y Array containing either the power (KJ/hr) or (m**3/hr) C* consumed by the compressor or the C* refrigerant volume flow rate entering the C* compressor for each working point C* Slope Slope of the straight line (-) or (m**3/hr) C* C* OUTPUT VARIABLE C* ASyx Dimensionless standard deviation of the (-) C* linear regression C*********************************************************************** C MAJOR RESTRICTION: The maximum number of working points C is equal to 83. C C DEVELOPER: Jean-Pascal Bourdouxhe C (of the TOOLKIT subroutine) Marc Grodent C University of Liege, Belgium C C DATE: March 09,1993 C Modified for TRNSYS: July 1994-Madison C Mark Nott C*********************************************************************** C INTERNAL VARIABLES C MeanX Mean value of either the isentropic (KJ/hr) or (-) C compression power or the pfactor C MeanY Mean value of either the power (KJ/hr) or (m**3/hr) C consumed by the compressor or the C refrigerant volume flow rate entering C the compressor C C SumX and SumY are variables used to calculate these mean values C Xsq,Ysq and rsq are secondary variables used in the routine C*********************************************************************** REAL N,MeanX,MeanY DIMENSION X(83),Y(83) Nb=INT(N) SumX=0 SumY=0 DO 10 I=1,Nb SumX=SumX+X(I) SumY=SumY+Y(I) 10 CONTINUE C Calculate the mean value of either the isentropic compression C power or the pfactor MeanX=SumX/N C Calculate the mean value of either the power consumed by the C compressor or the refrigerant volume flow rate entering the C compressor MeanY=SumY/N Xsq=0 Ysq=0 DO 20 I=1,Nb Xsq=Xsq+(X(I)-MeanX)**2 Ysq=Ysq+(Y(I)-MeanY)**2 20 CONTINUE rsq=Slope**2*Xsq/Ysq C Calculate the standard deviation of the linear regression Syx=SQRT((1-rsq)*Ysq/(N-2)) C Calculate the dimensionless standard deviation of the C linear regression ASyx=Syx/MeanY RETURN 1 END