SUBROUTINE TYPE54(TIME,XIN,OUT,T,DTDT,PAR,INFO,ICNTRL,*) C*********************************************************************** C* Copyright ASHRAE. Toolkit for HVAC System Energy Calculations C*********************************************************************** C* SUBROUTINE: MIXOSIM C* C* LANGUAGE: FORTRAN 77 C* C* PURPOSE: To calculate the leaving temperature C* and mass flow rate of two mixed streams C* by simple conservation. C*********************************************************************** C* INPUT VARIABLES DESCRIPTION(UNITS) SAMPLE VALUES C* XIN(1) M1Ent Mass flow rate of stream 1(kg/s) 2.0 C* XIN(2) T1Ent Entering temperature of stream 1(C) 1.67 C* XIN(3) M2Ent Mass flow rate of stream 2(kg/s) 1.65 C* XIN(4) T2Ent Entering temperature of stream 2(C) 23.89 C* C* OUTPUT VARIABLES C* OUT(1) MLvg Mass flow rate of mixed stream(kg/s) 3.65 C* OUT(2) TLvg Temperature of mixed stream(C) 11.7147 C* OUT(3) ErrStat Error flag (0=ok, 1=error)(-) 0.0 C*********************************************************************** C MAJOR RESTRICTION: Specific heats equal for two streams. 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: None C SUBROUTINES CALLED: None C FUNCTIONS REQUIRED: None C C REVISION HISTORY: None C C REFERENCE: None C*********************************************************************** C* INTERNAL VARIABLES C* small Small number used in place of zero C*********************************************************************** INTEGER ErrStat, IOPT, NI, NP, ND DOUBLE PRECISION XIN, OUT DIMENSION XIN(4),OUT(3) CHARACTER*3 YCHECK(4), OCHECK(3) DATA small/1.E-9/ DATA YCHECK/'MF2','TE1','MF2','TE1'/ DATA OCHECK/'MF2','TE1','DM1'/ M1ENT = XIN(1) T1ENT = XIN(2) M2ENT = XIN(3) T2ENT = XIN(4) ErrStat = 0 IOPT = -1 NI = 4 !CORRECT NUMBER OF INPUTS NP = 0 !CORRECT NUMBER OF PARAMETERS ND = 0 !CORRECT NUMBER OF DERIVATIVES 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 NUMBER CALL RCHECK(INFO,YCHECK,OCHECK) C CHECKS TO SEE IN THE INPUT AND OUTPUT UNITS MATCH ENDIF C1*** Calculate the mass flow rate of the mixed stream. MLvg = M1Ent+M2Ent C1*** If leaving flow is zero, set leaving conditions to those of C1 steam 1 and RETURN. IF (ABS(MLvg) .LE. small) THEN TLvg = T1Ent ELSE C1*** Leaving flow is not zero. C1*** Calculate the temperature of the mixed stream. TLvg = (M1Ent*T1Ent+M2Ent*T2Ent)/MLvg ENDIF OUT(1) = MLVG OUT(2) = TLVG OUT(3) = ERRSTAT RETURN 1 END