-
Notifications
You must be signed in to change notification settings - Fork 477
Fix VRF Thermostat Control Type Issues #11611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2067,7 +2067,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) | |
| ErrorsFound = true; | ||
| } | ||
|
|
||
| if (thisVrfSys.ThermostatPriority == ThermostatCtrlType::ScheduledPriority) { | ||
| if (thisVrfSys.ThermostatPriority == ThermostatCtrlType::Scheduled) { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) { | ||
|
|
@@ -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) { | ||
|
|
@@ -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) | ||
|
|
@@ -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: | ||
|
|
@@ -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; | ||
|
rraustad marked this conversation as resolved.
|
||
| } else { | ||
| state.dataHVACVarRefFlow->HeatingLoad(VRFCond) = false; | ||
| state.dataHVACVarRefFlow->CoolingLoad(VRFCond) = false; | ||
|
|
@@ -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
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused, so I got rid of it. |
||
| default: | ||
| break; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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> | ||
|
|
@@ -64,7 +63,6 @@ | |
| #include <EnergyPlus/SingleDuct.hh> | ||
| #include <EnergyPlus/StandardRatings.hh> | ||
| #include <EnergyPlus/UnitarySystem.hh> | ||
| #include <EnergyPlus/UtilityRoutines.hh> | ||
|
|
||
| namespace EnergyPlus { | ||
|
|
||
|
|
@@ -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", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the real fix - changing |
||
| // "FIRSTONPRIORITY", | ||
| "LOADPRIORITY", | ||
| "MASTERTHERMOSTATPRIORITY", | ||
| "SCHEDULED", | ||
| "THERMOSTATOFFSETPRIORITY", | ||
| "ZONEPRIORITY", | ||
|
Comment on lines
+95
to
+99
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the unused place holder, and sorted the list. |
||
| }; | ||
|
|
||
| enum class EvapWaterSupply | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.