Skip to content

Commit f7249d7

Browse files
committed
fix cooling with similar approach as heating
1 parent cf6d16c commit f7249d7

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

src/EnergyPlus/DXCoils.cc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ void SimDXCoil(EnergyPlusData &state,
234234
CalcDXHeatingCoil(state, DXCoilNum, PartLoadRatio, FanOpMode, AirFlowRatio, MaxCap);
235235
} break;
236236
case CoilVRF_FluidTCtrl_Cooling: {
237-
CalcVRFCoolingCoil_FluidTCtrl(state, DXCoilNum, CompressorOperation::On, FirstHVACIteration, PartLoadRatio, FanOpMode, CompCycRatio, _, _);
237+
CalcVRFCoolingCoil_FluidTCtrl(
238+
state, DXCoilNum, CompressorOperation::On, FirstHVACIteration, PartLoadRatio, FanOpMode, CompCycRatio, _, _, MaxCap);
238239
} break;
239240
case CoilVRF_FluidTCtrl_Heating: {
240241
CalcVRFHeatingCoil_FluidTCtrl(state, CompressorOp, DXCoilNum, PartLoadRatio, FanOpMode, _, MaxCap);
@@ -6962,7 +6963,7 @@ void InitDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the cur
69626963
} else if (thisDXCoil.DXCoilType_Num == DataHVACGlobals::CoilVRF_Cooling) {
69636964
CalcVRFCoolingCoil(state, DXCoilNum, CompressorOperation::On, false, 1.0, 1.0, 1.0, _, _, _);
69646965
} else if (thisDXCoil.DXCoilType_Num == DataHVACGlobals::CoilVRF_FluidTCtrl_Cooling) {
6965-
CalcVRFCoolingCoil_FluidTCtrl(state, DXCoilNum, CompressorOperation::On, false, 1.0, 1.0, 1.0, _, _);
6966+
CalcVRFCoolingCoil_FluidTCtrl(state, DXCoilNum, CompressorOperation::On, false, 1.0, 1.0, 1.0, _, _, _);
69666967
}
69676968

