Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ \subsubsection{Inputs}\label{inputs-051}

\paragraph{Field: Thermostat Priority Schedule Name}\label{field-thermostat-priority-schedule-name-000}

This alpha field identifies the schedule used when the previous field is set to Scheduled. Schedule values of 0 denote heating mode while values of 1 denote cooling mode. Any other values will force the system off.
This alpha field identifies the schedule used when the previous field is set to Scheduled. Schedule values of 0 denote cooling mode while values of 1 denote heating mode. Any other values will force the system off.
Copy link
Copy Markdown
Collaborator Author

@mitchute mitchute Jun 1, 2026

Choose a reason for hiding this comment

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

IDD vs. the code & docs had these reversed. I deferred to the IDD, but we can change that if the reverse would be better.


\paragraph{Field: Zone Terminal Unit List Name}\label{field-zone-terminal-unit-list-name}

Expand Down
19 changes: 8 additions & 11 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound)
ErrorsFound = true;
}

if (thisVrfSys.ThermostatPriority == ThermostatCtrlType::ScheduledPriority) {
if (thisVrfSys.ThermostatPriority == ThermostatCtrlType::Scheduled) {
Copy link
Copy Markdown
Collaborator Author

@mitchute mitchute Jun 1, 2026

Choose a reason for hiding this comment

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

Renamed to be consistent with the IDD key choice.

if (lAlphaFieldBlanks(26)) {
ShowSevereEmptyField(state, eoh, cAlphaFieldNames(26), cAlphaFieldNames(25), cAlphaArgs(25));
} else if ((thisVrfSys.prioritySched = Sched::GetSchedule(state, cAlphaArgs(26))) == nullptr) {
Expand Down Expand Up @@ -2761,7 +2761,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound)
} else if (Util::SameString(ThermostatPriorityType, "ThermostatOffsetPriority")) {
thisVrfFluidCtrl.ThermostatPriority = ThermostatCtrlType::ThermostatOffsetPriority;
} else if (Util::SameString(ThermostatPriorityType, "Scheduled")) {
thisVrfFluidCtrl.ThermostatPriority = ThermostatCtrlType::ScheduledPriority;
thisVrfFluidCtrl.ThermostatPriority = ThermostatCtrlType::Scheduled;
} else if (Util::SameString(ThermostatPriorityType, "MasterThermostatPriority")) {
thisVrfFluidCtrl.ThermostatPriority = ThermostatCtrlType::MasterThermostatPriority;
if (thisVrfFluidCtrl.MasterZonePtr == 0) {
Expand Down Expand Up @@ -6608,7 +6608,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool
EnableSystem = true;
}
} break;
case ThermostatCtrlType::ScheduledPriority:
case ThermostatCtrlType::Scheduled:
case ThermostatCtrlType::MasterThermostatPriority: {
// can't switch modes if scheduled (i.e., would be switching to unscheduled mode)
// or master TSTAT used (i.e., master zone only has a specific load - can't switch)
Expand Down Expand Up @@ -6708,7 +6708,7 @@ void InitVRF(EnergyPlusData &state, int const VRFTUNum, int const ZoneNum, bool
EnableSystem = true;
}
} break;
case ThermostatCtrlType::ScheduledPriority:
case ThermostatCtrlType::Scheduled:
case ThermostatCtrlType::MasterThermostatPriority: {
} break;
default:
Expand Down Expand Up @@ -10214,13 +10214,13 @@ void InitializeOperatingMode(EnergyPlusData &state,
state.dataHVACVarRefFlow->CoolingLoad(VRFCond) = false;
}
} break;
case ThermostatCtrlType::ScheduledPriority: {
case ThermostatCtrlType::Scheduled: {
if (state.dataHVACVarRefFlow->VRF(VRFCond).prioritySched->getCurrentVal() == 0) {
state.dataHVACVarRefFlow->HeatingLoad(VRFCond) = true;
state.dataHVACVarRefFlow->CoolingLoad(VRFCond) = false;
} else if (state.dataHVACVarRefFlow->VRF(VRFCond).prioritySched->getCurrentVal() == 1) {
state.dataHVACVarRefFlow->HeatingLoad(VRFCond) = false;
state.dataHVACVarRefFlow->CoolingLoad(VRFCond) = true;
} else if (state.dataHVACVarRefFlow->VRF(VRFCond).prioritySched->getCurrentVal() == 1) {
state.dataHVACVarRefFlow->HeatingLoad(VRFCond) = true;
state.dataHVACVarRefFlow->CoolingLoad(VRFCond) = false;
Comment thread
rraustad marked this conversation as resolved.
} else {
state.dataHVACVarRefFlow->HeatingLoad(VRFCond) = false;
state.dataHVACVarRefFlow->CoolingLoad(VRFCond) = false;
Expand Down Expand Up @@ -10281,9 +10281,6 @@ void InitializeOperatingMode(EnergyPlusData &state,
state.dataHVACVarRefFlow->CoolingLoad(VRFCond) = false;
}
} break;
case ThermostatCtrlType::FirstOnPriority: {
// na
} break;
Comment on lines -10284 to -10286
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Unused, so I got rid of it.

default:
break;
}
Expand Down
16 changes: 8 additions & 8 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
// EnergyPlus Headers
#include <EnergyPlus/Data/BaseData.hh>
#include <EnergyPlus/DataGlobalConstants.hh>
#include <EnergyPlus/DataGlobals.hh>
#include <EnergyPlus/DataHeatBalance.hh>
#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/FluidProperties.hh>
Expand All @@ -64,7 +63,6 @@
#include <EnergyPlus/SingleDuct.hh>
#include <EnergyPlus/StandardRatings.hh>
#include <EnergyPlus/UnitarySystem.hh>
#include <EnergyPlus/UtilityRoutines.hh>

namespace EnergyPlus {

Expand All @@ -86,17 +84,19 @@ namespace HVACVariableRefrigerantFlow {
{
Invalid = -1,
LoadPriority, // total of zone loads dictate operation in cooling or heating
ZonePriority, // # of zones requiring cooling or heating dictate operation in cooling or heating
ThermostatOffsetPriority, // zone with largest deviation from setpoint dictates operation
ScheduledPriority, // cooling and heating modes are scheduled
MasterThermostatPriority, // Master zone thermostat dictates operation
FirstOnPriority, // first unit to respond dictates operation (not used at this time)
Scheduled, // cooling and heating modes are scheduled
ThermostatOffsetPriority, // zone with largest deviation from setpoint dictates operation
ZonePriority, // # of zones requiring cooling or heating dictate operation in cooling or heating
Num
};

static constexpr std::array<std::string_view, static_cast<int>(ThermostatCtrlType::Num)> ThermostatCtrlTypeUC = {
"LOADPRIORITY", "ZONEPRIORITY", "THERMOSTATOFFSETPRIORITY", "SCHEDULEDPRIORITY", "MASTERTHERMOSTATPRIORITY",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the real fix - changing SCHEDULEDPRIORITY to SCHEDULED since that is the key in the IDD that this is looking for.

// "FIRSTONPRIORITY",
"LOADPRIORITY",
"MASTERTHERMOSTATPRIORITY",
"SCHEDULED",
"THERMOSTATOFFSETPRIORITY",
"ZONEPRIORITY",
Comment on lines +95 to +99
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed the unused place holder, and sorted the list.

};

enum class EvapWaterSupply
Expand Down
48 changes: 48 additions & 0 deletions tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,54 @@ TEST_F(AirLoopFixture, VRF_SysModel_inAirloop)
EXPECT_TRUE(ErrorsFound); // nodes are not connected correctly
}

TEST_F(EnergyPlusFixture, VRF_ScheduledThermostatPriority)
{
EXPECT_EQ(static_cast<int>(ThermostatCtrlType::Scheduled), getEnumValue(ThermostatCtrlTypeUC, Util::makeUPPER("Scheduled")));

int constexpr VRFCond = 1;
int constexpr TUListNum = 1;
Real64 onOffAirFlowRatio = 0.0;

auto *prioritySched = new Sched::ScheduleConstant();
state->dataSched->schedules.push_back(prioritySched);

state->dataHVACVarRefFlow->VRF.allocate(1);
state->dataHVACVarRefFlow->VRF(VRFCond).ThermostatPriority = ThermostatCtrlType::Scheduled;
state->dataHVACVarRefFlow->VRF(VRFCond).prioritySched = prioritySched;

state->dataHVACVarRefFlow->MaxDeltaT.allocate(1);
state->dataHVACVarRefFlow->MinDeltaT.allocate(1);
state->dataHVACVarRefFlow->NumCoolingLoads.allocate(1);
state->dataHVACVarRefFlow->SumCoolingLoads.allocate(1);
state->dataHVACVarRefFlow->NumHeatingLoads.allocate(1);
state->dataHVACVarRefFlow->SumHeatingLoads.allocate(1);
state->dataHVACVarRefFlow->HeatingLoad.allocate(1);
state->dataHVACVarRefFlow->CoolingLoad.allocate(1);

state->dataHVACVarRefFlow->TerminalUnitList.allocate(1);
auto &terminalUnitList = state->dataHVACVarRefFlow->TerminalUnitList(TUListNum);
terminalUnitList.NumTUInList = 1;
terminalUnitList.TerminalUnitNotSizedYet.allocate(1);
terminalUnitList.TerminalUnitNotSizedYet(1) = true;
terminalUnitList.CoolingCoilAvailable.allocate(1);
terminalUnitList.HeatingCoilAvailable.allocate(1);

prioritySched->currentVal = 0.0;
InitializeOperatingMode(*state, true, VRFCond, TUListNum, onOffAirFlowRatio);
EXPECT_TRUE(state->dataHVACVarRefFlow->CoolingLoad(VRFCond));
EXPECT_FALSE(state->dataHVACVarRefFlow->HeatingLoad(VRFCond));

prioritySched->currentVal = 1.0;
InitializeOperatingMode(*state, true, VRFCond, TUListNum, onOffAirFlowRatio);
EXPECT_FALSE(state->dataHVACVarRefFlow->CoolingLoad(VRFCond));
EXPECT_TRUE(state->dataHVACVarRefFlow->HeatingLoad(VRFCond));

prioritySched->currentVal = 2.0;
InitializeOperatingMode(*state, true, VRFCond, TUListNum, onOffAirFlowRatio);
EXPECT_FALSE(state->dataHVACVarRefFlow->CoolingLoad(VRFCond));
EXPECT_FALSE(state->dataHVACVarRefFlow->HeatingLoad(VRFCond));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This all looks consistent now.

}

//*****************VRF-FluidTCtrl Model
TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Compressor)
{
Expand Down
Loading