Skip to content

Commit 12ddab2

Browse files
committed
Fix issue with autosized water coil showing User-Specified and crash with IHP
1 parent 7d05580 commit 12ddab2

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/EnergyPlus/WaterCoils.cc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,11 @@ void GetWaterCoilInput(EnergyPlusData &state)
719719
waterCoil.MaxWaterVolFlowRate = NumArray(1); // Liquid mass flow rate at Design kg/s
720720
if (waterCoil.MaxWaterVolFlowRate == DataSizing::AutoSize) waterCoil.RequestingAutoSize = true;
721721
waterCoil.DesAirVolFlowRate = NumArray(2); // Dry air mass flow rate at Design (kg/s)
722-
if (waterCoil.DesAirVolFlowRate == DataSizing::AutoSize) waterCoil.RequestingAutoSize = true;
722+
if (waterCoil.DesAirVolFlowRate == DataSizing::AutoSize) {
723+
waterCoil.RequestingAutoSize = true;
724+
} else {
725+
waterCoil.DesAirVolFlowRateIsAutosized = false;
726+
}
723727
waterCoil.DesInletWaterTemp = NumArray(3); // Entering water temperature at Design C
724728
if (waterCoil.DesInletWaterTemp == DataSizing::AutoSize) waterCoil.RequestingAutoSize = true;
725729
waterCoil.DesInletAirTemp = NumArray(4); // Entering air dry bulb temperature at Design(C)
@@ -2222,6 +2226,12 @@ void SizeWaterCoil(EnergyPlusData &state, int const CoilNum)
22222226
} else {
22232227
bPRINT = true;
22242228
}
2229+
if (waterCoil.DesAirVolFlowRateIsAutosized && waterCoil.DesAirVolFlowRate > 0.0) {
2230+
state.dataSize->DataConstantUsedForSizing = 1.0;
2231+
state.dataSize->DataFractionUsedForSizing = waterCoil.DesAirVolFlowRate;
2232+
waterCoil.DesAirVolFlowRate = DataSizing::AutoSize;
2233+
} else {
2234+
}
22252235
TempSize = waterCoil.DesAirVolFlowRate;
22262236
CoolingAirFlowSizer sizingCoolingAirFlow2;
22272237
std::string stringOverride = "Design Air Flow Rate [m3/s]";
@@ -2231,6 +2241,8 @@ void SizeWaterCoil(EnergyPlusData &state, int const CoilNum)
22312241
sizingCoolingAirFlow2.initializeWithinEP(state, HVAC::coilTypeNames[(int)waterCoil.coilType], CompName, bPRINT, RoutineName);
22322242
waterCoil.DesAirVolFlowRate = sizingCoolingAirFlow2.size(state, TempSize, ErrorsFound);
22332243
waterCoil.DesAirMassFlowRate = waterCoil.DesAirVolFlowRate * state.dataEnvrn->StdRhoAir;
2244+
state.dataSize->DataConstantUsedForSizing = 0.0;
2245+
state.dataSize->DataFractionUsedForSizing = 0.0;
22342246

22352247
if (waterCoil.DesAirVolFlowRate <= 0.0) {
22362248
waterCoil.DesAirVolFlowRate = 0.0;

src/EnergyPlus/WaterCoils.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ namespace WaterCoils {
147147
// Design Input Variables to the Design Detailed Simple inputs model
148148
Real64 DesInletWaterTemp; // Entering water temperature at Design(C)
149149
Real64 DesAirVolFlowRate; // Entering Air Volume Flow Rate Design( m3/s)
150+
bool DesAirVolFlowRateIsAutosized = true;
150151
Real64 DesInletAirTemp; // Entering air dry bulb temperature at Design(C)
151152
Real64 DesInletAirHumRat; // Entering air humidity ratio at design conditions
152153
Real64 DesTotWaterCoilLoad; // Total heat transfer rate at Design(Watt)

src/EnergyPlus/WaterThermalTanks.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8838,7 +8838,7 @@ void WaterThermalTankData::CalcHeatPumpWaterHeater(EnergyPlusData &state, bool c
88388838
}
88398839
// pass node info and simulate crankcase heater
88408840
if (MaxSpeedNum > 0) {
8841-
int VSCoilNum = (HeatPump.bIsIHP) ? state.dataIntegratedHP->IntegratedHeatPumps(VSCoilNum).SCWHCoilNum : HeatPump.DXCoilNum;
8841+
int VSCoilNum = (HeatPump.bIsIHP) ? state.dataIntegratedHP->IntegratedHeatPumps(HeatPump.DXCoilNum).SCWHCoilNum : HeatPump.DXCoilNum;
88428842

88438843
// set the SCWH mode
88448844
Real64 SpeedRatio = 1.0; // speed ratio for interpolating between two speed levels

0 commit comments

Comments
 (0)