Skip to content
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

Fix HVAC radiant heat gain with CondFD #10310

Merged
merged 12 commits into from
Jan 5, 2024
16 changes: 9 additions & 7 deletions src/EnergyPlus/ChilledCeilingPanelSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ void GetCoolingPanelInput(EnergyPlusData &state)
}
if (thisCP.SurfacePtr(SurfNum) != 0) {
state.dataSurface->surfIntConv(thisCP.SurfacePtr(SurfNum)).getsRadiantHeat = true;
state.dataSurface->allGetsRadiantHeatSurfaceList.emplace_back(thisCP.SurfacePtr(SurfNum));
}

AllFracsSummed += thisCP.FracDistribToSurf(SurfNum);
Expand Down Expand Up @@ -1588,13 +1589,15 @@ 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 (auto &thisCP : state.dataChilledCeilingPanelSimple->CoolingPanel) {
for (int radSurfNum = 1; radSurfNum <= thisCP.TotSurfToDistrib; ++radSurfNum) {
int surfNum = thisCP.SurfacePtr(radSurfNum);
state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum).CoolingPanel = 0.0;
}
}
state.dataHeatBalFanSys->ZoneQCoolingPanelToPerson = 0.0;

for (int CoolingPanelNum = 1; CoolingPanelNum <= (int)state.dataChilledCeilingPanelSimple->CoolingPanel.size(); ++CoolingPanelNum) {

auto &thisCP(state.dataChilledCeilingPanelSimple->CoolingPanel(CoolingPanelNum));

for (auto &thisCP : state.dataChilledCeilingPanelSimple->CoolingPanel) {
int ZoneNum = thisCP.ZonePtr;
if (ZoneNum <= 0) continue;
state.dataHeatBalFanSys->ZoneQCoolingPanelToPerson(ZoneNum) += thisCP.CoolingPanelSource * thisCP.FracDistribPerson;
Expand All @@ -1604,8 +1607,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.dataHeatBalSurf->AnyRadiantSystems = true;
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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New struct to hold the old Array1Ds for SurfQHTRadSys, SurfQHWBaseboard, etc.

Copy link
Member

Choose a reason for hiding this comment

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

:) :) :)

