Skip to content

Commit 380d580

Browse files
author
Yujie Xu
committed
use newly derived r to compute compressor speed and Q_evap_req
how r is derived: in the original code Q_evap_req = Q_cond_req - CompEvaporatingPWRSpd(CounterCompSpdTemp); I think the intent was Q_cond_req = Q_req = Q_evap_req + compressor heat but compressor heat might not actually be CompEvaporatingPWRSpd(CounterCompSpdTemp) let k be the speed level C be the short form for C_cap_operation PWR(.) be the short form of CompEvaporatingPWRSpd(.) CAP(.) be the short form of CompEvaporatingCAPSpd(.) spd(.) be the short form of this->CompressorSpeed(.) deltaPWR be PWR(k) - PWR(k - 1) deltaCAP be CAP(k) - CAP(k - 1) I think compressor heat should be this instead of just PWR(k) compressor heat = deltaPWR * r + PWR(k - 1) so Q_cond_req = Q_req = Q_evap_req + deltaPWR * r + PWR(k - 1) <---- eq 1 we also know this from the CompSpdActual calculation equation that CompSpdActual = Spd(k - 1) + deltaSpd / deltaCAP * (Q_evap_req * C - CAP(k - 1)) so we call the following r r = (Q_evap_req * C - CAP(k - 1)) / deltaCAP so CompSpdActual = Spd(k - 1) + deltaSpd * r arranging terms in eq 1 Q_cond_req - deltaPWR * r - PWR(k - 1) = Q_evap_req (Q_cond_req - deltaPWR * r - PWR(k - 1)) * C - CAP(k - 1) = Q_evap_req * C - CAP(k - 1) ((Q_cond_req - deltaPWR * r - PWR(k - 1)) * C - CAP(k - 1)) / deltaCAP = (Q_evap_req * C - CAP(k - 1)) / deltaCAP ((Q_cond_req - deltaPWR * r - PWR(k - 1)) * C - CAP(k - 1)) / deltaCAP = r (Q_cond_req - deltaPWR * r - PWR(k - 1)) * C - CAP(k - 1) = deltaCAP * r (Q_cond_req - PWR(k - 1)) * C - CAP(k - 1) = deltaCAP * r + deltaPWR * r * C so r = ((Q_cond_req - PWR(k - 1)) * C - CAP(k - 1)) / (deltaCAP + deltaPWR * C) = ((Q_cond_req - PWR(k - 1)) - CAP(k - 1)/C) / (deltaCAP/C + deltaPWR) in the special case where k = 1, then k - 1, PWR(k - 1) and CAP(k - 1) will all be 0 r = ((Q_cond_req) * C) / (CAP(1) + PWR(1) * C) = (Q_cond_req) / (CAP(1)/C + PWR(1))
1 parent a777bf5 commit 380d580

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

src/EnergyPlus/HVACVariableRefrigerantFlow.cc

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13703,30 +13703,30 @@ void VRFCondenserEquipment::VRFOU_CompSpd(
1370313703

1370413704
Q_cond_req = Q_req;
1370513705

13706-
for (CounterCompSpdTemp = 1; CounterCompSpdTemp <= NumOfCompSpdInput; CounterCompSpdTemp++) {
13707-
// Iteration to find the VRF speed that can meet the required load, Iteration DoName1
13708-
13709-
CompEvaporatingPWRSpd(CounterCompSpdTemp) =
13710-
this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(CounterCompSpdTemp), T_discharge, T_suction);
13711-
CompEvaporatingCAPSpd(CounterCompSpdTemp) =
13712-
this->CoffEvapCap * this->RatedEvapCapacity * CurveValue(state, this->OUCoolingCAPFT(CounterCompSpdTemp), T_discharge, T_suction);
13713-
Real64 PLR = Q_cond_req / (CompEvaporatingCAPSpd(CounterCompSpdTemp) + CompEvaporatingPWRSpd(CounterCompSpdTemp));
13714-
13715-
if (PLR <= 1.0) {
13716-
// Compressor speed stage CounterCompSpdTemp need not to be increased, finish Iteration DoName1
13717-
13718-
if (CounterCompSpdTemp > 1) {
13719-
13720-
CompSpdLB = CounterCompSpdTemp - 1;
13721-
CompSpdUB = CounterCompSpdTemp;
13722-
13723-
CompSpdActual = this->CompressorSpeed(CompSpdLB) + (this->CompressorSpeed(CompSpdUB) - this->CompressorSpeed(CompSpdLB)) * PLR;
13724-
13725-
} else {
13726-
CompSpdActual = this->CompressorSpeed(1) * PLR;
13706+
CounterCompSpdTemp = 1;
13707+
CompEvaporatingPWRSpd(1) = this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(1), T_discharge, T_suction);
13708+
CompEvaporatingCAPSpd(1) = this->CoffEvapCap * this->RatedEvapCapacity * CurveValue(state, this->OUCoolingCAPFT(1), T_discharge, T_suction);
13709+
Real64 r = (Q_cond_req * C_cap_operation) / (CompEvaporatingCAPSpd(1) + CompEvaporatingPWRSpd(1) * C_cap_operation);
13710+
if (r < 1.0) {
13711+
CompSpdActual = this->CompressorSpeed(1) * r;
13712+
Q_evap_req = Q_cond_req - CompEvaporatingPWRSpd(1) * r;
13713+
} else {
13714+
for (CounterCompSpdTemp = 2; CounterCompSpdTemp <= NumOfCompSpdInput; CounterCompSpdTemp++) {
13715+
CompEvaporatingPWRSpd(CounterCompSpdTemp) =
13716+
this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(CounterCompSpdTemp), T_discharge, T_suction);
13717+
CompEvaporatingCAPSpd(CounterCompSpdTemp) =
13718+
this->CoffEvapCap * this->RatedEvapCapacity * CurveValue(state, this->OUCoolingCAPFT(CounterCompSpdTemp), T_discharge, T_suction);
13719+
CompSpdLB = CounterCompSpdTemp - 1;
13720+
CompSpdUB = CounterCompSpdTemp;
13721+
Real64 deltaCAP = CompEvaporatingCAPSpd(CompSpdUB) - CompEvaporatingCAPSpd(CompSpdLB);
13722+
Real64 deltaPWR = CompEvaporatingPWRSpd(CompSpdUB) - CompEvaporatingPWRSpd(CompSpdLB);
13723+
Real64 r = ((Q_cond_req - CompEvaporatingPWRSpd(CompSpdLB)) * C_cap_operation - CompEvaporatingCAPSpd(CompSpdLB)) /
13724+
(deltaCAP + deltaPWR * C_cap_operation);
13725+
if (r < 1.0) {
13726+
CompSpdActual = this->CompressorSpeed(CompSpdLB) + (this->CompressorSpeed(CompSpdUB) - this->CompressorSpeed(CompSpdLB)) * r;
13727+
Q_evap_req = Q_cond_req - deltaPWR * r - CompEvaporatingPWRSpd(CompSpdLB);
13728+
break;
1372713729
}
13728-
13729-
break; // EXIT DoName1
1373013730
}
1373113731
} // End: Iteration DoName1
1373213732

0 commit comments

Comments
 (0)