SUBROUTINE TYPE61 (TIME,XIN,OUT,T,DTDT,PAR,INFO,ICNTRL,*) C*********************************************************************** C* Copyright ASHRAE. Toolkit for HVAC System Energy Calculations C*********************************************************************** C* SUBROUTINE: VLVPDET (COMPONENT 1212) C* C* LANGUAGE: FORTRAN 77 C* C* PURPOSE: Calculates the performance of a valve or C* damper. Outlet pressure is determined as C* a function of inlet pressure, flow rate, C* and valve position. C*********************************************************************** C* INPUT VARIABLES DESCRIPTION(UNITS) SAMPLE VALUES C* XIN(1) M Mass flow rate through valve(kg/s) 2.71 C* XIN(2) PEnt Pressure of fluid entering valve(Pa) 103425.0 C* XIN(3) Pos Valve position (0=closed,1=open)(-) .50 C* C* OUTPUT VARIABLES: C* OUT(1) PLvg Pressure of fluid leaving valve(Pa) 21951.0 C* OUT(2) ErrStat Error status indicator, 0 = ok, 1 = error(-) 0.0 C* C* PARAMETERS C* PAR(1) ResOpen Flow resistance coefficient at full open(1/kgm) 2779.0 C* PAR(2) WtFactor Weighting factor for valve characteristic(-) 1.0 C* WtFactor = 0 : exponential characteristic C* WtFactor = 1 : linear characteristic C* 0 < WtFactor < 1 : intermediate characteristic C* PAR(3) LeakPar Leakage parameter, ratio of flow through(-) .001 C* closed valve to flow through open valve C* at fixed pressure differential C*********************************************************************** C MAJOR RESTRICTIONS: Pressure drop proportional to square of C flow rate. C C DEVELOPER: Shauna Gabel C Michael J. Brandemuehl, PhD, PE C University of Colorado at Boulder C C DATE: January 1, 1992 C C INCLUDE FILES: vlv.inc C SUBROUTINES CALLED: None C FUNCTIONS CALLED: None C C REVISION HISTORY: None C C REFERENCE: Clark, D.R. 1985. HVACSIM+ building C systems and equipment simulation program: C Reference Manual. NBSIR 84-2996, National C Institute of Standards and Technology, C Washingtion, D.C. C*********************************************************************** C INTERNAL VARIABLES: C rlinear Characterizes linear resistance (1/kg m) C rExp Characterizes exponential resistance (1/kg m) C resistCoef Flow resistance coefficient relating (1/kg m) C flow to pressure drop C deltaP Pressure drop across the valve (Pa) C small Small number used in place of zero C*********************************************************************** DOUBLE PRECISION XIN, OUT INTEGER ErrStat, INFO, IOPT, NI, NP, ND,LEAKPAR,SMALL REAL leak, PAR DIMENSION XIN(3),OUT(2),PAR(3), INFO(15) CHARACTER*3 YCHECK(3), OCHECK(2) DATA small/1.E-6/ DATA YCHECK/'MF2','PR3','DM1'/ DATA OCHECK/'PR3','DM1'/ ErrStat = 0 IOPT = -1 NI = 3 !NUMBER OF CORRECT INPUTS NP = 3 !NUMBER OF CORRECT PARAMETERS ND = 0 !NUMBER OF CORRECT DERIVATIVES M = XIN(1) PENT = XIN(2) POS = XIN(3) RESOPEN = PAR(1) WTFACTOR = PAR(2) LEAKPAR = PAR(3) IF (INFO(7).EQ.-1) THEN CALL TYPECK(IOPT,INFO,NI,NP,ND) C CHECKS TO SEE IF THE USER'S INFO MATCHES THE CORRECT NUMBERS CALL RCHECK(INFO,YCHECK,OCHECK) C CHECKS TO SEE IF THE INPUT AND OUTPUT UNIT MATCH ENDIF C2*** Check to ensure non-zero leakage parameter leak = MAX ( LeakPar,small) C1*** Calculate the flow resistance coefficient as the weighted average C1*** of linear and exponential valves. rLinear = 1./(((1-leak)*Pos+leak)**2) rExp = leak**(2*(1-Pos)) resistCoef = ResOpen*(WtFactor*rLinear+(1-WtFactor)*rExp) C1*** Calculate the pressure drop across the valve. C2*** M*ABS(M) allows negative deltaP for negative M. deltaP = resistCoef*M*ABS(M) C1*** Calculate the outlet pressure. PLvg = PEnt-deltaP OUT(1) = PLVG OUT(2) = ERRSTAT RETURN 1 END