69686969
// coil outlets
@@ -16613,7 +16614,8 @@ void CalcVRFCoolingCoil_FluidTCtrl(EnergyPlusData &state,
1661316614
int const FanOpMode, // Allows parent object to control fan operation
1661416615
Real64 const CompCycRatio, // cycling ratio of VRF condenser
1661516616
ObjexxFCL::Optional_int_const PerfMode, // Performance mode for MultiMode DX coil; Always 1 for other coil types
16616-
ObjexxFCL::Optional<Real64 const> OnOffAirFlowRatio // ratio of compressor on airflow to compressor off airflow
16617+
ObjexxFCL::Optional<Real64 const> OnOffAirFlowRatio, // ratio of compressor on airflow to compressor off airflow
16618+
ObjexxFCL::Optional<Real64 const> MaxCoolCap // maximum allowed cooling capacity
1661716619
)
1661816620
{
1661916621
// SUBROUTINE INFORMATION:
@@ -16838,7 +16840,12 @@ void CalcVRFCoolingCoil_FluidTCtrl(EnergyPlusData &state,
1683816840
ShowFatalError(state, format("{} \"{}\" - Rated total cooling capacity is zero or less.", thisDXCoil.DXCoilType, thisDXCoil.Name));
1683916841
}
1684016842

16841-
TotCap = thisDXCoil.RatedTotCap(Mode);
16843+
if (present(MaxCoolCap)) {
16844+
TotCap = min(MaxCoolCap, thisDXCoil.RatedTotCap(Mode));
16845+
} else {
16846+
TotCap = thisDXCoil.RatedTotCap(Mode);
16847+
}
16848+
1684216849
QCoilReq = -PartLoadRatio * TotCap;
1684316850
if (PartLoadRatio == 0.0) {
1684416851
AirMassFlowMin = state.dataHVACVarRefFlow->OACompOffMassFlow;

src/EnergyPlus/DXCoils.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,8 @@ namespace DXCoils {
881881
int const FanOpMode, // Allows parent object to control fan operation
882882
Real64 const CompCycRatio, // cycling ratio of VRF condenser
883883
ObjexxFCL::Optional_int_const PerfMode, // Performance mode for MultiMode DX coil; Always 1 for other coil types
884-
ObjexxFCL::Optional<Real64 const> OnOffAirFlowRatio // ratio of compressor on airflow to compressor off airflow
884+
ObjexxFCL::Optional<Real64 const> OnOffAirFlowRatio, // ratio of compressor on airflow to compressor off airflow
885+
ObjexxFCL::Optional<Real64 const> MaxCoolCap // maximum allowed cooling capacity
885886
);
886887

887888
void

src/EnergyPlus/HVACVariableRefrigerantFlow.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11369,6 +11369,7 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
1136911369
Real64 T_comp_in; // temperature of refrigerant at compressor inlet, after piping loss (c) [C]
1137011370
Real64 TU_HeatingLoad; // Heating load from terminal units, excluding heating loss [W]
1137111371
Real64 TU_CoolingLoad; // Cooling load from terminal units, excluding heating loss [W]
11372+
Real64 TU_CoolingLoad_actual; // TU_CoolingLoad trimed to maximum system capacity[W]
1137211373
Real64 Tdischarge; // VRF Compressor discharge refrigerant temperature [C]
1137311374
Real64 Tsuction; // VRF compressor suction refrigerant temperature [C]
1137411375
Real64 Tolerance; // Tolerance for condensing temperature calculation [C]
@@ -11436,6 +11437,7 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
1143611437
}
1143711438
this->TUCoolingLoad = TU_CoolingLoad; // this is cooling coil load, not terminal unit load
1143811439
this->TUHeatingLoad = TU_HeatingLoad; // this is heating coil load, not terminal unit load
11440+
TU_CoolingLoad_actual = TU_CoolingLoad;
1143911441

1144011442
// loop through TU's and calculate average inlet conditions for active coils
1144111443
for (NumTU = 1; NumTU <= NumTUInList; ++NumTU) {
@@ -11571,9 +11573,7 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
1157111573
if (Q_c_TU_PL > CompEvaporatingCAPSpdMax) {
1157211574
// Required load is beyond the max system capacity
1157311575

11574-
Q_c_TU_PL = CompEvaporatingCAPSpdMax;
11575-
TU_CoolingLoad = CompEvaporatingCAPSpdMax;
11576-
this->TUCoolingLoad = TU_CoolingLoad;
11576+
TU_CoolingLoad_actual = min(TU_CoolingLoad, CompEvaporatingCAPSpdMax);
1157711577
RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(Pevap, RefPHigh), RefPLow), RefrigerantIndex, RoutineName);
1157811578
h_IU_evap_out = GetSupHeatEnthalpyRefrig(state,
1157911579
this->RefrigerantName,
@@ -11582,7 +11582,7 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
1158211582
RefrigerantIndex,
1158311583
RoutineName);
1158411584
SH_IU_merged = 3;
11585-
m_ref_IU_evap = TU_CoolingLoad / (h_IU_evap_out - h_IU_evap_in);
11585+
m_ref_IU_evap = TU_CoolingLoad_actual / (h_IU_evap_out - h_IU_evap_in);
1158611586

1158711587
} else {
1158811588

@@ -11734,12 +11734,12 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
1173411734
this->CoffEvapCap * this->RatedEvapCapacity *
1173511735
CurveValue(
1173611736
state, this->OUCoolingCAPFT(NumOfCompSpdInput), Tdischarge, Tsuction); // Include the piping loss, at the highest compressor speed
11737-
this->PipingCorrectionCooling = TU_CoolingLoad / (TU_CoolingLoad + Pipe_Q_c);
11737+
this->PipingCorrectionCooling = TU_CoolingLoad_actual / (TU_CoolingLoad_actual + Pipe_Q_c);
1173811738
state.dataHVACVarRefFlow->MaxCoolingCapacity(VRFCond) = this->CoolingCapacity; // for report, maximum evaporating capacity of the system
1173911739

1174011740
this->HeatingCapacity = 0.0; // Include the piping loss
1174111741
this->PipingCorrectionHeating = 1.0; // 1 means no piping loss
11742-
state.dataHVACVarRefFlow->MaxHeatingCapacity(VRFCond) = 0.0;
11742+
state.dataHVACVarRefFlow->MaxHeatingCapacity(VRFCond) = 0.0; // yujie: might be wrong here too, should be MaxCap = 1e+20
1174311743

1174411744
this->OUCondHeatRate = Q_h_OU;
1174511745
this->OUEvapHeatRate = 0;
@@ -11957,7 +11957,7 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
1195711957

1195811958
this->CoolingCapacity = 0.0; // Include the piping loss
1195911959
this->PipingCorrectionCooling = 0.0;
11960-
state.dataHVACVarRefFlow->MaxCoolingCapacity(VRFCond) = 0.0; // for report
11960+
state.dataHVACVarRefFlow->MaxCoolingCapacity(VRFCond) = 0.0; // for report . yujie: might be wrong here too, should be MaxCap = 1e+20
1196111961

1196211962
this->OUCondHeatRate = 0;
1196311963
this->OUEvapHeatRate = Q_c_OU;

0 commit comments

Comments
 (0)