Skip to content
Merged
97 changes: 79 additions & 18 deletions src/EnergyPlus/SingleDuct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ void GetSysInput(EnergyPlusData &state)
airTerm.SysName = Alphas(1);
airTerm.sysType = CurrentModuleObject;
airTerm.SysType_Num = SysType::SingleDuctVAVReheat;

airTerm.ReheatComp = Alphas(7);
if (Util::SameString(airTerm.ReheatComp, "Coil:Heating:Fuel")) {
airTerm.ReheatComp_Num = HeatingCoilType::Gas;
Expand All @@ -380,12 +381,28 @@ void GetSysInput(EnergyPlusData &state)
ShowContinueError(state, format("Occurs in {} = {}", airTerm.sysType, airTerm.SysName));
ErrorsFound = true;
}

airTerm.ReheatName = Alphas(8);
ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType);
if (IsNotOK) {
ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName));
ErrorsFound = true;
if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the changes. They occur in about four different places.

HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
ErrorsFound = true;
}
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) {
airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
ErrorsFound = true;
}
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) {
airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
ErrorsFound = true;
}
}

if (lAlphaBlanks(2)) {
airTerm.availSched = Sched::GetScheduleAlwaysOn(state);
} else if ((airTerm.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) {
Expand Down Expand Up @@ -692,12 +709,26 @@ void GetSysInput(EnergyPlusData &state)
ErrorsFound = true;
}
airTerm.ReheatName = Alphas(6);
ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType);
if (IsNotOK) {
ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName));
ErrorsFound = true;
if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here they are again.

HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
ErrorsFound = true;
}
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) {
airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
ErrorsFound = true;
}
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) {
airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
ErrorsFound = true;
}
}

if (lAlphaBlanks(2)) {
airTerm.availSched = Sched::GetScheduleAlwaysOn(state);
} else if ((airTerm.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) {
Expand Down Expand Up @@ -919,12 +950,26 @@ void GetSysInput(EnergyPlusData &state)
ErrorsFound = true;
}
airTerm.ReheatName = Alphas(6);
ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType);
if (IsNotOK) {
ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName));
ErrorsFound = true;
if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) {
HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
ErrorsFound = true;
}
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) {
airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
ErrorsFound = true;
}
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) {
airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(6), Alphas(6));
ErrorsFound = true;
}
}

if (lAlphaBlanks(2)) {
airTerm.availSched = Sched::GetScheduleAlwaysOn(state);
} else if ((airTerm.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) {
Expand Down Expand Up @@ -1654,11 +1699,27 @@ void GetSysInput(EnergyPlusData &state)
ShowContinueError(state, format("Occurs in {} = {}", airTerm.sysType, airTerm.SysName));
ErrorsFound = true;
}
ValidateComponent(state, airTerm.ReheatComp, airTerm.ReheatName, IsNotOK, airTerm.sysType);
if (IsNotOK) {
ShowContinueError(state, format("In {} = {}", airTerm.sysType, airTerm.SysName));
ErrorsFound = true;

if (airTerm.ReheatComp_Num == HeatingCoilType::Gas || airTerm.ReheatComp_Num == HeatingCoilType::Electric) {
HeatingCoils::GetCoilIndex(state, airTerm.ReheatName, airTerm.ReheatComp_Index, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
ErrorsFound = true;
}
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SimpleHeating) {
airTerm.ReheatComp_Index = WaterCoils::GetWaterCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
ErrorsFound = true;
}
} else if (airTerm.ReheatComp_Num == HeatingCoilType::SteamAirHeating) {
airTerm.ReheatComp_Index = SteamCoils::GetSteamCoilIndex(state, airTerm.ReheatComp, airTerm.ReheatName, ErrorsFound);
if (airTerm.ReheatComp_Index == 0) {
ShowSevereItemNotFound(state, eoh, cAlphaFields(8), Alphas(8));
ErrorsFound = true;
}
}


airTerm.fanType = static_cast<HVAC::FanType>(getEnumValue(HVAC::fanTypeNamesUC, Alphas(5)));

Expand Down
Loading