Skip to content

Commit

Permalink
Merge pull request #8786 from energy-plus/sw-thermal-absorp
Browse files Browse the repository at this point in the history
Solar and thermal absorptance calculation
  • Loading branch information
mjwitte authored Jun 10, 2021
2 parents ab0f165 + 943bd84 commit ac2bc9a
Show file tree
Hide file tree
Showing 14 changed files with 183 additions and 113 deletions.
4 changes: 4 additions & 0 deletions src/EnergyPlus/DataGlobals.hh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ struct DataGlobal : BaseGlobalStruct
bool FinalSizingHVACSizingSimIteration = false; // when doing HVAC sizing Simulation
bool AnyEnergyManagementSystemInModel = false; // true if there is any EMS or Erl in model. otherwise false
bool AnySurfPropOverridesInModel = false; // true if there is any EMS or Erl overriding the surface properties for any surface.
bool AnyConstrOverridesInModel = false; // true if there is any EMS or Erl overriding the constructions for any surface.
bool AndShadingControlInModel = false; // true if there is any window shading control for any fenestration surface
bool AnyLocalEnvironmentsInModel = false; // true if there is any local environmental data objected defined in model, otherwise false
bool AnyPlantInModel = false; // true if there are any plant or condenser loops in model, otherwise false
bool AnyIdealCondEntSetPointInModel = false; // true if there is any ideal condenser entering set point manager in model.
Expand Down Expand Up @@ -243,7 +245,9 @@ struct DataGlobal : BaseGlobalStruct
this->RedoSizesHVACSimulation = false;
this->FinalSizingHVACSizingSimIteration = false;
this->AnyEnergyManagementSystemInModel = false;
this->AnyConstrOverridesInModel = false;
this->AnySurfPropOverridesInModel = false;
this->AndShadingControlInModel = false;
this->AnyLocalEnvironmentsInModel = false;
this->AnyPlantInModel = false;
this->AnyIdealCondEntSetPointInModel = false;
Expand Down
18 changes: 10 additions & 8 deletions src/EnergyPlus/DataHeatBalSurface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,16 @@ struct HeatBalSurfData : BaseGlobalStruct
Array1D<bool> SurfMovInsulExtPresent; // True when interior movable insulation is present
Array1D<bool> SurfMovInsulIntPresent; // True when interior movable insulation is present
Array1D<bool> SurfMovInsulIntPresentPrevTS; // True when interior movable insulation was present during the previous time step
Array1D<Real64> SurfMovInsulHExt; // Resistance or "h" value of exterior movable insulation
Array1D<Real64> SurfMovInsulHInt; // Resistance or "h" value of interior movable insulation
Array1D<Real64> SurfAbsSolarExt; // Solar Absorptivity of surface inside face or interior movable insulation if present
Array1D<Real64> SurfAbsThermalExt; // Thermal Absorptivity of surface inside face or interior movable insulation if present
Array1D<Real64> SurfAbsSolarInt; // Solar absorptivity of surface outside face or exterior movable insulation if present
Array1D<Real64> SurfRoughnessExt; // Roughness of surface inside face or interior movable insulation if present
Array1D<Real64> SurfAbsThermalInt; // Thermal absorptivity of surface outside face or exterior movable insulation if present
std::vector<int> SurfMovInsulIndexList;

Array1D<Real64> SurfMovInsulHExt; // Resistance or "h" value of exterior movable insulation
Array1D<Real64> SurfMovInsulHInt; // Resistance or "h" value of interior movable insulation
Array1D<Real64> SurfAbsSolarExt; // Solar Absorptivity of surface inside face or interior movable insulation if present
Array1D<Real64> SurfAbsThermalExt; // Thermal Absorptivity of surface inside face or interior movable insulation if present
Array1D<Real64> SurfAbsSolarInt; // Solar absorptivity of surface outside face or exterior movable insulation if present
Array1D<Real64> SurfRoughnessExt; // Roughness of surface inside face or interior movable insulation if present
Array1D<Real64> SurfAbsThermalInt; // Thermal absorptivity of surface outside face or exterior movable insulation if present
std::vector<int> SurfMovInsulIndexList;
std::vector<int> SurfMovSlatsIndexList;
void clear_state() override
{
this->Zone_has_mixed_HT_models.clear();
Expand Down Expand Up @@ -380,6 +381,7 @@ struct HeatBalSurfData : BaseGlobalStruct
this->SurfAbsThermalInt.deallocate();
this->SurfRoughnessExt.deallocate();
this->SurfMovInsulIndexList.clear();
this->SurfMovSlatsIndexList.clear();
}
};

