CONTINUOUS_MODEL CeLVO ABSTRACT "Two-way flows thru a Large Vertical rectangular Opening at any height. Density gradients in connected zones are neglected. By: Per Sahlin Date: Well, a long time ago Calls: Enthal from PSYCHRO1.NMF RhoMois from PSYCHRO2.NMF Revisions: 011115 LE Model rewritten. All events are removed and the massflows are now continuous functions of Dp_b and Dp_t. New versions of formulas when Dp_b and Dp_t have the same sign to get rid of numerical problems when Dp_b and Dp_t are close to each other. Linearization within +-dPLin around the axis. Some variables have been removed. 010523 MV Top and Bot calculations are protected agaist very small and large pressure differences, wo protection it leads to pressures, which produce not a number- fortran error messages. All integration came lots faster as well. 010427 ABg Modified Qn12, Qn21 replaced Q_R Redefined Fi12, Fi21 Removed Fi12_B12, etc. 010120 RSC Defined new local variables Fi12_B12, Fi12_B21, Fi21_B12, Fi21_B21 010119 MV A new BiDirLnk type link is introduced at both sides of the opening. The displacement ventilation calculation in the detailed zone model needs more information than just net flows. Due to this many new IN-variables (dummy ones) are introduced and A_S:s are revised as well. 010110 MV To calculate volume flow dry air density is used. 010110 RSC Defined new local variables delta, Q12R, Q21R, Fi12, Fi21 990211 AB Heights above floors introduced. Wrong width corrected for flat profile. 981028 MV P1On and Rho1On modes are introduced 980211 AB Width is made a controllable variable 980114 MV Events are changed again 971201 MV RhoDry is changed to rhoMois 971125 MV Density calculation is changed to use rho_dry function rho_20 removed from parameter section hysteresis to slanted A_S parameter 971119 MV linearization when dP is less than 0.001 density difference is reduce for slanted vel. profile A_S parameter for slanted vel. profile 971118 MV cp removed from parameters as well 971104 PS cP removed and call to Enthal inserted " EQUATIONS /* get current width */ Width := MAX(1E-08,Contr) * w; /* calculating densities*/ Rho1 := RHOMOIS (T1a,Hum1a); Rho2 := RHOMOIS (T2a,Hum2a); /* pressure differences at top and bottom of opening*/ Dp_b := (P1a - Rho1*G*zb_1) - (P2a - Rho2*G*zb_2); Dp_t := Dp_b - Rho1*G*z_t + Rho2*G*z_t; /* calculating mass flows */ IF LINEARIZE(1) THEN IF Dp_b + Dp_t > 0 THEN M_12 := cd*Width*z_t * SQRT(2*Rho1*dPLin)/dPLin*(Dp_b+Dp_t)/2; M_21 := 0E-12; ELSE M_12 := 0E-12; M_21 := cd*Width*z_t * SQRT(2*Rho2*dPLin)/dPLin*(-Dp_b-Dp_t)/2; END_IF; ELSE_IF Dp_b > dPLin AND Dp_t > dPLin THEN M_12 := cd*(2/3)*Width*z_t * SQRT(2*Rho1) *(SQRT(Dp_b)+SQRT(Dp_t)-SQRT(Dp_b*Dp_t)/(SQRT(Dp_b)+SQRT(Dp_t))); M_21 := 0E-12; ELSE_IF Dp_b > dPLin AND Dp_t >= 0.0 THEN M_12 := cd*(2/3)*Width*z_t * SQRT(2*Rho1) *(SQRT(Dp_b)+Dp_t/SQRT(dPlin)-Dp_t/SQRT(dPlin)*SQRT(Dp_b)/(SQRT(Dp_b)+SQRT(Dplin))); M_21 := 0E-12; ELSE_IF Dp_b >= 0.0 AND Dp_t > dPLin THEN M_12 := cd*(2/3)*Width*z_t * SQRT(2*Rho1) *(SQRT(Dp_t)+Dp_b/SQRT(dPlin)-Dp_b/SQRT(dPlin)*SQRT(Dp_t)/(SQRT(Dp_t)+SQRT(Dplin))); M_21 := 0E-12; ELSE_IF Dp_b >= 0.0 AND Dp_t >= 0.0 THEN M_12 := cd*(2/3)*Width*z_t * SQRT(2*Rho1) *((Dp_t+Dp_b)/SQRT(dPlin)-Dp_b*Dp_t/dPlin/(2*SQRT(Dplin))); M_21 := 0E-12; ELSE_IF Dp_b <-dPLin AND Dp_t <-dPLin THEN M_12 := 0E-12; M_21 := cd*(2/3)*Width*z_t * SQRT(2*Rho2) *(SQRT(-Dp_b)+SQRT(-Dp_t)-SQRT(Dp_b*Dp_t)/(SQRT(-Dp_b)+SQRT(-Dp_t))); ELSE_IF Dp_b <-dPLin AND Dp_t <= 0.0 THEN M_12 := 0E-12; M_21 := cd*(2/3)*Width*z_t * SQRT(2*Rho2) *(SQRT(-Dp_b)-Dp_t/SQRT(dPlin)+Dp_t/SQRT(dPlin)*SQRT(-Dp_b)/(SQRT(-Dp_b)+SQRT(Dplin))); ELSE_IF Dp_b <= 0.0 AND Dp_t <-dPLin THEN M_12 := 0E-12; M_21 := cd*(2/3)*Width*z_t * SQRT(2*Rho2) *(SQRT(-Dp_t)-Dp_b/SQRT(dPlin)+Dp_b/SQRT(dPlin)*SQRT(-Dp_t)/(SQRT(-Dp_t)+SQRT(Dplin))); ELSE_IF Dp_b <= 0.0 AND Dp_t <= 0.0 THEN M_12 := 0E-12; M_21 := cd*(2/3)*Width*z_t * SQRT(2*Rho2) *(-(Dp_t+Dp_b)/SQRT(dPlin)-Dp_b*Dp_t/dPlin/(2*SQRT(Dplin))); ELSE Top := IF Dp_t >= dPLin THEN cd*(2/3)*Width*z_t*Dp_t**(3/2)/(Dp_t-Dp_b) ELSE_IF Dp_t >= 0.0 THEN cd*(2/3)*Width*z_t*dPLin**(1/2)*Dp_t/(dPLin-Dp_b) ELSE_IF Dp_t > -dPLin THEN cd*(2/3)*Width*z_t*dPLin**(1/2)*Dp_t/(-dPLin-Dp_b) ELSE -cd*(2/3)*Width*z_t*(-Dp_t)**(3/2)/(Dp_t-Dp_b) END_IF; Bot := IF Dp_b >= dPLin THEN cd*(2/3)*Width*z_t*Dp_b**(3/2)/(Dp_b-Dp_t) ELSE_IF Dp_b >= 0.0 THEN cd*(2/3)*Width*z_t*dPLin**(1/2)*Dp_b/(dPLin-Dp_t) ELSE_IF Dp_b > -dPLin THEN cd*(2/3)*Width*z_t*dPLin**(1/2)*Dp_b/(-dPLin-Dp_t) ELSE -cd*(2/3)*Width*z_t*(-Dp_b)**(3/2)/(Dp_b-Dp_t) END_IF; IF (Dp_b > Dp_t) THEN M_12 := Bot * SQRT(2*Rho1); M_21 := Top * SQRT(2*Rho2); ELSE M_12 := Top * SQRT(2*Rho1); M_21 := Bot * SQRT(2*Rho2); END_IF END_IF; /* Top := IF Dp_t > dPLin THEN cd*(2/3)*Width*Dp_t**(3/2)/(G*(Rho1 - Rho2)) ELSE_IF Dp_t > -dPLin THEN cd*(2/3)*Width*dPLin**(1/2)*Dp_t/(G*(Rho1 - Rho2)) ELSE -cd*(2/3)*Width*(-Dp_t)**(3/2)/(G*(Rho1 - Rho2)) END_IF; Bot := IF Dp_b > dPLin THEN cd*(2/3)*Width*Dp_b**(3/2)/(G*(Rho1 - Rho2)) ELSE_IF Dp_b > -dPLin THEN cd*(2/3)*Width*dPLin**(1/2)*Dp_b/(G*(Rho1 - Rho2)) ELSE -cd*(2/3)*Width*(-Dp_b)**(3/2)/(G*(Rho1 - Rho2)) END_IF; */ /* Removed by Mika 010523 Top := cd*(2/3)*Width*abs(Dp_t)**(3/2)/(G*(Rho1 - Rho2)); Bot := cd*(2/3)*Width*abs(Dp_b)**(3/2)/(G*(Rho1 - Rho2)); */ /* go thru the different cases of neutral plane position and slope of vel. profile, calculate resulting mass flows */ /* Z_n := Dp_b / (G*(Rho1 - Rho2)); IF (Dp_b > 0 AND (Z_n < 0 OR Z_n > z_t)) THEN M_12 := (Bot - Top) * SQRT(2*Rho1); M_21 := 0E-12; ELSE_IF (Dp_b < 0 AND (Z_n < 0 OR Z_n > z_t)) THEN M_12 := 0E-12; M_21 := (Bot - Top) * SQRT(2*Rho2); ELSE_IF (Dp_b > Dp_t) THEN IF (Dp_b > Dp_t) THEN M_12 := Bot * SQRT(2*Rho1); M_21 := -Top * SQRT(2*Rho2); ELSE M_12 := -Top * SQRT(2*Rho1); M_21 := Bot * SQRT(2*Rho2); END_IF END_IF; */ /* Mass flows */ M12 = M_12; M21 = M_21; /* convected heat */ Q12 = M12 * Enthal(T1a,Hum1a); Q21 = M21 * Enthal(T2a,Hum2a); /* convected mass fraction */ Xf12 = M12 * X1a; Xf21 = M21 * X2a; /* convected moisture fraction */ Humf12 = M12 * Hum1a; Humf21 = M21 * Hum2a; /* + */ delta:=Enthal(T1a,Hum1a)-Enthal(T2a,Hum2a); /* - IF M12>0 THEN Fi12_B12 := (M12/RHODRY(T1a,Hum1a))*1E+03; ELSE Fi21_B12:=(-M12/Rho1)*1E+03; END_IF; IF M21>0 THEN Fi21_B21 := (M21/RHODRY(T1a,Hum1a))*1E+03; ELSE Fi12_B21:=(-M21/Rho1)*1E+03; END_IF; Fi12:=Fi12_B12+Fi12_B21; Fi21:=Fi21_B12+Fi21_B21; Q_R:=Q21-Q12; */ /* + */ /* For each adjacent zone, include only mass flow into zone; specify relative enthalpy flow for this */ Fi12 := M12/Rho1*1E+03; Fi21 := M21/Rho2*1E+03; Qn12 := IF M12 > 0 THEN M12 * delta; ELSE 0 END_if; Qn21 := IF M21 > 0 THEN M21 * (-delta); ELSE 0 END_if; /* . */ /* .*/ /* SlantOn := Eventp(G0,abs(Rho1 - Rho2)-0.01); SlantOff := Eventn(G1,abs(Rho1 - Rho2)-0.0001); Slanted := IF SlantOn > 0 THEN 1 ELSE_IF SlantOff < 0 THEN 0 ELSE Slanted END_IF; Dp_bPos := Eventp(G2,Dp_b+0.05); Dp_bNeg := Eventn(G3,Dp_b-0.05); P1On := IF Dp_bPos > 0 THEN 1 ELSE_IF Dp_bNeg < 0 THEN 0 ELSE P1On END_IF; Rho1On := IF Event(G4,Rho1 - Rho2) > 0 THEN 1 ELSE 0 END_IF; */ LINKS /* type name variables...*/ BiDirAir Term1a P1a, POS_IN M12, T1a, POS_IN Q12, X1a, POS_IN Xf12, Hum1a, POS_IN Humf12; BiDirAir Term1b P1b, POS_OUT M21, T1b, POS_OUT Q21, X1b, POS_OUT Xf21, Hum1b, POS_OUT Humf21; BiDirAir Term2a P2a, POS_OUT M12, T2a, POS_OUT Q12, X2a, POS_OUT Xf12, Hum2a, POS_OUT Humf12; BiDirAir Term2b P2b, POS_IN M21, T2b, POS_IN Q21, X2b, POS_IN Xf21, Hum2b, POS_IN Humf21; ControlLink Opening Contr; VARIABLES /*type name role def min max descr.*/ Temp T1a IN 20 ABS_ZERO BIG "Zone 1 Temperature" Temp T2a IN 20 ABS_ZERO BIG "Zone 2 Temperature" Temp T1b IN 20 ABS_ZERO BIG "Zone 1 Temperature" Temp T2b IN 20 ABS_ZERO BIG "Zone 2 Temperature" Density Rho1 LOC 1.2 SMALL BIG "Zone 1 density" Density Rho2 LOC 1.2 SMALL BIG "Zone 2 density" Pressure Dp_t LOC 0.1 -BIG BIG "Pressure diff, top of opening" Pressure Dp_b LOC 0.1 -BIG BIG "Pressure diff, floor level" Pressure P1a IN 1325 -BIG BIG "Zone 1 floor level pressure" Pressure P2a IN 1325 -BIG BIG "Zone 2 floor level pressure" Pressure P1b IN 1325 -BIG BIG "Zone 1 floor level pressure" Pressure P2b IN 1325 -BIG BIG "Zone 2 floor level pressure" Control Contr IN 0 0 1 "Control input, 0 closed, 1 open" /* Length Z_n LOC 1.1 0 BIG "level of neutral plane, Dp = 0" */ Length Width LOC "Current width" GENERIC Top LOC "Help variable" GENERIC Bot LOC "Help variable" MassFlow M_12 LOC 0.001 0 BIG "Massflow from zone 1 to 2" MassFlow M_21 LOC 0.001 0 BIG "Massflow from zone 2 to 1" /* = HeatFlux Q_R LOC 0 -BIG BIG "Net HeatFlux" HeatFlux Q_R12 LOC 0 -BIG BIG "Net HeatFlux from zone 1 to 2" HeatFlux Q_R21 LOC 0 -BIG BIG "Net HeatFlux from zone 2 to 1" + */ HeatFlux Qn12 LOC 0 -BIG BIG "Net heatFlux for flow from zone 1 to 2" HeatFlux Qn21 LOC 0 -BIG BIG "Net heatFlux for flow from zone 2 to 1" /* . */ MassFlow M12 OUT 0 -BIG BIG "Massflow" MassFlow M21 OUT 0 -BIG BIG "Massflow" HeatFlux Q12 OUT 0 -BIG BIG "HeatFlux from zone 1 to 2" HeatFlux Q21 OUT 0 -BIG BIG "HeatFlux from zone 2 to 1" /* - VolFlow_m Fi12 LOC 0 -BIG BIG "Total volume flow from zone 1 to 2" VolFlow_m Fi21 LOC 0 -BIG BIG "Total volume flow from zone 2 to 1" VolFlow_m Fi12_B12 LOC 0 -BIG BIG "Contribution of M12 to total volume flow from zone 1 to 2" VolFlow_m Fi12_B21 LOC 0 -BIG BIG "Contribution of M21 to total volume flow from zone 1 to 2" VolFlow_m Fi21_B12 LOC 0 -BIG BIG "Contribution of M12 to total volume flow from zone 2 to 1" VolFlow_m Fi21_B21 LOC 0 -BIG BIG "Contribution of M21 to total volume flow from zone 2 to 1" */ /* + */ VolFlow_m Fi12 LOC 0 -BIG BIG "Volume flow from zone 1 [to 2]" VolFlow_m Fi21 LOC 0 -BIG BIG "Volume flow from zone 2 [to 1]" /* . */ FractFlow_y Xf12 OUT 0 -BIG BIG "Amount of fraction trnsp." FractFlow_y Xf21 OUT 0 -BIG BIG "Amount of fraction trnsp." Fraction_y X1a IN 594 0 BIG "Zone 1 fraction" Fraction_y X2a IN 594 0 BIG "Zone 2 fraction" Fraction_y X1b IN 594 0 BIG "Zone 1 fraction" Fraction_y X2b IN 594 0 BIG "Zone 2 fraction" HumRatio Hum1a IN 0.006 SMALL BIG "moisture fraction in" HumRatio Hum2a IN 0.006 SMALL BIG "moisture fraction zone" HumRatio Hum1b IN 0.006 SMALL BIG "moisture fraction in" HumRatio Hum2b IN 0.006 SMALL BIG "moisture fraction zone" HumFlow Humf12 OUT 0 -BIG BIG "moisture transport" HumFlow Humf21 OUT 0 -BIG BIG "moisture transport" /* Generic G0 A_S 1 0 1 "Memory of slanted vel. profile" Generic G1 A_S 1 0 1 "Memory of slanted vel. profile" Generic Slanted A_S 0 0 1 "Slanted vel. profile" Generic SlantOn LOC 1 -BIG BIG "Slanted On" Generic SlantOff LOC 1 -BIG BIG "Slanted Off" Generic G2 A_S 1 0 1 " " Generic G3 A_S 1 0 1 " " Generic P1On A_S 1 0 1 "Pressure 1 greater than pressure 2" Generic dp_bPos LOC 1 -BIG BIG "dp_b pressure difference positive" Generic dp_bNeg LOC 1 -BIG BIG "dp_b pressure difference negative" Generic G4 A_S 1 0 1 " " Generic Rho1On A_S 1 0 1 "Density 1 greater than density 2" */ Enthalpy delta LOC 1 0 BIG "Enthalpy difference " PARAMETERS /* type name role def min max descr.*/ Length z_t S_P 2 SMALL 100 "Opening height" Length w S_P 1 SMALL 100 "Opening width" Length z_z S_P 2.4 SMALL BIG "Average zone height" Length zb_1 S_P 0 -5 100 "Opening bottom height from floor, zone 1" Length zb_2 S_P 0 -5 100 "Opening bottom height from floor, zone 2" Pressure dPLin S_P 0.001 SMALL BIG "Pressure difference to linearize" /* derived parameter */ Factor cd C_P .6 SMALL 1 "Discharge coefficient" PARAMETER_PROCESSING /* Temporary solutions */ cd := 0.65; /* cd := 0.609*(z_t/z_z) - 0.066; */ END_MODEL