Skip to content
Merged
Changes from 9 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
6 changes: 6 additions & 0 deletions src/EnergyPlus/UnitarySystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7934,6 +7934,7 @@ namespace UnitarySystems {
thisSys.input_specs.design_specification_multispeed_object_name = Util::makeUPPER(it.value().get<std::string>());
}

thisSys.m_LastMode = (thisSys.m_CoolCoilExists) ? CoolingMode : HeatingMode;
thisSys.processInputSpec(state, thisSys.input_specs, sysNum, errorsFound, ZoneEquipment, ZoneOAUnitNum);

if (sysNum == -1) {
Expand Down Expand Up @@ -8234,6 +8235,11 @@ namespace UnitarySystems {
SingleDuct::SimATMixer(state, this->m_ATMixerName, FirstHVACIteration, this->m_ATMixerIndex);
}
}

// set variables used in fan call inside function calcPassiveSystem
state.dataUnitarySystems->m_massFlow1 = state.dataLoopNodes->Node(this->AirInNode).MassFlowRate;
state.dataUnitarySystems->m_runTimeFraction1 = (state.dataUnitarySystems->m_massFlow1 > 0.0) ? 1.0 : 0.0; // constant fan mode is required

Copy link
Contributor Author

@rraustad rraustad Oct 24, 2025

Choose a reason for hiding this comment

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

If either of these changes are removed, the system air flow goes to 0 and there is no control to set point temperature. I'm not quite sure the initialization of LastMode should be done in getInput but I am warming up to it since the mode needs to start somewhere. If the mode is not set from 0 to cooling or heating mode the fan does not turn on. So this change seems OK. And if the fan operating parameters are not set, for set point controlled systems, then the fan won't turn on. So this also seems OK.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@rraustad do you think this is captured in our tests already? Given your description, it seems like we should have some sort of test to ensure this continues to function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was hard to track down. The defect file has Fan:SystemModel in a modified example file (UnitarySystem_VSHeatPumpWaterToAirEquationFit). Unit tests have legacy fans. One unit test has Fan:System models but doesn't test controls. The Fan:SystemModel needs to set these 2 variables for the fan call in calcPassiveSystem. This may have started with the fan refactor or a change to UnitarySystem that did not notice this corner case. I'm trying to figure out a good place for a unit test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

First 2 unit tests passed fine without any changes. Then figured out that it was the coil type and the fan type that caused this issue and a specific unit test was added. That unit test fails without these changes. This coil type was calling calcPassiveSystem when it did not need to. Those lines were deleted. Since that function is no longer called the new lines to set the fan parameters were also not needed.

if (this->OAMixerExists) {
// the PTHP does one or the other, but why can't an OA Mixer exist with the AT Mixer?
MixedAir::SimOAMixer(state, blankStdString, this->OAMixerIndex);
Expand Down