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 TARCOGMain_hh_INCLUDED
49 : #define TARCOGMain_hh_INCLUDED
50 :
51 : // ObjexxFCL Headers
52 : #include <ObjexxFCL/Array2A.hh>
53 :
54 : // EnergyPlus Headers
55 : #include <EnergyPlus/EnergyPlus.hh>
56 : #include <EnergyPlus/TARCOGGassesParams.hh>
57 : #include <EnergyPlus/TARCOGParams.hh>
58 :
59 : namespace EnergyPlus {
60 :
61 : namespace TARCOGMain {
62 :
63 : void TARCOG90(EnergyPlusData &state,
64 : int nlayer, // Number of layers (glass + SD)
65 : int iwd, // Wind direction:
66 : Real64 &tout, // Outdoor temperature [K]
67 : Real64 &tind, // Indoor temperature [K]
68 : Real64 &trmin, // Indoor mean radiant temperature [K]
69 : Real64 wso, // Outdoor wind speed [m/s]
70 : Real64 wsi, // Inside forced air speed [m/s]
71 : Real64 dir, // Direct solar radiation [W/m2]
72 : Real64 outir, // IR radiance of window's exterior surround [W/m2]
73 : int isky, // Flag for sky temperature(Tsky) and sky emittance(esky)
74 : Real64 tsky, // Night sky temperature [K]
75 : Real64 &esky, // Effective night sky emittance
76 : Real64 fclr, // Fraction of sky that is clear
77 : Real64 VacuumPressure, // maximal pressure for gas to be considered as vacuum
78 : Real64 &VacuumMaxGapThickness, // maximum allowed thickness without producing warning message
79 : TARCOGParams::DeflectionCalculation CalcDeflection, // Deflection calculation flag:
80 : Real64 Pa, // Atmospheric (outside/inside) pressure (used onlu if CalcDeflection = 1)
81 : Real64 Pini, // Initial presssure at time of fabrication (used only if CalcDeflection = 1)
82 : Real64 Tini, // Initial temperature at time of fabrication (used only if CalcDeflection = 1)
83 : Array1D<Real64> &gap, // Vector of gap widths [m]
84 : Array1D<Real64> &GapDefMax, // Vector of gap widths in deflected state. It will be used as input
85 : Array1D<Real64> &thick, // Vector of glazing layer thicknesses [m]
86 : Array1D<Real64> &scon, // Vector of conductivities of each glazing layer [W/mK]
87 : const Array1D<Real64> &YoungsMod, // Youngs Modulus coefficients used in deflection calculations
88 : const Array1D<Real64> &PoissonsRat, // Poissons Ratio coefficients used in deflection calculations
89 : const Array1D<Real64> &tir, // Vector of IR transmittances of each surface
90 : const Array1D<Real64> &emis, // Vector of IR emittances of each surface
91 : Real64 totsol, // Total solar transmittance of the IGU
92 : Real64 tilt, // Window tilt [degrees]
93 : const Array1D<Real64> &asol, // Vector of Absorbed solar energy fractions for each layer
94 : Real64 height, // IGU cavity height
95 : Real64 heightt, // Window height
96 : Real64 width, // Window width
97 : const Array1D<Real64> &presure, // Vector of gas pressures in gaps [N/m2]
98 : Array2A_int iprop, // Matrix of gas codes - see mgas definition
99 : Array2A<Real64> frct, // Matrix of mass percentages in gap mixtures
100 : Array2A<Real64> xgcon, // Matrix of constants for gas conductivity calc
101 : Array2A<Real64> xgvis, // Matrix of constants for gas dynamic viscosity calc
102 : Array2A<Real64> xgcp, // Matrix of constants for gas specific heat calc at constant pressure
103 : const Array1D<Real64> &xwght, // Vector of Molecular weights for gasses
104 : const Array1D<Real64> &gama, // Vector of spefic heat ration for low pressure calc
105 : const Array1D_int &nmix, // Vector of number of gasses in gas mixture of each gap
106 : const Array1D_int &SupportPillar, // Shows whether or not gap have support pillar
107 : const Array1D<Real64> &PillarSpacing, // Pillar spacing for each gap (used in case there is support pillar)
108 : const Array1D<Real64> &PillarRadius, // Pillar radius for each gap (used in case there is support pillar)
109 : Array1D<Real64> &theta, // Vector of average temperatures of glazing surfaces [K]
110 : Array1D<Real64> &LayerDef, // Vector of layers deflection. [m]
111 : Array1D<Real64> &q, // Vector of various heat fluxes [W/m2]
112 : Array1D<Real64> &qv, // Vector of heat fluxes to each gap by ventillation [W/m2]
113 : Real64 &ufactor, // Center of glass U-value [W/m2 K]
114 : Real64 &sc, // Shading Coefficient
115 : Real64 &hflux, // Net heat flux between room and window [W/m2]
116 : Real64 &hcin, // Indoor convective surface heat transfer coefficient [W/m2 K]
117 : Real64 &hcout, // Outdoor convective surface heat transfer coefficient [W/m2 K]
118 : Real64 &hrin, // Indoor radiative surface heat transfer coefficient [W/m2 K]
119 : Real64 &hrout, // Outdoor radiative surface heat transfer coefficient [W/m2 K]
120 : Real64 &hin, // Indoor combined film coefficient (if non-zero) [W/m2K]
121 : Real64 &hout, // Outdoor combined film coefficient (if non-zero) [W/m2K]
122 : Array1D<Real64> &hcgas, // Convective part of gap effective conductivity (including in and out)
123 : Array1D<Real64> &hrgas, // Radiative part of gap effective conductivity (including in and out)
124 : Real64 &shgc, // Solar heat gain coefficient - per ISO 15099
125 : int &nperr, // Error code
126 : std::string &ErrorMessage, // To store error message from tarcog execution
127 : Real64 &shgct, // Solar heat gain coefficient - per old procedure
128 : Real64 &tamb, // Outdoor environmental temperature [K]
129 : Real64 &troom, // Indoor environmental temperature [K]
130 : const Array1D_int &ibc, // Vector of boundary condition flags (ibc(1) - outdoor, ibc(2) - indoor
131 : const Array1D<Real64> &Atop, // Vector with areas of top openings - between SD layers and top of
132 : const Array1D<Real64> &Abot, // Vector with areas of bottom openings - between SD layers and
133 : const Array1D<Real64> &Al, // Vector with areas of left-hand side openings - between SD layers and
134 : const Array1D<Real64> &Ar, // Vector of areas of right-hand side openings - between SD layers and
135 : const Array1D<Real64> &Ah, // Vector of total areas of holes for each SD [m2]
136 : const Array1D<Real64> &SlatThick, // Thickness of the slat material [m]
137 : const Array1D<Real64> &SlatWidth, // Slat width [m]
138 : const Array1D<Real64> &SlatAngle, // Slat tilt angle [deg]
139 : const Array1D<Real64> &SlatCond, // Conductivity of the slat material [W/m.K]
140 : const Array1D<Real64> &SlatSpacing, // Distance between slats [m]
141 : const Array1D<Real64> &SlatCurve, // Curvature radius of the slat [m]
142 : const Array1D<Real64> &vvent, // Vector of velocities for forced ventilation, for each gap, and for
143 : const Array1D<Real64> &tvent, // Vector of temperatures of ventilation gas for forced ventilation,
144 : const Array1D<TARCOGParams::TARCOGLayerType> &LayerType, // Glazing layer type flag
145 : const Array1D_int &nslice, // Vector of numbers of slices in a laminated glazing layers
146 : const Array1D<Real64> &LaminateA, // Left-hand side array for creating slice equations
147 : const Array1D<Real64> &LaminateB, // Right-hand side array for creating slice equations
148 : const Array1D<Real64> &sumsol, // Array of absorbed solar energy fractions for each laminated
149 : Array1D<Real64> &hg, // Gas conductance of the glazing cavity [W/m2 K]
150 : Array1D<Real64> &hr, // Radiation conductance of the glazing cavity [W/m2 K]
151 : Array1D<Real64> &hs, // Thermal conductance of the glazing cavity [W/m2 K]
152 : Real64 &he, // External heat transfer coefficient [W/m2 K] - EN673 and ISO 10292 procedure
153 : Real64 &hi, // Internal heat transfer coefficient [W/m2 K] - EN673 and ISO 10292 procedure
154 : Array1D<Real64> &Ra, // Vector of Rayleigh numbers, for each gap
155 : Array1D<Real64> &Nu, // Vector of Nusselt numbers, for each gap
156 : TARCOGGassesParams::Stdrd standard, // Calculation standard switch:
157 : TARCOGParams::TARCOGThermalModel ThermalMod, // Thermal model:
158 : int Debug_mode, // Switch for debug output files:
159 : std::string const &Debug_dir, // Target directory for debug files
160 : std::string const &Debug_file, // File name template for debug files
161 : int win_ID, // ID of window (passed by W6)
162 : int igu_ID, // ID of the IGU (passed by W6)
163 : Real64 &ShadeEmisRatioOut, // Ratio of modified to glass emissivity at the outermost glazing surface
164 : Real64 &ShadeEmisRatioIn, // Ratio of modified to glass emissivity at the innermost glazing surface
165 : Real64 &ShadeHcRatioOut, // Ratio of modified to unshaded Hc at the outermost glazing surface
166 : Real64 &ShadeHcRatioIn, // Ratio of modified to unshaded Hc at the innermost glazing surface
167 : Real64 &HcUnshadedOut, // Hc value at outermost glazing surface of an unshaded subsystem [W/m2 K]
168 : Real64 &HcUnshadedIn, // Hc value at innermost glazing surface of an unshaded subsystem [W/m2 K]
169 : Array1D<Real64> &Keff, // Vector of keff values for gaps [W/m.K]
170 : Array1D<Real64> &ShadeGapKeffConv, // Vector of convective keff values for areas above/below
171 : Real64 SDScalar, // Factor of Venetian SD layer contribution to convection
172 : int SHGCCalc, // SHGC calculation switch:
173 : int &NumOfIterations, // Number of iterations for reacing solution
174 : Real64 edgeGlCorrFac // Edge of glass correction factor
175 : );
176 : }
177 : struct TARCOGMainData : BaseGlobalStruct
178 : {
179 :
180 : Array1D<Real64> sconTemp = Array1D<Real64>(TARCOGParams::maxlay);
181 : Array1D<Real64> thickTemp = Array1D<Real64>(TARCOGParams::maxlay);
182 :
183 : // Internaly used
184 : bool converged = false; // used for convergence check in case of deflection calculations
185 : Array1D<Real64> told = Array1D<Real64>(TARCOGParams::maxlay2);
186 : Array1D<Real64> CurGap = Array1D<Real64>(TARCOGParams::MaxGap);
187 : Array1D<Real64> GapDefMean = Array1D<Real64>(TARCOGParams::MaxGap);
188 :
189 796 : void init_state([[maybe_unused]] EnergyPlusData &state) override
190 : {
191 796 : }
192 :
193 0 : void clear_state() override
194 : {
195 0 : sconTemp = Array1D<Real64>(TARCOGParams::maxlay);
196 0 : thickTemp = Array1D<Real64>(TARCOGParams::maxlay);
197 0 : converged = false;
198 0 : told = Array1D<Real64>(TARCOGParams::maxlay2);
199 0 : CurGap = Array1D<Real64>(TARCOGParams::MaxGap);
200 0 : GapDefMean = Array1D<Real64>(TARCOGParams::MaxGap);
201 0 : };
202 : };
203 : } // namespace EnergyPlus
204 :
205 : #endif
|