Skip to content

Commit 705588c

Browse files
authored
Merge pull request #578 from cse-sim/rsys-mzbug
Performance map based RSYS multizone bug fix
2 parents 1ffd4ae + 3717483 commit 705588c

File tree

5 files changed

+7997
-22
lines changed

5 files changed

+7997
-22
lines changed

src/ashwface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ RC FENAW::fa_Subhr( // subhr calcs for single time step
611611
// transmitted SW solar, Btuh/ft2
612612
fa_pXS->xs_glzTrans = fa_mSolar * (sbcO.sb_sgTarg.st_bm*fa_BmTauF(iH) + sbcO.sb_sgTarg.st_df*fa_DfTauF());
613613

614-
#if defined( _DEBUG)
614+
#if 0 && defined( _DEBUG)
615615
if (fa_absSlr[nL] > 0.)
616616
{
617617
double trans2 = fa_mSolar * IrSItoIP(fa_absSlr[nL]);

src/cnloads.cpp

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,33 +1278,43 @@ RC ZNR::zn_AirRequest( // determine air requirement given rs_asSup
12781278
orWarn("Flipped tSup RSYS='%s', tPln=%0.3f, tSup=%0.3f, tSP=%0.1f, tZn=%0.3f\n",
12791279
rs->Name(), rs->rs_asOut.as_tdb, tSup0, zn_tzsp, tz);
12801280
}
1281+
if (zn_hcMode != RSYS::rsmOFF && zn_tzsp > 0.f)
1282+
orWarn("Inconsistent hcMode RSYS='%s', hcMode=%d, tSP=%0.1f, tZn=%0.3f\n",
1283+
rs->Name(), zn_hcMode, zn_tzsp, tz);
12811284
#endif
12821285

1283-
double amfSup0 = zn_AmfHvacCR(zn_tzsp, tSup0); // dry air mass flow rate required to hold
1286+
// if zone needs conditioning
1287+
// Note: RSYS::rs_ZoneAirRequest() has no effect for air flow = 0, OK to skip calls
1288+
if (zn_hcMode != RSYS::rsmOFF)
1289+
{
1290+
// dry air mass flow rate required to hold setpoint, lbm/hr
1291+
double amfSup0 = zn_AmfHvacCR(zn_tzsp, tSup0);
1292+
12841293
#if 0 && defined(_DEBUG)
1285-
double qLoad = zn_QAirCR(zn_tzsp);
1286-
// load at system, Btuh
1287-
double qLoad0 = rs->rs_asOut.as_QSenDiff2(rs->rs_asIn, amfSup0);
1288-
if (fabs(qLoad - qLoad0) > 5.)
1289-
printf("\nzn_AirRequest mismatch");
1294+
double qLoad = zn_QAirCR(zn_tzsp);
1295+
// load at system, Btuh
1296+
double qLoad0 = rs->rs_asOut.as_QSenDiff2(rs->rs_asIn, amfSup0);
1297+
if (fabs(qLoad - qLoad0) > 5.)
1298+
printf("\nzn_AirRequest mismatch");
12901299
#endif
12911300

1292-
zn_rsAmfSysReq[0] = rs->rs_ZoneAirRequest(amfSup0, 0); // notify system of requirement
1293-
CHECKFP(zn_rsAmfSysReq[0]); // check for NaN etc (debug only)
1301+
zn_rsAmfSysReq[0] = rs->rs_ZoneAirRequest(amfSup0, 0); // notify system of requirement
1302+
CHECKFP(zn_rsAmfSysReq[0]); // check for NaN etc (debug only)
12941303

1295-
if (zn_hcMode == RSYS::rsmHEAT && rs->rs_CanHaveAuxHeat() && rs->rs_speedF==1.f)
1296-
{ // HP heating full speed: repeat calc with full aux
1297-
double tSup1 = rs->rs_asSupAux.as_tdb;
1298-
double amfSup1 = zn_AmfHvacCR(zn_tzsp, tSup1);
1299-
zn_rsAmfSysReq[1] = rs->rs_ZoneAirRequest(amfSup1, 1);
1304+
if (zn_hcMode == RSYS::rsmHEAT && rs->rs_CanHaveAuxHeat() && rs->rs_speedF==1.f)
1305+
{ // HP heating full speed: repeat calc with full aux
1306+
double tSup1 = rs->rs_asSupAux.as_tdb;
1307+
double amfSup1 = zn_AmfHvacCR(zn_tzsp, tSup1);
1308+
zn_rsAmfSysReq[1] = rs->rs_ZoneAirRequest(amfSup1, 1);
13001309
#if defined( _DEBUG)
1301-
double qHt0 = amfSup0 * (tSup0 - zn_tzsp);
1302-
double qHt1 = amfSup1 * (tSup1 - zn_tzsp);
1303-
// zn_AmfHvacCR can return DBL_MAX
1304-
if (qHt0 > 0. && qHt0 < 1.e10 && qHt1 > 0. && qHt1 < 1.e10
1305-
&& frDiff(qHt0, qHt1) > .001)
1306-
printf("\nqHt mismatch");
1310+
double qHt0 = amfSup0 * (tSup0 - zn_tzsp);
1311+
double qHt1 = amfSup1 * (tSup1 - zn_tzsp);
1312+
// zn_AmfHvacCR can return DBL_MAX
1313+
if (qHt0 > 0. && qHt0 < 1.e10 && qHt1 > 0. && qHt1 < 1.e10
1314+
&& frDiff(qHt0, qHt1) > .001)
1315+
printf("\nqHt mismatch");
13071316
#endif
1317+
}
13081318
}
13091319
return rc;
13101320
} // ZNR::zn_AirRequest
@@ -5418,7 +5428,7 @@ void RSYS::rs_ClearSubhrResults(
54185428
rs_amf = 0.;
54195429
rs_fanPwr = 0.f;
54205430
rs_amfReq[0] = rs_amfReq[1] = 0.;
5421-
rs_znLoad[0] = rs_znLoad[1] = 0.;
5431+
rs_znLoad[0] = rs_znLoad[1] = 0.f;
54225432
rs_asRet.as_Init();
54235433
rs_asIn.as_Init();
54245434
rs_twbIn = 0.;
@@ -5735,7 +5745,10 @@ double RSYS::rs_ZoneAirRequest( // air quantity needed by zone
57355745
int iAux /*=0*/) // 0 = primary mode (compressor)
57365746
// 1 = aux mode (aux alone or main+aux (ASHP heating only)
57375747
// each zone needing conditioning requests air
5738-
// returns RSYS (not supply register) amf needed to provide zone requirement
5748+
// Note: no effect if znSupReq = 0 (OK to skip call)
5749+
//
5750+
// returns RSYS amf (not supply register amf) needed to provide zone requirement, lbm/hr
5751+
57395752
{
57405753
// handle impossible requests
57415754
// supplyDT = tz - tSup

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ make_cse_test(ashpPkgRoom)
5555
make_cse_test(ashp_dfng)
5656
make_cse_test(perfmap)
5757
make_cse_test(perfmap3)
58+
make_cse_test(perfmap2z)
5859
make_cse_test(fancoil)
5960
make_cse_test(wshp)
6061
make_cse_test(herv)

0 commit comments

Comments
 (0)