Skip to content

Commit 35d4b69

Browse files
author
Yujie Xu
committed
add converge check that h_comp_out_new changed
1 parent 765218b commit 35d4b69

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/EnergyPlus/HVACVariableRefrigerantFlow.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11123,6 +11123,8 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
1112311123
Real64 h_comp_in_new; // enthalpy of refrigerant at compressor inlet (new) [kJ/kg]
1112411124
Real64 h_comp_out; // enthalpy of refrigerant at compressor outlet [kJ/kg]
1112511125
Real64 h_comp_out_new; // enthalpy of refrigerant at compressor outlet (new) [kJ/kg]
11126+
Real64 h_comp_out_new_prev; // previous value of h_comp_out_new
11127+
Real64 tol_h_comp_out_new; // tolerance of h_comp_out_new change
1112611128
Real64 m_air; // OU coil air mass flow rate [kg/s]
1112711129
Real64 m_ref_IU_cond; // mass flow rate of Refrigerant through IU condensers [kg/s]
1112811130
Real64 m_ref_IU_cond_i; // mass flow rate of Refrigerant through an individual IU condenser [kg/s]
@@ -11214,6 +11216,8 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
1121411216
RefPLow = this->refrig->PsLowPresValue; // Low Pressure Value for Ps (>0.0)
1121511217
RefPHigh = this->refrig->PsHighPresValue; // High Pressure Value for Ps (max in tables)
1121611218

11219+
tol_h_comp_out_new = 1e-10;
11220+
1121711221
// sum loads on TU coils
1121811222
for (NumTU = 1; NumTU <= NumTUInList; ++NumTU) {
1121911223
TU_CoolingLoad += state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).TotalCoolLoad(NumTU);
@@ -11924,10 +11928,11 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
1192411928
}
1192511929

1192611930
//* Update h_comp_out in iteration (Label230)
11931+
h_comp_out_new_prev = h_comp_out_new;
1192711932
h_comp_out_new = Ncomp / (m_ref_IU_evap + m_ref_OU_evap) + h_comp_in;
1192811933

1192911934
if ((std::abs(h_comp_out - h_comp_out_new) > Tolerance * h_comp_out) && (h_IU_cond_in < h_IU_cond_in_up) &&
11930-
(h_IU_cond_in_low < h_IU_cond_in)) {
11935+
(h_IU_cond_in_low < h_IU_cond_in) && std::abs(h_comp_out_new - h_comp_out_new_prev) > tol_h_comp_out_new) {
1193111936
Real64 h_IU_cond_in_old = h_IU_cond_in;
1193211937
if (h_comp_out < h_comp_out_new) {
1193311938
h_IU_cond_in = h_IU_cond_in + 0.1 * (h_IU_cond_in_up - h_IU_cond_in_low);

0 commit comments

Comments
 (0)