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/string.functions.hh>
50 : #include <ObjexxFCL/time.hh>
51 :
52 : // EnergyPlus Headers
53 : #include <EnergyPlus/Data/EnergyPlusData.hh>
54 : #include <EnergyPlus/DataGlobals.hh>
55 : #include <EnergyPlus/FileSystem.hh>
56 : #include <EnergyPlus/TARCOGCommon.hh>
57 : #include <EnergyPlus/TARCOGGassesParams.hh>
58 : #include <EnergyPlus/TARCOGOutput.hh>
59 : #include <EnergyPlus/TARCOGParams.hh>
60 :
61 : namespace EnergyPlus::TARCOGOutput {
62 :
63 : // MODULE INFORMATION:
64 : // AUTHOR Simon Vidanovic
65 : // DATE WRITTEN June/22/2010
66 : // MODIFIED na
67 : // RE-ENGINEERED na
68 :
69 : // Revision: 6.0.36 (June/22/2010)
70 : // - Initial setup, extracted from TARCOG.for
71 :
72 : // PURPOSE OF THIS MODULE:
73 : // A module which contains debug dump subroutines
74 :
75 : // Using/Aliasing
76 : using namespace TARCOGCommon;
77 : using namespace TARCOGGassesParams;
78 : using namespace TARCOGParams;
79 :
80 0 : void WriteInputArguments(EnergyPlusData &state,
81 : InputOutputFile &InArgumentsFile,
82 : const fs::path &DBGD,
83 : Real64 const tout,
84 : Real64 const tind,
85 : Real64 const trmin,
86 : Real64 const wso,
87 : int const iwd,
88 : Real64 const wsi,
89 : Real64 const dir,
90 : Real64 const outir,
91 : int const isky,
92 : Real64 const tsky,
93 : Real64 const esky,
94 : Real64 const fclr,
95 : Real64 const VacuumPressure,
96 : Real64 const VacuumMaxGapThickness,
97 : const Array1D_int &ibc,
98 : Real64 const hout,
99 : Real64 const hin,
100 : TARCOGGassesParams::Stdrd const standard,
101 : TARCOGThermalModel const ThermalMod,
102 : Real64 const SDScalar,
103 : Real64 const height,
104 : Real64 const heightt,
105 : Real64 const width,
106 : Real64 const tilt,
107 : Real64 const totsol,
108 : int const nlayer,
109 : const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
110 : const Array1D<Real64> &thick,
111 : const Array1D<Real64> &scon,
112 : const Array1D<Real64> &asol,
113 : const Array1D<Real64> &tir,
114 : const Array1D<Real64> &emis,
115 : const Array1D<Real64> &Atop,
116 : const Array1D<Real64> &Abot,
117 : const Array1D<Real64> &Al,
118 : const Array1D<Real64> &Ar,
119 : const Array1D<Real64> &Ah,
120 : const Array1D<Real64> &SlatThick,
121 : const Array1D<Real64> &SlatWidth,
122 : const Array1D<Real64> &SlatAngle,
123 : const Array1D<Real64> &SlatCond,
124 : const Array1D<Real64> &SlatSpacing,
125 : const Array1D<Real64> &SlatCurve,
126 : const Array1D_int &nslice,
127 : const Array1D<Real64> &LaminateA,
128 : const Array1D<Real64> &LaminateB,
129 : const Array1D<Real64> &sumsol,
130 : const Array1D<Real64> &gap,
131 : const Array1D<Real64> &vvent,
132 : const Array1D<Real64> &tvent,
133 : const Array1D<Real64> &presure,
134 : const Array1D_int &nmix,
135 : Array2A_int const iprop,
136 : Array2A<Real64> const frct,
137 : Array2A<Real64> const xgcon,
138 : Array2A<Real64> const xgvis,
139 : Array2A<Real64> const xgcp,
140 : const Array1D<Real64> &xwght)
141 : {
142 :
143 : // Using/Aliasing
144 : // Argument array dimensioning
145 0 : EP_SIZE_CHECK(ibc, 2);
146 0 : EP_SIZE_CHECK(LayerType, maxlay);
147 0 : EP_SIZE_CHECK(thick, maxlay);
148 0 : EP_SIZE_CHECK(scon, maxlay);
149 0 : EP_SIZE_CHECK(asol, maxlay);
150 0 : EP_SIZE_CHECK(tir, maxlay2);
151 0 : EP_SIZE_CHECK(emis, maxlay2);
152 0 : EP_SIZE_CHECK(Atop, maxlay);
153 0 : EP_SIZE_CHECK(Abot, maxlay);
154 0 : EP_SIZE_CHECK(Al, maxlay);
155 0 : EP_SIZE_CHECK(Ar, maxlay);
156 0 : EP_SIZE_CHECK(Ah, maxlay);
157 0 : EP_SIZE_CHECK(SlatThick, maxlay);
158 0 : EP_SIZE_CHECK(SlatWidth, maxlay);
159 0 : EP_SIZE_CHECK(SlatAngle, maxlay);
160 0 : EP_SIZE_CHECK(SlatCond, maxlay);
161 0 : EP_SIZE_CHECK(SlatSpacing, maxlay);
162 0 : EP_SIZE_CHECK(SlatCurve, maxlay);
163 0 : EP_SIZE_CHECK(nslice, maxlay);
164 0 : EP_SIZE_CHECK(LaminateA, maxlay);
165 0 : EP_SIZE_CHECK(LaminateB, maxlay);
166 0 : EP_SIZE_CHECK(sumsol, maxlay);
167 0 : EP_SIZE_CHECK(gap, maxlay);
168 0 : EP_SIZE_CHECK(vvent, maxlay1);
169 0 : EP_SIZE_CHECK(tvent, maxlay1);
170 0 : EP_SIZE_CHECK(presure, maxlay1);
171 0 : EP_SIZE_CHECK(nmix, maxlay1);
172 0 : iprop.dim(maxgas, maxlay1);
173 0 : frct.dim(maxgas, maxlay1);
174 0 : xgcon.dim(3, maxgas);
175 0 : xgvis.dim(3, maxgas);
176 0 : xgcp.dim(3, maxgas);
177 0 : EP_SIZE_CHECK(xwght, maxgas);
178 :
179 : // Locals
180 0 : Array1D_int DATE_TIME(8);
181 0 : Array1D_string real_CLOCK(3);
182 :
183 : int i;
184 : int j;
185 :
186 : // Formats
187 : static constexpr std::string_view Format_1000("TARCOG input arguments:\n");
188 : static constexpr std::string_view Format_1001("TARCOG debug output, {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
189 : static constexpr std::string_view Format_1002(" WindowID:{:8} - Not specified\n");
190 : static constexpr std::string_view Format_1003(" WindowID:{:8} \n");
191 : static constexpr std::string_view Format_1006(" IGUID: {:8} - Not specified\n");
192 : static constexpr std::string_view Format_1007(" IGUID: {:8} \n");
193 : static constexpr std::string_view Format_1005("Simulation parameters:\n");
194 : static constexpr std::string_view Format_1010(" Tout = {:10.6F} K ( {:7.3F} deg C) - Outdoor temperature\n");
195 : static constexpr std::string_view Format_1015(" Tint = {:10.6F} K ( {:7.3F} deg C) - Indoor temperature\n");
196 : static constexpr std::string_view Format_1020(" Trmin = {:10.6F} K ( {:7.3F} deg C) - Indoor mean radiant temp.\n");
197 : static constexpr std::string_view Format_1030(" wso = {:7.3F} - Outdoor wind speed [m/s]\n");
198 : static constexpr std::string_view Format_1032(" iwd = 0 - Wind direction - windward\n");
199 : static constexpr std::string_view Format_1033(" iwd = 1 - Wind direction - leeward\n");
200 : static constexpr std::string_view Format_1035(" wsi = {:7.3F} - Indoor forced air speed [m/s]\n");
201 : static constexpr std::string_view Format_1040(" dir = {:8.3F} - Direct solar radiation [W/m^2]\n");
202 : static constexpr std::string_view Format_1041(" outir = {:8.3F} - IR radiation [W/m^2]\n");
203 : static constexpr std::string_view Format_1045(" isky = {:3} - Flag for handling tsky, esky\n");
204 : static constexpr std::string_view Format_1050(" tsky = {:10.6F} K ( {:7.3F} deg C) - Night sky temperature\n");
205 : static constexpr std::string_view Format_1055(" esky = {:7.3F} - Effective night sky emmitance\n");
206 : static constexpr std::string_view Format_1060(" fclr = {:7.3F} - Fraction of sky that is clear\n");
207 : static constexpr std::string_view Format_1061(" VacuumPressure = {:7.3F} - maximum allowed gas pressure to be considered as vacuum\n");
208 : static constexpr std::string_view Format_1062(
209 : " VacuumMaxGapThickness = {:7.3F} - maximum allowed vacuum gap thickness with support pillar\n");
210 : static constexpr std::string_view Format_1063(" ibc(1) = {:3} - Outdoor BC switch\n");
211 : static constexpr std::string_view Format_1065(" hout = {:9.5F} - Outdoor film coeff. [W/m^2-K]\n");
212 : static constexpr std::string_view Format_1066(" ibc(2) = {:3} - Indoor BC switch\n");
213 : static constexpr std::string_view Format_1068(" hin = {:9.5F} - Indoor film coeff. [W/m^2-K]\n");
214 : static constexpr std::string_view Format_1070(" standard = {:3} - ISO 15099 calc. standard\n");
215 : static constexpr std::string_view Format_1071(" standard = {:3} - EN 673/ISO 10292 Declared calc. standard\n");
216 : static constexpr std::string_view Format_1072(" standard = {:3} - EN 673/ISO 10292 Design calc. standard\n");
217 : static constexpr std::string_view Format_10731(" ThermalMod = {:3} - ISO15099 thermal model\n");
218 : static constexpr std::string_view Format_10732(" ThermalMod = {:3} - Scaled Cavity Width (SCW) thermal model\n");
219 : static constexpr std::string_view Format_10733(" ThermalMod = {:3} - Convective Scalar Model (CSM) thermal model\n");
220 : static constexpr std::string_view Format_10740(" SDScalar = {:7.5F} - Factor of Venetian SD layer contribution to convection\n\n (only if "
221 : "ThermalModel = 2, otherwise ignored)\n");
222 : static constexpr std::string_view Format_1075("IGU parameters:\n");
223 : static constexpr std::string_view Format_1076(" height = {:10.6F} - IGU cavity height [m]\n");
224 : static constexpr std::string_view Format_1077(" heightt = {:10.6F} - Total window height [m]\n");
225 : static constexpr std::string_view Format_1078(" width = {:10.6F} - Window width [m]\n");
226 : static constexpr std::string_view Format_1079(" tilt = {:7.3F} - Window tilt [deg]\n");
227 : static constexpr std::string_view Format_1080(" totsol = {:10.6F} - Total solar transmittance of IGU\n");
228 : static constexpr std::string_view Format_1081(" nlayer = {:3} - Number of glazing layers\n");
229 : static constexpr std::string_view Format_1089("IGU layers list:\n");
230 : static constexpr std::string_view Format_10802(" Layer{:3} : {:1} - Specular layer - Monolyhtic Glass\n");
231 : static constexpr std::string_view Format_10803(" Layer{:3} : {:1} - Laminated Glass\n");
232 : static constexpr std::string_view Format_10804(" Layer{:3} : {:1} - Horizontal Venetian Blind\n");
233 : static constexpr std::string_view Format_10805(" Layer{:3} : {:1} - Woven Shade\n");
234 : static constexpr std::string_view Format_10806(" Layer{:3} : {:1} - Diffuse Shade\n");
235 : static constexpr std::string_view Format_10809(" Layer{:3} : {:1} - UNKNOWN TYPE!\n");
236 : static constexpr std::string_view Format_10810(" Layer{:3} : {:1} - Vertical Venetian Blind\n");
237 : static constexpr std::string_view Format_1085(" nslice = {:3} - Number of slices\n");
238 : static constexpr std::string_view Format_1090(" thick = {:10.6F} - Thickness [m]\n");
239 : static constexpr std::string_view Format_1091(" scon = {:10.6F} - Thermal conductivity [W/m-K]\n");
240 : static constexpr std::string_view Format_1092(" asol = {:12.8F} - Absorbed solar energy [W/m^2]\n");
241 : static constexpr std::string_view Format_1093(" tir = {:12.8F} - IR transmittance\n");
242 : static constexpr std::string_view Format_1094(" emis1 = {:10.6F} - IR outdoor emissivity\n");
243 : static constexpr std::string_view Format_1095(" emis2 = {:10.6F} - IR indoor emissivity\n");
244 : static constexpr std::string_view Format_1100(" Atop = {:10.6F} - Top opening area [m^2]\n");
245 : static constexpr std::string_view Format_1101(" Abot = {:10.6F} - Bottom opening area [m^2]\n");
246 : static constexpr std::string_view Format_1102(" Al = {:10.6F} - Left opening area [m^2]\n");
247 : static constexpr std::string_view Format_1103(" Ar = {:10.6F} - Right opening area [m^2]\n");
248 : static constexpr std::string_view Format_1105(" Ah = {:10.6F} - Total area of holes [m^2]\n");
249 : static constexpr std::string_view Format_11051(" SlatThick = {:10.6F} - Slat thickness [m]\n");
250 : static constexpr std::string_view Format_11052(" SlatWidth = {:10.6F} - Slat width [m]\n");
251 : static constexpr std::string_view Format_11053(" SlatAngle = {:10.6F} - Slat tilt angle [deg]\n");
252 : static constexpr std::string_view Format_11054(" SlatCond = {:10.6F} - Conductivity of the slat material [W/m.K]\n");
253 : static constexpr std::string_view Format_11055(" SlatSpacing = {:10.6F} - Distance between slats [m]\n");
254 : static constexpr std::string_view Format_11056(" SlatCurve = {:10.6F} - Curvature radius of the slat [m]\n");
255 : static constexpr std::string_view Format_1110("IGU Gaps:\n");
256 : static constexpr std::string_view Format_1111(" Gap {:2}:\n");
257 : static constexpr std::string_view Format_11110(" Outdoor space:\n");
258 : static constexpr std::string_view Format_11111(" Indoor space:\n");
259 : static constexpr std::string_view Format_1112(" gap = {:12.5F} - Gap width [m]\n");
260 : static constexpr std::string_view Format_1113(" presure = {:12.5F} - Gas pressure [N/m^2]\n");
261 : static constexpr std::string_view Format_1114(" nmix = {:6} - Num. of gasses in a gas mix\n");
262 : static constexpr std::string_view Format_1115(" Gas {:1}: {} {:6.2F} %\n");
263 : static constexpr std::string_view Format_1120(" vvent = {:12.5F} - Forced ventilation speed [m/s]\n");
264 : static constexpr std::string_view Format_1121(" tvent = {:12.5F} - Temperature in connected gap [K]\n");
265 : static constexpr std::string_view Format_1130(" Gas mix coefficients - gas {:1}, {:6.2F} %\n");
266 : static constexpr std::string_view Format_1131(" gcon = {:11.6F}, {:11.6F}, {:11.6F} - Conductivity\n");
267 : static constexpr std::string_view Format_1132(" gvis = {:11.6F}, {:11.6F}, {:11.6F} - Dynamic viscosity\n");
268 : static constexpr std::string_view Format_1133(" gcp = {:11.6F}, {:11.6F}, {:11.6F} - Spec.heat @ const.P\n");
269 : static constexpr std::string_view Format_1134(" wght = {:11.6F} - Molecular weight\n");
270 : static constexpr std::string_view Format_1198("===== ===== ===== ===== ===== ===== ===== ===== ===== ===== =====\n");
271 :
272 : // bi...Create debug file w/ Tarcog's input arguments:
273 :
274 : // File is not open and nothing cannot be written
275 0 : if (!InArgumentsFile.good()) return;
276 :
277 0 : date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
278 :
279 0 : print(InArgumentsFile, "\n");
280 0 : print(InArgumentsFile, Format_1001, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
281 0 : print(InArgumentsFile, "\n");
282 :
283 0 : if (state.dataTARCOGOutputs->winID == -1) {
284 0 : print(InArgumentsFile, Format_1002, state.dataTARCOGOutputs->winID);
285 : } else {
286 0 : print(InArgumentsFile, Format_1003, state.dataTARCOGOutputs->winID);
287 : }
288 :
289 0 : if (state.dataTARCOGOutputs->iguID == -1) {
290 0 : print(InArgumentsFile, Format_1006, state.dataTARCOGOutputs->iguID);
291 : } else {
292 0 : print(InArgumentsFile, Format_1007, state.dataTARCOGOutputs->iguID);
293 : }
294 :
295 0 : print(InArgumentsFile, " Debug dir: {}\n", DBGD);
296 :
297 0 : print(InArgumentsFile, "\n");
298 0 : print(InArgumentsFile, Format_1000);
299 0 : print(InArgumentsFile, "\n");
300 0 : print(InArgumentsFile, Format_1005);
301 0 : print(InArgumentsFile, Format_1010, tout, tout - Constant::Kelvin);
302 0 : print(InArgumentsFile, Format_1015, tind, tind - Constant::Kelvin);
303 0 : print(InArgumentsFile, Format_1020, trmin, trmin - Constant::Kelvin);
304 0 : print(InArgumentsFile, Format_1030, wso);
305 0 : if (iwd == 0) print(InArgumentsFile, Format_1032); // windward
306 0 : if (iwd == 1) print(InArgumentsFile, Format_1033); // leeward
307 0 : print(InArgumentsFile, Format_1035, wsi);
308 0 : print(InArgumentsFile, Format_1040, dir);
309 0 : print(InArgumentsFile, Format_1041, outir);
310 0 : print(InArgumentsFile, Format_1045, isky);
311 0 : print(InArgumentsFile, Format_1050, tsky, tsky - Constant::Kelvin);
312 0 : print(InArgumentsFile, Format_1055, esky);
313 0 : print(InArgumentsFile, Format_1060, fclr);
314 0 : print(InArgumentsFile, Format_1061, VacuumPressure);
315 0 : print(InArgumentsFile, Format_1062, VacuumMaxGapThickness);
316 0 : print(InArgumentsFile, Format_1063, ibc(1));
317 0 : print(InArgumentsFile, Format_1065, hout);
318 0 : print(InArgumentsFile, Format_1066, ibc(2));
319 0 : print(InArgumentsFile, Format_1068, hin);
320 :
321 0 : if (standard == TARCOGGassesParams::Stdrd::ISO15099) print(InArgumentsFile, Format_1070, standard);
322 0 : if (standard == TARCOGGassesParams::Stdrd::EN673) print(InArgumentsFile, Format_1071, standard);
323 0 : if (standard == TARCOGGassesParams::Stdrd::EN673Design) print(InArgumentsFile, Format_1072, standard);
324 :
325 0 : if (ThermalMod == TARCOGThermalModel::ISO15099) {
326 0 : print(InArgumentsFile, Format_10731, ThermalMod);
327 0 : print(InArgumentsFile, Format_10740, SDScalar);
328 : }
329 :
330 0 : if (ThermalMod == TARCOGThermalModel::SCW) {
331 0 : print(InArgumentsFile, Format_10732, ThermalMod);
332 0 : print(InArgumentsFile, Format_10740, SDScalar);
333 : }
334 :
335 0 : if (ThermalMod == TARCOGThermalModel::CSM) {
336 0 : print(InArgumentsFile, Format_10733, ThermalMod);
337 0 : print(InArgumentsFile, Format_10740, SDScalar);
338 : }
339 :
340 0 : print(InArgumentsFile, "\n");
341 :
342 0 : print(InArgumentsFile, Format_1075);
343 0 : print(InArgumentsFile, Format_1076, height);
344 0 : print(InArgumentsFile, Format_1077, heightt);
345 0 : print(InArgumentsFile, Format_1078, width);
346 0 : print(InArgumentsFile, Format_1079, tilt);
347 0 : print(InArgumentsFile, Format_1080, totsol);
348 0 : print(InArgumentsFile, Format_1081, nlayer);
349 0 : print(InArgumentsFile, "\n");
350 :
351 0 : print(InArgumentsFile, Format_1089);
352 0 : for (i = 1; i <= nlayer; ++i) {
353 0 : switch (LayerType(i)) {
354 0 : case TARCOGLayerType::DIFFSHADE: { // Diffuse Shade
355 0 : print(InArgumentsFile, Format_10806, i, LayerType(i));
356 0 : } break;
357 0 : case TARCOGLayerType::WOVSHADE: { // Woven Shade
358 0 : print(InArgumentsFile, Format_10805, i, LayerType(i));
359 0 : } break;
360 0 : case TARCOGLayerType::VENETBLIND_HORIZ: { // Horizontal venetian blind
361 0 : print(InArgumentsFile, Format_10804, i, LayerType(i));
362 0 : } break;
363 0 : case TARCOGLayerType::VENETBLIND_VERT: { // Vertical venetian blind
364 0 : print(InArgumentsFile, Format_10810, i, LayerType(i));
365 0 : } break;
366 0 : case TARCOGLayerType::SPECULAR: { // Specular layer
367 0 : if (nslice(i) <= 1) {
368 0 : print(InArgumentsFile, Format_10802, i, LayerType(i)); // Monolithic glass
369 : } else {
370 0 : print(InArgumentsFile, Format_10803, i, LayerType(i)); // Laminated layer
371 : }
372 0 : } break;
373 0 : default: {
374 0 : print(InArgumentsFile, Format_10809, i, LayerType(i));
375 0 : } break;
376 : }
377 :
378 0 : print(InArgumentsFile, Format_1090, thick(i));
379 0 : print(InArgumentsFile, Format_1091, scon(i));
380 0 : print(InArgumentsFile, Format_1092, asol(i));
381 0 : print(InArgumentsFile, Format_1093, tir(2 * i - 1));
382 0 : print(InArgumentsFile, Format_1094, emis(2 * i - 1));
383 0 : print(InArgumentsFile, Format_1095, emis(2 * i));
384 :
385 0 : if (LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ || LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) { // SD layer
386 0 : print(InArgumentsFile, Format_1100, Atop(i));
387 0 : print(InArgumentsFile, Format_1101, Abot(i));
388 0 : print(InArgumentsFile, Format_1102, Al(i));
389 0 : print(InArgumentsFile, Format_1103, Ar(i));
390 0 : print(InArgumentsFile, Format_1105, Ah(i));
391 :
392 0 : print(InArgumentsFile, Format_11051, SlatThick(i));
393 0 : print(InArgumentsFile, Format_11052, SlatWidth(i));
394 0 : print(InArgumentsFile, Format_11053, SlatAngle(i));
395 0 : print(InArgumentsFile, Format_11054, SlatCond(i));
396 0 : print(InArgumentsFile, Format_11055, SlatSpacing(i));
397 0 : print(InArgumentsFile, Format_11056, SlatCurve(i));
398 : }
399 :
400 0 : if (nslice(i) > 1) { // SD layer
401 0 : print(InArgumentsFile, Format_1085, nslice(i));
402 0 : print(InArgumentsFile, Format_1085, LaminateA(i));
403 0 : print(InArgumentsFile, Format_1085, LaminateB(i));
404 0 : print(InArgumentsFile, Format_1085, sumsol(i));
405 : }
406 : } // i - layers
407 :
408 0 : print(InArgumentsFile, "\n");
409 :
410 0 : print(InArgumentsFile, Format_1110);
411 :
412 0 : for (i = 1; i <= nlayer + 1; ++i) { // loop through gaps:
413 0 : if ((i > 1) && (i <= nlayer)) print(InArgumentsFile, Format_1111, i - 1);
414 0 : if (i == 1) print(InArgumentsFile, Format_11110);
415 0 : if (i == nlayer + 1) print(InArgumentsFile, Format_11111);
416 0 : if ((i > 1) && (i <= nlayer)) print(InArgumentsFile, Format_1112, gap(i - 1));
417 0 : print(InArgumentsFile, Format_1113, presure(i));
418 0 : if ((i > 1) && (i <= nlayer)) {
419 0 : print(InArgumentsFile, Format_1120, vvent(i));
420 : }
421 0 : if ((i > 1) && (i <= nlayer)) {
422 0 : print(InArgumentsFile, Format_1121, tvent(i));
423 : }
424 0 : print(InArgumentsFile, Format_1114, nmix(i));
425 :
426 0 : for (j = 1; j <= nmix(i); ++j) {
427 : // if (iprop(i, j).eq.1) write(InArgumentsFile, 1115) iprop(i, j), ' ' 100*frct(i, j) ! Air
428 0 : print(InArgumentsFile, Format_1115, iprop(j, i), ' ', 100 * frct(j, i)); // gas
429 : // if (iprop(i, j).eq.2) write(InArgumentsFile, 1116) iprop(i, j), 100*frct(i, j) ! Argon
430 : // if (iprop(i, j).eq.3) write(InArgumentsFile, 1117) iprop(i, j), 100*frct(i, j) ! Krypton
431 : // if (iprop(i, j).eq.4) write(InArgumentsFile, 1118) iprop(i, j), 100*frct(i, j) ! Xenon
432 0 : print(InArgumentsFile, Format_1130, iprop(j, i), 100 * frct(j, i));
433 0 : print(InArgumentsFile, Format_1131, xgcon(1, iprop(j, i)), xgcon(2, iprop(j, i)), xgcon(3, iprop(j, i)));
434 0 : print(InArgumentsFile, Format_1132, xgvis(1, iprop(j, i)), xgvis(2, iprop(j, i)), xgvis(3, iprop(j, i)));
435 0 : print(InArgumentsFile, Format_1133, xgcp(1, iprop(j, i)), xgcp(2, iprop(j, i)), xgcp(3, iprop(j, i)));
436 0 : print(InArgumentsFile, Format_1134, xwght(iprop(j, i)));
437 : } // - j - one mix
438 : } // i - gas loop
439 :
440 0 : print(InArgumentsFile, "\n");
441 0 : print(InArgumentsFile, Format_1198);
442 0 : }
443 :
444 0 : void WriteModifiedArguments(InputOutputFile &InArgumentsFile,
445 : [[maybe_unused]] fs::path const &DBGD,
446 : Real64 const esky,
447 : Real64 const trmout,
448 : Real64 const trmin,
449 : Real64 const ebsky,
450 : Real64 const ebroom,
451 : Real64 const Gout,
452 : Real64 const Gin,
453 : int const nlayer,
454 : const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
455 : const Array1D_int &nmix,
456 : Array2A<Real64> const frct,
457 : const Array1D<Real64> &thick,
458 : const Array1D<Real64> &scon,
459 : const Array1D<Real64> &gap,
460 : Array2A<Real64> const xgcon,
461 : Array2A<Real64> const xgvis,
462 : Array2A<Real64> const xgcp,
463 : const Array1D<Real64> &xwght)
464 : {
465 :
466 : // Using/Aliasing
467 : // Argument array dimensioning
468 0 : EP_SIZE_CHECK(LayerType, maxlay);
469 0 : EP_SIZE_CHECK(nmix, maxlay1);
470 0 : frct.dim(maxgas, maxlay1);
471 0 : EP_SIZE_CHECK(thick, maxlay);
472 0 : EP_SIZE_CHECK(scon, maxlay);
473 0 : EP_SIZE_CHECK(gap, MaxGap);
474 0 : xgcon.dim(3, maxgas);
475 0 : xgvis.dim(3, maxgas);
476 0 : xgcp.dim(3, maxgas);
477 0 : EP_SIZE_CHECK(xwght, maxgas);
478 :
479 : // Locals
480 : int i;
481 : int j;
482 :
483 : // Formats
484 : static constexpr std::string_view Format_1014("Adjusted input arguments:\n");
485 : static constexpr std::string_view Format_1013(" Gass coefficients:\n");
486 : static constexpr std::string_view Format_1016(" Trmout = {:10.6F} K ( {:7.3F} deg C) - Outdoor mean radiant temp.\n");
487 : static constexpr std::string_view Format_1017(" Gout = {:10.6F} \n");
488 : static constexpr std::string_view Format_1018(" Gin = {:10.6F} \n");
489 : static constexpr std::string_view Format_1019(" Ebsky = {:10.6F} \n");
490 : static constexpr std::string_view Format_10191(" Ebroom = {:10.6F} \n");
491 : static constexpr std::string_view Format_1020(" Trmin = {:10.6F} K ( {:7.3F} deg C) - Indoor mean radiant temp.\n");
492 : static constexpr std::string_view Format_1055(" esky = {:7.3F} - Effective night sky emmitance\n");
493 : static constexpr std::string_view Format_1084(" Layer{:3} : {:1} - Venetian Blind\n");
494 : static constexpr std::string_view Format_1090(" thick = {:10.6F} - Thickness [m]\n");
495 : static constexpr std::string_view Format_1091(" scon = {:10.6F} - Thermal conductivity [W/m-K]\n");
496 : static constexpr std::string_view Format_1130(" Gas mix coefficients - gas {:1}, {:6.2F} %\n");
497 : static constexpr std::string_view Format_1131(" gcon = {:11.6F}, {:11.6F}, {:11.6F} - Conductivity\n");
498 : static constexpr std::string_view Format_1132(" gvis = {:11.6F}, {:11.6F}, {:11.6F} - Dynamic viscosity\n");
499 : static constexpr std::string_view Format_1133(" gcp = {:11.6F}, {:11.6F}, {:11.6F} - Spec.heat @ const.P\n");
500 : static constexpr std::string_view Format_1134(" wght = {:11.6F} - Molecular weight\n");
501 : static constexpr std::string_view Format_1111(" Gap {:2}:\n");
502 : static constexpr std::string_view Format_1112(" Gap width: {:11.8F}\n");
503 : static constexpr std::string_view Format_11110(" Outdoor space:\n");
504 : static constexpr std::string_view Format_11111(" Indoor space:\n");
505 : static constexpr std::string_view Format_1198("===== ===== ===== ===== ===== ===== ===== ===== ===== ===== =====\n");
506 :
507 0 : print(InArgumentsFile, "\n");
508 0 : print(InArgumentsFile, Format_1014);
509 0 : print(InArgumentsFile, "\n");
510 0 : print(InArgumentsFile, Format_1055, esky);
511 0 : print(InArgumentsFile, Format_1016, trmout, trmout - Constant::Kelvin);
512 0 : print(InArgumentsFile, Format_1020, trmin, trmin - Constant::Kelvin);
513 0 : print(InArgumentsFile, Format_1019, ebsky);
514 0 : print(InArgumentsFile, Format_10191, ebroom);
515 0 : print(InArgumentsFile, Format_1017, Gout);
516 0 : print(InArgumentsFile, Format_1018, Gin);
517 0 : print(InArgumentsFile, "\n");
518 :
519 0 : for (i = 1; i <= nlayer; ++i) {
520 0 : if ((TARCOGLayerType)LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ ||
521 0 : (TARCOGLayerType)LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) { // SD layer
522 0 : print(InArgumentsFile, Format_1084, i, LayerType(i));
523 0 : print(InArgumentsFile, Format_1090, thick(i));
524 0 : print(InArgumentsFile, Format_1091, scon(i));
525 : }
526 : }
527 0 : print(InArgumentsFile, "\n");
528 :
529 0 : print(InArgumentsFile, Format_1013);
530 0 : for (i = 1; i <= nlayer + 1; ++i) { // loop through gaps:
531 0 : if ((i > 1) && (i <= nlayer)) print(InArgumentsFile, Format_1111, i - 1);
532 0 : if ((i > 1) && (i <= nlayer)) print(InArgumentsFile, Format_1112, gap(i - 1));
533 0 : if (i == 1) print(InArgumentsFile, Format_11110);
534 0 : if (i == nlayer + 1) print(InArgumentsFile, Format_11111);
535 0 : for (j = 1; j <= nmix(i); ++j) {
536 0 : print(InArgumentsFile, Format_1130, j, 100 * frct(j, i));
537 0 : print(InArgumentsFile, Format_1131, xgcon(1, j), xgcon(2, j), xgcon(3, j));
538 0 : print(InArgumentsFile, Format_1132, xgvis(1, j), xgvis(2, j), xgvis(3, j));
539 0 : print(InArgumentsFile, Format_1133, xgcp(1, j), xgcp(2, j), xgcp(3, j));
540 0 : print(InArgumentsFile, Format_1134, xwght(j));
541 : } // j - gas mix
542 : } // i - gaps
543 0 : print(InArgumentsFile, "\n");
544 0 : print(InArgumentsFile, Format_1198);
545 0 : }
546 :
547 0 : void WriteOutputArguments(InputOutputFile &OutArgumentsFile,
548 : [[maybe_unused]] fs::path const &DBGD,
549 : int const nlayer,
550 : Real64 const tamb,
551 : const Array1D<Real64> &q,
552 : const Array1D<Real64> &qv,
553 : const Array1D<Real64> &qcgas,
554 : const Array1D<Real64> &qrgas,
555 : const Array1D<Real64> &theta,
556 : const Array1D<Real64> &vfreevent,
557 : const Array1D<Real64> &vvent,
558 : const Array1D<Real64> &Keff,
559 : const Array1D<Real64> &ShadeGapKeffConv,
560 : Real64 const troom,
561 : Real64 const ufactor,
562 : Real64 const shgc,
563 : Real64 const sc,
564 : Real64 const hflux,
565 : Real64 const shgct,
566 : Real64 const hcin,
567 : Real64 const hrin,
568 : Real64 const hcout,
569 : Real64 const hrout,
570 : const Array1D<Real64> &Ra,
571 : const Array1D<Real64> &Nu,
572 : const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
573 : const Array1D<Real64> &Ebf,
574 : const Array1D<Real64> &Ebb,
575 : const Array1D<Real64> &Rf,
576 : const Array1D<Real64> &Rb,
577 : Real64 const ebsky,
578 : Real64 const Gout,
579 : Real64 const ebroom,
580 : Real64 const Gin,
581 : Real64 const ShadeEmisRatioIn,
582 : Real64 const ShadeEmisRatioOut,
583 : Real64 const ShadeHcRatioIn,
584 : Real64 const ShadeHcRatioOut,
585 : Real64 const HcUnshadedIn,
586 : Real64 const HcUnshadedOut,
587 : const Array1D<Real64> &hcgas,
588 : const Array1D<Real64> &hrgas,
589 : Real64 const AchievedErrorTolerance,
590 : int const NumOfIter)
591 : {
592 :
593 : // Using/Aliasing
594 : // Argument array dimensioning
595 0 : EP_SIZE_CHECK(q, maxlay3);
596 0 : EP_SIZE_CHECK(qv, maxlay1);
597 0 : EP_SIZE_CHECK(qcgas, maxlay1);
598 0 : EP_SIZE_CHECK(qrgas, maxlay1);
599 0 : EP_SIZE_CHECK(theta, maxlay2);
600 0 : EP_SIZE_CHECK(vfreevent, maxlay1);
601 0 : EP_SIZE_CHECK(vvent, maxlay1);
602 0 : EP_SIZE_CHECK(Keff, maxlay);
603 0 : EP_SIZE_CHECK(ShadeGapKeffConv, MaxGap);
604 0 : EP_SIZE_CHECK(Ra, maxlay);
605 0 : EP_SIZE_CHECK(Nu, maxlay);
606 0 : EP_SIZE_CHECK(LayerType, maxlay);
607 0 : EP_SIZE_CHECK(Ebf, maxlay);
608 0 : EP_SIZE_CHECK(Ebb, maxlay);
609 0 : EP_SIZE_CHECK(Rf, maxlay);
610 0 : EP_SIZE_CHECK(Rb, maxlay);
611 0 : EP_SIZE_CHECK(hcgas, maxlay);
612 0 : EP_SIZE_CHECK(hrgas, maxlay);
613 :
614 : // Locals
615 0 : Array1D_int DATE_TIME(8);
616 0 : Array1D_string real_CLOCK(3);
617 :
618 : int i;
619 :
620 : // Formats
621 : static constexpr std::string_view Format_2000("TARCOG calculation results - {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
622 : static constexpr std::string_view Format_2120(" Ufactor = {:12.6F}\n");
623 : static constexpr std::string_view Format_2130(" SHGC = {:12.6F}\n");
624 : static constexpr std::string_view Format_2131(" SHGC_OLD = {:12.6F}\n");
625 : static constexpr std::string_view Format_2132(" SC = {:12.6F}\n");
626 : static constexpr std::string_view Format_2140(" hcin = {:10.6F} hrin = {:10.6F} hin = {:10.6F}\n");
627 : static constexpr std::string_view Format_2150(" hcout = {:10.6F} hrout = {:10.6F} hout = {:10.6F}\n");
628 : static constexpr std::string_view Format_2155(" Ra({:1}) ={:15.6F} Nu({:1}) ={:12.6F}\n");
629 : static constexpr std::string_view Format_2160(" hcgas({:1}) ={:15.6F} hrgas({:1}) ={:24.6F}\n");
630 : static constexpr std::string_view Format_2170(" hflux = {:12.6F}\n");
631 : static constexpr std::string_view Format_2105(" Tamb ={:11.6F} K ( {:7.3F} deg C)\n");
632 : static constexpr std::string_view Format_2110(" ----------------- ------------------ Theta{:2} ={:11.6F} K ( {:7.3F} deg C)\n");
633 : static constexpr std::string_view Format_2111(
634 : " \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "
635 : "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Theta{:2} ={:11.6F} K ( {:7.3F} "
636 : "deg C)\n");
637 : static constexpr std::string_view Format_2112(" +++++++++++++++++ ++++++++++++++++++ Theta{:2} ={:11.6F} K ( {:7.3F} deg C)\n");
638 : static constexpr std::string_view Format_2115(" Troom ={:11.6F} K ( {:7.3F} deg C)\n");
639 : static constexpr std::string_view Format_2180(" qout ={:12.5F}\n");
640 : static constexpr std::string_view Format_2190(" | qpane{:2} ={:12.5F} |\n");
641 : static constexpr std::string_view Format_2195(" | qpane{:2} ={:12.5F} | keffc{:2} ={:11.6F}\n");
642 : static constexpr std::string_view Format_2199(" | qlayer{:2} ={:12.5F} |\n");
643 : static constexpr std::string_view Format_2210(" qin ={:11.6F}\n");
644 : static constexpr std::string_view Format_2300(" q{:2} ={:12.5F}\n");
645 : static constexpr std::string_view Format_2320(" qv{:2} ={:12.5F}\n");
646 : static constexpr std::string_view Format_2321(" airspd{:2} ={:12.5F} keff{:2} ={:12.5F}\n");
647 : static constexpr std::string_view Format_2322(" qc{:2} ={:12.5F} qr{:2} ={:12.5F}\n");
648 : static constexpr std::string_view Format_2330(" ShadeEmisRatioIn ={:11.6F} ShadeEmisRatioOut ={:11.6F}\n");
649 : static constexpr std::string_view Format_2331(" ShadeHcRatioIn ={:11.6F} ShadeHcRatioOut ={:11.6F}\n");
650 : static constexpr std::string_view Format_2332(" HcUnshadedIn ={:11.6F} HcUnshadedOut ={:11.6F}\n");
651 : static constexpr std::string_view Format_2350("Heat Flux Flow and Temperatures of Layer Surfaces:\n");
652 : static constexpr std::string_view Format_2351("Basic IGU properties:\n");
653 : static constexpr std::string_view Format_4205(" Ebsky ={:11.6F} [W/m2], Gout ={:11.6F} [W/m2]\n");
654 : static constexpr std::string_view Format_4215(" Ebroom ={:11.6F} [W/m2], Gin ={:11.6F} [W/m2]\n");
655 : static constexpr std::string_view Format_4110(" Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
656 : static constexpr std::string_view Format_4111(" ----------------- ------------------\n");
657 : static constexpr std::string_view Format_4112(" Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
658 : static constexpr std::string_view Format_4113(" \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "
659 : "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n");
660 : static constexpr std::string_view Format_4114(" Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
661 : static constexpr std::string_view Format_4115(" +++++++++++++++++ ++++++++++++++++++\n");
662 : static constexpr std::string_view Format_4116(" Ef{:2} ={:11.6F} [W/m2], Rf{:2} ={:11.6F} [W/m2]\n");
663 : static constexpr std::string_view Format_4117(" ooooooooooooooooo oooooooooooooooooo\n");
664 : static constexpr std::string_view Format_4120(" Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
665 : static constexpr std::string_view Format_4121(" ----------------- ------------------\n");
666 : static constexpr std::string_view Format_4122(" Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
667 : static constexpr std::string_view Format_4123(" \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ "
668 : "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n");
669 : static constexpr std::string_view Format_4124(" Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
670 : static constexpr std::string_view Format_4125(" +++++++++++++++++ ++++++++++++++++++\n");
671 : static constexpr std::string_view Format_4126(" Eb{:2} ={:11.6F} [W/m2], Rb{:2} ={:11.6F} [W/m2]\n");
672 : static constexpr std::string_view Format_4127(" ooooooooooooooooo oooooooooooooooooo\n");
673 : static constexpr std::string_view Format_4190(" | |\n");
674 : static constexpr std::string_view Format_4350("Energy balances on Layer Surfaces:\n");
675 :
676 0 : date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
677 0 : print(OutArgumentsFile, "\n");
678 0 : print(OutArgumentsFile, Format_2000, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
679 0 : print(OutArgumentsFile, "\n");
680 0 : print(OutArgumentsFile, Format_2350);
681 0 : print(OutArgumentsFile, "\n");
682 0 : print(OutArgumentsFile, Format_2105, tamb, tamb - Constant::Kelvin);
683 0 : print(OutArgumentsFile, Format_2180, q(1));
684 :
685 : // bi Write out layer properties:
686 0 : for (i = 1; i <= nlayer; ++i) {
687 0 : switch (LayerType(i)) {
688 0 : case TARCOGLayerType::SPECULAR: { // Specular layer
689 0 : print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
690 0 : print(OutArgumentsFile, Format_2190, i, q(2 * i));
691 0 : print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
692 0 : } break;
693 0 : case TARCOGLayerType::VENETBLIND_HORIZ:
694 : case TARCOGLayerType::VENETBLIND_VERT: { // Venetian blind
695 0 : print(OutArgumentsFile, Format_2111, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
696 0 : print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i));
697 0 : print(OutArgumentsFile, Format_2111, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
698 0 : } break;
699 0 : case TARCOGLayerType::WOVSHADE: { // Venetian blind
700 0 : print(OutArgumentsFile, Format_2112, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
701 0 : print(OutArgumentsFile, Format_2195, i, q(2 * i), i, ShadeGapKeffConv(i));
702 0 : print(OutArgumentsFile, Format_2112, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
703 0 : } break;
704 0 : case TARCOGLayerType::DIFFSHADE: { // Venetian blind
705 0 : print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
706 0 : print(OutArgumentsFile, Format_2190, i, q(2 * i));
707 0 : print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
708 0 : } break;
709 0 : default: {
710 0 : print(OutArgumentsFile, Format_2110, 2 * i - 1, theta(2 * i - 1), theta(2 * i - 1) - Constant::Kelvin);
711 0 : print(OutArgumentsFile, Format_2199, i, q(2 * i));
712 0 : print(OutArgumentsFile, Format_2110, 2 * i, theta(2 * i), theta(2 * i) - Constant::Kelvin);
713 0 : } break;
714 : }
715 :
716 : // bi Write out gap properties:
717 0 : if (i != nlayer) {
718 0 : print(OutArgumentsFile, Format_2300, i, q(2 * i + 1));
719 0 : print(OutArgumentsFile, Format_2320, i, qv(i + 1));
720 0 : if (vvent(i + 1) == 0) {
721 0 : print(OutArgumentsFile, Format_2321, i, vfreevent(i + 1), i, Keff(i));
722 : } else {
723 0 : if (i > 1) {
724 0 : print(OutArgumentsFile, Format_2321, i, vvent(i + 1), i, Keff(i - 1));
725 : // Autodesk:BoundsViolation Keff(i-1) @ i=1: Fixed in 8.2 by surrounding if block
726 : }
727 : }
728 0 : print(OutArgumentsFile, Format_2322, i, qcgas(i + 1), i, qrgas(i + 1));
729 : } else {
730 0 : print(OutArgumentsFile, Format_2210, q(2 * i + 1));
731 : }
732 : } // i - layers
733 :
734 0 : print(OutArgumentsFile, Format_2115, troom, troom - Constant::Kelvin);
735 :
736 0 : print(OutArgumentsFile, "\n");
737 :
738 : // Simon: Write energy balances on layer surfaces
739 0 : print(OutArgumentsFile, Format_4350);
740 0 : print(OutArgumentsFile, "\n");
741 0 : print(OutArgumentsFile, Format_4205, ebsky, Gout);
742 0 : print(OutArgumentsFile, "\n");
743 :
744 0 : for (i = 1; i <= nlayer; ++i) {
745 0 : switch (LayerType(i)) {
746 0 : case TARCOGLayerType::SPECULAR: { // Specular layer
747 0 : print(OutArgumentsFile, Format_4110, i, Ebf(i), i, Rf(i));
748 0 : print(OutArgumentsFile, Format_4111);
749 0 : print(OutArgumentsFile, Format_4190);
750 0 : print(OutArgumentsFile, Format_4121);
751 0 : print(OutArgumentsFile, Format_4120, i, Ebb(i), i, Rb(i));
752 0 : } break;
753 0 : case TARCOGLayerType::VENETBLIND_HORIZ:
754 : case TARCOGLayerType::VENETBLIND_VERT: { // Venetian blind
755 0 : print(OutArgumentsFile, Format_4112, i, Ebf(i), i, Rf(i));
756 0 : print(OutArgumentsFile, Format_4113);
757 0 : print(OutArgumentsFile, Format_4190);
758 0 : print(OutArgumentsFile, Format_4123);
759 0 : print(OutArgumentsFile, Format_4122, i, Ebb(i), i, Rb(i));
760 0 : } break;
761 0 : case TARCOGLayerType::WOVSHADE: { // Venetian blind
762 0 : print(OutArgumentsFile, Format_4114, i, Ebf(i), i, Rf(i));
763 0 : print(OutArgumentsFile, Format_4115);
764 0 : print(OutArgumentsFile, Format_4190);
765 0 : print(OutArgumentsFile, Format_4125);
766 0 : print(OutArgumentsFile, Format_4124, i, Ebb(i), i, Rb(i));
767 0 : } break;
768 0 : case TARCOGLayerType::DIFFSHADE: {
769 0 : print(OutArgumentsFile, Format_4116, i, Ebf(i), i, Rf(i));
770 0 : print(OutArgumentsFile, Format_4117);
771 0 : print(OutArgumentsFile, Format_4190);
772 0 : print(OutArgumentsFile, Format_4127);
773 0 : print(OutArgumentsFile, Format_4126, i, Ebb(i), i, Rb(i));
774 0 : } break;
775 0 : default: {
776 0 : print(OutArgumentsFile, Format_4110, i, Ebf(i), i, Rf(i));
777 0 : print(OutArgumentsFile, Format_4111);
778 0 : print(OutArgumentsFile, Format_4190);
779 0 : print(OutArgumentsFile, Format_4121);
780 0 : print(OutArgumentsFile, Format_4120, i, Ebb(i), i, Rb(i));
781 0 : } break;
782 : }
783 0 : print(OutArgumentsFile, "\n");
784 : }
785 :
786 0 : print(OutArgumentsFile, Format_4215, ebroom, Gin);
787 :
788 0 : print(OutArgumentsFile, "\n");
789 0 : print(OutArgumentsFile, Format_2351);
790 0 : print(OutArgumentsFile, "\n");
791 0 : print(OutArgumentsFile, Format_2120, ufactor);
792 0 : print(OutArgumentsFile, Format_2130, shgc);
793 0 : print(OutArgumentsFile, "\n");
794 0 : print(OutArgumentsFile, Format_2132, sc);
795 0 : print(OutArgumentsFile, Format_2170, hflux);
796 0 : print(OutArgumentsFile, "\n");
797 0 : print(OutArgumentsFile, Format_2131, shgct);
798 0 : print(OutArgumentsFile, "\n");
799 0 : print(OutArgumentsFile, Format_2140, hcin, hrin, hcin + hrin);
800 0 : print(OutArgumentsFile, Format_2150, hcout, hrout, hcout + hrout);
801 :
802 0 : print(OutArgumentsFile, "\n");
803 0 : for (i = 1; i <= nlayer - 1; ++i) {
804 0 : print(OutArgumentsFile, Format_2155, i, Ra(i), i, Nu(i));
805 : }
806 0 : print(OutArgumentsFile, "\n");
807 0 : print(OutArgumentsFile, Format_2330, ShadeEmisRatioIn, ShadeEmisRatioOut);
808 0 : print(OutArgumentsFile, Format_2331, ShadeHcRatioIn, ShadeHcRatioOut);
809 0 : print(OutArgumentsFile, Format_2332, HcUnshadedIn, HcUnshadedOut);
810 :
811 0 : print(OutArgumentsFile, "\n");
812 0 : for (i = 2; i <= nlayer; ++i) {
813 0 : print(OutArgumentsFile, Format_2160, i, hcgas(i), i, hrgas(i));
814 : }
815 :
816 0 : print(OutArgumentsFile, "\n");
817 0 : print(OutArgumentsFile, " Error Tolerance = {:12.6E}\n", AchievedErrorTolerance);
818 :
819 0 : print(OutArgumentsFile, "\n");
820 0 : print(OutArgumentsFile, " Number of Iterations = {}\n", NumOfIter);
821 0 : }
822 :
823 0 : void WriteOutputEN673(InputOutputFile &OutArgumentsFile,
824 : [[maybe_unused]] fs::path const &DBGD,
825 : int const nlayer,
826 : Real64 const ufactor,
827 : Real64 const hout,
828 : Real64 const hin,
829 : const Array1D<Real64> &Ra,
830 : const Array1D<Real64> &Nu,
831 : const Array1D<Real64> &hg,
832 : const Array1D<Real64> &hr,
833 : const Array1D<Real64> &hs,
834 : [[maybe_unused]] int &nperr)
835 : {
836 :
837 : // Argument array dimensioning
838 0 : EP_SIZE_CHECK(Ra, maxlay);
839 0 : EP_SIZE_CHECK(Nu, maxlay);
840 0 : EP_SIZE_CHECK(hg, maxlay);
841 0 : EP_SIZE_CHECK(hr, maxlay);
842 0 : EP_SIZE_CHECK(hs, maxlay);
843 :
844 0 : Array1D_int DATE_TIME(8);
845 0 : Array1D_string real_CLOCK(3);
846 :
847 : int i;
848 :
849 : // Formats
850 : static constexpr std::string_view Format_2000("TARCOG calculation results - {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
851 : static constexpr std::string_view Format_2351("Basic IGU properties:\n");
852 : static constexpr std::string_view Format_2120(" Ufactor = {:12.6F}\n");
853 : static constexpr std::string_view Format_2220(" he = {:8.4F}, hi = {:8.4F}\n");
854 : static constexpr std::string_view Format_2155(" Ra({:1}) ={:15.6F} Nu({:1}) ={:12.6F}\n");
855 : static constexpr std::string_view Format_2230(" hg{:2} ={:15.6E} hr{:2} ={:15.6E} hs{:2} ={:15.6E}\n");
856 :
857 0 : date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
858 0 : print(OutArgumentsFile, "\n");
859 0 : print(OutArgumentsFile, Format_2000, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
860 0 : print(OutArgumentsFile, "\n");
861 :
862 0 : print(OutArgumentsFile, "\n");
863 0 : print(OutArgumentsFile, Format_2351);
864 0 : print(OutArgumentsFile, "\n");
865 0 : print(OutArgumentsFile, Format_2120, ufactor);
866 0 : print(OutArgumentsFile, "\n");
867 0 : print(OutArgumentsFile, Format_2220, hout, hin);
868 0 : print(OutArgumentsFile, "\n");
869 0 : for (i = 1; i <= nlayer - 1; ++i) {
870 0 : print(OutArgumentsFile, Format_2155, i, Ra(i), i, Nu(i));
871 : }
872 0 : print(OutArgumentsFile, "\n");
873 0 : for (i = 1; i <= nlayer - 1; ++i) {
874 0 : print(OutArgumentsFile, Format_2230, i, hg(i), i, hr(i), i, hs(i));
875 : }
876 0 : }
877 :
878 0 : void WriteTARCOGInputFile(EnergyPlusData &state,
879 : Files &files,
880 : std::string const &VerNum,
881 : Real64 const tout,
882 : Real64 const tind,
883 : Real64 const trmin,
884 : Real64 const wso,
885 : int const iwd,
886 : Real64 const wsi,
887 : Real64 const dir,
888 : Real64 const outir,
889 : int const isky,
890 : Real64 const tsky,
891 : Real64 const esky,
892 : Real64 const fclr,
893 : Real64 const VacuumPressure,
894 : Real64 const VacuumMaxGapThickness,
895 : DeflectionCalculation const CalcDeflection,
896 : Real64 const Pa,
897 : Real64 const Pini,
898 : Real64 const Tini,
899 : const Array1D_int &ibc,
900 : Real64 const hout,
901 : Real64 const hin,
902 : TARCOGGassesParams::Stdrd const standard,
903 : TARCOGThermalModel const ThermalMod,
904 : Real64 const SDScalar,
905 : Real64 const height,
906 : Real64 const heightt,
907 : Real64 const width,
908 : Real64 const tilt,
909 : Real64 const totsol,
910 : int const nlayer,
911 : const Array1D<TARCOGParams::TARCOGLayerType> &LayerType,
912 : const Array1D<Real64> &thick,
913 : const Array1D<Real64> &scon,
914 : const Array1D<Real64> &YoungsMod,
915 : const Array1D<Real64> &PoissonsRat,
916 : const Array1D<Real64> &asol,
917 : const Array1D<Real64> &tir,
918 : const Array1D<Real64> &emis,
919 : const Array1D<Real64> &Atop,
920 : const Array1D<Real64> &Abot,
921 : const Array1D<Real64> &Al,
922 : const Array1D<Real64> &Ar,
923 : const Array1D<Real64> &Ah,
924 : const Array1D_int &SupportPillar, // Shows whether or not gap have support pillar
925 : const Array1D<Real64> &PillarSpacing, // Pillar spacing for each gap (used in case there is support pillar)
926 : const Array1D<Real64> &PillarRadius, // Pillar radius for each gap (used in case there is support pillar)
927 : const Array1D<Real64> &SlatThick,
928 : const Array1D<Real64> &SlatWidth,
929 : const Array1D<Real64> &SlatAngle,
930 : const Array1D<Real64> &SlatCond,
931 : const Array1D<Real64> &SlatSpacing,
932 : const Array1D<Real64> &SlatCurve,
933 : const Array1D_int &nslice,
934 : const Array1D<Real64> &gap,
935 : const Array1D<Real64> &GapDef,
936 : const Array1D<Real64> &vvent,
937 : const Array1D<Real64> &tvent,
938 : const Array1D<Real64> &presure,
939 : const Array1D_int &nmix,
940 : Array2A_int const iprop,
941 : Array2A<Real64> const frct,
942 : Array2A<Real64> const xgcon,
943 : Array2A<Real64> const xgvis,
944 : Array2A<Real64> const xgcp,
945 : const Array1D<Real64> &xwght,
946 : const Array1D<Real64> &gama)
947 : {
948 :
949 : // Using/Aliasing
950 : using namespace TARCOGGassesParams;
951 :
952 : // Argument array dimensioning
953 0 : EP_SIZE_CHECK(ibc, 2);
954 0 : EP_SIZE_CHECK(LayerType, maxlay);
955 0 : EP_SIZE_CHECK(thick, maxlay);
956 0 : EP_SIZE_CHECK(scon, maxlay);
957 0 : EP_SIZE_CHECK(YoungsMod, maxlay);
958 0 : EP_SIZE_CHECK(PoissonsRat, maxlay);
959 0 : EP_SIZE_CHECK(asol, maxlay);
960 0 : EP_SIZE_CHECK(tir, maxlay2);
961 0 : EP_SIZE_CHECK(emis, maxlay2);
962 0 : EP_SIZE_CHECK(Atop, maxlay);
963 0 : EP_SIZE_CHECK(Abot, maxlay);
964 0 : EP_SIZE_CHECK(Al, maxlay);
965 0 : EP_SIZE_CHECK(Ar, maxlay);
966 0 : EP_SIZE_CHECK(Ah, maxlay);
967 0 : EP_SIZE_CHECK(SupportPillar, maxlay);
968 0 : EP_SIZE_CHECK(PillarSpacing, maxlay);
969 0 : EP_SIZE_CHECK(PillarRadius, maxlay);
970 0 : EP_SIZE_CHECK(SlatThick, maxlay);
971 0 : EP_SIZE_CHECK(SlatWidth, maxlay);
972 0 : EP_SIZE_CHECK(SlatAngle, maxlay);
973 0 : EP_SIZE_CHECK(SlatCond, maxlay);
974 0 : EP_SIZE_CHECK(SlatSpacing, maxlay);
975 0 : EP_SIZE_CHECK(SlatCurve, maxlay);
976 0 : EP_SIZE_CHECK(nslice, maxlay);
977 0 : EP_SIZE_CHECK(gap, maxlay);
978 0 : EP_SIZE_CHECK(GapDef, MaxGap);
979 0 : EP_SIZE_CHECK(vvent, maxlay1);
980 0 : EP_SIZE_CHECK(tvent, maxlay1);
981 0 : EP_SIZE_CHECK(presure, maxlay1);
982 0 : EP_SIZE_CHECK(nmix, maxlay1);
983 0 : iprop.dim(maxgas, maxlay1);
984 0 : frct.dim(maxgas, maxlay1);
985 0 : xgcon.dim(3, maxgas);
986 0 : xgvis.dim(3, maxgas);
987 0 : xgcp.dim(3, maxgas);
988 0 : EP_SIZE_CHECK(xwght, maxgas);
989 0 : EP_SIZE_CHECK(gama, maxgas);
990 :
991 : int i;
992 : int j;
993 : int NumOfProvGasses;
994 :
995 0 : Array1D_int DATE_TIME(8);
996 0 : Array1D_string real_CLOCK(3);
997 :
998 : // Formats
999 : static constexpr std::string_view Format_111("*\n");
1000 : static constexpr std::string_view Format_112("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
1001 : static constexpr std::string_view Format_113("*------------------------------------------------------------\n");
1002 : static constexpr std::string_view Format_200("* General options:\n");
1003 : static constexpr std::string_view Format_210(
1004 : "* <nlayer, debug, standard, ThermalMod, CalcDeflection, SDScalar, VacuumPressure, VacuumMaxGapThickness>\n");
1005 : static constexpr std::string_view Format_300("* Environmental settings:\n");
1006 : static constexpr std::string_view Format_310("* <tout, tind, wso, iwd, wsi, dir, outir, isky, tsky, esky, fclr, trmin, Pa, Pini, Tini>\n");
1007 : static constexpr std::string_view Format_400("* Overall IGU properties:\n");
1008 : static constexpr std::string_view Format_410("* <totsol, tilt, height, heightt, width>\n");
1009 : static constexpr std::string_view Format_600("* Outdoor environment:\n");
1010 : static constexpr std::string_view Format_610("* <ibc(1), hout, presure(1), 1, 1, 1.0, vvent(1), tvent(1)>\n");
1011 : static constexpr std::string_view Format_700("* IGU definition:\n");
1012 : static constexpr std::string_view Format_800("* Indoor environment:\n");
1013 : static constexpr std::string_view Format_810("* <ibc(2), hin, presure(nlayer+1), 1, 1, 1.0, vvent(nlayer+1), tvent(nlayer+1)>\n");
1014 : static constexpr std::string_view Format_900("* End file\n");
1015 : static constexpr std::string_view Format_10001("* created by TARCOG v. {}\n");
1016 : static constexpr std::string_view Format_1001("* TARCOG debug output for WinCOG, {:4}-{:02}-{:02}, {:02}:{:02}:{:02}\n");
1017 : static constexpr std::string_view Format_1002("* WindowID: {:8} - Not specified\n");
1018 : static constexpr std::string_view Format_1003("* WindowID: {:8} \n");
1019 : static constexpr std::string_view Format_1006("* IGUID: {:8} - Not specified\n");
1020 : static constexpr std::string_view Format_1007("* IGUID: {:8} \n");
1021 : static constexpr std::string_view Format_1008("* Num Layers: {:8} \n");
1022 : static constexpr std::string_view Format_1010(" {:1}, {:1}, {:1}, {:1}, {:1}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1023 : static constexpr std::string_view Format_1020(
1024 : " {:24.12F}, {:24.12F}, {:24.12F}, {:1}, {:24.12F}, {:24.12F}, {:24.12F}, {:1}, {:24.12F}, {:24.12F}, "
1025 : "{:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1026 : static constexpr std::string_view Format_1030(" {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1027 : // static constexpr std::string_view Format_1031(" {:24.12F}, {:24.12F}, {:3}, {:24.12F}, {:3}, {:3}, {:24.12F}, {:24.12F}, {:24.12F},
1028 : // {:24.12F}, "
1029 : // "{:24.12F}, {:24.12F}, {:2}, {:2}, {:2}, {:2}\n");
1030 : static constexpr std::string_view Format_1034("* <PillarSpacing(i), PillarRadius(i)\n");
1031 : static constexpr std::string_view Format_1035(" {:24.12F}, {:24.12F}\n");
1032 : static constexpr std::string_view Format_1040(" {:1}, {:24.12F}, {:24.12F}, {:1}, {:1}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1033 : static constexpr std::string_view Format_1048("* <gap(i), GapDef(i), presure(i+1), nmix(i+1), (iprop(i+1, j), j=1,nmix(i+1)), (frct(i+1, j), "
1034 : "\n\nj=1,nmix(i+1)), vvent(i), tvent(i), SupportPillar(i)>\n");
1035 : static constexpr std::string_view Format_1049("* Gap {:1}:\n");
1036 : static constexpr std::string_view Format_1050(
1037 : "* <scon(i), asol(i), thick(i), emis(2*i-1), emis(2*i), tir(2*i-1), YoungsMod(i),\n\n PoissonsRat(i), LayerType(i), nslice(i)>\n");
1038 : static constexpr std::string_view Format_1051(
1039 : " {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:1}, {:1}\n");
1040 : static constexpr std::string_view Format_1052("* <Atop(i), Abot(i), Al(i), Ar(i), Ah(i)>\n");
1041 : static constexpr std::string_view Format_1053(" {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1042 : static constexpr std::string_view Format_1054("* <SlatThick(i), SlatWidth(i), SlatAngle(i), SlatCond(i), SlatSpacing(i), SlatCurve(i)>\n");
1043 : static constexpr std::string_view Format_1055(" {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}, {:24.12F}\n");
1044 : static constexpr std::string_view Format_1060("* Layer {:1} - specular-glass:\n");
1045 : static constexpr std::string_view Format_1061("* Layer {:1} - venetian blind:\n");
1046 : static constexpr std::string_view Format_1062("* Layer {:1} - woven shade:\n");
1047 : static constexpr std::string_view Format_1063("* Layer {:1} - diffuse shade:\n");
1048 : static constexpr std::string_view Format_1064("* Layer {:1} - ???:\n");
1049 : static constexpr std::string_view Format_2000("* Gas coefficients information\n");
1050 : static constexpr std::string_view Format_2010(" {:2}\n");
1051 : static constexpr std::string_view Format_2011("* <NumberOfGasses>\n");
1052 : static constexpr std::string_view Format_2020(" {:12.6E}\n");
1053 : static constexpr std::string_view Format_2021("* <MolecularWeight>\n");
1054 : static constexpr std::string_view Format_2030(", {:12.6E}");
1055 : static constexpr std::string_view Format_2031("* <gconA, gconB, gconC>\n");
1056 : static constexpr std::string_view Format_2032("* <gvisA, gvisB, gvisC>\n");
1057 : static constexpr std::string_view Format_2033("* <gcpA, gcpB, gcpC>\n");
1058 : static constexpr std::string_view Format_2034("* <Gamma>\n");
1059 :
1060 0 : date_and_time(real_CLOCK(1), real_CLOCK(2), real_CLOCK(3), DATE_TIME);
1061 :
1062 0 : print(files.WINCogFile, Format_112);
1063 0 : print(files.WINCogFile, Format_111);
1064 0 : print(files.WINCogFile, Format_1001, DATE_TIME(1), DATE_TIME(2), DATE_TIME(3), DATE_TIME(5), DATE_TIME(6), DATE_TIME(7));
1065 0 : print(files.WINCogFile, Format_10001, VerNum); //, VerDat
1066 0 : print(files.WINCogFile, Format_111);
1067 :
1068 0 : if (state.dataTARCOGOutputs->winID == -1) {
1069 0 : print(files.WINCogFile, Format_1002, state.dataTARCOGOutputs->winID);
1070 : } else {
1071 0 : print(files.WINCogFile, Format_1003, state.dataTARCOGOutputs->winID);
1072 : }
1073 0 : if (state.dataTARCOGOutputs->iguID == -1) {
1074 0 : print(files.WINCogFile, Format_1006, state.dataTARCOGOutputs->iguID);
1075 : } else {
1076 0 : print(files.WINCogFile, Format_1007, state.dataTARCOGOutputs->iguID);
1077 : }
1078 :
1079 0 : print(files.WINCogFile, Format_1008, nlayer);
1080 0 : print(files.WINCogFile, Format_111);
1081 0 : print(files.WINCogFile, Format_112);
1082 :
1083 0 : print(files.WINCogFile, Format_113);
1084 0 : print(files.WINCogFile, Format_200);
1085 0 : print(files.WINCogFile, Format_113);
1086 0 : print(files.WINCogFile, Format_210);
1087 0 : print(files.WINCogFile, Format_1010, nlayer, 2, standard, ThermalMod, CalcDeflection, SDScalar, VacuumPressure, VacuumMaxGapThickness);
1088 :
1089 0 : print(files.WINCogFile, Format_113);
1090 0 : print(files.WINCogFile, Format_300);
1091 0 : print(files.WINCogFile, Format_113);
1092 0 : print(files.WINCogFile, Format_310);
1093 0 : print(files.WINCogFile, Format_1020, tout, tind, wso, iwd, wsi, dir, outir, isky, tsky, esky, fclr, trmin, Pa, Pini, Tini);
1094 :
1095 0 : NumOfProvGasses = 0;
1096 0 : while (xwght(NumOfProvGasses + 1) != 0) {
1097 0 : ++NumOfProvGasses;
1098 : }
1099 0 : print(files.WINCogFile, Format_113);
1100 0 : print(files.WINCogFile, Format_2000);
1101 0 : print(files.WINCogFile, Format_113);
1102 0 : print(files.WINCogFile, Format_2011);
1103 0 : print(files.WINCogFile, Format_2010, NumOfProvGasses);
1104 0 : for (i = 1; i <= NumOfProvGasses; ++i) {
1105 0 : print(files.WINCogFile, Format_2021);
1106 0 : print(files.WINCogFile, Format_2020, xwght(i));
1107 0 : print(files.WINCogFile, Format_2031);
1108 0 : for (j = 2; j <= 3; ++j) {
1109 0 : print(files.WINCogFile, Format_2030, xgcon(j, i));
1110 : }
1111 0 : print(files.WINCogFile, "\n");
1112 0 : print(files.WINCogFile, Format_2032);
1113 0 : for (j = 2; j <= 3; ++j) {
1114 0 : print(files.WINCogFile, Format_2030, xgvis(j, i));
1115 : }
1116 0 : print(files.WINCogFile, "\n");
1117 0 : print(files.WINCogFile, Format_2033);
1118 0 : for (j = 2; j <= 3; ++j) {
1119 0 : print(files.WINCogFile, Format_2030, xgcp(j, i));
1120 : }
1121 0 : print(files.WINCogFile, "\n");
1122 0 : print(files.WINCogFile, Format_2034);
1123 0 : print(files.WINCogFile, Format_2020, gama(i));
1124 : } // i = 1, NumProvGasses
1125 :
1126 0 : print(files.WINCogFile, Format_113);
1127 0 : print(files.WINCogFile, Format_400);
1128 0 : print(files.WINCogFile, Format_113);
1129 0 : print(files.WINCogFile, Format_410);
1130 0 : print(files.WINCogFile, Format_1030, totsol, tilt, height, heightt, width);
1131 :
1132 0 : print(files.WINCogFile, Format_113);
1133 0 : print(files.WINCogFile, Format_600);
1134 0 : print(files.WINCogFile, Format_113);
1135 0 : print(files.WINCogFile, Format_610);
1136 0 : print(files.WINCogFile, Format_1040, ibc(1), hout, presure(1), 1, 1, 1.0, vvent(1), tvent(1));
1137 :
1138 0 : print(files.WINCogFile, Format_700);
1139 :
1140 0 : for (i = 1; i <= nlayer; ++i) {
1141 0 : print(files.WINCogFile, Format_113);
1142 0 : if (LayerType(i) == TARCOGLayerType::SPECULAR) {
1143 0 : print(files.WINCogFile, Format_1060, i);
1144 0 : } else if (LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ || LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) {
1145 0 : print(files.WINCogFile, Format_1061, i);
1146 0 : } else if (LayerType(i) == TARCOGLayerType::WOVSHADE) {
1147 0 : print(files.WINCogFile, Format_1062, i);
1148 0 : } else if (LayerType(i) == TARCOGLayerType::DIFFSHADE) {
1149 0 : print(files.WINCogFile, Format_1063, i);
1150 : } else {
1151 0 : print(files.WINCogFile, Format_1064, i);
1152 : }
1153 0 : print(files.WINCogFile, Format_113);
1154 :
1155 0 : print(files.WINCogFile, Format_1050);
1156 0 : print(files.WINCogFile,
1157 : Format_1051,
1158 : scon(i),
1159 : asol(i),
1160 : thick(i),
1161 0 : emis(2 * i - 1),
1162 : emis(2 * i),
1163 0 : tir(2 * i - 1),
1164 : YoungsMod(i),
1165 : PoissonsRat(i),
1166 : LayerType(i),
1167 : nslice(i));
1168 :
1169 0 : if (IsShadingLayer(LayerType(i))) {
1170 0 : print(files.WINCogFile, Format_1052);
1171 0 : print(files.WINCogFile, Format_1053, Atop(i), Abot(i), Al(i), Ar(i), Ah(i));
1172 : }
1173 :
1174 0 : if (LayerType(i) == TARCOGLayerType::VENETBLIND_HORIZ || LayerType(i) == TARCOGLayerType::VENETBLIND_VERT) {
1175 0 : print(files.WINCogFile, Format_1054);
1176 0 : print(files.WINCogFile, Format_1055, SlatThick(i), SlatWidth(i), SlatAngle(i), SlatCond(i), SlatSpacing(i), SlatCurve(i));
1177 : }
1178 :
1179 0 : if (i < nlayer) {
1180 0 : print(files.WINCogFile, Format_113);
1181 0 : print(files.WINCogFile, Format_1049, i);
1182 0 : print(files.WINCogFile, Format_113);
1183 0 : print(files.WINCogFile, Format_1048);
1184 0 : print(files.WINCogFile, " {:24.12F}, {:24.12F}, {:24.12F}, {:1}, ", gap(i), GapDef(i), presure(i + 1), nmix(i + 1));
1185 0 : for (j = 1; j <= nmix(i + 1); ++j) {
1186 0 : print(files.WINCogFile, "{:1}, ", iprop(j, i + 1));
1187 : }
1188 0 : for (j = 1; j <= nmix(i + 1); ++j) {
1189 0 : print(files.WINCogFile, "{:24.12F}, ", frct(j, i + 1));
1190 : }
1191 0 : print(files.WINCogFile, " {:24.12F}, {:24.12F}, {:1}, \n", vvent(i + 1), tvent(i + 1), SupportPillar(i));
1192 0 : if (SupportPillar(i) == YES_SupportPillar) {
1193 0 : print(files.WINCogFile, Format_1034);
1194 0 : print(files.WINCogFile, Format_1035, PillarSpacing(i), PillarRadius(i));
1195 : }
1196 : }
1197 : } // i - layers
1198 :
1199 0 : print(files.WINCogFile, Format_113);
1200 0 : print(files.WINCogFile, Format_800);
1201 0 : print(files.WINCogFile, Format_113);
1202 :
1203 0 : print(files.WINCogFile, Format_810);
1204 0 : print(files.WINCogFile, Format_1040, ibc(2), hin, presure(nlayer + 1), 1, 1, 1.0, vvent(nlayer + 1), tvent(nlayer + 1));
1205 :
1206 0 : print(files.WINCogFile, Format_113);
1207 0 : print(files.WINCogFile, Format_900);
1208 0 : print(files.WINCogFile, Format_113);
1209 0 : print(files.WINCogFile, "\n");
1210 0 : }
1211 :
1212 35972 : void FinishDebugOutputFiles(Files &files, int const nperr)
1213 : {
1214 :
1215 : static constexpr std::string_view Format_2360("TARCOG status: {:3} - Normal termination.\n");
1216 : static constexpr std::string_view Format_2361("TARCOG status: {:3} - Warning!\n");
1217 : static constexpr std::string_view Format_2362("TARCOG status: {:3} - Error!\n");
1218 : static constexpr std::string_view Format_1199("##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####\n");
1219 :
1220 35972 : if (files.WriteDebugOutput) {
1221 :
1222 0 : print(files.DebugOutputFile, "\n");
1223 0 : if ((nperr > 0) && (nperr < 1000)) {
1224 0 : print(files.DebugOutputFile, Format_2362, nperr);
1225 0 : } else if ((nperr >= 1000)) {
1226 0 : print(files.DebugOutputFile, Format_2361, nperr);
1227 : } else {
1228 0 : print(files.DebugOutputFile, Format_2360, nperr);
1229 : }
1230 :
1231 0 : print(files.DebugOutputFile, "\n");
1232 0 : print(files.DebugOutputFile, Format_1199);
1233 0 : print(files.DebugOutputFile, Format_1199);
1234 :
1235 : } // debug
1236 :
1237 : // Close debug files
1238 35972 : if (files.DebugOutputFile.good()) {
1239 0 : files.DebugOutputFile.close();
1240 : }
1241 :
1242 35972 : if (files.WINCogFile.good()) {
1243 0 : files.WINCogFile.close();
1244 : }
1245 :
1246 35972 : if (files.IterationCSVFile.good()) {
1247 0 : files.IterationCSVFile.close();
1248 : }
1249 :
1250 35972 : if (files.TarcogIterationsFile.good()) {
1251 0 : files.TarcogIterationsFile.close();
1252 : }
1253 35972 : }
1254 :
1255 37990 : void PrepDebugFilesAndVariables(EnergyPlusData &state,
1256 : Files &files,
1257 : fs::path const &Debug_dir,
1258 : fs::path const &Debug_file,
1259 : [[maybe_unused]] int const Debug_mode,
1260 : int const win_ID,
1261 : int const igu_ID)
1262 : {
1263 :
1264 37990 : files.DBGD = Debug_dir;
1265 :
1266 37990 : state.dataTARCOGOutputs->winID = win_ID;
1267 37990 : state.dataTARCOGOutputs->iguID = igu_ID;
1268 :
1269 : // setup file names if file name is provided, otherwise keep default
1270 37990 : if (!Debug_file.empty()) {
1271 37990 : files.WINCogFilePath = FileSystem::appendSuffixToPath(Debug_file, ".w7");
1272 37990 : files.DebugOutputFilePath = FileSystem::appendSuffixToPath(Debug_file, ".dbg");
1273 : }
1274 :
1275 37990 : files.WriteDebugOutput = false;
1276 : // there used to be a block under here but the debug flag was hardwired to not do any reporting, so it was removed
1277 37990 : }
1278 :
1279 : } // namespace EnergyPlus::TARCOGOutput
|