-
Notifications
You must be signed in to change notification settings - Fork 398
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
Follow up to #10617 and allow other ZoneHVAC:*
component with Airflow Network simulations
#10637
Changes from all commits
f57c2fb
e583596
043ebb0
81474ac
dac299b
b6a68bd
635af34
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 |
---|---|---|
|
@@ -10149,7 +10149,8 @@ namespace UnitarySystems { | |
Real64 TotalOutputDelta = 0.0; // delta total output rate, {W} | ||
int ZoneInNode = this->m_ZoneInletNode; | ||
Real64 MassFlowRate = state.dataLoopNodes->Node(ZoneInNode).MassFlowRate / this->ControlZoneMassFlowFrac; | ||
if (state.afn->distribution_simulated) { | ||
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
this->m_sysType != SysType::PackagedWSHP) { | ||
Comment on lines
+10152
to
+10153
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. Exclude PTHP/PTAC/WSHP since they are excluded from AFN simulation with distribution. |
||
DeltaMassRate = state.dataLoopNodes->Node(this->AirOutNode).MassFlowRate - | ||
state.dataLoopNodes->Node(ZoneInNode).MassFlowRate / this->ControlZoneMassFlowFrac; | ||
if (DeltaMassRate < 0.0) DeltaMassRate = 0.0; | ||
|
@@ -12143,7 +12144,8 @@ namespace UnitarySystems { | |
Real64 DesOutHumRat = this->m_DesiredOutletHumRat; | ||
int CoilType_Num = this->m_CoolingCoilType_Num; | ||
Real64 LoopDXCoilMaxRTFSave = 0.0; | ||
if (state.afn->distribution_simulated) { | ||
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
this->m_sysType != SysType::PackagedWSHP) { | ||
LoopDXCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF; | ||
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = 0.0; | ||
} | ||
|
@@ -13897,7 +13899,8 @@ namespace UnitarySystems { | |
this->m_CoolingCycRatio = CycRatio; | ||
this->m_DehumidificationMode = DehumidMode; | ||
|
||
if (state.afn->distribution_simulated) { | ||
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
this->m_sysType != SysType::PackagedWSHP) { | ||
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = | ||
max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave); | ||
} | ||
|
@@ -13952,7 +13955,8 @@ namespace UnitarySystems { | |
|
||
Real64 LoopHeatingCoilMaxRTFSave = 0.0; | ||
Real64 LoopDXCoilMaxRTFSave = 0.0; | ||
if (state.afn->distribution_simulated) { | ||
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
this->m_sysType != SysType::PackagedWSHP) { | ||
LoopHeatingCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF; | ||
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = 0.0; | ||
LoopDXCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF; | ||
|
@@ -14571,7 +14575,8 @@ namespace UnitarySystems { | |
this->m_HeatingCycRatio = CycRatio; | ||
HeatCoilLoad = ReqOutput; | ||
|
||
if (state.afn->distribution_simulated) { | ||
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
this->m_sysType != SysType::PackagedWSHP) { | ||
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = | ||
max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF, LoopHeatingCoilMaxRTFSave); | ||
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = | ||
|
@@ -14622,7 +14627,8 @@ namespace UnitarySystems { | |
|
||
Real64 LoopHeatingCoilMaxRTFSave = 0.0; | ||
Real64 LoopDXCoilMaxRTFSave = 0.0; | ||
if (state.afn->distribution_simulated) { | ||
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
this->m_sysType != SysType::PackagedWSHP) { | ||
auto &afnInfo = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum); | ||
LoopHeatingCoilMaxRTFSave = afnInfo.AFNLoopHeatingCoilMaxRTF; | ||
afnInfo.AFNLoopHeatingCoilMaxRTF = 0.0; | ||
|
@@ -14975,7 +14981,8 @@ namespace UnitarySystems { | |
} // IF((GetCurrentScheduleValue(state, UnitarySystem(UnitarySysNum)%m_SysAvailSchedPtr) > 0.0d0) .AND. & | ||
|
||
// LoopHeatingCoilMaxRTF used for AirflowNetwork gets set in child components (gas and fuel) | ||
if (state.afn->distribution_simulated) { | ||
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
this->m_sysType != SysType::PackagedWSHP) { | ||
auto &afnInfo = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum); | ||
afnInfo.AFNLoopHeatingCoilMaxRTF = max(afnInfo.AFNLoopHeatingCoilMaxRTF, LoopHeatingCoilMaxRTFSave); | ||
afnInfo.AFNLoopDXCoilRTF = max(afnInfo.AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave); | ||
|
@@ -15664,7 +15671,8 @@ namespace UnitarySystems { | |
this->m_ElecPower = locFanElecPower + elecCoolingPower + elecHeatingPower + suppHeatingPower + defrostElecPower + this->m_TotalAuxElecPower; | ||
this->m_ElecPowerConsumption = this->m_ElecPower * ReportingConstant; | ||
|
||
if (state.afn->distribution_simulated) { | ||
if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && | ||
this->m_sysType != SysType::PackagedWSHP) { | ||
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOnMassFlowrate = state.dataUnitarySystems->CompOnMassFlow; | ||
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOffMassFlowrate = state.dataUnitarySystems->CompOffMassFlow; | ||
state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopFanOperationMode = this->m_FanOpMode; | ||
|
@@ -16739,6 +16747,33 @@ namespace UnitarySystems { | |
return false; | ||
} | ||
|
||
bool getUnitarySystemNodeNumber(EnergyPlusData &state, int const nodeNumber) | ||
{ | ||
for (int unitarySysIndex = 0; unitarySysIndex <= state.dataUnitarySystems->numUnitarySystems - 1; ++unitarySysIndex) { | ||
auto &unitarySys = state.dataUnitarySystems->unitarySys[unitarySysIndex]; | ||
|
||
int FanInletNodeIndex = state.dataFans->fans(unitarySys.m_FanIndex)->inletNodeNum; | ||
int FanOutletNodeIndex = state.dataFans->fans(unitarySys.m_FanIndex)->outletNodeNum; | ||
|
||
bool noUnitarySysOutdoorAir = false; | ||
if (unitarySys.m_CoolOutAirVolFlow == 0 && unitarySys.m_HeatOutAirVolFlow == 0 && unitarySys.m_NoCoolHeatOutAirVolFlow == 0) { | ||
noUnitarySysOutdoorAir = true; | ||
} | ||
|
||
if (unitarySys.m_sysType == UnitarySys::SysType::PackagedWSHP || unitarySys.m_sysType == UnitarySys::SysType::PackagedAC || | ||
unitarySys.m_sysType == UnitarySys::SysType::PackagedHP) { | ||
if (noUnitarySysOutdoorAir && (nodeNumber == FanInletNodeIndex || nodeNumber == FanOutletNodeIndex || | ||
nodeNumber == unitarySys.AirInNode || nodeNumber == unitarySys.m_OAMixerNodes[0] || | ||
nodeNumber == unitarySys.m_OAMixerNodes[1] || nodeNumber == unitarySys.m_OAMixerNodes[2]) || | ||
nodeNumber == unitarySys.m_OAMixerNodes[3] || nodeNumber == unitarySys.CoolCoilOutletNodeNum || | ||
nodeNumber == unitarySys.HeatCoilOutletNodeNum) { | ||
return true; | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
Comment on lines
+16750
to
+16776
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. New function to identify nodes used by PTAC/PTHP/WSHP that don't use any OA so they can be excluded from the AFN distribution validation. |
||
void setupAllOutputVars(EnergyPlusData &state, int const numAllSystemTypes) | ||
{ | ||
// setup reports only once | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,6 +359,7 @@ namespace WindowAC { | |
} else { | ||
state.dataWindowAC->WindAC(WindACNum).OutsideAirNode = OANodeNums(1); | ||
state.dataWindowAC->WindAC(WindACNum).AirReliefNode = OANodeNums(2); | ||
state.dataWindowAC->WindAC(WindACNum).ReturnAirNode = OANodeNums(3); | ||
state.dataWindowAC->WindAC(WindACNum).MixedAirNode = OANodeNums(4); | ||
} | ||
} | ||
|
@@ -1499,30 +1500,22 @@ namespace WindowAC { | |
} // WindAC(WindACNum)%DXCoilType_Num == CoilDX_CoolingHXAssisted && * | ||
} | ||
|
||
bool GetWindowACNodeNumber(EnergyPlusData &state, int const NodeNumber) | ||
bool getWindowACNodeNumber(EnergyPlusData &state, int const nodeNumber) | ||
{ | ||
if (state.dataWindowAC->GetWindowACInputFlag) { | ||
GetWindowAC(state); | ||
state.dataWindowAC->GetWindowACInputFlag = false; | ||
} | ||
|
||
bool windowACOutdoorAir = false; | ||
|
||
for (int windowACIndex = 1; windowACIndex <= state.dataWindowAC->NumWindAC; ++windowACIndex) { | ||
auto &windowAC = state.dataWindowAC->WindAC(windowACIndex); | ||
if (windowAC.OutAirVolFlow == 0) { | ||
windowACOutdoorAir = true; | ||
} else { | ||
windowACOutdoorAir = false; | ||
} | ||
int FanInletNodeIndex = 0; | ||
int FanOutletNodeIndex = 0; | ||
FanInletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->inletNodeNum; | ||
FanOutletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->outletNodeNum; | ||
|
||
if (windowACOutdoorAir && | ||
(NodeNumber == windowAC.OutsideAirNode || NodeNumber == windowAC.MixedAirNode || NodeNumber == windowAC.AirReliefNode || | ||
NodeNumber == FanInletNodeIndex || NodeNumber == FanOutletNodeIndex || NodeNumber == windowAC.AirInNode)) { | ||
int FanInletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->inletNodeNum; | ||
int FanOutletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->outletNodeNum; | ||
|
||
if (windowAC.OutAirVolFlow == 0 && | ||
(nodeNumber == windowAC.OutsideAirNode || nodeNumber == windowAC.MixedAirNode || nodeNumber == windowAC.AirReliefNode || | ||
nodeNumber == FanInletNodeIndex || nodeNumber == FanOutletNodeIndex || nodeNumber == windowAC.AirInNode || | ||
nodeNumber == windowAC.CoilOutletNodeNum || nodeNumber == windowAC.AirOutNode || nodeNumber == windowAC.ReturnAirNode)) { | ||
Comment on lines
-1502
to
+1518
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. Address review comments from #10617. |
||
return true; | ||
} | ||
} | ||
|
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.
New function to identify nodes used by VRF terminal units that don't use any OA so they can be excluded from the AFN distribution validation.