! This component has been assigned Type Number 208. If that number conflicts with ! another user Type number, you will need to change it and recompile the appropriate ! dll. subroutine TYPE208(time,xin,out,t,dtdt,par,info,icntrl,*) !DEC$ATTRIBUTES DLLEXPORT :: TYPE208 c************************************************************************ c* * c* This TRNSYS type is a flow controller that calculates the * c* percentage of flow that should pass through the A/C coil in * c* order to minimize the sensible reheat in the system. The A/C * c* coil outlet temperature is constrained to above 38 F so that * c* frosting of the coil is not encountered. * c* * c* ---Todd B. Jekel 12-4-90 * c* * c* * c* * c* PARAMETERS 2 * c* Mode * c* 1 Optimal controller * c* Convergence tolerance * c* 2 Set A/C temperature * c* Temperature * c* * c* INPUTS 7 * c* Load [Btu/hr] * c* SHR [sensible load/total load] * c* mf_tot [lbm/hr] * c* T_set [F] * c* w_set [lbm H2O/lbm air] * c* h_set [Btu/lbm] * c* frn_vent [mf_vent/mf_tot] * c* * c* OUTPUTS 1 * c* x [mf_ac/mf_tot] * c* T_sat [F] * c* * c************************************************************************ C C SAMPLE INPUT AND OUTPUT VALUES C C PARAMETERS SAMPLE VALUES C PAR(1) MODE 2 C PAR(2) T_ACO 48.0 C C INPUTS C XIN(1) LOAD 170000.0 C XIN(2) SHR 0.5 C XIN(3) MF_TOT 68000.0 C XIN(4) T_SET 72.0 C XIN(5) W_SET 0.00834 C XIN(6) H_SET 30.0 C XIN(7) FRN_VENT 0.15 C C OUTPUTS C OUT(1) X 0.9235 C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC implicit none real dh_load !c Total enthalpy change of the c load [Btu/lbm] real dwdT_s !c Derivative of saturation c humidity ratio wrt saturation c temperature real f !c New estimate of T_sat as given c by Newtons method real frn_vent !c Fraction of ventilation mass flow real h_s !c Curve fit for saturation enthalpy real Load !c Total load on space [Btu/hr] real mode !c Set A/C temperature or optimum real mf_tot !c Total mass flow rate of c air through system [lbm/hr] real SHR !c Sensible Heat Ratio of c space load real T_aco !c Desired outlet A/C coil temp. real T_sat,w_sat,h_sat !c Saturation temperature, c humidity ratio, and c enthalpy (assumed A/C c outlet state real T_set,w_set,h_set !c Set-point temperature, c humidity ratio, and c enthalpy real tol !c Convergence tolerance real x1 !c Fraction of flow that meets the c sensible portion in mode 2 real x2 !c Fraction of flow that meets the c latent portion in mode 2 real x !c Fraction of total mass c flow of system that should c flow through the A/C coil real w_s !c Curve fit for saturation c humidity ratio as a function c of saturation temperature c NOTE: Time has no effect on the output of this controller, only the c inputs effect the outputs. real time,xin,out,t,dtdt,icntrl,par integer info dimension xin(7),out(2),info(15),par(2) c -----Curve fits for saturation humidity ratio, enthalpy, and the c derivative of saturation humidity ratio wrt saturation temperature w_s(T_sat) = 1.E-4*(1.2626+1.1614*T_sat-1.393E-2*T_sat**2+ & 4.1348E-4*T_sat**3) dwdT_s(T_sat) = 1.E-4*(1.1614-2.*1.393E-2*T_sat+3.*4.1348E-4* & T_sat**2) h_s(T_sat) = -2.8065+0.55408*T_sat-0.00549*T_sat**2+7.28738E-5* & T_sat**3 ! Set the version information for TRNSYS IF (INFO(7).EQ.-2) THEN INFO(12) = 15 RETURN 1 ENDIF c Set TRNSYS inputs to subroutine nomenclature mode = nint(par(1)) if (par(1) .eq. 1) then tol = par(2) else T_aco = par(2) end if Load = xin(1) SHR = xin(2) mf_tot = xin(3) T_set = xin(4) w_set = xin(5) h_set = xin(6) frn_vent = xin(7) c On first call to type do usual TRNSYS checking if (info(7) .eq. -1) then call typeck(1,info,7,2,0) info(6) = 2 !c two output info(9) = 0 !c output depends only on c inputs, not time end if c Determine the "length" of the load line dh_load = Load/mf_tot c Initial guess for saturated state (assumed A/C outlet state) T_sat = 50. w_sat = w_s(T_sat) if (par(1) .eq. 1) then 100 f = T_sat-(1./SHR-1.-1061.*(w_set-w_sat)/(0.24*(T_set-T_sat)))/ & (-1061.*(-dwdT_s(T_sat)*(T_set-T_sat)+(w_set-w_sat))/(0.24* & (T_set-T_sat)**2)) if (abs(f-T_sat) .gt. tol) then T_sat = f w_sat = w_s(T_sat) goto 100 else c Due to defrost constraints the exiting temperature from the A/C c should not be less than 38 F. if (T_sat .lt. 38.) then T_sat = 38. w_sat = w_s(T_sat) c Determine the fraction through the A/C coil such that the latent c portion of the load is met. The sensible portion will be more than c met and reheat will be needed in order to keep the space at the c desired set-point. x = ((1.-SHR)*dh_load/1061.)/(w_set-w_sat) else h_sat = h_s(T_sat) c Determine the fraction through the A/C coil such that both the c latent and sensible load are exactly met. No reheat is required; c therefore, the A/C coil load is minimized. x = dh_load/(h_set-h_sat) end if end if else T_sat = T_aco x1 = (SHR*dh_load/0.24)/(T_set-T_sat) w_sat = w_s(T_sat) x2 = ((1.-SHR)*dh_load/1061.)/(w_set-w_sat) x = max(x1,x2) end if if (x .gt. 1.) then x = 1. end if if (x .lt. frn_vent) then x = frn_vent end if c Set the fraction, x, to the TRNSYS output variable out(1) = x out(2) = T_sat return 1 end