@@ -909,38 +909,41 @@ namespace UnitarySystems {
909
909
state.dataLoopNodes->Node(this->m_HeatRecoveryInletNodeNum).MassFlowRate = mdotHR;
910
910
}
911
911
912
+ if (this->m_ControlType == UnitarySysCtrlType::Setpoint && this->m_sysType == SysType::Unitary) {
913
+ if (ScheduleManager::GetCurrentScheduleValue(state, this->m_SysAvailSchedPtr) > 0.0) {
914
+ if (this->m_LastMode == CoolingMode) {
915
+ if (this->m_MultiOrVarSpeedCoolCoil) {
916
+ state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->m_CoolMassFlowRate[this->m_NumOfSpeedCooling];
917
+ } else {
918
+ state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->MaxCoolAirMassFlow;
919
+ }
920
+ } else if (this->m_LastMode == HeatingMode) {
921
+ if (this->m_MultiOrVarSpeedHeatCoil) {
922
+ state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->m_HeatMassFlowRate[this->m_NumOfSpeedHeating];
923
+ } else {
924
+ state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->MaxHeatAirMassFlow;
925
+ }
926
+ } else {
927
+ if (this->m_AirFlowControl == UseCompFlow::Off) {
928
+ if (this->m_MultiOrVarSpeedCoolCoil) {
929
+ state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->MaxNoCoolHeatAirMassFlow;
930
+ } else {
931
+ state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->MaxNoCoolHeatAirMassFlow;
932
+ }
933
+ }
934
+ }
935
+ } else {
936
+ state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = 0.0;
937
+ }
938
+ }
939
+
912
940
// get operating capacity of water and steam coil
913
941
if (FirstHVACIteration || this->m_DehumidControlType_Num == DehumCtrlType::CoolReheat) {
914
942
if (FirstHVACIteration) {
915
943
this->m_IterationCounter = 0;
916
944
std::fill(this->m_IterationMode.begin(), this->m_IterationMode.end(), 0);
917
945
918
946
// for DX systems, just read the inlet node flow rate and let air loop decide flow
919
- if (this->m_ControlType == UnitarySysCtrlType::Setpoint && this->m_sysType == SysType::Unitary) {
920
- if (ScheduleManager::GetCurrentScheduleValue(state, this->m_SysAvailSchedPtr) > 0.0) {
921
- if (this->m_LastMode == CoolingMode) {
922
- if (this->m_MultiOrVarSpeedCoolCoil) {
923
- state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->m_CoolMassFlowRate[this->m_NumOfSpeedCooling];
924
- } else {
925
- state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->MaxCoolAirMassFlow;
926
- }
927
- } else if (this->m_LastMode == HeatingMode) {
928
- if (this->m_MultiOrVarSpeedHeatCoil) {
929
- state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->m_HeatMassFlowRate[this->m_NumOfSpeedHeating];
930
- } else {
931
- state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->MaxHeatAirMassFlow;
932
- }
933
- } else {
934
- if (this->m_MultiOrVarSpeedCoolCoil) {
935
- state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->MaxNoCoolHeatAirMassFlow;
936
- } else {
937
- state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = this->MaxNoCoolHeatAirMassFlow;
938
- }
939
- }
940
- } else {
941
- state.dataLoopNodes->Node(this->AirInNode).MassFlowRate = 0.0;
942
- }
943
- }
944
947
if (this->m_WaterHRPlantLoopModel) {
945
948
// initialize loop water temp on FirstHVACIteration
946
949
Real64 airInTemp = state.dataLoopNodes->Node(this->CoolCoilInletNodeNum).Temp;
@@ -7570,6 +7573,7 @@ namespace UnitarySystems {
7570
7573
thisSys.input_specs.design_specification_multispeed_object_name = Util::makeUPPER(it.value().get<std::string>());
7571
7574
}
7572
7575
7576
+ thisSys.m_LastMode = CoolingMode;
7573
7577
thisSys.processInputSpec(state, thisSys.input_specs, sysNum, errorsFound, ZoneEquipment, ZoneOAUnitNum);
7574
7578
7575
7579
if (sysNum == -1) {
@@ -7864,6 +7868,11 @@ namespace UnitarySystems {
7864
7868
SingleDuct::SimATMixer(state, this->m_ATMixerName, FirstHVACIteration, this->m_ATMixerIndex);
7865
7869
}
7866
7870
}
7871
+
7872
+ // set variables used in fan call inside function calcPassiveSystem
7873
+ state.dataUnitarySystems->m_massFlow1 = state.dataLoopNodes->Node(this->AirInNode).MassFlowRate;
7874
+ state.dataUnitarySystems->m_runTimeFraction1 = (state.dataUnitarySystems->m_massFlow1 > 0.0) ? 1.0 : 0.0; // constant fan mode is required
7875
+
7867
7876
if (this->OAMixerExists) {
7868
7877
// the PTHP does one or the other, but why can't an OA Mixer exist with the AT Mixer?
7869
7878
MixedAir::SimOAMixer(state, blankStdString, this->OAMixerIndex);
@@ -13881,8 +13890,9 @@ namespace UnitarySystems {
13881
13890
13882
13891
if (PartLoadFrac > 1.0) {
13883
13892
PartLoadFrac = 1.0;
13884
- } else if (PartLoadFrac < 0.0) {
13893
+ } else if (PartLoadFrac <= 0.0) {
13885
13894
PartLoadFrac = 0.0;
13895
+ if (this->m_LastMode == CoolingMode) this->m_LastMode = 0;
13886
13896
}
13887
13897
13888
13898
this->m_CoolingPartLoadFrac = PartLoadFrac;
@@ -14507,8 +14517,9 @@ namespace UnitarySystems {
14507
14517
14508
14518
if (PartLoadFrac > 1.0) {
14509
14519
PartLoadFrac = 1.0;
14510
- } else if (PartLoadFrac < 0.0) {
14520
+ } else if (PartLoadFrac <= 0.0) {
14511
14521
PartLoadFrac = 0.0;
14522
+ if (this->m_LastMode == HeatingMode) this->m_LastMode = 0;
14512
14523
}
14513
14524
14514
14525
if (SolFla < 0) {
@@ -14897,6 +14908,7 @@ namespace UnitarySystems {
14897
14908
PartLoadFrac = 1.0;
14898
14909
} else if (PartLoadFrac < 0.0) {
14899
14910
PartLoadFrac = 0.0;
14911
+ if (this->m_LastMode == HeatingMode && this->m_HeatingPartLoadFrac == 0.0) this->m_LastMode = 0;
14900
14912
}
14901
14913
14902
14914
if (SolFla == -1) {
0 commit comments