From 37275cb253ed535bca6b8fd54feb88b3fac235ad Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 6 Dec 2023 18:18:12 -0600 Subject: [PATCH] surfQRadFromHVAC struct --- src/EnergyPlus/ChilledCeilingPanelSimple.cc | 7 ++++-- src/EnergyPlus/DataHeatBalFanSys.hh | 22 ++++++++-------- src/EnergyPlus/ElectricBaseboardRadiator.cc | 7 ++++-- src/EnergyPlus/HWBaseboardRadiator.cc | 7 ++++-- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 28 ++++++++++----------- src/EnergyPlus/HighTempRadiantSystem.cc | 7 ++++-- src/EnergyPlus/SteamBaseboardRadiator.cc | 7 ++++-- 7 files changed, 50 insertions(+), 35 deletions(-) diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index 2923d69c44d..17ce9c712fb 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -1589,7 +1589,10 @@ void DistributeCoolingPanelRadGains(EnergyPlusData &state) Real64 constexpr SmallestArea(0.001); // Smallest area in meters squared (to avoid a divide by zero) // Initialize arrays - state.dataHeatBalFanSys->SurfQCoolingPanel = 0.0; + for (int surfNum : state.dataSurface->allGetsRadiantHeatSurfaceList) { + auto &thisSurfQRadFromHVAC = state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum); + thisSurfQRadFromHVAC.CoolingPanel = 0.0; + } state.dataHeatBalFanSys->ZoneQCoolingPanelToPerson = 0.0; for (int CoolingPanelNum = 1; CoolingPanelNum <= (int)state.dataChilledCeilingPanelSimple->CoolingPanel.size(); ++CoolingPanelNum) { @@ -1605,7 +1608,7 @@ void DistributeCoolingPanelRadGains(EnergyPlusData &state) auto &ThisSurf(state.dataSurface->Surface(SurfNum)); if (ThisSurf.Area > SmallestArea) { Real64 ThisSurfIntensity = (thisCP.CoolingPanelSource * thisCP.FracDistribToSurf(RadSurfNum) / ThisSurf.Area); - state.dataHeatBalFanSys->SurfQCoolingPanel(SurfNum) += ThisSurfIntensity; + state.dataHeatBalFanSys->surfQRadFromHVAC(SurfNum).CoolingPanel += ThisSurfIntensity; // CR 8074, trap for excessive intensity (throws off surface balance ) if (ThisSurfIntensity > DataHeatBalFanSys::MaxRadHeatFlux) { ShowSevereError(state, "DistributeCoolingPanelRadGains: excessive thermal radiation heat flux intensity detected"); diff --git a/src/EnergyPlus/DataHeatBalFanSys.hh b/src/EnergyPlus/DataHeatBalFanSys.hh index f19cca58c6f..d113d5e33fc 100644 --- a/src/EnergyPlus/DataHeatBalFanSys.hh +++ b/src/EnergyPlus/DataHeatBalFanSys.hh @@ -89,6 +89,15 @@ namespace DataHeatBalFanSys { int DualPMVErrIndex = 0; // Dual PMV setpoint error index }; + struct SurfQRadFromHVACData + { + Real64 HTRadSys; // Current radiant heat flux to surface from high temperature radiant heaters + Real64 HWBaseboard; // Current radiant heat flux to surface from hot water baseboard heaters + Real64 SteamBaseboard; // Current radiant heat flux to surface from steam baseboard heaters + Real64 ElecBaseboard; // Current radiant heat flux to surface from electric baseboard heaters + Real64 CoolingPanel; // Current radiant heat flux to surface from simple cooling panels + }; + } // namespace DataHeatBalFanSys struct HeatBalFanSysData : BaseGlobalStruct @@ -121,17 +130,8 @@ struct HeatBalFanSysData : BaseGlobalStruct // temperature at source Array1D CTFTuserConstPart; // Constant Outside Portion of the CTF calculation of // temperature at the user specified location - Array1D SurfQHTRadSys; // Current radiant heat flux at a surface due to the presence - // of high temperature radiant heaters - Array1D SurfQHWBaseboard; // Current radiant heat flux at a surface due to the presence - // of hot water baseboard heaters - Array1D SurfQSteamBaseboard; // Current radiant heat flux at a surface due to the presence - // of steam baseboard heaters - Array1D SurfQElecBaseboard; // Current radiant heat flux at a surface due to the presence - // of electric baseboard heaters - Array1D SurfQCoolingPanel; // Current radiant heat flux at a surface due to the presence - // of simple cooling panels - Array1D QRadSurfAFNDuct; // Current radiant heat flux at a surface due to radiation from AFN ducts + EPVector surfQRadFromHVAC; // Radiant heat flux to surface from radiant HVAC equipment + Array1D QRadSurfAFNDuct; // Current radiant heat flux at a surface due to radiation from AFN ducts Array1D QPoolSurfNumerator; // Current pool heat flux impact at the surface (numerator of surface heat balance) Array1D PoolHeatTransCoefs; // Current pool heat transfer coefficients (denominator of surface heat balance) Array1D RadSysTiHBConstCoef; // Inside heat balance coefficient that is constant diff --git a/src/EnergyPlus/ElectricBaseboardRadiator.cc b/src/EnergyPlus/ElectricBaseboardRadiator.cc index 0e0c1aacc3d..bf72af7684d 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -906,7 +906,10 @@ namespace ElectricBaseboardRadiator { Real64 constexpr SmallestArea(0.001); // Smallest area in meters squared (to avoid a divide by zero) // Initialize arrays - state.dataHeatBalFanSys->SurfQElecBaseboard = 0.0; + for (int surfNum : state.dataSurface->allGetsRadiantHeatSurfaceList) { + auto &thisSurfQRadFromHVAC = state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum); + thisSurfQRadFromHVAC.ElecBaseboard = 0.0; + } state.dataHeatBalFanSys->ZoneQElecBaseboardToPerson = 0.0; for (auto &elecBaseboard : state.dataElectBaseboardRad->ElecBaseboard) { @@ -919,7 +922,7 @@ namespace ElectricBaseboardRadiator { if (state.dataSurface->Surface(SurfNum).Area > SmallestArea) { Real64 ThisSurfIntensity = (elecBaseboard.QBBElecRadSource * elecBaseboard.FracDistribToSurf(RadSurfNum) / state.dataSurface->Surface(SurfNum).Area); - state.dataHeatBalFanSys->SurfQElecBaseboard(SurfNum) += ThisSurfIntensity; + state.dataHeatBalFanSys->surfQRadFromHVAC(SurfNum).ElecBaseboard += ThisSurfIntensity; if (ThisSurfIntensity > DataHeatBalFanSys::MaxRadHeatFlux) { ShowSevereError(state, "DistributeBBElecRadGains: excessive thermal radiation heat flux intensity detected"); ShowContinueError(state, "Surface = " + state.dataSurface->Surface(SurfNum).Name); diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index c8434e8068e..fed677118f7 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -1496,7 +1496,10 @@ namespace HWBaseboardRadiator { Real64 ThisSurfIntensity; // temporary for W/m2 term for rad on a surface // Initialize arrays - state.dataHeatBalFanSys->SurfQHWBaseboard = 0.0; + for (int surfNum : state.dataSurface->allGetsRadiantHeatSurfaceList) { + auto &thisSurfQRadFromHVAC = state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum); + thisSurfQRadFromHVAC.HWBaseboard = 0.0; + } state.dataHeatBalFanSys->ZoneQHWBaseboardToPerson = 0.0; for (auto &thisHWBB : state.dataHWBaseboardRad->HWBaseboard) { @@ -1510,7 +1513,7 @@ namespace HWBaseboardRadiator { SurfNum = thisHWBB.SurfacePtr(RadSurfNum); if (state.dataSurface->Surface(SurfNum).Area > SmallestArea) { ThisSurfIntensity = (thisHWBB.QBBRadSource * thisHWBB.FracDistribToSurf(RadSurfNum) / state.dataSurface->Surface(SurfNum).Area); - state.dataHeatBalFanSys->SurfQHWBaseboard(SurfNum) += ThisSurfIntensity; + state.dataHeatBalFanSys->surfQRadFromHVAC(SurfNum).HWBaseboard += ThisSurfIntensity; // CR 8074, trap for excessive intensity (throws off surface balance ) if (ThisSurfIntensity > DataHeatBalFanSys::MaxRadHeatFlux) { ShowSevereError(state, "DistributeBBRadGains: excessive thermal radiation heat flux intensity detected"); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 28026683cbf..0f0e1d1bb2e 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -547,13 +547,17 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) state.dataHeatBalFanSys->QRadSysSource(SurfNum) = 0.0; state.dataHeatBalFanSys->QPVSysSource(SurfNum) = 0.0; - state.dataHeatBalFanSys->SurfQHTRadSys(SurfNum) = 0.0; - state.dataHeatBalFanSys->SurfQHWBaseboard(SurfNum) = 0.0; - state.dataHeatBalFanSys->SurfQSteamBaseboard(SurfNum) = 0.0; - state.dataHeatBalFanSys->SurfQElecBaseboard(SurfNum) = 0.0; - state.dataHeatBalFanSys->SurfQCoolingPanel(SurfNum) = 0.0; state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum) = 0.0; state.dataHeatBalFanSys->PoolHeatTransCoefs(SurfNum) = 0.0; + for (int surfNum : state.dataSurface->allGetsRadiantHeatSurfaceList) { + auto &thisSurfQRadFromHVAC = state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum); + thisSurfQRadFromHVAC.HTRadSys = 0.0; + thisSurfQRadFromHVAC.HWBaseboard = 0.0; + thisSurfQRadFromHVAC.SteamBaseboard = 0.0; + thisSurfQRadFromHVAC.ElecBaseboard = 0.0; + thisSurfQRadFromHVAC.CoolingPanel = 0.0; + } + } // ...end of Zone Surf loop } } // ...end of Zone loop @@ -1447,11 +1451,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataHeatBalFanSys->RadSysToHBQsrcCoef.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalFanSys->QRadSysSource.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalFanSys->TCondFDSourceNode.dimension(state.dataSurface->TotSurfaces, 15.0); - state.dataHeatBalFanSys->SurfQHTRadSys.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalFanSys->SurfQHWBaseboard.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalFanSys->SurfQSteamBaseboard.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalFanSys->SurfQElecBaseboard.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBalFanSys->SurfQCoolingPanel.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataHeatBalFanSys->surfQRadFromHVAC.allocate(state.dataSurface->TotSurfaces); state.dataHeatBalFanSys->QRadSurfAFNDuct.dimension(state.dataSurface->TotSurfaces, 0.0); // allocate terms used for pool surface heat balance @@ -9022,10 +9022,10 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, void sumSurfQdotRadHVAC(EnergyPlusData &state) { for (int surfNum : state.dataSurface->allGetsRadiantHeatSurfaceList) { - state.dataHeatBalSurf->SurfQdotRadHVACInPerArea(surfNum) = - state.dataHeatBalFanSys->SurfQHTRadSys(surfNum) + state.dataHeatBalFanSys->SurfQHWBaseboard(surfNum) + - state.dataHeatBalFanSys->SurfQSteamBaseboard(surfNum) + state.dataHeatBalFanSys->SurfQElecBaseboard(surfNum) + - state.dataHeatBalFanSys->SurfQCoolingPanel(surfNum); + auto &thisSurfQRadFromHVAC = state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum); + state.dataHeatBalSurf->SurfQdotRadHVACInPerArea(surfNum) = thisSurfQRadFromHVAC.HTRadSys + thisSurfQRadFromHVAC.HWBaseboard + + thisSurfQRadFromHVAC.SteamBaseboard + thisSurfQRadFromHVAC.ElecBaseboard + + thisSurfQRadFromHVAC.CoolingPanel; } } diff --git a/src/EnergyPlus/HighTempRadiantSystem.cc b/src/EnergyPlus/HighTempRadiantSystem.cc index b9c16a5af8d..cf0be9f6155 100644 --- a/src/EnergyPlus/HighTempRadiantSystem.cc +++ b/src/EnergyPlus/HighTempRadiantSystem.cc @@ -1140,7 +1140,10 @@ namespace HighTempRadiantSystem { // Initialize arrays dataHBFS->SumConvHTRadSys = 0.0; dataHBFS->SumLatentHTRadSys = 0.0; - dataHBFS->SurfQHTRadSys = 0.0; + for (int surfNum : state.dataSurface->allGetsRadiantHeatSurfaceList) { + auto &thisSurfQRadFromHVAC = state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum); + thisSurfQRadFromHVAC.HTRadSys = 0.0; + } dataHBFS->ZoneQHTRadSysToPerson = 0.0; for (auto &thisHTR : state.dataHighTempRadSys->HighTempRadSys) { @@ -1155,7 +1158,7 @@ namespace HighTempRadiantSystem { if (state.dataSurface->Surface(SurfNum).Area > SmallestArea) { ThisSurfIntensity = (thisHTR.QHTRRadSource * thisHTR.FracRadiant * thisHTR.FracDistribToSurf(RadSurfNum) / state.dataSurface->Surface(SurfNum).Area); - dataHBFS->SurfQHTRadSys(SurfNum) += ThisSurfIntensity; + state.dataHeatBalFanSys->surfQRadFromHVAC(SurfNum).HTRadSys += ThisSurfIntensity; if (ThisSurfIntensity > DataHeatBalFanSys::MaxRadHeatFlux) { // CR 8074, trap excessive intensity (throws off surface balance ) ShowSevereError(state, "DistributeHTRadGains: excessive thermal radiation heat flux intensity detected"); diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index d37cd181918..6653447d016 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -1522,7 +1522,10 @@ namespace SteamBaseboardRadiator { int ZoneNum; // Pointer to the Zone derived type Real64 ThisSurfIntensity; // temporary for W/m2 term for rad on a surface - state.dataHeatBalFanSys->SurfQSteamBaseboard = 0.0; + for (int surfNum : state.dataSurface->allGetsRadiantHeatSurfaceList) { + auto &thisSurfQRadFromHVAC = state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum); + thisSurfQRadFromHVAC.SteamBaseboard = 0.0; + } state.dataHeatBalFanSys->ZoneQSteamBaseboardToPerson = 0.0; for (BaseboardNum = 1; BaseboardNum <= state.dataSteamBaseboardRadiator->NumSteamBaseboards; ++BaseboardNum) { @@ -1540,7 +1543,7 @@ namespace SteamBaseboardRadiator { ThisSurfIntensity = (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).QBBSteamRadSource * state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribToSurf(RadSurfNum) / state.dataSurface->Surface(SurfNum).Area); - state.dataHeatBalFanSys->SurfQSteamBaseboard(SurfNum) += ThisSurfIntensity; + state.dataHeatBalFanSys->surfQRadFromHVAC(SurfNum).SteamBaseboard += ThisSurfIntensity; if (ThisSurfIntensity > MaxRadHeatFlux) { // CR 8074, trap for excessive intensity (throws off surface balance ) ShowSevereError(state, "DistributeBBSteamRadGains: excessive thermal radiation heat flux intensity detected");