SUBROUTINE TYPE75 (TIME,XIN,OUT,T,DTDT,PAR,INFO,ICNTRL,*) C*********************************************************************** C* Copyright ASHRAE. Toolkit for HVAC System Energy Calculations C* UPDATED FOR THE TRNSYS-LIBARY BY RUEDIGER SCHWARZ AND NATE BLAIR C*********************************************************************`** C* SUBROUTINE: MIXOAIR C* C* LANGUAGE: FORTRAN 77 C* C* PURPOSE: Calculate the leaving temperature, C* humidity ratio and mass flow rate of two C* mixed air streams by simple conservation. C*********************************************************************** C* INPUT VARIABLES DESCRIPTION(UNITS) SAMPLE VALUES C* XIN(1) M1Ent Dry air mass flow rate of stream 1 (kg/s) 2.0000000 C* XIN(2) T1Ent Entering temperature of stream 1 (C) 1.6700000 C* XIN(3) W1Ent Entering humidity ratio of stream 1 (-) .0017 C* XIN(4) M2Ent Dry air mass flow rate of stream 2 (kg/s) 1.65 C* XIN(5) T2Ent Entering temperature of stream 2 (C) 23.89 C* XIN(6) W2Ent Entering humidity ratio of stream 2 (-) .0092 C* C* OUTPUT VARIABLES C* OUT(1) MLvg Dry air mass flow rate of mixed stream (kg/s) 3.65 C* OUT(2) TLvg Temperature of mixed stream (C) 11.7881 C* OUT(3) WLvg Humidity ratio of mixed stream (C) .00509 C* OUT(4) ErrStat Error flag (0=ok, 1=error) (-) (-) C*********************************************************************** C MAJOR RESTRICTION: None C C DEVELOPER: Shauna Gabel, MS 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 C FUNCTIONS REQUIRED: ENTHALPY C DRYBULB 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 DIMENSION XIN(6),OUT(3), INFO(15) DOUBLE PRECISION XIN, OUT CHARACTER*3 YCHECK(6), OCHECK(3) DATA small/1.E-9/,CPAIR/1006.0/,CPVAP/1805.5/,HFG/2501000.0/ DATA YCHECK/'MF2','TE1','DM1','MF2','TE1','DM1'/ DATA OCHECK/'MF2','TE1','TE1'/ M1Ent=XIN(1) T1Ent=XIN(2) W1Ent=XIN(3) M2Ent=XIN(4) T2Ent=XIN(5) W2Ent=XIN(6) ErrStat = 0 IOPT = -1 NI = 6 !NUMBER OF CORRECT INPUTS NP = 0 !NUMBER OF CORRECT PARAMTERS ND = 0 !NUMBER OF CORRECT 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 IF 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 stream 1 and RETURN. IF (ABS(MLvg) .LE. small) THEN WLvg = W1Ent TLvg = T1Ent ELSE C1*** Leaving flow is not zero. Proceed with calculations. C1*** Calculate the humidity ratio of the mixed stream WLvg = (M1Ent*W1Ent+M2Ent*W2Ent)/MLvg C1*** Calculate the mixed stream temperature from enthalpy and humidity h1Ent = ENTHALPY(CPAIR,CPVAP,HFG,T1Ent,W1Ent) h2Ent = ENTHALPY(CPAIR,CPVAP,HFG,T2Ent,W2Ent) hLvg = (M1Ent*h1Ent+M2Ent*h2Ent)/MLvg TLvg = DRYBULB(CPAIR,CPVAP,HFG,hLvg,WLvg) ENDIF OUT(1)=MLVG OUT(2)=TLVG OUT(3)=WLVG RETURN 1 END REAL FUNCTION DRYBULB (CPAIR,CPVAP,HFG,H,W) C*********************************************************************** C* Copyright ASHRAE. Toolkit for HVAC System Energy Calculations C*********************************************************************** C* FUNCTION: DRYBULB C* C* LANGUAGE: FORTRAN 77 C* C* PURPOSE: Calculate the dry bulb temperature of C* moist air from enthalpy and humidity. C*********************************************************************** C* INPUT VARIABLES: C* H Enthalpy (J/kg) C* W Humidity ratio (-) C* C* OUTPUT VARIABLES: C* Drybulb Dry bulb temperature (C) C* C* PROPERTIES: C* CpAir Specific heat of air (J/kg C) C* CpVap Specific heat of water vapor (J/kg C) C* Hfg Reference heat of vaporization of water (J/kg) C*********************************************************************** C MAJOR RESTRICTIONS: Uses perfect gas relationships C Fit for enthalpy of saturated water vapor 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: PROP.INC C SUBROUTINES CALLED: None C FUNCTIONS CALLED: None C C REVISION HISTORY: None C C REFERENCE: 1989 ASHRAE Handbook - Fundamentals C*********************************************************************** C*$INCLUDE: 'prop.inc' C1*** Calculate the dry bulb temperature as a function of enthalpy and C1*** humidity ratio. C2*** hDryAir = Prop(CpAir)*TDB C2*** hSatVap = Prop(Hfg) + Prop(CpVap)*TDB C2*** Enthalpy = hDryAir + W*hSatVap Drybulb = (H-Hfg*W)/(CpAir+CpVap*W) RETURN END REAL FUNCTION ENTHALPY (CPAIR,CPVAP,HFG,TDB,W) C*********************************************************************** C* Copyright ASHRAE. Toolkit for HVAC System Energy Calculations C*********************************************************************** C* FUNCTION: ENTHALPY C* C* LANGUAGE: FORTRAN 77 C* C* PURPOSE: Calculate the enthalpy of moist air. C*********************************************************************** C* INPUT VARIABLES: C* TDB Dry bulb temperature (C) C* W Humidity ratio (-) C* C* OUTPUT VARIABLES: C* Enthalpy Enthalpy of moist air (J/kg) C* C* PROPERTIES: C* CpAir Specific heat of air (J/kg C) C* CpVap Specific heat of water vapor (J/kg C) C* Hfg Reference heat of vaporization of water (J/kg) C*********************************************************************** C MAJOR RESTRICTIONS Uses perfect gas relationships C Fit for enthalpy of saturated water vapor 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: PROP.INC C SUBROUTINES CALLED: None C FUNCTIONS CALLED: None C C REVISION HISTORY: None C C REFERENCE: 1989 ASHRAE Handbook - Fundamentals C*********************************************************************** C1*** Calculate the enthalpy as a function of dry bulb temperature and C1*** humidity ratio. hDryAir = CpAir*TDB hSatVap = Hfg + CpVap*TDB Enthalpy = hDryAir + W*hSatVap RETURN END