@@ -59,10 +59,6 @@ WHAT if we modify the smart terminal to shut off flow if supply temp is on wrong
5959 ****** UNTIL details thought thru, don't bother to try to implement smart terminals. ******* */
6060
6161// -----------------------------------------------------------------------------------------------------------------------------
62- // --- constants, also hard-coded in cncult2.cpp for Top.absTol; also in cnah.cpp:
63- const float RELoverABS = .01f ; // relative to absolute tolerance ratio: +-1 corrsponds to +- 1%.
64- const float ABSoverREL = 1 .f/RELoverABS; // reciprocal thereof
65- // ---------------------------------------------------------------------------------------------------------------------------
6662RC FC hvacIterSubhr ()
6763
6864// Iterative (estimate-refine) part of hvac subhour computations for all zones/terminals/airHandlers
@@ -531,25 +527,38 @@ RC TU::tu_Setup() // check and set up terminal record: call for each terminal
531527 SI vbl = FALSE ; // TRUE if any variable exprs given: don't default
532528 float def = 0 .f ; // use only > 0 values
533529 if (sstat[TU_TUVFMN] & FsSET) // if minimum flow given
530+ {
534531 if (sstat[TU_TUVFMN] & FsAS) // if being autoSized 7-95, its not constant nor variable
535532 ausz++; // set flag
536533 else if (sstat[TU_TUVFMN] & FsVAL) // else if set now (thus constant)
537534 def = tuVfMn; // use it as default (if > 0)
538- else vbl++; // not set, not autoSized --> must be variable, can't default
535+ else
536+ vbl++; // not set, not autoSized --> must be variable, can't default
537+ }
539538 if (cmAr & cmStH) // heat max only pertinent with tstat ctrl'd heat
539+ {
540540 if (sstat[TU_TUVFMXH] & FsSET) // if heat max flow given
541+ {
541542 if (sstat[TU_TUVFMXH] & FsAS) // if being autoSized 7-95, its not constant nor variable
542543 ausz++; // set flag
543544 else if (sstat[TU_TUVFMXH] & FsVAL) // if set now (thus constant)
544545 setToMax (def, tuVfMxH); // use it as default if larger
545- else vbl++; // not set --> must be variable, can't default
546+ else
547+ vbl++; // not set --> must be variable, can't default
548+ }
549+ }
546550 if (cmAr & cmStC) // cool max only pertinent with tstat ctrl'd cool
551+ {
547552 if (sstat[TU_TUVFMXC] & FsSET) // if cool max flow given
553+ {
548554 if (sstat[TU_TUVFMXC] & FsAS) // if being autoSized 7-95, its not constant nor variable
549555 ausz++; // set flag
550556 else if (sstat[TU_TUVFMXC] & FsVAL) // if set now (thus constant)
551557 setToMax (def, tuVfMxC); // use it as default if larger
552- else vbl++; // not set --> must be variable, can't default
558+ else
559+ vbl++; // not set --> must be variable, can't default
560+ }
561+ }
553562 /* if any exprs given, don't use the constants or autoSizes -- require input.
554563 if only constants or autoSizes given, use max for main sim.
555564 if both constants & autoSizes given, don't store the constants b4 ausz phase: leave 0 for dynamic default.
@@ -2498,6 +2507,9 @@ RC ZNR::ztuMode() // ztuCompute inner fcn: determine zone mode, zone temp, term
24982507 Turnoff happens: AH::setTsSp1 (some 0-flow cases), TU::tuEstimate (next subhour),
24992508 and now in ZNR::ztuAbs at most once per subhour. 4-95. */
25002509
2510+ default :
2511+ break ;
2512+
25012513 } // end switch zhxTy
25022514
25032515 // sums for humidity, for setpoint modes: add active-terminal contribution if any to sums from ztuAbs
@@ -2773,7 +2785,7 @@ RC ZNR::ztuAbs( // compute stuff for zn's terminals in given zone mode
27732785 && ah->isZNorZN2 // if ah supply temp is under ZN or ZN2 control this hour
27742786 // don't turn on ah if no flow possible: just turns itself off again --> ah-tu nonconvergence, 10-96.
27752787 && (max ( tu->tuVfMn , tu->tuVfMxH ) > 0 || Top.tp_sizing && tu->vhAs .az_active ) // tuVfMxH==0 is allowed input.
2776- && (ah->sfan .vfDs > 0 || Top.tp_sizing && ah->fanAs .az_active ) ) // vfDs==0 could result from autoSizing.
2788+ && (ah->sfan .vfDs > 0 || ( Top.tp_sizing && ah->fanAs .az_active ) ) ) // vfDs==0 could result from autoSizing.
27772789 {
27782790 TU *ctu = TuB.p + ah->ahCtu ; // point ZN/ZN2 control terminal for this air handler
27792791 ctu->wantMd = ahHEATING; // have terminal tell ah that it wants heat
@@ -2808,7 +2820,7 @@ RC ZNR::ztuAbs( // compute stuff for zn's terminals in given zone mode
28082820 && ah->isZNorZN2 // if ah supply temp is under ZN or ZN2 control this hour
28092821 // don't turn on ah if no flow possible: just turns itself off again --> ah-tu nonconvergence, 10-96.
28102822 && (max ( tu->tuVfMn , tu->tuVfMxC ) > 0 || Top.tp_sizing && tu->vcAs .az_active ) // tuVfMxC==0 is allowed input.
2811- && (ah->sfan .vfDs > 0 || Top.tp_sizing && ah->fanAs .az_active ) ) // vfDs==0 could result from autoSizing.
2823+ && (ah->sfan .vfDs > 0 || ( Top.tp_sizing && ah->fanAs .az_active ) ) ) // vfDs==0 could result from autoSizing.
28122824 {
28132825 TU *ctu = TuB.p + ah->ahCtu ; // point ZN/ZN2 control terminal for this air handler
28142826 ctu->wantMd = ahCOOLING; // have terminal tell ah that it wants coolth
@@ -2862,6 +2874,8 @@ haveFlow: ; // other air handler cases join here with flow cz set
28622874 wc1 += cz * (ah->ah_wSupLs + ah->ah_wSup )/2 .; // accumulate average supply hum rat * flow, for wcO1
28632875 wc += cz * ah->ah_wSup ; // accumulate latest supply hum rat * flow
28642876 break ;
2877+ default :
2878+ break ;
28652879 }
28662880 }
28672881
@@ -3098,6 +3112,8 @@ tzOhum: ; // common exit for air cases. cz contains tu->cz.
30983112 }
30993113 break ;
31003114#undef TOLF
3115+ default :
3116+ break ;
31013117 }
31023118 }
31033119} // ZNR::ztuMdSets
0 commit comments