LCOV - code coverage report
Current view: top level - EnergyPlus - DataWindowEquivalentLayer.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 19 26 73.1 %
Date: 2023-01-17 19:17:23 Functions: 16 21 76.2 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2023, 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 DataWindowEquivalentLayer_hh_INCLUDED
      49             : #define DataWindowEquivalentLayer_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/Data/BaseData.hh>
      56             : #include <EnergyPlus/DataGlobals.hh>
      57             : #include <EnergyPlus/EnergyPlus.hh>
      58             : 
      59             : namespace EnergyPlus {
      60             : 
      61             : namespace DataWindowEquivalentLayer {
      62             : 
      63             :     // Using/Aliasing
      64             : 
      65             :     // Data
      66             :     // CFSTY: Complex Fenestration System
      67             :     int constexpr CFSMAXNL = 6; // max # of glaze or shade layers
      68             :     // Long-wave (aka LW or thermal) layer properties
      69             :     // Short wave (aka SW or solar) layer properties
      70             :     // "black" room (no reflection)
      71             :     // Layer information
      72             : 
      73             :     // Gap Gas Properties
      74             :     // Gap information
      75             :     // Equivalent Layer Window Constructon
      76             :     // CFSLAYER: layer types
      77             :     enum class LayerType
      78             :     {
      79             :         Invalid = -1,
      80             :         NONE,   // unused / empty layer
      81             :         GLAZE,  // glazing layer i.e, purely specular
      82             :         DRAPE,  // pleated drapes/curtains
      83             :         ROLLB,  // roller blind
      84             :         VBHOR,  // venetian blinds - horizontal
      85             :         VBVER,  // venetian blinds - vertical
      86             :         INSCRN, // insect screen
      87             :         ROOM,   // indoor space and/or make no adjustment
      88             :         GZS,    // glazing with spectral data (read from aux file)
      89             :         Num
      90             :     };
      91             : 
      92             :     // index for solar arrays
      93             :     enum class SolarArrays
      94             :     {
      95             :         Invalid = -1,
      96             :         DIFF,
      97             :         BEAM,
      98             :         Num
      99             :     };
     100             : 
     101             :     // Parameters to indicate blind orientation for use with the Material
     102             :     // derived type (see below):
     103             :     enum class Orientation
     104             :     {
     105             :         Invalid = -1,
     106             :         Horizontal,
     107             :         Vertical,
     108             :         Num
     109             :     };
     110             : 
     111             :     enum class AngleType
     112             :     {
     113             :         Invalid = -1,
     114             :         Fixed,
     115             :         Variable,
     116             :         Num
     117             :     };
     118             : 
     119             :     struct CFSLWP
     120             :     {
     121             :         // Members
     122             :         Real64 EPSLF; // thermal emittance, front (outside) side
     123             :         Real64 EPSLB; // thermal emittance, back (inside) side
     124             :         Real64 TAUL;  // thermal transmittance (same value for front or back)
     125             : 
     126             :         // Default Constructor
     127           4 :         CFSLWP() : EPSLF(0.0), EPSLB(0.0), TAUL(0.0)
     128             :         {
     129           4 :         }
     130             :     };
     131             : 
     132             :     struct CFSSWP
     133             :     {
     134             :         // Members
     135             :         Real64 RHOSFBB; // Solar reflectance, BEAM-BEAM, front (outside) side (any angle of incidence)
     136             :         Real64 RHOSBBB; // Solar reflectance, BEAM-BEAM, back (inside) side (any angle of incidence)
     137             :         Real64 TAUSFBB; // Solar transmittance, BEAM-BEAM, any angle of incidence
     138             :         // radiation incident from front (outside)
     139             :         Real64 TAUSBBB; // Solar transmittance, BEAM-BEAM, any angle of incidence
     140             :         //    radiation incident from back (inside)
     141             :         Real64 RHOSFBD; // Solar reflectance, BEAM-DIFFUSE, front (outside) side
     142             :         //    BEAM-DIFFUSE, any angle of incidence
     143             :         Real64 RHOSBBD; // Solar reflectance, BEAM-DIFFUSE, back (inside) side
     144             :         //    any angle of incidence
     145             :         Real64 TAUSFBD; // Solar transmittance, BEAM-DIFFUSE, front (outside) side
     146             :         //    any angle of incidence
     147             :         Real64 TAUSBBD; // Solar transmittance, BEAM-DIFFUSE, any angle of incidence
     148             :         Real64 RHOSFDD; // Solar reflectance, DIFFUSE-DIFFUSE, front (outside) side
     149             :         Real64 RHOSBDD; // Solar reflectance, DIFFUSE-DIFFUSE, back (inside) side
     150             :         Real64 TAUS_DD; // Solar transmittance, DIFFUSE-DIFFUSE
     151             :         //    (same value for radiation incident from front or back)
     152             : 
     153             :         // Default Constructor
     154        2170 :         CFSSWP()
     155        2170 :             : RHOSFBB(0.0), RHOSBBB(0.0), TAUSFBB(0.0), TAUSBBB(0.0), RHOSFBD(0.0), RHOSBBD(0.0), TAUSFBD(0.0), TAUSBBD(0.0), RHOSFDD(0.0),
     156        2170 :               RHOSBDD(0.0), TAUS_DD(0.0)
     157             :         {
     158        2170 :         }
     159             :     };
     160             : 
     161          56 :     struct CFSLAYER
     162             :     {
     163             :         // Members
     164             :         std::string Name; // ID of layer
     165             :         LayerType LTYPE;  // layer type (see ltyXXX above)
     166             :         int iGZS;         // re spectral glazing
     167             :         //   = GZSTbl idx of LTYPE=ltyGZS (spectral glazing)
     168             :         //   else 0
     169             :         // material properties
     170             :         //  ltyGLAZE, ltyROLLB: as measured
     171             :         CFSSWP SWP_MAT; // ltyGZS: derived from GSZ file data
     172             :         CFSLWP LWP_MAT; // ltyVBxxx = slat properties (diffuse only)
     173             :         //   short wave (solar)
     174             :         //   long wave (thermal)
     175             :         // equivalent layer properties (see FinalizeCFSLAYER())
     176             :         //  = diff + direct-normal properties for pseudo flat layer
     177             :         CFSSWP SWP_EL; // ltyGLAZE, ltyGZS, ltyROLLB: same as _MAT
     178             :         CFSLWP LWP_EL; // ltyVBxxx: see VB_xxx()
     179             :         //   short wave (solar)
     180             :         //   long wave (thermal)
     181             :         // Shade Geometry (Slat, Drape, Insect Screen)
     182             :         Real64 S; // spacing
     183             :         //    VB: slat spacing, m, >0
     184             :         //    PD: rectangular pleat spacing, m >0
     185             :         //    IS: wire center-to-center spacing (pitch), m, >0
     186             :         //    else unused
     187             :         Real64 W; // width
     188             :         //    VB: slat tip-to-tip (chord width), m, >0
     189             :         //        if crown > 0, W < slat flattened width
     190             :         //    PD: pleat depth, m >= 0
     191             :         //    IS: wire diameter, m, >0, <S
     192             :         Real64 C; // crown
     193             :         //    VB: slat crown, m >=0 if used
     194             :         //    crown assume upward for ltyVBHOR else unused
     195             :         Real64 PHI_DEG; // Angle
     196             :         //    VB: slat angle, degrees (-90 <= PHI_DEG <= 90)
     197             :         //        ltyVBHOR: + = front-side slat tip below horizontal
     198             :         //        ltyVBVER: + = front-side slat tip is counter-
     199             :         //                     clockwise from normal (viewed from above)
     200             :         //    else unused
     201             :         // shade control method
     202             :         int CNTRL; // VB: lscNONE:   PHI_DEG not changed
     203             :         //        lscVBPROF: PHI_DEG = profile angle (max gain)
     204             :         //        lscVBNOBM: exclude beam (max visibility w/o beam)
     205             :         //                   PHI_DEG altered to just exclude beam
     206             :         //                   PHI_DEG = 20 if diffuse only
     207             : 
     208             :         // Default Constructor
     209           2 :         CFSLAYER() : LTYPE(LayerType::Invalid), iGZS(0), S(0.0), W(0.0), C(0.0), PHI_DEG(0.0), CNTRL(0)
     210             :         {
     211           2 :         }
     212             :     };
     213             : 
     214          41 :     struct CFSFILLGAS
     215             :     {
     216             :         // Members
     217             :         std::string Name; // Gas Type (AIR, ARGON, XENON, KRYPTON, CUSTOM)
     218             :         // Gas Conductivity: K = AK + BK*T + CK*T*T
     219             :         Real64 AK; // conductivity coeff constant term,  (W/m-K)
     220             :         Real64 BK; // conductivity coeff of T term, (W/m-K2)
     221             :         Real64 CK; // conductivity coeff of T^2 term, (W/m-K^3)
     222             :         // Gas Specific heat: CP = ACP + BCP*T + CCP*T*T
     223             :         Real64 ACP; // specific heat constant term, (J/kg-K)
     224             :         Real64 BCP; // specific heat coeff of T term, (J/kg-K^2)
     225             :         Real64 CCP; // specific heat coeff of T^2 term, (J/kg-K^3)
     226             :         // Gas Viscosity: Visc = AVISC + BVISC*T + CVISC*T*T
     227             :         Real64 AVISC; // viscosity constant term, (N-sec/m2)
     228             :         Real64 BVISC; // viscosity coeff of T term, (N-sec/m2-K)
     229             :         Real64 CVISC; // viscosity coeff of T^2 term, (N-sec/m2-K^2)
     230             :         Real64 MHAT;  // apparent molecular weight of gas
     231             : 
     232             :         // Default Constructor
     233           1 :         CFSFILLGAS() : AK(0.0), BK(0.0), CK(0.0), ACP(0.0), BCP(0.0), CCP(0.0), AVISC(0.0), BVISC(0.0), CVISC(0.0), MHAT(0.0)
     234             :         {
     235           1 :         }
     236             :     };
     237             : 
     238          41 :     struct CFSGAP
     239             :     {
     240             :         // Members
     241             :         std::string Name; // Gap layer name
     242             :         int GTYPE;        // gap type (gtyXXX above)
     243             :         Real64 TAS;       // actual surface-surface gap thickness, mm (always > 0)
     244             :         //   VB: minimum tip-surface distance (slats normal to CFS plane)
     245             :         Real64 TAS_EFF; // effective gap thickness, mm (always > 0)
     246             :         //   if either adjacent layer is VB adjusted
     247             :         //   slat angle and convective behavior
     248             :         //   else = TAS
     249             :         CFSFILLGAS FG; // fill gas properties (see above)
     250             :         Real64 RHOGAS; // fill gas density (kg/m3)
     251             : 
     252             :         // Default Constructor
     253           1 :         CFSGAP() : GTYPE(0), TAS(0.0), TAS_EFF(0.0), RHOGAS(0.0)
     254             :         {
     255           1 :         }
     256             :     };
     257             : 
     258           7 :     struct CFSTY
     259             :     {
     260             :         // Members
     261             :         std::string Name;         // ID (Fenestration Name)
     262             :         int NL;                   // number of layers
     263             :         Array1D<CFSLAYER> L;      // layer array, L(1) is outside layer
     264             :         Array1D<CFSGAP> G;        // gap array, G(1) is outside-most, betw L(1) and L(2)
     265             :         bool ISControlled;        // CFS is not controlled, or has no controlled VB layer
     266             :         int VBLayerPtr;           // Venetian blind layer pointer
     267             :         int WEQLSolverErrorIndex; // recurring error index
     268             : 
     269             :         // Default Constructor
     270           1 :         CFSTY() : NL(0), L(CFSMAXNL), G(CFSMAXNL - 1), ISControlled(false), VBLayerPtr(0), WEQLSolverErrorIndex(0)
     271             :         {
     272           1 :         }
     273             :     };
     274             : 
     275             : } // namespace DataWindowEquivalentLayer
     276             : 
     277        1542 : struct WindowEquivLayerData : BaseGlobalStruct
     278             : {
     279             : 
     280             :     // Defined CFSLayers and CFSs
     281             :     int TotWinEquivLayerConstructs = 0; // Number of constructions with Window equivalent Layer
     282             : 
     283             :     DataWindowEquivalentLayer::CFSSWP
     284             :         SWP_ROOMBLK; // Solar reflectance, BEAM-BEAM, front | Solar reflectance, BEAM-BEAM, back | Solar transmittance, BEAM-BEAM, front | Solar
     285             :     // transmittance, BEAM-BEAM, back | Solar reflectance, BEAM-DIFFUSE, front | Solar reflectance, BEAM-DIFFUSE, back | Solar
     286             :     // transmittance, BEAM-DIFFUSE, front | Solar transmittance, BEAM-DIFFUSE, back | Solar reflectance, DIFFUSE-DIFFUSE, front |
     287             :     // Solar reflectance, DIFFUSE-DIFFUSE, back | Solar transmittance, DIFFUSE-DIFFUSE
     288             :     Array1D<DataWindowEquivalentLayer::CFSLAYER> CFSLayers;
     289             :     Array1D<DataWindowEquivalentLayer::CFSTY> CFS;
     290             :     Array1D<DataWindowEquivalentLayer::CFSGAP> CFSGaps;
     291             : 
     292           0 :     void clear_state() override
     293             :     {
     294           0 :         this->TotWinEquivLayerConstructs = 0;
     295           0 :         this->SWP_ROOMBLK = {};
     296           0 :         this->CFSLayers.clear();
     297           0 :         this->CFS.clear();
     298           0 :         this->CFSGaps.clear();
     299           0 :     }
     300             : };
     301             : 
     302             : } // namespace EnergyPlus
     303             : 
     304             : #endif

Generated by: LCOV version 1.13