LCOV - code coverage report
Current view: top level - EnergyPlus - Material.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 77.4 % 133 103
Test Date: 2025-05-22 16:09:37 Functions: 70.6 % 51 36

            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 Material_hh_INCLUDED
      49              : #define Material_hh_INCLUDED
      50              : 
      51              : // EnergyPlus Headers
      52              : #include <EnergyPlus/Data/BaseData.hh>
      53              : #include <EnergyPlus/DataWindowEquivalentLayer.hh>
      54              : #include <EnergyPlus/EnergyPlus.hh>
      55              : #include <EnergyPlus/General.hh>
      56              : #include <EnergyPlus/ScheduleManager.hh>
      57              : #include <EnergyPlus/TARCOGGassesParams.hh>
      58              : #include <EnergyPlus/TARCOGParams.hh>
      59              : #include <EnergyPlus/WindowModel.hh>
      60              : 
      61              : namespace EnergyPlus {
      62              : 
      63              : // Forward declarations
      64              : namespace Curve {
      65              :     struct Curve;
      66              : }
      67              : 
      68              : namespace Material {
      69              : 
      70              :     // Parameters to indicate material group type for use with the Material
      71              :     // derived type (see below):
      72              : 
      73              :     // Don't change these numbers because they are printed out by number in SQLite (shouldn't print out internal enums by number)
      74              :     enum class Group
      75              :     {
      76              :         Invalid = -1,
      77              :         Regular,
      78              :         AirGap,
      79              :         Shade,
      80              :         Glass,
      81              :         Gas,
      82              :         Blind,
      83              :         GasMixture,
      84              :         Screen,
      85              :         EcoRoof,
      86              :         IRTransparent,
      87              :         GlassSimple,
      88              :         ComplexShade,
      89              :         ComplexWindowGap,
      90              :         GlassEQL,
      91              :         ShadeEQL,
      92              :         DrapeEQL,
      93              :         BlindEQL,
      94              :         ScreenEQL,
      95              :         WindowGapEQL,
      96              :         GlassTCParent,
      97              :         Num
      98              :     };
      99              : 
     100              :     enum class GasType
     101              :     {
     102              :         Invalid = -1,
     103              :         Custom,
     104              :         Air,
     105              :         Argon,
     106              :         Krypton,
     107              :         Xenon,
     108              :         Num
     109              :     };
     110              : 
     111              :     enum class GapVentType
     112              :     {
     113              :         Invalid = -1,
     114              :         Sealed,
     115              :         VentedIndoor,
     116              :         VentedOutdoor,
     117              :         Num
     118              :     };
     119              : 
     120              :     constexpr std::array<std::string_view, (int)GapVentType::Num> gapVentTypeNamesUC = {"SEALED", "VENTEDINDOOR", "VENTEDOUTDOOR"};
     121              : 
     122              :     extern const std::array<std::string_view, (int)GasType::Num> gasTypeNames;
     123              :     extern const std::array<std::string_view, (int)GapVentType::Num> gapVentTypeNames;
     124              : 
     125              :     enum class SlatAngleType
     126              :     {
     127              :         Invalid = -1,
     128              :         FixedSlatAngle,
     129              :         MaximizeSolar,
     130              :         BlockBeamSolar,
     131              :         Num
     132              :     };
     133              : 
     134              :     constexpr std::array<std::string_view, (int)SlatAngleType::Num> slatAngleTypeNamesUC = {"FIXEDSLATANGLE", "MAXIMIZESOLAR", "BLOCKBEAMSOLAR"};
     135              : 
     136              :     // Parameter for window screens beam reflectance accounting
     137              :     enum class ScreenBeamReflectanceModel
     138              :     {
     139              :         Invalid = -1,
     140              :         DoNotModel,
     141              :         DirectBeam,
     142              :         Diffuse,
     143              :         Num
     144              :     };
     145              : 
     146              :     constexpr std::array<std::string_view, (int)ScreenBeamReflectanceModel::Num> screenBeamReflectanceModelNamesUC = {
     147              :         "DONOTMODEL", "MODELASDIRECTBEAM", "MODELASDIFFUSE"};
     148              : 
     149              :     enum class VariableAbsCtrlSignal
     150              :     {
     151              :         Invalid = -1,
     152              :         SurfaceTemperature,
     153              :         SurfaceReceivedSolarRadiation,
     154              :         SpaceHeatingCoolingMode,
     155              :         Scheduled,
     156              :         Num
     157              :     };
     158              : 
     159              :     constexpr std::array<std::string_view, (int)VariableAbsCtrlSignal::Num> variableAbsCtrlSignalNamesUC = {
     160              :         "SURFACETEMPERATURE", "SURFACERECEIVEDSOLARRADIATION", "SPACEHEATINGCOOLINGMODE", "SCHEDULED"};
     161              : 
     162              :     // Parameters to indicate surface roughness for use with the Material
     163              :     // derived type:
     164              :     enum class SurfaceRoughness
     165              :     {
     166              :         Invalid = -1,
     167              :         VeryRough,
     168              :         Rough,
     169              :         MediumRough,
     170              :         MediumSmooth,
     171              :         Smooth,
     172              :         VerySmooth,
     173              :         Num
     174              :     };
     175              : 
     176              :     constexpr std::array<std::string_view, (int)SurfaceRoughness::Num> surfaceRoughnessNamesUC{
     177              :         "VERYROUGH", "ROUGH", "MEDIUMROUGH", "MEDIUMSMOOTH", "SMOOTH", "VERYSMOOTH"};
     178              : 
     179              :     extern const std::array<std::string_view, (int)SurfaceRoughness::Num> surfaceRoughnessNames;
     180              : 
     181              :     // Class Hierarchy
     182              :     //
     183              :     // MaterialBase: Material, Material:AirGap, Material:NoMass, Material:InfraredTransparent
     184              :     //    |
     185              :     //    | MaterialGasMix: WindowMaterial:Gas, WindowMaterial:GasMixture
     186              :     //    |    | MaterialComplexGap: WindowMaterial:Gap (includes WindowGap:DeflectionState and WindowGap:SupportPillar)
     187              :     //    |
     188              :     //    | MaterialFen: abstract
     189              :     //    |    | MaterialGlass: WindowMaterial:Glazing, WindowMaterial:Glazing:RefractionExtinctionMethod
     190              :     //    |    |    | MaterialGlassEQL: WindowMaterial:Glazing:EquivalentLayer
     191              :     //    |    |    | MaterialGlassTCParent: WindowMaterial:GlazingGroup:Thermochromic
     192              :     //    |    |
     193              :     //    |    | MaterialShadingDevice: abstract
     194              :     //    |    |    | MaterialShade: WindowMaterial:Shade
     195              :     //    |    |    | MaterialBlind: WindowMaterial:Blind
     196              :     //    |    |    | MaterialScreen: WindowMaterial:Screen
     197              :     //    |    |    | MaterialComplexShade: WindowMaterial:ComplexShade
     198              :     //    |    |    |    | MaterialShadeEQL: WindowMaterial:Shade:EquivalentLayer
     199              :     //    |    |    |    | MaterialBlindEQL: WindowMaterial:Blind:EquivalentLayer
     200              :     //    |    |    |    | MaterialDrapeEQL: WindowMaterial:Drape:EquivalentLayer
     201              :     //    |    |    |    | MaterialScreenEQL: WindowMaterial:Screen:EquivalentLayer
     202              :     //    |
     203              :     //    | MaterialEcoRoof: Material:RoofVegeration
     204              :     //    |
     205              :     //    | MaterialEMPD: holder of EMPD MaterialProperties.
     206              :     //    |
     207              :     //    | MaterialHAMT: holder of HAMT MaterialProperties.
     208              :     //    |
     209              :     //    | MaterialPhaseChange: holder of PhaseChange MaterialProperties.
     210              : 
     211              :     // This class is used for Material:AirGap, Material,
     212              :     // Material:NoMass, and Material:InfraredTransparent.  It is also
     213              :     // the base class for all other materials.  Material:AirGap,
     214              :     // Material:NoMass, and Material:IRT could be a much smaller
     215              :     // parent class of this, but Material:Regular is by far the most
     216              :     // common material so it makes sense to have it as the base class
     217              :     // to avoid an excess of dynamic casting.
     218              :     struct MaterialBase
     219              :     {
     220              :         // Members
     221              :         std::string Name = "";        // Name of material layer
     222              :         int Num = 0;                  // Index in material array, comes in handy sometimes
     223              :         Group group = Group::Invalid; // Material group type (see Material Parameters above.  Currently
     224              : 
     225              :         bool isUsed = false;
     226              : 
     227              :         // active: RegularMaterial, Shade, Air, WindowGlass,
     228              :         // WindowGas, WindowBlind, WindowGasMixture, Screen, EcoRoof,
     229              :         // IRTMaterial, WindowSimpleGlazing, ComplexWindowShade, ComplexWindowGap)
     230              :         SurfaceRoughness Roughness = SurfaceRoughness::Invalid; // Surface roughness index (See Surface Roughness parameters
     231              :         // above.  Current: VerySmooth, Smooth, MediumSmooth,
     232              :         // MediumRough, Rough, VeryRough)
     233              :         // Thermo-physical material properties
     234              :         Real64 Conductivity = 0.0; // Thermal conductivity of layer (W/m2K)
     235              :         Real64 Density = 0.0;      // Layer density (kg/m3)
     236              :         Real64 Resistance = 0.0;   // Layer thermal resistance (alternative to Density,
     237              :         // Conductivity, Thickness, and Specific Heat; K/W)
     238              :         bool ROnly = false; // Material defined with "R" only
     239              :         Real64 NominalR = 0.0;
     240              :         Real64 SpecHeat = 0.0;  // Layer specific heat (J/kgK)
     241              :         Real64 Thickness = 0.0; // Layer thickness (m)
     242              : 
     243              :         Real64 AbsorpThermal = 0.0;      // Layer thermal absorptance
     244              :         Real64 AbsorpThermalInput = 0.0; // Layer thermal absorptance input by user
     245              :         Real64 AbsorpThermalBack = 0.0;  // Infrared radiation back absorption
     246              :         Real64 AbsorpThermalFront = 0.0; // Infrared radiation front absorption
     247              : 
     248              :         Real64 AbsorpSolar = 0.0;      // Layer solar absorptance
     249              :         Real64 AbsorpSolarInput = 0.0; // Layer solar absorptance input by user
     250              : 
     251              :         Real64 AbsorpVisible = 0.0;      // Layer Visible Absorptance
     252              :         Real64 AbsorpVisibleInput = 0.0; // Layer Visible Absorptance input by user
     253              : 
     254              :         // Radiation parameters // Are these for windows or for opaque materials also?
     255              :         bool AbsorpSolarEMSOverrideOn = false;   // if true, then EMS calling to override value for solar absorptance
     256              :         Real64 AbsorpSolarEMSOverride = false;   // value to use when EMS calling to override value for solar absorptance
     257              :         bool AbsorpThermalEMSOverrideOn = false; // if true, then EMS calling to override value for thermal absorptance
     258              :         Real64 AbsorpThermalEMSOverride = 0.0;   // value to use when EMS calling to override value for thermal absorptance
     259              :         bool AbsorpVisibleEMSOverrideOn = false; // if true, then EMS calling to override value for visible absorptance
     260              :         Real64 AbsorpVisibleEMSOverride = 0.0;   // value to use when EMS calling to override value for visible absorptance
     261              : 
     262              :         // dynamic thermal and solar absorptance coating parameters
     263              :         VariableAbsCtrlSignal absorpVarCtrlSignal = VariableAbsCtrlSignal::Invalid;
     264              :         Sched::Schedule *absorpThermalVarSched = nullptr;
     265              :         Curve::Curve *absorpThermalVarCurve = nullptr;
     266              :         Sched::Schedule *absorpSolarVarSched = nullptr;
     267              :         Curve::Curve *absorpSolarVarCurve = nullptr;
     268              : 
     269              :         bool hasEMPD = false;
     270              :         bool hasHAMT = false;
     271              :         bool hasPCM = false;
     272              : 
     273              :         // Moved these into the base class for SQLite purposes
     274              :         Real64 Porosity = 0.0; // Layer porosity
     275              :         // Real64 IsoMoistCap = 0.0;   // Isothermal moisture capacity on water vapor density (m3/kg)
     276              :         // Real64 ThermGradCoef = 0.0; // Thermal-gradient coefficient for moisture capacity based on the water vapor density (kg/kgK)
     277              :         Real64 VaporDiffus = 0.0; // Layer vapor diffusivity
     278              : 
     279              :         bool WarnedForHighDiffusivity = false; // used to limit error messaging to just the first instance
     280              : 
     281         1353 :         MaterialBase()
     282         2706 :         {
     283         1353 :             group = Group::AirGap;
     284         1353 :         }
     285         2291 :         virtual ~MaterialBase() = default;
     286              :     };
     287              : 
     288              :     struct MaterialFen : public MaterialBase
     289              :     {
     290              :         // Are these just for windows?
     291              :         Real64 Trans = 0.0;        // Transmittance of layer (glass, shade)
     292              :         Real64 TransVis = 0.0;     // Visible transmittance (at normal incidence)
     293              :         Real64 TransThermal = 0.0; // Infrared radiation transmittance
     294              : 
     295              :         Real64 ReflectSolBeamBack = 0.0;  // Solar back reflectance (beam to everything)
     296              :         Real64 ReflectSolBeamFront = 0.0; // Solar front reflectance (beam to everything)
     297              : 
     298          180 :         MaterialFen() : MaterialBase()
     299              :         {
     300          180 :             group = Group::Invalid;
     301          180 :         }
     302          179 :         ~MaterialFen() = default;
     303              :         virtual bool can_instantiate() = 0;
     304              :     };
     305              : 
     306              :     // Abstract parent class for all WindowMaterial:X shading device materials (including Equivalent Layer).
     307              :     struct MaterialShadingDevice : public MaterialFen
     308              :     {
     309              :         // Some characteristics for blind thermal calculation
     310              :         Real64 toGlassDist = 0.0;    // Distance between window shade and adjacent glass (m)
     311              :         Real64 topOpeningMult = 0.0; // Area of air-flow opening at top of blind, expressed as a fraction
     312              :         //  of the blind-to-glass opening area at the top of the blind
     313              :         Real64 bottomOpeningMult = 0.0; // Area of air-flow opening at bottom of blind, expressed as a fraction
     314              :         //  of the blind-to-glass opening area at the bottom of the blind
     315              :         Real64 leftOpeningMult = 0.0; // Area of air-flow opening at left side of blind, expressed as a fraction
     316              :         //  of the blind-to-glass opening area at the left side of the blind
     317              :         Real64 rightOpeningMult = 0.0; // Area of air-flow opening at right side of blind, expressed as a fraction
     318              :         //  of the blind-to-glass opening area at the right side of the blind
     319              :         // Calculated blind properties
     320              : 
     321              :         Real64 airFlowPermeability = 0.0; // The effective area of openings in the shade itself, expressed as a
     322              :         //  fraction of the shade area
     323           22 :         MaterialShadingDevice() : MaterialFen()
     324              :         {
     325           22 :             group = Group::Invalid;
     326           22 :         }
     327           22 :         ~MaterialShadingDevice() = default;
     328              :         virtual bool can_instantiate() = 0; // Prevents this class from being instantiated
     329              :     };
     330              : 
     331              :     // Class for WindowMaterial:Shade
     332              :     struct MaterialShade : public MaterialShadingDevice
     333              :     {
     334              :         Real64 ReflectShade = 0.0;    // Shade or screen reflectance (interior shade only)
     335              :         Real64 ReflectShadeVis = 0.0; // Shade reflectance for visible radiation
     336              : 
     337            8 :         MaterialShade() : MaterialShadingDevice()
     338              :         {
     339            8 :             group = Group::Shade;
     340            8 :         }
     341           16 :         ~MaterialShade() = default;
     342            0 :         bool can_instantiate() override
     343              :         {
     344            0 :             return true;
     345              :         } // Allows this class to be instantiated
     346              :     };
     347              : 
     348              :     // This may seem like an overly complicated way to handle a set of
     349              :     // multi-dimensional variables, but I think that it is actually
     350              :     // cleaner than either a multi-dimensional array (and certaily
     351              :     // faster) and also better than just a long list of variables.
     352              : 
     353              :     // Blind-properties essentially have four dimensions: property
     354              :     // type (transmittance, reflectance, absorptance), beam or
     355              :     // diffuse, front or back, solar or visible (maybe solar or
     356              :     // visible or thermal/IR).  Rather than coming up with and
     357              :     // enforcing a consistent namming scheme for these variables,
     358              :     // arranging them into nested structres keeps the ordering (as
     359              :     // well as the naming) of the dimensions consistent, and also
     360              :     // inserts periods between the dimensions to help with
     361              :     // readability.  In this case, I chose the struct nesting to be
     362              :     // SolVis.Front.Back.BmDf.Prop.  So variables are always going to
     363              :     // be called Sol.Front.Df.Abs and Vis.Back.Df.Ref.
     364              : 
     365              :     // For the record, accessing variables in nested structs is as
     366              :     // fast as accessing plain scalar variables.  The reason is that
     367              :     // the compiler knows the position of every variable at every
     368              :     // level of a nested struct at compile time and can load it with a
     369              :     // single offset like it loads every other variable in an object.
     370              :     // This is another downside of references in C++.  Accessing
     371              :     // variables in structures (even nested structures) is fast.
     372              :     // Acessing variables through pointer indirection is slow.
     373              :     // W->X->Y->Z is slower than W.X.Y.Z.  References are pointers,
     374              :     // but they use the . notation rather than -> for accessing
     375              :     // fields.  So if W.X.Y.Z is implemented using nested structures
     376              :     // then it is fast, but if it is implemented using references to
     377              :     // structures then it is slow.  But without context there is no
     378              :     // way to tell which is which.
     379              : 
     380              :     struct BlindBmTAR
     381              :     {
     382              :         Real64 BmTra = 0.0; // Beam-beam transmittance
     383              :         Real64 DfTra = 0.0; // Beam-diff transmittance
     384              :         Real64 BmRef = 0.0; // Beam-beam reflectance
     385              :         Real64 DfRef = 0.0; // Beam-diff reflectance
     386              :         Real64 Abs = 0.0;   // Absorptance
     387              : 
     388         1520 :         void interpSlatAng(BlindBmTAR const &t1, BlindBmTAR const &t2, Real64 interpFac)
     389              :         {
     390         1520 :             BmTra = Interp(t1.BmTra, t2.BmTra, interpFac);
     391         1520 :             DfTra = Interp(t1.DfTra, t2.DfTra, interpFac);
     392         1520 :             BmRef = Interp(t1.BmRef, t2.BmRef, interpFac);
     393         1520 :             DfRef = Interp(t1.DfRef, t2.DfRef, interpFac);
     394         1520 :             Abs = Interp(t1.Abs, t2.Abs, interpFac);
     395         1520 :         }
     396              :     };
     397              : 
     398              :     struct BlindDfTAR
     399              :     {
     400              :         Real64 Tra = 0.0;
     401              :         Real64 Abs = 0.0;
     402              :         Real64 Ref = 0.0;
     403              : 
     404              :         void interpSlatAng(BlindDfTAR const &t1, BlindDfTAR const &t2, Real64 interpFac)
     405              :         {
     406              :             Tra = Interp(t1.Tra, t2.Tra, interpFac);
     407              :             Ref = Interp(t1.Ref, t2.Ref, interpFac);
     408              :             Abs = Interp(t1.Abs, t2.Abs, interpFac);
     409              :         }
     410              :     };
     411              : 
     412              :     struct BlindDfTARGS
     413              :     {
     414              :         Real64 Tra = 0.0;
     415              :         Real64 TraGnd = 0.0;
     416              :         Real64 TraSky = 0.0;
     417              :         Real64 Ref = 0.0;
     418              :         Real64 RefGnd = 0.0;
     419              :         Real64 RefSky = 0.0;
     420              :         Real64 Abs = 0.0;
     421              :         Real64 AbsGnd = 0.0;
     422              :         Real64 AbsSky = 0.0;
     423              : 
     424           40 :         void interpSlatAng(BlindDfTARGS const &t1, BlindDfTARGS const &t2, Real64 interpFac)
     425              :         {
     426           40 :             Tra = Interp(t1.Tra, t2.Tra, interpFac);
     427           40 :             TraGnd = Interp(t1.TraGnd, t2.TraGnd, interpFac);
     428           40 :             TraSky = Interp(t1.TraSky, t2.TraSky, interpFac);
     429           40 :             Ref = Interp(t1.Ref, t2.Ref, interpFac);
     430           40 :             RefGnd = Interp(t1.RefGnd, t2.RefGnd, interpFac);
     431           40 :             RefSky = Interp(t1.RefSky, t2.RefSky, interpFac);
     432           40 :             Abs = Interp(t1.Abs, t2.Abs, interpFac);
     433           40 :             AbsGnd = Interp(t1.AbsGnd, t2.AbsGnd, interpFac);
     434           40 :             AbsSky = Interp(t1.AbsSky, t2.AbsSky, interpFac);
     435           40 :         }
     436              :     };
     437              : 
     438              :     template <int ProfAngs> struct BlindBmDf
     439              :     {
     440              :         std::array<BlindBmTAR, ProfAngs> Bm;
     441              :         BlindDfTARGS Df;
     442              : 
     443           40 :         void interpSlatAng(BlindBmDf const &t1, BlindBmDf const &t2, Real64 interpFac)
     444              :         {
     445         1560 :             for (int i = 0; i < ProfAngs; ++i)
     446         1520 :                 Bm[i].interpSlatAng(t1.Bm[i], t2.Bm[i], interpFac);
     447           40 :             Df.interpSlatAng(t1.Df, t2.Df, interpFac);
     448           40 :         }
     449              :     };
     450              : 
     451              :     template <int ProfAngs> struct BlindFtBk
     452              :     {
     453              :         BlindBmDf<ProfAngs> Ft;
     454              :         BlindBmDf<ProfAngs> Bk;
     455              : 
     456           20 :         void interpSlatAng(BlindFtBk const &t1, BlindFtBk const &t2, Real64 interpFac)
     457              :         {
     458           20 :             Ft.interpSlatAng(t1.Ft, t2.Ft, interpFac);
     459           20 :             Bk.interpSlatAng(t1.Bk, t2.Bk, interpFac);
     460           20 :         }
     461              :     };
     462              : 
     463              :     struct BlindTraEmi
     464              :     {
     465              :         Real64 Tra = 0.0;
     466              :         Real64 Emi = 0.0;
     467              : 
     468           20 :         void interpSlatAng(BlindTraEmi const &t1, BlindTraEmi const &t2, Real64 interpFac)
     469              :         {
     470           20 :             Tra = Interp(t1.Tra, t2.Tra, interpFac);
     471           20 :             Emi = Interp(t1.Emi, t2.Emi, interpFac);
     472           20 :         }
     473              :     };
     474              : 
     475              :     struct BlindFtBkIR
     476              :     {
     477              :         BlindTraEmi Ft;
     478              :         BlindTraEmi Bk;
     479              : 
     480           10 :         void interpSlatAng(BlindFtBkIR const &t1, BlindFtBkIR const &t2, Real64 interpFac)
     481              :         {
     482           10 :             Ft.interpSlatAng(t1.Ft, t2.Ft, interpFac);
     483           10 :             Bk.interpSlatAng(t1.Bk, t2.Bk, interpFac);
     484           10 :         }
     485              :     };
     486              : 
     487              :     template <int ProfAngs> struct BlindTraAbsRef
     488              :     {
     489              :         BlindFtBk<ProfAngs> Sol;
     490              :         BlindFtBk<ProfAngs> Vis;
     491              :         BlindFtBkIR IR;
     492              : 
     493           10 :         void interpSlatAng(BlindTraAbsRef const &t1, BlindTraAbsRef const &t2, Real64 interpFac)
     494              :         {
     495           10 :             Sol.interpSlatAng(t1.Sol, t2.Sol, interpFac);
     496           10 :             Vis.interpSlatAng(t1.Vis, t2.Vis, interpFac);
     497           10 :             IR.interpSlatAng(t1.IR, t2.IR, interpFac);
     498           10 :         }
     499              :     };
     500              : 
     501              :     // Blind
     502              :     constexpr int MaxSlatAngs = 181;
     503              :     constexpr int MaxProfAngs = 37;
     504              : 
     505              :     constexpr Real64 dProfAng = Constant::Pi / (MaxProfAngs - 1);
     506              :     constexpr Real64 dSlatAng = Constant::Pi / (MaxSlatAngs - 1);
     507              : 
     508              :     // WindowMaterial:Blind class
     509              :     struct MaterialBlind : public MaterialShadingDevice
     510              :     {
     511              :         // Input properties
     512              :         DataWindowEquivalentLayer::Orientation SlatOrientation = DataWindowEquivalentLayer::Orientation::Invalid; // HORIZONTAL or VERTICAL
     513              :         DataWindowEquivalentLayer::AngleType SlatAngleType = DataWindowEquivalentLayer::AngleType::Fixed;         // FIXED or VARIABLE
     514              :         Real64 SlatWidth = 0.0;                                                                                   // Slat width (m)
     515              :         Real64 SlatSeparation = 0.0;                                                                              // Slat separation (m)
     516              :         Real64 SlatThickness = 0.0;                                                                               // Slat thickness (m)
     517              :         Real64 SlatCrown = 0.0;        // the height of the slate (length from the chord to the curve)
     518              :         Real64 SlatAngle = 0.0;        // Slat angle (deg)
     519              :         Real64 MinSlatAngle = 0.0;     // Minimum slat angle for variable-angle slats (deg) (user input)
     520              :         Real64 MaxSlatAngle = 0.0;     // Maximum slat angle for variable-angle slats (deg) (user input)
     521              :         Real64 SlatConductivity = 0.0; // Slat conductivity (W/m-K)
     522              : 
     523              :         BlindTraAbsRef<1> slatTAR; // Beam properties for slats are not profile-angle dependent
     524              : 
     525              :         // Beam properties for blinds are profile angle dependent, so template must be instantiated with MaxProfAngs+1
     526              :         std::array<BlindTraAbsRef<MaxProfAngs + 1>, MaxSlatAngs> TARs;
     527              : 
     528              :         // Default Constructor
     529            6 :         MaterialBlind() : MaterialShadingDevice()
     530              :         {
     531            6 :             group = Group::Blind;
     532            6 :         }
     533           12 :         ~MaterialBlind() = default;
     534            0 :         bool can_instantiate()
     535              :         {
     536            0 :             return true;
     537              :         } // This function allows this class to be instantiated
     538              : 
     539              :         Real64 BeamBeamTrans(Real64 profAng, Real64 slatAng) const;
     540              :     };
     541              : 
     542              :     // WindowMaterial:ComplexShade class
     543              :     struct MaterialComplexShade : public MaterialShadingDevice
     544              :     {
     545              :         // Layer type (OtherShadingType, Venetian, Woven, Perforated)
     546              :         TARCOGParams::TARCOGLayerType LayerType = TARCOGParams::TARCOGLayerType::Invalid;
     547              :         Real64 FrontEmissivity = 0.0;  // Emissivity of front surface
     548              :         Real64 BackEmissivity = 0.0;   // Emissivity of back surface
     549              :         Real64 SlatWidth = 0.0;        // Slat width (m)
     550              :         Real64 SlatSpacing = 0.0;      // Slat spacing (m)
     551              :         Real64 SlatThickness = 0.0;    // Slat thickness (m)
     552              :         Real64 SlatAngle = 0.0;        // Slat angle (deg)
     553              :         Real64 SlatConductivity = 0.0; // Slat conductivity (W/m2K)
     554              :         Real64 SlatCurve = 0.0;        // Curvature radius of slat (if =0 then flat) (m)
     555              : 
     556              :         Real64 frontOpeningMult = 0.0;
     557              : 
     558            3 :         MaterialComplexShade() : MaterialShadingDevice()
     559              :         {
     560            3 :             group = Group::ComplexShade;
     561            3 :         }
     562            6 :         ~MaterialComplexShade() = default;
     563            0 :         bool can_instantiate()
     564              :         {
     565            0 :             return true;
     566              :         } // This function allows this class to be instantiated
     567              :     };
     568              : 
     569              :     int constexpr maxMixGases = 5;
     570              : 
     571              :     struct GasCoeffs
     572              :     {
     573              :         Real64 c0 = 0.0;
     574              :         Real64 c1 = 0.0;
     575              :         Real64 c2 = 0.0;
     576              :     };
     577              : 
     578              :     struct Gas
     579              :     {
     580              :         GasType type = GasType::Custom;
     581              :         GasCoeffs con = GasCoeffs();
     582              :         GasCoeffs vis = GasCoeffs();
     583              :         GasCoeffs cp = GasCoeffs();
     584              :         Real64 wght = 0.0;
     585              :         Real64 specHeatRatio = 0.0;
     586              :     };
     587              : 
     588              :     extern const std::array<Gas, 10> gases;
     589              : 
     590              :     // Class for WindowMaterial:Gas and WindowMaterial:GasMixture.  Parent class for Material:ComplexWindowGap
     591              :     struct MaterialGasMix : public MaterialBase
     592              :     {
     593              :         //  up to 5 gases in a mixture [Window gas only].  It is defined as parameter (GasCoefs)
     594              :         int numGases = 0; // Number of gases in a window gas mixture
     595              : 
     596              :         std::array<Real64, maxMixGases> gasFracts = {0.0};
     597              :         std::array<Gas, maxMixGases> gases = {Gas()};
     598              : 
     599              :         GapVentType gapVentType = GapVentType::Sealed; // Gap Ven type for equivalent Layer window model
     600              : 
     601           55 :         MaterialGasMix() : MaterialBase()
     602              :         {
     603           55 :             group = Group::Gas;
     604           55 :         }
     605          109 :         ~MaterialGasMix() = default;
     606              :     };
     607              : 
     608              :     // Class for Material:ComplexWindowGap
     609              :     struct MaterialComplexWindowGap : public MaterialGasMix
     610              :     {
     611              :         Real64 Pressure = 0.0;
     612              :         Real64 pillarSpacing = 0.0; // Spacing between centers of support pillars (m)
     613              :         Real64 pillarRadius = 0.0;  // Support pillar radius (m)
     614              :         Real64 deflectedThickness = 0.0;
     615              : 
     616            1 :         MaterialComplexWindowGap() : MaterialGasMix()
     617              :         {
     618            1 :             group = Group::ComplexWindowGap;
     619            1 :         }
     620            2 :         ~MaterialComplexWindowGap() = default;
     621              :     };
     622              : 
     623              :     struct ScreenBmTraAbsRef
     624              :     {
     625              :         struct
     626              :         {
     627              :             Real64 Tra = 0.0;
     628              :         } Bm;
     629              :         struct
     630              :         {
     631              :             Real64 Tra = 0.0;
     632              :         } Df;
     633              :         Real64 Abs = 0.0;
     634              :         Real64 Ref = 0.0;
     635              :     };
     636              : 
     637              :     struct ScreenBmTAR
     638              :     {
     639              :         struct
     640              :         {
     641              :             ScreenBmTraAbsRef Ft, Bk;
     642              :         } Sol;
     643              :         struct
     644              :         {
     645              :             ScreenBmTraAbsRef Ft, Bk;
     646              :         } Vis;
     647              :     };
     648              : 
     649              :     // Screen Beam Transmittance, Absorptance, Reflectance (TAR) properties
     650              :     struct ScreenBmTransAbsRef
     651              :     {
     652              :         Real64 BmTrans = 0.0; // Beam solar transmittance (dependent on sun angle)
     653              :         // (this value can include scattering if the user so chooses)
     654              :         Real64 BmTransBack = 0.0; // Beam solar transmittance (dependent on sun angle) from back side of screen
     655              :         Real64 BmTransVis = 0.0;  // Visible solar transmittance (dependent on sun angle)
     656              :         // (this value can include visible scattering if the user so chooses)
     657              :         Real64 DfTrans = 0.0;     // Beam solar transmitted as diffuse radiation (dependent on sun angle)
     658              :         Real64 DfTransBack = 0.0; // Beam solar transmitted as diffuse radiation (dependent on sun angle) from back side
     659              :         Real64 DfTransVis = 0.0;  // Visible solar transmitted as diffuse radiation (dependent on sun angle)
     660              : 
     661              :         // The following reflectance properties are dependent on sun angle:
     662              :         Real64 RefSolFront = 0.0; // Beam solar reflected as diffuse radiation when sun is in front of screen
     663              :         Real64 RefVisFront = 0.0; // Visible solar reflected as diffuse radiation when sun is in front of screen
     664              :         Real64 RefSolBack = 0.0;  // Beam solar reflected as diffuse radiation when sun is in back of screen
     665              :         Real64 RefVisBack = 0.0;  // Visible solar reflected as diffuse radiation when sun is in back of screen
     666              :         Real64 AbsSolFront = 0.0; // Front surface solar beam absorptance
     667              :         Real64 AbsSolBack = 0.0;  // Back surface solar beam absorptance
     668              :     };
     669              : 
     670              : #define PRECALC_INTERP_SCREEN
     671              : 
     672              :     constexpr int minDegResolution = 5;
     673              : 
     674              :     constexpr int maxIPhi = (Constant::Pi * Constant::RadToDeg / minDegResolution) + 1;
     675              :     constexpr int maxITheta = (Constant::Pi * Constant::RadToDeg / minDegResolution) + 1;
     676              : 
     677              :     // Class for Material:Screen
     678              :     struct MaterialScreen : public MaterialShadingDevice
     679              :     {
     680              :         Real64 diameterToSpacingRatio = 0.0; // ratio of screen material diameter to screen material spacing
     681              : 
     682              :         ScreenBeamReflectanceModel bmRefModel = ScreenBeamReflectanceModel::Invalid; // user specified method of accounting for scattered solar beam
     683              : 
     684              :         Real64 DfTrans = 0.0;    // Back surface diffuse solar transmitted
     685              :         Real64 DfTransVis = 0.0; // Back surface diffuse visible solar transmitted
     686              :         Real64 DfRef = 0.0;      // Back reflection of solar diffuse radiation
     687              :         Real64 DfRefVis = 0.0;   // Back reflection of visible diffuse radiation
     688              :         Real64 DfAbs = 0.0;      // Absorption of diffuse radiation
     689              : 
     690              :         Real64 ShadeRef = 0.0;       // Screen assembly solar reflectance (user input adjusted for holes in screen)
     691              :         Real64 ShadeRefVis = 0.0;    // Screen assembly visible reflectance (user input adjusted for holes in screen)
     692              :         Real64 CylinderRef = 0.0;    // Screen material solar reflectance (user input, does not account for holes in screen)
     693              :         Real64 CylinderRefVis = 0.0; // Screen material visible reflectance (user input, does not account for holes in screen)
     694              : 
     695              :         int mapDegResolution = 0;                                      // Resolution of azimuth and altitude angles to print in transmittance map
     696              :         Real64 dPhi = (Real64)minDegResolution * Constant::DegToRad;   // phi increments (rad)
     697              :         Real64 dTheta = (Real64)minDegResolution * Constant::DegToRad; // theta increments (rad)
     698              : 
     699              :         std::array<std::array<ScreenBmTransAbsRef, maxITheta>, maxIPhi> btars;
     700              : 
     701            0 :         MaterialScreen() : MaterialShadingDevice()
     702              :         {
     703            0 :             group = Group::Screen;
     704            0 :         }
     705            0 :         ~MaterialScreen() = default;
     706            0 :         bool can_instantiate() override
     707              :         {
     708            0 :             return true;
     709              :         } // Allows this class to be instantiated
     710              :     };
     711              : 
     712              :     // Class for Material:Shade:EquivalentLayer and parent class for
     713              :     // Material:Blind:EquivalentLayer, Material:Drape:EquivalentLayer
     714              :     // and MaterialScreen:EquivalentLayer
     715              :     struct MaterialShadeEQL : public MaterialShadingDevice
     716              :     {
     717              :         // Shading properties are profile-angle independent in EQL model
     718              :         BlindTraAbsRef<1> TAR;
     719              : 
     720            5 :         MaterialShadeEQL() : MaterialShadingDevice()
     721              :         {
     722            5 :             group = Group::ShadeEQL;
     723            5 :         }
     724            5 :         virtual ~MaterialShadeEQL() = default;
     725            0 :         bool can_instantiate() override
     726              :         {
     727            0 :             return true;
     728              :         } // Allows this class to be instantiated
     729              :     };
     730              : 
     731              :     // Class for Material:Screen:EquivalentLayer
     732              :     struct MaterialScreenEQL : public MaterialShadeEQL
     733              :     {
     734              :         Real64 wireSpacing = 0.0;  // insect screen wire spacing
     735              :         Real64 wireDiameter = 0.0; // insect screen wire diameter
     736              : 
     737            0 :         MaterialScreenEQL() : MaterialShadeEQL()
     738              :         {
     739            0 :             group = Group::ScreenEQL;
     740            0 :         }
     741            0 :         virtual ~MaterialScreenEQL() = default;
     742              :     };
     743              : 
     744              :     struct MaterialDrapeEQL : public MaterialShadeEQL
     745              :     {
     746              :         bool isPleated = false;     // if pleated drape= true, if nonpleated drape = false
     747              :         Real64 pleatedWidth = 0.0;  // width of the pleated drape fabric section
     748              :         Real64 pleatedLength = 0.0; // length of the pleated drape fabric section
     749              : 
     750            0 :         MaterialDrapeEQL() : MaterialShadeEQL()
     751              :         {
     752            0 :             group = Group::DrapeEQL;
     753            0 :         } // Can be any number of 'group' types, so don't set it here
     754            0 :         virtual ~MaterialDrapeEQL() = default;
     755              :     };
     756              : 
     757              :     struct MaterialBlindEQL : public MaterialShadeEQL
     758              :     {
     759              :         Real64 SlatWidth = 0.0;                                      // slat width
     760              :         Real64 SlatSeparation = 0.0;                                 // slat separation
     761              :         Real64 SlatCrown = 0.0;                                      // slat crown
     762              :         Real64 SlatAngle = 0.0;                                      // slat angle
     763              :         SlatAngleType slatAngleType = SlatAngleType::FixedSlatAngle; // slat angle control type, 0=fixed, 1=maximize solar, 2=block beam
     764              :         DataWindowEquivalentLayer::Orientation SlatOrientation = DataWindowEquivalentLayer::Orientation::Invalid; // horizontal or vertical
     765              : 
     766            5 :         MaterialBlindEQL() : MaterialShadeEQL()
     767              :         {
     768            5 :             group = Group::BlindEQL;
     769            5 :         } // Can be any number of 'group' types, so don't set it here
     770           10 :         virtual ~MaterialBlindEQL() = default;
     771              :     };
     772              : 
     773              :     // EcoRoof
     774              :     enum EcoRoofCalcMethod
     775              :     {
     776              :         Invalid = -1,
     777              :         Simple,
     778              :         SchaapGenuchten,
     779              :         Num
     780              :     };
     781              : 
     782              :     extern const std::array<std::string_view, (int)EcoRoofCalcMethod::Num> ecoRoofCalcMethodNamesUC;
     783              : 
     784              :     // Class for Material:RoofVegetation
     785              :     struct MaterialEcoRoof : public MaterialBase
     786              :     {
     787              :         // EcoRoof-Related properties, essentially for the plant layer,
     788              :         //    the soil layer uses the same resource as a regular material
     789              :         EcoRoofCalcMethod calcMethod = EcoRoofCalcMethod::Invalid; // 1-Simple, 2-SchaapGenuchten
     790              :         Real64 HeightOfPlants = 0.0;                               // plants' height
     791              :         Real64 LAI = 0.0;                                          // LeafAreaIndex (Dimensionless???)
     792              :         Real64 Lreflectivity = 0.0;                                // LeafReflectivity
     793              :         Real64 LEmissitivity = 0.0;                                // LeafEmissivity
     794              :         Real64 InitMoisture = 0.0;                                 // Initial soil moisture DJS
     795              :         Real64 MinMoisture = 0.0;                                  // Minimum moisture allowed DJS
     796              :         Real64 RStomata = 0.0;                                     // Minimum stomatal resistance DJS
     797              : 
     798            4 :         MaterialEcoRoof() : MaterialBase()
     799              :         {
     800            4 :             group = Group::EcoRoof;
     801            4 :         }
     802            8 :         ~MaterialEcoRoof() = default;
     803              :     };
     804              : 
     805              :     struct WindowThermalModelParams
     806              :     {
     807              :         // Members
     808              :         std::string Name;                                                                                   // Window thermal model name
     809              :         TARCOGGassesParams::Stdrd CalculationStandard = TARCOGGassesParams::Stdrd::Invalid;                 // Tarcog calculation standard
     810              :         TARCOGParams::TARCOGThermalModel ThermalModel = TARCOGParams::TARCOGThermalModel::Invalid;          // Tarcog thermal model
     811              :         Real64 SDScalar = 0.0;                                                                              // SDScalar coefficient
     812              :         TARCOGParams::DeflectionCalculation DeflectionModel = TARCOGParams::DeflectionCalculation::Invalid; // Deflection model
     813              :         Real64 VacuumPressureLimit = 0.0; // Pressure limit at which it will be considered vacuum gas state
     814              :         Real64 InitialTemperature = 0.0;  // Window(s) temperature in time of fabrication
     815              :         Real64 InitialPressure = 0.0;     // Window(s) pressure in time of fabrication
     816              :     };
     817              : 
     818              :     struct SpectralDataProperties
     819              :     {
     820              :         // Members
     821              :         std::string Name;           // Name of spectral data set
     822              :         int NumOfWavelengths = 0;   // Number of wavelengths in the data set
     823              :         Array1D<Real64> WaveLength; // Wavelength (microns)
     824              :         Array1D<Real64> Trans;      // Transmittance at normal incidence
     825              :         Array1D<Real64> ReflFront;  // Front reflectance at normal incidence
     826              :         Array1D<Real64> ReflBack;   // Back reflectance at normal incidence
     827              :     };
     828              : 
     829              :     struct MaterialGlass : public MaterialFen
     830              :     {
     831              :         // Window-related radiation parameters
     832              :         Real64 GlassTransDirtFactor = 1.0; // Multiplier on glass transmittance due to dirt
     833              :         bool SolarDiffusing = false;       // True if glass diffuses beam solar radiation
     834              :         Real64 ReflectSolDiffBack = 0.0;   // Solar back diffuse reflectance
     835              :         Real64 ReflectSolDiffFront = 0.0;  // Solar front diffuse reflectance
     836              :         Real64 ReflectVisBeamBack = 0.0;   // Visible back reflectance (beam to everything)
     837              :         Real64 ReflectVisBeamFront = 0.0;  // Visible front reflectance (beam to everything)
     838              :         Real64 ReflectVisDiffBack = 0.0;   // Visible back diffuse reflectance
     839              :         Real64 ReflectVisDiffFront = 0.0;  // Visible front diffuse reflectance
     840              :         Real64 TransSolBeam = 0.0;         // Solar transmittance (beam to everything)
     841              :         Real64 TransVisBeam = 0.0;         // Visible transmittance (beam to everything)
     842              :         // Complex fenestration parameters
     843              :         Real64 YoungModulus = 0.0;  // Young's modulus (Pa) - used in window deflection calculations
     844              :         Real64 PoissonsRatio = 0.0; // Poisson's ratio - used in window deflection calculations
     845              : 
     846              :         // Added 12/22/2008 for thermochromic window glazing material
     847              :         Real64 SpecTemp = 0.0;                          // Temperature corresponding to the specified material properties
     848              :         int TCParentMatNum = 0;                         // Reference to the parent object WindowMaterial:Glazing:Thermochromic
     849              :         int GlassSpectralDataPtr = 0;                   // Number of a spectral data set associated with a window glass material
     850              :         Curve::Curve *GlassSpecAngTransCurve = nullptr; // Transmittance as a function of spectral and angle associated with a glass material
     851              :         Curve::Curve *GlassSpecAngFReflCurve = nullptr; // Front reflectance as a function of spectral and angle associated with a glass material
     852              :         Curve::Curve *GlassSpecAngBReflCurve = nullptr; // Back reflectance as a function of spectral and angle associated with a glass material
     853              : 
     854              :         // TODO: these and others need to be moved to a child class
     855              :         // Simple Glazing System
     856              :         Real64 SimpleWindowUfactor = 0.0;       // user input for simple window U-factor with film coeffs (W/m2-k)
     857              :         Real64 SimpleWindowSHGC = 0.0;          // user input for simple window Solar Heat Gain Coefficient (non-dimensional)
     858              :         Real64 SimpleWindowVisTran = 0.0;       // (optional) user input for simple window Visual Transmittance (non-dimensional)
     859              :         bool SimpleWindowVTinputByUser = false; // false means not input, true means user provide VT input
     860              : 
     861              :         Window::OpticalDataModel windowOpticalData = Window::OpticalDataModel::SpectralAverage;
     862              : 
     863          146 :         MaterialGlass() : MaterialFen()
     864              :         {
     865          146 :             group = Group::Glass;
     866          146 :         }
     867          290 :         ~MaterialGlass() = default;
     868            0 :         bool can_instantiate()
     869              :         {
     870            0 :             return true;
     871              :         }
     872              : 
     873              :         void SetupSimpleWindowGlazingSystem(EnergyPlusData &state);
     874              :     };
     875              : 
     876              :     struct MaterialGlassEQL : public MaterialFen
     877              :     {
     878              :         BlindTraAbsRef<1> TAR;
     879              :         Window::OpticalDataModel windowOpticalData = Window::OpticalDataModel::SpectralAverage;
     880              : 
     881           12 :         MaterialGlassEQL() : MaterialFen()
     882              :         {
     883           12 :             group = Group::GlassEQL;
     884           12 :         }
     885           24 :         ~MaterialGlassEQL() = default;
     886            0 :         bool can_instantiate()
     887              :         {
     888            0 :             return true;
     889              :         }
     890              :     };
     891              : 
     892              :     struct MaterialRefSpecTemp
     893              :     {
     894              :         int matNum = 0;
     895              :         Real64 specTemp = 0.0;
     896              :     };
     897              : 
     898              :     struct MaterialGlassTC : public MaterialBase
     899              :     {
     900              :         // Members
     901              :         int numMatRefs = 0; // Number of TC glazing materials
     902              :         Array1D<MaterialRefSpecTemp> matRefs;
     903              : 
     904            0 :         MaterialGlassTC() : MaterialBase()
     905              :         {
     906            0 :             group = Group::GlassTCParent;
     907            0 :         }
     908            0 :         ~MaterialGlassTC() = default;
     909              :     };
     910              : 
     911              :     int GetMaterialNum(EnergyPlusData const &state, std::string const &matName);
     912              :     MaterialBase *GetMaterial(EnergyPlusData &state, std::string const &matName);
     913              : 
     914              :     void GetMaterialData(EnergyPlusData &state, bool &errorsFound); // set to true if errors found in input
     915              :     void GetVariableAbsorptanceInput(EnergyPlusData &state, bool &errorsFound);
     916              :     void GetWindowGlassSpectralData(EnergyPlusData &state, bool &errorsFound);
     917              : 
     918              :     // Angles must be in radians
     919              :     void GetRelativePhiTheta(Real64 phiWin, Real64 thetaWin, Vector3<Real64> const &solcos, Real64 &phi, Real64 &theta);
     920              :     void NormalizePhiTheta(Real64 &phi, Real64 &theta);
     921              :     void GetPhiThetaIndices(Real64 phi, Real64 theta, Real64 dPhi, Real64 dTheta, int &iPhi1, int &iPhi2, int &iTheta1, int &iTheta2);
     922              : 
     923              :     void CalcScreenTransmittance(EnergyPlusData &state,
     924              :                                  MaterialScreen const *screen,
     925              :                                  Real64 phi,   // Sun altitude relative to surface outward normal (rad)
     926              :                                  Real64 theta, // Sun azimuth relative to surface outward normal (rad)
     927              :                                  ScreenBmTransAbsRef &tar);
     928              : 
     929              :     void NormalizeProfSlat(Real64 &profAng, Real64 &slatAng);
     930              :     void GetProfIndices(Real64 profAng, int &iProf1, int &iProf2);
     931              :     void GetSlatIndicesInterpFac(Real64 slatAng, int &iSlat1, int &iSlat2, Real64 &interpFac);
     932              : } // namespace Material
     933              : 
     934              : struct MaterialData : BaseGlobalStruct
     935              : {
     936              :     Array1D<Material::MaterialBase *> materials;
     937              :     std::map<std::string, int> materialMap;
     938              : 
     939              :     int NumRegulars = 0;
     940              :     int NumNoMasses = 0;
     941              :     int NumIRTs = 0;
     942              :     int NumAirGaps = 0;
     943              :     int NumW5Glazings = 0;         // Window5 Glass Materials, specified by transmittance and front and back reflectance
     944              :     int NumW5AltGlazings = 0;      // Window5 Glass Materials, specified by index of refraction and extinction coeff
     945              :     int NumW5Gases = 0;            // Window5 Single-Gas Materials
     946              :     int NumW5GasMixtures = 0;      // Window5 Gas Mixtures
     947              :     int NumW7SupportPillars = 0;   // Complex fenestration support pillars
     948              :     int NumW7DeflectionStates = 0; // Complex fenestration deflection states
     949              :     int NumW7Gaps = 0;             // Complex fenestration material gaps
     950              :     int NumBlinds = 0;             // Total number of blind materials
     951              :     int NumScreens = 0;            // Total number of exterior window screen materials
     952              :     int NumTCGlazings = 0;         // Number of TC glazing object - WindowMaterial:Glazing:Thermochromic found in the idf file
     953              :     int NumShades = 0;             // Total number of shade materials
     954              :     int NumComplexGaps = 0;        // Total number of window gaps for complex fenestrations
     955              :     int NumSimpleWindows = 0;      // number of simple window systems.
     956              :     int NumEQLGlazings = 0;        // Window5 Single-Gas Materials for Equivalent Layer window model
     957              :     int NumEQLShades = 0;          // Total number of shade materials for Equivalent Layer window model
     958              :     int NumEQLDrapes = 0;          // Total number of drape materials for Equivalent Layer window model
     959              :     int NumEQLBlinds = 0;          // Total number of blind materials for Equivalent Layer window model
     960              :     int NumEQLScreens = 0;         // Total number of exterior window screen materials for Equivalent Layer window model
     961              :     int NumEQLGaps = 0;            // Window5 Equivalent Layer Single-Gas Materials
     962              :     int NumEcoRoofs = 0;
     963              : 
     964              :     bool AnyVariableAbsorptance = false;
     965              :     int NumSpectralData = 0;
     966              : 
     967              :     Array1D<Material::WindowThermalModelParams> WindowThermalModel;
     968              :     Array1D<Material::SpectralDataProperties> SpectralData;
     969              : 
     970         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
     971              :     {
     972         2126 :     }
     973              : 
     974         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     975              :     {
     976         1152 :     }
     977              : 
     978         2100 :     void clear_state() override
     979              :     {
     980         3346 :         for (int i = 0; i < materials.isize(); ++i) {
     981         1246 :             delete materials[i];
     982              :         }
     983         2100 :         materials.clear();
     984         2100 :         materialMap.clear();
     985         2100 :     }
     986              : };
     987              : 
     988              : } // namespace EnergyPlus
     989              : 
     990              : #endif
        

Generated by: LCOV version 2.0-1