Skip to content

Commit

Permalink
surfQRadFromHVAC struct
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Dec 7, 2023
1 parent 195ee79 commit 37275cb
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 35 deletions.
7 changes: 5 additions & 2 deletions src/EnergyPlus/ChilledCeilingPanelSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
Expand Down
22 changes: 11 additions & 11 deletions src/EnergyPlus/DataHeatBalFanSys.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -121,17 +130,8 @@ struct HeatBalFanSysData : BaseGlobalStruct
// temperature at source
Array1D<Real64> CTFTuserConstPart; // Constant Outside Portion of the CTF calculation of
// temperature at the user specified location
Array1D<Real64> SurfQHTRadSys; // Current radiant heat flux at a surface due to the presence
// of high temperature radiant heaters
Array1D<Real64> SurfQHWBaseboard; // Current radiant heat flux at a surface due to the presence
// of hot water baseboard heaters
Array1D<Real64> SurfQSteamBaseboard; // Current radiant heat flux at a surface due to the presence
// of steam baseboard heaters
Array1D<Real64> SurfQElecBaseboard; // Current radiant heat flux at a surface due to the presence
// of electric baseboard heaters
Array1D<Real64> SurfQCoolingPanel; // Current radiant heat flux at a surface due to the presence
// of simple cooling panels
Array1D<Real64> QRadSurfAFNDuct; // Current radiant heat flux at a surface due to radiation from AFN ducts
EPVector<DataHeatBalFanSys::SurfQRadFromHVACData> surfQRadFromHVAC; // Radiant heat flux to surface from radiant HVAC equipment
Array1D<Real64> QRadSurfAFNDuct; // Current radiant heat flux at a surface due to radiation from AFN ducts
Array1D<Real64> QPoolSurfNumerator; // Current pool heat flux impact at the surface (numerator of surface heat balance)
Array1D<Real64> PoolHeatTransCoefs; // Current pool heat transfer coefficients (denominator of surface heat balance)
Array1D<Real64> RadSysTiHBConstCoef; // Inside heat balance coefficient that is constant
Expand Down
7 changes: 5 additions & 2 deletions src/EnergyPlus/ElectricBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions src/EnergyPlus/HWBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
Expand Down
28 changes: 14 additions & 14 deletions src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/EnergyPlus/HighTempRadiantSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
Expand Down
7 changes: 5 additions & 2 deletions src/EnergyPlus/SteamBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
Expand Down

5 comments on commit 37275cb

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

SysRadHeatGain10304 (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2759 of 2759 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

SysRadHeatGain10304 (mjwitte) - x86_64-MacOS-10.17-clang-14.0.0: OK (3546 of 3546 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

SysRadHeatGain10304 (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3587 of 3587 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

SysRadHeatGain10304 (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1972 of 1972 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

SysRadHeatGain10304 (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (790 of 790 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.