Expand Down
21 changes: 10 additions & 11 deletions src/EnergyPlus/DataHeatBalance.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2179,13 +2179,12 @@ struct HeatBalanceData : BaseGlobalStruct
// from interior surfaces, and beam entering through interior windows
// (considered diffuse)
// Originally QD, now used only for EnclSolQSDifSol calc for daylighting
Array1D<Real64> EnclSolVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance)
Array1D<Real64> EnclRadQThermalRad; // TOTAL THERMAL RADIATION ADDED TO ZONE or Radiant Enclosure (group of zones)

// todo - the following in absorptance branch
Array1D<Real64> ITABSF; // FRACTION OF THERMAL FLUX ABSORBED (PER UNIT AREA)
Array1D<Real64> TMULT; // TMULT - MULTIPLIER TO COMPUTE 'ITABSF'

Array1D<Real64> EnclSolVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance)
Array1D<Real64> EnclRadQThermalRad; // TOTAL THERMAL RADIATION ADDED TO ZONE or Radiant Enclosure (group of zones)
Array1D<Real64> EnclRadThermAbsMult; // EnclRadThermAbsMult - MULTIPLIER TO COMPUTE 'ITABSF'
Array1D<bool> ZoneSolAbsFirstCalc; // for error message
Array1D<bool> EnclRadReCalc; // Enclosure solar or thermal radiation properties needs to be recalc due to window/shading status change
bool EnclRadAlwaysReCalc = false; // Enclosure solar or thermal radiation properties always needs to be recalc at any time step
// todo - the following in absorptance branch
Array2D<Real64> SunlitFracHR; // Hourly fraction of heat transfer surface that is sunlit
Array2D<Real64> CosIncAngHR; // Hourly cosine of beam radiation incidence angle on surface
Expand Down Expand Up @@ -2361,6 +2360,7 @@ struct HeatBalanceData : BaseGlobalStruct
this->NoFfactorConstructionsUsed = true;
this->NoCfactorConstructionsUsed = true;
this->NoRegularMaterialsUsed = true;
this->EnclRadAlwaysReCalc = false;
this->SNLoadHeatEnergy.deallocate();
this->SNLoadCoolEnergy.deallocate();
this->SNLoadHeatRate.deallocate();
Expand Down Expand Up @@ -2468,10 +2468,9 @@ struct HeatBalanceData : BaseGlobalStruct
this->EnclSolQDforDaylight.deallocate();
this->EnclSolVMULT.deallocate();
this->EnclRadQThermalRad.deallocate();

this->ITABSF.deallocate();
this->TMULT.deallocate();

this->EnclRadThermAbsMult.deallocate();
this->ZoneSolAbsFirstCalc.deallocate();
this->EnclRadReCalc.deallocate();
this->SunlitFracHR.deallocate();
this->CosIncAngHR.deallocate();
this->SunlitFrac.deallocate();
Expand Down
7 changes: 5 additions & 2 deletions src/EnergyPlus/DataSurfaces.hh
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ namespace DataSurfaces {
std::vector<int> windowShadingControlList; // List of possible window shading controls
bool HasShadeControl; // True if the surface is listed in a WindowShadingControl object
int activeShadedConstruction; // The currently active shaded construction (windows only)
int activeShadedConstructionPrev; // The currently active shaded construction (windows only)
std::vector<int> shadedConstructionList; // List of shaded constructions that correspond with window shading controls (windows only - same
// indexes as windowShadingControlList)
std::vector<int> shadedStormWinConstructionList; // List of shaded constructions with storm window that correspond with window shading
Expand All @@ -668,8 +669,8 @@ namespace DataSurfaces {
HeatTransferAlgorithm(iHeatTransferModel::NotSet), BaseSurf(0), NumSubSurfaces(0), Zone(0), ExtBoundCond(0), ExtSolar(false),
ExtWind(false), ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0),
MirroredSurf(false), IsShadowing(false), IsShadowPossibleObstruction(false), SchedShadowSurfIndex(0), IsTransparent(false),
SchedMinValue(0.0), activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0),
Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false)
SchedMinValue(0.0), activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), activeShadedConstructionPrev(0),
FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false)
{
}

