LCOV - code coverage report
Current view: top level - EnergyPlus - DataHeatBalSurface.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 100.0 % 7 7
Test Date: 2025-05-22 16:09:37 Functions: 100.0 % 3 3

            Line data    Source code
       1              : // EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
       2              : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3              : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4              : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5              : // contributors. All rights reserved.
       6              : //
       7              : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8              : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9              : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10              : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11              : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12              : //
      13              : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14              : // provided that the following conditions are met:
      15              : //
      16              : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17              : //     conditions and the following disclaimer.
      18              : //
      19              : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20              : //     conditions and the following disclaimer in the documentation and/or other materials
      21              : //     provided with the distribution.
      22              : //
      23              : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24              : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25              : //     used to endorse or promote products derived from this software without specific prior
      26              : //     written permission.
      27              : //
      28              : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29              : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30              : //     reference solely to the software portion of its product, Licensee must refer to the
      31              : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32              : //     obtained under this License and may not use a different name for the software. Except as
      33              : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34              : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35              : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36              : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37              : //
      38              : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39              : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40              : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41              : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42              : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43              : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44              : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45              : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46              : // POSSIBILITY OF SUCH DAMAGE.
      47              : 
      48              : #ifndef DataHeatBalSurface_hh_INCLUDED
      49              : #define DataHeatBalSurface_hh_INCLUDED
      50              : 
      51              : // ObjexxFCL Headers
      52              : #include <ObjexxFCL/Array1D.hh>
      53              : #include <ObjexxFCL/Array2D.hh>
      54              : 
      55              : // EnergyPlus Headers
      56              : #include <EnergyPlus/Data/BaseData.hh>
      57              : #include <EnergyPlus/DataSurfaces.hh>
      58              : #include <EnergyPlus/EnergyPlus.hh>
      59              : 
      60              : namespace EnergyPlus {
      61              : 
      62              : namespace DataHeatBalSurface {
      63              : 
      64              :     // Data
      65              :     // MODULE PARAMETER DEFINITIONS
      66              :     Real64 constexpr MinSurfaceTempLimit(-100.0);            // Lowest inside surface temperature allowed in Celsius
      67              :     Real64 constexpr MinSurfaceTempLimitBeforeFatal(-250.0); // 2.5 times MinSurfaceTempLimit
      68              :     Real64 constexpr DefaultSurfaceTempLimit(200.0);         // Highest inside surface temperature allowed in Celsius
      69              :     Real64 constexpr IterDampConst(5.0);                     // Damping constant for inside surface temperature iterations
      70              :     int constexpr ItersReevalConvCoeff(30);                  // Number of iterations between inside convection coefficient reevaluations
      71              :     int constexpr MaxIterations(500);                        // Maximum number of iterations allowed for inside surface temps
      72              :     Real64 constexpr PoolIsOperatingLimit(0.0001);           // Limit to determine if swimming pool is operating or not
      73              :     int constexpr MinEMPDIterations(4);                      // Minimum number of iterations required for EMPD solution
      74              :     int constexpr IterationsForCondFDRelaxChange(5);         // number of iterations for inside temps that triggers a change
      75              : 
      76              : } // namespace DataHeatBalSurface
      77              : 
      78              : struct HeatBalSurfData : BaseGlobalStruct
      79              : {
      80              : 
      81              :     std::vector<bool> Zone_has_mixed_HT_models; // True if any surfaces in zone use CondFD, HAMT, or Kiva
      82              : 
      83              :     // Integer Variables for the Heat Balance Simulation
      84              :     Array1D_int SurfCurrNumHist; // From Old Bldctf.inc
      85              : 
      86              :     // Surface heat balance limits and convergence parameters
      87              :     Real64 MaxSurfaceTempLimit = 200.0;            // Highest inside surface temperature allowed in Celsius
      88              :     Real64 MaxSurfaceTempLimitBeforeFatal = 500.0; // 2.5 times MaxSurfaceTempLimit
      89              :     int MinIterations = 1;                         // Minimum number of iterations for surface heat balance
      90              :     bool InterZoneWindow = false;                  // True if there is an interzone window
      91              :     Real64 SumSurfaceHeatEmission = 0.0;           // Heat emission from all surfaces
      92              : 
      93              :     // Variables Dimensioned to Max Number of Heat Transfer Surfaces (maxhts)
      94              :     Array1D<Real64> SurfCTFConstInPart;  // Constant Inside Portion of the CTF calculation
      95              :     Array1D<Real64> SurfCTFConstOutPart; // Constant Outside Portion of the CTF calculation
      96              :     // This group of arrays (soon to be vectors) added to facilitate vectorizable loops in CalcHeatBalanceInsideSurf2CTFOnly
      97              :     Array1D<Real64> SurfCTFCross0;       // Construct.CTFCross(0)
      98              :     Array1D<Real64> SurfCTFInside0;      // Construct.CTFInside(0)
      99              :     Array1D<Real64> SurfCTFSourceIn0;    // Construct.CTFSourceIn(0)
     100              :     Array1D<Real64> SurfTempOutHist;     // TH(1,1,SurfNum)
     101              :     Array1D<Real64> SurfQSourceSinkHist; // SurfQsrcHist(SurfNum, 1)
     102              : 
     103              :     Array1D_int SurfIsAdiabatic;     // 0 not adiabatic, 1 is adiabatic
     104              :     Array1D_int SurfIsSourceOrSink;  // 0 no internal source/sink, 1 has internal source/sing
     105              :     Array1D_int SurfIsOperatingPool; // 0 not pool, 1 is pool
     106              :     Array1D<Real64> SurfTempTerm;    // TempTerm for heatbalance equation
     107              :     Array1D<Real64> SurfTempDiv;     // Divisor for heatbalance equation
     108              :     // end group added to support CalcHeatBalanceInsideSurf2CTFOnly
     109              :     Array1D<Real64> SurfTempIn;           // Temperature of the Inside Surface for each heat transfer surface
     110              :     Array1D<Real64> SurfTempInsOld;       // SurfTempIn from previous iteration for convergence check
     111              :     Array1D<Real64> SurfTempInTmp;        // Inside Surface Temperature Of Each Heat Transfer Surface
     112              :     Array1D<Real64> SurfHConvExt;         // Outside Convection Coefficient
     113              :     Array1D<Real64> SurfWinCoeffAdjRatio; // Convective Coefficient Adjustment Ratio assuming highly conductive frames
     114              :                                           // Only applicable for exterior window surfaces
     115              :     Array1D<Real64> SurfHAirExt;          // Outside Radiation Coefficient to Air
     116              :     Array1D<Real64> SurfHSkyExt;          // Outside Radiation Coefficient to Sky
     117              :     Array1D<Real64> SurfHGrdExt;          // Outside Radiation Coefficient to Ground
     118              :     Array1D<Real64> SurfHConvInt;         // INSIDE CONVECTION COEFFICIENT
     119              :     Array1D<Real64> SurfTempSource;       // Temperature at the source location for each heat transfer surface
     120              :     Array1D<Real64> SurfTempUserLoc;      // Temperature at the user specified location for each heat transfer surface
     121              :     Array1D<Real64> SurfTempInMovInsRep;  // Temperature of interior movable insulation on the side facing the zone
     122              :     Array1D<Real64> SurfHSrdSurfExt;      // Outside Radiation Coefficient to Surrounding Surfaces
     123              : 
     124              :     Array1D<Real64> SurfQConvInRep;        // Surface convection heat gain at inside face [J]
     125              :     Array1D<Real64> SurfQdotConvInRep;     // Surface convection heat transfer rate at inside face surface [W] (report)
     126              :     Array1D<Real64> SurfQdotConvInPerArea; // Surface conv heat transfer rate per m2 at inside face surf (report){w/m2]
     127              : 
     128              :     // these next three all are for net IR thermal radiation exchange with other surfaces in the model.
     129              :     Array1D<Real64> SurfQRadNetSurfInRep;    // Surface thermal radiation heat gain at Inside face [J]
     130              :     Array1D<Real64> SurfQdotRadNetSurfInRep; // Surface thermal radiation heat transfer inside face surface [W]
     131              :     // these next three all are for solar radiation gains on inside face
     132              :     Array1D<Real64> SurfQRadSolarInRep;           // Surface thermal radiation heat gain at Inside face [J]
     133              :     Array1D<Real64> SurfQdotRadSolarInRep;        // Surface thermal radiation heat transfer inside face surface [W]
     134              :     Array1D<Real64> SurfQdotRadSolarInRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Inside face surf
     135              :     // these next two all are for Lights visible radiation gains on inside face
     136              :     Array1D<Real64> SurfQRadLightsInRep;    // Surface thermal radiation heat gain at Inside face [J]
     137              :     Array1D<Real64> SurfQdotRadLightsInRep; // Surface thermal radiation heat transfer inside face surface [W]
     138              :     // these next two all are for Internal Gains sources of radiation gains on inside face
     139              :     Array1D<Real64> SurfQRadIntGainsInRep;    // Surface thermal radiation heat gain at Inside face [J]
     140              :     Array1D<Real64> SurfQdotRadIntGainsInRep; // Surface thermal radiation heat transfer inside face surface [W]
     141              :     // these next four all are for Radiative HVAC sources of radiation gains on inside face
     142              :     Array1D<Real64> SurfQRadHVACInRep;        // Surface thermal radiation heat gain at Inside face [J]
     143              :     Array1D<Real64> SurfQdotRadHVACInRep;     // Surface thermal radiation heat transfer inside face surface [W]
     144              :     Array1D<Real64> SurfQdotRadHVACInPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Inside face surf
     145              : 
     146              :     Array1D<Real64> SurfQConvOutReport;     // Surface convection heat gain at Outside face [J]
     147              :     Array1D<Real64> SurfQdotConvOutRep;     // Surface convection heat transfer rate at Outside face surface [W]
     148              :     Array1D<Real64> SurfQdotConvOutPerArea; // Surface conv heat transfer rate per m2 at Outside face surf (report){w/m2]
     149              : 
     150              :     Array1D<Real64> SurfQRadOutReport;        // Surface thermal radiation heat gain at Outside face [J]
     151              :     Array1D<Real64> SurfQdotRadOutRep;        // Surface thermal radiation heat transfer outside face surface [W]
     152              :     Array1D<Real64> SurfQdotRadOutRepPerArea; // [W/m2]Surface thermal radiation heat transfer rate per m2 at Outside face surf
     153              :     Array1D<Real64> SurfQAirExtReport;        // Surface Outside Face Thermal Radiation to Air Heat Transfer Rate [W]
     154              :     Array1D<Real64> SurfQHeatEmiReport;       // Surface Outside Face Heat Emission to Air Rate [W]
     155              : 
     156              :     Array1D<Real64> SurfOpaqInsFaceCondGainRep; // Opaq Surf Ins Face Cond when Opaq Surf Ins Face Cond >= 0
     157              :     Array1D<Real64> SurfOpaqInsFaceCondLossRep; // Opaq Surf Ins Face Cond when Opaq Surf Ins Face Cond  < 0
     158              :     Array1D<Real64> SurfOpaqInsFaceCond;        // Opaque surface inside face heat conduction flow (W) from inside of opaque surfaces,
     159              :                                                 // for reporting (W)
     160              :     Array1D<Real64> SurfOpaqInsFaceCondFlux;    // Opaque surface inside face heat conduction flux (W/m2) from inside of opaque surfaces,
     161              :                                                 // for reporting (W/m2)
     162              :     Array1D<Real64> SurfOpaqInsFaceCondEnergy;  // Opaque surface inside face heat conduction flow (J) from inside of opaque surfaces,
     163              :                                                 // for reporting (J)
     164              : 
     165              :     Array1D<Real64> SurfOpaqExtFaceCondGainRep; // Opaq Surf Ext Face Cond when Opaq Surf Ext Face Cond >= 0
     166              :     Array1D<Real64> SurfOpaqExtFaceCondLossRep; // Opaq Surf Ext Face Cond when Opaq Surf Ext Face Cond  < 0
     167              :     Array1D<Real64> SurfOpaqOutFaceCond;     // Opaque surface outside face heat conduction flow (W) from inside of opaque surfaces, for reporting (W)
     168              :     Array1D<Real64> SurfOpaqOutFaceCondFlux; // Opaque surface outside face heat conduct flux (W/m2) from outside of opaque surfaces,
     169              :                                              // for reporting (W/m2)
     170              :     Array1D<Real64> SurfOpaqOutFaceCondEnergy; // Opaque surface outside face heat conduction flow (J) from inside of opaque surfaces,
     171              :                                                // for reporting (J)
     172              : 
     173              :     Array1D<Real64> SurfOpaqAvgFaceCondGainRep; // Opaq Surf average Face Cond when Opaq Surf average Face Cond >= 0
     174              :     Array1D<Real64> SurfOpaqAvgFaceCondLossRep; // Opaq Surf average Face Cond when Opaq Surf average Face Cond  < 0
     175              :     Array1D<Real64> SurfOpaqAvgFaceCond;     // Opaque surface average heat conduction flow (W) net conduction from outside environ toward inside zone
     176              :                                              // from inside of opaque surfaces, for reporting (W)
     177              :     Array1D<Real64> SurfOpaqAvgFaceCondFlux; // Opaque surface average face heat conduction flux (W/m2) net conduction from outside environ to inside
     178              :                                              // zone from inside of opaque surfaces, for reporting (W/m2)
     179              :     Array1D<Real64> SurfOpaqAvgFaceCondEnergy; // Opaque surface average heat conduction flow (J) net conduction from outside environ toward inside
     180              :                                                // zone from inside of opaque surfaces, for reporting (J)
     181              : 
     182              :     Array1D<Real64> SurfOpaqStorageCondGainRep; // Opaque surface stored heat conduction flow when Opaque surface stored heat conduction flow  >= 0
     183              :     Array1D<Real64> SurfOpaqStorageCondLossRep; // Opaque surface stored heat conduction flow when Opaque surface stored heat conduction flow   < 0
     184              :     Array1D<Real64> SurfOpaqStorageCond;        // Opaque surface stored heat conduction flow (W) storage of heat inside surface,
     185              :                                                 // positive is increasing in surf
     186              :     Array1D<Real64> SurfOpaqStorageCondFlux;    // Opaque surface stored heat conduction flux (W/m2) storage of heat inside surface,
     187              :                                                 // positive is increasing in surf
     188              :     Array1D<Real64> SurfOpaqStorageCondEnergy;  // Opaque surface stored heat conduction flow (J) storage of heat inside surface,
     189              :                                                 // positive is increasing in surf
     190              : 
     191              :     Array1D<Real64> SurfOpaqInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar, for reporting (W)
     192              :     Array1D<Real64> SurfTempOut; // Temperature of the Outside Surface for each heat transfer surface used for reporting purposes only. Ref: TH(x,1,1)
     193              :     Array1D<Real64> SurfQRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation
     194              : 
     195              :     Array1D<Real64> SurfQdotRadNetLWInPerArea;  // Net interior long wavelength radiation to a surface from other surfaces
     196              :     Array1D<Real64> SurfQdotRadLightsInPerArea; // Short wave from Lights radiation absorbed on inside of opaque surface
     197              :     // Variables that are used in both the Surface Heat Balance and the Moisture Balance
     198              :     Array1D<Real64> SurfOpaqQRadSWOutAbs;  // Short wave radiation absorbed on outside of opaque surface
     199              :     Array1D<Real64> SurfOpaqQRadSWInAbs;   // Short wave radiation absorbed on inside of opaque surface
     200              :     Array1D<Real64> SurfQRadLWOutSrdSurfs; // Long wave radiation absorbed on outside of exterior surface
     201              : 
     202              :     Array1D<Real64> SurfQAdditionalHeatSourceOutside; // Additional heat source term on boundary conditions at outside surface
     203              :     Array1D<Real64> SurfQAdditionalHeatSourceInside;  // Additional heat source term on boundary conditions at inside surface
     204              : 
     205              :     Array1D<Real64> SurfOpaqInitialDifSolInAbs;   // Initial diffuse solar absorbed on inside of opaque surface [W/m2]
     206              :     Array1D<Real64> SurfWinInitialDifSolInTrans;  // Initial diffuse solar transmitted out through window inside face [W/m2]
     207              :     Array1D<Real64> SurfWinInitialBeamSolInTrans; // Interior beam solar transmitted out through window inside face [W]
     208              : 
     209              :     // REAL(r64) variables from BLDCTF.inc and only used in the Heat Balance
     210              :     // Hist Term (1 = Current Time, 2-MaxCTFTerms = previous times)
     211              :     Array1D<Array1D<Real64>> SurfInsideTempHist;  // Temperature history - inside (Hist Term, SurfNum)
     212              :     Array1D<Array1D<Real64>> SurfOutsideTempHist; // Temperature history - outside (Hist Term, SurfNum)
     213              :     Array1D<Array1D<Real64>>
     214              :         SurfInsideTempHistMaster; // Master temperature history (on the time step for the construct) - inside (Hist Term, SurfNum)
     215              :     Array1D<Array1D<Real64>>
     216              :         SurfOutsideTempHistMaster;                // Master temperature history (on the time step for the construct) - outside (Hist Term, SurfNum)
     217              :     Array1D<Array1D<Real64>> SurfInsideFluxHist;  // Flux history - inside (Hist Term, SurfNum)
     218              :     Array1D<Array1D<Real64>> SurfOutsideFluxHist; // Flux history - outside (Hist Term, SurfNum)
     219              :     Array1D<Array1D<Real64>> SurfInsideFluxHistMaster;  // Master flux history (on the time step for the construct) - inside (Hist Term, SurfNum)
     220              :     Array1D<Array1D<Real64>> SurfOutsideFluxHistMaster; // Master flux history (on the time step for the construct) - outside (Hist Term, SurfNum)
     221              : 
     222              :     Array2D<Real64> SurfTsrcHist;   // Temperature history at the source location (SurfNum,Term)
     223              :     Array2D<Real64> SurfTuserHist;  // Temperature history at the user specified location (SurfNum,Term)
     224              :     Array2D<Real64> SurfQsrcHist;   // Heat source/sink history for the surface (SurfNum,Term)
     225              :     Array2D<Real64> SurfTsrcHistM;  // Master temperature history at the source location (SurfNum,Term)
     226              :     Array2D<Real64> SurfTuserHistM; // Master temperature history at the user specified location (SurfNum,Term)
     227              :     Array2D<Real64> SurfQsrcHistM;  // Master heat source/sink history for the surface (SurfNum,Term)
     228              : 
     229              :     Array2D<Real64> ZoneFractDifShortZtoZ; // Fraction of diffuse short radiation in Zone 2 transmitted to Zone 1
     230              :     Array1D_bool EnclSolRecDifShortFromZ;  // True if Zone gets short radiation from another
     231              : 
     232              :     // Surface Heat Balance
     233              :     Array1D<Real64> SurfAbsSolarExt;                      // Solar Absorptivity of surface outside face or interior movable insulation if present
     234              :     Array1D<Real64> SurfAbsThermalExt;                    // Thermal Absorptivity of surface outside face or interior movable insulation if present
     235              :     Array1D<Real64> SurfAbsSolarInt;                      // Solar absorptivity of surface inside face or exterior movable insulation if present
     236              :     Array1D<Material::SurfaceRoughness> SurfRoughnessExt; // Roughness of surface inside face or exterior movable insulation if present
     237              :     Array1D<Real64> SurfAbsThermalInt;                    // Thermal absorptivity of surface inside face or exterior movable insulation if present
     238              : 
     239              :     std::vector<int> SurfMovSlatsIndexList;
     240              : 
     241         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
     242              :     {
     243         2126 :     }
     244              : 
     245         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     246              :     {
     247         1152 :     }
     248              : 
     249         2100 :     void clear_state() override
     250              :     {
     251         2100 :         new (this) HeatBalSurfData();
     252         2100 :     }
     253              : };
     254              : 
     255              : } // namespace EnergyPlus
     256              : 
     257              : #endif
        

Generated by: LCOV version 2.0-1