Skip to content

Commit

Permalink
add global anyRadiantSystems delete AnyRadiantSystems surface array
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Dec 1, 2023
1 parent 10d17cd commit fd480aa
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/ChilledCeilingPanelSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ void GetCoolingPanelInput(EnergyPlusData &state)
continue;
}

state.dataHeatBal->anyRadiantSystems = true;
Real64 AllFracsSummed = thisCP.FracDistribPerson;
for (SurfNum = 1; SurfNum <= thisCP.TotSurfToDistrib; ++SurfNum) {
thisCP.SurfaceName(SurfNum) = state.dataIPShortCut->cAlphaArgs(SurfNum + 8);
Expand Down Expand Up @@ -1605,7 +1606,6 @@ void DistributeCoolingPanelRadGains(EnergyPlusData &state)
if (ThisSurf.Area > SmallestArea) {
Real64 ThisSurfIntensity = (thisCP.CoolingPanelSource * thisCP.FracDistribToSurf(RadSurfNum) / ThisSurf.Area);
state.dataHeatBalFanSys->SurfQCoolingPanel(SurfNum) += ThisSurfIntensity;
state.dataHeatBalSurf->AnyRadiantSystems(SurfNum) = true;
// 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
1 change: 0 additions & 1 deletion src/EnergyPlus/DataHeatBalSurface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ struct HeatBalSurfData : BaseGlobalStruct
Array1D<Real64> SurfQRadIntGainsInRep; // Surface thermal radiation heat gain at Inside face [J]
Array1D<Real64> SurfQdotRadIntGainsInRep; // Surface thermal radiation heat transfer inside face surface [W]
// these next four all are for Radiative HVAC sources of radiation gains on inside face
Array1D<bool> AnyRadiantSystems; // True if there are any radiant systems
Array1D<Real64> SurfQRadHVACInRep; // Surface thermal radiation heat gain at Inside face [J]
Array1D<Real64> SurfQdotRadHVACInRep; // Surface thermal radiation heat transfer inside face surface [W]
Array1D<Real64> SurfQdotRadHVACInPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Inside face surf
Expand Down
5 changes: 3 additions & 2 deletions src/EnergyPlus/DataHeatBalance.hh
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@ namespace DataHeatBalance {
int zoneOABalanceIndex = 0; // Index to ZoneAirBalance for this zone, if any

// Spaces
EPVector<int> spaceIndexes; // Indexes to spaces in this zone
int numSpaces = 0; // Number of spaces in this zone
EPVector<int> spaceIndexes; // Indexes to spaces in this zone
int numSpaces = 0; // Number of spaces in this zone

// Default Constructor
ZoneData() : Centroid(0.0, 0.0, 0.0)
Expand Down Expand Up @@ -1828,6 +1828,7 @@ struct HeatBalanceData : BaseGlobalStruct
bool AnyAirBoundary = false; // Construction:AirBoundary used (implies grouped solar and radiant is present)
bool AnyBSDF = false; // True if any WindowModelType == WindowModel:: BSDF
bool AnyVariableAbsorptance = false; // true if any MaterialProperty:VariableAbsorptance is present
bool anyRadiantSystems = false; // true if any HVAC system with radiant output is present
int MaxNumberOfWarmupDays = 25; // Maximum number of warmup days allowed
int MinNumberOfWarmupDays = 1; // Minimum number of warmup days allowed
Real64 CondFDRelaxFactor = 1.0; // Relaxation factor, for looping across all the surfaces.
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/ElectricBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ namespace ElectricBaseboardRadiator {
elecBaseboard.ZonePtr =
DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::BaseboardElectric, elecBaseboard.EquipName);

state.dataHeatBal->anyRadiantSystems = true;
Real64 AllFracsSummed = elecBaseboard.FracDistribPerson;
for (int SurfNum = 1; SurfNum <= elecBaseboard.TotSurfToDistrib; ++SurfNum) {
elecBaseboard.SurfaceName(SurfNum) = state.dataIPShortCut->cAlphaArgs(SurfNum + 3);
Expand Down Expand Up @@ -919,7 +920,6 @@ namespace ElectricBaseboardRadiator {
Real64 ThisSurfIntensity =
(elecBaseboard.QBBElecRadSource * elecBaseboard.FracDistribToSurf(RadSurfNum) / state.dataSurface->Surface(SurfNum).Area);
state.dataHeatBalFanSys->SurfQElecBaseboard(SurfNum) += ThisSurfIntensity;
state.dataHeatBalSurf->AnyRadiantSystems(SurfNum) = true;
if (ThisSurfIntensity > DataHeatBalFanSys::MaxRadHeatFlux) {
ShowSevereError(state, "DistributeBBElecRadGains: excessive thermal radiation heat flux intensity detected");
ShowContinueError(state, "Surface = " + state.dataSurface->Surface(SurfNum).Name);
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HWBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ namespace HWBaseboardRadiator {
thisHWBaseboard.ZonePtr =
DataZoneEquipment::GetZoneEquipControlledZoneNum(state, DataZoneEquipment::ZoneEquipType::BaseboardWater, thisHWBaseboard.Name);

state.dataHeatBal->anyRadiantSystems = true;
Real64 AllFracsSummed = HWBaseboardDesignDataObject.FracDistribPerson;
for (SurfNum = 1; SurfNum <= thisHWBaseboard.TotSurfToDistrib; ++SurfNum) {
thisHWBaseboard.SurfacePtr(SurfNum) =
Expand Down Expand Up @@ -1510,7 +1511,6 @@ namespace HWBaseboardRadiator {
if (state.dataSurface->Surface(SurfNum).Area > SmallestArea) {
ThisSurfIntensity = (thisHWBB.QBBRadSource * thisHWBB.FracDistribToSurf(RadSurfNum) / state.dataSurface->Surface(SurfNum).Area);
state.dataHeatBalFanSys->SurfQHWBaseboard(SurfNum) += ThisSurfIntensity;
state.dataHeatBalSurf->AnyRadiantSystems(SurfNum) = true;
// 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
5 changes: 2 additions & 3 deletions src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,6 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state)
state.dataHeatBalSurf->SurfQRadIntGainsInRep.dimension(state.dataSurface->TotSurfaces, 0.0);
state.dataHeatBalSurf->SurfQdotRadIntGainsInRep.dimension(state.dataSurface->TotSurfaces, 0.0);

state.dataHeatBalSurf->AnyRadiantSystems.dimension(state.dataSurface->TotSurfaces, false);
state.dataHeatBalSurf->SurfQRadHVACInRep.dimension(state.dataSurface->TotSurfaces, 0.0);
state.dataHeatBalSurf->SurfQdotRadHVACInRep.dimension(state.dataSurface->TotSurfaces, 0.0);
state.dataHeatBalSurf->SurfQdotRadHVACInPerArea.dimension(state.dataSurface->TotSurfaces, 0.0);
Expand Down Expand Up @@ -2162,7 +2161,6 @@ void InitThermalAndFluxHistories(EnergyPlusData &state)
state.dataHeatBalSurf->SurfQdotRadLightsInRep(SurfNum) = 0.0;
state.dataHeatBalSurf->SurfQRadIntGainsInRep(SurfNum) = 0.0;
state.dataHeatBalSurf->SurfQdotRadIntGainsInRep(SurfNum) = 0.0;
state.dataHeatBalSurf->AnyRadiantSystems(SurfNum) = false;
state.dataHeatBalSurf->SurfQRadHVACInRep(SurfNum) = 0.0;
state.dataHeatBalSurf->SurfQdotRadHVACInRep(SurfNum) = 0.0;
state.dataHeatBalSurf->SurfQdotRadHVACInPerArea(SurfNum) = 0.0;
Expand Down Expand Up @@ -9033,9 +9031,10 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state,

void sumSurfQdotRadHVAC(EnergyPlusData &state)
{
if (!state.dataHeatBal->anyRadiantSystems) return;
for (auto thisSpace : state.dataHeatBal->space) {
for (int surfNum = thisSpace.HTSurfaceFirst; surfNum <= thisSpace.HTSurfaceLast; ++surfNum) {
if (state.dataHeatBalSurf->AnyRadiantSystems(surfNum)) {
if (state.dataSurface->surfIntConv(surfNum).getsRadiantHeat) {
state.dataHeatBalSurf->SurfQdotRadHVACInPerArea(surfNum) =
state.dataHeatBalFanSys->SurfQHTRadSys(surfNum) + state.dataHeatBalFanSys->SurfQHWBaseboard(surfNum) +
state.dataHeatBalFanSys->SurfQSteamBaseboard(surfNum) + state.dataHeatBalFanSys->SurfQElecBaseboard(surfNum) +
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HighTempRadiantSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ namespace HighTempRadiantSystem {
highTempRadSys.SurfacePtr.allocate(highTempRadSys.TotSurfToDistrib);
highTempRadSys.FracDistribToSurf.allocate(highTempRadSys.TotSurfToDistrib);

state.dataHeatBal->anyRadiantSystems = true;
AllFracsSummed = highTempRadSys.FracDistribPerson;
for (int SurfNum = 1; SurfNum <= highTempRadSys.TotSurfToDistrib; ++SurfNum) {
highTempRadSys.SurfaceName(SurfNum) = state.dataIPShortCut->cAlphaArgs(SurfNum + 7);
Expand Down Expand Up @@ -1155,7 +1156,6 @@ namespace HighTempRadiantSystem {
ThisSurfIntensity = (thisHTR.QHTRRadSource * thisHTR.FracRadiant * thisHTR.FracDistribToSurf(RadSurfNum) /
state.dataSurface->Surface(SurfNum).Area);
dataHBFS->SurfQHTRadSys(SurfNum) += ThisSurfIntensity;
state.dataHeatBalSurf->AnyRadiantSystems(SurfNum) = true;

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
2 changes: 1 addition & 1 deletion src/EnergyPlus/SteamBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ namespace SteamBaseboardRadiator {
continue;
}

state.dataHeatBal->anyRadiantSystems = true;
Real64 AllFracsSummed = SteamBaseboardDesignDataObject.FracDistribPerson;
for (SurfNum = 1; SurfNum <= state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).TotSurfToDistrib; ++SurfNum) {
state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SurfaceName(SurfNum) = state.dataIPShortCut->cAlphaArgs(SurfNum + 5);
Expand Down Expand Up @@ -1539,7 +1540,6 @@ namespace SteamBaseboardRadiator {
state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribToSurf(RadSurfNum) /
state.dataSurface->Surface(SurfNum).Area);
state.dataHeatBalFanSys->SurfQSteamBaseboard(SurfNum) += ThisSurfIntensity;
state.dataHeatBalSurf->AnyRadiantSystems(SurfNum) = true;

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 fd480aa

@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-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: OK (3587 of 3587 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-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.