Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/EnergyPlus/ZoneTempPredictorCorrector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5681,17 +5681,14 @@ void CalcZoneComponentLoadSums(EnergyPlusData &state,
}
}
}
// now calculate air energy storage source term.
// capacitance is volume * density * heat capacity
Real64 CpAir = Psychrometrics::PsyCpAirFnW(thisHB->airHumRat);
Real64 RhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, thisHB->MAT, thisHB->airHumRat);

// Calculate the air energy storage term using the same capacitance and time integration method as the zone air temperature solver.
switch (state.dataHeatBal->ZoneAirSolutionAlgo) {
case DataHeatBalance::SolutionAlgo::ThirdOrder: {
thisAirRpt.CzdTdt = RhoAir * CpAir * thisZone.Volume * thisZone.ZoneVolCapMultpSens * (thisHB->MAT - thisHB->ZTM[0]) / TimeStepSysSec;
// Exact solution
thisAirRpt.CzdTdt =
thisHB->AirPowerCap * ((11.0 / 6.0) * thisHB->MAT - 3.0 * thisHB->ZTM[0] + (3.0 / 2.0) * thisHB->ZTM[1] - (1.0 / 3.0) * thisHB->ZTM[2]);
} break;
case DataHeatBalance::SolutionAlgo::AnalyticalSolution: {
// Exact solution
thisAirRpt.CzdTdt = thisHB->TempIndCoef - thisHB->TempDepCoef * thisHB->MAT;
} break;
case DataHeatBalance::SolutionAlgo::EulerMethod: {
Expand Down
20 changes: 20 additions & 0 deletions tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,26 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_calcZoneOrSpaceSums_SurfCon
EXPECT_NEAR(7328.768356, thisZoneHB.SumSysMCpT, 0.0001);
}

TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_ThirdOrderComponentLoadStorageTest)
{
state->init_state(*state);

state->dataHeatBal->Zone.allocate(1);
state->dataHeatBalFanSys->SumConvHTRadSys.allocate(1);
state->dataHeatBalFanSys->SumConvPool.allocate(1);

ZoneTempPredictorCorrector::ZoneHeatBalanceData zoneHB;
zoneHB.AirPowerCap = 100.0;
zoneHB.MAT = 23.0;
zoneHB.ZTM = {20.0, 19.0, 18.0, 0.0};

state->dataHeatBal->ZoneAirSolutionAlgo = DataHeatBalance::SolutionAlgo::ThirdOrder;
DataHeatBalance::AirReportVars airReport;
CalcZoneComponentLoadSums(*state, 1, &zoneHB, airReport);

EXPECT_NEAR(1400.0 / 3.0, airReport.CzdTdt, 1.0e-10);
}

TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_EMSOverrideSetpointTest)
{
// AUTHOR: L. Gu, FSEC
Expand Down
Loading