{
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
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
6 changes: 2 additions & 4 deletions src/EnergyPlus/DataHeatBalance.hh
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,8 @@ namespace DataHeatBalance {
int zoneOABalanceIndex = 0; // Index to ZoneAirBalance for this zone, if any

// Spaces
bool anySurfacesWithoutSpace = false; // True if any surfaces in a zone do not have a space assigned in input
bool anySurfacesWithSpace = false; // True if any surfaces in a zone have a space assigned in input
Comment on lines -701 to -702
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated to the main defect, but moved these out of state.

Copy link
Member

Choose a reason for hiding this comment

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

👍

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
5 changes: 3 additions & 2 deletions src/EnergyPlus/DataSurfaces.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1425,8 +1425,6 @@ struct SurfacesData : BaseGlobalStruct
bool AirflowWindows = false; // TRUE if one or more airflow windows
bool ShadingTransmittanceVaries = false; // overall, shading transmittance varies for the building
bool UseRepresentativeSurfaceCalculations = false; // Use Representative Surfaces for Calculations
bool AnyHeatBalanceInsideSourceTerm = false; // True if any SurfaceProperty:HeatBalanceSourceTerm inside face used
bool AnyHeatBalanceOutsideSourceTerm = false; // True if any SurfaceProperty:HeatBalanceSourceTerm outside face used
bool AnyMovableInsulation = false; // True if any movable insulation presents
bool AnyMovableSlat = false; // True if there are any movable slats for window blinds presented

Expand All @@ -1451,6 +1449,9 @@ struct SurfacesData : BaseGlobalStruct
std::vector<int> AllHTKivaSurfaceList; // List of all Kiva foundation surfaces
std::vector<int> AllSurfaceListReportOrder; // List of all surfaces - output reporting order
std::vector<int> AllVaryAbsOpaqSurfaceList; // List of all opaque exterior surfaces with dynamic coating
std::vector<int> allInsideSourceSurfaceList; // List of all surfaces with SurfaceProperty:HeatBalanceSourceTerm for inside face
std::vector<int> allOutsideSourceSurfaceList; // List of all surfaces with SurfaceProperty:HeatBalanceSourceTerm for outside face
std::vector<int> allGetsRadiantHeatSurfaceList; // List of all surfaces that receive radiant HVAC output
Comment on lines +1452 to +1454
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New surface lists for special cases.


std::array<std::vector<int>, static_cast<int>(DataSurfaces::SurfaceFilter::Num)> SurfaceFilterLists;

Expand Down
11 changes: 8 additions & 3 deletions src/EnergyPlus/ElectricBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ namespace ElectricBaseboardRadiator {
}
if (elecBaseboard.SurfacePtr(SurfNum) != 0) {
state.dataSurface->surfIntConv(elecBaseboard.SurfacePtr(SurfNum)).getsRadiantHeat = true;
state.dataSurface->allGetsRadiantHeatSurfaceList.emplace_back(elecBaseboard.SurfacePtr(SurfNum));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Example of building the allGetsRadiantHeatSurfaceList vector.

}

AllFracsSummed += elecBaseboard.FracDistribToSurf(SurfNum);
Expand Down Expand Up @@ -905,7 +906,12 @@ 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 (auto &elecBaseboard : state.dataElectBaseboardRad->ElecBaseboard) {
for (int radSurfNum = 1; radSurfNum <= elecBaseboard.TotSurfToDistrib; ++radSurfNum) {
int surfNum = elecBaseboard.SurfacePtr(radSurfNum);
state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum).ElecBaseboard = 0.0;
Comment on lines -908 to +912
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of zeroing this for all surfaces, only need to touch the surfaces that actually receive radiant heat from electric baseboards. Similar changes for the other four equipment types (chilled panel, HW baseboard, Steam baseboard, high temp radiant).

}
}
state.dataHeatBalFanSys->ZoneQElecBaseboardToPerson = 0.0;

for (auto &elecBaseboard : state.dataElectBaseboardRad->ElecBaseboard) {
Expand All @@ -918,8 +924,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.dataHeatBalSurf->AnyRadiantSystems = true;
state.dataHeatBalFanSys->surfQRadFromHVAC(SurfNum).ElecBaseboard += ThisSurfIntensity;
Comment on lines -921 to +927
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously AnyRadiantSystems was getting set to true for all surfaces more than once for every iteration.

if (ThisSurfIntensity > DataHeatBalFanSys::MaxRadHeatFlux) {
ShowSevereError(state, "DistributeBBElecRadGains: excessive thermal radiation heat flux intensity detected");
ShowContinueError(state, "Surface = " + state.dataSurface->Surface(SurfNum).Name);
Expand Down
18 changes: 10 additions & 8 deletions src/EnergyPlus/HWBaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ namespace HWBaseboardRadiator {
}
if (thisHWBaseboard.SurfacePtr(SurfNum) != 0) {
state.dataSurface->surfIntConv(thisHWBaseboard.SurfacePtr(SurfNum)).getsRadiantHeat = true;
state.dataSurface->allGetsRadiantHeatSurfaceList.emplace_back(thisHWBaseboard.SurfacePtr(SurfNum));
}

AllFracsSummed += thisHWBaseboard.FracDistribToSurf(SurfNum);
Expand Down Expand Up @@ -1489,13 +1490,15 @@ namespace HWBaseboardRadiator {
// SUBROUTINE PARAMETER DEFINITIONS:
Real64 constexpr SmallestArea(0.001); // Smallest area in meters squared (to avoid a divide by zero)

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int RadSurfNum; // Counter for surfaces receiving radiation from radiant heater
int SurfNum; // Pointer to the Surface derived type
Real64 ThisSurfIntensity; // temporary for W/m2 term for rad on a surface

// Initialize arrays
state.dataHeatBalFanSys->SurfQHWBaseboard = 0.0;
for (auto &thisHWBB : state.dataHWBaseboardRad->HWBaseboard) {
for (int radSurfNum = 1; radSurfNum <= thisHWBB.TotSurfToDistrib; ++radSurfNum) {
int surfNum = thisHWBB.SurfacePtr(radSurfNum);
state.dataHeatBalFanSys->surfQRadFromHVAC(surfNum).HWBaseboard = 0.0;
}
}
state.dataHeatBalFanSys->ZoneQHWBaseboardToPerson = 0.0;

for (auto &thisHWBB : state.dataHWBaseboardRad->HWBaseboard) {
Expand All @@ -1505,12 +1508,11 @@ namespace HWBaseboardRadiator {
if (ZoneNum <= 0) continue;
state.dataHeatBalFanSys->ZoneQHWBaseboardToPerson(ZoneNum) += thisHWBB.QBBRadSource * HWBaseboardDesignDataObject.FracDistribPerson;

for (RadSurfNum = 1; RadSurfNum <= thisHWBB.TotSurfToDistrib; ++RadSurfNum) {
SurfNum = thisHWBB.SurfacePtr(RadSurfNum);
for (int RadSurfNum = 1; RadSurfNum <= thisHWBB.TotSurfToDistrib; ++RadSurfNum) {
int 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.dataHeatBalSurf->AnyRadiantSystems = true;
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
Loading
Loading