CONTINUOUS_MODEL BdTerm ABSTRACT "Air inlet/outlet terminal, connecting bidirectional duct fittings to zones. Bi-directional transports of mass, energy and a mass fraction. Linear flow below limit 'dp0', and if LIN." EQUATIONS Rho1 := rhomois(T1,Hum1); Dp := P1 - P2 - zr1 * G * Rho1 ; /* powerlaw massflow equation */ M = IF LINEARIZE (1) THEN c_lin * Dp ELSE_IF abs (Dp) < dp0 THEN c_lin * Dp ELSE_IF Dp > 0 THEN c_turb * sqrt(Dp) ELSE -c_turb * sqrt(-Dp) END_IF BAD_INVERSES () ; /* convected heat */ Q = IF LINEARIZE (1) THEN (T1 - T2) / 2 ELSE_IF M > 0.0 THEN M * Enthal(T1,Hum1) ELSE M * Enthal(T2,Hum2) END_IF GOOD_INVERSES (Q) ; /* fraction transported */ Xf = IF LINEARIZE (1) THEN (X1 - X2) / 2 ELSE_IF M > 0.0 THEN X1 * M ELSE X2 * M END_IF GOOD_INVERSES (Xf); /* Hum transported through leak*/ Humf = IF LINEARIZE (1) THEN (Hum1 - Hum2) / 2 ELSE_IF M > 0.0 THEN Hum1 * M ELSE Hum2 * M END_IF GOOD_INVERSES (Humf) ; LINKS /* type name variables... */ BidirAir zone P1, POS_IN M, T1, POS_IN Q, X1, POS_IN Xf, Hum1, POS_IN Humf ; BidirAir system P2, POS_OUT M, T2, POS_OUT Q, X2, POS_OUT Xf, Hum2, POS_OUT Humf ; VARIABLES /* type name role def min max description */ Density Rho1 LOC 1.2 .5 3 "density of zone air" massflow M OUT 0 -BIG BIG "massflow from zone to system" Pressure P1 IN 1 -BIG BIG "zone floor level pressure" Pressure P2 IN 2 -BIG BIG "system terminal pressure" Temp T1 IN 20 ABS_ZERO BIG "zone temperature" Temp T2 IN 20 ABS_ZERO BIG "system terminal temperature" HeatFlux Q OUT 0 -BIG BIG "heat moved from zone to system" Fraction_y X1 IN 594 0 BIG "zone fraction" Fraction_y X2 IN 594 0 BIG "system terminal fraction" FractFlow_y Xf OUT 0 -BIG BIG "fraction moved from zone to system" HumRatio Hum1 IN .005 0 1 "hum. of neighbor 1" HumRatio Hum2 IN .005 0 1 "hum. of neighbor 2" HumFlow Humf OUT 0 -BIG BIG "hum. moved by massflow" Pressure Dp LOC "effective pressure diff" PARAMETERS /* type name role def min max description */ /* easy access parameters */ Generic InPar S_P 0 0 1 "Input parameters 0 = c_t 1 = xi" generic c_t S_P 0 0 BIG "powerlaw coefficient" length d S_P .25 SMALL BIG "inner diameter" generic xi S_P 10 SMALL BIG "loss coeff" length zr1 S_P 0 0 BIG "terminal height from floor" Pressure dp0 S_P .1 SMALL BIG "limit for linear flow" /* derived parameters */ area a C_P "cross section area" generic c_lin C_P "laminar coefficient" generic c_turb C_P "flow characteristic" PARAMETER_PROCESSING a := PI * d * d / 4. ; /* Check alternative definitions of c_turb */ c_turb := IF InPar < 0.5 THEN c_t ELSE_IF xi == 0 THEN 0 ELSE a * (2. * rho_air / xi)**0.5 END_IF ; IF c_turb == 0 THEN CALL nmf_error ("parameters missing (c_t or xi) for bidir terminal ") END_IF ; c_lin := c_turb / sqrt (dp0) ; END_MODEL