@@ -355,7 +355,6 @@ RC ZNR::zn_BegHour2() // beginning-of-hour calcs for zone
355355RC ZNR::zn_BegSubhr1 () // zone start of subhour, part 1
356356// call *before* airnet and possible others needing prior-step (lagged) values
357357{
358- // is following still needed? eg loadsIzxfer no longer accumulates to it... 11-95
359358 memset ( &ZnresB.p [ss].curr .S , 0 , sizeof ( ZNRES_IVL_SUB) ); // access subhr results struct in ZNRES via subscr in ZrB & 0 it.
360359 ZnresB.p [ss].curr .S .nSubhr = 1L ; // count subhours by setting to 1 at subhr level & accumulating
361360
@@ -1719,10 +1718,7 @@ RC RSYS::rs_CkF()
17191718 rs_fanPwrC = 0 .f ; // fan power included in primary by default
17201719 }
17211720 else
1722- { rc |= requireN (when, RSYS_SEER, 0 );
1723- if (IsSetCount (RSYS_COP95, RSYS_EER95, 0 ) == 2 )
1724- rc |= oer (" rsEER and rsCOP95 cannot both be given %s" , when);
1725- }
1721+ rc |= requireN (when, RSYS_SEER, 0 );
17261722
17271723 // cooling model air flow correlations have limited validity range
17281724 // verify air flow 150 - 550 cfm/ton (per Proctor Engineering)
@@ -2005,28 +2001,34 @@ RC RSYS::rs_TopRSys1() // check RSYS, initial set up for run
20052001
20062002 if (rs_CanCool ())
20072003 { // default/harmonize 95 F COP
2008- // force rs_COP95 <-> rs_EER95 consistency
2009- // at most 1 can be input
2004+ // inter-default rs_COP95 <-> rs_EER95
2005+ // if both input, values can be different
2006+ // rs_COP95 used for VCHP2, rs_EER95 used for single speed
20102007 // EER can default from SEER
20112008 if (rs_IsPkgRoom ())
20122009 { // pkg: derive SEER from EER
20132010 // abram conant fit, 6-20
20142011 rs_SEER = 1 .07f * rs_EER95;
20152012 // rs_COP95 not allowed
20162013 }
2017- else if (IsSet (RSYS_COP95))
2018- rs_EER95 = rs_COP95 * BtuperWh;
2019- else if (!IsSet (RSYS_EER95))
2020- { // estimate missing EER from SEER
2021- // California ACM method
2022- rs_EER95 = rs_SEER < 13 .f ? 10 .f + 0 .84f * (rs_SEER - 11.5 )
2023- : rs_SEER < 16 .f ? 11 .3f + 0 .57f * (rs_SEER - 13 )
2024- : 13 .f ;
2025- if (rs_SEER <= rs_EER95)
2026- rc |= oer (" rsSEER (%g) must be > rsEER (%g)" , rs_SEER, rs_EER95);
2014+ else if (IsSet (RSYS_EER95))
2015+ { if (!IsSet (RSYS_COP95))
2016+ rs_COP95 = rs_EER95 / BtuperWh;
2017+ }
2018+ else
2019+ { if (IsSet (RSYS_COP95))
2020+ rs_EER95 = rs_COP95 * BtuperWh;
2021+ else
2022+ { // estimate missing EER from SEER
2023+ // California ACM method
2024+ rs_EER95 = rs_SEER < 13 .f ? 10 .f + 0 .84f * (rs_SEER - 11.5 )
2025+ : rs_SEER < 16 .f ? 11 .3f + 0 .57f * (rs_SEER - 13 )
2026+ : 13 .f ;
2027+ rs_COP95 = rs_EER95 / BtuperWh;
2028+ }
20272029 }
2028- // rs_EER95 now set
2029- rs_COP95 = rs_EER95 / BtuperWh;
2030+ if (rs_SEER <= rs_EER95)
2031+ rc |= oer ( " rsSEER (%g) must be > rsEER (%g) " , rs_SEER, rs_EER95);
20302032 }
20312033
20322034 if (IsAusz ( RSYS_CAP95))
@@ -2704,10 +2706,9 @@ float RSYS::rs_FanHRtdPerTon( // fan heat included in ratings
27042706// returns fan heat included in ratings, Btuh
27052707{
27062708 float fanHRtdPerTon =
2707- rs_IsPkgRoom () ? 0 .f // PkgRoom: no fan adjustment
2708- : rs_fan.fn_motTy == C_MOTTYCH_PSC
2709- ? 500 .f // PSC = Permanent Split Capacitor
2710- : 283 .f ; // BPM = Brushless Permanent Magnet (aka ECM)
2709+ rs_IsPkgRoom () || rs_adjForFanHt == C_NOYESCH_NO ? 0 .f // PkgRoom or user override: no fan adjustment
2710+ : rs_fan.fn_motTy == C_MOTTYCH_PSC ? 500 .f // PSC = Permanent Split Capacitor
2711+ : 283 .f ; // BPM = Brushless Permanent Magnet (aka ECM)
27112712
27122713 return capNomTons * fanHRtdPerTon;
27132714
@@ -3120,23 +3121,26 @@ x printf("\nhit");
31203121 else
31213122 { // total capacities and input, Btuh
31223123 // include rated fan power
3124+ // cap values are net Btuh, <0
31233125 float capClg, inpClg, capClgMin, inpClgMin;
31243126 RC rc = rs_GetPerfBtwxt (rs_pRgiClg, rs_tdbOut,
31253127 capClg, inpClg, capClgMin, inpClgMin);
31263128 rs_speedFMin = capClg >= 0 .f ? 1 .f : capClgMin / capClg;
31273129 float fanHAdj = rs_fanHRtdC; // fan heat adjustment, Btuh
3130+ // adjust for fan power (= convert to gross cooling)
31283131 capClg += fanHAdj;
31293132 inpClg -= fanHAdj;
31303133 capClgMin += fanHAdj * rs_speedFMin;
31313134 inpClgMin -= fanHAdj * rs_speedFMin;
31323135
3133- rs_capTotCt = capClg * rs_speedF; // total coil capacity at current conditions and speed, Btuh
3136+ rs_capTotCt = capClg * rs_speedF; // total coil capacity (= gross) at current conditions and speed, Btuh
31343137 rs_capSenCt = rs_SHR * rs_capTotCt; // sensible coil capacity at current conditions and speed, Btuh
31353138
3139+ // input at current speed (Btuh)
31363140 float inpX = rs_speedF == 1 .f
31373141 ? inpClg
31383142 : inpClgMin
3139- + (inpClg - inpClgMin) * (rs_speedF - rs_speedFMin) / (1 .f - rs_speedFMin);
3143+ + (inpClg - inpClgMin) * (rs_speedF - rs_speedFMin) / (1 .f - rs_speedFMin);
31403144
31413145 rs_effCt = abs ( rs_capSenCt) / inpX; // compressor-only COP
31423146 }
@@ -4553,7 +4557,7 @@ void RSYS::rs_EnteringAirState() // RSYS entering air state
45534557 orWarn (" dubious return temp (%.1f F)" , afRet.as_tdb );
45544558#endif
45554559 }
4556- rs_asRet = afRet; // state = flow w/o amf
4560+ rs_asRet. as_Set ( afRet) ; // state = flow w/o amf
45574561 }
45584562
45594563 // adjust state for return duct
@@ -4998,25 +5002,28 @@ RC RSYS::rs_AllocateZoneAirVC() //
49985002
49995003} // RSYS::AllocateZoneAirVC()
50005004// -----------------------------------------------------------------------------
5001- RC RSYS::rs_TotalAirRequest (
5005+ RC RSYS::rs_TotalAirRequest ( // all-zone air request at speedF
50025006 float speedF)
5003-
50045007{
50055008 RC rc = RCOK;
50065009
5007- rs_ClearSubhrResults (1 ); // init for speed re-try
5008- int ret = rs_SupplyAirState (rs_mode, speedF);
5009- ZNR* zp;
5010- RLUPC (ZrB, zp, rs_IsZoneServed (zp))
5011- zp->zn_AirRequest (this );
5012-
5013- if (rs_amfReq[0 ] <= 0 .) // if any air requested (by any zone)
5010+ if (speedF != rs_speedF)
50145011 {
5015- printf (" \n rs_AirRequest: rs_amfReq[ 0] <= 0." );
5016- return RCBAD;
5017- }
50185012
5019- rs_fxCap[0 ] = rs_amf / rs_amfReq[0 ]; // >1 = excess capacity
5013+ rs_ClearSubhrResults (1 ); // init for speed re-try
5014+ int ret = rs_SupplyAirState (rs_mode, speedF);
5015+ ZNR* zp;
5016+ RLUPC (ZrB, zp, rs_IsZoneServed (zp))
5017+ zp->zn_AirRequest (this );
5018+
5019+ if (rs_amfReq[0 ] <= 0 .) // if any air requested (by any zone)
5020+ {
5021+ printf (" \n rs_AirRequest: rs_amfReq[ 0] <= 0." );
5022+ return RCBAD;
5023+ }
5024+
5025+ rs_fxCap[0 ] = rs_amf / rs_amfReq[0 ]; // >1 = excess capacity
5026+ }
50205027
50215028 return rc;
50225029} // RSYS::rs_TotalAirRequest
@@ -5050,7 +5057,7 @@ double RSYS::rs_FindAirFlow()
50505057
50515058#if defined( _DEBUG)
50525059 if (ret)
5053- printf (" \n rs_FindAirFlow(): secant ret=%d" , ret);
5060+ printf (" \n rs_FindAirFlow(): secant ret=%d rsMode=%d " , ret, rs_mode );
50545061 if (rs_speedF < rs_speedFMin || rs_speedF > 1 .f )
50555062 printf (" \n rs_FindAirFlow() rs_speedF=%0.2f" , rs_speedF);
50565063#endif
@@ -5124,11 +5131,11 @@ RC RSYS::rs_FinalizeSh()
51245131 float runFFan = 0 .f ; // subhour fan run fraction
51255132 if (rs_mode == rsmCOOL)
51265133 {
5127- rs_outSen = rs_loadF * rs_capSenCt; // average output w/o fan, Btuh (< 0)
5134+ rs_outSen = rs_loadF * rs_capSenCt; // average output w/o fan (= gross cooling) , Btuh (< 0)
51285135 rs_outLat = rs_loadF * rs_capLatCt;
51295136 rs_outFan = rs_inFan = rs_loadF * rs_speedF * rs_fanHeatC; // all fan heat to air
51305137 runFFan = rs_loadF;
5131- rs_outSenTot = rs_outSen + rs_outFan; // gross output
5138+ rs_outSenTot = rs_outSen + rs_outFan; // net cooling output, Btuh (generally < 0)
51325139
51335140 if (!rs_IsVCClg () || rs_speedF == 1 .f )
51345141 { rs_runF = rs_loadF;
0 commit comments