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 : // ObjexxFCL Headers
49 : #include <ObjexxFCL/Array1D.hh>
50 : #include <ObjexxFCL/Fmath.hh>
51 :
52 : // EnergyPlus Headers
53 : #include <EnergyPlus/DataGlobals.hh>
54 : #include <EnergyPlus/TARCOGCommon.hh>
55 : #include <EnergyPlus/TARCOGDeflection.hh>
56 : #include <EnergyPlus/TARCOGParams.hh>
57 :
58 : namespace EnergyPlus::TARCOGDeflection {
59 :
60 : // MODULE INFORMATION:
61 : // AUTHOR Simon Vidanovic
62 : // DATE WRITTEN October/22/2011
63 : // MODIFIED na
64 : // RE-ENGINEERED na
65 : // Revision: 7.0.02 (October 22, 2011)
66 : // - Initial setup
67 :
68 : // PURPOSE OF THIS MODULE:
69 : // A module which contains functions for deflection calculation
70 :
71 : // Using/Aliasing
72 : using namespace TARCOGParams;
73 : using namespace TARCOGCommon;
74 :
75 4036 : void PanesDeflection(DeflectionCalculation const DeflectionStandard,
76 : Real64 const W,
77 : Real64 const H,
78 : int const nlayer,
79 : Real64 const Pa,
80 : Real64 const Pini,
81 : Real64 const Tini,
82 : const Array1D<Real64> &PaneThickness,
83 : const Array1D<Real64> &NonDeflectedGapWidth,
84 : Array1D<Real64> &DeflectedGapWidthMax,
85 : Array1D<Real64> &DeflectedGapWidthMean,
86 : const Array1D<Real64> &PanelTemps,
87 : const Array1D<Real64> &YoungsMod,
88 : const Array1D<Real64> &PoissonsRat,
89 : Array1D<Real64> &LayerDeflection,
90 : int &nperr,
91 : std::string &ErrorMessage)
92 : {
93 : //***********************************************************************
94 : // PanesDeflection - calculates deflection of panes and recalculate gap
95 : // widths at maximal point of deflection
96 : //***********************************************************************
97 :
98 : // Argument array dimensioning
99 4036 : EP_SIZE_CHECK(PaneThickness, maxlay);
100 4036 : EP_SIZE_CHECK(NonDeflectedGapWidth, MaxGap);
101 4036 : EP_SIZE_CHECK(DeflectedGapWidthMax, MaxGap);
102 4036 : EP_SIZE_CHECK(DeflectedGapWidthMean, MaxGap);
103 4036 : EP_SIZE_CHECK(PanelTemps, maxlay2);
104 4036 : EP_SIZE_CHECK(YoungsMod, maxlay);
105 4036 : EP_SIZE_CHECK(PoissonsRat, maxlay);
106 4036 : EP_SIZE_CHECK(LayerDeflection, maxlay);
107 :
108 : // Localy used
109 4036 : Array1D<Real64> DCoeff(maxlay);
110 :
111 : // first calculate D coefficients since that will be necessary for any of selected standards
112 16144 : for (int i = 1; i <= nlayer; ++i) {
113 12108 : DCoeff(i) = YoungsMod(i) * pow_3(PaneThickness(i)) / (12 * (1 - pow_2(PoissonsRat(i))));
114 : }
115 4036 : if (DeflectionStandard == DeflectionCalculation::TEMPERATURE) {
116 2018 : DeflectionTemperatures(nlayer,
117 : W,
118 : H,
119 : Pa,
120 : Pini,
121 : Tini,
122 : NonDeflectedGapWidth,
123 : DeflectedGapWidthMax,
124 : DeflectedGapWidthMean,
125 : PanelTemps,
126 : DCoeff,
127 : LayerDeflection,
128 : nperr,
129 : ErrorMessage);
130 2018 : } else if (DeflectionStandard == DeflectionCalculation::GAP_WIDTHS) {
131 2018 : DeflectionWidths(nlayer, W, H, DCoeff, NonDeflectedGapWidth, DeflectedGapWidthMax, DeflectedGapWidthMean, LayerDeflection);
132 : } else { // including NO_DEFLECTION_CALCULATION
133 0 : return;
134 : }
135 4036 : }
136 :
137 2018 : void DeflectionTemperatures(int const nlayer,
138 : Real64 const W,
139 : Real64 const H,
140 : Real64 const Pa,
141 : Real64 const Pini,
142 : Real64 const Tini,
143 : const Array1D<Real64> &NonDeflectedGapWidth,
144 : Array1D<Real64> &DeflectedGapWidthMax,
145 : Array1D<Real64> &DeflectedGapWidthMean,
146 : const Array1D<Real64> &PanelTemps,
147 : Array1D<Real64> &DCoeff,
148 : Array1D<Real64> &LayerDeflection,
149 : int &nperr,
150 : std::string &ErrorMessage)
151 : {
152 : //***********************************************************************************************************
153 : // DeflectionTemperatures - calculates deflection of panes and recalculate gap
154 : // widths at maximal point of deflection based on gap pressures and temperatures
155 : //***********************************************************************************************************
156 :
157 : // Argument array dimensioning
158 2018 : EP_SIZE_CHECK(NonDeflectedGapWidth, MaxGap);
159 2018 : EP_SIZE_CHECK(DeflectedGapWidthMax, MaxGap);
160 2018 : EP_SIZE_CHECK(DeflectedGapWidthMean, MaxGap);
161 2018 : EP_SIZE_CHECK(PanelTemps, maxlay2);
162 2018 : EP_SIZE_CHECK(DCoeff, maxlay);
163 2018 : EP_SIZE_CHECK(LayerDeflection, maxlay);
164 :
165 : // Static constants
166 2018 : static Real64 const Pi_6(pow_6(Constant::Pi));
167 :
168 : // localy used
169 2018 : Array1D<Real64> DPressure(maxlay); // delta pressure at each glazing layer
170 2018 : Array1D<Real64> Vini(MaxGap);
171 2018 : Array1D<Real64> Vgap(MaxGap);
172 2018 : Array1D<Real64> Pgap(MaxGap);
173 2018 : Array1D<Real64> Tgap(MaxGap);
174 : Real64 MaxLDSum;
175 : Real64 MeanLDSum;
176 : Real64 Ratio;
177 :
178 : // calculate Vini for each gap
179 4036 : for (int i = 1; i <= nlayer - 1; ++i) {
180 2018 : Vini(i) = NonDeflectedGapWidth(i) * W * H;
181 : } // do i = 1, nlayer
182 :
183 2018 : MaxLDSum = LDSumMax(W, H);
184 2018 : MeanLDSum = LDSumMean(W, H);
185 2018 : Ratio = MeanLDSum / MaxLDSum;
186 :
187 : // calculate Vgap for each gap
188 2018 : Real64 const W_H_Ratio(W * H * Ratio);
189 4036 : for (int i = 1; i <= nlayer - 1; ++i) {
190 2018 : Vgap(i) = Vini(i) + W_H_Ratio * (LayerDeflection(i) - LayerDeflection(i + 1));
191 : } // do i = 1, nlayer
192 :
193 : // calculate Tgap for each gap
194 4036 : for (int i = 1; i <= nlayer - 1; ++i) {
195 2018 : int const j = 2 * i;
196 2018 : Tgap(i) = (PanelTemps(j) + PanelTemps(j + 1)) / 2;
197 : } // do i = 1, nlayer
198 :
199 4036 : for (int i = 1; i <= nlayer - 1; ++i) {
200 2018 : Pgap(i) = Pini * Vini(i) * Tgap(i) / (Tini * Vgap(i));
201 : } // do i = 1, nlayer
202 :
203 2018 : DPressure(1) = Pgap(1) - Pa;
204 2018 : if (nlayer > 1) {
205 2018 : DPressure(nlayer) = Pa - Pgap(nlayer - 1);
206 : }
207 :
208 2018 : for (int i = 2; i <= nlayer - 1; ++i) {
209 0 : DPressure(i) = Pgap(i) - Pgap(i - 1);
210 : } // do i = 1, nlayer
211 :
212 2018 : Real64 const deflection_fac(DeflectionRelaxation * MaxLDSum * 16);
213 6054 : for (int i = 1; i <= nlayer; ++i) {
214 4036 : LayerDeflection(i) += deflection_fac * DPressure(i) / (Pi_6 * DCoeff(i));
215 : }
216 :
217 4036 : for (int i = 1; i <= nlayer - 1; ++i) {
218 2018 : DeflectedGapWidthMax(i) = NonDeflectedGapWidth(i) + LayerDeflection(i) - LayerDeflection(i + 1);
219 2018 : if (DeflectedGapWidthMax(i) < 0.0) {
220 2018 : nperr = 2001; // glazing panes collapsed
221 2018 : ErrorMessage = "Glazing panes collapsed";
222 : }
223 : }
224 :
225 4036 : for (int i = 1; i <= nlayer - 1; ++i) {
226 2018 : DeflectedGapWidthMean(i) = NonDeflectedGapWidth(i) + Ratio * (DeflectedGapWidthMax(i) - NonDeflectedGapWidth(i));
227 : }
228 2018 : }
229 :
230 2018 : void DeflectionWidths(int const nlayer,
231 : Real64 const W,
232 : Real64 const H,
233 : Array1D<Real64> &DCoeff,
234 : const Array1D<Real64> &NonDeflectedGapWidth,
235 : const Array1D<Real64> &DeflectedGapWidthMax,
236 : Array1D<Real64> &DeflectedGapWidthMean,
237 : Array1D<Real64> &LayerDeflection)
238 : {
239 : // Argument array dimensioning
240 2018 : EP_SIZE_CHECK(DCoeff, maxlay);
241 2018 : EP_SIZE_CHECK(NonDeflectedGapWidth, MaxGap);
242 2018 : EP_SIZE_CHECK(DeflectedGapWidthMax, MaxGap);
243 2018 : EP_SIZE_CHECK(DeflectedGapWidthMean, MaxGap);
244 2018 : EP_SIZE_CHECK(LayerDeflection, maxlay);
245 :
246 2018 : Real64 nominator = 0.0;
247 8072 : for (int i = 1; i <= nlayer - 1; ++i) {
248 6054 : Real64 SumL = 0.0;
249 18162 : for (int j = i; j <= nlayer - 1; ++j) {
250 12108 : SumL += NonDeflectedGapWidth(j) - DeflectedGapWidthMax(j);
251 : }
252 6054 : nominator += SumL * DCoeff(i);
253 : }
254 :
255 2018 : Real64 denominator = 0.0;
256 10090 : for (int i = 1; i <= nlayer; ++i) {
257 8072 : denominator += DCoeff(i);
258 : }
259 :
260 2018 : LayerDeflection(nlayer) = nominator / denominator;
261 :
262 8072 : for (int i = nlayer - 1; i >= 1; --i) {
263 6054 : LayerDeflection(i) = DeflectedGapWidthMax(i) - NonDeflectedGapWidth(i) + LayerDeflection(i + 1);
264 : }
265 :
266 2018 : Real64 MaxLDSum = LDSumMax(W, H);
267 2018 : Real64 MeanLDSum = LDSumMean(W, H);
268 2018 : Real64 Ratio = MeanLDSum / MaxLDSum;
269 :
270 8072 : for (int i = 1; i <= nlayer - 1; ++i) {
271 6054 : DeflectedGapWidthMean(i) = NonDeflectedGapWidth(i) + Ratio * (DeflectedGapWidthMax(i) - NonDeflectedGapWidth(i));
272 : }
273 2018 : }
274 :
275 : } // namespace EnergyPlus::TARCOGDeflection
|