Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2024, 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/EPVector.hh>
55 : #include <EnergyPlus/EnergyPlus.hh>
56 : #include <EnergyPlus/PhaseChangeModeling/HysteresisModel.hh>
57 : #include <EnergyPlus/TARCOGGassesParams.hh>
58 : #include <EnergyPlus/TARCOGParams.hh>
59 :
60 : namespace EnergyPlus {
61 :
62 : namespace Material {
63 :
64 : constexpr int MaxSlatAngs(181); // 1 degree increments for slat angles (We'll see what the performance implications are)
65 : constexpr int MaxProfAngs(37);
66 :
67 : // Parameters to indicate material group type for use with the Material
68 : // derived type (see below):
69 : enum class Group
70 : {
71 : Invalid = -1,
72 : Regular,
73 : Air,
74 : Shade,
75 : WindowGlass,
76 : WindowGas,
77 : WindowBlind,
78 : WindowGasMixture,
79 : Screen,
80 : EcoRoof,
81 : IRTransparent,
82 : WindowSimpleGlazing,
83 : ComplexWindowShade,
84 : ComplexWindowGap,
85 : GlassEquivalentLayer,
86 : ShadeEquivalentLayer,
87 : DrapeEquivalentLayer,
88 : BlindEquivalentLayer,
89 : ScreenEquivalentLayer,
90 : GapEquivalentLayer,
91 : Num
92 : };
93 :
94 : enum class GasType
95 : {
96 : Invalid = -1,
97 : Custom,
98 : Air,
99 : Argon,
100 : Krypton,
101 : Xenon,
102 : Num
103 : };
104 :
105 : #ifdef GET_OUT
106 : // Air Argon Krypton Xenon
107 : // Gas conductivity coefficients for gases in a mixture
108 : extern const std::array<std::array<Real64, 10>, 3> GasCoeffsCon;
109 : // Gas viscosity coefficients for gases in a mixture
110 : extern const std::array<std::array<Real64, 10>, 3> GasCoeffsVis;
111 : // Gas specific heat coefficients for gases in a mixture
112 : extern const std::array<std::array<Real64, 10>, 3> GasCoeffsCp;
113 : extern const std::array<Real64, 10> GasWght;
114 : extern const std::array<Real64, 10> GasSpecificHeatRatio;
115 : #endif // GET_OUT
116 :
117 : enum class GapVentType
118 : {
119 : Invalid = -1,
120 : Sealed,
121 : VentedIndoor,
122 : VentedOutdoor,
123 : Num
124 : };
125 :
126 : constexpr std::array<std::string_view, (int)GapVentType::Num> gapVentTypeNamesUC = {"SEALED", "VENTEDINDOOR", "VENTEDOUTDOOR"};
127 :
128 : extern const std::array<std::string_view, (int)GasType::Num> gasTypeNames;
129 : extern const std::array<std::string_view, (int)GapVentType::Num> gapVentTypeNames;
130 :
131 : enum class SlatAngleType
132 : {
133 : Invalid = -1,
134 : FixedSlatAngle,
135 : MaximizeSolar,
136 : BlockBeamSolar,
137 : Num
138 : };
139 :
140 : constexpr std::array<std::string_view, (int)SlatAngleType::Num> slatAngleTypeNamesUC = {"FIXEDSLATANGLE", "MAXIMIZESOLAR", "BLOCKBEAMSOLAR"};
141 :
142 : // Parameter for window screens beam reflectance accounting
143 : enum class ScreenBeamReflectanceModel
144 : {
145 : Invalid = -1,
146 : DoNotModel,
147 : DirectBeam,
148 : Diffuse,
149 : Num
150 : };
151 :
152 : constexpr std::array<std::string_view, (int)ScreenBeamReflectanceModel::Num> screenBeamReflectanceModelNamesUC = {
153 : "DONOTMODEL", "MODELASDIRECTBEAM", "MODELASDIFFUSE"};
154 :
155 : enum class VariableAbsCtrlSignal
156 : {
157 : Invalid = -1,
158 : SurfaceTemperature,
159 : SurfaceReceivedSolarRadiation,
160 : SpaceHeatingCoolingMode,
161 : Scheduled,
162 : Num
163 : };
164 :
165 : constexpr std::array<std::string_view, (int)VariableAbsCtrlSignal::Num> variableAbsCtrlSignalNamesUC = {
166 : "SURFACETEMPERATURE", "SURFACERECEIVEDSOLARRADIATION", "SPACEHEATINGCOOLINGMODE", "SCHEDULED"};
167 :
168 : // Parameters to indicate surface roughness for use with the Material
169 : // derived type:
170 : enum class SurfaceRoughness
171 : {
172 : Invalid = -1,
173 : VeryRough,
174 : Rough,
175 : MediumRough,
176 : MediumSmooth,
177 : Smooth,
178 : VerySmooth,
179 : Num
180 : };
181 :
182 : constexpr std::array<std::string_view, (int)SurfaceRoughness::Num> surfaceRoughnessNamesUC{
183 : "VERYROUGH", "ROUGH", "MEDIUMROUGH", "MEDIUMSMOOTH", "SMOOTH", "VERYSMOOTH"};
184 :
185 : extern const std::array<std::string_view, (int)SurfaceRoughness::Num> surfaceRoughnessNames;
186 :
187 : struct MaterialBase
188 : {
189 : // Members
190 : std::string Name = ""; // Name of material layer
191 : Group group = Group::Invalid; // Material group type (see Material Parameters above. Currently
192 : // active: RegularMaterial, Shade, Air, WindowGlass,
193 : // WindowGas, WindowBlind, WindowGasMixture, Screen, EcoRoof,
194 : // IRTMaterial, WindowSimpleGlazing, ComplexWindowShade, ComplexWindowGap)
195 : SurfaceRoughness Roughness = SurfaceRoughness::Invalid; // Surface roughness index (See Surface Roughness parameters
196 : // above. Current: VerySmooth, Smooth, MediumSmooth,
197 : // MediumRough, Rough, VeryRough)
198 : // Thermo-physical material properties
199 : Real64 Conductivity = 0.0; // Thermal conductivity of layer (W/m2K)
200 : Real64 Density = 0.0; // Layer density (kg/m3)
201 : Real64 Resistance = 0.0; // Layer thermal resistance (alternative to Density,
202 : // Conductivity, Thickness, and Specific Heat; K/W)
203 : bool ROnly = false; // Material defined with "R" only
204 : Real64 SpecHeat = 0.0; // Layer specific heat (J/kgK)
205 : Real64 Thickness = 0.0; // Layer thickness (m)
206 :
207 : Real64 AbsorpThermal = 0.0; // Layer thermal absorptance
208 : Real64 AbsorpThermalInput = 0.0; // Layer thermal absorptance input by user
209 : Real64 AbsorpThermalBack = 0.0; // Infrared radiation back absorption
210 : Real64 AbsorpThermalFront = 0.0; // Infrared radiation front absorption
211 :
212 : Real64 AbsorpSolar = 0.0; // Layer solar absorptance
213 : Real64 AbsorpSolarInput = 0.0; // Layer solar absorptance input by user
214 :
215 : Real64 AbsorpVisible = 0.0; // Layer Visible Absorptance
216 : Real64 AbsorpVisibleInput = 0.0; // Layer Visible Absorptance input by user
217 :
218 : Real64 Trans = 0.0; // Transmittance of layer (glass, shade)
219 : Real64 TransVis = 0.0; // Visible transmittance (at normal incidence)
220 : Real64 TransThermal = 0.0; // Infrared radiation transmittance
221 :
222 : Real64 ReflectSolBeamBack = 0.0; // Solar back reflectance (beam to everything)
223 : Real64 ReflectSolBeamFront = 0.0; // Solar front reflectance (beam to everything)
224 :
225 : // TODO: these and others need to be moved to a child class
226 : // Simple Glazing System
227 : Real64 SimpleWindowUfactor = 0.0; // user input for simple window U-factor with film coeffs (W/m2-k)
228 : Real64 SimpleWindowSHGC = 0.0; // user input for simple window Solar Heat Gain Coefficient (non-dimensional)
229 : Real64 SimpleWindowVisTran = 0.0; // (optional) user input for simple window Visual Transmittance (non-dimensional)
230 : bool SimpleWindowVTinputByUser = false; // false means not input, true means user provide VT input
231 : bool WarnedForHighDiffusivity = false; // used to limit error messaging to just the first instance
232 :
233 : bool isUsed = false;
234 :
235 : // Moved these into the base class for SQLite purposes
236 : Real64 Porosity = 0.0; // Layer porosity
237 : Real64 IsoMoistCap = 0.0; // Isothermal moisture capacity on water vapor density (m3/kg)
238 : Real64 ThermGradCoef = 0.0; // Thermal-gradient coefficient for moisture capacity based on the water vapor density (kg/kgK)
239 : Real64 VaporDiffus = 0.0; // Layer vapor diffusivity
240 :
241 0 : virtual bool dummy()
242 : {
243 0 : return true;
244 : } // Need at least one virtual function (vtable) for dynamic casting to work (duh)
245 48 : virtual ~MaterialBase() = default;
246 : };
247 :
248 : struct MaterialChild : public MaterialBase
249 : {
250 : int GlassSpectralDataPtr = 0; // Number of a spectral data set associated with a window glass material
251 : // Radiation parameters
252 : bool AbsorpSolarEMSOverrideOn = false; // if true, then EMS calling to override value for solar absorptance
253 : Real64 AbsorpSolarEMSOverride = false; // value to use when EMS calling to override value for solar absorptance
254 : bool AbsorpThermalEMSOverrideOn = false; // if true, then EMS calling to override value for thermal absorptance
255 : Real64 AbsorpThermalEMSOverride = 0.0; // value to use when EMS calling to override value for thermal absorptance
256 : // dynamic thermal and solar absorptance coating parameters
257 : VariableAbsCtrlSignal absorpVarCtrlSignal = VariableAbsCtrlSignal::Invalid;
258 : int absorpThermalVarSchedIdx = 0;
259 : int absorpThermalVarFuncIdx = 0;
260 : int absorpSolarVarSchedIdx = 0;
261 : int absorpSolarVarFuncIdx = 0;
262 : bool AbsorpVisibleEMSOverrideOn = false; // if true, then EMS calling to override value for visible absorptance
263 : Real64 AbsorpVisibleEMSOverride = 0.0; // value to use when EMS calling to override value for visible absorptance
264 :
265 : // Window-related radiation parameters
266 : Real64 GlassTransDirtFactor = 1.0; // Multiplier on glass transmittance due to dirt
267 : bool SolarDiffusing = false; // True if glass diffuses beam solar radiation
268 : Real64 ReflectShade = 0.0; // Shade or screen reflectance (interior shade only)
269 : Real64 ReflectShadeVis = 0.0; // Shade reflectance for visible radiation
270 : Real64 ReflectSolDiffBack = 0.0; // Solar back diffuse reflectance
271 : Real64 ReflectSolDiffFront = 0.0; // Solar front diffuse reflectance
272 : Real64 ReflectVisBeamBack = 0.0; // Visible back reflectance (beam to everything)
273 : Real64 ReflectVisBeamFront = 0.0; // Visible front reflectance (beam to everything)
274 : Real64 ReflectVisDiffBack = 0.0; // Visible back diffuse reflectance
275 : Real64 ReflectVisDiffFront = 0.0; // Visible front diffuse reflectance
276 : Real64 TransSolBeam = 0.0; // Solar transmittance (beam to everything)
277 : Real64 TransVisBeam = 0.0; // Visible transmittance (beam to everything)
278 : int BlindDataPtr = 0; // Pointer to window blind data
279 : // Complex fenestration parameters
280 : Real64 YoungModulus = 0.0; // Young's modulus (Pa) - used in window deflection calculations
281 : Real64 PoissonsRatio = 0.0; // Poisson's ratio - used in window deflection calculations
282 : Real64 DeflectedThickness = 0.0; // Minimum gap thickness in deflected state (m). Used with measured deflection
283 : Real64 Pressure = 0.0; // Window Gap pressure (Pa)
284 : int SupportPillarPtr = 0; // Pointer to support pillar data
285 : int DeflectionStatePtr = 0; // Pointer to deflection state
286 : int ComplexShadePtr = 0; // Pointer to complex shade data
287 : int GasPointer = 0; // Pointer to gas or gas mixture used in the gap
288 : // Window-shade thermal model parameters
289 : Real64 WinShadeToGlassDist = 0.0; // Distance between window shade and adjacent glass (m)
290 : Real64 WinShadeTopOpeningMult = 0.0; // Area of air-flow opening at top of shade, expressed as a fraction
291 : // of the shade-to-glass opening area at the top of the shade
292 : Real64 WinShadeBottomOpeningMult = 0.0; // Area of air-flow opening at bottom of shade, expressed as a fraction
293 : // of the shade-to-glass opening area at the bottom of the shade
294 : Real64 WinShadeLeftOpeningMult = 0.0; // Area of air-flow opening at left side of shade, expressed as a fraction
295 : // of the shade-to-glass opening area at the left side of the shade
296 : Real64 WinShadeRightOpeningMult = 0.0; // Area of air-flow opening at right side of shade, expressed as a fraction
297 : // of the shade-to-glass opening area at the right side of the shade
298 : Real64 WinShadeAirFlowPermeability = 0.0; // The effective area of openings in the shade itself, expressed as a
299 : // fraction of the shade area
300 : bool EMPDMaterialProps = false; // True if EMPD properties have been assigned
301 : Real64 EMPDmu = 0.0; // Water Vapor Diffusion Resistance Factor (dimensionless)
302 : Real64 MoistACoeff = 0.0; // Moisture Equation Coefficient a
303 : Real64 MoistBCoeff = 0.0; // Moisture Equation Coefficient b
304 : Real64 MoistCCoeff = 0.0; // Moisture Equation Coefficient c
305 : Real64 MoistDCoeff = 0.0; // Moisture Equation Coefficient d
306 : Real64 EMPDSurfaceDepth = 0.0; // Surface-layer penetration depth (m)
307 : Real64 EMPDDeepDepth = 0.0; // Deep-layer penetration depth (m)
308 : Real64 EMPDCoatingThickness = 0.0; // Coating Layer Thickness (m)
309 : Real64 EMPDmuCoating = 0.0; // Coating Layer water vapor diffusion resistance factor (dimensionless)
310 : // EcoRoof-Related properties, essentially for the plant layer,
311 : // the soil layer uses the same resource as a regular material
312 : int EcoRoofCalculationMethod = 0; // 1-Simple, 2-SchaapGenuchten
313 : Real64 HeightOfPlants = 0.0; // plants' height
314 : Real64 LAI = 0.0; // LeafAreaIndex (Dimensionless???)
315 : Real64 Lreflectivity = 0.0; // LeafReflectivity
316 : Real64 LEmissitivity = 0.0; // LeafEmissivity
317 : Real64 InitMoisture = 0.0; // Initial soil moisture DJS
318 : Real64 MinMoisture = 0.0; // Minimum moisture allowed DJS
319 : Real64 RStomata = 0.0; // Minimum stomatal resistance DJS
320 : // HAMT
321 : int niso = -1; // Number of data points
322 : Array1D<Real64> isodata = Array1D<Real64>(27, 0.0); // isotherm values
323 : Array1D<Real64> isorh = Array1D<Real64>(27, 0.0); // isotherm RH values
324 : int nsuc = -1; // Number of data points
325 : Array1D<Real64> sucdata = Array1D<Real64>(27, 0.0); // suction values
326 : Array1D<Real64> sucwater = Array1D<Real64>(27, 0.0); // suction water values
327 : int nred = -1; // Number of data points
328 : Array1D<Real64> reddata = Array1D<Real64>(27, 0.0); // redistribution values
329 : Array1D<Real64> redwater = Array1D<Real64>(27, 0.0); // redistribution water values
330 : int nmu = -1; // Number of data points
331 : Array1D<Real64> mudata = Array1D<Real64>(27, 0.0); // mu values
332 : Array1D<Real64> murh = Array1D<Real64>(27, 0.0); // mu rh values
333 : int ntc = -1; // Number of data points
334 : Array1D<Real64> tcdata = Array1D<Real64>(27, 0.0); // thermal conductivity values
335 : Array1D<Real64> tcwater = Array1D<Real64>(27, 0.0); // thermal conductivity water values
336 : Real64 itemp = 10.0; // initial Temperature
337 : Real64 irh = 0.5; // Initial RH
338 : Real64 iwater = 0.2; // Initial water content kg/kg
339 : int divs = 3; // Number of divisions
340 : Real64 divsize = 0.005; // Average Cell Size
341 : int divmin = 3; // Minimum number of cells
342 : int divmax = 10; // Maximum number of cells
343 : // Added 12/22/2008 for thermochromic window glazing material
344 : Real64 SpecTemp = 0.0; // Temperature corresponding to the specified material properties
345 : int TCParent = 0; // Reference to the parent object WindowMaterial:Glazing:Thermochromic
346 : // Equivalent Layer (ASHWAT) Model
347 : Real64 ScreenWireSpacing = 0.0; // insect screen wire spacing
348 : Real64 ScreenWireDiameter = 0.0; // insect screen wire diameter
349 :
350 : Real64 ReflFrontBeamBeam = 0.0; // Beam-Beam solar reflectance front at zero incident
351 : Real64 ReflBackBeamBeam = 0.0; // Beam-Beam solar reflectance back at zero incident
352 : Real64 TausFrontBeamBeam = 0.0; // Beam-Beam solar transmittance front at zero incident
353 : Real64 TausBackBeamBeam = 0.0; // Beam-Beam solar transmittance back at zero incident
354 : Real64 ReflFrontBeamBeamVis = 0.0; // Beam-Beam visible reflectance front at zero incident
355 : Real64 ReflBackBeamBeamVis = 0.0; // Beam-Beam visible reflectance back at zero incident
356 : Real64 TausFrontBeamBeamVis = 0.0; // Beam-Beam visible transmittance front at zero incident
357 : Real64 TausBackBeamBeamVis = 0.0; // Beam-Beam visible transmittance back at zero incident
358 : Real64 ReflFrontBeamDiff = 0.0; // Beam-Diffuse solar reflectance front at zero incident
359 : Real64 ReflBackBeamDiff = 0.0; // Beam-Diffuse solar reflectance back at zero incident
360 : Real64 TausFrontBeamDiff = 0.0; // Beam-Diffuse solar transmittance front at zero incident
361 : Real64 TausBackBeamDiff = 0.0; // Beam-Diffuse solar transmittance back at zero incident
362 : Real64 ReflFrontBeamDiffVis = 0.0; // Beam-Diffuse visible reflectance front at zero incident
363 : Real64 ReflBackBeamDiffVis = 0.0; // Beam-Diffuse visible reflectance back at zero incident
364 : Real64 TausFrontBeamDiffVis = 0.0; // Beam-Diffuse visible transmittance front at zero incident
365 : Real64 TausBackBeamDiffVis = 0.0; // Beam-Diffuse visible transmittance back at zero incident
366 :
367 : Real64 ReflFrontDiffDiff = 0.0; // Diffuse-Diffuse solar reflectance front
368 : Real64 ReflBackDiffDiff = 0.0; // Diffuse-Diffuse solar reflectance back
369 : Real64 TausDiffDiff = 0.0; // Diffuse-Diffuse solar transmittance (front and back)
370 : Real64 ReflFrontDiffDiffVis = 0.0; // Diffuse-Diffuse visible reflectance front
371 : Real64 ReflBackDiffDiffVis = 0.0; // Diffuse-Diffuse visible reflectance back
372 : Real64 TausDiffDiffVis = 0.0; // Diffuse-Diffuse visible transmittance (front and back)
373 : Real64 EmissThermalFront = 0.0; // Front side thermal or infrared Emissivity
374 : Real64 EmissThermalBack = 0.0; // Back side thermal or infrared Emissivity
375 : Real64 TausThermal = 0.0; // Thermal transmittance (front and back)
376 :
377 : bool ISPleatedDrape = false; // if pleated drape= true, if nonpleated drape = false
378 : Real64 PleatedDrapeWidth = 0.0; // width of the pleated drape fabric section
379 : Real64 PleatedDrapeLength = 0.0; // length of the pleated drape fabric section
380 : Real64 SlatWidth = 0.0; // slat width
381 : Real64 SlatSeparation = 0.0; // slat separation
382 : Real64 SlatCrown = 0.0; // slat crown
383 : Real64 SlatAngle = 0.0; // slat angle
384 : SlatAngleType slatAngleType = SlatAngleType::FixedSlatAngle; // slat angle control type, 0=fixed, 1=maximize solar, 2=block beam
385 : DataWindowEquivalentLayer::Orientation SlatOrientation = DataWindowEquivalentLayer::Orientation::Invalid; // horizontal or vertical
386 : HysteresisPhaseChange::HysteresisPhaseChange *phaseChange = nullptr;
387 : bool GlassSpectralAndAngle = false; // if SpectralAndAngle is an entered choice
388 : int GlassSpecAngTransDataPtr =
389 : 0; // Data set index of transmittance as a function of spectral and angle associated with a window glass material
390 : int GlassSpecAngFRefleDataPtr = 0; // Data set index of front reflectance as a function of spectral and angle associated with a window glass
391 : // material
392 : int GlassSpecAngBRefleDataPtr = 0; // Data set index of back reflectance as a function of spectral and angle associated with a window glass
393 : // material
394 :
395 0 : virtual bool dummy()
396 : {
397 0 : return true;
398 : }
399 48 : virtual ~MaterialChild() = default;
400 : };
401 :
402 : struct WindowBlindProperties
403 : {
404 : // Members
405 : std::string Name;
406 : int MaterialNumber = 0; // Material pointer for the blind
407 : // Input properties
408 : DataWindowEquivalentLayer::Orientation SlatOrientation = DataWindowEquivalentLayer::Orientation::Invalid; // HORIZONTAL or VERTICAL
409 : DataWindowEquivalentLayer::AngleType SlatAngleType = DataWindowEquivalentLayer::AngleType::Fixed; // FIXED or VARIABLE
410 : Real64 SlatWidth = 0.0; // Slat width (m)
411 : Real64 SlatSeparation = 0.0; // Slat separation (m)
412 : Real64 SlatThickness = 0.0; // Slat thickness (m)
413 : Real64 SlatCrown = 0.0; // the height of the slate (length from the chord to the curve)
414 : Real64 SlatAngle = 0.0; // Slat angle (deg)
415 : Real64 MinSlatAngle = 0.0; // Minimum slat angle for variable-angle slats (deg) (user input)
416 : Real64 MaxSlatAngle = 0.0; // Maximum slat angle for variable-angle slats (deg) (user input)
417 : Real64 SlatConductivity = 0.0; // Slat conductivity (W/m-K)
418 : // Solar slat properties
419 : Real64 SlatTransSolBeamDiff = 0.0; // Slat solar beam-diffuse transmittance
420 : Real64 SlatFrontReflSolBeamDiff = 0.0; // Slat front solar beam-diffuse reflectance
421 : Real64 SlatBackReflSolBeamDiff = 0.0; // Slat back solar beam-diffuse reflectance
422 : Real64 SlatTransSolDiffDiff = 0.0; // Slat solar diffuse-diffuse transmittance
423 : Real64 SlatFrontReflSolDiffDiff = 0.0; // Slat front solar diffuse-diffuse reflectance
424 : Real64 SlatBackReflSolDiffDiff = 0.0; // Slat back solar diffuse-diffuse reflectance
425 : // Visible slat properties
426 : Real64 SlatTransVisBeamDiff = 0.0; // Slat visible beam-diffuse transmittance
427 : Real64 SlatFrontReflVisBeamDiff = 0.0; // Slat front visible beam-diffuse reflectance
428 : Real64 SlatBackReflVisBeamDiff = 0.0; // Slat back visible beam-diffuse reflectance
429 : Real64 SlatTransVisDiffDiff = 0.0; // Slat visible diffuse-diffuse transmittance
430 : Real64 SlatFrontReflVisDiffDiff = 0.0; // Slat front visible diffuse-diffuse reflectance
431 : Real64 SlatBackReflVisDiffDiff = 0.0; // Slat back visible diffuse-diffuse reflectance
432 : // Long-wave (IR) slat properties
433 : Real64 SlatTransIR = 0.0; // Slat IR transmittance
434 : Real64 SlatFrontEmissIR = 0.0; // Slat front emissivity
435 : Real64 SlatBackEmissIR = 0.0; // Slat back emissivity
436 : // Some characteristics for blind thermal calculation
437 : Real64 BlindToGlassDist = 0.0; // Distance between window shade and adjacent glass (m)
438 : Real64 BlindTopOpeningMult = 0.0; // Area of air-flow opening at top of blind, expressed as a fraction
439 : // of the blind-to-glass opening area at the top of the blind
440 : Real64 BlindBottomOpeningMult = 0.0; // Area of air-flow opening at bottom of blind, expressed as a fraction
441 : // of the blind-to-glass opening area at the bottom of the blind
442 : Real64 BlindLeftOpeningMult = 0.0; // Area of air-flow opening at left side of blind, expressed as a fraction
443 : // of the blind-to-glass opening area at the left side of the blind
444 : Real64 BlindRightOpeningMult = 0.0; // Area of air-flow opening at right side of blind, expressed as a fraction
445 : // of the blind-to-glass opening area at the right side of the blind
446 : // Calculated blind properties
447 : // Blind solar properties
448 : Array2D<Real64> SolFrontBeamBeamTrans; // Blind solar front beam-beam transmittance vs.
449 : // profile angle, slat angle
450 : Array2D<Real64> SolFrontBeamBeamRefl; // Blind solar front beam-beam reflectance vs. profile angle,
451 : // slat angle (zero)
452 : Array2D<Real64> SolBackBeamBeamTrans; // Blind solar back beam-beam transmittance vs. profile angle,
453 : // slat angle
454 : Array2D<Real64> SolBackBeamBeamRefl; // Blind solar back beam-beam reflectance vs. profile angle,
455 : // slat angle (zero)
456 : Array2D<Real64> SolFrontBeamDiffTrans; // Blind solar front beam-diffuse transmittance
457 : // vs. profile angle, slat angle
458 : Array2D<Real64> SolFrontBeamDiffRefl; // Blind solar front beam-diffuse reflectance
459 : // vs. profile angle, slat angle
460 : Array2D<Real64> SolBackBeamDiffTrans; // Blind solar back beam-diffuse transmittance
461 : // vs. profile angle, slat angle
462 : Array2D<Real64> SolBackBeamDiffRefl; // Blind solar back beam-diffuse reflectance
463 : // vs. profile angle, slat angle
464 : Array1D<Real64> SolFrontDiffDiffTrans; // Blind solar front diffuse-diffuse transmittance
465 : // vs. slat angle
466 : Array1D<Real64> SolFrontDiffDiffTransGnd; // Blind ground solar front diffuse-diffuse transmittance
467 : // vs. slat angle
468 : Array1D<Real64> SolFrontDiffDiffTransSky; // Blind sky solar front diffuse-diffuse transmittance
469 : // vs. slat angle
470 : Array1D<Real64> SolFrontDiffDiffRefl; // Blind solar front diffuse-diffuse reflectance
471 : // vs. slat angle
472 : Array1D<Real64> SolFrontDiffDiffReflGnd; // Blind ground solar front diffuse-diffuse reflectance
473 : // vs. slat angle
474 : Array1D<Real64> SolFrontDiffDiffReflSky; // Blind sky solar front diffuse-diffuse reflectance
475 : // vs. slat angle
476 : Array1D<Real64> SolBackDiffDiffTrans; // Blind solar back diffuse-diffuse transmittance
477 : // vs. slat angle
478 : Array1D<Real64> SolBackDiffDiffRefl; // Blind solar back diffuse-diffuse reflectance
479 : // vs. slat angle
480 : Array2D<Real64> SolFrontBeamAbs; // Blind solar front beam absorptance vs. slat angle
481 : Array2D<Real64> SolBackBeamAbs; // Blind solar back beam absorptance vs. slat angle
482 : Array1D<Real64> SolFrontDiffAbs; // Blind solar front diffuse absorptance vs. slat angle
483 : Array1D<Real64> SolFrontDiffAbsGnd; // Blind ground solar front diffuse absorptance vs. slat angle
484 : Array1D<Real64> SolFrontDiffAbsSky; // Blind sky solar front diffuse absorptance vs. slat angle
485 : Array1D<Real64> SolBackDiffAbs; // Blind solar back diffuse absorptance vs. slat angle
486 : // Blind visible properties
487 : Array2D<Real64> VisFrontBeamBeamTrans; // Blind visible front beam-beam transmittance
488 : // vs. profile angle, slat angle
489 : Array2D<Real64> VisFrontBeamBeamRefl; // Blind visible front beam-beam reflectance
490 : // vs. profile angle, slat angle (zero)
491 : Array2D<Real64> VisBackBeamBeamTrans; // Blind visible back beam-beam transmittance
492 : // vs. profile angle, slat angle
493 : Array2D<Real64> VisBackBeamBeamRefl; // Blind visible back beam-beam reflectance
494 : // vs. profile angle, slat angle (zero)
495 : Array2D<Real64> VisFrontBeamDiffTrans; // Blind visible front beam-diffuse transmittance
496 : // vs. profile angle, slat angle
497 : Array2D<Real64> VisFrontBeamDiffRefl; // Blind visible front beam-diffuse reflectance
498 : // vs. profile angle, slat angle
499 : Array2D<Real64> VisBackBeamDiffTrans; // Blind visible back beam-diffuse transmittance
500 : // vs. profile angle, slat angle
501 : Array2D<Real64> VisBackBeamDiffRefl; // Blind visible back beam-diffuse reflectance
502 : // vs. profile angle, slat angle
503 : Array1D<Real64> VisFrontDiffDiffTrans; // Blind visible front diffuse-diffuse transmittance
504 : // vs. slat angle
505 : Array1D<Real64> VisFrontDiffDiffRefl; // Blind visible front diffuse-diffuse reflectance
506 : // vs. slat angle
507 : Array1D<Real64> VisBackDiffDiffTrans; // Blind visible back diffuse-diffuse transmittance
508 : // vs. slat angle
509 : Array1D<Real64> VisBackDiffDiffRefl; // Blind visible back diffuse-diffuse reflectance
510 : // vs. slat angle
511 : // Long-wave (IR) blind properties
512 : Array1D<Real64> IRFrontTrans; // Blind IR front transmittance vs. slat angle
513 : Array1D<Real64> IRFrontEmiss; // Blind IR front emissivity vs. slat angle
514 : Array1D<Real64> IRBackTrans; // Blind IR back transmittance vs. slat angle
515 : Array1D<Real64> IRBackEmiss; // Blind IR back emissivity vs. slat angle
516 :
517 : // Default Constructor
518 39 : WindowBlindProperties()
519 39 : : SolFrontBeamBeamTrans(MaxSlatAngs, MaxProfAngs, 0.0), SolFrontBeamBeamRefl(MaxSlatAngs, MaxProfAngs, 0.0),
520 39 : SolBackBeamBeamTrans(MaxSlatAngs, MaxProfAngs, 0.0), SolBackBeamBeamRefl(MaxSlatAngs, MaxProfAngs, 0.0),
521 39 : SolFrontBeamDiffTrans(MaxSlatAngs, MaxProfAngs, 0.0), SolFrontBeamDiffRefl(MaxSlatAngs, MaxProfAngs, 0.0),
522 39 : SolBackBeamDiffTrans(MaxSlatAngs, MaxProfAngs, 0.0), SolBackBeamDiffRefl(MaxSlatAngs, MaxProfAngs, 0.0),
523 39 : SolFrontDiffDiffTrans(MaxSlatAngs, 0.0), SolFrontDiffDiffTransGnd(MaxSlatAngs, 0.0), SolFrontDiffDiffTransSky(MaxSlatAngs, 0.0),
524 39 : SolFrontDiffDiffRefl(MaxSlatAngs, 0.0), SolFrontDiffDiffReflGnd(MaxSlatAngs, 0.0), SolFrontDiffDiffReflSky(MaxSlatAngs, 0.0),
525 39 : SolBackDiffDiffTrans(MaxSlatAngs, 0.0), SolBackDiffDiffRefl(MaxSlatAngs, 0.0), SolFrontBeamAbs(MaxSlatAngs, MaxProfAngs, 0.0),
526 39 : SolBackBeamAbs(MaxSlatAngs, MaxProfAngs, 0.0), SolFrontDiffAbs(MaxSlatAngs, 0.0), SolFrontDiffAbsGnd(MaxSlatAngs, 0.0),
527 39 : SolFrontDiffAbsSky(MaxSlatAngs, 0.0), SolBackDiffAbs(MaxSlatAngs, 0.0), VisFrontBeamBeamTrans(MaxSlatAngs, MaxProfAngs, 0.0),
528 39 : VisFrontBeamBeamRefl(MaxSlatAngs, MaxProfAngs, 0.0), VisBackBeamBeamTrans(MaxSlatAngs, MaxProfAngs, 0.0),
529 39 : VisBackBeamBeamRefl(MaxSlatAngs, MaxProfAngs, 0.0), VisFrontBeamDiffTrans(MaxSlatAngs, MaxProfAngs, 0.0),
530 39 : VisFrontBeamDiffRefl(MaxSlatAngs, MaxProfAngs, 0.0), VisBackBeamDiffTrans(MaxSlatAngs, MaxProfAngs, 0.0),
531 39 : VisBackBeamDiffRefl(MaxSlatAngs, MaxProfAngs, 0.0), VisFrontDiffDiffTrans(MaxSlatAngs, 0.0), VisFrontDiffDiffRefl(MaxSlatAngs, 0.0),
532 39 : VisBackDiffDiffTrans(MaxSlatAngs, 0.0), VisBackDiffDiffRefl(MaxSlatAngs, 0.0), IRFrontTrans(MaxSlatAngs, 0.0),
533 78 : IRFrontEmiss(MaxSlatAngs, 0.0), IRBackTrans(MaxSlatAngs, 0.0), IRBackEmiss(MaxSlatAngs, 0.0)
534 : {
535 39 : }
536 : };
537 :
538 : struct WindowComplexShade
539 : {
540 : // Members
541 : std::string Name; // Name for complex shade
542 : TARCOGParams::TARCOGLayerType LayerType =
543 : TARCOGParams::TARCOGLayerType::Invalid; // Layer type (OtherShadingType, Venetian, Woven, Perforated)
544 : Real64 Thickness = 0.0; // Layer thickness (m)
545 : Real64 Conductivity = 0.0; // Layer conductivity (W/m2K)
546 : Real64 IRTransmittance = 0.0; // IR Transmittance
547 : Real64 FrontEmissivity = 0.0; // Emissivity of front surface
548 : Real64 BackEmissivity = 0.0; // Emissivity of back surface
549 : Real64 TopOpeningMultiplier = 0.0; // Coverage percent for top opening (%)
550 : Real64 BottomOpeningMultiplier = 0.0; // Coverage percent for bottom opening (%)
551 : Real64 LeftOpeningMultiplier = 0.0; // Coverage percent for left opening (%)
552 : Real64 RightOpeningMultiplier = 0.0; // Coverage percent for right opening (%)
553 : Real64 FrontOpeningMultiplier = 0.0; // Coverage percent for front opening (%)
554 : Real64 SlatWidth = 0.0; // Slat width (m)
555 : Real64 SlatSpacing = 0.0; // Slat spacing (m)
556 : Real64 SlatThickness = 0.0; // Slat thickness (m)
557 : Real64 SlatAngle = 0.0; // Slat angle (deg)
558 : Real64 SlatConductivity = 0.0; // Slat conductivity (W/m2K)
559 : Real64 SlatCurve = 0.0; // Curvature radius of slat (if =0 then flat) (m)
560 : };
561 :
562 : struct WindowThermalModelParams
563 : {
564 : // Members
565 : std::string Name; // Window thermal model name
566 : TARCOGGassesParams::Stdrd CalculationStandard = TARCOGGassesParams::Stdrd::Invalid; // Tarcog calculation standard
567 : TARCOGParams::TARCOGThermalModel ThermalModel = TARCOGParams::TARCOGThermalModel::Invalid; // Tarcog thermal model
568 : Real64 SDScalar = 0.0; // SDScalar coefficient
569 : TARCOGParams::DeflectionCalculation DeflectionModel = TARCOGParams::DeflectionCalculation::Invalid; // Deflection model
570 : Real64 VacuumPressureLimit = 0.0; // Pressure limit at which it will be considered vacuum gas state
571 : Real64 InitialTemperature = 0.0; // Window(s) temperature in time of fabrication
572 : Real64 InitialPressure = 0.0; // Window(s) pressure in time of fabrication
573 : };
574 :
575 : int constexpr maxMixGases = 5;
576 :
577 : struct GasCoeffs
578 : {
579 : Real64 c0 = 0.0;
580 : Real64 c1 = 0.0;
581 : Real64 c2 = 0.0;
582 : };
583 :
584 : struct Gas
585 : {
586 : GasType type = GasType::Custom;
587 : GasCoeffs con = GasCoeffs();
588 : GasCoeffs vis = GasCoeffs();
589 : GasCoeffs cp = GasCoeffs();
590 : Real64 wght = 0.0;
591 : Real64 specHeatRatio = 0.0;
592 : };
593 :
594 : extern const std::array<Gas, 10> gases;
595 :
596 : struct MaterialGasMix : public MaterialBase
597 : {
598 : // up to 5 gases in a mixture [Window gas only]. It is defined as parameter (GasCoefs)
599 : int numGases = 0; // Number of gases in a window gas mixture
600 :
601 : std::array<Real64, maxMixGases> gasFracts = {0.0};
602 : std::array<Gas, maxMixGases> gases = {Gas()};
603 :
604 : GapVentType gapVentType = GapVentType::Sealed; // Gap Ven type for equivalent Layer window model
605 :
606 0 : virtual bool dummy()
607 : {
608 0 : return true;
609 : }
610 :
611 843 : MaterialGasMix() : MaterialBase()
612 : {
613 843 : group = Group::WindowGas;
614 843 : }
615 : };
616 :
617 : struct ScreenBmTransAbsRef
618 : {
619 : Real64 BmTrans = 0.0; // Beam solar transmittance (dependent on sun angle)
620 : // (this value can include scattering if the user so chooses)
621 : Real64 BmTransBack = 0.0; // Beam solar transmittance (dependent on sun angle) from back side of screen
622 : Real64 BmTransVis = 0.0; // Visible solar transmittance (dependent on sun angle)
623 : // (this value can include visible scattering if the user so chooses)
624 : Real64 DfTrans = 0.0; // Beam solar transmitted as diffuse radiation (dependent on sun angle)
625 : Real64 DfTransBack = 0.0; // Beam solar transmitted as diffuse radiation (dependent on sun angle) from back side
626 : Real64 DfTransVis = 0.0; // Visible solar transmitted as diffuse radiation (dependent on sun angle)
627 :
628 : // The following reflectance properties are dependent on sun angle:
629 : Real64 RefSolFront = 0.0; // Beam solar reflected as diffuse radiation when sun is in front of screen
630 : Real64 RefVisFront = 0.0; // Visible solar reflected as diffuse radiation when sun is in front of screen
631 : Real64 RefSolBack = 0.0; // Beam solar reflected as diffuse radiation when sun is in back of screen
632 : Real64 RefVisBack = 0.0; // Visible solar reflected as diffuse radiation when sun is in back of screen
633 : Real64 AbsSolFront = 0.0; // Front surface solar beam absorptance
634 : Real64 AbsSolBack = 0.0; // Back surface solar beam absorptance
635 : };
636 :
637 : #define PRECALC_INTERP_SCREEN
638 :
639 : constexpr int minDegResolution = 5;
640 :
641 : constexpr int maxIPhi = (Constant::Pi * Constant::RadToDeg / minDegResolution) + 1;
642 : constexpr int maxITheta = (Constant::Pi * Constant::RadToDeg / minDegResolution) + 1;
643 :
644 : struct MaterialScreen : public MaterialBase
645 : {
646 : Real64 diameterToSpacingRatio = 0.0; // ratio of screen material diameter to screen material spacing
647 :
648 : ScreenBeamReflectanceModel bmRefModel = ScreenBeamReflectanceModel::Invalid; // user specified method of accounting for scattered solar beam
649 :
650 : Real64 DfTrans = 0.0; // Back surface diffuse solar transmitted
651 : Real64 DfTransVis = 0.0; // Back surface diffuse visible solar transmitted
652 : Real64 DfRef = 0.0; // Back reflection of solar diffuse radiation
653 : Real64 DfRefVis = 0.0; // Back reflection of visible diffuse radiation
654 : Real64 DfAbs = 0.0; // Absorption of diffuse radiation
655 :
656 : Real64 ShadeRef = 0.0; // Screen assembly solar reflectance (user input adjusted for holes in screen)
657 : Real64 ShadeRefVis = 0.0; // Screen assembly visible reflectance (user input adjusted for holes in screen)
658 : Real64 CylinderRef = 0.0; // Screen material solar reflectance (user input, does not account for holes in screen)
659 : Real64 CylinderRefVis = 0.0; // Screen material visible reflectance (user input, does not account for holes in screen)
660 :
661 : int mapDegResolution = 0; // Resolution of azimuth and altitude angles to print in transmittance map
662 : Real64 dPhi = (Real64)minDegResolution * Constant::DegToRad; // phi increments (rad)
663 : Real64 dTheta = (Real64)minDegResolution * Constant::DegToRad; // theta increments (rad)
664 :
665 : std::array<std::array<ScreenBmTransAbsRef, maxITheta>, maxIPhi> btars;
666 :
667 : // These are shared with window shade and blind
668 : Real64 toGlassDist = 0.0; // Distance between window shade and adjacent glass (m)
669 : Real64 topOpeningMult = 0.0; // Area of air-flow opening at top of shade, expressed as a fraction
670 : // of the shade-to-glass opening area at the top of the shade
671 : Real64 bottomOpeningMult = 0.0; // Area of air-flow opening at bottom of shade, expressed as a fraction
672 : // of the shade-to-glass opening area at the bottom of the shade
673 : Real64 leftOpeningMult = 0.0; // Area of air-flow opening at left side of shade, expressed as a fraction
674 : // of the shade-to-glass opening area at the left side of the shade
675 : Real64 rightOpeningMult = 0.0; // Area of air-flow opening at right side of shade, expressed as a fraction
676 : // of the shade-to-glass opening area at the right side of the shade
677 : Real64 airFlowPermeability = 0.0; // The effective area of openings in the shade itself, expressed as a
678 : // fraction of the shade area
679 :
680 0 : virtual bool dummy()
681 : {
682 0 : return true;
683 : }
684 :
685 2 : MaterialScreen() : MaterialBase()
686 : {
687 2 : group = Group::Screen;
688 2 : }
689 : };
690 :
691 : void GetMaterialData(EnergyPlusData &state, bool &errorsFound); // set to true if errors found in input
692 : void GetVariableAbsorptanceInput(EnergyPlusData &state, bool &errorsFound);
693 :
694 : // Angles must be in radians
695 : void GetRelativePhiTheta(Real64 phiWin, Real64 thetaWin, Vector3<Real64> const &solcos, Real64 &phi, Real64 &theta);
696 : void NormalizePhiTheta(Real64 &phi, Real64 &theta);
697 : void GetPhiThetaIndices(Real64 phi, Real64 theta, Real64 dPhi, Real64 dTheta, int &iPhi1, int &iPhi2, int &iTheta1, int &iTheta2);
698 :
699 : void CalcScreenTransmittance(EnergyPlusData &state,
700 : MaterialScreen const *screen,
701 : Real64 phi, // Sun altitude relative to surface outward normal (rad)
702 : Real64 theta, // Sun azimuth relative to surface outward normal (rad)
703 : ScreenBmTransAbsRef &tar);
704 :
705 : } // namespace Material
706 :
707 : struct MaterialData : BaseGlobalStruct
708 : {
709 : EPVector<Material::MaterialBase *> Material;
710 : int TotMaterials = 0; // Total number of unique materials (layers) in this simulation
711 : int TotComplexShades = 0; // Total number of shading materials for complex fenestrations
712 :
713 : EPVector<Material::WindowBlindProperties> Blind;
714 : EPVector<Material::WindowComplexShade> ComplexShade;
715 : EPVector<Material::WindowThermalModelParams> WindowThermalModel;
716 :
717 796 : void init_state([[maybe_unused]] EnergyPlusData &state) override
718 : {
719 796 : }
720 :
721 0 : void clear_state() override
722 : {
723 0 : for (int i = 0; i < TotMaterials; ++i) {
724 0 : delete Material[i]; //
725 : }
726 0 : Material.deallocate();
727 0 : }
728 : };
729 :
730 : } // namespace EnergyPlus
731 :
732 : #endif
|