Expand Down Expand Up @@ -1199,6 +1200,7 @@ struct SurfacesData : BaseGlobalStruct
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
Array1D_int InsideGlassCondensationFlag; // 1 if innermost glass inside surface temp < zone air dew point; 0 otherwise
Array1D_int InsideFrameCondensationFlag; // 1 if frame inside surface temp < zone air dew point; 0 otherwise
Array1D_int InsideDividerCondensationFlag; // 1 if divider inside surface temp < zone air dew point; 0 otherwise
Expand Down Expand Up @@ -1589,6 +1591,7 @@ struct SurfacesData : BaseGlobalStruct
this->AirflowWindows = false;
this->ShadingTransmittanceVaries = false;
this->AnyMovableInsulation = false;
this->AnyMovableSlat = false;
this->InsideGlassCondensationFlag.deallocate();
this->InsideFrameCondensationFlag.deallocate();
this->InsideDividerCondensationFlag.deallocate();
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/HeatBalanceIntRadExchange.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ namespace HeatBalanceIntRadExchange {
zone_info.Emissivity(ZoneSurfNum) = state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum);
if (state.dataConstruction->Construct(ConstrNum).TypeIsWindow &&
ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) {
zone_info.Emissivity(ZoneSurfNum) = state.dataHeatBal->ITABSF(SurfNum);
zone_info.Emissivity(ZoneSurfNum) = state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum);
}
if (state.dataSurface->SurfWinWindowModelType(SurfNum) == WindowEQLModel &&
state.dataWindowEquivLayer->CFS(state.dataConstruction->Construct(ConstrNum).EQLConsPtr).ISControlled) {
Expand Down Expand Up @@ -310,7 +310,7 @@ namespace HeatBalanceIntRadExchange {
// and emiss is used here that is a weighted combination of shade/blind and glass temp and emiss.
} else if (ANY_INTERIOR_SHADE_BLIND(state.dataSurface->SurfWinShadingFlag(SurfNum))) {
SurfaceTempRad[ZoneSurfNum] = state.dataSurface->SurfWinEffInsSurfTemp(SurfNum);
SurfaceEmiss[ZoneSurfNum] = state.dataHeatBal->ITABSF(SurfNum);
SurfaceEmiss[ZoneSurfNum] = state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum);
} else {
SurfaceTempRad[ZoneSurfNum] = SurfaceTemp(SurfNum);
SurfaceEmiss[ZoneSurfNum] = construct.InsideAbsorpThermal;
Expand Down
8 changes: 8 additions & 0 deletions src/EnergyPlus/HeatBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5717,6 +5717,9 @@ namespace HeatBalanceManager {
state.dataHeatBal->EnclSolQDforDaylight.allocate(state.dataGlobal->NumOfZones);
state.dataHeatBal->EnclRadQThermalRad.allocate(state.dataGlobal->NumOfZones);
state.dataHeatBal->ZoneMRT.allocate(state.dataGlobal->NumOfZones);
state.dataHeatBal->EnclRadThermAbsMult.allocate(state.dataGlobal->NumOfZones);
state.dataHeatBal->ZoneSolAbsFirstCalc.allocate(state.dataGlobal->NumOfZones);
state.dataHeatBal->EnclRadReCalc.allocate(state.dataGlobal->NumOfZones);
for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) {
state.dataHeatBal->EnclSolDB(zoneNum) = 0.0;
state.dataHeatBal->EnclSolDBSSG(zoneNum) = 0.0;
Expand All @@ -5726,12 +5729,17 @@ namespace HeatBalanceManager {
state.dataHeatBal->EnclSolQDforDaylight(zoneNum) = 0.0;
state.dataHeatBal->EnclRadQThermalRad(zoneNum) = 0.0;
state.dataHeatBal->ZoneMRT(zoneNum) = 0.0;
state.dataHeatBal->EnclRadThermAbsMult(zoneNum) = 0.0;
state.dataHeatBal->ZoneSolAbsFirstCalc(zoneNum) = true;
state.dataHeatBal->EnclRadReCalc(zoneNum) = false;
}
state.dataHeatBal->EnclSolQSWRad.allocate(state.dataViewFactor->NumOfSolarEnclosures);
state.dataHeatBal->EnclSolQSWRadLights.allocate(state.dataViewFactor->NumOfSolarEnclosures);
state.dataHeatBal->EnclSolVMULT.allocate(state.dataViewFactor->NumOfSolarEnclosures);
for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) {
state.dataHeatBal->EnclSolQSWRad(enclosureNum) = 0.0;
state.dataHeatBal->EnclSolQSWRadLights(enclosureNum) = 0.0;
state.dataHeatBal->EnclSolVMULT(enclosureNum) = 0.0;
}
}
void AllocateHeatBalArrays(EnergyPlusData &state)
Expand Down
Loading

5 comments on commit ac2bc9a

@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.

develop (mjwitte) - x86_64-MacOS-10.15-clang-11.0.0: OK (2363 of 2363 tests passed, 0 test warnings)

Build Badge Test 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.

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2383 of 2383 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.

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1639 of 1639 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

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

Build Badge Test 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.

develop (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (726 of 726 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.